diff -Nru open-vm-tools-2008.01.23-74039/aclocal.m4 open-vm-tools-2008.10.10-123053-3~ppa2/aclocal.m4 --- open-vm-tools-2008.01.23-74039/aclocal.m4 2008-01-28 08:02:58.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/aclocal.m4 2008-10-13 08:02:08.000000000 +0100 @@ -16,6405 +16,6 @@ You have another version of autoconf. If you want to use that, you should regenerate the build system entirely.], [63])]) -# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- - -# serial 48 AC_PROG_LIBTOOL - - -# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED) -# ----------------------------------------------------------- -# If this macro is not defined by Autoconf, define it here. -m4_ifdef([AC_PROVIDE_IFELSE], - [], - [m4_define([AC_PROVIDE_IFELSE], - [m4_ifdef([AC_PROVIDE_$1], - [$2], [$3])])]) - - -# AC_PROG_LIBTOOL -# --------------- -AC_DEFUN([AC_PROG_LIBTOOL], -[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl -dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX -dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX. - AC_PROVIDE_IFELSE([AC_PROG_CXX], - [AC_LIBTOOL_CXX], - [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX - ])]) -dnl And a similar setup for Fortran 77 support - AC_PROVIDE_IFELSE([AC_PROG_F77], - [AC_LIBTOOL_F77], - [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77 -])]) - -dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly. -dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run -dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both. - AC_PROVIDE_IFELSE([AC_PROG_GCJ], - [AC_LIBTOOL_GCJ], - [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], - [AC_LIBTOOL_GCJ], - [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ], - [AC_LIBTOOL_GCJ], - [ifdef([AC_PROG_GCJ], - [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])]) - ifdef([A][M_PROG_GCJ], - [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])]) - ifdef([LT_AC_PROG_GCJ], - [define([LT_AC_PROG_GCJ], - defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])]) -])])# AC_PROG_LIBTOOL - - -# _AC_PROG_LIBTOOL -# ---------------- -AC_DEFUN([_AC_PROG_LIBTOOL], -[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl -AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl -AC_BEFORE([$0],[AC_LIBTOOL_F77])dnl -AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl - -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" - -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' -AC_SUBST(LIBTOOL)dnl - -# Prevent multiple expansion -define([AC_PROG_LIBTOOL], []) -])# _AC_PROG_LIBTOOL - - -# AC_LIBTOOL_SETUP -# ---------------- -AC_DEFUN([AC_LIBTOOL_SETUP], -[AC_PREREQ(2.50)dnl -AC_REQUIRE([AC_ENABLE_SHARED])dnl -AC_REQUIRE([AC_ENABLE_STATIC])dnl -AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_PROG_LD])dnl -AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl -AC_REQUIRE([AC_PROG_NM])dnl - -AC_REQUIRE([AC_PROG_LN_S])dnl -AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl -# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! -AC_REQUIRE([AC_OBJEXT])dnl -AC_REQUIRE([AC_EXEEXT])dnl -dnl - -AC_LIBTOOL_SYS_MAX_CMD_LEN -AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE -AC_LIBTOOL_OBJDIR - -AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl -_LT_AC_PROG_ECHO_BACKSLASH - -case $host_os in -aix3*) - # AIX sometimes has problems with the GCC collect2 program. For some - # reason, if we set the COLLECT_NAMES environment variable, the problems - # vanish in a puff of smoke. - if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES - fi - ;; -esac - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed='sed -e 1s/^X//' -[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'] - -# Same as above, but do not quote variable references. -[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'] - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' - -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' - -# Constants: -rm="rm -f" - -# Global variables: -default_ofile=libtool -can_build_shared=yes - -# All known linkers require a `.a' archive for static linking (except MSVC, -# which needs '.lib'). -libext=a -ltmain="$ac_aux_dir/ltmain.sh" -ofile="$default_ofile" -with_gnu_ld="$lt_cv_prog_gnu_ld" - -AC_CHECK_TOOL(AR, ar, false) -AC_CHECK_TOOL(RANLIB, ranlib, :) -AC_CHECK_TOOL(STRIP, strip, :) - -old_CC="$CC" -old_CFLAGS="$CFLAGS" - -# Set sane defaults for various variables -test -z "$AR" && AR=ar -test -z "$AR_FLAGS" && AR_FLAGS=cru -test -z "$AS" && AS=as -test -z "$CC" && CC=cc -test -z "$LTCC" && LTCC=$CC -test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS -test -z "$DLLTOOL" && DLLTOOL=dlltool -test -z "$LD" && LD=ld -test -z "$LN_S" && LN_S="ln -s" -test -z "$MAGIC_CMD" && MAGIC_CMD=file -test -z "$NM" && NM=nm -test -z "$SED" && SED=sed -test -z "$OBJDUMP" && OBJDUMP=objdump -test -z "$RANLIB" && RANLIB=: -test -z "$STRIP" && STRIP=: -test -z "$ac_objext" && ac_objext=o - -# Determine commands to create old-style static archives. -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' -old_postinstall_cmds='chmod 644 $oldlib' -old_postuninstall_cmds= - -if test -n "$RANLIB"; then - case $host_os in - openbsd*) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" - ;; - *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" - ;; - esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" -fi - -_LT_CC_BASENAME([$compiler]) - -# Only perform the check for file, if the check method requires it -case $deplibs_check_method in -file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - AC_PATH_MAGIC - fi - ;; -esac - -AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no) -AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], -enable_win32_dll=yes, enable_win32_dll=no) - -AC_ARG_ENABLE([libtool-lock], - [AC_HELP_STRING([--disable-libtool-lock], - [avoid locking (might break parallel builds)])]) -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes - -AC_ARG_WITH([pic], - [AC_HELP_STRING([--with-pic], - [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], - [pic_mode="$withval"], - [pic_mode=default]) -test -z "$pic_mode" && pic_mode=default - -# Use C for the default configuration in the libtool script -tagname= -AC_LIBTOOL_LANG_C_CONFIG -_LT_AC_TAGCONFIG -])# AC_LIBTOOL_SETUP - - -# _LT_AC_SYS_COMPILER -# ------------------- -AC_DEFUN([_LT_AC_SYS_COMPILER], -[AC_REQUIRE([AC_PROG_CC])dnl - -# 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 -])# _LT_AC_SYS_COMPILER - - -# _LT_CC_BASENAME(CC) -# ------------------- -# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. -AC_DEFUN([_LT_CC_BASENAME], -[for cc_temp in $1""; do - case $cc_temp in - compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; - distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` -]) - - -# _LT_COMPILER_BOILERPLATE -# ------------------------ -# Check for compiler boilerplate output or warnings with -# the simple compiler test code. -AC_DEFUN([_LT_COMPILER_BOILERPLATE], -[ac_outfile=conftest.$ac_objext -printf "$lt_simple_compile_test_code" >conftest.$ac_ext -eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_compiler_boilerplate=`cat conftest.err` -$rm conftest* -])# _LT_COMPILER_BOILERPLATE - - -# _LT_LINKER_BOILERPLATE -# ---------------------- -# Check for linker boilerplate output or warnings with -# the simple link test code. -AC_DEFUN([_LT_LINKER_BOILERPLATE], -[ac_outfile=conftest.$ac_objext -printf "$lt_simple_link_test_code" >conftest.$ac_ext -eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_linker_boilerplate=`cat conftest.err` -$rm conftest* -])# _LT_LINKER_BOILERPLATE - - -# _LT_AC_SYS_LIBPATH_AIX -# ---------------------- -# Links a minimal program and checks the executable -# for the system default hardcoded library path. In most cases, -# this is /usr/lib:/lib, but when the MPI compilers are used -# the location of the communication and MPI libs are included too. -# If we don't find anything, use the default library path according -# to the aix ld manual. -AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX], -[AC_LINK_IFELSE(AC_LANG_PROGRAM,[ -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi],[]) -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi -])# _LT_AC_SYS_LIBPATH_AIX - - -# _LT_AC_SHELL_INIT(ARG) -# ---------------------- -AC_DEFUN([_LT_AC_SHELL_INIT], -[ifdef([AC_DIVERSION_NOTICE], - [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], - [AC_DIVERT_PUSH(NOTICE)]) -$1 -AC_DIVERT_POP -])# _LT_AC_SHELL_INIT - - -# _LT_AC_PROG_ECHO_BACKSLASH -# -------------------------- -# Add some code to the start of the generated configure script which -# will find an echo command which doesn't interpret backslashes. -AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH], -[_LT_AC_SHELL_INIT([ -# Check that we are running under the correct shell. -SHELL=${CONFIG_SHELL-/bin/sh} - -case X$ECHO in -X*--fallback-echo) - # Remove one level of quotation (which was required for Make). - ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` - ;; -esac - -echo=${ECHO-echo} -if test "X[$]1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X[$]1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then - # Yippee, $echo works! - : -else - # Restart under the correct shell. - exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} -fi - -if test "X[$]1" = X--fallback-echo; then - # used as fallback echo - shift - cat </dev/null 2>&1 && unset CDPATH - -if test -z "$ECHO"; then -if test "X${echo_test_string+set}" != Xset; then -# find a string as large as possible, as long as the shell can cope with it - for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do - # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... - if (echo_test_string=`eval $cmd`) 2>/dev/null && - echo_test_string=`eval $cmd` && - (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null - then - break - fi - done -fi - -if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - : -else - # The Solaris, AIX, and Digital Unix default echo programs unquote - # backslashes. This makes it impossible to quote backslashes using - # echo "$something" | sed 's/\\/\\\\/g' - # - # So, first we look for a working echo in the user's PATH. - - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for dir in $PATH /usr/ucb; do - IFS="$lt_save_ifs" - if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && - test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - echo="$dir/echo" - break - fi - done - IFS="$lt_save_ifs" - - if test "X$echo" = Xecho; then - # We didn't find a better echo, so look for alternatives. - if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # This shell has a builtin print -r that does the trick. - echo='print -r' - elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && - test "X$CONFIG_SHELL" != X/bin/ksh; then - # If we have ksh, try running configure again with it. - ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} - export ORIGINAL_CONFIG_SHELL - CONFIG_SHELL=/bin/ksh - export CONFIG_SHELL - exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} - else - # Try using printf. - echo='printf %s\n' - if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # Cool, printf works - : - elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL - export CONFIG_SHELL - SHELL="$CONFIG_SHELL" - export SHELL - echo="$CONFIG_SHELL [$]0 --fallback-echo" - elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - echo="$CONFIG_SHELL [$]0 --fallback-echo" - else - # maybe with a smaller string... - prev=: - - for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do - if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null - then - break - fi - prev="$cmd" - done - - if test "$prev" != 'sed 50q "[$]0"'; then - echo_test_string=`eval $prev` - export echo_test_string - exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} - else - # Oops. We lost completely, so just stick with echo. - echo=echo - fi - fi - fi - fi -fi -fi - -# Copy echo and quote the copy suitably for passing to libtool from -# the Makefile, instead of quoting the original, which is used later. -ECHO=$echo -if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then - ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" -fi - -AC_SUBST(ECHO) -])])# _LT_AC_PROG_ECHO_BACKSLASH - - -# _LT_AC_LOCK -# ----------- -AC_DEFUN([_LT_AC_LOCK], -[AC_ARG_ENABLE([libtool-lock], - [AC_HELP_STRING([--disable-libtool-lock], - [avoid locking (might break parallel builds)])]) -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 AC_TRY_EVAL(ac_compile); 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 __oline__ "configure"' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - if test "$lt_cv_prog_gnu_ld" = yes; then - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -melf32bsmip" - ;; - *N32*) - LD="${LD-ld} -melf32bmipn32" - ;; - *64-bit*) - LD="${LD-ld} -melf64bmip" - ;; - esac - else - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -32" - ;; - *N32*) - LD="${LD-ld} -n32" - ;; - *64-bit*) - LD="${LD-ld} -64" - ;; - esac - fi - fi - rm -rf conftest* - ;; - -x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.o` in - *32-bit*) - case $host in - x86_64-*linux*) - LD="${LD-ld} -m elf_i386" - ;; - ppc64-*linux*|powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" - ;; - s390x-*linux*) - LD="${LD-ld} -m elf_s390" - ;; - sparc64-*linux*) - LD="${LD-ld} -m elf32_sparc" - ;; - esac - ;; - *64-bit*) - case $host in - x86_64-*linux*) - LD="${LD-ld} -m elf_x86_64" - ;; - ppc*-*linux*|powerpc*-*linux*) - LD="${LD-ld} -m elf64ppc" - ;; - s390*-*linux*) - LD="${LD-ld} -m elf64_s390" - ;; - sparc*-*linux*) - LD="${LD-ld} -m elf64_sparc" - ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; - -*-*-sco3.2v5*) - # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -belf" - AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, - [AC_LANG_PUSH(C) - AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) - AC_LANG_POP]) - if test x"$lt_cv_cc_needs_belf" != x"yes"; then - # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf - CFLAGS="$SAVE_CFLAGS" - fi - ;; -sparc*-*solaris*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.o` in - *64-bit*) - case $lt_cv_prog_gnu_ld in - yes*) LD="${LD-ld} -m elf64_sparc" ;; - *) LD="${LD-ld} -64" ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; - -AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL], -[*-*-cygwin* | *-*-mingw* | *-*-pw32*) - AC_CHECK_TOOL(DLLTOOL, dlltool, false) - AC_CHECK_TOOL(AS, as, false) - AC_CHECK_TOOL(OBJDUMP, objdump, false) - ;; - ]) -esac - -need_locks="$enable_libtool_lock" - -])# _LT_AC_LOCK - - -# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, -# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) -# ---------------------------------------------------------------- -# Check whether the given compiler option works -AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], -[AC_REQUIRE([LT_AC_PROG_SED]) -AC_CACHE_CHECK([$1], [$2], - [$2=no - ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) - printf "$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:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:__oline__: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - $2=yes - fi - fi - $rm conftest* -]) - -if test x"[$]$2" = xyes; then - ifelse([$5], , :, [$5]) -else - ifelse([$6], , :, [$6]) -fi -])# AC_LIBTOOL_COMPILER_OPTION - - -# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, -# [ACTION-SUCCESS], [ACTION-FAILURE]) -# ------------------------------------------------------------ -# Check whether the given compiler option works -AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], -[AC_CACHE_CHECK([$1], [$2], - [$2=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $3" - printf "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The linker can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&AS_MESSAGE_LOG_FD - $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - $2=yes - fi - else - $2=yes - fi - fi - $rm conftest* - LDFLAGS="$save_LDFLAGS" -]) - -if test x"[$]$2" = xyes; then - ifelse([$4], , :, [$4]) -else - ifelse([$5], , :, [$5]) -fi -])# AC_LIBTOOL_LINKER_OPTION - - -# AC_LIBTOOL_SYS_MAX_CMD_LEN -# -------------------------- -AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], -[# 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*) - # On Win9x/ME, this test blows up -- it succeeds, but takes - # about 5 minutes as the teststring grows exponentially. - # Worse, since 9x/ME are not pre-emptively multitasking, - # you end up with a "frozen" computer, even though with patience - # the test eventually succeeds (with a max line length of 256k). - # Instead, let's just punt: use the minimum linelength reported by - # all of the supported platforms: 8192 (on NT/2K/XP). - lt_cv_sys_max_cmd_len=8192; - ;; - - amigaos*) - # On AmigaOS with pdksh, this test takes hours, literally. - # So we just punt and use a minimum line length of 8192. - lt_cv_sys_max_cmd_len=8192; - ;; - - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) - # This has been around since 386BSD, at least. Likely further. - if test -x /sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` - elif test -x /usr/sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` - else - lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs - fi - # And add a safety zone - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - ;; - - interix*) - # We know the value 262144 and hardcode it with a safety zone (like BSD) - lt_cv_sys_max_cmd_len=196608 - ;; - - osf*) - # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure - # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not - # nice to cause kernel panics so lets avoid the loop below. - # First set a reasonable default. - lt_cv_sys_max_cmd_len=16384 - # - if test -x /sbin/sysconfig; then - case `/sbin/sysconfig -q proc exec_disable_arg_limit` in - *1*) lt_cv_sys_max_cmd_len=-1 ;; - esac - fi - ;; - sco3.2v5*) - lt_cv_sys_max_cmd_len=102400 - ;; - sysv5* | sco5v6* | sysv4.2uw2*) - kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` - if test -n "$kargmax"; then - lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` - else - lt_cv_sys_max_cmd_len=32768 - fi - ;; - *) - # If test is not a shell built-in, we'll probably end up computing a - # maximum length that is only half of the actual maximum length, but - # we can't tell. - SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} - while (test "X"`$SHELL [$]0 --fallback-echo "X$teststring" 2>/dev/null` \ - = "XX$teststring") >/dev/null 2>&1 && - new_result=`expr "X$teststring" : ".*" 2>&1` && - lt_cv_sys_max_cmd_len=$new_result && - test $i != 17 # 1/2 MB should be enough - do - i=`expr $i + 1` - teststring=$teststring$teststring - done - teststring= - # Add a significant safety factor because C++ compilers can tack on massive - # amounts of additional arguments before passing them to the linker. - # It appears as though 1/2 is a usable value. - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` - ;; - esac -]) -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 -])# AC_LIBTOOL_SYS_MAX_CMD_LEN - - -# _LT_AC_CHECK_DLFCN -# ------------------ -AC_DEFUN([_LT_AC_CHECK_DLFCN], -[AC_CHECK_HEADERS(dlfcn.h)dnl -])# _LT_AC_CHECK_DLFCN - - -# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, -# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) -# --------------------------------------------------------------------- -AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF], -[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl -if test "$cross_compiling" = yes; then : - [$4] -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext < -#endif - -#include - -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif - -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -#ifdef __cplusplus -extern "C" void exit (int); -#endif - -void fnord() { int i=42;} -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - /* dlclose (self); */ - } - else - puts (dlerror ()); - - exit (status); -}] -EOF - if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) $1 ;; - x$lt_dlneed_uscore) $2 ;; - x$lt_dlunknown|x*) $3 ;; - esac - else : - # compilation failed - $3 - fi -fi -rm -fr conftest* -])# _LT_AC_TRY_DLOPEN_SELF - - -# AC_LIBTOOL_DLOPEN_SELF -# ---------------------- -AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], -[AC_REQUIRE([_LT_AC_CHECK_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*) - 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="-dld"], - [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="-dld"]) - ]) - ]) - ]) - ]) - ]) - ;; - 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_AC_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_AC_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 -])# AC_LIBTOOL_DLOPEN_SELF - - -# AC_LIBTOOL_PROG_CC_C_O([TAGNAME]) -# --------------------------------- -# Check to see if options -c and -o are simultaneously supported by compiler -AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O], -[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl -AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], - [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)], - [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no - $rm -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&AS_MESSAGE_LOG_FD - echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp - $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then - _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes - fi - fi - chmod u+w . 2>&AS_MESSAGE_LOG_FD - $rm conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files - $rm out/* && rmdir out - cd .. - rmdir conftest - $rm conftest* -]) -])# AC_LIBTOOL_PROG_CC_C_O - - -# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME]) -# ----------------------------------------- -# Check to see if we can do hard links to lock some files if needed -AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], -[AC_REQUIRE([_LT_AC_LOCK])dnl - -hard_links="nottested" -if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - AC_MSG_CHECKING([if we can lock with hard links]) - 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 - AC_MSG_RESULT([$hard_links]) - if test "$hard_links" = no; then - AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) - need_locks=warn - fi -else - need_locks=no -fi -])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS - - -# AC_LIBTOOL_OBJDIR -# ----------------- -AC_DEFUN([AC_LIBTOOL_OBJDIR], -[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], -[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]) -objdir=$lt_cv_objdir -])# AC_LIBTOOL_OBJDIR - - -# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME]) -# ---------------------------------------------- -# Check hardcoding attributes. -AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], -[AC_MSG_CHECKING([how to hardcode library paths into programs]) -_LT_AC_TAGVAR(hardcode_action, $1)= -if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \ - test -n "$_LT_AC_TAGVAR(runpath_var, $1)" || \ - test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then - - # We can hardcode non-existant directories. - if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no && - test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then - # Linking always hardcodes the temporary library directory. - _LT_AC_TAGVAR(hardcode_action, $1)=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - _LT_AC_TAGVAR(hardcode_action, $1)=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - _LT_AC_TAGVAR(hardcode_action, $1)=unsupported -fi -AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)]) - -if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi -])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH - - -# AC_LIBTOOL_SYS_LIB_STRIP -# ------------------------ -AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP], -[striplib= -old_striplib= -AC_MSG_CHECKING([whether stripping libraries is possible]) -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" - AC_MSG_RESULT([yes]) -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" - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) -fi - ;; - *) - AC_MSG_RESULT([no]) - ;; - esac -fi -])# AC_LIBTOOL_SYS_LIB_STRIP - - -# AC_LIBTOOL_SYS_DYNAMIC_LINKER -# ----------------------------- -# PORTME Fill in your ld.so characteristics -AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER], -[AC_MSG_CHECKING([dynamic linker characteristics]) -library_names_spec= -libname_spec='lib$name' -soname_spec= -shrext_cmds=".so" -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi -need_lib_prefix=unknown -hardcode_into_libs=no - -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown - -case $host_os in -aix3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' - shlibpath_var=LIBPATH - - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' - ;; - -aix4* | aix5*) - version_type=linux - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test "$host_cpu" = ia64; then - # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - aix4 | aix4.[[01]] | aix4.[[01]].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; - esac - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then - # If using run time linking (on AIX 4.2 or later) use lib.so - # instead of lib.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - else - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}${shared_ext}$major' - fi - shlibpath_var=LIBPATH - fi - ;; - -amigaos*) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' - ;; - -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi[[45]]*) - version_type=linux - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; - -cygwin* | mingw* | pw32*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no - - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32*) - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname~ - chmod a+x \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $rm \$dlpath' - shlibpath_overrides_runpath=yes - - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" - ;; - mingw*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' - ;; - esac - ;; - - *) - library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' - ;; - esac - dynamic_linker='Win32 ld.exe' - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; - -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' - soname_spec='${libname}${release}${major}$shared_ext' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' - # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. - if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` - else - sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' - fi - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -freebsd1*) - dynamic_linker=no - ;; - -kfreebsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='GNU ld.so' - ;; - -freebsd* | dragonfly*) - # DragonFly does not have aout. When/if they implement a new - # versioning mechanism, adjust this. - if test -x /usr/bin/objformat; then - objformat=`/usr/bin/objformat` - else - case $host_os in - freebsd[[123]]*) objformat=aout ;; - *) objformat=elf ;; - esac - fi - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2*) - shlibpath_overrides_runpath=yes - ;; - freebsd3.[[01]]* | freebsdelf3.[[01]]*) - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ - freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - freebsd*) # from 4.6 on - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - esac - ;; - -gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - hardcode_into_libs=yes - ;; - -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - version_type=sunos - need_lib_prefix=no - need_version=no - case $host_cpu in - ia64*) - shrext_cmds='.so' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.so" - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - if test "X$HPUX_IA64_MODE" = X32; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - hppa*64*) - shrext_cmds='.sl' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.sl" - shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - *) - shrext_cmds='.sl' - dynamic_linker="$host_os dld.sl" - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - ;; - esac - # HP-UX runs *really* slowly unless shared libraries are mode 555. - postinstall_cmds='chmod 555 $lib' - ;; - -interix3*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -irix5* | irix6* | nonstopux*) - case $host_os in - nonstopux*) version_type=nonstopux ;; - *) - if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux - else - version_type=irix - fi ;; - esac - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' - case $host_os in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" - hardcode_into_libs=yes - ;; - -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no - ;; - -# This must be Linux ELF. -linux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - - # find out which ABI we are using - libsuff= - case "$host_cpu" in - x86_64*|s390x*|powerpc64*) - echo '[#]line __oline__ "configure"' > conftest.$ac_ext - if AC_TRY_EVAL(ac_compile); then - case `/usr/bin/file conftest.$ac_objext` in - *64-bit*) - libsuff=64 - sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" - ;; - esac - fi - rm -rf conftest* - ;; - esac - - # Append ld.so.conf contents to the search path - if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" - fi - - # We used to test for /lib/ld.so.1 and disable shared libraries on - # powerpc, because MkLinux only supported shared libraries with the - # GNU dynamic linker. Since this was broken with cross compilers, - # most powerpc-linux boxes support dynamic linking these days and - # people can always --disable-shared, the test was removed, and we - # assume the GNU/Linux dynamic linker is in use. - dynamic_linker='GNU/Linux ld.so' - ;; - -knetbsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='GNU ld.so' - ;; - -netbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - -newsos6) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -nto-qnx*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -openbsd*) - version_type=sunos - sys_lib_dlsearch_path_spec="/usr/lib" - need_lib_prefix=no - # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. - case $host_os in - openbsd3.3 | openbsd3.3.*) need_version=yes ;; - *) need_version=no ;; - esac - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - case $host_os in - openbsd2.[[89]] | openbsd2.[[89]].*) - shlibpath_overrides_runpath=no - ;; - *) - shlibpath_overrides_runpath=yes - ;; - esac - else - shlibpath_overrides_runpath=yes - fi - ;; - -os2*) - libname_spec='$name' - shrext_cmds=".dll" - need_lib_prefix=no - library_names_spec='$libname${shared_ext} $libname.a' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH - ;; - -osf3* | osf4* | osf5*) - version_type=osf - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" - ;; - -solaris*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; - -sunos4*) - version_type=sunos - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - if test "$with_gnu_ld" = yes; then - need_lib_prefix=no - fi - need_version=yes - ;; - -sysv4 | sysv4.3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - export_dynamic_flag_spec='${wl}-Blargedynsym' - runpath_var=LD_RUN_PATH - ;; - siemens) - need_lib_prefix=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; - -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux - library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - version_type=freebsd-elf - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - hardcode_into_libs=yes - if test "$with_gnu_ld" = yes; then - sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' - shlibpath_overrides_runpath=no - else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - shlibpath_overrides_runpath=yes - case $host_os in - sco3.2v5*) - sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" - ;; - esac - fi - sys_lib_dlsearch_path_spec='/usr/lib' - ;; - -uts4*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -*) - dynamic_linker=no - ;; -esac -AC_MSG_RESULT([$dynamic_linker]) -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 -])# AC_LIBTOOL_SYS_DYNAMIC_LINKER - - -# _LT_AC_TAGCONFIG -# ---------------- -AC_DEFUN([_LT_AC_TAGCONFIG], -[AC_ARG_WITH([tags], - [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@], - [include additional configurations @<:@automatic@:>@])], - [tagnames="$withval"]) - -if test -f "$ltmain" && test -n "$tagnames"; then - if test ! -f "${ofile}"; then - AC_MSG_WARN([output file `$ofile' does not exist]) - fi - - if test -z "$LTCC"; then - eval "`$SHELL ${ofile} --config | grep '^LTCC='`" - if test -z "$LTCC"; then - AC_MSG_WARN([output file `$ofile' does not look like a libtool script]) - else - AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile']) - fi - fi - if test -z "$LTCFLAGS"; then - eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" - fi - - # Extract list of available tagged configurations in $ofile. - # Note that this assumes the entire list is on one line. - available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` - - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for tagname in $tagnames; do - IFS="$lt_save_ifs" - # Check whether tagname contains only valid characters - case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in - "") ;; - *) AC_MSG_ERROR([invalid tag name: $tagname]) - ;; - esac - - if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null - then - AC_MSG_ERROR([tag name \"$tagname\" already exists]) - fi - - # Update the list of available tags. - if test -n "$tagname"; then - echo appending configuration tag \"$tagname\" to $ofile - - case $tagname in - CXX) - if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then - AC_LIBTOOL_LANG_CXX_CONFIG - else - tagname="" - fi - ;; - - F77) - if test -n "$F77" && test "X$F77" != "Xno"; then - AC_LIBTOOL_LANG_F77_CONFIG - else - tagname="" - fi - ;; - - GCJ) - if test -n "$GCJ" && test "X$GCJ" != "Xno"; then - AC_LIBTOOL_LANG_GCJ_CONFIG - else - tagname="" - fi - ;; - - RC) - AC_LIBTOOL_LANG_RC_CONFIG - ;; - - *) - AC_MSG_ERROR([Unsupported tag name: $tagname]) - ;; - esac - - # Append the new tag name to the list of available tags. - if test -n "$tagname" ; then - available_tags="$available_tags $tagname" - fi - fi - done - IFS="$lt_save_ifs" - - # Now substitute the updated list of available tags. - if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then - mv "${ofile}T" "$ofile" - chmod +x "$ofile" - else - rm -f "${ofile}T" - AC_MSG_ERROR([unable to update list of available tagged configurations.]) - fi -fi -])# _LT_AC_TAGCONFIG - - -# AC_LIBTOOL_DLOPEN -# ----------------- -# enable checks for dlopen support -AC_DEFUN([AC_LIBTOOL_DLOPEN], - [AC_BEFORE([$0],[AC_LIBTOOL_SETUP]) -])# AC_LIBTOOL_DLOPEN - - -# AC_LIBTOOL_WIN32_DLL -# -------------------- -# declare package support for building win32 DLLs -AC_DEFUN([AC_LIBTOOL_WIN32_DLL], -[AC_BEFORE([$0], [AC_LIBTOOL_SETUP]) -])# AC_LIBTOOL_WIN32_DLL - - -# AC_ENABLE_SHARED([DEFAULT]) -# --------------------------- -# implement the --enable-shared flag -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -AC_DEFUN([AC_ENABLE_SHARED], -[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE([shared], - [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@], - [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])], - [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], - [enable_shared=]AC_ENABLE_SHARED_DEFAULT) -])# AC_ENABLE_SHARED - - -# AC_DISABLE_SHARED -# ----------------- -# set the default shared flag to --disable-shared -AC_DEFUN([AC_DISABLE_SHARED], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_SHARED(no) -])# AC_DISABLE_SHARED - - -# AC_ENABLE_STATIC([DEFAULT]) -# --------------------------- -# implement the --enable-static flag -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -AC_DEFUN([AC_ENABLE_STATIC], -[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE([static], - [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@], - [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])], - [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], - [enable_static=]AC_ENABLE_STATIC_DEFAULT) -])# AC_ENABLE_STATIC - - -# AC_DISABLE_STATIC -# ----------------- -# set the default static flag to --disable-static -AC_DEFUN([AC_DISABLE_STATIC], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_STATIC(no) -])# AC_DISABLE_STATIC - - -# AC_ENABLE_FAST_INSTALL([DEFAULT]) -# --------------------------------- -# implement the --enable-fast-install flag -# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. -AC_DEFUN([AC_ENABLE_FAST_INSTALL], -[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl -AC_ARG_ENABLE([fast-install], - [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], - [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], - [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], - [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT) -])# AC_ENABLE_FAST_INSTALL - - -# AC_DISABLE_FAST_INSTALL -# ----------------------- -# set the default to --disable-fast-install -AC_DEFUN([AC_DISABLE_FAST_INSTALL], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -AC_ENABLE_FAST_INSTALL(no) -])# AC_DISABLE_FAST_INSTALL - - -# AC_LIBTOOL_PICMODE([MODE]) -# -------------------------- -# implement the --with-pic flag -# MODE is either `yes' or `no'. If omitted, it defaults to `both'. -AC_DEFUN([AC_LIBTOOL_PICMODE], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl -pic_mode=ifelse($#,1,$1,default) -])# AC_LIBTOOL_PICMODE - - -# AC_PROG_EGREP -# ------------- -# This is predefined starting with Autoconf 2.54, so this conditional -# definition can be removed once we require Autoconf 2.54 or later. -m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP], -[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep], - [if echo a | (grep -E '(a|b)') >/dev/null 2>&1 - then ac_cv_prog_egrep='grep -E' - else ac_cv_prog_egrep='egrep' - fi]) - EGREP=$ac_cv_prog_egrep - AC_SUBST([EGREP]) -])]) - - -# AC_PATH_TOOL_PREFIX -# ------------------- -# find a file program which can recognise shared library -AC_DEFUN([AC_PATH_TOOL_PREFIX], -[AC_REQUIRE([AC_PROG_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="ifelse([$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 <&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org - -EOF - fi ;; - esac - fi - break - fi - done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" - ;; -esac]) -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - AC_MSG_RESULT($MAGIC_CMD) -else - AC_MSG_RESULT(no) -fi -])# AC_PATH_TOOL_PREFIX - - -# AC_PATH_MAGIC -# ------------- -# find a file program which can recognise a shared library -AC_DEFUN([AC_PATH_MAGIC], -[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) -if test -z "$lt_cv_path_MAGIC_CMD"; then - if test -n "$ac_tool_prefix"; then - AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) - else - MAGIC_CMD=: - fi -fi -])# AC_PATH_MAGIC - - -# AC_PROG_LD -# ---------- -# find the pathname to the GNU or non-GNU linker -AC_DEFUN([AC_PROG_LD], -[AC_ARG_WITH([gnu-ld], - [AC_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]) -AC_REQUIRE([LT_AC_PROG_SED])dnl -AC_REQUIRE([AC_PROG_CC])dnl -AC_REQUIRE([AC_CANONICAL_HOST])dnl -AC_REQUIRE([AC_CANONICAL_BUILD])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 /dev/null; then - case $host_cpu in - i*86 ) - # Not sure whether the presence of OpenBSD here was a mistake. - # Let's accept both of them until this is cleared up. - lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` - ;; - esac - else - lt_cv_deplibs_check_method=pass_all - fi - ;; - -gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - -hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=/usr/bin/file - case $host_cpu in - ia64*) - lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' - lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so - ;; - hppa*64*) - [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] - lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl - ;; - *) - lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' - lt_cv_file_magic_test_file=/usr/lib/libc.sl - ;; - esac - ;; - -interix3*) - # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' - ;; - -irix5* | irix6* | nonstopux*) - case $LD in - *-32|*"-32 ") libmagic=32-bit;; - *-n32|*"-n32 ") libmagic=N32;; - *-64|*"-64 ") libmagic=64-bit;; - *) libmagic=never-match;; - esac - lt_cv_deplibs_check_method=pass_all - ;; - -# This must be Linux ELF. -linux*) - lt_cv_deplibs_check_method=pass_all - ;; - -netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' - fi - ;; - -newos6*) - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/libnls.so - ;; - -nto-qnx*) - lt_cv_deplibs_check_method=unknown - ;; - -openbsd*) - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' - fi - ;; - -osf3* | osf4* | osf5*) - lt_cv_deplibs_check_method=pass_all - ;; - -solaris*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv4 | sysv4.3*) - case $host_vendor in - motorola) - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` - ;; - ncr) - lt_cv_deplibs_check_method=pass_all - ;; - sequent) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' - ;; - sni) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" - lt_cv_file_magic_test_file=/lib/libc.so - ;; - siemens) - lt_cv_deplibs_check_method=pass_all - ;; - pc) - lt_cv_deplibs_check_method=pass_all - ;; - esac - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - lt_cv_deplibs_check_method=pass_all - ;; -esac -]) -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 -])# AC_DEPLIBS_CHECK_METHOD - - -# AC_PROG_NM -# ---------- -# find the pathname to a BSD-compatible name lister -AC_DEFUN([AC_PROG_NM], -[AC_CACHE_CHECK([for BSD-compatible nm], lt_cv_path_NM, -[if test -n "$NM"; then - # Let the user override the test. - lt_cv_path_NM="$NM" -else - lt_nm_to_check="${ac_tool_prefix}nm" - if test -n "$ac_tool_prefix" && test "$build" = "$host"; then - lt_nm_to_check="$lt_nm_to_check nm" - fi - for lt_tmp_nm in $lt_nm_to_check; do - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - tmp_nm="$ac_dir/$lt_tmp_nm" - if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then - # Check to see if the nm accepts a BSD-compat flag. - # Adding the `sed 1q' prevents false positives on HP-UX, which says: - # nm: unknown option "B" ignored - # Tru64's nm complains that /dev/null is an invalid object file - case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in - */dev/null* | *'Invalid file or object type'*) - lt_cv_path_NM="$tmp_nm -B" - break - ;; - *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in - */dev/null*) - lt_cv_path_NM="$tmp_nm -p" - break - ;; - *) - lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but - continue # so that we can try to find one that supports BSD flags - ;; - esac - ;; - esac - fi - done - IFS="$lt_save_ifs" - done - test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm -fi]) -NM="$lt_cv_path_NM" -])# AC_PROG_NM - - -# AC_CHECK_LIBM -# ------------- -# check for math library -AC_DEFUN([AC_CHECK_LIBM], -[AC_REQUIRE([AC_CANONICAL_HOST])dnl -LIBM= -case $host in -*-*-beos* | *-*-cygwin* | *-*-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_CHECK_LIBM - - -# AC_LIBLTDL_CONVENIENCE([DIRECTORY]) -# ----------------------------------- -# sets LIBLTDL to the link flags for the libltdl convenience library and -# LTDLINCL to the include flags for the libltdl header and adds -# --enable-ltdl-convenience to the configure arguments. Note that -# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, -# it is assumed to be `libltdl'. LIBLTDL will be prefixed with -# '${top_builddir}/' and LTDLINCL will be prefixed with '${top_srcdir}/' -# (note the single quotes!). If your package is not flat and you're not -# using automake, define top_builddir and top_srcdir appropriately in -# the Makefiles. -AC_DEFUN([AC_LIBLTDL_CONVENIENCE], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl - case $enable_ltdl_convenience in - no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; - "") enable_ltdl_convenience=yes - ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; - esac - LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la - LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) - # For backwards non-gettext consistent compatibility... - INCLTDL="$LTDLINCL" -])# AC_LIBLTDL_CONVENIENCE - - -# AC_LIBLTDL_INSTALLABLE([DIRECTORY]) -# ----------------------------------- -# sets LIBLTDL to the link flags for the libltdl installable library and -# LTDLINCL to the include flags for the libltdl header and adds -# --enable-ltdl-install to the configure arguments. Note that -# AC_CONFIG_SUBDIRS is not called here. If DIRECTORY is not provided, -# and an installed libltdl is not found, it is assumed to be `libltdl'. -# LIBLTDL will be prefixed with '${top_builddir}/'# and LTDLINCL with -# '${top_srcdir}/' (note the single quotes!). If your package is not -# flat and you're not using automake, define top_builddir and top_srcdir -# appropriately in the Makefiles. -# In the future, this macro may have to be called after AC_PROG_LIBTOOL. -AC_DEFUN([AC_LIBLTDL_INSTALLABLE], -[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl - AC_CHECK_LIB(ltdl, lt_dlinit, - [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], - [if test x"$enable_ltdl_install" = xno; then - AC_MSG_WARN([libltdl not installed, but installation disabled]) - else - enable_ltdl_install=yes - fi - ]) - if test x"$enable_ltdl_install" = x"yes"; then - ac_configure_args="$ac_configure_args --enable-ltdl-install" - LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la - LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) - else - ac_configure_args="$ac_configure_args --enable-ltdl-install=no" - LIBLTDL="-lltdl" - LTDLINCL= - fi - # For backwards non-gettext consistent compatibility... - INCLTDL="$LTDLINCL" -])# AC_LIBLTDL_INSTALLABLE - - -# AC_LIBTOOL_CXX -# -------------- -# enable support for C++ libraries -AC_DEFUN([AC_LIBTOOL_CXX], -[AC_REQUIRE([_LT_AC_LANG_CXX]) -])# AC_LIBTOOL_CXX - - -# _LT_AC_LANG_CXX -# --------------- -AC_DEFUN([_LT_AC_LANG_CXX], -[AC_REQUIRE([AC_PROG_CXX]) -AC_REQUIRE([_LT_AC_PROG_CXXCPP]) -_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX]) -])# _LT_AC_LANG_CXX - -# _LT_AC_PROG_CXXCPP -# ------------------ -AC_DEFUN([_LT_AC_PROG_CXXCPP], -[ -AC_REQUIRE([AC_PROG_CXX]) -if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then - AC_PROG_CXXCPP -fi -])# _LT_AC_PROG_CXXCPP - -# AC_LIBTOOL_F77 -# -------------- -# enable support for Fortran 77 libraries -AC_DEFUN([AC_LIBTOOL_F77], -[AC_REQUIRE([_LT_AC_LANG_F77]) -])# AC_LIBTOOL_F77 - - -# _LT_AC_LANG_F77 -# --------------- -AC_DEFUN([_LT_AC_LANG_F77], -[AC_REQUIRE([AC_PROG_F77]) -_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77]) -])# _LT_AC_LANG_F77 - - -# AC_LIBTOOL_GCJ -# -------------- -# enable support for GCJ libraries -AC_DEFUN([AC_LIBTOOL_GCJ], -[AC_REQUIRE([_LT_AC_LANG_GCJ]) -])# AC_LIBTOOL_GCJ - - -# _LT_AC_LANG_GCJ -# --------------- -AC_DEFUN([_LT_AC_LANG_GCJ], -[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[], - [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[], - [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[], - [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])], - [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])], - [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])]) -_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}GCJ]) -])# _LT_AC_LANG_GCJ - - -# AC_LIBTOOL_RC -# ------------- -# enable support for Windows resource files -AC_DEFUN([AC_LIBTOOL_RC], -[AC_REQUIRE([LT_AC_PROG_RC]) -_LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}RC]) -])# AC_LIBTOOL_RC - - -# AC_LIBTOOL_LANG_C_CONFIG -# ------------------------ -# Ensure that the configuration vars for the C compiler are -# suitably defined. Those variables are subsequently used by -# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. -AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG]) -AC_DEFUN([_LT_AC_LANG_C_CONFIG], -[lt_save_CC="$CC" -AC_LANG_PUSH(C) - -# Source file extension for C test sources. -ac_ext=c - -# Object file extension for compiled C test sources. -objext=o -_LT_AC_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;\n" - -# Code to be used in simple link tests -lt_simple_link_test_code='int main(){return(0);}\n' - -_LT_AC_SYS_COMPILER - -# save warnings/boilerplate of simple test code -_LT_COMPILER_BOILERPLATE -_LT_LINKER_BOILERPLATE - -AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1) -AC_LIBTOOL_PROG_COMPILER_PIC($1) -AC_LIBTOOL_PROG_CC_C_O($1) -AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) -AC_LIBTOOL_PROG_LD_SHLIBS($1) -AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) -AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) -AC_LIBTOOL_SYS_LIB_STRIP -AC_LIBTOOL_DLOPEN_SELF - -# Report which library types will actually be built -AC_MSG_CHECKING([if libtool supports shared libraries]) -AC_MSG_RESULT([$can_build_shared]) - -AC_MSG_CHECKING([whether to build shared libraries]) -test "$can_build_shared" = "no" && enable_shared=no - -# On AIX, shared libraries and static libraries use the same namespace, and -# are all built from PIC. -case $host_os in -aix3*) - test "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; - -aix4* | aix5*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - fi - ;; -esac -AC_MSG_RESULT([$enable_shared]) - -AC_MSG_CHECKING([whether to build static libraries]) -# Make sure either enable_shared or enable_static is yes. -test "$enable_shared" = yes || enable_static=yes -AC_MSG_RESULT([$enable_static]) - -AC_LIBTOOL_CONFIG($1) - -AC_LANG_POP -CC="$lt_save_CC" -])# AC_LIBTOOL_LANG_C_CONFIG - - -# AC_LIBTOOL_LANG_CXX_CONFIG -# -------------------------- -# Ensure that the configuration vars for the C compiler are -# suitably defined. Those variables are subsequently used by -# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'. -AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)]) -AC_DEFUN([_LT_AC_LANG_CXX_CONFIG], -[AC_LANG_PUSH(C++) -AC_REQUIRE([AC_PROG_CXX]) -AC_REQUIRE([_LT_AC_PROG_CXXCPP]) - -_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no -_LT_AC_TAGVAR(allow_undefined_flag, $1)= -_LT_AC_TAGVAR(always_export_symbols, $1)=no -_LT_AC_TAGVAR(archive_expsym_cmds, $1)= -_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= -_LT_AC_TAGVAR(hardcode_direct, $1)=no -_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= -_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= -_LT_AC_TAGVAR(hardcode_libdir_separator, $1)= -_LT_AC_TAGVAR(hardcode_minus_L, $1)=no -_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported -_LT_AC_TAGVAR(hardcode_automatic, $1)=no -_LT_AC_TAGVAR(module_cmds, $1)= -_LT_AC_TAGVAR(module_expsym_cmds, $1)= -_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown -_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds -_LT_AC_TAGVAR(no_undefined_flag, $1)= -_LT_AC_TAGVAR(whole_archive_flag_spec, $1)= -_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no - -# Dependencies to place before and after the object being linked: -_LT_AC_TAGVAR(predep_objects, $1)= -_LT_AC_TAGVAR(postdep_objects, $1)= -_LT_AC_TAGVAR(predeps, $1)= -_LT_AC_TAGVAR(postdeps, $1)= -_LT_AC_TAGVAR(compiler_lib_search_path, $1)= - -# Source file extension for C++ test sources. -ac_ext=cpp - -# Object file extension for compiled C++ test sources. -objext=o -_LT_AC_TAGVAR(objext, $1)=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;\n" - -# Code to be used in simple link tests -lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }\n' - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. -_LT_AC_SYS_COMPILER - -# save warnings/boilerplate of simple test code -_LT_COMPILER_BOILERPLATE -_LT_LINKER_BOILERPLATE - -# Allow CC to be a program name with arguments. -lt_save_CC=$CC -lt_save_LD=$LD -lt_save_GCC=$GCC -GCC=$GXX -lt_save_with_gnu_ld=$with_gnu_ld -lt_save_path_LD=$lt_cv_path_LD -if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then - lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx -else - $as_unset lt_cv_prog_gnu_ld -fi -if test -n "${lt_cv_path_LDCXX+set}"; then - lt_cv_path_LD=$lt_cv_path_LDCXX -else - $as_unset lt_cv_path_LD -fi -test -z "${LDCXX+set}" || LD=$LDCXX -CC=${CXX-"c++"} -compiler=$CC -_LT_AC_TAGVAR(compiler, $1)=$CC -_LT_CC_BASENAME([$compiler]) - -# We don't want -fno-exception wen compiling C++ code, so set the -# no_builtin_flag separately -if test "$GXX" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' -else - _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= -fi - -if test "$GXX" = yes; then - # Set up default GNU C++ configuration - - AC_PROG_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 - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${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 - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= - 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. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - fi - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' - -else - GXX=no - with_gnu_ld=no - wlarc= -fi - -# PORTME: fill in a description of your system's C++ link characteristics -AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) -_LT_AC_TAGVAR(ld_shlibs, $1)=yes -case $host_os in - aix3*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - aix4* | aix5*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) - for ld_flag in $LDFLAGS; do - case $ld_flag in - *-brtl*) - aix_use_runtimelinking=yes - break - ;; - esac - done - ;; - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - _LT_AC_TAGVAR(archive_cmds, $1)='' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - - if test "$GXX" = yes; then - case $host_os in aix4.[[012]]|aix4.[[012]].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && \ - strings "$collect2name" | grep resolve_lib_name >/dev/null - then - # We have reworked collect2 - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - else - # We have old collect2 - _LT_AC_TAGVAR(hardcode_direct, $1)=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 - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= - fi - ;; - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - _LT_AC_TAGVAR(always_export_symbols, $1)=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. - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' - # Determine the default libpath from the value encoded in an empty executable. - _LT_AC_SYS_LIBPATH_AIX - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' - _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$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. - _LT_AC_SYS_LIBPATH_AIX - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${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. - _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes - # This is similar to how AIX traditionally builds its shared libraries. - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$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 - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - chorus*) - case $cc_basename in - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, - # as there is no search path for DLLs. - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(always_export_symbols, $1)=no - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$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... - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='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 - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - darwin* | rhapsody*) - case $host_os in - rhapsody* | darwin1.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - ;; - 10.*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' - ;; - esac - fi - ;; - esac - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_automatic, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - - if test "$GXX" = yes ; then - lt_int_apple_cc_single_mod=no - output_verbose_link_cmd='echo' - if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then - lt_int_apple_cc_single_mod=yes - fi - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - fi - _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - fi - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - case $cc_basename in - xlc*) - output_verbose_link_cmd='echo' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' - _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - ;; - *) - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - fi - ;; - - dgux*) - case $cc_basename in - ec++*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - ghcx*) - # Green Hills C++ Compiler - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - freebsd[[12]]*) - # C++ shared libraries reported to be fairly broken before switch to ELF - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - freebsd-elf*) - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - ;; - freebsd* | kfreebsd*-gnu | dragonfly*) - # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF - # conventions - _LT_AC_TAGVAR(ld_shlibs, $1)=yes - ;; - gnu*) - ;; - hpux9*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=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 - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - aCC*) - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[[-]]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - hpux10*|hpux11*) - if test $with_gnu_ld = no; then - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - case $host_cpu in - hppa*64*|ia64*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' - ;; - *) - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - ;; - esac - fi - case $host_cpu in - hppa*64*|ia64*) - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - *) - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=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 - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - aCC*) - case $host_cpu in - hppa*64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - ia64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes; then - if test $with_gnu_ld = no; then - case $host_cpu in - hppa*64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - ia64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - fi - else - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - interix3*) - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${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. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='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++ - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - - # Archives containing C++ object files must be created using - # "CC -ar", where "CC" is the IRIX C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' - ;; - *) - if test "$GXX" = yes; then - if test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' - fi - fi - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - ;; - esac - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - linux*) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_AC_TAGVAR(archive_cmds, $1)='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' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' - ;; - icpc*) - # Intel C++ - with_gnu_ld=yes - # version 8.0 and above of icpc choke on multiply defined symbols - # if we add $predep_objects and $postdep_objects, however 7.1 and - # earlier do not add the objects themselves. - case `$CC -V 2>&1` in - *"Version 7."*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$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 - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - ;; - esac - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - ;; - pgCC*) - # Portland Group C++ compiler - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$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' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - ;; - cxx*) - # Compaq C++ - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$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 - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - esac - ;; - lynxos*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - m88k*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - mvs*) - case $cc_basename in - cxx*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' - wlarc= - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - fi - # Workaround some broken pre-1.5 toolchains - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' - ;; - openbsd2*) - # C++ shared libraries are fairly broken - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - openbsd*) - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - fi - output_verbose_link_cmd='echo' - ;; - osf3*) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_AC_TAGVAR(archive_cmds, $1)='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' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' - - ;; - RCC*) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - cxx*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' - - else - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - osf4* | osf5*) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - _LT_AC_TAGVAR(archive_cmds, $1)='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' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Archives containing C++ object files must be created using - # the KAI C++ compiler. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' - ;; - RCC*) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - cxx*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='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' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' - - else - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - psos*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - lcc*) - # Lucid - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - solaris*) - case $cc_basename in - CC*) - # Sun C++ 4.2, 5.x and Centerline C++ - _LT_AC_TAGVAR(archive_cmds_need_lc,$1)=yes - _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$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' - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - case $host_os in - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; - *) - # The C++ compiler is used as linker so we must use $wl - # flag to pass the commands to the underlying system - # linker. We must also pass each convience library through - # to the system linker between allextract/defaultextract. - # The C++ compiler will combine linker options so we - # cannot just pass the convience library names through - # without $wl. - # Supported since Solaris 2.6 (maybe 2.5.1?) - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' - ;; - esac - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - - output_verbose_link_cmd='echo' - - # Archives containing C++ object files must be created using - # "CC -xar", where "CC" is the Sun C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' - ;; - gcx*) - # Green Hills C++ Compiler - _LT_AC_TAGVAR(archive_cmds, $1)='$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. - _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' - ;; - *) - # GNU C++ compiler with Solaris linker - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' - if $CC --version | grep -v '^2\.7' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" - else - # g++ 2.7 appears to require `-G' NOT `-shared' on this - # platform. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" - fi - - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' - fi - ;; - esac - ;; - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) - _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var='LD_RUN_PATH' - - case $cc_basename in - CC*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - ;; - sysv5* | sco3.2v5* | sco5v6*) - # Note: We can NOT use -z defs as we might desire, because we do not - # link with -lc, and that would cause any symbols used from libc to - # always be unresolved, which means just about no library would - # ever link correctly. If we're not using GNU ld we use -z text - # though, which does catch some bad symbols but isn't as heavy-handed - # as -z defs. - # For security reasons, it is highly recommended that you always - # use absolute paths for naming shared libraries, and exclude the - # DT_RUNPATH tag from executables and libraries. But doing so - # requires that you compile everything twice, which is a pain. - # So that behaviour is only enabled if SCOABSPATH is set to a - # non-empty value in the environment. Most likely only useful for - # creating official distributions of packages. - # This is a hack until libtool officially supports absolute path - # names for shared libraries. - _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - - case $cc_basename in - CC*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - ;; - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - ;; - vxworks*) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - *) - # FIXME: insert proper C++ library support - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; -esac -AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) -test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no - -_LT_AC_TAGVAR(GCC, $1)="$GXX" -_LT_AC_TAGVAR(LD, $1)="$LD" - -AC_LIBTOOL_POSTDEP_PREDEP($1) -AC_LIBTOOL_PROG_COMPILER_PIC($1) -AC_LIBTOOL_PROG_CC_C_O($1) -AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1) -AC_LIBTOOL_PROG_LD_SHLIBS($1) -AC_LIBTOOL_SYS_DYNAMIC_LINKER($1) -AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1) - -AC_LIBTOOL_CONFIG($1) - -AC_LANG_POP -CC=$lt_save_CC -LDCXX=$LD -LD=$lt_save_LD -GCC=$lt_save_GCC -with_gnu_ldcxx=$with_gnu_ld -with_gnu_ld=$lt_save_with_gnu_ld -lt_cv_path_LDCXX=$lt_cv_path_LD -lt_cv_path_LD=$lt_save_path_LD -lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld -lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld -])# AC_LIBTOOL_LANG_CXX_CONFIG - -# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME]) -# ------------------------------------ -# Figure out "hidden" library dependencies from verbose -# compiler output when linking a shared library. -# Parse the compiler output and extract the necessary -# objects, libraries and library flags. -AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[ -dnl we can't use the lt_simple_compile_test_code here, -dnl because it contains code intended for an executable, -dnl not a library. It's possible we should let each -dnl tag define a new lt_????_link_test_code variable, -dnl but it's only used here... -ifelse([$1],[],[cat > conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext < conftest.$ac_ext <> "$cfgfile" -ifelse([$1], [], -[#! $SHELL - -# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) -# NOTE: Changes made to this file will be lost: look at ltmain.sh. -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 -# Free Software Foundation, Inc. -# -# This file is part of GNU Libtool: -# Originally by Gordon Matzigkeit , 1996 -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# A sed program that does not truncate output. -SED=$lt_SED - -# Sed that helps us avoid accidentally triggering echo(1) options like -n. -Xsed="$SED -e 1s/^X//" - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -# The names of the tagged configurations supported by this script. -available_tags= - -# ### BEGIN LIBTOOL CONFIG], -[# ### BEGIN LIBTOOL TAG CONFIG: $tagname]) - -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: - -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared - -# Whether or not to build static libraries. -build_old_libs=$enable_static - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1) - -# Whether or not to disallow shared libs when runtime libs are static -allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) - -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install - -# The host system. -host_alias=$host_alias -host=$host -host_os=$host_os - -# The build system. -build_alias=$build_alias -build=$build -build_os=$build_os - -# An echo program that does not interpret backslashes. -echo=$lt_echo - -# The archiver. -AR=$lt_AR -AR_FLAGS=$lt_AR_FLAGS - -# A C compiler. -LTCC=$lt_LTCC - -# LTCC compiler flags. -LTCFLAGS=$lt_LTCFLAGS - -# A language-specific compiler. -CC=$lt_[]_LT_AC_TAGVAR(compiler, $1) - -# Is the compiler the GNU C compiler? -with_gcc=$_LT_AC_TAGVAR(GCC, $1) - -gcc_dir=\`$CC -print-file-name=. | $SED 's,/\.$,,'\` -gcc_ver=\`$CC -dumpversion\` - -# An ERE matcher. -EGREP=$lt_EGREP - -# The linker used to build libraries. -LD=$lt_[]_LT_AC_TAGVAR(LD, $1) - -# Whether we need hard or soft links. -LN_S=$lt_LN_S - -# A BSD-compatible nm program. -NM=$lt_NM - -# A symbol stripping program -STRIP=$lt_STRIP - -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=$MAGIC_CMD - -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" - -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" - -# Used on cygwin: assembler. -AS="$AS" - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - -# How to pass a linker flag through the compiler. -wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) - -# Object file suffix (normally "o"). -objext="$ac_objext" - -# Old archive suffix (normally "a"). -libext="$libext" - -# Shared library suffix (normally ".so"). -shrext_cmds='$shrext_cmds' - -# Executable file suffix (normally ""). -exeext="$exeext" - -# Additional compiler flags for building library objects. -pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) -pic_mode=$pic_mode - -# What is the maximum length of a command? -max_cmd_len=$lt_cv_sys_max_cmd_len - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) - -# Must we lock files when doing compilation? -need_locks=$lt_need_locks - -# Do we need the lib prefix for modules? -need_lib_prefix=$need_lib_prefix - -# Do we need a version for libraries? -need_version=$need_version - -# Whether dlopen is supported. -dlopen_support=$enable_dlopen - -# Whether dlopen of programs is supported. -dlopen_self=$enable_dlopen_self - -# Whether dlopen of statically linked programs is supported. -dlopen_self_static=$enable_dlopen_self_static - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1) - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1) - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1) - -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1) - -# Library versioning type. -version_type=$version_type - -# Format of library name prefix. -libname_spec=$lt_libname_spec - -# List of archive names. First name is the real one, the rest are links. -# The last name is the one that the linker finds with -lNAME. -library_names_spec=$lt_library_names_spec - -# The coded name of the library, if different from the real name. -soname_spec=$lt_soname_spec - -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1) -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1) - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) - -# Commands used to build and install a shared archive. -archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1) -archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1) -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1) -module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1) - -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib - -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects=\`echo $lt_[]_LT_AC_TAGVAR(predep_objects, $1) | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` - -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects=\`echo $lt_[]_LT_AC_TAGVAR(postdep_objects, $1) | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` - -# Dependencies to place before the objects being linked to create a -# shared library. -predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1) - -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1) - -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=\`echo $lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` - -# Method to check whether dependent libraries are shared objects. -deplibs_check_method=$lt_deplibs_check_method - -# Command to use when deplibs_check_method == file_magic. -file_magic_cmd=$lt_file_magic_cmd - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1) - -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1) - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds - -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$lt_finish_eval - -# Take the output of nm and produce a listing of raw symbols and C names. -global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe - -# Transform the output of nm in a proper C declaration -global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl - -# Transform the output of nm in a C name address pair -global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address - -# This is the shared library runtime path variable. -runpath_var=$runpath_var - -# This is the shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath - -# How to hardcode a shared library path into an executable. -hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1) - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) - -# If ld is used when linking, flag to hardcode \$libdir into -# a binary during linking. This must work even if \$libdir does -# not exist. -hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1) - -# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1) - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1) - -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1) - -# 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=$_LT_AC_TAGVAR(hardcode_automatic, $1) - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1) - -# Compile-time system search path for libraries -sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` - -# Run-time system search path for libraries -sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec - -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)" - -# Set to yes if exported symbols are required. -always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1) - -# The commands to list exported symbols. -export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1) - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1) - -# Symbols that must always be exported. -include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1) - -ifelse([$1],[], -[# ### END LIBTOOL CONFIG], -[# ### END LIBTOOL TAG CONFIG: $tagname]) - -__EOF__ - -ifelse([$1],[], [ - case $host_os in - aix3*) - cat <<\EOF >> "$cfgfile" - -# AIX sometimes has problems with the GCC collect2 program. For some -# reason, if we set the COLLECT_NAMES environment variable, the problems -# vanish in a puff of smoke. -if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES -fi -EOF - ;; - esac - - # We use sed instead of cat because bash on DJGPP gets confused if - # if finds mixed CR/LF and LF-only lines. Since sed operates in - # text mode, it properly converts lines to CR/LF. This bash problem - # is reportedly fixed, but why not run on old versions too? - sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) - - mv -f "$cfgfile" "$ofile" || \ - (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") - chmod +x "$ofile" -]) -else - # If there is no Makefile yet, we rely on a make rule to execute - # `config.status --recheck' to rerun these tests and create the - # libtool script then. - ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` - if test -f "$ltmain_in"; then - test -f Makefile && make "$ltmain" - fi -fi -])# AC_LIBTOOL_CONFIG - - -# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME]) -# ------------------------------------------- -AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], -[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl - -_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= - -if test "$GCC" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' - - AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], - lt_cv_prog_compiler_rtti_exceptions, - [-fno-rtti -fno-exceptions], [], - [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) -fi -])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI - - -# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE -# --------------------------------- -AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], -[AC_REQUIRE([AC_CANONICAL_HOST]) -AC_REQUIRE([AC_PROG_NM]) -AC_REQUIRE([AC_OBJEXT]) -# Check for command to grab the raw symbol name followed by C symbol from nm. -AC_MSG_CHECKING([command to parse $NM output from $compiler object]) -AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], -[ -# These are sane defaults that work on at least a few old systems. -# [They come from Ultrix. What could be older than Ultrix?!! ;)] - -# Character class describing NM global symbol codes. -symcode='[[BCDEGRST]]' - -# Regexp to match symbols that can be accessed directly from C. -sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' - -# Transform an extracted symbol line into a proper C declaration -lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" - -# Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - -# Define system-specific variables. -case $host_os in -aix*) - symcode='[[BCDT]]' - ;; -cygwin* | mingw* | pw32*) - symcode='[[ABCDGISTW]]' - ;; -hpux*) # Its linker distinguishes data from code symbols - if test "$host_cpu" = ia64; then - symcode='[[ABCDEGRST]]' - fi - lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - ;; -linux*) - if test "$host_cpu" = ia64; then - symcode='[[ABCDGIRSTW]]' - lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - fi - ;; -irix* | nonstopux*) - symcode='[[BCDEGRST]]' - ;; -osf*) - symcode='[[BCDEGQRST]]' - ;; -solaris*) - symcode='[[BDRT]]' - ;; -sco3.2v5*) - symcode='[[DT]]' - ;; -sysv4.2uw2*) - symcode='[[DT]]' - ;; -sysv5* | sco5v6* | unixware* | OpenUNIX*) - symcode='[[ABDT]]' - ;; -sysv4) - symcode='[[DFNSTU]]' - ;; -esac - -# Handle CRLF in mingw tool chain -opt_cr= -case $build_os in -mingw*) - opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp - ;; -esac - -# If we're using GNU nm, then use its standard symbol codes. -case `$NM -V 2>&1` in -*GNU* | *'with BFD'*) - symcode='[[ABCDGIRSTW]]' ;; -esac - -# Try without a prefix undercore, then with it. -for ac_symprfx in "" "_"; do - - # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. - symxfrm="\\1 $ac_symprfx\\2 \\2" - - # Write the raw and C identifiers. - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" - - # Check to see that the pipe works correctly. - pipe_works=no - - rm -f conftest* - cat > conftest.$ac_ext < $nlist) && test -s "$nlist"; then - # Try sorting and uniquifying the output. - if sort "$nlist" | uniq > "$nlist"T; then - mv -f "$nlist"T "$nlist" - else - rm -f "$nlist"T - fi - - # Make sure that we snagged all the symbols we need. - if grep ' nm_test_var$' "$nlist" >/dev/null; then - if grep ' nm_test_func$' "$nlist" >/dev/null; then - cat < conftest.$ac_ext -#ifdef __cplusplus -extern "C" { -#endif - -EOF - # Now generate the symbol file. - eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' - - cat <> conftest.$ac_ext -#if defined (__STDC__) && __STDC__ -# define lt_ptr_t void * -#else -# define lt_ptr_t char * -# define const -#endif - -/* The mapping between symbol names and symbols. */ -const struct { - const char *name; - lt_ptr_t address; -} -lt_preloaded_symbols[[]] = -{ -EOF - $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext - cat <<\EOF >> conftest.$ac_ext - {0, (lt_ptr_t) 0} -}; - -#ifdef __cplusplus -} -#endif -EOF - # Now try linking the two files. - mv conftest.$ac_objext conftstm.$ac_objext - lt_save_LIBS="$LIBS" - lt_save_CFLAGS="$CFLAGS" - LIBS="conftstm.$ac_objext" - CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" - if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then - pipe_works=yes - fi - LIBS="$lt_save_LIBS" - CFLAGS="$lt_save_CFLAGS" - else - echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD - fi - else - echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD - fi - else - echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD - fi - else - echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD - cat conftest.$ac_ext >&5 - fi - rm -f conftest* conftst* - - # Do not use the global_symbol_pipe unless it works. - if test "$pipe_works" = yes; then - break - else - lt_cv_sys_global_symbol_pipe= - fi -done -]) -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 - AC_MSG_RESULT(failed) -else - AC_MSG_RESULT(ok) -fi -]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE - - -# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME]) -# --------------------------------------- -AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC], -[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)= -_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= -_LT_AC_TAGVAR(lt_prog_compiler_static, $1)= - -AC_MSG_CHECKING([for $compiler option to produce PIC]) - ifelse([$1],[CXX],[ - # C++ specific cases for pic, static, wl, etc. - if test "$GXX" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - amigaos*) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' - ;; - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - mingw* | os2* | pw32*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' - ;; - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' - ;; - *djgpp*) - # DJGPP does not support shared libraries at all - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - ;; - interix3*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. - ;; - sysv4*MP*) - if test -d /usr/nec; then - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic - fi - ;; - hpux*) - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - else - case $host_os in - aix4* | aix5*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - else - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' - fi - ;; - chorus*) - case $cc_basename in - cxch68*) - # Green Hills C++ Compiler - # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" - ;; - esac - ;; - darwin*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - case $cc_basename in - xlc*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - ;; - esac - ;; - dgux*) - case $cc_basename in - ec++*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - ;; - ghcx*) - # Green Hills C++ Compiler - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - *) - ;; - esac - ;; - freebsd* | kfreebsd*-gnu | dragonfly*) - # FreeBSD uses GNU C++ - ;; - hpux9* | hpux10* | hpux11*) - case $cc_basename in - CC*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' - if test "$host_cpu" != ia64; then - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - fi - ;; - aCC*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+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_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - # CC pic flag -KPIC is the default. - ;; - *) - ;; - esac - ;; - linux*) - case $cc_basename in - KCC*) - # KAI C++ Compiler - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - icpc* | ecpc*) - # Intel C++ - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - pgCC*) - # Portland Group C++ compiler. - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-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_AC_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - *) - ;; - esac - ;; - lynxos*) - ;; - m88k*) - ;; - mvs*) - case $cc_basename in - cxx*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' - ;; - *) - ;; - esac - ;; - netbsd*) - ;; - osf3* | osf4* | osf5*) - case $cc_basename in - KCC*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' - ;; - RCC*) - # Rational C++ 2.4.1 - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - cxx*) - # Digital/Compaq C++ - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - *) - ;; - esac - ;; - psos*) - ;; - solaris*) - case $cc_basename in - CC*) - # Sun C++ 4.2, 5.x and Centerline C++ - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - ;; - gcx*) - # Green Hills C++ Compiler - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - ;; - *) - ;; - esac - ;; - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - lcc*) - # Lucid - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - ;; - *) - ;; - esac - ;; - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - ;; - *) - ;; - esac - ;; - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - case $cc_basename in - CC*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - esac - ;; - vxworks*) - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - esac - fi -], -[ - if test "$GCC" = yes; then - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - - amigaos*) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' - ;; - - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - - mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' - ;; - - interix3*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. - ;; - - msdosdjgpp*) - # Just because we use GCC doesn't mean we suddenly get shared libraries - # on systems that don't support them. - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - enable_shared=no - ;; - - sysv4*MP*) - if test -d /usr/nec; then - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic - fi - ;; - - hpux*) - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - ;; - - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - else - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' - fi - ;; - darwin*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - case $cc_basename in - xlc*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-qnocommon' - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - ;; - esac - ;; - - mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT' - ;; - - hpux9* | hpux10* | hpux11*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-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_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' - ;; - - irix5* | irix6* | nonstopux*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # PIC (with -KPIC) is the default. - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - newsos6) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - linux*) - case $cc_basename in - icc* | ecc*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - pgcc* | pgf77* | pgf90* | pgf95*) - # Portland Group compilers (*not* the Pentium gcc compiler, - # which looks to be a dead project) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - ccc*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # All Alpha code is PIC. - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - esac - ;; - - osf3* | osf4* | osf5*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - # All OSF/1 code is PIC. - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' - ;; - - solaris*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - case $cc_basename in - f77* | f90* | f95*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; - *) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; - esac - ;; - - sunos4*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec ;then - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - fi - ;; - - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - unicos*) - _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - - uts4*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic' - _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' - ;; - - *) - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no - ;; - esac - fi -]) -AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)]) - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then - AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works], - _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1), - [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [], - [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in - "" | " "*) ;; - *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;; - esac], - [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) -fi -case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)= - ;; - *) - _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])" - ;; -esac - -# -# Check to make sure the static flag actually works. -# -wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_AC_TAGVAR(lt_prog_compiler_static, $1)\" -AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], - _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1), - $lt_tmp_static_flag, - [], - [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=]) -]) - - -# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME]) -# ------------------------------------ -# See if the linker supports building shared libraries. -AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS], -[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) -ifelse([$1],[CXX],[ - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - case $host_os in - aix4* | aix5*) - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - if $NM -V 2>&1 | grep 'GNU' > /dev/null; then - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' - else - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' - fi - ;; - pw32*) - _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" - ;; - cygwin* | mingw*) - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([[^ ]]*\) [[^ ]]*/\1 DATA/;/^I /d;/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' - ;; - *) - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - ;; - esac -],[ - runpath_var= - _LT_AC_TAGVAR(allow_undefined_flag, $1)= - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no - _LT_AC_TAGVAR(archive_cmds, $1)= - _LT_AC_TAGVAR(archive_expsym_cmds, $1)= - _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)= - _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)= - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= - _LT_AC_TAGVAR(thread_safe_flag_spec, $1)= - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_minus_L, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown - _LT_AC_TAGVAR(hardcode_automatic, $1)=no - _LT_AC_TAGVAR(module_cmds, $1)= - _LT_AC_TAGVAR(module_expsym_cmds, $1)= - _LT_AC_TAGVAR(always_export_symbols, $1)=no - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - _LT_AC_TAGVAR(include_expsyms, $1)= - # 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'. - _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_" - # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out - # platforms (ab)use it in PIC code, but their linkers get confused if - # the symbol is explicitly referenced. Since portable code cannot - # rely on this symbol name, it's probably fine to never include it in - # preloaded symbol tables. - extract_expsyms_cmds= - # Just being paranoid about ensuring that cc_basename is set. - _LT_CC_BASENAME([$compiler]) - case $host_os in - cygwin* | mingw* | pw32*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - if test "$GCC" != yes; then - with_gnu_ld=no - fi - ;; - interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) - with_gnu_ld=yes - ;; - openbsd*) - with_gnu_ld=no - ;; - esac - - _LT_AC_TAGVAR(ld_shlibs, $1)=yes - if test "$with_gnu_ld" = yes; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' - - # Set some defaults for GNU ld with shared library support. These - # are reset later if shared libraries are not supported. Putting them - # here allows them to be overridden if necessary. - runpath_var=LD_RUN_PATH - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${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 - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= - fi - supports_anon_versioning=no - case `$LD -v 2>/dev/null` in - *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 - *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... - *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... - *\ 2.11.*) ;; # other 2.11 versions - *) supports_anon_versioning=yes ;; - esac - - # See if GNU ld supports shared libraries. - case $host_os in - aix3* | aix4* | aix5*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - _LT_AC_TAGVAR(ld_shlibs, $1)=no - cat <&2 - -*** Warning: the GNU linker, at least up to release 2.9.1, is reported -*** to be unable to reliably create shared libraries on AIX. -*** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to modify your PATH -*** so that a non-GNU linker is found, and then restart. - -EOF - fi - ;; - - amigaos*) - _LT_AC_TAGVAR(archive_cmds, $1)='$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)' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - - # Samuel A. Falvo II reports - # that the semantics of dynamic libraries on AmigaOS, at least up - # to version 4, is to share data among multiple programs linked - # with the same dynamic library. Since this doesn't match the - # behavior of shared libraries on other platforms, we can't use - # them. - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - - beos*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, - # as there is no search path for DLLs. - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(always_export_symbols, $1)=no - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols' - - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$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... - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='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 - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - interix3*) - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${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. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - ;; - - linux*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - tmp_addflag= - case $cc_basename,$host_cpu in - pgcc*) # Portland Group C compiler - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag' - ;; - pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag -Mnomain' ;; - ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 - tmp_addflag=' -i_dynamic' ;; - efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 - tmp_addflag=' -i_dynamic -nofor_main' ;; - ifc* | ifort*) # Intel Fortran compiler - tmp_addflag=' -nofor_main' ;; - esac - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - - if test $supports_anon_versioning = yes; then - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - $echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - fi - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - fi - ;; - - solaris*) - if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then - _LT_AC_TAGVAR(ld_shlibs, $1)=no - cat <&2 - -*** Warning: The releases 2.8.* of the GNU linker cannot reliably -*** create shared libraries on Solaris systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.9.1 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -EOF - elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - - sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) - case `$LD -v 2>&1` in - *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) - _LT_AC_TAGVAR(ld_shlibs, $1)=no - cat <<_LT_EOF 1>&2 - -*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not -*** reliably create shared libraries on SCO systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.16.91.0.3 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -_LT_EOF - ;; - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - ;; - - sunos4*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - _LT_AC_TAGVAR(ld_shlibs, $1)=no - fi - ;; - esac - - if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no; then - runpath_var= - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)= - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)= - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)= - fi - else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(always_export_symbols, $1)=yes - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$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. - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported - fi - ;; - - aix4* | aix5*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - if $NM -V 2>&1 | grep 'GNU' > /dev/null; then - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' - else - _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols' - fi - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*) - for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then - aix_use_runtimelinking=yes - break - fi - done - ;; - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - _LT_AC_TAGVAR(archive_cmds, $1)='' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - - if test "$GCC" = yes; then - case $host_os in aix4.[[012]]|aix4.[[012]].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && \ - strings "$collect2name" | grep resolve_lib_name >/dev/null - then - # We have reworked collect2 - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - else - # We have old collect2 - _LT_AC_TAGVAR(hardcode_direct, $1)=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 - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)= - fi - ;; - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - _LT_AC_TAGVAR(always_export_symbols, $1)=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. - _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok' - # Determine the default libpath from the value encoded in an empty executable. - _LT_AC_SYS_LIBPATH_AIX - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' - _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs" - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$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. - _LT_AC_SYS_LIBPATH_AIX - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${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. - _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='$convenience' - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes - # This is similar to how AIX traditionally builds its shared libraries. - _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$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*) - _LT_AC_TAGVAR(archive_cmds, $1)='$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)' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - # see comment about different semantics on the GNU ld section - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - - bsdi[[45]]*) - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic - ;; - - cygwin* | mingw* | pw32*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' - _LT_AC_TAGVAR(allow_undefined_flag, $1)=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. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true' - # FIXME: Should let the user specify the lib program. - _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs' - _LT_AC_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' - _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes - ;; - - darwin* | rhapsody*) - case $host_os in - rhapsody* | darwin1.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[[012]]) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - ;; - 10.*) - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-undefined ${wl}dynamic_lookup' - ;; - esac - fi - ;; - esac - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_automatic, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - if test "$GCC" = yes ; then - output_verbose_link_cmd='echo' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - case $cc_basename in - xlc*) - output_verbose_link_cmd='echo' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' - _LT_AC_TAGVAR(module_cmds, $1)='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - ;; - *) - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - fi - ;; - - dgux*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - freebsd1*) - _LT_AC_TAGVAR(ld_shlibs, $1)=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*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | kfreebsd*-gnu | dragonfly*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - hpux9*) - if test "$GCC" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$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 - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - ;; - - hpux10*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - fi - if test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - fi - ;; - - hpux11*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - case $host_cpu in - hppa*64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - else - case $host_cpu in - hppa*64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - fi - if test "$with_gnu_ld" = no; then - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - - case $host_cpu in - hppa*64*|ia64*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - *) - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - ;; - esac - fi - ;; - - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - newsos6) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - openbsd*) - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' - else - case $host_os in - openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - ;; - *) - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' - ;; - esac - fi - ;; - - os2*) - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported - _LT_AC_TAGVAR(archive_cmds, $1)='$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' - _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; - - osf3*) - if test "$GCC" = yes; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' - else - _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ - $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' - - # Both c and cxx compiler support -rpath directly - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' - fi - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=: - ;; - - solaris*) - _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text' - if test "$GCC" = yes; then - wlarc='${wl}' - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' - else - wlarc='' - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - case $host_os in - solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; - *) - # The compiler driver will combine linker options so we - # cannot just pass the convience library names through - # without $wl, iff we do not link with $LD. - # Luckily, gcc supports the same syntax we need for Sun Studio. - # Supported since Solaris 2.6 (maybe 2.5.1?) - case $wlarc in - '') - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; - *) - _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; - esac ;; - esac - _LT_AC_TAGVAR(link_all_deplibs, $1)=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. - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes - _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - sysv4) - case $host_vendor in - sni) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' - _LT_AC_TAGVAR(hardcode_direct, $1)=no - ;; - motorola) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - sysv4.3*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - _LT_AC_TAGVAR(ld_shlibs, $1)=yes - fi - ;; - - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7*) - _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$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. - _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' - _LT_AC_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' - _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':' - _LT_AC_TAGVAR(link_all_deplibs, $1)=yes - _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - else - _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - - uts4*) - _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' - _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no - ;; - - *) - _LT_AC_TAGVAR(ld_shlibs, $1)=no - ;; - esac - fi -]) -AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)]) -test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no - -# -# Do we need to explicitly link libc? -# -case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in -x|xyes) - # Assume -lc should be added - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes - - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $_LT_AC_TAGVAR(archive_cmds, $1) 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. - AC_MSG_CHECKING([whether -lc should be explicitly linked in]) - $rm conftest* - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - - if AC_TRY_EVAL(ac_compile) 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1) - pic_flag=$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1) - _LT_AC_TAGVAR(allow_undefined_flag, $1)= - if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) - then - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no - else - _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes - fi - _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $rm conftest* - AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)]) - ;; - esac - fi - ;; -esac -])# AC_LIBTOOL_PROG_LD_SHLIBS - - -# _LT_AC_FILE_LTDLL_C -# ------------------- -# Be careful that the start marker always follows a newline. -AC_DEFUN([_LT_AC_FILE_LTDLL_C], [ -# /* ltdll.c starts here */ -# #define WIN32_LEAN_AND_MEAN -# #include -# #undef WIN32_LEAN_AND_MEAN -# #include -# -# #ifndef __CYGWIN__ -# # ifdef __CYGWIN32__ -# # define __CYGWIN__ __CYGWIN32__ -# # endif -# #endif -# -# #ifdef __cplusplus -# extern "C" { -# #endif -# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); -# #ifdef __cplusplus -# } -# #endif -# -# #ifdef __CYGWIN__ -# #include -# DECLARE_CYGWIN_DLL( DllMain ); -# #endif -# HINSTANCE __hDllInstance_base; -# -# BOOL APIENTRY -# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) -# { -# __hDllInstance_base = hInst; -# return TRUE; -# } -# /* ltdll.c ends here */ -])# _LT_AC_FILE_LTDLL_C - - -# _LT_AC_TAGVAR(VARNAME, [TAGNAME]) -# --------------------------------- -AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])]) - - -# old names -AC_DEFUN([AM_PROG_LIBTOOL], [AC_PROG_LIBTOOL]) -AC_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) -AC_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) -AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) -AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) -AC_DEFUN([AM_PROG_LD], [AC_PROG_LD]) -AC_DEFUN([AM_PROG_NM], [AC_PROG_NM]) - -# This is just to silence aclocal about the macro not being used -ifelse([AC_DISABLE_FAST_INSTALL]) - -AC_DEFUN([LT_AC_PROG_GCJ], -[AC_CHECK_TOOL(GCJ, gcj, no) - test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" - AC_SUBST(GCJFLAGS) -]) - -AC_DEFUN([LT_AC_PROG_RC], -[AC_CHECK_TOOL(RC, windres, no) -]) - -# NOTE: This macro has been submitted for inclusion into # -# GNU Autoconf as AC_PROG_SED. When it is available in # -# a released version of Autoconf we should remove this # -# macro and use it instead. # -# LT_AC_PROG_SED -# -------------- -# Check for a fully-functional sed program, that truncates -# as few characters as possible. Prefer GNU sed if found. -AC_DEFUN([LT_AC_PROG_SED], -[AC_MSG_CHECKING([for a sed that does not truncate output]) -AC_CACHE_VAL(lt_cv_path_SED, -[# Loop through the user's path and test for sed and gsed. -# Then use that list of sed's as ones to test for truncation. -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for lt_ac_prog in sed gsed; do - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then - lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" - fi - done - done -done -IFS=$as_save_IFS -lt_ac_max=0 -lt_ac_count=0 -# Add /usr/xpg4/bin/sed as it is typically found on Solaris -# along with /bin/sed that truncates output. -for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do - test ! -f $lt_ac_sed && continue - cat /dev/null > conftest.in - lt_ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >conftest.in - # Check for GNU sed and select it if it is found. - if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then - lt_cv_path_SED=$lt_ac_sed - break - fi - while true; do - cat conftest.in conftest.in >conftest.tmp - mv conftest.tmp conftest.in - cp conftest.in conftest.nl - echo >>conftest.nl - $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break - cmp -s conftest.out conftest.nl || break - # 10000 chars as input seems more than enough - test $lt_ac_count -gt 10 && break - lt_ac_count=`expr $lt_ac_count + 1` - if test $lt_ac_count -gt $lt_ac_max; then - lt_ac_max=$lt_ac_count - lt_cv_path_SED=$lt_ac_sed - fi - done -done -]) -SED=$lt_cv_path_SED -AC_SUBST([SED]) -AC_MSG_RESULT([$SED]) -]) - # Copyright (C) 2002, 2003, 2005, 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation @@ -6976,6 +577,40 @@ 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 @@ -7259,3 +894,8 @@ 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]) diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/autom4te.cache/output.0 /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/autom4te.cache/output.0 --- open-vm-tools-2008.01.23-74039/autom4te.cache/output.0 2008-01-28 08:02:58.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/autom4te.cache/output.0 2008-10-13 08:02:01.000000000 +0100 @@ -1,6 +1,6 @@ @%:@! /bin/sh @%:@ Guess values for system-dependent variables and create Makefiles. -@%:@ Generated by GNU Autoconf 2.61 for open-vm-tools 2008.01.23-74039. +@%:@ Generated by GNU Autoconf 2.61 for open-vm-tools 2008.10.10-123053. @%:@ @%:@ Report bugs to . @%:@ @@ -728,8 +728,8 @@ # Identity of this package. PACKAGE_NAME='open-vm-tools' PACKAGE_TARNAME='open-vm-tools' -PACKAGE_VERSION='2008.01.23-74039' -PACKAGE_STRING='open-vm-tools 2008.01.23-74039' +PACKAGE_VERSION='2008.10.10-123053' +PACKAGE_STRING='open-vm-tools 2008.10.10-123053' PACKAGE_BUGREPORT='open-vm-tools-devel@lists.sourceforge.net' ac_unique_file="checkvm/checkvm.c" @@ -853,19 +853,19 @@ am__fastdepCC_TRUE am__fastdepCC_FALSE CPP -SED -GREP -EGREP -LN_S -ECHO -AR -RANLIB CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE +SED +LN_S +GREP +EGREP +ECHO +AR +RANLIB CXXCPP F77 FFLAGS @@ -877,37 +877,64 @@ X_PRE_LIBS X_LIBS X_EXTRA_LIBS +LIBPNG_CONFIG DNET_CONFIG +ICU_CONFIG +HAVE_CXX +RPCGEN BUILD_HGFSMOUNTER_TRUE BUILD_HGFSMOUNTER_FALSE LINUX_TRUE LINUX_FALSE SOLARIS_TRUE SOLARIS_FALSE +FREEBSD_TRUE +FREEBSD_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 +PAMD_TRUE +PAMD_FALSE +ENABLE_UNITY_TRUE +ENABLE_UNITY_FALSE +WITH_ROOT_PRIVILEGES_TRUE +WITH_ROOT_PRIVILEGES_FALSE +TARGET_OS +KERNEL_RELEASE MODULES_OS +MODULES_DIR MODULES -COMMON_CFLAGS -COMMON_PROG_CFLAGS COMMON_XLIBS -GTK_CFLAGS +GTK_CPPFLAGS GTK_LIBS -DNET_CFLAGS +DNET_CPPFLAGS DNET_LIBS -LIB_AUTH_CFLAGS -LIB_FILE_CFLAGS -LIB_HGFS_SERVER_CFLAGS -LIB_IMPERSONATE_CFLAGS -LIB_MISC_CFLAGS -LIB_PROC_MGR_CFLAGS -LIB_STRING_CFLAGS -LIB_USER_CFLAGS -GUESTD_LDFLAGS -VMWARE_USER_CFLAGS -VMWARE_USER_LDFLAGS +PROCPS_LIBS +ICU_CPPFLAGS +ICU_LIBS +PAM_PREFIX +URIPARSER_CPPFLAGS +URIPARSER_LIBS +LIBPNG_CPPFLAGS +LIBPNG_LIBS +ZLIB_CPPFLAGS +ZLIB_LIBS +LIB_AUTH_CPPFLAGS +LIB_FILE_CPPFLAGS +LIB_HGFS_SERVER_CPPFLAGS +LIB_IMPERSONATE_CPPFLAGS +LIB_MISC_CPPFLAGS +LIB_PROC_MGR_CPPFLAGS +LIB_STRING_CPPFLAGS +LIB_USER_CPPFLAGS +GUESTD_LDADD +VMWARE_USER_CPPFLAGS +VMWARE_USER_LDADD LIB@&t@OBJS LTLIBOBJS' ac_subst_files='' @@ -1429,7 +1456,7 @@ # 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 2008.01.23-74039 to adapt to many kinds of systems. +\`configure' configures open-vm-tools 2008.10.10-123053 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1503,14 +1530,15 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of open-vm-tools 2008.01.23-74039:";; + short | recursive ) echo "Configuration of open-vm-tools 2008.10.10-123053:";; 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-multimon disables multimon, enabled by default + --disable-unity disables Unity, enabled by default --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@:>@ @@ -1522,11 +1550,27 @@ 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 (falls back on Gtk 1.2) --with-gnu-ld assume the C compiler uses GNU ld @<:@default=no@:>@ --with-pic try to use only PIC/non-PIC objects @<:@default=use both@:>@ --with-tags@<:@=TAGS@:>@ include additional configurations @<:@automatic@:>@ --with-x use the X Window System + --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 @@ -1608,7 +1652,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -open-vm-tools configure 2008.01.23-74039 +open-vm-tools configure 2008.10.10-123053 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1622,7 +1666,7 @@ 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 2008.01.23-74039, which was +It was created by open-vm-tools $as_me 2008.10.10-123053, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -1997,8 +2041,10 @@ # 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 "$srcdir" "$srcdir/.." "$srcdir/../.."; do +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" @@ -2014,8 +2060,8 @@ fi done if test -z "$ac_aux_dir"; then - { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 -echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} + { { 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 @@ -2028,6 +2074,8 @@ 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 @@ -2173,11 +2221,51 @@ ;; 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="`uname -r | cut -f1 -d. | cut -f1 -d-`" - minor_version="`uname -r | cut -f2 -d. | cut -f1 -d-`" - micro_version="`uname -r | cut -f3 -d. | cut -f1 -d-`" + 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 } @@ -2197,15 +2285,49 @@ ;; esac osVersion="`getOsVersion`" +if test "$os" = "linux"; then + if test "$with_kernel_modules" = "yes"; then + 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 + fi +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; MULTIMON_ENABLED="$enableval" + enableval=$enable_multimon; enable_multimon="$enableval" +else + enable_multimon="yes" +fi + + +# Check whether --enable-unity was given. +if test "${enable_unity+set}" = set; then + enableval=$enable_unity; enable_unity="$enableval" +else + enable_unity="yes" +fi + + + +# Check whether --with-gtk2 was given. +if test "${with_gtk2+set}" = set; then + withval=$with_gtk2; with_gtk2="$withval" else - MULTIMON_ENABLED="yes" + with_gtk2="yes" fi +# If we're not going to use Gtk 2.0, disable Unity. It may be possible to +# get Unity working with Gtk 1.2 (it used to in the past), but that will +# require a great deal of work. +if test "$with_gtk2" != "yes"; then + enable_unity="no" +fi + am__api_version='1.10' # Find a good install program. We prefer a C program (faster), @@ -2512,7 +2634,7 @@ # Define the identity of the package. PACKAGE='open-vm-tools' - VERSION='2008.01.23-74039' + VERSION='2008.10.10-123053' cat >>confdefs.h <<_ACEOF @@ -2664,11 +2786,22 @@ ### # These need to be declared after initialization. -CFLAGS="$CFLAGS -DUSING_AUTOCONF=1" +# 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" ### ### Programs ### +# C preprocessor and compiler. DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" @@ -4772,899 +4905,498 @@ fi -# 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 + +# 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 - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + 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=. - # 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 + 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 - 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' - -# Needed for creating the archives in lib/ and the shared libraries. -# 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 +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + { echo "$as_me:$LINENO: result: $CXX" >&5 +echo "${ECHO_T}$CXX" >&6; } else - enable_static=yes + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi -# 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 + test -n "$CXX" && break + done fi - - -{ echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 -echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6; } -if test "${lt_cv_path_SED+set}" = set; then +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 - # Loop through the user's path and test for sed and gsed. -# Then use that list of sed's as ones to test for truncation. + 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 lt_ac_prog in sed gsed; do - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then - lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" - fi - done - done -done -IFS=$as_save_IFS -lt_ac_max=0 -lt_ac_count=0 -# Add /usr/xpg4/bin/sed as it is typically found on Solaris -# along with /bin/sed that truncates output. -for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do - test ! -f $lt_ac_sed && continue - cat /dev/null > conftest.in - lt_ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >conftest.in - # Check for GNU sed and select it if it is found. - if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then - lt_cv_path_SED=$lt_ac_sed - break - fi - while true; do - cat conftest.in conftest.in >conftest.tmp - mv conftest.tmp conftest.in - cp conftest.in conftest.nl - echo >>conftest.nl - $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break - cmp -s conftest.out conftest.nl || break - # 10000 chars as input seems more than enough - test $lt_ac_count -gt 10 && break - lt_ac_count=`expr $lt_ac_count + 1` - if test $lt_ac_count -gt $lt_ac_max; then - lt_ac_max=$lt_ac_count - lt_cv_path_SED=$lt_ac_sed - fi - done -done - -fi - -SED=$lt_cv_path_SED - -{ echo "$as_me:$LINENO: result: $SED" >&5 -echo "${ECHO_T}$SED" >&6; } - -{ echo "$as_me:$LINENO: checking for 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 + 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 - -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 - +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 - ac_cv_path_GREP=$GREP -fi - - + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } 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 + test -n "$ac_ct_CXX" && break done -IFS=$as_save_IFS - + 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 -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 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 - 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" - + 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 -# 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 + ; + 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 - with_gnu_ld=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_compiler_gnu=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; } +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + fi -if test "${lt_cv_path_LD+set}" = set; then +{ 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 - 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 conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -LD="$lt_cv_path_LD" -if test -n "$LD"; then - { echo "$as_me:$LINENO: result: $LD" >&5 -echo "${ECHO_T}$LD" >&6; } +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:$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 + 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 - # I'd rather use --version here, but apparently some GNU lds only accept -v. -case `$LD -v 2>&1 &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 -{ echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5 -echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; } -with_gnu_ld=$lt_cv_prog_gnu_ld +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi -{ 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' +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 -echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6; } -reload_flag=$lt_cv_ld_reload_flag -case $reload_flag in -"" | " "*) ;; -*) reload_flag=" $reload_flag" ;; -esac -reload_cmds='$LD$reload_flag -o $output$reload_objs' -case $host_os in - darwin*) - if test "$GCC" = yes; then - reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' - else - reload_cmds='$LD$reload_flag -o $output$reload_objs' - fi - ;; -esac -{ echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 -echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6; } -if test "${lt_cv_path_NM+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$NM"; then - # Let the user override the test. - lt_cv_path_NM="$NM" +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 - 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" + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= fi - for lt_tmp_nm in $lt_nm_to_check; do - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - tmp_nm="$ac_dir/$lt_tmp_nm" - if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then - # Check to see if the nm accepts a BSD-compat flag. - # Adding the `sed 1q' prevents false positives on HP-UX, which says: - # nm: unknown option "B" ignored - # Tru64's nm complains that /dev/null is an invalid object file - case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in - */dev/null* | *'Invalid file or object type'*) - lt_cv_path_NM="$tmp_nm -B" - break - ;; - *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in - */dev/null*) - lt_cv_path_NM="$tmp_nm -p" - break - ;; - *) - lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but - continue # so that we can try to find one that supports BSD flags - ;; - esac - ;; - esac - fi - done - IFS="$lt_save_ifs" - done - test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm -fi fi -{ echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 -echo "${ECHO_T}$lt_cv_path_NM" >&6; } -NM="$lt_cv_path_NM" +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 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 +depcc="$CXX" am_compiler_list= -{ echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5 -echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6; } -if test "${lt_cv_deplibs_check_method+set}" = set; then +{ echo "$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 - lt_cv_file_magic_cmd='$MAGIC_CMD' -lt_cv_file_magic_test_file= -lt_cv_deplibs_check_method='unknown' -# Need to set the preceding variable on all platforms that support -# interlibrary dependencies. -# 'none' -- dependencies not supported. -# `unknown' -- same as none, but documents that we really don't know. -# 'pass_all' -- all dependencies passed with no checks. -# 'test_compile' -- check by making test program. -# 'file_magic [[regex]]' -- check by looking for files in library path -# which responds to the $file_magic_cmd with a given extended regex. -# If you have `file' or equivalent on your system and you're not sure -# whether `pass_all' will *always* work, you probably want this one. - -case $host_os in -aix4* | aix5*) - lt_cv_deplibs_check_method=pass_all - ;; + 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 -beos*) - lt_cv_deplibs_check_method=pass_all - ;; + 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 -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 - ;; + 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 -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' - ;; + cd .. + rm -rf conftest.dir +else + am_cv_CXX_dependencies_compiler_type=none +fi -mingw* | pw32*) - # Base MSYS/MinGW do not provide the 'file' command needed by - # func_win32_libid shell function, so use a weaker test based on 'objdump'. - lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' - lt_cv_file_magic_cmd='$OBJDUMP -f' - ;; +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 -darwin* | rhapsody*) - lt_cv_deplibs_check_method=pass_all - ;; + 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 -freebsd* | kfreebsd*-gnu | dragonfly*) - if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then - case $host_cpu in - i*86 ) - # Not sure whether the presence of OpenBSD here was a mistake. - # Let's accept both of them until this is cleared up. - lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` - ;; - esac - else - lt_cv_deplibs_check_method=pass_all - fi - ;; -gnu*) - lt_cv_deplibs_check_method=pass_all - ;; -hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=/usr/bin/file - case $host_cpu in - ia64*) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' - lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so - ;; - hppa*64*) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' - lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl - ;; - *) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' - lt_cv_file_magic_test_file=/usr/lib/libc.sl - ;; - esac - ;; - -interix3*) - # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' - ;; - -irix5* | irix6* | nonstopux*) - case $LD in - *-32|*"-32 ") libmagic=32-bit;; - *-n32|*"-n32 ") libmagic=N32;; - *-64|*"-64 ") libmagic=64-bit;; - *) libmagic=never-match;; - esac - lt_cv_deplibs_check_method=pass_all - ;; - -# This must be Linux ELF. -linux*) - lt_cv_deplibs_check_method=pass_all - ;; - -netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' - fi - ;; - -newos6*) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/libnls.so - ;; - -nto-qnx*) - lt_cv_deplibs_check_method=unknown - ;; - -openbsd*) - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' - fi - ;; - -osf3* | osf4* | osf5*) - lt_cv_deplibs_check_method=pass_all - ;; - -solaris*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv4 | sysv4.3*) - case $host_vendor in - motorola) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` - ;; - ncr) - lt_cv_deplibs_check_method=pass_all - ;; - sequent) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' - ;; - sni) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" - lt_cv_file_magic_test_file=/lib/libc.so - ;; - siemens) - lt_cv_deplibs_check_method=pass_all - ;; - pc) - lt_cv_deplibs_check_method=pass_all - ;; - esac - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - lt_cv_deplibs_check_method=pass_all - ;; -esac - -fi -{ echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 -echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6; } -file_magic_cmd=$lt_cv_file_magic_cmd -deplibs_check_method=$lt_cv_deplibs_check_method -test -z "$deplibs_check_method" && deplibs_check_method=unknown - - - - -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} - -# Allow CC to be a program name with arguments. -compiler=$CC - - -# Check whether --enable-libtool-lock 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 __oline__ "configure"' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - if test "$lt_cv_prog_gnu_ld" = yes; then - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -melf32bsmip" - ;; - *N32*) - LD="${LD-ld} -melf32bmipn32" - ;; - *64-bit*) - LD="${LD-ld} -melf64bmip" - ;; - esac - else - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -32" - ;; - *N32*) - LD="${LD-ld} -n32" - ;; - *64-bit*) - LD="${LD-ld} -64" - ;; - esac - fi - fi - rm -rf conftest* - ;; - -x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - case `/usr/bin/file conftest.o` in - *32-bit*) - case $host in - x86_64-*linux*) - LD="${LD-ld} -m elf_i386" - ;; - ppc64-*linux*|powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" - ;; - s390x-*linux*) - LD="${LD-ld} -m elf_s390" - ;; - sparc64-*linux*) - LD="${LD-ld} -m elf32_sparc" - ;; - esac - ;; - *64-bit*) - case $host in - x86_64-*linux*) - LD="${LD-ld} -m elf_x86_64" - ;; - ppc*-*linux*|powerpc*-*linux*) - LD="${LD-ld} -m elf64ppc" - ;; - s390*-*linux*) - LD="${LD-ld} -m elf64_s390" - ;; - sparc*-*linux*) - LD="${LD-ld} -m elf64_sparc" - ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; - -*-*-sco3.2v5*) - # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -belf" - { echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 -echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6; } -if test "${lt_cv_cc_needs_belf+set}" = set; then +# 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 - 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 + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -5679,216 +5411,55 @@ return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in +# 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_link") 2>conftest.er1 + (eval "$ac_try") 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 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 - ;; -sparc*-*solaris*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (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 - case `/usr/bin/file conftest.o` in - *64-bit*) - case $lt_cv_prog_gnu_ld in - yes*) LD="${LD-ld} -m elf64_sparc" ;; - *) LD="${LD-ld} -64" ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; - - -esac - -need_locks="$enable_libtool_lock" - - - -{ 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 + (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_compile") 2>conftest.er1 + (eval "$ac_try") 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 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 + (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_link") 2>&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in + (exit $ac_status); } && + test -f conftest2.$ac_objext && { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac @@ -5896,1864 +5467,1801 @@ (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : + (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 - 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 + eval ac_cv_prog_cc_${ac_cc}_c_o=no fi +rm -f core conftest* - -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 +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 STDC_HEADERS 1 +@%:@define NO_MINUS_C_MINUS_O 1 _ACEOF fi -# On IRIX 5.3, sys/types and inttypes.h are conflicting. - - - - - - +# 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 -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 +# 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 - 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;; + 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 -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 +done +IFS=$as_save_IFS - 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 - + 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; } -done +# 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' -for ac_header in dlfcn.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 "$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 -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 + 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 - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + 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_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; } + $ac_path_SED_found && break 3 + done +done + +done +IFS=$as_save_IFS -# 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; } +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 -# 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" + ac_cv_path_SED=$SED 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 +{ 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 -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 +{ 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 - if test -n "$CXX"; then - ac_cv_prog_CXX="$CXX" # Let the user override the test. + { 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 + 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_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 + 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 -CXX=$ac_cv_prog_CXX -if test -n "$CXX"; then - { echo "$as_me:$LINENO: result: $CXX" >&5 -echo "${ECHO_T}$CXX" >&6; } +{ 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. +# 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 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + enable_shared=yes fi - test -n "$CXX" && break - done +# 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 -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 + + +# 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 - if test -n "$ac_ct_CXX"; then - ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. + enable_fast_install=yes +fi + + +{ echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 +echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6; } +if test "${lt_cv_path_SED+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else + # Loop through the user's path and test for sed and gsed. +# Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for 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 + for lt_ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then + lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" + fi + done + done done IFS=$as_save_IFS +lt_ac_max=0 +lt_ac_count=0 +# Add /usr/xpg4/bin/sed as it is typically found on Solaris +# along with /bin/sed that truncates output. +for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do + test ! -f $lt_ac_sed && continue + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test $lt_ac_count -gt 10 && break + lt_ac_count=`expr $lt_ac_count + 1` + if test $lt_ac_count -gt $lt_ac_max; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done fi -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 +SED=$lt_cv_path_SED - 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 +{ echo "$as_me:$LINENO: result: $SED" >&5 +echo "${ECHO_T}$SED" >&6; } - 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 "$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 - 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 + # 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_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;; + 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 -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. */ + $ac_path_GREP_found && break 3 + done +done -int -main () -{ +done +IFS=$as_save_IFS - ; - 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 +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 -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + ac_cv_path_GREP=$GREP 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=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 - -depcc="$CXX" am_compiler_list= +{ 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 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 "$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 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 + 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 - 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 + $ac_path_EGREP_found && break 3 done +done + +done +IFS=$as_save_IFS + - cd .. - rm -rf conftest.dir -else - am_cv_CXX_dependencies_compiler_type=none 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 -{ 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= + 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" + -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 - : +# 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 - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue + with_gnu_ld=no 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 +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: 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 - + { echo "$as_me:$LINENO: checking for non-GNU ld" >&5 +echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; } fi - CXXCPP=$ac_cv_prog_CXXCPP +if test "${lt_cv_path_LD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 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 - : + 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 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue + lt_cv_path_LD="$LD" # Let the user override the test with a path. 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 - : +LD="$lt_cv_path_LD" +if test -n "$LD"; then + { echo "$as_me:$LINENO: result: $LD" >&5 +echo "${ECHO_T}$LD" >&6; } 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; }; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } 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 - +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 -ac_ext=f -ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' -ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_f77_compiler_gnu -if test -n "$ac_tool_prefix"; then - for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_F77+set}" = set; then +{ echo "$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 - if test -n "$F77"; then - ac_cv_prog_F77="$F77" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_F77="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -F77=$ac_cv_prog_F77 -if test -n "$F77"; then - { echo "$as_me:$LINENO: result: $F77" >&5 -echo "${ECHO_T}$F77" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + lt_cv_ld_reload_flag='-r' fi +{ echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 +echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6; } +reload_flag=$lt_cv_ld_reload_flag +case $reload_flag in +"" | " "*) ;; +*) reload_flag=" $reload_flag" ;; +esac +reload_cmds='$LD$reload_flag -o $output$reload_objs' +case $host_os in + darwin*) + if test "$GCC" = yes; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi + ;; +esac - - test -n "$F77" && break - done -fi -if test -z "$F77"; then - ac_ct_F77=$F77 - for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_F77+set}" = set; then +{ echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 +echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6; } +if test "${lt_cv_path_NM+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test -n "$ac_ct_F77"; then - ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test. + if test -n "$NM"; then + # Let the user override the test. + lt_cv_path_NM="$NM" 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_F77="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 + 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 -done -done -IFS=$as_save_IFS - + for lt_tmp_nm in $lt_nm_to_check; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + tmp_nm="$ac_dir/$lt_tmp_nm" + if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + # Tru64's nm complains that /dev/null is an invalid object file + case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in + */dev/null* | *'Invalid file or object type'*) + lt_cv_path_NM="$tmp_nm -B" + break + ;; + *) + case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in + */dev/null*) + lt_cv_path_NM="$tmp_nm -p" + break + ;; + *) + lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + ;; + esac + ;; + esac + fi + done + IFS="$lt_save_ifs" + done + test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm fi fi -ac_ct_F77=$ac_cv_prog_ac_ct_F77 -if test -n "$ac_ct_F77"; then - { echo "$as_me:$LINENO: result: $ac_ct_F77" >&5 -echo "${ECHO_T}$ac_ct_F77" >&6; } +{ echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 +echo "${ECHO_T}$lt_cv_path_NM" >&6; } +NM="$lt_cv_path_NM" + +{ echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5 +echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6; } +if test "${lt_cv_deplibs_check_method+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi + lt_cv_file_magic_cmd='$MAGIC_CMD' +lt_cv_file_magic_test_file= +lt_cv_deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# `unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'test_compile' -- check by making test program. +# 'file_magic [[regex]]' -- check by looking for files in library path +# which responds to the $file_magic_cmd with a given extended regex. +# If you have `file' or equivalent on your system and you're not sure +# whether `pass_all' will *always* work, you probably want this one. + +case $host_os in +aix4* | aix5*) + lt_cv_deplibs_check_method=pass_all + ;; +beos*) + lt_cv_deplibs_check_method=pass_all + ;; - test -n "$ac_ct_F77" && break -done +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 + ;; - if test "x$ac_ct_F77" = x; then - F77="" +cygwin*) + # func_win32_libid is a shell function defined in ltmain.sh + lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' + lt_cv_file_magic_cmd='func_win32_libid' + ;; + +mingw* | pw32*) + # Base MSYS/MinGW do not provide the 'file' command needed by + # func_win32_libid shell function, so use a weaker test based on 'objdump'. + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + ;; + +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; + +freebsd* | kfreebsd*-gnu | dragonfly*) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + case $host_cpu in + i*86 ) + # Not sure whether the presence of OpenBSD here was a mistake. + # Let's accept both of them until this is cleared up. + lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` + ;; + esac else - 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 - F77=$ac_ct_F77 + lt_cv_deplibs_check_method=pass_all fi -fi + ;; +gnu*) + lt_cv_deplibs_check_method=pass_all + ;; -# Provide some information about the compiler. -echo "$as_me:$LINENO: checking for Fortran 77 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); } -rm -f a.out +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; -# If we don't use `.F' as extension, the preprocessor is not run on the -# input file. (Note that this only needs to work for GNU compilers.) -ac_save_ext=$ac_ext -ac_ext=F -{ echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6; } -if test "${ac_cv_f77_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF - program main -#ifndef __GNUC__ - choke me -#endif - - end -_ACEOF -rm -f conftest.$ac_objext -if { (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_f77_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 +interix3*) + # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' + ;; -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_f77_compiler_gnu=$ac_compiler_gnu +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 + ;; -fi -{ echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6; } -ac_ext=$ac_save_ext -ac_test_FFLAGS=${FFLAGS+set} -ac_save_FFLAGS=$FFLAGS -FFLAGS= -{ echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5 -echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6; } -if test "${ac_cv_prog_f77_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - FFLAGS=-g -cat >conftest.$ac_ext <<_ACEOF - program main +# This must be Linux ELF. +linux*) + lt_cv_deplibs_check_method=pass_all + ;; - end -_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_f77_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_f77_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' + fi + ;; - ac_cv_prog_f77_g=no -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 + ;; -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +nto-qnx*) + lt_cv_deplibs_check_method=unknown + ;; -fi -{ echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5 -echo "${ECHO_T}$ac_cv_prog_f77_g" >&6; } -if test "$ac_test_FFLAGS" = set; then - FFLAGS=$ac_save_FFLAGS -elif test $ac_cv_prog_f77_g = yes; then - if test "x$ac_cv_f77_compiler_gnu" = xyes; then - FFLAGS="-g -O2" - else - FFLAGS="-g" - fi -else - if test "x$ac_cv_f77_compiler_gnu" = xyes; then - FFLAGS="-O2" +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 - FFLAGS= + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi -fi + ;; -G77=`test $ac_compiler_gnu = yes && echo yes` -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu +osf3* | osf4* | osf5*) + lt_cv_deplibs_check_method=pass_all + ;; +solaris*) + lt_cv_deplibs_check_method=pass_all + ;; +sysv4 | sysv4.3*) + case $host_vendor in + motorola) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' + lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + ncr) + lt_cv_deplibs_check_method=pass_all + ;; + sequent) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' + ;; + sni) + lt_cv_file_magic_cmd='/bin/file' + lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" + lt_cv_file_magic_test_file=/lib/libc.so + ;; + siemens) + lt_cv_deplibs_check_method=pass_all + ;; + pc) + lt_cv_deplibs_check_method=pass_all + ;; + esac + ;; -# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + lt_cv_deplibs_check_method=pass_all + ;; +esac -# 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" +fi +{ echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 +echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6; } +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown - case $build_os in - msdosdjgpp*) - # On DJGPP, this test can blow up pretty badly due to problems in libc - # (any single argument exceeding 2000 bytes causes a buffer overrun - # during glob expansion). Even if it were fixed, the result of this - # check would be larger than it should be. - lt_cv_sys_max_cmd_len=12288; # 12K is about right - ;; - gnu*) - # Under GNU Hurd, this test is not required because there is - # no limit to the length of command line arguments. - # Libtool will interpret -1 as no limit whatsoever - lt_cv_sys_max_cmd_len=-1; - ;; - cygwin* | mingw*) - # On Win9x/ME, this test blows up -- it succeeds, but takes - # about 5 minutes as the teststring grows exponentially. - # Worse, since 9x/ME are not pre-emptively multitasking, - # you end up with a "frozen" computer, even though with patience - # the test eventually succeeds (with a max line length of 256k). - # Instead, let's just punt: use the minimum linelength reported by - # all of the supported platforms: 8192 (on NT/2K/XP). - lt_cv_sys_max_cmd_len=8192; - ;; - amigaos*) - # On AmigaOS with pdksh, this test takes hours, literally. - # So we just punt and use a minimum line length of 8192. - lt_cv_sys_max_cmd_len=8192; - ;; +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} - 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` - ;; +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} - interix*) - # We know the value 262144 and hardcode it with a safety zone (like BSD) - lt_cv_sys_max_cmd_len=196608 - ;; +# Allow CC to be a program name with arguments. +compiler=$CC - osf*) - # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure - # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not - # nice to cause kernel panics so lets avoid the loop below. - # First set a reasonable default. - lt_cv_sys_max_cmd_len=16384 - # - if test -x /sbin/sysconfig; then - case `/sbin/sysconfig -q proc exec_disable_arg_limit` in - *1*) lt_cv_sys_max_cmd_len=-1 ;; - esac - fi - ;; - sco3.2v5*) - lt_cv_sys_max_cmd_len=102400 - ;; - sysv5* | sco5v6* | sysv4.2uw2*) - kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` - if test -n "$kargmax"; then - lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` - else - lt_cv_sys_max_cmd_len=32768 - fi - ;; - *) - # If test is not a shell built-in, we'll probably end up computing a - # maximum length that is only half of the actual maximum length, but - # we can't tell. - SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} - while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \ - = "XX$teststring") >/dev/null 2>&1 && - new_result=`expr "X$teststring" : ".*" 2>&1` && - lt_cv_sys_max_cmd_len=$new_result && - test $i != 17 # 1/2 MB should be enough - do - i=`expr $i + 1` - teststring=$teststring$teststring - done - teststring= - # Add a significant safety factor because C++ compilers can tack on massive - # amounts of additional arguments before passing them to the linker. - # It appears as though 1/2 is a usable value. - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` - ;; - esac +# Check whether --enable-libtool-lock was given. +if test "${enable_libtool_lock+set}" = set; then + enableval=$enable_libtool_lock; 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 - +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 __oline__ "configure"' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + if test "$lt_cv_prog_gnu_ld" = yes; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -melf32bsmip" + ;; + *N32*) + LD="${LD-ld} -melf32bmipn32" + ;; + *64-bit*) + LD="${LD-ld} -melf64bmip" + ;; + esac + else + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + fi + rm -rf conftest* + ;; +x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.o` in + *32-bit*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_i386" + ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf32ppclinux" + ;; + s390x-*linux*) + LD="${LD-ld} -m elf_s390" + ;; + sparc64-*linux*) + LD="${LD-ld} -m elf32_sparc" + ;; + esac + ;; + *64-bit*) + case $host in + x86_64-*linux*) + LD="${LD-ld} -m elf_x86_64" + ;; + ppc*-*linux*|powerpc*-*linux*) + LD="${LD-ld} -m elf64ppc" + ;; + s390*-*linux*) + LD="${LD-ld} -m elf64_s390" + ;; + sparc*-*linux*) + LD="${LD-ld} -m elf64_sparc" + ;; + esac + ;; + esac + fi + rm -rf conftest* + ;; -# 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 +*-*-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 - -# These are sane defaults that work on at least a few old systems. -# [They come from Ultrix. What could be older than Ultrix?!! ;)] + 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 -# Character class describing NM global symbol codes. -symcode='[BCDEGRST]' + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -# Regexp to match symbols that can be accessed directly from C. -sympat='\([_A-Za-z][_A-Za-z0-9]*\)' +int +main () +{ -# Transform an extracted symbol line into a proper C declaration -lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" + ; + 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 -# Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + lt_cv_cc_needs_belf=no +fi -# Define system-specific variables. -case $host_os in -aix*) - symcode='[BCDT]' - ;; -cygwin* | mingw* | pw32*) - symcode='[ABCDGISTW]' +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 ;; -hpux*) # Its linker distinguishes data from code symbols - if test "$host_cpu" = ia64; then - symcode='[ABCDEGRST]' +sparc*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) LD="${LD-ld} -m elf64_sparc" ;; + *) LD="${LD-ld} -64" ;; + esac + ;; + esac fi - lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + rm -rf conftest* ;; -linux*) - if test "$host_cpu" = ia64; then - symcode='[ABCDGIRSTW]' - lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - fi - ;; -irix* | nonstopux*) - symcode='[BCDEGRST]' - ;; -osf*) - symcode='[BCDEGQRST]' - ;; -solaris*) - symcode='[BDRT]' - ;; -sco3.2v5*) - symcode='[DT]' - ;; -sysv4.2uw2*) - symcode='[DT]' - ;; -sysv5* | sco5v6* | unixware* | OpenUNIX*) - symcode='[ABDT]' - ;; -sysv4) - symcode='[DFNSTU]' - ;; -esac -# Handle CRLF in mingw tool chain -opt_cr= -case $build_os in -mingw*) - opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp - ;; -esac -# If we're using GNU nm, then use its standard symbol codes. -case `$NM -V 2>&1` in -*GNU* | *'with BFD'*) - symcode='[ABCDGIRSTW]' ;; esac -# Try without a prefix undercore, then with it. -for ac_symprfx in "" "_"; do - - # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. - symxfrm="\\1 $ac_symprfx\\2 \\2" - - # Write the raw and C identifiers. - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" - - # Check to see that the pipe works correctly. - pipe_works=no - - rm -f conftest* - cat > conftest.$ac_ext <&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # Now try to grab the symbols. - nlist=conftest.nm - if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5 - (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && test -s "$nlist"; then - # Try sorting and uniquifying the output. - if sort "$nlist" | uniq > "$nlist"T; then - mv -f "$nlist"T "$nlist" - else - rm -f "$nlist"T - fi +need_locks="$enable_libtool_lock" - # Make sure that we snagged all the symbols we need. - if grep ' nm_test_var$' "$nlist" >/dev/null; then - if grep ' nm_test_func$' "$nlist" >/dev/null; then - cat < conftest.$ac_ext -#ifdef __cplusplus -extern "C" { -#endif -EOF - # Now generate the symbol file. - eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' - cat <> conftest.$ac_ext -#if defined (__STDC__) && __STDC__ -# define lt_ptr_t void * -#else -# define lt_ptr_t char * -# define const -#endif +{ 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 -/* The mapping between symbol names and symbols. */ -const struct { - const char *name; - lt_ptr_t address; -} -lt_preloaded_symbols[] = +int +main () { -EOF - $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext - cat <<\EOF >> conftest.$ac_ext - {0, (lt_ptr_t) 0} -}; -#ifdef __cplusplus + ; + return 0; } -#endif -EOF - # Now try linking the two files. - mv conftest.$ac_objext conftstm.$ac_objext - lt_save_LIBS="$LIBS" - lt_save_CFLAGS="$CFLAGS" - LIBS="conftstm.$ac_objext" - CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +_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 -s conftest${ac_exeext}; then - pipe_works=yes - fi - LIBS="$lt_save_LIBS" - CFLAGS="$lt_save_CFLAGS" - else - echo "cannot find nm_test_func in $nlist" >&5 - fi - else - echo "cannot find nm_test_var in $nlist" >&5 - fi - else - echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 - fi - else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - fi - rm -f conftest* conftst* - - # Do not use the global_symbol_pipe unless it works. - if test "$pipe_works" = yes; then - break - else - lt_cv_sys_global_symbol_pipe= - fi -done + (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 -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 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ 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 +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 - # MS-DOS does not allow filenames that begin with a dot. - lt_cv_objdir=_libs -fi -rmdir .libs 2>/dev/null + ac_cv_header_stdc=no fi -{ echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 -echo "${ECHO_T}$lt_cv_objdir" >&6; } -objdir=$lt_cv_objdir +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 -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 - ;; +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 -# 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' +( 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 -# 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' +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 -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' +fi -# Constants: -rm="rm -f" +# On IRIX 5.3, sys/types and inttypes.h are conflicting. -# Global variables: -default_ofile=libtool -can_build_shared=yes -# All known linkers require a `.a' archive for static linking (except MSVC, -# which needs '.lib'). -libext=a -ltmain="$ac_aux_dir/ltmain.sh" -ofile="$default_ofile" -with_gnu_ld="$lt_cv_prog_gnu_ld" -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. -set dummy ${ac_tool_prefix}ar; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_AR+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$AR"; then - ac_cv_prog_AR="$AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { 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}ar" - 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 -fi -if test -z "$ac_cv_prog_AR"; then - ac_ct_AR=$AR - # Extract the first word of "ar", so it can be a program name with args. -set dummy ar; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_AR+set}" = set; then + + + +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 - if test -n "$ac_ct_AR"; then - ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. + 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 -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="ar" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS + 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_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; } +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 - 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 -else - AR="$ac_cv_prog_AR" -fi +done -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 + + +for ac_header in dlfcn.h 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 +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 - if test -n "$ac_ct_RANLIB"; then - ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. + # 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 -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 + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -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; } + ac_header_compiler=no 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 ;; +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 - RANLIB=$ac_ct_RANLIB - fi +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 - RANLIB="$ac_cv_prog_RANLIB" + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no 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 +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 - 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 - + 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 -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; } +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +@%:@define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + fi +done -fi -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 + + +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 - 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 + # 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=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 + +fi + + +ac_ext=f +ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' +ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_f77_compiler_gnu +if test -n "$ac_tool_prefix"; then + for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$F77"; then + ac_cv_prog_F77="$F77" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { 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" + ac_cv_prog_F77="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -7763,242 +7271,226 @@ 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; } +F77=$ac_cv_prog_F77 +if test -n "$F77"; then + { echo "$as_me:$LINENO: result: $F77" >&5 +echo "${ECHO_T}$F77" >&6; } else { echo "$as_me:$LINENO: result: no" >&5 echo "${ECHO_T}no" >&6; } fi - 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 + + test -n "$F77" && break + done +fi +if test -z "$F77"; then + ac_ct_F77=$F77 + for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_F77"; then + ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { 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_F77="$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_F77=$ac_cv_prog_ac_ct_F77 +if test -n "$ac_ct_F77"; then + { echo "$as_me:$LINENO: result: $ac_ct_F77" >&5 +echo "${ECHO_T}$ac_ct_F77" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$ac_ct_F77" && break +done + + if test "x$ac_ct_F77" = x; then + F77="" + 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 + F77=$ac_ct_F77 fi -else - STRIP="$ac_cv_prog_STRIP" -fi - - -old_CC="$CC" -old_CFLAGS="$CFLAGS" - -# Set sane defaults for various variables -test -z "$AR" && AR=ar -test -z "$AR_FLAGS" && AR_FLAGS=cru -test -z "$AS" && AS=as -test -z "$CC" && CC=cc -test -z "$LTCC" && LTCC=$CC -test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS -test -z "$DLLTOOL" && DLLTOOL=dlltool -test -z "$LD" && LD=ld -test -z "$LN_S" && LN_S="ln -s" -test -z "$MAGIC_CMD" && MAGIC_CMD=file -test -z "$NM" && NM=nm -test -z "$SED" && SED=sed -test -z "$OBJDUMP" && OBJDUMP=objdump -test -z "$RANLIB" && RANLIB=: -test -z "$STRIP" && STRIP=: -test -z "$ac_objext" && ac_objext=o - -# Determine commands to create old-style static archives. -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' -old_postinstall_cmds='chmod 644 $oldlib' -old_postuninstall_cmds= - -if test -n "$RANLIB"; then - case $host_os in - openbsd*) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" - ;; - *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" - ;; - esac - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi -for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` +# Provide some information about the compiler. +echo "$as_me:$LINENO: checking for Fortran 77 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); } +rm -f a.out -# Only perform the check for file, if the check method requires it -case $deplibs_check_method in -file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - { echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 -echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6; } -if test "${lt_cv_path_MAGIC_CMD+set}" = set; then +# If we don't use `.F' as extension, the preprocessor is not run on the +# input file. (Note that this only needs to work for GNU compilers.) +ac_save_ext=$ac_ext +ac_ext=F +{ echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6; } +if test "${ac_cv_f77_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - case $MAGIC_CMD in -[\\/*] | ?:[\\/]*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; -*) - lt_save_MAGIC_CMD="$MAGIC_CMD" - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" - for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/${ac_tool_prefix}file; then - lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - $EGREP "$file_magic_regex" > /dev/null; then - : - else - cat <&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org + cat >conftest.$ac_ext <<_ACEOF + program main +#ifndef __GNUC__ + choke me +#endif -EOF - fi ;; - esac - fi - break - fi - done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" - ;; + end +_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 -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; } +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_f77_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_compiler_gnu=yes else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_compiler_gnu=no 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 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_f77_compiler_gnu=$ac_compiler_gnu + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6; } +ac_ext=$ac_save_ext +ac_test_FFLAGS=${FFLAGS+set} +ac_save_FFLAGS=$FFLAGS +FFLAGS= +{ echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5 +echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6; } +if test "${ac_cv_prog_f77_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - case $MAGIC_CMD in -[\\/*] | ?:[\\/]*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; -*) - lt_save_MAGIC_CMD="$MAGIC_CMD" - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" - for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/file; then - lt_cv_path_MAGIC_CMD="$ac_dir/file" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - $EGREP "$file_magic_regex" > /dev/null; then - : - else - cat <&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org + FFLAGS=-g +cat >conftest.$ac_ext <<_ACEOF + program main -EOF - fi ;; - esac - fi - break - fi - done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" - ;; + end +_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 -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; } +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_f77_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_f77_g=yes else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 - else - MAGIC_CMD=: - fi + ac_cv_prog_f77_g=no fi - fi - ;; -esac - -enable_dlopen=no -enable_win32_dll=no +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -# 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 - - -# Check whether --with-pic was given. -if test "${with_pic+set}" = set; then - withval=$with_pic; pic_mode="$withval" +{ echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5 +echo "${ECHO_T}$ac_cv_prog_f77_g" >&6; } +if test "$ac_test_FFLAGS" = set; then + FFLAGS=$ac_save_FFLAGS +elif test $ac_cv_prog_f77_g = yes; then + if test "x$ac_cv_f77_compiler_gnu" = xyes; then + FFLAGS="-g -O2" + else + FFLAGS="-g" + fi else - pic_mode=default + if test "x$ac_cv_f77_compiler_gnu" = xyes; then + FFLAGS="-O2" + else + FFLAGS= + fi fi -test -z "$pic_mode" && pic_mode=default - -# Use C for the default configuration in the libtool script -tagname= -lt_save_CC="$CC" +G77=`test $ac_compiler_gnu = yes && echo yes` ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -8006,2254 +7498,1811 @@ 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 +# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;\n" +# 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" -# Code to be used in simple link tests -lt_simple_link_test_code='int main(){return(0);}\n' + 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; + ;; -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} + cygwin* | mingw*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + 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; + ;; -# Allow CC to be a program name with arguments. -compiler=$CC + 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 + ;; -# save warnings/boilerplate of simple test code -ac_outfile=conftest.$ac_objext -printf "$lt_simple_compile_test_code" >conftest.$ac_ext -eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_compiler_boilerplate=`cat conftest.err` -$rm conftest* + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + # If test is not a shell built-in, we'll probably end up computing a + # maximum length that is only half of the actual maximum length, but + # we can't tell. + SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} + while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \ + = "XX$teststring") >/dev/null 2>&1 && + new_result=`expr "X$teststring" : ".*" 2>&1` && + lt_cv_sys_max_cmd_len=$new_result && + test $i != 17 # 1/2 MB should be enough + do + i=`expr $i + 1` + teststring=$teststring$teststring + done + teststring= + # Add a significant safety factor because C++ compilers can tack on massive + # amounts of additional arguments before passing them to the linker. + # It appears as though 1/2 is a usable value. + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + ;; + esac -ac_outfile=conftest.$ac_objext -printf "$lt_simple_link_test_code" >conftest.$ac_ext -eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_linker_boilerplate=`cat conftest.err` -$rm conftest* +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 -## 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... -lt_prog_compiler_no_builtin_flag= -if test "$GCC" = yes; then - lt_prog_compiler_no_builtin_flag=' -fno-builtin' - -{ echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 -echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; } -if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then +# 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 - lt_cv_prog_compiler_rtti_exceptions=no - ac_outfile=conftest.$ac_objext - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="-fno-rtti -fno-exceptions" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:__oline__: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_rtti_exceptions=yes - fi - fi - $rm conftest* - -fi -{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; } - -if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then - lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" -else - : -fi + +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] -fi +# Character class describing NM global symbol codes. +symcode='[BCDEGRST]' -lt_prog_compiler_wl= -lt_prog_compiler_pic= -lt_prog_compiler_static= +# Regexp to match symbols that can be accessed directly from C. +sympat='\([_A-Za-z][_A-Za-z0-9]*\)' -{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 -echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } - - if test "$GCC" = yes; then - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_static='-static' +# Transform an extracted symbol line into a proper C declaration +lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" - 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 - ;; +# Transform an extracted symbol line into symbol name and symbol address +lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - amigaos*) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' - ;; +# Define system-specific variables. +case $host_os in +aix*) + symcode='[BCDT]' + ;; +cygwin* | mingw* | pw32*) + symcode='[ABCDGISTW]' + ;; +hpux*) # Its linker distinguishes data from code symbols + if test "$host_cpu" = ia64; then + symcode='[ABCDEGRST]' + fi + lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + ;; +linux*) + if test "$host_cpu" = ia64; then + symcode='[ABCDGIRSTW]' + lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" + lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" + fi + ;; +irix* | nonstopux*) + symcode='[BCDEGRST]' + ;; +osf*) + symcode='[BCDEGQRST]' + ;; +solaris*) + symcode='[BDRT]' + ;; +sco3.2v5*) + symcode='[DT]' + ;; +sysv4.2uw2*) + symcode='[DT]' + ;; +sysv5* | sco5v6* | unixware* | OpenUNIX*) + symcode='[ABDT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +esac - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; +# 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 - mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic='-DDLL_EXPORT' - ;; +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[ABCDGIRSTW]' ;; +esac - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic='-fno-common' - ;; +# Try without a prefix undercore, then with it. +for ac_symprfx in "" "_"; do - interix3*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. - ;; + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" - 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 - ;; + # Write the raw and C identifiers. + lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic=-Kconform_pic - fi - ;; + # Check to see that the pipe works correctly. + pipe_works=no - hpux*) - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic='-fPIC' - ;; - esac - ;; + rm -f conftest* + cat > conftest.$ac_ext <&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Now try to grab the symbols. + nlist=conftest.nm + if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5 + (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s "$nlist"; then + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" else - lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' + rm -f "$nlist"T fi - ;; - darwin*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - case $cc_basename in - xlc*) - lt_prog_compiler_pic='-qnocommon' - lt_prog_compiler_wl='-Wl,' - ;; - esac - ;; - mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic='-DDLL_EXPORT' - ;; + # Make sure that we snagged all the symbols we need. + if grep ' nm_test_var$' "$nlist" >/dev/null; then + if grep ' nm_test_func$' "$nlist" >/dev/null; then + cat < conftest.$ac_ext +#ifdef __cplusplus +extern "C" { +#endif - 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' - ;; +EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' - irix5* | irix6* | nonstopux*) - lt_prog_compiler_wl='-Wl,' - # PIC (with -KPIC) is the default. - lt_prog_compiler_static='-non_shared' - ;; + cat <> conftest.$ac_ext +#if defined (__STDC__) && __STDC__ +# define lt_ptr_t void * +#else +# define lt_ptr_t char * +# define const +#endif - newsos6) - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + lt_ptr_t address; +} +lt_preloaded_symbols[] = +{ +EOF + $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext + cat <<\EOF >> conftest.$ac_ext + {0, (lt_ptr_t) 0} +}; - linux*) - case $cc_basename in - icc* | ecc*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-static' - ;; - pgcc* | pgf77* | pgf90* | pgf95*) - # Portland Group compilers (*not* the Pentium gcc compiler, - # which looks to be a dead project) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fpic' - lt_prog_compiler_static='-Bstatic' - ;; - ccc*) - lt_prog_compiler_wl='-Wl,' - # All Alpha code is PIC. - lt_prog_compiler_static='-non_shared' - ;; - esac - ;; +#ifdef __cplusplus +} +#endif +EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_save_LIBS="$LIBS" + lt_save_CFLAGS="$CFLAGS" + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS="$lt_save_LIBS" + CFLAGS="$lt_save_CFLAGS" + else + echo "cannot find nm_test_func in $nlist" >&5 + fi + else + echo "cannot find nm_test_var in $nlist" >&5 + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 + fi + else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -f conftest* conftst* - osf3* | osf4* | osf5*) - lt_prog_compiler_wl='-Wl,' - # All OSF/1 code is PIC. - lt_prog_compiler_static='-non_shared' - ;; + # 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 - solaris*) - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - case $cc_basename in - f77* | f90* | f95*) - lt_prog_compiler_wl='-Qoption ld ';; - *) - lt_prog_compiler_wl='-Wl,';; - esac - ;; +fi - sunos4*) - lt_prog_compiler_wl='-Qoption ld ' - lt_prog_compiler_pic='-PIC' - lt_prog_compiler_static='-Bstatic' - ;; +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 - sysv4 | sysv4.2uw2* | sysv4.3*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; +{ 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 - 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 +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 -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic" >&6; } +# 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' -# -# Check to make sure the PIC flag actually works. -# -if test -n "$lt_prog_compiler_pic"; then - -{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 -echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6; } -if test "${lt_prog_compiler_pic_works+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_pic_works=no - ac_outfile=conftest.$ac_objext - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic -DPIC" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:__oline__: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_pic_works=yes - fi - fi - $rm conftest* +# Same as above, but do not quote variable references. +double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g' -fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6; } +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' -if test x"$lt_prog_compiler_pic_works" = xyes; then - case $lt_prog_compiler_pic in - "" | " "*) ;; - *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; - esac -else - lt_prog_compiler_pic= - lt_prog_compiler_can_build_shared=no -fi +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' -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 +# Constants: +rm="rm -f" -# -# Check to make sure the static flag actually works. -# -wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" -{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } -if test "${lt_prog_compiler_static_works+set}" = set; then +# Global variables: +default_ofile=libtool +can_build_shared=yes + +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a +ltmain="$ac_aux_dir/ltmain.sh" +ofile="$default_ofile" +with_gnu_ld="$lt_cv_prog_gnu_ld" + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - lt_prog_compiler_static_works=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $lt_tmp_static_flag" - printf "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The linker can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&5 - $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_static_works=yes - fi - else - lt_prog_compiler_static_works=yes - fi - fi - $rm conftest* - LDFLAGS="$save_LDFLAGS" + 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}ar" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5 -echo "${ECHO_T}$lt_prog_compiler_static_works" >&6; } - -if test x"$lt_prog_compiler_static_works" = xyes; then - : +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + { echo "$as_me:$LINENO: result: $AR" >&5 +echo "${ECHO_T}$AR" >&6; } else - lt_prog_compiler_static= + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } 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 +fi +if test -z "$ac_cv_prog_AR"; then + ac_ct_AR=$AR + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - lt_cv_prog_compiler_c_o=no - $rm -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:__oline__: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp - $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then - lt_cv_prog_compiler_c_o=yes - fi - fi - chmod u+w . 2>&5 - $rm conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files - $rm out/* && rmdir out - cd .. - rmdir conftest - $rm conftest* + 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="ar" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS fi -{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6; } +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 + 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 +else + AR="$ac_cv_prog_AR" +fi -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 +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 - need_locks=no + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi -{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } - runpath_var= - allow_undefined_flag= - enable_shared_with_static_runtimes=no - archive_cmds= - archive_expsym_cmds= - old_archive_From_new_cmds= - old_archive_from_expsyms_cmds= - export_dynamic_flag_spec= - whole_archive_flag_spec= - thread_safe_flag_spec= - hardcode_libdir_flag_spec= - hardcode_libdir_flag_spec_ld= - hardcode_libdir_separator= - hardcode_direct=no - hardcode_minus_L=no - hardcode_shlibpath_var=unsupported - link_all_deplibs=unknown - hardcode_automatic=no - module_cmds= - module_expsym_cmds= - always_export_symbols=no - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - include_expsyms= - # exclude_expsyms can be an extended regexp of symbols to exclude - # it will be wrapped by ` (' and `)$', so one must not match beginning or - # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', - # as well as any symbol that contains `d'. - exclude_expsyms="_GLOBAL_OFFSET_TABLE_" - # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out - # platforms (ab)use it in PIC code, but their linkers get confused if - # the symbol is explicitly referenced. Since portable code cannot - # rely on this symbol name, it's probably fine to never include it in - # preloaded symbol tables. - extract_expsyms_cmds= - # Just being paranoid about ensuring that cc_basename is set. - for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac +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 -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` +done +IFS=$as_save_IFS - case $host_os in - cygwin* | mingw* | pw32*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - if test "$GCC" != yes; then - with_gnu_ld=no - fi - ;; - interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) - with_gnu_ld=yes - ;; - openbsd*) - with_gnu_ld=no - ;; - esac +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 - ld_shlibs=yes - if test "$with_gnu_ld" = yes; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' + 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 - # Set some defaults for GNU ld with shared library support. These - # are reset later if shared libraries are not supported. Putting them - # here allows them to be overridden if necessary. - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' - export_dynamic_flag_spec='${wl}--export-dynamic' - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec= - fi - supports_anon_versioning=no - case `$LD -v 2>/dev/null` in - *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 - *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... - *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... - *\ 2.11.*) ;; # other 2.11 versions - *) supports_anon_versioning=yes ;; - esac +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 - # See if GNU ld supports shared libraries. - case $host_os in - aix3* | aix4* | aix5*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - ld_shlibs=no - cat <&2 +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 -*** Warning: the GNU linker, at least up to release 2.9.1, is reported -*** to be unable to reliably create shared libraries on AIX. -*** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to modify your PATH -*** so that a non-GNU linker is found, and then restart. -EOF - fi - ;; +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 - amigaos*) - archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes +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 - # Samuel A. Falvo II reports - # that the semantics of dynamic libraries on AmigaOS, at least up - # to version 4, is to share data among multiple programs linked - # with the same dynamic library. Since this doesn't match the - # behavior of shared libraries on other platforms, we can't use - # them. - ld_shlibs=no - ;; + 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 - beos*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - ld_shlibs=no - fi - ;; - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec='-L$libdir' - allow_undefined_flag=unsupported - always_export_symbols=no - enable_shared_with_static_runtimes=yes - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' +old_CC="$CC" +old_CFLAGS="$CFLAGS" - 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 - ;; +# Set sane defaults for various variables +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru +test -z "$AS" && AS=as +test -z "$CC" && CC=cc +test -z "$LTCC" && LTCC=$CC +test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS +test -z "$DLLTOOL" && DLLTOOL=dlltool +test -z "$LD" && LD=ld +test -z "$LN_S" && LN_S="ln -s" +test -z "$MAGIC_CMD" && MAGIC_CMD=file +test -z "$NM" && NM=nm +test -z "$SED" && SED=sed +test -z "$OBJDUMP" && OBJDUMP=objdump +test -z "$RANLIB" && RANLIB=: +test -z "$STRIP" && STRIP=: +test -z "$ac_objext" && ac_objext=o - interix3*) - hardcode_direct=no - hardcode_shlibpath_var=no - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - export_dynamic_flag_spec='${wl}-E' - # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. - # Instead, shared libraries are loaded at an image base (0x10000000 by - # default) and relocated if they conflict, which is a slow very memory - # consuming and fragmenting process. To avoid this, we pick a random, - # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link - # time. Moving up from 0x10000000 also allows more sbrk(2) space. - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - ;; +# Determine commands to create old-style static archives. +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= - linux*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - tmp_addflag= - case $cc_basename,$host_cpu in - pgcc*) # Portland Group C compiler - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag' - ;; - pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag -Mnomain' ;; - ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 - tmp_addflag=' -i_dynamic' ;; - efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 - tmp_addflag=' -i_dynamic -nofor_main' ;; - ifc* | ifort*) # Intel Fortran compiler - tmp_addflag=' -nofor_main' ;; - esac - archive_cmds='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +if test -n "$RANLIB"; then + case $host_os in + openbsd*) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi - if test $supports_anon_versioning = yes; then - archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - $echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - fi - else - ld_shlibs=no - fi - ;; +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - fi - ;; - solaris*) - if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then - ld_shlibs=no - cat <&2 +# Only perform the check for file, if the check method requires it +case $deplibs_check_method in +file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + { echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 +echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6; } +if test "${lt_cv_path_MAGIC_CMD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $MAGIC_CMD in +[\\/*] | ?:[\\/]*) + lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. + ;; +*) + lt_save_MAGIC_CMD="$MAGIC_CMD" + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" + for ac_dir in $ac_dummy; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/${ac_tool_prefix}file; then + lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" + if test -n "$file_magic_test_file"; then + case $deplibs_check_method in + "file_magic "*) + file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` + MAGIC_CMD="$lt_cv_path_MAGIC_CMD" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + $EGREP "$file_magic_regex" > /dev/null; then + : + else + cat <&2 -*** Warning: The 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. +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org EOF - elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no + fi ;; + esac 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 + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi -*** 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. +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 -_LT_EOF - ;; - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' +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 - ld_shlibs=no - fi - ;; - esac - ;; + cat <&2 - sunos4*) - archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; +*** 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 - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no +EOF + fi ;; + esac fi - ;; - esac - - if test "$ld_shlibs" = no; then - runpath_var= - hardcode_libdir_flag_spec= - export_dynamic_flag_spec= - whole_archive_flag_spec= + break fi - else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - allow_undefined_flag=unsupported - always_export_symbols=yes - archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - hardcode_minus_L=yes - if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - hardcode_direct=unsupported - fi - ;; - - aix4* | aix5*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - if $NM -V 2>&1 | grep 'GNU' > /dev/null; then - export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - else - export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - fi - aix_use_runtimelinking=no + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[23]|aix4.[23].*|aix5*) - for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then - aix_use_runtimelinking=yes - break - fi - done - ;; - esac +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 - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi + else + MAGIC_CMD=: + fi +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. + fi + ;; +esac - archive_cmds='' - hardcode_direct=yes - hardcode_libdir_separator=':' - link_all_deplibs=yes +enable_dlopen=no +enable_win32_dll=no - if test "$GCC" = yes; then - case $host_os in aix4.[012]|aix4.[012].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && \ - strings "$collect2name" | grep resolve_lib_name >/dev/null - then - # We have reworked collect2 - hardcode_direct=yes - else - # We have old collect2 - hardcode_direct=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - hardcode_minus_L=yes - hardcode_libdir_flag_spec='-L$libdir' - hardcode_libdir_separator= - fi - ;; - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi +# Check whether --enable-libtool-lock was given. +if test "${enable_libtool_lock+set}" = set; then + enableval=$enable_libtool_lock; +fi - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - always_export_symbols=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - allow_undefined_flag='-berok' - # Determine the default libpath from the value encoded in an empty executable. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes -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 - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi +# Check whether --with-pic was given. +if test "${with_pic+set}" = set; then + withval=$with_pic; pic_mode="$withval" else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - + pic_mode=default fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi +test -z "$pic_mode" && pic_mode=default - hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag="-z nodefs" - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an empty executable. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +# Use C for the default configuration in the libtool script +tagname= +lt_save_CC="$CC" +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu -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 - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +# Source file extension for C test sources. +ac_ext=c - -fi +# Object file extension for compiled C test sources. +objext=o +objext=$objext -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;\n" - hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - no_undefined_flag=' ${wl}-bernotok' - allow_undefined_flag=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec='$convenience' - archive_cmds_need_lc=yes - # This is similar to how AIX traditionally builds its shared libraries. - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}\n' + + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* + +ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* + + +## 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... + +lt_prog_compiler_no_builtin_flag= + +if test "$GCC" = yes; then + lt_prog_compiler_no_builtin_flag=' -fno-builtin' + + +{ echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; } +if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-fno-rtti -fno-exceptions" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:__oline__: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $rm conftest* + +fi +{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; } + +if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then + lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" +else + : +fi + +fi + +lt_prog_compiler_wl= +lt_prog_compiler_pic= +lt_prog_compiler_static= + +{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } + + if test "$GCC" = yes; then + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_static='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' fi ;; amigaos*) - archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - # see comment about different semantics on the GNU ld section - ld_shlibs=no + # 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' ;; - bsdi[45]*) - export_dynamic_flag_spec=-rdynamic + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. ;; - cygwin* | mingw* | pw32*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - hardcode_libdir_flag_spec=' ' - allow_undefined_flag=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - old_archive_From_new_cmds='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs' - fix_srcfile_path='`cygpath -w "$srcfile"`' - enable_shared_with_static_runtimes=yes + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic='-DDLL_EXPORT' ;; darwin* | rhapsody*) - case $host_os in - rhapsody* | darwin1.[012]) - allow_undefined_flag='${wl}-undefined ${wl}suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[012]) - allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - ;; - 10.*) - allow_undefined_flag='${wl}-undefined ${wl}dynamic_lookup' - ;; - esac - fi - ;; - esac - archive_cmds_need_lc=no - hardcode_direct=no - hardcode_automatic=yes - hardcode_shlibpath_var=unsupported - whole_archive_flag_spec='' - link_all_deplibs=yes - if test "$GCC" = yes ; then - output_verbose_link_cmd='echo' - archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - case $cc_basename in - xlc*) - output_verbose_link_cmd='echo' - archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' - module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - ;; - *) - ld_shlibs=no - ;; - esac - fi + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' ;; - dgux*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no + interix3*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. ;; - freebsd1*) - ld_shlibs=no + 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 ;; - # 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 + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic=-Kconform_pic + fi ;; - # 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 + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac ;; - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | kfreebsd*-gnu | dragonfly*) - archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no + *) + lt_prog_compiler_pic='-fPIC' ;; - - hpux9*) - if test "$GCC" = yes; then - archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + 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 - 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' ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + lt_prog_compiler_pic='-qnocommon' + lt_prog_compiler_wl='-Wl,' + ;; + esac + ;; - hpux10*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; - hardcode_direct=yes - export_dynamic_flag_spec='${wl}-E' + 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' + ;; - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - fi + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static='-non_shared' ;; - hpux11*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - case $host_cpu in - hppa*64*) - archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - else - case $host_cpu in - hppa*64*) - archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: + newsos6) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; - case $host_cpu in - hppa*64*|ia64*) - hardcode_libdir_flag_spec_ld='+b $libdir' - hardcode_direct=no - hardcode_shlibpath_var=no - ;; - *) - hardcode_direct=yes - export_dynamic_flag_spec='${wl}-E' + linux*) + case $cc_basename in + icc* | ecc*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + esac + ;; - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - ;; - esac - fi + osf3* | osf4* | osf5*) + lt_prog_compiler_wl='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static='-non_shared' ;; - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec_ld='-rpath $libdir' - fi - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - link_all_deplibs=yes + solaris*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + lt_prog_compiler_wl='-Qoption ld ';; + *) + lt_prog_compiler_wl='-Wl,';; + esac ;; - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no + sunos4*) + lt_prog_compiler_wl='-Qoption ld ' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' ;; - 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 + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' ;; - openbsd*) - hardcode_direct=yes - hardcode_shlibpath_var=no - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - export_dynamic_flag_spec='${wl}-E' - else - case $host_os in - openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-R$libdir' - ;; - *) - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - ;; - esac + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic='-Kconform_pic' + lt_prog_compiler_static='-Bstatic' 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' + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' ;; - osf3*) - if test "$GCC" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - fi - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: + unicos*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_can_build_shared=no ;; - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ - $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' + uts4*) + lt_prog_compiler_pic='-pic' + lt_prog_compiler_static='-Bstatic' + ;; - # Both c and cxx compiler support -rpath directly - hardcode_libdir_flag_spec='-rpath $libdir' - fi - hardcode_libdir_separator=: + *) + lt_prog_compiler_can_build_shared=no ;; + esac + fi - solaris*) - no_undefined_flag=' -z text' - if test "$GCC" = yes; then - wlarc='${wl}' - archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' - else - wlarc='' - archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' - fi - hardcode_libdir_flag_spec='-R$libdir' - hardcode_shlibpath_var=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) - # The compiler driver will combine linker options so we - # cannot just pass the convience library names through - # without $wl, iff we do not link with $LD. - # Luckily, gcc supports the same syntax we need for Sun Studio. - # Supported since Solaris 2.6 (maybe 2.5.1?) - case $wlarc in - '') - whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; - *) - whole_archive_flag_spec='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; - esac ;; - esac - link_all_deplibs=yes - ;; - - sunos4*) - if test "x$host_vendor" = xsequent; then - # Use $CC to link under sequent, because it throws in some extra .o - # files that make .init and .fini sections work. - archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - hardcode_libdir_flag_spec='-L$libdir' - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; - - sysv4) - case $host_vendor in - sni) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' - reload_cmds='$CC -r -o $output$reload_objs' - hardcode_direct=no - ;; - motorola) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var=no - ;; - - sysv4.3*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - export_dynamic_flag_spec='-Bexport' - ;; +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic" >&6; } - 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 - ;; +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic"; then + +{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6; } +if test "${lt_prog_compiler_pic_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_pic_works=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic -DPIC" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:__oline__: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_pic_works=yes + fi + fi + $rm conftest* - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) - no_undefined_flag='${wl}-z,text' - archive_cmds_need_lc=no - hardcode_shlibpath_var=no - runpath_var='LD_RUN_PATH' +fi +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6; } - 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 - ;; +if test x"$lt_prog_compiler_pic_works" = xyes; then + case $lt_prog_compiler_pic in + "" | " "*) ;; + *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; + esac +else + lt_prog_compiler_pic= + lt_prog_compiler_can_build_shared=no +fi - sysv5* | sco3.2v5* | sco5v6*) - # Note: We can NOT use -z defs as we might desire, because we do not - # link with -lc, and that would cause any symbols used from libc to - # always be unresolved, which means just about no library would - # ever link correctly. If we're not using GNU ld we use -z text - # though, which does catch some bad symbols but isn't as heavy-handed - # as -z defs. - no_undefined_flag='${wl}-z,text' - allow_undefined_flag='${wl}-z,nodefs' - archive_cmds_need_lc=no - hardcode_shlibpath_var=no - hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' - hardcode_libdir_separator=':' - link_all_deplibs=yes - export_dynamic_flag_spec='${wl}-Bexport' - runpath_var='LD_RUN_PATH' +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 - if test "$GCC" = yes; then - archive_cmds='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" +{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } +if test "${lt_prog_compiler_static_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_static_works=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + printf "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_static_works=yes + fi + else + lt_prog_compiler_static_works=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" - uts4*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; +fi +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5 +echo "${ECHO_T}$lt_prog_compiler_static_works" >&6; } - *) - ld_shlibs=no - ;; - esac - fi +if test x"$lt_prog_compiler_static_works" = xyes; then + : +else + lt_prog_compiler_static= +fi -{ echo "$as_me:$LINENO: result: $ld_shlibs" >&5 -echo "${ECHO_T}$ld_shlibs" >&6; } -test "$ld_shlibs" = no && can_build_shared=no -# -# Do we need to explicitly link libc? -# -case "x$archive_cmds_need_lc" in -x|xyes) - # Assume -lc should be added - archive_cmds_need_lc=yes +{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } +if test "${lt_cv_prog_compiler_c_o+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_c_o=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$lt_simple_compile_test_code" > conftest.$ac_ext - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $archive_cmds in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 -echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } - $rm conftest* - printf "$lt_simple_compile_test_code" > conftest.$ac_ext + 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:__oline__: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:__oline__: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $rm conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files + $rm out/* && rmdir out + cd .. + rmdir conftest + $rm conftest* - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl - pic_flag=$lt_prog_compiler_pic - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag - allow_undefined_flag= - if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 - (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - then - archive_cmds_need_lc=no - else - archive_cmds_need_lc=yes - fi - allow_undefined_flag=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $rm conftest* - { echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 -echo "${ECHO_T}$archive_cmds_need_lc" >&6; } - ;; - esac - fi - ;; -esac +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 dynamic linker characteristics" >&5 -echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } -library_names_spec= -libname_spec='lib$name' -soname_spec= -shrext_cmds=".so" -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + +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 - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" + need_locks=no fi -need_lib_prefix=unknown -hardcode_into_libs=no - -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown -case $host_os in -aix3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' - shlibpath_var=LIBPATH +{ 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; } - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' - ;; + runpath_var= + allow_undefined_flag= + enable_shared_with_static_runtimes=no + archive_cmds= + archive_expsym_cmds= + old_archive_From_new_cmds= + old_archive_from_expsyms_cmds= + export_dynamic_flag_spec= + whole_archive_flag_spec= + thread_safe_flag_spec= + hardcode_libdir_flag_spec= + hardcode_libdir_flag_spec_ld= + hardcode_libdir_separator= + hardcode_direct=no + hardcode_minus_L=no + hardcode_shlibpath_var=unsupported + link_all_deplibs=unknown + hardcode_automatic=no + module_cmds= + module_expsym_cmds= + always_export_symbols=no + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + exclude_expsyms="_GLOBAL_OFFSET_TABLE_" + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + extract_expsyms_cmds= + # Just being paranoid about ensuring that cc_basename is set. + for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` -aix4* | aix5*) - version_type=linux - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test "$host_cpu" = ia64; then - # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - aix4 | aix4.[01] | aix4.[01].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; - esac - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then - # If using run time linking (on AIX 4.2 or later) use lib.so - # instead of lib.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - else - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}${shared_ext}$major' + case $host_os in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no fi - shlibpath_var=LIBPATH - fi - ;; + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac -amigaos*) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' - ;; + ld_shlibs=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec= + fi + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac -bsdi[45]*) - version_type=linux - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs=no + cat <&2 -cygwin* | mingw* | pw32*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32*) - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname~ - chmod a+x \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $rm \$dlpath' - shlibpath_overrides_runpath=yes +EOF + fi + ;; - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + amigaos*) + archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can't use + # them. + ld_shlibs=no ;; - mingw*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + + 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 - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + ld_shlibs=no fi ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - ;; - esac - ;; - *) - library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' - ;; - esac - dynamic_linker='Win32 ld.exe' - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + allow_undefined_flag=unsupported + always_export_symbols=no + enable_shared_with_static_runtimes=yes + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' - soname_spec='${libname}${release}${major}$shared_ext' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' - # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. - if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` - else - sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' - fi - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; + 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 + ;; -dgux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; + interix3*) + hardcode_direct=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; -freebsd1*) - dynamic_linker=no - ;; + linux*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + tmp_addflag= + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + esac + archive_cmds='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' -kfreebsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='GNU ld.so' - ;; + if test $supports_anon_versioning = yes; then + archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + $echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + else + ld_shlibs=no + fi + ;; -freebsd* | dragonfly*) - # DragonFly does not have aout. When/if they implement a new - # versioning mechanism, adjust this. - if test -x /usr/bin/objformat; then - objformat=`/usr/bin/objformat` - else - case $host_os in - freebsd[123]*) objformat=aout ;; - *) objformat=elf ;; - esac - fi - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - need_version=no - need_lib_prefix=no + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi ;; - freebsd-*) - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2*) - shlibpath_overrides_runpath=yes - ;; - freebsd3.[01]* | freebsdelf3.[01]*) - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ - freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - freebsd*) # from 4.6 on - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - esac - ;; - -gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - hardcode_into_libs=yes - ;; -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - version_type=sunos - need_lib_prefix=no - need_version=no - case $host_cpu in - ia64*) - shrext_cmds='.so' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.so" - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - if test "X$HPUX_IA64_MODE" = X32; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - hppa*64*) - shrext_cmds='.sl' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.sl" - shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - *) - shrext_cmds='.sl' - dynamic_linker="$host_os dld.sl" - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - ;; - esac - # HP-UX runs *really* slowly unless shared libraries are mode 555. - postinstall_cmds='chmod 555 $lib' - ;; + solaris*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <&2 -interix3*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; +*** 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. -irix5* | irix6* | nonstopux*) - case $host_os in - nonstopux*) version_type=nonstopux ;; - *) - if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux - else - version_type=irix - fi ;; - esac - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' - case $host_os in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" - hardcode_into_libs=yes - ;; +EOF + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no - ;; + 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 -# This must be Linux ELF. -linux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes +*** 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. - # find out which ABI we are using - libsuff= - case "$host_cpu" in - x86_64*|s390x*|powerpc64*) - echo '#line __oline__ "configure"' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - case `/usr/bin/file conftest.$ac_objext` in - *64-bit*) - libsuff=64 - sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" - ;; +_LT_EOF + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; esac - fi - rm -rf conftest* - ;; - esac - - # Append ld.so.conf contents to the search path - if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" - fi + ;; - # We used to test for /lib/ld.so.1 and disable shared libraries on - # powerpc, because MkLinux only supported shared libraries with the - # GNU dynamic linker. Since this was broken with cross compilers, - # most powerpc-linux boxes support dynamic linking these days and - # people can always --disable-shared, the test was removed, and we - # assume the GNU/Linux dynamic linker is in use. - dynamic_linker='GNU/Linux ld.so' - ;; + sunos4*) + archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; -knetbsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='GNU ld.so' - ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac -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' + if test "$ld_shlibs" = no; then + runpath_var= + hardcode_libdir_flag_spec= + export_dynamic_flag_spec= + whole_archive_flag_spec= + fi else - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - -newsos6) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -nto-qnx*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -openbsd*) - version_type=sunos - sys_lib_dlsearch_path_spec="/usr/lib" - need_lib_prefix=no - # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. - case $host_os in - openbsd3.3 | openbsd3.3.*) need_version=yes ;; - *) need_version=no ;; - esac - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in - openbsd2.[89] | openbsd2.[89].*) - shlibpath_overrides_runpath=no - ;; - *) - shlibpath_overrides_runpath=yes - ;; - esac - else - shlibpath_overrides_runpath=yes - fi - ;; + 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 + ;; -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 - ;; + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no -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" - ;; + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac -solaris*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi -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 - ;; + # 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. -sysv4 | sysv4.3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - export_dynamic_flag_spec='${wl}-Blargedynsym' - runpath_var=LD_RUN_PATH - ;; - siemens) - need_lib_prefix=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; + archive_cmds='' + hardcode_direct=yes + hardcode_libdir_separator=':' + link_all_deplibs=yes -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux - library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + hardcode_direct=yes + else + # We have old collect2 + hardcode_direct=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - version_type=freebsd-elf - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - hardcode_into_libs=yes - if test "$with_gnu_ld" = yes; then - sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' - shlibpath_overrides_runpath=no - else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - shlibpath_overrides_runpath=yes - case $host_os in - sco3.2v5*) - sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" - ;; - esac - fi - sys_lib_dlsearch_path_spec='/usr/lib' - ;; + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag='-berok' + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -uts4*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -*) - dynamic_linker=no - ;; -esac -{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5 -echo "${ECHO_T}$dynamic_linker" >&6; } -test "$dynamic_linker" = no && can_build_shared=no - -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi - -{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 -echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } -hardcode_action= -if test -n "$hardcode_libdir_flag_spec" || \ - test -n "$runpath_var" || \ - test "X$hardcode_automatic" = "Xyes" ; then - - # We can hardcode non-existant directories. - if test "$hardcode_direct" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, )" != no && - test "$hardcode_minus_L" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action=unsupported -fi -{ echo "$as_me:$LINENO: result: $hardcode_action" >&5 -echo "${ECHO_T}$hardcode_action" >&6; } - -if test "$hardcode_action" = relink; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi - -striplib= -old_striplib= -{ echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 -echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6; } -if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then - test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" - test -z "$striplib" && striplib="$STRIP --strip-unneeded" - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } -else -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP" ; then - striplib="$STRIP -x" - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } - else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - ;; - *) - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } - ;; - esac -fi - -if test "x$enable_dlopen" != xyes; then - enable_dlopen=unknown - enable_dlopen_self=unknown - enable_dlopen_self_static=unknown -else - lt_cv_dlopen=no - lt_cv_dlopen_libs= - - case $host_os in - beos*) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ;; - - mingw* | pw32*) - lt_cv_dlopen="LoadLibrary" - lt_cv_dlopen_libs= - ;; - - cygwin*) - lt_cv_dlopen="dlopen" - lt_cv_dlopen_libs= - ;; - - darwin*) - # if libdl is installed we need to link against it - { echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6; } -if test "${ac_cv_lib_dl_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any 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; } @@ -10276,79 +9325,43 @@ test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - ac_cv_lib_dl_dlopen=yes + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - 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 - - ;; +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; 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 + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag="-z nodefs" + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* 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; } @@ -10371,8980 +9384,10845 @@ test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - ac_cv_func_shl_load=yes + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - 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. */ +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi -/* 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 + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag=' ${wl}-bernotok' + allow_undefined_flag=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + archive_cmds_need_lc=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; - ac_cv_lib_dld_shl_load=no -fi + amigaos*) + archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + # see comment about different semantics on the GNU ld section + ld_shlibs=no + ;; -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="-dld" -else - { echo "$as_me:$LINENO: checking for dlopen" >&5 -echo $ECHO_N "checking for dlopen... $ECHO_C" >&6; } -if test "${ac_cv_func_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define dlopen to an innocuous variant, in case declares dlopen. - For example, HP-UX 11i declares gettimeofday. */ -#define dlopen innocuous_dlopen + bsdi[45]*) + export_dynamic_flag_spec=-rdynamic + ;; -/* 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. */ + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_From_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path='`cygpath -w "$srcfile"`' + enable_shared_with_static_runtimes=yes + ;; -#ifdef __STDC__ -# include -#else -# include -#endif + darwin* | rhapsody*) + case $host_os in + rhapsody* | darwin1.[012]) + allow_undefined_flag='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[012]) + allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + allow_undefined_flag='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + fi + ;; + esac + archive_cmds_need_lc=no + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + whole_archive_flag_spec='' + link_all_deplibs=yes + if test "$GCC" = yes ; then + output_verbose_link_cmd='echo' + archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + ld_shlibs=no + ;; + esac + fi + ;; -#undef dlopen + dgux*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; -/* 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 + freebsd1*) + ld_shlibs=no + ;; -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 + # 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 + ;; - ac_cv_func_dlopen=no -fi + # 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 + ;; -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. */ + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | kfreebsd*-gnu | dragonfly*) + archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; -/* 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 + hpux9*) + if test "$GCC" = yes; then + archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes -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. */ + # 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' + ;; -/* 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 + hpux10*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: - ac_cv_lib_svld_dlopen=no -fi + hardcode_direct=yes + export_dynamic_flag_spec='${wl}-E' -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. */ + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + fi + ;; -/* 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 + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: - ac_cv_lib_dld_dld_link=no -fi + case $host_cpu in + hppa*64*|ia64*) + hardcode_libdir_flag_spec_ld='+b $libdir' + hardcode_direct=no + hardcode_shlibpath_var=no + ;; + *) + hardcode_direct=yes + export_dynamic_flag_spec='${wl}-E' -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="-dld" -fi + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; - -fi + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_ld='-rpath $libdir' + fi + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + link_all_deplibs=yes + ;; - -fi + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; - -fi + 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 + ;; - -fi + openbsd*) + hardcode_direct=yes + hardcode_shlibpath_var=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + export_dynamic_flag_spec='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-R$libdir' + ;; + *) + archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='${wl}-rpath,$libdir' + ;; + esac + fi + ;; - -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' + ;; - ;; - esac + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + fi + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; - if test "x$lt_cv_dlopen" != xno; then - enable_dlopen=yes - else - enable_dlopen=no - fi + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' - case $lt_cv_dlopen in - dlopen) - save_CPPFLAGS="$CPPFLAGS" - test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + hardcode_libdir_separator=: + ;; - save_LDFLAGS="$LDFLAGS" - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + solaris*) + no_undefined_flag=' -z text' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + wlarc='' + archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_shlibpath_var=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine linker options so we + # cannot just pass the convience library names through + # without $wl, iff we do not link with $LD. + # Luckily, gcc supports the same syntax we need for Sun Studio. + # Supported since Solaris 2.6 (maybe 2.5.1?) + case $wlarc in + '') + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; + *) + whole_archive_flag_spec='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; + esac ;; + esac + link_all_deplibs=yes + ;; - save_LIBS="$LIBS" - LIBS="$lt_cv_dlopen_libs $LIBS" + 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 + ;; - { echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 -echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6; } -if test "${lt_cv_dlopen_self+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then : - lt_cv_dlopen_self=cross -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext < -#endif + sysv4.3*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + export_dynamic_flag_spec='-Bexport' + ;; -#include + 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 + ;; -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) + no_undefined_flag='${wl}-z,text' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' -/* 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 + 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 + ;; -#ifdef __cplusplus -extern "C" void exit (int); -#endif + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag='${wl}-z,text' + allow_undefined_flag='${wl}-z,nodefs' + archive_cmds_need_lc=no + hardcode_shlibpath_var=no + hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + hardcode_libdir_separator=':' + link_all_deplibs=yes + export_dynamic_flag_spec='${wl}-Bexport' + runpath_var='LD_RUN_PATH' -void fnord() { int i=42;} -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; + if test "$GCC" = yes; then + archive_cmds='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - /* dlclose (self); */ - } - else - puts (dlerror ()); + uts4*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; - exit (status); -} -EOF - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) >&5 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; - x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; - x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; + *) + ld_shlibs=no + ;; esac - else : - # compilation failed - lt_cv_dlopen_self=no fi -fi -rm -fr conftest* - - -fi -{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 -echo "${ECHO_T}$lt_cv_dlopen_self" >&6; } - - if test "x$lt_cv_dlopen_self" = xyes; then - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" - { echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 -echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6; } -if test "${lt_cv_dlopen_self_static+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then : - lt_cv_dlopen_self_static=cross -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext < -#endif - -#include - -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif - -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif -#ifdef __cplusplus -extern "C" void exit (int); -#endif +{ echo "$as_me:$LINENO: result: $ld_shlibs" >&5 +echo "${ECHO_T}$ld_shlibs" >&6; } +test "$ld_shlibs" = no && can_build_shared=no -void fnord() { int i=42;} -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; +# +# 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 (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - /* dlclose (self); */ - } - else - puts (dlerror ()); + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } + $rm conftest* + printf "$lt_simple_compile_test_code" > conftest.$ac_ext - exit (status); -} -EOF - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 + 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); } && 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 ;; + (exit $ac_status); } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + pic_flag=$lt_prog_compiler_pic + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 + (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + then + archive_cmds_need_lc=no + else + archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + { echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 +echo "${ECHO_T}$archive_cmds_need_lc" >&6; } + ;; esac - 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 + ;; +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 +{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi +need_lib_prefix=unknown +hardcode_into_libs=no +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown -# 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 - ;; + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; aix4* | aix5*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH fi - ;; -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; } +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; -# The else clause should only fire when bootstrapping the -# libtool distribution, otherwise you forgot to ship ltmain.sh -# with your package, and you will get complaints that there are -# no rules to generate ltmain.sh. -if test -f "$ltmain"; then - # See if we are running on zsh, and set the options which allow our commands through - # without removal of \ escapes. - if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST - fi - # Now quote all the things that may contain metacharacters while being - # careful not to overquote the AC_SUBSTed values. We take copies of the - # variables and quote the copies for generation of the libtool script. - for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ - SED SHELL STRIP \ - libname_spec library_names_spec soname_spec extract_expsyms_cmds \ - old_striplib striplib file_magic_cmd finish_cmds finish_eval \ - deplibs_check_method reload_flag reload_cmds need_locks \ - lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ - lt_cv_sys_global_symbol_to_c_name_address \ - sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ - old_postinstall_cmds old_postuninstall_cmds \ - compiler \ - CC \ - LD \ - lt_prog_compiler_wl \ - lt_prog_compiler_pic \ - lt_prog_compiler_static \ - lt_prog_compiler_no_builtin_flag \ - export_dynamic_flag_spec \ - thread_safe_flag_spec \ - whole_archive_flag_spec \ - enable_shared_with_static_runtimes \ - old_archive_cmds \ - old_archive_from_new_cmds \ - predep_objects \ - postdep_objects \ - predeps \ - postdeps \ - compiler_lib_search_path \ - archive_cmds \ - archive_expsym_cmds \ - postinstall_cmds \ - postuninstall_cmds \ - old_archive_from_expsyms_cmds \ - allow_undefined_flag \ - no_undefined_flag \ - export_symbols_cmds \ - hardcode_libdir_flag_spec \ - hardcode_libdir_flag_spec_ld \ - hardcode_libdir_separator \ - hardcode_automatic \ - module_cmds \ - module_expsym_cmds \ - lt_cv_prog_compiler_c_o \ - exclude_expsyms \ - include_expsyms; do +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; - case $var in - old_archive_cmds | \ - old_archive_from_new_cmds | \ - archive_cmds | \ - archive_expsym_cmds | \ - module_cmds | \ - module_expsym_cmds | \ - old_archive_from_expsyms_cmds | \ - export_symbols_cmds | \ - extract_expsyms_cmds | reload_cmds | finish_cmds | \ - postinstall_cmds | postuninstall_cmds | \ - old_postinstall_cmds | old_postuninstall_cmds | \ - sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) - # Double-quote double-evaled strings. - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" +bsdi[45]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; - *) - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac - done + ;; - case $lt_echo in - *'\$0 --fallback-echo"') - lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; -cfgfile="${ofile}T" - trap "$rm \"$cfgfile\"; exit 1" 1 2 15 - $rm -f "$cfgfile" - { echo "$as_me:$LINENO: creating $ofile" >&5 -echo "$as_me: creating $ofile" >&6;} +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; - cat <<__EOF__ >> "$cfgfile" -#! $SHELL +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; -# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) -# NOTE: Changes made to this file will be lost: look at ltmain.sh. -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 -# Free Software Foundation, Inc. -# -# This file is part of GNU Libtool: -# Originally by Gordon Matzigkeit , 1996 -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# A sed program that does not truncate output. -SED=$lt_SED +freebsd1*) + dynamic_linker=no + ;; -# Sed that helps us avoid accidentally triggering echo(1) options like -n. -Xsed="$SED -e 1s/^X//" +kfreebsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; -# 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 +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + freebsd*) # from 4.6 on + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; -# The names of the tagged configurations supported by this script. -available_tags= +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; -# ### BEGIN LIBTOOL CONFIG +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' + ;; -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +interix3*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; -# Whether or not to build static libraries. -build_old_libs=$enable_static +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$archive_cmds_need_lc + # find out which ABI we are using + libsuff= + case "$host_cpu" in + x86_64*|s390x*|powerpc64*) + echo '#line __oline__ "configure"' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.$ac_objext` in + *64-bit*) + libsuff=64 + sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" + ;; + esac + fi + rm -rf conftest* + ;; + esac -# Whether or not to disallow shared libs when runtime libs are static -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" + fi -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install + # 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' + ;; -# 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 +knetbsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; -# An echo program that does not interpret backslashes. -echo=$lt_echo +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 + ;; -# The archiver. -AR=$lt_AR -AR_FLAGS=$lt_AR_FLAGS +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; -# A C compiler. -LTCC=$lt_LTCC +nto-qnx*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; -# LTCC compiler flags. -LTCFLAGS=$lt_LTCFLAGS +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 + ;; -# A language-specific compiler. -CC=$lt_compiler +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 + ;; -# Is the compiler the GNU C compiler? -with_gcc=$GCC +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" + ;; -gcc_dir=\`$CC -print-file-name=. | $SED 's,/\.$,,'\` -gcc_ver=\`$CC -dumpversion\` +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; -# An ERE matcher. -EGREP=$lt_EGREP +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 + ;; -# The linker used to build libraries. -LD=$lt_LD +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; -# Whether we need hard or soft links. -LN_S=$lt_LN_S +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; -# A BSD-compatible nm program. -NM=$lt_NM +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + shlibpath_overrides_runpath=no + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + shlibpath_overrides_runpath=yes + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; -# A symbol stripping program -STRIP=$lt_STRIP +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=$MAGIC_CMD +*) + 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 -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" +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 -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" +{ 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 -# Used on cygwin: assembler. -AS="$AS" + # We can hardcode non-existant directories. + if test "$hardcode_direct" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, )" != no && + test "$hardcode_minus_L" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action=unsupported +fi +{ echo "$as_me:$LINENO: result: $hardcode_action" >&5 +echo "${ECHO_T}$hardcode_action" >&6; } -# The name of the directory that contains temporary libtool files. -objdir=$objdir +if test "$hardcode_action" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl - -# Object file suffix (normally "o"). -objext="$ac_objext" - -# Old archive suffix (normally "a"). -libext="$libext" +striplib= +old_striplib= +{ echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 +echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6; } +if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then + test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" + test -z "$striplib" && striplib="$STRIP --strip-unneeded" + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } +else +# FIXME - insert some real tests, host_os isn't really good enough + case $host_os in + darwin*) + if test -n "$STRIP" ; then + striplib="$STRIP -x" + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + ;; + *) + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + ;; + esac +fi -# Shared library suffix (normally ".so"). -shrext_cmds='$shrext_cmds' +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= -# Executable file suffix (normally ""). -exeext="$exeext" + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic -pic_mode=$pic_mode + mingw* | pw32*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; -# What is the maximum length of a command? -max_cmd_len=$lt_cv_sys_max_cmd_len + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o + 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. */ -# Must we lock files when doing compilation? -need_locks=$lt_need_locks +/* 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 -# Do we need the lib prefix for modules? -need_lib_prefix=$need_lib_prefix + ac_cv_lib_dl_dlopen=no +fi -# Do we need a version for libraries? -need_version=$need_version +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 -# Whether dlopen is supported. -dlopen_support=$enable_dlopen + ;; -# Whether dlopen of programs is supported. -dlopen_self=$enable_dlopen_self + *) + { 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 -# Whether dlopen of statically linked programs is supported. -dlopen_self_static=$enable_dlopen_self_static +/* 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. */ -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_lt_prog_compiler_static +#ifdef __STDC__ +# include +#else +# include +#endif -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag +#undef shl_load -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec +/* 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 -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec +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 -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_thread_safe_flag_spec + ac_cv_func_shl_load=no +fi -# Library versioning type. -version_type=$version_type +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. */ -# Format of library name prefix. -libname_spec=$lt_libname_spec - -# List of archive names. First name is the real one, the rest are links. -# The last name is the one that the linker finds with -lNAME. -library_names_spec=$lt_library_names_spec - -# The coded name of the library, if different from the real name. -soname_spec=$lt_soname_spec - -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_old_archive_cmds -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds - -# Commands used to build and install a shared archive. -archive_cmds=$lt_archive_cmds -archive_expsym_cmds=$lt_archive_expsym_cmds -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds +/* 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 -# Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_module_cmds -module_expsym_cmds=$lt_module_expsym_cmds + ac_cv_lib_dld_shl_load=no +fi -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib +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="-dld" +else + { echo "$as_me:$LINENO: checking for dlopen" >&5 +echo $ECHO_N "checking for dlopen... $ECHO_C" >&6; } +if test "${ac_cv_func_dlopen+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define dlopen to an innocuous variant, in case declares dlopen. + For example, HP-UX 11i declares gettimeofday. */ +#define dlopen innocuous_dlopen -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects=\`echo $lt_predep_objects | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` +/* 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. */ -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects=\`echo $lt_postdep_objects | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` +#ifdef __STDC__ +# include +#else +# include +#endif -# Dependencies to place before the objects being linked to create a -# shared library. -predeps=$lt_predeps +#undef dlopen -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_postdeps +/* 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 -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=\`echo $lt_compiler_lib_search_path | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` +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 -# Method to check whether dependent libraries are shared objects. -deplibs_check_method=$lt_deplibs_check_method + ac_cv_func_dlopen=no +fi -# Command to use when deplibs_check_method == file_magic. -file_magic_cmd=$lt_file_magic_cmd +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. */ -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag +/* 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 -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag + ac_cv_lib_dl_dlopen=no +fi -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds +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. */ -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$lt_finish_eval - -# Take the output of nm and produce a listing of raw symbols and C names. -global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe +/* 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 -# Transform the output of nm in a proper C declaration -global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + ac_cv_lib_svld_dlopen=no +fi -# 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 +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. */ -# This is the shared library runtime path variable. -runpath_var=$runpath_var +/* 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 -# This is the shared library path variable. -shlibpath_var=$shlibpath_var + ac_cv_lib_dld_dld_link=no +fi -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath +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="-dld" +fi -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action + +fi -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs + +fi -# 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 + +fi -# If ld is used when linking, flag to hardcode \$libdir into -# a binary during linking. This must work even if \$libdir does -# not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld + +fi -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator + +fi -# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$hardcode_direct + ;; + esac -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$hardcode_minus_L + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" -# 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 + save_LDFLAGS="$LDFLAGS" + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" + save_LIBS="$LIBS" + LIBS="$lt_cv_dlopen_libs $LIBS" -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs + { echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 +echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6; } +if test "${lt_cv_dlopen_self+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < +#endif -# Run-time system search path for libraries -sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec +#include -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$fix_srcfile_path" +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif -# Set to yes if exported symbols are required. -always_export_symbols=$always_export_symbols +/* 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 -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds +#ifdef __cplusplus +extern "C" void exit (int); +#endif -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + else + puts (dlerror ()); -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms - -# ### END LIBTOOL CONFIG - -__EOF__ - - - case $host_os in - aix3*) - cat <<\EOF >> "$cfgfile" - -# AIX sometimes has problems with the GCC collect2 program. For some -# reason, if we set the COLLECT_NAMES environment variable, the problems -# vanish in a puff of smoke. -if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES -fi + exit (status); +} EOF - ;; - esac - - # We use sed instead of cat because bash on DJGPP gets confused if - # if finds mixed CR/LF and LF-only lines. Since sed operates in - # text mode, it properly converts lines to CR/LF. This bash problem - # is reportedly fixed, but why not run on old versions too? - sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) - - mv -f "$cfgfile" "$ofile" || \ - (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") - chmod +x "$ofile" - -else - # If there is no Makefile yet, we rely on a make rule to execute - # `config.status --recheck' to rerun these tests and create the - # libtool script then. - ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` - if test -f "$ltmain_in"; then - test -f Makefile && make "$ltmain" + 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; } -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 "x$lt_cv_dlopen_self" = xyes; then + wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" + { echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 +echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6; } +if test "${lt_cv_dlopen_self_static+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then : + lt_cv_dlopen_self_static=cross +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext < +#endif +#include -# Check whether --with-tags was given. -if test "${with_tags+set}" = set; then - withval=$with_tags; tagnames="$withval" -fi +#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 -if test -f "$ltmain" && test -n "$tagnames"; then - if test ! -f "${ofile}"; then - { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5 -echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;} - fi +#ifdef __cplusplus +extern "C" void exit (int); +#endif - if test -z "$LTCC"; then - eval "`$SHELL ${ofile} --config | grep '^LTCC='`" - if test -z "$LTCC"; then - { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5 -echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;} - else - { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5 -echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;} - fi - fi - if test -z "$LTCFLAGS"; then - eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" - fi +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; - # Extract list of available tagged configurations in $ofile. - # Note that this assumes the entire list is on one line. - available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + else + puts (dlerror ()); - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for tagname in $tagnames; do - IFS="$lt_save_ifs" - # Check whether tagname contains only valid characters - case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in - "") ;; - *) { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5 -echo "$as_me: error: invalid tag name: $tagname" >&2;} - { (exit 1); exit 1; }; } - ;; + exit (status); +} +EOF + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&5 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; + x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac + else : + # compilation failed + lt_cv_dlopen_self_static=no + fi +fi +rm -fr conftest* - if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null - then - { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5 -echo "$as_me: error: tag name \"$tagname\" already exists" >&2;} - { (exit 1); exit 1; }; } + +fi +{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 +echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6; } fi - # Update the list of available tags. - if test -n "$tagname"; then - echo appending configuration tag \"$tagname\" to $ofile - - case $tagname in - CXX) - if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then - ac_ext=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 + 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 -archive_cmds_need_lc_CXX=no -allow_undefined_flag_CXX= -always_export_symbols_CXX=no -archive_expsym_cmds_CXX= -export_dynamic_flag_spec_CXX= -hardcode_direct_CXX=no -hardcode_libdir_flag_spec_CXX= -hardcode_libdir_flag_spec_ld_CXX= -hardcode_libdir_separator_CXX= -hardcode_minus_L_CXX=no -hardcode_shlibpath_var_CXX=unsupported -hardcode_automatic_CXX=no -module_cmds_CXX= -module_expsym_cmds_CXX= -link_all_deplibs_CXX=unknown -old_archive_cmds_CXX=$old_archive_cmds -no_undefined_flag_CXX= -whole_archive_flag_spec_CXX= -enable_shared_with_static_runtimes_CXX=no +# 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; } -# 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= +{ 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 -# Source file extension for C++ test sources. -ac_ext=cpp +# 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 + ;; -# Object file extension for compiled C++ test sources. -objext=o -objext_CXX=$objext +aix4* | aix5*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; +esac +{ echo "$as_me:$LINENO: result: $enable_shared" >&5 +echo "${ECHO_T}$enable_shared" >&6; } -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;\n" +{ 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; } -# Code to be used in simple link tests -lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n' +# The else clause should only fire when bootstrapping the +# libtool distribution, otherwise you forgot to ship ltmain.sh +# with your package, and you will get complaints that there are +# no rules to generate ltmain.sh. +if test -f "$ltmain"; then + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # Now quote all the things that may contain metacharacters while being + # careful not to overquote the AC_SUBSTed values. We take copies of the + # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ + SED SHELL STRIP \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler \ + CC \ + LD \ + lt_prog_compiler_wl \ + lt_prog_compiler_pic \ + lt_prog_compiler_static \ + lt_prog_compiler_no_builtin_flag \ + export_dynamic_flag_spec \ + thread_safe_flag_spec \ + whole_archive_flag_spec \ + enable_shared_with_static_runtimes \ + old_archive_cmds \ + old_archive_from_new_cmds \ + predep_objects \ + postdep_objects \ + predeps \ + postdeps \ + compiler_lib_search_path \ + archive_cmds \ + archive_expsym_cmds \ + postinstall_cmds \ + postuninstall_cmds \ + old_archive_from_expsyms_cmds \ + allow_undefined_flag \ + no_undefined_flag \ + export_symbols_cmds \ + hardcode_libdir_flag_spec \ + hardcode_libdir_flag_spec_ld \ + hardcode_libdir_separator \ + hardcode_automatic \ + module_cmds \ + module_expsym_cmds \ + lt_cv_prog_compiler_c_o \ + exclude_expsyms \ + include_expsyms; do -# ltmain only uses $CC for tagged configurations so make sure $CC is set. + case $var in + old_archive_cmds | \ + old_archive_from_new_cmds | \ + archive_cmds | \ + archive_expsym_cmds | \ + module_cmds | \ + module_expsym_cmds | \ + old_archive_from_expsyms_cmds | \ + export_symbols_cmds | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + ;; + esac + done -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} +cfgfile="${ofile}T" + trap "$rm \"$cfgfile\"; exit 1" 1 2 15 + $rm -f "$cfgfile" + { echo "$as_me:$LINENO: creating $ofile" >&5 +echo "$as_me: creating $ofile" >&6;} -# Allow CC to be a program name with arguments. -compiler=$CC + cat <<__EOF__ >> "$cfgfile" +#! $SHELL +# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) +# NOTE: Changes made to this file will be lost: look at ltmain.sh. +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. +# +# This file is part of GNU Libtool: +# Originally by Gordon Matzigkeit , 1996 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. -# save warnings/boilerplate of simple test code -ac_outfile=conftest.$ac_objext -printf "$lt_simple_compile_test_code" >conftest.$ac_ext -eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_compiler_boilerplate=`cat conftest.err` -$rm conftest* +# A sed program that does not truncate output. +SED=$lt_SED -ac_outfile=conftest.$ac_objext -printf "$lt_simple_link_test_code" >conftest.$ac_ext -eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_linker_boilerplate=`cat conftest.err` -$rm conftest* +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="$SED -e 1s/^X//" +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH -# Allow CC to be a program name with arguments. -lt_save_CC=$CC -lt_save_LD=$LD -lt_save_GCC=$GCC -GCC=$GXX -lt_save_with_gnu_ld=$with_gnu_ld -lt_save_path_LD=$lt_cv_path_LD -if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then - lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx -else - $as_unset lt_cv_prog_gnu_ld -fi -if test -n "${lt_cv_path_LDCXX+set}"; then - lt_cv_path_LD=$lt_cv_path_LDCXX -else - $as_unset lt_cv_path_LD -fi -test -z "${LDCXX+set}" || LD=$LDCXX -CC=${CXX-"c++"} -compiler=$CC -compiler_CXX=$CC -for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` +# The names of the tagged configurations supported by this script. +available_tags= +# ### BEGIN LIBTOOL CONFIG -# We don't want -fno-exception wen compiling C++ code, so set the -# no_builtin_flag separately -if test "$GXX" = yes; then - lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' -else - lt_prog_compiler_no_builtin_flag_CXX= -fi +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: -if test "$GXX" = yes; then - # Set up default GNU C++ configuration +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL - -# 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 +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared -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 +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install - # Check if GNU C++ uses GNU ld as the underlying linker, since the - # archiving commands below assume that GNU ld is being used. - if test "$with_gnu_ld" = yes; then - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os - hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-dynamic' +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os - # 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}' +# An echo program that does not interpret backslashes. +echo=$lt_echo - # 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= +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS - # 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 +# A C compiler. +LTCC=$lt_LTCC - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS -else - GXX=no - with_gnu_ld=no - wlarc= -fi +# A language-specific compiler. +CC=$lt_compiler -# PORTME: fill in a description of your system's C++ link characteristics -{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } -ld_shlibs_CXX=yes -case $host_os in - aix3*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - aix4* | aix5*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - aix_use_runtimelinking=no +# Is the compiler the GNU C compiler? +with_gcc=$GCC - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[23]|aix4.[23].*|aix5*) - for ld_flag in $LDFLAGS; do - case $ld_flag in - *-brtl*) - aix_use_runtimelinking=yes - break - ;; - esac - done - ;; - esac +gcc_dir=\`$CC -print-file-name=. | $SED 's,/\.$,,'\` +gcc_ver=\`$CC -dumpversion\` - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi +# An ERE matcher. +EGREP=$lt_EGREP - # 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. +# The linker used to build libraries. +LD=$lt_LD - archive_cmds_CXX='' - hardcode_direct_CXX=yes - hardcode_libdir_separator_CXX=':' - link_all_deplibs_CXX=yes +# Whether we need hard or soft links. +LN_S=$lt_LN_S - if test "$GXX" = yes; then - case $host_os in aix4.[012]|aix4.[012].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && \ - strings "$collect2name" | grep resolve_lib_name >/dev/null - then - # We have reworked collect2 - hardcode_direct_CXX=yes - else - # We have old collect2 - hardcode_direct_CXX=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - hardcode_minus_L_CXX=yes - hardcode_libdir_flag_spec_CXX='-L$libdir' - hardcode_libdir_separator_CXX= - fi - ;; - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi +# A BSD-compatible nm program. +NM=$lt_NM - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - always_export_symbols_CXX=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - allow_undefined_flag_CXX='-berok' - # Determine the default libpath from the value encoded in an empty executable. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +# A symbol stripping program +STRIP=$lt_STRIP -int -main () -{ +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD - ; - 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 - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" - -fi +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi +# Used on cygwin: assembler. +AS="$AS" - hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" +# The name of the directory that contains temporary libtool files. +objdir=$objdir - archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag_CXX="-z nodefs" - archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an empty executable. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds -int -main () -{ +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl - ; - 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 - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +# Object file suffix (normally "o"). +objext="$ac_objext" - -fi +# Old archive suffix (normally "a"). +libext="$libext" -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' - hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - no_undefined_flag_CXX=' ${wl}-bernotok' - allow_undefined_flag_CXX=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec_CXX='$convenience' - archive_cmds_need_lc_CXX=yes - # This is similar to how AIX traditionally builds its shared libraries. - archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; +# Executable file suffix (normally ""). +exeext="$exeext" - 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 - ;; +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic +pic_mode=$pic_mode - chorus*) - case $cc_basename in - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec_CXX='-L$libdir' - allow_undefined_flag_CXX=unsupported - always_export_symbols_CXX=no - enable_shared_with_static_runtimes_CXX=yes +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - ld_shlibs_CXX=no - fi - ;; - darwin* | rhapsody*) - case $host_os in - rhapsody* | darwin1.[012]) - allow_undefined_flag_CXX='${wl}-undefined ${wl}suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[012]) - allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - ;; - 10.*) - allow_undefined_flag_CXX='${wl}-undefined ${wl}dynamic_lookup' - ;; - esac - fi - ;; - esac - archive_cmds_need_lc_CXX=no - hardcode_direct_CXX=no - hardcode_automatic_CXX=yes - hardcode_shlibpath_var_CXX=unsupported - whole_archive_flag_spec_CXX='' - link_all_deplibs_CXX=yes +# Must we lock files when doing compilation? +need_locks=$lt_need_locks - if test "$GXX" = yes ; then - lt_int_apple_cc_single_mod=no - output_verbose_link_cmd='echo' - if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then - lt_int_apple_cc_single_mod=yes - fi - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - else - archive_cmds_CXX='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - fi - module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - fi - module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - case $cc_basename in - xlc*) - output_verbose_link_cmd='echo' - archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' - module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - ;; - *) - ld_shlibs_CXX=no - ;; - esac - fi - ;; +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix - dgux*) - case $cc_basename in - ec++*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - ghcx*) - # Green Hills C++ Compiler - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - freebsd[12]*) - # C++ shared libraries reported to be fairly broken before switch to ELF - ld_shlibs_CXX=no - ;; - freebsd-elf*) - archive_cmds_need_lc_CXX=no - ;; - freebsd* | kfreebsd*-gnu | dragonfly*) - # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF - # conventions - ld_shlibs_CXX=yes - ;; - gnu*) - ;; - hpux9*) - hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_CXX=: - export_dynamic_flag_spec_CXX='${wl}-E' - hardcode_direct_CXX=yes - hardcode_minus_L_CXX=yes # Not in the search PATH, - # but as the default - # location of the library. +# Do we need a version for libraries? +need_version=$need_version - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - aCC*) - archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes; then - archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - fi - ;; - esac - ;; - hpux10*|hpux11*) - if test $with_gnu_ld = no; then - hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_CXX=: +# Whether dlopen is supported. +dlopen_support=$enable_dlopen - case $host_cpu in - hppa*64*|ia64*) - hardcode_libdir_flag_spec_ld_CXX='+b $libdir' - ;; - *) - export_dynamic_flag_spec_CXX='${wl}-E' - ;; - esac - fi - case $host_cpu in - hppa*64*|ia64*) - hardcode_direct_CXX=no - hardcode_shlibpath_var_CXX=no - ;; - *) - hardcode_direct_CXX=yes - hardcode_minus_L_CXX=yes # Not in the search PATH, - # but as the default - # location of the library. - ;; - esac +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - aCC*) - case $host_cpu in - hppa*64*) - archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - ia64*) - archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - *) - archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes; then - if test $with_gnu_ld = no; then - case $host_cpu in - hppa*64*) - archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - ia64*) - archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - *) - archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - fi - else - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - fi - ;; - esac - ;; - interix3*) - hardcode_direct_CXX=no - hardcode_shlibpath_var_CXX=no - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - export_dynamic_flag_spec_CXX='${wl}-E' - # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. - # Instead, shared libraries are loaded at an image base (0x10000000 by - # default) and relocated if they conflict, which is a slow very memory - # consuming and fragmenting process. To avoid this, we pick a random, - # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link - # time. Moving up from 0x10000000 also allows more sbrk(2) space. - archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - ;; - irix5* | irix6*) - case $cc_basename in - CC*) - # SGI C++ - archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static - # Archives containing C++ object files must be created using - # "CC -ar", where "CC" is the IRIX C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' - ;; - *) - if test "$GXX" = yes; then - if test "$with_gnu_ld" = no; then - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' - fi - fi - link_all_deplibs_CXX=yes - ;; - esac - hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_CXX=: - ;; - linux*) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag - hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-dynamic' +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' - ;; - icpc*) - # Intel C++ - with_gnu_ld=yes - # version 8.0 and above of icpc choke on multiply defined symbols - # if we add $predep_objects and $postdep_objects, however 7.1 and - # earlier do not add the objects themselves. - case `$CC -V 2>&1` in - *"Version 7."*) - archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - ;; - *) # Version 8.0 or newer - tmp_idyn= - case $host_cpu in - ia64*) tmp_idyn=' -i_dynamic';; - esac - archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - ;; - esac - archive_cmds_need_lc_CXX=no - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-dynamic' - whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - ;; - pgCC*) - # Portland Group C++ compiler - archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec - hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-dynamic' - whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - ;; - cxx*) - # Compaq C++ - archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec_CXX='-rpath $libdir' - hardcode_libdir_separator_CXX=: +# Library versioning type. +version_type=$version_type - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - esac - ;; - lynxos*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - m88k*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - mvs*) - case $cc_basename in - cxx*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' - wlarc= - hardcode_libdir_flag_spec_CXX='-R$libdir' - hardcode_direct_CXX=yes - hardcode_shlibpath_var_CXX=no - fi - # Workaround some broken pre-1.5 toolchains - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' - ;; - openbsd2*) - # C++ shared libraries are fairly broken - ld_shlibs_CXX=no - ;; - openbsd*) - hardcode_direct_CXX=yes - hardcode_shlibpath_var_CXX=no - archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' - export_dynamic_flag_spec_CXX='${wl}-E' - whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - fi - output_verbose_link_cmd='echo' - ;; - osf3*) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler +# Format of library name prefix. +libname_spec=$lt_libname_spec - # 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' +# 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 - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - hardcode_libdir_separator_CXX=: +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec - # 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' +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_old_archive_cmds +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds - ;; - RCC*) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - cxx*) - allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds - hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_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 - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds +archive_expsym_cmds=$lt_archive_expsym_cmds +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds - hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_CXX=: +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds +module_expsym_cmds=$lt_module_expsym_cmds - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib - else - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - fi - ;; - esac - ;; - osf4* | osf5*) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=\`echo $lt_predep_objects | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` - # 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' +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=\`echo $lt_postdep_objects | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - hardcode_libdir_separator_CXX=: +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps - # Archives containing C++ object files must be created using - # the KAI C++ compiler. - old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' - ;; - RCC*) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - cxx*) - allow_undefined_flag_CXX=' -expect_unresolved \*' - archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ - echo "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ - $rm $lib.exp' +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps - hardcode_libdir_flag_spec_CXX='-rpath $libdir' - hardcode_libdir_separator_CXX=: +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=\`echo $lt_compiler_lib_search_path | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method - hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_CXX=: +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag - else - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - fi - ;; - esac - ;; - psos*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - lcc*) - # Lucid - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - solaris*) - case $cc_basename in - CC*) - # Sun C++ 4.2, 5.x and Centerline C++ - archive_cmds_need_lc_CXX=yes - no_undefined_flag_CXX=' -zdefs' - archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag - hardcode_libdir_flag_spec_CXX='-R$libdir' - hardcode_shlibpath_var_CXX=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) - # The C++ compiler is used as linker so we must use $wl - # flag to pass the commands to the underlying system - # linker. We must also pass each convience library through - # to the system linker between allextract/defaultextract. - # The C++ compiler will combine linker options so we - # cannot just pass the convience library names through - # without $wl. - # Supported since Solaris 2.6 (maybe 2.5.1?) - whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' - ;; - esac - link_all_deplibs_CXX=yes +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds - output_verbose_link_cmd='echo' +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval - # Archives containing C++ object files must be created using - # "CC -xar", where "CC" is the Sun C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' - ;; - gcx*) - # Green Hills C++ Compiler - archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - - # The C++ compiler must be used to create the archive. - old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' - ;; - *) - # GNU C++ compiler with Solaris linker - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - no_undefined_flag_CXX=' ${wl}-z ${wl}defs' - if $CC --version | grep -v '^2\.7' > /dev/null; then - archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' +# 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 - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" - else - # g++ 2.7 appears to require `-G' NOT `-shared' on this - # platform. - archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" - fi +# 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 - hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' - fi - ;; - esac - ;; - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) - no_undefined_flag_CXX='${wl}-z,text' - archive_cmds_need_lc_CXX=no - hardcode_shlibpath_var_CXX=no - runpath_var='LD_RUN_PATH' +# This is the shared library runtime path variable. +runpath_var=$runpath_var - case $cc_basename in - CC*) - archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - ;; - sysv5* | sco3.2v5* | sco5v6*) - # Note: We can NOT use -z defs as we might desire, because we do not - # link with -lc, and that would cause any symbols used from libc to - # always be unresolved, which means just about no library would - # ever link correctly. If we're not using GNU ld we use -z text - # though, which does catch some bad symbols but isn't as heavy-handed - # as -z defs. - # For security reasons, it is highly recommended that you always - # use absolute paths for naming shared libraries, and exclude the - # DT_RUNPATH tag from executables and libraries. But doing so - # requires that you compile everything twice, which is a pain. - # So that behaviour is only enabled if SCOABSPATH is set to a - # non-empty value in the environment. Most likely only useful for - # creating official distributions of packages. - # This is a hack until libtool officially supports absolute path - # names for shared libraries. - no_undefined_flag_CXX='${wl}-z,text' - allow_undefined_flag_CXX='${wl}-z,nodefs' - archive_cmds_need_lc_CXX=no - hardcode_shlibpath_var_CXX=no - hardcode_libdir_flag_spec_CXX='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' - hardcode_libdir_separator_CXX=':' - link_all_deplibs_CXX=yes - export_dynamic_flag_spec_CXX='${wl}-Bexport' - runpath_var='LD_RUN_PATH' +# This is the shared library path variable. +shlibpath_var=$shlibpath_var - case $cc_basename in - CC*) - archive_cmds_CXX='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds_CXX='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - ;; - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - vxworks*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; -esac -{ echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 -echo "${ECHO_T}$ld_shlibs_CXX" >&6; } -test "$ld_shlibs_CXX" = no && can_build_shared=no +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath -GCC_CXX="$GXX" -LD_CXX="$LD" +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action -## 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... +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs -cat > conftest.$ac_ext <&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # Parse the compiler output and extract the necessary - # objects, libraries and library flags. +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld - # Sentinel used to keep track of whether or not we are before - # the conftest object file. - pre_test_object_deps_done=no +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator - # The `*' in the case matches for architectures that use `case' in - # $output_verbose_cmd can trigger glob expansion during the loop - # eval without this substitution. - output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"` +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct - for p in `eval $output_verbose_link_cmd`; do - case $p in +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L - -L* | -R* | -l*) - # Some compilers place space between "-{L,R}" and the path. - # Remove the space. - if test $p = "-L" \ - || test $p = "-R"; then - prev=$p - continue - else - prev= - fi +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var - if test "$pre_test_object_deps_done" = no; then - case $p in - -L* | -R*) - # Internal compiler library paths should come after those - # provided the user. The postdeps already come after the - # user supplied libs so there is no need to process them. - if test -z "$compiler_lib_search_path_CXX"; then - compiler_lib_search_path_CXX="${prev}${p}" - else - compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" - fi - ;; - # The "-l" case would never come before the object being - # linked, so don't bother handling this case. - esac - else - if test -z "$postdeps_CXX"; then - postdeps_CXX="${prev}${p}" - else - postdeps_CXX="${postdeps_CXX} ${prev}${p}" - fi - fi - ;; +# 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 - *.$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 +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" - 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 - ;; +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs - *) ;; # Ignore the rest. +# Compile-time system search path for libraries +sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` - esac - done +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec - # Clean up. - rm -f a.out a.exe -else - echo "libtool.m4: error: problem compiling CXX test program" -fi +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$fix_srcfile_path" -$rm -f confest.$objext +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols -# PORTME: override above test on systems where it is broken -case $host_os in -interix3*) - # Interix 3.5 installs completely hosed .la files for C++, so rather than - # hack all around it, let's just trust "g++" to DTRT. - predep_objects_CXX= - postdep_objects_CXX= - postdeps_CXX= - ;; +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds -solaris*) - case $cc_basename in - CC*) - # Adding this requires a known-good setup of shared libraries for - # Sun compiler versions before 5.6, else PIC objects from an old - # archive will be linked into the output, leading to subtle bugs. - postdeps_CXX='-lCstd -lCrun' +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms + +# ### END LIBTOOL CONFIG + +__EOF__ + + + case $host_os in + aix3*) + cat <<\EOF >> "$cfgfile" + +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +EOF ;; esac - ;; -esac + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) -case " $postdeps_CXX " in -*" -lc "*) archive_cmds_need_lc_CXX=no ;; -esac + mv -f "$cfgfile" "$ofile" || \ + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" -lt_prog_compiler_wl_CXX= -lt_prog_compiler_pic_CXX= -lt_prog_compiler_static_CXX= +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi +fi -{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 -echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } - - # C++ specific cases for pic, static, wl, etc. - if test "$GXX" = yes; then - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX='-static' - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_CXX='-Bstatic' - fi - ;; - amigaos*) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' - ;; - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - mingw* | os2* | pw32*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic_CXX='-DDLL_EXPORT' - ;; - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic_CXX='-fno-common' - ;; - *djgpp*) - # DJGPP does not support shared libraries at all - lt_prog_compiler_pic_CXX= - ;; - interix3*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. - ;; - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic_CXX=-Kconform_pic - fi - ;; - hpux*) - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - ;; - *) - lt_prog_compiler_pic_CXX='-fPIC' +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC="$lt_save_CC" + + +# Check whether --with-tags was given. +if test "${with_tags+set}" = set; then + withval=$with_tags; tagnames="$withval" +fi + + +if test -f "$ltmain" && test -n "$tagnames"; then + if test ! -f "${ofile}"; then + { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5 +echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;} + fi + + if test -z "$LTCC"; then + eval "`$SHELL ${ofile} --config | grep '^LTCC='`" + if test -z "$LTCC"; then + { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5 +echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;} + else + { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5 +echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;} + fi + fi + if test -z "$LTCFLAGS"; then + eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" + fi + + # Extract list of available tagged configurations in $ofile. + # Note that this assumes the entire list is on one line. + available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` + + lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," + for tagname in $tagnames; do + IFS="$lt_save_ifs" + # Check whether tagname contains only valid characters + case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in + "") ;; + *) { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5 +echo "$as_me: error: invalid tag name: $tagname" >&2;} + { (exit 1); exit 1; }; } ;; - esac - ;; - *) - lt_prog_compiler_pic_CXX='-fPIC' - ;; esac - else - case $host_os in - aix4* | aix5*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_CXX='-Bstatic' - else - lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' - fi - ;; - chorus*) - case $cc_basename in - cxch68*) - # Green Hills C++ Compiler - # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" - ;; - esac - ;; - darwin*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - case $cc_basename in - xlc*) - lt_prog_compiler_pic_CXX='-qnocommon' - lt_prog_compiler_wl_CXX='-Wl,' - ;; - esac - ;; - dgux*) - case $cc_basename in - ec++*) - lt_prog_compiler_pic_CXX='-KPIC' - ;; - ghcx*) - # Green Hills C++ Compiler - lt_prog_compiler_pic_CXX='-pic' - ;; - *) - ;; - esac - ;; - freebsd* | kfreebsd*-gnu | dragonfly*) - # FreeBSD uses GNU C++ - ;; - hpux9* | hpux10* | hpux11*) - case $cc_basename in - CC*) - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' - if test "$host_cpu" != ia64; then - lt_prog_compiler_pic_CXX='+Z' - fi - ;; - aCC*) - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic_CXX='+Z' - ;; - esac - ;; - *) - ;; - esac - ;; - interix*) - # This is c89, which is MS Visual C++ (no shared libs) - # Anyone wants to do a port? - ;; - irix5* | irix6* | nonstopux*) - case $cc_basename in - CC*) - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX='-non_shared' - # CC pic flag -KPIC is the default. - ;; - *) - ;; - esac - ;; - linux*) - case $cc_basename in - KCC*) - # KAI C++ Compiler - lt_prog_compiler_wl_CXX='--backend -Wl,' - lt_prog_compiler_pic_CXX='-fPIC' - ;; - icpc* | ecpc*) - # Intel C++ - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_pic_CXX='-KPIC' - lt_prog_compiler_static_CXX='-static' - ;; - pgCC*) - # Portland Group C++ compiler. - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_pic_CXX='-fpic' - lt_prog_compiler_static_CXX='-Bstatic' - ;; - cxx*) - # Compaq C++ - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - lt_prog_compiler_pic_CXX= - lt_prog_compiler_static_CXX='-non_shared' - ;; - *) - ;; - esac - ;; - lynxos*) - ;; - m88k*) - ;; - mvs*) - case $cc_basename in - cxx*) - lt_prog_compiler_pic_CXX='-W c,exportall' - ;; - *) - ;; - esac + + if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null + then + { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5 +echo "$as_me: error: tag name \"$tagname\" already exists" >&2;} + { (exit 1); exit 1; }; } + fi + + # Update the list of available tags. + if test -n "$tagname"; then + echo appending configuration tag \"$tagname\" to $ofile + + case $tagname in + CXX) + if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + ac_ext=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= +export_dynamic_flag_spec_CXX= +hardcode_direct_CXX=no +hardcode_libdir_flag_spec_CXX= +hardcode_libdir_flag_spec_ld_CXX= +hardcode_libdir_separator_CXX= +hardcode_minus_L_CXX=no +hardcode_shlibpath_var_CXX=unsupported +hardcode_automatic_CXX=no +module_cmds_CXX= +module_expsym_cmds_CXX= +link_all_deplibs_CXX=unknown +old_archive_cmds_CXX=$old_archive_cmds +no_undefined_flag_CXX= +whole_archive_flag_spec_CXX= +enable_shared_with_static_runtimes_CXX=no + +# Dependencies to place before and after the object being linked: +predep_objects_CXX= +postdep_objects_CXX= +predeps_CXX= +postdeps_CXX= +compiler_lib_search_path_CXX= + +# Source file extension for C++ test sources. +ac_ext=cpp + +# Object file extension for compiled C++ test sources. +objext=o +objext_CXX=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;\n" + +# Code to be used in simple link tests +lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* + +ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* + + +# Allow CC to be a program name with arguments. +lt_save_CC=$CC +lt_save_LD=$LD +lt_save_GCC=$GCC +GCC=$GXX +lt_save_with_gnu_ld=$with_gnu_ld +lt_save_path_LD=$lt_cv_path_LD +if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx +else + $as_unset lt_cv_prog_gnu_ld +fi +if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX +else + $as_unset lt_cv_path_LD +fi +test -z "${LDCXX+set}" || LD=$LDCXX +CC=${CXX-"c++"} +compiler=$CC +compiler_CXX=$CC +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + +# We don't want -fno-exception wen compiling C++ code, so set the +# no_builtin_flag separately +if test "$GXX" = yes; then + lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' +else + lt_prog_compiler_no_builtin_flag_CXX= +fi + +if test "$GXX" = yes; then + # Set up default GNU C++ configuration + + +# Check whether --with-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then + withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi + +ac_prog=ld +if test "$GCC" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + { echo "$as_me:$LINENO: checking for ld used by $CC" >&5 +echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6; } + case $host in + *-*-mingw*) + # gcc leaves a trailing carriage return which upsets mingw + ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; + *) + ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; + esac + case $ac_prog in + # Accept absolute paths. + [\\/]* | ?:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the pathname of ld + ac_prog=`echo $ac_prog| $SED 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + { echo "$as_me:$LINENO: checking for GNU ld" >&5 +echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6; } +else + { echo "$as_me:$LINENO: checking for non-GNU ld" >&5 +echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6; } +fi +if test "${lt_cv_path_LD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$LD"; then + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for ac_dir in $PATH; do + IFS="$lt_save_ifs" + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + lt_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some variants of GNU ld only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + case `"$lt_cv_path_LD" -v 2>&1 &5 +echo "${ECHO_T}$LD" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi +test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 +echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} + { (exit 1); exit 1; }; } +{ echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 +echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6; } +if test "${lt_cv_prog_gnu_ld+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 &5 +echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; } +with_gnu_ld=$lt_cv_prog_gnu_ld + + + + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test "$with_gnu_ld" = yes; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='${wl}' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ + grep 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec_CXX= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + +else + GXX=no + with_gnu_ld=no + wlarc= +fi + +# PORTME: fill in a description of your system's C++ link characteristics +{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } +ld_shlibs_CXX=yes +case $host_os in + aix3*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + case $ld_flag in + *-brtl*) + aix_use_runtimelinking=yes + break ;; - esac + esac + done ;; - 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 + esac + + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi + + # When large executables or shared objects are built, AIX ld can + # have problems creating the table of contents. If linking a library + # or program results in "error TOC overflow" add -mminimal-toc to + # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not + # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. + + archive_cmds_CXX='' + hardcode_direct_CXX=yes + hardcode_libdir_separator_CXX=':' + link_all_deplibs_CXX=yes + + if test "$GXX" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + hardcode_direct_CXX=yes + else + # We have old collect2 + hardcode_direct_CXX=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L_CXX=yes + hardcode_libdir_flag_spec_CXX='-L$libdir' + hardcode_libdir_separator_CXX= + fi ;; - vxworks*) + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols_CXX=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag_CXX='-berok' + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (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 + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" + + archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag_CXX="-z nodefs" + archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (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 + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag_CXX=' ${wl}-bernotok' + allow_undefined_flag_CXX=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_CXX='$convenience' + archive_cmds_need_lc_CXX=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag_CXX=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs_CXX=no + fi + ;; + + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_CXX='-L$libdir' + allow_undefined_flag_CXX=unsupported + always_export_symbols_CXX=no + enable_shared_with_static_runtimes_CXX=yes + + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs_CXX=no + fi + ;; + darwin* | rhapsody*) + case $host_os in + rhapsody* | darwin1.[012]) + allow_undefined_flag_CXX='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[012]) + allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + allow_undefined_flag_CXX='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + fi + ;; + esac + archive_cmds_need_lc_CXX=no + hardcode_direct_CXX=no + hardcode_automatic_CXX=yes + hardcode_shlibpath_var_CXX=unsupported + whole_archive_flag_spec_CXX='' + link_all_deplibs_CXX=yes + + if test "$GXX" = yes ; then + lt_int_apple_cc_single_mod=no + output_verbose_link_cmd='echo' + if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then + lt_int_apple_cc_single_mod=yes + fi + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + else + archive_cmds_CXX='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + fi + module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + if test "X$lt_int_apple_cc_single_mod" = Xyes ; then + archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + fi + module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + ld_shlibs_CXX=no + ;; + esac + fi + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + freebsd[12]*) + # C++ shared libraries reported to be fairly broken before switch to ELF + ld_shlibs_CXX=no + ;; + freebsd-elf*) + archive_cmds_need_lc_CXX=no + ;; + freebsd* | kfreebsd*-gnu | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + ld_shlibs_CXX=yes + ;; + gnu*) + ;; + hpux9*) + hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_CXX=: + export_dynamic_flag_spec_CXX='${wl}-E' + hardcode_direct_CXX=yes + hardcode_minus_L_CXX=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aCC*) + archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_CXX=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_libdir_flag_spec_ld_CXX='+b $libdir' + ;; + *) + export_dynamic_flag_spec_CXX='${wl}-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + hardcode_direct_CXX=no + hardcode_shlibpath_var_CXX=no + ;; + *) + hardcode_direct_CXX=yes + hardcode_minus_L_CXX=yes # Not in the search PATH, + # but as the default + # location of the library. + ;; + esac + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case $host_cpu in + hppa*64*) + archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + interix3*) + hardcode_direct_CXX=no + hardcode_shlibpath_var_CXX=no + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + export_dynamic_flag_spec_CXX='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; + irix5* | irix6*) + case $cc_basename in + CC*) + # SGI C++ + archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' + fi + fi + link_all_deplibs_CXX=yes + ;; + esac + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + ;; + linux*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + + hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' + ;; + icpc*) + # Intel C++ + with_gnu_ld=yes + # version 8.0 and above of icpc choke on multiply defined symbols + # if we add $predep_objects and $postdep_objects, however 7.1 and + # earlier do not add the objects themselves. + case `$CC -V 2>&1` in + *"Version 7."*) + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + *) # Version 8.0 or newer + tmp_idyn= + case $host_cpu in + ia64*) tmp_idyn=' -i_dynamic';; + esac + archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + archive_cmds_need_lc_CXX=no + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; + pgCC*) + # Portland Group C++ compiler + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + ;; + cxx*) + # Compaq C++ + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec_CXX='-rpath $libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + esac + ;; + lynxos*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + m88k*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + hardcode_libdir_flag_spec_CXX='-R$libdir' + hardcode_direct_CXX=yes + hardcode_shlibpath_var_CXX=no + fi + # Workaround some broken pre-1.5 toolchains + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' + ;; + openbsd2*) + # C++ shared libraries are fairly broken + ld_shlibs_CXX=no + ;; + openbsd*) + hardcode_direct_CXX=yes + hardcode_shlibpath_var_CXX=no + archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' + export_dynamic_flag_spec_CXX='${wl}-E' + whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + fi + output_verbose_link_cmd='echo' + ;; + osf3*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + hardcode_libdir_separator_CXX=: + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' + + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + cxx*) + allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + osf4* | osf5*) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' + hardcode_libdir_separator_CXX=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + cxx*) + allow_undefined_flag_CXX=' -expect_unresolved \*' + archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ + echo "-hidden">> $lib.exp~ + $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ + $rm $lib.exp' + + hardcode_libdir_flag_spec_CXX='-rpath $libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + psos*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + archive_cmds_need_lc_CXX=yes + no_undefined_flag_CXX=' -zdefs' + archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + hardcode_libdir_flag_spec_CXX='-R$libdir' + hardcode_shlibpath_var_CXX=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The C++ compiler is used as linker so we must use $wl + # flag to pass the commands to the underlying system + # linker. We must also pass each convience library through + # to the system linker between allextract/defaultextract. + # The C++ compiler will combine linker options so we + # cannot just pass the convience library names through + # without $wl. + # Supported since Solaris 2.6 (maybe 2.5.1?) + whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' + ;; + esac + link_all_deplibs_CXX=yes + + output_verbose_link_cmd='echo' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + no_undefined_flag_CXX=' ${wl}-z ${wl}defs' + if $CC --version | grep -v '^2\.7' > /dev/null; then + archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + fi + + hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' + fi + ;; + esac + ;; + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) + no_undefined_flag_CXX='${wl}-z,text' + archive_cmds_need_lc_CXX=no + hardcode_shlibpath_var_CXX=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + # For security reasons, it is highly recommended that you always + # use absolute paths for naming shared libraries, and exclude the + # DT_RUNPATH tag from executables and libraries. But doing so + # requires that you compile everything twice, which is a pain. + # So that behaviour is only enabled if SCOABSPATH is set to a + # non-empty value in the environment. Most likely only useful for + # creating official distributions of packages. + # This is a hack until libtool officially supports absolute path + # names for shared libraries. + no_undefined_flag_CXX='${wl}-z,text' + allow_undefined_flag_CXX='${wl}-z,nodefs' + archive_cmds_need_lc_CXX=no + hardcode_shlibpath_var_CXX=no + hardcode_libdir_flag_spec_CXX='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + hardcode_libdir_separator_CXX=':' + link_all_deplibs_CXX=yes + export_dynamic_flag_spec_CXX='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + archive_cmds_CXX='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + vxworks*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; +esac +{ echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 +echo "${ECHO_T}$ld_shlibs_CXX" >&6; } +test "$ld_shlibs_CXX" = no && can_build_shared=no + +GCC_CXX="$GXX" +LD_CXX="$LD" + +## 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... + +cat > conftest.$ac_ext <&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Parse the compiler output and extract the necessary + # objects, libraries and library flags. + + # Sentinel used to keep track of whether or not we are before + # the conftest object file. + pre_test_object_deps_done=no + + # The `*' in the case matches for architectures that use `case' in + # $output_verbose_cmd can trigger glob expansion during the loop + # eval without this substitution. + output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"` + + for p in `eval $output_verbose_link_cmd`; do + case $p in + + -L* | -R* | -l*) + # Some compilers place space between "-{L,R}" and the path. + # Remove the space. + if test $p = "-L" \ + || test $p = "-R"; then + prev=$p + continue + else + prev= + fi + + if test "$pre_test_object_deps_done" = no; then + case $p in + -L* | -R*) + # Internal compiler library paths should come after those + # provided the user. The postdeps already come after the + # user supplied libs so there is no need to process them. + if test -z "$compiler_lib_search_path_CXX"; then + compiler_lib_search_path_CXX="${prev}${p}" + else + compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" + fi + ;; + # The "-l" case would never come before the object being + # linked, so don't bother handling this case. + esac + else + if test -z "$postdeps_CXX"; then + postdeps_CXX="${prev}${p}" + else + postdeps_CXX="${postdeps_CXX} ${prev}${p}" + fi + fi + ;; + + *.$objext) + # This assumes that the test object file only shows up + # once in the compiler output. + if test "$p" = "conftest.$objext"; then + pre_test_object_deps_done=yes + continue + fi + + if test "$pre_test_object_deps_done" = no; then + if test -z "$predep_objects_CXX"; then + predep_objects_CXX="$p" + else + predep_objects_CXX="$predep_objects_CXX $p" + fi + else + if test -z "$postdep_objects_CXX"; then + postdep_objects_CXX="$p" + else + postdep_objects_CXX="$postdep_objects_CXX $p" + fi + fi + ;; + + *) ;; # Ignore the rest. + + esac + done + + # Clean up. + rm -f a.out a.exe +else + echo "libtool.m4: error: problem compiling CXX test program" +fi + +$rm -f confest.$objext + +# PORTME: override above test on systems where it is broken +case $host_os in +interix3*) + # Interix 3.5 installs completely hosed .la files for C++, so rather than + # hack all around it, let's just trust "g++" to DTRT. + predep_objects_CXX= + postdep_objects_CXX= + postdeps_CXX= + ;; + +solaris*) + case $cc_basename in + CC*) + # Adding this requires a known-good setup of shared libraries for + # Sun compiler versions before 5.6, else PIC objects from an old + # archive will be linked into the output, leading to subtle bugs. + postdeps_CXX='-lCstd -lCrun' + ;; + esac + ;; +esac + + +case " $postdeps_CXX " in +*" -lc "*) archive_cmds_need_lc_CXX=no ;; +esac + +lt_prog_compiler_wl_CXX= +lt_prog_compiler_pic_CXX= +lt_prog_compiler_static_CXX= + +{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } + + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_CXX='-Bstatic' + fi + ;; + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' + ;; + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | os2* | pw32*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_CXX='-DDLL_EXPORT' + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic_CXX='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + lt_prog_compiler_pic_CXX= + ;; + interix3*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic_CXX=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + esac + ;; + *) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + esac + else + case $host_os in + aix4* | aix5*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_CXX='-Bstatic' + else + lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + ;; + esac + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + lt_prog_compiler_pic_CXX='-qnocommon' + lt_prog_compiler_wl_CXX='-Wl,' + ;; + esac + ;; + dgux*) + case $cc_basename in + ec++*) + lt_prog_compiler_pic_CXX='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + lt_prog_compiler_pic_CXX='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | kfreebsd*-gnu | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' + if test "$host_cpu" != ia64; then + lt_prog_compiler_pic_CXX='+Z' + fi + ;; + aCC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_CXX='+Z' + ;; + esac + ;; + *) + ;; + esac + ;; + interix*) + # This is c89, which is MS Visual C++ (no shared libs) + # Anyone wants to do a port? + ;; + irix5* | irix6* | nonstopux*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux*) + case $cc_basename in + KCC*) + # KAI C++ Compiler + lt_prog_compiler_wl_CXX='--backend -Wl,' + lt_prog_compiler_pic_CXX='-fPIC' + ;; + icpc* | ecpc*) + # Intel C++ + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-static' + ;; + pgCC*) + # Portland Group C++ compiler. + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-fpic' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + cxx*) + # Compaq C++ + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + lt_prog_compiler_pic_CXX= + lt_prog_compiler_static_CXX='-non_shared' + ;; + *) + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + lt_prog_compiler_pic_CXX='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd*) + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + lt_prog_compiler_wl_CXX='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + lt_prog_compiler_pic_CXX='-pic' + ;; + cxx*) + # Digital/Compaq C++ + lt_prog_compiler_wl_CXX='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + lt_prog_compiler_pic_CXX= + lt_prog_compiler_static_CXX='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + lt_prog_compiler_wl_CXX='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + lt_prog_compiler_pic_CXX='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + lt_prog_compiler_pic_CXX='-pic' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + lcc*) + # Lucid + lt_prog_compiler_pic_CXX='-pic' + ;; + *) + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + lt_prog_compiler_pic_CXX='-KPIC' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + ;; + esac + ;; + vxworks*) + ;; + *) + lt_prog_compiler_can_build_shared_CXX=no + ;; + esac + fi + +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6; } + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_CXX"; then + +{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6; } +if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_pic_works_CXX=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:__oline__: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_pic_works_CXX=yes + fi + fi + $rm conftest* + +fi +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6; } + +if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then + case $lt_prog_compiler_pic_CXX in + "" | " "*) ;; + *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; + esac +else + lt_prog_compiler_pic_CXX= + lt_prog_compiler_can_build_shared_CXX=no +fi + +fi +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic_CXX= + ;; + *) + lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" + ;; +esac + +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" +{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } +if test "${lt_prog_compiler_static_works_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_static_works_CXX=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + printf "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_static_works_CXX=yes + fi + else + lt_prog_compiler_static_works_CXX=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" + +fi +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_CXX" >&5 +echo "${ECHO_T}$lt_prog_compiler_static_works_CXX" >&6; } + +if test x"$lt_prog_compiler_static_works_CXX" = xyes; then + : +else + lt_prog_compiler_static_CXX= +fi + + +{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } +if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_c_o_CXX=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + lt_compiler_flag="-o out/conftest2.$ac_objext" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:__oline__: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_CXX=yes + fi + fi + chmod u+w . 2>&5 + $rm conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files + $rm out/* && rmdir out + cd .. + rmdir conftest + $rm conftest* + +fi +{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6; } + + +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { echo "$as_me:$LINENO: result: $hard_links" >&5 +echo "${ECHO_T}$hard_links" >&6; } + if test "$hard_links" = no; then + { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi + +{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } + + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + case $host_os in + aix4* | aix5*) + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + export_symbols_cmds_CXX="$ltdll_cmds" + ;; + cygwin* | mingw*) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([^ ]*\) [^ ]*/\1 DATA/;/^I /d;/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' + ;; + *) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac + +{ echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 +echo "${ECHO_T}$ld_shlibs_CXX" >&6; } +test "$ld_shlibs_CXX" = no && can_build_shared=no + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc_CXX" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc_CXX=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds_CXX in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } + $rm conftest* + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_CXX + pic_flag=$lt_prog_compiler_pic_CXX + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_CXX + allow_undefined_flag_CXX= + if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 + (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + then + archive_cmds_need_lc_CXX=no + else + archive_cmds_need_lc_CXX=yes + fi + allow_undefined_flag_CXX=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5 +echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6; } + ;; + esac + fi + ;; +esac + +{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes + + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +kfreebsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + freebsd*) # from 4.6 on + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix3*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes + + # find out which ABI we are using + libsuff= + case "$host_cpu" in + x86_64*|s390x*|powerpc64*) + echo '#line __oline__ "configure"' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.$ac_objext` in + *64-bit*) + libsuff=64 + sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" + ;; + esac + fi + rm -rf conftest* + ;; + esac + + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" + fi + + # We used to test for /lib/ld.so.1 and disable shared libraries on + # powerpc, because MkLinux only supported shared libraries with the + # GNU dynamic linker. Since this was broken with cross compilers, + # most powerpc-linux boxes support dynamic linking these days and + # people can always --disable-shared, the test was removed, and we + # assume the GNU/Linux dynamic linker is in use. + dynamic_linker='GNU/Linux ld.so' + ;; + +knetbsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +nto-qnx*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +openbsd*) + version_type=sunos + sys_lib_dlsearch_path_spec="/usr/lib" + need_lib_prefix=no + # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. + case $host_os in + openbsd3.3 | openbsd3.3.*) need_version=yes ;; + *) need_version=no ;; + esac + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + case $host_os in + openbsd2.[89] | openbsd2.[89].*) + shlibpath_overrides_runpath=no ;; *) - lt_prog_compiler_can_build_shared_CXX=no + shlibpath_overrides_runpath=yes + ;; + esac + else + shlibpath_overrides_runpath=yes + fi + ;; + +os2*) + libname_spec='$name' + shrext_cmds=".dll" + need_lib_prefix=no + library_names_spec='$libname${shared_ext} $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + shlibpath_overrides_runpath=no + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + shlibpath_overrides_runpath=yes + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac - fi + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +*) + dynamic_linker=no + ;; +esac +{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6; } +test "$dynamic_linker" = no && can_build_shared=no + +variables_saved_for_relink="PATH $shlibpath_var $runpath_var" +if test "$GCC" = yes; then + variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" +fi + +{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } +hardcode_action_CXX= +if test -n "$hardcode_libdir_flag_spec_CXX" || \ + test -n "$runpath_var_CXX" || \ + test "X$hardcode_automatic_CXX" = "Xyes" ; then + + # We can hardcode non-existant directories. + if test "$hardcode_direct_CXX" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no && + test "$hardcode_minus_L_CXX" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action_CXX=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action_CXX=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action_CXX=unsupported +fi +{ echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5 +echo "${ECHO_T}$hardcode_action_CXX" >&6; } + +if test "$hardcode_action_CXX" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + + +# The else clause should only fire when bootstrapping the +# libtool distribution, otherwise you forgot to ship ltmain.sh +# with your package, and you will get complaints that there are +# no rules to generate ltmain.sh. +if test -f "$ltmain"; then + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # Now quote all the things that may contain metacharacters while being + # careful not to overquote the AC_SUBSTed values. We take copies of the + # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ + SED SHELL STRIP \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler_CXX \ + CC_CXX \ + LD_CXX \ + lt_prog_compiler_wl_CXX \ + lt_prog_compiler_pic_CXX \ + lt_prog_compiler_static_CXX \ + lt_prog_compiler_no_builtin_flag_CXX \ + export_dynamic_flag_spec_CXX \ + thread_safe_flag_spec_CXX \ + whole_archive_flag_spec_CXX \ + enable_shared_with_static_runtimes_CXX \ + old_archive_cmds_CXX \ + old_archive_from_new_cmds_CXX \ + predep_objects_CXX \ + postdep_objects_CXX \ + predeps_CXX \ + postdeps_CXX \ + compiler_lib_search_path_CXX \ + archive_cmds_CXX \ + archive_expsym_cmds_CXX \ + postinstall_cmds_CXX \ + postuninstall_cmds_CXX \ + old_archive_from_expsyms_cmds_CXX \ + allow_undefined_flag_CXX \ + no_undefined_flag_CXX \ + export_symbols_cmds_CXX \ + hardcode_libdir_flag_spec_CXX \ + hardcode_libdir_flag_spec_ld_CXX \ + hardcode_libdir_separator_CXX \ + hardcode_automatic_CXX \ + module_cmds_CXX \ + module_expsym_cmds_CXX \ + lt_cv_prog_compiler_c_o_CXX \ + exclude_expsyms_CXX \ + include_expsyms_CXX; do + + case $var in + old_archive_cmds_CXX | \ + old_archive_from_new_cmds_CXX | \ + archive_cmds_CXX | \ + archive_expsym_cmds_CXX | \ + module_cmds_CXX | \ + module_expsym_cmds_CXX | \ + old_archive_from_expsyms_cmds_CXX | \ + export_symbols_cmds_CXX | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + ;; + esac + done -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6; } + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac -# -# Check to make sure the PIC flag actually works. -# -if test -n "$lt_prog_compiler_pic_CXX"; then - -{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 -echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6; } -if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_pic_works_CXX=no - ac_outfile=conftest.$ac_objext - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:__oline__: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_pic_works_CXX=yes - fi - fi - $rm conftest* +cfgfile="$ofile" -fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6; } + cat <<__EOF__ >> "$cfgfile" +# ### BEGIN LIBTOOL TAG CONFIG: $tagname -if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then - case $lt_prog_compiler_pic_CXX in - "" | " "*) ;; - *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; - esac -else - lt_prog_compiler_pic_CXX= - lt_prog_compiler_can_build_shared_CXX=no -fi +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: -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 +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL -# -# Check to make sure the static flag actually works. -# -wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" -{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } -if test "${lt_prog_compiler_static_works_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_static_works_CXX=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $lt_tmp_static_flag" - printf "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The linker can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&5 - $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_static_works_CXX=yes - fi - else - lt_prog_compiler_static_works_CXX=yes - fi - fi - $rm conftest* - LDFLAGS="$save_LDFLAGS" +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared -fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_CXX" >&5 -echo "${ECHO_T}$lt_prog_compiler_static_works_CXX" >&6; } +# Whether or not to build static libraries. +build_old_libs=$enable_static -if test x"$lt_prog_compiler_static_works_CXX" = xyes; then - : -else - lt_prog_compiler_static_CXX= -fi +# 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 -{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 -echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } -if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_prog_compiler_c_o_CXX=no - $rm -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - printf "$lt_simple_compile_test_code" > conftest.$ac_ext +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install - 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:__oline__: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:__oline__: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp - $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then - lt_cv_prog_compiler_c_o_CXX=yes - fi - fi - chmod u+w . 2>&5 - $rm conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files - $rm out/* && rmdir out - cd .. - rmdir conftest - $rm conftest* +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os + +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os + +# An echo program that does not interpret backslashes. +echo=$lt_echo + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# A C compiler. +LTCC=$lt_LTCC + +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS + +# A language-specific compiler. +CC=$lt_compiler_CXX + +# Is the compiler the GNU C compiler? +with_gcc=$GCC_CXX + +gcc_dir=\`$CC -print-file-name=. | $SED 's,/\.$,,'\` +gcc_ver=\`$CC -dumpversion\` + +# An ERE matcher. +EGREP=$lt_EGREP + +# The linker used to build libraries. +LD=$lt_LD_CXX + +# Whether we need hard or soft links. +LN_S=$lt_LN_S + +# A BSD-compatible nm program. +NM=$lt_NM + +# A symbol stripping program +STRIP=$lt_STRIP + +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" -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; } +# Used on cygwin: assembler. +AS="$AS" +# The name of the directory that contains temporary libtool files. +objdir=$objdir -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 +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds -{ 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; } +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_CXX - export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - case $host_os in - aix4* | aix5*) - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - if $NM -V 2>&1 | grep 'GNU' > /dev/null; then - export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - else - export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - fi - ;; - pw32*) - export_symbols_cmds_CXX="$ltdll_cmds" - ;; - cygwin* | mingw*) - export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([^ ]*\) [^ ]*/\1 DATA/;/^I /d;/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' - ;; - *) - export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - ;; - esac +# Object file suffix (normally "o"). +objext="$ac_objext" -{ 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 +# Old archive suffix (normally "a"). +libext="$libext" -# -# 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 +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $archive_cmds_CXX in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 -echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } - $rm conftest* - printf "$lt_simple_compile_test_code" > conftest.$ac_ext +# Executable file suffix (normally ""). +exeext="$exeext" - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl_CXX - pic_flag=$lt_prog_compiler_pic_CXX - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag_CXX - allow_undefined_flag_CXX= - if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 - (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - then - archive_cmds_need_lc_CXX=no - else - archive_cmds_need_lc_CXX=yes - fi - allow_undefined_flag_CXX=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $rm conftest* - { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5 -echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6; } - ;; - esac - fi - ;; -esac +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_CXX +pic_mode=$pic_mode -{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 -echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } -library_names_spec= -libname_spec='lib$name' -soname_spec= -shrext_cmds=".so" -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi -need_lib_prefix=unknown -hardcode_into_libs=no +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX -case $host_os in -aix3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' - shlibpath_var=LIBPATH +# Must we lock files when doing compilation? +need_locks=$lt_need_locks - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' - ;; +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix -aix4* | aix5*) - version_type=linux - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test "$host_cpu" = ia64; then - # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - aix4 | aix4.[01] | aix4.[01].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; - esac - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then - # If using run time linking (on AIX 4.2 or later) use lib.so - # instead of lib.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - else - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}${shared_ext}$major' - fi - shlibpath_var=LIBPATH - fi - ;; +# Do we need a version for libraries? +need_version=$need_version -amigaos*) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' - ;; +# Whether dlopen is supported. +dlopen_support=$enable_dlopen -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_CXX + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX -bsdi[45]*) - version_type=linux - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; +# Library versioning type. +version_type=$version_type -cygwin* | mingw* | pw32*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no +# Format of library name prefix. +libname_spec=$lt_libname_spec - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32*) - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname~ - chmod a+x \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $rm \$dlpath' - shlibpath_overrides_runpath=yes +# 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 - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" - ;; - mingw*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - ;; - esac - ;; +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec - *) - library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' - ;; - esac - dynamic_linker='Win32 ld.exe' - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_old_archive_cmds_CXX +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' - soname_spec='${libname}${release}${major}$shared_ext' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' - # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. - if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` - else - sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' - fi - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX -dgux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; +# 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 -freebsd1*) - dynamic_linker=no - ;; +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds_CXX +archive_expsym_cmds=$lt_archive_expsym_cmds_CXX +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds -kfreebsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='GNU ld.so' - ;; +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds_CXX +module_expsym_cmds=$lt_module_expsym_cmds_CXX -freebsd* | dragonfly*) - # DragonFly does not have aout. When/if they implement a new - # versioning mechanism, adjust this. - if test -x /usr/bin/objformat; then - objformat=`/usr/bin/objformat` - else - case $host_os in - freebsd[123]*) objformat=aout ;; - *) objformat=elf ;; - esac - fi - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2*) - shlibpath_overrides_runpath=yes - ;; - freebsd3.[01]* | freebsdelf3.[01]*) - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ - freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - freebsd*) # from 4.6 on - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - esac - ;; +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib -gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - hardcode_into_libs=yes - ;; +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=\`echo $lt_predep_objects_CXX | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` -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' - ;; +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=\`echo $lt_postdep_objects_CXX | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` -interix3*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps_CXX + +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps_CXX -irix5* | irix6* | nonstopux*) - case $host_os in - nonstopux*) version_type=nonstopux ;; - *) - if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux - else - version_type=irix - fi ;; - esac - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' - case $host_os in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" - hardcode_into_libs=yes - ;; +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_CXX | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no - ;; +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method -# This must be Linux ELF. -linux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd - # find out which ABI we are using - libsuff= - case "$host_cpu" in - x86_64*|s390x*|powerpc64*) - echo '#line __oline__ "configure"' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - case `/usr/bin/file conftest.$ac_objext` in - *64-bit*) - libsuff=64 - sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" - ;; - esac - fi - rm -rf conftest* - ;; - esac +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_CXX - # Append ld.so.conf contents to the search path - if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" - fi +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_CXX - # 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' - ;; +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds -knetbsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='GNU ld.so' - ;; +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval -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 - ;; +# 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 -newsos6) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl -nto-qnx*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; +# 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 -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 - ;; +# This is the shared library runtime path variable. +runpath_var=$runpath_var -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 - ;; +# This is the shared library path variable. +shlibpath_var=$shlibpath_var -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" - ;; +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath -solaris*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_CXX -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 - ;; +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs -sysv4 | sysv4.3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - export_dynamic_flag_spec='${wl}-Blargedynsym' - runpath_var=LD_RUN_PATH - ;; - siemens) - need_lib_prefix=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; +# 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 -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux - library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - version_type=freebsd-elf - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - hardcode_into_libs=yes - if test "$with_gnu_ld" = yes; then - sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' - shlibpath_overrides_runpath=no - else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - shlibpath_overrides_runpath=yes - case $host_os in - sco3.2v5*) - sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" - ;; - esac - fi - sys_lib_dlsearch_path_spec='/usr/lib' - ;; +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX -uts4*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct_CXX -*) - 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 +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L_CXX -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 +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX -{ 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 +# 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 - # We can hardcode non-existant directories. - if test "$hardcode_direct_CXX" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no && - test "$hardcode_minus_L_CXX" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action_CXX=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action_CXX=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action_CXX=unsupported -fi -{ echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5 -echo "${ECHO_T}$hardcode_action_CXX" >&6; } +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" -if test "$hardcode_action_CXX" = relink; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_CXX +# Compile-time system search path for libraries +sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` -# The else clause should only fire when bootstrapping the -# libtool distribution, otherwise you forgot to ship ltmain.sh -# with your package, and you will get complaints that there are -# no rules to generate ltmain.sh. -if test -f "$ltmain"; then - # See if we are running on zsh, and set the options which allow our commands through - # without removal of \ escapes. - if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST - fi - # Now quote all the things that may contain metacharacters while being - # careful not to overquote the AC_SUBSTed values. We take copies of the - # variables and quote the copies for generation of the libtool script. - for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ - SED SHELL STRIP \ - libname_spec library_names_spec soname_spec extract_expsyms_cmds \ - old_striplib striplib file_magic_cmd finish_cmds finish_eval \ - deplibs_check_method reload_flag reload_cmds need_locks \ - lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ - lt_cv_sys_global_symbol_to_c_name_address \ - sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ - old_postinstall_cmds old_postuninstall_cmds \ - compiler_CXX \ - CC_CXX \ - LD_CXX \ - lt_prog_compiler_wl_CXX \ - lt_prog_compiler_pic_CXX \ - lt_prog_compiler_static_CXX \ - lt_prog_compiler_no_builtin_flag_CXX \ - export_dynamic_flag_spec_CXX \ - thread_safe_flag_spec_CXX \ - whole_archive_flag_spec_CXX \ - enable_shared_with_static_runtimes_CXX \ - old_archive_cmds_CXX \ - old_archive_from_new_cmds_CXX \ - predep_objects_CXX \ - postdep_objects_CXX \ - predeps_CXX \ - postdeps_CXX \ - compiler_lib_search_path_CXX \ - archive_cmds_CXX \ - archive_expsym_cmds_CXX \ - postinstall_cmds_CXX \ - postuninstall_cmds_CXX \ - old_archive_from_expsyms_cmds_CXX \ - allow_undefined_flag_CXX \ - no_undefined_flag_CXX \ - export_symbols_cmds_CXX \ - hardcode_libdir_flag_spec_CXX \ - hardcode_libdir_flag_spec_ld_CXX \ - hardcode_libdir_separator_CXX \ - hardcode_automatic_CXX \ - module_cmds_CXX \ - module_expsym_cmds_CXX \ - lt_cv_prog_compiler_c_o_CXX \ - exclude_expsyms_CXX \ - include_expsyms_CXX; do +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec - case $var in - old_archive_cmds_CXX | \ - old_archive_from_new_cmds_CXX | \ - archive_cmds_CXX | \ - archive_expsym_cmds_CXX | \ - module_cmds_CXX | \ - module_expsym_cmds_CXX | \ - old_archive_from_expsyms_cmds_CXX | \ - export_symbols_cmds_CXX | \ - extract_expsyms_cmds | reload_cmds | finish_cmds | \ - postinstall_cmds | postuninstall_cmds | \ - old_postinstall_cmds | old_postuninstall_cmds | \ - sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) - # Double-quote double-evaled strings. - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" - ;; - *) - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" - ;; - esac - done +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$fix_srcfile_path_CXX" - case $lt_echo in - *'\$0 --fallback-echo"') - lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` - ;; - esac +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols_CXX -cfgfile="$ofile" +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_CXX - cat <<__EOF__ >> "$cfgfile" -# ### BEGIN LIBTOOL TAG CONFIG: $tagname +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_CXX -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_CXX -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared +# ### END LIBTOOL TAG CONFIG: $tagname -# Whether or not to build static libraries. -build_old_libs=$enable_static +__EOF__ -# 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 +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi +fi -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install -# The host system. -host_alias=$host_alias -host=$host -host_os=$host_os +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC=$lt_save_CC +LDCXX=$LD +LD=$lt_save_LD +GCC=$lt_save_GCC +with_gnu_ldcxx=$with_gnu_ld +with_gnu_ld=$lt_save_with_gnu_ld +lt_cv_path_LDCXX=$lt_cv_path_LD +lt_cv_path_LD=$lt_save_path_LD +lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld +lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld + + else + tagname="" + fi + ;; + + F77) + if test -n "$F77" && test "X$F77" != "Xno"; then + +ac_ext=f +ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' +ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_f77_compiler_gnu + -# The build system. -build_alias=$build_alias -build=$build -build_os=$build_os +archive_cmds_need_lc_F77=no +allow_undefined_flag_F77= +always_export_symbols_F77=no +archive_expsym_cmds_F77= +export_dynamic_flag_spec_F77= +hardcode_direct_F77=no +hardcode_libdir_flag_spec_F77= +hardcode_libdir_flag_spec_ld_F77= +hardcode_libdir_separator_F77= +hardcode_minus_L_F77=no +hardcode_automatic_F77=no +module_cmds_F77= +module_expsym_cmds_F77= +link_all_deplibs_F77=unknown +old_archive_cmds_F77=$old_archive_cmds +no_undefined_flag_F77= +whole_archive_flag_spec_F77= +enable_shared_with_static_runtimes_F77=no -# An echo program that does not interpret backslashes. -echo=$lt_echo +# Source file extension for f77 test sources. +ac_ext=f -# The archiver. -AR=$lt_AR -AR_FLAGS=$lt_AR_FLAGS +# Object file extension for compiled f77 test sources. +objext=o +objext_F77=$objext -# A C compiler. -LTCC=$lt_LTCC +# Code to be used in simple compile tests +lt_simple_compile_test_code=" subroutine t\n return\n end\n" -# LTCC compiler flags. -LTCFLAGS=$lt_LTCFLAGS +# Code to be used in simple link tests +lt_simple_link_test_code=" program t\n end\n" -# A language-specific compiler. -CC=$lt_compiler_CXX +# ltmain only uses $CC for tagged configurations so make sure $CC is set. -# Is the compiler the GNU C compiler? -with_gcc=$GCC_CXX +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} -gcc_dir=\`$CC -print-file-name=. | $SED 's,/\.$,,'\` -gcc_ver=\`$CC -dumpversion\` +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} -# An ERE matcher. -EGREP=$lt_EGREP +# Allow CC to be a program name with arguments. +compiler=$CC -# The linker used to build libraries. -LD=$lt_LD_CXX -# Whether we need hard or soft links. -LN_S=$lt_LN_S +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* -# A BSD-compatible nm program. -NM=$lt_NM +ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* -# A symbol stripping program -STRIP=$lt_STRIP -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=$MAGIC_CMD +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +CC=${F77-"f77"} +compiler=$CC +compiler_F77=$CC +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" +{ 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; } -# Used on cygwin: assembler. -AS="$AS" +{ 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 -# The name of the directory that contains temporary libtool files. -objdir=$objdir +# On AIX, shared libraries and static libraries use the same namespace, and +# are all built from PIC. +case $host_os in +aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; +aix4* | aix5*) + if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then + test "$enable_shared" = yes && enable_static=no + fi + ;; +esac +{ echo "$as_me:$LINENO: result: $enable_shared" >&5 +echo "${ECHO_T}$enable_shared" >&6; } -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds +{ 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; } -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl_CXX +GCC_F77="$G77" +LD_F77="$LD" -# Object file suffix (normally "o"). -objext="$ac_objext" +lt_prog_compiler_wl_F77= +lt_prog_compiler_pic_F77= +lt_prog_compiler_static_F77= -# Old archive suffix (normally "a"). -libext="$libext" +{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } + + if test "$GCC" = yes; then + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_static_F77='-static' -# Shared library suffix (normally ".so"). -shrext_cmds='$shrext_cmds' + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_F77='-Bstatic' + fi + ;; -# Executable file suffix (normally ""). -exeext="$exeext" + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4' + ;; -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic_CXX -pic_mode=$pic_mode + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; -# What is the maximum length of a command? -max_cmd_len=$lt_cv_sys_max_cmd_len + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_F77='-DDLL_EXPORT' + ;; -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic_F77='-fno-common' + ;; -# Must we lock files when doing compilation? -need_locks=$lt_need_locks + interix3*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; -# Do we need the lib prefix for modules? -need_lib_prefix=$need_lib_prefix + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared_F77=no + enable_shared=no + ;; -# Do we need a version for libraries? -need_version=$need_version + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic_F77=-Kconform_pic + fi + ;; -# Whether dlopen is supported. -dlopen_support=$enable_dlopen + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_F77='-fPIC' + ;; + esac + ;; -# Whether dlopen of programs is supported. -dlopen_self=$enable_dlopen_self + *) + lt_prog_compiler_pic_F77='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl_F77='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_F77='-Bstatic' + else + lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp' + fi + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + lt_prog_compiler_pic_F77='-qnocommon' + lt_prog_compiler_wl_F77='-Wl,' + ;; + esac + ;; -# Whether dlopen of statically linked programs is supported. -dlopen_self_static=$enable_dlopen_self_static + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_F77='-DDLL_EXPORT' + ;; -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_lt_prog_compiler_static_CXX + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl_F77='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_F77='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static_F77='${wl}-a ${wl}archive' + ;; -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl_F77='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static_F77='-non_shared' + ;; -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX + newsos6) + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-Bstatic' + ;; -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX + linux*) + case $cc_basename in + icc* | ecc*) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_pic_F77='-fpic' + lt_prog_compiler_static_F77='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl_F77='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static_F77='-non_shared' + ;; + esac + ;; -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX + osf3* | osf4* | osf5*) + lt_prog_compiler_wl_F77='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static_F77='-non_shared' + ;; -# Library versioning type. -version_type=$version_type + solaris*) + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + lt_prog_compiler_wl_F77='-Qoption ld ';; + *) + lt_prog_compiler_wl_F77='-Wl,';; + esac + ;; -# Format of library name prefix. -libname_spec=$lt_libname_spec + sunos4*) + lt_prog_compiler_wl_F77='-Qoption ld ' + lt_prog_compiler_pic_F77='-PIC' + lt_prog_compiler_static_F77='-Bstatic' + ;; -# 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 + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-Bstatic' + ;; -# The coded name of the library, if different from the real name. -soname_spec=$lt_soname_spec + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic_F77='-Kconform_pic' + lt_prog_compiler_static_F77='-Bstatic' + fi + ;; -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_old_archive_cmds_CXX -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_pic_F77='-KPIC' + lt_prog_compiler_static_F77='-Bstatic' + ;; -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX + unicos*) + lt_prog_compiler_wl_F77='-Wl,' + lt_prog_compiler_can_build_shared_F77=no + ;; -# 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 + uts4*) + lt_prog_compiler_pic_F77='-pic' + lt_prog_compiler_static_F77='-Bstatic' + ;; -# Commands used to build and install a shared archive. -archive_cmds=$lt_archive_cmds_CXX -archive_expsym_cmds=$lt_archive_expsym_cmds_CXX -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds + *) + lt_prog_compiler_can_build_shared_F77=no + ;; + esac + fi -# Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_module_cmds_CXX -module_expsym_cmds=$lt_module_expsym_cmds_CXX +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6; } -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_F77"; then + +{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6; } +if test "${lt_prog_compiler_pic_works_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_pic_works_F77=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic_F77" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:__oline__: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_pic_works_F77=yes + fi + fi + $rm conftest* -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects=\`echo $lt_predep_objects_CXX | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` +fi +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6; } -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects=\`echo $lt_postdep_objects_CXX | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` +if test x"$lt_prog_compiler_pic_works_F77" = xyes; then + case $lt_prog_compiler_pic_F77 in + "" | " "*) ;; + *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;; + esac +else + lt_prog_compiler_pic_F77= + lt_prog_compiler_can_build_shared_F77=no +fi -# Dependencies to place before the objects being linked to create a -# shared library. -predeps=$lt_predeps_CXX +fi +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic_F77= + ;; + *) + lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77" + ;; +esac -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_postdeps_CXX +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl_F77 eval lt_tmp_static_flag=\"$lt_prog_compiler_static_F77\" +{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } +if test "${lt_prog_compiler_static_works_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_static_works_F77=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + printf "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_static_works_F77=yes + fi + else + lt_prog_compiler_static_works_F77=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_CXX | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` +fi +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_F77" >&5 +echo "${ECHO_T}$lt_prog_compiler_static_works_F77" >&6; } -# Method to check whether dependent libraries are shared objects. -deplibs_check_method=$lt_deplibs_check_method +if test x"$lt_prog_compiler_static_works_F77" = xyes; then + : +else + lt_prog_compiler_static_F77= +fi -# Command to use when deplibs_check_method == file_magic. -file_magic_cmd=$lt_file_magic_cmd -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag_CXX +{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } +if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_c_o_F77=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$lt_simple_compile_test_code" > conftest.$ac_ext -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag_CXX + 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:__oline__: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:__oline__: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_F77=yes + fi + fi + chmod u+w . 2>&5 + $rm conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files + $rm out/* && rmdir out + cd .. + rmdir conftest + $rm conftest* -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds +fi +{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6; } -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$lt_finish_eval -# Take the output of nm and produce a listing of raw symbols and C names. -global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { echo "$as_me:$LINENO: result: $hard_links" >&5 +echo "${ECHO_T}$hard_links" >&6; } + if test "$hard_links" = no; then + { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi -# Transform the output of nm in a proper C declaration -global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl +{ 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; } -# 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 + runpath_var= + allow_undefined_flag_F77= + enable_shared_with_static_runtimes_F77=no + archive_cmds_F77= + archive_expsym_cmds_F77= + old_archive_From_new_cmds_F77= + old_archive_from_expsyms_cmds_F77= + export_dynamic_flag_spec_F77= + whole_archive_flag_spec_F77= + thread_safe_flag_spec_F77= + hardcode_libdir_flag_spec_F77= + hardcode_libdir_flag_spec_ld_F77= + hardcode_libdir_separator_F77= + hardcode_direct_F77=no + hardcode_minus_L_F77=no + hardcode_shlibpath_var_F77=unsupported + link_all_deplibs_F77=unknown + hardcode_automatic_F77=no + module_cmds_F77= + module_expsym_cmds_F77= + always_export_symbols_F77=no + export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms_F77= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + exclude_expsyms_F77="_GLOBAL_OFFSET_TABLE_" + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + extract_expsyms_cmds= + # Just being paranoid about ensuring that cc_basename is set. + for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` -# This is the shared library runtime path variable. -runpath_var=$runpath_var + case $host_os in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac -# This is the shared library path variable. -shlibpath_var=$shlibpath_var + ld_shlibs_F77=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_F77='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec_F77= + fi + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action_CXX + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs_F77=no + cat <&2 -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. -# 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 +EOF + fi + ;; -# If ld is used when linking, flag to hardcode \$libdir into -# a binary during linking. This must work even if \$libdir does -# not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX + amigaos*) + archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_minus_L_F77=yes -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can't use + # them. + ld_shlibs_F77=no + ;; -# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$hardcode_direct_CXX + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag_F77=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs_F77=no + fi + ;; -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$hardcode_minus_L_CXX + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_F77='-L$libdir' + allow_undefined_flag_F77=unsupported + always_export_symbols_F77=no + enable_shared_with_static_runtimes_F77=yes + export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs_F77=no + fi + ;; -# 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 + interix3*) + hardcode_direct_F77=no + hardcode_shlibpath_var_F77=no + hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' + export_dynamic_flag_spec_F77='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds_F77='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" + linux*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + tmp_addflag= + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + esac + archive_cmds_F77='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs_CXX + if test $supports_anon_versioning = yes; then + archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + $echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + else + ld_shlibs_F77=no + fi + ;; -# Compile-time system search path for libraries -sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; -# Run-time system search path for libraries -sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + solaris*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + ld_shlibs_F77=no + cat <&2 -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$fix_srcfile_path_CXX" +*** 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. -# Set to yes if exported symbols are required. -always_export_symbols=$always_export_symbols_CXX +EOF + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs_F77=no + fi + ;; -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds_CXX + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs_F77=no + cat <<_LT_EOF 1>&2 -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds +*** 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. -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms_CXX +_LT_EOF + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' + archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' + else + ld_shlibs_F77=no + fi + ;; + esac + ;; -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms_CXX + sunos4*) + archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + ;; -# ### END LIBTOOL TAG CONFIG: $tagname + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs_F77=no + fi + ;; + esac -__EOF__ + if test "$ld_shlibs_F77" = no; then + runpath_var= + hardcode_libdir_flag_spec_F77= + export_dynamic_flag_spec_F77= + whole_archive_flag_spec_F77= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag_F77=unsupported + always_export_symbols_F77=yes + archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L_F77=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct_F77=unsupported + fi + ;; + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no -else - # If there is no Makefile yet, we rely on a make rule to execute - # `config.status --recheck' to rerun these tests and create the - # libtool script then. - ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` - if test -f "$ltmain_in"; then - test -f Makefile && make "$ltmain" - fi -fi + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi -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 + # 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. -CC=$lt_save_CC -LDCXX=$LD -LD=$lt_save_LD -GCC=$lt_save_GCC -with_gnu_ldcxx=$with_gnu_ld -with_gnu_ld=$lt_save_with_gnu_ld -lt_cv_path_LDCXX=$lt_cv_path_LD -lt_cv_path_LD=$lt_save_path_LD -lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld -lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld + archive_cmds_F77='' + hardcode_direct_F77=yes + hardcode_libdir_separator_F77=':' + link_all_deplibs_F77=yes + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + hardcode_direct_F77=yes + else + # We have old collect2 + hardcode_direct_F77=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L_F77=yes + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_libdir_separator_F77= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' else - tagname="" + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi fi - ;; + fi - F77) - if test -n "$F77" && test "X$F77" != "Xno"; then - -ac_ext=f -ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' -ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_f77_compiler_gnu + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols_F77=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag_F77='-berok' + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF + program main + end +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (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_f77_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -archive_cmds_need_lc_F77=no -allow_undefined_flag_F77= -always_export_symbols_F77=no -archive_expsym_cmds_F77= -export_dynamic_flag_spec_F77= -hardcode_direct_F77=no -hardcode_libdir_flag_spec_F77= -hardcode_libdir_flag_spec_ld_F77= -hardcode_libdir_separator_F77= -hardcode_minus_L_F77=no -hardcode_automatic_F77=no -module_cmds_F77= -module_expsym_cmds_F77= -link_all_deplibs_F77=unknown -old_archive_cmds_F77=$old_archive_cmds -no_undefined_flag_F77= -whole_archive_flag_spec_F77= -enable_shared_with_static_runtimes_F77=no + +fi -# Source file extension for f77 test sources. -ac_ext=f +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi -# Object file extension for compiled f77 test sources. -objext=o -objext_F77=$objext + hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag_F77="-z nodefs" + archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF + program main -# Code to be used in simple compile tests -lt_simple_compile_test_code=" subroutine t\n return\n end\n" + end +_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_f77_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -# Code to be used in simple link tests -lt_simple_link_test_code=" program t\n end\n" + +fi -# ltmain only uses $CC for tagged configurations so make sure $CC is set. +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} + hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag_F77=' ${wl}-bernotok' + allow_undefined_flag_F77=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_F77='$convenience' + archive_cmds_need_lc_F77=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + amigaos*) + archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_minus_L_F77=yes + # see comment about different semantics on the GNU ld section + ld_shlibs_F77=no + ;; -# Allow CC to be a program name with arguments. -compiler=$CC + bsdi[45]*) + export_dynamic_flag_spec_F77=-rdynamic + ;; + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec_F77=' ' + allow_undefined_flag_F77=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_From_new_cmds_F77='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path_F77='`cygpath -w "$srcfile"`' + enable_shared_with_static_runtimes_F77=yes + ;; -# save warnings/boilerplate of simple test code -ac_outfile=conftest.$ac_objext -printf "$lt_simple_compile_test_code" >conftest.$ac_ext -eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_compiler_boilerplate=`cat conftest.err` -$rm conftest* + darwin* | rhapsody*) + case $host_os in + rhapsody* | darwin1.[012]) + allow_undefined_flag_F77='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[012]) + allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + allow_undefined_flag_F77='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + fi + ;; + esac + archive_cmds_need_lc_F77=no + hardcode_direct_F77=no + hardcode_automatic_F77=yes + hardcode_shlibpath_var_F77=unsupported + whole_archive_flag_spec_F77='' + link_all_deplibs_F77=yes + if test "$GCC" = yes ; then + output_verbose_link_cmd='echo' + archive_cmds_F77='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + ld_shlibs_F77=no + ;; + esac + fi + ;; -ac_outfile=conftest.$ac_objext -printf "$lt_simple_link_test_code" >conftest.$ac_ext -eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_linker_boilerplate=`cat conftest.err` -$rm conftest* + dgux*) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_shlibpath_var_F77=no + ;; + + freebsd1*) + ld_shlibs_F77=no + ;; + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec_F77='-R$libdir' + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + ;; -# Allow CC to be a program name with arguments. -lt_save_CC="$CC" -CC=${F77-"f77"} -compiler=$CC -compiler_F77=$CC -for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_F77=yes + hardcode_minus_L_F77=yes + hardcode_shlibpath_var_F77=no + ;; + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | kfreebsd*-gnu | dragonfly*) + archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_F77='-R$libdir' + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + ;; -{ 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; } + hpux9*) + if test "$GCC" = yes; then + archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds_F77='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_F77=: + hardcode_direct_F77=yes -{ 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 + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_F77=yes + export_dynamic_flag_spec_F77='${wl}-E' + ;; -# On AIX, shared libraries and static libraries use the same namespace, and -# are all built from PIC. -case $host_os in -aix3*) - test "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; -aix4* | aix5*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - fi - ;; -esac -{ echo "$as_me:$LINENO: result: $enable_shared" >&5 -echo "${ECHO_T}$enable_shared" >&6; } + hpux10*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_F77=: -{ 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; } + hardcode_direct_F77=yes + export_dynamic_flag_spec_F77='${wl}-E' -GCC_F77="$G77" -LD_F77="$LD" + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_F77=yes + fi + ;; -lt_prog_compiler_wl_F77= -lt_prog_compiler_pic_F77= -lt_prog_compiler_static_F77= + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_F77=: -{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 -echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } - - if test "$GCC" = yes; then - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_static_F77='-static' + case $host_cpu in + hppa*64*|ia64*) + hardcode_libdir_flag_spec_ld_F77='+b $libdir' + hardcode_direct_F77=no + hardcode_shlibpath_var_F77=no + ;; + *) + hardcode_direct_F77=yes + export_dynamic_flag_spec_F77='${wl}-E' - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_F77='-Bstatic' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_F77=yes + ;; + esac fi ;; - amigaos*) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4' + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_ld_F77='-rpath $libdir' + fi + hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_F77=: + link_all_deplibs_F77=yes ;; - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec_F77='-R$libdir' + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no ;; - mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic_F77='-DDLL_EXPORT' + newsos6) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_F77=yes + hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_F77=: + hardcode_shlibpath_var_F77=no ;; - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic_F77='-fno-common' + openbsd*) + hardcode_direct_F77=yes + hardcode_shlibpath_var_F77=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' + export_dynamic_flag_spec_F77='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_F77='-R$libdir' + ;; + *) + archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' + ;; + esac + fi ;; - interix3*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. + os2*) + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_minus_L_F77=yes + allow_undefined_flag_F77=unsupported + archive_cmds_F77='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; - msdosdjgpp*) - # Just because we use GCC doesn't mean we suddenly get shared libraries - # on systems that don't support them. - lt_prog_compiler_can_build_shared_F77=no - enable_shared=no + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag_F77=' -expect_unresolved \*' + archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + fi + hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_F77=: ;; - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic_F77=-Kconform_pic + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag_F77=' -expect_unresolved \*' + archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' + + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec_F77='-rpath $libdir' fi + hardcode_libdir_separator_F77=: ;; - hpux*) - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; + solaris*) + no_undefined_flag_F77=' -z text' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + wlarc='' + archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + fi + hardcode_libdir_flag_spec_F77='-R$libdir' + hardcode_shlibpath_var_F77=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; *) - lt_prog_compiler_pic_F77='-fPIC' - ;; + # The compiler driver will combine linker options so we + # cannot just pass the convience library names through + # without $wl, iff we do not link with $LD. + # Luckily, gcc supports the same syntax we need for Sun Studio. + # Supported since Solaris 2.6 (maybe 2.5.1?) + case $wlarc in + '') + whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;; + *) + whole_archive_flag_spec_F77='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; + esac ;; esac + link_all_deplibs_F77=yes ;; - *) - lt_prog_compiler_pic_F77='-fPIC' - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - lt_prog_compiler_wl_F77='-Wl,' - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_F77='-Bstatic' + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else - lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp' + archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi - ;; - darwin*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - case $cc_basename in - xlc*) - lt_prog_compiler_pic_F77='-qnocommon' - lt_prog_compiler_wl_F77='-Wl,' - ;; - esac - ;; - - mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic_F77='-DDLL_EXPORT' + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_direct_F77=yes + hardcode_minus_L_F77=yes + hardcode_shlibpath_var_F77=no ;; - hpux9* | hpux10* | hpux11*) - lt_prog_compiler_wl_F77='-Wl,' - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - # +Z the default + sysv4) + case $host_vendor in + sni) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_F77=yes # is this really true??? ;; - *) - lt_prog_compiler_pic_F77='+Z' + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds_F77='$CC -r -o $output$reload_objs' + hardcode_direct_F77=no + ;; + motorola) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie ;; esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - lt_prog_compiler_static_F77='${wl}-a ${wl}archive' + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var_F77=no ;; - irix5* | irix6* | nonstopux*) - lt_prog_compiler_wl_F77='-Wl,' - # PIC (with -KPIC) is the default. - lt_prog_compiler_static_F77='-non_shared' + sysv4.3*) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_F77=no + export_dynamic_flag_spec_F77='-Bexport' ;; - newsos6) - lt_prog_compiler_pic_F77='-KPIC' - lt_prog_compiler_static_F77='-Bstatic' + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_F77=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs_F77=yes + fi ;; - linux*) - case $cc_basename in - icc* | ecc*) - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_pic_F77='-KPIC' - lt_prog_compiler_static_F77='-static' - ;; - pgcc* | pgf77* | pgf90* | pgf95*) - # Portland Group compilers (*not* the Pentium gcc compiler, - # which looks to be a dead project) - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_pic_F77='-fpic' - lt_prog_compiler_static_F77='-Bstatic' - ;; - ccc*) - lt_prog_compiler_wl_F77='-Wl,' - # All Alpha code is PIC. - lt_prog_compiler_static_F77='-non_shared' - ;; - esac + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) + no_undefined_flag_F77='${wl}-z,text' + archive_cmds_need_lc_F77=no + hardcode_shlibpath_var_F77=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds_F77='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_F77='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi ;; - osf3* | osf4* | osf5*) - lt_prog_compiler_wl_F77='-Wl,' - # All OSF/1 code is PIC. - lt_prog_compiler_static_F77='-non_shared' + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag_F77='${wl}-z,text' + allow_undefined_flag_F77='${wl}-z,nodefs' + archive_cmds_need_lc_F77=no + hardcode_shlibpath_var_F77=no + hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + hardcode_libdir_separator_F77=':' + link_all_deplibs_F77=yes + export_dynamic_flag_spec_F77='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + archive_cmds_F77='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_F77='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi ;; - solaris*) - lt_prog_compiler_pic_F77='-KPIC' - lt_prog_compiler_static_F77='-Bstatic' - case $cc_basename in - f77* | f90* | f95*) - lt_prog_compiler_wl_F77='-Qoption ld ';; - *) - lt_prog_compiler_wl_F77='-Wl,';; - esac + uts4*) + archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_F77='-L$libdir' + hardcode_shlibpath_var_F77=no ;; - sunos4*) - lt_prog_compiler_wl_F77='-Qoption ld ' - lt_prog_compiler_pic_F77='-PIC' - lt_prog_compiler_static_F77='-Bstatic' + *) + ld_shlibs_F77=no ;; + esac + fi - sysv4 | sysv4.2uw2* | sysv4.3*) - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_pic_F77='-KPIC' - lt_prog_compiler_static_F77='-Bstatic' +{ echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5 +echo "${ECHO_T}$ld_shlibs_F77" >&6; } +test "$ld_shlibs_F77" = no && can_build_shared=no + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc_F77" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc_F77=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds_F77 in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } + $rm conftest* + printf "$lt_simple_compile_test_code" > conftest.$ac_ext - sysv4*MP*) - if test -d /usr/nec ;then - lt_prog_compiler_pic_F77='-Kconform_pic' - lt_prog_compiler_static_F77='-Bstatic' + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_F77 + pic_flag=$lt_prog_compiler_pic_F77 + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_F77 + allow_undefined_flag_F77= + if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 + (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + then + archive_cmds_need_lc_F77=no + else + archive_cmds_need_lc_F77=yes + fi + allow_undefined_flag_F77=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 fi + $rm conftest* + { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5 +echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6; } ;; + esac + fi + ;; +esac - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_pic_F77='-KPIC' - lt_prog_compiler_static_F77='-Bstatic' - ;; +{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +need_lib_prefix=unknown +hardcode_into_libs=no - unicos*) - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_can_build_shared_F77=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 - uts4*) - lt_prog_compiler_pic_F77='-pic' - lt_prog_compiler_static_F77='-Bstatic' - ;; +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH - *) - lt_prog_compiler_can_build_shared_F77=no + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no + fi ;; esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH fi + ;; -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6; } - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$lt_prog_compiler_pic_F77"; then - -{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5 -echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6; } -if test "${lt_prog_compiler_pic_works_F77+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_pic_works_F77=no - ac_outfile=conftest.$ac_objext - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic_F77" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:__oline__: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_pic_works_F77=yes - fi - fi - $rm conftest* - -fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6; } +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; -if test x"$lt_prog_compiler_pic_works_F77" = xyes; then - case $lt_prog_compiler_pic_F77 in - "" | " "*) ;; - *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;; - esac -else - lt_prog_compiler_pic_F77= - lt_prog_compiler_can_build_shared_F77=no -fi +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; -fi -case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - lt_prog_compiler_pic_F77= - ;; - *) - lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77" - ;; -esac +bsdi[45]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; -# -# Check to make sure the static flag actually works. -# -wl=$lt_prog_compiler_wl_F77 eval lt_tmp_static_flag=\"$lt_prog_compiler_static_F77\" -{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } -if test "${lt_prog_compiler_static_works_F77+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_static_works_F77=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $lt_tmp_static_flag" - printf "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The linker can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&5 - $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_static_works_F77=yes - fi - else - lt_prog_compiler_static_works_F77=yes - fi - fi - $rm conftest* - LDFLAGS="$save_LDFLAGS" +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no -fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_F77" >&5 -echo "${ECHO_T}$lt_prog_compiler_static_works_F77" >&6; } + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes -if test x"$lt_prog_compiler_static_works_F77" = xyes; then - : -else - lt_prog_compiler_static_F77= -fi + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; -{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 -echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } -if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_prog_compiler_c_o_F77=no - $rm -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - printf "$lt_simple_compile_test_code" > conftest.$ac_ext +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; - 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:__oline__: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:__oline__: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp - $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then - lt_cv_prog_compiler_c_o_F77=yes - fi - fi - chmod u+w . 2>&5 - $rm conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files - $rm out/* && rmdir out - cd .. - rmdir conftest - $rm conftest* +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; -fi -{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6; } +freebsd1*) + dynamic_linker=no + ;; +kfreebsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; -hard_links="nottested" -if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 -echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } - hard_links=yes - $rm conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - { echo "$as_me:$LINENO: result: $hard_links" >&5 -echo "${ECHO_T}$hard_links" >&6; } - if test "$hard_links" = no; then - { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} - need_locks=warn +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac fi -else - need_locks=no -fi - -{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } - - runpath_var= - allow_undefined_flag_F77= - enable_shared_with_static_runtimes_F77=no - archive_cmds_F77= - archive_expsym_cmds_F77= - old_archive_From_new_cmds_F77= - old_archive_from_expsyms_cmds_F77= - export_dynamic_flag_spec_F77= - whole_archive_flag_spec_F77= - thread_safe_flag_spec_F77= - hardcode_libdir_flag_spec_F77= - hardcode_libdir_flag_spec_ld_F77= - hardcode_libdir_separator_F77= - hardcode_direct_F77=no - hardcode_minus_L_F77=no - hardcode_shlibpath_var_F77=unsupported - link_all_deplibs_F77=unknown - hardcode_automatic_F77=no - module_cmds_F77= - module_expsym_cmds_F77= - always_export_symbols_F77=no - export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - include_expsyms_F77= - # exclude_expsyms can be an extended regexp of symbols to exclude - # it will be wrapped by ` (' and `)$', so one must not match beginning or - # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', - # as well as any symbol that contains `d'. - exclude_expsyms_F77="_GLOBAL_OFFSET_TABLE_" - # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out - # platforms (ab)use it in PIC code, but their linkers get confused if - # the symbol is explicitly referenced. Since portable code cannot - # rely on this symbol name, it's probably fine to never include it in - # preloaded symbol tables. - extract_expsyms_cmds= - # Just being paranoid about ensuring that cc_basename is set. - for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; + 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 -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` - + shlibpath_var=LD_LIBRARY_PATH case $host_os in - cygwin* | mingw* | pw32*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - if test "$GCC" != yes; then - with_gnu_ld=no + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + freebsd*) # from 4.6 on + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; - interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) - with_gnu_ld=yes - ;; - openbsd*) - with_gnu_ld=no + 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' + ;; - ld_shlibs_F77=yes - if test "$with_gnu_ld" = yes; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' - - # Set some defaults for GNU ld with shared library support. These - # are reset later if shared libraries are not supported. Putting them - # here allows them to be overridden if necessary. - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir' - export_dynamic_flag_spec_F77='${wl}--export-dynamic' - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec_F77= - fi - supports_anon_versioning=no - case `$LD -v 2>/dev/null` in - *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 - *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... - *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... - *\ 2.11.*) ;; # other 2.11 versions - *) supports_anon_versioning=yes ;; - esac - - # See if GNU ld supports shared libraries. - case $host_os in - aix3* | aix4* | aix5*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - ld_shlibs_F77=no - cat <&2 - -*** Warning: the GNU linker, at least up to release 2.9.1, is reported -*** to be unable to reliably create shared libraries on AIX. -*** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to modify your PATH -*** so that a non-GNU linker is found, and then restart. - -EOF - fi - ;; - - amigaos*) - archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_minus_L_F77=yes - - # Samuel A. Falvo II reports - # that the semantics of dynamic libraries on AmigaOS, at least up - # to version 4, is to share data among multiple programs linked - # with the same dynamic library. Since this doesn't match the - # behavior of shared libraries on other platforms, we can't use - # them. - ld_shlibs_F77=no - ;; - - beos*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag_F77=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - ld_shlibs_F77=no - fi - ;; - - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec_F77='-L$libdir' - allow_undefined_flag_F77=unsupported - always_export_symbols_F77=no - enable_shared_with_static_runtimes_F77=yes - export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' +interix3*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - ld_shlibs_F77=no - fi - ;; + 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 + ;; - interix3*) - hardcode_direct_F77=no - hardcode_shlibpath_var_F77=no - hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' - export_dynamic_flag_spec_F77='${wl}-E' - # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. - # Instead, shared libraries are loaded at an image base (0x10000000 by - # default) and relocated if they conflict, which is a slow very memory - # consuming and fragmenting process. To avoid this, we pick a random, - # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link - # time. Moving up from 0x10000000 also allows more sbrk(2) space. - archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - archive_expsym_cmds_F77='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - ;; +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; - linux*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - tmp_addflag= - case $cc_basename,$host_cpu in - pgcc*) # Portland Group C compiler - whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag' - ;; - pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers - whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag -Mnomain' ;; - ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 - tmp_addflag=' -i_dynamic' ;; - efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 - tmp_addflag=' -i_dynamic -nofor_main' ;; - ifc* | ifort*) # Intel Fortran compiler - tmp_addflag=' -nofor_main' ;; - esac - archive_cmds_F77='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes - if test $supports_anon_versioning = yes; then - archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - $echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - fi - else - ld_shlibs_F77=no - fi - ;; + # find out which ABI we are using + libsuff= + case "$host_cpu" in + x86_64*|s390x*|powerpc64*) + echo '#line __oline__ "configure"' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.$ac_objext` in + *64-bit*) + libsuff=64 + sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" + ;; + esac + fi + rm -rf conftest* + ;; + esac - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - fi - ;; + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" + fi - solaris*) - if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then - ld_shlibs_F77=no - cat <&2 + # 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' + ;; -*** 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. +knetbsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; -EOF - elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs_F77=no - fi - ;; +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 + ;; - sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) - case `$LD -v 2>&1` in - *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) - ld_shlibs_F77=no - cat <<_LT_EOF 1>&2 +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; -*** 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. +nto-qnx*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; -_LT_EOF +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 ;; - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' - archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' - archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' - else - ld_shlibs_F77=no - fi + *) + shlibpath_overrides_runpath=yes ;; esac - ;; - - sunos4*) - archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - hardcode_direct_F77=yes - hardcode_shlibpath_var_F77=no - ;; - - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs_F77=no - fi - ;; - esac - - if test "$ld_shlibs_F77" = no; then - runpath_var= - hardcode_libdir_flag_spec_F77= - export_dynamic_flag_spec_F77= - whole_archive_flag_spec_F77= - fi else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - allow_undefined_flag_F77=unsupported - always_export_symbols_F77=yes - archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - hardcode_minus_L_F77=yes - if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - hardcode_direct_F77=unsupported - fi - ;; + shlibpath_overrides_runpath=yes + fi + ;; - aix4* | aix5*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - if $NM -V 2>&1 | grep 'GNU' > /dev/null; then - export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - else - export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - fi - aix_use_runtimelinking=no +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 + ;; - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[23]|aix4.[23].*|aix5*) - for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then - aix_use_runtimelinking=yes - break - fi - done - ;; - esac +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" + ;; - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; - # 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. +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; - archive_cmds_F77='' - hardcode_direct_F77=yes - hardcode_libdir_separator_F77=':' - link_all_deplibs_F77=yes +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; - if test "$GCC" = yes; then - case $host_os in aix4.[012]|aix4.[012].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && \ - strings "$collect2name" | grep resolve_lib_name >/dev/null - then - # We have reworked collect2 - hardcode_direct_F77=yes - else - # We have old collect2 - hardcode_direct_F77=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - hardcode_minus_L_F77=yes - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_libdir_separator_F77= - fi - ;; - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + shlibpath_overrides_runpath=no + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + shlibpath_overrides_runpath=yes + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - always_export_symbols_F77=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - allow_undefined_flag_F77='-berok' - # Determine the default libpath from the value encoded in an empty executable. - cat >conftest.$ac_ext <<_ACEOF - program main +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; - end -_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;; +*) + dynamic_linker=no + ;; 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_f77_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +{ 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 -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - - hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag_F77="-z nodefs" - archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an empty executable. - cat >conftest.$ac_ext <<_ACEOF - program main +{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } +hardcode_action_F77= +if test -n "$hardcode_libdir_flag_spec_F77" || \ + test -n "$runpath_var_F77" || \ + test "X$hardcode_automatic_F77" = "Xyes" ; then - end -_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_f77_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi + # We can hardcode non-existant directories. + if test "$hardcode_direct_F77" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no && + test "$hardcode_minus_L_F77" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action_F77=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action_F77=immediate + fi else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action_F77=unsupported fi +{ echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5 +echo "${ECHO_T}$hardcode_action_F77" >&6; } -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi +if test "$hardcode_action_F77" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi - hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - no_undefined_flag_F77=' ${wl}-bernotok' - allow_undefined_flag_F77=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec_F77='$convenience' - archive_cmds_need_lc_F77=yes - # This is similar to how AIX traditionally builds its shared libraries. - archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - amigaos*) - archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_minus_L_F77=yes - # see comment about different semantics on the GNU ld section - ld_shlibs_F77=no - ;; +# The else clause should only fire when bootstrapping the +# libtool distribution, otherwise you forgot to ship ltmain.sh +# with your package, and you will get complaints that there are +# no rules to generate ltmain.sh. +if test -f "$ltmain"; then + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # Now quote all the things that may contain metacharacters while being + # careful not to overquote the AC_SUBSTed values. We take copies of the + # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ + SED SHELL STRIP \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler_F77 \ + CC_F77 \ + LD_F77 \ + lt_prog_compiler_wl_F77 \ + lt_prog_compiler_pic_F77 \ + lt_prog_compiler_static_F77 \ + lt_prog_compiler_no_builtin_flag_F77 \ + export_dynamic_flag_spec_F77 \ + thread_safe_flag_spec_F77 \ + whole_archive_flag_spec_F77 \ + enable_shared_with_static_runtimes_F77 \ + old_archive_cmds_F77 \ + old_archive_from_new_cmds_F77 \ + predep_objects_F77 \ + postdep_objects_F77 \ + predeps_F77 \ + postdeps_F77 \ + compiler_lib_search_path_F77 \ + archive_cmds_F77 \ + archive_expsym_cmds_F77 \ + postinstall_cmds_F77 \ + postuninstall_cmds_F77 \ + old_archive_from_expsyms_cmds_F77 \ + allow_undefined_flag_F77 \ + no_undefined_flag_F77 \ + export_symbols_cmds_F77 \ + hardcode_libdir_flag_spec_F77 \ + hardcode_libdir_flag_spec_ld_F77 \ + hardcode_libdir_separator_F77 \ + hardcode_automatic_F77 \ + module_cmds_F77 \ + module_expsym_cmds_F77 \ + lt_cv_prog_compiler_c_o_F77 \ + exclude_expsyms_F77 \ + include_expsyms_F77; do - bsdi[45]*) - export_dynamic_flag_spec_F77=-rdynamic + case $var in + old_archive_cmds_F77 | \ + old_archive_from_new_cmds_F77 | \ + archive_cmds_F77 | \ + archive_expsym_cmds_F77 | \ + module_cmds_F77 | \ + module_expsym_cmds_F77 | \ + old_archive_from_expsyms_cmds_F77 | \ + export_symbols_cmds_F77 | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; - - cygwin* | mingw* | pw32*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - hardcode_libdir_flag_spec_F77=' ' - allow_undefined_flag_F77=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - old_archive_From_new_cmds_F77='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs' - fix_srcfile_path_F77='`cygpath -w "$srcfile"`' - enable_shared_with_static_runtimes_F77=yes + *) + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; + esac + done - darwin* | rhapsody*) - case $host_os in - rhapsody* | darwin1.[012]) - allow_undefined_flag_F77='${wl}-undefined ${wl}suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[012]) - allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - ;; - 10.*) - allow_undefined_flag_F77='${wl}-undefined ${wl}dynamic_lookup' - ;; - esac - fi - ;; - esac - archive_cmds_need_lc_F77=no - hardcode_direct_F77=no - hardcode_automatic_F77=yes - hardcode_shlibpath_var_F77=unsupported - whole_archive_flag_spec_F77='' - link_all_deplibs_F77=yes - if test "$GCC" = yes ; then - output_verbose_link_cmd='echo' - archive_cmds_F77='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - case $cc_basename in - xlc*) - output_verbose_link_cmd='echo' - archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' - module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - ;; - *) - ld_shlibs_F77=no - ;; - esac - fi - ;; + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac - dgux*) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_shlibpath_var_F77=no - ;; +cfgfile="$ofile" - freebsd1*) - ld_shlibs_F77=no - ;; + cat <<__EOF__ >> "$cfgfile" +# ### BEGIN LIBTOOL TAG CONFIG: $tagname - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor - # support. Future versions do this automatically, but an explicit c++rt0.o - # does not break anything, and helps significantly (at the cost of a little - # extra space). - freebsd2.2*) - archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - hardcode_libdir_flag_spec_F77='-R$libdir' - hardcode_direct_F77=yes - hardcode_shlibpath_var_F77=no - ;; +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) - archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_F77=yes - hardcode_minus_L_F77=yes - hardcode_shlibpath_var_F77=no - ;; +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | kfreebsd*-gnu | dragonfly*) - archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec_F77='-R$libdir' - hardcode_direct_F77=yes - hardcode_shlibpath_var_F77=no - ;; +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared - hpux9*) - if test "$GCC" = yes; then - archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - archive_cmds_F77='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - fi - hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_F77=: - hardcode_direct_F77=yes +# Whether or not to build static libraries. +build_old_libs=$enable_static - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_F77=yes - export_dynamic_flag_spec_F77='${wl}-E' - ;; +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc_F77 - hpux10*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_F77=: +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77 - hardcode_direct_F77=yes - export_dynamic_flag_spec_F77='${wl}-E' +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_F77=yes - fi - ;; +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os - hpux11*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - case $host_cpu in - hppa*64*) - archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - else - case $host_cpu in - hppa*64*) - archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_F77=: +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os - case $host_cpu in - hppa*64*|ia64*) - hardcode_libdir_flag_spec_ld_F77='+b $libdir' - hardcode_direct_F77=no - hardcode_shlibpath_var_F77=no - ;; - *) - hardcode_direct_F77=yes - export_dynamic_flag_spec_F77='${wl}-E' +# An echo program that does not interpret backslashes. +echo=$lt_echo - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_F77=yes - ;; - esac - fi - ;; +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec_ld_F77='-rpath $libdir' - fi - hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_F77=: - link_all_deplibs_F77=yes - ;; +# A C compiler. +LTCC=$lt_LTCC - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - hardcode_libdir_flag_spec_F77='-R$libdir' - hardcode_direct_F77=yes - hardcode_shlibpath_var_F77=no - ;; +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS - newsos6) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_F77=yes - hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_F77=: - hardcode_shlibpath_var_F77=no - ;; +# A language-specific compiler. +CC=$lt_compiler_F77 - openbsd*) - hardcode_direct_F77=yes - hardcode_shlibpath_var_F77=no - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' - export_dynamic_flag_spec_F77='${wl}-E' - else - case $host_os in - openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) - archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_F77='-R$libdir' - ;; - *) - archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' - ;; - esac - fi - ;; +# Is the compiler the GNU C compiler? +with_gcc=$GCC_F77 - os2*) - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_minus_L_F77=yes - allow_undefined_flag_F77=unsupported - archive_cmds_F77='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; +gcc_dir=\`$CC -print-file-name=. | $SED 's,/\.$,,'\` +gcc_ver=\`$CC -dumpversion\` - osf3*) - if test "$GCC" = yes; then - allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - allow_undefined_flag_F77=' -expect_unresolved \*' - archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - fi - hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_F77=: - ;; +# An ERE matcher. +EGREP=$lt_EGREP - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' - else - allow_undefined_flag_F77=' -expect_unresolved \*' - archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ - $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' +# The linker used to build libraries. +LD=$lt_LD_F77 - # Both c and cxx compiler support -rpath directly - hardcode_libdir_flag_spec_F77='-rpath $libdir' - fi - hardcode_libdir_separator_F77=: - ;; +# Whether we need hard or soft links. +LN_S=$lt_LN_S - solaris*) - no_undefined_flag_F77=' -z text' - if test "$GCC" = yes; then - wlarc='${wl}' - archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' - else - wlarc='' - archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' - fi - hardcode_libdir_flag_spec_F77='-R$libdir' - hardcode_shlibpath_var_F77=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) - # The compiler driver will combine linker options so we - # cannot just pass the convience library names through - # without $wl, iff we do not link with $LD. - # Luckily, gcc supports the same syntax we need for Sun Studio. - # Supported since Solaris 2.6 (maybe 2.5.1?) - case $wlarc in - '') - whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;; - *) - whole_archive_flag_spec_F77='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; - esac ;; - esac - link_all_deplibs_F77=yes - ;; +# A BSD-compatible nm program. +NM=$lt_NM - sunos4*) - if test "x$host_vendor" = xsequent; then - # Use $CC to link under sequent, because it throws in some extra .o - # files that make .init and .fini sections work. - archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_direct_F77=yes - hardcode_minus_L_F77=yes - hardcode_shlibpath_var_F77=no - ;; +# A symbol stripping program +STRIP=$lt_STRIP - sysv4) - case $host_vendor in - sni) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_F77=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' - reload_cmds_F77='$CC -r -o $output$reload_objs' - hardcode_direct_F77=no - ;; - motorola) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var_F77=no - ;; +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD - sysv4.3*) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var_F77=no - export_dynamic_flag_spec_F77='-Bexport' - ;; +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" - sysv4*MP*) - if test -d /usr/nec; then - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var_F77=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ld_shlibs_F77=yes - fi - ;; +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) - no_undefined_flag_F77='${wl}-z,text' - archive_cmds_need_lc_F77=no - hardcode_shlibpath_var_F77=no - runpath_var='LD_RUN_PATH' +# Used on cygwin: assembler. +AS="$AS" - if test "$GCC" = yes; then - archive_cmds_F77='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_F77='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; +# The name of the directory that contains temporary libtool files. +objdir=$objdir - sysv5* | sco3.2v5* | sco5v6*) - # Note: We can NOT use -z defs as we might desire, because we do not - # link with -lc, and that would cause any symbols used from libc to - # always be unresolved, which means just about no library would - # ever link correctly. If we're not using GNU ld we use -z text - # though, which does catch some bad symbols but isn't as heavy-handed - # as -z defs. - no_undefined_flag_F77='${wl}-z,text' - allow_undefined_flag_F77='${wl}-z,nodefs' - archive_cmds_need_lc_F77=no - hardcode_shlibpath_var_F77=no - hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' - hardcode_libdir_separator_F77=':' - link_all_deplibs_F77=yes - export_dynamic_flag_spec_F77='${wl}-Bexport' - runpath_var='LD_RUN_PATH' +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_F77 + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" - if test "$GCC" = yes; then - archive_cmds_F77='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_F77='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' - uts4*) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_shlibpath_var_F77=no - ;; +# Executable file suffix (normally ""). +exeext="$exeext" - *) - ld_shlibs_F77=no - ;; - esac - fi +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_F77 +pic_mode=$pic_mode -{ echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5 -echo "${ECHO_T}$ld_shlibs_F77" >&6; } -test "$ld_shlibs_F77" = no && can_build_shared=no +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len -# -# Do we need to explicitly link libc? -# -case "x$archive_cmds_need_lc_F77" in -x|xyes) - # Assume -lc should be added - archive_cmds_need_lc_F77=yes +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77 - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $archive_cmds_F77 in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 -echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } - $rm conftest* - printf "$lt_simple_compile_test_code" > conftest.$ac_ext +# Must we lock files when doing compilation? +need_locks=$lt_need_locks - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl_F77 - pic_flag=$lt_prog_compiler_pic_F77 - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag_F77 - allow_undefined_flag_F77= - if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 - (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - then - archive_cmds_need_lc_F77=no - else - archive_cmds_need_lc_F77=yes - fi - allow_undefined_flag_F77=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $rm conftest* - { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5 -echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6; } - ;; - esac - fi - ;; -esac +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix -{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 -echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } -library_names_spec= -libname_spec='lib$name' -soname_spec= -shrext_cmds=".so" -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi -need_lib_prefix=unknown -hardcode_into_libs=no +# Do we need a version for libraries? +need_version=$need_version -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown +# Whether dlopen is supported. +dlopen_support=$enable_dlopen -case $host_os in -aix3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' - shlibpath_var=LIBPATH +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' - ;; +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static -aix4* | aix5*) - version_type=linux - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test "$host_cpu" = ia64; then - # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - aix4 | aix4.[01] | aix4.[01].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; - esac - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then - # If using run time linking (on AIX 4.2 or later) use lib.so - # instead of lib.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - else - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}${shared_ext}$major' - fi - shlibpath_var=LIBPATH - fi - ;; +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_F77 -amigaos*) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' - ;; +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77 -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77 -bsdi[45]*) - version_type=linux - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77 -cygwin* | mingw* | pw32*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77 - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32*) - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname~ - chmod a+x \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $rm \$dlpath' - shlibpath_overrides_runpath=yes +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_old_archive_cmds_F77 +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" - ;; - mingw*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - ;; - esac - ;; +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77 - *) - library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' - ;; - esac - dynamic_linker='Win32 ld.exe' - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77 -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' - soname_spec='${libname}${release}${major}$shared_ext' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' - # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. - if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` - else - sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' - fi - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds_F77 +archive_expsym_cmds=$lt_archive_expsym_cmds_F77 +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds -dgux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds_F77 +module_expsym_cmds=$lt_module_expsym_cmds_F77 -freebsd1*) - dynamic_linker=no - ;; +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib -kfreebsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='GNU ld.so' - ;; +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=\`echo $lt_predep_objects_F77 | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` -freebsd* | dragonfly*) - # DragonFly does not have aout. When/if they implement a new - # versioning mechanism, adjust this. - if test -x /usr/bin/objformat; then - objformat=`/usr/bin/objformat` - else - case $host_os in - freebsd[123]*) objformat=aout ;; - *) objformat=elf ;; - esac - fi - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2*) - shlibpath_overrides_runpath=yes - ;; - freebsd3.[01]* | freebsdelf3.[01]*) - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ - freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - freebsd*) # from 4.6 on - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - esac - ;; +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=\`echo $lt_postdep_objects_F77 | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` -gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - hardcode_into_libs=yes - ;; +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps_F77 -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' - ;; +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps_F77 -interix3*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_F77 | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` -irix5* | irix6* | nonstopux*) - case $host_os in - nonstopux*) version_type=nonstopux ;; - *) - if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux - else - version_type=irix - fi ;; - esac - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' - case $host_os in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" - hardcode_into_libs=yes - ;; +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no - ;; +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$lt_file_magic_cmd -# This must be Linux ELF. -linux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_F77 - # find out which ABI we are using - libsuff= - case "$host_cpu" in - x86_64*|s390x*|powerpc64*) - echo '#line __oline__ "configure"' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - case `/usr/bin/file conftest.$ac_objext` in - *64-bit*) - libsuff=64 - sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" - ;; - esac - fi - rm -rf conftest* - ;; - esac +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_F77 - # Append ld.so.conf contents to the search path - if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" - fi +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds - # 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' - ;; +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval -knetbsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='GNU ld.so' - ;; +# 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 -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 - ;; +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl -newsos6) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; +# 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 -nto-qnx*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; +# This is the shared library runtime path variable. +runpath_var=$runpath_var -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 - ;; +# This is the shared library path variable. +shlibpath_var=$shlibpath_var -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 - ;; +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath -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" - ;; +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_F77 -solaris*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs -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 - ;; +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77 -sysv4 | sysv4.3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - export_dynamic_flag_spec='${wl}-Blargedynsym' - runpath_var=LD_RUN_PATH - ;; - siemens) - need_lib_prefix=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77 + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77 + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct_F77 + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L_F77 + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_F77 + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$hardcode_automatic_F77 + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_F77 + +# Compile-time system search path for libraries +sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$fix_srcfile_path_F77" + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols_F77 + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_F77 -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux - library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - version_type=freebsd-elf - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - hardcode_into_libs=yes - if test "$with_gnu_ld" = yes; then - sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' - shlibpath_overrides_runpath=no - else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - shlibpath_overrides_runpath=yes - case $host_os in - sco3.2v5*) - sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" - ;; - esac - fi - sys_lib_dlsearch_path_spec='/usr/lib' - ;; +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_F77 -uts4*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_F77 -*) - 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 +# ### END LIBTOOL TAG CONFIG: $tagname -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 +__EOF__ -{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 -echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } -hardcode_action_F77= -if test -n "$hardcode_libdir_flag_spec_F77" || \ - test -n "$runpath_var_F77" || \ - test "X$hardcode_automatic_F77" = "Xyes" ; then - # We can hardcode non-existant directories. - if test "$hardcode_direct_F77" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no && - test "$hardcode_minus_L_F77" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action_F77=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action_F77=immediate - fi else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action_F77=unsupported + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi fi -{ echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5 -echo "${ECHO_T}$hardcode_action_F77" >&6; } -if test "$hardcode_action_F77" = relink; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi +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 -# The else clause should only fire when bootstrapping the -# libtool distribution, otherwise you forgot to ship ltmain.sh -# with your package, and you will get complaints that there are -# no rules to generate ltmain.sh. -if test -f "$ltmain"; then - # See if we are running on zsh, and set the options which allow our commands through - # without removal of \ escapes. - if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST - fi - # Now quote all the things that may contain metacharacters while being - # careful not to overquote the AC_SUBSTed values. We take copies of the - # variables and quote the copies for generation of the libtool script. - for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ - SED SHELL STRIP \ - libname_spec library_names_spec soname_spec extract_expsyms_cmds \ - old_striplib striplib file_magic_cmd finish_cmds finish_eval \ - deplibs_check_method reload_flag reload_cmds need_locks \ - lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ - lt_cv_sys_global_symbol_to_c_name_address \ - sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ - old_postinstall_cmds old_postuninstall_cmds \ - compiler_F77 \ - CC_F77 \ - LD_F77 \ - lt_prog_compiler_wl_F77 \ - lt_prog_compiler_pic_F77 \ - lt_prog_compiler_static_F77 \ - lt_prog_compiler_no_builtin_flag_F77 \ - export_dynamic_flag_spec_F77 \ - thread_safe_flag_spec_F77 \ - whole_archive_flag_spec_F77 \ - enable_shared_with_static_runtimes_F77 \ - old_archive_cmds_F77 \ - old_archive_from_new_cmds_F77 \ - predep_objects_F77 \ - postdep_objects_F77 \ - predeps_F77 \ - postdeps_F77 \ - compiler_lib_search_path_F77 \ - archive_cmds_F77 \ - archive_expsym_cmds_F77 \ - postinstall_cmds_F77 \ - postuninstall_cmds_F77 \ - old_archive_from_expsyms_cmds_F77 \ - allow_undefined_flag_F77 \ - no_undefined_flag_F77 \ - export_symbols_cmds_F77 \ - hardcode_libdir_flag_spec_F77 \ - hardcode_libdir_flag_spec_ld_F77 \ - hardcode_libdir_separator_F77 \ - hardcode_automatic_F77 \ - module_cmds_F77 \ - module_expsym_cmds_F77 \ - lt_cv_prog_compiler_c_o_F77 \ - exclude_expsyms_F77 \ - include_expsyms_F77; do +CC="$lt_save_CC" - case $var in - old_archive_cmds_F77 | \ - old_archive_from_new_cmds_F77 | \ - archive_cmds_F77 | \ - archive_expsym_cmds_F77 | \ - module_cmds_F77 | \ - module_expsym_cmds_F77 | \ - old_archive_from_expsyms_cmds_F77 | \ - export_symbols_cmds_F77 | \ - extract_expsyms_cmds | reload_cmds | finish_cmds | \ - postinstall_cmds | postuninstall_cmds | \ - old_postinstall_cmds | old_postuninstall_cmds | \ - sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) - # Double-quote double-evaled strings. - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" - ;; - *) - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" - ;; - esac - done + else + tagname="" + fi + ;; - case $lt_echo in - *'\$0 --fallback-echo"') - lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` - ;; - esac + GCJ) + if test -n "$GCJ" && test "X$GCJ" != "Xno"; then + -cfgfile="$ofile" +# Source file extension for Java test sources. +ac_ext=java - cat <<__EOF__ >> "$cfgfile" -# ### BEGIN LIBTOOL TAG CONFIG: $tagname +# Object file extension for compiled Java test sources. +objext=o +objext_GCJ=$objext -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# Code to be used in simple compile tests +lt_simple_compile_test_code="class foo {}\n" -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL +# Code to be used in simple link tests +lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n' -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared +# ltmain only uses $CC for tagged configurations so make sure $CC is set. -# Whether or not to build static libraries. -build_old_libs=$enable_static +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$archive_cmds_need_lc_F77 +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} -# Whether or not to disallow shared libs when runtime libs are static -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77 +# Allow CC to be a program name with arguments. +compiler=$CC -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install -# The host system. -host_alias=$host_alias -host=$host -host_os=$host_os +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* -# The build system. -build_alias=$build_alias -build=$build -build_os=$build_os +ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* -# An echo program that does not interpret backslashes. -echo=$lt_echo -# The archiver. -AR=$lt_AR -AR_FLAGS=$lt_AR_FLAGS +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +CC=${GCJ-"gcj"} +compiler=$CC +compiler_GCJ=$CC +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` -# A C compiler. -LTCC=$lt_LTCC -# LTCC compiler flags. -LTCFLAGS=$lt_LTCFLAGS +# GCJ did not exist at the time GCC didn't implicitly link libc in. +archive_cmds_need_lc_GCJ=no -# A language-specific compiler. -CC=$lt_compiler_F77 +old_archive_cmds_GCJ=$old_archive_cmds -# Is the compiler the GNU C compiler? -with_gcc=$GCC_F77 +## 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... -gcc_dir=\`$CC -print-file-name=. | $SED 's,/\.$,,'\` -gcc_ver=\`$CC -dumpversion\` +lt_prog_compiler_no_builtin_flag_GCJ= -# An ERE matcher. -EGREP=$lt_EGREP +if test "$GCC" = yes; then + lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin' -# The linker used to build libraries. -LD=$lt_LD_F77 + +{ echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; } +if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="-fno-rtti -fno-exceptions" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:__oline__: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $rm conftest* -# Whether we need hard or soft links. -LN_S=$lt_LN_S +fi +{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; } -# A BSD-compatible nm program. -NM=$lt_NM +if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then + lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions" +else + : +fi -# A symbol stripping program -STRIP=$lt_STRIP +fi -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=$MAGIC_CMD +lt_prog_compiler_wl_GCJ= +lt_prog_compiler_pic_GCJ= +lt_prog_compiler_static_GCJ= -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" +{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } + + if test "$GCC" = yes; then + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_static_GCJ='-static' -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_GCJ='-Bstatic' + fi + ;; -# Used on cygwin: assembler. -AS="$AS" + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + lt_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4' + ;; -# The name of the directory that contains temporary libtool files. -objdir=$objdir + beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' + ;; -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl_F77 + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic_GCJ='-fno-common' + ;; -# Object file suffix (normally "o"). -objext="$ac_objext" + interix3*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; -# Old archive suffix (normally "a"). -libext="$libext" + msdosdjgpp*) + # Just because we use GCC doesn't mean we suddenly get shared libraries + # on systems that don't support them. + lt_prog_compiler_can_build_shared_GCJ=no + enable_shared=no + ;; -# Shared library suffix (normally ".so"). -shrext_cmds='$shrext_cmds' + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic_GCJ=-Kconform_pic + fi + ;; -# Executable file suffix (normally ""). -exeext="$exeext" + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_GCJ='-fPIC' + ;; + esac + ;; -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic_F77 -pic_mode=$pic_mode + *) + lt_prog_compiler_pic_GCJ='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl_GCJ='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_GCJ='-Bstatic' + else + lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp' + fi + ;; + darwin*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + case $cc_basename in + xlc*) + lt_prog_compiler_pic_GCJ='-qnocommon' + lt_prog_compiler_wl_GCJ='-Wl,' + ;; + esac + ;; -# What is the maximum length of a command? -max_cmd_len=$lt_cv_sys_max_cmd_len + mingw* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' + ;; -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77 + hpux9* | hpux10* | hpux11*) + lt_prog_compiler_wl_GCJ='-Wl,' + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic_GCJ='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive' + ;; -# Must we lock files when doing compilation? -need_locks=$lt_need_locks + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl_GCJ='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static_GCJ='-non_shared' + ;; -# Do we need the lib prefix for modules? -need_lib_prefix=$need_lib_prefix + newsos6) + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; -# Do we need a version for libraries? -need_version=$need_version + linux*) + case $cc_basename in + icc* | ecc*) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_pic_GCJ='-fpic' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl_GCJ='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static_GCJ='-non_shared' + ;; + esac + ;; -# Whether dlopen is supported. -dlopen_support=$enable_dlopen + osf3* | osf4* | osf5*) + lt_prog_compiler_wl_GCJ='-Wl,' + # All OSF/1 code is PIC. + lt_prog_compiler_static_GCJ='-non_shared' + ;; -# Whether dlopen of programs is supported. -dlopen_self=$enable_dlopen_self + solaris*) + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + lt_prog_compiler_wl_GCJ='-Qoption ld ';; + *) + lt_prog_compiler_wl_GCJ='-Wl,';; + esac + ;; -# Whether dlopen of statically linked programs is supported. -dlopen_self_static=$enable_dlopen_self_static + sunos4*) + lt_prog_compiler_wl_GCJ='-Qoption ld ' + lt_prog_compiler_pic_GCJ='-PIC' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_lt_prog_compiler_static_F77 + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77 + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic_GCJ='-Kconform_pic' + lt_prog_compiler_static_GCJ='-Bstatic' + fi + ;; -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77 + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_pic_GCJ='-KPIC' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77 + unicos*) + lt_prog_compiler_wl_GCJ='-Wl,' + lt_prog_compiler_can_build_shared_GCJ=no + ;; -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77 + uts4*) + lt_prog_compiler_pic_GCJ='-pic' + lt_prog_compiler_static_GCJ='-Bstatic' + ;; -# Library versioning type. -version_type=$version_type + *) + lt_prog_compiler_can_build_shared_GCJ=no + ;; + esac + fi -# Format of library name prefix. -libname_spec=$lt_libname_spec +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6; } -# 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 +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_GCJ"; then + +{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6; } +if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_pic_works_GCJ=no + ac_outfile=conftest.$ac_objext + printf "$lt_simple_compile_test_code" > conftest.$ac_ext + lt_compiler_flag="$lt_prog_compiler_pic_GCJ" + # Insert the option either (1) after the last *FLAGS variable, or + # (2) before a word containing "conftest.", or (3) at the end. + # Note that $ac_compile itself does not contain backslashes and begins + # with a dollar sign (not a hyphen), so the echo should work correctly. + # The option is referenced via a variable to avoid confusing sed. + lt_compile=`echo "$ac_compile" | $SED \ + -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ + -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ + -e 's:$: $lt_compiler_flag:'` + (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:__oline__: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_pic_works_GCJ=yes + fi + fi + $rm conftest* -# The coded name of the library, if different from the real name. -soname_spec=$lt_soname_spec +fi +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6; } -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_old_archive_cmds_F77 -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds +if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then + case $lt_prog_compiler_pic_GCJ in + "" | " "*) ;; + *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;; + esac +else + lt_prog_compiler_pic_GCJ= + lt_prog_compiler_can_build_shared_GCJ=no +fi -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77 +fi +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + lt_prog_compiler_pic_GCJ= + ;; + *) + lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ" + ;; +esac -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77 +# +# Check to make sure the static flag actually works. +# +wl=$lt_prog_compiler_wl_GCJ eval lt_tmp_static_flag=\"$lt_prog_compiler_static_GCJ\" +{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } +if test "${lt_prog_compiler_static_works_GCJ+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_prog_compiler_static_works_GCJ=no + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $lt_tmp_static_flag" + printf "$lt_simple_link_test_code" > conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_prog_compiler_static_works_GCJ=yes + fi + else + lt_prog_compiler_static_works_GCJ=yes + fi + fi + $rm conftest* + LDFLAGS="$save_LDFLAGS" -# Commands used to build and install a shared archive. -archive_cmds=$lt_archive_cmds_F77 -archive_expsym_cmds=$lt_archive_expsym_cmds_F77 -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds +fi +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_GCJ" >&5 +echo "${ECHO_T}$lt_prog_compiler_static_works_GCJ" >&6; } -# Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_module_cmds_F77 -module_expsym_cmds=$lt_module_expsym_cmds_F77 +if test x"$lt_prog_compiler_static_works_GCJ" = xyes; then + : +else + lt_prog_compiler_static_GCJ= +fi -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects=\`echo $lt_predep_objects_F77 | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` +{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } +if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_c_o_GCJ=no + $rm -r conftest 2>/dev/null + mkdir conftest + cd conftest + mkdir out + printf "$lt_simple_compile_test_code" > conftest.$ac_ext -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects=\`echo $lt_postdep_objects_F77 | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` + 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:__oline__: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:__oline__: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_GCJ=yes + fi + fi + chmod u+w . 2>&5 + $rm conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files + $rm out/* && rmdir out + cd .. + rmdir conftest + $rm conftest* -# Dependencies to place before the objects being linked to create a -# shared library. -predeps=$lt_predeps_F77 +fi +{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6; } -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_postdeps_F77 -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_F77 | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` +hard_links="nottested" +if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + { echo "$as_me:$LINENO: result: $hard_links" >&5 +echo "${ECHO_T}$hard_links" >&6; } + if test "$hard_links" = no; then + { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + need_locks=warn + fi +else + need_locks=no +fi -# Method to check whether dependent libraries are shared objects. -deplibs_check_method=$lt_deplibs_check_method +{ 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; } -# Command to use when deplibs_check_method == file_magic. -file_magic_cmd=$lt_file_magic_cmd + runpath_var= + allow_undefined_flag_GCJ= + enable_shared_with_static_runtimes_GCJ=no + archive_cmds_GCJ= + archive_expsym_cmds_GCJ= + old_archive_From_new_cmds_GCJ= + old_archive_from_expsyms_cmds_GCJ= + export_dynamic_flag_spec_GCJ= + whole_archive_flag_spec_GCJ= + thread_safe_flag_spec_GCJ= + hardcode_libdir_flag_spec_GCJ= + hardcode_libdir_flag_spec_ld_GCJ= + hardcode_libdir_separator_GCJ= + hardcode_direct_GCJ=no + hardcode_minus_L_GCJ=no + hardcode_shlibpath_var_GCJ=unsupported + link_all_deplibs_GCJ=unknown + hardcode_automatic_GCJ=no + module_cmds_GCJ= + module_expsym_cmds_GCJ= + always_export_symbols_GCJ=no + export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + include_expsyms_GCJ= + # exclude_expsyms can be an extended regexp of symbols to exclude + # it will be wrapped by ` (' and `)$', so one must not match beginning or + # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', + # as well as any symbol that contains `d'. + exclude_expsyms_GCJ="_GLOBAL_OFFSET_TABLE_" + # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out + # platforms (ab)use it in PIC code, but their linkers get confused if + # the symbol is explicitly referenced. Since portable code cannot + # rely on this symbol name, it's probably fine to never include it in + # preloaded symbol tables. + extract_expsyms_cmds= + # Just being paranoid about ensuring that cc_basename is set. + for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag_F77 + case $host_os in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag_F77 + ld_shlibs_GCJ=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_GCJ='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec_GCJ= + fi + supports_anon_versioning=no + case `$LD -v 2>/dev/null` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$lt_finish_eval + # See if GNU ld supports shared libraries. + case $host_os in + aix3* | aix4* | aix5*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + ld_shlibs_GCJ=no + cat <&2 -# 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 +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. -# Transform the output of nm in a proper C declaration -global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl +EOF + fi + ;; -# 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 + amigaos*) + archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_minus_L_GCJ=yes -# This is the shared library runtime path variable. -runpath_var=$runpath_var + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can't use + # them. + ld_shlibs_GCJ=no + ;; -# This is the shared library path variable. -shlibpath_var=$shlibpath_var + beos*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag_GCJ=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs_GCJ=no + fi + ;; -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath + cygwin* | mingw* | pw32*) + # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_GCJ='-L$libdir' + allow_undefined_flag_GCJ=unsupported + always_export_symbols_GCJ=no + enable_shared_with_static_runtimes_GCJ=yes + export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action_F77 + if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds_GCJ='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs_GCJ=no + fi + ;; -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs + interix3*) + hardcode_direct_GCJ=no + hardcode_shlibpath_var_GCJ=no + hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' + export_dynamic_flag_spec_GCJ='${wl}-E' + # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. + # Instead, shared libraries are loaded at an image base (0x10000000 by + # default) and relocated if they conflict, which is a slow very memory + # consuming and fragmenting process. To avoid this, we pick a random, + # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link + # time. Moving up from 0x10000000 also allows more sbrk(2) space. + archive_cmds_GCJ='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + archive_expsym_cmds_GCJ='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + ;; -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77 + linux*) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + tmp_addflag= + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + esac + archive_cmds_GCJ='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' -# If ld is used when linking, flag to hardcode \$libdir into -# a binary during linking. This must work even if \$libdir does -# not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77 + if test $supports_anon_versioning = yes; then + archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~ + cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ + $echo "local: *; };" >> $output_objdir/$libname.ver~ + $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' + fi + else + ld_shlibs_GCJ=no + fi + ;; -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77 + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; -# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$hardcode_direct_F77 + solaris*) + if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then + ld_shlibs_GCJ=no + cat <&2 -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$hardcode_minus_L_F77 +*** 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. -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var_F77 +EOF + elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs_GCJ=no + fi + ;; -# Set to yes if building a shared library automatically hardcodes DIR into the library -# and all subsequent libraries and executables linked against it. -hardcode_automatic=$hardcode_automatic_F77 + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs_GCJ=no + cat <<_LT_EOF 1>&2 -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" +*** 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. -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs_F77 +_LT_EOF + ;; + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' + archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' + else + ld_shlibs_GCJ=no + fi + ;; + esac + ;; -# Compile-time system search path for libraries -sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` + sunos4*) + archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; -# Run-time system search path for libraries -sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + *) + if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs_GCJ=no + fi + ;; + esac -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$fix_srcfile_path_F77" + if test "$ld_shlibs_GCJ" = no; then + runpath_var= + hardcode_libdir_flag_spec_GCJ= + export_dynamic_flag_spec_GCJ= + whole_archive_flag_spec_GCJ= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag_GCJ=unsupported + always_export_symbols_GCJ=yes + archive_expsym_cmds_GCJ='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L_GCJ=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct_GCJ=unsupported + fi + ;; -# Set to yes if exported symbols are required. -always_export_symbols=$always_export_symbols_F77 + aix4* | aix5*) + if test "$host_cpu" = ia64; then + # On IA64, the linker does run time linking by default, so we don't + # have to do anything special. + aix_use_runtimelinking=no + exp_sym_flag='-Bexport' + no_entry_flag="" + else + # If we're using GNU nm, then we don't want the "-C" option. + # -C means demangle to AIX nm, but means don't demangle with GNU nm + if $NM -V 2>&1 | grep 'GNU' > /dev/null; then + export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds_GCJ='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds_F77 + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|aix5*) + for ld_flag in $LDFLAGS; do + if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then + aix_use_runtimelinking=yes + break + fi + done + ;; + esac -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms_F77 + # 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. -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms_F77 + archive_cmds_GCJ='' + hardcode_direct_GCJ=yes + hardcode_libdir_separator_GCJ=':' + link_all_deplibs_GCJ=yes -# ### END LIBTOOL TAG CONFIG: $tagname + if test "$GCC" = yes; then + case $host_os in aix4.[012]|aix4.[012].*) + # We only want to do this on AIX 4.2 and lower, the check + # below for broken collect2 doesn't work under 4.3+ + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + hardcode_direct_GCJ=yes + else + # We have old collect2 + hardcode_direct_GCJ=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L_GCJ=yes + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_libdir_separator_GCJ= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi -__EOF__ + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols_GCJ=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag_GCJ='-berok' + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int +main () +{ + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (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 + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi else - # If there is no Makefile yet, we rely on a make rule to execute - # `config.status --recheck' to rerun these tests and create the - # libtool script then. - ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` - if test -f "$ltmain_in"; then - test -f Makefile && make "$ltmain" - fi -fi - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -CC="$lt_save_CC" + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag_GCJ="-z nodefs" + archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else - tagname="" - fi - ;; + # Determine the default libpath from the value encoded in an empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ - GCJ) - if test -n "$GCJ" && test "X$GCJ" != "Xno"; then - +int +main () +{ -# Source file extension for Java test sources. -ac_ext=java + ; + 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 + +aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'` +# Check for a 64-bit object if we didn't find anything. +if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } +}'`; fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -# Object file extension for compiled Java test sources. -objext=o -objext_GCJ=$objext + +fi -# Code to be used in simple compile tests -lt_simple_compile_test_code="class foo {}\n" +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi -# Code to be used in simple link tests -lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n' + hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag_GCJ=' ${wl}-bernotok' + allow_undefined_flag_GCJ=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_GCJ='$convenience' + archive_cmds_need_lc_GCJ=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; -# ltmain only uses $CC for tagged configurations so make sure $CC is set. + amigaos*) + archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_minus_L_GCJ=yes + # see comment about different semantics on the GNU ld section + ld_shlibs_GCJ=no + ;; -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} + bsdi[45]*) + export_dynamic_flag_spec_GCJ=-rdynamic + ;; -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec_GCJ=' ' + allow_undefined_flag_GCJ=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_From_new_cmds_GCJ='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`' + enable_shared_with_static_runtimes_GCJ=yes + ;; -# Allow CC to be a program name with arguments. -compiler=$CC + darwin* | rhapsody*) + case $host_os in + rhapsody* | darwin1.[012]) + allow_undefined_flag_GCJ='${wl}-undefined ${wl}suppress' + ;; + *) # Darwin 1.3 on + if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then + allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + else + case ${MACOSX_DEPLOYMENT_TARGET} in + 10.[012]) + allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' + ;; + 10.*) + allow_undefined_flag_GCJ='${wl}-undefined ${wl}dynamic_lookup' + ;; + esac + fi + ;; + esac + archive_cmds_need_lc_GCJ=no + hardcode_direct_GCJ=no + hardcode_automatic_GCJ=yes + hardcode_shlibpath_var_GCJ=unsupported + whole_archive_flag_spec_GCJ='' + link_all_deplibs_GCJ=yes + if test "$GCC" = yes ; then + output_verbose_link_cmd='echo' + archive_cmds_GCJ='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' + module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + else + case $cc_basename in + xlc*) + output_verbose_link_cmd='echo' + archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' + module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' + # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds + archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' + ;; + *) + ld_shlibs_GCJ=no + ;; + esac + fi + ;; + dgux*) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_shlibpath_var_GCJ=no + ;; -# save warnings/boilerplate of simple test code -ac_outfile=conftest.$ac_objext -printf "$lt_simple_compile_test_code" >conftest.$ac_ext -eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_compiler_boilerplate=`cat conftest.err` -$rm conftest* + freebsd1*) + ld_shlibs_GCJ=no + ;; -ac_outfile=conftest.$ac_objext -printf "$lt_simple_link_test_code" >conftest.$ac_ext -eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_linker_boilerplate=`cat conftest.err` -$rm conftest* + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec_GCJ='-R$libdir' + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_GCJ=yes + hardcode_minus_L_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; -# Allow CC to be a program name with arguments. -lt_save_CC="$CC" -CC=${GCJ-"gcj"} -compiler=$CC -compiler_GCJ=$CC -for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | kfreebsd*-gnu | dragonfly*) + archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_GCJ='-R$libdir' + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; + + hpux9*) + if test "$GCC" = yes; then + archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds_GCJ='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + hardcode_direct_GCJ=yes + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_GCJ=yes + export_dynamic_flag_spec_GCJ='${wl}-E' + ;; -# GCJ did not exist at the time GCC didn't implicitly link libc in. -archive_cmds_need_lc_GCJ=no + hpux10*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_GCJ=: -old_archive_cmds_GCJ=$old_archive_cmds + hardcode_direct_GCJ=yes + export_dynamic_flag_spec_GCJ='${wl}-E' -## 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... + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_GCJ=yes + fi + ;; -lt_prog_compiler_no_builtin_flag_GCJ= + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_GCJ=: -if test "$GCC" = yes; then - lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin' + case $host_cpu in + hppa*64*|ia64*) + hardcode_libdir_flag_spec_ld_GCJ='+b $libdir' + hardcode_direct_GCJ=no + hardcode_shlibpath_var_GCJ=no + ;; + *) + hardcode_direct_GCJ=yes + export_dynamic_flag_spec_GCJ='${wl}-E' - -{ echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 -echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; } -if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_prog_compiler_rtti_exceptions=no - ac_outfile=conftest.$ac_objext - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="-fno-rtti -fno-exceptions" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:__oline__: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_rtti_exceptions=yes - fi - fi - $rm conftest* + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L_GCJ=yes + ;; + esac + fi + ;; -fi -{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; } + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir' + fi + hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + link_all_deplibs_GCJ=yes + ;; -if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then - lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions" -else - : -fi + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec_GCJ='-R$libdir' + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + ;; -fi + newsos6) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_GCJ=yes + hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_GCJ=: + hardcode_shlibpath_var_GCJ=no + ;; -lt_prog_compiler_wl_GCJ= -lt_prog_compiler_pic_GCJ= -lt_prog_compiler_static_GCJ= + openbsd*) + hardcode_direct_GCJ=yes + hardcode_shlibpath_var_GCJ=no + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' + export_dynamic_flag_spec_GCJ='${wl}-E' + else + case $host_os in + openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) + archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_GCJ='-R$libdir' + ;; + *) + archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' + ;; + esac + fi + ;; -{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 -echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } - - if test "$GCC" = yes; then - lt_prog_compiler_wl_GCJ='-Wl,' - lt_prog_compiler_static_GCJ='-static' + os2*) + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_minus_L_GCJ=yes + allow_undefined_flag_GCJ=unsupported + archive_cmds_GCJ='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' + old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_GCJ='-Bstatic' + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + allow_undefined_flag_GCJ=' -expect_unresolved \*' + archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' fi + hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator_GCJ=: ;; - amigaos*) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - lt_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4' - ;; + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' + else + allow_undefined_flag_GCJ=' -expect_unresolved \*' + archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ + $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec_GCJ='-rpath $libdir' + fi + hardcode_libdir_separator_GCJ=: ;; - mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' + solaris*) + no_undefined_flag_GCJ=' -z text' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' + else + wlarc='' + archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' + fi + hardcode_libdir_flag_spec_GCJ='-R$libdir' + hardcode_shlibpath_var_GCJ=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The compiler driver will combine linker options so we + # cannot just pass the convience library names through + # without $wl, iff we do not link with $LD. + # Luckily, gcc supports the same syntax we need for Sun Studio. + # Supported since Solaris 2.6 (maybe 2.5.1?) + case $wlarc in + '') + whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;; + *) + whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; + esac ;; + esac + link_all_deplibs_GCJ=yes ;; - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic_GCJ='-fno-common' + sunos4*) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_direct_GCJ=yes + hardcode_minus_L_GCJ=yes + hardcode_shlibpath_var_GCJ=no ;; - interix3*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. + sysv4) + case $host_vendor in + sni) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_GCJ=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' + reload_cmds_GCJ='$CC -r -o $output$reload_objs' + hardcode_direct_GCJ=no + ;; + motorola) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var_GCJ=no ;; - msdosdjgpp*) - # Just because we use GCC doesn't mean we suddenly get shared libraries - # on systems that don't support them. - lt_prog_compiler_can_build_shared_GCJ=no - enable_shared=no + sysv4.3*) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_GCJ=no + export_dynamic_flag_spec_GCJ='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then - lt_prog_compiler_pic_GCJ=-Kconform_pic + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var_GCJ=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs_GCJ=yes fi ;; - hpux*) - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic_GCJ='-fPIC' - ;; - esac - ;; + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) + no_undefined_flag_GCJ='${wl}-z,text' + archive_cmds_need_lc_GCJ=no + hardcode_shlibpath_var_GCJ=no + runpath_var='LD_RUN_PATH' - *) - lt_prog_compiler_pic_GCJ='-fPIC' - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - lt_prog_compiler_wl_GCJ='-Wl,' - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_GCJ='-Bstatic' + if test "$GCC" = yes; then + archive_cmds_GCJ='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else - lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp' + archive_cmds_GCJ='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; - darwin*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - case $cc_basename in - xlc*) - lt_prog_compiler_pic_GCJ='-qnocommon' - lt_prog_compiler_wl_GCJ='-Wl,' - ;; - esac - ;; - mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' - ;; + sysv5* | sco3.2v5* | sco5v6*) + # Note: We can NOT use -z defs as we might desire, because we do not + # link with -lc, and that would cause any symbols used from libc to + # always be unresolved, which means just about no library would + # ever link correctly. If we're not using GNU ld we use -z text + # though, which does catch some bad symbols but isn't as heavy-handed + # as -z defs. + no_undefined_flag_GCJ='${wl}-z,text' + allow_undefined_flag_GCJ='${wl}-z,nodefs' + archive_cmds_need_lc_GCJ=no + hardcode_shlibpath_var_GCJ=no + hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' + hardcode_libdir_separator_GCJ=':' + link_all_deplibs_GCJ=yes + export_dynamic_flag_spec_GCJ='${wl}-Bexport' + runpath_var='LD_RUN_PATH' - hpux9* | hpux10* | hpux11*) - lt_prog_compiler_wl_GCJ='-Wl,' - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic_GCJ='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive' + if test "$GCC" = yes; then + archive_cmds_GCJ='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds_GCJ='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' + fi ;; - irix5* | irix6* | nonstopux*) - lt_prog_compiler_wl_GCJ='-Wl,' - # PIC (with -KPIC) is the default. - lt_prog_compiler_static_GCJ='-non_shared' + uts4*) + archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec_GCJ='-L$libdir' + hardcode_shlibpath_var_GCJ=no ;; - newsos6) - lt_prog_compiler_pic_GCJ='-KPIC' - lt_prog_compiler_static_GCJ='-Bstatic' + *) + ld_shlibs_GCJ=no ;; + esac + fi - linux*) - case $cc_basename in - icc* | ecc*) - lt_prog_compiler_wl_GCJ='-Wl,' - lt_prog_compiler_pic_GCJ='-KPIC' - lt_prog_compiler_static_GCJ='-static' - ;; - pgcc* | pgf77* | pgf90* | pgf95*) - # Portland Group compilers (*not* the Pentium gcc compiler, - # which looks to be a dead project) - lt_prog_compiler_wl_GCJ='-Wl,' - lt_prog_compiler_pic_GCJ='-fpic' - lt_prog_compiler_static_GCJ='-Bstatic' - ;; - ccc*) - lt_prog_compiler_wl_GCJ='-Wl,' - # All Alpha code is PIC. - lt_prog_compiler_static_GCJ='-non_shared' - ;; - esac +{ echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5 +echo "${ECHO_T}$ld_shlibs_GCJ" >&6; } +test "$ld_shlibs_GCJ" = no && can_build_shared=no + +# +# Do we need to explicitly link libc? +# +case "x$archive_cmds_need_lc_GCJ" in +x|xyes) + # Assume -lc should be added + archive_cmds_need_lc_GCJ=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds_GCJ in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } + $rm conftest* + printf "$lt_simple_compile_test_code" > conftest.$ac_ext - osf3* | osf4* | osf5*) - lt_prog_compiler_wl_GCJ='-Wl,' - # All OSF/1 code is PIC. - lt_prog_compiler_static_GCJ='-non_shared' + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl_GCJ + pic_flag=$lt_prog_compiler_pic_GCJ + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ + allow_undefined_flag_GCJ= + if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 + (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + then + archive_cmds_need_lc_GCJ=no + else + archive_cmds_need_lc_GCJ=yes + fi + allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $rm conftest* + { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5 +echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6; } ;; + esac + fi + ;; +esac + +{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi +else + sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +fi +need_lib_prefix=unknown +hardcode_into_libs=no - solaris*) - lt_prog_compiler_pic_GCJ='-KPIC' - lt_prog_compiler_static_GCJ='-Bstatic' - case $cc_basename in - f77* | f90* | f95*) - lt_prog_compiler_wl_GCJ='-Qoption ld ';; - *) - lt_prog_compiler_wl_GCJ='-Wl,';; - esac - ;; +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown - sunos4*) - lt_prog_compiler_wl_GCJ='-Qoption ld ' - lt_prog_compiler_pic_GCJ='-PIC' - lt_prog_compiler_static_GCJ='-Bstatic' - ;; +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH - sysv4 | sysv4.2uw2* | sysv4.3*) - lt_prog_compiler_wl_GCJ='-Wl,' - lt_prog_compiler_pic_GCJ='-KPIC' - lt_prog_compiler_static_GCJ='-Bstatic' - ;; + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; - sysv4*MP*) - if test -d /usr/nec ;then - lt_prog_compiler_pic_GCJ='-Kconform_pic' - lt_prog_compiler_static_GCJ='-Bstatic' +aix4* | aix5*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then + : + else + can_build_shared=no fi ;; - - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - lt_prog_compiler_wl_GCJ='-Wl,' - lt_prog_compiler_pic_GCJ='-KPIC' - lt_prog_compiler_static_GCJ='-Bstatic' - ;; - - unicos*) - lt_prog_compiler_wl_GCJ='-Wl,' - lt_prog_compiler_can_build_shared_GCJ=no - ;; - - uts4*) - lt_prog_compiler_pic_GCJ='-pic' - lt_prog_compiler_static_GCJ='-Bstatic' - ;; - - *) - lt_prog_compiler_can_build_shared_GCJ=no - ;; esac + # 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 + ;; -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6; } - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$lt_prog_compiler_pic_GCJ"; then - -{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5 -echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6; } -if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_pic_works_GCJ=no - ac_outfile=conftest.$ac_objext - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic_GCJ" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:__oline__: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_pic_works_GCJ=yes - fi - fi - $rm conftest* - -fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6; } +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + ;; -if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then - case $lt_prog_compiler_pic_GCJ in - "" | " "*) ;; - *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;; - esac -else - lt_prog_compiler_pic_GCJ= - lt_prog_compiler_can_build_shared_GCJ=no -fi +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; -fi -case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - lt_prog_compiler_pic_GCJ= - ;; - *) - lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ" - ;; -esac +bsdi[45]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; -# -# Check to make sure the static flag actually works. -# -wl=$lt_prog_compiler_wl_GCJ eval lt_tmp_static_flag=\"$lt_prog_compiler_static_GCJ\" -{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } -if test "${lt_prog_compiler_static_works_GCJ+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_static_works_GCJ=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $lt_tmp_static_flag" - printf "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The linker can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&5 - $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_static_works_GCJ=yes - fi - else - lt_prog_compiler_static_works_GCJ=yes - fi - fi - $rm conftest* - LDFLAGS="$save_LDFLAGS" +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no -fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_GCJ" >&5 -echo "${ECHO_T}$lt_prog_compiler_static_works_GCJ" >&6; } + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname' + postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ + dlpath=$dir/\$dldll~ + $rm \$dlpath' + shlibpath_overrides_runpath=yes -if test x"$lt_prog_compiler_static_works_GCJ" = xyes; then - : -else - lt_prog_compiler_static_GCJ= -fi + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; -{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 -echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } -if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_prog_compiler_c_o_GCJ=no - $rm -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - printf "$lt_simple_compile_test_code" > conftest.$ac_ext +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' + soname_spec='${libname}${release}${major}$shared_ext' + shlibpath_overrides_runpath=yes + shlibpath_var=DYLD_LIBRARY_PATH + shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' + # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. + if test "$GCC" = yes; then + sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + else + sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; - 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:__oline__: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:__oline__: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp - $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then - lt_cv_prog_compiler_c_o_GCJ=yes - fi - fi - chmod u+w . 2>&5 - $rm conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files - $rm out/* && rmdir out - cd .. - rmdir conftest - $rm conftest* +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; -fi -{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6; } +freebsd1*) + dynamic_linker=no + ;; +kfreebsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; -hard_links="nottested" -if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 -echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } - hard_links=yes - $rm conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - { echo "$as_me:$LINENO: result: $hard_links" >&5 -echo "${ECHO_T}$hard_links" >&6; } - if test "$hard_links" = no; then - { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} - need_locks=warn +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac fi -else - need_locks=no -fi - -{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } - - runpath_var= - allow_undefined_flag_GCJ= - enable_shared_with_static_runtimes_GCJ=no - archive_cmds_GCJ= - archive_expsym_cmds_GCJ= - old_archive_From_new_cmds_GCJ= - old_archive_from_expsyms_cmds_GCJ= - export_dynamic_flag_spec_GCJ= - whole_archive_flag_spec_GCJ= - thread_safe_flag_spec_GCJ= - hardcode_libdir_flag_spec_GCJ= - hardcode_libdir_flag_spec_ld_GCJ= - hardcode_libdir_separator_GCJ= - hardcode_direct_GCJ=no - hardcode_minus_L_GCJ=no - hardcode_shlibpath_var_GCJ=unsupported - link_all_deplibs_GCJ=unknown - hardcode_automatic_GCJ=no - module_cmds_GCJ= - module_expsym_cmds_GCJ= - always_export_symbols_GCJ=no - export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - include_expsyms_GCJ= - # exclude_expsyms can be an extended regexp of symbols to exclude - # it will be wrapped by ` (' and `)$', so one must not match beginning or - # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', - # as well as any symbol that contains `d'. - exclude_expsyms_GCJ="_GLOBAL_OFFSET_TABLE_" - # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out - # platforms (ab)use it in PIC code, but their linkers get confused if - # the symbol is explicitly referenced. Since portable code cannot - # rely on this symbol name, it's probably fine to never include it in - # preloaded symbol tables. - extract_expsyms_cmds= - # Just being paranoid about ensuring that cc_basename is set. - for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; + 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 -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` - + shlibpath_var=LD_LIBRARY_PATH case $host_os in - cygwin* | mingw* | pw32*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - if test "$GCC" != yes; then - with_gnu_ld=no + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + freebsd*) # from 4.6 on + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; - interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) - with_gnu_ld=yes - ;; - openbsd*) - with_gnu_ld=no + 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' + ;; - ld_shlibs_GCJ=yes - if test "$with_gnu_ld" = yes; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' - - # Set some defaults for GNU ld with shared library support. These - # are reset later if shared libraries are not supported. Putting them - # here allows them to be overridden if necessary. - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir' - export_dynamic_flag_spec_GCJ='${wl}--export-dynamic' - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec_GCJ= - fi - supports_anon_versioning=no - case `$LD -v 2>/dev/null` in - *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 - *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... - *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... - *\ 2.11.*) ;; # other 2.11 versions - *) supports_anon_versioning=yes ;; - esac - - # See if GNU ld supports shared libraries. - case $host_os in - aix3* | aix4* | aix5*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - ld_shlibs_GCJ=no - cat <&2 - -*** Warning: the GNU linker, at least up to release 2.9.1, is reported -*** to be unable to reliably create shared libraries on AIX. -*** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to modify your PATH -*** so that a non-GNU linker is found, and then restart. - -EOF - fi - ;; - - amigaos*) - archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_minus_L_GCJ=yes - - # Samuel A. Falvo II reports - # that the semantics of dynamic libraries on AmigaOS, at least up - # to version 4, is to share data among multiple programs linked - # with the same dynamic library. Since this doesn't match the - # behavior of shared libraries on other platforms, we can't use - # them. - ld_shlibs_GCJ=no - ;; - - beos*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag_GCJ=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - ld_shlibs_GCJ=no - fi - ;; - - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec_GCJ='-L$libdir' - allow_undefined_flag_GCJ=unsupported - always_export_symbols_GCJ=no - enable_shared_with_static_runtimes_GCJ=yes - export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' +interix3*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - archive_expsym_cmds_GCJ='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - ld_shlibs_GCJ=no - fi - ;; + 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 + ;; - interix3*) - hardcode_direct_GCJ=no - hardcode_shlibpath_var_GCJ=no - hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' - export_dynamic_flag_spec_GCJ='${wl}-E' - # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. - # Instead, shared libraries are loaded at an image base (0x10000000 by - # default) and relocated if they conflict, which is a slow very memory - # consuming and fragmenting process. To avoid this, we pick a random, - # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link - # time. Moving up from 0x10000000 also allows more sbrk(2) space. - archive_cmds_GCJ='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - archive_expsym_cmds_GCJ='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - ;; +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; - linux*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - tmp_addflag= - case $cc_basename,$host_cpu in - pgcc*) # Portland Group C compiler - whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag' - ;; - pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers - whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag -Mnomain' ;; - ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 - tmp_addflag=' -i_dynamic' ;; - efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 - tmp_addflag=' -i_dynamic -nofor_main' ;; - ifc* | ifort*) # Intel Fortran compiler - tmp_addflag=' -nofor_main' ;; - esac - archive_cmds_GCJ='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' +# This must be Linux ELF. +linux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + # This implies no fast_install, which is unacceptable. + # Some rework will be needed to allow for fast_install + # before this can be enabled. + hardcode_into_libs=yes - if test $supports_anon_versioning = yes; then - archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - $echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - fi - else - ld_shlibs_GCJ=no - fi - ;; + # find out which ABI we are using + libsuff= + case "$host_cpu" in + x86_64*|s390x*|powerpc64*) + echo '#line __oline__ "configure"' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.$ac_objext` in + *64-bit*) + libsuff=64 + sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" + ;; + esac + fi + rm -rf conftest* + ;; + esac - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - fi - ;; + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" + fi - solaris*) - if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then - ld_shlibs_GCJ=no - cat <&2 + # 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' + ;; -*** 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. +knetbsd*-gnu) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='GNU ld.so' + ;; -EOF - elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs_GCJ=no - fi - ;; +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 + ;; - sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) - case `$LD -v 2>&1` in - *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) - ld_shlibs_GCJ=no - cat <<_LT_EOF 1>&2 +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; -*** 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. +nto-qnx*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; -_LT_EOF +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 ;; - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' - archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' - archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' - else - ld_shlibs_GCJ=no - fi + *) + shlibpath_overrides_runpath=yes ;; esac - ;; - - sunos4*) - archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - hardcode_direct_GCJ=yes - hardcode_shlibpath_var_GCJ=no - ;; - - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs_GCJ=no - fi - ;; - esac - - if test "$ld_shlibs_GCJ" = no; then - runpath_var= - hardcode_libdir_flag_spec_GCJ= - export_dynamic_flag_spec_GCJ= - whole_archive_flag_spec_GCJ= - fi else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - allow_undefined_flag_GCJ=unsupported - always_export_symbols_GCJ=yes - archive_expsym_cmds_GCJ='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - hardcode_minus_L_GCJ=yes - if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - hardcode_direct_GCJ=unsupported - fi - ;; + shlibpath_overrides_runpath=yes + fi + ;; - aix4* | aix5*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - if $NM -V 2>&1 | grep 'GNU' > /dev/null; then - export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - else - export_symbols_cmds_GCJ='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - fi - aix_use_runtimelinking=no +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 + ;; - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[23]|aix4.[23].*|aix5*) - for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then - aix_use_runtimelinking=yes - break - fi - done - ;; - esac +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" + ;; - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; - # 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. +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 + ;; - archive_cmds_GCJ='' - hardcode_direct_GCJ=yes - hardcode_libdir_separator_GCJ=':' - link_all_deplibs_GCJ=yes +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + export_dynamic_flag_spec='${wl}-Blargedynsym' + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; - if test "$GCC" = yes; then - case $host_os in aix4.[012]|aix4.[012].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && \ - strings "$collect2name" | grep resolve_lib_name >/dev/null - then - # We have reworked collect2 - hardcode_direct_GCJ=yes - else - # We have old collect2 - hardcode_direct_GCJ=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - hardcode_minus_L_GCJ=yes - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_libdir_separator_GCJ= - fi - ;; - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - always_export_symbols_GCJ=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - allow_undefined_flag_GCJ='-berok' - # Determine the default libpath from the value encoded in an empty executable. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + if test "$with_gnu_ld" = yes; then + sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' + shlibpath_overrides_runpath=no + else + sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' + shlibpath_overrides_runpath=yes + case $host_os in + sco3.2v5*) + sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + ;; + esac + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; -int -main () -{ +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; - ; - 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;; +*) + dynamic_linker=no + ;; 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 - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +{ 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 -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - - hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag_GCJ="-z nodefs" - archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an empty executable. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ +{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } +hardcode_action_GCJ= +if test -n "$hardcode_libdir_flag_spec_GCJ" || \ + test -n "$runpath_var_GCJ" || \ + test "X$hardcode_automatic_GCJ" = "Xyes" ; then - ; - 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 - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi + # We can hardcode non-existant directories. + if test "$hardcode_direct_GCJ" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no && + test "$hardcode_minus_L_GCJ" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action_GCJ=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action_GCJ=immediate + fi else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action_GCJ=unsupported fi +{ echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5 +echo "${ECHO_T}$hardcode_action_GCJ" >&6; } -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi +if test "$hardcode_action_GCJ" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi - hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - no_undefined_flag_GCJ=' ${wl}-bernotok' - allow_undefined_flag_GCJ=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec_GCJ='$convenience' - archive_cmds_need_lc_GCJ=yes - # This is similar to how AIX traditionally builds its shared libraries. - archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - amigaos*) - archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_minus_L_GCJ=yes - # see comment about different semantics on the GNU ld section - ld_shlibs_GCJ=no - ;; +# The else clause should only fire when bootstrapping the +# libtool distribution, otherwise you forgot to ship ltmain.sh +# with your package, and you will get complaints that there are +# no rules to generate ltmain.sh. +if test -f "$ltmain"; then + # See if we are running on zsh, and set the options which allow our commands through + # without removal of \ escapes. + if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST + fi + # Now quote all the things that may contain metacharacters while being + # careful not to overquote the AC_SUBSTed values. We take copies of the + # variables and quote the copies for generation of the libtool script. + for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ + SED SHELL STRIP \ + libname_spec library_names_spec soname_spec extract_expsyms_cmds \ + old_striplib striplib file_magic_cmd finish_cmds finish_eval \ + deplibs_check_method reload_flag reload_cmds need_locks \ + lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ + lt_cv_sys_global_symbol_to_c_name_address \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + old_postinstall_cmds old_postuninstall_cmds \ + compiler_GCJ \ + CC_GCJ \ + LD_GCJ \ + lt_prog_compiler_wl_GCJ \ + lt_prog_compiler_pic_GCJ \ + lt_prog_compiler_static_GCJ \ + lt_prog_compiler_no_builtin_flag_GCJ \ + export_dynamic_flag_spec_GCJ \ + thread_safe_flag_spec_GCJ \ + whole_archive_flag_spec_GCJ \ + enable_shared_with_static_runtimes_GCJ \ + old_archive_cmds_GCJ \ + old_archive_from_new_cmds_GCJ \ + predep_objects_GCJ \ + postdep_objects_GCJ \ + predeps_GCJ \ + postdeps_GCJ \ + compiler_lib_search_path_GCJ \ + archive_cmds_GCJ \ + archive_expsym_cmds_GCJ \ + postinstall_cmds_GCJ \ + postuninstall_cmds_GCJ \ + old_archive_from_expsyms_cmds_GCJ \ + allow_undefined_flag_GCJ \ + no_undefined_flag_GCJ \ + export_symbols_cmds_GCJ \ + hardcode_libdir_flag_spec_GCJ \ + hardcode_libdir_flag_spec_ld_GCJ \ + hardcode_libdir_separator_GCJ \ + hardcode_automatic_GCJ \ + module_cmds_GCJ \ + module_expsym_cmds_GCJ \ + lt_cv_prog_compiler_c_o_GCJ \ + exclude_expsyms_GCJ \ + include_expsyms_GCJ; do - bsdi[45]*) - export_dynamic_flag_spec_GCJ=-rdynamic + case $var in + old_archive_cmds_GCJ | \ + old_archive_from_new_cmds_GCJ | \ + archive_cmds_GCJ | \ + archive_expsym_cmds_GCJ | \ + module_cmds_GCJ | \ + module_expsym_cmds_GCJ | \ + old_archive_from_expsyms_cmds_GCJ | \ + export_symbols_cmds_GCJ | \ + extract_expsyms_cmds | reload_cmds | finish_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" ;; - - cygwin* | mingw* | pw32*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - hardcode_libdir_flag_spec_GCJ=' ' - allow_undefined_flag_GCJ=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - old_archive_From_new_cmds_GCJ='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs' - fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`' - enable_shared_with_static_runtimes_GCJ=yes + *) + eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" ;; + esac + done - darwin* | rhapsody*) - case $host_os in - rhapsody* | darwin1.[012]) - allow_undefined_flag_GCJ='${wl}-undefined ${wl}suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[012]) - allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - ;; - 10.*) - allow_undefined_flag_GCJ='${wl}-undefined ${wl}dynamic_lookup' - ;; - esac - fi - ;; - esac - archive_cmds_need_lc_GCJ=no - hardcode_direct_GCJ=no - hardcode_automatic_GCJ=yes - hardcode_shlibpath_var_GCJ=unsupported - whole_archive_flag_spec_GCJ='' - link_all_deplibs_GCJ=yes - if test "$GCC" = yes ; then - output_verbose_link_cmd='echo' - archive_cmds_GCJ='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - case $cc_basename in - xlc*) - output_verbose_link_cmd='echo' - archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' - module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - ;; - *) - ld_shlibs_GCJ=no - ;; - esac - fi - ;; + case $lt_echo in + *'\$0 --fallback-echo"') + lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac - dgux*) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_shlibpath_var_GCJ=no - ;; +cfgfile="$ofile" - freebsd1*) - ld_shlibs_GCJ=no - ;; + cat <<__EOF__ >> "$cfgfile" +# ### BEGIN LIBTOOL TAG CONFIG: $tagname - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor - # support. Future versions do this automatically, but an explicit c++rt0.o - # does not break anything, and helps significantly (at the cost of a little - # extra space). - freebsd2.2*) - archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - hardcode_libdir_flag_spec_GCJ='-R$libdir' - hardcode_direct_GCJ=yes - hardcode_shlibpath_var_GCJ=no - ;; +# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) - archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_GCJ=yes - hardcode_minus_L_GCJ=yes - hardcode_shlibpath_var_GCJ=no - ;; +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | kfreebsd*-gnu | dragonfly*) - archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec_GCJ='-R$libdir' - hardcode_direct_GCJ=yes - hardcode_shlibpath_var_GCJ=no - ;; +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared - hpux9*) - if test "$GCC" = yes; then - archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - archive_cmds_GCJ='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - fi - hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_GCJ=: - hardcode_direct_GCJ=yes +# Whether or not to build static libraries. +build_old_libs=$enable_static - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_GCJ=yes - export_dynamic_flag_spec_GCJ='${wl}-E' - ;; +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc_GCJ - hpux10*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_GCJ=: +# Whether or not to disallow shared libs when runtime libs are static +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ - hardcode_direct_GCJ=yes - export_dynamic_flag_spec_GCJ='${wl}-E' +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_GCJ=yes - fi - ;; +# The host system. +host_alias=$host_alias +host=$host +host_os=$host_os - hpux11*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - case $host_cpu in - hppa*64*) - archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - else - case $host_cpu in - hppa*64*) - archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_GCJ=: +# The build system. +build_alias=$build_alias +build=$build +build_os=$build_os - case $host_cpu in - hppa*64*|ia64*) - hardcode_libdir_flag_spec_ld_GCJ='+b $libdir' - hardcode_direct_GCJ=no - hardcode_shlibpath_var_GCJ=no - ;; - *) - hardcode_direct_GCJ=yes - export_dynamic_flag_spec_GCJ='${wl}-E' +# An echo program that does not interpret backslashes. +echo=$lt_echo - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_GCJ=yes - ;; - esac - fi - ;; +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir' - fi - hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_GCJ=: - link_all_deplibs_GCJ=yes - ;; +# A C compiler. +LTCC=$lt_LTCC - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - hardcode_libdir_flag_spec_GCJ='-R$libdir' - hardcode_direct_GCJ=yes - hardcode_shlibpath_var_GCJ=no - ;; +# LTCC compiler flags. +LTCFLAGS=$lt_LTCFLAGS - newsos6) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_GCJ=yes - hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_GCJ=: - hardcode_shlibpath_var_GCJ=no - ;; +# A language-specific compiler. +CC=$lt_compiler_GCJ - openbsd*) - hardcode_direct_GCJ=yes - hardcode_shlibpath_var_GCJ=no - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' - export_dynamic_flag_spec_GCJ='${wl}-E' - else - case $host_os in - openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) - archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_GCJ='-R$libdir' - ;; - *) - archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' - ;; - esac - fi - ;; +# Is the compiler the GNU C compiler? +with_gcc=$GCC_GCJ - os2*) - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_minus_L_GCJ=yes - allow_undefined_flag_GCJ=unsupported - archive_cmds_GCJ='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; +gcc_dir=\`$CC -print-file-name=. | $SED 's,/\.$,,'\` +gcc_ver=\`$CC -dumpversion\` - osf3*) - if test "$GCC" = yes; then - allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - allow_undefined_flag_GCJ=' -expect_unresolved \*' - archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - fi - hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_GCJ=: - ;; +# An ERE matcher. +EGREP=$lt_EGREP - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' - else - allow_undefined_flag_GCJ=' -expect_unresolved \*' - archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ - $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' +# The linker used to build libraries. +LD=$lt_LD_GCJ - # Both c and cxx compiler support -rpath directly - hardcode_libdir_flag_spec_GCJ='-rpath $libdir' - fi - hardcode_libdir_separator_GCJ=: - ;; +# Whether we need hard or soft links. +LN_S=$lt_LN_S - solaris*) - no_undefined_flag_GCJ=' -z text' - if test "$GCC" = yes; then - wlarc='${wl}' - archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' - else - wlarc='' - archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' - fi - hardcode_libdir_flag_spec_GCJ='-R$libdir' - hardcode_shlibpath_var_GCJ=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) - # The compiler driver will combine linker options so we - # cannot just pass the convience library names through - # without $wl, iff we do not link with $LD. - # Luckily, gcc supports the same syntax we need for Sun Studio. - # Supported since Solaris 2.6 (maybe 2.5.1?) - case $wlarc in - '') - whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;; - *) - whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; - esac ;; - esac - link_all_deplibs_GCJ=yes - ;; +# A BSD-compatible nm program. +NM=$lt_NM - sunos4*) - if test "x$host_vendor" = xsequent; then - # Use $CC to link under sequent, because it throws in some extra .o - # files that make .init and .fini sections work. - archive_cmds_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_direct_GCJ=yes - hardcode_minus_L_GCJ=yes - hardcode_shlibpath_var_GCJ=no - ;; +# A symbol stripping program +STRIP=$lt_STRIP - sysv4) - case $host_vendor in - sni) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_GCJ=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' - reload_cmds_GCJ='$CC -r -o $output$reload_objs' - hardcode_direct_GCJ=no - ;; - motorola) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var_GCJ=no - ;; +# Used to examine libraries when file_magic_cmd begins "file" +MAGIC_CMD=$MAGIC_CMD - sysv4.3*) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var_GCJ=no - export_dynamic_flag_spec_GCJ='-Bexport' - ;; +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" - sysv4*MP*) - if test -d /usr/nec; then - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var_GCJ=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ld_shlibs_GCJ=yes - fi - ;; +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) - no_undefined_flag_GCJ='${wl}-z,text' - archive_cmds_need_lc_GCJ=no - hardcode_shlibpath_var_GCJ=no - runpath_var='LD_RUN_PATH' +# Used on cygwin: assembler. +AS="$AS" - if test "$GCC" = yes; then - archive_cmds_GCJ='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_GCJ='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; +# The name of the directory that contains temporary libtool files. +objdir=$objdir - sysv5* | sco3.2v5* | sco5v6*) - # Note: We can NOT use -z defs as we might desire, because we do not - # link with -lc, and that would cause any symbols used from libc to - # always be unresolved, which means just about no library would - # ever link correctly. If we're not using GNU ld we use -z text - # though, which does catch some bad symbols but isn't as heavy-handed - # as -z defs. - no_undefined_flag_GCJ='${wl}-z,text' - allow_undefined_flag_GCJ='${wl}-z,nodefs' - archive_cmds_need_lc_GCJ=no - hardcode_shlibpath_var_GCJ=no - hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' - hardcode_libdir_separator_GCJ=':' - link_all_deplibs_GCJ=yes - export_dynamic_flag_spec_GCJ='${wl}-Bexport' - runpath_var='LD_RUN_PATH' +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_GCJ + +# Object file suffix (normally "o"). +objext="$ac_objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Shared library suffix (normally ".so"). +shrext_cmds='$shrext_cmds' - if test "$GCC" = yes; then - archive_cmds_GCJ='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_GCJ='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; +# Executable file suffix (normally ""). +exeext="$exeext" - uts4*) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_shlibpath_var_GCJ=no - ;; +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_GCJ +pic_mode=$pic_mode - *) - ld_shlibs_GCJ=no - ;; - esac - fi +# What is the maximum length of a command? +max_cmd_len=$lt_cv_sys_max_cmd_len -{ echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5 -echo "${ECHO_T}$ld_shlibs_GCJ" >&6; } -test "$ld_shlibs_GCJ" = no && can_build_shared=no +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ -# -# Do we need to explicitly link libc? -# -case "x$archive_cmds_need_lc_GCJ" in -x|xyes) - # Assume -lc should be added - archive_cmds_need_lc_GCJ=yes +# Must we lock files when doing compilation? +need_locks=$lt_need_locks - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $archive_cmds_GCJ in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 -echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } - $rm conftest* - printf "$lt_simple_compile_test_code" > conftest.$ac_ext +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl_GCJ - pic_flag=$lt_prog_compiler_pic_GCJ - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ - allow_undefined_flag_GCJ= - if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 - (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - then - archive_cmds_need_lc_GCJ=no - else - archive_cmds_need_lc_GCJ=yes - fi - allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $rm conftest* - { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5 -echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6; } - ;; - esac - fi - ;; -esac +# Do we need a version for libraries? +need_version=$need_version -{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 -echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } -library_names_spec= -libname_spec='lib$name' -soname_spec= -shrext_cmds=".so" -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi -need_lib_prefix=unknown -hardcode_into_libs=no +# Whether dlopen is supported. +dlopen_support=$enable_dlopen -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self -case $host_os in -aix3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' - shlibpath_var=LIBPATH +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' - ;; +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static_GCJ -aix4* | aix5*) - version_type=linux - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test "$host_cpu" = ia64; then - # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - aix4 | aix4.[01] | aix4.[01].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; - esac - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then - # If using run time linking (on AIX 4.2 or later) use lib.so - # instead of lib.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - else - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}${shared_ext}$major' - fi - shlibpath_var=LIBPATH - fi - ;; +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ -amigaos*) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' - ;; +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ -bsdi[45]*) - version_type=linux - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ -cygwin* | mingw* | pw32*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no +# Library versioning type. +version_type=$version_type - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32*) - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname~ - chmod a+x \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $rm \$dlpath' - shlibpath_overrides_runpath=yes +# Format of library name prefix. +libname_spec=$lt_libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$lt_library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$lt_RANLIB +old_archive_cmds=$lt_old_archive_cmds_GCJ +old_postinstall_cmds=$lt_old_postinstall_cmds +old_postuninstall_cmds=$lt_old_postuninstall_cmds - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" - ;; - mingw*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - ;; - esac - ;; +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ - *) - library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' - ;; - esac - dynamic_linker='Win32 ld.exe' - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' - soname_spec='${libname}${release}${major}$shared_ext' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' - # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. - if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` - else - sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' - fi - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; +# Commands used to build and install a shared archive. +archive_cmds=$lt_archive_cmds_GCJ +archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ +postinstall_cmds=$lt_postinstall_cmds +postuninstall_cmds=$lt_postuninstall_cmds -dgux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; +# Commands used to build a loadable module (assumed same as above if empty) +module_cmds=$lt_module_cmds_GCJ +module_expsym_cmds=$lt_module_expsym_cmds_GCJ -freebsd1*) - dynamic_linker=no - ;; +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib -kfreebsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='GNU ld.so' - ;; +# Dependencies to place before the objects being linked to create a +# shared library. +predep_objects=\`echo $lt_predep_objects_GCJ | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` -freebsd* | dragonfly*) - # DragonFly does not have aout. When/if they implement a new - # versioning mechanism, adjust this. - if test -x /usr/bin/objformat; then - objformat=`/usr/bin/objformat` - else - case $host_os in - freebsd[123]*) objformat=aout ;; - *) objformat=elf ;; - esac - fi - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2*) - shlibpath_overrides_runpath=yes - ;; - freebsd3.[01]* | freebsdelf3.[01]*) - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ - freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - freebsd*) # from 4.6 on - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - esac - ;; +# Dependencies to place after the objects being linked to create a +# shared library. +postdep_objects=\`echo $lt_postdep_objects_GCJ | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` -gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - hardcode_into_libs=yes - ;; +# Dependencies to place before the objects being linked to create a +# shared library. +predeps=$lt_predeps_GCJ -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' - ;; +# Dependencies to place after the objects being linked to create a +# shared library. +postdeps=$lt_postdeps_GCJ -interix3*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; +# The library search path used internally by the compiler when linking +# a shared library. +compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_GCJ | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` -irix5* | irix6* | nonstopux*) - case $host_os in - nonstopux*) version_type=nonstopux ;; - *) - if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux - else - version_type=irix - fi ;; - esac - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' - case $host_os in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" - hardcode_into_libs=yes - ;; +# 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 -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no - ;; +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_GCJ -# This must be Linux ELF. -linux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes +# Flag that forces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag_GCJ - # find out which ABI we are using - libsuff= - case "$host_cpu" in - x86_64*|s390x*|powerpc64*) - echo '#line __oline__ "configure"' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - case `/usr/bin/file conftest.$ac_objext` in - *64-bit*) - libsuff=64 - sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" - ;; - esac - fi - rm -rf conftest* - ;; - esac +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds - # Append ld.so.conf contents to the search path - if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" - fi +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$lt_finish_eval - # 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' - ;; +# 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 -knetbsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='GNU ld.so' - ;; +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl -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 - ;; +# 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 -newsos6) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; +# This is the shared library runtime path variable. +runpath_var=$runpath_var -nto-qnx*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; +# This is the shared library path variable. +shlibpath_var=$shlibpath_var -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 - ;; +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath -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 - ;; +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_GCJ -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" - ;; +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs -solaris*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_GCJ -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 - ;; +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ -sysv4 | sysv4.3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - export_dynamic_flag_spec='${wl}-Blargedynsym' - runpath_var=LD_RUN_PATH - ;; - siemens) - need_lib_prefix=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ + +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct_GCJ + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L_GCJ + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ + +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$hardcode_automatic_GCJ + +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" + +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_GCJ + +# Compile-time system search path for libraries +sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$fix_srcfile_path_GCJ" + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols_GCJ + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_GCJ + +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux - library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' - shlibpath_var=LD_LIBRARY_PATH +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_GCJ + +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_GCJ + +# ### END LIBTOOL TAG CONFIG: $tagname + +__EOF__ + + +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" fi - ;; +fi -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - version_type=freebsd-elf - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - hardcode_into_libs=yes - if test "$with_gnu_ld" = yes; then - sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' - shlibpath_overrides_runpath=no - else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - shlibpath_overrides_runpath=yes - case $host_os in - sco3.2v5*) - sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +CC="$lt_save_CC" + + else + tagname="" + fi ;; - esac - fi - sys_lib_dlsearch_path_spec='/usr/lib' - ;; -uts4*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; + RC) + -*) - 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 +# Source file extension for RC test sources. +ac_ext=rc -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 +# Object file extension for compiled RC test sources. +objext=o +objext_RC=$objext -{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 -echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } -hardcode_action_GCJ= -if test -n "$hardcode_libdir_flag_spec_GCJ" || \ - test -n "$runpath_var_GCJ" || \ - test "X$hardcode_automatic_GCJ" = "Xyes" ; then +# Code to be used in simple compile tests +lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n' - # We can hardcode non-existant directories. - if test "$hardcode_direct_GCJ" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no && - test "$hardcode_minus_L_GCJ" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action_GCJ=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action_GCJ=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action_GCJ=unsupported -fi -{ echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5 -echo "${ECHO_T}$hardcode_action_GCJ" >&6; } +# Code to be used in simple link tests +lt_simple_link_test_code="$lt_simple_compile_test_code" -if test "$hardcode_action_GCJ" = relink; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi +# ltmain only uses $CC for tagged configurations so make sure $CC is set. + +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} + +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + +# Allow CC to be a program name with arguments. +compiler=$CC + + +# save warnings/boilerplate of simple test code +ac_outfile=conftest.$ac_objext +printf "$lt_simple_compile_test_code" >conftest.$ac_ext +eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_compiler_boilerplate=`cat conftest.err` +$rm conftest* + +ac_outfile=conftest.$ac_objext +printf "$lt_simple_link_test_code" >conftest.$ac_ext +eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err +_lt_linker_boilerplate=`cat conftest.err` +$rm conftest* + + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +CC=${RC-"windres"} +compiler=$CC +compiler_RC=$CC +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` +lt_cv_prog_compiler_c_o_RC=yes # The else clause should only fire when bootstrapping the # libtool distribution, otherwise you forgot to ship ltmain.sh @@ -19368,51 +20246,51 @@ lt_cv_sys_global_symbol_to_c_name_address \ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ old_postinstall_cmds old_postuninstall_cmds \ - compiler_GCJ \ - CC_GCJ \ - LD_GCJ \ - lt_prog_compiler_wl_GCJ \ - lt_prog_compiler_pic_GCJ \ - lt_prog_compiler_static_GCJ \ - lt_prog_compiler_no_builtin_flag_GCJ \ - export_dynamic_flag_spec_GCJ \ - thread_safe_flag_spec_GCJ \ - whole_archive_flag_spec_GCJ \ - enable_shared_with_static_runtimes_GCJ \ - old_archive_cmds_GCJ \ - old_archive_from_new_cmds_GCJ \ - predep_objects_GCJ \ - postdep_objects_GCJ \ - predeps_GCJ \ - postdeps_GCJ \ - compiler_lib_search_path_GCJ \ - archive_cmds_GCJ \ - archive_expsym_cmds_GCJ \ - postinstall_cmds_GCJ \ - postuninstall_cmds_GCJ \ - old_archive_from_expsyms_cmds_GCJ \ - allow_undefined_flag_GCJ \ - no_undefined_flag_GCJ \ - export_symbols_cmds_GCJ \ - hardcode_libdir_flag_spec_GCJ \ - hardcode_libdir_flag_spec_ld_GCJ \ - hardcode_libdir_separator_GCJ \ - hardcode_automatic_GCJ \ - module_cmds_GCJ \ - module_expsym_cmds_GCJ \ - lt_cv_prog_compiler_c_o_GCJ \ - exclude_expsyms_GCJ \ - include_expsyms_GCJ; do + compiler_RC \ + CC_RC \ + LD_RC \ + lt_prog_compiler_wl_RC \ + lt_prog_compiler_pic_RC \ + lt_prog_compiler_static_RC \ + lt_prog_compiler_no_builtin_flag_RC \ + export_dynamic_flag_spec_RC \ + thread_safe_flag_spec_RC \ + whole_archive_flag_spec_RC \ + enable_shared_with_static_runtimes_RC \ + old_archive_cmds_RC \ + old_archive_from_new_cmds_RC \ + predep_objects_RC \ + postdep_objects_RC \ + predeps_RC \ + postdeps_RC \ + compiler_lib_search_path_RC \ + archive_cmds_RC \ + archive_expsym_cmds_RC \ + postinstall_cmds_RC \ + postuninstall_cmds_RC \ + old_archive_from_expsyms_cmds_RC \ + allow_undefined_flag_RC \ + no_undefined_flag_RC \ + export_symbols_cmds_RC \ + hardcode_libdir_flag_spec_RC \ + hardcode_libdir_flag_spec_ld_RC \ + hardcode_libdir_separator_RC \ + hardcode_automatic_RC \ + module_cmds_RC \ + module_expsym_cmds_RC \ + lt_cv_prog_compiler_c_o_RC \ + exclude_expsyms_RC \ + include_expsyms_RC; do case $var in - old_archive_cmds_GCJ | \ - old_archive_from_new_cmds_GCJ | \ - archive_cmds_GCJ | \ - archive_expsym_cmds_GCJ | \ - module_cmds_GCJ | \ - module_expsym_cmds_GCJ | \ - old_archive_from_expsyms_cmds_GCJ | \ - export_symbols_cmds_GCJ | \ + old_archive_cmds_RC | \ + old_archive_from_new_cmds_RC | \ + archive_cmds_RC | \ + archive_expsym_cmds_RC | \ + module_cmds_RC | \ + module_expsym_cmds_RC | \ + old_archive_from_expsyms_cmds_RC | \ + export_symbols_cmds_RC | \ extract_expsyms_cmds | reload_cmds | finish_cmds | \ postinstall_cmds | postuninstall_cmds | \ old_postinstall_cmds | old_postuninstall_cmds | \ @@ -19449,10 +20327,10 @@ build_old_libs=$enable_static # Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$archive_cmds_need_lc_GCJ +build_libtool_need_lc=$archive_cmds_need_lc_RC # Whether or not to disallow shared libs when runtime libs are static -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC # Whether or not to optimize for fast installation. fast_install=$enable_fast_install @@ -19481,10 +20359,10 @@ LTCFLAGS=$lt_LTCFLAGS # A language-specific compiler. -CC=$lt_compiler_GCJ +CC=$lt_compiler_RC # Is the compiler the GNU C compiler? -with_gcc=$GCC_GCJ +with_gcc=$GCC_RC gcc_dir=\`$CC -print-file-name=. | $SED 's,/\.$,,'\` gcc_ver=\`$CC -dumpversion\` @@ -19493,7 +20371,7 @@ EGREP=$lt_EGREP # The linker used to build libraries. -LD=$lt_LD_GCJ +LD=$lt_LD_RC # Whether we need hard or soft links. LN_S=$lt_LN_S @@ -19524,7 +20402,7 @@ reload_cmds=$lt_reload_cmds # How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl_GCJ +wl=$lt_lt_prog_compiler_wl_RC # Object file suffix (normally "o"). objext="$ac_objext" @@ -19539,14 +20417,14 @@ exeext="$exeext" # Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic_GCJ +pic_flag=$lt_lt_prog_compiler_pic_RC pic_mode=$pic_mode # What is the maximum length of a command? max_cmd_len=$lt_cv_sys_max_cmd_len # Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ +compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC # Must we lock files when doing compilation? need_locks=$lt_need_locks @@ -19567,19 +20445,19 @@ dlopen_self_static=$enable_dlopen_self_static # Compiler flag to prevent dynamic linking. -link_static_flag=$lt_lt_prog_compiler_static_GCJ +link_static_flag=$lt_lt_prog_compiler_static_RC # Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC # Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC # Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ +whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC # Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ +thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC # Library versioning type. version_type=$version_type @@ -19596,25 +20474,25 @@ # Commands used to build and install an old-style archive. RANLIB=$lt_RANLIB -old_archive_cmds=$lt_old_archive_cmds_GCJ +old_archive_cmds=$lt_old_archive_cmds_RC old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC # Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC # Commands used to build and install a shared archive. -archive_cmds=$lt_archive_cmds_GCJ -archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ +archive_cmds=$lt_archive_cmds_RC +archive_expsym_cmds=$lt_archive_expsym_cmds_RC postinstall_cmds=$lt_postinstall_cmds postuninstall_cmds=$lt_postuninstall_cmds # Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_module_cmds_GCJ -module_expsym_cmds=$lt_module_expsym_cmds_GCJ +module_cmds=$lt_module_cmds_RC +module_expsym_cmds=$lt_module_expsym_cmds_RC # Commands to strip libraries. old_striplib=$lt_old_striplib @@ -19622,23 +20500,23 @@ # Dependencies to place before the objects being linked to create a # shared library. -predep_objects=\`echo $lt_predep_objects_GCJ | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` +predep_objects=\`echo $lt_predep_objects_RC | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place after the objects being linked to create a # shared library. -postdep_objects=\`echo $lt_postdep_objects_GCJ | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` +postdep_objects=\`echo $lt_postdep_objects_RC | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Dependencies to place before the objects being linked to create a # shared library. -predeps=$lt_predeps_GCJ +predeps=$lt_predeps_RC # Dependencies to place after the objects being linked to create a # shared library. -postdeps=$lt_postdeps_GCJ +postdeps=$lt_postdeps_RC # The library search path used internally by the compiler when linking # a shared library. -compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_GCJ | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` +compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_RC | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method @@ -19647,10 +20525,10 @@ file_magic_cmd=$lt_file_magic_cmd # Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag_GCJ +allow_undefined_flag=$lt_allow_undefined_flag_RC # Flag that forces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag_GCJ +no_undefined_flag=$lt_no_undefined_flag_RC # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds @@ -19677,845 +20555,1401 @@ shlibpath_overrides_runpath=$shlibpath_overrides_runpath # How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action_GCJ - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_GCJ - -# If ld is used when linking, flag to hardcode \$libdir into -# a binary during linking. This must work even if \$libdir does -# not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ - -# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$hardcode_direct_GCJ - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$hardcode_minus_L_GCJ - -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ - -# Set to yes if building a shared library automatically hardcodes DIR into the library -# and all subsequent libraries and executables linked against it. -hardcode_automatic=$hardcode_automatic_GCJ - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs_GCJ - -# Compile-time system search path for libraries -sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` - -# Run-time system search path for libraries -sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec - -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$fix_srcfile_path_GCJ" - -# Set to yes if exported symbols are required. -always_export_symbols=$always_export_symbols_GCJ - -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds_GCJ - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms_GCJ - -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms_GCJ - -# ### END LIBTOOL TAG CONFIG: $tagname - -__EOF__ - - -else - # If there is no Makefile yet, we rely on a make rule to execute - # `config.status --recheck' to rerun these tests and create the - # libtool script then. - ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` - if test -f "$ltmain_in"; then - test -f Makefile && make "$ltmain" - fi -fi - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -CC="$lt_save_CC" - - else - tagname="" - fi - ;; - - RC) - - -# Source file extension for RC test sources. -ac_ext=rc - -# Object file extension for compiled RC test sources. -objext=o -objext_RC=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n' - -# Code to be used in simple link tests -lt_simple_link_test_code="$lt_simple_compile_test_code" - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. - -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} - -# Allow CC to be a program name with arguments. -compiler=$CC - - -# save warnings/boilerplate of simple test code -ac_outfile=conftest.$ac_objext -printf "$lt_simple_compile_test_code" >conftest.$ac_ext -eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_compiler_boilerplate=`cat conftest.err` -$rm conftest* - -ac_outfile=conftest.$ac_objext -printf "$lt_simple_link_test_code" >conftest.$ac_ext -eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_linker_boilerplate=`cat conftest.err` -$rm conftest* - - -# Allow CC to be a program name with arguments. -lt_save_CC="$CC" -CC=${RC-"windres"} -compiler=$CC -compiler_RC=$CC -for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` - -lt_cv_prog_compiler_c_o_RC=yes +hardcode_action=$hardcode_action_RC -# The else clause should only fire when bootstrapping the -# libtool distribution, otherwise you forgot to ship ltmain.sh -# with your package, and you will get complaints that there are -# no rules to generate ltmain.sh. -if test -f "$ltmain"; then - # See if we are running on zsh, and set the options which allow our commands through - # without removal of \ escapes. - if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST - fi - # Now quote all the things that may contain metacharacters while being - # careful not to overquote the AC_SUBSTed values. We take copies of the - # variables and quote the copies for generation of the libtool script. - for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ - SED SHELL STRIP \ - libname_spec library_names_spec soname_spec extract_expsyms_cmds \ - old_striplib striplib file_magic_cmd finish_cmds finish_eval \ - deplibs_check_method reload_flag reload_cmds need_locks \ - lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ - lt_cv_sys_global_symbol_to_c_name_address \ - sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ - old_postinstall_cmds old_postuninstall_cmds \ - compiler_RC \ - CC_RC \ - LD_RC \ - lt_prog_compiler_wl_RC \ - lt_prog_compiler_pic_RC \ - lt_prog_compiler_static_RC \ - lt_prog_compiler_no_builtin_flag_RC \ - export_dynamic_flag_spec_RC \ - thread_safe_flag_spec_RC \ - whole_archive_flag_spec_RC \ - enable_shared_with_static_runtimes_RC \ - old_archive_cmds_RC \ - old_archive_from_new_cmds_RC \ - predep_objects_RC \ - postdep_objects_RC \ - predeps_RC \ - postdeps_RC \ - compiler_lib_search_path_RC \ - archive_cmds_RC \ - archive_expsym_cmds_RC \ - postinstall_cmds_RC \ - postuninstall_cmds_RC \ - old_archive_from_expsyms_cmds_RC \ - allow_undefined_flag_RC \ - no_undefined_flag_RC \ - export_symbols_cmds_RC \ - hardcode_libdir_flag_spec_RC \ - hardcode_libdir_flag_spec_ld_RC \ - hardcode_libdir_separator_RC \ - hardcode_automatic_RC \ - module_cmds_RC \ - module_expsym_cmds_RC \ - lt_cv_prog_compiler_c_o_RC \ - exclude_expsyms_RC \ - include_expsyms_RC; do +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs - case $var in - old_archive_cmds_RC | \ - old_archive_from_new_cmds_RC | \ - archive_cmds_RC | \ - archive_expsym_cmds_RC | \ - module_cmds_RC | \ - module_expsym_cmds_RC | \ - old_archive_from_expsyms_cmds_RC | \ - export_symbols_cmds_RC | \ - extract_expsyms_cmds | reload_cmds | finish_cmds | \ - postinstall_cmds | postuninstall_cmds | \ - old_postinstall_cmds | old_postuninstall_cmds | \ - sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) - # Double-quote double-evaled strings. - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" - ;; - *) - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" - ;; - esac - done +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_RC - case $lt_echo in - *'\$0 --fallback-echo"') - lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` - ;; - esac +# If ld is used when linking, flag to hardcode \$libdir into +# a binary during linking. This must work even if \$libdir does +# not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC -cfgfile="$ofile" +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC - cat <<__EOF__ >> "$cfgfile" -# ### BEGIN LIBTOOL TAG CONFIG: $tagname +# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct_RC -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L_RC -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_RC -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared +# Set to yes if building a shared library automatically hardcodes DIR into the library +# and all subsequent libraries and executables linked against it. +hardcode_automatic=$hardcode_automatic_RC -# Whether or not to build static libraries. -build_old_libs=$enable_static +# Variables whose values should be saved in libtool wrapper scripts and +# restored at relink time. +variables_saved_for_relink="$variables_saved_for_relink" -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$archive_cmds_need_lc_RC +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_RC -# Whether or not to disallow shared libs when runtime libs are static -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC +# Compile-time system search path for libraries +sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec -# The host system. -host_alias=$host_alias -host=$host -host_os=$host_os +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$fix_srcfile_path_RC" -# The build system. -build_alias=$build_alias -build=$build -build_os=$build_os +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols_RC -# An echo program that does not interpret backslashes. -echo=$lt_echo +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_RC -# The archiver. -AR=$lt_AR -AR_FLAGS=$lt_AR_FLAGS +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds -# A C compiler. -LTCC=$lt_LTCC +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_RC -# LTCC compiler flags. -LTCFLAGS=$lt_LTCFLAGS +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_RC -# A language-specific compiler. -CC=$lt_compiler_RC +# ### END LIBTOOL TAG CONFIG: $tagname -# Is the compiler the GNU C compiler? -with_gcc=$GCC_RC +__EOF__ -gcc_dir=\`$CC -print-file-name=. | $SED 's,/\.$,,'\` -gcc_ver=\`$CC -dumpversion\` -# An ERE matcher. -EGREP=$lt_EGREP +else + # If there is no Makefile yet, we rely on a make rule to execute + # `config.status --recheck' to rerun these tests and create the + # libtool script then. + ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` + if test -f "$ltmain_in"; then + test -f Makefile && make "$ltmain" + fi +fi -# The linker used to build libraries. -LD=$lt_LD_RC -# Whether we need hard or soft links. -LN_S=$lt_LN_S +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 -# A BSD-compatible nm program. -NM=$lt_NM +CC="$lt_save_CC" -# A symbol stripping program -STRIP=$lt_STRIP + ;; -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=$MAGIC_CMD + *) + { { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5 +echo "$as_me: error: Unsupported tag name: $tagname" >&2;} + { (exit 1); exit 1; }; } + ;; + esac -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" + # Append the new tag name to the list of available tags. + if test -n "$tagname" ; then + available_tags="$available_tags $tagname" + fi + fi + done + IFS="$lt_save_ifs" -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" + # Now substitute the updated list of available tags. + if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then + mv "${ofile}T" "$ofile" + chmod +x "$ofile" + else + rm -f "${ofile}T" + { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5 +echo "$as_me: error: unable to update list of available tagged configurations." >&2;} + { (exit 1); exit 1; }; } + fi +fi -# Used on cygwin: assembler. -AS="$AS" -# The name of the directory that contains temporary libtool files. -objdir=$objdir -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl_RC +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' -# Object file suffix (normally "o"). -objext="$ac_objext" +# Prevent multiple expansion -# Old archive suffix (normally "a"). -libext="$libext" -# Shared library suffix (normally ".so"). -shrext_cmds='$shrext_cmds' -# Executable file suffix (normally ""). -exeext="$exeext" -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic_RC -pic_mode=$pic_mode -# What is the maximum length of a command? -max_cmd_len=$lt_cv_sys_max_cmd_len -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC -# Must we lock files when doing compilation? -need_locks=$lt_need_locks -# Do we need the lib prefix for modules? -need_lib_prefix=$need_lib_prefix -# Do we need a version for libraries? -need_version=$need_version -# Whether dlopen is supported. -dlopen_support=$enable_dlopen -# Whether dlopen of programs is supported. -dlopen_self=$enable_dlopen_self + + + + + + + + + +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 + -# Whether dlopen of statically linked programs is supported. -dlopen_self_static=$enable_dlopen_self_static -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_lt_prog_compiler_static_RC +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 -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC +### +### Libraries +### -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC +{ echo "$as_me:$LINENO: checking for X" >&5 +echo $ECHO_N "checking for X... $ECHO_C" >&6; } -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC +# Check whether --with-x was given. +if test "${with_x+set}" = set; then + withval=$with_x; +fi -# Library versioning type. -version_type=$version_type +# $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 -# Format of library name prefix. -libname_spec=$lt_libname_spec +# 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 -# 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 +/usr/include/X11 +/usr/include/X11R6 +/usr/include/X11R5 +/usr/include/X11R4 -# The coded name of the library, if different from the real name. -soname_spec=$lt_soname_spec +/usr/local/X11/include +/usr/local/X11R6/include +/usr/local/X11R5/include +/usr/local/X11R4/include -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_old_archive_cmds_RC -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds +/usr/local/include/X11 +/usr/local/include/X11R6 +/usr/local/include/X11R5 +/usr/local/include/X11R4 -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC +/usr/X386/include +/usr/x386/include +/usr/XFree86/include/X11 -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC +/usr/include +/usr/local/include +/usr/unsupported/include +/usr/athena/include +/usr/local/x11r5/include +/usr/lpp/Xamples/include -# Commands used to build and install a shared archive. -archive_cmds=$lt_archive_cmds_RC -archive_expsym_cmds=$lt_archive_expsym_cmds_RC -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds +/usr/openwin/include +/usr/openwin/share/include' -# Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_module_cmds_RC -module_expsym_cmds=$lt_module_expsym_cmds_RC +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 -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib + 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 -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects=\`echo $lt_predep_objects_RC | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` +rm -f conftest.err conftest.$ac_ext +fi # $ac_x_includes = no -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects=\`echo $lt_postdep_objects_RC | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` +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 -# Dependencies to place before the objects being linked to create a -# shared library. -predeps=$lt_predeps_RC + 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 -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_postdeps_RC +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi # $ac_x_libraries = no -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_RC | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` +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 -# Method to check whether dependent libraries are shared objects. -deplibs_check_method=$lt_deplibs_check_method +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 -# Command to use when deplibs_check_method == file_magic. -file_magic_cmd=$lt_file_magic_cmd +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 -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag_RC + 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 -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag_RC + # 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. */ -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds +int +main () +{ -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$lt_finish_eval + ; + 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 -# 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 + 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. */ -# Transform the output of nm in a proper C declaration -global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl +int +main () +{ -# 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 + ; + 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 -# This is the shared library runtime path variable. -runpath_var=$runpath_var + { echo "$as_me:$LINENO: result: neither works" >&5 +echo "${ECHO_T}neither works" >&6; } +fi -# This is the shared library path variable. -shlibpath_var=$shlibpath_var +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath +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 -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action_RC + # 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. -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs + 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. */ -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_RC +/* 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 -# If ld is used when linking, flag to hardcode \$libdir into -# a binary during linking. This must work even if \$libdir does -# not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC + { 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. */ -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC +/* 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 -# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$hardcode_direct_RC + ac_cv_lib_dnet_dnet_ntoa=no +fi -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$hardcode_minus_L_RC +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 -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var_RC + 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. */ -# Set to yes if building a shared library automatically hardcodes DIR into the library -# and all subsequent libraries and executables linked against it. -hardcode_automatic=$hardcode_automatic_RC +/* 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 -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" + ac_cv_lib_dnet_stub_dnet_ntoa=no +fi -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs_RC +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 -# Compile-time system search path for libraries -sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` + fi +fi -# Run-time system search path for libraries -sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$ac_xsave_LIBS" -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$fix_srcfile_path_RC" + # 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 -# Set to yes if exported symbols are required. -always_export_symbols=$always_export_symbols_RC +/* 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. */ -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds_RC +#ifdef __STDC__ +# include +#else +# include +#endif -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds +#undef gethostbyname -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms_RC +/* 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 -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms_RC +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 -# ### END LIBTOOL TAG CONFIG: $tagname + ac_cv_func_gethostbyname=no +fi -__EOF__ +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 - # If there is no Makefile yet, we rely on a make rule to execute - # `config.status --recheck' to rerun these tests and create the - # libtool script then. - ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` - if test -f "$ltmain_in"; then - test -f Makefile && make "$ltmain" - fi -fi - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -CC="$lt_save_CC" - - ;; - - *) - { { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5 -echo "$as_me: error: Unsupported tag name: $tagname" >&2;} - { (exit 1); exit 1; }; } - ;; - esac - - # Append the new tag name to the list of available tags. - if test -n "$tagname" ; then - available_tags="$available_tags $tagname" - fi - fi - done - IFS="$lt_save_ifs" + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 - # Now substitute the updated list of available tags. - if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then - mv "${ofile}T" "$ofile" - chmod +x "$ofile" - else - rm -f "${ofile}T" - { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5 -echo "$as_me: error: unable to update list of available tagged configurations." >&2;} - { (exit 1); exit 1; }; } - fi + 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. */ -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" +/* 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 -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' + ac_cv_lib_bsd_gethostbyname=no +fi -# Prevent multiple expansion +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 -# 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 + # 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 - 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 + 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 -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 +#undef remove -### -### Libraries -### +/* 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 -{ echo "$as_me:$LINENO: checking for X" >&5 -echo $ECHO_N "checking for X... $ECHO_C" >&6; } +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 -# Check whether --with-x was given. -if test "${with_x+set}" = set; then - withval=$with_x; +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; } -# $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 + 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 - # 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}' + ac_check_lib_save_LIBS=$LIBS +LIBS="-lposix $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ _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 +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -/usr/local/include/X11 -/usr/local/include/X11R6 -/usr/local/include/X11R5 -/usr/local/include/X11R4 +/* 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 -/usr/X386/include -/usr/x386/include -/usr/XFree86/include/X11 + ac_cv_lib_posix_remove=no +fi -/usr/include -/usr/local/include -/usr/unsupported/include -/usr/athena/include -/usr/local/x11r5/include -/usr/lpp/Xamples/include +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 -/usr/openwin/include -/usr/openwin/share/include' + fi -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. + # 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. */ -@%:@include +/* 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 -if { (ac_try="$ac_cpp conftest.$ac_ext" +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_cpp conftest.$ac_ext") 2>conftest.er1 + (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); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || test ! -s conftest.err - }; then - # We can compile using X headers with no special include directory. -ac_x_includes= + } && 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 - 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 + ac_cv_func_shmat=no fi -rm -f conftest.err conftest.$ac_ext -fi # $ac_x_includes = no +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_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 + 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. */ -@%:@include + +/* 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 () { -XrmInitialize () +return shmat (); ; return 0; } @@ -20538,97 +21972,143 @@ 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= + ac_cv_lib_ipc_shmat=yes 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 + 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 -fi # $ac_x_libraries = no +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 -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'" + 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 -;; #( - *) 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; } +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 -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 + LDFLAGS=$ac_save_LDFLAGS - X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS= +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" + enable_unity="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 - if test -n "$x_includes"; then - X_CFLAGS="$X_CFLAGS -I$x_includes" - fi + CPPFLAGS="$CPPFLAGS $X_CFLAGS" + COMMON_XLIBS="$X_PRE_LIBS $X_LIBS -lX11 $X_EXTRA_LIBS" - # 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 + { 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; } @@ -20651,37 +22131,53 @@ 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" + ac_cv_lib_Xext_XeviQueryVersion=yes 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 + 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 -int -main () -{ - - ; - return 0; -} +@%:@include _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" +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_link") 2>conftest.er1 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -20690,41 +22186,38 @@ (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" + } && 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 - { echo "$as_me:$LINENO: result: neither works" >&5 -echo "${ECHO_T}neither works" >&6; } + ac_cv_header_X11_extensions_extutil_h=no fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +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 -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 + 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 @@ -20737,11 +22230,11 @@ #ifdef __cplusplus extern "C" #endif -char XOpenDisplay (); +char XineramaQueryVersion (); int main () { -return XOpenDisplay (); +return XineramaQueryVersion (); ; return 0; } @@ -20764,18 +22257,37 @@ 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 - { 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 + 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 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="-ldnet $LIBS" +LIBS="-lXrender $COMMON_XLIBS $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -20789,11 +22301,11 @@ #ifdef __cplusplus extern "C" #endif -char dnet_ntoa (); +char XRenderQueryVersion (); int main () { -return dnet_ntoa (); +return XRenderQueryVersion (); ; return 0; } @@ -20816,32 +22328,36 @@ test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - ac_cv_lib_dnet_dnet_ntoa=yes + ac_cv_lib_Xrender_XRenderQueryVersion=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_dnet_dnet_ntoa=no + 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_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" +{ 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 - 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 "$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="-ldnet_stub $LIBS" +LIBS="-lXrandr $COMMON_XLIBS $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -20855,11 +22371,11 @@ #ifdef __cplusplus extern "C" #endif -char dnet_ntoa (); +char XRRQueryVersion (); int main () { -return dnet_ntoa (); +return XRRQueryVersion (); ; return 0; } @@ -20882,66 +22398,42 @@ test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - ac_cv_lib_dnet_stub_dnet_ntoa=yes + ac_cv_lib_Xrandr_XRRQueryVersion=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_dnet_stub_dnet_ntoa=no + 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_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 +{ 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 -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 "$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 - cat >conftest.$ac_ext <<_ACEOF + 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. */ -/* 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 @@ -20949,18 +22441,11 @@ #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 - +char XTestQueryExtension (); int main () { -return gethostbyname (); +return XTestQueryExtension (); ; return 0; } @@ -20983,28 +22468,43 @@ test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - ac_cv_func_gethostbyname=yes + ac_cv_lib_Xtst_XTestQueryExtension=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_func_gethostbyname=no + 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: 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 + + # If we're building with support for Unity, we'll need a few additional + # libraries. + if test "$enable_unity" != "no"; then + + # Unity needs the X11 Screen Saver extension library. It should be + # in the same place as the X11 libraries, so no need for any fancy + # path checking. + { echo "$as_me:$LINENO: checking for XScreenSaverQueryExtension in -lXss" >&5 +echo $ECHO_N "checking for XScreenSaverQueryExtension in -lXss... $ECHO_C" >&6; } +if test "${ac_cv_lib_Xss_XScreenSaverQueryExtension+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lnsl $LIBS" +LIBS="-lXss $COMMON_XLIBS $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -21018,11 +22518,11 @@ #ifdef __cplusplus extern "C" #endif -char gethostbyname (); +char XScreenSaverQueryExtension (); int main () { -return gethostbyname (); +return XScreenSaverQueryExtension (); ; return 0; } @@ -21045,32 +22545,46 @@ test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - ac_cv_lib_nsl_gethostbyname=yes + ac_cv_lib_Xss_XScreenSaverQueryExtension=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_nsl_gethostbyname=no + ac_cv_lib_Xss_XScreenSaverQueryExtension=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" +{ echo "$as_me:$LINENO: result: $ac_cv_lib_Xss_XScreenSaverQueryExtension" >&5 +echo "${ECHO_T}$ac_cv_lib_Xss_XScreenSaverQueryExtension" >&6; } +if test $ac_cv_lib_Xss_XScreenSaverQueryExtension = yes; then + COMMON_XLIBS="-lXss $COMMON_XLIBS" +else + { { echo "$as_me:$LINENO: error: libXss not found. Please configure without Unity (using --disable-unity) or install the libXss devel package." >&5 +echo "$as_me: error: libXss not found. Please configure without Unity (using --disable-unity) or install the libXss devel package." >&2;} + { (exit 1); exit 1; }; } 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 + + # Check for the uriparser library and headers. The upstream uriparser + # doesn't appear to ship with either a pkg-config file or a + # uriparser-config binary, so we'll look for it the old-fashioned + # way. + # + # Note that we look for uriFreeQueryListA because it's a relatively + # new symbol that our code needs (it isn't present in the uriparser + # that shipped with Ubuntu Hardy). + ORIGINAL_LDFLAGS="$LDFLAGS" + LDFLAGS="$CUSTOM_URIPARSER_LIBS $LDFLAGS" + { echo "$as_me:$LINENO: checking for uriFreeQueryListA in -luriparser" >&5 +echo $ECHO_N "checking for uriFreeQueryListA in -luriparser... $ECHO_C" >&6; } +if test "${ac_cv_lib_uriparser_uriFreeQueryListA+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lbsd $LIBS" +LIBS="-luriparser $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -21084,11 +22598,11 @@ #ifdef __cplusplus extern "C" #endif -char gethostbyname (); +char uriFreeQueryListA (); int main () { -return gethostbyname (); +return uriFreeQueryListA (); ; return 0; } @@ -21111,124 +22625,262 @@ test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - ac_cv_lib_bsd_gethostbyname=yes + ac_cv_lib_uriparser_uriFreeQueryListA=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_bsd_gethostbyname=no + ac_cv_lib_uriparser_uriFreeQueryListA=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" +{ echo "$as_me:$LINENO: result: $ac_cv_lib_uriparser_uriFreeQueryListA" >&5 +echo "${ECHO_T}$ac_cv_lib_uriparser_uriFreeQueryListA" >&6; } +if test $ac_cv_lib_uriparser_uriFreeQueryListA = yes; then + if test -n "$CUSTOM_URIPARSER_LIBS"; then + URIPARSER_LIBS="$CUSTOM_URIPARSER_LIBS" + else + URIPARSER_LIBS="-luriparser" + fi +else + { { echo "$as_me:$LINENO: error: uriparser library not found or is too old. Please configure without Unity (using --disable-unity) or install the liburiparser devel package." >&5 +echo "$as_me: error: uriparser library not found or is too old. Please configure without Unity (using --disable-unity) or install the liburiparser devel package." >&2;} + { (exit 1); exit 1; }; } fi - fi - fi + LDFLAGS="$ORIGINAL_LDFLAGS" - # 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 + if test -n "$CUSTOM_URIPARSER_CPPFLAGS"; then + URIPARSER_CPPFLAGS="$CUSTOM_URIPARSER_CPPFLAGS" + else + # XXX: No pkg-config and no uriparser-config means we need to + # hard-code a sensible default. + URIPARSER_CPPFLAGS="-I/usr/include/uriparser" + fi + ORIGINAL_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$URIPARSER_CPPFLAGS $CPPFLAGS" + if test "${ac_cv_header_Uri_h+set}" = set; then + { echo "$as_me:$LINENO: checking for Uri.h" >&5 +echo $ECHO_N "checking for Uri.h... $ECHO_C" >&6; } +if test "${ac_cv_header_Uri_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_Uri_h" >&5 +echo "${ECHO_T}$ac_cv_header_Uri_h" >&6; } else - cat >conftest.$ac_ext <<_ACEOF + # Is the header compilable? +{ echo "$as_me:$LINENO: checking Uri.h usability" >&5 +echo $ECHO_N "checking Uri.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. */ -/* 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 +$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 -#undef connect + ac_header_compiler=no +fi -/* 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 +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; } -int -main () -{ -return connect (); - ; - return 0; -} +# Is the header present? +{ echo "$as_me:$LINENO: checking Uri.h presence" >&5 +echo $ECHO_N "checking Uri.h presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" +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_link") 2>conftest.er1 + (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); } && { - test -z "$ac_c_werror_flag" || + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$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 + }; then + ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_func_connect=no + ac_header_preproc=no fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +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: Uri.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: Uri.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: Uri.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: Uri.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: Uri.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: Uri.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: Uri.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: Uri.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: Uri.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: Uri.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: Uri.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: Uri.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: Uri.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: Uri.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: Uri.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: Uri.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 Uri.h" >&5 +echo $ECHO_N "checking for Uri.h... $ECHO_C" >&6; } +if test "${ac_cv_header_Uri_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_Uri_h=$ac_header_preproc fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5 -echo "${ECHO_T}$ac_cv_func_connect" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_header_Uri_h" >&5 +echo "${ECHO_T}$ac_cv_header_Uri_h" >&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 +fi +if test $ac_cv_header_Uri_h = yes; then + : +else + { { echo "$as_me:$LINENO: error: uriparser headers not found. Please configure without Unity (using --disable-unity) or install the liburiparser devel package" >&5 +echo "$as_me: error: uriparser headers not found. Please configure without Unity (using --disable-unity) or install the liburiparser devel package" >&2;} + { (exit 1); exit 1; }; } +fi + + + CPPFLAGS="$ORIGINAL_CPPFLAGS" + + # Check for libpng using pkg-config, or barring that, using + # libpng-config. + if test "$HAVE_PKG_CONFIG" = "yes"; then + { echo "$as_me:$LINENO: checking for libpng (via pkg-config)" >&5 +echo $ECHO_N "checking for libpng (via pkg-config)... $ECHO_C" >&6; } + if pkg-config --exists libpng12; then + LIBPNG_CPPFLAGS="`pkg-config --cflags libpng12`" + LIBPNG_LIBS="`pkg-config --libs libpng12`" + { 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 + else + # Extract the first word of "libpng-config", so it can be a program name with args. +set dummy libpng-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_LIBPNG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $LIBPNG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_LIBPNG_CONFIG="$LIBPNG_CONFIG" # 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_LIBPNG_CONFIG="$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_LIBPNG_CONFIG" && ac_cv_path_LIBPNG_CONFIG="no" + ;; +esac +fi +LIBPNG_CONFIG=$ac_cv_path_LIBPNG_CONFIG +if test -n "$LIBPNG_CONFIG"; then + { echo "$as_me:$LINENO: result: $LIBPNG_CONFIG" >&5 +echo "${ECHO_T}$LIBPNG_CONFIG" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + if test "$LIBPNG_CONFIG" != "no"; then + LIBPNG_CPPFLAGS="`$LIBPNG_CONFIG --cflags`" + LIBPNG_LIBS="`$LIBPNG_CONFIG --libs`" + fi + fi + if test -z "$LIBPNG_CPPFLAGS"; then + { { echo "$as_me:$LINENO: error: libpng not found. Please configure without Unity (using --disable-unity) or install the libpng devel package" >&5 +echo "$as_me: error: libpng not found. Please configure without Unity (using --disable-unity) or install the libpng devel package" >&2;} + { (exit 1); exit 1; }; } + fi + + # Check for the zlib library and headers. Like uriparser, there + # isn't a pkg-config or zlib-config file. + ORIGINAL_LDFLAGS="$LDFLAGS" + LDFLAGS="$CUSTOM_ZLIB_LIBS $LDFLAGS" + { echo "$as_me:$LINENO: checking for zlibVersion in -lz" >&5 +echo $ECHO_N "checking for zlibVersion in -lz... $ECHO_C" >&6; } +if test "${ac_cv_lib_z_zlibVersion+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lsocket $X_EXTRA_LIBS $LIBS" +LIBS="-lz $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -21242,11 +22894,11 @@ #ifdef __cplusplus extern "C" #endif -char connect (); +char zlibVersion (); int main () { -return connect (); +return zlibVersion (); ; return 0; } @@ -21269,85 +22921,72 @@ test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - ac_cv_lib_socket_connect=yes + ac_cv_lib_z_zlibVersion=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_socket_connect=no + ac_cv_lib_z_zlibVersion=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" +{ echo "$as_me:$LINENO: result: $ac_cv_lib_z_zlibVersion" >&5 +echo "${ECHO_T}$ac_cv_lib_z_zlibVersion" >&6; } +if test $ac_cv_lib_z_zlibVersion = yes; then + if test -n "$CUSTOM_ZLIB_LIBS"; then + ZLIB_LIBS="$CUSTOM_ZLIB_LIBS" + else + ZLIB_LIBS="-lz" + fi +else + { { echo "$as_me:$LINENO: error: zlib library not found. Please configure without Unity (using --disable-unity) or install the zlib devel package." >&5 +echo "$as_me: error: zlib library not found. Please configure without Unity (using --disable-unity) or install the zlib devel package." >&2;} + { (exit 1); exit 1; }; } fi - fi + LDFLAGS="$ORIGINAL_LDFLAGS" - # 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 + if test -n "$CUSTOM_ZLIB_CPPFLAGS"; then + ZLIB_CPPFLAGS="$CUSTOM_ZLIB_CPPFLAGS" + else + # XXX: No pkg-config and no zlib-config means we need to + # hard-code a sensible default. + ZLIB_CPPFLAGS="-I/usr/include" + fi + ORIGINAL_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$ZLIB_CPPFLAGS $CPPFLAGS" + if test "${ac_cv_header_zlib_h+set}" = set; then + { echo "$as_me:$LINENO: checking for zlib.h" >&5 +echo $ECHO_N "checking for zlib.h... $ECHO_C" >&6; } +if test "${ac_cv_header_zlib_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5 +echo "${ECHO_T}$ac_cv_header_zlib_h" >&6; } else - cat >conftest.$ac_ext <<_ACEOF + # Is the header compilable? +{ echo "$as_me:$LINENO: checking zlib.h usability" >&5 +echo $ECHO_N "checking zlib.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. */ -/* 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; -} +$ac_includes_default +@%:@include _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" +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_link") 2>conftest.er1 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -21356,118 +22995,129 @@ (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 + } && 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_cv_func_remove=no + ac_header_compiler=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; } +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; } - 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" +# Is the header present? +{ echo "$as_me:$LINENO: checking zlib.h presence" >&5 +echo $ECHO_N "checking zlib.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. */ - -/* 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; -} +@%:@include _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" +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_link") 2>conftest.er1 + (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); } && { - test -z "$ac_c_werror_flag" || + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$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 + }; then + ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_posix_remove=no + ac_header_preproc=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 +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: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: zlib.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: zlib.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: zlib.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: zlib.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: zlib.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: zlib.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: zlib.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: zlib.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: zlib.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: zlib.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: zlib.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: zlib.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 zlib.h" >&5 +echo $ECHO_N "checking for zlib.h... $ECHO_C" >&6; } +if test "${ac_cv_header_zlib_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_zlib_h=$ac_header_preproc 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" +{ echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5 +echo "${ECHO_T}$ac_cv_header_zlib_h" >&6; } + +fi +if test $ac_cv_header_zlib_h = yes; then + : +else + { { echo "$as_me:$LINENO: error: zlib headers not found. Please configure without Unity (using --disable-unity) or install the zlib devel package" >&5 +echo "$as_me: error: zlib headers not found. Please configure without Unity (using --disable-unity) or install the zlib devel package" >&2;} + { (exit 1); exit 1; }; } 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 + CPPFLAGS="$ORIGINAL_CPPFLAGS" + fi # End of library checks for Unity. + + if test -n "$CUSTOM_GTK_CPPFLAGS" -o -n "$CUSTOM_GTK_LIBS"; then + # Check to see if we have some version of GTK. gtk_accel_group_add + # is a random function that is present in Gtk 1.2 but not Gtk + # 2.0. Similarly, gtk_tree_view_new is a random function in Gtk 2.0 + # which is not present in Gtk 1.2. + { echo "$as_me:$LINENO: checking for gtk_accel_group_add in -lgtk" >&5 +echo $ECHO_N "checking for gtk_accel_group_add in -lgtk... $ECHO_C" >&6; } +if test "${ac_cv_lib_gtk_gtk_accel_group_add+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_check_lib_save_LIBS=$LIBS +LIBS="-lgtk $CUSTOM_GTK_LIBS $LIBS" +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 @@ -21475,18 +23125,11 @@ #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 - +char gtk_accel_group_add (); int main () { -return shmat (); +return gtk_accel_group_add (); ; return 0; } @@ -21509,28 +23152,32 @@ test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - ac_cv_func_shmat=yes + ac_cv_lib_gtk_gtk_accel_group_add=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_func_shmat=no + ac_cv_lib_gtk_gtk_accel_group_add=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_gtk_gtk_accel_group_add" >&5 +echo "${ECHO_T}$ac_cv_lib_gtk_gtk_accel_group_add" >&6; } +if test $ac_cv_lib_gtk_gtk_accel_group_add = yes; then + HAVE_GTK1="yes" 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 + if test "$with_gtk2" != "no"; then + { echo "$as_me:$LINENO: checking for gtk_tree_view_new in -lgtk-x11-2.0" >&5 +echo $ECHO_N "checking for gtk_tree_view_new in -lgtk-x11-2.0... $ECHO_C" >&6; } +if test "${ac_cv_lib_gtk_x11_2_0_gtk_tree_view_new+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lipc $LIBS" +LIBS="-lgtk-x11-2.0 $CUSTOM_GTK_LIBS $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -21544,11 +23191,11 @@ #ifdef __cplusplus extern "C" #endif -char shmat (); +char gtk_tree_view_new (); int main () { -return shmat (); +return gtk_tree_view_new (); ; return 0; } @@ -21571,43 +23218,120 @@ test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - ac_cv_lib_ipc_shmat=yes + ac_cv_lib_gtk_x11_2_0_gtk_tree_view_new=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_ipc_shmat=no + ac_cv_lib_gtk_x11_2_0_gtk_tree_view_new=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" +{ echo "$as_me:$LINENO: result: $ac_cv_lib_gtk_x11_2_0_gtk_tree_view_new" >&5 +echo "${ECHO_T}$ac_cv_lib_gtk_x11_2_0_gtk_tree_view_new" >&6; } +if test $ac_cv_lib_gtk_x11_2_0_gtk_tree_view_new = yes; then + HAVE_GTK2="yes" fi - fi - 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 + # Sometimes pkg-config can find stuff that AC_CHECK_LIB can't, so we use that as well. + if test "$HAVE_PKG_CONFIG" = "yes"; then + if test "$with_gtk2" != "no"; then + { 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 + HAVE_GTK2="yes" + { 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 + fi + + { echo "$as_me:$LINENO: checking for Gtk+ 1.x (via pkg-config)" >&5 +echo $ECHO_N "checking for Gtk+ 1.x (via pkg-config)... $ECHO_C" >&6; } + # The latter half of the test is because pkg-config's fallback + # to gtk-config is broken on systems such as Ubuntu that use + # bash-completion for unknown commands. (On Ubuntu, typing + # 'gtk-config' on a system that doesn't have libgtk1.2-dev + # installed outputs hints about using apt-get, in addition to the + # regular bash "command not found" message.) + if pkg-config --exists gtk+ \ + && test -n "`pkg-config --libs gtk+ 2>/dev/null | grep -v '^ *$'`"; then + HAVE_GTK1="yes" + { 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 + fi + + if test "$HAVE_GTK1" = "yes" -o "$HAVE_GTK2" = "yes"; then + # This bit is to fix builds on OpenSolaris B71, where + # 'pkg-config --cflags gtk+-2.0' gives an error. + if test "$HAVE_GTK2" = "yes" -a "$HAVE_PKG_CONFIG" = "yes" \ + && ! pkg-config --exists gtk+-2.0 \ + && test -z "$CUSTOM_GTK_CPPFLAGS" -a -z "$CUSTOM_GTK_LIBS"; then + HAVE_GTK2="no" + fi + + if test "$HAVE_GTK2" = "yes"; then + # Gtk 2.0 + GTK_CPPFLAGS="$GTK_CPPFLAGS -DGTK2" + gtkPackageName="gtk+-2.0" + elif test "$HAVE_GTK1" = "yes"; then + # Gtk 1.2 + gtkPackageName="gtk+" + + # Unity requires Gtk 2.0. + if test "$enable_unity" != "no"; then + { { echo "$as_me:$LINENO: error: The Unity feature requires Gtk+ 2.0. Please install the Gtk+ 2.0 devel packages or configure without Unity (using --disable-unity)" >&5 +echo "$as_me: error: The Unity feature requires Gtk+ 2.0. Please install the Gtk+ 2.0 devel packages or configure without Unity (using --disable-unity)" >&2;} + { (exit 1); exit 1; }; } + fi + else + # We found Gtk+ 2.0 that turned out to have a non-working + # pkg-config setup, AND Gtk 1.2 wasn't installed. + { { echo "$as_me:$LINENO: error: The Gtk+ library installed on your system is not fully functional. Please contact your OS vendor." >&5 +echo "$as_me: error: The Gtk+ library installed on your system is not fully functional. Please contact your OS vendor." >&2;} + { (exit 1); exit 1; }; } + fi + + # Prefer flags specified, in the environment, by the user. + if test -n "$CUSTOM_GTK_CPPFLAGS" -o -n "$CUSTOM_GTK_LIBS"; then + GTK_CPPFLAGS="$GTK_CPPFLAGS $CUSTOM_GTK_CPPFLAGS" + GTK_LIBS="$GTK_LIBS $CUSTOM_GTK_LIBS" + # Use pkg-config if available and there are no user-specified flags. + elif test "$HAVE_PKG_CONFIG" = "yes"; then + GTK_CPPFLAGS="$GTK_CPPFLAGS $(pkg-config --cflags $gtkPackageName)" + GTK_LIBS="$GTK_LIBS $(pkg-config --libs $gtkPackageName)" + # Otherwise, we have a problem. + else + { { echo "$as_me:$LINENO: error: pkg-config not found. Get pkg-config or set CUSTOM_GTK_CPPFLAGS and CUSTOM_GTK_LIBS to specify gtk header file and library locations." >&5 +echo "$as_me: error: pkg-config not found. Get pkg-config or set CUSTOM_GTK_CPPFLAGS and CUSTOM_GTK_LIBS to specify gtk header file and library locations." >&2;} + { (exit 1); exit 1; }; } + fi + + # Check for a sufficiently new installation of Gtk 2.0. This symbol is, at + # the time of writing, used in vmware-user. We must perform this check + # after GTK_LIBS has been set up. Note: we don't actually use the + # resultant HAVE_NEW_GTK2 variable; it's just set so that the default + # action, which will append gdk-x11-2.0 to LIBS, isn't taken. + if test "$HAVE_GTK2" == "yes"; then + { echo "$as_me:$LINENO: checking for gdk_display_get_default_group in -lgdk-x11-2.0" >&5 +echo $ECHO_N "checking for gdk_display_get_default_group in -lgdk-x11-2.0... $ECHO_C" >&6; } +if test "${ac_cv_lib_gdk_x11_2_0_gdk_display_get_default_group+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lICE $X_EXTRA_LIBS $LIBS" +LIBS="-lgdk-x11-2.0 $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -21621,11 +23345,11 @@ #ifdef __cplusplus extern "C" #endif -char IceConnectionNumber (); +char gdk_display_get_default_group (); int main () { -return IceConnectionNumber (); +return gdk_display_get_default_group (); ; return 0; } @@ -21648,50 +23372,41 @@ test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - ac_cv_lib_ICE_IceConnectionNumber=yes + ac_cv_lib_gdk_x11_2_0_gdk_display_get_default_group=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_ICE_IceConnectionNumber=no + ac_cv_lib_gdk_x11_2_0_gdk_display_get_default_group=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 - +{ echo "$as_me:$LINENO: result: $ac_cv_lib_gdk_x11_2_0_gdk_display_get_default_group" >&5 +echo "${ECHO_T}$ac_cv_lib_gdk_x11_2_0_gdk_display_get_default_group" >&6; } +if test $ac_cv_lib_gdk_x11_2_0_gdk_display_get_default_group = yes; then + HAVE_NEW_GTK2="yes" +else + { { echo "$as_me:$LINENO: error: Gtk 2.0 installation may be too old. Please upgrade your Gtk 2.0 packages or configure without Gtk 2.0 (using --without-gtk2)" >&5 +echo "$as_me: error: Gtk 2.0 installation may be too old. Please upgrade your Gtk 2.0 packages or configure without Gtk 2.0 (using --without-gtk2)" >&2;} + { (exit 1); exit 1; }; } + $GTK_LIBS fi + fi -# If the user explicitly disables X11, then don't try to detect the X-related libraries -if test "$have_x" = "disabled"; then - MULTIMON_ENABLED="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 - LIBS="$LIBS $X_LIBS" - CFLAGS="$CFLAGS $X_CFLAGS" - COMMON_XLIBS="-lX11" - COMMON_XLIBS="-lXext $COMMON_XLIBS" - - if test "$MULTIMON_ENABLED" != "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 + # Unity requires libgdk_pixbuf_xlib, which most systems don't seem to + # provide via "pkg-config --libs gtk+-2.0". + if test "$enable_unity" != "no"; then + { echo "$as_me:$LINENO: checking for gdk_pixbuf_xlib_init in -lgdk_pixbuf_xlib-2.0" >&5 +echo $ECHO_N "checking for gdk_pixbuf_xlib_init in -lgdk_pixbuf_xlib-2.0... $ECHO_C" >&6; } +if test "${ac_cv_lib_gdk_pixbuf_xlib_2_0_gdk_pixbuf_xlib_init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lXinerama $COMMON_XLIBS $LIBS" +LIBS="-lgdk_pixbuf_xlib-2.0 $GTK_LIBS $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -21705,11 +23420,11 @@ #ifdef __cplusplus extern "C" #endif -char XineramaQueryVersion (); +char gdk_pixbuf_xlib_init (); int main () { -return XineramaQueryVersion (); +return gdk_pixbuf_xlib_init (); ; return 0; } @@ -21732,37 +23447,43 @@ test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - ac_cv_lib_Xinerama_XineramaQueryVersion=yes + ac_cv_lib_gdk_pixbuf_xlib_2_0_gdk_pixbuf_xlib_init=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_Xinerama_XineramaQueryVersion=no + ac_cv_lib_gdk_pixbuf_xlib_2_0_gdk_pixbuf_xlib_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_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" +{ echo "$as_me:$LINENO: result: $ac_cv_lib_gdk_pixbuf_xlib_2_0_gdk_pixbuf_xlib_init" >&5 +echo "${ECHO_T}$ac_cv_lib_gdk_pixbuf_xlib_2_0_gdk_pixbuf_xlib_init" >&6; } +if test $ac_cv_lib_gdk_pixbuf_xlib_2_0_gdk_pixbuf_xlib_init = yes; then + GTK_LIBS="$GTK_LIBS -lgdk_pixbuf_xlib-2.0" 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;} + { { echo "$as_me:$LINENO: error: gdk_pixbuf_xlib-2.0 not found. Make sure your Gtk 2.0 installation is sane, or configure without Unity (using --disable-unity)." >&5 +echo "$as_me: error: gdk_pixbuf_xlib-2.0 not found. Make sure your Gtk 2.0 installation is sane, or configure without Unity (using --disable-unity)." >&2;} { (exit 1); exit 1; }; } fi + fi + else + { { echo "$as_me:$LINENO: error: libgtk not found. Please install the gtk devel package(s)." >&5 +echo "$as_me: error: libgtk not found. Please install the gtk devel package(s)." >&2;} + { (exit 1); exit 1; }; } fi +fi # End of checks for X libraries - { 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 "$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="-lXrandr -lXrender $COMMON_XLIBS $LIBS" +LIBS="-lcrypt $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -21776,11 +23497,11 @@ #ifdef __cplusplus extern "C" #endif -char XRRQueryVersion (); +char crypt (); int main () { -return XRRQueryVersion (); +return crypt (); ; return 0; } @@ -21803,37 +23524,37 @@ test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - ac_cv_lib_Xrandr_XRRQueryVersion=yes + ac_cv_lib_crypt_crypt=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_Xrandr_XRRQueryVersion=no + 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_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" - COMMON_XLIBS="-lXrender $COMMON_XLIBS" +{ 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" + GUESTD_LDADD="$GUESTD_LDADD -lcrypt" 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;} + { { 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 - { 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 "$as_me:$LINENO: checking for notify_init in -lnotify" >&5 +echo $ECHO_N "checking for notify_init in -lnotify... $ECHO_C" >&6; } +if test "${ac_cv_lib_notify_notify_init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lXtst $COMMON_XLIBS $LIBS" +LIBS="-lnotify $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -21847,11 +23568,11 @@ #ifdef __cplusplus extern "C" #endif -char XTestQueryExtension (); +char notify_init (); int main () { -return XTestQueryExtension (); +return notify_init (); ; return 0; } @@ -21874,47 +23595,60 @@ test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - ac_cv_lib_Xtst_XTestQueryExtension=yes + ac_cv_lib_notify_notify_init=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_Xtst_XTestQueryExtension=no + ac_cv_lib_notify_notify_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_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" +{ echo "$as_me:$LINENO: result: $ac_cv_lib_notify_notify_init" >&5 +echo "${ECHO_T}$ac_cv_lib_notify_notify_init" >&6; } +if test $ac_cv_lib_notify_notify_init = yes; then + HAVE_NOTIFY="yes" + VMWARE_USER_LDADD="$VMWARE_USER_LDADD -lnotify" 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; }; } + { echo "$as_me:$LINENO: WARNING: libnotify not found; notification disabled" >&5 +echo "$as_me: WARNING: libnotify not found; notification disabled" >&2;} fi - if test -n "$CUSTOM_GTK_CFLAGS" -o -n "$CUSTOM_GTK_LIBS"; then - # Check to see if we have some version of GTK. gtk_accel_group_add - # is a random function that is present in Gtk 1.2 but not Gtk - # 2.0. Similarly, gtk_tree_view_new is a random function in Gtk 2.0 - # which is not present in Gtk 1.2. - { echo "$as_me:$LINENO: checking for gtk_accel_group_add in -lgtk" >&5 -echo $ECHO_N "checking for gtk_accel_group_add in -lgtk... $ECHO_C" >&6; } -if test "${ac_cv_lib_gtk_gtk_accel_group_add+set}" = set; then + +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 - ac_check_lib_save_LIBS=$LIBS -LIBS="-lgtk $CUSTOM_GTK_LIBS $LIBS" -cat >conftest.$ac_ext <<_ACEOF + 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 @@ -21922,11 +23656,18 @@ #ifdef __cplusplus extern "C" #endif -char gtk_accel_group_add (); +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 gtk_accel_group_add (); +return $ac_func (); ; return 0; } @@ -21949,31 +23690,33 @@ test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - ac_cv_lib_gtk_gtk_accel_group_add=yes + eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_gtk_gtk_accel_group_add=no + eval "$as_ac_var=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_gtk_gtk_accel_group_add" >&5 -echo "${ECHO_T}$ac_cv_lib_gtk_gtk_accel_group_add" >&6; } -if test $ac_cv_lib_gtk_gtk_accel_group_add = yes; then - HAVE_GTK1="yes" fi - - { echo "$as_me:$LINENO: checking for gtk_tree_view_new in -lgtk-x11-2.0" >&5 -echo $ECHO_N "checking for gtk_tree_view_new in -lgtk-x11-2.0... $ECHO_C" >&6; } -if test "${ac_cv_lib_gtk_x11_2_0_gtk_tree_view_new+set}" = set; then +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="-lgtk-x11-2.0 $CUSTOM_GTK_LIBS $LIBS" +LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -21987,11 +23730,11 @@ #ifdef __cplusplus extern "C" #endif -char gtk_tree_view_new (); +char dlopen (); int main () { -return gtk_tree_view_new (); +return dlopen (); ; return 0; } @@ -22014,117 +23757,63 @@ test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - ac_cv_lib_gtk_x11_2_0_gtk_tree_view_new=yes + ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_gtk_x11_2_0_gtk_tree_view_new=no + 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_gtk_x11_2_0_gtk_tree_view_new" >&5 -echo "${ECHO_T}$ac_cv_lib_gtk_x11_2_0_gtk_tree_view_new" >&6; } -if test $ac_cv_lib_gtk_x11_2_0_gtk_tree_view_new = yes; then - HAVE_GTK2="yes" +{ 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 + GUESTD_LDADD="$GUESTD_LDADD -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 - - # Sometimes pkg-config can find stuff that AC_CHECK_LIB can't, so we use that as well. - if test "$HAVE_PKG_CONFIG" = "yes"; then - { 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 - HAVE_GTK2="yes" - { 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: checking for Gtk+ 1.x (via pkg-config)" >&5 -echo $ECHO_N "checking for Gtk+ 1.x (via pkg-config)... $ECHO_C" >&6; } - # The latter half of the test is because pkg-config's fallback - # to gtk-config is broken on systems such as Ubuntu that use - # bash-completion for unknown commands. (On Ubuntu, typing - # 'gtk-config' on a system that doesn't have libgtk1.2-dev - # installed outputs hints about using apt-get, in addition to the - # regular bash "command not found" message.) - if pkg-config --exists gtk+ \ - && test -n "`pkg-config --libs gtk+ 2>/dev/null | grep -v '^ *$'`"; then - HAVE_GTK1="yes" - { 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 - fi - - if test "$HAVE_GTK1" = "yes" -o "$HAVE_GTK2" = "yes"; then - # This bit is to fix builds on OpenSolaris B71, where - # 'pkg-config --cflags gtk+-2.0' gives an error. - if test "$HAVE_GTK2" = "yes" -a "$HAVE_PKG_CONFIG" = "yes" \ - && ! pkg-config --exists gtk+-2.0 \ - && test -z "$CUSTOM_GTK_CFLAGS" -a -z "$CUSTOM_GTK_LIBS"; then - HAVE_GTK2="no" - fi - - if test "$HAVE_GTK2" = "yes"; then - # Gtk 2.0 - GTK_CFLAGS="$GTK_CFLAGS -DGTK2" - gtkPackageName="gtk+-2.0" - elif test "$HAVE_GTK1" = "yes"; then - # Gtk 1.2 - gtkPackageName="gtk+" - else - # We found Gtk+ 2.0 that turned out to have a non-working - # pkg-config setup, AND Gtk 1.2 wasn't installed. - { { echo "$as_me:$LINENO: error: The Gtk+ library installed on your system is not fully functional. Please contact your OS vendor." >&5 -echo "$as_me: error: The Gtk+ library installed on your system is not fully functional. Please contact your OS vendor." >&2;} - { (exit 1); exit 1; }; } - fi +fi +done - # Prefer flags specified, in the environment, by the user. - if test -n "$CUSTOM_GTK_CFLAGS" -o -n "$CUSTOM_GTK_LIBS"; then - GTK_CFLAGS="$GTK_CFLAGS $CUSTOM_GTK_CFLAGS" - GTK_LIBS="$GTK_LIBS $CUSTOM_GTK_LIBS" - # Use pkg-config if available and there are no user-specified flags. - elif test "$HAVE_PKG_CONFIG" = "yes"; then - GTK_CFLAGS="$GTK_CFLAGS $(pkg-config --cflags $gtkPackageName)" - GTK_LIBS="$GTK_LIBS $(pkg-config --libs $gtkPackageName)" - # Otherwise, we have a problem. - else - { { echo "$as_me:$LINENO: error: pkg-config not found. Get pkg-config or set CUSTOM_GTK_CFLAGS and CUSTOM_GTK_LIBS to specify gtk header file and library locations." >&5 -echo "$as_me: error: pkg-config not found. Get pkg-config or set CUSTOM_GTK_CFLAGS and CUSTOM_GTK_LIBS to specify gtk header file and library locations." >&2;} - { (exit 1); exit 1; }; } - fi - else - { { echo "$as_me:$LINENO: error: libgtk not found. Please install the gtk devel package(s)." >&5 -echo "$as_me: error: libgtk not found. Please install the gtk devel package(s)." >&2;} - { (exit 1); exit 1; }; } - 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 +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 - ac_check_lib_save_LIBS=$LIBS -LIBS="-lcrypt $LIBS" -cat >conftest.$ac_ext <<_ACEOF + 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 @@ -22132,11 +23821,18 @@ #ifdef __cplusplus extern "C" #endif -char crypt (); +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 crypt (); +return $ac_func (); ; return 0; } @@ -22159,32 +23855,30 @@ test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - ac_cv_lib_crypt_crypt=yes + eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_crypt_crypt=no + eval "$as_ac_var=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" - GUESTD_LDFLAGS="$GUESTD_LDFLAGS -lcrypt" -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; }; } +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 dlopen +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 @@ -22274,14 +23968,17 @@ @%:@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 +fi +done + + +{ 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="-ldl $LIBS" +LIBS="-lpthread $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -22295,11 +23992,11 @@ #ifdef __cplusplus extern "C" #endif -char dlopen (); +char pthread_mutex_init (); int main () { -return dlopen (); +return pthread_mutex_init (); ; return 0; } @@ -22322,63 +24019,69 @@ test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - ac_cv_lib_dl_dlopen=yes + 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_dl_dlopen=no + 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_dl_dlopen" >&5 -echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6; } -if test $ac_cv_lib_dl_dlopen = yes; then - GUESTD_LDFLAGS="$GUESTD_LDFLAGS -ldl" +{ 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 + GUESTD_LDADD="$GUESTD_LDADD -lpthread" + VMWARE_USER_LDADD="$VMWARE_USER_LDADD -lpthread" 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;} + { { 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 + +# 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 -done +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 -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 +else + with_procps="no" +fi + +if test "$with_procps" = "yes"; then + ORIGINAL_LDFLAGS="$LDFLAGS" + LDFLAGS="$CUSTOM_PROCPS_LIBS $LDFLAGS" + { echo "$as_me:$LINENO: checking for getstat in -lproc-3.2.7" >&5 +echo $ECHO_N "checking for getstat in -lproc-3.2.7... $ECHO_C" >&6; } +if test "${ac_cv_lib_proc_3_2_7_getstat+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_check_lib_save_LIBS=$LIBS +LIBS="-lproc-3.2.7 $LIBS" +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 @@ -22386,18 +24089,11 @@ #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 - +char getstat (); int main () { -return $ac_func (); +return getstat (); ; return 0; } @@ -22420,130 +24116,330 @@ test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" + ac_cv_lib_proc_3_2_7_getstat=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_var=no" + ac_cv_lib_proc_3_2_7_getstat=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_proc_3_2_7_getstat" >&5 +echo "${ECHO_T}$ac_cv_lib_proc_3_2_7_getstat" >&6; } +if test $ac_cv_lib_proc_3_2_7_getstat = yes; then + if test -n "$CUSTOM_PROCPS_LIBS"; then + PROCPS_LIBS="$CUSTOM_PROCPS_LIBS" + else + PROCPS_LIBS="-lproc-3.2.7" + fi +else + { { 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 + + LDFLAGS="$ORIGINAL_LDFLAGS" + + GUESTD_LDADD="$GUESTD_LDADD $PROCPS_LIBS" + VMWARE_USER_LDADD="$VMWARE_USER_LDADD $PROCPS_LIBS" +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 + + +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. + for ac_prog in dumbnet-config dnet-config +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_DNET_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$DNET_CONFIG"; then + ac_cv_prog_DNET_CONFIG="$DNET_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_DNET_CONFIG="$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 +DNET_CONFIG=$ac_cv_prog_DNET_CONFIG +if test -n "$DNET_CONFIG"; then + { echo "$as_me:$LINENO: result: $DNET_CONFIG" >&5 +echo "${ECHO_T}$DNET_CONFIG" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$DNET_CONFIG" && break +done +test -n "$DNET_CONFIG" || DNET_CONFIG="no" + + + if test "$DNET_CONFIG" != no; then + DNET_CPPFLAGS="`$DNET_CONFIG --cflags`" + DNET_LIBS="`$DNET_CONFIG --libs`" + + GUESTD_LDADD="$GUESTD_LDADD $DNET_LIBS" + VMWARE_USER_LDADD="$VMWARE_USER_LDADD $DNET_LIBS" + if test "$DNET_CONFIG" == dumbnet-config; then + +cat >>confdefs.h <<\_ACEOF +@%:@define DNET_IS_DUMBNET 1 +_ACEOF + + fi + else + { { 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 "$with_icu" = "yes"; 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_ICU_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $ICU_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ICU_CONFIG="$ICU_CONFIG" # 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_ICU_CONFIG="$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_ICU_CONFIG" && ac_cv_path_ICU_CONFIG="no" + ;; +esac +fi +ICU_CONFIG=$ac_cv_path_ICU_CONFIG +if test -n "$ICU_CONFIG"; then + { echo "$as_me:$LINENO: result: $ICU_CONFIG" >&5 +echo "${ECHO_T}$ICU_CONFIG" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + + if test "$ICU_CONFIG" != no; then + ICU_CPPFLAGS="`$ICU_CONFIG --cppflags` -DUSE_ICU" + ICU_LIBS="`$ICU_CONFIG --ldflags`" + + # The icu components are built with C++, so we need to ensure + # that the C++ linker actually exists, and use it when linking + # icu into our applications and when performing configuration + # tests against icu. + # + # XXX: Getting automake to choose between the C linker and the + # C++ linker depending on HAVE_ICU was a royal pain in the ass. + # The classic way to do this is to define an optional source + # file for a program with an extension of .cxx, using + # nodist_EXTRA_fooprogram_SOURCES. This causes automake's + # linker detection algorithm to see a C++ source file and + # automatically set up the C++ linker and link line for us. + # Unfortunately, said linker detection doesn't obey + # conditionals, which means that it'd always pick the C++ + # linker, regardless of the value of HAVE_ICU. Instead, we are + # forced to manually set the correct linker in fooprogram_LINK. + # However, since none of our programs actually contain C++ + # code, automake doesn't make the CXXLINK variable (which + # contains the linker as well as all link flags) available to + # us, so we must hard-code the entire link line into + # fooprogram_LINK. Not exactly a futureproof solution... + # + # Additional references on this problem: + # http://sources.redhat.com/ml/automake/1999-10/msg00101.html + # http://lists.gnu.org/archive/html/bug-automake/2008-04/msg00010.html + # http://www.gnu.org/software/automake/manual/automake.html#Libtool-Convenience-Libraries + # http://www.gnu.org/software/automake/manual/automake.html#C_002b_002b-Support + 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 - -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 - +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 -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 +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 - 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" + 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 - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +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 - 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 - +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="" + 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 -done + if test -z "$HAVE_CXX"; then + { { echo "$as_me:$LINENO: error: No C++ compiler was found on your PATH. Please configure without ICU (using --without-icu) or install a C++ compiler." >&5 +echo "$as_me: error: No C++ compiler was found on your PATH. Please configure without ICU (using --without-icu) or install a C++ compiler." >&2;} + { (exit 1); exit 1; }; } + 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 -{ 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 "$as_me:$LINENO: checking for ucasemap_utf8ToTitle_3_8 in -licuuc" >&5 +echo $ECHO_N "checking for ucasemap_utf8ToTitle_3_8 in -licuuc... $ECHO_C" >&6; } +if test "${ac_cv_lib_icuuc_ucasemap_utf8ToTitle_3_8+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lpthread $LIBS" +LIBS="-licuuc $ICU_LIBS $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -22557,11 +24453,11 @@ #ifdef __cplusplus extern "C" #endif -char pthread_mutex_init (); +char ucasemap_utf8ToTitle_3_8 (); int main () { -return pthread_mutex_init (); +return ucasemap_utf8ToTitle_3_8 (); ; return 0; } @@ -22580,47 +24476,58 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || + test -z "$ac_cxx_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 + ac_cv_lib_icuuc_ucasemap_utf8ToTitle_3_8=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_pthread_pthread_mutex_init=no + ac_cv_lib_icuuc_ucasemap_utf8ToTitle_3_8=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 - GUESTD_LDFLAGS="$GUESTD_LDFLAGS -lpthread" - VMWARE_USER_LDFLAGS="$VMWARE_USER_LDFLAGS -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; }; } +{ echo "$as_me:$LINENO: result: $ac_cv_lib_icuuc_ucasemap_utf8ToTitle_3_8" >&5 +echo "${ECHO_T}$ac_cv_lib_icuuc_ucasemap_utf8ToTitle_3_8" >&6; } +if test $ac_cv_lib_icuuc_ucasemap_utf8ToTitle_3_8 = yes; then + have_ICU_38="yes" 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 "$os" = "solaris"; then - # libdnet is needed on Solaris to build guestInfoPosix.c. + if test "$have_ICU_38" = "yes"; then + ICU_CPPFLAGS="$ICU_CPPFLAGS -DHAVE_ICU_38" + fi + + # Easier to give all modules the ICU defines/includes... + CPPFLAGS="$CPPFLAGS $ICU_CPPFLAGS" + else + { { echo "$as_me:$LINENO: error: icu-config was not found on your PATH. Please configure without ICU (using --without-icu) or install ICU - http://www.icu-project.org" >&5 +echo "$as_me: error: icu-config was not found on your PATH. Please configure without ICU (using --without-icu) or install ICU - http://www.icu-project.org" >&2;} + { (exit 1); exit 1; }; } + fi +fi - # Extract the first word of "dnet-config", so it can be a program name with args. -set dummy dnet-config; ac_word=$2 +# 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_DNET_CONFIG+set}" = set; then +if test "${ac_cv_path_RPCGEN+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - case $DNET_CONFIG in + case $RPCGEN in [\\/]* | ?:[\\/]*) - ac_cv_path_DNET_CONFIG="$DNET_CONFIG" # Let the user override the test with a path. + ac_cv_path_RPCGEN="$RPCGEN" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -22630,7 +24537,7 @@ 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_DNET_CONFIG="$as_dir/$ac_word$ac_exec_ext" + 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 @@ -22638,14 +24545,16 @@ done IFS=$as_save_IFS - test -z "$ac_cv_path_DNET_CONFIG" && ac_cv_path_DNET_CONFIG="no" + 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 -DNET_CONFIG=$ac_cv_path_DNET_CONFIG -if test -n "$DNET_CONFIG"; then - { echo "$as_me:$LINENO: result: $DNET_CONFIG" >&5 -echo "${ECHO_T}$DNET_CONFIG" >&6; } +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; } @@ -22653,19 +24562,6 @@ - if test "$DNET_CONFIG" = "no"; then - { { echo "$as_me:$LINENO: error: dnet-config was not found on your PATH. libdnet must be installed in order to build open-vm-tools on Solaris. See http://libdnet.sourceforge.net/" >&5 -echo "$as_me: error: dnet-config was not found on your PATH. libdnet must be installed in order to build open-vm-tools on Solaris. See http://libdnet.sourceforge.net/" >&2;} - { (exit 1); exit 1; }; } - fi - - DNET_CFLAGS="`$DNET_CONFIG --cflags`" - DNET_LIBS="`$DNET_CONFIG --libs`" - - GUESTD_LDFLAGS="$GUESTD_LDFLAGS $DNET_LIBS" - VMWARE_USER_LDFLAGS="$VMWARE_USER_LDFLAGS $DNET_LIBS" -fi - ### ### Headers ### @@ -24756,7 +26652,7 @@ -if test "$MULTIMON_ENABLED" != "no"; then +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 @@ -25756,9 +27652,6 @@ ### Specific features and OS/arch flags / actions ### -# Capture the CFLAGS, so we can restore them later. -ORIGINAL_CFLAGS="$CFLAGS" - # Check to see if SYS_setuid32 is defined. If SYS_setuid32 is unknown, we will # certainly error out. if test "$os$userSpaceBitness" = "linux32"; then @@ -25818,6 +27711,7 @@ # remove const'ness without an explicit cast). { echo "$as_me:$LINENO: checking for the new format of iconv" >&5 echo $ECHO_N "checking for the new format of iconv... $ECHO_C" >&6; } +ORIGINAL_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Werror" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -25974,6 +27868,7 @@ { echo "$as_me:$LINENO: checking for setresuid" >&5 echo $ECHO_N "checking for setresuid... $ECHO_C" >&6; } # Ensure an error is thrown if setresuid is unknown. + ORIGINAL_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Werror-implicit-function-declaration -Werror" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -26025,15 +27920,17 @@ fi ### General flags / actions -COMMON_CFLAGS="$COMMON_CFLAGS -Wall" -COMMON_CFLAGS="$COMMON_CFLAGS -Werror" +CFLAGS="$CFLAGS -Wall" +CFLAGS="$CFLAGS -Werror" # -Wno-unknown-pragmas is due to gcc not understanding '#pragma ident' in Xlib.h on OpenSolaris. for TEST_CFLAG in -Wno-pointer-sign -Wno-unused-value -fno-strict-aliasing \ -Wno-unknown-pragmas -Wno-uninitialized; 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 @@ -26068,7 +27965,7 @@ test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - COMMON_CFLAGS="$COMMON_CFLAGS $TEST_CFLAG" + NEW_CFLAG=" $TEST_CFLAG" { echo "$as_me:$LINENO: result: yes" >&5 echo "${ECHO_T}yes" >&6; } else @@ -26080,67 +27977,79 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS="$ORIGINAL_CFLAGS" + CFLAGS="$ORIGINAL_CFLAGS$NEW_CFLAG" done -COMMON_CFLAGS="$COMMON_CFLAGS -DVMX86_TOOLS" +CPPFLAGS="$CPPFLAGS -DVMX86_TOOLS" +CPPFLAGS="$CPPFLAGS -DNO_CORE_ICU" INCLUDE_DIR="`cd $srcdir; pwd`/lib/include" -COMMON_CFLAGS="$COMMON_CFLAGS -I$INCLUDE_DIR" +CPPFLAGS="$CPPFLAGS -I$INCLUDE_DIR" ### OS/arch-specific flags / actions MODULES="" MODULES_OS="$os" +TARGET_OS="$os" +MODULES_DIR="" buildHgfsmounter=no if test "$os" = "linux"; then - COMMON_CFLAGS="$COMMON_CFLAGS -D_FILE_OFFSET_BITS=64" - COMMON_CFLAGS="$COMMON_CFLAGS -D_LARGEFILE64_SOURCE" - COMMON_CFLAGS="$COMMON_CFLAGS -D_XOPEN_SOURCE=500" - COMMON_CFLAGS="$COMMON_CFLAGS -D_BSD_SOURCE" - COMMON_CFLAGS="$COMMON_CFLAGS -D_SVID_SOURCE" + 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" if test "$osVersion" -ge 202000; then - MODULES="$MODULES vmxnet vmmemctl" + MODULES="$MODULES vmmemctl vmxnet" fi if test "$osVersion" -ge 204000; then - MODULES="$MODULES vmhgfs vmblock" + MODULES="$MODULES vmblock vmci vmhgfs vsock" buildHgfsmounter=yes fi + if test "$osVersion" -ge 206000; then + MODULES="$MODULES vmxnet3" + fi if test "$osVersion" -ge 206006; then MODULES="$MODULES vmsync" fi fi if test "$os" = "freebsd"; then - if test "$osVersion" -gt 302000; then + MODULES_DIR="/boot/modules" + + if test "$osVersion" -ge 302000; then MODULES="$MODULES vmmemctl" fi - if test "$osVersion" -gt 409000; then + if test "$osVersion" -ge 409000; then MODULES="$MODULES vmxnet" fi - if test "$osVersion" -gt 600000; then - MODULES="$MODULES vmhgfs vmblock" + if test "$osVersion" -ge 600000; then + MODULES="$MODULES vmblock vmhgfs" buildHgfsmounter=yes fi fi if test "$os" = "solaris"; then - LIB_IMPERSONATE_CFLAGS="$LIB_IMPERSONATE_CFLAGS -D_POSIX_PTHREAD_SEMANTICS" - LIB_USER_CFLAGS="$LIB_USER_CFLAGS -D_POSIX_PTHREAD_SEMANTICS" + LIB_IMPERSONATE_CPPFLAGS="$LIB_IMPERSONATE_CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS" + LIB_USER_CPPFLAGS="$LIB_USER_CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS" - GUESTD_LDFLAGS="$GUESTD_LDFLAGS -lsocket" - GUESTD_LDFLAGS="$GUESTD_LDFLAGS -lnsl" - - VMWARE_USER_CFLAGS="$VMWARE_USER_CFLAGS -I/usr/X11/include/" - VMWARE_USER_LDFLAGS="$VMWARE_USER_LDFLAGS -lXext" - VMWARE_USER_LDFLAGS="$VMWARE_USER_LDFLAGS -lX11" - VMWARE_USER_LDFLAGS="$VMWARE_USER_LDFLAGS -lsocket" - VMWARE_USER_LDFLAGS="$VMWARE_USER_LDFLAGS -lnsl" + GUESTD_LDADD="$GUESTD_LDADD -lsocket" + GUESTD_LDADD="$GUESTD_LDADD -lnsl" + GUESTD_LDADD="$GUESTD_LDADD -lrpcsvc" + + VMWARE_USER_CPPFLAGS="$VMWARE_USER_CPPFLAGS -I/usr/X11/include/" + VMWARE_USER_LDADD="$VMWARE_USER_LDADD -lXext" + VMWARE_USER_LDADD="$VMWARE_USER_LDADD -lX11" + VMWARE_USER_LDADD="$VMWARE_USER_LDADD -lsocket" + VMWARE_USER_LDADD="$VMWARE_USER_LDADD -lnsl" + VMWARE_USER_LDADD="$VMWARE_USER_LDADD -lrpcsvc" # uname -r on Solaris 10 reports "5.10" if test "$osVersion" -ge 510000; then - COMMON_CFLAGS="$COMMON_CFLAGS -DSOL10" + CPPFLAGS="$CPPFLAGS -DSOL10" fi fi @@ -26168,6 +28077,14 @@ SOLARIS_FALSE= fi + if test "$os" = "freebsd"; then + FREEBSD_TRUE= + FREEBSD_FALSE='#' +else + FREEBSD_TRUE='#' + FREEBSD_FALSE= +fi + if test "$userSpaceBitness" = "32"; then THIRTY_TWO_BIT_USERSPACE_TRUE= THIRTY_TWO_BIT_USERSPACE_FALSE='#' @@ -26184,43 +28101,86 @@ 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 -d /etc/pam.d; then + PAMD_TRUE= + PAMD_FALSE='#' +else + PAMD_TRUE='#' + PAMD_FALSE= +fi + + if test "$enable_unity" = "yes"; then + ENABLE_UNITY_TRUE= + ENABLE_UNITY_FALSE='#' +else + ENABLE_UNITY_TRUE='#' + ENABLE_UNITY_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 + ### 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 "$MULTIMON_ENABLED" = "no"; then - cat >>confdefs.h <<\_ACEOF +# 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 if test "$os$userSpaceBitness" = "linux64" || test "$HAVE_SYS_SETUID" = "yes"; then - LIB_MISC_CFLAGS="$LIB_MISC_CFLAGS -DGLIBC_VERSION_21" + LIB_MISC_CPPFLAGS="$LIB_MISC_CPPFLAGS -DGLIBC_VERSION_21" fi if test "$HAVE_NEW_ICONV" = "yes"; then - LIB_MISC_CFLAGS="$LIB_MISC_CFLAGS -DGLIBC_VERSION_22" + LIB_MISC_CPPFLAGS="$LIB_MISC_CPPFLAGS -DGLIBC_VERSION_22" fi if test "$HAVE_LSEEK" = "yes"; then - LIB_FILE_CFLAGS="$LIB_FILE_CFLAGS -DGLIBC_VERSION_21" - LIB_HGFS_SERVER_CFLAGS="$LIB_HGFS_SERVER_CFLAGS -DGLIBC_VERSION_21" + LIB_FILE_CPPFLAGS="$LIB_FILE_CPPFLAGS -DGLIBC_VERSION_21" + LIB_HGFS_SERVER_CPPFLAGS="$LIB_HGFS_SERVER_CPPFLAGS -DGLIBC_VERSION_21" fi if test "$HAVE_SETRESUID" = "yes"; then - LIB_PROC_MGR_CFLAGS="$LIB_PROC_MGR_CFLAGS -DGLIBC_VERSION_23" + LIB_PROC_MGR_CPPFLAGS="$LIB_PROC_MGR_CPPFLAGS -DGLIBC_VERSION_23" fi if test "$HAVE_CRYPT" = "yes"; then - LIB_AUTH_CFLAGS="$LIB_AUTH_CFLAGS -DGLIBC_VERSION_22" + LIB_AUTH_CPPFLAGS="$LIB_AUTH_CPPFLAGS -DGLIBC_VERSION_22" fi if test "$HAVE_WCHAR_H" = "yes"; then - LIB_STRING_CFLAGS="$LIB_STRING_CFLAGS -DGLIBC_VERSION_22" + LIB_STRING_CPPFLAGS="$LIB_STRING_CPPFLAGS -DGLIBC_VERSION_22" fi ### General substs @@ -26235,6 +28195,17 @@ + + + + + + + + + + + ### Lib substs @@ -26256,7 +28227,7 @@ ### ### Create the Makefiles ### -ac_config_files="$ac_config_files Makefile lib/Makefile lib/atomic/Makefile lib/atomic/shared/Makefile lib/auth/Makefile lib/backdoor/Makefile lib/backdoor/shared/Makefile lib/conf/Makefile lib/dict/Makefile lib/dnd/Makefile lib/err/Makefile lib/eventManager/Makefile lib/file/Makefile lib/fileUtf8/Makefile lib/foundryMsg/Makefile lib/guestApp/Makefile lib/guestInfo/Makefile lib/hgfs/Makefile lib/hgfsBd/Makefile lib/hgfsServer/Makefile lib/hgfsServerManagerGuest/Makefile lib/hgfsServerPolicyGuest/Makefile lib/deployPkg/Makefile lib/impersonate/Makefile lib/message/Makefile lib/message/shared/Makefile lib/misc/Makefile lib/misc/shared/Makefile lib/netUtil/Makefile lib/panic/Makefile lib/panicDefault/Makefile lib/printer/Makefile lib/procMgr/Makefile lib/rpcIn/Makefile lib/rpcOut/Makefile lib/rpcOut/shared/Makefile lib/rpcVmx/Makefile lib/SLPv2Parser/Makefile lib/socketMgr/Makefile lib/strUtil/Makefile lib/string/Makefile lib/string/shared/Makefile lib/sync/Makefile lib/sync/shared/Makefile lib/syncDriver/Makefile lib/system/Makefile lib/toolsLogger/Makefile lib/unicode/Makefile lib/user/Makefile lib/vixTools/Makefile lib/vmBackupLib/Makefile lib/vmCheck/Makefile lib/vmSignal/Makefile lib/wiper/Makefile guestd/Makefile vmware-user/Makefile toolbox/Makefile hgfsclient/Makefile hgfsmounter/Makefile checkvm/Makefile libguestlib/Makefile xferlogs/Makefile modules/Makefile" +ac_config_files="$ac_config_files Makefile lib/Makefile lib/appUtil/Makefile lib/auth/Makefile lib/backdoor/Makefile lib/backdoor/shared/Makefile lib/conf/Makefile lib/dict/Makefile lib/dnd/Makefile lib/dynxdr/Makefile lib/err/Makefile lib/eventManager/Makefile lib/file/Makefile lib/foundryMsg/Makefile lib/ghIntegration/Makefile lib/ghIntegrationStub/Makefile lib/guestApp/Makefile lib/guestInfo/Makefile lib/guestRpc/Makefile lib/hgfs/Makefile lib/hgfsBd/Makefile lib/hgfsServer/Makefile lib/hgfsServerManagerGuest/Makefile lib/hgfsServerPolicyGuest/Makefile lib/deployPkg/Makefile lib/image/Makefile lib/impersonate/Makefile lib/message/Makefile lib/message/shared/Makefile lib/misc/Makefile lib/misc/shared/Makefile lib/netUtil/Makefile lib/panic/Makefile lib/panicDefault/Makefile lib/printer/Makefile lib/procMgr/Makefile lib/raster/Makefile lib/region/Makefile lib/resolution/Makefile lib/rpcIn/Makefile lib/rpcOut/Makefile lib/rpcOut/shared/Makefile lib/rpcVmx/Makefile lib/SLPv2Parser/Makefile lib/socketMgr/Makefile lib/string/Makefile lib/string/shared/Makefile lib/stubs/Makefile lib/stubs/shared/Makefile lib/sync/Makefile lib/sync/shared/Makefile lib/syncDriver/Makefile lib/system/Makefile lib/toolsLogger/Makefile lib/unicode/Makefile lib/unity/Makefile lib/unityStub/Makefile lib/unityWindowTracker/Makefile lib/user/Makefile lib/vixTools/Makefile lib/vmBackupLib/Makefile lib/vmCheck/Makefile lib/vmSignal/Makefile lib/wiper/Makefile guestd/Makefile vmware-user/Makefile vmware-user-suid-wrapper/Makefile toolbox/Makefile hgfsclient/Makefile hgfsmounter/Makefile checkvm/Makefile libguestlib/Makefile xferlogs/Makefile modules/Makefile scripts/Makefile" ### @@ -26437,6 +28408,13 @@ 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 "${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 @@ -26451,6 +28429,41 @@ 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 "${PAMD_TRUE}" && test -z "${PAMD_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"PAMD\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"PAMD\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${ENABLE_UNITY_TRUE}" && test -z "${ENABLE_UNITY_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"ENABLE_UNITY\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"ENABLE_UNITY\" 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 : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files @@ -26751,7 +28764,7 @@ # 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 2008.01.23-74039, which was +This file was extended by open-vm-tools $as_me 2008.10.10-123053, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -26798,7 +28811,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -open-vm-tools config.status 2008.01.23-74039 +open-vm-tools config.status 2008.10.10-123053 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" @@ -26906,27 +28919,30 @@ "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; - "lib/atomic/Makefile") CONFIG_FILES="$CONFIG_FILES lib/atomic/Makefile" ;; - "lib/atomic/shared/Makefile") CONFIG_FILES="$CONFIG_FILES lib/atomic/shared/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/backdoor/shared/Makefile") CONFIG_FILES="$CONFIG_FILES lib/backdoor/shared/Makefile" ;; "lib/conf/Makefile") CONFIG_FILES="$CONFIG_FILES lib/conf/Makefile" ;; "lib/dict/Makefile") CONFIG_FILES="$CONFIG_FILES lib/dict/Makefile" ;; "lib/dnd/Makefile") CONFIG_FILES="$CONFIG_FILES lib/dnd/Makefile" ;; + "lib/dynxdr/Makefile") CONFIG_FILES="$CONFIG_FILES lib/dynxdr/Makefile" ;; "lib/err/Makefile") CONFIG_FILES="$CONFIG_FILES lib/err/Makefile" ;; "lib/eventManager/Makefile") CONFIG_FILES="$CONFIG_FILES lib/eventManager/Makefile" ;; "lib/file/Makefile") CONFIG_FILES="$CONFIG_FILES lib/file/Makefile" ;; - "lib/fileUtf8/Makefile") CONFIG_FILES="$CONFIG_FILES lib/fileUtf8/Makefile" ;; "lib/foundryMsg/Makefile") CONFIG_FILES="$CONFIG_FILES lib/foundryMsg/Makefile" ;; + "lib/ghIntegration/Makefile") CONFIG_FILES="$CONFIG_FILES lib/ghIntegration/Makefile" ;; + "lib/ghIntegrationStub/Makefile") CONFIG_FILES="$CONFIG_FILES lib/ghIntegrationStub/Makefile" ;; "lib/guestApp/Makefile") CONFIG_FILES="$CONFIG_FILES lib/guestApp/Makefile" ;; "lib/guestInfo/Makefile") CONFIG_FILES="$CONFIG_FILES lib/guestInfo/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/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/deployPkg/Makefile") CONFIG_FILES="$CONFIG_FILES lib/deployPkg/Makefile" ;; + "lib/image/Makefile") CONFIG_FILES="$CONFIG_FILES lib/image/Makefile" ;; "lib/impersonate/Makefile") CONFIG_FILES="$CONFIG_FILES lib/impersonate/Makefile" ;; "lib/message/Makefile") CONFIG_FILES="$CONFIG_FILES lib/message/Makefile" ;; "lib/message/shared/Makefile") CONFIG_FILES="$CONFIG_FILES lib/message/shared/Makefile" ;; @@ -26937,21 +28953,28 @@ "lib/panicDefault/Makefile") CONFIG_FILES="$CONFIG_FILES lib/panicDefault/Makefile" ;; "lib/printer/Makefile") CONFIG_FILES="$CONFIG_FILES lib/printer/Makefile" ;; "lib/procMgr/Makefile") CONFIG_FILES="$CONFIG_FILES lib/procMgr/Makefile" ;; + "lib/raster/Makefile") CONFIG_FILES="$CONFIG_FILES lib/raster/Makefile" ;; + "lib/region/Makefile") CONFIG_FILES="$CONFIG_FILES lib/region/Makefile" ;; + "lib/resolution/Makefile") CONFIG_FILES="$CONFIG_FILES lib/resolution/Makefile" ;; "lib/rpcIn/Makefile") CONFIG_FILES="$CONFIG_FILES lib/rpcIn/Makefile" ;; "lib/rpcOut/Makefile") CONFIG_FILES="$CONFIG_FILES lib/rpcOut/Makefile" ;; "lib/rpcOut/shared/Makefile") CONFIG_FILES="$CONFIG_FILES lib/rpcOut/shared/Makefile" ;; "lib/rpcVmx/Makefile") CONFIG_FILES="$CONFIG_FILES lib/rpcVmx/Makefile" ;; "lib/SLPv2Parser/Makefile") CONFIG_FILES="$CONFIG_FILES lib/SLPv2Parser/Makefile" ;; "lib/socketMgr/Makefile") CONFIG_FILES="$CONFIG_FILES lib/socketMgr/Makefile" ;; - "lib/strUtil/Makefile") CONFIG_FILES="$CONFIG_FILES lib/strUtil/Makefile" ;; "lib/string/Makefile") CONFIG_FILES="$CONFIG_FILES lib/string/Makefile" ;; "lib/string/shared/Makefile") CONFIG_FILES="$CONFIG_FILES lib/string/shared/Makefile" ;; + "lib/stubs/Makefile") CONFIG_FILES="$CONFIG_FILES lib/stubs/Makefile" ;; + "lib/stubs/shared/Makefile") CONFIG_FILES="$CONFIG_FILES lib/stubs/shared/Makefile" ;; "lib/sync/Makefile") CONFIG_FILES="$CONFIG_FILES lib/sync/Makefile" ;; "lib/sync/shared/Makefile") CONFIG_FILES="$CONFIG_FILES lib/sync/shared/Makefile" ;; "lib/syncDriver/Makefile") CONFIG_FILES="$CONFIG_FILES lib/syncDriver/Makefile" ;; "lib/system/Makefile") CONFIG_FILES="$CONFIG_FILES lib/system/Makefile" ;; "lib/toolsLogger/Makefile") CONFIG_FILES="$CONFIG_FILES lib/toolsLogger/Makefile" ;; "lib/unicode/Makefile") CONFIG_FILES="$CONFIG_FILES lib/unicode/Makefile" ;; + "lib/unity/Makefile") CONFIG_FILES="$CONFIG_FILES lib/unity/Makefile" ;; + "lib/unityStub/Makefile") CONFIG_FILES="$CONFIG_FILES lib/unityStub/Makefile" ;; + "lib/unityWindowTracker/Makefile") CONFIG_FILES="$CONFIG_FILES lib/unityWindowTracker/Makefile" ;; "lib/user/Makefile") CONFIG_FILES="$CONFIG_FILES lib/user/Makefile" ;; "lib/vixTools/Makefile") CONFIG_FILES="$CONFIG_FILES lib/vixTools/Makefile" ;; "lib/vmBackupLib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/vmBackupLib/Makefile" ;; @@ -26960,6 +28983,7 @@ "lib/wiper/Makefile") CONFIG_FILES="$CONFIG_FILES lib/wiper/Makefile" ;; "guestd/Makefile") CONFIG_FILES="$CONFIG_FILES guestd/Makefile" ;; "vmware-user/Makefile") CONFIG_FILES="$CONFIG_FILES vmware-user/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" ;; @@ -26967,6 +28991,7 @@ "libguestlib/Makefile") CONFIG_FILES="$CONFIG_FILES libguestlib/Makefile" ;; "xferlogs/Makefile") CONFIG_FILES="$CONFIG_FILES xferlogs/Makefile" ;; "modules/Makefile") CONFIG_FILES="$CONFIG_FILES modules/Makefile" ;; + "scripts/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/Makefile" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} @@ -27112,19 +29137,19 @@ am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim CPP!$CPP$ac_delim -SED!$SED$ac_delim -GREP!$GREP$ac_delim -EGREP!$EGREP$ac_delim -LN_S!$LN_S$ac_delim -ECHO!$ECHO$ac_delim -AR!$AR$ac_delim -RANLIB!$RANLIB$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 +GREP!$GREP$ac_delim +EGREP!$EGREP$ac_delim +ECHO!$ECHO$ac_delim +AR!$AR$ac_delim +RANLIB!$RANLIB$ac_delim _ACEOF if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then @@ -27177,42 +29202,69 @@ X_PRE_LIBS!$X_PRE_LIBS$ac_delim X_LIBS!$X_LIBS$ac_delim X_EXTRA_LIBS!$X_EXTRA_LIBS$ac_delim +LIBPNG_CONFIG!$LIBPNG_CONFIG$ac_delim DNET_CONFIG!$DNET_CONFIG$ac_delim +ICU_CONFIG!$ICU_CONFIG$ac_delim +HAVE_CXX!$HAVE_CXX$ac_delim +RPCGEN!$RPCGEN$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 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 +PAMD_TRUE!$PAMD_TRUE$ac_delim +PAMD_FALSE!$PAMD_FALSE$ac_delim +ENABLE_UNITY_TRUE!$ENABLE_UNITY_TRUE$ac_delim +ENABLE_UNITY_FALSE!$ENABLE_UNITY_FALSE$ac_delim +WITH_ROOT_PRIVILEGES_TRUE!$WITH_ROOT_PRIVILEGES_TRUE$ac_delim +WITH_ROOT_PRIVILEGES_FALSE!$WITH_ROOT_PRIVILEGES_FALSE$ac_delim +TARGET_OS!$TARGET_OS$ac_delim +KERNEL_RELEASE!$KERNEL_RELEASE$ac_delim MODULES_OS!$MODULES_OS$ac_delim +MODULES_DIR!$MODULES_DIR$ac_delim MODULES!$MODULES$ac_delim -COMMON_CFLAGS!$COMMON_CFLAGS$ac_delim -COMMON_PROG_CFLAGS!$COMMON_PROG_CFLAGS$ac_delim COMMON_XLIBS!$COMMON_XLIBS$ac_delim -GTK_CFLAGS!$GTK_CFLAGS$ac_delim +GTK_CPPFLAGS!$GTK_CPPFLAGS$ac_delim GTK_LIBS!$GTK_LIBS$ac_delim -DNET_CFLAGS!$DNET_CFLAGS$ac_delim +DNET_CPPFLAGS!$DNET_CPPFLAGS$ac_delim DNET_LIBS!$DNET_LIBS$ac_delim -LIB_AUTH_CFLAGS!$LIB_AUTH_CFLAGS$ac_delim -LIB_FILE_CFLAGS!$LIB_FILE_CFLAGS$ac_delim -LIB_HGFS_SERVER_CFLAGS!$LIB_HGFS_SERVER_CFLAGS$ac_delim -LIB_IMPERSONATE_CFLAGS!$LIB_IMPERSONATE_CFLAGS$ac_delim -LIB_MISC_CFLAGS!$LIB_MISC_CFLAGS$ac_delim -LIB_PROC_MGR_CFLAGS!$LIB_PROC_MGR_CFLAGS$ac_delim -LIB_STRING_CFLAGS!$LIB_STRING_CFLAGS$ac_delim -LIB_USER_CFLAGS!$LIB_USER_CFLAGS$ac_delim -GUESTD_LDFLAGS!$GUESTD_LDFLAGS$ac_delim -VMWARE_USER_CFLAGS!$VMWARE_USER_CFLAGS$ac_delim -VMWARE_USER_LDFLAGS!$VMWARE_USER_LDFLAGS$ac_delim +PROCPS_LIBS!$PROCPS_LIBS$ac_delim +ICU_CPPFLAGS!$ICU_CPPFLAGS$ac_delim +ICU_LIBS!$ICU_LIBS$ac_delim +PAM_PREFIX!$PAM_PREFIX$ac_delim +URIPARSER_CPPFLAGS!$URIPARSER_CPPFLAGS$ac_delim +URIPARSER_LIBS!$URIPARSER_LIBS$ac_delim +LIBPNG_CPPFLAGS!$LIBPNG_CPPFLAGS$ac_delim +LIBPNG_LIBS!$LIBPNG_LIBS$ac_delim +ZLIB_CPPFLAGS!$ZLIB_CPPFLAGS$ac_delim +ZLIB_LIBS!$ZLIB_LIBS$ac_delim +LIB_AUTH_CPPFLAGS!$LIB_AUTH_CPPFLAGS$ac_delim +LIB_FILE_CPPFLAGS!$LIB_FILE_CPPFLAGS$ac_delim +LIB_HGFS_SERVER_CPPFLAGS!$LIB_HGFS_SERVER_CPPFLAGS$ac_delim +LIB_IMPERSONATE_CPPFLAGS!$LIB_IMPERSONATE_CPPFLAGS$ac_delim +LIB_MISC_CPPFLAGS!$LIB_MISC_CPPFLAGS$ac_delim +LIB_PROC_MGR_CPPFLAGS!$LIB_PROC_MGR_CPPFLAGS$ac_delim +LIB_STRING_CPPFLAGS!$LIB_STRING_CPPFLAGS$ac_delim +LIB_USER_CPPFLAGS!$LIB_USER_CPPFLAGS$ac_delim +GUESTD_LDADD!$GUESTD_LDADD$ac_delim +VMWARE_USER_CPPFLAGS!$VMWARE_USER_CPPFLAGS$ac_delim +VMWARE_USER_LDADD!$VMWARE_USER_LDADD$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` = 44; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 71; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/autom4te.cache/output.1 /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/autom4te.cache/output.1 --- open-vm-tools-2008.01.23-74039/autom4te.cache/output.1 2008-01-28 08:03:00.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/autom4te.cache/output.1 2008-10-13 08:02:10.000000000 +0100 @@ -1,6 +1,6 @@ @%:@! /bin/sh @%:@ Guess values for system-dependent variables and create Makefiles. -@%:@ Generated by GNU Autoconf 2.61 for open-vm-tools 2008.01.23-74039. +@%:@ Generated by GNU Autoconf 2.61 for open-vm-tools 2008.10.10-123053. @%:@ @%:@ Report bugs to . @%:@ @@ -555,22 +555,22 @@ # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} -case X$ECHO in +case X$lt_ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). - ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','` + ECHO=`echo "$lt_ECHO" | sed 's,\\\\\$\\$0,'$0','` ;; esac -echo=${ECHO-echo} +ECHO=${lt_ECHO-echo} if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : -elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then - # Yippee, $echo works! +elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then + # Yippee, $ECHO works! : else # Restart under the correct shell. @@ -580,9 +580,9 @@ if test "X$1" = X--fallback-echo; then # used as fallback echo shift - cat </dev/null 2>&1 && unset CDPATH -if test -z "$ECHO"; then -if test "X${echo_test_string+set}" != Xset; then -# find a string as large as possible, as long as the shell can cope with it - for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do - # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... - if (echo_test_string=`eval $cmd`) 2>/dev/null && - echo_test_string=`eval $cmd` && - (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null - then - break - fi - done -fi +if test -z "$lt_ECHO"; then + if test "X${echo_test_string+set}" != Xset; then + # find a string as large as possible, as long as the shell can cope with it + for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do + # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... + if { echo_test_string=`eval $cmd`; } 2>/dev/null && + { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null + then + break + fi + done + fi -if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - : -else - # The Solaris, AIX, and Digital Unix default echo programs unquote - # backslashes. This makes it impossible to quote backslashes using - # echo "$something" | sed 's/\\/\\\\/g' - # - # So, first we look for a working echo in the user's PATH. + if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : + else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for dir in $PATH /usr/ucb; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + IFS="$lt_save_ifs" + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + ECHO="$dir/echo" + break + fi + done IFS="$lt_save_ifs" - if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && - test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - echo="$dir/echo" - break - fi - done - IFS="$lt_save_ifs" - if test "X$echo" = Xecho; then - # We didn't find a better echo, so look for alternatives. - if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # This shell has a builtin print -r that does the trick. - echo='print -r' - elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && - test "X$CONFIG_SHELL" != X/bin/ksh; then - # If we have ksh, try running configure again with it. - ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} - export ORIGINAL_CONFIG_SHELL - CONFIG_SHELL=/bin/ksh - export CONFIG_SHELL - exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} - else - # Try using printf. - echo='printf %s\n' - if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # Cool, printf works - : - elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL - export CONFIG_SHELL - SHELL="$CONFIG_SHELL" - export SHELL - echo="$CONFIG_SHELL $0 --fallback-echo" - elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - echo="$CONFIG_SHELL $0 --fallback-echo" + if test "X$ECHO" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + ECHO='print -r' + elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running configure again with it. + ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} else - # maybe with a smaller string... - prev=: + # Try using printf. + ECHO='printf %s\n' + if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + ECHO="$CONFIG_SHELL $0 --fallback-echo" + elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + ECHO="$CONFIG_SHELL $0 --fallback-echo" + else + # maybe with a smaller string... + prev=: - for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do - if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null - then - break - fi - prev="$cmd" - done + for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do + if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null + then + break + fi + prev="$cmd" + done - if test "$prev" != 'sed 50q "$0"'; then - echo_test_string=`eval $prev` - export echo_test_string - exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} - else - # Oops. We lost completely, so just stick with echo. - echo=echo - fi + if test "$prev" != 'sed 50q "$0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} + else + # Oops. We lost completely, so just stick with echo. + ECHO=echo + fi + fi fi fi fi fi -fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. -ECHO=$echo -if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then - ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" +lt_ECHO=$ECHO +if test "X$lt_ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then + lt_ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" fi -tagnames=${tagnames+${tagnames},}CXX - -tagnames=${tagnames+${tagnames},}F77 - exec 7<&0 &1 # Name of the host. @@ -728,8 +723,8 @@ # Identity of this package. PACKAGE_NAME='open-vm-tools' PACKAGE_TARNAME='open-vm-tools' -PACKAGE_VERSION='2008.01.23-74039' -PACKAGE_STRING='open-vm-tools 2008.01.23-74039' +PACKAGE_VERSION='2008.10.10-123053' +PACKAGE_STRING='open-vm-tools 2008.10.10-123053' PACKAGE_BUGREPORT='open-vm-tools-devel@lists.sourceforge.net' ac_unique_file="checkvm/checkvm.c" @@ -853,61 +848,92 @@ am__fastdepCC_TRUE am__fastdepCC_FALSE CPP -SED -GREP -EGREP -LN_S -ECHO -AR -RANLIB CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE -CXXCPP -F77 -FFLAGS -ac_ct_F77 +SED +LN_S LIBTOOL +GREP +EGREP +FGREP +LD +DUMPBIN +ac_ct_DUMPBIN +NM +AR +RANLIB +lt_ECHO +DSYMUTIL +NMEDIT +CXXCPP HAVE_PKG_CONFIG XMKMF X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS +LIBPNG_CONFIG DNET_CONFIG +ICU_CONFIG +HAVE_CXX +RPCGEN BUILD_HGFSMOUNTER_TRUE BUILD_HGFSMOUNTER_FALSE LINUX_TRUE LINUX_FALSE SOLARIS_TRUE SOLARIS_FALSE +FREEBSD_TRUE +FREEBSD_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 +PAMD_TRUE +PAMD_FALSE +ENABLE_UNITY_TRUE +ENABLE_UNITY_FALSE +WITH_ROOT_PRIVILEGES_TRUE +WITH_ROOT_PRIVILEGES_FALSE +TARGET_OS +KERNEL_RELEASE MODULES_OS +MODULES_DIR MODULES -COMMON_CFLAGS -COMMON_PROG_CFLAGS COMMON_XLIBS -GTK_CFLAGS +GTK_CPPFLAGS GTK_LIBS -DNET_CFLAGS +DNET_CPPFLAGS DNET_LIBS -LIB_AUTH_CFLAGS -LIB_FILE_CFLAGS -LIB_HGFS_SERVER_CFLAGS -LIB_IMPERSONATE_CFLAGS -LIB_MISC_CFLAGS -LIB_PROC_MGR_CFLAGS -LIB_STRING_CFLAGS -LIB_USER_CFLAGS -GUESTD_LDFLAGS -VMWARE_USER_CFLAGS -VMWARE_USER_LDFLAGS +PROCPS_LIBS +ICU_CPPFLAGS +ICU_LIBS +PAM_PREFIX +URIPARSER_CPPFLAGS +URIPARSER_LIBS +LIBPNG_CPPFLAGS +LIBPNG_LIBS +ZLIB_CPPFLAGS +ZLIB_LIBS +LIB_AUTH_CPPFLAGS +LIB_FILE_CPPFLAGS +LIB_HGFS_SERVER_CPPFLAGS +LIB_IMPERSONATE_CPPFLAGS +LIB_MISC_CPPFLAGS +LIB_PROC_MGR_CPPFLAGS +LIB_STRING_CPPFLAGS +LIB_USER_CPPFLAGS +GUESTD_LDADD +VMWARE_USER_CPPFLAGS +VMWARE_USER_LDADD LIB@&t@OBJS LTLIBOBJS' ac_subst_files='' @@ -924,8 +950,6 @@ CXXFLAGS CCC CXXCPP -F77 -FFLAGS XMKMF' @@ -1429,7 +1453,7 @@ # 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 2008.01.23-74039 to adapt to many kinds of systems. +\`configure' configures open-vm-tools 2008.10.10-123053 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1503,14 +1527,15 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of open-vm-tools 2008.01.23-74039:";; + short | recursive ) echo "Configuration of open-vm-tools 2008.10.10-123053:";; 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-multimon disables multimon, enabled by default + --disable-unity disables Unity, enabled by default --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@:>@ @@ -1522,11 +1547,26 @@ Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-gnu-ld assume the C compiler uses GNU ld @<:@default=no@:>@ + --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 (falls back on Gtk 1.2) --with-pic try to use only PIC/non-PIC objects @<:@default=use both@:>@ - --with-tags@<:@=TAGS@:>@ include additional configurations @<:@automatic@:>@ + --with-gnu-ld assume the C compiler uses GNU ld @<:@default=no@:>@ --with-x use the X Window System + --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 @@ -1540,8 +1580,6 @@ CXX C++ compiler command CXXFLAGS C++ compiler flags CXXCPP C++ preprocessor - F77 Fortran 77 compiler command - FFLAGS Fortran 77 compiler flags XMKMF Path to xmkmf, Makefile generator for X Window System Use these variables to override the choices made by `configure' or to help @@ -1608,7 +1646,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -open-vm-tools configure 2008.01.23-74039 +open-vm-tools configure 2008.10.10-123053 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1622,7 +1660,7 @@ 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 2008.01.23-74039, which was +It was created by open-vm-tools $as_me 2008.10.10-123053, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -1997,8 +2035,10 @@ # 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 "$srcdir" "$srcdir/.." "$srcdir/../.."; do +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" @@ -2014,8 +2054,8 @@ fi done if test -z "$ac_aux_dir"; then - { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 -echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} + { { 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 @@ -2028,6 +2068,8 @@ 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 @@ -2173,11 +2215,51 @@ ;; 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="`uname -r | cut -f1 -d. | cut -f1 -d-`" - minor_version="`uname -r | cut -f2 -d. | cut -f1 -d-`" - micro_version="`uname -r | cut -f3 -d. | cut -f1 -d-`" + 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 } @@ -2197,15 +2279,49 @@ ;; esac osVersion="`getOsVersion`" +if test "$os" = "linux"; then + if test "$with_kernel_modules" = "yes"; then + 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 + fi +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; MULTIMON_ENABLED="$enableval" + enableval=$enable_multimon; enable_multimon="$enableval" +else + enable_multimon="yes" +fi + + +# Check whether --enable-unity was given. +if test "${enable_unity+set}" = set; then + enableval=$enable_unity; enable_unity="$enableval" +else + enable_unity="yes" +fi + + + +# Check whether --with-gtk2 was given. +if test "${with_gtk2+set}" = set; then + withval=$with_gtk2; with_gtk2="$withval" else - MULTIMON_ENABLED="yes" + with_gtk2="yes" fi +# If we're not going to use Gtk 2.0, disable Unity. It may be possible to +# get Unity working with Gtk 1.2 (it used to in the past), but that will +# require a great deal of work. +if test "$with_gtk2" != "yes"; then + enable_unity="no" +fi + am__api_version='1.10' # Find a good install program. We prefer a C program (faster), @@ -2512,7 +2628,7 @@ # Define the identity of the package. PACKAGE='open-vm-tools' - VERSION='2008.01.23-74039' + VERSION='2008.10.10-123053' cat >>confdefs.h <<_ACEOF @@ -2664,11 +2780,22 @@ ### # These need to be declared after initialization. -CFLAGS="$CFLAGS -DUSING_AUTOCONF=1" +# 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" ### ### Programs ### +# C preprocessor and compiler. DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" @@ -4772,1435 +4899,1400 @@ fi -# 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 + +# 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 - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + 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=. - # 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 + 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 - 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' - -# Needed for creating the archives in lib/ and the shared libraries. -# 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 +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + { echo "$as_me:$LINENO: result: $CXX" >&5 +echo "${ECHO_T}$CXX" >&6; } else - enable_shared=yes + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } 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 + test -n "$CXX" && break + done fi - - -# 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 - - -{ echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 -echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6; } -if test "${lt_cv_path_SED+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # Loop through the user's path and test for sed and gsed. -# Then use that list of sed's as ones to test for truncation. -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH +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 - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for lt_ac_prog in sed gsed; do - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then - lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" - fi - done - done -done -IFS=$as_save_IFS -lt_ac_max=0 -lt_ac_count=0 -# Add /usr/xpg4/bin/sed as it is typically found on Solaris -# along with /bin/sed that truncates output. -for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do - test ! -f $lt_ac_sed && continue - cat /dev/null > conftest.in - lt_ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >conftest.in - # Check for GNU sed and select it if it is found. - if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then - lt_cv_path_SED=$lt_ac_sed - break - fi - while true; do - cat conftest.in conftest.in >conftest.tmp - mv conftest.tmp conftest.in - cp conftest.in conftest.nl - echo >>conftest.nl - $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break - cmp -s conftest.out conftest.nl || break - # 10000 chars as input seems more than enough - test $lt_ac_count -gt 10 && break - lt_ac_count=`expr $lt_ac_count + 1` - if test $lt_ac_count -gt $lt_ac_max; then - lt_ac_max=$lt_ac_count - lt_cv_path_SED=$lt_ac_sed - fi - done -done - -fi - -SED=$lt_cv_path_SED - -{ echo "$as_me:$LINENO: result: $SED" >&5 -echo "${ECHO_T}$SED" >&6; } - -{ echo "$as_me:$LINENO: checking for 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 + # 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 - # 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 + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. 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 +for as_dir in $PATH 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 + 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 - -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 - +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 - ac_cv_path_GREP=$GREP -fi - - + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } 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 - + test -n "$ac_ct_CXX" && break done -IFS=$as_save_IFS - + 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 -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 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 - ac_cv_path_EGREP=$EGREP -fi + 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 - 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" - - - -# 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 + ; + 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 - with_gnu_ld=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_compiler_gnu=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; } +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + fi -if test "${lt_cv_path_LD+set}" = set; then +{ 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 - 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 conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -LD="$lt_cv_path_LD" -if test -n "$LD"; then - { echo "$as_me:$LINENO: result: $LD" >&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 +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 - # I'd rather use --version here, but apparently some GNU lds only accept -v. -case `$LD -v 2>&1 &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 -fi -{ echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5 -echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; } -with_gnu_ld=$lt_cv_prog_gnu_ld +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. */ -{ 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 +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 - lt_cv_ld_reload_flag='-r' + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + fi -{ echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 -echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6; } -reload_flag=$lt_cv_ld_reload_flag -case $reload_flag in -"" | " "*) ;; -*) reload_flag=" $reload_flag" ;; -esac -reload_cmds='$LD$reload_flag -o $output$reload_objs' -case $host_os in - darwin*) - if test "$GCC" = yes; then - reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' - else - reload_cmds='$LD$reload_flag -o $output$reload_objs' - fi - ;; -esac -{ echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 -echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6; } -if test "${lt_cv_path_NM+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$NM"; then - # Let the user override the test. - lt_cv_path_NM="$NM" -else - lt_nm_to_check="${ac_tool_prefix}nm" - if test -n "$ac_tool_prefix" && test "$build" = "$host"; then - lt_nm_to_check="$lt_nm_to_check nm" - fi - for lt_tmp_nm in $lt_nm_to_check; do - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - tmp_nm="$ac_dir/$lt_tmp_nm" - if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then - # Check to see if the nm accepts a BSD-compat flag. - # Adding the `sed 1q' prevents false positives on HP-UX, which says: - # nm: unknown option "B" ignored - # Tru64's nm complains that /dev/null is an invalid object file - case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in - */dev/null* | *'Invalid file or object type'*) - lt_cv_path_NM="$tmp_nm -B" - break - ;; - *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in - */dev/null*) - lt_cv_path_NM="$tmp_nm -p" - break - ;; - *) - lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but - continue # so that we can try to find one that supports BSD flags - ;; - esac - ;; - esac - fi - done - IFS="$lt_save_ifs" - done - test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm +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: $lt_cv_path_NM" >&5 -echo "${ECHO_T}$lt_cv_path_NM" >&6; } -NM="$lt_cv_path_NM" -{ 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; } +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 - { echo "$as_me:$LINENO: result: no, using $LN_S" >&5 -echo "${ECHO_T}no, using $LN_S" >&6; } + 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 -{ echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5 -echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6; } -if test "${lt_cv_deplibs_check_method+set}" = set; then +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 - 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. + 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 -case $host_os in -aix4* | aix5*) - lt_cv_deplibs_check_method=pass_all - ;; + 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 -beos*) - lt_cv_deplibs_check_method=pass_all - ;; + 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 -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 - ;; + cd .. + rm -rf conftest.dir +else + am_cv_CXX_dependencies_compiler_type=none +fi -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' - ;; +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 -mingw* | pw32*) - # Base MSYS/MinGW do not provide the 'file' command needed by - # func_win32_libid shell function, so use a weaker test based on 'objdump'. - lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' - lt_cv_file_magic_cmd='$OBJDUMP -f' - ;; + 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 -darwin* | rhapsody*) - lt_cv_deplibs_check_method=pass_all - ;; -freebsd* | kfreebsd*-gnu | dragonfly*) - if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then - case $host_cpu in - i*86 ) - # Not sure whether the presence of OpenBSD here was a mistake. - # Let's accept both of them until this is cleared up. - lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` - ;; - esac - else - lt_cv_deplibs_check_method=pass_all - fi - ;; -gnu*) - lt_cv_deplibs_check_method=pass_all - ;; +# 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. */ -hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=/usr/bin/file - case $host_cpu in - ia64*) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' - lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so - ;; - hppa*64*) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' - lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl - ;; - *) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' - lt_cv_file_magic_test_file=/usr/lib/libc.sl - ;; - esac - ;; +int +main () +{ -interix3*) - # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' - ;; + ; + 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* -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 - ;; +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 -# This must be Linux ELF. -linux*) - lt_cv_deplibs_check_method=pass_all - ;; +fi -netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' - fi - ;; +# 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 -newos6*) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/libnls.so - ;; -nto-qnx*) - lt_cv_deplibs_check_method=unknown - ;; -openbsd*) - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' +# 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 - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + # 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; } -osf3* | osf4* | osf5*) - lt_cv_deplibs_check_method=pass_all - ;; +# 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}' -solaris*) - lt_cv_deplibs_check_method=pass_all - ;; +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' -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 - ;; +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - lt_cv_deplibs_check_method=pass_all - ;; +{ 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 -fi -{ echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 -echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6; } -file_magic_cmd=$lt_cv_file_magic_cmd -deplibs_check_method=$lt_cv_deplibs_check_method -test -z "$deplibs_check_method" && deplibs_check_method=unknown + $ac_path_SED_found && break 3 + done +done +done +IFS=$as_save_IFS -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} +fi -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} +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 -# Allow CC to be a program name with arguments. -compiler=$CC +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 -# Check whether --enable-libtool-lock was given. -if test "${enable_libtool_lock+set}" = set; then - enableval=$enable_libtool_lock; +{ 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 -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes +{ 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 -# 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 __oline__ "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* - ;; +fi -x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - case `/usr/bin/file conftest.o` in - *32-bit*) - case $host in - x86_64-*linux*) - LD="${LD-ld} -m elf_i386" - ;; - ppc64-*linux*|powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" - ;; - s390x-*linux*) - LD="${LD-ld} -m elf_s390" - ;; - sparc64-*linux*) - LD="${LD-ld} -m elf32_sparc" - ;; - esac - ;; - *64-bit*) - case $host in - x86_64-*linux*) - LD="${LD-ld} -m elf_x86_64" - ;; - ppc*-*linux*|powerpc*-*linux*) - LD="${LD-ld} -m elf64ppc" - ;; - s390*-*linux*) - LD="${LD-ld} -m elf64_s390" - ;; - sparc*-*linux*) - LD="${LD-ld} -m elf64_sparc" - ;; - esac - ;; - esac + 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 - rm -rf conftest* - ;; +fi +{ echo "$as_me:$LINENO: result: $MKDIR_P" >&5 +echo "${ECHO_T}$MKDIR_P" >&6; } -*-*-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. */ +# 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 -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 +macro_version='2.2' +macro_revision='1.2599' -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 - ;; -sparc*-*solaris*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - case `/usr/bin/file conftest.o` in - *64-bit*) - case $lt_cv_prog_gnu_ld in - yes*) LD="${LD-ld} -m elf64_sparc" ;; - *) LD="${LD-ld} -64" ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; + + + -esac -need_locks="$enable_libtool_lock" +ltmain="$ac_aux_dir/ltmain.sh" -{ 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 "$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 - 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 + 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 - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + 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_cv_header_stdc=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + $ac_path_SED_found && break 3 + done +done -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 +done +IFS=$as_save_IFS -_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 +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 -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then - : else - ac_cv_header_stdc=no + ac_cv_path_SED=$SED fi -rm -f conftest* 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 -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 +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" -#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 +{ 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 -# On IRIX 5.3, sys/types and inttypes.h are conflicting. + $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" + -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 "$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 - 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" + 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 - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_Header=no" -fi + 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 -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 + $ac_path_EGREP_found && break 3 + done done +done +IFS=$as_save_IFS -for ac_header in dlfcn.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 +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 -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 + ac_cv_path_EGREP=$EGREP 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 fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -@%:@define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 +echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" -fi - -done -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 "$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 test -n "$CXX"; then - ac_cv_prog_CXX="$CXX" # Let the user override the test. + 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 +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 - 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; } + 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 - test -n "$CXX" && break + + + + + + + + +{ 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 -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 +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 "$ac_tool_prefix"; then + for ac_prog in "dumpbin -symbols" "link -dump -symbols" + 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_ac_ct_CXX+set}" = set; then +if test "${ac_cv_prog_DUMPBIN+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. + 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 @@ -6209,7 +6301,7 @@ 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" + 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 @@ -6219,645 +6311,558 @@ 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; } +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 "$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 + test -n "$DUMPBIN" && break + done 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 +if test -z "$DUMPBIN"; then + ac_ct_DUMPBIN=$DUMPBIN + for ac_prog in "dumpbin -symbols" "link -dump -symbols" +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 - 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 + if test -n "$ac_ct_DUMPBIN"; then + ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +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 - 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 +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: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi - 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 () -{ + test -n "$ac_ct_DUMPBIN" && break +done - ; - 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;; + 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 -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. */ + DUMPBIN=$ac_ct_DUMPBIN + fi +fi -int -main () -{ + + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" + fi +fi +test -z "$NM" && NM=nm - ; - 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 +{ 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:__oline__: $ac_compile\"" >&5) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&5 + (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&5 + (eval echo "\"\$as_me:__oline__: 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; } -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi +# 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" -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=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 + 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 + ;; -depcc="$CXX" am_compiler_list= + 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; + ;; -{ 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 + cygwin* | mingw*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; - 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 + 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; + ;; - 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 + 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 - done + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + 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"`$SHELL $0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ + = "XX$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 - cd .. - rm -rf conftest.dir -else - am_cv_CXX_dependencies_compiler_type=none 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 -{ 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 +max_cmd_len=$lt_cv_sys_max_cmd_len - if - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then - am__fastdepCXX_TRUE= - am__fastdepCXX_FALSE='#' + + + + + + +: ${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"}, \ + = c,a/b,, ) >/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 - am__fastdepCXX_TRUE='#' - am__fastdepCXX_FALSE= + 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 + + + -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 "$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 - # 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 + lt_cv_ld_reload_flag='-r' 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;; +{ 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 -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;; +reload_cmds='$LD$reload_flag -o $output$reload_objs' +case $host_os in + darwin*) + if test "$GCC" = yes; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi + ;; esac -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 + +{ 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 - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + 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. - # Passes both tests. -ac_preproc_ok=: -break -fi +case $host_os in +aix[4-9]*) + lt_cv_deplibs_check_method=pass_all + ;; -rm -f conftest.err conftest.$ac_ext +beos*) + lt_cv_deplibs_check_method=pass_all + ;; -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 +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 + ;; -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 +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' + ;; -fi +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. + if ( 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 + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; +darwin* | rhapsody*) + lt_cv_deplibs_check_method=pass_all + ;; -ac_ext=f -ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' -ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_f77_compiler_gnu -if test -n "$ac_tool_prefix"; then - for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_F77+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +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 + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +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 Linux ELF. +linux* | k*bsd*-gnu) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +*nto* | *qnx*) + lt_cv_deplibs_check_method=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_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}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test -n "$F77"; then - ac_cv_prog_F77="$F77" # Let the user override the test. + 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 @@ -6866,7 +6871,7 @@ 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_F77="$ac_tool_prefix$ac_prog" + ac_cv_prog_AR="${ac_tool_prefix}ar" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -6876,32 +6881,28 @@ fi fi -F77=$ac_cv_prog_F77 -if test -n "$F77"; then - { echo "$as_me:$LINENO: result: $F77" >&5 -echo "${ECHO_T}$F77" >&6; } +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 "$F77" && break - done fi -if test -z "$F77"; then - ac_ct_F77=$F77 - for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 +if test -z "$ac_cv_prog_AR"; then + ac_ct_AR=$AR + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_F77+set}" = set; then +if test "${ac_cv_prog_ac_ct_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test -n "$ac_ct_F77"; then - ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test. + 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 @@ -6910,7 +6911,7 @@ 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_F77="$ac_prog" + ac_cv_prog_ac_ct_AR="ar" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -6920,21 +6921,17 @@ fi fi -ac_ct_F77=$ac_cv_prog_ac_ct_F77 -if test -n "$ac_ct_F77"; then - { echo "$as_me:$LINENO: result: $ac_ct_F77" >&5 -echo "${ECHO_T}$ac_ct_F77" >&6; } +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_F77" && break -done - - if test "x$ac_ct_F77" = x; then - F77="" + if test "x$ac_ct_AR" = x; then + AR="false" else case $cross_compiling:$ac_tool_warned in yes:) @@ -6946,308 +6943,307 @@ configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac - F77=$ac_ct_F77 + AR=$ac_ct_AR fi +else + AR="$ac_cv_prog_AR" fi +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru -# Provide some information about the compiler. -echo "$as_me:$LINENO: checking for Fortran 77 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); } -rm -f a.out - -# If we don't use `.F' as extension, the preprocessor is not run on the -# input file. (Note that this only needs to work for GNU compilers.) -ac_save_ext=$ac_ext -ac_ext=F -{ echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6; } -if test "${ac_cv_f77_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF - program main -#ifndef __GNUC__ - choke me -#endif - - end -_ACEOF -rm -f conftest.$ac_objext -if { (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_f77_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_f77_compiler_gnu=$ac_compiler_gnu + + + -fi -{ echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6; } -ac_ext=$ac_save_ext -ac_test_FFLAGS=${FFLAGS+set} -ac_save_FFLAGS=$FFLAGS -FFLAGS= -{ echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5 -echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6; } -if test "${ac_cv_prog_f77_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - FFLAGS=-g -cat >conftest.$ac_ext <<_ACEOF - program main - end -_ACEOF -rm -f conftest.$ac_objext -if { (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_f77_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_f77_g=yes +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 - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + 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 - ac_cv_prog_f77_g=no +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 -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5 -echo "${ECHO_T}$ac_cv_prog_f77_g" >&6; } -if test "$ac_test_FFLAGS" = set; then - FFLAGS=$ac_save_FFLAGS -elif test $ac_cv_prog_f77_g = yes; then - if test "x$ac_cv_f77_compiler_gnu" = xyes; then - FFLAGS="-g -O2" - else - FFLAGS="-g" +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 - if test "x$ac_cv_f77_compiler_gnu" = xyes; then - FFLAGS="-O2" + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" else - FFLAGS= + 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 -G77=`test $ac_compiler_gnu = yes && echo yes` -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - +test -z "$STRIP" && STRIP=: + + + -# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! -# find the maximum length of command line arguments -{ echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 -echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6; } -if test "${lt_cv_sys_max_cmd_len+set}" = set; then +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 - i=0 - teststring="ABCD" - - case $build_os in - msdosdjgpp*) - # On DJGPP, this test can blow up pretty badly due to problems in libc - # (any single argument exceeding 2000 bytes causes a buffer overrun - # during glob expansion). Even if it were fixed, the result of this - # check would be larger than it should be. - lt_cv_sys_max_cmd_len=12288; # 12K is about right - ;; - - gnu*) - # Under GNU Hurd, this test is not required because there is - # no limit to the length of command line arguments. - # Libtool will interpret -1 as no limit whatsoever - lt_cv_sys_max_cmd_len=-1; - ;; - - cygwin* | mingw*) - # On Win9x/ME, this test blows up -- it succeeds, but takes - # about 5 minutes as the teststring grows exponentially. - # Worse, since 9x/ME are not pre-emptively multitasking, - # you end up with a "frozen" computer, even though with patience - # the test eventually succeeds (with a max line length of 256k). - # Instead, let's just punt: use the minimum linelength reported by - # all of the supported platforms: 8192 (on NT/2K/XP). - lt_cv_sys_max_cmd_len=8192; - ;; - - amigaos*) - # On AmigaOS with pdksh, this test takes hours, literally. - # So we just punt and use a minimum line length of 8192. - lt_cv_sys_max_cmd_len=8192; - ;; - - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) - # This has been around since 386BSD, at least. Likely further. - if test -x /sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` - elif test -x /usr/sbin/sysctl; then - lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` - else - lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs - fi - # And add a safety zone - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` - ;; - - interix*) - # We know the value 262144 and hardcode it with a safety zone (like BSD) - lt_cv_sys_max_cmd_len=196608 - ;; - - osf*) - # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure - # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not - # nice to cause kernel panics so lets avoid the loop below. - # First set a reasonable default. - lt_cv_sys_max_cmd_len=16384 - # - if test -x /sbin/sysconfig; then - case `/sbin/sysconfig -q proc exec_disable_arg_limit` in - *1*) lt_cv_sys_max_cmd_len=-1 ;; - esac - fi - ;; - sco3.2v5*) - lt_cv_sys_max_cmd_len=102400 - ;; - sysv5* | sco5v6* | sysv4.2uw2*) - kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` - if test -n "$kargmax"; then - lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` - else - lt_cv_sys_max_cmd_len=32768 - fi - ;; - *) - # If test is not a shell built-in, we'll probably end up computing a - # maximum length that is only half of the actual maximum length, but - # we can't tell. - SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} - while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \ - = "XX$teststring") >/dev/null 2>&1 && - new_result=`expr "X$teststring" : ".*" 2>&1` && - lt_cv_sys_max_cmd_len=$new_result && - test $i != 17 # 1/2 MB should be enough - do - i=`expr $i + 1` - teststring=$teststring$teststring - done - teststring= - # Add a significant safety factor because C++ compilers can tack on massive - # amounts of additional arguments before passing them to the linker. - # It appears as though 1/2 is a usable value. - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` - ;; - esac + 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 - -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; } +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: none" >&5 -echo "${ECHO_T}none" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - - -# Check for command to grab the raw symbol name followed by C symbol from nm. -{ echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 -echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6; } -if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then +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 - -# These are sane defaults that work on at least a few old systems. -# [They come from Ultrix. What could be older than Ultrix?!! ;)] - + 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 \$oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 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]*\)' -# Transform an extracted symbol line into a proper C declaration -lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" - -# Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - # Define system-specific variables. case $host_os in aix*) @@ -7256,19 +7252,10 @@ cygwin* | mingw* | pw32*) symcode='[ABCDGISTW]' ;; -hpux*) # Its linker distinguishes data from code symbols +hpux*) if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi - lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - ;; -linux*) - if test "$host_cpu" = ia64; then - symcode='[ABCDGIRSTW]' - lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' @@ -7293,44 +7280,72 @@ ;; 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 + opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac -# If we're using GNU nm, then use its standard symbol codes. -case `$NM -V 2>&1` in -*GNU* | *'with BFD'*) - symcode='[ABCDGIRSTW]' ;; -esac - -# Try without a prefix undercore, then with it. +# 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. - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" + 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};"\ +" /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 # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* - cat > conftest.$ac_ext < conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; -void nm_test_func(){} +void nm_test_func(void); +void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} -EOF +_LT_EOF if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 @@ -7352,42 +7367,44 @@ fi # Make sure that we snagged all the symbols we need. - if grep ' nm_test_var$' "$nlist" >/dev/null; then - if grep ' nm_test_func$' "$nlist" >/dev/null; then - cat < conftest.$ac_ext + if $GREP ' nm_test_var$' "$nlist" >/dev/null; then + if $GREP ' nm_test_func$' "$nlist" >/dev/null; then + cat <<_LT_EOF > conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif -EOF +_LT_EOF # Now generate the symbol file. - eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' - cat <> conftest.$ac_ext -#if defined (__STDC__) && __STDC__ -# define lt_ptr_t void * -#else -# define lt_ptr_t char * -# define const -#endif + cat <<_LT_EOF >> conftest.$ac_ext -/* The mapping between symbol names and symbols. */ +/* The mapping between symbol names and symbols. */ const struct { const char *name; - lt_ptr_t address; + void *address; } -lt_preloaded_symbols[] = +lt__PROGRAM__LTX_preloaded_symbols[] = { -EOF - $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext - cat <<\EOF >> conftest.$ac_ext - {0, (lt_ptr_t) 0} + { "@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 -EOF +_LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_save_LIBS="$LIBS" @@ -7416,7 +7433,7 @@ echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi - rm -f conftest* conftst* + rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then @@ -7439,120 +7456,259 @@ echo "${ECHO_T}ok" >&6; } fi -{ echo "$as_me:$LINENO: checking for objdir" >&5 -echo $ECHO_N "checking for objdir... $ECHO_C" >&6; } -if test "${lt_cv_objdir+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - rm -f .libs 2>/dev/null -mkdir .libs 2>/dev/null -if test -d .libs; then - lt_cv_objdir=.libs -else - # MS-DOS does not allow filenames that begin with a dot. - lt_cv_objdir=_libs -fi -rmdir .libs 2>/dev/null -fi -{ echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 -echo "${ECHO_T}$lt_cv_objdir" >&6; } -objdir=$lt_cv_objdir - + + + + + + -case $host_os in -aix3*) - # AIX sometimes has problems with the GCC collect2 program. For some - # reason, if we set the COLLECT_NAMES environment variable, the problems - # vanish in a puff of smoke. - if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES - fi - ;; -esac - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed='sed -e 1s/^X//' -sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g' - -# Same as above, but do not quote variable references. -double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g' - -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' + + + -# Constants: -rm="rm -f" -# Global variables: -default_ofile=libtool -can_build_shared=yes + + + -# All known linkers require a `.a' archive for static linking (except MSVC, -# which needs '.lib'). -libext=a -ltmain="$ac_aux_dir/ltmain.sh" -ofile="$default_ofile" -with_gnu_ld="$lt_cv_prog_gnu_ld" -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. -set dummy ${ac_tool_prefix}ar; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_AR+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$AR"; then - ac_cv_prog_AR="$AR" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { 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}ar" - 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; } +# 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 -fi -if test -z "$ac_cv_prog_AR"; then - ac_ct_AR=$AR - # Extract the first word of "ar", so it can be a program name with args. -set dummy ar; ac_word=$2 +# 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 __oline__ "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 + ;; +sparc*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) LD="${LD-ld} -m elf64_sparc" ;; + *) + 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" + + + 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_ac_ct_AR+set}" = set; then +if test "${ac_cv_prog_DSYMUTIL+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. + 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 @@ -7561,7 +7717,7 @@ 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="ar" + ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -7571,17 +7727,57 @@ 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; } +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 - if test "x$ac_ct_AR" = x; then - AR="false" + +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:) @@ -7593,22 +7789,22 @@ configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac - AR=$ac_ct_AR + DSYMUTIL=$ac_ct_DSYMUTIL fi else - AR="$ac_cv_prog_AR" + DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. -set dummy ${ac_tool_prefix}ranlib; ac_word=$2 + 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_RANLIB+set}" = set; then +if test "${ac_cv_prog_NMEDIT+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. + 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 @@ -7617,7 +7813,7 @@ 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" + ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -7627,10 +7823,10 @@ fi fi -RANLIB=$ac_cv_prog_RANLIB -if test -n "$RANLIB"; then - { echo "$as_me:$LINENO: result: $RANLIB" >&5 -echo "${ECHO_T}$RANLIB" >&6; } +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; } @@ -7638,17 +7834,17 @@ 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 +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_RANLIB+set}" = set; then +if test "${ac_cv_prog_ac_ct_NMEDIT+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. + 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 @@ -7657,7 +7853,7 @@ 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" + ac_cv_prog_ac_ct_NMEDIT="nmedit" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -7667,17 +7863,17 @@ 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; } +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_RANLIB" = x; then - RANLIB=":" + if test "x$ac_ct_NMEDIT" = x; then + NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) @@ -7689,4348 +7885,3927 @@ configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac - RANLIB=$ac_ct_RANLIB + NMEDIT=$ac_ct_NMEDIT fi else - RANLIB="$ac_cv_prog_RANLIB" + NMEDIT="$ac_cv_prog_NMEDIT" 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 + + + + + { 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. + echo "int foo(void){return 1;}" > conftest.c + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib ${wl}-single_module conftest.c + if test -f libconftest.dylib; then + lt_cv_apple_cc_single_mod=yes + rm -rf libconftest.dylib* + fi + rm conftest.c + 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 "$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 - 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 + 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. */ -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 +int +main () +{ - 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 ;; + ; + 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 - STRIP=$ac_ct_STRIP - fi +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 - STRIP="$ac_cv_prog_STRIP" -fi - - -old_CC="$CC" -old_CFLAGS="$CFLAGS" - -# Set sane defaults for various variables -test -z "$AR" && AR=ar -test -z "$AR_FLAGS" && AR_FLAGS=cru -test -z "$AS" && AS=as -test -z "$CC" && CC=cc -test -z "$LTCC" && LTCC=$CC -test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS -test -z "$DLLTOOL" && DLLTOOL=dlltool -test -z "$LD" && LD=ld -test -z "$LN_S" && LN_S="ln -s" -test -z "$MAGIC_CMD" && MAGIC_CMD=file -test -z "$NM" && NM=nm -test -z "$SED" && SED=sed -test -z "$OBJDUMP" && OBJDUMP=objdump -test -z "$RANLIB" && RANLIB=: -test -z "$STRIP" && STRIP=: -test -z "$ac_objext" && ac_objext=o + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -# Determine commands to create old-style static archives. -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' -old_postinstall_cmds='chmod 644 $oldlib' -old_postuninstall_cmds= + lt_cv_ld_exported_symbols_list=no +fi -if test -n "$RANLIB"; then - case $host_os in - openbsd*) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" - ;; - *) - old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" +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; } + 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 - old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" -fi - -for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; + 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" != ":"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` -# Only perform the check for file, if the check method requires it -case $deplibs_check_method in -file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - { echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 -echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6; } -if test "${lt_cv_path_MAGIC_CMD+set}" = set; then +{ echo "$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 - case $MAGIC_CMD in -[\\/*] | ?:[\\/]*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; -*) - lt_save_MAGIC_CMD="$MAGIC_CMD" - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" - for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/${ac_tool_prefix}file; then - lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - $EGREP "$file_magic_regex" > /dev/null; then - : - else - cat <&2 + 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 -*** 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 +int +main () +{ -EOF - fi ;; - esac - fi - break - fi - done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" - ;; + ; + 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 -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 -echo "${ECHO_T}$MAGIC_CMD" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - -if test -z "$lt_cv_path_MAGIC_CMD"; then - if test -n "$ac_tool_prefix"; then - { echo "$as_me:$LINENO: checking for file" >&5 -echo $ECHO_N "checking for file... $ECHO_C" >&6; } -if test "${lt_cv_path_MAGIC_CMD+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $MAGIC_CMD in -[\\/*] | ?:[\\/]*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; -*) - lt_save_MAGIC_CMD="$MAGIC_CMD" - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" - for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/file; then - lt_cv_path_MAGIC_CMD="$ac_dir/file" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - $EGREP "$file_magic_regex" > /dev/null; then - : - else - cat <&2 - -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -EOF - fi ;; - esac - fi - break - fi - done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" - ;; -esac -fi +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 -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; } +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then + : else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + ac_cv_header_stdc=no fi +rm -f conftest* - else - MAGIC_CMD=: - fi fi - fi - ;; -esac - -enable_dlopen=no -enable_win32_dll=no +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 -# Check whether --enable-libtool-lock was given. -if test "${enable_libtool_lock+set}" = set; then - enableval=$enable_libtool_lock; +_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* -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes - +fi -# Check whether --with-pic was given. -if test "${with_pic+set}" = set; then - withval=$with_pic; pic_mode="$withval" +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 - pic_mode=default -fi + 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 -test -z "$pic_mode" && pic_mode=default +#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 -# Use C for the default configuration in the libtool script -tagname= -lt_save_CC="$CC" -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu +( 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 -# Source file extension for C test sources. -ac_ext=c +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 -# Object file extension for compiled C test sources. -objext=o -objext=$objext +fi -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;\n" +# On IRIX 5.3, sys/types and inttypes.h are conflicting. -# Code to be used in simple link tests -lt_simple_link_test_code='int main(){return(0);}\n' -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} -# Allow CC to be a program name with arguments. -compiler=$CC -# save warnings/boilerplate of simple test code -ac_outfile=conftest.$ac_objext -printf "$lt_simple_compile_test_code" >conftest.$ac_ext -eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_compiler_boilerplate=`cat conftest.err` -$rm conftest* -ac_outfile=conftest.$ac_objext -printf "$lt_simple_link_test_code" >conftest.$ac_ext -eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_linker_boilerplate=`cat conftest.err` -$rm conftest* +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 -lt_prog_compiler_no_builtin_flag= + eval "$as_ac_Header=no" +fi -if test "$GCC" = yes; then - lt_prog_compiler_no_builtin_flag=' -fno-builtin' +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 - -{ 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 +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 - lt_cv_prog_compiler_rtti_exceptions=no - ac_outfile=conftest.$ac_objext - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="-fno-rtti -fno-exceptions" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:__oline__: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_rtti_exceptions=yes - fi - fi - $rm conftest* - -fi -{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; } + 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 -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" +@%:@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 - : -fi + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + eval "$as_ac_Header=no" fi -lt_prog_compiler_wl= -lt_prog_compiler_pic= -lt_prog_compiler_static= - -{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 -echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } +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 - if test "$GCC" = yes; then - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_static='-static' +fi - 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 - ;; +done - amigaos*) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' - ;; - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic='-DDLL_EXPORT' - ;; +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 - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic='-fno-common' - ;; +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 - interix3*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. - ;; - msdosdjgpp*) - # Just because we use GCC doesn't mean we suddenly get shared libraries - # on systems that don't support them. - lt_prog_compiler_can_build_shared=no - enable_shared=no - ;; + 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 - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic=-Kconform_pic - fi - ;; +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 - hpux*) - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic='-fPIC' - ;; - esac - ;; - *) - lt_prog_compiler_pic='-fPIC' - ;; - esac + test -n "$ac_ct_CXX" && break +done + + if test "x$ac_ct_CXX" = x; then + CXX="g++" else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - lt_prog_compiler_wl='-Wl,' - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static='-Bstatic' - else - lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' - fi - ;; - darwin*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - case $cc_basename in - xlc*) - lt_prog_compiler_pic='-qnocommon' - lt_prog_compiler_wl='-Wl,' - ;; - esac - ;; - - mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic='-DDLL_EXPORT' - ;; - - hpux9* | hpux10* | hpux11*) - lt_prog_compiler_wl='-Wl,' - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - lt_prog_compiler_static='${wl}-a ${wl}archive' - ;; + 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 - irix5* | irix6* | nonstopux*) - lt_prog_compiler_wl='-Wl,' - # PIC (with -KPIC) is the default. - lt_prog_compiler_static='-non_shared' - ;; + 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); } - newsos6) - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; +{ 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. */ - linux*) - case $cc_basename in - icc* | ecc*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-static' - ;; - pgcc* | pgf77* | pgf90* | pgf95*) - # Portland Group compilers (*not* the Pentium gcc compiler, - # which looks to be a dead project) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fpic' - lt_prog_compiler_static='-Bstatic' - ;; - ccc*) - lt_prog_compiler_wl='-Wl,' - # All Alpha code is PIC. - lt_prog_compiler_static='-non_shared' - ;; - esac - ;; +int +main () +{ +#ifndef __GNUC__ + choke me +#endif - osf3* | osf4* | osf5*) - lt_prog_compiler_wl='-Wl,' - # All OSF/1 code is PIC. - lt_prog_compiler_static='-non_shared' - ;; + ; + 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 - solaris*) - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - case $cc_basename in - f77* | f90* | f95*) - lt_prog_compiler_wl='-Qoption ld ';; - *) - lt_prog_compiler_wl='-Wl,';; - esac - ;; + ac_compiler_gnu=no +fi - sunos4*) - lt_prog_compiler_wl='-Qoption ld ' - lt_prog_compiler_pic='-PIC' - lt_prog_compiler_static='-Bstatic' - ;; +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu - sysv4 | sysv4.2uw2* | sysv4.3*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; +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. */ - sysv4*MP*) - if test -d /usr/nec ;then - lt_prog_compiler_pic='-Kconform_pic' - lt_prog_compiler_static='-Bstatic' - fi - ;; +int +main () +{ - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; + ; + 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 - unicos*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_can_build_shared=no - ;; + CXXFLAGS="" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ - uts4*) - lt_prog_compiler_pic='-pic' - lt_prog_compiler_static='-Bstatic' - ;; +int +main () +{ - *) - lt_prog_compiler_can_build_shared=no - ;; - esac - fi + ; + 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 -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic" >&6; } + 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. */ -# -# Check to make sure the PIC flag actually works. -# -if test -n "$lt_prog_compiler_pic"; then - -{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 -echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6; } -if test "${lt_prog_compiler_pic_works+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 +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 - lt_prog_compiler_pic_works=no - ac_outfile=conftest.$ac_objext - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic -DPIC" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:__oline__: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_pic_works=yes - fi - fi - $rm conftest* + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6; } -if test x"$lt_prog_compiler_pic_works" = xyes; then - case $lt_prog_compiler_pic in - "" | " "*) ;; - *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; - esac -else - lt_prog_compiler_pic= - lt_prog_compiler_can_build_shared=no +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - lt_prog_compiler_pic= - ;; - *) - lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" - ;; -esac - -# -# Check to make sure the static flag actually works. -# -wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" -{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } -if test "${lt_prog_compiler_static_works+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_static_works=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $lt_tmp_static_flag" - printf "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The linker can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&5 - $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_static_works=yes - fi - else - lt_prog_compiler_static_works=yes - fi - fi - $rm conftest* - LDFLAGS="$save_LDFLAGS" +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: $lt_prog_compiler_static_works" >&5 -echo "${ECHO_T}$lt_prog_compiler_static_works" >&6; } - -if test x"$lt_prog_compiler_static_works" = xyes; then - : +{ 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 - lt_prog_compiler_static= + 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 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 "$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 - lt_cv_prog_compiler_c_o=no - $rm -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:__oline__: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp - $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then - lt_cv_prog_compiler_c_o=yes - fi - fi - chmod u+w . 2>&5 - $rm conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files - $rm out/* && rmdir out - cd .. - rmdir conftest - $rm conftest* - -fi -{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6; } - + 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 -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 + 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 -else - need_locks=no -fi - -{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } - - runpath_var= - allow_undefined_flag= - enable_shared_with_static_runtimes=no - archive_cmds= - archive_expsym_cmds= - old_archive_From_new_cmds= - old_archive_from_expsyms_cmds= - export_dynamic_flag_spec= - whole_archive_flag_spec= - thread_safe_flag_spec= - hardcode_libdir_flag_spec= - hardcode_libdir_flag_spec_ld= - hardcode_libdir_separator= - hardcode_direct=no - hardcode_minus_L=no - hardcode_shlibpath_var=unsupported - link_all_deplibs=unknown - hardcode_automatic=no - module_cmds= - module_expsym_cmds= - always_export_symbols=no - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - include_expsyms= - # exclude_expsyms can be an extended regexp of symbols to exclude - # it will be wrapped by ` (' and `)$', so one must not match beginning or - # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', - # as well as any symbol that contains `d'. - exclude_expsyms="_GLOBAL_OFFSET_TABLE_" - # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out - # platforms (ab)use it in PIC code, but their linkers get confused if - # the symbol is explicitly referenced. Since portable code cannot - # rely on this symbol name, it's probably fine to never include it in - # preloaded symbol tables. - extract_expsyms_cmds= - # Just being paranoid about ensuring that cc_basename is set. - for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` - - case $host_os in - cygwin* | mingw* | pw32*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - if test "$GCC" != yes; then - with_gnu_ld=no - fi - ;; - interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) - with_gnu_ld=yes - ;; - openbsd*) - with_gnu_ld=no - ;; - esac - - ld_shlibs=yes - if test "$with_gnu_ld" = yes; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' + 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 - # 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' + 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 - whole_archive_flag_spec= - fi - supports_anon_versioning=no - case `$LD -v 2>/dev/null` in - *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 - *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... - *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... - *\ 2.11.*) ;; # other 2.11 versions - *) supports_anon_versioning=yes ;; + 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 - # See if GNU ld supports shared libraries. - case $host_os in - aix3* | aix4* | aix5*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - ld_shlibs=no - cat <&2 - -*** Warning: the GNU linker, at least up to release 2.9.1, is reported -*** to be unable to reliably create shared libraries on AIX. -*** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to modify your PATH -*** so that a non-GNU linker is found, and then restart. + cd .. + rm -rf conftest.dir +else + am_cv_CXX_dependencies_compiler_type=none +fi -EOF - 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 - amigaos*) - archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes + 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 - # Samuel A. Falvo II reports - # that the semantics of dynamic libraries on AmigaOS, at least up - # to version 4, is to share data among multiple programs linked - # with the same dynamic library. Since this doesn't match the - # behavior of shared libraries on other platforms, we can't use - # them. - ld_shlibs=no - ;; - beos*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - ld_shlibs=no - fi - ;; +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 - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec='-L$libdir' - allow_undefined_flag=unsupported - always_export_symbols=no - enable_shared_with_static_runtimes=yes - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' + # Broken: fails on valid input. +continue +fi - 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 - ;; +rm -f conftest.err conftest.$ac_ext - interix3*) - hardcode_direct=no - hardcode_shlibpath_var=no - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - export_dynamic_flag_spec='${wl}-E' - # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. - # Instead, shared libraries are loaded at an image base (0x10000000 by - # default) and relocated if they conflict, which is a slow very memory - # consuming and fragmenting process. To avoid this, we pick a random, - # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link - # time. Moving up from 0x10000000 also allows more sbrk(2) space. - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - ;; - - linux*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - tmp_addflag= - case $cc_basename,$host_cpu in - pgcc*) # Portland Group C compiler - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag' - ;; - pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag -Mnomain' ;; - ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 - tmp_addflag=' -i_dynamic' ;; - efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 - tmp_addflag=' -i_dynamic -nofor_main' ;; - ifc* | ifort*) # Intel Fortran compiler - tmp_addflag=' -nofor_main' ;; - esac - archive_cmds='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - - if test $supports_anon_versioning = yes; then - archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - $echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - fi - else - ld_shlibs=no - fi - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - fi - ;; - - solaris*) - if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then - ld_shlibs=no - cat <&2 - -*** Warning: The releases 2.8.* of the GNU linker cannot reliably -*** create shared libraries on Solaris systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.9.1 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -EOF - elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - - sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) - case `$LD -v 2>&1` in - *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) - ld_shlibs=no - cat <<_LT_EOF 1>&2 - -*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not -*** reliably create shared libraries on SCO systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.16.91.0.3 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -_LT_EOF - ;; - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - esac - ;; - - sunos4*) - archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - esac - - if test "$ld_shlibs" = no; then - runpath_var= - hardcode_libdir_flag_spec= - export_dynamic_flag_spec= - whole_archive_flag_spec= - fi - else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - allow_undefined_flag=unsupported - always_export_symbols=yes - archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - hardcode_minus_L=yes - if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - hardcode_direct=unsupported - fi - ;; - - aix4* | aix5*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - if $NM -V 2>&1 | grep 'GNU' > /dev/null; then - export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - else - export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - fi - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[23]|aix4.[23].*|aix5*) - for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then - aix_use_runtimelinking=yes - break - fi - done - ;; - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - archive_cmds='' - hardcode_direct=yes - hardcode_libdir_separator=':' - link_all_deplibs=yes - - if test "$GCC" = yes; then - case $host_os in aix4.[012]|aix4.[012].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && \ - strings "$collect2name" | grep resolve_lib_name >/dev/null - then - # We have reworked collect2 - hardcode_direct=yes - else - # We have old collect2 - hardcode_direct=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - hardcode_minus_L=yes - hardcode_libdir_flag_spec='-L$libdir' - hardcode_libdir_separator= - fi - ;; - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - always_export_symbols=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - allow_undefined_flag='-berok' - # Determine the default libpath from the value encoded in an empty executable. - cat >conftest.$ac_ext <<_ACEOF + # 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. */ - -int -main () -{ - - ; - return 0; -} +@%:@include _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" +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_link") 2>conftest.er1 + (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); } && { - test -z "$ac_c_werror_flag" || + (exit $ac_status); } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi + }; 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 core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - - hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag="-z nodefs" - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an empty executable. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +rm -f conftest.err conftest.$ac_ext -int -main () -{ +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 - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" + 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_link") 2>conftest.er1 + (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); } && { - test -z "$ac_c_werror_flag" || + (exit $ac_status); } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi + }; then + : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - + # Broken: fails on valid input. +continue fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi +rm -f conftest.err conftest.$ac_ext - hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - no_undefined_flag=' ${wl}-bernotok' - allow_undefined_flag=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec='$convenience' - archive_cmds_need_lc=yes - # This is similar to how AIX traditionally builds its shared libraries. - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; + # 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 - amigaos*) - archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - # see comment about different semantics on the GNU ld section - ld_shlibs=no - ;; + # Passes both tests. +ac_preproc_ok=: +break +fi - bsdi[45]*) - export_dynamic_flag_spec=-rdynamic - ;; +rm -f conftest.err conftest.$ac_ext - cygwin* | mingw* | pw32*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - hardcode_libdir_flag_spec=' ' - allow_undefined_flag=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - old_archive_From_new_cmds='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs' - fix_srcfile_path='`cygpath -w "$srcfile"`' - enable_shared_with_static_runtimes=yes - ;; +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 + _lt_caught_CXX_error=yes +fi - darwin* | rhapsody*) - case $host_os in - rhapsody* | darwin1.[012]) - allow_undefined_flag='${wl}-undefined ${wl}suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[012]) - allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - ;; - 10.*) - allow_undefined_flag='${wl}-undefined ${wl}dynamic_lookup' - ;; - esac - fi - ;; - esac - archive_cmds_need_lc=no - hardcode_direct=no - hardcode_automatic=yes - hardcode_shlibpath_var=unsupported - whole_archive_flag_spec='' - link_all_deplibs=yes - if test "$GCC" = yes ; then - output_verbose_link_cmd='echo' - archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - case $cc_basename in - xlc*) - output_verbose_link_cmd='echo' - archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' - module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - ;; - *) - ld_shlibs=no - ;; - esac - fi - ;; +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 - dgux*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; +else + _lt_caught_CXX_error=yes +fi - freebsd1*) - ld_shlibs=no - ;; - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor - # support. Future versions do this automatically, but an explicit c++rt0.o - # does not break anything, and helps significantly (at the cost of a little - # extra space). - freebsd2.2*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | kfreebsd*-gnu | dragonfly*) - archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - hpux9*) - if test "$GCC" = yes; then - archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - fi - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_direct=yes +# Set options - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - export_dynamic_flag_spec='${wl}-E' - ;; - hpux10*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_direct=yes - export_dynamic_flag_spec='${wl}-E' + enable_dlopen=no + - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - fi + 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 - hpux11*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - case $host_cpu in - hppa*64*) - archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - else - case $host_cpu in - hppa*64*) - archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: - case $host_cpu in - hppa*64*|ia64*) - hardcode_libdir_flag_spec_ld='+b $libdir' - hardcode_direct=no - hardcode_shlibpath_var=no - ;; - *) - hardcode_direct=yes - export_dynamic_flag_spec='${wl}-E' + + + + - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - ;; - esac - fi - ;; - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec_ld='-rpath $libdir' - fi - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - link_all_deplibs=yes - ;; - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no + # 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 - newsos6) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_shlibpath_var=no - ;; - openbsd*) - hardcode_direct=yes - hardcode_shlibpath_var=no - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - export_dynamic_flag_spec='${wl}-E' - else - case $host_os in - openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-R$libdir' - ;; - *) - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - ;; - esac - fi - ;; + + + + - os2*) - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - allow_undefined_flag=unsupported - archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; - osf3*) - if test "$GCC" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - fi - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - ;; - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ - $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' + +# Check whether --with-pic was given. +if test "${with_pic+set}" = set; then + withval=$with_pic; pic_mode="$withval" +else + pic_mode=default +fi - # Both c and cxx compiler support -rpath directly - hardcode_libdir_flag_spec='-rpath $libdir' - fi - hardcode_libdir_separator=: - ;; - solaris*) - no_undefined_flag=' -z text' - if test "$GCC" = yes; then - wlarc='${wl}' - archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' - else - wlarc='' - archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' - fi - hardcode_libdir_flag_spec='-R$libdir' - hardcode_shlibpath_var=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) - # The compiler driver will combine linker options so we - # cannot just pass the convience library names through - # without $wl, iff we do not link with $LD. - # Luckily, gcc supports the same syntax we need for Sun Studio. - # Supported since Solaris 2.6 (maybe 2.5.1?) - case $wlarc in - '') - whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; - *) - whole_archive_flag_spec='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; - esac ;; - esac - link_all_deplibs=yes - ;; +test -z "$pic_mode" && pic_mode=default - 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 + # 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 - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) - no_undefined_flag='${wl}-z,text' - archive_cmds_need_lc=no - hardcode_shlibpath_var=no - runpath_var='LD_RUN_PATH' - if test "$GCC" = yes; then - archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - sysv5* | sco3.2v5* | sco5v6*) - # Note: We can NOT use -z defs as we might desire, because we do not - # link with -lc, and that would cause any symbols used from libc to - # always be unresolved, which means just about no library would - # ever link correctly. If we're not using GNU ld we use -z text - # though, which does catch some bad symbols but isn't as heavy-handed - # as -z defs. - no_undefined_flag='${wl}-z,text' - allow_undefined_flag='${wl}-z,nodefs' - archive_cmds_need_lc=no - hardcode_shlibpath_var=no - hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' - hardcode_libdir_separator=':' - link_all_deplibs=yes - export_dynamic_flag_spec='${wl}-Bexport' - runpath_var='LD_RUN_PATH' + + + - if test "$GCC" = yes; then - archive_cmds='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - uts4*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; + - *) - ld_shlibs=no - ;; - esac - fi -{ echo "$as_me:$LINENO: result: $ld_shlibs" >&5 -echo "${ECHO_T}$ld_shlibs" >&6; } -test "$ld_shlibs" = no && can_build_shared=no +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" -# -# 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 +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $archive_cmds in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 -echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } - $rm conftest* - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl - pic_flag=$lt_prog_compiler_pic - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag - allow_undefined_flag= - if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 - (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - then - archive_cmds_need_lc=no - else - archive_cmds_need_lc=yes - fi - allow_undefined_flag=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $rm conftest* - { echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 -echo "${ECHO_T}$archive_cmds_need_lc" >&6; } - ;; - esac - fi - ;; -esac + + + -{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 -echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } -library_names_spec= -libname_spec='lib$name' -soname_spec= -shrext_cmds=".so" -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi + + + + + + + + + + + + + + + + + + + +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 - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" + 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 -need_lib_prefix=unknown -hardcode_into_libs=no +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 -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown + + + -case $host_os in -aix3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' - shlibpath_var=LIBPATH +cat >>confdefs.h <<_ACEOF +@%:@define LT_OBJDIR "$lt_cv_objdir/" +_ACEOF - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' - ;; -aix4* | aix5*) - version_type=linux - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test "$host_cpu" = ia64; then - # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - aix4 | aix4.[01] | aix4.[01].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; - esac - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then - # If using run time linking (on AIX 4.2 or later) use lib.so - # instead of lib.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - else - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}${shared_ext}$major' - fi - shlibpath_var=LIBPATH + + + + + + + + + + + + + + + +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 -amigaos*) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' - ;; +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' -bsdi[45]*) - version_type=linux - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' -cygwin* | mingw* | pw32*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32*) - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname~ - chmod a+x \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $rm \$dlpath' - shlibpath_overrides_runpath=yes +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" - ;; - mingw*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - ;; - esac - ;; +# Global variables: +ofile=libtool +can_build_shared=yes - *) - library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' - ;; +# 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 - dynamic_linker='Win32 ld.exe' - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; +done +cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' - soname_spec='${libname}${release}${major}$shared_ext' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' - # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. - if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` - else - sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' - fi - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + +# 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 -dgux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH +*** 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 -freebsd1*) - dynamic_linker=no +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 -kfreebsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='GNU ld.so' +*** 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 + -freebsd* | dragonfly*) - # DragonFly does not have aout. When/if they implement a new - # versioning mechanism, adjust this. - if test -x /usr/bin/objformat; then - objformat=`/usr/bin/objformat` else - case $host_os in - freebsd[123]*) objformat=aout ;; - *) objformat=elf ;; - esac + MAGIC_CMD=: + fi +fi + fi - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2*) - shlibpath_overrides_runpath=yes - ;; - freebsd3.[01]* | freebsdelf3.[01]*) - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ - freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - freebsd*) # from 4.6 on - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - esac ;; +esac -gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - hardcode_into_libs=yes - ;; +# Use C for the default configuration in the libtool script -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' - ;; +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 -interix3*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; -irix5* | irix6* | nonstopux*) - case $host_os in - nonstopux*) version_type=nonstopux ;; - *) - if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux - else - version_type=irix - fi ;; - esac - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' - case $host_os in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" - hardcode_into_libs=yes - ;; +# Source file extension for C test sources. +ac_ext=c -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no - ;; +# Object file extension for compiled C test sources. +objext=o +objext=$objext -# This must be Linux ELF. -linux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" - # find out which ABI we are using - libsuff= - case "$host_cpu" in - x86_64*|s390x*|powerpc64*) - echo '#line __oline__ "configure"' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - case `/usr/bin/file conftest.$ac_objext` in - *64-bit*) - libsuff=64 - sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" - ;; - esac - fi - rm -rf conftest* - ;; - esac +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' - # Append ld.so.conf contents to the search path - if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" - fi - # We used to test for /lib/ld.so.1 and disable shared libraries on - # powerpc, because MkLinux only supported shared libraries with the - # GNU dynamic linker. Since this was broken with cross compilers, - # most powerpc-linux boxes support dynamic linking these days and - # people can always --disable-shared, the test was removed, and we - # assume the GNU/Linux dynamic linker is in use. - dynamic_linker='GNU/Linux ld.so' - ;; -knetbsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='GNU ld.so' - ;; -netbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; -newsos6) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; -nto-qnx*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; -openbsd*) - version_type=sunos - sys_lib_dlsearch_path_spec="/usr/lib" - need_lib_prefix=no - # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. - case $host_os in - openbsd3.3 | openbsd3.3.*) need_version=yes ;; - *) need_version=no ;; - esac - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - case $host_os in - openbsd2.[89] | openbsd2.[89].*) - shlibpath_overrides_runpath=no - ;; - *) - shlibpath_overrides_runpath=yes - ;; - esac - else - shlibpath_overrides_runpath=yes - fi - ;; +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} -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 - ;; +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} -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" - ;; +# Allow CC to be a program name with arguments. +compiler=$CC -solaris*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; +# 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 -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 - ;; +# 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* -sysv4 | sysv4.3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - export_dynamic_flag_spec='${wl}-Blargedynsym' - runpath_var=LD_RUN_PATH - ;; - siemens) - need_lib_prefix=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; - -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux - library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - version_type=freebsd-elf - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - hardcode_into_libs=yes - if test "$with_gnu_ld" = yes; then - sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' - shlibpath_overrides_runpath=no - else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - shlibpath_overrides_runpath=yes - case $host_os in - sco3.2v5*) - sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" - ;; - esac - fi - sys_lib_dlsearch_path_spec='/usr/lib' - ;; +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* -uts4*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; -*) - dynamic_linker=no - ;; -esac -{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5 -echo "${ECHO_T}$dynamic_linker" >&6; } -test "$dynamic_linker" = no && can_build_shared=no +## 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= -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi - -{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 -echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } -hardcode_action= -if test -n "$hardcode_libdir_flag_spec" || \ - test -n "$runpath_var" || \ - test "X$hardcode_automatic" = "Xyes" ; then + lt_prog_compiler_no_builtin_flag=' -fno-builtin' - # We can hardcode non-existant directories. - if test "$hardcode_direct" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, )" != no && - test "$hardcode_minus_L" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action=immediate - fi + { 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 - # 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; } + 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:__oline__: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:__oline__: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $RM conftest* -if test "$hardcode_action" = relink; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless fi +{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; } -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; } +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 -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP" ; then - striplib="$STRIP -x" - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } - else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + : fi - ;; - *) - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } - ;; - esac + fi -if test "x$enable_dlopen" != xyes; then - enable_dlopen=unknown - enable_dlopen_self=unknown - enable_dlopen_self_static=unknown -else - lt_cv_dlopen=no - lt_cv_dlopen_libs= + + + - case $host_os in - beos*) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ;; - mingw* | pw32*) - lt_cv_dlopen="LoadLibrary" - lt_cv_dlopen_libs= - ;; + lt_prog_compiler_wl= +lt_prog_compiler_pic= +lt_prog_compiler_static= - cygwin*) - lt_cv_dlopen="dlopen" - lt_cv_dlopen_libs= - ;; +{ 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; } - 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. */ + if test "$GCC" = yes; then + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_static='-static' -/* 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 + 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 + ;; - ac_cv_lib_dl_dlopen=no -fi + amigaos*) + if test "$host_cpu" = m68k; then + # 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' + 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 + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; -#undef shl_load + mingw* | cygwin* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; -/* 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 + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + ;; -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 + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + ;; - ac_cv_func_shl_load=no -fi + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; -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. */ + 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 + ;; -/* 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 + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic='-fPIC -shared' + ;; - ac_cv_lib_dld_shl_load=no -fi + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic=-Kconform_pic + 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="-dld" -else - { echo "$as_me:$LINENO: checking for dlopen" >&5 -echo $ECHO_N "checking for dlopen... $ECHO_C" >&6; } -if test "${ac_cv_func_dlopen+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define dlopen to an innocuous variant, in case declares dlopen. - For example, HP-UX 11i declares gettimeofday. */ -#define dlopen innocuous_dlopen + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + else + lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' + fi + ;; -/* 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. */ + mingw* | cygwin* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; -#ifdef __STDC__ -# include -#else -# include -#endif + 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' + ;; -#undef dlopen + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static='-non_shared' + ;; -/* 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 + linux* | k*bsd*-gnu) + case $cc_basename in + icc* | ecc* | ifort*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + xl*) + # IBM XL C 8.0/Fortran 10.1 on PPC + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-qpic' + lt_prog_compiler_static='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C 5.9 + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Wl,' + ;; + *Sun\ F*) + # 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='' + ;; + esac + ;; + esac + ;; -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;; + 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*) + 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 -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 +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic" >&6; } - 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 + +# +# 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 - 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. */ + 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:__oline__: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:__oline__: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_pic_works=yes + fi + fi + $RM conftest* -/* 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 +fi +{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_pic_works" >&6; } - ac_cv_lib_dl_dlopen=no +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 -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 + + + + + + +# +# 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 - 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 + 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 "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_static_works=yes + fi + else + lt_cv_prog_compiler_static_works=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" - ac_cv_lib_svld_dlopen=no fi +{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_static_works" >&6; } -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" +if test x"$lt_cv_prog_compiler_static_works" = xyes; then + : 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 + 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 - 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. */ + 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 -/* 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 + 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:__oline__: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:__oline__: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* - ac_cv_lib_dld_dld_link=no fi +{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6; } -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="-dld" -fi + + + - -fi - -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 - -fi + 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:__oline__: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:__oline__: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $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; } - -fi - ;; - esac - if test "x$lt_cv_dlopen" != xno; then - enable_dlopen=yes - else - enable_dlopen=no + +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 - 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 <&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } -#if HAVE_DLFCN_H -#include -#endif + 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_flag_spec_ld= + 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= -#include + case $host_os in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif + ld_shlibs=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' -/* 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 + # 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 + *\ [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 -#ifdef __cplusplus -extern "C" void exit (int); -#endif + # 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 -void fnord() { int i=42;} -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - /* dlclose (self); */ - } - else - puts (dlerror ()); +_LT_EOF + fi + ;; - exit (status); -} -EOF - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) >&5 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; - x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; - x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; - esac - else : - # compilation failed - lt_cv_dlopen_self=no - fi -fi -rm -fr conftest* + amigaos*) + if test "$host_cpu" = m68k; then + 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 + fi - -fi -{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 -echo "${ECHO_T}$lt_cv_dlopen_self" >&6; } + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can't use + # them. + ld_shlibs=no + ;; - 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 <&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 + ;; -#if HAVE_DLFCN_H -#include -#endif + cygwin* | mingw* | pw32*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + allow_undefined_flag=unsupported + always_export_symbols=no + enable_shared_with_static_runtimes=yes + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' -#include + 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 + ;; -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif + 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' + ;; -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif - -#ifdef __cplusplus -extern "C" void exit (int); -#endif - -void fnord() { int i=42;} -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - /* dlclose (self); */ - } - else - puts (dlerror ()); - - exit (status); -} -EOF - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) >&5 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; - x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; - x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; - esac - else : - # compilation failed - lt_cv_dlopen_self_static=no - fi -fi -rm -fr conftest* - - -fi -{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 -echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6; } - fi + gnu* | linux* | tpf* | k*bsd*-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= + 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; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + xl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + 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; $ECHO \"$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' - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - LIBS="$save_LIBS" - ;; - esac + 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 $lt_cv_dlopen_self in - yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; - *) enable_dlopen_self=unknown ;; - esac + case $cc_basename in + xlf*) + # 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= + hardcode_libdir_flag_spec_ld='-rpath $libdir' + archive_cmds='$LD -shared $libobjs $deplibs $compiler_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 $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + ld_shlibs=no + fi + ;; - 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 + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 -# 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; } +*** 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. -{ 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 +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; -# 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 - ;; + 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 -aix4* | aix5*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - fi - ;; -esac -{ echo "$as_me:$LINENO: result: $enable_shared" >&5 -echo "${ECHO_T}$enable_shared" >&6; } +*** 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. -{ 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; } +_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 + ;; -# The else clause should only fire when bootstrapping the -# libtool distribution, otherwise you forgot to ship ltmain.sh -# with your package, and you will get complaints that there are -# no rules to generate ltmain.sh. -if test -f "$ltmain"; then - # See if we are running on zsh, and set the options which allow our commands through - # without removal of \ escapes. - if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST - fi - # Now quote all the things that may contain metacharacters while being - # careful not to overquote the AC_SUBSTed values. We take copies of the - # variables and quote the copies for generation of the libtool script. - for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ - SED SHELL STRIP \ - libname_spec library_names_spec soname_spec extract_expsyms_cmds \ - old_striplib striplib file_magic_cmd finish_cmds finish_eval \ - deplibs_check_method reload_flag reload_cmds need_locks \ - lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ - lt_cv_sys_global_symbol_to_c_name_address \ - sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ - old_postinstall_cmds old_postuninstall_cmds \ - compiler \ - CC \ - LD \ - lt_prog_compiler_wl \ - lt_prog_compiler_pic \ - lt_prog_compiler_static \ - lt_prog_compiler_no_builtin_flag \ - export_dynamic_flag_spec \ - thread_safe_flag_spec \ - whole_archive_flag_spec \ - enable_shared_with_static_runtimes \ - old_archive_cmds \ - old_archive_from_new_cmds \ - predep_objects \ - postdep_objects \ - predeps \ - postdeps \ - compiler_lib_search_path \ - archive_cmds \ - archive_expsym_cmds \ - postinstall_cmds \ - postuninstall_cmds \ - old_archive_from_expsyms_cmds \ - allow_undefined_flag \ - no_undefined_flag \ - export_symbols_cmds \ - hardcode_libdir_flag_spec \ - hardcode_libdir_flag_spec_ld \ - hardcode_libdir_separator \ - hardcode_automatic \ - module_cmds \ - module_expsym_cmds \ - lt_cv_prog_compiler_c_o \ - exclude_expsyms \ - include_expsyms; do - - case $var in - old_archive_cmds | \ - old_archive_from_new_cmds | \ - archive_cmds | \ - archive_expsym_cmds | \ - module_cmds | \ - module_expsym_cmds | \ - old_archive_from_expsyms_cmds | \ - export_symbols_cmds | \ - extract_expsyms_cmds | reload_cmds | finish_cmds | \ - postinstall_cmds | postuninstall_cmds | \ - old_postinstall_cmds | old_postuninstall_cmds | \ - sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) - # Double-quote double-evaled strings. - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + sunos4*) + archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct=yes + hardcode_shlibpath_var=no ;; + *) - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi ;; esac - done - - case $lt_echo in - *'\$0 --fallback-echo"') - lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` - ;; - esac -cfgfile="${ofile}T" - trap "$rm \"$cfgfile\"; exit 1" 1 2 15 - $rm -f "$cfgfile" - { echo "$as_me:$LINENO: creating $ofile" >&5 -echo "$as_me: creating $ofile" >&6;} - - cat <<__EOF__ >> "$cfgfile" -#! $SHELL - -# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) -# NOTE: Changes made to this file will be lost: look at ltmain.sh. -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 -# Free Software Foundation, Inc. -# -# This file is part of GNU Libtool: -# Originally by Gordon Matzigkeit , 1996 -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# A sed program that does not truncate output. -SED=$lt_SED + 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 + ;; -# Sed that helps us avoid accidentally triggering echo(1) options like -n. -Xsed="$SED -e 1s/^X//" + 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 + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no -# 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 + # 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 -# The names of the tagged configurations supported by this script. -available_tags= + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi -# ### BEGIN LIBTOOL CONFIG + # 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. -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: + archive_cmds='' + hardcode_direct=yes + hardcode_direct_absolute=yes + hardcode_libdir_separator=':' + link_all_deplibs=yes + file_list_spec='${wl}-f,' -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared + 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 + 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 -# Whether or not to build static libraries. -build_old_libs=$enable_static + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$archive_cmds_need_lc +int +main () +{ -# Whether or not to disallow shared libs when runtime libs are static -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes + ; + 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 + } + }' +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 "$aix_libpath"; then + 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 -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install + +fi -# The host system. -host_alias=$host_alias -host=$host -host_os=$host_os +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi -# The build system. -build_alias=$build_alias -build=$build -build_os=$build_os + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag="-z nodefs" + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -# An echo program that does not interpret backslashes. -echo=$lt_echo +int +main () +{ -# The archiver. -AR=$lt_AR -AR_FLAGS=$lt_AR_FLAGS + ; + 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 + } + }' +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 "$aix_libpath"; then + 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 -# A C compiler. -LTCC=$lt_LTCC + +fi -# LTCC compiler flags. -LTCFLAGS=$lt_LTCFLAGS +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi -# A language-specific compiler. -CC=$lt_compiler + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag=' ${wl}-bernotok' + allow_undefined_flag=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + archive_cmds_need_lc=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; -# Is the compiler the GNU C compiler? -with_gcc=$GCC + amigaos*) + if test "$host_cpu" = m68k; then + 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 + fi + # see comment about different semantics on the GNU ld section + ld_shlibs=no + ;; -gcc_dir=\`$CC -print-file-name=. | $SED 's,/\.$,,'\` -gcc_ver=\`$CC -dumpversion\` + bsdi[45]*) + export_dynamic_flag_spec=-rdynamic + ;; -# An ERE matcher. -EGREP=$lt_EGREP + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_from_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path='`cygpath -w "$srcfile"`' + enable_shared_with_static_runtimes=yes + ;; -# The linker used to build libraries. -LD=$lt_LD + darwin* | rhapsody*) + + + archive_cmds_need_lc=no + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + whole_archive_flag_spec='' + link_all_deplibs=yes + allow_undefined_flag="$_lt_dar_allow_undefined" + if test "$GCC" = "yes"; then + output_verbose_link_cmd=echo + archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_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 -# Whether we need hard or soft links. -LN_S=$lt_LN_S + ;; -# A BSD-compatible nm program. -NM=$lt_NM + dgux*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; -# A symbol stripping program -STRIP=$lt_STRIP + freebsd1*) + ld_shlibs=no + ;; -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=$MAGIC_CMD + # 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 + ;; -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" + # 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 + ;; -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; -# Used on cygwin: assembler. -AS="$AS" + hpux9*) + if test "$GCC" = yes; then + archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes -# The name of the directory that contains temporary libtool files. -objdir=$objdir + # 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' + ;; -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl + hpux10*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_flag_spec_ld='+b $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 + ;; -# Object file suffix (normally "o"). -objext="$ac_objext" + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: -# Old archive suffix (normally "a"). -libext="$libext" + 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' -# Shared library suffix (normally ".so"). -shrext_cmds='$shrext_cmds' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + ;; + esac + fi + ;; -# Executable file suffix (normally ""). -exeext="$exeext" + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${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. + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + cat >conftest.$ac_ext <<_ACEOF +int foo(void) {} +_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 + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic -pic_mode=$pic_mode + +fi -# What is the maximum length of a command? -max_cmd_len=$lt_cv_sys_max_cmd_len +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS="$save_LDFLAGS" + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -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 + ;; -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; -# Must we lock files when doing compilation? -need_locks=$lt_need_locks + 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 + ;; -# Do we need the lib prefix for modules? -need_lib_prefix=$need_lib_prefix + *nto* | *qnx*) + ;; -# Do we need a version for libraries? -need_version=$need_version + 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 + ;; -# Whether dlopen is supported. -dlopen_support=$enable_dlopen + 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' + ;; -# Whether dlopen of programs is supported. -dlopen_self=$enable_dlopen_self + osf3*) + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${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" && $ECHO "X-set_version $verstring" | $Xsed` -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=: + ;; -# Whether dlopen of statically linked programs is supported. -dlopen_self_static=$enable_dlopen_self_static + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${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" && $ECHO "X-set_version $verstring" | $Xsed` -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 "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_lt_prog_compiler_static + # Both c and cxx compiler support -rpath directly + hardcode_libdir_flag_spec='-rpath $libdir' + fi + archive_cmds_need_lc='no' + hardcode_libdir_separator=: + ;; -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag + solaris*) + no_undefined_flag=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' + archive_cmds='$CC -shared ${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 ${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 + ;; -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec + 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 + ;; -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec + 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 + ;; -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_thread_safe_flag_spec + sysv4.3*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + export_dynamic_flag_spec='-Bexport' + ;; -# Library versioning type. -version_type=$version_type + 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 + ;; -# Format of library name prefix. -libname_spec=$lt_libname_spec + 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' -# 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 + 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 + ;; -# The coded name of the library, if different from the real name. -soname_spec=$lt_soname_spec + 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' -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_old_archive_cmds -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds + 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 + ;; -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds + uts4*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds + *) + ld_shlibs=no + ;; + esac -# Commands used to build and install a shared archive. -archive_cmds=$lt_archive_cmds -archive_expsym_cmds=$lt_archive_expsym_cmds -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds + 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 -# Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_module_cmds -module_expsym_cmds=$lt_module_expsym_cmds +{ echo "$as_me:$LINENO: result: $ld_shlibs" >&5 +echo "${ECHO_T}$ld_shlibs" >&6; } +test "$ld_shlibs" = no && can_build_shared=no -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib +with_gnu_ld=$with_gnu_ld -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects=\`echo $lt_predep_objects | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` - -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects=\`echo $lt_postdep_objects | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` -# Dependencies to place before the objects being linked to create a -# shared library. -predeps=$lt_predeps + + + -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_postdeps + + + -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=\`echo $lt_compiler_lib_search_path | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` + + + -# Method to check whether dependent libraries are shared objects. -deplibs_check_method=$lt_deplibs_check_method -# Command to use when deplibs_check_method == file_magic. -file_magic_cmd=$lt_file_magic_cmd +# +# 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 -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $archive_cmds in + *'~'*) + # FIXME: we may have to deal with multi-command sequences. + ;; + '$CC '*) + # Test whether the compiler implicitly links with -lc since on some + # systems, -lgcc has to come before -lc. If gcc already passes -lc + # to ld, don't add -lc before -lgcc. + { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$lt_prog_compiler_wl + pic_flag=$lt_prog_compiler_pic + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\"") >&5 + (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + then + archive_cmds_need_lc=no + else + archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + { echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 +echo "${ECHO_T}$archive_cmds_need_lc" >&6; } + ;; + esac + fi + ;; +esac -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$lt_finish_eval + + + -# Take the output of nm and produce a listing of raw symbols and C names. -global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe -# Transform the output of nm in a proper C declaration -global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + + + -# Transform the output of nm in a C name address pair -global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address -# This is the shared library runtime path variable. -runpath_var=$runpath_var + + + -# This is the shared library path variable. -shlibpath_var=$shlibpath_var -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath + + + -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs + + + -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec -# If ld is used when linking, flag to hardcode \$libdir into -# a binary during linking. This must work even if \$libdir does -# not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld + + + -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator -# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$hardcode_direct + + + -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$hardcode_minus_L -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var + + + -# Set to yes if building a shared library automatically hardcodes DIR into the library -# and all subsequent libraries and executables linked against it. -hardcode_automatic=$hardcode_automatic -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" + + + -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs -# Compile-time system search path for libraries -sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` + + + -# Run-time system search path for libraries -sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$fix_srcfile_path" + + + -# Set to yes if exported symbols are required. -always_export_symbols=$always_export_symbols -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds + + + -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms + + + -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms -# ### END LIBTOOL CONFIG + + + -__EOF__ + + + - case $host_os in - aix3*) - cat <<\EOF >> "$cfgfile" -# AIX sometimes has problems with the GCC collect2 program. For some -# reason, if we set the COLLECT_NAMES environment variable, the problems -# vanish in a puff of smoke. -if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES -fi -EOF - ;; - esac + + + - # We use sed instead of cat because bash on DJGPP gets confused if - # if finds mixed CR/LF and LF-only lines. Since sed operates in - # text mode, it properly converts lines to CR/LF. This bash problem - # is reportedly fixed, but why not run on old versions too? - sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) - mv -f "$cfgfile" "$ofile" || \ - (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") - chmod +x "$ofile" + + + -else - # If there is no Makefile yet, we rely on a make rule to execute - # `config.status --recheck' to rerun these tests and create the - # libtool script then. - ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` - if test -f "$ltmain_in"; then - test -f Makefile && make "$ltmain" - fi -fi - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -CC="$lt_save_CC" - - -# Check whether --with-tags was given. -if test "${with_tags+set}" = set; then - withval=$with_tags; tagnames="$withval" -fi + + + -if test -f "$ltmain" && test -n "$tagnames"; then - if test ! -f "${ofile}"; then - { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5 -echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;} - fi - if test -z "$LTCC"; then - eval "`$SHELL ${ofile} --config | grep '^LTCC='`" - if test -z "$LTCC"; then - { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5 -echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;} - else - { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5 -echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;} - fi - fi - if test -z "$LTCFLAGS"; then - eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" - fi + + + - # Extract list of available tagged configurations in $ofile. - # Note that this assumes the entire list is on one line. - available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for tagname in $tagnames; do - IFS="$lt_save_ifs" - # Check whether tagname contains only valid characters - case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in - "") ;; - *) { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5 -echo "$as_me: error: invalid tag name: $tagname" >&2;} - { (exit 1); exit 1; }; } - ;; - esac + + + - if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null - then - { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5 -echo "$as_me: error: tag name \"$tagname\" already exists" >&2;} - { (exit 1); exit 1; }; } - fi - # Update the list of available tags. - if test -n "$tagname"; then - echo appending configuration tag \"$tagname\" to $ofile - - case $tagname in - CXX) - if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then - ac_ext=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= -export_dynamic_flag_spec_CXX= -hardcode_direct_CXX=no -hardcode_libdir_flag_spec_CXX= -hardcode_libdir_flag_spec_ld_CXX= -hardcode_libdir_separator_CXX= -hardcode_minus_L_CXX=no -hardcode_shlibpath_var_CXX=unsupported -hardcode_automatic_CXX=no -module_cmds_CXX= -module_expsym_cmds_CXX= -link_all_deplibs_CXX=unknown -old_archive_cmds_CXX=$old_archive_cmds -no_undefined_flag_CXX= -whole_archive_flag_spec_CXX= -enable_shared_with_static_runtimes_CXX=no + + + -# Dependencies to place before and after the object being linked: -predep_objects_CXX= -postdep_objects_CXX= -predeps_CXX= -postdeps_CXX= -compiler_lib_search_path_CXX= -# Source file extension for C++ test sources. -ac_ext=cpp + + + -# Object file extension for compiled C++ test sources. -objext=o -objext_CXX=$objext -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;\n" + + + -# Code to be used in simple link tests -lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n' -# ltmain only uses $CC for tagged configurations so make sure $CC is set. + + + -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + + + -# Allow CC to be a program name with arguments. -compiler=$CC + + + -# save warnings/boilerplate of simple test code -ac_outfile=conftest.$ac_objext -printf "$lt_simple_compile_test_code" >conftest.$ac_ext -eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_compiler_boilerplate=`cat conftest.err` -$rm conftest* -ac_outfile=conftest.$ac_objext -printf "$lt_simple_link_test_code" >conftest.$ac_ext -eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_linker_boilerplate=`cat conftest.err` -$rm conftest* + + + -# Allow CC to be a program name with arguments. -lt_save_CC=$CC -lt_save_LD=$LD -lt_save_GCC=$GCC -GCC=$GXX -lt_save_with_gnu_ld=$with_gnu_ld -lt_save_path_LD=$lt_cv_path_LD -if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then - lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx -else - $as_unset lt_cv_prog_gnu_ld -fi -if test -n "${lt_cv_path_LDCXX+set}"; then - lt_cv_path_LD=$lt_cv_path_LDCXX -else - $as_unset lt_cv_path_LD -fi -test -z "${LDCXX+set}" || LD=$LDCXX -CC=${CXX-"c++"} -compiler=$CC -compiler_CXX=$CC -for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + + -# We don't want -fno-exception wen compiling C++ code, so set the -# no_builtin_flag separately -if test "$GXX" = yes; then - lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' -else - lt_prog_compiler_no_builtin_flag_CXX= -fi + + + -if test "$GXX" = yes; then - # Set up default GNU C++ configuration - -# Check whether --with-gnu-ld 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 + { echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } -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 - ;; + case $host_os in + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; 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 /dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` + else + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # 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 - IFS="$lt_save_ifs" -else - lt_cv_path_LD="$LD" # Let the user override the test with a path. -fi -fi - -LD="$lt_cv_path_LD" -if test -n "$LD"; then - { echo "$as_me:$LINENO: result: $LD" >&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 + 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; } +}'` + sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` 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 - +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 - # Check if GNU C++ uses GNU ld as the underlying linker, since the - # archiving commands below assume that GNU ld is being used. - if test "$with_gnu_ld" = yes; then - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - - hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-dynamic' +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH - # 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}' + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; - # 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' +aix[4-9]*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else - whole_archive_flag_spec_CXX= + # 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 - 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' + shlibpath_var=LIBPATH fi + ;; - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' - -else - GXX=no - with_gnu_ld=no - wlarc= -fi +amigaos*) + if test "$host_cpu" = m68k; then + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + else + dynamic_linker=no + fi + ;; -# PORTME: fill in a description of your system's C++ link characteristics -{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } -ld_shlibs_CXX=yes -case $host_os in - aix3*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - aix4* | aix5*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - aix_use_runtimelinking=no +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[23]|aix4.[23].*|aix5*) - for ld_flag in $LDFLAGS; do - case $ld_flag in - *-brtl*) - aix_use_runtimelinking=yes - break - ;; - esac - done - ;; - esac +bsdi[45]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - archive_cmds_CXX='' - hardcode_direct_CXX=yes - hardcode_libdir_separator_CXX=':' - link_all_deplibs_CXX=yes + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + 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 - if test "$GXX" = yes; then - case $host_os in aix4.[012]|aix4.[012].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && \ - strings "$collect2name" | grep resolve_lib_name >/dev/null - then - # We have reworked collect2 - hardcode_direct_CXX=yes - else - # We have old collect2 - hardcode_direct_CXX=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - hardcode_minus_L_CXX=yes - hardcode_libdir_flag_spec_CXX='-L$libdir' - hardcode_libdir_separator_CXX= - fi - ;; - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' + case $host_os in + cygwin*) + # Cygwin DLLs use 'cyg' prefix rather than 'lib' + soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi - fi - - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - always_export_symbols_CXX=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - allow_undefined_flag_CXX='-berok' - # Determine the default libpath from the value encoded in an empty executable. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (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 - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + ;; + 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 + ;; - -fi + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi +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`' - hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" + sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' + ;; - archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag_CXX="-z nodefs" - archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an empty executable. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; -int -main () -{ +freebsd1*) + dynamic_linker=no + ;; - ; - 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" || +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix[3-9]*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux* | k*bsd*-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' + 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 + 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 - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi + if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then + shlibpath_overrides_runpath=yes +fi + else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -12040,6591 +11815,3283 @@ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - - hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - no_undefined_flag_CXX=' ${wl}-bernotok' - allow_undefined_flag_CXX=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec_CXX='$convenience' - archive_cmds_need_lc_CXX=yes - # This is similar to how AIX traditionally builds its shared libraries. - archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir - 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 - ;; + # 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 - chorus*) - case $cc_basename in - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; + # Append ld.so.conf contents to the search path + if test -f /etc/ld.so.conf; then + lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` + sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" + fi - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec_CXX='-L$libdir' - allow_undefined_flag_CXX=unsupported - always_export_symbols_CXX=no - enable_shared_with_static_runtimes_CXX=yes - - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - ld_shlibs_CXX=no - fi + # 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' ;; - darwin* | rhapsody*) - case $host_os in - rhapsody* | darwin1.[012]) - allow_undefined_flag_CXX='${wl}-undefined ${wl}suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[012]) - allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - ;; - 10.*) - allow_undefined_flag_CXX='${wl}-undefined ${wl}dynamic_lookup' - ;; - esac - fi - ;; - esac - archive_cmds_need_lc_CXX=no - hardcode_direct_CXX=no - hardcode_automatic_CXX=yes - hardcode_shlibpath_var_CXX=unsupported - whole_archive_flag_spec_CXX='' - link_all_deplibs_CXX=yes - - if test "$GXX" = yes ; then - lt_int_apple_cc_single_mod=no - output_verbose_link_cmd='echo' - if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then - lt_int_apple_cc_single_mod=yes - fi - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - else - archive_cmds_CXX='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - fi - module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - fi - module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - case $cc_basename in - xlc*) - output_verbose_link_cmd='echo' - archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' - module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - ;; - *) - ld_shlibs_CXX=no - ;; - esac - fi - ;; - dgux*) - case $cc_basename in - ec++*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - ghcx*) - # Green Hills C++ Compiler - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - freebsd[12]*) - # C++ shared libraries reported to be fairly broken before switch to ELF - ld_shlibs_CXX=no - ;; - freebsd-elf*) - archive_cmds_need_lc_CXX=no - ;; - freebsd* | kfreebsd*-gnu | dragonfly*) - # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF - # conventions - ld_shlibs_CXX=yes - ;; - gnu*) - ;; - hpux9*) - hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_CXX=: - export_dynamic_flag_spec_CXX='${wl}-E' - hardcode_direct_CXX=yes - hardcode_minus_L_CXX=yes # Not in the search PATH, - # but as the default - # location of the library. - - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - aCC*) - archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes; then - archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - fi - ;; - esac - ;; - hpux10*|hpux11*) - if test $with_gnu_ld = no; then - hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_CXX=: +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 + ;; - case $host_cpu in - hppa*64*|ia64*) - hardcode_libdir_flag_spec_ld_CXX='+b $libdir' - ;; - *) - export_dynamic_flag_spec_CXX='${wl}-E' - ;; - esac - fi - case $host_cpu in - hppa*64*|ia64*) - hardcode_direct_CXX=no - hardcode_shlibpath_var_CXX=no - ;; - *) - hardcode_direct_CXX=yes - hardcode_minus_L_CXX=yes # Not in the search PATH, - # but as the default - # location of the library. - ;; - esac +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - aCC*) - case $host_cpu in - hppa*64*) - archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - ia64*) - archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - *) - archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes; then - if test $with_gnu_ld = no; then - case $host_cpu in - hppa*64*) - archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - ia64*) - archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - *) - archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - fi - else - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - fi - ;; - esac - ;; - interix3*) - hardcode_direct_CXX=no - hardcode_shlibpath_var_CXX=no - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - export_dynamic_flag_spec_CXX='${wl}-E' - # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. - # Instead, shared libraries are loaded at an image base (0x10000000 by - # default) and relocated if they conflict, which is a slow very memory - # consuming and fragmenting process. To avoid this, we pick a random, - # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link - # time. Moving up from 0x10000000 also allows more sbrk(2) space. - archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - ;; - irix5* | irix6*) - case $cc_basename in - CC*) - # SGI C++ - archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - - # Archives containing C++ object files must be created using - # "CC -ar", where "CC" is the IRIX C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' +*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 ;; *) - if test "$GXX" = yes; then - if test "$with_gnu_ld" = no; then - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' - fi - fi - link_all_deplibs_CXX=yes - ;; - esac - hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_CXX=: - ;; - linux*) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - - hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-dynamic' - - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' - ;; - icpc*) - # Intel C++ - with_gnu_ld=yes - # version 8.0 and above of icpc choke on multiply defined symbols - # if we add $predep_objects and $postdep_objects, however 7.1 and - # earlier do not add the objects themselves. - case `$CC -V 2>&1` in - *"Version 7."*) - archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - ;; - *) # Version 8.0 or newer - tmp_idyn= - case $host_cpu in - ia64*) tmp_idyn=' -i_dynamic';; - esac - archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - ;; - esac - archive_cmds_need_lc_CXX=no - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-dynamic' - whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + shlibpath_overrides_runpath=yes ;; - pgCC*) - # Portland Group C++ compiler - archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' - - hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-dynamic' - whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - ;; - cxx*) - # Compaq C++ - archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + esac + else + shlibpath_overrides_runpath=yes + fi + ;; - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec_CXX='-rpath $libdir' - hardcode_libdir_separator_CXX=: +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 + ;; - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - esac - ;; - lynxos*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - m88k*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - mvs*) - case $cc_basename in - cxx*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' - wlarc= - hardcode_libdir_flag_spec_CXX='-R$libdir' - hardcode_direct_CXX=yes - hardcode_shlibpath_var_CXX=no - fi - # Workaround some broken pre-1.5 toolchains - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' - ;; - openbsd2*) - # C++ shared libraries are fairly broken - ld_shlibs_CXX=no - ;; - openbsd*) - hardcode_direct_CXX=yes - hardcode_shlibpath_var_CXX=no - archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' - export_dynamic_flag_spec_CXX='${wl}-E' - whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - fi - output_verbose_link_cmd='echo' - ;; - osf3*) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' +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" + ;; - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - hardcode_libdir_separator_CXX=: +rdos*) + dynamic_linker=no + ;; - # 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' +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; - ;; - RCC*) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - cxx*) - allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - - hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_CXX=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' +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 + ;; - hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_CXX=: +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + 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 + ;; - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; - else - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - 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 - ;; - 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' + fi + sys_lib_dlsearch_path_spec='/usr/lib' + ;; - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - hardcode_libdir_separator_CXX=: +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux + need_lib_prefix=no + need_version=no + library_name_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 + ;; - # Archives containing C++ object files must be created using - # the KAI C++ compiler. - old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' - ;; - RCC*) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - cxx*) - allow_undefined_flag_CXX=' -expect_unresolved \*' - archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ - echo "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ - $rm $lib.exp' - - hardcode_libdir_flag_spec_CXX='-rpath $libdir' - hardcode_libdir_separator_CXX=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; - hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_CXX=: +*) + 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 - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' +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 - else - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - fi - ;; - esac - ;; - psos*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - lcc*) - # Lucid - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - solaris*) - case $cc_basename in - CC*) - # Sun C++ 4.2, 5.x and Centerline C++ - archive_cmds_need_lc_CXX=yes - no_undefined_flag_CXX=' -zdefs' - archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - hardcode_libdir_flag_spec_CXX='-R$libdir' - hardcode_shlibpath_var_CXX=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) - # The C++ compiler is used as linker so we must use $wl - # flag to pass the commands to the underlying system - # linker. We must also pass each convience library through - # to the system linker between allextract/defaultextract. - # The C++ compiler will combine linker options so we - # cannot just pass the convience library names through - # without $wl. - # Supported since Solaris 2.6 (maybe 2.5.1?) - whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' - ;; - esac - link_all_deplibs_CXX=yes + + + - output_verbose_link_cmd='echo' - # Archives containing C++ object files must be created using - # "CC -xar", where "CC" is the Sun C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' - ;; - gcx*) - # Green Hills C++ Compiler - archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + + + - # The C++ compiler must be used to create the archive. - old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' - ;; - *) - # GNU C++ compiler with Solaris linker - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - no_undefined_flag_CXX=' ${wl}-z ${wl}defs' - if $CC --version | grep -v '^2\.7' > /dev/null; then - archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" - else - # g++ 2.7 appears to require `-G' NOT `-shared' on this - # platform. - archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + + + - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" - fi - hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' - fi - ;; - esac - ;; - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) - no_undefined_flag_CXX='${wl}-z,text' - archive_cmds_need_lc_CXX=no - hardcode_shlibpath_var_CXX=no - runpath_var='LD_RUN_PATH' - - case $cc_basename in - CC*) - archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - ;; - sysv5* | sco3.2v5* | sco5v6*) - # Note: We can NOT use -z defs as we might desire, because we do not - # link with -lc, and that would cause any symbols used from libc to - # always be unresolved, which means just about no library would - # ever link correctly. If we're not using GNU ld we use -z text - # though, which does catch some bad symbols but isn't as heavy-handed - # as -z defs. - # For security reasons, it is highly recommended that you always - # use absolute paths for naming shared libraries, and exclude the - # DT_RUNPATH tag from executables and libraries. But doing so - # requires that you compile everything twice, which is a pain. - # So that behaviour is only enabled if SCOABSPATH is set to a - # non-empty value in the environment. Most likely only useful for - # creating official distributions of packages. - # This is a hack until libtool officially supports absolute path - # names for shared libraries. - no_undefined_flag_CXX='${wl}-z,text' - allow_undefined_flag_CXX='${wl}-z,nodefs' - archive_cmds_need_lc_CXX=no - hardcode_shlibpath_var_CXX=no - hardcode_libdir_flag_spec_CXX='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' - hardcode_libdir_separator_CXX=':' - link_all_deplibs_CXX=yes - export_dynamic_flag_spec_CXX='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - - case $cc_basename in - CC*) - archive_cmds_CXX='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds_CXX='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - ;; - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - vxworks*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; -esac -{ echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 -echo "${ECHO_T}$ld_shlibs_CXX" >&6; } -test "$ld_shlibs_CXX" = no && can_build_shared=no + + + -GCC_CXX="$GXX" -LD_CXX="$LD" + + + -cat > conftest.$ac_ext <&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # Parse the compiler output and extract the necessary - # objects, libraries and library flags. + + + - # Sentinel used to keep track of whether or not we are before - # the conftest object file. - pre_test_object_deps_done=no - # The `*' in the case matches for architectures that use `case' in - # $output_verbose_cmd can trigger glob expansion during the loop - # eval without this substitution. - output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"` + + + - for p in `eval $output_verbose_link_cmd`; do - case $p in - -L* | -R* | -l*) - # Some compilers place space between "-{L,R}" and the path. - # Remove the space. - if test $p = "-L" \ - || test $p = "-R"; then - prev=$p - continue - else - prev= - fi + + + - if test "$pre_test_object_deps_done" = no; then - case $p in - -L* | -R*) - # Internal compiler library paths should come after those - # provided the user. The postdeps already come after the - # user supplied libs so there is no need to process them. - if test -z "$compiler_lib_search_path_CXX"; then - compiler_lib_search_path_CXX="${prev}${p}" - else - compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" - fi - ;; - # The "-l" case would never come before the object being - # linked, so don't bother handling this case. - esac - else - if test -z "$postdeps_CXX"; then - postdeps_CXX="${prev}${p}" - else - postdeps_CXX="${postdeps_CXX} ${prev}${p}" - fi - fi - ;; - *.$objext) - # This assumes that the test object file only shows up - # once in the compiler output. - if test "$p" = "conftest.$objext"; then - pre_test_object_deps_done=yes - continue - fi + + + - if test "$pre_test_object_deps_done" = no; then - if test -z "$predep_objects_CXX"; then - predep_objects_CXX="$p" - else - predep_objects_CXX="$predep_objects_CXX $p" - fi - else - if test -z "$postdep_objects_CXX"; then - postdep_objects_CXX="$p" - else - postdep_objects_CXX="$postdep_objects_CXX $p" - fi - fi - ;; - *) ;; # Ignore the rest. + + + - esac - done - # Clean up. - rm -f a.out a.exe -else - echo "libtool.m4: error: problem compiling CXX test program" -fi + + + -$rm -f confest.$objext -# PORTME: override above test on systems where it is broken -case $host_os in -interix3*) - # Interix 3.5 installs completely hosed .la files for C++, so rather than - # hack all around it, let's just trust "g++" to DTRT. - predep_objects_CXX= - postdep_objects_CXX= - postdeps_CXX= - ;; + + + -solaris*) - case $cc_basename in - CC*) - # Adding this requires a known-good setup of shared libraries for - # Sun compiler versions before 5.6, else PIC objects from an old - # archive will be linked into the output, leading to subtle bugs. - postdeps_CXX='-lCstd -lCrun' - ;; - esac - ;; -esac + + + -case " $postdeps_CXX " in -*" -lc "*) archive_cmds_need_lc_CXX=no ;; -esac -lt_prog_compiler_wl_CXX= -lt_prog_compiler_pic_CXX= -lt_prog_compiler_static_CXX= + + + -{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 -echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } - - # C++ specific cases for pic, static, wl, etc. - if test "$GXX" = yes; then - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX='-static' - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_CXX='-Bstatic' - fi - ;; - amigaos*) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' - ;; - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - mingw* | os2* | pw32*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic_CXX='-DDLL_EXPORT' - ;; - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic_CXX='-fno-common' - ;; - *djgpp*) - # DJGPP does not support shared libraries at all - lt_prog_compiler_pic_CXX= - ;; - interix3*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. - ;; - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic_CXX=-Kconform_pic - fi - ;; - hpux*) - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - ;; - *) - lt_prog_compiler_pic_CXX='-fPIC' - ;; - esac - ;; - *) - lt_prog_compiler_pic_CXX='-fPIC' - ;; - esac - else - case $host_os in - aix4* | aix5*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_CXX='-Bstatic' - else - lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' - fi - ;; - chorus*) - case $cc_basename in - cxch68*) - # Green Hills C++ Compiler - # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" - ;; - esac - ;; - darwin*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - case $cc_basename in - xlc*) - lt_prog_compiler_pic_CXX='-qnocommon' - lt_prog_compiler_wl_CXX='-Wl,' - ;; - esac - ;; - dgux*) - case $cc_basename in - ec++*) - lt_prog_compiler_pic_CXX='-KPIC' - ;; - ghcx*) - # Green Hills C++ Compiler - lt_prog_compiler_pic_CXX='-pic' - ;; - *) - ;; - esac - ;; - freebsd* | kfreebsd*-gnu | dragonfly*) - # FreeBSD uses GNU C++ - ;; - hpux9* | hpux10* | hpux11*) - case $cc_basename in - CC*) - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' - if test "$host_cpu" != ia64; then - lt_prog_compiler_pic_CXX='+Z' - fi - ;; - aCC*) - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic_CXX='+Z' - ;; - esac - ;; - *) - ;; - esac - ;; - interix*) - # This is c89, which is MS Visual C++ (no shared libs) - # Anyone wants to do a port? - ;; - irix5* | irix6* | nonstopux*) - case $cc_basename in - CC*) - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX='-non_shared' - # CC pic flag -KPIC is the default. - ;; - *) - ;; - esac - ;; - linux*) - case $cc_basename in - KCC*) - # KAI C++ Compiler - lt_prog_compiler_wl_CXX='--backend -Wl,' - lt_prog_compiler_pic_CXX='-fPIC' - ;; - icpc* | ecpc*) - # Intel C++ - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_pic_CXX='-KPIC' - lt_prog_compiler_static_CXX='-static' - ;; - pgCC*) - # Portland Group C++ compiler. - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_pic_CXX='-fpic' - lt_prog_compiler_static_CXX='-Bstatic' - ;; - cxx*) - # Compaq C++ - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - lt_prog_compiler_pic_CXX= - lt_prog_compiler_static_CXX='-non_shared' - ;; - *) - ;; - esac - ;; - lynxos*) - ;; - m88k*) - ;; - mvs*) - case $cc_basename in - cxx*) - lt_prog_compiler_pic_CXX='-W c,exportall' - ;; - *) - ;; - esac - ;; - netbsd*) - ;; - osf3* | osf4* | osf5*) - case $cc_basename in - KCC*) - lt_prog_compiler_wl_CXX='--backend -Wl,' - ;; - RCC*) - # Rational C++ 2.4.1 - lt_prog_compiler_pic_CXX='-pic' - ;; - cxx*) - # Digital/Compaq C++ - lt_prog_compiler_wl_CXX='-Wl,' - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - lt_prog_compiler_pic_CXX= - lt_prog_compiler_static_CXX='-non_shared' - ;; - *) - ;; - esac - ;; - psos*) - ;; - solaris*) - case $cc_basename in - CC*) - # Sun C++ 4.2, 5.x and Centerline C++ - lt_prog_compiler_pic_CXX='-KPIC' - lt_prog_compiler_static_CXX='-Bstatic' - lt_prog_compiler_wl_CXX='-Qoption ld ' - ;; - gcx*) - # Green Hills C++ Compiler - lt_prog_compiler_pic_CXX='-PIC' - ;; - *) - ;; - esac - ;; - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - lt_prog_compiler_pic_CXX='-pic' - lt_prog_compiler_static_CXX='-Bstatic' - ;; - lcc*) - # Lucid - lt_prog_compiler_pic_CXX='-pic' - ;; - *) - ;; - esac - ;; - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - lt_prog_compiler_pic_CXX='-KPIC' - ;; - *) - ;; - esac - ;; - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - case $cc_basename in - CC*) - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_pic_CXX='-KPIC' - lt_prog_compiler_static_CXX='-Bstatic' - ;; - esac - ;; - vxworks*) - ;; - *) - lt_prog_compiler_can_build_shared_CXX=no - ;; - esac - fi - -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6; } - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$lt_prog_compiler_pic_CXX"; then - -{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 -echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6; } -if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_pic_works_CXX=no - ac_outfile=conftest.$ac_objext - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:__oline__: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_pic_works_CXX=yes - fi - fi - $rm conftest* - -fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6; } - -if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then - case $lt_prog_compiler_pic_CXX in - "" | " "*) ;; - *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; - esac -else - lt_prog_compiler_pic_CXX= - lt_prog_compiler_can_build_shared_CXX=no -fi - -fi -case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - lt_prog_compiler_pic_CXX= - ;; - *) - lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" - ;; -esac - -# -# Check to make sure the static flag actually works. -# -wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" -{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } -if test "${lt_prog_compiler_static_works_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_static_works_CXX=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $lt_tmp_static_flag" - printf "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The linker can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&5 - $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_static_works_CXX=yes - fi - else - lt_prog_compiler_static_works_CXX=yes - fi - fi - $rm conftest* - LDFLAGS="$save_LDFLAGS" - -fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_CXX" >&5 -echo "${ECHO_T}$lt_prog_compiler_static_works_CXX" >&6; } - -if test x"$lt_prog_compiler_static_works_CXX" = xyes; then - : -else - lt_prog_compiler_static_CXX= -fi - - -{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 -echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } -if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_prog_compiler_c_o_CXX=no - $rm -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:__oline__: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp - $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then - lt_cv_prog_compiler_c_o_CXX=yes - fi - fi - chmod u+w . 2>&5 - $rm conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files - $rm out/* && rmdir out - cd .. - rmdir conftest - $rm conftest* - -fi -{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6; } - - -hard_links="nottested" -if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 -echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } - hard_links=yes - $rm conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - { echo "$as_me:$LINENO: result: $hard_links" >&5 -echo "${ECHO_T}$hard_links" >&6; } - if test "$hard_links" = no; then - { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} - need_locks=warn - fi -else - need_locks=no -fi - -{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } - - export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - case $host_os in - aix4* | aix5*) - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - if $NM -V 2>&1 | grep 'GNU' > /dev/null; then - export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - else - export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - fi - ;; - pw32*) - export_symbols_cmds_CXX="$ltdll_cmds" - ;; - cygwin* | mingw*) - export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([^ ]*\) [^ ]*/\1 DATA/;/^I /d;/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' - ;; - *) - export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - ;; - esac - -{ echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 -echo "${ECHO_T}$ld_shlibs_CXX" >&6; } -test "$ld_shlibs_CXX" = no && can_build_shared=no - -# -# Do we need to explicitly link libc? -# -case "x$archive_cmds_need_lc_CXX" in -x|xyes) - # Assume -lc should be added - archive_cmds_need_lc_CXX=yes - - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $archive_cmds_CXX in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 -echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } - $rm conftest* - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl_CXX - pic_flag=$lt_prog_compiler_pic_CXX - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag_CXX - allow_undefined_flag_CXX= - if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 - (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - then - archive_cmds_need_lc_CXX=no - else - archive_cmds_need_lc_CXX=yes - fi - allow_undefined_flag_CXX=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $rm conftest* - { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5 -echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6; } - ;; - esac - fi - ;; -esac - -{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 -echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } -library_names_spec= -libname_spec='lib$name' -soname_spec= -shrext_cmds=".so" -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi -need_lib_prefix=unknown -hardcode_into_libs=no - -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown - -case $host_os in -aix3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' - shlibpath_var=LIBPATH - - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' - ;; - -aix4* | aix5*) - version_type=linux - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test "$host_cpu" = ia64; then - # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - aix4 | aix4.[01] | aix4.[01].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; - esac - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then - # If using run time linking (on AIX 4.2 or later) use lib.so - # instead of lib.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - else - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}${shared_ext}$major' - fi - shlibpath_var=LIBPATH - fi - ;; - -amigaos*) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' - ;; - -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; - -bsdi[45]*) - version_type=linux - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; - -cygwin* | mingw* | pw32*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no - - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32*) - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname~ - chmod a+x \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $rm \$dlpath' - shlibpath_overrides_runpath=yes - - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" - ;; - mingw*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - ;; - esac - ;; - - *) - library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' - ;; - esac - dynamic_linker='Win32 ld.exe' - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; - -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' - soname_spec='${libname}${release}${major}$shared_ext' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' - # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. - if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` - else - sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' - fi - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -freebsd1*) - dynamic_linker=no - ;; - -kfreebsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='GNU ld.so' - ;; - -freebsd* | dragonfly*) - # DragonFly does not have aout. When/if they implement a new - # versioning mechanism, adjust this. - if test -x /usr/bin/objformat; then - objformat=`/usr/bin/objformat` - else - case $host_os in - freebsd[123]*) objformat=aout ;; - *) objformat=elf ;; - esac - fi - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2*) - shlibpath_overrides_runpath=yes - ;; - freebsd3.[01]* | freebsdelf3.[01]*) - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ - freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - freebsd*) # from 4.6 on - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - esac - ;; - -gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - hardcode_into_libs=yes - ;; - -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - version_type=sunos - need_lib_prefix=no - need_version=no - case $host_cpu in - ia64*) - shrext_cmds='.so' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.so" - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - if test "X$HPUX_IA64_MODE" = X32; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - hppa*64*) - shrext_cmds='.sl' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.sl" - shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - *) - shrext_cmds='.sl' - dynamic_linker="$host_os dld.sl" - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - ;; - esac - # HP-UX runs *really* slowly unless shared libraries are mode 555. - postinstall_cmds='chmod 555 $lib' - ;; - -interix3*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -irix5* | irix6* | nonstopux*) - case $host_os in - nonstopux*) version_type=nonstopux ;; - *) - if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux - else - version_type=irix - fi ;; - esac - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' - case $host_os in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" - hardcode_into_libs=yes - ;; - -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no - ;; - -# This must be Linux ELF. -linux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - - # find out which ABI we are using - libsuff= - case "$host_cpu" in - x86_64*|s390x*|powerpc64*) - echo '#line __oline__ "configure"' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - case `/usr/bin/file conftest.$ac_objext` in - *64-bit*) - libsuff=64 - sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" - ;; - esac - fi - rm -rf conftest* - ;; - esac - - # Append ld.so.conf contents to the search path - if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" - fi - - # We used to test for /lib/ld.so.1 and disable shared libraries on - # powerpc, because MkLinux only supported shared libraries with the - # GNU dynamic linker. Since this was broken with cross compilers, - # most powerpc-linux boxes support dynamic linking these days and - # people can always --disable-shared, the test was removed, and we - # assume the GNU/Linux dynamic linker is in use. - dynamic_linker='GNU/Linux ld.so' - ;; - -knetbsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='GNU ld.so' - ;; - -netbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - -newsos6) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -nto-qnx*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; - -openbsd*) - version_type=sunos - sys_lib_dlsearch_path_spec="/usr/lib" - need_lib_prefix=no - # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. - case $host_os in - openbsd3.3 | openbsd3.3.*) need_version=yes ;; - *) need_version=no ;; - esac - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - case $host_os in - openbsd2.[89] | openbsd2.[89].*) - shlibpath_overrides_runpath=no - ;; - *) - shlibpath_overrides_runpath=yes - ;; - esac - else - shlibpath_overrides_runpath=yes - fi - ;; - -os2*) - libname_spec='$name' - shrext_cmds=".dll" - need_lib_prefix=no - library_names_spec='$libname${shared_ext} $libname.a' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH - ;; - -osf3* | osf4* | osf5*) - version_type=osf - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" - ;; - -solaris*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; - -sunos4*) - version_type=sunos - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - if test "$with_gnu_ld" = yes; then - need_lib_prefix=no - fi - need_version=yes - ;; - -sysv4 | sysv4.3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - export_dynamic_flag_spec='${wl}-Blargedynsym' - runpath_var=LD_RUN_PATH - ;; - siemens) - need_lib_prefix=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; - -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux - library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - version_type=freebsd-elf - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - hardcode_into_libs=yes - if test "$with_gnu_ld" = yes; then - sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' - shlibpath_overrides_runpath=no - else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - shlibpath_overrides_runpath=yes - case $host_os in - sco3.2v5*) - sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" - ;; - esac - fi - sys_lib_dlsearch_path_spec='/usr/lib' - ;; - -uts4*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -*) - dynamic_linker=no - ;; -esac -{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5 -echo "${ECHO_T}$dynamic_linker" >&6; } -test "$dynamic_linker" = no && can_build_shared=no - -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi - -{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 -echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } -hardcode_action_CXX= -if test -n "$hardcode_libdir_flag_spec_CXX" || \ - test -n "$runpath_var_CXX" || \ - test "X$hardcode_automatic_CXX" = "Xyes" ; then - - # We can hardcode non-existant directories. - if test "$hardcode_direct_CXX" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no && - test "$hardcode_minus_L_CXX" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action_CXX=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action_CXX=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action_CXX=unsupported -fi -{ echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5 -echo "${ECHO_T}$hardcode_action_CXX" >&6; } - -if test "$hardcode_action_CXX" = relink; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi - - -# The else clause should only fire when bootstrapping the -# libtool distribution, otherwise you forgot to ship ltmain.sh -# with your package, and you will get complaints that there are -# no rules to generate ltmain.sh. -if test -f "$ltmain"; then - # See if we are running on zsh, and set the options which allow our commands through - # without removal of \ escapes. - if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST - fi - # Now quote all the things that may contain metacharacters while being - # careful not to overquote the AC_SUBSTed values. We take copies of the - # variables and quote the copies for generation of the libtool script. - for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ - SED SHELL STRIP \ - libname_spec library_names_spec soname_spec extract_expsyms_cmds \ - old_striplib striplib file_magic_cmd finish_cmds finish_eval \ - deplibs_check_method reload_flag reload_cmds need_locks \ - lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ - lt_cv_sys_global_symbol_to_c_name_address \ - sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ - old_postinstall_cmds old_postuninstall_cmds \ - compiler_CXX \ - CC_CXX \ - LD_CXX \ - lt_prog_compiler_wl_CXX \ - lt_prog_compiler_pic_CXX \ - lt_prog_compiler_static_CXX \ - lt_prog_compiler_no_builtin_flag_CXX \ - export_dynamic_flag_spec_CXX \ - thread_safe_flag_spec_CXX \ - whole_archive_flag_spec_CXX \ - enable_shared_with_static_runtimes_CXX \ - old_archive_cmds_CXX \ - old_archive_from_new_cmds_CXX \ - predep_objects_CXX \ - postdep_objects_CXX \ - predeps_CXX \ - postdeps_CXX \ - compiler_lib_search_path_CXX \ - archive_cmds_CXX \ - archive_expsym_cmds_CXX \ - postinstall_cmds_CXX \ - postuninstall_cmds_CXX \ - old_archive_from_expsyms_cmds_CXX \ - allow_undefined_flag_CXX \ - no_undefined_flag_CXX \ - export_symbols_cmds_CXX \ - hardcode_libdir_flag_spec_CXX \ - hardcode_libdir_flag_spec_ld_CXX \ - hardcode_libdir_separator_CXX \ - hardcode_automatic_CXX \ - module_cmds_CXX \ - module_expsym_cmds_CXX \ - lt_cv_prog_compiler_c_o_CXX \ - exclude_expsyms_CXX \ - include_expsyms_CXX; do - - case $var in - old_archive_cmds_CXX | \ - old_archive_from_new_cmds_CXX | \ - archive_cmds_CXX | \ - archive_expsym_cmds_CXX | \ - module_cmds_CXX | \ - module_expsym_cmds_CXX | \ - old_archive_from_expsyms_cmds_CXX | \ - export_symbols_cmds_CXX | \ - extract_expsyms_cmds | reload_cmds | finish_cmds | \ - postinstall_cmds | postuninstall_cmds | \ - old_postinstall_cmds | old_postuninstall_cmds | \ - sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) - # Double-quote double-evaled strings. - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" - ;; - *) - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" - ;; - esac - done - - case $lt_echo in - *'\$0 --fallback-echo"') - lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` - ;; - esac - -cfgfile="$ofile" - - cat <<__EOF__ >> "$cfgfile" -# ### BEGIN LIBTOOL TAG CONFIG: $tagname - -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: - -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared - -# Whether or not to build static libraries. -build_old_libs=$enable_static - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$archive_cmds_need_lc_CXX - -# Whether or not to disallow shared libs when runtime libs are static -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX - -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install - -# The host system. -host_alias=$host_alias -host=$host -host_os=$host_os - -# The build system. -build_alias=$build_alias -build=$build -build_os=$build_os - -# An echo program that does not interpret backslashes. -echo=$lt_echo - -# The archiver. -AR=$lt_AR -AR_FLAGS=$lt_AR_FLAGS - -# A C compiler. -LTCC=$lt_LTCC - -# LTCC compiler flags. -LTCFLAGS=$lt_LTCFLAGS - -# A language-specific compiler. -CC=$lt_compiler_CXX - -# Is the compiler the GNU C compiler? -with_gcc=$GCC_CXX - -gcc_dir=\`$CC -print-file-name=. | $SED 's,/\.$,,'\` -gcc_ver=\`$CC -dumpversion\` - -# An ERE matcher. -EGREP=$lt_EGREP - -# The linker used to build libraries. -LD=$lt_LD_CXX - -# Whether we need hard or soft links. -LN_S=$lt_LN_S - -# A BSD-compatible nm program. -NM=$lt_NM - -# A symbol stripping program -STRIP=$lt_STRIP - -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=$MAGIC_CMD - -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" - -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" - -# Used on cygwin: assembler. -AS="$AS" - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl_CXX - -# Object file suffix (normally "o"). -objext="$ac_objext" - -# Old archive suffix (normally "a"). -libext="$libext" - -# Shared library suffix (normally ".so"). -shrext_cmds='$shrext_cmds' - -# Executable file suffix (normally ""). -exeext="$exeext" - -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic_CXX -pic_mode=$pic_mode - -# What is the maximum length of a command? -max_cmd_len=$lt_cv_sys_max_cmd_len - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX - -# Must we lock files when doing compilation? -need_locks=$lt_need_locks - -# Do we need the lib prefix for modules? -need_lib_prefix=$need_lib_prefix - -# Do we need a version for libraries? -need_version=$need_version - -# Whether dlopen is supported. -dlopen_support=$enable_dlopen - -# Whether dlopen of programs is supported. -dlopen_self=$enable_dlopen_self - -# Whether dlopen of statically linked programs is supported. -dlopen_self_static=$enable_dlopen_self_static - -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_lt_prog_compiler_static_CXX - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX - -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX - -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX - -# Library versioning type. -version_type=$version_type - -# Format of library name prefix. -libname_spec=$lt_libname_spec - -# List of archive names. First name is the real one, the rest are links. -# The last name is the one that the linker finds with -lNAME. -library_names_spec=$lt_library_names_spec - -# The coded name of the library, if different from the real name. -soname_spec=$lt_soname_spec - -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_old_archive_cmds_CXX -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds - -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX - -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX - -# Commands used to build and install a shared archive. -archive_cmds=$lt_archive_cmds_CXX -archive_expsym_cmds=$lt_archive_expsym_cmds_CXX -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds - -# Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_module_cmds_CXX -module_expsym_cmds=$lt_module_expsym_cmds_CXX - -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib - -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects=\`echo $lt_predep_objects_CXX | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` - -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects=\`echo $lt_postdep_objects_CXX | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` - -# Dependencies to place before the objects being linked to create a -# shared library. -predeps=$lt_predeps_CXX - -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_postdeps_CXX - -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_CXX | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` - -# Method to check whether dependent libraries are shared objects. -deplibs_check_method=$lt_deplibs_check_method - -# Command to use when deplibs_check_method == file_magic. -file_magic_cmd=$lt_file_magic_cmd - -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag_CXX - -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag_CXX - -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds - -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$lt_finish_eval - -# Take the output of nm and produce a listing of raw symbols and C names. -global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe - -# Transform the output of nm in a proper C declaration -global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl - -# Transform the output of nm in a C name address pair -global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address - -# This is the shared library runtime path variable. -runpath_var=$runpath_var - -# This is the shared library path variable. -shlibpath_var=$shlibpath_var - -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath - -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action_CXX - -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs - -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX - -# If ld is used when linking, flag to hardcode \$libdir into -# a binary during linking. This must work even if \$libdir does -# not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX - -# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$hardcode_direct_CXX - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$hardcode_minus_L_CXX - -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX - -# Set to yes if building a shared library automatically hardcodes DIR into the library -# and all subsequent libraries and executables linked against it. -hardcode_automatic=$hardcode_automatic_CXX - -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" - -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs_CXX - -# Compile-time system search path for libraries -sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` - -# Run-time system search path for libraries -sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec - -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$fix_srcfile_path_CXX" - -# Set to yes if exported symbols are required. -always_export_symbols=$always_export_symbols_CXX - -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds_CXX - -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds - -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms_CXX - -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms_CXX - -# ### END LIBTOOL TAG CONFIG: $tagname - -__EOF__ - - -else - # If there is no Makefile yet, we rely on a make rule to execute - # `config.status --recheck' to rerun these tests and create the - # libtool script then. - ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` - if test -f "$ltmain_in"; then - test -f Makefile && make "$ltmain" - fi -fi - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -CC=$lt_save_CC -LDCXX=$LD -LD=$lt_save_LD -GCC=$lt_save_GCC -with_gnu_ldcxx=$with_gnu_ld -with_gnu_ld=$lt_save_with_gnu_ld -lt_cv_path_LDCXX=$lt_cv_path_LD -lt_cv_path_LD=$lt_save_path_LD -lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld -lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld - - else - tagname="" - fi - ;; - - F77) - if test -n "$F77" && test "X$F77" != "Xno"; then - -ac_ext=f -ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' -ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_f77_compiler_gnu - - -archive_cmds_need_lc_F77=no -allow_undefined_flag_F77= -always_export_symbols_F77=no -archive_expsym_cmds_F77= -export_dynamic_flag_spec_F77= -hardcode_direct_F77=no -hardcode_libdir_flag_spec_F77= -hardcode_libdir_flag_spec_ld_F77= -hardcode_libdir_separator_F77= -hardcode_minus_L_F77=no -hardcode_automatic_F77=no -module_cmds_F77= -module_expsym_cmds_F77= -link_all_deplibs_F77=unknown -old_archive_cmds_F77=$old_archive_cmds -no_undefined_flag_F77= -whole_archive_flag_spec_F77= -enable_shared_with_static_runtimes_F77=no - -# Source file extension for f77 test sources. -ac_ext=f - -# Object file extension for compiled f77 test sources. -objext=o -objext_F77=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code=" subroutine t\n return\n end\n" - -# Code to be used in simple link tests -lt_simple_link_test_code=" program t\n end\n" - -# ltmain only uses $CC for tagged configurations so make sure $CC is set. - -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} - -# Allow CC to be a program name with arguments. -compiler=$CC - - -# save warnings/boilerplate of simple test code -ac_outfile=conftest.$ac_objext -printf "$lt_simple_compile_test_code" >conftest.$ac_ext -eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_compiler_boilerplate=`cat conftest.err` -$rm conftest* - -ac_outfile=conftest.$ac_objext -printf "$lt_simple_link_test_code" >conftest.$ac_ext -eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_linker_boilerplate=`cat conftest.err` -$rm conftest* - - -# Allow CC to be a program name with arguments. -lt_save_CC="$CC" -CC=${F77-"f77"} -compiler=$CC -compiler_F77=$CC -for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` - - -{ echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 -echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; } -{ echo "$as_me:$LINENO: result: $can_build_shared" >&5 -echo "${ECHO_T}$can_build_shared" >&6; } - -{ echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 -echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6; } -test "$can_build_shared" = "no" && enable_shared=no - -# On AIX, shared libraries and static libraries use the same namespace, and -# are all built from PIC. -case $host_os in -aix3*) - test "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; -aix4* | aix5*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - fi - ;; -esac -{ echo "$as_me:$LINENO: result: $enable_shared" >&5 -echo "${ECHO_T}$enable_shared" >&6; } - -{ echo "$as_me:$LINENO: checking whether to build static libraries" >&5 -echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; } -# Make sure either enable_shared or enable_static is yes. -test "$enable_shared" = yes || enable_static=yes -{ echo "$as_me:$LINENO: result: $enable_static" >&5 -echo "${ECHO_T}$enable_static" >&6; } - -GCC_F77="$G77" -LD_F77="$LD" - -lt_prog_compiler_wl_F77= -lt_prog_compiler_pic_F77= -lt_prog_compiler_static_F77= - -{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 -echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } - - if test "$GCC" = yes; then - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_static_F77='-static' - - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_F77='-Bstatic' - fi - ;; - - amigaos*) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4' - ;; - - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; - - mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic_F77='-DDLL_EXPORT' - ;; - - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic_F77='-fno-common' - ;; - - interix3*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. - ;; - - msdosdjgpp*) - # Just because we use GCC doesn't mean we suddenly get shared libraries - # on systems that don't support them. - lt_prog_compiler_can_build_shared_F77=no - enable_shared=no - ;; - - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic_F77=-Kconform_pic - fi - ;; - - hpux*) - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic_F77='-fPIC' - ;; - esac - ;; - - *) - lt_prog_compiler_pic_F77='-fPIC' - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - lt_prog_compiler_wl_F77='-Wl,' - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_F77='-Bstatic' - else - lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp' - fi - ;; - darwin*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - case $cc_basename in - xlc*) - lt_prog_compiler_pic_F77='-qnocommon' - lt_prog_compiler_wl_F77='-Wl,' - ;; - esac - ;; - - mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic_F77='-DDLL_EXPORT' - ;; - - hpux9* | hpux10* | hpux11*) - lt_prog_compiler_wl_F77='-Wl,' - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic_F77='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - lt_prog_compiler_static_F77='${wl}-a ${wl}archive' - ;; - - irix5* | irix6* | nonstopux*) - lt_prog_compiler_wl_F77='-Wl,' - # PIC (with -KPIC) is the default. - lt_prog_compiler_static_F77='-non_shared' - ;; - - newsos6) - lt_prog_compiler_pic_F77='-KPIC' - lt_prog_compiler_static_F77='-Bstatic' - ;; - - linux*) - case $cc_basename in - icc* | ecc*) - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_pic_F77='-KPIC' - lt_prog_compiler_static_F77='-static' - ;; - pgcc* | pgf77* | pgf90* | pgf95*) - # Portland Group compilers (*not* the Pentium gcc compiler, - # which looks to be a dead project) - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_pic_F77='-fpic' - lt_prog_compiler_static_F77='-Bstatic' - ;; - ccc*) - lt_prog_compiler_wl_F77='-Wl,' - # All Alpha code is PIC. - lt_prog_compiler_static_F77='-non_shared' - ;; - esac - ;; - - osf3* | osf4* | osf5*) - lt_prog_compiler_wl_F77='-Wl,' - # All OSF/1 code is PIC. - lt_prog_compiler_static_F77='-non_shared' - ;; - - solaris*) - lt_prog_compiler_pic_F77='-KPIC' - lt_prog_compiler_static_F77='-Bstatic' - case $cc_basename in - f77* | f90* | f95*) - lt_prog_compiler_wl_F77='-Qoption ld ';; - *) - lt_prog_compiler_wl_F77='-Wl,';; - esac - ;; - - sunos4*) - lt_prog_compiler_wl_F77='-Qoption ld ' - lt_prog_compiler_pic_F77='-PIC' - lt_prog_compiler_static_F77='-Bstatic' - ;; - - sysv4 | sysv4.2uw2* | sysv4.3*) - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_pic_F77='-KPIC' - lt_prog_compiler_static_F77='-Bstatic' - ;; - - sysv4*MP*) - if test -d /usr/nec ;then - lt_prog_compiler_pic_F77='-Kconform_pic' - lt_prog_compiler_static_F77='-Bstatic' - fi - ;; - - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_pic_F77='-KPIC' - lt_prog_compiler_static_F77='-Bstatic' - ;; - - unicos*) - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_can_build_shared_F77=no - ;; - - uts4*) - lt_prog_compiler_pic_F77='-pic' - lt_prog_compiler_static_F77='-Bstatic' - ;; - - *) - lt_prog_compiler_can_build_shared_F77=no - ;; - esac - fi - -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6; } - -# -# Check to make sure the PIC flag actually works. -# -if test -n "$lt_prog_compiler_pic_F77"; then - -{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5 -echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6; } -if test "${lt_prog_compiler_pic_works_F77+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_pic_works_F77=no - ac_outfile=conftest.$ac_objext - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic_F77" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:__oline__: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_pic_works_F77=yes - fi - fi - $rm conftest* - -fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6; } - -if test x"$lt_prog_compiler_pic_works_F77" = xyes; then - case $lt_prog_compiler_pic_F77 in - "" | " "*) ;; - *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;; - esac -else - lt_prog_compiler_pic_F77= - lt_prog_compiler_can_build_shared_F77=no -fi - -fi -case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - lt_prog_compiler_pic_F77= - ;; - *) - lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77" - ;; -esac - -# -# Check to make sure the static flag actually works. -# -wl=$lt_prog_compiler_wl_F77 eval lt_tmp_static_flag=\"$lt_prog_compiler_static_F77\" -{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } -if test "${lt_prog_compiler_static_works_F77+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_static_works_F77=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $lt_tmp_static_flag" - printf "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The linker can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&5 - $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_static_works_F77=yes - fi - else - lt_prog_compiler_static_works_F77=yes - fi - fi - $rm conftest* - LDFLAGS="$save_LDFLAGS" - -fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_F77" >&5 -echo "${ECHO_T}$lt_prog_compiler_static_works_F77" >&6; } - -if test x"$lt_prog_compiler_static_works_F77" = xyes; then - : -else - lt_prog_compiler_static_F77= -fi - - -{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 -echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } -if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_prog_compiler_c_o_F77=no - $rm -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:__oline__: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp - $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then - lt_cv_prog_compiler_c_o_F77=yes - fi - fi - chmod u+w . 2>&5 - $rm conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files - $rm out/* && rmdir out - cd .. - rmdir conftest - $rm conftest* - -fi -{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6; } - - -hard_links="nottested" -if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 -echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } - hard_links=yes - $rm conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - { echo "$as_me:$LINENO: result: $hard_links" >&5 -echo "${ECHO_T}$hard_links" >&6; } - if test "$hard_links" = no; then - { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} - need_locks=warn - fi -else - need_locks=no -fi - -{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } - - runpath_var= - allow_undefined_flag_F77= - enable_shared_with_static_runtimes_F77=no - archive_cmds_F77= - archive_expsym_cmds_F77= - old_archive_From_new_cmds_F77= - old_archive_from_expsyms_cmds_F77= - export_dynamic_flag_spec_F77= - whole_archive_flag_spec_F77= - thread_safe_flag_spec_F77= - hardcode_libdir_flag_spec_F77= - hardcode_libdir_flag_spec_ld_F77= - hardcode_libdir_separator_F77= - hardcode_direct_F77=no - hardcode_minus_L_F77=no - hardcode_shlibpath_var_F77=unsupported - link_all_deplibs_F77=unknown - hardcode_automatic_F77=no - module_cmds_F77= - module_expsym_cmds_F77= - always_export_symbols_F77=no - export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - include_expsyms_F77= - # exclude_expsyms can be an extended regexp of symbols to exclude - # it will be wrapped by ` (' and `)$', so one must not match beginning or - # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', - # as well as any symbol that contains `d'. - exclude_expsyms_F77="_GLOBAL_OFFSET_TABLE_" - # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out - # platforms (ab)use it in PIC code, but their linkers get confused if - # the symbol is explicitly referenced. Since portable code cannot - # rely on this symbol name, it's probably fine to never include it in - # preloaded symbol tables. - extract_expsyms_cmds= - # Just being paranoid about ensuring that cc_basename is set. - for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` - - case $host_os in - cygwin* | mingw* | pw32*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - if test "$GCC" != yes; then - with_gnu_ld=no - fi - ;; - interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) - with_gnu_ld=yes - ;; - openbsd*) - with_gnu_ld=no - ;; - esac - - ld_shlibs_F77=yes - if test "$with_gnu_ld" = yes; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' - - # Set some defaults for GNU ld with shared library support. These - # are reset later if shared libraries are not supported. Putting them - # here allows them to be overridden if necessary. - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir' - export_dynamic_flag_spec_F77='${wl}--export-dynamic' - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec_F77= - fi - supports_anon_versioning=no - case `$LD -v 2>/dev/null` in - *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 - *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... - *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... - *\ 2.11.*) ;; # other 2.11 versions - *) supports_anon_versioning=yes ;; - esac - - # See if GNU ld supports shared libraries. - case $host_os in - aix3* | aix4* | aix5*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - ld_shlibs_F77=no - cat <&2 - -*** Warning: the GNU linker, at least up to release 2.9.1, is reported -*** to be unable to reliably create shared libraries on AIX. -*** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to modify your PATH -*** so that a non-GNU linker is found, and then restart. - -EOF - fi - ;; - - amigaos*) - archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_minus_L_F77=yes - - # Samuel A. Falvo II reports - # that the semantics of dynamic libraries on AmigaOS, at least up - # to version 4, is to share data among multiple programs linked - # with the same dynamic library. Since this doesn't match the - # behavior of shared libraries on other platforms, we can't use - # them. - ld_shlibs_F77=no - ;; - - beos*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag_F77=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - ld_shlibs_F77=no - fi - ;; - - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec_F77='-L$libdir' - allow_undefined_flag_F77=unsupported - always_export_symbols_F77=no - enable_shared_with_static_runtimes_F77=yes - export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' - - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - ld_shlibs_F77=no - fi - ;; - - interix3*) - hardcode_direct_F77=no - hardcode_shlibpath_var_F77=no - hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' - export_dynamic_flag_spec_F77='${wl}-E' - # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. - # Instead, shared libraries are loaded at an image base (0x10000000 by - # default) and relocated if they conflict, which is a slow very memory - # consuming and fragmenting process. To avoid this, we pick a random, - # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link - # time. Moving up from 0x10000000 also allows more sbrk(2) space. - archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - archive_expsym_cmds_F77='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - ;; - - linux*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - tmp_addflag= - case $cc_basename,$host_cpu in - pgcc*) # Portland Group C compiler - whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag' - ;; - pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers - whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag -Mnomain' ;; - ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 - tmp_addflag=' -i_dynamic' ;; - efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 - tmp_addflag=' -i_dynamic -nofor_main' ;; - ifc* | ifort*) # Intel Fortran compiler - tmp_addflag=' -nofor_main' ;; - esac - archive_cmds_F77='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - - if test $supports_anon_versioning = yes; then - archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - $echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - fi - else - ld_shlibs_F77=no - fi - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - fi - ;; - - solaris*) - if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then - ld_shlibs_F77=no - cat <&2 - -*** Warning: The releases 2.8.* of the GNU linker cannot reliably -*** create shared libraries on Solaris systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.9.1 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -EOF - elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs_F77=no - fi - ;; - - sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) - case `$LD -v 2>&1` in - *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) - ld_shlibs_F77=no - cat <<_LT_EOF 1>&2 - -*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not -*** reliably create shared libraries on SCO systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.16.91.0.3 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -_LT_EOF - ;; - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' - archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' - archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' - else - ld_shlibs_F77=no - fi - ;; - esac - ;; - - sunos4*) - archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - hardcode_direct_F77=yes - hardcode_shlibpath_var_F77=no - ;; - - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs_F77=no - fi - ;; - esac - - if test "$ld_shlibs_F77" = no; then - runpath_var= - hardcode_libdir_flag_spec_F77= - export_dynamic_flag_spec_F77= - whole_archive_flag_spec_F77= - fi - else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - allow_undefined_flag_F77=unsupported - always_export_symbols_F77=yes - archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - hardcode_minus_L_F77=yes - if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - hardcode_direct_F77=unsupported - fi - ;; - - aix4* | aix5*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - if $NM -V 2>&1 | grep 'GNU' > /dev/null; then - export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - else - export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - fi - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[23]|aix4.[23].*|aix5*) - for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then - aix_use_runtimelinking=yes - break - fi - done - ;; - esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - archive_cmds_F77='' - hardcode_direct_F77=yes - hardcode_libdir_separator_F77=':' - link_all_deplibs_F77=yes - - if test "$GCC" = yes; then - case $host_os in aix4.[012]|aix4.[012].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && \ - strings "$collect2name" | grep resolve_lib_name >/dev/null - then - # We have reworked collect2 - hardcode_direct_F77=yes - else - # We have old collect2 - hardcode_direct_F77=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - hardcode_minus_L_F77=yes - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_libdir_separator_F77= - fi - ;; - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - always_export_symbols_F77=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - allow_undefined_flag_F77='-berok' - # Determine the default libpath from the value encoded in an empty executable. - cat >conftest.$ac_ext <<_ACEOF - program main - - end -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (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_f77_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - - hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag_F77="-z nodefs" - archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an empty executable. - cat >conftest.$ac_ext <<_ACEOF - program main - - end -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (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_f77_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - - hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - no_undefined_flag_F77=' ${wl}-bernotok' - allow_undefined_flag_F77=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec_F77='$convenience' - archive_cmds_need_lc_F77=yes - # This is similar to how AIX traditionally builds its shared libraries. - archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - - amigaos*) - archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_minus_L_F77=yes - # see comment about different semantics on the GNU ld section - ld_shlibs_F77=no - ;; - - bsdi[45]*) - export_dynamic_flag_spec_F77=-rdynamic - ;; - - cygwin* | mingw* | pw32*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - hardcode_libdir_flag_spec_F77=' ' - allow_undefined_flag_F77=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - old_archive_From_new_cmds_F77='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs' - fix_srcfile_path_F77='`cygpath -w "$srcfile"`' - enable_shared_with_static_runtimes_F77=yes - ;; - - darwin* | rhapsody*) - case $host_os in - rhapsody* | darwin1.[012]) - allow_undefined_flag_F77='${wl}-undefined ${wl}suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[012]) - allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - ;; - 10.*) - allow_undefined_flag_F77='${wl}-undefined ${wl}dynamic_lookup' - ;; - esac - fi - ;; - esac - archive_cmds_need_lc_F77=no - hardcode_direct_F77=no - hardcode_automatic_F77=yes - hardcode_shlibpath_var_F77=unsupported - whole_archive_flag_spec_F77='' - link_all_deplibs_F77=yes - if test "$GCC" = yes ; then - output_verbose_link_cmd='echo' - archive_cmds_F77='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - case $cc_basename in - xlc*) - output_verbose_link_cmd='echo' - archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' - module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - ;; - *) - ld_shlibs_F77=no - ;; - esac - fi - ;; - - dgux*) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_shlibpath_var_F77=no - ;; - - freebsd1*) - ld_shlibs_F77=no - ;; - - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor - # support. Future versions do this automatically, but an explicit c++rt0.o - # does not break anything, and helps significantly (at the cost of a little - # extra space). - freebsd2.2*) - archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - hardcode_libdir_flag_spec_F77='-R$libdir' - hardcode_direct_F77=yes - hardcode_shlibpath_var_F77=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) - archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_F77=yes - hardcode_minus_L_F77=yes - hardcode_shlibpath_var_F77=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | kfreebsd*-gnu | dragonfly*) - archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec_F77='-R$libdir' - hardcode_direct_F77=yes - hardcode_shlibpath_var_F77=no - ;; - - hpux9*) - if test "$GCC" = yes; then - archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - archive_cmds_F77='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - fi - hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_F77=: - hardcode_direct_F77=yes - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_F77=yes - export_dynamic_flag_spec_F77='${wl}-E' - ;; - - hpux10*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_F77=: - - hardcode_direct_F77=yes - export_dynamic_flag_spec_F77='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_F77=yes - fi - ;; - - hpux11*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - case $host_cpu in - hppa*64*) - archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - else - case $host_cpu in - hppa*64*) - archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_F77=: - - case $host_cpu in - hppa*64*|ia64*) - hardcode_libdir_flag_spec_ld_F77='+b $libdir' - hardcode_direct_F77=no - hardcode_shlibpath_var_F77=no - ;; - *) - hardcode_direct_F77=yes - export_dynamic_flag_spec_F77='${wl}-E' - - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_F77=yes - ;; - esac - fi - ;; - - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec_ld_F77='-rpath $libdir' - fi - hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_F77=: - link_all_deplibs_F77=yes - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - hardcode_libdir_flag_spec_F77='-R$libdir' - hardcode_direct_F77=yes - hardcode_shlibpath_var_F77=no - ;; - - newsos6) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_F77=yes - hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_F77=: - hardcode_shlibpath_var_F77=no - ;; - - openbsd*) - hardcode_direct_F77=yes - hardcode_shlibpath_var_F77=no - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' - export_dynamic_flag_spec_F77='${wl}-E' - else - case $host_os in - openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) - archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_F77='-R$libdir' - ;; - *) - archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' - ;; - esac - fi - ;; - - os2*) - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_minus_L_F77=yes - allow_undefined_flag_F77=unsupported - archive_cmds_F77='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; - - osf3*) - if test "$GCC" = yes; then - allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - allow_undefined_flag_F77=' -expect_unresolved \*' - archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - fi - hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_F77=: - ;; - - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' - else - allow_undefined_flag_F77=' -expect_unresolved \*' - archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ - $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' - - # Both c and cxx compiler support -rpath directly - hardcode_libdir_flag_spec_F77='-rpath $libdir' - fi - hardcode_libdir_separator_F77=: - ;; - - solaris*) - no_undefined_flag_F77=' -z text' - if test "$GCC" = yes; then - wlarc='${wl}' - archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' - else - wlarc='' - archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' - fi - hardcode_libdir_flag_spec_F77='-R$libdir' - hardcode_shlibpath_var_F77=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) - # The compiler driver will combine linker options so we - # cannot just pass the convience library names through - # without $wl, iff we do not link with $LD. - # Luckily, gcc supports the same syntax we need for Sun Studio. - # Supported since Solaris 2.6 (maybe 2.5.1?) - case $wlarc in - '') - whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;; - *) - whole_archive_flag_spec_F77='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; - esac ;; - esac - link_all_deplibs_F77=yes - ;; - - sunos4*) - if test "x$host_vendor" = xsequent; then - # Use $CC to link under sequent, because it throws in some extra .o - # files that make .init and .fini sections work. - archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_direct_F77=yes - hardcode_minus_L_F77=yes - hardcode_shlibpath_var_F77=no - ;; - - sysv4) - case $host_vendor in - sni) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_F77=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' - reload_cmds_F77='$CC -r -o $output$reload_objs' - hardcode_direct_F77=no - ;; - motorola) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var_F77=no - ;; - - sysv4.3*) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var_F77=no - export_dynamic_flag_spec_F77='-Bexport' - ;; - - sysv4*MP*) - if test -d /usr/nec; then - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var_F77=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ld_shlibs_F77=yes - fi - ;; - - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) - no_undefined_flag_F77='${wl}-z,text' - archive_cmds_need_lc_F77=no - hardcode_shlibpath_var_F77=no - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - archive_cmds_F77='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_F77='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - - sysv5* | sco3.2v5* | sco5v6*) - # Note: We can NOT use -z defs as we might desire, because we do not - # link with -lc, and that would cause any symbols used from libc to - # always be unresolved, which means just about no library would - # ever link correctly. If we're not using GNU ld we use -z text - # though, which does catch some bad symbols but isn't as heavy-handed - # as -z defs. - no_undefined_flag_F77='${wl}-z,text' - allow_undefined_flag_F77='${wl}-z,nodefs' - archive_cmds_need_lc_F77=no - hardcode_shlibpath_var_F77=no - hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' - hardcode_libdir_separator_F77=':' - link_all_deplibs_F77=yes - export_dynamic_flag_spec_F77='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - - if test "$GCC" = yes; then - archive_cmds_F77='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_F77='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; + + + - uts4*) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_shlibpath_var_F77=no - ;; - *) - ld_shlibs_F77=no - ;; - esac - fi + + + -{ echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5 -echo "${ECHO_T}$ld_shlibs_F77" >&6; } -test "$ld_shlibs_F77" = no && can_build_shared=no -# -# Do we need to explicitly link libc? -# -case "x$archive_cmds_need_lc_F77" in -x|xyes) - # Assume -lc should be added - archive_cmds_need_lc_F77=yes + + + - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $archive_cmds_F77 in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 -echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } - $rm conftest* - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl_F77 - pic_flag=$lt_prog_compiler_pic_F77 - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag_F77 - allow_undefined_flag_F77= - if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 - (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - then - archive_cmds_need_lc_F77=no - else - archive_cmds_need_lc_F77=yes - fi - allow_undefined_flag_F77=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $rm conftest* - { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5 -echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6; } - ;; - esac - fi - ;; -esac + { echo "$as_me:$LINENO: checking 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 -{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 -echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } -library_names_spec= -libname_spec='lib$name' -soname_spec= -shrext_cmds=".so" -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + # 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 - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action=immediate fi else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" + # 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 -need_lib_prefix=unknown -hardcode_into_libs=no -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown + + + -case $host_os in -aix3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' - shlibpath_var=LIBPATH - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' - ;; + 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= -aix4* | aix5*) - version_type=linux - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test "$host_cpu" = ia64; then - # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - aix4 | aix4.[01] | aix4.[01].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; - esac - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then - # If using run time linking (on AIX 4.2 or later) use lib.so - # instead of lib.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - else - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}${shared_ext}$major' - fi - shlibpath_var=LIBPATH - fi - ;; + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; -amigaos*) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' - ;; + mingw* | pw32*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; -bsdi[45]*) - version_type=linux - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; + 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. */ -cygwin* | mingw* | pw32*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no +/* 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 - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32*) - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname~ - chmod a+x \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $rm \$dlpath' - shlibpath_overrides_runpath=yes + ac_cv_lib_dl_dlopen=no +fi - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" - ;; - mingw*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - ;; - esac - ;; +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 - *) - library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; - esac - dynamic_linker='Win32 ld.exe' - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' - soname_spec='${libname}${release}${major}$shared_ext' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' - # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. - if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` - else - sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' - fi - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; + *) + { 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 -dgux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; +/* 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. */ -freebsd1*) - dynamic_linker=no - ;; +#ifdef __STDC__ +# include +#else +# include +#endif -kfreebsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='GNU ld.so' - ;; +#undef shl_load -freebsd* | dragonfly*) - # DragonFly does not have aout. When/if they implement a new - # versioning mechanism, adjust this. - if test -x /usr/bin/objformat; then - objformat=`/usr/bin/objformat` - else - case $host_os in - freebsd[123]*) objformat=aout ;; - *) objformat=elf ;; - esac - fi - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2*) - shlibpath_overrides_runpath=yes - ;; - freebsd3.[01]* | freebsdelf3.[01]*) - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ - freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - freebsd*) # from 4.6 on - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - esac - ;; +/* 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 -gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - hardcode_into_libs=yes - ;; +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 -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' - ;; + ac_cv_func_shl_load=no +fi -interix3*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; +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. */ -irix5* | irix6* | nonstopux*) - case $host_os in - nonstopux*) version_type=nonstopux ;; - *) - if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux - else - version_type=irix - fi ;; - esac - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' - case $host_os in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" - hardcode_into_libs=yes - ;; +/* 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 -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no - ;; + ac_cv_lib_dld_shl_load=no +fi -# This must be Linux ELF. -linux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes +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 - # find out which ABI we are using - libsuff= - case "$host_cpu" in - x86_64*|s390x*|powerpc64*) - echo '#line __oline__ "configure"' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - case `/usr/bin/file conftest.$ac_objext` in - *64-bit*) - libsuff=64 - sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" - ;; - esac - fi - rm -rf conftest* - ;; - esac +/* 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. */ - # Append ld.so.conf contents to the search path - if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" - fi +#ifdef __STDC__ +# include +#else +# include +#endif - # 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' - ;; +#undef dlopen -knetbsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='GNU ld.so' - ;; +/* 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 -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 - ;; +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 -newsos6) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; + ac_cv_func_dlopen=no +fi -nto-qnx*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; +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. */ -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 - ;; +/* 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. */ -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 - ;; +/* 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 -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" - ;; + ac_cv_lib_svld_dlopen=no +fi -solaris*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; +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. */ -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 - ;; +/* 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 -sysv4 | sysv4.3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - export_dynamic_flag_spec='${wl}-Blargedynsym' - runpath_var=LD_RUN_PATH - ;; - siemens) - need_lib_prefix=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; + ac_cv_lib_dld_dld_link=no +fi -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux - library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; +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 -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - version_type=freebsd-elf - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - hardcode_into_libs=yes - if test "$with_gnu_ld" = yes; then - sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' - shlibpath_overrides_runpath=no - else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - shlibpath_overrides_runpath=yes - case $host_os in - sco3.2v5*) - sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" - ;; - esac - fi - sys_lib_dlsearch_path_spec='/usr/lib' - ;; + +fi -uts4*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; + +fi -*) - 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 + +fi -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" + fi -{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 -echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } -hardcode_action_F77= -if test -n "$hardcode_libdir_flag_spec_F77" || \ - test -n "$runpath_var_F77" || \ - test "X$hardcode_automatic_F77" = "Xyes" ; then + +fi - # We can hardcode non-existant directories. - if test "$hardcode_direct_F77" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no && - test "$hardcode_minus_L_F77" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action_F77=relink + ;; + esac + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action_F77=immediate + enable_dlopen=no fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action_F77=unsupported -fi -{ echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5 -echo "${ECHO_T}$hardcode_action_F77" >&6; } -if test "$hardcode_action_F77" = relink; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi + 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" -# The else clause should only fire when bootstrapping the -# libtool distribution, otherwise you forgot to ship ltmain.sh -# with your package, and you will get complaints that there are -# no rules to generate ltmain.sh. -if test -f "$ltmain"; then - # See if we are running on zsh, and set the options which allow our commands through - # without removal of \ escapes. - if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST - fi - # Now quote all the things that may contain metacharacters while being - # careful not to overquote the AC_SUBSTed values. We take copies of the - # variables and quote the copies for generation of the libtool script. - for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ - SED SHELL STRIP \ - libname_spec library_names_spec soname_spec extract_expsyms_cmds \ - old_striplib striplib file_magic_cmd finish_cmds finish_eval \ - deplibs_check_method reload_flag reload_cmds need_locks \ - lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ - lt_cv_sys_global_symbol_to_c_name_address \ - sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ - old_postinstall_cmds old_postuninstall_cmds \ - compiler_F77 \ - CC_F77 \ - LD_F77 \ - lt_prog_compiler_wl_F77 \ - lt_prog_compiler_pic_F77 \ - lt_prog_compiler_static_F77 \ - lt_prog_compiler_no_builtin_flag_F77 \ - export_dynamic_flag_spec_F77 \ - thread_safe_flag_spec_F77 \ - whole_archive_flag_spec_F77 \ - enable_shared_with_static_runtimes_F77 \ - old_archive_cmds_F77 \ - old_archive_from_new_cmds_F77 \ - predep_objects_F77 \ - postdep_objects_F77 \ - predeps_F77 \ - postdeps_F77 \ - compiler_lib_search_path_F77 \ - archive_cmds_F77 \ - archive_expsym_cmds_F77 \ - postinstall_cmds_F77 \ - postuninstall_cmds_F77 \ - old_archive_from_expsyms_cmds_F77 \ - allow_undefined_flag_F77 \ - no_undefined_flag_F77 \ - export_symbols_cmds_F77 \ - hardcode_libdir_flag_spec_F77 \ - hardcode_libdir_flag_spec_ld_F77 \ - hardcode_libdir_separator_F77 \ - hardcode_automatic_F77 \ - module_cmds_F77 \ - module_expsym_cmds_F77 \ - lt_cv_prog_compiler_c_o_F77 \ - exclude_expsyms_F77 \ - include_expsyms_F77; do - - case $var in - old_archive_cmds_F77 | \ - old_archive_from_new_cmds_F77 | \ - archive_cmds_F77 | \ - archive_expsym_cmds_F77 | \ - module_cmds_F77 | \ - module_expsym_cmds_F77 | \ - old_archive_from_expsyms_cmds_F77 | \ - export_symbols_cmds_F77 | \ - extract_expsyms_cmds | reload_cmds | finish_cmds | \ - postinstall_cmds | postuninstall_cmds | \ - old_postinstall_cmds | old_postuninstall_cmds | \ - sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) - # Double-quote double-evaled strings. - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" - ;; - *) - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" - ;; - esac - done + { 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 __oline__ "configure" +#include "confdefs.h" - case $lt_echo in - *'\$0 --fallback-echo"') - lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` - ;; - esac +#if HAVE_DLFCN_H +#include +#endif -cfgfile="$ofile" +#include - cat <<__EOF__ >> "$cfgfile" -# ### BEGIN LIBTOOL TAG CONFIG: $tagname +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +/* 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 -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL +#ifdef __cplusplus +extern "C" void exit (int); +#endif -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; -# Whether or not to build static libraries. -build_old_libs=$enable_static + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + else + puts (dlerror ()); -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$archive_cmds_need_lc_F77 + exit (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* -# Whether or not to disallow shared libs when runtime libs are static -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77 + +fi +{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 +echo "${ECHO_T}$lt_cv_dlopen_self" >&6; } -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install + 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 __oline__ "configure" +#include "confdefs.h" -# The host system. -host_alias=$host_alias -host=$host -host_os=$host_os +#if HAVE_DLFCN_H +#include +#endif -# The build system. -build_alias=$build_alias -build=$build -build_os=$build_os +#include -# An echo program that does not interpret backslashes. -echo=$lt_echo +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif -# The archiver. -AR=$lt_AR -AR_FLAGS=$lt_AR_FLAGS +/* 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 -# A C compiler. -LTCC=$lt_LTCC +#ifdef __cplusplus +extern "C" void exit (int); +#endif -# LTCC compiler flags. -LTCFLAGS=$lt_LTCFLAGS +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + else + puts (dlerror ()); -# A language-specific compiler. -CC=$lt_compiler_F77 + exit (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* -# Is the compiler the GNU C compiler? -with_gcc=$GCC_F77 + +fi +{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 +echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6; } + fi -gcc_dir=\`$CC -print-file-name=. | $SED 's,/\.$,,'\` -gcc_ver=\`$CC -dumpversion\` + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac -# An ERE matcher. -EGREP=$lt_EGREP + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac -# The linker used to build libraries. -LD=$lt_LD_F77 + 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 -# Whether we need hard or soft links. -LN_S=$lt_LN_S + + + -# A BSD-compatible nm program. -NM=$lt_NM -# A symbol stripping program -STRIP=$lt_STRIP + + + -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=$MAGIC_CMD -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" + + + -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" -# Used on cygwin: assembler. -AS="$AS" + +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 -# The name of the directory that contains temporary libtool files. -objdir=$objdir + + + -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl_F77 + + + -# Object file suffix (normally "o"). -objext="$ac_objext" -# Old archive suffix (normally "a"). -libext="$libext" -# Shared library suffix (normally ".so"). -shrext_cmds='$shrext_cmds' + # 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; } -# Executable file suffix (normally ""). -exeext="$exeext" + { 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 -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic_F77 -pic_mode=$pic_mode + # 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 + ;; -# What is the maximum length of a command? -max_cmd_len=$lt_cv_sys_max_cmd_len + 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; } -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77 + { 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; } -# Must we lock files when doing compilation? -need_locks=$lt_need_locks + -# Do we need the lib prefix for modules? -need_lib_prefix=$need_lib_prefix -# Do we need a version for libraries? -need_version=$need_version +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 -# Whether dlopen is supported. -dlopen_support=$enable_dlopen +CC="$lt_save_CC" -# Whether dlopen of programs is supported. -dlopen_self=$enable_dlopen_self + +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 -# Whether dlopen of statically linked programs is supported. -dlopen_self_static=$enable_dlopen_self_static +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_flag_spec_ld_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 +no_undefined_flag_CXX= +whole_archive_flag_spec_CXX= +enable_shared_with_static_runtimes_CXX=no -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_lt_prog_compiler_static_F77 +# Source file extension for C++ test sources. +ac_ext=cpp -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77 +# Object file extension for compiled C++ test sources. +objext=o +objext_CXX=$objext -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77 +# 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;" -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77 + # Code to be used in simple link tests + lt_simple_link_test_code='int main(int, char *[]) { return(0); }' -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77 + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + -# Library versioning type. -version_type=$version_type -# Format of library name prefix. -libname_spec=$lt_libname_spec -# List of archive names. First name is the real one, the rest are links. -# The last name is the one that the linker finds with -lNAME. -library_names_spec=$lt_library_names_spec -# The coded name of the library, if different from the real name. -soname_spec=$lt_soname_spec -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_old_archive_cmds_F77 -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77 +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77 +# Allow CC to be a program name with arguments. +compiler=$CC -# Commands used to build and install a shared archive. -archive_cmds=$lt_archive_cmds_F77 -archive_expsym_cmds=$lt_archive_expsym_cmds_F77 -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds -# Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_module_cmds_F77 -module_expsym_cmds=$lt_module_expsym_cmds_F77 + # 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* -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib + 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* -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects=\`echo $lt_predep_objects_F77 | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` - -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects=\`echo $lt_postdep_objects_F77 | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` - -# Dependencies to place before the objects being linked to create a -# shared library. -predeps=$lt_predeps_F77 - -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_postdeps_F77 -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_F77 | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` + # Allow CC to be a program name with arguments. + lt_save_CC=$CC + lt_save_LD=$LD + lt_save_GCC=$GCC + GCC=$GXX + lt_save_with_gnu_ld=$with_gnu_ld + lt_save_path_LD=$lt_cv_path_LD + if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx + else + $as_unset lt_cv_prog_gnu_ld + fi + if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX + else + $as_unset lt_cv_path_LD + fi + test -z "${LDCXX+set}" || LD=$LDCXX + CC=${CXX-"c++"} + compiler=$CC + compiler_CXX=$CC + for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` -# 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 + 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 -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag_F77 + if test "$GXX" = yes; then + # Set up default GNU C++ configuration -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag_F77 + -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds +# 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 -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$lt_finish_eval +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 -# Transform the output of nm in a proper C declaration -global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl -# Transform the output of nm in a C name address pair -global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address -# This is the shared library runtime path variable. -runpath_var=$runpath_var -# This is the shared library path variable. -shlibpath_var=$shlibpath_var -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action_F77 -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test "$with_gnu_ld" = yes; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='${wl}' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | + $GREP 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec_CXX= + fi + else + with_gnu_ld=no + wlarc= -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77 + # 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 -# If ld is used when linking, flag to hardcode \$libdir into -# a binary during linking. This must work even if \$libdir does -# not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77 - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77 - -# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$hardcode_direct_F77 - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$hardcode_minus_L_F77 - -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var_F77 - -# Set to yes if building a shared library automatically hardcodes DIR into the library -# and all subsequent libraries and executables linked against it. -hardcode_automatic=$hardcode_automatic_F77 + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" + else + GXX=no + with_gnu_ld=no + wlarc= + fi -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs_F77 + # 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 -# Compile-time system search path for libraries -sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` + # 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 -# Run-time system search path for libraries -sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$fix_srcfile_path_F77" + # 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 -# Set to yes if exported symbols are required. -always_export_symbols=$always_export_symbols_F77 + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to + # export. + always_export_symbols_CXX=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag_CXX='-berok' + # Determine the default libpath from the value encoded in an empty + # executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds_F77 +int +main () +{ -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds + ; + 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 + } + }' +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 "$aix_libpath"; then + 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 -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms_F77 + +fi -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms_F77 +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi -# ### END LIBTOOL TAG CONFIG: $tagname + hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" -__EOF__ + archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag_CXX="-z nodefs" + archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int +main () +{ -else - # If there is no Makefile yet, we rely on a make rule to execute - # `config.status --recheck' to rerun these tests and create the - # libtool script then. - ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` - if test -f "$ltmain_in"; then - test -f Makefile && make "$ltmain" - fi + ; + 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 + } + }' +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 "$aix_libpath"; then + 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 -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 +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi -CC="$lt_save_CC" + hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag_CXX=' ${wl}-bernotok' + allow_undefined_flag_CXX=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_CXX='$convenience' + archive_cmds_need_lc_CXX=yes + # This is similar to how AIX traditionally builds its shared + # libraries. + archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag_CXX=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else - tagname="" + ld_shlibs_CXX=no fi ;; - GCJ) - if test -n "$GCJ" && test "X$GCJ" != "Xno"; then - + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; -# Source file extension for Java test sources. -ac_ext=java + cygwin* | mingw* | pw32*) + # _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' + allow_undefined_flag_CXX=unsupported + always_export_symbols_CXX=no + enable_shared_with_static_runtimes_CXX=yes + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs_CXX=no + fi + ;; + darwin* | rhapsody*) + + + archive_cmds_need_lc_CXX=no + hardcode_direct_CXX=no + hardcode_automatic_CXX=yes + hardcode_shlibpath_var_CXX=unsupported + whole_archive_flag_spec_CXX='' + link_all_deplibs_CXX=yes + allow_undefined_flag_CXX="$_lt_dar_allow_undefined" + if test "$GCC" = "yes"; then + output_verbose_link_cmd=echo + 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 -# Object file extension for compiled Java test sources. -objext=o -objext_GCJ=$objext + else + ld_shlibs_CXX=no + fi -# Code to be used in simple compile tests -lt_simple_compile_test_code="class foo {}\n" + ;; -# Code to be used in simple link tests -lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n' + 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 + ;; -# ltmain only uses $CC for tagged configurations so make sure $CC is set. + freebsd[12]*) + # C++ shared libraries reported to be fairly broken before + # switch to ELF + ld_shlibs_CXX=no + ;; -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} + freebsd-elf*) + archive_cmds_need_lc_CXX=no + ;; -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + freebsd* | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + ld_shlibs_CXX=yes + ;; -# Allow CC to be a program name with arguments. -compiler=$CC + gnu*) + ;; + hpux9*) + hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_CXX=: + export_dynamic_flag_spec_CXX='${wl}-E' + hardcode_direct_CXX=yes + hardcode_minus_L_CXX=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aCC*) + archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + ;; + *) + if test "$GXX" = yes; then + archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; -# save warnings/boilerplate of simple test code -ac_outfile=conftest.$ac_objext -printf "$lt_simple_compile_test_code" >conftest.$ac_ext -eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_compiler_boilerplate=`cat conftest.err` -$rm conftest* + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_CXX=: -ac_outfile=conftest.$ac_objext -printf "$lt_simple_link_test_code" >conftest.$ac_ext -eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_linker_boilerplate=`cat conftest.err` -$rm conftest* + 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; $ECHO "X$list" | $Xsed' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case $host_cpu in + hppa*64*) + archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; -# Allow CC to be a program name with arguments. -lt_save_CC="$CC" -CC=${GCJ-"gcj"} -compiler=$CC -compiler_GCJ=$CC -for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + 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" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -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) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + + 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 | $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 | $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 | $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 | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + ;; + *) # Version 6 will 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; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + ;; + cxx*) + # Compaq C++ + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec_CXX='-rpath $libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + ;; + xl*) + # 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; $ECHO \"$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='echo' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' + ;; + esac + ;; + esac + ;; -# GCJ did not exist at the time GCC didn't implicitly link libc in. -archive_cmds_need_lc_GCJ=no + lynxos*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; -old_archive_cmds_GCJ=$old_archive_cmds + 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 + ;; -lt_prog_compiler_no_builtin_flag_GCJ= + 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::"' + ;; -if test "$GCC" = yes; then - lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin' + *nto* | *qnx*) + ld_shlibs_CXX=yes + ;; - -{ echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 -echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; } -if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_prog_compiler_rtti_exceptions=no - ac_outfile=conftest.$ac_objext - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="-fno-rtti -fno-exceptions" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:__oline__: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_rtti_exceptions=yes - fi - fi - $rm conftest* + openbsd2*) + # C++ shared libraries are fairly broken + ld_shlibs_CXX=no + ;; -fi -{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; } + 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=echo + else + ld_shlibs_CXX=no + fi + ;; -if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then - lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions" -else - : -fi + 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" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -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" && $ECHO "X-set_version $verstring" | $Xsed` -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 "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~ + $RM $lib.exp' + hardcode_libdir_flag_spec_CXX='-rpath $libdir' + ;; + esac -fi + hardcode_libdir_separator_CXX=: -lt_prog_compiler_wl_GCJ= -lt_prog_compiler_pic_GCJ= -lt_prog_compiler_static_GCJ= + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + ;; + *) + 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" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + *) + archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${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 "\-L"' + + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + 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 "$GCC" = yes; then - lt_prog_compiler_wl_GCJ='-Wl,' - lt_prog_compiler_static_GCJ='-static' + psos*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_GCJ='-Bstatic' - fi - ;; + 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 + ;; - amigaos*) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - lt_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4' - ;; + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + archive_cmds_need_lc_CXX=yes + no_undefined_flag_CXX=' -zdefs' + archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + hardcode_libdir_flag_spec_CXX='-R$libdir' + hardcode_shlibpath_var_CXX=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The 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 - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; + output_verbose_link_cmd='echo' - mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' - ;; + # 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' - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic_GCJ='-fno-common' - ;; + # The C++ compiler must be used to create the archive. + old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + no_undefined_flag_CXX=' ${wl}-z ${wl}defs' + if $CC --version | $GREP -v '^2\.7' > /dev/null; then + archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + fi + + hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' + 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 + ;; - interix3*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. - ;; + 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' - msdosdjgpp*) - # Just because we use GCC doesn't mean we suddenly get shared libraries - # on systems that don't support them. - lt_prog_compiler_can_build_shared_GCJ=no - enable_shared=no + 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 ;; - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic_GCJ=-Kconform_pic - 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_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' - hpux*) - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic_GCJ='-fPIC' - ;; - esac + 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 ;; - *) - lt_prog_compiler_pic_GCJ='-fPIC' - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - lt_prog_compiler_wl_GCJ='-Wl,' - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_GCJ='-Bstatic' - else - lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp' - fi - ;; - darwin*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - case $cc_basename in - xlc*) - lt_prog_compiler_pic_GCJ='-qnocommon' - lt_prog_compiler_wl_GCJ='-Wl,' - ;; - esac - ;; + 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 + ;; - mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' - ;; + vxworks*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; - hpux9* | hpux10* | hpux11*) - lt_prog_compiler_wl_GCJ='-Wl,' - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; *) - lt_prog_compiler_pic_GCJ='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive' - ;; + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac - irix5* | irix6* | nonstopux*) - lt_prog_compiler_wl_GCJ='-Wl,' - # PIC (with -KPIC) is the default. - lt_prog_compiler_static_GCJ='-non_shared' - ;; + { 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 - newsos6) - lt_prog_compiler_pic_GCJ='-KPIC' - lt_prog_compiler_static_GCJ='-Bstatic' - ;; + GCC_CXX="$GXX" + LD_CXX="$LD" - linux*) - case $cc_basename in - icc* | ecc*) - lt_prog_compiler_wl_GCJ='-Wl,' - lt_prog_compiler_pic_GCJ='-KPIC' - lt_prog_compiler_static_GCJ='-static' - ;; - pgcc* | pgf77* | pgf90* | pgf95*) - # Portland Group compilers (*not* the Pentium gcc compiler, - # which looks to be a dead project) - lt_prog_compiler_wl_GCJ='-Wl,' - lt_prog_compiler_pic_GCJ='-fpic' - lt_prog_compiler_static_GCJ='-Bstatic' - ;; - ccc*) - lt_prog_compiler_wl_GCJ='-Wl,' - # All Alpha code is PIC. - lt_prog_compiler_static_GCJ='-non_shared' - ;; - esac - ;; + ## 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= - osf3* | osf4* | osf5*) - lt_prog_compiler_wl_GCJ='-Wl,' - # All OSF/1 code is PIC. - lt_prog_compiler_static_GCJ='-non_shared' - ;; +cat > conftest.$ac_ext <<_LT_EOF +class Foo +{ +public: + Foo (void) { a = 0; } +private: + int a; +}; +_LT_EOF - solaris*) - lt_prog_compiler_pic_GCJ='-KPIC' - lt_prog_compiler_static_GCJ='-Bstatic' - case $cc_basename in - f77* | f90* | f95*) - lt_prog_compiler_wl_GCJ='-Qoption ld ';; - *) - lt_prog_compiler_wl_GCJ='-Wl,';; - esac - ;; +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. - sunos4*) - lt_prog_compiler_wl_GCJ='-Qoption ld ' - lt_prog_compiler_pic_GCJ='-PIC' - lt_prog_compiler_static_GCJ='-Bstatic' - ;; + # Sentinel used to keep track of whether or not we are before + # the conftest object file. + pre_test_object_deps_done=no - sysv4 | sysv4.2uw2* | sysv4.3*) - lt_prog_compiler_wl_GCJ='-Wl,' - lt_prog_compiler_pic_GCJ='-KPIC' - lt_prog_compiler_static_GCJ='-Bstatic' - ;; + for p in `eval "$output_verbose_link_cmd"`; do + case $p in - sysv4*MP*) - if test -d /usr/nec ;then - lt_prog_compiler_pic_GCJ='-Kconform_pic' - lt_prog_compiler_static_GCJ='-Bstatic' - fi - ;; + -L* | -R* | -l*) + # Some compilers place space between "-{L,R}" and the path. + # Remove the space. + if test $p = "-L" || + test $p = "-R"; then + prev=$p + continue + else + prev= + fi - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - lt_prog_compiler_wl_GCJ='-Wl,' - lt_prog_compiler_pic_GCJ='-KPIC' - lt_prog_compiler_static_GCJ='-Bstatic' - ;; + if test "$pre_test_object_deps_done" = no; then + case $p in + -L* | -R*) + # Internal compiler library paths should come after those + # provided the user. The postdeps already come after the + # user supplied libs so there is no need to process them. + if test -z "$compiler_lib_search_path_CXX"; then + compiler_lib_search_path_CXX="${prev}${p}" + else + compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" + fi + ;; + # The "-l" case would never come before the object being + # linked, so don't bother handling this case. + esac + else + if test -z "$postdeps_CXX"; then + postdeps_CXX="${prev}${p}" + else + postdeps_CXX="${postdeps_CXX} ${prev}${p}" + fi + fi + ;; - unicos*) - lt_prog_compiler_wl_GCJ='-Wl,' - lt_prog_compiler_can_build_shared_GCJ=no - ;; + *.$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 - uts4*) - lt_prog_compiler_pic_GCJ='-pic' - lt_prog_compiler_static_GCJ='-Bstatic' - ;; + 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 + ;; - *) - lt_prog_compiler_can_build_shared_GCJ=no - ;; - esac - fi + *) ;; # Ignore the rest. -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6; } + esac + done -# -# Check to make sure the PIC flag actually works. -# -if test -n "$lt_prog_compiler_pic_GCJ"; then - -{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5 -echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6; } -if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + # Clean up. + rm -f a.out a.exe else - lt_prog_compiler_pic_works_GCJ=no - ac_outfile=conftest.$ac_objext - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic_GCJ" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:__oline__: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_pic_works_GCJ=yes - fi - fi - $rm conftest* - + echo "libtool.m4: error: problem compiling CXX test program" fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6; } -if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then - case $lt_prog_compiler_pic_GCJ in - "" | " "*) ;; - *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;; - esac -else - lt_prog_compiler_pic_GCJ= - lt_prog_compiler_can_build_shared_GCJ=no -fi +$RM -f confest.$objext -fi +# PORTME: override above test on systems where it is broken case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - lt_prog_compiler_pic_GCJ= +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 ;; - *) - lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ" + esac + ;; + +solaris*) + case $cc_basename in + CC*) + # 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 -# -# Check to make sure the static flag actually works. -# -wl=$lt_prog_compiler_wl_GCJ eval lt_tmp_static_flag=\"$lt_prog_compiler_static_GCJ\" -{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } -if test "${lt_prog_compiler_static_works_GCJ+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_static_works_GCJ=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $lt_tmp_static_flag" - printf "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The linker can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&5 - $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_static_works_GCJ=yes - fi - else - lt_prog_compiler_static_works_GCJ=yes - fi - fi - $rm conftest* - LDFLAGS="$save_LDFLAGS" +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 -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_GCJ" >&5 -echo "${ECHO_T}$lt_prog_compiler_static_works_GCJ" >&6; } -if test x"$lt_prog_compiler_static_works_GCJ" = xyes; then - : -else - lt_prog_compiler_static_GCJ= -fi + + + -{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 -echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } -if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_prog_compiler_c_o_GCJ=no - $rm -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - printf "$lt_simple_compile_test_code" > conftest.$ac_ext + + + - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:__oline__: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp - $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then - lt_cv_prog_compiler_c_o_GCJ=yes - fi - fi - chmod u+w . 2>&5 - $rm conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files - $rm out/* && rmdir out - cd .. - rmdir conftest - $rm conftest* -fi -{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6; } + + + -hard_links="nottested" -if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 -echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } - hard_links=yes - $rm conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - { echo "$as_me:$LINENO: result: $hard_links" >&5 -echo "${ECHO_T}$hard_links" >&6; } - if test "$hard_links" = no; then - { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} - need_locks=warn - fi -else - need_locks=no -fi + + + -{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } - runpath_var= - allow_undefined_flag_GCJ= - enable_shared_with_static_runtimes_GCJ=no - archive_cmds_GCJ= - archive_expsym_cmds_GCJ= - old_archive_From_new_cmds_GCJ= - old_archive_from_expsyms_cmds_GCJ= - export_dynamic_flag_spec_GCJ= - whole_archive_flag_spec_GCJ= - thread_safe_flag_spec_GCJ= - hardcode_libdir_flag_spec_GCJ= - hardcode_libdir_flag_spec_ld_GCJ= - hardcode_libdir_separator_GCJ= - hardcode_direct_GCJ=no - hardcode_minus_L_GCJ=no - hardcode_shlibpath_var_GCJ=unsupported - link_all_deplibs_GCJ=unknown - hardcode_automatic_GCJ=no - module_cmds_GCJ= - module_expsym_cmds_GCJ= - always_export_symbols_GCJ=no - export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - include_expsyms_GCJ= - # exclude_expsyms can be an extended regexp of symbols to exclude - # it will be wrapped by ` (' and `)$', so one must not match beginning or - # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', - # as well as any symbol that contains `d'. - exclude_expsyms_GCJ="_GLOBAL_OFFSET_TABLE_" - # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out - # platforms (ab)use it in PIC code, but their linkers get confused if - # the symbol is explicitly referenced. Since portable code cannot - # rely on this symbol name, it's probably fine to never include it in - # preloaded symbol tables. - extract_expsyms_cmds= - # Just being paranoid about ensuring that cc_basename is set. - for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + + - case $host_os in - cygwin* | mingw* | pw32*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - if test "$GCC" != yes; then - with_gnu_ld=no - fi - ;; - interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) - with_gnu_ld=yes - ;; - openbsd*) - with_gnu_ld=no - ;; - esac - ld_shlibs_GCJ=yes - if test "$with_gnu_ld" = yes; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' + + + - # Set some defaults for GNU ld with shared library support. These - # are reset later if shared libraries are not supported. Putting them - # here allows them to be overridden if necessary. - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir' - export_dynamic_flag_spec_GCJ='${wl}--export-dynamic' - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec_GCJ= - fi - supports_anon_versioning=no - case `$LD -v 2>/dev/null` in - *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 - *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... - *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... - *\ 2.11.*) ;; # other 2.11 versions - *) supports_anon_versioning=yes ;; - esac - # See if GNU ld supports shared libraries. - case $host_os in - aix3* | aix4* | aix5*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - ld_shlibs_GCJ=no - cat <&2 + lt_prog_compiler_wl_CXX= +lt_prog_compiler_pic_CXX= +lt_prog_compiler_static_CXX= -*** Warning: the GNU linker, at least up to release 2.9.1, is reported -*** to be unable to reliably create shared libraries on AIX. -*** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to modify your PATH -*** so that a non-GNU linker is found, and then restart. +{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } + + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='-static' -EOF + 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*) - archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_minus_L_GCJ=yes - - # Samuel A. Falvo II reports - # that the semantics of dynamic libraries on AmigaOS, at least up - # to version 4, is to share data among multiple programs linked - # with the same dynamic library. Since this doesn't match the - # behavior of shared libraries on other platforms, we can't use - # them. - ld_shlibs_GCJ=no - ;; - - beos*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag_GCJ=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - ld_shlibs_GCJ=no + if test "$host_cpu" = m68k; then + # 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' fi ;; - - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec_GCJ='-L$libdir' - allow_undefined_flag_GCJ=unsupported - always_export_symbols_GCJ=no - enable_shared_with_static_runtimes_GCJ=yes - export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' - - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - archive_expsym_cmds_GCJ='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - ld_shlibs_GCJ=no + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | cygwin* | os2* | pw32*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # 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= + ;; + 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 ;; - - interix3*) - hardcode_direct_GCJ=no - hardcode_shlibpath_var_GCJ=no - hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' - export_dynamic_flag_spec_GCJ='${wl}-E' - # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. - # Instead, shared libraries are loaded at an image base (0x10000000 by - # default) and relocated if they conflict, which is a slow very memory - # consuming and fragmenting process. To avoid this, we pick a random, - # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link - # time. Moving up from 0x10000000 also allows more sbrk(2) space. - archive_cmds_GCJ='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - archive_expsym_cmds_GCJ='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + esac ;; - - linux*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - tmp_addflag= - case $cc_basename,$host_cpu in - pgcc*) # Portland Group C compiler - whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag' + *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" ;; - pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers - whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag -Mnomain' ;; - ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 - tmp_addflag=' -i_dynamic' ;; - efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 - tmp_addflag=' -i_dynamic -nofor_main' ;; - ifc* | ifort*) # Intel Fortran compiler - tmp_addflag=' -nofor_main' ;; esac - archive_cmds_GCJ='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - - if test $supports_anon_versioning = yes; then - archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - $echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - fi - else - ld_shlibs_GCJ=no - fi - ;; - - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - fi - ;; - - solaris*) - if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then - ld_shlibs_GCJ=no - cat <&2 - -*** Warning: The releases 2.8.* of the GNU linker cannot reliably -*** create shared libraries on Solaris systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.9.1 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -EOF - elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs_GCJ=no - fi - ;; - - sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) - case `$LD -v 2>&1` in - *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) - ld_shlibs_GCJ=no - cat <<_LT_EOF 1>&2 - -*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not -*** reliably create shared libraries on SCO systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.16.91.0.3 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -_LT_EOF ;; - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' - archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' - archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' - else - ld_shlibs_GCJ=no - fi + 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) + case $cc_basename in + KCC*) + # KAI C++ Compiler + lt_prog_compiler_wl_CXX='--backend -Wl,' + lt_prog_compiler_pic_CXX='-fPIC' + ;; + icpc* | ecpc* ) + # Intel C++ + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-static' + ;; + pgCC* | 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*) + # IBM XL 8.0 on PPC + 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*) + ;; + *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*) ;; - esac - ;; - - sunos4*) - archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - hardcode_direct_GCJ=yes - hardcode_shlibpath_var_GCJ=no - ;; - - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs_GCJ=no - fi - ;; - esac - - if test "$ld_shlibs_GCJ" = no; then - runpath_var= - hardcode_libdir_flag_spec_GCJ= - export_dynamic_flag_spec_GCJ= - whole_archive_flag_spec_GCJ= - fi - else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - allow_undefined_flag_GCJ=unsupported - always_export_symbols_GCJ=yes - archive_expsym_cmds_GCJ='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - hardcode_minus_L_GCJ=yes - if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - hardcode_direct_GCJ=unsupported - fi - ;; - - aix4* | aix5*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - if $NM -V 2>&1 | grep 'GNU' > /dev/null; then - export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - else - export_symbols_cmds_GCJ='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - fi - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[23]|aix4.[23].*|aix5*) - for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then - aix_use_runtimelinking=yes - break - fi - done - ;; + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-Bstatic' + lt_prog_compiler_wl_CXX='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + lt_prog_compiler_pic_CXX='-PIC' + ;; + *) + ;; esac - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - archive_cmds_GCJ='' - hardcode_direct_GCJ=yes - hardcode_libdir_separator_GCJ=':' - link_all_deplibs_GCJ=yes - - if test "$GCC" = yes; then - case $host_os in aix4.[012]|aix4.[012].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && \ - strings "$collect2name" | grep resolve_lib_name >/dev/null - then - # We have reworked collect2 - hardcode_direct_GCJ=yes - else - # We have old collect2 - hardcode_direct_GCJ=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - hardcode_minus_L_GCJ=yes - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_libdir_separator_GCJ= - fi - ;; + ;; + 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 - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - always_export_symbols_GCJ=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - allow_undefined_flag_GCJ='-berok' - # Determine the default libpath from the value encoded in an empty executable. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (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 - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - - hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag_GCJ="-z nodefs" - archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an empty executable. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ + ;; + 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 - ; - 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;; +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 -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 - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - - hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - no_undefined_flag_GCJ=' ${wl}-bernotok' - allow_undefined_flag_GCJ=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec_GCJ='$convenience' - archive_cmds_need_lc_GCJ=yes - # This is similar to how AIX traditionally builds its shared libraries. - archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; +{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6; } - amigaos*) - archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_minus_L_GCJ=yes - # see comment about different semantics on the GNU ld section - ld_shlibs_GCJ=no - ;; - bsdi[45]*) - export_dynamic_flag_spec_GCJ=-rdynamic - ;; - cygwin* | mingw* | pw32*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - hardcode_libdir_flag_spec_GCJ=' ' - allow_undefined_flag_GCJ=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - old_archive_From_new_cmds_GCJ='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs' - fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`' - enable_shared_with_static_runtimes_GCJ=yes - ;; +# +# 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:__oline__: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:__oline__: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_pic_works_CXX=yes + fi + fi + $RM conftest* - darwin* | rhapsody*) - case $host_os in - rhapsody* | darwin1.[012]) - allow_undefined_flag_GCJ='${wl}-undefined ${wl}suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[012]) - allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - ;; - 10.*) - allow_undefined_flag_GCJ='${wl}-undefined ${wl}dynamic_lookup' - ;; - esac - fi - ;; - esac - archive_cmds_need_lc_GCJ=no - hardcode_direct_GCJ=no - hardcode_automatic_GCJ=yes - hardcode_shlibpath_var_GCJ=unsupported - whole_archive_flag_spec_GCJ='' - link_all_deplibs_GCJ=yes - if test "$GCC" = yes ; then - output_verbose_link_cmd='echo' - archive_cmds_GCJ='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - case $cc_basename in - xlc*) - output_verbose_link_cmd='echo' - archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' - module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - ;; - *) - ld_shlibs_GCJ=no - ;; - esac - fi - ;; +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; } - dgux*) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_shlibpath_var_GCJ=no - ;; +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 - freebsd1*) - ld_shlibs_GCJ=no - ;; +fi - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor - # support. Future versions do this automatically, but an explicit c++rt0.o - # does not break anything, and helps significantly (at the cost of a little - # extra space). - freebsd2.2*) - archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - hardcode_libdir_flag_spec_GCJ='-R$libdir' - hardcode_direct_GCJ=yes - hardcode_shlibpath_var_GCJ=no - ;; - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) - archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_GCJ=yes - hardcode_minus_L_GCJ=yes - hardcode_shlibpath_var_GCJ=no - ;; - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | kfreebsd*-gnu | dragonfly*) - archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec_GCJ='-R$libdir' - hardcode_direct_GCJ=yes - hardcode_shlibpath_var_GCJ=no - ;; +# +# 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 "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_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" - hpux9*) - if test "$GCC" = yes; then - archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - archive_cmds_GCJ='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - fi - hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_GCJ=: - hardcode_direct_GCJ=yes +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; } - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_GCJ=yes - export_dynamic_flag_spec_GCJ='${wl}-E' - ;; +if test x"$lt_cv_prog_compiler_static_works_CXX" = xyes; then + : +else + lt_prog_compiler_static_CXX= +fi - hpux10*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_GCJ=: - hardcode_direct_GCJ=yes - export_dynamic_flag_spec_GCJ='${wl}-E' - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_GCJ=yes - fi - ;; - hpux11*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - case $host_cpu in - hppa*64*) - archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - else - case $host_cpu in - hppa*64*) - archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_GCJ=: + { 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 - case $host_cpu in - hppa*64*|ia64*) - hardcode_libdir_flag_spec_ld_GCJ='+b $libdir' - hardcode_direct_GCJ=no - hardcode_shlibpath_var_GCJ=no - ;; - *) - hardcode_direct_GCJ=yes - export_dynamic_flag_spec_GCJ='${wl}-E' + 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:__oline__: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:__oline__: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_CXX=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_GCJ=yes - ;; - esac - fi - ;; +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; } - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir' - fi - hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_GCJ=: - link_all_deplibs_GCJ=yes - ;; - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - hardcode_libdir_flag_spec_GCJ='-R$libdir' - hardcode_direct_GCJ=yes - hardcode_shlibpath_var_GCJ=no - ;; - newsos6) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_GCJ=yes - hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_GCJ=: - hardcode_shlibpath_var_GCJ=no - ;; + { 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 - openbsd*) - hardcode_direct_GCJ=yes - hardcode_shlibpath_var_GCJ=no - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' - export_dynamic_flag_spec_GCJ='${wl}-E' - else - case $host_os in - openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) - archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_GCJ='-R$libdir' - ;; - *) - archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' - ;; - esac - fi - ;; + 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:__oline__: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:__oline__: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_CXX=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* - os2*) - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_minus_L_GCJ=yes - allow_undefined_flag_GCJ=unsupported - archive_cmds_GCJ='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; +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; } - osf3*) - if test "$GCC" = yes; then - allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - allow_undefined_flag_GCJ=' -expect_unresolved \*' - archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - fi - hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_GCJ=: - ;; - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' - else - allow_undefined_flag_GCJ=' -expect_unresolved \*' - archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ - $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' - # Both c and cxx compiler support -rpath directly - hardcode_libdir_flag_spec_GCJ='-rpath $libdir' - fi - hardcode_libdir_separator_GCJ=: - ;; - solaris*) - no_undefined_flag_GCJ=' -z text' - if test "$GCC" = yes; then - wlarc='${wl}' - archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' - else - wlarc='' - archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' - fi - hardcode_libdir_flag_spec_GCJ='-R$libdir' - hardcode_shlibpath_var_GCJ=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) - # The compiler driver will combine linker options so we - # cannot just pass the convience library names through - # without $wl, iff we do not link with $LD. - # Luckily, gcc supports the same syntax we need for Sun Studio. - # Supported since Solaris 2.6 (maybe 2.5.1?) - case $wlarc in - '') - whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;; - *) - whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; - esac ;; - esac - link_all_deplibs_GCJ=yes - ;; +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 - sunos4*) - if test "x$host_vendor" = xsequent; then - # Use $CC to link under sequent, because it throws in some extra .o - # files that make .init and .fini sections work. - archive_cmds_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_direct_GCJ=yes - hardcode_minus_L_GCJ=yes - hardcode_shlibpath_var_GCJ=no - ;; - sysv4) - case $host_vendor in - sni) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_GCJ=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' - reload_cmds_GCJ='$CC -r -o $output$reload_objs' - hardcode_direct_GCJ=no - ;; - motorola) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var_GCJ=no - ;; - sysv4.3*) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var_GCJ=no - export_dynamic_flag_spec_GCJ='-Bexport' - ;; + { 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; } - sysv4*MP*) - if test -d /usr/nec; then - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var_GCJ=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ld_shlibs_GCJ=yes - fi - ;; + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + 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 + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + export_symbols_cmds_CXX="$ltdll_cmds" + ;; + cygwin* | mingw*) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;/^.*[ ]__nm__/s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + ;; + *) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac + exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) - no_undefined_flag_GCJ='${wl}-z,text' - archive_cmds_need_lc_GCJ=no - hardcode_shlibpath_var_GCJ=no - runpath_var='LD_RUN_PATH' +{ 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 - if test "$GCC" = yes; then - archive_cmds_GCJ='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_GCJ='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; +with_gnu_ld_CXX=$with_gnu_ld - sysv5* | sco3.2v5* | sco5v6*) - # Note: We can NOT use -z defs as we might desire, because we do not - # link with -lc, and that would cause any symbols used from libc to - # always be unresolved, which means just about no library would - # ever link correctly. If we're not using GNU ld we use -z text - # though, which does catch some bad symbols but isn't as heavy-handed - # as -z defs. - no_undefined_flag_GCJ='${wl}-z,text' - allow_undefined_flag_GCJ='${wl}-z,nodefs' - archive_cmds_need_lc_GCJ=no - hardcode_shlibpath_var_GCJ=no - hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' - hardcode_libdir_separator_GCJ=':' - link_all_deplibs_GCJ=yes - export_dynamic_flag_spec_GCJ='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - if test "$GCC" = yes; then - archive_cmds_GCJ='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_GCJ='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - uts4*) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_shlibpath_var_GCJ=no - ;; - *) - ld_shlibs_GCJ=no - ;; - esac - fi -{ echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5 -echo "${ECHO_T}$ld_shlibs_GCJ" >&6; } -test "$ld_shlibs_GCJ" = no && can_build_shared=no # # Do we need to explicitly link libc? # -case "x$archive_cmds_need_lc_GCJ" in +case "x$archive_cmds_need_lc_CXX" in x|xyes) # Assume -lc should be added - archive_cmds_need_lc_GCJ=yes + archive_cmds_need_lc_CXX=yes if test "$enable_shared" = yes && test "$GCC" = yes; then - case $archive_cmds_GCJ in + case $archive_cmds_CXX in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; @@ -18634,8 +15101,8 @@ # to ld, don't add -lc before -lgcc. { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } - $rm conftest* - printf "$lt_simple_compile_test_code" > conftest.$ac_ext + $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 @@ -18646,40 +15113,104 @@ lib=conftest libobjs=conftest.$ac_objext deplibs= - wl=$lt_prog_compiler_wl_GCJ - pic_flag=$lt_prog_compiler_pic_GCJ + 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_GCJ - allow_undefined_flag_GCJ= - if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 - (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 + lt_save_allow_undefined_flag=$allow_undefined_flag_CXX + allow_undefined_flag_CXX= + if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\"") >&5 + (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then - archive_cmds_need_lc_GCJ=no + archive_cmds_need_lc_CXX=no else - archive_cmds_need_lc_GCJ=yes + archive_cmds_need_lc_CXX=yes fi - allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag + allow_undefined_flag_CXX=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi - $rm conftest* - { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5 -echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6; } + $RM conftest* + { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5 +echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6; } ;; esac fi ;; esac -{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { echo "$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= @@ -18693,20 +15224,6 @@ version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" -if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi need_lib_prefix=unknown hardcode_into_libs=no @@ -18724,7 +15241,7 @@ soname_spec='${libname}${release}${shared_ext}$major' ;; -aix4* | aix5*) +aix[4-9]*) version_type=linux need_lib_prefix=no need_version=no @@ -18743,7 +15260,7 @@ 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 + echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no @@ -18769,9 +15286,13 @@ ;; amigaos*) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + if test "$host_cpu" = m68k; then + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + else + dynamic_linker=no + fi ;; beos*) @@ -18805,14 +15326,17 @@ 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'\''`~ + 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' + 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' + $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in @@ -18824,17 +15348,17 @@ mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then + sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + 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"` + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) @@ -18858,17 +15382,12 @@ version_type=darwin need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' + 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`' - # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. - if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` - else - sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' - fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; @@ -18885,18 +15404,6 @@ dynamic_linker=no ;; -kfreebsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='GNU ld.so' - ;; - freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. @@ -18934,7 +15441,7 @@ shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; - freebsd*) # from 4.6 on + *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; @@ -18973,18 +15480,18 @@ 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 - ;; - *) + 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 @@ -18997,7 +15504,7 @@ postinstall_cmds='chmod 555 $lib' ;; -interix3*) +interix[3-9]*) version_type=linux need_lib_prefix=no need_version=no @@ -19052,7 +15559,7 @@ ;; # This must be Linux ELF. -linux*) +linux* | k*bsd*-gnu) version_type=linux need_lib_prefix=no need_version=no @@ -19061,36 +15568,69 @@ 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 + 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 + 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 + # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes - # find out which ABI we are using - libsuff= - case "$host_cpu" in - x86_64*|s390x*|powerpc64*) - echo '#line __oline__ "configure"' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - case `/usr/bin/file conftest.$ac_objext` in - *64-bit*) - libsuff=64 - sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" - ;; - esac - fi - rm -rf conftest* - ;; - esac - # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" + 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;/^$/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 @@ -19102,23 +15642,11 @@ dynamic_linker='GNU/Linux ld.so' ;; -knetbsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='GNU ld.so' - ;; - netbsd*) version_type=sunos need_lib_prefix=no need_version=no - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + 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' @@ -19139,14 +15667,16 @@ shlibpath_overrides_runpath=yes ;; -nto-qnx*) - version_type=linux +*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=yes + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' ;; openbsd*) @@ -19155,13 +15685,13 @@ 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 ;; + 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 + 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 @@ -19195,6 +15725,10 @@ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; +rdos*) + dynamic_linker=no + ;; + solaris*) version_type=linux need_lib_prefix=no @@ -19229,7 +15763,6 @@ sni) shlibpath_overrides_runpath=no need_lib_prefix=no - export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) @@ -19260,13 +15793,12 @@ 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' - shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - shlibpath_overrides_runpath=yes case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" @@ -19276,474 +15808,135 @@ sys_lib_dlsearch_path_spec='/usr/lib' ;; -uts4*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -*) - dynamic_linker=no - ;; -esac -{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5 -echo "${ECHO_T}$dynamic_linker" >&6; } -test "$dynamic_linker" = no && can_build_shared=no - -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi - -{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 -echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } -hardcode_action_GCJ= -if test -n "$hardcode_libdir_flag_spec_GCJ" || \ - test -n "$runpath_var_GCJ" || \ - test "X$hardcode_automatic_GCJ" = "Xyes" ; then - - # We can hardcode non-existant directories. - if test "$hardcode_direct_GCJ" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no && - test "$hardcode_minus_L_GCJ" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action_GCJ=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action_GCJ=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action_GCJ=unsupported -fi -{ echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5 -echo "${ECHO_T}$hardcode_action_GCJ" >&6; } - -if test "$hardcode_action_GCJ" = relink; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi - - -# The else clause should only fire when bootstrapping the -# libtool distribution, otherwise you forgot to ship ltmain.sh -# with your package, and you will get complaints that there are -# no rules to generate ltmain.sh. -if test -f "$ltmain"; then - # See if we are running on zsh, and set the options which allow our commands through - # without removal of \ escapes. - if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST - fi - # Now quote all the things that may contain metacharacters while being - # careful not to overquote the AC_SUBSTed values. We take copies of the - # variables and quote the copies for generation of the libtool script. - for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ - SED SHELL STRIP \ - libname_spec library_names_spec soname_spec extract_expsyms_cmds \ - old_striplib striplib file_magic_cmd finish_cmds finish_eval \ - deplibs_check_method reload_flag reload_cmds need_locks \ - lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ - lt_cv_sys_global_symbol_to_c_name_address \ - sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ - old_postinstall_cmds old_postuninstall_cmds \ - compiler_GCJ \ - CC_GCJ \ - LD_GCJ \ - lt_prog_compiler_wl_GCJ \ - lt_prog_compiler_pic_GCJ \ - lt_prog_compiler_static_GCJ \ - lt_prog_compiler_no_builtin_flag_GCJ \ - export_dynamic_flag_spec_GCJ \ - thread_safe_flag_spec_GCJ \ - whole_archive_flag_spec_GCJ \ - enable_shared_with_static_runtimes_GCJ \ - old_archive_cmds_GCJ \ - old_archive_from_new_cmds_GCJ \ - predep_objects_GCJ \ - postdep_objects_GCJ \ - predeps_GCJ \ - postdeps_GCJ \ - compiler_lib_search_path_GCJ \ - archive_cmds_GCJ \ - archive_expsym_cmds_GCJ \ - postinstall_cmds_GCJ \ - postuninstall_cmds_GCJ \ - old_archive_from_expsyms_cmds_GCJ \ - allow_undefined_flag_GCJ \ - no_undefined_flag_GCJ \ - export_symbols_cmds_GCJ \ - hardcode_libdir_flag_spec_GCJ \ - hardcode_libdir_flag_spec_ld_GCJ \ - hardcode_libdir_separator_GCJ \ - hardcode_automatic_GCJ \ - module_cmds_GCJ \ - module_expsym_cmds_GCJ \ - lt_cv_prog_compiler_c_o_GCJ \ - exclude_expsyms_GCJ \ - include_expsyms_GCJ; do - - case $var in - old_archive_cmds_GCJ | \ - old_archive_from_new_cmds_GCJ | \ - archive_cmds_GCJ | \ - archive_expsym_cmds_GCJ | \ - module_cmds_GCJ | \ - module_expsym_cmds_GCJ | \ - old_archive_from_expsyms_cmds_GCJ | \ - export_symbols_cmds_GCJ | \ - extract_expsyms_cmds | reload_cmds | finish_cmds | \ - postinstall_cmds | postuninstall_cmds | \ - old_postinstall_cmds | old_postuninstall_cmds | \ - sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) - # Double-quote double-evaled strings. - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" - ;; - *) - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" - ;; - esac - done - - case $lt_echo in - *'\$0 --fallback-echo"') - lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` - ;; - esac - -cfgfile="$ofile" - - cat <<__EOF__ >> "$cfgfile" -# ### BEGIN LIBTOOL TAG CONFIG: $tagname - -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: - -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL - -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared - -# Whether or not to build static libraries. -build_old_libs=$enable_static - -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$archive_cmds_need_lc_GCJ - -# Whether or not to disallow shared libs when runtime libs are static -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ - -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install - -# The host system. -host_alias=$host_alias -host=$host -host_os=$host_os - -# The build system. -build_alias=$build_alias -build=$build -build_os=$build_os - -# An echo program that does not interpret backslashes. -echo=$lt_echo - -# The archiver. -AR=$lt_AR -AR_FLAGS=$lt_AR_FLAGS - -# A C compiler. -LTCC=$lt_LTCC - -# LTCC compiler flags. -LTCFLAGS=$lt_LTCFLAGS - -# A language-specific compiler. -CC=$lt_compiler_GCJ - -# Is the compiler the GNU C compiler? -with_gcc=$GCC_GCJ - -gcc_dir=\`$CC -print-file-name=. | $SED 's,/\.$,,'\` -gcc_ver=\`$CC -dumpversion\` - -# An ERE matcher. -EGREP=$lt_EGREP - -# The linker used to build libraries. -LD=$lt_LD_GCJ - -# Whether we need hard or soft links. -LN_S=$lt_LN_S - -# A BSD-compatible nm program. -NM=$lt_NM - -# A symbol stripping program -STRIP=$lt_STRIP - -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=$MAGIC_CMD - -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" - -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" - -# Used on cygwin: assembler. -AS="$AS" - -# The name of the directory that contains temporary libtool files. -objdir=$objdir - -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds - -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl_GCJ - -# Object file suffix (normally "o"). -objext="$ac_objext" - -# Old archive suffix (normally "a"). -libext="$libext" - -# Shared library suffix (normally ".so"). -shrext_cmds='$shrext_cmds' - -# Executable file suffix (normally ""). -exeext="$exeext" - -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic_GCJ -pic_mode=$pic_mode - -# What is the maximum length of a command? -max_cmd_len=$lt_cv_sys_max_cmd_len - -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ - -# Must we lock files when doing compilation? -need_locks=$lt_need_locks - -# Do we need the lib prefix for modules? -need_lib_prefix=$need_lib_prefix - -# Do we need a version for libraries? -need_version=$need_version - -# Whether dlopen is supported. -dlopen_support=$enable_dlopen - -# Whether dlopen of programs is supported. -dlopen_self=$enable_dlopen_self - -# Whether dlopen of statically linked programs is supported. -dlopen_self_static=$enable_dlopen_self_static +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux + need_lib_prefix=no + need_version=no + library_name_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 + ;; -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_lt_prog_compiler_static_GCJ +uts4*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ +*) + 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 -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ +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 -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ -# Library versioning type. -version_type=$version_type -# Format of library name prefix. -libname_spec=$lt_libname_spec -# List of archive names. First name is the real one, the rest are links. -# The last name is the one that the linker finds with -lNAME. -library_names_spec=$lt_library_names_spec -# The coded name of the library, if different from the real name. -soname_spec=$lt_soname_spec -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_old_archive_cmds_GCJ -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ -# Commands used to build and install a shared archive. -archive_cmds=$lt_archive_cmds_GCJ -archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds -# Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_module_cmds_GCJ -module_expsym_cmds=$lt_module_expsym_cmds_GCJ -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects=\`echo $lt_predep_objects_GCJ | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` - -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects=\`echo $lt_postdep_objects_GCJ | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` - -# Dependencies to place before the objects being linked to create a -# shared library. -predeps=$lt_predeps_GCJ - -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_postdeps_GCJ -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_GCJ | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` -# Method to check whether dependent libraries are shared objects. -deplibs_check_method=$lt_deplibs_check_method -# Command to use when deplibs_check_method == file_magic. -file_magic_cmd=$lt_file_magic_cmd -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag_GCJ -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag_GCJ -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$lt_finish_eval -# Take the output of nm and produce a listing of raw symbols and C names. -global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe -# Transform the output of nm in a proper C declaration -global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl -# Transform the output of nm in a C name address pair -global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address -# This is the shared library runtime path variable. -runpath_var=$runpath_var -# This is the shared library path variable. -shlibpath_var=$shlibpath_var -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action_GCJ -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_GCJ -# If ld is used when linking, flag to hardcode \$libdir into -# a binary during linking. This must work even if \$libdir does -# not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ - -# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$hardcode_direct_GCJ - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$hardcode_minus_L_GCJ - -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ - -# Set to yes if building a shared library automatically hardcodes DIR into the library -# and all subsequent libraries and executables linked against it. -hardcode_automatic=$hardcode_automatic_GCJ -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs_GCJ -# Compile-time system search path for libraries -sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` -# Run-time system search path for libraries -sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$fix_srcfile_path_GCJ" -# Set to yes if exported symbols are required. -always_export_symbols=$always_export_symbols_GCJ + { 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 -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds_GCJ + # 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; } -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds +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 -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms_GCJ -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms_GCJ -# ### END LIBTOOL TAG CONFIG: $tagname -__EOF__ + -else - # If there is no Makefile yet, we rely on a make rule to execute - # `config.status --recheck' to rerun these tests and create the - # libtool script then. - ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` - if test -f "$ltmain_in"; then - test -f Makefile && make "$ltmain" - fi -fi + fi # test -n "$compiler" + CC=$lt_save_CC + 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' @@ -19751,759 +15944,1701 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -CC="$lt_save_CC" - else - tagname="" - fi - ;; - RC) - -# Source file extension for RC test sources. -ac_ext=rc -# Object file extension for compiled RC test sources. -objext=o -objext_RC=$objext -# Code to be used in simple compile tests -lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n' -# Code to be used in simple link tests -lt_simple_link_test_code="$lt_simple_compile_test_code" -# ltmain only uses $CC for tagged configurations so make sure $CC is set. + + -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} -# Allow CC to be a program name with arguments. -compiler=$CC + ac_config_commands="$ac_config_commands libtool" -# save warnings/boilerplate of simple test code -ac_outfile=conftest.$ac_objext -printf "$lt_simple_compile_test_code" >conftest.$ac_ext -eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_compiler_boilerplate=`cat conftest.err` -$rm conftest* -ac_outfile=conftest.$ac_objext -printf "$lt_simple_link_test_code" >conftest.$ac_ext -eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_linker_boilerplate=`cat conftest.err` -$rm conftest* +# Only expand once: -# Allow CC to be a program name with arguments. -lt_save_CC="$CC" -CC=${RC-"windres"} -compiler=$CC -compiler_RC=$CC -for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac + +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 -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` +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 -lt_cv_prog_compiler_c_o_RC=yes -# The else clause should only fire when bootstrapping the -# libtool distribution, otherwise you forgot to ship ltmain.sh -# with your package, and you will get complaints that there are -# no rules to generate ltmain.sh. -if test -f "$ltmain"; then - # See if we are running on zsh, and set the options which allow our commands through - # without removal of \ escapes. - if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST - fi - # Now quote all the things that may contain metacharacters while being - # careful not to overquote the AC_SUBSTed values. We take copies of the - # variables and quote the copies for generation of the libtool script. - for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ - SED SHELL STRIP \ - libname_spec library_names_spec soname_spec extract_expsyms_cmds \ - old_striplib striplib file_magic_cmd finish_cmds finish_eval \ - deplibs_check_method reload_flag reload_cmds need_locks \ - lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ - lt_cv_sys_global_symbol_to_c_name_address \ - sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ - old_postinstall_cmds old_postuninstall_cmds \ - compiler_RC \ - CC_RC \ - LD_RC \ - lt_prog_compiler_wl_RC \ - lt_prog_compiler_pic_RC \ - lt_prog_compiler_static_RC \ - lt_prog_compiler_no_builtin_flag_RC \ - export_dynamic_flag_spec_RC \ - thread_safe_flag_spec_RC \ - whole_archive_flag_spec_RC \ - enable_shared_with_static_runtimes_RC \ - old_archive_cmds_RC \ - old_archive_from_new_cmds_RC \ - predep_objects_RC \ - postdep_objects_RC \ - predeps_RC \ - postdeps_RC \ - compiler_lib_search_path_RC \ - archive_cmds_RC \ - archive_expsym_cmds_RC \ - postinstall_cmds_RC \ - postuninstall_cmds_RC \ - old_archive_from_expsyms_cmds_RC \ - allow_undefined_flag_RC \ - no_undefined_flag_RC \ - export_symbols_cmds_RC \ - hardcode_libdir_flag_spec_RC \ - hardcode_libdir_flag_spec_ld_RC \ - hardcode_libdir_separator_RC \ - hardcode_automatic_RC \ - module_cmds_RC \ - module_expsym_cmds_RC \ - lt_cv_prog_compiler_c_o_RC \ - exclude_expsyms_RC \ - include_expsyms_RC; do - - case $var in - old_archive_cmds_RC | \ - old_archive_from_new_cmds_RC | \ - archive_cmds_RC | \ - archive_expsym_cmds_RC | \ - module_cmds_RC | \ - module_expsym_cmds_RC | \ - old_archive_from_expsyms_cmds_RC | \ - export_symbols_cmds_RC | \ - extract_expsyms_cmds | reload_cmds | finish_cmds | \ - postinstall_cmds | postuninstall_cmds | \ - old_postinstall_cmds | old_postuninstall_cmds | \ - sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) - # Double-quote double-evaled strings. - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" - ;; - *) - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" - ;; + +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 - done - - case $lt_echo in - *'\$0 --fallback-echo"') - lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` - ;; - esac - -cfgfile="$ofile" - - cat <<__EOF__ >> "$cfgfile" -# ### BEGIN LIBTOOL TAG CONFIG: $tagname + fi + cd .. + rm -f -r conftest.dir +fi -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# 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 -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL +/usr/include/X11 +/usr/include/X11R6 +/usr/include/X11R5 +/usr/include/X11R4 -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared +/usr/local/X11/include +/usr/local/X11R6/include +/usr/local/X11R5/include +/usr/local/X11R4/include -# Whether or not to build static libraries. -build_old_libs=$enable_static +/usr/local/include/X11 +/usr/local/include/X11R6 +/usr/local/include/X11R5 +/usr/local/include/X11R4 -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$archive_cmds_need_lc_RC +/usr/X386/include +/usr/x386/include +/usr/XFree86/include/X11 -# Whether or not to disallow shared libs when runtime libs are static -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC +/usr/include +/usr/local/include +/usr/unsupported/include +/usr/athena/include +/usr/local/x11r5/include +/usr/lpp/Xamples/include -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install +/usr/openwin/include +/usr/openwin/share/include' -# The host system. -host_alias=$host_alias -host=$host -host_os=$host_os +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 -# The build system. -build_alias=$build_alias -build=$build -build_os=$build_os + 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 -# An echo program that does not interpret backslashes. -echo=$lt_echo +rm -f conftest.err conftest.$ac_ext +fi # $ac_x_includes = no -# The archiver. -AR=$lt_AR -AR_FLAGS=$lt_AR_FLAGS +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 -# A C compiler. -LTCC=$lt_LTCC + 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 -# LTCC compiler flags. -LTCFLAGS=$lt_LTCFLAGS +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi # $ac_x_libraries = no -# A language-specific compiler. -CC=$lt_compiler_RC +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 -# Is the compiler the GNU C compiler? -with_gcc=$GCC_RC +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 -gcc_dir=\`$CC -print-file-name=. | $SED 's,/\.$,,'\` -gcc_ver=\`$CC -dumpversion\` +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 -# An ERE matcher. -EGREP=$lt_EGREP + 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 -# The linker used to build libraries. -LD=$lt_LD_RC + # 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. */ -# Whether we need hard or soft links. -LN_S=$lt_LN_S +int +main () +{ -# A BSD-compatible nm program. -NM=$lt_NM + ; + 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 -# A symbol stripping program -STRIP=$lt_STRIP + 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. */ -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=$MAGIC_CMD +int +main () +{ -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" + ; + 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 -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" + { echo "$as_me:$LINENO: result: neither works" >&5 +echo "${ECHO_T}neither works" >&6; } +fi -# Used on cygwin: assembler. -AS="$AS" +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi -# The name of the directory that contains temporary libtool files. -objdir=$objdir +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 -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds + # 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. -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl_RC + 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. */ -# Object file suffix (normally "o"). -objext="$ac_objext" +/* 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 -# Old archive suffix (normally "a"). -libext="$libext" + { 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. */ -# Shared library suffix (normally ".so"). -shrext_cmds='$shrext_cmds' +/* 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 -# Executable file suffix (normally ""). -exeext="$exeext" + ac_cv_lib_dnet_dnet_ntoa=no +fi -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic_RC -pic_mode=$pic_mode +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 -# What is the maximum length of a command? -max_cmd_len=$lt_cv_sys_max_cmd_len + 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. */ -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC +/* 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 -# Must we lock files when doing compilation? -need_locks=$lt_need_locks + ac_cv_lib_dnet_stub_dnet_ntoa=no +fi -# Do we need the lib prefix for modules? -need_lib_prefix=$need_lib_prefix +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 -# Do we need a version for libraries? -need_version=$need_version + fi +fi -# Whether dlopen is supported. -dlopen_support=$enable_dlopen +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$ac_xsave_LIBS" -# Whether dlopen of programs is supported. -dlopen_self=$enable_dlopen_self + # 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 -# Whether dlopen of statically linked programs is supported. -dlopen_self_static=$enable_dlopen_self_static +/* 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. */ -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_lt_prog_compiler_static_RC +#ifdef __STDC__ +# include +#else +# include +#endif -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC +#undef gethostbyname -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC +/* 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 -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC +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 -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC + ac_cv_func_gethostbyname=no +fi -# Library versioning type. -version_type=$version_type +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; } -# Format of library name prefix. -libname_spec=$lt_libname_spec + 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. */ -# 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 +/* 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 -# The coded name of the library, if different from the real name. -soname_spec=$lt_soname_spec + ac_cv_lib_nsl_gethostbyname=no +fi -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_old_archive_cmds_RC -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds +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 -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC + 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. */ -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC +/* 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 -# Commands used to build and install a shared archive. -archive_cmds=$lt_archive_cmds_RC -archive_expsym_cmds=$lt_archive_expsym_cmds_RC -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds + ac_cv_lib_bsd_gethostbyname=no +fi -# Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_module_cmds_RC -module_expsym_cmds=$lt_module_expsym_cmds_RC +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 -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib + fi + fi -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects=\`echo $lt_predep_objects_RC | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` - -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects=\`echo $lt_postdep_objects_RC | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` - -# Dependencies to place before the objects being linked to create a -# shared library. -predeps=$lt_predeps_RC - -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_postdeps_RC + # 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 -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_RC | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` +/* 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. */ -# Method to check whether dependent libraries are shared objects. -deplibs_check_method=$lt_deplibs_check_method +#ifdef __STDC__ +# include +#else +# include +#endif -# Command to use when deplibs_check_method == file_magic. -file_magic_cmd=$lt_file_magic_cmd +#undef connect -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag_RC +/* 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 -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag_RC +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 -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds + ac_cv_func_connect=no +fi -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$lt_finish_eval +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; } -# 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 + 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. */ -# Transform the output of nm in a proper C declaration -global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl +/* 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 -# 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 + ac_cv_lib_socket_connect=no +fi -# This is the shared library runtime path variable. -runpath_var=$runpath_var +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 -# This is the shared library path variable. -shlibpath_var=$shlibpath_var + fi -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath + # 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 -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action_RC +/* 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. */ -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs +#ifdef __STDC__ +# include +#else +# include +#endif -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_RC +#undef remove -# If ld is used when linking, flag to hardcode \$libdir into -# a binary during linking. This must work even if \$libdir does -# not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC - -# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$hardcode_direct_RC - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$hardcode_minus_L_RC - -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var_RC - -# Set to yes if building a shared library automatically hardcodes DIR into the library -# and all subsequent libraries and executables linked against it. -hardcode_automatic=$hardcode_automatic_RC +/* 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 -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" +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 -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs_RC + ac_cv_func_remove=no +fi -# Compile-time system search path for libraries -sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` +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; } -# Run-time system search path for libraries -sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec + 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. */ -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$fix_srcfile_path_RC" +/* 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 -# Set to yes if exported symbols are required. -always_export_symbols=$always_export_symbols_RC + ac_cv_lib_posix_remove=no +fi -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds_RC +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 -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds + fi -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms_RC + # 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 -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms_RC +/* 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. */ -# ### END LIBTOOL TAG CONFIG: $tagname +#ifdef __STDC__ +# include +#else +# include +#endif -__EOF__ +#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 - # If there is no Makefile yet, we rely on a make rule to execute - # `config.status --recheck' to rerun these tests and create the - # libtool script then. - ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` - if test -f "$ltmain_in"; then - test -f Makefile && make "$ltmain" - fi + 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; } -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 $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. */ -CC="$lt_save_CC" +/* 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 - *) - { { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5 -echo "$as_me: error: Unsupported tag name: $tagname" >&2;} - { (exit 1); exit 1; }; } - ;; - esac +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 - # Append the new tag name to the list of available tags. - if test -n "$tagname" ; then - available_tags="$available_tags $tagname" - fi fi - done - IFS="$lt_save_ifs" - - # Now substitute the updated list of available tags. - if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then - mv "${ofile}T" "$ofile" - chmod +x "$ofile" - else - rm -f "${ofile}T" - { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5 -echo "$as_me: error: unable to update list of available tagged configurations." >&2;} - { (exit 1); exit 1; }; } fi -fi - - - -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" - -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' - -# Prevent multiple expansion - - - - - - + # 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 - - - +# 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" + enable_unity="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" -# 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 "$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 - if test -n "$HAVE_PKG_CONFIG"; then - ac_cv_prog_HAVE_PKG_CONFIG="$HAVE_PKG_CONFIG" # Let the user override the test. + 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 -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 + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 - test -z "$ac_cv_prog_HAVE_PKG_CONFIG" && ac_cv_prog_HAVE_PKG_CONFIG="no" + 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 -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; } +{ 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: 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;} + { { 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 -### -### Libraries -### -{ echo "$as_me:$LINENO: checking for X" >&5 -echo $ECHO_N "checking for X... $ECHO_C" >&6; } + { 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 -# Check whether --with-x was given. -if test "${with_x+set}" = set; then - withval=$with_x; + ac_cv_header_X11_extensions_extutil_h=no 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 +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 - # 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 + { { 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 -# 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 + 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. */ -/usr/local/include/X11 -/usr/local/include/X11R6 -/usr/local/include/X11R5 -/usr/local/include/X11R4 +/* 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 -/usr/X386/include -/usr/x386/include -/usr/XFree86/include/X11 + ac_cv_lib_Xinerama_XineramaQueryVersion=no +fi -/usr/include -/usr/local/include -/usr/unsupported/include -/usr/athena/include -/usr/local/x11r5/include -/usr/lpp/Xamples/include +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 -/usr/openwin/include -/usr/openwin/share/include' + fi -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 + { 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. */ -@%:@include + +/* 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 -if { (ac_try="$ac_cpp conftest.$ac_ext" +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_cpp conftest.$ac_ext") 2>conftest.er1 + (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); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || test ! -s conftest.err - }; then - # We can compile using X headers with no special include directory. -ac_x_includes= + } && 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 - 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 + ac_cv_lib_Xrender_XRenderQueryVersion=no fi -rm -f conftest.err conftest.$ac_ext -fi # $ac_x_includes = no +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 -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 + + { 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. */ -@%:@include + +/* 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 () { -XrmInitialize () +return XRRQueryVersion (); ; return 0; } @@ -20526,97 +17661,131 @@ 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= + ac_cv_lib_Xrandr_XRRQueryVersion=yes 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 + 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 -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 +LIBS=$ac_check_lib_save_LIBS 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 +{ 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 - # 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; } + { { 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 -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 + + { 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. */ - X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS= +/* 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 - if test -n "$x_includes"; then - X_CFLAGS="$X_CFLAGS -I$x_includes" - fi + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 - # 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 + 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 + + + # If we're building with support for Unity, we'll need a few additional + # libraries. + if test "$enable_unity" != "no"; then + + # Unity needs the X11 Screen Saver extension library. It should be + # in the same place as the X11 libraries, so no need for any fancy + # path checking. + { echo "$as_me:$LINENO: checking for XScreenSaverQueryExtension in -lXss" >&5 +echo $ECHO_N "checking for XScreenSaverQueryExtension in -lXss... $ECHO_C" >&6; } +if test "${ac_cv_lib_Xss_XScreenSaverQueryExtension+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lXss $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 XScreenSaverQueryExtension (); int main () { - +return XScreenSaverQueryExtension (); ; return 0; } @@ -20639,25 +17808,64 @@ 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" + ac_cv_lib_Xss_XScreenSaverQueryExtension=yes 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 + ac_cv_lib_Xss_XScreenSaverQueryExtension=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_Xss_XScreenSaverQueryExtension" >&5 +echo "${ECHO_T}$ac_cv_lib_Xss_XScreenSaverQueryExtension" >&6; } +if test $ac_cv_lib_Xss_XScreenSaverQueryExtension = yes; then + COMMON_XLIBS="-lXss $COMMON_XLIBS" +else + { { echo "$as_me:$LINENO: error: libXss not found. Please configure without Unity (using --disable-unity) or install the libXss devel package." >&5 +echo "$as_me: error: libXss not found. Please configure without Unity (using --disable-unity) or install the libXss devel package." >&2;} + { (exit 1); exit 1; }; } +fi + + + # Check for the uriparser library and headers. The upstream uriparser + # doesn't appear to ship with either a pkg-config file or a + # uriparser-config binary, so we'll look for it the old-fashioned + # way. + # + # Note that we look for uriFreeQueryListA because it's a relatively + # new symbol that our code needs (it isn't present in the uriparser + # that shipped with Ubuntu Hardy). + ORIGINAL_LDFLAGS="$LDFLAGS" + LDFLAGS="$CUSTOM_URIPARSER_LIBS $LDFLAGS" + { echo "$as_me:$LINENO: checking for uriFreeQueryListA in -luriparser" >&5 +echo $ECHO_N "checking for uriFreeQueryListA in -luriparser... $ECHO_C" >&6; } +if test "${ac_cv_lib_uriparser_uriFreeQueryListA+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-luriparser $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 uriFreeQueryListA (); int main () { - +return uriFreeQueryListA (); ; return 0; } @@ -20680,39 +17888,263 @@ 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" + ac_cv_lib_uriparser_uriFreeQueryListA=yes 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; } + ac_cv_lib_uriparser_uriFreeQueryListA=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_uriparser_uriFreeQueryListA" >&5 +echo "${ECHO_T}$ac_cv_lib_uriparser_uriFreeQueryListA" >&6; } +if test $ac_cv_lib_uriparser_uriFreeQueryListA = yes; then + if test -n "$CUSTOM_URIPARSER_LIBS"; then + URIPARSER_LIBS="$CUSTOM_URIPARSER_LIBS" + else + URIPARSER_LIBS="-luriparser" + fi +else + { { echo "$as_me:$LINENO: error: uriparser library not found or is too old. Please configure without Unity (using --disable-unity) or install the liburiparser devel package." >&5 +echo "$as_me: error: uriparser library not found or is too old. Please configure without Unity (using --disable-unity) or install the liburiparser devel package." >&2;} + { (exit 1); exit 1; }; } 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 + LDFLAGS="$ORIGINAL_LDFLAGS" + + if test -n "$CUSTOM_URIPARSER_CPPFLAGS"; then + URIPARSER_CPPFLAGS="$CUSTOM_URIPARSER_CPPFLAGS" + else + # XXX: No pkg-config and no uriparser-config means we need to + # hard-code a sensible default. + URIPARSER_CPPFLAGS="-I/usr/include/uriparser" + fi + ORIGINAL_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$URIPARSER_CPPFLAGS $CPPFLAGS" + if test "${ac_cv_header_Uri_h+set}" = set; then + { echo "$as_me:$LINENO: checking for Uri.h" >&5 +echo $ECHO_N "checking for Uri.h... $ECHO_C" >&6; } +if test "${ac_cv_header_Uri_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_Uri_h" >&5 +echo "${ECHO_T}$ac_cv_header_Uri_h" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking Uri.h usability" >&5 +echo $ECHO_N "checking Uri.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 Uri.h presence" >&5 +echo $ECHO_N "checking Uri.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: Uri.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: Uri.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: Uri.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: Uri.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: Uri.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: Uri.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: Uri.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: Uri.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: Uri.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: Uri.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: Uri.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: Uri.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: Uri.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: Uri.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: Uri.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: Uri.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 Uri.h" >&5 +echo $ECHO_N "checking for Uri.h... $ECHO_C" >&6; } +if test "${ac_cv_header_Uri_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_Uri_h=$ac_header_preproc +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_Uri_h" >&5 +echo "${ECHO_T}$ac_cv_header_Uri_h" >&6; } + +fi +if test $ac_cv_header_Uri_h = yes; then + : +else + { { echo "$as_me:$LINENO: error: uriparser headers not found. Please configure without Unity (using --disable-unity) or install the liburiparser devel package" >&5 +echo "$as_me: error: uriparser headers not found. Please configure without Unity (using --disable-unity) or install the liburiparser devel package" >&2;} + { (exit 1); exit 1; }; } +fi + + + CPPFLAGS="$ORIGINAL_CPPFLAGS" + + # Check for libpng using pkg-config, or barring that, using + # libpng-config. + if test "$HAVE_PKG_CONFIG" = "yes"; then + { echo "$as_me:$LINENO: checking for libpng (via pkg-config)" >&5 +echo $ECHO_N "checking for libpng (via pkg-config)... $ECHO_C" >&6; } + if pkg-config --exists libpng12; then + LIBPNG_CPPFLAGS="`pkg-config --cflags libpng12`" + LIBPNG_LIBS="`pkg-config --libs libpng12`" + { 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 + else + # Extract the first word of "libpng-config", so it can be a program name with args. +set dummy libpng-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_LIBPNG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $LIBPNG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_LIBPNG_CONFIG="$LIBPNG_CONFIG" # 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_LIBPNG_CONFIG="$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 - # 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. + test -z "$ac_cv_path_LIBPNG_CONFIG" && ac_cv_path_LIBPNG_CONFIG="no" + ;; +esac +fi +LIBPNG_CONFIG=$ac_cv_path_LIBPNG_CONFIG +if test -n "$LIBPNG_CONFIG"; then + { echo "$as_me:$LINENO: result: $LIBPNG_CONFIG" >&5 +echo "${ECHO_T}$LIBPNG_CONFIG" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi - 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 + + if test "$LIBPNG_CONFIG" != "no"; then + LIBPNG_CPPFLAGS="`$LIBPNG_CONFIG --cflags`" + LIBPNG_LIBS="`$LIBPNG_CONFIG --libs`" + fi + fi + if test -z "$LIBPNG_CPPFLAGS"; then + { { echo "$as_me:$LINENO: error: libpng not found. Please configure without Unity (using --disable-unity) or install the libpng devel package" >&5 +echo "$as_me: error: libpng not found. Please configure without Unity (using --disable-unity) or install the libpng devel package" >&2;} + { (exit 1); exit 1; }; } + fi + + # Check for the zlib library and headers. Like uriparser, there + # isn't a pkg-config or zlib-config file. + ORIGINAL_LDFLAGS="$LDFLAGS" + LDFLAGS="$CUSTOM_ZLIB_LIBS $LDFLAGS" + { echo "$as_me:$LINENO: checking for zlibVersion in -lz" >&5 +echo $ECHO_N "checking for zlibVersion in -lz... $ECHO_C" >&6; } +if test "${ac_cv_lib_z_zlibVersion+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lz $LIBS" +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -20725,11 +18157,11 @@ #ifdef __cplusplus extern "C" #endif -char XOpenDisplay (); +char zlibVersion (); int main () { -return XOpenDisplay (); +return zlibVersion (); ; return 0; } @@ -20752,84 +18184,197 @@ test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - : + ac_cv_lib_z_zlibVersion=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_z_zlibVersion=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_z_zlibVersion" >&5 +echo "${ECHO_T}$ac_cv_lib_z_zlibVersion" >&6; } +if test $ac_cv_lib_z_zlibVersion = yes; then + if test -n "$CUSTOM_ZLIB_LIBS"; then + ZLIB_LIBS="$CUSTOM_ZLIB_LIBS" + else + ZLIB_LIBS="-lz" + fi +else + { { echo "$as_me:$LINENO: error: zlib library not found. Please configure without Unity (using --disable-unity) or install the zlib devel package." >&5 +echo "$as_me: error: zlib library not found. Please configure without Unity (using --disable-unity) or install the zlib devel package." >&2;} + { (exit 1); exit 1; }; } +fi + + LDFLAGS="$ORIGINAL_LDFLAGS" + + if test -n "$CUSTOM_ZLIB_CPPFLAGS"; then + ZLIB_CPPFLAGS="$CUSTOM_ZLIB_CPPFLAGS" + else + # XXX: No pkg-config and no zlib-config means we need to + # hard-code a sensible default. + ZLIB_CPPFLAGS="-I/usr/include" + fi + ORIGINAL_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$ZLIB_CPPFLAGS $CPPFLAGS" + if test "${ac_cv_header_zlib_h+set}" = set; then + { echo "$as_me:$LINENO: checking for zlib.h" >&5 +echo $ECHO_N "checking for zlib.h... $ECHO_C" >&6; } +if test "${ac_cv_header_zlib_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5 +echo "${ECHO_T}$ac_cv_header_zlib_h" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking zlib.h usability" >&5 +echo $ECHO_N "checking zlib.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 - { 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" + 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 zlib.h presence" >&5 +echo $ECHO_N "checking zlib.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. */ - -/* 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; -} +@%:@include _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" +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_link") 2>conftest.er1 + (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); } && { - test -z "$ac_c_werror_flag" || + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$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 + }; then + ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_dnet_dnet_ntoa=no + ac_header_preproc=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 +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: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: zlib.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: zlib.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: zlib.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: zlib.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: zlib.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: zlib.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: zlib.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: zlib.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: zlib.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: zlib.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: zlib.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: zlib.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 zlib.h" >&5 +echo $ECHO_N "checking for zlib.h... $ECHO_C" >&6; } +if test "${ac_cv_header_zlib_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_zlib_h=$ac_header_preproc 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" +{ echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5 +echo "${ECHO_T}$ac_cv_header_zlib_h" >&6; } + +fi +if test $ac_cv_header_zlib_h = yes; then + : +else + { { echo "$as_me:$LINENO: error: zlib headers not found. Please configure without Unity (using --disable-unity) or install the zlib devel package" >&5 +echo "$as_me: error: zlib headers not found. Please configure without Unity (using --disable-unity) or install the zlib devel package" >&2;} + { (exit 1); exit 1; }; } 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 + + CPPFLAGS="$ORIGINAL_CPPFLAGS" + fi # End of library checks for Unity. + + if test -n "$CUSTOM_GTK_CPPFLAGS" -o -n "$CUSTOM_GTK_LIBS"; then + # Check to see if we have some version of GTK. gtk_accel_group_add + # is a random function that is present in Gtk 1.2 but not Gtk + # 2.0. Similarly, gtk_tree_view_new is a random function in Gtk 2.0 + # which is not present in Gtk 1.2. + { echo "$as_me:$LINENO: checking for gtk_accel_group_add in -lgtk" >&5 +echo $ECHO_N "checking for gtk_accel_group_add in -lgtk... $ECHO_C" >&6; } +if test "${ac_cv_lib_gtk_gtk_accel_group_add+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-ldnet_stub $LIBS" +LIBS="-lgtk $CUSTOM_GTK_LIBS $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -20843,11 +18388,11 @@ #ifdef __cplusplus extern "C" #endif -char dnet_ntoa (); +char gtk_accel_group_add (); int main () { -return dnet_ntoa (); +return gtk_accel_group_add (); ; return 0; } @@ -20870,66 +18415,38 @@ test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - ac_cv_lib_dnet_stub_dnet_ntoa=yes + ac_cv_lib_gtk_gtk_accel_group_add=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_dnet_stub_dnet_ntoa=no + ac_cv_lib_gtk_gtk_accel_group_add=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 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_gtk_gtk_accel_group_add" >&5 +echo "${ECHO_T}$ac_cv_lib_gtk_gtk_accel_group_add" >&6; } +if test $ac_cv_lib_gtk_gtk_accel_group_add = yes; then + HAVE_GTK1="yes" 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 + if test "$with_gtk2" != "no"; then + { echo "$as_me:$LINENO: checking for gtk_tree_view_new in -lgtk-x11-2.0" >&5 +echo $ECHO_N "checking for gtk_tree_view_new in -lgtk-x11-2.0... $ECHO_C" >&6; } +if test "${ac_cv_lib_gtk_x11_2_0_gtk_tree_view_new+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_check_lib_save_LIBS=$LIBS +LIBS="-lgtk-x11-2.0 $CUSTOM_GTK_LIBS $LIBS" +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 @@ -20937,18 +18454,11 @@ #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 - +char gtk_tree_view_new (); int main () { -return gethostbyname (); +return gtk_tree_view_new (); ; return 0; } @@ -20971,28 +18481,120 @@ test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - ac_cv_func_gethostbyname=yes + ac_cv_lib_gtk_x11_2_0_gtk_tree_view_new=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_func_gethostbyname=no + ac_cv_lib_gtk_x11_2_0_gtk_tree_view_new=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_gtk_x11_2_0_gtk_tree_view_new" >&5 +echo "${ECHO_T}$ac_cv_lib_gtk_x11_2_0_gtk_tree_view_new" >&6; } +if test $ac_cv_lib_gtk_x11_2_0_gtk_tree_view_new = yes; then + HAVE_GTK2="yes" 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 + fi + fi + + # Sometimes pkg-config can find stuff that AC_CHECK_LIB can't, so we use that as well. + if test "$HAVE_PKG_CONFIG" = "yes"; then + if test "$with_gtk2" != "no"; then + { 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 + HAVE_GTK2="yes" + { 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 + fi + + { echo "$as_me:$LINENO: checking for Gtk+ 1.x (via pkg-config)" >&5 +echo $ECHO_N "checking for Gtk+ 1.x (via pkg-config)... $ECHO_C" >&6; } + # The latter half of the test is because pkg-config's fallback + # to gtk-config is broken on systems such as Ubuntu that use + # bash-completion for unknown commands. (On Ubuntu, typing + # 'gtk-config' on a system that doesn't have libgtk1.2-dev + # installed outputs hints about using apt-get, in addition to the + # regular bash "command not found" message.) + if pkg-config --exists gtk+ \ + && test -n "`pkg-config --libs gtk+ 2>/dev/null | grep -v '^ *$'`"; then + HAVE_GTK1="yes" + { 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 + fi + + if test "$HAVE_GTK1" = "yes" -o "$HAVE_GTK2" = "yes"; then + # This bit is to fix builds on OpenSolaris B71, where + # 'pkg-config --cflags gtk+-2.0' gives an error. + if test "$HAVE_GTK2" = "yes" -a "$HAVE_PKG_CONFIG" = "yes" \ + && ! pkg-config --exists gtk+-2.0 \ + && test -z "$CUSTOM_GTK_CPPFLAGS" -a -z "$CUSTOM_GTK_LIBS"; then + HAVE_GTK2="no" + fi + + if test "$HAVE_GTK2" = "yes"; then + # Gtk 2.0 + GTK_CPPFLAGS="$GTK_CPPFLAGS -DGTK2" + gtkPackageName="gtk+-2.0" + elif test "$HAVE_GTK1" = "yes"; then + # Gtk 1.2 + gtkPackageName="gtk+" + + # Unity requires Gtk 2.0. + if test "$enable_unity" != "no"; then + { { echo "$as_me:$LINENO: error: The Unity feature requires Gtk+ 2.0. Please install the Gtk+ 2.0 devel packages or configure without Unity (using --disable-unity)" >&5 +echo "$as_me: error: The Unity feature requires Gtk+ 2.0. Please install the Gtk+ 2.0 devel packages or configure without Unity (using --disable-unity)" >&2;} + { (exit 1); exit 1; }; } + fi + else + # We found Gtk+ 2.0 that turned out to have a non-working + # pkg-config setup, AND Gtk 1.2 wasn't installed. + { { echo "$as_me:$LINENO: error: The Gtk+ library installed on your system is not fully functional. Please contact your OS vendor." >&5 +echo "$as_me: error: The Gtk+ library installed on your system is not fully functional. Please contact your OS vendor." >&2;} + { (exit 1); exit 1; }; } + fi + + # Prefer flags specified, in the environment, by the user. + if test -n "$CUSTOM_GTK_CPPFLAGS" -o -n "$CUSTOM_GTK_LIBS"; then + GTK_CPPFLAGS="$GTK_CPPFLAGS $CUSTOM_GTK_CPPFLAGS" + GTK_LIBS="$GTK_LIBS $CUSTOM_GTK_LIBS" + # Use pkg-config if available and there are no user-specified flags. + elif test "$HAVE_PKG_CONFIG" = "yes"; then + GTK_CPPFLAGS="$GTK_CPPFLAGS $(pkg-config --cflags $gtkPackageName)" + GTK_LIBS="$GTK_LIBS $(pkg-config --libs $gtkPackageName)" + # Otherwise, we have a problem. + else + { { echo "$as_me:$LINENO: error: pkg-config not found. Get pkg-config or set CUSTOM_GTK_CPPFLAGS and CUSTOM_GTK_LIBS to specify gtk header file and library locations." >&5 +echo "$as_me: error: pkg-config not found. Get pkg-config or set CUSTOM_GTK_CPPFLAGS and CUSTOM_GTK_LIBS to specify gtk header file and library locations." >&2;} + { (exit 1); exit 1; }; } + fi + + # Check for a sufficiently new installation of Gtk 2.0. This symbol is, at + # the time of writing, used in vmware-user. We must perform this check + # after GTK_LIBS has been set up. Note: we don't actually use the + # resultant HAVE_NEW_GTK2 variable; it's just set so that the default + # action, which will append gdk-x11-2.0 to LIBS, isn't taken. + if test "$HAVE_GTK2" == "yes"; then + { echo "$as_me:$LINENO: checking for gdk_display_get_default_group in -lgdk-x11-2.0" >&5 +echo $ECHO_N "checking for gdk_display_get_default_group in -lgdk-x11-2.0... $ECHO_C" >&6; } +if test "${ac_cv_lib_gdk_x11_2_0_gdk_display_get_default_group+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lnsl $LIBS" +LIBS="-lgdk-x11-2.0 $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -21006,11 +18608,11 @@ #ifdef __cplusplus extern "C" #endif -char gethostbyname (); +char gdk_display_get_default_group (); int main () { -return gethostbyname (); +return gdk_display_get_default_group (); ; return 0; } @@ -21033,32 +18635,41 @@ test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - ac_cv_lib_nsl_gethostbyname=yes + ac_cv_lib_gdk_x11_2_0_gdk_display_get_default_group=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_nsl_gethostbyname=no + ac_cv_lib_gdk_x11_2_0_gdk_display_get_default_group=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" +{ echo "$as_me:$LINENO: result: $ac_cv_lib_gdk_x11_2_0_gdk_display_get_default_group" >&5 +echo "${ECHO_T}$ac_cv_lib_gdk_x11_2_0_gdk_display_get_default_group" >&6; } +if test $ac_cv_lib_gdk_x11_2_0_gdk_display_get_default_group = yes; then + HAVE_NEW_GTK2="yes" +else + { { echo "$as_me:$LINENO: error: Gtk 2.0 installation may be too old. Please upgrade your Gtk 2.0 packages or configure without Gtk 2.0 (using --without-gtk2)" >&5 +echo "$as_me: error: Gtk 2.0 installation may be too old. Please upgrade your Gtk 2.0 packages or configure without Gtk 2.0 (using --without-gtk2)" >&2;} + { (exit 1); exit 1; }; } + $GTK_LIBS 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 + fi + + # Unity requires libgdk_pixbuf_xlib, which most systems don't seem to + # provide via "pkg-config --libs gtk+-2.0". + if test "$enable_unity" != "no"; then + { echo "$as_me:$LINENO: checking for gdk_pixbuf_xlib_init in -lgdk_pixbuf_xlib-2.0" >&5 +echo $ECHO_N "checking for gdk_pixbuf_xlib_init in -lgdk_pixbuf_xlib-2.0... $ECHO_C" >&6; } +if test "${ac_cv_lib_gdk_pixbuf_xlib_2_0_gdk_pixbuf_xlib_init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lbsd $LIBS" +LIBS="-lgdk_pixbuf_xlib-2.0 $GTK_LIBS $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -21072,11 +18683,11 @@ #ifdef __cplusplus extern "C" #endif -char gethostbyname (); +char gdk_pixbuf_xlib_init (); int main () { -return gethostbyname (); +return gdk_pixbuf_xlib_init (); ; return 0; } @@ -21099,61 +18710,49 @@ test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - ac_cv_lib_bsd_gethostbyname=yes + ac_cv_lib_gdk_pixbuf_xlib_2_0_gdk_pixbuf_xlib_init=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_bsd_gethostbyname=no + ac_cv_lib_gdk_pixbuf_xlib_2_0_gdk_pixbuf_xlib_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_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" +{ echo "$as_me:$LINENO: result: $ac_cv_lib_gdk_pixbuf_xlib_2_0_gdk_pixbuf_xlib_init" >&5 +echo "${ECHO_T}$ac_cv_lib_gdk_pixbuf_xlib_2_0_gdk_pixbuf_xlib_init" >&6; } +if test $ac_cv_lib_gdk_pixbuf_xlib_2_0_gdk_pixbuf_xlib_init = yes; then + GTK_LIBS="$GTK_LIBS -lgdk_pixbuf_xlib-2.0" +else + { { echo "$as_me:$LINENO: error: gdk_pixbuf_xlib-2.0 not found. Make sure your Gtk 2.0 installation is sane, or configure without Unity (using --disable-unity)." >&5 +echo "$as_me: error: gdk_pixbuf_xlib-2.0 not found. Make sure your Gtk 2.0 installation is sane, or configure without Unity (using --disable-unity)." >&2;} + { (exit 1); exit 1; }; } fi fi - fi + else + { { echo "$as_me:$LINENO: error: libgtk not found. Please install the gtk devel package(s)." >&5 +echo "$as_me: error: libgtk not found. Please install the gtk devel package(s)." >&2;} + { (exit 1); exit 1; }; } + fi +fi # End of checks for X libraries - # 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 "$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 - cat >conftest.$ac_ext <<_ACEOF + 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. */ -/* 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 @@ -21161,18 +18760,11 @@ #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 - +char crypt (); int main () { -return connect (); +return crypt (); ; return 0; } @@ -21195,28 +18787,37 @@ test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - ac_cv_func_connect=yes + ac_cv_lib_crypt_crypt=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_func_connect=no + 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" + GUESTD_LDADD="$GUESTD_LDADD -lcrypt" +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 -{ 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 "$as_me:$LINENO: checking for notify_init in -lnotify" >&5 +echo $ECHO_N "checking for notify_init in -lnotify... $ECHO_C" >&6; } +if test "${ac_cv_lib_notify_notify_init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lsocket $X_EXTRA_LIBS $LIBS" +LIBS="-lnotify $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -21230,11 +18831,11 @@ #ifdef __cplusplus extern "C" #endif -char connect (); +char notify_init (); int main () { -return connect (); +return notify_init (); ; return 0; } @@ -21257,30 +18858,36 @@ test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - ac_cv_lib_socket_connect=yes + ac_cv_lib_notify_notify_init=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_socket_connect=no + ac_cv_lib_notify_notify_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_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" +{ echo "$as_me:$LINENO: result: $ac_cv_lib_notify_notify_init" >&5 +echo "${ECHO_T}$ac_cv_lib_notify_notify_init" >&6; } +if test $ac_cv_lib_notify_notify_init = yes; then + HAVE_NOTIFY="yes" + VMWARE_USER_LDADD="$VMWARE_USER_LDADD -lnotify" +else + { echo "$as_me:$LINENO: WARNING: libnotify not found; notification disabled" >&5 +echo "$as_me: WARNING: libnotify not found; notification disabled" >&2;} 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 + +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 @@ -21289,12 +18896,12 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define remove to an innocuous variant, in case declares remove. +/* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ -#define remove innocuous_remove +#define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char remove (); below. + which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ @@ -21304,7 +18911,7 @@ # include #endif -#undef remove +#undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC @@ -21312,18 +18919,18 @@ #ifdef __cplusplus extern "C" #endif -char remove (); +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_remove || defined __stub___remove +#if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { -return remove (); +return $ac_func (); ; return 0; } @@ -21346,28 +18953,33 @@ test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - ac_cv_func_remove=yes + eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_func_remove=no + 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 -{ 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 +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="-lposix $LIBS" +LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -21381,11 +18993,11 @@ #ifdef __cplusplus extern "C" #endif -char remove (); +char dlopen (); int main () { -return remove (); +return dlopen (); ; return 0; } @@ -21408,30 +19020,39 @@ test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - ac_cv_lib_posix_remove=yes + ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_posix_remove=no + 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_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" +{ 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 + GUESTD_LDADD="$GUESTD_LDADD -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 +fi +done - # 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 + + +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 @@ -21440,12 +19061,12 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define shmat to an innocuous variant, in case declares shmat. +/* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ -#define shmat innocuous_shmat +#define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char shmat (); below. + which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ @@ -21455,7 +19076,7 @@ # include #endif -#undef shmat +#undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC @@ -21463,18 +19084,18 @@ #ifdef __cplusplus extern "C" #endif -char shmat (); +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_shmat || defined __stub___shmat +#if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { -return shmat (); +return $ac_func (); ; return 0; } @@ -21497,34 +19118,59 @@ test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - ac_cv_func_shmat=yes + eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_func_shmat=no + 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 -{ echo "$as_me:$LINENO: result: $ac_cv_func_shmat" >&5 -echo "${ECHO_T}$ac_cv_func_shmat" >&6; } +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 $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 + +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 - ac_check_lib_save_LIBS=$LIBS -LIBS="-lipc $LIBS" -cat >conftest.$ac_ext <<_ACEOF + 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 @@ -21532,11 +19178,18 @@ #ifdef __cplusplus extern "C" #endif -char shmat (); +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 shmat (); +return $ac_func (); ; return 0; } @@ -21559,43 +19212,36 @@ test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - ac_cv_lib_ipc_shmat=yes + eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_ipc_shmat=no + eval "$as_ac_var=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" +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 - 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 "$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="-lICE $X_EXTRA_LIBS $LIBS" +LIBS="-lpthread $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -21609,11 +19255,11 @@ #ifdef __cplusplus extern "C" #endif -char IceConnectionNumber (); +char pthread_mutex_init (); int main () { -return IceConnectionNumber (); +return pthread_mutex_init (); ; return 0; } @@ -21636,50 +19282,63 @@ test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - ac_cv_lib_ICE_IceConnectionNumber=yes + 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_ICE_IceConnectionNumber=no + 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_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" +{ 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 + GUESTD_LDADD="$GUESTD_LDADD -lpthread" + VMWARE_USER_LDADD="$VMWARE_USER_LDADD -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 - LDFLAGS=$ac_save_LDFLAGS +# 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 the user explicitly disables X11, then don't try to detect the X-related libraries -if test "$have_x" = "disabled"; then - MULTIMON_ENABLED="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; }; } +if test "$os" = "linux"; then + +# Check whether --with-procps was given. +if test "${with_procps+set}" = set; then + withval=$with_procps; else - LIBS="$LIBS $X_LIBS" - CFLAGS="$CFLAGS $X_CFLAGS" - COMMON_XLIBS="-lX11" - COMMON_XLIBS="-lXext $COMMON_XLIBS" + with_procps=yes +fi - if test "$MULTIMON_ENABLED" != "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 +else + with_procps="no" +fi + +if test "$with_procps" = "yes"; then + ORIGINAL_LDFLAGS="$LDFLAGS" + LDFLAGS="$CUSTOM_PROCPS_LIBS $LDFLAGS" + { echo "$as_me:$LINENO: checking for getstat in -lproc-3.2.7" >&5 +echo $ECHO_N "checking for getstat in -lproc-3.2.7... $ECHO_C" >&6; } +if test "${ac_cv_lib_proc_3_2_7_getstat+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lXinerama $COMMON_XLIBS $LIBS" +LIBS="-lproc-3.2.7 $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -21693,11 +19352,11 @@ #ifdef __cplusplus extern "C" #endif -char XineramaQueryVersion (); +char getstat (); int main () { -return XineramaQueryVersion (); +return getstat (); ; return 0; } @@ -21720,37 +19379,330 @@ test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - ac_cv_lib_Xinerama_XineramaQueryVersion=yes + ac_cv_lib_proc_3_2_7_getstat=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_Xinerama_XineramaQueryVersion=no + ac_cv_lib_proc_3_2_7_getstat=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" +{ echo "$as_me:$LINENO: result: $ac_cv_lib_proc_3_2_7_getstat" >&5 +echo "${ECHO_T}$ac_cv_lib_proc_3_2_7_getstat" >&6; } +if test $ac_cv_lib_proc_3_2_7_getstat = yes; then + if test -n "$CUSTOM_PROCPS_LIBS"; then + PROCPS_LIBS="$CUSTOM_PROCPS_LIBS" + else + PROCPS_LIBS="-lproc-3.2.7" + fi 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;} + { { 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 + LDFLAGS="$ORIGINAL_LDFLAGS" + + GUESTD_LDADD="$GUESTD_LDADD $PROCPS_LIBS" + VMWARE_USER_LDADD="$VMWARE_USER_LDADD $PROCPS_LIBS" +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 + + +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. + for ac_prog in dumbnet-config dnet-config +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_DNET_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$DNET_CONFIG"; then + ac_cv_prog_DNET_CONFIG="$DNET_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_DNET_CONFIG="$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 +DNET_CONFIG=$ac_cv_prog_DNET_CONFIG +if test -n "$DNET_CONFIG"; then + { echo "$as_me:$LINENO: result: $DNET_CONFIG" >&5 +echo "${ECHO_T}$DNET_CONFIG" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$DNET_CONFIG" && break +done +test -n "$DNET_CONFIG" || DNET_CONFIG="no" + + + if test "$DNET_CONFIG" != no; then + DNET_CPPFLAGS="`$DNET_CONFIG --cflags`" + DNET_LIBS="`$DNET_CONFIG --libs`" + + GUESTD_LDADD="$GUESTD_LDADD $DNET_LIBS" + VMWARE_USER_LDADD="$VMWARE_USER_LDADD $DNET_LIBS" + if test "$DNET_CONFIG" == dumbnet-config; then + +cat >>confdefs.h <<\_ACEOF +@%:@define DNET_IS_DUMBNET 1 +_ACEOF + + fi + else + { { 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 "$with_icu" = "yes"; 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_ICU_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $ICU_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ICU_CONFIG="$ICU_CONFIG" # 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_ICU_CONFIG="$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_ICU_CONFIG" && ac_cv_path_ICU_CONFIG="no" + ;; +esac +fi +ICU_CONFIG=$ac_cv_path_ICU_CONFIG +if test -n "$ICU_CONFIG"; then + { echo "$as_me:$LINENO: result: $ICU_CONFIG" >&5 +echo "${ECHO_T}$ICU_CONFIG" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + + if test "$ICU_CONFIG" != no; then + ICU_CPPFLAGS="`$ICU_CONFIG --cppflags` -DUSE_ICU" + ICU_LIBS="`$ICU_CONFIG --ldflags`" + + # The icu components are built with C++, so we need to ensure + # that the C++ linker actually exists, and use it when linking + # icu into our applications and when performing configuration + # tests against icu. + # + # XXX: Getting automake to choose between the C linker and the + # C++ linker depending on HAVE_ICU was a royal pain in the ass. + # The classic way to do this is to define an optional source + # file for a program with an extension of .cxx, using + # nodist_EXTRA_fooprogram_SOURCES. This causes automake's + # linker detection algorithm to see a C++ source file and + # automatically set up the C++ linker and link line for us. + # Unfortunately, said linker detection doesn't obey + # conditionals, which means that it'd always pick the C++ + # linker, regardless of the value of HAVE_ICU. Instead, we are + # forced to manually set the correct linker in fooprogram_LINK. + # However, since none of our programs actually contain C++ + # code, automake doesn't make the CXXLINK variable (which + # contains the linker as well as all link flags) available to + # us, so we must hard-code the entire link line into + # fooprogram_LINK. Not exactly a futureproof solution... + # + # Additional references on this problem: + # http://sources.redhat.com/ml/automake/1999-10/msg00101.html + # http://lists.gnu.org/archive/html/bug-automake/2008-04/msg00010.html + # http://www.gnu.org/software/automake/manual/automake.html#Libtool-Convenience-Libraries + # http://www.gnu.org/software/automake/manual/automake.html#C_002b_002b-Support + 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="" + 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 -z "$HAVE_CXX"; then + { { echo "$as_me:$LINENO: error: No C++ compiler was found on your PATH. Please configure without ICU (using --without-icu) or install a C++ compiler." >&5 +echo "$as_me: error: No C++ compiler was found on your PATH. Please configure without ICU (using --without-icu) or install a C++ compiler." >&2;} + { (exit 1); exit 1; }; } + 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 - { 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 "$as_me:$LINENO: checking for ucasemap_utf8ToTitle_3_8 in -licuuc" >&5 +echo $ECHO_N "checking for ucasemap_utf8ToTitle_3_8 in -licuuc... $ECHO_C" >&6; } +if test "${ac_cv_lib_icuuc_ucasemap_utf8ToTitle_3_8+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lXrandr -lXrender $COMMON_XLIBS $LIBS" +LIBS="-licuuc $ICU_LIBS $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -21764,11 +19716,11 @@ #ifdef __cplusplus extern "C" #endif -char XRRQueryVersion (); +char ucasemap_utf8ToTitle_3_8 (); int main () { -return XRRQueryVersion (); +return ucasemap_utf8ToTitle_3_8 (); ; return 0; } @@ -21787,71 +19739,130 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || + test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - ac_cv_lib_Xrandr_XRRQueryVersion=yes + ac_cv_lib_icuuc_ucasemap_utf8ToTitle_3_8=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_Xrandr_XRRQueryVersion=no + ac_cv_lib_icuuc_ucasemap_utf8ToTitle_3_8=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" - COMMON_XLIBS="-lXrender $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;} +{ echo "$as_me:$LINENO: result: $ac_cv_lib_icuuc_ucasemap_utf8ToTitle_3_8" >&5 +echo "${ECHO_T}$ac_cv_lib_icuuc_ucasemap_utf8ToTitle_3_8" >&6; } +if test $ac_cv_lib_icuuc_ucasemap_utf8ToTitle_3_8 = yes; then + have_ICU_38="yes" +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 "$have_ICU_38" = "yes"; then + ICU_CPPFLAGS="$ICU_CPPFLAGS -DHAVE_ICU_38" + fi + + # Easier to give all modules the ICU defines/includes... + CPPFLAGS="$CPPFLAGS $ICU_CPPFLAGS" + else + { { echo "$as_me:$LINENO: error: icu-config was not found on your PATH. Please configure without ICU (using --without-icu) or install ICU - http://www.icu-project.org" >&5 +echo "$as_me: error: icu-config was not found on your PATH. Please configure without ICU (using --without-icu) or install ICU - http://www.icu-project.org" >&2;} { (exit 1); exit 1; }; } + fi +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 - { 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 + +### +### 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 - ac_check_lib_save_LIBS=$LIBS -LIBS="-lXtst $COMMON_XLIBS $LIBS" + # 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. */ - -/* 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; -} +$ac_includes_default +@%:@include <$ac_header> _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" +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_link") 2>conftest.er1 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -21860,73 +19871,143 @@ (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 + } && 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_cv_lib_Xtst_XTestQueryExtension=no + ac_header_compiler=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 +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 -{ 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" + +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 - { { 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; }; } + 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 -n "$CUSTOM_GTK_CFLAGS" -o -n "$CUSTOM_GTK_LIBS"; then - # Check to see if we have some version of GTK. gtk_accel_group_add - # is a random function that is present in Gtk 1.2 but not Gtk - # 2.0. Similarly, gtk_tree_view_new is a random function in Gtk 2.0 - # which is not present in Gtk 1.2. - { echo "$as_me:$LINENO: checking for gtk_accel_group_add in -lgtk" >&5 -echo $ECHO_N "checking for gtk_accel_group_add in -lgtk... $ECHO_C" >&6; } -if test "${ac_cv_lib_gtk_gtk_accel_group_add+set}" = set; then + +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 - ac_check_lib_save_LIBS=$LIBS -LIBS="-lgtk $CUSTOM_GTK_LIBS $LIBS" + # 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. */ - -/* 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 gtk_accel_group_add (); -int -main () -{ -return gtk_accel_group_add (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" +$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_link") 2>conftest.er1 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -21935,208 +20016,143 @@ (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_gtk_gtk_accel_group_add=yes + } && 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_cv_lib_gtk_gtk_accel_group_add=no + ac_header_compiler=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_gtk_gtk_accel_group_add" >&5 -echo "${ECHO_T}$ac_cv_lib_gtk_gtk_accel_group_add" >&6; } -if test $ac_cv_lib_gtk_gtk_accel_group_add = yes; then - HAVE_GTK1="yes" -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; } - { echo "$as_me:$LINENO: checking for gtk_tree_view_new in -lgtk-x11-2.0" >&5 -echo $ECHO_N "checking for gtk_tree_view_new in -lgtk-x11-2.0... $ECHO_C" >&6; } -if test "${ac_cv_lib_gtk_x11_2_0_gtk_tree_view_new+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lgtk-x11-2.0 $CUSTOM_GTK_LIBS $LIBS" +# 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. */ - -/* 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 gtk_tree_view_new (); -int -main () -{ -return gtk_tree_view_new (); - ; - return 0; -} +@%:@include <$ac_header> _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" +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_link") 2>conftest.er1 + (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); } && { - test -z "$ac_c_werror_flag" || + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_lib_gtk_x11_2_0_gtk_tree_view_new=yes + }; then + ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_gtk_x11_2_0_gtk_tree_view_new=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_gtk_x11_2_0_gtk_tree_view_new" >&5 -echo "${ECHO_T}$ac_cv_lib_gtk_x11_2_0_gtk_tree_view_new" >&6; } -if test $ac_cv_lib_gtk_x11_2_0_gtk_tree_view_new = yes; then - HAVE_GTK2="yes" + ac_header_preproc=no fi - fi - - # Sometimes pkg-config can find stuff that AC_CHECK_LIB can't, so we use that as well. - if test "$HAVE_PKG_CONFIG" = "yes"; then - { 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 - HAVE_GTK2="yes" - { 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: checking for Gtk+ 1.x (via pkg-config)" >&5 -echo $ECHO_N "checking for Gtk+ 1.x (via pkg-config)... $ECHO_C" >&6; } - # The latter half of the test is because pkg-config's fallback - # to gtk-config is broken on systems such as Ubuntu that use - # bash-completion for unknown commands. (On Ubuntu, typing - # 'gtk-config' on a system that doesn't have libgtk1.2-dev - # installed outputs hints about using apt-get, in addition to the - # regular bash "command not found" message.) - if pkg-config --exists gtk+ \ - && test -n "`pkg-config --libs gtk+ 2>/dev/null | grep -v '^ *$'`"; then - HAVE_GTK1="yes" - { 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 - fi +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } - if test "$HAVE_GTK1" = "yes" -o "$HAVE_GTK2" = "yes"; then - # This bit is to fix builds on OpenSolaris B71, where - # 'pkg-config --cflags gtk+-2.0' gives an error. - if test "$HAVE_GTK2" = "yes" -a "$HAVE_PKG_CONFIG" = "yes" \ - && ! pkg-config --exists gtk+-2.0 \ - && test -z "$CUSTOM_GTK_CFLAGS" -a -z "$CUSTOM_GTK_LIBS"; then - HAVE_GTK2="no" - fi +# 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; } - if test "$HAVE_GTK2" = "yes"; then - # Gtk 2.0 - GTK_CFLAGS="$GTK_CFLAGS -DGTK2" - gtkPackageName="gtk+-2.0" - elif test "$HAVE_GTK1" = "yes"; then - # Gtk 1.2 - gtkPackageName="gtk+" - else - # We found Gtk+ 2.0 that turned out to have a non-working - # pkg-config setup, AND Gtk 1.2 wasn't installed. - { { echo "$as_me:$LINENO: error: The Gtk+ library installed on your system is not fully functional. Please contact your OS vendor." >&5 -echo "$as_me: error: The Gtk+ library installed on your system is not fully functional. Please contact your OS vendor." >&2;} - { (exit 1); exit 1; }; } - fi +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 - # Prefer flags specified, in the environment, by the user. - if test -n "$CUSTOM_GTK_CFLAGS" -o -n "$CUSTOM_GTK_LIBS"; then - GTK_CFLAGS="$GTK_CFLAGS $CUSTOM_GTK_CFLAGS" - GTK_LIBS="$GTK_LIBS $CUSTOM_GTK_LIBS" - # Use pkg-config if available and there are no user-specified flags. - elif test "$HAVE_PKG_CONFIG" = "yes"; then - GTK_CFLAGS="$GTK_CFLAGS $(pkg-config --cflags $gtkPackageName)" - GTK_LIBS="$GTK_LIBS $(pkg-config --libs $gtkPackageName)" - # Otherwise, we have a problem. - else - { { echo "$as_me:$LINENO: error: pkg-config not found. Get pkg-config or set CUSTOM_GTK_CFLAGS and CUSTOM_GTK_LIBS to specify gtk header file and library locations." >&5 -echo "$as_me: error: pkg-config not found. Get pkg-config or set CUSTOM_GTK_CFLAGS and CUSTOM_GTK_LIBS to specify gtk header file and library locations." >&2;} - { (exit 1); exit 1; }; } - fi +done - else - { { echo "$as_me:$LINENO: error: libgtk not found. Please install the gtk devel package(s)." >&5 -echo "$as_me: error: libgtk not found. Please install the gtk devel package(s)." >&2;} - { (exit 1); exit 1; }; } - 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 +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 - ac_check_lib_save_LIBS=$LIBS -LIBS="-lcrypt $LIBS" + # 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. */ - -/* 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; -} +$ac_includes_default +@%:@include <$ac_header> _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" +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_link") 2>conftest.er1 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -22145,161 +20161,143 @@ (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" - GUESTD_LDFLAGS="$GUESTD_LDFLAGS -lcrypt" -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 + } && 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; } -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 +# 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. */ -/* 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; -} +@%:@include <$ac_header> _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" +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_link") 2>conftest.er1 + (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); } && { - test -z "$ac_c_werror_flag" || + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$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" + }; then + ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_var=no" + ac_header_preproc=no fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +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_var'}'` +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_var'}'` = yes; then + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF -@%:@define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +@%:@define `echo "HAVE_$ac_header" | $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 +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 - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" + # 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. */ - -/* 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; -} +$ac_includes_default +@%:@include <$ac_header> _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" +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_link") 2>conftest.er1 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -22308,190 +20306,143 @@ (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 + } && 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_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 - GUESTD_LDFLAGS="$GUESTD_LDFLAGS -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 - + ac_header_compiler=no fi -done - +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; } -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 +# 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. */ -/* 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; -} +@%:@include <$ac_header> _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" +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_link") 2>conftest.er1 + (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); } && { - test -z "$ac_c_werror_flag" || + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$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" + }; then + ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_var=no" + ac_header_preproc=no fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +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_var'}'` +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_var'}'` = yes; then + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF -@%:@define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +@%:@define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi + done -for ac_func in fcvt +for ac_header in wchar.h 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 +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 - cat >conftest.$ac_ext <<_ACEOF + # 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. */ -/* 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; -} +$ac_includes_default +@%:@include <$ac_header> _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" +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_link") 2>conftest.er1 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -22500,166 +20451,111 @@ (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" + } && test -s conftest.$ac_objext; then + ac_header_compiler=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 - + ac_header_compiler=no fi -done +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; } -{ 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" +# 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. */ - -/* 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; -} +@%:@include <$ac_header> _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" +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_link") 2>conftest.er1 + (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); } && { - test -z "$ac_c_werror_flag" || + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$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 + }; then + ac_header_preproc=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 - GUESTD_LDFLAGS="$GUESTD_LDFLAGS -lpthread" - VMWARE_USER_LDFLAGS="$VMWARE_USER_LDFLAGS -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; }; } + 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; } -if test "$os" = "solaris"; then - # libdnet is needed on Solaris to build guestInfoPosix.c. - - # 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_DNET_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $DNET_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_DNET_CONFIG="$DNET_CONFIG" # 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_DNET_CONFIG="$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_DNET_CONFIG" && ac_cv_path_DNET_CONFIG="no" - ;; +# 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 -fi -DNET_CONFIG=$ac_cv_path_DNET_CONFIG -if test -n "$DNET_CONFIG"; then - { echo "$as_me:$LINENO: result: $DNET_CONFIG" >&5 -echo "${ECHO_T}$DNET_CONFIG" >&6; } +{ 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 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + 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; } - - - if test "$DNET_CONFIG" = "no"; then - { { echo "$as_me:$LINENO: error: dnet-config was not found on your PATH. libdnet must be installed in order to build open-vm-tools on Solaris. See http://libdnet.sourceforge.net/" >&5 -echo "$as_me: error: dnet-config was not found on your PATH. libdnet must be installed in order to build open-vm-tools on Solaris. See http://libdnet.sourceforge.net/" >&2;} - { (exit 1); exit 1; }; } - fi - - DNET_CFLAGS="`$DNET_CONFIG --cflags`" - DNET_LIBS="`$DNET_CONFIG --libs`" - - GUESTD_LDFLAGS="$GUESTD_LDFLAGS $DNET_LIBS" - VMWARE_USER_LDFLAGS="$VMWARE_USER_LDFLAGS $DNET_LIBS" +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 -### -### Headers -### +done -for ac_header in crypt.h +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 @@ -22804,7 +20700,7 @@ done -for ac_header in inttypes.h +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 @@ -22949,7 +20845,7 @@ done -for ac_header in stdint.h +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 @@ -23092,9 +20988,9 @@ fi done + # Required to make the sys/user.h check work correctly on FreeBSD - -for ac_header in stdlib.h +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 @@ -23239,7 +21135,7 @@ done -for ac_header in wchar.h +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 @@ -23384,7 +21280,69 @@ done -for ac_header in sys/inttypes.h +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 @@ -23529,7 +21487,7 @@ done -for ac_header in sys/io.h +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 @@ -23674,7 +21632,7 @@ done -for ac_header in sys/param.h +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 @@ -23802,47 +21760,177 @@ 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" + 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 -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_header_wchar_h" >&5 +echo "${ECHO_T}$ac_cv_header_wchar_h" >&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 - +if test $ac_cv_header_wchar_h = yes; then + HAVE_WCHAR_H="yes" +else + HAVE_WCHAR_H="no" 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 + +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 -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 + 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> +#include + #include + +@%:@include _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" @@ -23861,133 +21949,171 @@ test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_header_compiler=yes + ac_cv_header_X11_extensions_panoramiXproto_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_compiler=no + ac_cv_header_X11_extensions_panoramiXproto_h=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; } +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 -# 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 + +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 <$ac_header> + +#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 -if { (ac_try="$ac_cpp conftest.$ac_ext" +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_cpp conftest.$ac_ext") 2>conftest.er1 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? 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" || + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || test ! -s conftest.err - }; then - ac_header_preproc=yes + } && 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_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" + ac_cv_header_stdbool_h=no fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 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 "$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 -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 + 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> +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" @@ -24006,115 +22132,38 @@ test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_header_compiler=yes + ac_cv_type__Bool=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_compiler=no + ac_cv_type__Bool=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 +{ 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 -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 +if test $ac_cv_header_stdbool_h = yes; then + +cat >>confdefs.h <<\_ACEOF +@%:@define HAVE_STDBOOL_H 1 _ACEOF - -fi - -done +fi -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 "$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 @@ -24124,12 +22173,62 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#ifdef HAVE_SYS_PARAM_H -# include +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 - -@%:@include <$ac_header> + ; + return 0; +} _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" @@ -24148,53 +22247,83 @@ test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - eval "$as_ac_Header=yes" + ac_cv_c_const=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_Header=no" + ac_cv_c_const=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 +{ 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 -done +{ 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* -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; } +{ 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 - # 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 + 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. */ -$ac_includes_default -@%:@include <$ac_header> +#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" @@ -24213,133 +22342,61 @@ test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_header_compiler=yes + ac_cv_c_inline=$ac_kw 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 + test "$ac_cv_c_inline" != no && break +done - ac_header_preproc=no fi +{ echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 +echo "${ECHO_T}$ac_cv_c_inline" >&6; } -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 +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 $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 "$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 -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 + 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> +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" @@ -24358,133 +22415,114 @@ test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_header_compiler=yes + ac_cv_type_mode_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_compiler=no + ac_cv_type_mode_t=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; } +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 -# 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 +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. */ -@%:@include <$ac_header> +$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 -if { (ac_try="$ac_cpp conftest.$ac_ext" +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_cpp conftest.$ac_ext") 2>conftest.er1 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? 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" || + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || test ! -s conftest.err - }; then - ac_header_preproc=yes + } && 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_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" + ac_cv_type_off_t=no fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -@%:@define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +{ 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 - -done +fi -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 "$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 -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 + 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> +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" @@ -24503,129 +22541,112 @@ test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_header_compiler=yes + ac_cv_type_pid_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_compiler=no + ac_cv_type_pid_t=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; } +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 -# 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 +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. */ -@%:@include <$ac_header> +$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 -if { (ac_try="$ac_cpp conftest.$ac_ext" +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_cpp conftest.$ac_ext") 2>conftest.er1 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? 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" || + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || test ! -s conftest.err - }; then - ac_header_preproc=yes + } && 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_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" + ac_cv_type_size_t=no fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -@%:@define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +{ 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 - -done +fi -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 "$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 -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 + 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 +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" @@ -24644,110 +22665,72 @@ test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_header_compiler=yes + ac_cv_member_struct_stat_st_rdev=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 + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -@%:@include +$ac_includes_default +int +main () +{ +static struct stat ac_aggr; +if (sizeof ac_aggr.st_rdev) +return 0; + ; + return 0; +} _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" +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_cpp conftest.$ac_ext") 2>conftest.er1 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? 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" || + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || test ! -s conftest.err - }; then - ac_header_preproc=yes + } && 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_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 + ac_cv_member_struct_stat_st_rdev=no fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_wchar_h" >&5 -echo "${ECHO_T}$ac_cv_header_wchar_h" >&6; } +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -if test $ac_cv_header_wchar_h = yes; then - HAVE_WCHAR_H="yes" -else - HAVE_WCHAR_H="no" + +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 -if test "$MULTIMON_ENABLED" != "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 "$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 @@ -24756,10 +22739,18 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include - #include +#include +#include +#include -@%:@include +int +main () +{ +if ((struct tm *) 0) +return 0; + ; + return 0; +} _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" @@ -24778,35 +22769,29 @@ test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_header_X11_extensions_panoramiXproto_h=yes + ac_cv_header_time=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_header_X11_extensions_panoramiXproto_h=no + 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_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 - +{ 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 -### -### 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 "$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 @@ -24815,78 +22800,15 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +#include +#include -#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); - +struct tm tm; + int *p = &tm.tm_sec; + return !p; ; return 0; } @@ -24908,21 +22830,29 @@ test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_header_stdbool_h=yes + ac_cv_struct_tm=time.h else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_header_stdbool_h=no + 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_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 "$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 @@ -24931,15 +22861,14 @@ 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; + +volatile int x; +int * volatile y = (int *) 0; +return !x && !y; ; return 0; } @@ -24961,100 +22890,111 @@ test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type__Bool=yes + ac_cv_c_volatile=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type__Bool=no + 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_type__Bool" >&5 -echo "${ECHO_T}$ac_cv_type__Bool" >&6; } -if test $ac_cv_type__Bool = yes; then +{ 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 HAVE__BOOL 1 +cat >>confdefs.h <<\_ACEOF +@%:@define volatile _ACEOF - fi -if test $ac_cv_header_stdbool_h = yes; then - -cat >>confdefs.h <<\_ACEOF -@%:@define HAVE_STDBOOL_H 1 + +### +### Specific features and OS/arch flags / actions +### + +# Check to see if SYS_setuid32 is defined. If SYS_setuid32 is unknown, we will +# certainly error out. +if test "$os$userSpaceBitness" = "linux32"; then + { echo "$as_me:$LINENO: checking for SYS_setuid32" >&5 +echo $ECHO_N "checking for SYS_setuid32... $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 + #include +int +main () +{ + + syscall(SYS_setuid32, 1); + + ; + 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 + HAVE_SYS_SETUID="yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + HAVE_SYS_SETUID="no" 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 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + { echo "$as_me:$LINENO: result: $HAVE_SYS_SETUID" >&5 +echo "${ECHO_T}$HAVE_SYS_SETUID" >&6; } +fi + +# Newer iconv (from glibc 2.2 and later on Linux) takes a char ** as the second +# argument. Here, we test for the older form and expect a compiler warning/error +# if the newer form is defined (because, in that case, we would be attempting to +# remove const'ness without an explicit cast). +{ echo "$as_me:$LINENO: checking for the new format of iconv" >&5 +echo $ECHO_N "checking for the new format of iconv... $ECHO_C" >&6; } +ORIGINAL_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS -Werror" +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 () { -/* 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 + iconv_t cd; + char const *inbuf; + size_t inbytesleft; + char *outbuf; + size_t outbytesleft; + iconv(cd, &inbuf, &inbytesleft, &outbuf, &outbytesleft); + ; return 0; } @@ -25076,29 +23016,27 @@ test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_c_const=yes + HAVE_NEW_ICONV="no" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_c_const=no + HAVE_NEW_ICONV="yes" 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 +CFLAGS="$ORIGINAL_CFLAGS" +{ echo "$as_me:$LINENO: result: $HAVE_NEW_ICONV" >&5 +echo "${ECHO_T}$HAVE_NEW_ICONV" >&6; } -{ 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 +if test "$os" = "linux"; then + +for ac_func in lseek +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 @@ -25107,52 +23045,111 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include +/* 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 -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "uid_t" >/dev/null 2>&1; then - ac_cv_type_uid_t=yes +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 - ac_cv_type_uid_t=no -fi -rm -f conftest* + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + eval "$as_ac_var=no" 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 +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 - + HAVE_LSEEK="yes" +else + HAVE_LSEEK="no" fi +done -{ 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 + + # setresuid() was wrapped beginning in glibc 2.3.2. + { echo "$as_me:$LINENO: checking for setresuid" >&5 +echo $ECHO_N "checking for setresuid... $ECHO_C" >&6; } + # Ensure an error is thrown if setresuid is unknown. + ORIGINAL_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Werror-implicit-function-declaration -Werror" + 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 +#define _GNU_SOURCE + #include +int +main () +{ + setresuid(0, 0, 0); + + ; + return 0; +} _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" @@ -25171,58 +23168,45 @@ test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_c_inline=$ac_kw + HAVE_SETRESUID="yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - + HAVE_SETRESUID="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - test "$ac_cv_c_inline" != no && break -done - + CFLAGS="$ORIGINAL_CFLAGS" + { echo "$as_me:$LINENO: result: $HAVE_SETRESUID" >&5 +echo "${ECHO_T}$HAVE_SETRESUID" >&6; } 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 +### General flags / actions +CFLAGS="$CFLAGS -Wall" +CFLAGS="$CFLAGS -Werror" -{ 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 +# -Wno-unknown-pragmas is due to gcc not understanding '#pragma ident' in Xlib.h on OpenSolaris. +for TEST_CFLAG in -Wno-pointer-sign -Wno-unused-value -fno-strict-aliasing \ + -Wno-unknown-pragmas -Wno-uninitialized; 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. */ -$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; + ; return 0; } @@ -25244,2397 +23228,2865 @@ test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type_mode_t=yes + 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 - ac_cv_type_mode_t=no + { 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 -DNO_CORE_ICU" + +INCLUDE_DIR="`cd $srcdir; pwd`/lib/include" +CPPFLAGS="$CPPFLAGS -I$INCLUDE_DIR" + +### 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" + + if test "$osVersion" -ge 202000; then + MODULES="$MODULES vmmemctl vmxnet" + fi + if test "$osVersion" -ge 204000; then + MODULES="$MODULES vmblock vmci vmhgfs vsock" + buildHgfsmounter=yes + fi + if test "$osVersion" -ge 206000; then + MODULES="$MODULES vmxnet3" + fi + if test "$osVersion" -ge 206006; then + MODULES="$MODULES vmsync" + fi +fi + +if test "$os" = "freebsd"; then + 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 vmhgfs" + buildHgfsmounter=yes + 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" + + GUESTD_LDADD="$GUESTD_LDADD -lsocket" + GUESTD_LDADD="$GUESTD_LDADD -lnsl" + GUESTD_LDADD="$GUESTD_LDADD -lrpcsvc" + + VMWARE_USER_CPPFLAGS="$VMWARE_USER_CPPFLAGS -I/usr/X11/include/" + VMWARE_USER_LDADD="$VMWARE_USER_LDADD -lXext" + VMWARE_USER_LDADD="$VMWARE_USER_LDADD -lX11" + VMWARE_USER_LDADD="$VMWARE_USER_LDADD -lsocket" + VMWARE_USER_LDADD="$VMWARE_USER_LDADD -lnsl" + VMWARE_USER_LDADD="$VMWARE_USER_LDADD -lrpcsvc" + + # uname -r on Solaris 10 reports "5.10" + if test "$osVersion" -ge 510000; then + CPPFLAGS="$CPPFLAGS -DSOL10" + 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"; then + FREEBSD_TRUE= + FREEBSD_FALSE='#' +else + FREEBSD_TRUE='#' + FREEBSD_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 -d /etc/pam.d; then + PAMD_TRUE= + PAMD_FALSE='#' +else + PAMD_TRUE='#' + PAMD_FALSE= +fi + + if test "$enable_unity" = "yes"; then + ENABLE_UNITY_TRUE= + ENABLE_UNITY_FALSE='#' +else + ENABLE_UNITY_TRUE='#' + ENABLE_UNITY_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 + + +### 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 + +if test "$os$userSpaceBitness" = "linux64" || test "$HAVE_SYS_SETUID" = "yes"; then + LIB_MISC_CPPFLAGS="$LIB_MISC_CPPFLAGS -DGLIBC_VERSION_21" +fi + +if test "$HAVE_NEW_ICONV" = "yes"; then + LIB_MISC_CPPFLAGS="$LIB_MISC_CPPFLAGS -DGLIBC_VERSION_22" +fi + +if test "$HAVE_LSEEK" = "yes"; then + LIB_FILE_CPPFLAGS="$LIB_FILE_CPPFLAGS -DGLIBC_VERSION_21" + LIB_HGFS_SERVER_CPPFLAGS="$LIB_HGFS_SERVER_CPPFLAGS -DGLIBC_VERSION_21" +fi + +if test "$HAVE_SETRESUID" = "yes"; then + LIB_PROC_MGR_CPPFLAGS="$LIB_PROC_MGR_CPPFLAGS -DGLIBC_VERSION_23" +fi + +if test "$HAVE_CRYPT" = "yes"; then + LIB_AUTH_CPPFLAGS="$LIB_AUTH_CPPFLAGS -DGLIBC_VERSION_22" +fi + +if test "$HAVE_WCHAR_H" = "yes"; then + LIB_STRING_CPPFLAGS="$LIB_STRING_CPPFLAGS -DGLIBC_VERSION_22" +fi + +### General substs + + + + + + + + + + + + + + + + + + + + + + +### 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/backdoor/shared/Makefile lib/conf/Makefile lib/dict/Makefile lib/dnd/Makefile lib/dynxdr/Makefile lib/err/Makefile lib/eventManager/Makefile lib/file/Makefile lib/foundryMsg/Makefile lib/ghIntegration/Makefile lib/ghIntegrationStub/Makefile lib/guestApp/Makefile lib/guestInfo/Makefile lib/guestRpc/Makefile lib/hgfs/Makefile lib/hgfsBd/Makefile lib/hgfsServer/Makefile lib/hgfsServerManagerGuest/Makefile lib/hgfsServerPolicyGuest/Makefile lib/deployPkg/Makefile lib/image/Makefile lib/impersonate/Makefile lib/message/Makefile lib/message/shared/Makefile lib/misc/Makefile lib/misc/shared/Makefile lib/netUtil/Makefile lib/panic/Makefile lib/panicDefault/Makefile lib/printer/Makefile lib/procMgr/Makefile lib/raster/Makefile lib/region/Makefile lib/resolution/Makefile lib/rpcIn/Makefile lib/rpcOut/Makefile lib/rpcOut/shared/Makefile lib/rpcVmx/Makefile lib/SLPv2Parser/Makefile lib/socketMgr/Makefile lib/string/Makefile lib/string/shared/Makefile lib/stubs/Makefile lib/stubs/shared/Makefile lib/sync/Makefile lib/sync/shared/Makefile lib/syncDriver/Makefile lib/system/Makefile lib/toolsLogger/Makefile lib/unicode/Makefile lib/unity/Makefile lib/unityStub/Makefile lib/unityWindowTracker/Makefile lib/user/Makefile lib/vixTools/Makefile lib/vmBackupLib/Makefile lib/vmCheck/Makefile lib/vmSignal/Makefile lib/wiper/Makefile guestd/Makefile vmware-user/Makefile vmware-user-suid-wrapper/Makefile toolbox/Makefile hgfsclient/Makefile hgfsmounter/Makefile checkvm/Makefile libguestlib/Makefile xferlogs/Makefile modules/Makefile scripts/Makefile" + + +### +### 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 -{ 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 +rm -f confcache -fi +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' -{ 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; +# 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 } -_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 +' +DEFS=`sed -n "$ac_script" confdefs.h` - 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 +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 -fi +LTLIBOBJS=$ac_ltlibobjs -{ 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 +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 "${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 "${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 "${PAMD_TRUE}" && test -z "${PAMD_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"PAMD\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"PAMD\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${ENABLE_UNITY_TRUE}" && test -z "${ENABLE_UNITY_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"ENABLE_UNITY\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"ENABLE_UNITY\" 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 -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 +: ${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 -fi +cat >>$CONFIG_STATUS <<\_ACEOF +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## -{ 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 +# 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 - 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;; + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; 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 + + +# 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 -{ 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 +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + as_unset=false +fi - 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;; + +# 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 -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 +# 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 - ac_cv_member_struct_stat_st_rdev=no +# 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 -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false 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 +# 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'` -fi +# CDPATH. +$as_unset CDPATH -{ 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; + + 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 } -_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 + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +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 -{ 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 +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 -{ 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 +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: 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 + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi -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 +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + 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'" + - ac_cv_struct_tm=sys/time.h -fi +exec 6>&1 -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 +# 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 2008.10.10-123053, which was +generated by GNU Autoconf 2.61. Invocation command line was -fi + 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` +" -{ 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 () -{ +cat >>$CONFIG_STATUS <<_ACEOF +# Files that config.status was made for. +config_files="$ac_config_files" +config_commands="$ac_config_commands" -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 +cat >>$CONFIG_STATUS <<\_ACEOF +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. -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 +Usage: $0 [OPTIONS] [FILE]... -fi + -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 -### -### Specific features and OS/arch flags / actions -### +Configuration commands: +$config_commands -# Capture the CFLAGS, so we can restore them later. -ORIGINAL_CFLAGS="$CFLAGS" +Report bugs to ." -# Check to see if SYS_setuid32 is defined. If SYS_setuid32 is unknown, we will -# certainly error out. -if test "$os$userSpaceBitness" = "linux32"; then - { echo "$as_me:$LINENO: checking for SYS_setuid32" >&5 -echo $ECHO_N "checking for SYS_setuid32... $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 - #include -int -main () -{ +cat >>$CONFIG_STATUS <<_ACEOF +ac_cs_version="\\ +open-vm-tools config.status 2008.10.10-123053 +configured by $0, generated by GNU Autoconf 2.61, + with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" - syscall(SYS_setuid32, 1); - - ; - return 0; -} +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 -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 - HAVE_SYS_SETUID="yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - HAVE_SYS_SETUID="no" -fi +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 -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - { echo "$as_me:$LINENO: result: $HAVE_SYS_SETUID" >&5 -echo "${ECHO_T}$HAVE_SYS_SETUID" >&6; } -fi + 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=: ;; -# Newer iconv (from glibc 2.2 and later on Linux) takes a char ** as the second -# argument. Here, we test for the older form and expect a compiler warning/error -# if the newer form is defined (because, in that case, we would be attempting to -# remove const'ness without an explicit cast). -{ echo "$as_me:$LINENO: checking for the new format of iconv" >&5 -echo $ECHO_N "checking for the new format of iconv... $ECHO_C" >&6; } -CFLAGS="$CFLAGS -Werror" -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 () -{ + # This is an error. + -*) { echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } ;; - iconv_t cd; - char const *inbuf; - size_t inbytesleft; - char *outbuf; - size_t outbytesleft; + *) ac_config_targets="$ac_config_targets $1" + ac_need_defaults=false ;; - iconv(cd, &inbuf, &inbytesleft, &outbuf, &outbytesleft); - - ; - 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 - HAVE_NEW_ICONV="no" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + esac + shift +done + +ac_configure_extra_args= - HAVE_NEW_ICONV="yes" +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -CFLAGS="$ORIGINAL_CFLAGS" -{ echo "$as_me:$LINENO: result: $HAVE_NEW_ICONV" >&5 -echo "${ECHO_T}$HAVE_NEW_ICONV" >&6; } +_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 -if test "$os" = "linux"; then - -for ac_func in lseek -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 +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 -/* 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. */ +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" -#ifdef __STDC__ -# include -#else -# include -#endif -#undef $ac_func +# 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 -/* 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 +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +macro_version='`$ECHO "X$macro_version" | $Xsed -e "$delay_single_quote_subst"`' +macro_revision='`$ECHO "X$macro_revision" | $Xsed -e "$delay_single_quote_subst"`' +enable_shared='`$ECHO "X$enable_shared" | $Xsed -e "$delay_single_quote_subst"`' +enable_static='`$ECHO "X$enable_static" | $Xsed -e "$delay_single_quote_subst"`' +pic_mode='`$ECHO "X$pic_mode" | $Xsed -e "$delay_single_quote_subst"`' +enable_fast_install='`$ECHO "X$enable_fast_install" | $Xsed -e "$delay_single_quote_subst"`' +host_alias='`$ECHO "X$host_alias" | $Xsed -e "$delay_single_quote_subst"`' +host='`$ECHO "X$host" | $Xsed -e "$delay_single_quote_subst"`' +host_os='`$ECHO "X$host_os" | $Xsed -e "$delay_single_quote_subst"`' +build_alias='`$ECHO "X$build_alias" | $Xsed -e "$delay_single_quote_subst"`' +build='`$ECHO "X$build" | $Xsed -e "$delay_single_quote_subst"`' +build_os='`$ECHO "X$build_os" | $Xsed -e "$delay_single_quote_subst"`' +SED='`$ECHO "X$SED" | $Xsed -e "$delay_single_quote_subst"`' +Xsed='`$ECHO "X$Xsed" | $Xsed -e "$delay_single_quote_subst"`' +GREP='`$ECHO "X$GREP" | $Xsed -e "$delay_single_quote_subst"`' +EGREP='`$ECHO "X$EGREP" | $Xsed -e "$delay_single_quote_subst"`' +FGREP='`$ECHO "X$FGREP" | $Xsed -e "$delay_single_quote_subst"`' +LD='`$ECHO "X$LD" | $Xsed -e "$delay_single_quote_subst"`' +NM='`$ECHO "X$NM" | $Xsed -e "$delay_single_quote_subst"`' +LN_S='`$ECHO "X$LN_S" | $Xsed -e "$delay_single_quote_subst"`' +max_cmd_len='`$ECHO "X$max_cmd_len" | $Xsed -e "$delay_single_quote_subst"`' +ac_objext='`$ECHO "X$ac_objext" | $Xsed -e "$delay_single_quote_subst"`' +exeext='`$ECHO "X$exeext" | $Xsed -e "$delay_single_quote_subst"`' +lt_unset='`$ECHO "X$lt_unset" | $Xsed -e "$delay_single_quote_subst"`' +lt_SP2NL='`$ECHO "X$lt_SP2NL" | $Xsed -e "$delay_single_quote_subst"`' +lt_NL2SP='`$ECHO "X$lt_NL2SP" | $Xsed -e "$delay_single_quote_subst"`' +reload_flag='`$ECHO "X$reload_flag" | $Xsed -e "$delay_single_quote_subst"`' +reload_cmds='`$ECHO "X$reload_cmds" | $Xsed -e "$delay_single_quote_subst"`' +deplibs_check_method='`$ECHO "X$deplibs_check_method" | $Xsed -e "$delay_single_quote_subst"`' +file_magic_cmd='`$ECHO "X$file_magic_cmd" | $Xsed -e "$delay_single_quote_subst"`' +AR='`$ECHO "X$AR" | $Xsed -e "$delay_single_quote_subst"`' +AR_FLAGS='`$ECHO "X$AR_FLAGS" | $Xsed -e "$delay_single_quote_subst"`' +STRIP='`$ECHO "X$STRIP" | $Xsed -e "$delay_single_quote_subst"`' +RANLIB='`$ECHO "X$RANLIB" | $Xsed -e "$delay_single_quote_subst"`' +old_postinstall_cmds='`$ECHO "X$old_postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +old_postuninstall_cmds='`$ECHO "X$old_postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_cmds='`$ECHO "X$old_archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' +CC='`$ECHO "X$CC" | $Xsed -e "$delay_single_quote_subst"`' +CFLAGS='`$ECHO "X$CFLAGS" | $Xsed -e "$delay_single_quote_subst"`' +compiler='`$ECHO "X$compiler" | $Xsed -e "$delay_single_quote_subst"`' +GCC='`$ECHO "X$GCC" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_pipe='`$ECHO "X$lt_cv_sys_global_symbol_pipe" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_cdecl='`$ECHO "X$lt_cv_sys_global_symbol_to_cdecl" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' +objdir='`$ECHO "X$objdir" | $Xsed -e "$delay_single_quote_subst"`' +SHELL='`$ECHO "X$SHELL" | $Xsed -e "$delay_single_quote_subst"`' +ECHO='`$ECHO "X$ECHO" | $Xsed -e "$delay_single_quote_subst"`' +MAGIC_CMD='`$ECHO "X$MAGIC_CMD" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag='`$ECHO "X$lt_prog_compiler_no_builtin_flag" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_wl='`$ECHO "X$lt_prog_compiler_wl" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_pic='`$ECHO "X$lt_prog_compiler_pic" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_static='`$ECHO "X$lt_prog_compiler_static" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o='`$ECHO "X$lt_cv_prog_compiler_c_o" | $Xsed -e "$delay_single_quote_subst"`' +need_locks='`$ECHO "X$need_locks" | $Xsed -e "$delay_single_quote_subst"`' +DSYMUTIL='`$ECHO "X$DSYMUTIL" | $Xsed -e "$delay_single_quote_subst"`' +NMEDIT='`$ECHO "X$NMEDIT" | $Xsed -e "$delay_single_quote_subst"`' +libext='`$ECHO "X$libext" | $Xsed -e "$delay_single_quote_subst"`' +shrext_cmds='`$ECHO "X$shrext_cmds" | $Xsed -e "$delay_single_quote_subst"`' +extract_expsyms_cmds='`$ECHO "X$extract_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' +archive_cmds_need_lc='`$ECHO "X$archive_cmds_need_lc" | $Xsed -e "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes='`$ECHO "X$enable_shared_with_static_runtimes" | $Xsed -e "$delay_single_quote_subst"`' +export_dynamic_flag_spec='`$ECHO "X$export_dynamic_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' +whole_archive_flag_spec='`$ECHO "X$whole_archive_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' +compiler_needs_object='`$ECHO "X$compiler_needs_object" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_from_new_cmds='`$ECHO "X$old_archive_from_new_cmds" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds='`$ECHO "X$old_archive_from_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' +archive_cmds='`$ECHO "X$archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' +archive_expsym_cmds='`$ECHO "X$archive_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' +module_cmds='`$ECHO "X$module_cmds" | $Xsed -e "$delay_single_quote_subst"`' +module_expsym_cmds='`$ECHO "X$module_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' +with_gnu_ld='`$ECHO "X$with_gnu_ld" | $Xsed -e "$delay_single_quote_subst"`' +allow_undefined_flag='`$ECHO "X$allow_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' +no_undefined_flag='`$ECHO "X$no_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec='`$ECHO "X$hardcode_libdir_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_ld='`$ECHO "X$hardcode_libdir_flag_spec_ld" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_separator='`$ECHO "X$hardcode_libdir_separator" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_direct='`$ECHO "X$hardcode_direct" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_direct_absolute='`$ECHO "X$hardcode_direct_absolute" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_minus_L='`$ECHO "X$hardcode_minus_L" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_shlibpath_var='`$ECHO "X$hardcode_shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_automatic='`$ECHO "X$hardcode_automatic" | $Xsed -e "$delay_single_quote_subst"`' +inherit_rpath='`$ECHO "X$inherit_rpath" | $Xsed -e "$delay_single_quote_subst"`' +link_all_deplibs='`$ECHO "X$link_all_deplibs" | $Xsed -e "$delay_single_quote_subst"`' +fix_srcfile_path='`$ECHO "X$fix_srcfile_path" | $Xsed -e "$delay_single_quote_subst"`' +always_export_symbols='`$ECHO "X$always_export_symbols" | $Xsed -e "$delay_single_quote_subst"`' +export_symbols_cmds='`$ECHO "X$export_symbols_cmds" | $Xsed -e "$delay_single_quote_subst"`' +exclude_expsyms='`$ECHO "X$exclude_expsyms" | $Xsed -e "$delay_single_quote_subst"`' +include_expsyms='`$ECHO "X$include_expsyms" | $Xsed -e "$delay_single_quote_subst"`' +prelink_cmds='`$ECHO "X$prelink_cmds" | $Xsed -e "$delay_single_quote_subst"`' +file_list_spec='`$ECHO "X$file_list_spec" | $Xsed -e "$delay_single_quote_subst"`' +variables_saved_for_relink='`$ECHO "X$variables_saved_for_relink" | $Xsed -e "$delay_single_quote_subst"`' +need_lib_prefix='`$ECHO "X$need_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' +need_version='`$ECHO "X$need_version" | $Xsed -e "$delay_single_quote_subst"`' +version_type='`$ECHO "X$version_type" | $Xsed -e "$delay_single_quote_subst"`' +runpath_var='`$ECHO "X$runpath_var" | $Xsed -e "$delay_single_quote_subst"`' +shlibpath_var='`$ECHO "X$shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' +shlibpath_overrides_runpath='`$ECHO "X$shlibpath_overrides_runpath" | $Xsed -e "$delay_single_quote_subst"`' +libname_spec='`$ECHO "X$libname_spec" | $Xsed -e "$delay_single_quote_subst"`' +library_names_spec='`$ECHO "X$library_names_spec" | $Xsed -e "$delay_single_quote_subst"`' +soname_spec='`$ECHO "X$soname_spec" | $Xsed -e "$delay_single_quote_subst"`' +postinstall_cmds='`$ECHO "X$postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +postuninstall_cmds='`$ECHO "X$postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +finish_cmds='`$ECHO "X$finish_cmds" | $Xsed -e "$delay_single_quote_subst"`' +finish_eval='`$ECHO "X$finish_eval" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_into_libs='`$ECHO "X$hardcode_into_libs" | $Xsed -e "$delay_single_quote_subst"`' +sys_lib_search_path_spec='`$ECHO "X$sys_lib_search_path_spec" | $Xsed -e "$delay_single_quote_subst"`' +sys_lib_dlsearch_path_spec='`$ECHO "X$sys_lib_dlsearch_path_spec" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_action='`$ECHO "X$hardcode_action" | $Xsed -e "$delay_single_quote_subst"`' +enable_dlopen='`$ECHO "X$enable_dlopen" | $Xsed -e "$delay_single_quote_subst"`' +enable_dlopen_self='`$ECHO "X$enable_dlopen_self" | $Xsed -e "$delay_single_quote_subst"`' +enable_dlopen_self_static='`$ECHO "X$enable_dlopen_self_static" | $Xsed -e "$delay_single_quote_subst"`' +old_striplib='`$ECHO "X$old_striplib" | $Xsed -e "$delay_single_quote_subst"`' +striplib='`$ECHO "X$striplib" | $Xsed -e "$delay_single_quote_subst"`' +compiler_lib_search_dirs='`$ECHO "X$compiler_lib_search_dirs" | $Xsed -e "$delay_single_quote_subst"`' +predep_objects='`$ECHO "X$predep_objects" | $Xsed -e "$delay_single_quote_subst"`' +postdep_objects='`$ECHO "X$postdep_objects" | $Xsed -e "$delay_single_quote_subst"`' +predeps='`$ECHO "X$predeps" | $Xsed -e "$delay_single_quote_subst"`' +postdeps='`$ECHO "X$postdeps" | $Xsed -e "$delay_single_quote_subst"`' +compiler_lib_search_path='`$ECHO "X$compiler_lib_search_path" | $Xsed -e "$delay_single_quote_subst"`' +LD_CXX='`$ECHO "X$LD_CXX" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_cmds_CXX='`$ECHO "X$old_archive_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' +compiler_CXX='`$ECHO "X$compiler_CXX" | $Xsed -e "$delay_single_quote_subst"`' +GCC_CXX='`$ECHO "X$GCC_CXX" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "X$lt_prog_compiler_no_builtin_flag_CXX" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_wl_CXX='`$ECHO "X$lt_prog_compiler_wl_CXX" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_pic_CXX='`$ECHO "X$lt_prog_compiler_pic_CXX" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_static_CXX='`$ECHO "X$lt_prog_compiler_static_CXX" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o_CXX='`$ECHO "X$lt_cv_prog_compiler_c_o_CXX" | $Xsed -e "$delay_single_quote_subst"`' +archive_cmds_need_lc_CXX='`$ECHO "X$archive_cmds_need_lc_CXX" | $Xsed -e "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes_CXX='`$ECHO "X$enable_shared_with_static_runtimes_CXX" | $Xsed -e "$delay_single_quote_subst"`' +export_dynamic_flag_spec_CXX='`$ECHO "X$export_dynamic_flag_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`' +whole_archive_flag_spec_CXX='`$ECHO "X$whole_archive_flag_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`' +compiler_needs_object_CXX='`$ECHO "X$compiler_needs_object_CXX" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_from_new_cmds_CXX='`$ECHO "X$old_archive_from_new_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds_CXX='`$ECHO "X$old_archive_from_expsyms_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' +archive_cmds_CXX='`$ECHO "X$archive_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' +archive_expsym_cmds_CXX='`$ECHO "X$archive_expsym_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' +module_cmds_CXX='`$ECHO "X$module_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' +module_expsym_cmds_CXX='`$ECHO "X$module_expsym_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' +with_gnu_ld_CXX='`$ECHO "X$with_gnu_ld_CXX" | $Xsed -e "$delay_single_quote_subst"`' +allow_undefined_flag_CXX='`$ECHO "X$allow_undefined_flag_CXX" | $Xsed -e "$delay_single_quote_subst"`' +no_undefined_flag_CXX='`$ECHO "X$no_undefined_flag_CXX" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_CXX='`$ECHO "X$hardcode_libdir_flag_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_ld_CXX='`$ECHO "X$hardcode_libdir_flag_spec_ld_CXX" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_separator_CXX='`$ECHO "X$hardcode_libdir_separator_CXX" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_direct_CXX='`$ECHO "X$hardcode_direct_CXX" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_direct_absolute_CXX='`$ECHO "X$hardcode_direct_absolute_CXX" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_minus_L_CXX='`$ECHO "X$hardcode_minus_L_CXX" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_shlibpath_var_CXX='`$ECHO "X$hardcode_shlibpath_var_CXX" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_automatic_CXX='`$ECHO "X$hardcode_automatic_CXX" | $Xsed -e "$delay_single_quote_subst"`' +inherit_rpath_CXX='`$ECHO "X$inherit_rpath_CXX" | $Xsed -e "$delay_single_quote_subst"`' +link_all_deplibs_CXX='`$ECHO "X$link_all_deplibs_CXX" | $Xsed -e "$delay_single_quote_subst"`' +fix_srcfile_path_CXX='`$ECHO "X$fix_srcfile_path_CXX" | $Xsed -e "$delay_single_quote_subst"`' +always_export_symbols_CXX='`$ECHO "X$always_export_symbols_CXX" | $Xsed -e "$delay_single_quote_subst"`' +export_symbols_cmds_CXX='`$ECHO "X$export_symbols_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' +exclude_expsyms_CXX='`$ECHO "X$exclude_expsyms_CXX" | $Xsed -e "$delay_single_quote_subst"`' +include_expsyms_CXX='`$ECHO "X$include_expsyms_CXX" | $Xsed -e "$delay_single_quote_subst"`' +prelink_cmds_CXX='`$ECHO "X$prelink_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' +file_list_spec_CXX='`$ECHO "X$file_list_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_action_CXX='`$ECHO "X$hardcode_action_CXX" | $Xsed -e "$delay_single_quote_subst"`' +compiler_lib_search_dirs_CXX='`$ECHO "X$compiler_lib_search_dirs_CXX" | $Xsed -e "$delay_single_quote_subst"`' +predep_objects_CXX='`$ECHO "X$predep_objects_CXX" | $Xsed -e "$delay_single_quote_subst"`' +postdep_objects_CXX='`$ECHO "X$postdep_objects_CXX" | $Xsed -e "$delay_single_quote_subst"`' +predeps_CXX='`$ECHO "X$predeps_CXX" | $Xsed -e "$delay_single_quote_subst"`' +postdeps_CXX='`$ECHO "X$postdeps_CXX" | $Xsed -e "$delay_single_quote_subst"`' +compiler_lib_search_path_CXX='`$ECHO "X$compiler_lib_search_path_CXX" | $Xsed -e "$delay_single_quote_subst"`' + +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# Quote evaled strings. +for var in SED \ +GREP \ +EGREP \ +FGREP \ +LD \ +NM \ +LN_S \ +lt_SP2NL \ +lt_NL2SP \ +reload_flag \ +deplibs_check_method \ +file_magic_cmd \ +AR \ +AR_FLAGS \ +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 \ +SHELL \ +ECHO \ +lt_prog_compiler_no_builtin_flag \ +lt_prog_compiler_wl \ +lt_prog_compiler_pic \ +lt_prog_compiler_static \ +lt_cv_prog_compiler_c_o \ +need_locks \ +DSYMUTIL \ +NMEDIT \ +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_flag_spec_ld \ +hardcode_libdir_separator \ +fix_srcfile_path \ +exclude_expsyms \ +include_expsyms \ +file_list_spec \ +variables_saved_for_relink \ +libname_spec \ +library_names_spec \ +soname_spec \ +finish_eval \ +old_striplib \ +striplib \ +compiler_lib_search_dirs \ +predep_objects \ +postdep_objects \ +predeps \ +postdeps \ +compiler_lib_search_path \ +LD_CXX \ +compiler_CXX \ +lt_prog_compiler_no_builtin_flag_CXX \ +lt_prog_compiler_wl_CXX \ +lt_prog_compiler_pic_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_flag_spec_ld_CXX \ +hardcode_libdir_separator_CXX \ +fix_srcfile_path_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 "X\\\\\$\$var"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done -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;; +# 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 \ +postinstall_cmds \ +postuninstall_cmds \ +finish_cmds \ +sys_lib_search_path_spec \ +sys_lib_dlsearch_path_spec \ +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; do + case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Fix-up fallback echo if it was mangled by the above quoting rules. +case \$lt_ECHO in +*'\\\$0 --fallback-echo"') lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\$0 --fallback-echo"\$/\$0 --fallback-echo"/'\` + ;; 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 +ac_aux_dir='$ac_aux_dir' +xsi_shell='$xsi_shell' +lt_shell_append='$lt_shell_append' -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +# 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 -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 + + + PACKAGE='$PACKAGE' + VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' + RM='$RM' + ofile='$ofile' + + + + + + _ACEOF - HAVE_LSEEK="yes" -else - HAVE_LSEEK="no" -fi + +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/backdoor/shared/Makefile") CONFIG_FILES="$CONFIG_FILES lib/backdoor/shared/Makefile" ;; + "lib/conf/Makefile") CONFIG_FILES="$CONFIG_FILES lib/conf/Makefile" ;; + "lib/dict/Makefile") CONFIG_FILES="$CONFIG_FILES lib/dict/Makefile" ;; + "lib/dnd/Makefile") CONFIG_FILES="$CONFIG_FILES lib/dnd/Makefile" ;; + "lib/dynxdr/Makefile") CONFIG_FILES="$CONFIG_FILES lib/dynxdr/Makefile" ;; + "lib/err/Makefile") CONFIG_FILES="$CONFIG_FILES lib/err/Makefile" ;; + "lib/eventManager/Makefile") CONFIG_FILES="$CONFIG_FILES lib/eventManager/Makefile" ;; + "lib/file/Makefile") CONFIG_FILES="$CONFIG_FILES lib/file/Makefile" ;; + "lib/foundryMsg/Makefile") CONFIG_FILES="$CONFIG_FILES lib/foundryMsg/Makefile" ;; + "lib/ghIntegration/Makefile") CONFIG_FILES="$CONFIG_FILES lib/ghIntegration/Makefile" ;; + "lib/ghIntegrationStub/Makefile") CONFIG_FILES="$CONFIG_FILES lib/ghIntegrationStub/Makefile" ;; + "lib/guestApp/Makefile") CONFIG_FILES="$CONFIG_FILES lib/guestApp/Makefile" ;; + "lib/guestInfo/Makefile") CONFIG_FILES="$CONFIG_FILES lib/guestInfo/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/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/deployPkg/Makefile") CONFIG_FILES="$CONFIG_FILES lib/deployPkg/Makefile" ;; + "lib/image/Makefile") CONFIG_FILES="$CONFIG_FILES lib/image/Makefile" ;; + "lib/impersonate/Makefile") CONFIG_FILES="$CONFIG_FILES lib/impersonate/Makefile" ;; + "lib/message/Makefile") CONFIG_FILES="$CONFIG_FILES lib/message/Makefile" ;; + "lib/message/shared/Makefile") CONFIG_FILES="$CONFIG_FILES lib/message/shared/Makefile" ;; + "lib/misc/Makefile") CONFIG_FILES="$CONFIG_FILES lib/misc/Makefile" ;; + "lib/misc/shared/Makefile") CONFIG_FILES="$CONFIG_FILES lib/misc/shared/Makefile" ;; + "lib/netUtil/Makefile") CONFIG_FILES="$CONFIG_FILES lib/netUtil/Makefile" ;; + "lib/panic/Makefile") CONFIG_FILES="$CONFIG_FILES lib/panic/Makefile" ;; + "lib/panicDefault/Makefile") CONFIG_FILES="$CONFIG_FILES lib/panicDefault/Makefile" ;; + "lib/printer/Makefile") CONFIG_FILES="$CONFIG_FILES lib/printer/Makefile" ;; + "lib/procMgr/Makefile") CONFIG_FILES="$CONFIG_FILES lib/procMgr/Makefile" ;; + "lib/raster/Makefile") CONFIG_FILES="$CONFIG_FILES lib/raster/Makefile" ;; + "lib/region/Makefile") CONFIG_FILES="$CONFIG_FILES lib/region/Makefile" ;; + "lib/resolution/Makefile") CONFIG_FILES="$CONFIG_FILES lib/resolution/Makefile" ;; + "lib/rpcIn/Makefile") CONFIG_FILES="$CONFIG_FILES lib/rpcIn/Makefile" ;; + "lib/rpcOut/Makefile") CONFIG_FILES="$CONFIG_FILES lib/rpcOut/Makefile" ;; + "lib/rpcOut/shared/Makefile") CONFIG_FILES="$CONFIG_FILES lib/rpcOut/shared/Makefile" ;; + "lib/rpcVmx/Makefile") CONFIG_FILES="$CONFIG_FILES lib/rpcVmx/Makefile" ;; + "lib/SLPv2Parser/Makefile") CONFIG_FILES="$CONFIG_FILES lib/SLPv2Parser/Makefile" ;; + "lib/socketMgr/Makefile") CONFIG_FILES="$CONFIG_FILES lib/socketMgr/Makefile" ;; + "lib/string/Makefile") CONFIG_FILES="$CONFIG_FILES lib/string/Makefile" ;; + "lib/string/shared/Makefile") CONFIG_FILES="$CONFIG_FILES lib/string/shared/Makefile" ;; + "lib/stubs/Makefile") CONFIG_FILES="$CONFIG_FILES lib/stubs/Makefile" ;; + "lib/stubs/shared/Makefile") CONFIG_FILES="$CONFIG_FILES lib/stubs/shared/Makefile" ;; + "lib/sync/Makefile") CONFIG_FILES="$CONFIG_FILES lib/sync/Makefile" ;; + "lib/sync/shared/Makefile") CONFIG_FILES="$CONFIG_FILES lib/sync/shared/Makefile" ;; + "lib/syncDriver/Makefile") CONFIG_FILES="$CONFIG_FILES lib/syncDriver/Makefile" ;; + "lib/system/Makefile") CONFIG_FILES="$CONFIG_FILES lib/system/Makefile" ;; + "lib/toolsLogger/Makefile") CONFIG_FILES="$CONFIG_FILES lib/toolsLogger/Makefile" ;; + "lib/unicode/Makefile") CONFIG_FILES="$CONFIG_FILES lib/unicode/Makefile" ;; + "lib/unity/Makefile") CONFIG_FILES="$CONFIG_FILES lib/unity/Makefile" ;; + "lib/unityStub/Makefile") CONFIG_FILES="$CONFIG_FILES lib/unityStub/Makefile" ;; + "lib/unityWindowTracker/Makefile") CONFIG_FILES="$CONFIG_FILES lib/unityWindowTracker/Makefile" ;; + "lib/user/Makefile") CONFIG_FILES="$CONFIG_FILES lib/user/Makefile" ;; + "lib/vixTools/Makefile") CONFIG_FILES="$CONFIG_FILES lib/vixTools/Makefile" ;; + "lib/vmBackupLib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/vmBackupLib/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" ;; + "guestd/Makefile") CONFIG_FILES="$CONFIG_FILES guestd/Makefile" ;; + "vmware-user/Makefile") CONFIG_FILES="$CONFIG_FILES vmware-user/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" ;; + "libguestlib/Makefile") CONFIG_FILES="$CONFIG_FILES libguestlib/Makefile" ;; + "xferlogs/Makefile") CONFIG_FILES="$CONFIG_FILES xferlogs/Makefile" ;; + "modules/Makefile") CONFIG_FILES="$CONFIG_FILES modules/Makefile" ;; + "scripts/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/Makefile" ;; + + *) { { 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 - # setresuid() was wrapped beginning in glibc 2.3.2. - { echo "$as_me:$LINENO: checking for setresuid" >&5 -echo $ECHO_N "checking for setresuid... $ECHO_C" >&6; } - # Ensure an error is thrown if setresuid is unknown. - CFLAGS="$CFLAGS -Werror-implicit-function-declaration -Werror" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#define _GNU_SOURCE - #include -int -main () +# 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") +} || { - - setresuid(0, 0, 0); - - ; - return 0; + echo "$me: cannot create a temporary directory in ." >&2 + { (exit 1); exit 1; } } -_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 - HAVE_SETRESUID="yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - HAVE_SETRESUID="no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS="$ORIGINAL_CFLAGS" - { echo "$as_me:$LINENO: result: $HAVE_SETRESUID" >&5 -echo "${ECHO_T}$HAVE_SETRESUID" >&6; } -fi +# +# Set up the sed scripts for CONFIG_FILES section. +# -### General flags / actions -COMMON_CFLAGS="$COMMON_CFLAGS -Wall" -COMMON_CFLAGS="$COMMON_CFLAGS -Werror" +# 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 -# -Wno-unknown-pragmas is due to gcc not understanding '#pragma ident' in Xlib.h on OpenSolaris. -for TEST_CFLAG in -Wno-pointer-sign -Wno-unused-value -fno-strict-aliasing \ - -Wno-unknown-pragmas -Wno-uninitialized; do - { echo "$as_me:$LINENO: checking for GCC flag $TEST_CFLAG" >&5 -echo $ECHO_N "checking for GCC flag $TEST_CFLAG... $ECHO_C" >&6; } - CFLAGS="$CFLAGS $TEST_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; -} + +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 -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 - COMMON_CFLAGS="$COMMON_CFLAGS $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; } + 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 -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS="$ORIGINAL_CFLAGS" -done -COMMON_CFLAGS="$COMMON_CFLAGS -DVMX86_TOOLS" +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 +AR!$AR$ac_delim +RANLIB!$RANLIB$ac_delim +lt_ECHO!$lt_ECHO$ac_delim +DSYMUTIL!$DSYMUTIL$ac_delim +NMEDIT!$NMEDIT$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 +LIBPNG_CONFIG!$LIBPNG_CONFIG$ac_delim +DNET_CONFIG!$DNET_CONFIG$ac_delim +ICU_CONFIG!$ICU_CONFIG$ac_delim +HAVE_CXX!$HAVE_CXX$ac_delim +RPCGEN!$RPCGEN$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 +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 +PAMD_TRUE!$PAMD_TRUE$ac_delim +PAMD_FALSE!$PAMD_FALSE$ac_delim +ENABLE_UNITY_TRUE!$ENABLE_UNITY_TRUE$ac_delim +ENABLE_UNITY_FALSE!$ENABLE_UNITY_FALSE$ac_delim +WITH_ROOT_PRIVILEGES_TRUE!$WITH_ROOT_PRIVILEGES_TRUE$ac_delim +WITH_ROOT_PRIVILEGES_FALSE!$WITH_ROOT_PRIVILEGES_FALSE$ac_delim +TARGET_OS!$TARGET_OS$ac_delim +KERNEL_RELEASE!$KERNEL_RELEASE$ac_delim +MODULES_OS!$MODULES_OS$ac_delim +MODULES_DIR!$MODULES_DIR$ac_delim +MODULES!$MODULES$ac_delim +COMMON_XLIBS!$COMMON_XLIBS$ac_delim +GTK_CPPFLAGS!$GTK_CPPFLAGS$ac_delim +GTK_LIBS!$GTK_LIBS$ac_delim +DNET_CPPFLAGS!$DNET_CPPFLAGS$ac_delim +DNET_LIBS!$DNET_LIBS$ac_delim +PROCPS_LIBS!$PROCPS_LIBS$ac_delim +ICU_CPPFLAGS!$ICU_CPPFLAGS$ac_delim +ICU_LIBS!$ICU_LIBS$ac_delim +PAM_PREFIX!$PAM_PREFIX$ac_delim +URIPARSER_CPPFLAGS!$URIPARSER_CPPFLAGS$ac_delim +URIPARSER_LIBS!$URIPARSER_LIBS$ac_delim +LIBPNG_CPPFLAGS!$LIBPNG_CPPFLAGS$ac_delim +LIBPNG_LIBS!$LIBPNG_LIBS$ac_delim +ZLIB_CPPFLAGS!$ZLIB_CPPFLAGS$ac_delim +ZLIB_LIBS!$ZLIB_LIBS$ac_delim +LIB_AUTH_CPPFLAGS!$LIB_AUTH_CPPFLAGS$ac_delim +LIB_FILE_CPPFLAGS!$LIB_FILE_CPPFLAGS$ac_delim +LIB_HGFS_SERVER_CPPFLAGS!$LIB_HGFS_SERVER_CPPFLAGS$ac_delim +LIB_IMPERSONATE_CPPFLAGS!$LIB_IMPERSONATE_CPPFLAGS$ac_delim +LIB_MISC_CPPFLAGS!$LIB_MISC_CPPFLAGS$ac_delim +LIB_PROC_MGR_CPPFLAGS!$LIB_PROC_MGR_CPPFLAGS$ac_delim +LIB_STRING_CPPFLAGS!$LIB_STRING_CPPFLAGS$ac_delim +LIB_USER_CPPFLAGS!$LIB_USER_CPPFLAGS$ac_delim +GUESTD_LDADD!$GUESTD_LDADD$ac_delim +VMWARE_USER_CPPFLAGS!$VMWARE_USER_CPPFLAGS$ac_delim +VMWARE_USER_LDADD!$VMWARE_USER_LDADD$ac_delim +LIB@&t@OBJS!$LIB@&t@OBJS$ac_delim +LTLIBOBJS!$LTLIBOBJS$ac_delim +_ACEOF -INCLUDE_DIR="`cd $srcdir; pwd`/lib/include" -COMMON_CFLAGS="$COMMON_CFLAGS -I$INCLUDE_DIR" + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 75; 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 -### OS/arch-specific flags / actions +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 -MODULES="" -MODULES_OS="$os" -buildHgfsmounter=no +cat >>$CONFIG_STATUS <<_ACEOF +cat >"\$tmp/subs-2.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 -if test "$os" = "linux"; then - COMMON_CFLAGS="$COMMON_CFLAGS -D_FILE_OFFSET_BITS=64" - COMMON_CFLAGS="$COMMON_CFLAGS -D_LARGEFILE64_SOURCE" - COMMON_CFLAGS="$COMMON_CFLAGS -D_XOPEN_SOURCE=500" - COMMON_CFLAGS="$COMMON_CFLAGS -D_BSD_SOURCE" - COMMON_CFLAGS="$COMMON_CFLAGS -D_SVID_SOURCE" - if test "$osVersion" -ge 202000; then - MODULES="$MODULES vmxnet vmmemctl" - fi - if test "$osVersion" -ge 204000; then - MODULES="$MODULES vmhgfs vmblock" - buildHgfsmounter=yes - fi - if test "$osVersion" -ge 206006; then - MODULES="$MODULES vmsync" - fi +# 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 -if test "$os" = "freebsd"; then - if test "$osVersion" -gt 302000; then - MODULES="$MODULES vmmemctl" - fi - if test "$osVersion" -gt 409000; then - MODULES="$MODULES vmxnet" - fi - if test "$osVersion" -gt 600000; then - MODULES="$MODULES vmhgfs vmblock" - buildHgfsmounter=yes - fi -fi +cat >>$CONFIG_STATUS <<\_ACEOF +fi # test -n "$CONFIG_FILES" -if test "$os" = "solaris"; then - LIB_IMPERSONATE_CFLAGS="$LIB_IMPERSONATE_CFLAGS -D_POSIX_PTHREAD_SEMANTICS" - LIB_USER_CFLAGS="$LIB_USER_CFLAGS -D_POSIX_PTHREAD_SEMANTICS" - GUESTD_LDFLAGS="$GUESTD_LDFLAGS -lsocket" - GUESTD_LDFLAGS="$GUESTD_LDFLAGS -lnsl" +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 - VMWARE_USER_CFLAGS="$VMWARE_USER_CFLAGS -I/usr/X11/include/" - VMWARE_USER_LDFLAGS="$VMWARE_USER_LDFLAGS -lXext" - VMWARE_USER_LDFLAGS="$VMWARE_USER_LDFLAGS -lX11" - VMWARE_USER_LDFLAGS="$VMWARE_USER_LDFLAGS -lsocket" - VMWARE_USER_LDFLAGS="$VMWARE_USER_LDFLAGS -lnsl" + 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 - # uname -r on Solaris 10 reports "5.10" - if test "$osVersion" -ge 510000; then - COMMON_CFLAGS="$COMMON_CFLAGS -DSOL10" - fi -fi + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + 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 - if test "$buildHgfsmounter" = "yes"; then - BUILD_HGFSMOUNTER_TRUE= - BUILD_HGFSMOUNTER_FALSE='#' -else - BUILD_HGFSMOUNTER_TRUE='#' - BUILD_HGFSMOUNTER_FALSE= -fi + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin";; + esac + ;; + esac - if test "$os" = "linux"; then - LINUX_TRUE= - LINUX_FALSE='#' -else - LINUX_TRUE='#' - LINUX_FALSE= -fi + 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=. - if test "$os" = "solaris"; then - SOLARIS_TRUE= - SOLARIS_FALSE='#' -else - SOLARIS_TRUE='#' - SOLARIS_FALSE= -fi +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 - 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 +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 - if test "$have_x" = "yes"; then - HAVE_X11_TRUE= - HAVE_X11_FALSE='#' -else - HAVE_X11_TRUE='#' - HAVE_X11_FALSE= -fi + case $ac_mode in + :F) + # + # CONFIG_FILE + # -### Feature-specific flags / actions -# Combine where possible + 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 -# 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 "$MULTIMON_ENABLED" = "no"; then - cat >>confdefs.h <<\_ACEOF -@%:@define NO_MULTIMON 1 +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 -fi +# 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" >$tmp/out -if test "$os$userSpaceBitness" = "linux64" || test "$HAVE_SYS_SETUID" = "yes"; then - LIB_MISC_CFLAGS="$LIB_MISC_CFLAGS -DGLIBC_VERSION_21" -fi +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;} -if test "$HAVE_NEW_ICONV" = "yes"; then - LIB_MISC_CFLAGS="$LIB_MISC_CFLAGS -DGLIBC_VERSION_22" -fi + 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 -if test "$HAVE_LSEEK" = "yes"; then - LIB_FILE_CFLAGS="$LIB_FILE_CFLAGS -DGLIBC_VERSION_21" - LIB_HGFS_SERVER_CFLAGS="$LIB_HGFS_SERVER_CFLAGS -DGLIBC_VERSION_21" -fi -if test "$HAVE_SETRESUID" = "yes"; then - LIB_PROC_MGR_CFLAGS="$LIB_PROC_MGR_CFLAGS -DGLIBC_VERSION_23" -fi + 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 -if test "$HAVE_CRYPT" = "yes"; then - LIB_AUTH_CFLAGS="$LIB_AUTH_CFLAGS -DGLIBC_VERSION_22" -fi + cfgfile="${ofile}T" + trap "$RM \"$cfgfile\"; exit 1" 1 2 15 + $RM "$cfgfile" -if test "$HAVE_WCHAR_H" = "yes"; then - LIB_STRING_CFLAGS="$LIB_STRING_CFLAGS -DGLIBC_VERSION_22" -fi + cat <<_LT_EOF >> "$cfgfile" +#! $SHELL + +# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $as_me (GNU $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 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. -### General substs +# 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 +# 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//" -### Lib substs +# 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 -### Program substs +# turn newlines into spaces. +NL2SP=$lt_lt_NL2SP +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds +# 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 +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS +# A symbol stripping program. +STRIP=$lt_STRIP -### -### Create the Makefiles -### -ac_config_files="$ac_config_files Makefile lib/Makefile lib/atomic/Makefile lib/atomic/shared/Makefile lib/auth/Makefile lib/backdoor/Makefile lib/backdoor/shared/Makefile lib/conf/Makefile lib/dict/Makefile lib/dnd/Makefile lib/err/Makefile lib/eventManager/Makefile lib/file/Makefile lib/fileUtf8/Makefile lib/foundryMsg/Makefile lib/guestApp/Makefile lib/guestInfo/Makefile lib/hgfs/Makefile lib/hgfsBd/Makefile lib/hgfsServer/Makefile lib/hgfsServerManagerGuest/Makefile lib/hgfsServerPolicyGuest/Makefile lib/deployPkg/Makefile lib/impersonate/Makefile lib/message/Makefile lib/message/shared/Makefile lib/misc/Makefile lib/misc/shared/Makefile lib/netUtil/Makefile lib/panic/Makefile lib/panicDefault/Makefile lib/printer/Makefile lib/procMgr/Makefile lib/rpcIn/Makefile lib/rpcOut/Makefile lib/rpcOut/shared/Makefile lib/rpcVmx/Makefile lib/SLPv2Parser/Makefile lib/socketMgr/Makefile lib/strUtil/Makefile lib/string/Makefile lib/string/shared/Makefile lib/sync/Makefile lib/sync/shared/Makefile lib/syncDriver/Makefile lib/system/Makefile lib/toolsLogger/Makefile lib/unicode/Makefile lib/user/Makefile lib/vixTools/Makefile lib/vmBackupLib/Makefile lib/vmCheck/Makefile lib/vmSignal/Makefile lib/wiper/Makefile guestd/Makefile vmware-user/Makefile toolbox/Makefile hgfsclient/Makefile hgfsmounter/Makefile checkvm/Makefile libguestlib/Makefile xferlogs/Makefile modules/Makefile" +# 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 +# A C compiler. +LTCC=$lt_CC -### -### 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. +# LTCC compiler flags. +LTCFLAGS=$lt_CFLAGS -_ACEOF +# 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 -# 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 +# Transform the output of nm in a proper C declaration. +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl - (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 +# 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 -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' +# 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 -# 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` +# The name of the directory that contains temporary libtool files. +objdir=$objdir +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL -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 +# An echo program that does not interpret backslashes. +ECHO=$lt_ECHO -LTLIBOBJS=$ac_ltlibobjs +# 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 -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 "${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 +# Tool to manipulate archived DWARF debug symbol files on Mac OS X. +DSYMUTIL=$lt_DSYMUTIL -: ${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. +# Tool to change global to local symbols on Mac OS X. +NMEDIT=$lt_NMEDIT -debug=false -ac_cs_recheck=false -ac_cs_silent=false -SHELL=\${CONFIG_SHELL-$SHELL} -_ACEOF +# Old archive suffix (normally "a"). +libext=$libext -cat >>$CONFIG_STATUS <<\_ACEOF -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## +# Shared library suffix (normally ".so"). +shrext_cmds=$lt_shrext_cmds -# 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 +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds -fi +# 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 -# 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 +# Shared library runtime path variable. +runpath_var=$runpath_var -# 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 +# Shared library path variable. +shlibpath_var=$shlibpath_var -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi +# 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 -# 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" +# 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 -# 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 +# The coded name of the library, if different from the real name. +soname_spec=$lt_soname_spec - ;; -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 +# Command to use after installation of a shared archive. +postinstall_cmds=$lt_postinstall_cmds -# 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='+ ' +# Command to use after uninstallation of a shared archive. +postuninstall_cmds=$lt_postuninstall_cmds -# 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 +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$lt_finish_cmds -# 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 +# As "finish_cmds", except a single script fragment to be evaled but +# not shown. +finish_eval=$lt_finish_eval -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi +# 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 -# 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'` +# Run-time system search path for libraries. +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec -# CDPATH. -$as_unset CDPATH +# 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 - 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" || { +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib - # 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 -} +# The linker used to build libraries. +LD=$lt_LD +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi +# A language specific compiler. +CC=$lt_compiler -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 +# Is the compiler the GNU compiler? +with_gcc=$GCC -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag -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 +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl -if mkdir -p . 2>/dev/null; then - as_mkdir_p=: -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic -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 +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static -# 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'" +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" +# 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 -exec 6>&1 +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec -# 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 2008.01.23-74039, which was -generated by GNU Autoconf 2.61. Invocation command line was +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS - CONFIG_LINKS = $CONFIG_LINKS - CONFIG_COMMANDS = $CONFIG_COMMANDS - $ $0 $@ +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object -on `(hostname || uname -n) 2>/dev/null | sed 1q` -" +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds -_ACEOF +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds -cat >>$CONFIG_STATUS <<_ACEOF -# Files that config.status was made for. -config_files="$ac_config_files" -config_commands="$ac_config_commands" +# Commands used to build a shared archive. +archive_cmds=$lt_archive_cmds +archive_expsym_cmds=$lt_archive_expsym_cmds -_ACEOF +# 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 -cat >>$CONFIG_STATUS <<\_ACEOF -ac_cs_usage="\ -\`$as_me' instantiates files from templates according to the -current configuration. +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld -Usage: $0 [OPTIONS] [FILE]... +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag - -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 +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag -Configuration files: -$config_files +# 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 -Configuration commands: -$config_commands +# If ld is used when linking, flag to hardcode \$libdir into a binary +# during linking. This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld -Report bugs to ." +# Whether we need a single "-rpath" flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF -ac_cs_version="\\ -open-vm-tools config.status 2008.01.23-74039 -configured by $0, generated by GNU Autoconf 2.61, - with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary. +hardcode_direct=$hardcode_direct -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." +# 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 -ac_pwd='$ac_pwd' -srcdir='$srcdir' -INSTALL='$INSTALL' -MKDIR_P='$MKDIR_P' -_ACEOF +# Set to "yes" if using the -LDIR flag during linking hardcodes DIR +# into the resulting binary. +hardcode_minus_L=$hardcode_minus_L -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 +# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR +# into the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var - 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=: ;; +# 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 - # This is an error. - -*) { echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } ;; +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath - *) ac_config_targets="$ac_config_targets $1" - ac_need_defaults=false ;; +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs - esac - shift -done +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path=$lt_fix_srcfile_path -ac_configure_extra_args= +# Set to "yes" if exported symbols are required. +always_export_symbols=$always_export_symbols -if $ac_cs_silent; then - exec 6>/dev/null - ac_configure_extra_args="$ac_configure_extra_args --silent" -fi +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds -_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 +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms -_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 +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF -# -# INIT-COMMANDS -# -AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds -_ACEOF +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec -cat >>$CONFIG_STATUS <<\_ACEOF +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action -# Handling of arguments. -for ac_config_target in $ac_config_targets -do - case $ac_config_target in - "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; - "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; - "lib/atomic/Makefile") CONFIG_FILES="$CONFIG_FILES lib/atomic/Makefile" ;; - "lib/atomic/shared/Makefile") CONFIG_FILES="$CONFIG_FILES lib/atomic/shared/Makefile" ;; - "lib/auth/Makefile") CONFIG_FILES="$CONFIG_FILES lib/auth/Makefile" ;; - "lib/backdoor/Makefile") CONFIG_FILES="$CONFIG_FILES lib/backdoor/Makefile" ;; - "lib/backdoor/shared/Makefile") CONFIG_FILES="$CONFIG_FILES lib/backdoor/shared/Makefile" ;; - "lib/conf/Makefile") CONFIG_FILES="$CONFIG_FILES lib/conf/Makefile" ;; - "lib/dict/Makefile") CONFIG_FILES="$CONFIG_FILES lib/dict/Makefile" ;; - "lib/dnd/Makefile") CONFIG_FILES="$CONFIG_FILES lib/dnd/Makefile" ;; - "lib/err/Makefile") CONFIG_FILES="$CONFIG_FILES lib/err/Makefile" ;; - "lib/eventManager/Makefile") CONFIG_FILES="$CONFIG_FILES lib/eventManager/Makefile" ;; - "lib/file/Makefile") CONFIG_FILES="$CONFIG_FILES lib/file/Makefile" ;; - "lib/fileUtf8/Makefile") CONFIG_FILES="$CONFIG_FILES lib/fileUtf8/Makefile" ;; - "lib/foundryMsg/Makefile") CONFIG_FILES="$CONFIG_FILES lib/foundryMsg/Makefile" ;; - "lib/guestApp/Makefile") CONFIG_FILES="$CONFIG_FILES lib/guestApp/Makefile" ;; - "lib/guestInfo/Makefile") CONFIG_FILES="$CONFIG_FILES lib/guestInfo/Makefile" ;; - "lib/hgfs/Makefile") CONFIG_FILES="$CONFIG_FILES lib/hgfs/Makefile" ;; - "lib/hgfsBd/Makefile") CONFIG_FILES="$CONFIG_FILES lib/hgfsBd/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/deployPkg/Makefile") CONFIG_FILES="$CONFIG_FILES lib/deployPkg/Makefile" ;; - "lib/impersonate/Makefile") CONFIG_FILES="$CONFIG_FILES lib/impersonate/Makefile" ;; - "lib/message/Makefile") CONFIG_FILES="$CONFIG_FILES lib/message/Makefile" ;; - "lib/message/shared/Makefile") CONFIG_FILES="$CONFIG_FILES lib/message/shared/Makefile" ;; - "lib/misc/Makefile") CONFIG_FILES="$CONFIG_FILES lib/misc/Makefile" ;; - "lib/misc/shared/Makefile") CONFIG_FILES="$CONFIG_FILES lib/misc/shared/Makefile" ;; - "lib/netUtil/Makefile") CONFIG_FILES="$CONFIG_FILES lib/netUtil/Makefile" ;; - "lib/panic/Makefile") CONFIG_FILES="$CONFIG_FILES lib/panic/Makefile" ;; - "lib/panicDefault/Makefile") CONFIG_FILES="$CONFIG_FILES lib/panicDefault/Makefile" ;; - "lib/printer/Makefile") CONFIG_FILES="$CONFIG_FILES lib/printer/Makefile" ;; - "lib/procMgr/Makefile") CONFIG_FILES="$CONFIG_FILES lib/procMgr/Makefile" ;; - "lib/rpcIn/Makefile") CONFIG_FILES="$CONFIG_FILES lib/rpcIn/Makefile" ;; - "lib/rpcOut/Makefile") CONFIG_FILES="$CONFIG_FILES lib/rpcOut/Makefile" ;; - "lib/rpcOut/shared/Makefile") CONFIG_FILES="$CONFIG_FILES lib/rpcOut/shared/Makefile" ;; - "lib/rpcVmx/Makefile") CONFIG_FILES="$CONFIG_FILES lib/rpcVmx/Makefile" ;; - "lib/SLPv2Parser/Makefile") CONFIG_FILES="$CONFIG_FILES lib/SLPv2Parser/Makefile" ;; - "lib/socketMgr/Makefile") CONFIG_FILES="$CONFIG_FILES lib/socketMgr/Makefile" ;; - "lib/strUtil/Makefile") CONFIG_FILES="$CONFIG_FILES lib/strUtil/Makefile" ;; - "lib/string/Makefile") CONFIG_FILES="$CONFIG_FILES lib/string/Makefile" ;; - "lib/string/shared/Makefile") CONFIG_FILES="$CONFIG_FILES lib/string/shared/Makefile" ;; - "lib/sync/Makefile") CONFIG_FILES="$CONFIG_FILES lib/sync/Makefile" ;; - "lib/sync/shared/Makefile") CONFIG_FILES="$CONFIG_FILES lib/sync/shared/Makefile" ;; - "lib/syncDriver/Makefile") CONFIG_FILES="$CONFIG_FILES lib/syncDriver/Makefile" ;; - "lib/system/Makefile") CONFIG_FILES="$CONFIG_FILES lib/system/Makefile" ;; - "lib/toolsLogger/Makefile") CONFIG_FILES="$CONFIG_FILES lib/toolsLogger/Makefile" ;; - "lib/unicode/Makefile") CONFIG_FILES="$CONFIG_FILES lib/unicode/Makefile" ;; - "lib/user/Makefile") CONFIG_FILES="$CONFIG_FILES lib/user/Makefile" ;; - "lib/vixTools/Makefile") CONFIG_FILES="$CONFIG_FILES lib/vixTools/Makefile" ;; - "lib/vmBackupLib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/vmBackupLib/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" ;; - "guestd/Makefile") CONFIG_FILES="$CONFIG_FILES guestd/Makefile" ;; - "vmware-user/Makefile") CONFIG_FILES="$CONFIG_FILES vmware-user/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" ;; - "libguestlib/Makefile") CONFIG_FILES="$CONFIG_FILES libguestlib/Makefile" ;; - "xferlogs/Makefile") CONFIG_FILES="$CONFIG_FILES xferlogs/Makefile" ;; - "modules/Makefile") CONFIG_FILES="$CONFIG_FILES modules/Makefile" ;; +# The directories searched by this compiler when creating a shared library. +compiler_lib_search_dirs=$lt_compiler_lib_search_dirs - *) { { 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 +# 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 -# 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 +# ### 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 -# 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 || + +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 '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + case $xsi_shell in + yes) + cat << \_LT_EOF >> "$cfgfile" +# 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 () { - 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 + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac } -# Create a (secure) tmp directory for tmp files. +# func_basename file +func_basename () { - tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" -} || + func_basename_result="${1##*/}" +} + +# 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 () { - tmp=./conf$$-$RANDOM - (umask 077 && mkdir "$tmp") -} || + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac + func_basename_result="${1##*/}" +} + +# 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_stripname () { - echo "$me: cannot create a temporary directory in ." >&2 - { (exit 1); exit 1; } + # 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}"} } -# -# Set up the sed scripts for CONFIG_FILES section. -# +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=${1%%=*} + func_opt_split_arg=${1#*=} +} -# 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 +# func_lo2o object +func_lo2o () +{ + case ${1} in + *.lo) func_lo2o_result=${1%.lo}.${objext} ;; + *) func_lo2o_result=${1} ;; + esac +} +_LT_EOF + ;; + *) # Bourne compatible functions. + cat << \_LT_EOF >> "$cfgfile" +# 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 () +{ + # Extract subdirectory from the argument. + func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi +} -_ACEOF +# func_basename file +func_basename () +{ + func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` +} +# 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 "X${1}" | $Xsed -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 "X${1}" | $Xsed -e "$basename"` +} +# 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 "X${3}" \ + | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "X${3}" \ + | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; + esac +} -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 -SED!$SED$ac_delim -GREP!$GREP$ac_delim -EGREP!$EGREP$ac_delim -LN_S!$LN_S$ac_delim -ECHO!$ECHO$ac_delim -AR!$AR$ac_delim -RANLIB!$RANLIB$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 -_ACEOF +# sed scripts: +my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q' +my_sed_long_arg='1s/^-[^=]*=//' + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` + func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` +} + +# func_lo2o object +func_lo2o () +{ + func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` +} +_LT_EOF +esac + +case $lt_shell_append in + yes) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$1+=\$2" +} +_LT_EOF + ;; + *) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$1=\$$1\$2" +} +_LT_EOF + ;; + esac + + + sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + 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 + +# 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 + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_CXX + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_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 - 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 +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object_CXX -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 +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX -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 +# 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 -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - cat >conf$$subs.sed <<_ACEOF -CXXCPP!$CXXCPP$ac_delim -F77!$F77$ac_delim -FFLAGS!$FFLAGS$ac_delim -ac_ct_F77!$ac_ct_F77$ac_delim -LIBTOOL!$LIBTOOL$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 -DNET_CONFIG!$DNET_CONFIG$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 -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 -MODULES_OS!$MODULES_OS$ac_delim -MODULES!$MODULES$ac_delim -COMMON_CFLAGS!$COMMON_CFLAGS$ac_delim -COMMON_PROG_CFLAGS!$COMMON_PROG_CFLAGS$ac_delim -COMMON_XLIBS!$COMMON_XLIBS$ac_delim -GTK_CFLAGS!$GTK_CFLAGS$ac_delim -GTK_LIBS!$GTK_LIBS$ac_delim -DNET_CFLAGS!$DNET_CFLAGS$ac_delim -DNET_LIBS!$DNET_LIBS$ac_delim -LIB_AUTH_CFLAGS!$LIB_AUTH_CFLAGS$ac_delim -LIB_FILE_CFLAGS!$LIB_FILE_CFLAGS$ac_delim -LIB_HGFS_SERVER_CFLAGS!$LIB_HGFS_SERVER_CFLAGS$ac_delim -LIB_IMPERSONATE_CFLAGS!$LIB_IMPERSONATE_CFLAGS$ac_delim -LIB_MISC_CFLAGS!$LIB_MISC_CFLAGS$ac_delim -LIB_PROC_MGR_CFLAGS!$LIB_PROC_MGR_CFLAGS$ac_delim -LIB_STRING_CFLAGS!$LIB_STRING_CFLAGS$ac_delim -LIB_USER_CFLAGS!$LIB_USER_CFLAGS$ac_delim -GUESTD_LDFLAGS!$GUESTD_LDFLAGS$ac_delim -VMWARE_USER_CFLAGS!$VMWARE_USER_CFLAGS$ac_delim -VMWARE_USER_LDFLAGS!$VMWARE_USER_LDFLAGS$ac_delim -LIB@&t@OBJS!$LIB@&t@OBJS$ac_delim -LTLIBOBJS!$LTLIBOBJS$ac_delim -_ACEOF +# 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 - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 44; 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 +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld_CXX -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 +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag_CXX -cat >>$CONFIG_STATUS <<_ACEOF -cat >"\$tmp/subs-2.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 +# 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 -# 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 +# If ld is used when linking, flag to hardcode \$libdir into a binary +# during linking. This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX -cat >>$CONFIG_STATUS <<\_ACEOF -fi # test -n "$CONFIG_FILES" +# 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 -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 +# Set to "yes" if using the -LDIR flag during linking hardcodes DIR +# into the resulting binary. +hardcode_minus_L=$hardcode_minus_L_CXX - 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 +# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR +# into the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX - # 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 +# 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 - case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin";; - esac - ;; - esac +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath_CXX - 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=. +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_CXX -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 +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path=$lt_fix_srcfile_path_CXX -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 +# 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 - case $ac_mode in - :F) - # - # CONFIG_FILE - # +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_CXX - 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 +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_CXX -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= +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds_CXX -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 +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec_CXX -# 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" >$tmp/out +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action_CXX -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;} +# The directories searched by this compiler when creating a shared library. +compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX - 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 +# 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 - 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 ;; esac diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/autom4te.cache/output.2 /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/autom4te.cache/output.2 --- open-vm-tools-2008.01.23-74039/autom4te.cache/output.2 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/autom4te.cache/output.2 2008-10-13 08:02:08.000000000 +0100 @@ -0,0 +1,26122 @@ +@%:@! /bin/sh +@%:@ Guess values for system-dependent variables and create Makefiles. +@%:@ Generated by GNU Autoconf 2.61 for open-vm-tools 2008.10.10-123053. +@%:@ +@%:@ 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; } +") 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; } + +_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'" + + + + +# Check that we are running under the correct shell. +SHELL=${CONFIG_SHELL-/bin/sh} + +case X$lt_ECHO in +X*--fallback-echo) + # Remove one level of quotation (which was required for Make). + ECHO=`echo "$lt_ECHO" | sed 's,\\\\\$\\$0,'$0','` + ;; +esac + +ECHO=${lt_ECHO-echo} +if test "X$1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X$1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then + # Yippee, $ECHO works! + : +else + # Restart under the correct shell. + exec $SHELL "$0" --no-reexec ${1+"$@"} +fi + +if test "X$1" = X--fallback-echo; then + # used as fallback echo + shift + cat <<_LT_EOF +$* +_LT_EOF + exit 0 +fi + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +if test -z "$lt_ECHO"; then + if test "X${echo_test_string+set}" != Xset; then + # find a string as large as possible, as long as the shell can cope with it + for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do + # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... + if { echo_test_string=`eval $cmd`; } 2>/dev/null && + { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null + then + break + fi + done + fi + + if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : + else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + IFS="$lt_save_ifs" + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + ECHO="$dir/echo" + break + fi + done + IFS="$lt_save_ifs" + + if test "X$ECHO" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + ECHO='print -r' + elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running configure again with it. + ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} + else + # Try using printf. + ECHO='printf %s\n' + if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + ECHO="$CONFIG_SHELL $0 --fallback-echo" + elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + ECHO="$CONFIG_SHELL $0 --fallback-echo" + else + # maybe with a smaller string... + prev=: + + for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do + if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null + then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "$0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} + else + # Oops. We lost completely, so just stick with echo. + ECHO=echo + fi + fi + fi + fi + fi +fi + +# Copy echo and quote the copy suitably for passing to libtool from +# the Makefile, instead of quoting the original, which is used later. +lt_ECHO=$ECHO +if test "X$lt_ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then + lt_ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" +fi + + + + +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='2008.10.10-123053' +PACKAGE_STRING='open-vm-tools 2008.10.10-123053' +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 +AR +RANLIB +lt_ECHO +DSYMUTIL +NMEDIT +CXXCPP +HAVE_PKG_CONFIG +XMKMF +X_CFLAGS +X_PRE_LIBS +X_LIBS +X_EXTRA_LIBS +LIBPNG_CONFIG +DNET_CONFIG +ICU_CONFIG +HAVE_CXX +RPCGEN +BUILD_HGFSMOUNTER_TRUE +BUILD_HGFSMOUNTER_FALSE +LINUX_TRUE +LINUX_FALSE +SOLARIS_TRUE +SOLARIS_FALSE +FREEBSD_TRUE +FREEBSD_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 +PAMD_TRUE +PAMD_FALSE +ENABLE_UNITY_TRUE +ENABLE_UNITY_FALSE +WITH_ROOT_PRIVILEGES_TRUE +WITH_ROOT_PRIVILEGES_FALSE +TARGET_OS +KERNEL_RELEASE +MODULES_OS +MODULES_DIR +MODULES +COMMON_XLIBS +GTK_CPPFLAGS +GTK_LIBS +DNET_CPPFLAGS +DNET_LIBS +PROCPS_LIBS +ICU_CPPFLAGS +ICU_LIBS +PAM_PREFIX +URIPARSER_CPPFLAGS +URIPARSER_LIBS +LIBPNG_CPPFLAGS +LIBPNG_LIBS +ZLIB_CPPFLAGS +ZLIB_LIBS +LIB_AUTH_CPPFLAGS +LIB_FILE_CPPFLAGS +LIB_HGFS_SERVER_CPPFLAGS +LIB_IMPERSONATE_CPPFLAGS +LIB_MISC_CPPFLAGS +LIB_PROC_MGR_CPPFLAGS +LIB_STRING_CPPFLAGS +LIB_USER_CPPFLAGS +GUESTD_LDADD +VMWARE_USER_CPPFLAGS +VMWARE_USER_LDADD +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 2008.10.10-123053 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 2008.10.10-123053:";; + 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-unity disables Unity, enabled by default + --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors + --enable-shared@<:@=PKGS@:>@ build shared libraries @<:@default=yes@:>@ + --enable-static@<:@=PKGS@:>@ build static libraries @<:@default=yes@:>@ + --enable-fast-install@<:@=PKGS@:>@ + optimize for fast installation @<:@default=yes@:>@ + --disable-libtool-lock avoid locking (might break parallel builds) + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --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 (falls back on Gtk 1.2) + --with-pic try to use only PIC/non-PIC objects @<:@default=use + both@:>@ + --with-gnu-ld assume the C compiler uses GNU ld @<:@default=no@:>@ + --with-x use the X Window System + --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 2008.10.10-123053 +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 2008.10.10-123053, 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" + ;; + 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 "$os" = "linux"; then + if test "$with_kernel_modules" = "yes"; then + 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 + fi +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 --enable-unity was given. +if test "${enable_unity+set}" = set; then + enableval=$enable_unity; enable_unity="$enableval" +else + enable_unity="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 + + +# If we're not going to use Gtk 2.0, disable Unity. It may be possible to +# get Unity working with Gtk 1.2 (it used to in the past), but that will +# require a great deal of work. +if test "$with_gtk2" != "yes"; then + enable_unity="no" +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='2008.10.10-123053' + + +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" + +### +### 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.2' +macro_revision='1.2599' + + + + + + + + + + + + + +ltmain="$ac_aux_dir/ltmain.sh" + +{ 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 "$ac_tool_prefix"; then + for ac_prog in "dumpbin -symbols" "link -dump -symbols" + 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 -symbols" "link -dump -symbols" +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 + + + 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:__oline__: $ac_compile\"" >&5) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&5 + (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&5 + (eval echo "\"\$as_me:__oline__: 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*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + 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"`$SHELL $0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ + = "XX$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"}, \ + = c,a/b,, ) >/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 for $LD option to reload object files" >&5 +echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6; } +if test "${lt_cv_ld_reload_flag+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_ld_reload_flag='-r' +fi +{ echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 +echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6; } +reload_flag=$lt_cv_ld_reload_flag +case $reload_flag in +"" | " "*) ;; +*) reload_flag=" $reload_flag" ;; +esac +reload_cmds='$LD$reload_flag -o $output$reload_objs' +case $host_os in + darwin*) + if test "$GCC" = yes; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi + ;; +esac + + + + + + + + + + +{ echo "$as_me:$LINENO: checking 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. + if ( 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 + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +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 + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +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 Linux ELF. +linux* | k*bsd*-gnu) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +*nto* | *qnx*) + lt_cv_deplibs_check_method=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_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}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { 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}ar" + 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 + + +fi +if test -z "$ac_cv_prog_AR"; then + ac_ct_AR=$AR + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { 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="ar" + 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 + + 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 +else + AR="$ac_cv_prog_AR" +fi + +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru + + + + + + + + + + + +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 \$oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +# 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*) + 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};"\ +" /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 + + # 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 +#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. */ +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_save_LIBS="$LIBS" + lt_save_CFLAGS="$CFLAGS" + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS="$lt_save_LIBS" + CFLAGS="$lt_save_CFLAGS" + else + echo "cannot find nm_test_func in $nlist" >&5 + fi + else + echo "cannot find nm_test_var in $nlist" >&5 + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 + fi + else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -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 + + + + + + + + + + + + + + + + + + + + + + + +# 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 __oline__ "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 + ;; +sparc*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) LD="${LD-ld} -m elf64_sparc" ;; + *) + 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" + + + 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 + + + + + + + + + + + + + { 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. + echo "int foo(void){return 1;}" > conftest.c + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib ${wl}-single_module conftest.c + if test -f libconftest.dylib; then + lt_cv_apple_cc_single_mod=yes + rm -rf libconftest.dylib* + fi + rm conftest.c + 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; } + 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" != ":"; 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 + + + +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 + + +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 + _lt_caught_CXX_error=yes +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 + + + + + +# 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; pic_mode="$withval" +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 + +# Sed substitution that helps us do robust quoting. It backslashifies +# 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' + +# 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 "X$cc_temp" | $Xsed -e 's%.*/%%' -e "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 + lt_prog_compiler_no_builtin_flag=' -fno-builtin' + + { echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; } +if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_prog_compiler_rtti_exceptions=no + ac_outfile=conftest.$ac_objext + 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:__oline__: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:__oline__: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $RM conftest* + +fi +{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; } + +if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then + lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" +else + : +fi + +fi + + + + + + + lt_prog_compiler_wl= +lt_prog_compiler_pic= +lt_prog_compiler_static= + +{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } + + if test "$GCC" = yes; then + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_static='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + fi + ;; + + amigaos*) + if test "$host_cpu" = m68k; then + # 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' + fi + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # 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' + ;; + + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + ;; + + 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 + 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*) + # 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) + case $cc_basename in + icc* | ecc* | ifort*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + xl*) + # IBM XL C 8.0/Fortran 10.1 on PPC + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-qpic' + lt_prog_compiler_static='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C 5.9 + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Wl,' + ;; + *Sun\ F*) + # 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='' + ;; + 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*) + 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: result: $lt_prog_compiler_pic" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic" >&6; } + + + + + + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic"; then + { echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6; } +if test "${lt_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:__oline__: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:__oline__: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_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 "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_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:__oline__: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:__oline__: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $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:__oline__: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:__oline__: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $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_flag_spec_ld= + 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*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + ld_shlibs=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + export_dynamic_flag_spec='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec= + fi + supports_anon_versioning=no + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + 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.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +_LT_EOF + fi + ;; + + amigaos*) + if test "$host_cpu" = m68k; then + 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 + fi + + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can't use + # them. + ld_shlibs=no + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs=no + fi + ;; + + cygwin* | mingw* | pw32*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + allow_undefined_flag=unsupported + always_export_symbols=no + enable_shared_with_static_runtimes=yes + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs=no + fi + ;; + + 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) + 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= + 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; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + xl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + 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; $ECHO \"$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*) + # 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= + hardcode_libdir_flag_spec_ld='-rpath $libdir' + archive_cmds='$LD -shared $libobjs $deplibs $compiler_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 $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + ld_shlibs=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <<_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 $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) + ld_shlibs=no + cat <<_LT_EOF 1>&2 + +*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not +*** reliably create shared libraries on SCO systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.16.91.0.3 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +_LT_EOF + ;; + *) + # 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 $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + + if test "$ld_shlibs" = no; then + runpath_var= + hardcode_libdir_flag_spec= + export_dynamic_flag_spec= + whole_archive_flag_spec= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + allow_undefined_flag=unsupported + always_export_symbols=yes + archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + + 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 + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + aix_use_runtimelinking=no + + # Test if we are trying to use run time linking or normal + # AIX style linking. If -brtl is somewhere in LDFLAGS, we + # need to do runtime linking. + case $host_os in aix4.[23]|aix4.[23].*|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 + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (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 + } + }' +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 "$aix_libpath"; then + 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 "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag="-z nodefs" + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (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 + } + }' +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 "$aix_libpath"; then + 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 "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag=' ${wl}-bernotok' + allow_undefined_flag=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + archive_cmds_need_lc=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + amigaos*) + if test "$host_cpu" = m68k; then + 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 + fi + # see comment about different semantics on the GNU ld section + ld_shlibs=no + ;; + + bsdi[45]*) + export_dynamic_flag_spec=-rdynamic + ;; + + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_from_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path='`cygpath -w "$srcfile"`' + enable_shared_with_static_runtimes=yes + ;; + + darwin* | rhapsody*) + + + archive_cmds_need_lc=no + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + whole_archive_flag_spec='' + link_all_deplibs=yes + allow_undefined_flag="$_lt_dar_allow_undefined" + if test "$GCC" = "yes"; then + output_verbose_link_cmd=echo + archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_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 + ;; + + freebsd1*) + ld_shlibs=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + hpux9*) + if test "$GCC" = yes; then + archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + fi + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + export_dynamic_flag_spec='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_flag_spec_ld='+b $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 -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + + case $host_cpu in + hppa*64*|ia64*) + hardcode_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 $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${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. + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + cat >conftest.$ac_ext <<_ACEOF +int foo(void) {} +_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 + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + +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" + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -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*) + 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" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${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" && $ECHO "X-set_version $verstring" | $Xsed` -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} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${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" && $ECHO "X-set_version $verstring" | $Xsed` -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 "X-set_version $verstring" | $Xsed` -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 ${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 ${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; } + $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 + archive_cmds_need_lc=no + else + archive_cmds_need_lc=yes + fi + allow_undefined_flag=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + { echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 +echo "${ECHO_T}$archive_cmds_need_lc" >&6; } + ;; + esac + fi + ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } + +if test "$GCC" = yes; then + case $host_os in + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` + else + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # 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; } +}'` + sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` +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 + 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 + 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*) + if test "$host_cpu" = m68k; then + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + else + dynamic_linker=no + fi + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + 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="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${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 + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix[3-9]*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux* | k*bsd*-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' + 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 + 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 + 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 + + # 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;/^$/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' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=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 + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + 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 + need_lib_prefix=no + need_version=no + library_name_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 + 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*) + 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 __oline__ "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 + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + else + puts (dlerror ()); + + exit (status); +} +_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 __oline__ "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 + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + else + puts (dlerror ()); + + exit (status); +} +_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" + + +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_flag_spec_ld_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 +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_LD=$LD + lt_save_GCC=$GCC + GCC=$GXX + lt_save_with_gnu_ld=$with_gnu_ld + lt_save_path_LD=$lt_cv_path_LD + if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx + else + $as_unset lt_cv_prog_gnu_ld + fi + if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX + else + $as_unset lt_cv_path_LD + fi + test -z "${LDCXX+set}" || LD=$LDCXX + CC=${CXX-"c++"} + compiler=$CC + compiler_CXX=$CC + for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + + + 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 -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='${wl}' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | + $GREP 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec_CXX= + fi + else + with_gnu_ld=no + wlarc= + + # A generic and very simple default shared library creation + # command for GNU C++ for the case where it uses the native + # linker, instead of GNU ld. If possible, this setting should + # overridden to take advantage of the native linker features on + # the platform it is being used on. + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + + else + GXX=no + with_gnu_ld=no + wlarc= + fi + + # PORTME: fill in a description of your system's C++ link characteristics + { echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } + ld_shlibs_CXX=yes + case $host_os in + aix3*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + 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 + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to + # export. + always_export_symbols_CXX=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag_CXX='-berok' + # Determine the default libpath from the value encoded in an empty + # executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (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 + } + }' +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 "$aix_libpath"; then + 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 "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" + + archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag_CXX="-z nodefs" + archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (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 + } + }' +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 "$aix_libpath"; then + 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 "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + + hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag_CXX=' ${wl}-bernotok' + allow_undefined_flag_CXX=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_CXX='$convenience' + archive_cmds_need_lc_CXX=yes + # This is similar to how AIX traditionally builds its shared + # libraries. + archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag_CXX=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs_CXX=no + fi + ;; + + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + cygwin* | mingw* | pw32*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec_CXX='-L$libdir' + allow_undefined_flag_CXX=unsupported + always_export_symbols_CXX=no + enable_shared_with_static_runtimes_CXX=yes + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs_CXX=no + fi + ;; + darwin* | rhapsody*) + + + archive_cmds_need_lc_CXX=no + hardcode_direct_CXX=no + hardcode_automatic_CXX=yes + hardcode_shlibpath_var_CXX=unsupported + whole_archive_flag_spec_CXX='' + link_all_deplibs_CXX=yes + allow_undefined_flag_CXX="$_lt_dar_allow_undefined" + if test "$GCC" = "yes"; then + output_verbose_link_cmd=echo + 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 + ;; + + freebsd[12]*) + # C++ shared libraries reported to be fairly broken before + # switch to ELF + ld_shlibs_CXX=no + ;; + + freebsd-elf*) + archive_cmds_need_lc_CXX=no + ;; + + freebsd* | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + ld_shlibs_CXX=yes + ;; + + gnu*) + ;; + + hpux9*) + hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_CXX=: + export_dynamic_flag_spec_CXX='${wl}-E' + hardcode_direct_CXX=yes + hardcode_minus_L_CXX=yes # Not in the search PATH, + # but as the default + # location of the library. + + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aCC*) + archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + ;; + *) + if test "$GXX" = yes; then + archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_CXX=: + + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + 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; $ECHO "X$list" | $Xsed' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case $host_cpu in + hppa*64*) + archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + + 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" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -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) + case $cc_basename in + KCC*) + # Kuck and Associates, Inc. (KAI) C++ Compiler + + # KCC will only create a shared library if the output file + # ends with ".so" (or ".sl" for HP-UX), so rename the library + # to its proper name (with version) after linking. + archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + + 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 | $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 | $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 | $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 | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + ;; + *) # Version 6 will 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; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + ;; + cxx*) + # Compaq C++ + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec_CXX='-rpath $libdir' + hardcode_libdir_separator_CXX=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + ;; + xl*) + # 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; $ECHO \"$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='echo' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' + ;; + 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=echo + 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" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -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" && $ECHO "X-set_version $verstring" | $Xsed` -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 "X-set_version $verstring" | $Xsed` -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=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + ;; + *) + 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" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + *) + archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${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 "\-L"' + + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + + psos*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + archive_cmds_need_lc_CXX=yes + no_undefined_flag_CXX=' -zdefs' + archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + hardcode_libdir_flag_spec_CXX='-R$libdir' + hardcode_shlibpath_var_CXX=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The 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='echo' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + + # The C++ compiler must be used to create the archive. + old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + no_undefined_flag_CXX=' ${wl}-z ${wl}defs' + if $CC --version | $GREP -v '^2\.7' > /dev/null; then + archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + fi + + hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' + 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' + ;; + *) + 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 + +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 $p in + + -L* | -R* | -l*) + # Some compilers place space between "-{L,R}" and the path. + # Remove the space. + if test $p = "-L" || + test $p = "-R"; then + prev=$p + continue + else + prev= + fi + + if test "$pre_test_object_deps_done" = no; then + case $p in + -L* | -R*) + # Internal compiler library paths should come after those + # provided the user. The postdeps already come after the + # user supplied libs so there is no need to process them. + if test -z "$compiler_lib_search_path_CXX"; then + compiler_lib_search_path_CXX="${prev}${p}" + else + compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" + fi + ;; + # The "-l" case would never come before the object being + # linked, so don't bother handling this case. + esac + else + if test -z "$postdeps_CXX"; then + postdeps_CXX="${prev}${p}" + else + postdeps_CXX="${postdeps_CXX} ${prev}${p}" + fi + fi + ;; + + *.$objext) + # This assumes that the test object file only shows up + # once in the compiler output. + if test "$p" = "conftest.$objext"; then + pre_test_object_deps_done=yes + continue + fi + + if test "$pre_test_object_deps_done" = no; then + if test -z "$predep_objects_CXX"; then + predep_objects_CXX="$p" + else + predep_objects_CXX="$predep_objects_CXX $p" + fi + else + if test -z "$postdep_objects_CXX"; then + postdep_objects_CXX="$p" + else + postdep_objects_CXX="$postdep_objects_CXX $p" + fi + fi + ;; + + *) ;; # Ignore the rest. + + esac + done + + # Clean up. + rm -f a.out a.exe +else + echo "libtool.m4: error: problem compiling CXX test program" +fi + +$RM -f confest.$objext + +# PORTME: override above test on systems where it is broken +case $host_os in +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*) + # 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= + +{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } + + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_CXX='-Bstatic' + fi + ;; + amigaos*) + if test "$host_cpu" = m68k; then + # 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' + fi + ;; + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | cygwin* | os2* | pw32*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # 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= + ;; + 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 IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + lt_prog_compiler_pic_CXX='-fPIC' + ;; + esac + ;; + *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 + ;; + 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) + case $cc_basename in + KCC*) + # KAI C++ Compiler + lt_prog_compiler_wl_CXX='--backend -Wl,' + lt_prog_compiler_pic_CXX='-fPIC' + ;; + icpc* | ecpc* ) + # Intel C++ + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-static' + ;; + pgCC* | 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*) + # IBM XL 8.0 on PPC + 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*) + ;; + *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*) + # 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: result: $lt_prog_compiler_pic_CXX" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6; } + + + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$lt_prog_compiler_pic_CXX"; then + { echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6; } +if test "${lt_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:__oline__: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:__oline__: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_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 "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_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:__oline__: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:__oline__: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_CXX=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $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:__oline__: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:__oline__: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_CXX=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $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' + 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 + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + export_symbols_cmds_CXX="$ltdll_cmds" + ;; + cygwin* | mingw*) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;/^.*[ ]__nm__/s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + ;; + *) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac + exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' + +{ 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; } + $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 + archive_cmds_need_lc_CXX=no + else + archive_cmds_need_lc_CXX=yes + fi + allow_undefined_flag_CXX=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5 +echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6; } + ;; + esac + fi + ;; +esac + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } + +library_names_spec= +libname_spec='lib$name' +soname_spec= +shrext_cmds=".so" +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +need_lib_prefix=unknown +hardcode_into_libs=no + +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +need_version=unknown + +case $host_os in +aix3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX 3 has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}${shared_ext}$major' + ;; + +aix[4-9]*) + version_type=linux + need_lib_prefix=no + need_version=no + hardcode_into_libs=yes + if test "$host_cpu" = ia64; then + # AIX 5 supports IA64 + library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + else + # With GCC up to 2.95.x, collect2 would create an import file + # for dependence libraries. The import file would start with + # the line `#! .'. This would cause the generated library to + # depend on `.', always an invalid library. This was fixed in + # development snapshots of GCC prior to 3.0. + case $host_os in + aix4 | aix4.[01] | aix4.[01].*) + if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' + echo ' yes ' + echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then + : + else + can_build_shared=no + fi + ;; + esac + # AIX (on Power*) has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + if test "$aix_use_runtimelinking" = yes; then + # If using run time linking (on AIX 4.2 or later) use lib.so + # instead of lib.a to let people know that these are not + # typical AIX shared libraries. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + else + # We preserve .a as extension for shared libraries through AIX4.2 + # and later when we are not doing run time linking. + library_names_spec='${libname}${release}.a $libname.a' + soname_spec='${libname}${release}${shared_ext}$major' + fi + shlibpath_var=LIBPATH + fi + ;; + +amigaos*) + if test "$host_cpu" = m68k; then + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + else + dynamic_linker=no + fi + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + 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="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${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 + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ + freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix[3-9]*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux* | k*bsd*-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' + 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 + 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 + 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 + + # 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;/^$/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' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=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 + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + 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 + need_lib_prefix=no + need_version=no + library_name_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 + 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 + 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 + + +# 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" + enable_unity="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 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 + + + # If we're building with support for Unity, we'll need a few additional + # libraries. + if test "$enable_unity" != "no"; then + + # Unity needs the X11 Screen Saver extension library. It should be + # in the same place as the X11 libraries, so no need for any fancy + # path checking. + { echo "$as_me:$LINENO: checking for XScreenSaverQueryExtension in -lXss" >&5 +echo $ECHO_N "checking for XScreenSaverQueryExtension in -lXss... $ECHO_C" >&6; } +if test "${ac_cv_lib_Xss_XScreenSaverQueryExtension+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lXss $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 XScreenSaverQueryExtension (); +int +main () +{ +return XScreenSaverQueryExtension (); + ; + 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_Xss_XScreenSaverQueryExtension=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_Xss_XScreenSaverQueryExtension=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_Xss_XScreenSaverQueryExtension" >&5 +echo "${ECHO_T}$ac_cv_lib_Xss_XScreenSaverQueryExtension" >&6; } +if test $ac_cv_lib_Xss_XScreenSaverQueryExtension = yes; then + COMMON_XLIBS="-lXss $COMMON_XLIBS" +else + { { echo "$as_me:$LINENO: error: libXss not found. Please configure without Unity (using --disable-unity) or install the libXss devel package." >&5 +echo "$as_me: error: libXss not found. Please configure without Unity (using --disable-unity) or install the libXss devel package." >&2;} + { (exit 1); exit 1; }; } +fi + + + # Check for the uriparser library and headers. The upstream uriparser + # doesn't appear to ship with either a pkg-config file or a + # uriparser-config binary, so we'll look for it the old-fashioned + # way. + # + # Note that we look for uriFreeQueryListA because it's a relatively + # new symbol that our code needs (it isn't present in the uriparser + # that shipped with Ubuntu Hardy). + ORIGINAL_LDFLAGS="$LDFLAGS" + LDFLAGS="$CUSTOM_URIPARSER_LIBS $LDFLAGS" + { echo "$as_me:$LINENO: checking for uriFreeQueryListA in -luriparser" >&5 +echo $ECHO_N "checking for uriFreeQueryListA in -luriparser... $ECHO_C" >&6; } +if test "${ac_cv_lib_uriparser_uriFreeQueryListA+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-luriparser $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 uriFreeQueryListA (); +int +main () +{ +return uriFreeQueryListA (); + ; + 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_uriparser_uriFreeQueryListA=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_uriparser_uriFreeQueryListA=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_uriparser_uriFreeQueryListA" >&5 +echo "${ECHO_T}$ac_cv_lib_uriparser_uriFreeQueryListA" >&6; } +if test $ac_cv_lib_uriparser_uriFreeQueryListA = yes; then + if test -n "$CUSTOM_URIPARSER_LIBS"; then + URIPARSER_LIBS="$CUSTOM_URIPARSER_LIBS" + else + URIPARSER_LIBS="-luriparser" + fi +else + { { echo "$as_me:$LINENO: error: uriparser library not found or is too old. Please configure without Unity (using --disable-unity) or install the liburiparser devel package." >&5 +echo "$as_me: error: uriparser library not found or is too old. Please configure without Unity (using --disable-unity) or install the liburiparser devel package." >&2;} + { (exit 1); exit 1; }; } +fi + + LDFLAGS="$ORIGINAL_LDFLAGS" + + if test -n "$CUSTOM_URIPARSER_CPPFLAGS"; then + URIPARSER_CPPFLAGS="$CUSTOM_URIPARSER_CPPFLAGS" + else + # XXX: No pkg-config and no uriparser-config means we need to + # hard-code a sensible default. + URIPARSER_CPPFLAGS="-I/usr/include/uriparser" + fi + ORIGINAL_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$URIPARSER_CPPFLAGS $CPPFLAGS" + if test "${ac_cv_header_Uri_h+set}" = set; then + { echo "$as_me:$LINENO: checking for Uri.h" >&5 +echo $ECHO_N "checking for Uri.h... $ECHO_C" >&6; } +if test "${ac_cv_header_Uri_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_Uri_h" >&5 +echo "${ECHO_T}$ac_cv_header_Uri_h" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking Uri.h usability" >&5 +echo $ECHO_N "checking Uri.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 Uri.h presence" >&5 +echo $ECHO_N "checking Uri.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: Uri.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: Uri.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: Uri.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: Uri.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: Uri.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: Uri.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: Uri.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: Uri.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: Uri.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: Uri.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: Uri.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: Uri.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: Uri.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: Uri.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: Uri.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: Uri.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 Uri.h" >&5 +echo $ECHO_N "checking for Uri.h... $ECHO_C" >&6; } +if test "${ac_cv_header_Uri_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_Uri_h=$ac_header_preproc +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_Uri_h" >&5 +echo "${ECHO_T}$ac_cv_header_Uri_h" >&6; } + +fi +if test $ac_cv_header_Uri_h = yes; then + : +else + { { echo "$as_me:$LINENO: error: uriparser headers not found. Please configure without Unity (using --disable-unity) or install the liburiparser devel package" >&5 +echo "$as_me: error: uriparser headers not found. Please configure without Unity (using --disable-unity) or install the liburiparser devel package" >&2;} + { (exit 1); exit 1; }; } +fi + + + CPPFLAGS="$ORIGINAL_CPPFLAGS" + + # Check for libpng using pkg-config, or barring that, using + # libpng-config. + if test "$HAVE_PKG_CONFIG" = "yes"; then + { echo "$as_me:$LINENO: checking for libpng (via pkg-config)" >&5 +echo $ECHO_N "checking for libpng (via pkg-config)... $ECHO_C" >&6; } + if pkg-config --exists libpng12; then + LIBPNG_CPPFLAGS="`pkg-config --cflags libpng12`" + LIBPNG_LIBS="`pkg-config --libs libpng12`" + { 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 + else + # Extract the first word of "libpng-config", so it can be a program name with args. +set dummy libpng-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_LIBPNG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $LIBPNG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_LIBPNG_CONFIG="$LIBPNG_CONFIG" # 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_LIBPNG_CONFIG="$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_LIBPNG_CONFIG" && ac_cv_path_LIBPNG_CONFIG="no" + ;; +esac +fi +LIBPNG_CONFIG=$ac_cv_path_LIBPNG_CONFIG +if test -n "$LIBPNG_CONFIG"; then + { echo "$as_me:$LINENO: result: $LIBPNG_CONFIG" >&5 +echo "${ECHO_T}$LIBPNG_CONFIG" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + if test "$LIBPNG_CONFIG" != "no"; then + LIBPNG_CPPFLAGS="`$LIBPNG_CONFIG --cflags`" + LIBPNG_LIBS="`$LIBPNG_CONFIG --libs`" + fi + fi + if test -z "$LIBPNG_CPPFLAGS"; then + { { echo "$as_me:$LINENO: error: libpng not found. Please configure without Unity (using --disable-unity) or install the libpng devel package" >&5 +echo "$as_me: error: libpng not found. Please configure without Unity (using --disable-unity) or install the libpng devel package" >&2;} + { (exit 1); exit 1; }; } + fi + + # Check for the zlib library and headers. Like uriparser, there + # isn't a pkg-config or zlib-config file. + ORIGINAL_LDFLAGS="$LDFLAGS" + LDFLAGS="$CUSTOM_ZLIB_LIBS $LDFLAGS" + { echo "$as_me:$LINENO: checking for zlibVersion in -lz" >&5 +echo $ECHO_N "checking for zlibVersion in -lz... $ECHO_C" >&6; } +if test "${ac_cv_lib_z_zlibVersion+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lz $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 zlibVersion (); +int +main () +{ +return zlibVersion (); + ; + 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_z_zlibVersion=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_z_zlibVersion=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_z_zlibVersion" >&5 +echo "${ECHO_T}$ac_cv_lib_z_zlibVersion" >&6; } +if test $ac_cv_lib_z_zlibVersion = yes; then + if test -n "$CUSTOM_ZLIB_LIBS"; then + ZLIB_LIBS="$CUSTOM_ZLIB_LIBS" + else + ZLIB_LIBS="-lz" + fi +else + { { echo "$as_me:$LINENO: error: zlib library not found. Please configure without Unity (using --disable-unity) or install the zlib devel package." >&5 +echo "$as_me: error: zlib library not found. Please configure without Unity (using --disable-unity) or install the zlib devel package." >&2;} + { (exit 1); exit 1; }; } +fi + + LDFLAGS="$ORIGINAL_LDFLAGS" + + if test -n "$CUSTOM_ZLIB_CPPFLAGS"; then + ZLIB_CPPFLAGS="$CUSTOM_ZLIB_CPPFLAGS" + else + # XXX: No pkg-config and no zlib-config means we need to + # hard-code a sensible default. + ZLIB_CPPFLAGS="-I/usr/include" + fi + ORIGINAL_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$ZLIB_CPPFLAGS $CPPFLAGS" + if test "${ac_cv_header_zlib_h+set}" = set; then + { echo "$as_me:$LINENO: checking for zlib.h" >&5 +echo $ECHO_N "checking for zlib.h... $ECHO_C" >&6; } +if test "${ac_cv_header_zlib_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5 +echo "${ECHO_T}$ac_cv_header_zlib_h" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking zlib.h usability" >&5 +echo $ECHO_N "checking zlib.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 zlib.h presence" >&5 +echo $ECHO_N "checking zlib.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: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: zlib.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: zlib.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: zlib.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: zlib.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: zlib.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: zlib.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: zlib.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: zlib.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: zlib.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: zlib.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: zlib.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: zlib.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 zlib.h" >&5 +echo $ECHO_N "checking for zlib.h... $ECHO_C" >&6; } +if test "${ac_cv_header_zlib_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_zlib_h=$ac_header_preproc +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5 +echo "${ECHO_T}$ac_cv_header_zlib_h" >&6; } + +fi +if test $ac_cv_header_zlib_h = yes; then + : +else + { { echo "$as_me:$LINENO: error: zlib headers not found. Please configure without Unity (using --disable-unity) or install the zlib devel package" >&5 +echo "$as_me: error: zlib headers not found. Please configure without Unity (using --disable-unity) or install the zlib devel package" >&2;} + { (exit 1); exit 1; }; } +fi + + + CPPFLAGS="$ORIGINAL_CPPFLAGS" + fi # End of library checks for Unity. + + if test -n "$CUSTOM_GTK_CPPFLAGS" -o -n "$CUSTOM_GTK_LIBS"; then + # Check to see if we have some version of GTK. gtk_accel_group_add + # is a random function that is present in Gtk 1.2 but not Gtk + # 2.0. Similarly, gtk_tree_view_new is a random function in Gtk 2.0 + # which is not present in Gtk 1.2. + { echo "$as_me:$LINENO: checking for gtk_accel_group_add in -lgtk" >&5 +echo $ECHO_N "checking for gtk_accel_group_add in -lgtk... $ECHO_C" >&6; } +if test "${ac_cv_lib_gtk_gtk_accel_group_add+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lgtk $CUSTOM_GTK_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 gtk_accel_group_add (); +int +main () +{ +return gtk_accel_group_add (); + ; + 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_gtk_gtk_accel_group_add=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_gtk_gtk_accel_group_add=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_gtk_gtk_accel_group_add" >&5 +echo "${ECHO_T}$ac_cv_lib_gtk_gtk_accel_group_add" >&6; } +if test $ac_cv_lib_gtk_gtk_accel_group_add = yes; then + HAVE_GTK1="yes" +fi + + if test "$with_gtk2" != "no"; then + { echo "$as_me:$LINENO: checking for gtk_tree_view_new in -lgtk-x11-2.0" >&5 +echo $ECHO_N "checking for gtk_tree_view_new in -lgtk-x11-2.0... $ECHO_C" >&6; } +if test "${ac_cv_lib_gtk_x11_2_0_gtk_tree_view_new+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lgtk-x11-2.0 $CUSTOM_GTK_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 gtk_tree_view_new (); +int +main () +{ +return gtk_tree_view_new (); + ; + 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_gtk_x11_2_0_gtk_tree_view_new=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_gtk_x11_2_0_gtk_tree_view_new=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_gtk_x11_2_0_gtk_tree_view_new" >&5 +echo "${ECHO_T}$ac_cv_lib_gtk_x11_2_0_gtk_tree_view_new" >&6; } +if test $ac_cv_lib_gtk_x11_2_0_gtk_tree_view_new = yes; then + HAVE_GTK2="yes" +fi + + fi + fi + + # Sometimes pkg-config can find stuff that AC_CHECK_LIB can't, so we use that as well. + if test "$HAVE_PKG_CONFIG" = "yes"; then + if test "$with_gtk2" != "no"; then + { 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 + HAVE_GTK2="yes" + { 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 + fi + + { echo "$as_me:$LINENO: checking for Gtk+ 1.x (via pkg-config)" >&5 +echo $ECHO_N "checking for Gtk+ 1.x (via pkg-config)... $ECHO_C" >&6; } + # The latter half of the test is because pkg-config's fallback + # to gtk-config is broken on systems such as Ubuntu that use + # bash-completion for unknown commands. (On Ubuntu, typing + # 'gtk-config' on a system that doesn't have libgtk1.2-dev + # installed outputs hints about using apt-get, in addition to the + # regular bash "command not found" message.) + if pkg-config --exists gtk+ \ + && test -n "`pkg-config --libs gtk+ 2>/dev/null | grep -v '^ *$'`"; then + HAVE_GTK1="yes" + { 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 + fi + + if test "$HAVE_GTK1" = "yes" -o "$HAVE_GTK2" = "yes"; then + # This bit is to fix builds on OpenSolaris B71, where + # 'pkg-config --cflags gtk+-2.0' gives an error. + if test "$HAVE_GTK2" = "yes" -a "$HAVE_PKG_CONFIG" = "yes" \ + && ! pkg-config --exists gtk+-2.0 \ + && test -z "$CUSTOM_GTK_CPPFLAGS" -a -z "$CUSTOM_GTK_LIBS"; then + HAVE_GTK2="no" + fi + + if test "$HAVE_GTK2" = "yes"; then + # Gtk 2.0 + GTK_CPPFLAGS="$GTK_CPPFLAGS -DGTK2" + gtkPackageName="gtk+-2.0" + elif test "$HAVE_GTK1" = "yes"; then + # Gtk 1.2 + gtkPackageName="gtk+" + + # Unity requires Gtk 2.0. + if test "$enable_unity" != "no"; then + { { echo "$as_me:$LINENO: error: The Unity feature requires Gtk+ 2.0. Please install the Gtk+ 2.0 devel packages or configure without Unity (using --disable-unity)" >&5 +echo "$as_me: error: The Unity feature requires Gtk+ 2.0. Please install the Gtk+ 2.0 devel packages or configure without Unity (using --disable-unity)" >&2;} + { (exit 1); exit 1; }; } + fi + else + # We found Gtk+ 2.0 that turned out to have a non-working + # pkg-config setup, AND Gtk 1.2 wasn't installed. + { { echo "$as_me:$LINENO: error: The Gtk+ library installed on your system is not fully functional. Please contact your OS vendor." >&5 +echo "$as_me: error: The Gtk+ library installed on your system is not fully functional. Please contact your OS vendor." >&2;} + { (exit 1); exit 1; }; } + fi + + # Prefer flags specified, in the environment, by the user. + if test -n "$CUSTOM_GTK_CPPFLAGS" -o -n "$CUSTOM_GTK_LIBS"; then + GTK_CPPFLAGS="$GTK_CPPFLAGS $CUSTOM_GTK_CPPFLAGS" + GTK_LIBS="$GTK_LIBS $CUSTOM_GTK_LIBS" + # Use pkg-config if available and there are no user-specified flags. + elif test "$HAVE_PKG_CONFIG" = "yes"; then + GTK_CPPFLAGS="$GTK_CPPFLAGS $(pkg-config --cflags $gtkPackageName)" + GTK_LIBS="$GTK_LIBS $(pkg-config --libs $gtkPackageName)" + # Otherwise, we have a problem. + else + { { echo "$as_me:$LINENO: error: pkg-config not found. Get pkg-config or set CUSTOM_GTK_CPPFLAGS and CUSTOM_GTK_LIBS to specify gtk header file and library locations." >&5 +echo "$as_me: error: pkg-config not found. Get pkg-config or set CUSTOM_GTK_CPPFLAGS and CUSTOM_GTK_LIBS to specify gtk header file and library locations." >&2;} + { (exit 1); exit 1; }; } + fi + + # Check for a sufficiently new installation of Gtk 2.0. This symbol is, at + # the time of writing, used in vmware-user. We must perform this check + # after GTK_LIBS has been set up. Note: we don't actually use the + # resultant HAVE_NEW_GTK2 variable; it's just set so that the default + # action, which will append gdk-x11-2.0 to LIBS, isn't taken. + if test "$HAVE_GTK2" == "yes"; then + { echo "$as_me:$LINENO: checking for gdk_display_get_default_group in -lgdk-x11-2.0" >&5 +echo $ECHO_N "checking for gdk_display_get_default_group in -lgdk-x11-2.0... $ECHO_C" >&6; } +if test "${ac_cv_lib_gdk_x11_2_0_gdk_display_get_default_group+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lgdk-x11-2.0 $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 gdk_display_get_default_group (); +int +main () +{ +return gdk_display_get_default_group (); + ; + 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_gdk_x11_2_0_gdk_display_get_default_group=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_gdk_x11_2_0_gdk_display_get_default_group=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_gdk_x11_2_0_gdk_display_get_default_group" >&5 +echo "${ECHO_T}$ac_cv_lib_gdk_x11_2_0_gdk_display_get_default_group" >&6; } +if test $ac_cv_lib_gdk_x11_2_0_gdk_display_get_default_group = yes; then + HAVE_NEW_GTK2="yes" +else + { { echo "$as_me:$LINENO: error: Gtk 2.0 installation may be too old. Please upgrade your Gtk 2.0 packages or configure without Gtk 2.0 (using --without-gtk2)" >&5 +echo "$as_me: error: Gtk 2.0 installation may be too old. Please upgrade your Gtk 2.0 packages or configure without Gtk 2.0 (using --without-gtk2)" >&2;} + { (exit 1); exit 1; }; } + $GTK_LIBS +fi + + fi + + # Unity requires libgdk_pixbuf_xlib, which most systems don't seem to + # provide via "pkg-config --libs gtk+-2.0". + if test "$enable_unity" != "no"; then + { echo "$as_me:$LINENO: checking for gdk_pixbuf_xlib_init in -lgdk_pixbuf_xlib-2.0" >&5 +echo $ECHO_N "checking for gdk_pixbuf_xlib_init in -lgdk_pixbuf_xlib-2.0... $ECHO_C" >&6; } +if test "${ac_cv_lib_gdk_pixbuf_xlib_2_0_gdk_pixbuf_xlib_init+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lgdk_pixbuf_xlib-2.0 $GTK_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 gdk_pixbuf_xlib_init (); +int +main () +{ +return gdk_pixbuf_xlib_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_gdk_pixbuf_xlib_2_0_gdk_pixbuf_xlib_init=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_gdk_pixbuf_xlib_2_0_gdk_pixbuf_xlib_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_gdk_pixbuf_xlib_2_0_gdk_pixbuf_xlib_init" >&5 +echo "${ECHO_T}$ac_cv_lib_gdk_pixbuf_xlib_2_0_gdk_pixbuf_xlib_init" >&6; } +if test $ac_cv_lib_gdk_pixbuf_xlib_2_0_gdk_pixbuf_xlib_init = yes; then + GTK_LIBS="$GTK_LIBS -lgdk_pixbuf_xlib-2.0" +else + { { echo "$as_me:$LINENO: error: gdk_pixbuf_xlib-2.0 not found. Make sure your Gtk 2.0 installation is sane, or configure without Unity (using --disable-unity)." >&5 +echo "$as_me: error: gdk_pixbuf_xlib-2.0 not found. Make sure your Gtk 2.0 installation is sane, or configure without Unity (using --disable-unity)." >&2;} + { (exit 1); exit 1; }; } +fi + + fi + else + { { echo "$as_me:$LINENO: error: libgtk not found. Please install the gtk devel package(s)." >&5 +echo "$as_me: error: libgtk not found. Please install the gtk devel package(s)." >&2;} + { (exit 1); exit 1; }; } + 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" + GUESTD_LDADD="$GUESTD_LDADD -lcrypt" +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 + + +{ echo "$as_me:$LINENO: checking for notify_init in -lnotify" >&5 +echo $ECHO_N "checking for notify_init in -lnotify... $ECHO_C" >&6; } +if test "${ac_cv_lib_notify_notify_init+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lnotify $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 notify_init (); +int +main () +{ +return notify_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_notify_notify_init=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_notify_notify_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_notify_notify_init" >&5 +echo "${ECHO_T}$ac_cv_lib_notify_notify_init" >&6; } +if test $ac_cv_lib_notify_notify_init = yes; then + HAVE_NOTIFY="yes" + VMWARE_USER_LDADD="$VMWARE_USER_LDADD -lnotify" +else + { echo "$as_me:$LINENO: WARNING: libnotify not found; notification disabled" >&5 +echo "$as_me: WARNING: libnotify not found; notification disabled" >&2;} +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 + GUESTD_LDADD="$GUESTD_LDADD -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 + + +{ 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 + GUESTD_LDADD="$GUESTD_LDADD -lpthread" + VMWARE_USER_LDADD="$VMWARE_USER_LDADD -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 + + +# 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 + ORIGINAL_LDFLAGS="$LDFLAGS" + LDFLAGS="$CUSTOM_PROCPS_LIBS $LDFLAGS" + { echo "$as_me:$LINENO: checking for getstat in -lproc-3.2.7" >&5 +echo $ECHO_N "checking for getstat in -lproc-3.2.7... $ECHO_C" >&6; } +if test "${ac_cv_lib_proc_3_2_7_getstat+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lproc-3.2.7 $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 getstat (); +int +main () +{ +return getstat (); + ; + 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_proc_3_2_7_getstat=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_proc_3_2_7_getstat=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_proc_3_2_7_getstat" >&5 +echo "${ECHO_T}$ac_cv_lib_proc_3_2_7_getstat" >&6; } +if test $ac_cv_lib_proc_3_2_7_getstat = yes; then + if test -n "$CUSTOM_PROCPS_LIBS"; then + PROCPS_LIBS="$CUSTOM_PROCPS_LIBS" + else + PROCPS_LIBS="-lproc-3.2.7" + fi +else + { { 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 + + LDFLAGS="$ORIGINAL_LDFLAGS" + + GUESTD_LDADD="$GUESTD_LDADD $PROCPS_LIBS" + VMWARE_USER_LDADD="$VMWARE_USER_LDADD $PROCPS_LIBS" +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 + + +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. + for ac_prog in dumbnet-config dnet-config +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_DNET_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$DNET_CONFIG"; then + ac_cv_prog_DNET_CONFIG="$DNET_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_DNET_CONFIG="$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 +DNET_CONFIG=$ac_cv_prog_DNET_CONFIG +if test -n "$DNET_CONFIG"; then + { echo "$as_me:$LINENO: result: $DNET_CONFIG" >&5 +echo "${ECHO_T}$DNET_CONFIG" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$DNET_CONFIG" && break +done +test -n "$DNET_CONFIG" || DNET_CONFIG="no" + + + if test "$DNET_CONFIG" != no; then + DNET_CPPFLAGS="`$DNET_CONFIG --cflags`" + DNET_LIBS="`$DNET_CONFIG --libs`" + + GUESTD_LDADD="$GUESTD_LDADD $DNET_LIBS" + VMWARE_USER_LDADD="$VMWARE_USER_LDADD $DNET_LIBS" + if test "$DNET_CONFIG" == dumbnet-config; then + +cat >>confdefs.h <<\_ACEOF +@%:@define DNET_IS_DUMBNET 1 +_ACEOF + + fi + else + { { 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 "$with_icu" = "yes"; 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_ICU_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $ICU_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ICU_CONFIG="$ICU_CONFIG" # 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_ICU_CONFIG="$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_ICU_CONFIG" && ac_cv_path_ICU_CONFIG="no" + ;; +esac +fi +ICU_CONFIG=$ac_cv_path_ICU_CONFIG +if test -n "$ICU_CONFIG"; then + { echo "$as_me:$LINENO: result: $ICU_CONFIG" >&5 +echo "${ECHO_T}$ICU_CONFIG" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + + if test "$ICU_CONFIG" != no; then + ICU_CPPFLAGS="`$ICU_CONFIG --cppflags` -DUSE_ICU" + ICU_LIBS="`$ICU_CONFIG --ldflags`" + + # The icu components are built with C++, so we need to ensure + # that the C++ linker actually exists, and use it when linking + # icu into our applications and when performing configuration + # tests against icu. + # + # XXX: Getting automake to choose between the C linker and the + # C++ linker depending on HAVE_ICU was a royal pain in the ass. + # The classic way to do this is to define an optional source + # file for a program with an extension of .cxx, using + # nodist_EXTRA_fooprogram_SOURCES. This causes automake's + # linker detection algorithm to see a C++ source file and + # automatically set up the C++ linker and link line for us. + # Unfortunately, said linker detection doesn't obey + # conditionals, which means that it'd always pick the C++ + # linker, regardless of the value of HAVE_ICU. Instead, we are + # forced to manually set the correct linker in fooprogram_LINK. + # However, since none of our programs actually contain C++ + # code, automake doesn't make the CXXLINK variable (which + # contains the linker as well as all link flags) available to + # us, so we must hard-code the entire link line into + # fooprogram_LINK. Not exactly a futureproof solution... + # + # Additional references on this problem: + # http://sources.redhat.com/ml/automake/1999-10/msg00101.html + # http://lists.gnu.org/archive/html/bug-automake/2008-04/msg00010.html + # http://www.gnu.org/software/automake/manual/automake.html#Libtool-Convenience-Libraries + # http://www.gnu.org/software/automake/manual/automake.html#C_002b_002b-Support + 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="" + 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 -z "$HAVE_CXX"; then + { { echo "$as_me:$LINENO: error: No C++ compiler was found on your PATH. Please configure without ICU (using --without-icu) or install a C++ compiler." >&5 +echo "$as_me: error: No C++ compiler was found on your PATH. Please configure without ICU (using --without-icu) or install a C++ compiler." >&2;} + { (exit 1); exit 1; }; } + 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 + + { echo "$as_me:$LINENO: checking for ucasemap_utf8ToTitle_3_8 in -licuuc" >&5 +echo $ECHO_N "checking for ucasemap_utf8ToTitle_3_8 in -licuuc... $ECHO_C" >&6; } +if test "${ac_cv_lib_icuuc_ucasemap_utf8ToTitle_3_8+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-licuuc $ICU_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 ucasemap_utf8ToTitle_3_8 (); +int +main () +{ +return ucasemap_utf8ToTitle_3_8 (); + ; + 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 + ac_cv_lib_icuuc_ucasemap_utf8ToTitle_3_8=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_icuuc_ucasemap_utf8ToTitle_3_8=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_icuuc_ucasemap_utf8ToTitle_3_8" >&5 +echo "${ECHO_T}$ac_cv_lib_icuuc_ucasemap_utf8ToTitle_3_8" >&6; } +if test $ac_cv_lib_icuuc_ucasemap_utf8ToTitle_3_8 = yes; then + have_ICU_38="yes" +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 "$have_ICU_38" = "yes"; then + ICU_CPPFLAGS="$ICU_CPPFLAGS -DHAVE_ICU_38" + fi + + # Easier to give all modules the ICU defines/includes... + CPPFLAGS="$CPPFLAGS $ICU_CPPFLAGS" + else + { { echo "$as_me:$LINENO: error: icu-config was not found on your PATH. Please configure without ICU (using --without-icu) or install ICU - http://www.icu-project.org" >&5 +echo "$as_me: error: icu-config was not found on your PATH. Please configure without ICU (using --without-icu) or install ICU - http://www.icu-project.org" >&2;} + { (exit 1); exit 1; }; } + fi +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 "$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 + +### +### 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 +### + +# Check to see if SYS_setuid32 is defined. If SYS_setuid32 is unknown, we will +# certainly error out. +if test "$os$userSpaceBitness" = "linux32"; then + { echo "$as_me:$LINENO: checking for SYS_setuid32" >&5 +echo $ECHO_N "checking for SYS_setuid32... $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 + #include +int +main () +{ + + syscall(SYS_setuid32, 1); + + ; + 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 + HAVE_SYS_SETUID="yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + HAVE_SYS_SETUID="no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + { echo "$as_me:$LINENO: result: $HAVE_SYS_SETUID" >&5 +echo "${ECHO_T}$HAVE_SYS_SETUID" >&6; } +fi + +# Newer iconv (from glibc 2.2 and later on Linux) takes a char ** as the second +# argument. Here, we test for the older form and expect a compiler warning/error +# if the newer form is defined (because, in that case, we would be attempting to +# remove const'ness without an explicit cast). +{ echo "$as_me:$LINENO: checking for the new format of iconv" >&5 +echo $ECHO_N "checking for the new format of iconv... $ECHO_C" >&6; } +ORIGINAL_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS -Werror" +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 () +{ + + iconv_t cd; + char const *inbuf; + size_t inbytesleft; + char *outbuf; + size_t outbytesleft; + + iconv(cd, &inbuf, &inbytesleft, &outbuf, &outbytesleft); + + ; + 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 + HAVE_NEW_ICONV="no" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + HAVE_NEW_ICONV="yes" +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +CFLAGS="$ORIGINAL_CFLAGS" +{ echo "$as_me:$LINENO: result: $HAVE_NEW_ICONV" >&5 +echo "${ECHO_T}$HAVE_NEW_ICONV" >&6; } + +if test "$os" = "linux"; then + +for ac_func in lseek +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 + HAVE_LSEEK="yes" +else + HAVE_LSEEK="no" +fi +done + + + # setresuid() was wrapped beginning in glibc 2.3.2. + { echo "$as_me:$LINENO: checking for setresuid" >&5 +echo $ECHO_N "checking for setresuid... $ECHO_C" >&6; } + # Ensure an error is thrown if setresuid is unknown. + ORIGINAL_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Werror-implicit-function-declaration -Werror" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#define _GNU_SOURCE + #include +int +main () +{ + + setresuid(0, 0, 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 + HAVE_SETRESUID="yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + HAVE_SETRESUID="no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$ORIGINAL_CFLAGS" + { echo "$as_me:$LINENO: result: $HAVE_SETRESUID" >&5 +echo "${ECHO_T}$HAVE_SETRESUID" >&6; } +fi + +### 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. +for TEST_CFLAG in -Wno-pointer-sign -Wno-unused-value -fno-strict-aliasing \ + -Wno-unknown-pragmas -Wno-uninitialized; 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 -DNO_CORE_ICU" + +INCLUDE_DIR="`cd $srcdir; pwd`/lib/include" +CPPFLAGS="$CPPFLAGS -I$INCLUDE_DIR" + +### 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" + + if test "$osVersion" -ge 202000; then + MODULES="$MODULES vmmemctl vmxnet" + fi + if test "$osVersion" -ge 204000; then + MODULES="$MODULES vmblock vmci vmhgfs vsock" + buildHgfsmounter=yes + fi + if test "$osVersion" -ge 206000; then + MODULES="$MODULES vmxnet3" + fi + if test "$osVersion" -ge 206006; then + MODULES="$MODULES vmsync" + fi +fi + +if test "$os" = "freebsd"; then + 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 vmhgfs" + buildHgfsmounter=yes + 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" + + GUESTD_LDADD="$GUESTD_LDADD -lsocket" + GUESTD_LDADD="$GUESTD_LDADD -lnsl" + GUESTD_LDADD="$GUESTD_LDADD -lrpcsvc" + + VMWARE_USER_CPPFLAGS="$VMWARE_USER_CPPFLAGS -I/usr/X11/include/" + VMWARE_USER_LDADD="$VMWARE_USER_LDADD -lXext" + VMWARE_USER_LDADD="$VMWARE_USER_LDADD -lX11" + VMWARE_USER_LDADD="$VMWARE_USER_LDADD -lsocket" + VMWARE_USER_LDADD="$VMWARE_USER_LDADD -lnsl" + VMWARE_USER_LDADD="$VMWARE_USER_LDADD -lrpcsvc" + + # uname -r on Solaris 10 reports "5.10" + if test "$osVersion" -ge 510000; then + CPPFLAGS="$CPPFLAGS -DSOL10" + 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"; then + FREEBSD_TRUE= + FREEBSD_FALSE='#' +else + FREEBSD_TRUE='#' + FREEBSD_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 -d /etc/pam.d; then + PAMD_TRUE= + PAMD_FALSE='#' +else + PAMD_TRUE='#' + PAMD_FALSE= +fi + + if test "$enable_unity" = "yes"; then + ENABLE_UNITY_TRUE= + ENABLE_UNITY_FALSE='#' +else + ENABLE_UNITY_TRUE='#' + ENABLE_UNITY_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 + + +### 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 + +if test "$os$userSpaceBitness" = "linux64" || test "$HAVE_SYS_SETUID" = "yes"; then + LIB_MISC_CPPFLAGS="$LIB_MISC_CPPFLAGS -DGLIBC_VERSION_21" +fi + +if test "$HAVE_NEW_ICONV" = "yes"; then + LIB_MISC_CPPFLAGS="$LIB_MISC_CPPFLAGS -DGLIBC_VERSION_22" +fi + +if test "$HAVE_LSEEK" = "yes"; then + LIB_FILE_CPPFLAGS="$LIB_FILE_CPPFLAGS -DGLIBC_VERSION_21" + LIB_HGFS_SERVER_CPPFLAGS="$LIB_HGFS_SERVER_CPPFLAGS -DGLIBC_VERSION_21" +fi + +if test "$HAVE_SETRESUID" = "yes"; then + LIB_PROC_MGR_CPPFLAGS="$LIB_PROC_MGR_CPPFLAGS -DGLIBC_VERSION_23" +fi + +if test "$HAVE_CRYPT" = "yes"; then + LIB_AUTH_CPPFLAGS="$LIB_AUTH_CPPFLAGS -DGLIBC_VERSION_22" +fi + +if test "$HAVE_WCHAR_H" = "yes"; then + LIB_STRING_CPPFLAGS="$LIB_STRING_CPPFLAGS -DGLIBC_VERSION_22" +fi + +### General substs + + + + + + + + + + + + + + + + + + + + + + +### 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/backdoor/shared/Makefile lib/conf/Makefile lib/dict/Makefile lib/dnd/Makefile lib/dynxdr/Makefile lib/err/Makefile lib/eventManager/Makefile lib/file/Makefile lib/foundryMsg/Makefile lib/ghIntegration/Makefile lib/ghIntegrationStub/Makefile lib/guestApp/Makefile lib/guestInfo/Makefile lib/guestRpc/Makefile lib/hgfs/Makefile lib/hgfsBd/Makefile lib/hgfsServer/Makefile lib/hgfsServerManagerGuest/Makefile lib/hgfsServerPolicyGuest/Makefile lib/deployPkg/Makefile lib/image/Makefile lib/impersonate/Makefile lib/message/Makefile lib/message/shared/Makefile lib/misc/Makefile lib/misc/shared/Makefile lib/netUtil/Makefile lib/panic/Makefile lib/panicDefault/Makefile lib/printer/Makefile lib/procMgr/Makefile lib/raster/Makefile lib/region/Makefile lib/resolution/Makefile lib/rpcIn/Makefile lib/rpcOut/Makefile lib/rpcOut/shared/Makefile lib/rpcVmx/Makefile lib/SLPv2Parser/Makefile lib/socketMgr/Makefile lib/string/Makefile lib/string/shared/Makefile lib/stubs/Makefile lib/stubs/shared/Makefile lib/sync/Makefile lib/sync/shared/Makefile lib/syncDriver/Makefile lib/system/Makefile lib/toolsLogger/Makefile lib/unicode/Makefile lib/unity/Makefile lib/unityStub/Makefile lib/unityWindowTracker/Makefile lib/user/Makefile lib/vixTools/Makefile lib/vmBackupLib/Makefile lib/vmCheck/Makefile lib/vmSignal/Makefile lib/wiper/Makefile guestd/Makefile vmware-user/Makefile vmware-user-suid-wrapper/Makefile toolbox/Makefile hgfsclient/Makefile hgfsmounter/Makefile checkvm/Makefile libguestlib/Makefile xferlogs/Makefile modules/Makefile scripts/Makefile" + + +### +### 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 "${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 "${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 "${PAMD_TRUE}" && test -z "${PAMD_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"PAMD\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"PAMD\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${ENABLE_UNITY_TRUE}" && test -z "${ENABLE_UNITY_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"ENABLE_UNITY\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"ENABLE_UNITY\" 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 + +: ${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 2008.10.10-123053, 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 2008.10.10-123053 +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 "X$macro_version" | $Xsed -e "$delay_single_quote_subst"`' +macro_revision='`$ECHO "X$macro_revision" | $Xsed -e "$delay_single_quote_subst"`' +enable_shared='`$ECHO "X$enable_shared" | $Xsed -e "$delay_single_quote_subst"`' +enable_static='`$ECHO "X$enable_static" | $Xsed -e "$delay_single_quote_subst"`' +pic_mode='`$ECHO "X$pic_mode" | $Xsed -e "$delay_single_quote_subst"`' +enable_fast_install='`$ECHO "X$enable_fast_install" | $Xsed -e "$delay_single_quote_subst"`' +host_alias='`$ECHO "X$host_alias" | $Xsed -e "$delay_single_quote_subst"`' +host='`$ECHO "X$host" | $Xsed -e "$delay_single_quote_subst"`' +host_os='`$ECHO "X$host_os" | $Xsed -e "$delay_single_quote_subst"`' +build_alias='`$ECHO "X$build_alias" | $Xsed -e "$delay_single_quote_subst"`' +build='`$ECHO "X$build" | $Xsed -e "$delay_single_quote_subst"`' +build_os='`$ECHO "X$build_os" | $Xsed -e "$delay_single_quote_subst"`' +SED='`$ECHO "X$SED" | $Xsed -e "$delay_single_quote_subst"`' +Xsed='`$ECHO "X$Xsed" | $Xsed -e "$delay_single_quote_subst"`' +GREP='`$ECHO "X$GREP" | $Xsed -e "$delay_single_quote_subst"`' +EGREP='`$ECHO "X$EGREP" | $Xsed -e "$delay_single_quote_subst"`' +FGREP='`$ECHO "X$FGREP" | $Xsed -e "$delay_single_quote_subst"`' +LD='`$ECHO "X$LD" | $Xsed -e "$delay_single_quote_subst"`' +NM='`$ECHO "X$NM" | $Xsed -e "$delay_single_quote_subst"`' +LN_S='`$ECHO "X$LN_S" | $Xsed -e "$delay_single_quote_subst"`' +max_cmd_len='`$ECHO "X$max_cmd_len" | $Xsed -e "$delay_single_quote_subst"`' +ac_objext='`$ECHO "X$ac_objext" | $Xsed -e "$delay_single_quote_subst"`' +exeext='`$ECHO "X$exeext" | $Xsed -e "$delay_single_quote_subst"`' +lt_unset='`$ECHO "X$lt_unset" | $Xsed -e "$delay_single_quote_subst"`' +lt_SP2NL='`$ECHO "X$lt_SP2NL" | $Xsed -e "$delay_single_quote_subst"`' +lt_NL2SP='`$ECHO "X$lt_NL2SP" | $Xsed -e "$delay_single_quote_subst"`' +reload_flag='`$ECHO "X$reload_flag" | $Xsed -e "$delay_single_quote_subst"`' +reload_cmds='`$ECHO "X$reload_cmds" | $Xsed -e "$delay_single_quote_subst"`' +deplibs_check_method='`$ECHO "X$deplibs_check_method" | $Xsed -e "$delay_single_quote_subst"`' +file_magic_cmd='`$ECHO "X$file_magic_cmd" | $Xsed -e "$delay_single_quote_subst"`' +AR='`$ECHO "X$AR" | $Xsed -e "$delay_single_quote_subst"`' +AR_FLAGS='`$ECHO "X$AR_FLAGS" | $Xsed -e "$delay_single_quote_subst"`' +STRIP='`$ECHO "X$STRIP" | $Xsed -e "$delay_single_quote_subst"`' +RANLIB='`$ECHO "X$RANLIB" | $Xsed -e "$delay_single_quote_subst"`' +old_postinstall_cmds='`$ECHO "X$old_postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +old_postuninstall_cmds='`$ECHO "X$old_postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_cmds='`$ECHO "X$old_archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' +CC='`$ECHO "X$CC" | $Xsed -e "$delay_single_quote_subst"`' +CFLAGS='`$ECHO "X$CFLAGS" | $Xsed -e "$delay_single_quote_subst"`' +compiler='`$ECHO "X$compiler" | $Xsed -e "$delay_single_quote_subst"`' +GCC='`$ECHO "X$GCC" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_pipe='`$ECHO "X$lt_cv_sys_global_symbol_pipe" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_cdecl='`$ECHO "X$lt_cv_sys_global_symbol_to_cdecl" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' +objdir='`$ECHO "X$objdir" | $Xsed -e "$delay_single_quote_subst"`' +SHELL='`$ECHO "X$SHELL" | $Xsed -e "$delay_single_quote_subst"`' +ECHO='`$ECHO "X$ECHO" | $Xsed -e "$delay_single_quote_subst"`' +MAGIC_CMD='`$ECHO "X$MAGIC_CMD" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag='`$ECHO "X$lt_prog_compiler_no_builtin_flag" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_wl='`$ECHO "X$lt_prog_compiler_wl" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_pic='`$ECHO "X$lt_prog_compiler_pic" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_static='`$ECHO "X$lt_prog_compiler_static" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o='`$ECHO "X$lt_cv_prog_compiler_c_o" | $Xsed -e "$delay_single_quote_subst"`' +need_locks='`$ECHO "X$need_locks" | $Xsed -e "$delay_single_quote_subst"`' +DSYMUTIL='`$ECHO "X$DSYMUTIL" | $Xsed -e "$delay_single_quote_subst"`' +NMEDIT='`$ECHO "X$NMEDIT" | $Xsed -e "$delay_single_quote_subst"`' +libext='`$ECHO "X$libext" | $Xsed -e "$delay_single_quote_subst"`' +shrext_cmds='`$ECHO "X$shrext_cmds" | $Xsed -e "$delay_single_quote_subst"`' +extract_expsyms_cmds='`$ECHO "X$extract_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' +archive_cmds_need_lc='`$ECHO "X$archive_cmds_need_lc" | $Xsed -e "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes='`$ECHO "X$enable_shared_with_static_runtimes" | $Xsed -e "$delay_single_quote_subst"`' +export_dynamic_flag_spec='`$ECHO "X$export_dynamic_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' +whole_archive_flag_spec='`$ECHO "X$whole_archive_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' +compiler_needs_object='`$ECHO "X$compiler_needs_object" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_from_new_cmds='`$ECHO "X$old_archive_from_new_cmds" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds='`$ECHO "X$old_archive_from_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' +archive_cmds='`$ECHO "X$archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' +archive_expsym_cmds='`$ECHO "X$archive_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' +module_cmds='`$ECHO "X$module_cmds" | $Xsed -e "$delay_single_quote_subst"`' +module_expsym_cmds='`$ECHO "X$module_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' +with_gnu_ld='`$ECHO "X$with_gnu_ld" | $Xsed -e "$delay_single_quote_subst"`' +allow_undefined_flag='`$ECHO "X$allow_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' +no_undefined_flag='`$ECHO "X$no_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec='`$ECHO "X$hardcode_libdir_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_ld='`$ECHO "X$hardcode_libdir_flag_spec_ld" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_separator='`$ECHO "X$hardcode_libdir_separator" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_direct='`$ECHO "X$hardcode_direct" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_direct_absolute='`$ECHO "X$hardcode_direct_absolute" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_minus_L='`$ECHO "X$hardcode_minus_L" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_shlibpath_var='`$ECHO "X$hardcode_shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_automatic='`$ECHO "X$hardcode_automatic" | $Xsed -e "$delay_single_quote_subst"`' +inherit_rpath='`$ECHO "X$inherit_rpath" | $Xsed -e "$delay_single_quote_subst"`' +link_all_deplibs='`$ECHO "X$link_all_deplibs" | $Xsed -e "$delay_single_quote_subst"`' +fix_srcfile_path='`$ECHO "X$fix_srcfile_path" | $Xsed -e "$delay_single_quote_subst"`' +always_export_symbols='`$ECHO "X$always_export_symbols" | $Xsed -e "$delay_single_quote_subst"`' +export_symbols_cmds='`$ECHO "X$export_symbols_cmds" | $Xsed -e "$delay_single_quote_subst"`' +exclude_expsyms='`$ECHO "X$exclude_expsyms" | $Xsed -e "$delay_single_quote_subst"`' +include_expsyms='`$ECHO "X$include_expsyms" | $Xsed -e "$delay_single_quote_subst"`' +prelink_cmds='`$ECHO "X$prelink_cmds" | $Xsed -e "$delay_single_quote_subst"`' +file_list_spec='`$ECHO "X$file_list_spec" | $Xsed -e "$delay_single_quote_subst"`' +variables_saved_for_relink='`$ECHO "X$variables_saved_for_relink" | $Xsed -e "$delay_single_quote_subst"`' +need_lib_prefix='`$ECHO "X$need_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' +need_version='`$ECHO "X$need_version" | $Xsed -e "$delay_single_quote_subst"`' +version_type='`$ECHO "X$version_type" | $Xsed -e "$delay_single_quote_subst"`' +runpath_var='`$ECHO "X$runpath_var" | $Xsed -e "$delay_single_quote_subst"`' +shlibpath_var='`$ECHO "X$shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' +shlibpath_overrides_runpath='`$ECHO "X$shlibpath_overrides_runpath" | $Xsed -e "$delay_single_quote_subst"`' +libname_spec='`$ECHO "X$libname_spec" | $Xsed -e "$delay_single_quote_subst"`' +library_names_spec='`$ECHO "X$library_names_spec" | $Xsed -e "$delay_single_quote_subst"`' +soname_spec='`$ECHO "X$soname_spec" | $Xsed -e "$delay_single_quote_subst"`' +postinstall_cmds='`$ECHO "X$postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +postuninstall_cmds='`$ECHO "X$postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +finish_cmds='`$ECHO "X$finish_cmds" | $Xsed -e "$delay_single_quote_subst"`' +finish_eval='`$ECHO "X$finish_eval" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_into_libs='`$ECHO "X$hardcode_into_libs" | $Xsed -e "$delay_single_quote_subst"`' +sys_lib_search_path_spec='`$ECHO "X$sys_lib_search_path_spec" | $Xsed -e "$delay_single_quote_subst"`' +sys_lib_dlsearch_path_spec='`$ECHO "X$sys_lib_dlsearch_path_spec" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_action='`$ECHO "X$hardcode_action" | $Xsed -e "$delay_single_quote_subst"`' +enable_dlopen='`$ECHO "X$enable_dlopen" | $Xsed -e "$delay_single_quote_subst"`' +enable_dlopen_self='`$ECHO "X$enable_dlopen_self" | $Xsed -e "$delay_single_quote_subst"`' +enable_dlopen_self_static='`$ECHO "X$enable_dlopen_self_static" | $Xsed -e "$delay_single_quote_subst"`' +old_striplib='`$ECHO "X$old_striplib" | $Xsed -e "$delay_single_quote_subst"`' +striplib='`$ECHO "X$striplib" | $Xsed -e "$delay_single_quote_subst"`' +compiler_lib_search_dirs='`$ECHO "X$compiler_lib_search_dirs" | $Xsed -e "$delay_single_quote_subst"`' +predep_objects='`$ECHO "X$predep_objects" | $Xsed -e "$delay_single_quote_subst"`' +postdep_objects='`$ECHO "X$postdep_objects" | $Xsed -e "$delay_single_quote_subst"`' +predeps='`$ECHO "X$predeps" | $Xsed -e "$delay_single_quote_subst"`' +postdeps='`$ECHO "X$postdeps" | $Xsed -e "$delay_single_quote_subst"`' +compiler_lib_search_path='`$ECHO "X$compiler_lib_search_path" | $Xsed -e "$delay_single_quote_subst"`' +LD_CXX='`$ECHO "X$LD_CXX" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_cmds_CXX='`$ECHO "X$old_archive_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' +compiler_CXX='`$ECHO "X$compiler_CXX" | $Xsed -e "$delay_single_quote_subst"`' +GCC_CXX='`$ECHO "X$GCC_CXX" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "X$lt_prog_compiler_no_builtin_flag_CXX" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_wl_CXX='`$ECHO "X$lt_prog_compiler_wl_CXX" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_pic_CXX='`$ECHO "X$lt_prog_compiler_pic_CXX" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_static_CXX='`$ECHO "X$lt_prog_compiler_static_CXX" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o_CXX='`$ECHO "X$lt_cv_prog_compiler_c_o_CXX" | $Xsed -e "$delay_single_quote_subst"`' +archive_cmds_need_lc_CXX='`$ECHO "X$archive_cmds_need_lc_CXX" | $Xsed -e "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes_CXX='`$ECHO "X$enable_shared_with_static_runtimes_CXX" | $Xsed -e "$delay_single_quote_subst"`' +export_dynamic_flag_spec_CXX='`$ECHO "X$export_dynamic_flag_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`' +whole_archive_flag_spec_CXX='`$ECHO "X$whole_archive_flag_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`' +compiler_needs_object_CXX='`$ECHO "X$compiler_needs_object_CXX" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_from_new_cmds_CXX='`$ECHO "X$old_archive_from_new_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds_CXX='`$ECHO "X$old_archive_from_expsyms_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' +archive_cmds_CXX='`$ECHO "X$archive_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' +archive_expsym_cmds_CXX='`$ECHO "X$archive_expsym_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' +module_cmds_CXX='`$ECHO "X$module_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' +module_expsym_cmds_CXX='`$ECHO "X$module_expsym_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' +with_gnu_ld_CXX='`$ECHO "X$with_gnu_ld_CXX" | $Xsed -e "$delay_single_quote_subst"`' +allow_undefined_flag_CXX='`$ECHO "X$allow_undefined_flag_CXX" | $Xsed -e "$delay_single_quote_subst"`' +no_undefined_flag_CXX='`$ECHO "X$no_undefined_flag_CXX" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_CXX='`$ECHO "X$hardcode_libdir_flag_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_ld_CXX='`$ECHO "X$hardcode_libdir_flag_spec_ld_CXX" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_separator_CXX='`$ECHO "X$hardcode_libdir_separator_CXX" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_direct_CXX='`$ECHO "X$hardcode_direct_CXX" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_direct_absolute_CXX='`$ECHO "X$hardcode_direct_absolute_CXX" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_minus_L_CXX='`$ECHO "X$hardcode_minus_L_CXX" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_shlibpath_var_CXX='`$ECHO "X$hardcode_shlibpath_var_CXX" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_automatic_CXX='`$ECHO "X$hardcode_automatic_CXX" | $Xsed -e "$delay_single_quote_subst"`' +inherit_rpath_CXX='`$ECHO "X$inherit_rpath_CXX" | $Xsed -e "$delay_single_quote_subst"`' +link_all_deplibs_CXX='`$ECHO "X$link_all_deplibs_CXX" | $Xsed -e "$delay_single_quote_subst"`' +fix_srcfile_path_CXX='`$ECHO "X$fix_srcfile_path_CXX" | $Xsed -e "$delay_single_quote_subst"`' +always_export_symbols_CXX='`$ECHO "X$always_export_symbols_CXX" | $Xsed -e "$delay_single_quote_subst"`' +export_symbols_cmds_CXX='`$ECHO "X$export_symbols_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' +exclude_expsyms_CXX='`$ECHO "X$exclude_expsyms_CXX" | $Xsed -e "$delay_single_quote_subst"`' +include_expsyms_CXX='`$ECHO "X$include_expsyms_CXX" | $Xsed -e "$delay_single_quote_subst"`' +prelink_cmds_CXX='`$ECHO "X$prelink_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' +file_list_spec_CXX='`$ECHO "X$file_list_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_action_CXX='`$ECHO "X$hardcode_action_CXX" | $Xsed -e "$delay_single_quote_subst"`' +compiler_lib_search_dirs_CXX='`$ECHO "X$compiler_lib_search_dirs_CXX" | $Xsed -e "$delay_single_quote_subst"`' +predep_objects_CXX='`$ECHO "X$predep_objects_CXX" | $Xsed -e "$delay_single_quote_subst"`' +postdep_objects_CXX='`$ECHO "X$postdep_objects_CXX" | $Xsed -e "$delay_single_quote_subst"`' +predeps_CXX='`$ECHO "X$predeps_CXX" | $Xsed -e "$delay_single_quote_subst"`' +postdeps_CXX='`$ECHO "X$postdeps_CXX" | $Xsed -e "$delay_single_quote_subst"`' +compiler_lib_search_path_CXX='`$ECHO "X$compiler_lib_search_path_CXX" | $Xsed -e "$delay_single_quote_subst"`' + +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# Quote evaled strings. +for var in SED \ +GREP \ +EGREP \ +FGREP \ +LD \ +NM \ +LN_S \ +lt_SP2NL \ +lt_NL2SP \ +reload_flag \ +deplibs_check_method \ +file_magic_cmd \ +AR \ +AR_FLAGS \ +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 \ +SHELL \ +ECHO \ +lt_prog_compiler_no_builtin_flag \ +lt_prog_compiler_wl \ +lt_prog_compiler_pic \ +lt_prog_compiler_static \ +lt_cv_prog_compiler_c_o \ +need_locks \ +DSYMUTIL \ +NMEDIT \ +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_flag_spec_ld \ +hardcode_libdir_separator \ +fix_srcfile_path \ +exclude_expsyms \ +include_expsyms \ +file_list_spec \ +variables_saved_for_relink \ +libname_spec \ +library_names_spec \ +soname_spec \ +finish_eval \ +old_striplib \ +striplib \ +compiler_lib_search_dirs \ +predep_objects \ +postdep_objects \ +predeps \ +postdeps \ +compiler_lib_search_path \ +LD_CXX \ +compiler_CXX \ +lt_prog_compiler_no_builtin_flag_CXX \ +lt_prog_compiler_wl_CXX \ +lt_prog_compiler_pic_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_flag_spec_ld_CXX \ +hardcode_libdir_separator_CXX \ +fix_srcfile_path_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 "X\\\\\$\$var"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$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 \ +postinstall_cmds \ +postuninstall_cmds \ +finish_cmds \ +sys_lib_search_path_spec \ +sys_lib_dlsearch_path_spec \ +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; do + case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Fix-up fallback echo if it was mangled by the above quoting rules. +case \$lt_ECHO in +*'\\\$0 --fallback-echo"') lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\$0 --fallback-echo"\$/\$0 --fallback-echo"/'\` + ;; +esac + +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/backdoor/shared/Makefile") CONFIG_FILES="$CONFIG_FILES lib/backdoor/shared/Makefile" ;; + "lib/conf/Makefile") CONFIG_FILES="$CONFIG_FILES lib/conf/Makefile" ;; + "lib/dict/Makefile") CONFIG_FILES="$CONFIG_FILES lib/dict/Makefile" ;; + "lib/dnd/Makefile") CONFIG_FILES="$CONFIG_FILES lib/dnd/Makefile" ;; + "lib/dynxdr/Makefile") CONFIG_FILES="$CONFIG_FILES lib/dynxdr/Makefile" ;; + "lib/err/Makefile") CONFIG_FILES="$CONFIG_FILES lib/err/Makefile" ;; + "lib/eventManager/Makefile") CONFIG_FILES="$CONFIG_FILES lib/eventManager/Makefile" ;; + "lib/file/Makefile") CONFIG_FILES="$CONFIG_FILES lib/file/Makefile" ;; + "lib/foundryMsg/Makefile") CONFIG_FILES="$CONFIG_FILES lib/foundryMsg/Makefile" ;; + "lib/ghIntegration/Makefile") CONFIG_FILES="$CONFIG_FILES lib/ghIntegration/Makefile" ;; + "lib/ghIntegrationStub/Makefile") CONFIG_FILES="$CONFIG_FILES lib/ghIntegrationStub/Makefile" ;; + "lib/guestApp/Makefile") CONFIG_FILES="$CONFIG_FILES lib/guestApp/Makefile" ;; + "lib/guestInfo/Makefile") CONFIG_FILES="$CONFIG_FILES lib/guestInfo/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/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/deployPkg/Makefile") CONFIG_FILES="$CONFIG_FILES lib/deployPkg/Makefile" ;; + "lib/image/Makefile") CONFIG_FILES="$CONFIG_FILES lib/image/Makefile" ;; + "lib/impersonate/Makefile") CONFIG_FILES="$CONFIG_FILES lib/impersonate/Makefile" ;; + "lib/message/Makefile") CONFIG_FILES="$CONFIG_FILES lib/message/Makefile" ;; + "lib/message/shared/Makefile") CONFIG_FILES="$CONFIG_FILES lib/message/shared/Makefile" ;; + "lib/misc/Makefile") CONFIG_FILES="$CONFIG_FILES lib/misc/Makefile" ;; + "lib/misc/shared/Makefile") CONFIG_FILES="$CONFIG_FILES lib/misc/shared/Makefile" ;; + "lib/netUtil/Makefile") CONFIG_FILES="$CONFIG_FILES lib/netUtil/Makefile" ;; + "lib/panic/Makefile") CONFIG_FILES="$CONFIG_FILES lib/panic/Makefile" ;; + "lib/panicDefault/Makefile") CONFIG_FILES="$CONFIG_FILES lib/panicDefault/Makefile" ;; + "lib/printer/Makefile") CONFIG_FILES="$CONFIG_FILES lib/printer/Makefile" ;; + "lib/procMgr/Makefile") CONFIG_FILES="$CONFIG_FILES lib/procMgr/Makefile" ;; + "lib/raster/Makefile") CONFIG_FILES="$CONFIG_FILES lib/raster/Makefile" ;; + "lib/region/Makefile") CONFIG_FILES="$CONFIG_FILES lib/region/Makefile" ;; + "lib/resolution/Makefile") CONFIG_FILES="$CONFIG_FILES lib/resolution/Makefile" ;; + "lib/rpcIn/Makefile") CONFIG_FILES="$CONFIG_FILES lib/rpcIn/Makefile" ;; + "lib/rpcOut/Makefile") CONFIG_FILES="$CONFIG_FILES lib/rpcOut/Makefile" ;; + "lib/rpcOut/shared/Makefile") CONFIG_FILES="$CONFIG_FILES lib/rpcOut/shared/Makefile" ;; + "lib/rpcVmx/Makefile") CONFIG_FILES="$CONFIG_FILES lib/rpcVmx/Makefile" ;; + "lib/SLPv2Parser/Makefile") CONFIG_FILES="$CONFIG_FILES lib/SLPv2Parser/Makefile" ;; + "lib/socketMgr/Makefile") CONFIG_FILES="$CONFIG_FILES lib/socketMgr/Makefile" ;; + "lib/string/Makefile") CONFIG_FILES="$CONFIG_FILES lib/string/Makefile" ;; + "lib/string/shared/Makefile") CONFIG_FILES="$CONFIG_FILES lib/string/shared/Makefile" ;; + "lib/stubs/Makefile") CONFIG_FILES="$CONFIG_FILES lib/stubs/Makefile" ;; + "lib/stubs/shared/Makefile") CONFIG_FILES="$CONFIG_FILES lib/stubs/shared/Makefile" ;; + "lib/sync/Makefile") CONFIG_FILES="$CONFIG_FILES lib/sync/Makefile" ;; + "lib/sync/shared/Makefile") CONFIG_FILES="$CONFIG_FILES lib/sync/shared/Makefile" ;; + "lib/syncDriver/Makefile") CONFIG_FILES="$CONFIG_FILES lib/syncDriver/Makefile" ;; + "lib/system/Makefile") CONFIG_FILES="$CONFIG_FILES lib/system/Makefile" ;; + "lib/toolsLogger/Makefile") CONFIG_FILES="$CONFIG_FILES lib/toolsLogger/Makefile" ;; + "lib/unicode/Makefile") CONFIG_FILES="$CONFIG_FILES lib/unicode/Makefile" ;; + "lib/unity/Makefile") CONFIG_FILES="$CONFIG_FILES lib/unity/Makefile" ;; + "lib/unityStub/Makefile") CONFIG_FILES="$CONFIG_FILES lib/unityStub/Makefile" ;; + "lib/unityWindowTracker/Makefile") CONFIG_FILES="$CONFIG_FILES lib/unityWindowTracker/Makefile" ;; + "lib/user/Makefile") CONFIG_FILES="$CONFIG_FILES lib/user/Makefile" ;; + "lib/vixTools/Makefile") CONFIG_FILES="$CONFIG_FILES lib/vixTools/Makefile" ;; + "lib/vmBackupLib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/vmBackupLib/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" ;; + "guestd/Makefile") CONFIG_FILES="$CONFIG_FILES guestd/Makefile" ;; + "vmware-user/Makefile") CONFIG_FILES="$CONFIG_FILES vmware-user/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" ;; + "libguestlib/Makefile") CONFIG_FILES="$CONFIG_FILES libguestlib/Makefile" ;; + "xferlogs/Makefile") CONFIG_FILES="$CONFIG_FILES xferlogs/Makefile" ;; + "modules/Makefile") CONFIG_FILES="$CONFIG_FILES modules/Makefile" ;; + "scripts/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/Makefile" ;; + + *) { { 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 +AR!$AR$ac_delim +RANLIB!$RANLIB$ac_delim +lt_ECHO!$lt_ECHO$ac_delim +DSYMUTIL!$DSYMUTIL$ac_delim +NMEDIT!$NMEDIT$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 +LIBPNG_CONFIG!$LIBPNG_CONFIG$ac_delim +DNET_CONFIG!$DNET_CONFIG$ac_delim +ICU_CONFIG!$ICU_CONFIG$ac_delim +HAVE_CXX!$HAVE_CXX$ac_delim +RPCGEN!$RPCGEN$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 +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 +PAMD_TRUE!$PAMD_TRUE$ac_delim +PAMD_FALSE!$PAMD_FALSE$ac_delim +ENABLE_UNITY_TRUE!$ENABLE_UNITY_TRUE$ac_delim +ENABLE_UNITY_FALSE!$ENABLE_UNITY_FALSE$ac_delim +WITH_ROOT_PRIVILEGES_TRUE!$WITH_ROOT_PRIVILEGES_TRUE$ac_delim +WITH_ROOT_PRIVILEGES_FALSE!$WITH_ROOT_PRIVILEGES_FALSE$ac_delim +TARGET_OS!$TARGET_OS$ac_delim +KERNEL_RELEASE!$KERNEL_RELEASE$ac_delim +MODULES_OS!$MODULES_OS$ac_delim +MODULES_DIR!$MODULES_DIR$ac_delim +MODULES!$MODULES$ac_delim +COMMON_XLIBS!$COMMON_XLIBS$ac_delim +GTK_CPPFLAGS!$GTK_CPPFLAGS$ac_delim +GTK_LIBS!$GTK_LIBS$ac_delim +DNET_CPPFLAGS!$DNET_CPPFLAGS$ac_delim +DNET_LIBS!$DNET_LIBS$ac_delim +PROCPS_LIBS!$PROCPS_LIBS$ac_delim +ICU_CPPFLAGS!$ICU_CPPFLAGS$ac_delim +ICU_LIBS!$ICU_LIBS$ac_delim +PAM_PREFIX!$PAM_PREFIX$ac_delim +URIPARSER_CPPFLAGS!$URIPARSER_CPPFLAGS$ac_delim +URIPARSER_LIBS!$URIPARSER_LIBS$ac_delim +LIBPNG_CPPFLAGS!$LIBPNG_CPPFLAGS$ac_delim +LIBPNG_LIBS!$LIBPNG_LIBS$ac_delim +ZLIB_CPPFLAGS!$ZLIB_CPPFLAGS$ac_delim +ZLIB_LIBS!$ZLIB_LIBS$ac_delim +LIB_AUTH_CPPFLAGS!$LIB_AUTH_CPPFLAGS$ac_delim +LIB_FILE_CPPFLAGS!$LIB_FILE_CPPFLAGS$ac_delim +LIB_HGFS_SERVER_CPPFLAGS!$LIB_HGFS_SERVER_CPPFLAGS$ac_delim +LIB_IMPERSONATE_CPPFLAGS!$LIB_IMPERSONATE_CPPFLAGS$ac_delim +LIB_MISC_CPPFLAGS!$LIB_MISC_CPPFLAGS$ac_delim +LIB_PROC_MGR_CPPFLAGS!$LIB_PROC_MGR_CPPFLAGS$ac_delim +LIB_STRING_CPPFLAGS!$LIB_STRING_CPPFLAGS$ac_delim +LIB_USER_CPPFLAGS!$LIB_USER_CPPFLAGS$ac_delim +GUESTD_LDADD!$GUESTD_LDADD$ac_delim +VMWARE_USER_CPPFLAGS!$VMWARE_USER_CPPFLAGS$ac_delim +VMWARE_USER_LDADD!$VMWARE_USER_LDADD$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` = 75; 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 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" >$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 (GNU $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 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 + +# 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 + +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds + +# 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 + +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS + +# 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 + +# 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 + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL + +# An echo program that does not interpret backslashes. +ECHO=$lt_ECHO + +# 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 + +# 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 + +# 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 + +# 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 + +# 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 + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic + +# 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 + +# If ld is used when linking, flag to hardcode \$libdir into a binary +# during linking. This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld + +# Whether we need a single "-rpath" flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator + +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary. +hardcode_direct=$hardcode_direct + +# Set to "yes" if using 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 + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path=$lt_fix_srcfile_path + +# Set to "yes" if exported symbols are required. +always_export_symbols=$always_export_symbols + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds + +# 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 + +# 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 '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + case $xsi_shell in + yes) + cat << \_LT_EOF >> "$cfgfile" +# 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 () +{ + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac +} + +# func_basename file +func_basename () +{ + func_basename_result="${1##*/}" +} + +# 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 () +{ + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac + func_basename_result="${1##*/}" +} + +# 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_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}"} +} + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=${1%%=*} + func_opt_split_arg=${1#*=} +} + +# func_lo2o object +func_lo2o () +{ + case ${1} in + *.lo) func_lo2o_result=${1%.lo}.${objext} ;; + *) func_lo2o_result=${1} ;; + esac +} +_LT_EOF + ;; + *) # Bourne compatible functions. + cat << \_LT_EOF >> "$cfgfile" +# 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 () +{ + # Extract subdirectory from the argument. + func_dirname_result=`$ECHO "X${1}" | $Xsed -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 file +func_basename () +{ + func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` +} + +# 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 "X${1}" | $Xsed -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 "X${1}" | $Xsed -e "$basename"` +} + +# 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 "X${3}" \ + | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "X${3}" \ + | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; + esac +} + +# sed scripts: +my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q' +my_sed_long_arg='1s/^-[^=]*=//' + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` + func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` +} + +# func_lo2o object +func_lo2o () +{ + func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` +} +_LT_EOF +esac + +case $lt_shell_append in + yes) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$1+=\$2" +} +_LT_EOF + ;; + *) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$1=\$$1\$2" +} +_LT_EOF + ;; + esac + + + sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + 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 + +# 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 + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_CXX + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_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 + +# If ld is used when linking, flag to hardcode \$libdir into a binary +# during linking. This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX + +# Whether we need a single "-rpath" flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX + +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary. +hardcode_direct=$hardcode_direct_CXX + +# Set to "yes" if using 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 + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path=$lt_fix_srcfile_path_CXX + +# Set to "yes" if exported symbols are required. +always_export_symbols=$always_export_symbols_CXX + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_CXX + +# 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 + +# 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 + diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/autom4te.cache/requests /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/autom4te.cache/requests --- open-vm-tools-2008.01.23-74039/autom4te.cache/requests 2008-01-28 08:03:02.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/autom4te.cache/requests 2008-10-13 08:02:11.000000000 +0100 @@ -21,6 +21,7 @@ '/build/toolchain/lin32/automake-1.10/share/aclocal-1.10/install-sh.m4', '/build/toolchain/lin32/automake-1.10/share/aclocal-1.10/lead-dot.m4', '/build/toolchain/lin32/automake-1.10/share/aclocal-1.10/make.m4', + '/build/toolchain/lin32/automake-1.10/share/aclocal-1.10/minuso.m4', '/build/toolchain/lin32/automake-1.10/share/aclocal-1.10/missing.m4', '/build/toolchain/lin32/automake-1.10/share/aclocal-1.10/mkdirp.m4', '/build/toolchain/lin32/automake-1.10/share/aclocal-1.10/options.m4', @@ -66,8 +67,8 @@ 'AC_LIBTOOL_CXX' => 1, 'LT_AC_PROG_RC' => 1, '_AM_PROG_TAR' => 1, - 'AC_LIBTOOL_GCJ' => 1, 'LT_AC_PROG_GCJ' => 1, + 'AC_LIBTOOL_GCJ' => 1, 'AM_DISABLE_STATIC' => 1, '_LT_AC_PROG_CXXCPP' => 1, 'AM_DEP_TRACK' => 1, @@ -135,6 +136,7 @@ 'AC_ENABLE_STATIC' => 1, 'AC_LIBTOOL_SYS_LIB_STRIP' => 1, '_LT_AC_TAGVAR' => 1, + 'AM_PROG_CC_C_O' => 1, 'AC_LIBTOOL_LANG_F77_CONFIG' => 1, '_AM_MANGLE_OPTION' => 1, 'AM_CONDITIONAL' => 1, @@ -205,6 +207,180 @@ 'm4_include' => 1, 'AC_SUBST_TRACE' => 1 } + ], 'Autom4te::Request' ), + bless( [ + '2', + 1, + [ + '/build/toolchain/lin32/autoconf-2.61/share/autoconf' + ], + [ + '/build/toolchain/lin32/autoconf-2.61/share/autoconf/autoconf/autoconf.m4f', + '/build/toolchain/lin32/automake-1.10/share/aclocal-1.10/amversion.m4', + '/build/toolchain/lin32/automake-1.10/share/aclocal-1.10/auxdir.m4', + '/build/toolchain/lin32/automake-1.10/share/aclocal-1.10/cond.m4', + '/build/toolchain/lin32/automake-1.10/share/aclocal-1.10/depend.m4', + '/build/toolchain/lin32/automake-1.10/share/aclocal-1.10/depout.m4', + '/build/toolchain/lin32/automake-1.10/share/aclocal-1.10/init.m4', + '/build/toolchain/lin32/automake-1.10/share/aclocal-1.10/install-sh.m4', + '/build/toolchain/lin32/automake-1.10/share/aclocal-1.10/lead-dot.m4', + '/build/toolchain/lin32/automake-1.10/share/aclocal-1.10/make.m4', + '/build/toolchain/lin32/automake-1.10/share/aclocal-1.10/minuso.m4', + '/build/toolchain/lin32/automake-1.10/share/aclocal-1.10/missing.m4', + '/build/toolchain/lin32/automake-1.10/share/aclocal-1.10/mkdirp.m4', + '/build/toolchain/lin32/automake-1.10/share/aclocal-1.10/options.m4', + '/build/toolchain/lin32/automake-1.10/share/aclocal-1.10/runlog.m4', + '/build/toolchain/lin32/automake-1.10/share/aclocal-1.10/sanity.m4', + '/build/toolchain/lin32/automake-1.10/share/aclocal-1.10/strip.m4', + '/build/toolchain/lin32/automake-1.10/share/aclocal-1.10/substnot.m4', + '/build/toolchain/lin32/automake-1.10/share/aclocal-1.10/tar.m4', + 'm4/libtool.m4', + 'm4/ltoptions.m4', + 'm4/ltsugar.m4', + 'm4/ltversion.m4', + 'm4/lt~obsolete.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_LIBTOOL_OBJDIR' => 1, + 'LTOBSOLETE_VERSION' => 1, + 'AM_SANITY_CHECK' => 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, + 'AC_LIBTOOL_CONFIG' => 1, + '_LT_AC_LANG_F77' => 1, + '_AM_SUBST_NOTMAKE' => 1, + '_AM_AUTOCONF_VERSION' => 1, + 'AM_DISABLE_SHARED' => 1, + '_LT_AC_LANG_CXX' => 1, + 'AM_PROG_LIBTOOL' => 1, + '_LT_AC_FILE_LTDLL_C' => 1, + 'AM_PROG_LD' => 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, + '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_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, + '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, + 'LTVERSION_VERSION' => 1, + 'm4_include' => 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_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, + '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_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, + '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_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' ) ); diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/autom4te.cache/traces.0 /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/autom4te.cache/traces.0 --- open-vm-tools-2008.01.23-74039/autom4te.cache/traces.0 2008-01-28 08:02:58.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/autom4te.cache/traces.0 2008-10-13 08:02:01.000000000 +0100 @@ -6286,6 +6286,26 @@ AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) +m4trace:/build/toolchain/lin32/automake-1.10/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:/build/toolchain/lin32/automake-1.10/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)]) @@ -6444,126 +6464,126 @@ AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) -m4trace:configure.ac:25: -1- m4_pattern_forbid([^_?A[CHUM]_]) -m4trace:configure.ac:25: -1- m4_pattern_forbid([_AC_]) -m4trace:configure.ac:25: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS']) -m4trace:configure.ac:25: -1- m4_pattern_allow([^AS_FLAGS$]) -m4trace:configure.ac:25: -1- m4_pattern_forbid([^_?m4_]) -m4trace:configure.ac:25: -1- m4_pattern_forbid([^dnl$]) -m4trace:configure.ac:25: -1- m4_pattern_forbid([^_?AS_]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^SHELL$]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^PATH_SEPARATOR$]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^PACKAGE_NAME$]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^PACKAGE_VERSION$]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^PACKAGE_STRING$]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^exec_prefix$]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^prefix$]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^program_transform_name$]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^bindir$]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^sbindir$]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^libexecdir$]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^datarootdir$]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^datadir$]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^sysconfdir$]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^sharedstatedir$]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^localstatedir$]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^includedir$]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^oldincludedir$]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^docdir$]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^infodir$]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^htmldir$]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^dvidir$]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^pdfdir$]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^psdir$]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^libdir$]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^localedir$]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^mandir$]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^PACKAGE_NAME$]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^PACKAGE_VERSION$]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^PACKAGE_STRING$]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^DEFS$]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^ECHO_C$]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^ECHO_N$]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^ECHO_T$]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^LIBS$]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^build_alias$]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^host_alias$]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^target_alias$]) -m4trace:configure.ac:51: -1- m4_pattern_allow([^build$]) -m4trace:configure.ac:51: -1- m4_pattern_allow([^build_cpu$]) -m4trace:configure.ac:51: -1- m4_pattern_allow([^build_vendor$]) -m4trace:configure.ac:51: -1- m4_pattern_allow([^build_os$]) -m4trace:configure.ac:51: -1- m4_pattern_allow([^host$]) -m4trace:configure.ac:51: -1- m4_pattern_allow([^host_cpu$]) -m4trace:configure.ac:51: -1- m4_pattern_allow([^host_vendor$]) -m4trace:configure.ac:51: -1- m4_pattern_allow([^host_os$]) -m4trace:configure.ac:52: -1- m4_pattern_allow([^build$]) -m4trace:configure.ac:52: -1- m4_pattern_allow([^build_cpu$]) -m4trace:configure.ac:52: -1- m4_pattern_allow([^build_vendor$]) -m4trace:configure.ac:52: -1- m4_pattern_allow([^build_os$]) -m4trace:configure.ac:99: -1- AM_INIT_AUTOMAKE -m4trace:configure.ac:99: -1- m4_pattern_allow([^AM_[A-Z]+FLAGS$]) -m4trace:configure.ac:99: -1- AM_SET_CURRENT_AUTOMAKE_VERSION -m4trace:configure.ac:99: -1- AM_AUTOMAKE_VERSION([1.10]) -m4trace:configure.ac:99: -1- _AM_AUTOCONF_VERSION([2.61]) -m4trace:configure.ac:99: -1- m4_pattern_allow([^INSTALL_PROGRAM$]) -m4trace:configure.ac:99: -1- m4_pattern_allow([^INSTALL_SCRIPT$]) -m4trace:configure.ac:99: -1- m4_pattern_allow([^INSTALL_DATA$]) -m4trace:configure.ac:99: -1- m4_pattern_allow([^am__isrc$]) -m4trace:configure.ac:99: -1- _AM_SUBST_NOTMAKE([am__isrc]) -m4trace:configure.ac:99: -1- m4_pattern_allow([^CYGPATH_W$]) -m4trace:configure.ac:99: -1- _AM_SET_OPTIONS([]) -m4trace:configure.ac:99: -1- _m4_warn([obsolete], [The macro `AC_FOREACH' is obsolete. +m4trace:configure.ac:38: -1- m4_pattern_forbid([^_?A[CHUM]_]) +m4trace:configure.ac:38: -1- m4_pattern_forbid([_AC_]) +m4trace:configure.ac:38: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS']) +m4trace:configure.ac:38: -1- m4_pattern_allow([^AS_FLAGS$]) +m4trace:configure.ac:38: -1- m4_pattern_forbid([^_?m4_]) +m4trace:configure.ac:38: -1- m4_pattern_forbid([^dnl$]) +m4trace:configure.ac:38: -1- m4_pattern_forbid([^_?AS_]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^SHELL$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^PATH_SEPARATOR$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^PACKAGE_NAME$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^PACKAGE_VERSION$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^PACKAGE_STRING$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^exec_prefix$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^prefix$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^program_transform_name$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^bindir$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^sbindir$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^libexecdir$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^datarootdir$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^datadir$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^sysconfdir$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^sharedstatedir$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^localstatedir$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^includedir$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^oldincludedir$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^docdir$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^infodir$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^htmldir$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^dvidir$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^pdfdir$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^psdir$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^libdir$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^localedir$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^mandir$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^PACKAGE_NAME$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^PACKAGE_VERSION$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^PACKAGE_STRING$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^DEFS$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^ECHO_C$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^ECHO_N$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^ECHO_T$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^LIBS$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^build_alias$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^host_alias$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^target_alias$]) +m4trace:configure.ac:69: -1- m4_pattern_allow([^build$]) +m4trace:configure.ac:69: -1- m4_pattern_allow([^build_cpu$]) +m4trace:configure.ac:69: -1- m4_pattern_allow([^build_vendor$]) +m4trace:configure.ac:69: -1- m4_pattern_allow([^build_os$]) +m4trace:configure.ac:69: -1- m4_pattern_allow([^host$]) +m4trace:configure.ac:69: -1- m4_pattern_allow([^host_cpu$]) +m4trace:configure.ac:69: -1- m4_pattern_allow([^host_vendor$]) +m4trace:configure.ac:69: -1- m4_pattern_allow([^host_os$]) +m4trace:configure.ac:70: -1- m4_pattern_allow([^build$]) +m4trace:configure.ac:70: -1- m4_pattern_allow([^build_cpu$]) +m4trace:configure.ac:70: -1- m4_pattern_allow([^build_vendor$]) +m4trace:configure.ac:70: -1- m4_pattern_allow([^build_os$]) +m4trace:configure.ac:176: -1- AM_INIT_AUTOMAKE +m4trace:configure.ac:176: -1- m4_pattern_allow([^AM_[A-Z]+FLAGS$]) +m4trace:configure.ac:176: -1- AM_SET_CURRENT_AUTOMAKE_VERSION +m4trace:configure.ac:176: -1- AM_AUTOMAKE_VERSION([1.10]) +m4trace:configure.ac:176: -1- _AM_AUTOCONF_VERSION([2.61]) +m4trace:configure.ac:176: -1- m4_pattern_allow([^INSTALL_PROGRAM$]) +m4trace:configure.ac:176: -1- m4_pattern_allow([^INSTALL_SCRIPT$]) +m4trace:configure.ac:176: -1- m4_pattern_allow([^INSTALL_DATA$]) +m4trace:configure.ac:176: -1- m4_pattern_allow([^am__isrc$]) +m4trace:configure.ac:176: -1- _AM_SUBST_NOTMAKE([am__isrc]) +m4trace:configure.ac:176: -1- m4_pattern_allow([^CYGPATH_W$]) +m4trace:configure.ac:176: -1- _AM_SET_OPTIONS([]) +m4trace:configure.ac:176: -1- _m4_warn([obsolete], [The macro `AC_FOREACH' is obsolete. You should run autoupdate.], [../../lib/autoconf/general.m4:196: AC_FOREACH is expanded from... /build/toolchain/lin32/automake-1.10/share/aclocal-1.10/options.m4:25: _AM_SET_OPTIONS is expanded from... /build/toolchain/lin32/automake-1.10/share/aclocal-1.10/init.m4:26: AM_INIT_AUTOMAKE is expanded from... -configure.ac:99: the top level]) -m4trace:configure.ac:99: -1- m4_pattern_allow([^PACKAGE$]) -m4trace:configure.ac:99: -1- m4_pattern_allow([^VERSION$]) -m4trace:configure.ac:99: -1- _AM_IF_OPTION([no-define], [], [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) +configure.ac:176: the top level]) +m4trace:configure.ac:176: -1- m4_pattern_allow([^PACKAGE$]) +m4trace:configure.ac:176: -1- m4_pattern_allow([^VERSION$]) +m4trace:configure.ac:176: -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:99: -2- _AM_MANGLE_OPTION([no-define]) -m4trace:configure.ac:99: -1- m4_pattern_allow([^PACKAGE$]) -m4trace:configure.ac:99: -1- m4_pattern_allow([^VERSION$]) -m4trace:configure.ac:99: -1- AM_SANITY_CHECK -m4trace:configure.ac:99: -1- AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) -m4trace:configure.ac:99: -1- AM_MISSING_HAS_RUN -m4trace:configure.ac:99: -1- AM_AUX_DIR_EXPAND -m4trace:configure.ac:99: -1- m4_pattern_allow([^ACLOCAL$]) -m4trace:configure.ac:99: -1- AM_MISSING_PROG([AUTOCONF], [autoconf]) -m4trace:configure.ac:99: -1- m4_pattern_allow([^AUTOCONF$]) -m4trace:configure.ac:99: -1- AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) -m4trace:configure.ac:99: -1- m4_pattern_allow([^AUTOMAKE$]) -m4trace:configure.ac:99: -1- AM_MISSING_PROG([AUTOHEADER], [autoheader]) -m4trace:configure.ac:99: -1- m4_pattern_allow([^AUTOHEADER$]) -m4trace:configure.ac:99: -1- AM_MISSING_PROG([MAKEINFO], [makeinfo]) -m4trace:configure.ac:99: -1- m4_pattern_allow([^MAKEINFO$]) -m4trace:configure.ac:99: -1- AM_PROG_INSTALL_SH -m4trace:configure.ac:99: -1- m4_pattern_allow([^install_sh$]) -m4trace:configure.ac:99: -1- AM_PROG_INSTALL_STRIP -m4trace:configure.ac:99: -1- m4_pattern_allow([^STRIP$]) -m4trace:configure.ac:99: -1- m4_pattern_allow([^INSTALL_STRIP_PROGRAM$]) -m4trace:configure.ac:99: -1- AM_PROG_MKDIR_P -m4trace:configure.ac:99: -1- m4_pattern_allow([^mkdir_p$]) -m4trace:configure.ac:99: -1- m4_pattern_allow([^AWK$]) -m4trace:configure.ac:99: -1- m4_pattern_allow([^SET_MAKE$]) -m4trace:configure.ac:99: -1- AM_SET_LEADING_DOT -m4trace:configure.ac:99: -1- m4_pattern_allow([^am__leading_dot$]) -m4trace:configure.ac:99: -1- _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], +m4trace:configure.ac:176: -2- _AM_MANGLE_OPTION([no-define]) +m4trace:configure.ac:176: -1- m4_pattern_allow([^PACKAGE$]) +m4trace:configure.ac:176: -1- m4_pattern_allow([^VERSION$]) +m4trace:configure.ac:176: -1- AM_SANITY_CHECK +m4trace:configure.ac:176: -1- AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) +m4trace:configure.ac:176: -1- AM_MISSING_HAS_RUN +m4trace:configure.ac:176: -1- AM_AUX_DIR_EXPAND +m4trace:configure.ac:176: -1- m4_pattern_allow([^ACLOCAL$]) +m4trace:configure.ac:176: -1- AM_MISSING_PROG([AUTOCONF], [autoconf]) +m4trace:configure.ac:176: -1- m4_pattern_allow([^AUTOCONF$]) +m4trace:configure.ac:176: -1- AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) +m4trace:configure.ac:176: -1- m4_pattern_allow([^AUTOMAKE$]) +m4trace:configure.ac:176: -1- AM_MISSING_PROG([AUTOHEADER], [autoheader]) +m4trace:configure.ac:176: -1- m4_pattern_allow([^AUTOHEADER$]) +m4trace:configure.ac:176: -1- AM_MISSING_PROG([MAKEINFO], [makeinfo]) +m4trace:configure.ac:176: -1- m4_pattern_allow([^MAKEINFO$]) +m4trace:configure.ac:176: -1- AM_PROG_INSTALL_SH +m4trace:configure.ac:176: -1- m4_pattern_allow([^install_sh$]) +m4trace:configure.ac:176: -1- AM_PROG_INSTALL_STRIP +m4trace:configure.ac:176: -1- m4_pattern_allow([^STRIP$]) +m4trace:configure.ac:176: -1- m4_pattern_allow([^INSTALL_STRIP_PROGRAM$]) +m4trace:configure.ac:176: -1- AM_PROG_MKDIR_P +m4trace:configure.ac:176: -1- m4_pattern_allow([^mkdir_p$]) +m4trace:configure.ac:176: -1- m4_pattern_allow([^AWK$]) +m4trace:configure.ac:176: -1- m4_pattern_allow([^SET_MAKE$]) +m4trace:configure.ac:176: -1- AM_SET_LEADING_DOT +m4trace:configure.ac:176: -1- m4_pattern_allow([^am__leading_dot$]) +m4trace:configure.ac:176: -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:99: -2- _AM_MANGLE_OPTION([tar-ustar]) -m4trace:configure.ac:99: -1- _AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])]) -m4trace:configure.ac:99: -2- _AM_MANGLE_OPTION([tar-pax]) -m4trace:configure.ac:99: -1- _AM_PROG_TAR([v7]) -m4trace:configure.ac:99: -1- AM_MISSING_PROG([AMTAR], [tar]) -m4trace:configure.ac:99: -1- m4_pattern_allow([^AMTAR$]) -m4trace:configure.ac:99: -1- m4_pattern_allow([^am__tar$]) -m4trace:configure.ac:99: -1- m4_pattern_allow([^am__untar$]) -m4trace:configure.ac:99: -1- _AM_IF_OPTION([no-dependencies], [], [AC_PROVIDE_IFELSE([AC_PROG_CC], +m4trace:configure.ac:176: -2- _AM_MANGLE_OPTION([tar-ustar]) +m4trace:configure.ac:176: -1- _AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])]) +m4trace:configure.ac:176: -2- _AM_MANGLE_OPTION([tar-pax]) +m4trace:configure.ac:176: -1- _AM_PROG_TAR([v7]) +m4trace:configure.ac:176: -1- AM_MISSING_PROG([AMTAR], [tar]) +m4trace:configure.ac:176: -1- m4_pattern_allow([^AMTAR$]) +m4trace:configure.ac:176: -1- m4_pattern_allow([^am__tar$]) +m4trace:configure.ac:176: -1- m4_pattern_allow([^am__untar$]) +m4trace:configure.ac:176: -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 @@ -6576,125 +6596,145 @@ [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) -m4trace:configure.ac:99: -2- _AM_MANGLE_OPTION([no-dependencies]) -m4trace:configure.ac:111: -1- m4_pattern_allow([^CC$]) -m4trace:configure.ac:111: -1- m4_pattern_allow([^CFLAGS$]) -m4trace:configure.ac:111: -1- m4_pattern_allow([^LDFLAGS$]) -m4trace:configure.ac:111: -1- m4_pattern_allow([^LIBS$]) -m4trace:configure.ac:111: -1- m4_pattern_allow([^CPPFLAGS$]) -m4trace:configure.ac:111: -1- m4_pattern_allow([^CC$]) -m4trace:configure.ac:111: -1- m4_pattern_allow([^CC$]) -m4trace:configure.ac:111: -1- m4_pattern_allow([^CC$]) -m4trace:configure.ac:111: -1- m4_pattern_allow([^CC$]) -m4trace:configure.ac:111: -1- m4_pattern_allow([^ac_ct_CC$]) -m4trace:configure.ac:111: -1- m4_pattern_allow([^EXEEXT$]) -m4trace:configure.ac:111: -1- m4_pattern_allow([^OBJEXT$]) -m4trace:configure.ac:111: -1- _AM_DEPENDENCIES([CC]) -m4trace:configure.ac:111: -1- AM_SET_DEPDIR -m4trace:configure.ac:111: -1- m4_pattern_allow([^DEPDIR$]) -m4trace:configure.ac:111: -1- AM_OUTPUT_DEPENDENCY_COMMANDS -m4trace:configure.ac:111: -1- AM_MAKE_INCLUDE -m4trace:configure.ac:111: -1- m4_pattern_allow([^am__include$]) -m4trace:configure.ac:111: -1- m4_pattern_allow([^am__quote$]) -m4trace:configure.ac:111: -1- AM_DEP_TRACK -m4trace:configure.ac:111: -1- AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) -m4trace:configure.ac:111: -1- m4_pattern_allow([^AMDEP_TRUE$]) -m4trace:configure.ac:111: -1- m4_pattern_allow([^AMDEP_FALSE$]) -m4trace:configure.ac:111: -1- _AM_SUBST_NOTMAKE([AMDEP_TRUE]) -m4trace:configure.ac:111: -1- _AM_SUBST_NOTMAKE([AMDEP_FALSE]) -m4trace:configure.ac:111: -1- m4_pattern_allow([^AMDEPBACKSLASH$]) -m4trace:configure.ac:111: -1- _AM_SUBST_NOTMAKE([AMDEPBACKSLASH]) -m4trace:configure.ac:111: -1- m4_pattern_allow([^CCDEPMODE$]) -m4trace:configure.ac:111: -1- AM_CONDITIONAL([am__fastdepCC], [ +m4trace:configure.ac:176: -2- _AM_MANGLE_OPTION([no-dependencies]) +m4trace:configure.ac:199: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:199: -1- m4_pattern_allow([^CFLAGS$]) +m4trace:configure.ac:199: -1- m4_pattern_allow([^LDFLAGS$]) +m4trace:configure.ac:199: -1- m4_pattern_allow([^LIBS$]) +m4trace:configure.ac:199: -1- m4_pattern_allow([^CPPFLAGS$]) +m4trace:configure.ac:199: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:199: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:199: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:199: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:199: -1- m4_pattern_allow([^ac_ct_CC$]) +m4trace:configure.ac:199: -1- m4_pattern_allow([^EXEEXT$]) +m4trace:configure.ac:199: -1- m4_pattern_allow([^OBJEXT$]) +m4trace:configure.ac:199: -1- _AM_DEPENDENCIES([CC]) +m4trace:configure.ac:199: -1- AM_SET_DEPDIR +m4trace:configure.ac:199: -1- m4_pattern_allow([^DEPDIR$]) +m4trace:configure.ac:199: -1- AM_OUTPUT_DEPENDENCY_COMMANDS +m4trace:configure.ac:199: -1- AM_MAKE_INCLUDE +m4trace:configure.ac:199: -1- m4_pattern_allow([^am__include$]) +m4trace:configure.ac:199: -1- m4_pattern_allow([^am__quote$]) +m4trace:configure.ac:199: -1- AM_DEP_TRACK +m4trace:configure.ac:199: -1- AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +m4trace:configure.ac:199: -1- m4_pattern_allow([^AMDEP_TRUE$]) +m4trace:configure.ac:199: -1- m4_pattern_allow([^AMDEP_FALSE$]) +m4trace:configure.ac:199: -1- _AM_SUBST_NOTMAKE([AMDEP_TRUE]) +m4trace:configure.ac:199: -1- _AM_SUBST_NOTMAKE([AMDEP_FALSE]) +m4trace:configure.ac:199: -1- m4_pattern_allow([^AMDEPBACKSLASH$]) +m4trace:configure.ac:199: -1- _AM_SUBST_NOTMAKE([AMDEPBACKSLASH]) +m4trace:configure.ac:199: -1- m4_pattern_allow([^CCDEPMODE$]) +m4trace:configure.ac:199: -1- AM_CONDITIONAL([am__fastdepCC], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3]) -m4trace:configure.ac:111: -1- m4_pattern_allow([^am__fastdepCC_TRUE$]) -m4trace:configure.ac:111: -1- m4_pattern_allow([^am__fastdepCC_FALSE$]) -m4trace:configure.ac:111: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_TRUE]) -m4trace:configure.ac:111: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_FALSE]) -m4trace:configure.ac:111: -1- m4_pattern_allow([^CPP$]) -m4trace:configure.ac:111: -1- m4_pattern_allow([^CPPFLAGS$]) -m4trace:configure.ac:111: -1- m4_pattern_allow([^CPP$]) -m4trace:configure.ac:112: -1- m4_pattern_allow([^CC$]) -m4trace:configure.ac:112: -1- m4_pattern_allow([^CFLAGS$]) -m4trace:configure.ac:112: -1- m4_pattern_allow([^LDFLAGS$]) -m4trace:configure.ac:112: -1- m4_pattern_allow([^LIBS$]) -m4trace:configure.ac:112: -1- m4_pattern_allow([^CPPFLAGS$]) -m4trace:configure.ac:112: -1- m4_pattern_allow([^CC$]) -m4trace:configure.ac:112: -1- m4_pattern_allow([^CC$]) -m4trace:configure.ac:112: -1- m4_pattern_allow([^CC$]) -m4trace:configure.ac:112: -1- m4_pattern_allow([^CC$]) -m4trace:configure.ac:112: -1- m4_pattern_allow([^ac_ct_CC$]) -m4trace:configure.ac:112: -1- _AM_DEPENDENCIES([CC]) -m4trace:configure.ac:112: -1- m4_pattern_allow([^CCDEPMODE$]) -m4trace:configure.ac:112: -1- AM_CONDITIONAL([am__fastdepCC], [ +m4trace:configure.ac:199: -1- m4_pattern_allow([^am__fastdepCC_TRUE$]) +m4trace:configure.ac:199: -1- m4_pattern_allow([^am__fastdepCC_FALSE$]) +m4trace:configure.ac:199: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_TRUE]) +m4trace:configure.ac:199: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_FALSE]) +m4trace:configure.ac:199: -1- m4_pattern_allow([^CPP$]) +m4trace:configure.ac:199: -1- m4_pattern_allow([^CPPFLAGS$]) +m4trace:configure.ac:199: -1- m4_pattern_allow([^CPP$]) +m4trace:configure.ac:200: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:200: -1- m4_pattern_allow([^CFLAGS$]) +m4trace:configure.ac:200: -1- m4_pattern_allow([^LDFLAGS$]) +m4trace:configure.ac:200: -1- m4_pattern_allow([^LIBS$]) +m4trace:configure.ac:200: -1- m4_pattern_allow([^CPPFLAGS$]) +m4trace:configure.ac:200: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:200: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:200: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:200: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:200: -1- m4_pattern_allow([^ac_ct_CC$]) +m4trace:configure.ac:200: -1- _AM_DEPENDENCIES([CC]) +m4trace:configure.ac:200: -1- m4_pattern_allow([^CCDEPMODE$]) +m4trace:configure.ac:200: -1- AM_CONDITIONAL([am__fastdepCC], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3]) -m4trace:configure.ac:112: -1- m4_pattern_allow([^am__fastdepCC_TRUE$]) -m4trace:configure.ac:112: -1- m4_pattern_allow([^am__fastdepCC_FALSE$]) -m4trace:configure.ac:112: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_TRUE]) -m4trace:configure.ac:112: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_FALSE]) -m4trace:configure.ac:113: -1- m4_pattern_allow([^INSTALL_PROGRAM$]) -m4trace:configure.ac:113: -1- m4_pattern_allow([^INSTALL_SCRIPT$]) -m4trace:configure.ac:113: -1- m4_pattern_allow([^INSTALL_DATA$]) -m4trace:configure.ac:115: -1- AC_PROG_LIBTOOL -m4trace:configure.ac:115: -1- _AC_PROG_LIBTOOL -m4trace:configure.ac:115: -1- AC_LIBTOOL_SETUP -m4trace:configure.ac:115: -1- AC_ENABLE_SHARED -m4trace:configure.ac:115: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete. +m4trace:configure.ac:200: -1- m4_pattern_allow([^am__fastdepCC_TRUE$]) +m4trace:configure.ac:200: -1- m4_pattern_allow([^am__fastdepCC_FALSE$]) +m4trace:configure.ac:200: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_TRUE]) +m4trace:configure.ac:200: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_FALSE]) +m4trace:configure.ac:204: -1- m4_pattern_allow([^CXX$]) +m4trace:configure.ac:204: -1- m4_pattern_allow([^CXXFLAGS$]) +m4trace:configure.ac:204: -1- m4_pattern_allow([^LDFLAGS$]) +m4trace:configure.ac:204: -1- m4_pattern_allow([^LIBS$]) +m4trace:configure.ac:204: -1- m4_pattern_allow([^CPPFLAGS$]) +m4trace:configure.ac:204: -1- m4_pattern_allow([^CXX$]) +m4trace:configure.ac:204: -1- m4_pattern_allow([^ac_ct_CXX$]) +m4trace:configure.ac:204: -1- _AM_DEPENDENCIES([CXX]) +m4trace:configure.ac:204: -1- m4_pattern_allow([^CXXDEPMODE$]) +m4trace:configure.ac:204: -1- AM_CONDITIONAL([am__fastdepCXX], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CXX_dependencies_compiler_type" = gcc3]) +m4trace:configure.ac:204: -1- m4_pattern_allow([^am__fastdepCXX_TRUE$]) +m4trace:configure.ac:204: -1- m4_pattern_allow([^am__fastdepCXX_FALSE$]) +m4trace:configure.ac:204: -1- _AM_SUBST_NOTMAKE([am__fastdepCXX_TRUE]) +m4trace:configure.ac:204: -1- _AM_SUBST_NOTMAKE([am__fastdepCXX_FALSE]) +m4trace:configure.ac:209: -1- AM_PROG_CC_C_O +m4trace:configure.ac:209: -1- m4_pattern_allow([^NO_MINUS_C_MINUS_O$]) +m4trace:configure.ac:212: -1- m4_pattern_allow([^INSTALL_PROGRAM$]) +m4trace:configure.ac:212: -1- m4_pattern_allow([^INSTALL_SCRIPT$]) +m4trace:configure.ac:212: -1- m4_pattern_allow([^INSTALL_DATA$]) +m4trace:configure.ac:213: -1- m4_pattern_allow([^SED$]) +m4trace:configure.ac:213: -1- m4_pattern_allow([^SED$]) +m4trace:configure.ac:214: -1- m4_pattern_allow([^LN_S$]) +m4trace:configure.ac:218: -1- AC_PROG_LIBTOOL +m4trace:configure.ac:218: -1- _AC_PROG_LIBTOOL +m4trace:configure.ac:218: -1- AC_LIBTOOL_SETUP +m4trace:configure.ac:218: -1- AC_ENABLE_SHARED +m4trace:configure.ac:218: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete. You should run autoupdate.], [../../lib/autoconf/general.m4:209: AC_HELP_STRING is expanded from... ../../lib/autoconf/general.m4:1364: AC_ARG_ENABLE is expanded from... /build/toolchain/lin32/libtool-1.5.22/share/aclocal/libtool.m4:1926: AC_ENABLE_SHARED is expanded from... /build/toolchain/lin32/libtool-1.5.22/share/aclocal/libtool.m4:80: AC_LIBTOOL_SETUP is expanded from... /build/toolchain/lin32/libtool-1.5.22/share/aclocal/libtool.m4:60: _AC_PROG_LIBTOOL is expanded from... /build/toolchain/lin32/libtool-1.5.22/share/aclocal/libtool.m4:25: AC_PROG_LIBTOOL is expanded from... -configure.ac:115: the top level]) -m4trace:configure.ac:115: -1- AC_ENABLE_STATIC -m4trace:configure.ac:115: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete. +configure.ac:218: the top level]) +m4trace:configure.ac:218: -1- AC_ENABLE_STATIC +m4trace:configure.ac:218: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete. You should run autoupdate.], [../../lib/autoconf/general.m4:209: AC_HELP_STRING is expanded from... ../../lib/autoconf/general.m4:1364: AC_ARG_ENABLE is expanded from... /build/toolchain/lin32/libtool-1.5.22/share/aclocal/libtool.m4:1965: AC_ENABLE_STATIC is expanded from... /build/toolchain/lin32/libtool-1.5.22/share/aclocal/libtool.m4:80: AC_LIBTOOL_SETUP is expanded from... /build/toolchain/lin32/libtool-1.5.22/share/aclocal/libtool.m4:60: _AC_PROG_LIBTOOL is expanded from... /build/toolchain/lin32/libtool-1.5.22/share/aclocal/libtool.m4:25: AC_PROG_LIBTOOL is expanded from... -configure.ac:115: the top level]) -m4trace:configure.ac:115: -1- AC_ENABLE_FAST_INSTALL -m4trace:configure.ac:115: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete. +configure.ac:218: the top level]) +m4trace:configure.ac:218: -1- AC_ENABLE_FAST_INSTALL +m4trace:configure.ac:218: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete. You should run autoupdate.], [../../lib/autoconf/general.m4:209: AC_HELP_STRING is expanded from... ../../lib/autoconf/general.m4:1364: AC_ARG_ENABLE is expanded from... /build/toolchain/lin32/libtool-1.5.22/share/aclocal/libtool.m4:2004: AC_ENABLE_FAST_INSTALL is expanded from... /build/toolchain/lin32/libtool-1.5.22/share/aclocal/libtool.m4:80: AC_LIBTOOL_SETUP is expanded from... /build/toolchain/lin32/libtool-1.5.22/share/aclocal/libtool.m4:60: _AC_PROG_LIBTOOL is expanded from... /build/toolchain/lin32/libtool-1.5.22/share/aclocal/libtool.m4:25: AC_PROG_LIBTOOL is expanded from... -configure.ac:115: the top level]) -m4trace:configure.ac:115: -1- AC_PROG_LD -m4trace:configure.ac:115: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete. +configure.ac:218: the top level]) +m4trace:configure.ac:218: -1- AC_PROG_LD +m4trace:configure.ac:218: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete. You should run autoupdate.], [../../lib/autoconf/general.m4:209: AC_HELP_STRING is expanded from... ../../lib/autoconf/general.m4:1382: AC_ARG_WITH is expanded from... /build/toolchain/lin32/libtool-1.5.22/share/aclocal/libtool.m4:2145: AC_PROG_LD is expanded from... /build/toolchain/lin32/libtool-1.5.22/share/aclocal/libtool.m4:80: AC_LIBTOOL_SETUP is expanded from... /build/toolchain/lin32/libtool-1.5.22/share/aclocal/libtool.m4:60: _AC_PROG_LIBTOOL is expanded from... /build/toolchain/lin32/libtool-1.5.22/share/aclocal/libtool.m4:25: AC_PROG_LIBTOOL is expanded from... -configure.ac:115: the top level]) -m4trace:configure.ac:115: -1- LT_AC_PROG_SED -m4trace:configure.ac:115: -1- m4_pattern_allow([^SED$]) -m4trace:configure.ac:115: -1- AC_PROG_LD_GNU -m4trace:configure.ac:115: -1- AC_PROG_EGREP -m4trace:configure.ac:115: -1- m4_pattern_allow([^GREP$]) -m4trace:configure.ac:115: -1- m4_pattern_allow([^GREP$]) -m4trace:configure.ac:115: -1- m4_pattern_allow([^EGREP$]) -m4trace:configure.ac:115: -1- m4_pattern_allow([^EGREP$]) -m4trace:configure.ac:115: -1- AC_PROG_LD_RELOAD_FLAG -m4trace:configure.ac:115: -1- AC_PROG_NM -m4trace:configure.ac:115: -1- m4_pattern_allow([^LN_S$]) -m4trace:configure.ac:115: -1- AC_DEPLIBS_CHECK_METHOD -m4trace:configure.ac:115: -1- AC_LIBTOOL_SYS_MAX_CMD_LEN -m4trace:configure.ac:115: -1- AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], []) -m4trace:configure.ac:115: -1- AC_LIBTOOL_OBJDIR -m4trace:configure.ac:115: -1- _LT_AC_SYS_COMPILER -m4trace:configure.ac:115: -1- _LT_AC_PROG_ECHO_BACKSLASH -m4trace:configure.ac:115: -1- _LT_AC_SHELL_INIT([ +configure.ac:218: the top level]) +m4trace:configure.ac:218: -1- LT_AC_PROG_SED +m4trace:configure.ac:218: -1- m4_pattern_allow([^SED$]) +m4trace:configure.ac:218: -1- AC_PROG_LD_GNU +m4trace:configure.ac:218: -1- AC_PROG_EGREP +m4trace:configure.ac:218: -1- m4_pattern_allow([^GREP$]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^GREP$]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^EGREP$]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^EGREP$]) +m4trace:configure.ac:218: -1- AC_PROG_LD_RELOAD_FLAG +m4trace:configure.ac:218: -1- AC_PROG_NM +m4trace:configure.ac:218: -1- AC_DEPLIBS_CHECK_METHOD +m4trace:configure.ac:218: -1- AC_LIBTOOL_SYS_MAX_CMD_LEN +m4trace:configure.ac:218: -1- AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], []) +m4trace:configure.ac:218: -1- AC_LIBTOOL_OBJDIR +m4trace:configure.ac:218: -1- _LT_AC_SYS_COMPILER +m4trace:configure.ac:218: -1- _LT_AC_PROG_ECHO_BACKSLASH +m4trace:configure.ac:218: -1- _LT_AC_SHELL_INIT([ # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} @@ -6843,133 +6883,133 @@ AC_SUBST(ECHO) ]) -m4trace:configure.ac:115: -1- m4_pattern_allow([^ECHO$]) -m4trace:configure.ac:115: -1- m4_pattern_allow([^AR$]) -m4trace:configure.ac:115: -1- m4_pattern_allow([^RANLIB$]) -m4trace:configure.ac:115: -1- m4_pattern_allow([^STRIP$]) -m4trace:configure.ac:115: -1- _LT_CC_BASENAME([$compiler]) -m4trace:configure.ac:115: -1- AC_PATH_MAGIC -m4trace:configure.ac:115: -1- AC_PATH_TOOL_PREFIX([${ac_tool_prefix}file], [/usr/bin$PATH_SEPARATOR$PATH]) -m4trace:configure.ac:115: -1- AC_PATH_TOOL_PREFIX([file], [/usr/bin$PATH_SEPARATOR$PATH]) -m4trace:configure.ac:115: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete. +m4trace:configure.ac:218: -1- m4_pattern_allow([^ECHO$]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^AR$]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^RANLIB$]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^STRIP$]) +m4trace:configure.ac:218: -1- _LT_CC_BASENAME([$compiler]) +m4trace:configure.ac:218: -1- AC_PATH_MAGIC +m4trace:configure.ac:218: -1- AC_PATH_TOOL_PREFIX([${ac_tool_prefix}file], [/usr/bin$PATH_SEPARATOR$PATH]) +m4trace:configure.ac:218: -1- AC_PATH_TOOL_PREFIX([file], [/usr/bin$PATH_SEPARATOR$PATH]) +m4trace:configure.ac:218: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete. You should run autoupdate.], [../../lib/autoconf/general.m4:209: AC_HELP_STRING is expanded from... ../../lib/autoconf/general.m4:1364: AC_ARG_ENABLE is expanded from... /build/toolchain/lin32/libtool-1.5.22/share/aclocal/libtool.m4:80: AC_LIBTOOL_SETUP is expanded from... /build/toolchain/lin32/libtool-1.5.22/share/aclocal/libtool.m4:60: _AC_PROG_LIBTOOL is expanded from... /build/toolchain/lin32/libtool-1.5.22/share/aclocal/libtool.m4:25: AC_PROG_LIBTOOL is expanded from... -configure.ac:115: the top level]) -m4trace:configure.ac:115: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete. +configure.ac:218: the top level]) +m4trace:configure.ac:218: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete. You should run autoupdate.], [../../lib/autoconf/general.m4:209: AC_HELP_STRING is expanded from... ../../lib/autoconf/general.m4:1382: AC_ARG_WITH is expanded from... /build/toolchain/lin32/libtool-1.5.22/share/aclocal/libtool.m4:80: AC_LIBTOOL_SETUP is expanded from... /build/toolchain/lin32/libtool-1.5.22/share/aclocal/libtool.m4:60: _AC_PROG_LIBTOOL is expanded from... /build/toolchain/lin32/libtool-1.5.22/share/aclocal/libtool.m4:25: AC_PROG_LIBTOOL is expanded from... -configure.ac:115: the top level]) -m4trace:configure.ac:115: -1- AC_LIBTOOL_LANG_C_CONFIG -m4trace:configure.ac:115: -1- _LT_AC_LANG_C_CONFIG -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([objext], []) -m4trace:configure.ac:115: -1- _LT_AC_SYS_COMPILER -m4trace:configure.ac:115: -1- _LT_COMPILER_BOILERPLATE -m4trace:configure.ac:115: -1- _LT_LINKER_BOILERPLATE -m4trace:configure.ac:115: -1- AC_LIBTOOL_PROG_COMPILER_NO_RTTI([]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], []) -m4trace:configure.ac:115: -1- AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], [lt_cv_prog_compiler_rtti_exceptions], [-fno-rtti -fno-exceptions], [], [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, )="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, ) -fno-rtti -fno-exceptions"]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], []) -m4trace:configure.ac:115: -1- AC_LIBTOOL_PROG_COMPILER_PIC([]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_can_build_shared], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_can_build_shared], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_can_build_shared], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) -m4trace:configure.ac:115: -2- _LT_AC_TAGVAR([lt_prog_compiler_pic_works], []) -m4trace:configure.ac:115: -1- AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, ) works], [lt_prog_compiler_pic_works], [$_LT_AC_TAGVAR(lt_prog_compiler_pic, )ifelse([],[],[ -DPIC],[ifelse([],[CXX],[ -DPIC],[])])], [], [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, ) in +configure.ac:218: the top level]) +m4trace:configure.ac:218: -1- AC_LIBTOOL_LANG_C_CONFIG +m4trace:configure.ac:218: -1- _LT_AC_LANG_C_CONFIG +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([objext], []) +m4trace:configure.ac:218: -1- _LT_AC_SYS_COMPILER +m4trace:configure.ac:218: -1- _LT_COMPILER_BOILERPLATE +m4trace:configure.ac:218: -1- _LT_LINKER_BOILERPLATE +m4trace:configure.ac:218: -1- AC_LIBTOOL_PROG_COMPILER_NO_RTTI([]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], []) +m4trace:configure.ac:218: -1- AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], [lt_cv_prog_compiler_rtti_exceptions], [-fno-rtti -fno-exceptions], [], [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, )="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, ) -fno-rtti -fno-exceptions"]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], []) +m4trace:configure.ac:218: -1- AC_LIBTOOL_PROG_COMPILER_PIC([]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_can_build_shared], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_can_build_shared], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_can_build_shared], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) +m4trace:configure.ac:218: -2- _LT_AC_TAGVAR([lt_prog_compiler_pic_works], []) +m4trace:configure.ac:218: -1- AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, ) works], [lt_prog_compiler_pic_works], [$_LT_AC_TAGVAR(lt_prog_compiler_pic, )ifelse([],[],[ -DPIC],[ifelse([],[CXX],[ -DPIC],[])])], [], [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, ) in "" | " "*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, )=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, )" ;; esac], [_LT_AC_TAGVAR(lt_prog_compiler_pic, )= _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, )=no]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_can_build_shared], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], []) -m4trace:configure.ac:115: -2- _LT_AC_TAGVAR([lt_prog_compiler_static_works], []) -m4trace:configure.ac:115: -1- AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], [lt_prog_compiler_static_works], [$lt_tmp_static_flag], [], [_LT_AC_TAGVAR(lt_prog_compiler_static, )=]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], []) -m4trace:configure.ac:115: -1- AC_LIBTOOL_PROG_CC_C_O([]) -m4trace:configure.ac:115: -3- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], []) -m4trace:configure.ac:115: -3- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], []) -m4trace:configure.ac:115: -1- AC_LIBTOOL_SYS_HARD_LINK_LOCKS([]) -m4trace:configure.ac:115: -1- _LT_AC_LOCK -m4trace:configure.ac:115: -1- _m4_warn([obsolete], [The macro `AC_TRY_LINK' is obsolete. +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_can_build_shared], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], []) +m4trace:configure.ac:218: -2- _LT_AC_TAGVAR([lt_prog_compiler_static_works], []) +m4trace:configure.ac:218: -1- AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], [lt_prog_compiler_static_works], [$lt_tmp_static_flag], [], [_LT_AC_TAGVAR(lt_prog_compiler_static, )=]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], []) +m4trace:configure.ac:218: -1- AC_LIBTOOL_PROG_CC_C_O([]) +m4trace:configure.ac:218: -3- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], []) +m4trace:configure.ac:218: -3- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], []) +m4trace:configure.ac:218: -1- AC_LIBTOOL_SYS_HARD_LINK_LOCKS([]) +m4trace:configure.ac:218: -1- _LT_AC_LOCK +m4trace:configure.ac:218: -1- _m4_warn([obsolete], [The macro `AC_TRY_LINK' is obsolete. You should run autoupdate.], [../../lib/autoconf/general.m4:2414: AC_TRY_LINK is expanded from... ../../lib/m4sugar/m4sh.m4:516: AS_IF is expanded from... ../../lib/autoconf/general.m4:1898: AC_CACHE_VAL is expanded from... @@ -6981,1475 +7021,1459 @@ /build/toolchain/lin32/libtool-1.5.22/share/aclocal/libtool.m4:80: AC_LIBTOOL_SETUP is expanded from... /build/toolchain/lin32/libtool-1.5.22/share/aclocal/libtool.m4:60: _AC_PROG_LIBTOOL is expanded from... /build/toolchain/lin32/libtool-1.5.22/share/aclocal/libtool.m4:25: AC_PROG_LIBTOOL is expanded from... -configure.ac:115: the top level]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], []) -m4trace:configure.ac:115: -1- AC_LIBTOOL_PROG_LD_SHLIBS([]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_From_new_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([thread_safe_flag_spec], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_minus_L], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([link_all_deplibs], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_automatic], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([module_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([module_expsym_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([always_export_symbols], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_symbols_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([include_expsyms], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([exclude_expsyms], []) -m4trace:configure.ac:115: -1- _LT_CC_BASENAME([$compiler]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_minus_L], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([always_export_symbols], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_symbols_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([always_export_symbols], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_minus_L], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_symbols_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_symbols_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([link_all_deplibs], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_minus_L], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([always_export_symbols], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], []) -m4trace:configure.ac:115: -1- _LT_AC_SYS_LIBPATH_AIX -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_SYS_LIBPATH_AIX -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([no_undefined_flag], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_minus_L], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_From_new_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([fix_srcfile_path], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_automatic], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([link_all_deplibs], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([module_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([module_expsym_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([module_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([module_expsym_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_minus_L], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_minus_L], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_minus_L], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_minus_L], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([link_all_deplibs], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_minus_L], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_From_new_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([no_undefined_flag], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([link_all_deplibs], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_minus_L], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([reload_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([no_undefined_flag], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([no_undefined_flag], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([link_all_deplibs], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], []) -m4trace:configure.ac:115: -2- _LT_AC_TAGVAR([archive_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], []) -m4trace:configure.ac:115: -1- AC_LIBTOOL_SYS_DYNAMIC_LINKER([]) -m4trace:configure.ac:115: -1- AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_action], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([runpath_var], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_automatic], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_minus_L], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_action], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_action], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_action], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_action], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_action], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_action], []) -m4trace:configure.ac:115: -1- AC_LIBTOOL_SYS_LIB_STRIP -m4trace:configure.ac:115: -1- AC_LIBTOOL_DLOPEN_SELF -m4trace:configure.ac:115: -1- _LT_AC_CHECK_DLFCN -m4trace:configure.ac:115: -1- m4_pattern_allow([^STDC_HEADERS$]) -m4trace:configure.ac:115: -1- _LT_AC_TRY_DLOPEN_SELF([lt_cv_dlopen_self=yes], [lt_cv_dlopen_self=yes], [lt_cv_dlopen_self=no], [lt_cv_dlopen_self=cross]) -m4trace:configure.ac:115: -1- _LT_AC_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]) -m4trace:configure.ac:115: -1- AC_LIBTOOL_CONFIG([]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([compiler], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([CC], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([LD], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([thread_safe_flag_spec], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_from_new_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([predep_objects], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([postdep_objects], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([predeps], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([postdeps], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([compiler_lib_search_path], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([postinstall_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([postuninstall_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([no_undefined_flag], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_symbols_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_automatic], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([module_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([module_expsym_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([exclude_expsyms], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([include_expsyms], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_from_new_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([module_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([module_expsym_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_symbols_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([compiler], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([GCC], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([LD], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([thread_safe_flag_spec], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_from_new_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([module_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([module_expsym_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([predep_objects], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([postdep_objects], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([predeps], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([postdeps], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([compiler_lib_search_path], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([no_undefined_flag], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_action], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_minus_L], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_automatic], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([link_all_deplibs], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([fix_srcfile_path], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([always_export_symbols], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_symbols_cmds], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([exclude_expsyms], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([include_expsyms], []) -m4trace:configure.ac:115: -1- _LT_AC_TAGCONFIG -m4trace:configure.ac:115: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete. +configure.ac:218: the top level]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], []) +m4trace:configure.ac:218: -1- AC_LIBTOOL_PROG_LD_SHLIBS([]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_From_new_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([thread_safe_flag_spec], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_minus_L], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([link_all_deplibs], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_automatic], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([module_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([module_expsym_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([always_export_symbols], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_symbols_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([include_expsyms], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([exclude_expsyms], []) +m4trace:configure.ac:218: -1- _LT_CC_BASENAME([$compiler]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_minus_L], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([always_export_symbols], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_symbols_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([always_export_symbols], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_minus_L], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_symbols_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_symbols_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([link_all_deplibs], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_minus_L], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([always_export_symbols], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], []) +m4trace:configure.ac:218: -1- _LT_AC_SYS_LIBPATH_AIX +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_SYS_LIBPATH_AIX +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([no_undefined_flag], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_minus_L], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_From_new_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([fix_srcfile_path], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_automatic], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([link_all_deplibs], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([module_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([module_expsym_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([module_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([module_expsym_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_minus_L], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_minus_L], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_minus_L], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_minus_L], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([link_all_deplibs], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_minus_L], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_From_new_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([no_undefined_flag], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([link_all_deplibs], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_minus_L], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([reload_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([no_undefined_flag], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([no_undefined_flag], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([link_all_deplibs], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], []) +m4trace:configure.ac:218: -2- _LT_AC_TAGVAR([archive_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], []) +m4trace:configure.ac:218: -1- AC_LIBTOOL_SYS_DYNAMIC_LINKER([]) +m4trace:configure.ac:218: -1- AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_action], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([runpath_var], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_automatic], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_minus_L], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_action], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_action], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_action], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_action], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_action], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_action], []) +m4trace:configure.ac:218: -1- AC_LIBTOOL_SYS_LIB_STRIP +m4trace:configure.ac:218: -1- AC_LIBTOOL_DLOPEN_SELF +m4trace:configure.ac:218: -1- _LT_AC_CHECK_DLFCN +m4trace:configure.ac:218: -1- m4_pattern_allow([^STDC_HEADERS$]) +m4trace:configure.ac:218: -1- _LT_AC_TRY_DLOPEN_SELF([lt_cv_dlopen_self=yes], [lt_cv_dlopen_self=yes], [lt_cv_dlopen_self=no], [lt_cv_dlopen_self=cross]) +m4trace:configure.ac:218: -1- _LT_AC_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]) +m4trace:configure.ac:218: -1- AC_LIBTOOL_CONFIG([]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([compiler], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([CC], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([LD], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([thread_safe_flag_spec], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_from_new_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([predep_objects], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([postdep_objects], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([predeps], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([postdeps], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([compiler_lib_search_path], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([postinstall_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([postuninstall_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([no_undefined_flag], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_symbols_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_automatic], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([module_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([module_expsym_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([exclude_expsyms], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([include_expsyms], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_from_new_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([module_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([module_expsym_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_symbols_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([compiler], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([GCC], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([LD], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([thread_safe_flag_spec], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_from_new_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([module_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([module_expsym_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([predep_objects], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([postdep_objects], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([predeps], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([postdeps], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([compiler_lib_search_path], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([no_undefined_flag], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_action], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_minus_L], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_automatic], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([link_all_deplibs], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([fix_srcfile_path], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([always_export_symbols], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_symbols_cmds], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([exclude_expsyms], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([include_expsyms], []) +m4trace:configure.ac:218: -1- _LT_AC_TAGCONFIG +m4trace:configure.ac:218: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete. You should run autoupdate.], [../../lib/autoconf/general.m4:209: AC_HELP_STRING is expanded from... ../../lib/autoconf/general.m4:1382: AC_ARG_WITH is expanded from... /build/toolchain/lin32/libtool-1.5.22/share/aclocal/libtool.m4:1804: _LT_AC_TAGCONFIG is expanded from... /build/toolchain/lin32/libtool-1.5.22/share/aclocal/libtool.m4:80: AC_LIBTOOL_SETUP is expanded from... /build/toolchain/lin32/libtool-1.5.22/share/aclocal/libtool.m4:60: _AC_PROG_LIBTOOL is expanded from... /build/toolchain/lin32/libtool-1.5.22/share/aclocal/libtool.m4:25: AC_PROG_LIBTOOL is expanded from... -configure.ac:115: the top level]) -m4trace:configure.ac:115: -1- _m4_warn([obsolete], [back quotes and double quotes must not be escaped in: $as_me:$LINENO: error: tag name \"$tagname\" already exists], [/build/toolchain/lin32/libtool-1.5.22/share/aclocal/libtool.m4:1804: _LT_AC_TAGCONFIG is expanded from... +configure.ac:218: the top level]) +m4trace:configure.ac:218: -1- _m4_warn([obsolete], [back quotes and double quotes must not be escaped in: $as_me:$LINENO: error: tag name \"$tagname\" already exists], [/build/toolchain/lin32/libtool-1.5.22/share/aclocal/libtool.m4:1804: _LT_AC_TAGCONFIG is expanded from... /build/toolchain/lin32/libtool-1.5.22/share/aclocal/libtool.m4:80: AC_LIBTOOL_SETUP is expanded from... /build/toolchain/lin32/libtool-1.5.22/share/aclocal/libtool.m4:60: _AC_PROG_LIBTOOL is expanded from... /build/toolchain/lin32/libtool-1.5.22/share/aclocal/libtool.m4:25: AC_PROG_LIBTOOL is expanded from... -configure.ac:115: the top level]) -m4trace:configure.ac:115: -1- _m4_warn([obsolete], [back quotes and double quotes must not be escaped in: $as_me: error: tag name \"$tagname\" already exists], [/build/toolchain/lin32/libtool-1.5.22/share/aclocal/libtool.m4:1804: _LT_AC_TAGCONFIG is expanded from... +configure.ac:218: the top level]) +m4trace:configure.ac:218: -1- _m4_warn([obsolete], [back quotes and double quotes must not be escaped in: $as_me: error: tag name \"$tagname\" already exists], [/build/toolchain/lin32/libtool-1.5.22/share/aclocal/libtool.m4:1804: _LT_AC_TAGCONFIG is expanded from... /build/toolchain/lin32/libtool-1.5.22/share/aclocal/libtool.m4:80: AC_LIBTOOL_SETUP is expanded from... /build/toolchain/lin32/libtool-1.5.22/share/aclocal/libtool.m4:60: _AC_PROG_LIBTOOL is expanded from... /build/toolchain/lin32/libtool-1.5.22/share/aclocal/libtool.m4:25: AC_PROG_LIBTOOL is expanded from... -configure.ac:115: the top level]) -m4trace:configure.ac:115: -1- AC_LIBTOOL_LANG_CXX_CONFIG -m4trace:configure.ac:115: -1- _LT_AC_LANG_CXX_CONFIG([CXX]) -m4trace:configure.ac:115: -1- m4_pattern_allow([^CXX$]) -m4trace:configure.ac:115: -1- m4_pattern_allow([^CXXFLAGS$]) -m4trace:configure.ac:115: -1- m4_pattern_allow([^LDFLAGS$]) -m4trace:configure.ac:115: -1- m4_pattern_allow([^LIBS$]) -m4trace:configure.ac:115: -1- m4_pattern_allow([^CPPFLAGS$]) -m4trace:configure.ac:115: -1- m4_pattern_allow([^CXX$]) -m4trace:configure.ac:115: -1- m4_pattern_allow([^ac_ct_CXX$]) -m4trace:configure.ac:115: -1- _AM_DEPENDENCIES([CXX]) -m4trace:configure.ac:115: -1- m4_pattern_allow([^CXXDEPMODE$]) -m4trace:configure.ac:115: -1- AM_CONDITIONAL([am__fastdepCXX], [ - test "x$enable_dependency_tracking" != xno \ - && test "$am_cv_CXX_dependencies_compiler_type" = gcc3]) -m4trace:configure.ac:115: -1- m4_pattern_allow([^am__fastdepCXX_TRUE$]) -m4trace:configure.ac:115: -1- m4_pattern_allow([^am__fastdepCXX_FALSE$]) -m4trace:configure.ac:115: -1- _AM_SUBST_NOTMAKE([am__fastdepCXX_TRUE]) -m4trace:configure.ac:115: -1- _AM_SUBST_NOTMAKE([am__fastdepCXX_FALSE]) -m4trace:configure.ac:115: -1- _LT_AC_PROG_CXXCPP -m4trace:configure.ac:115: -1- m4_pattern_allow([^CXXCPP$]) -m4trace:configure.ac:115: -1- m4_pattern_allow([^CPPFLAGS$]) -m4trace:configure.ac:115: -1- m4_pattern_allow([^CXXCPP$]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([always_export_symbols], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_minus_L], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_automatic], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([module_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([module_expsym_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([link_all_deplibs], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([no_undefined_flag], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([predep_objects], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([postdep_objects], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([predeps], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([postdeps], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([compiler_lib_search_path], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([objext], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_SYS_COMPILER -m4trace:configure.ac:115: -1- _LT_COMPILER_BOILERPLATE -m4trace:configure.ac:115: -1- _LT_LINKER_BOILERPLATE -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([compiler], [CXX]) -m4trace:configure.ac:115: -1- _LT_CC_BASENAME([$compiler]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [CXX]) -m4trace:configure.ac:115: -1- AC_PROG_LD -m4trace:configure.ac:115: -1- AC_PROG_LD_GNU -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([link_all_deplibs], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_minus_L], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([always_export_symbols], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_SYS_LIBPATH_AIX -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_SYS_LIBPATH_AIX -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([no_undefined_flag], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([always_export_symbols], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_automatic], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([link_all_deplibs], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([module_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([module_expsym_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([module_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([module_expsym_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_minus_L], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_minus_L], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([link_all_deplibs], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([no_undefined_flag], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([link_all_deplibs], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([no_undefined_flag], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([no_undefined_flag], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([no_undefined_flag], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([link_all_deplibs], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([GCC], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([LD], [CXX]) -m4trace:configure.ac:115: -1- AC_LIBTOOL_POSTDEP_PREDEP([CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([compiler_lib_search_path], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([compiler_lib_search_path], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([compiler_lib_search_path], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([compiler_lib_search_path], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([postdeps], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([postdeps], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([postdeps], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([postdeps], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([predep_objects], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([predep_objects], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([predep_objects], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([predep_objects], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([postdep_objects], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([postdep_objects], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([postdep_objects], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([postdep_objects], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([predep_objects], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([postdep_objects], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([postdeps], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([postdeps], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([postdeps], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX]) -m4trace:configure.ac:115: -1- AC_LIBTOOL_PROG_COMPILER_PIC([CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_can_build_shared], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) -m4trace:configure.ac:115: -2- _LT_AC_TAGVAR([lt_prog_compiler_pic_works], [CXX]) -m4trace:configure.ac:115: -1- AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, CXX) works], [lt_prog_compiler_pic_works_CXX], [$_LT_AC_TAGVAR(lt_prog_compiler_pic, CXX)ifelse([CXX],[],[ -DPIC],[ifelse([CXX],[CXX],[ -DPIC],[])])], [], [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, CXX) in +configure.ac:218: the top level]) +m4trace:configure.ac:218: -1- AC_LIBTOOL_LANG_CXX_CONFIG +m4trace:configure.ac:218: -1- _LT_AC_LANG_CXX_CONFIG([CXX]) +m4trace:configure.ac:218: -1- _LT_AC_PROG_CXXCPP +m4trace:configure.ac:218: -1- m4_pattern_allow([^CXXCPP$]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^CPPFLAGS$]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^CXXCPP$]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([always_export_symbols], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_minus_L], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_automatic], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([module_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([module_expsym_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([link_all_deplibs], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([no_undefined_flag], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([predep_objects], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([postdep_objects], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([predeps], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([postdeps], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([compiler_lib_search_path], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([objext], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_SYS_COMPILER +m4trace:configure.ac:218: -1- _LT_COMPILER_BOILERPLATE +m4trace:configure.ac:218: -1- _LT_LINKER_BOILERPLATE +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([compiler], [CXX]) +m4trace:configure.ac:218: -1- _LT_CC_BASENAME([$compiler]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [CXX]) +m4trace:configure.ac:218: -1- AC_PROG_LD +m4trace:configure.ac:218: -1- AC_PROG_LD_GNU +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([link_all_deplibs], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_minus_L], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([always_export_symbols], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_SYS_LIBPATH_AIX +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_SYS_LIBPATH_AIX +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([no_undefined_flag], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([always_export_symbols], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_automatic], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([link_all_deplibs], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([module_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([module_expsym_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([module_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([module_expsym_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_minus_L], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_minus_L], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([link_all_deplibs], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([no_undefined_flag], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([link_all_deplibs], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([no_undefined_flag], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([no_undefined_flag], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([no_undefined_flag], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([link_all_deplibs], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([GCC], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([LD], [CXX]) +m4trace:configure.ac:218: -1- AC_LIBTOOL_POSTDEP_PREDEP([CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([compiler_lib_search_path], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([compiler_lib_search_path], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([compiler_lib_search_path], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([compiler_lib_search_path], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([postdeps], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([postdeps], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([postdeps], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([postdeps], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([predep_objects], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([predep_objects], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([predep_objects], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([predep_objects], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([postdep_objects], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([postdep_objects], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([postdep_objects], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([postdep_objects], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([predep_objects], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([postdep_objects], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([postdeps], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([postdeps], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([postdeps], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX]) +m4trace:configure.ac:218: -1- AC_LIBTOOL_PROG_COMPILER_PIC([CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_can_build_shared], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) +m4trace:configure.ac:218: -2- _LT_AC_TAGVAR([lt_prog_compiler_pic_works], [CXX]) +m4trace:configure.ac:218: -1- AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, CXX) works], [lt_prog_compiler_pic_works_CXX], [$_LT_AC_TAGVAR(lt_prog_compiler_pic, CXX)ifelse([CXX],[],[ -DPIC],[ifelse([CXX],[CXX],[ -DPIC],[])])], [], [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, CXX) in "" | " "*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, CXX)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, CXX)" ;; esac], [_LT_AC_TAGVAR(lt_prog_compiler_pic, CXX)= _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, CXX)=no]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_can_build_shared], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX]) -m4trace:configure.ac:115: -2- _LT_AC_TAGVAR([lt_prog_compiler_static_works], [CXX]) -m4trace:configure.ac:115: -1- AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], [lt_prog_compiler_static_works_CXX], [$lt_tmp_static_flag], [], [_LT_AC_TAGVAR(lt_prog_compiler_static, CXX)=]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX]) -m4trace:configure.ac:115: -1- AC_LIBTOOL_PROG_CC_C_O([CXX]) -m4trace:configure.ac:115: -3- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [CXX]) -m4trace:configure.ac:115: -3- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [CXX]) -m4trace:configure.ac:115: -1- AC_LIBTOOL_SYS_HARD_LINK_LOCKS([CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [CXX]) -m4trace:configure.ac:115: -1- AC_LIBTOOL_PROG_LD_SHLIBS([CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_symbols_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_symbols_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_symbols_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_symbols_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_symbols_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_symbols_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX]) -m4trace:configure.ac:115: -2- _LT_AC_TAGVAR([archive_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX]) -m4trace:configure.ac:115: -1- AC_LIBTOOL_SYS_DYNAMIC_LINKER([CXX]) -m4trace:configure.ac:115: -1- AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_action], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([runpath_var], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_automatic], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_minus_L], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_action], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_action], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_action], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_action], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_action], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_action], [CXX]) -m4trace:configure.ac:115: -1- AC_LIBTOOL_CONFIG([CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([compiler], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([CC], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([LD], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([thread_safe_flag_spec], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_from_new_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([predep_objects], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([postdep_objects], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([predeps], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([postdeps], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([compiler_lib_search_path], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([postinstall_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([postuninstall_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([no_undefined_flag], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_symbols_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_automatic], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([module_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([module_expsym_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([exclude_expsyms], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([include_expsyms], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_from_new_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([module_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([module_expsym_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_symbols_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([compiler], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([GCC], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([LD], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([thread_safe_flag_spec], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_from_new_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([module_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([module_expsym_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([predep_objects], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([postdep_objects], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([predeps], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([postdeps], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([compiler_lib_search_path], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([no_undefined_flag], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_action], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_minus_L], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_automatic], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([link_all_deplibs], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([fix_srcfile_path], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([always_export_symbols], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_symbols_cmds], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([exclude_expsyms], [CXX]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([include_expsyms], [CXX]) -m4trace:configure.ac:115: -1- AC_LIBTOOL_LANG_F77_CONFIG -m4trace:configure.ac:115: -1- _LT_AC_LANG_F77_CONFIG([F77]) -m4trace:configure.ac:115: -1- m4_pattern_allow([^F77$]) -m4trace:configure.ac:115: -1- m4_pattern_allow([^FFLAGS$]) -m4trace:configure.ac:115: -1- m4_pattern_allow([^LDFLAGS$]) -m4trace:configure.ac:115: -1- m4_pattern_allow([^LIBS$]) -m4trace:configure.ac:115: -1- m4_pattern_allow([^F77$]) -m4trace:configure.ac:115: -1- m4_pattern_allow([^ac_ct_F77$]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([always_export_symbols], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_minus_L], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_automatic], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([module_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([module_expsym_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([link_all_deplibs], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([no_undefined_flag], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([objext], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_SYS_COMPILER -m4trace:configure.ac:115: -1- _LT_COMPILER_BOILERPLATE -m4trace:configure.ac:115: -1- _LT_LINKER_BOILERPLATE -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([compiler], [F77]) -m4trace:configure.ac:115: -1- _LT_CC_BASENAME([$compiler]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([GCC], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([LD], [F77]) -m4trace:configure.ac:115: -1- AC_LIBTOOL_PROG_COMPILER_PIC([F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_can_build_shared], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_can_build_shared], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_can_build_shared], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) -m4trace:configure.ac:115: -2- _LT_AC_TAGVAR([lt_prog_compiler_pic_works], [F77]) -m4trace:configure.ac:115: -1- AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, F77) works], [lt_prog_compiler_pic_works_F77], [$_LT_AC_TAGVAR(lt_prog_compiler_pic, F77)ifelse([F77],[],[ -DPIC],[ifelse([F77],[CXX],[ -DPIC],[])])], [], [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, F77) in +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_can_build_shared], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX]) +m4trace:configure.ac:218: -2- _LT_AC_TAGVAR([lt_prog_compiler_static_works], [CXX]) +m4trace:configure.ac:218: -1- AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], [lt_prog_compiler_static_works_CXX], [$lt_tmp_static_flag], [], [_LT_AC_TAGVAR(lt_prog_compiler_static, CXX)=]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX]) +m4trace:configure.ac:218: -1- AC_LIBTOOL_PROG_CC_C_O([CXX]) +m4trace:configure.ac:218: -3- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [CXX]) +m4trace:configure.ac:218: -3- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [CXX]) +m4trace:configure.ac:218: -1- AC_LIBTOOL_SYS_HARD_LINK_LOCKS([CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [CXX]) +m4trace:configure.ac:218: -1- AC_LIBTOOL_PROG_LD_SHLIBS([CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_symbols_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_symbols_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_symbols_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_symbols_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_symbols_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_symbols_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX]) +m4trace:configure.ac:218: -2- _LT_AC_TAGVAR([archive_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX]) +m4trace:configure.ac:218: -1- AC_LIBTOOL_SYS_DYNAMIC_LINKER([CXX]) +m4trace:configure.ac:218: -1- AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_action], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([runpath_var], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_automatic], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_minus_L], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_action], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_action], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_action], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_action], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_action], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_action], [CXX]) +m4trace:configure.ac:218: -1- AC_LIBTOOL_CONFIG([CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([compiler], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([CC], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([LD], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([thread_safe_flag_spec], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_from_new_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([predep_objects], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([postdep_objects], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([predeps], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([postdeps], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([compiler_lib_search_path], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([postinstall_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([postuninstall_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([no_undefined_flag], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_symbols_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_automatic], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([module_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([module_expsym_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([exclude_expsyms], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([include_expsyms], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_from_new_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([module_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([module_expsym_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_symbols_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([compiler], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([GCC], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([LD], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([thread_safe_flag_spec], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_from_new_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([module_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([module_expsym_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([predep_objects], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([postdep_objects], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([predeps], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([postdeps], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([compiler_lib_search_path], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([no_undefined_flag], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_action], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_minus_L], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_automatic], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([link_all_deplibs], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([fix_srcfile_path], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([always_export_symbols], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_symbols_cmds], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([exclude_expsyms], [CXX]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([include_expsyms], [CXX]) +m4trace:configure.ac:218: -1- AC_LIBTOOL_LANG_F77_CONFIG +m4trace:configure.ac:218: -1- _LT_AC_LANG_F77_CONFIG([F77]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^F77$]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^FFLAGS$]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^LDFLAGS$]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^LIBS$]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^F77$]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^ac_ct_F77$]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([always_export_symbols], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_minus_L], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_automatic], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([module_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([module_expsym_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([link_all_deplibs], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([no_undefined_flag], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([objext], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_SYS_COMPILER +m4trace:configure.ac:218: -1- _LT_COMPILER_BOILERPLATE +m4trace:configure.ac:218: -1- _LT_LINKER_BOILERPLATE +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([compiler], [F77]) +m4trace:configure.ac:218: -1- _LT_CC_BASENAME([$compiler]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([GCC], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([LD], [F77]) +m4trace:configure.ac:218: -1- AC_LIBTOOL_PROG_COMPILER_PIC([F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_can_build_shared], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_can_build_shared], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_can_build_shared], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) +m4trace:configure.ac:218: -2- _LT_AC_TAGVAR([lt_prog_compiler_pic_works], [F77]) +m4trace:configure.ac:218: -1- AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, F77) works], [lt_prog_compiler_pic_works_F77], [$_LT_AC_TAGVAR(lt_prog_compiler_pic, F77)ifelse([F77],[],[ -DPIC],[ifelse([F77],[CXX],[ -DPIC],[])])], [], [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, F77) in "" | " "*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, F77)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, F77)" ;; esac], [_LT_AC_TAGVAR(lt_prog_compiler_pic, F77)= _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, F77)=no]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_can_build_shared], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77]) -m4trace:configure.ac:115: -2- _LT_AC_TAGVAR([lt_prog_compiler_static_works], [F77]) -m4trace:configure.ac:115: -1- AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], [lt_prog_compiler_static_works_F77], [$lt_tmp_static_flag], [], [_LT_AC_TAGVAR(lt_prog_compiler_static, F77)=]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77]) -m4trace:configure.ac:115: -1- AC_LIBTOOL_PROG_CC_C_O([F77]) -m4trace:configure.ac:115: -3- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [F77]) -m4trace:configure.ac:115: -3- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [F77]) -m4trace:configure.ac:115: -1- AC_LIBTOOL_SYS_HARD_LINK_LOCKS([F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [F77]) -m4trace:configure.ac:115: -1- AC_LIBTOOL_PROG_LD_SHLIBS([F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_From_new_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([thread_safe_flag_spec], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_minus_L], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([link_all_deplibs], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_automatic], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([module_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([module_expsym_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([always_export_symbols], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_symbols_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([include_expsyms], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([exclude_expsyms], [F77]) -m4trace:configure.ac:115: -1- _LT_CC_BASENAME([$compiler]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_minus_L], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([always_export_symbols], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_symbols_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([always_export_symbols], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_minus_L], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_symbols_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_symbols_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([link_all_deplibs], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_minus_L], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([always_export_symbols], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_SYS_LIBPATH_AIX -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_SYS_LIBPATH_AIX -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([no_undefined_flag], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_minus_L], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_From_new_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([fix_srcfile_path], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_automatic], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([link_all_deplibs], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([module_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([module_expsym_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([module_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([module_expsym_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_minus_L], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_minus_L], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_minus_L], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_minus_L], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([link_all_deplibs], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_minus_L], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_From_new_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([no_undefined_flag], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([link_all_deplibs], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_minus_L], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([reload_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([no_undefined_flag], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([no_undefined_flag], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([link_all_deplibs], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77]) -m4trace:configure.ac:115: -2- _LT_AC_TAGVAR([archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [F77]) -m4trace:configure.ac:115: -1- AC_LIBTOOL_SYS_DYNAMIC_LINKER([F77]) -m4trace:configure.ac:115: -1- AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_action], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([runpath_var], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_automatic], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_minus_L], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_action], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_action], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_action], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_action], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_action], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_action], [F77]) -m4trace:configure.ac:115: -1- AC_LIBTOOL_CONFIG([F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([compiler], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([CC], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([LD], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([thread_safe_flag_spec], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_from_new_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([predep_objects], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([postdep_objects], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([predeps], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([postdeps], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([compiler_lib_search_path], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([postinstall_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([postuninstall_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([no_undefined_flag], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_symbols_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_automatic], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([module_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([module_expsym_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([exclude_expsyms], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([include_expsyms], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_from_new_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([module_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([module_expsym_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_symbols_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([compiler], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([GCC], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([LD], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([thread_safe_flag_spec], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_from_new_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([module_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([module_expsym_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([predep_objects], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([postdep_objects], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([predeps], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([postdeps], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([compiler_lib_search_path], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([no_undefined_flag], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_action], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_minus_L], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_automatic], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([link_all_deplibs], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([fix_srcfile_path], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([always_export_symbols], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_symbols_cmds], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([exclude_expsyms], [F77]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([include_expsyms], [F77]) -m4trace:configure.ac:115: -1- AC_LIBTOOL_LANG_GCJ_CONFIG -m4trace:configure.ac:115: -1- _LT_AC_LANG_GCJ_CONFIG([GCJ]) -m4trace:configure.ac:115: -1- _m4_warn([obsolete], [The macro `AC_LANG_SAVE' is obsolete. +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_can_build_shared], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77]) +m4trace:configure.ac:218: -2- _LT_AC_TAGVAR([lt_prog_compiler_static_works], [F77]) +m4trace:configure.ac:218: -1- AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], [lt_prog_compiler_static_works_F77], [$lt_tmp_static_flag], [], [_LT_AC_TAGVAR(lt_prog_compiler_static, F77)=]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77]) +m4trace:configure.ac:218: -1- AC_LIBTOOL_PROG_CC_C_O([F77]) +m4trace:configure.ac:218: -3- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [F77]) +m4trace:configure.ac:218: -3- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [F77]) +m4trace:configure.ac:218: -1- AC_LIBTOOL_SYS_HARD_LINK_LOCKS([F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [F77]) +m4trace:configure.ac:218: -1- AC_LIBTOOL_PROG_LD_SHLIBS([F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_From_new_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([thread_safe_flag_spec], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_minus_L], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([link_all_deplibs], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_automatic], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([module_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([module_expsym_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([always_export_symbols], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_symbols_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([include_expsyms], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([exclude_expsyms], [F77]) +m4trace:configure.ac:218: -1- _LT_CC_BASENAME([$compiler]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_minus_L], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([always_export_symbols], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_symbols_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([always_export_symbols], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_minus_L], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_symbols_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_symbols_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([link_all_deplibs], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_minus_L], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([always_export_symbols], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_SYS_LIBPATH_AIX +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_SYS_LIBPATH_AIX +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([no_undefined_flag], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_minus_L], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_From_new_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([fix_srcfile_path], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_automatic], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([link_all_deplibs], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([module_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([module_expsym_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([module_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([module_expsym_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_minus_L], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_minus_L], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_minus_L], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_minus_L], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([link_all_deplibs], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_minus_L], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_From_new_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([no_undefined_flag], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([link_all_deplibs], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_minus_L], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([reload_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([no_undefined_flag], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([no_undefined_flag], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([link_all_deplibs], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77]) +m4trace:configure.ac:218: -2- _LT_AC_TAGVAR([archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [F77]) +m4trace:configure.ac:218: -1- AC_LIBTOOL_SYS_DYNAMIC_LINKER([F77]) +m4trace:configure.ac:218: -1- AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_action], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([runpath_var], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_automatic], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_minus_L], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_action], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_action], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_action], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_action], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_action], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_action], [F77]) +m4trace:configure.ac:218: -1- AC_LIBTOOL_CONFIG([F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([compiler], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([CC], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([LD], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([thread_safe_flag_spec], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_from_new_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([predep_objects], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([postdep_objects], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([predeps], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([postdeps], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([compiler_lib_search_path], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([postinstall_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([postuninstall_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([no_undefined_flag], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_symbols_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_automatic], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([module_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([module_expsym_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([exclude_expsyms], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([include_expsyms], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_from_new_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([module_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([module_expsym_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_symbols_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([compiler], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([GCC], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([LD], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([thread_safe_flag_spec], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_from_new_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([module_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([module_expsym_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([predep_objects], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([postdep_objects], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([predeps], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([postdeps], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([compiler_lib_search_path], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([no_undefined_flag], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_action], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_minus_L], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_automatic], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([link_all_deplibs], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([fix_srcfile_path], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([always_export_symbols], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_symbols_cmds], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([exclude_expsyms], [F77]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([include_expsyms], [F77]) +m4trace:configure.ac:218: -1- AC_LIBTOOL_LANG_GCJ_CONFIG +m4trace:configure.ac:218: -1- _LT_AC_LANG_GCJ_CONFIG([GCJ]) +m4trace:configure.ac:218: -1- _m4_warn([obsolete], [The macro `AC_LANG_SAVE' is obsolete. You should run autoupdate.], [../../lib/autoconf/lang.m4:167: AC_LANG_SAVE is expanded from... /build/toolchain/lin32/libtool-1.5.22/share/aclocal/libtool.m4:4018: _LT_AC_LANG_GCJ_CONFIG is expanded from... /build/toolchain/lin32/libtool-1.5.22/share/aclocal/libtool.m4:4017: AC_LIBTOOL_LANG_GCJ_CONFIG is expanded from... @@ -8457,512 +8481,512 @@ /build/toolchain/lin32/libtool-1.5.22/share/aclocal/libtool.m4:80: AC_LIBTOOL_SETUP is expanded from... /build/toolchain/lin32/libtool-1.5.22/share/aclocal/libtool.m4:60: _AC_PROG_LIBTOOL is expanded from... /build/toolchain/lin32/libtool-1.5.22/share/aclocal/libtool.m4:25: AC_PROG_LIBTOOL is expanded from... -configure.ac:115: the top level]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([objext], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_SYS_COMPILER -m4trace:configure.ac:115: -1- _LT_COMPILER_BOILERPLATE -m4trace:configure.ac:115: -1- _LT_LINKER_BOILERPLATE -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([compiler], [GCJ]) -m4trace:configure.ac:115: -1- _LT_CC_BASENAME([$compiler]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- AC_LIBTOOL_PROG_COMPILER_NO_RTTI([GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [GCJ]) -m4trace:configure.ac:115: -1- AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], [lt_cv_prog_compiler_rtti_exceptions], [-fno-rtti -fno-exceptions], [], [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, GCJ)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, GCJ) -fno-rtti -fno-exceptions"]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [GCJ]) -m4trace:configure.ac:115: -1- AC_LIBTOOL_PROG_COMPILER_PIC([GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_can_build_shared], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_can_build_shared], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_can_build_shared], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) -m4trace:configure.ac:115: -2- _LT_AC_TAGVAR([lt_prog_compiler_pic_works], [GCJ]) -m4trace:configure.ac:115: -1- AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, GCJ) works], [lt_prog_compiler_pic_works_GCJ], [$_LT_AC_TAGVAR(lt_prog_compiler_pic, GCJ)ifelse([GCJ],[],[ -DPIC],[ifelse([GCJ],[CXX],[ -DPIC],[])])], [], [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, GCJ) in +configure.ac:218: the top level]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([objext], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_SYS_COMPILER +m4trace:configure.ac:218: -1- _LT_COMPILER_BOILERPLATE +m4trace:configure.ac:218: -1- _LT_LINKER_BOILERPLATE +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([compiler], [GCJ]) +m4trace:configure.ac:218: -1- _LT_CC_BASENAME([$compiler]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- AC_LIBTOOL_PROG_COMPILER_NO_RTTI([GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [GCJ]) +m4trace:configure.ac:218: -1- AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], [lt_cv_prog_compiler_rtti_exceptions], [-fno-rtti -fno-exceptions], [], [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, GCJ)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, GCJ) -fno-rtti -fno-exceptions"]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [GCJ]) +m4trace:configure.ac:218: -1- AC_LIBTOOL_PROG_COMPILER_PIC([GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_can_build_shared], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_can_build_shared], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_can_build_shared], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) +m4trace:configure.ac:218: -2- _LT_AC_TAGVAR([lt_prog_compiler_pic_works], [GCJ]) +m4trace:configure.ac:218: -1- AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, GCJ) works], [lt_prog_compiler_pic_works_GCJ], [$_LT_AC_TAGVAR(lt_prog_compiler_pic, GCJ)ifelse([GCJ],[],[ -DPIC],[ifelse([GCJ],[CXX],[ -DPIC],[])])], [], [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, GCJ) in "" | " "*) ;; *) _LT_AC_TAGVAR(lt_prog_compiler_pic, GCJ)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, GCJ)" ;; esac], [_LT_AC_TAGVAR(lt_prog_compiler_pic, GCJ)= _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, GCJ)=no]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_can_build_shared], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ]) -m4trace:configure.ac:115: -2- _LT_AC_TAGVAR([lt_prog_compiler_static_works], [GCJ]) -m4trace:configure.ac:115: -1- AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], [lt_prog_compiler_static_works_GCJ], [$lt_tmp_static_flag], [], [_LT_AC_TAGVAR(lt_prog_compiler_static, GCJ)=]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ]) -m4trace:configure.ac:115: -1- AC_LIBTOOL_PROG_CC_C_O([GCJ]) -m4trace:configure.ac:115: -3- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [GCJ]) -m4trace:configure.ac:115: -3- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [GCJ]) -m4trace:configure.ac:115: -1- AC_LIBTOOL_SYS_HARD_LINK_LOCKS([GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [GCJ]) -m4trace:configure.ac:115: -1- AC_LIBTOOL_PROG_LD_SHLIBS([GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_From_new_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([thread_safe_flag_spec], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_minus_L], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([link_all_deplibs], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_automatic], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([module_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([module_expsym_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([always_export_symbols], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_symbols_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([include_expsyms], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([exclude_expsyms], [GCJ]) -m4trace:configure.ac:115: -1- _LT_CC_BASENAME([$compiler]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_minus_L], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([always_export_symbols], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_symbols_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([always_export_symbols], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_minus_L], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_symbols_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_symbols_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([link_all_deplibs], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_minus_L], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([always_export_symbols], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_SYS_LIBPATH_AIX -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_SYS_LIBPATH_AIX -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([no_undefined_flag], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_minus_L], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_From_new_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([fix_srcfile_path], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_automatic], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([link_all_deplibs], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([module_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([module_expsym_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([module_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([module_expsym_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_minus_L], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_minus_L], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_minus_L], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_minus_L], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([link_all_deplibs], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_minus_L], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_From_new_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([no_undefined_flag], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([link_all_deplibs], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_minus_L], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([reload_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([no_undefined_flag], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([no_undefined_flag], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([link_all_deplibs], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ]) -m4trace:configure.ac:115: -2- _LT_AC_TAGVAR([archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [GCJ]) -m4trace:configure.ac:115: -1- AC_LIBTOOL_SYS_DYNAMIC_LINKER([GCJ]) -m4trace:configure.ac:115: -1- AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_action], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([runpath_var], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_automatic], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_minus_L], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_action], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_action], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_action], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_action], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_action], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_action], [GCJ]) -m4trace:configure.ac:115: -1- AC_LIBTOOL_CONFIG([GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([compiler], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([CC], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([LD], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([thread_safe_flag_spec], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_from_new_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([predep_objects], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([postdep_objects], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([predeps], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([postdeps], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([compiler_lib_search_path], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([postinstall_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([postuninstall_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([no_undefined_flag], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_symbols_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_automatic], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([module_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([module_expsym_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([exclude_expsyms], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([include_expsyms], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_from_new_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([module_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([module_expsym_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_symbols_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([compiler], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([GCC], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([LD], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([thread_safe_flag_spec], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_from_new_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([module_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([module_expsym_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([predep_objects], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([postdep_objects], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([predeps], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([postdeps], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([compiler_lib_search_path], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([no_undefined_flag], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_action], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_minus_L], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_automatic], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([link_all_deplibs], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([fix_srcfile_path], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([always_export_symbols], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_symbols_cmds], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([exclude_expsyms], [GCJ]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([include_expsyms], [GCJ]) -m4trace:configure.ac:115: -1- _m4_warn([obsolete], [The macro `AC_LANG_RESTORE' is obsolete. +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_can_build_shared], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ]) +m4trace:configure.ac:218: -2- _LT_AC_TAGVAR([lt_prog_compiler_static_works], [GCJ]) +m4trace:configure.ac:218: -1- AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], [lt_prog_compiler_static_works_GCJ], [$lt_tmp_static_flag], [], [_LT_AC_TAGVAR(lt_prog_compiler_static, GCJ)=]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ]) +m4trace:configure.ac:218: -1- AC_LIBTOOL_PROG_CC_C_O([GCJ]) +m4trace:configure.ac:218: -3- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [GCJ]) +m4trace:configure.ac:218: -3- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [GCJ]) +m4trace:configure.ac:218: -1- AC_LIBTOOL_SYS_HARD_LINK_LOCKS([GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [GCJ]) +m4trace:configure.ac:218: -1- AC_LIBTOOL_PROG_LD_SHLIBS([GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_From_new_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([thread_safe_flag_spec], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_minus_L], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([link_all_deplibs], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_automatic], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([module_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([module_expsym_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([always_export_symbols], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_symbols_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([include_expsyms], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([exclude_expsyms], [GCJ]) +m4trace:configure.ac:218: -1- _LT_CC_BASENAME([$compiler]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_minus_L], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([always_export_symbols], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_symbols_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([always_export_symbols], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_minus_L], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_symbols_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_symbols_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([link_all_deplibs], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_minus_L], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([always_export_symbols], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_SYS_LIBPATH_AIX +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_SYS_LIBPATH_AIX +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([no_undefined_flag], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_minus_L], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_From_new_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([fix_srcfile_path], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_automatic], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([link_all_deplibs], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([module_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([module_expsym_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([module_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([module_expsym_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_minus_L], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_minus_L], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_minus_L], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_minus_L], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([link_all_deplibs], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_minus_L], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_From_new_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([no_undefined_flag], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([link_all_deplibs], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_minus_L], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([reload_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([no_undefined_flag], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([no_undefined_flag], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([link_all_deplibs], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([ld_shlibs], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ]) +m4trace:configure.ac:218: -2- _LT_AC_TAGVAR([archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [GCJ]) +m4trace:configure.ac:218: -1- AC_LIBTOOL_SYS_DYNAMIC_LINKER([GCJ]) +m4trace:configure.ac:218: -1- AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_action], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([runpath_var], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_automatic], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_minus_L], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_action], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_action], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_action], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_action], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_action], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_action], [GCJ]) +m4trace:configure.ac:218: -1- AC_LIBTOOL_CONFIG([GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([compiler], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([CC], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([LD], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([thread_safe_flag_spec], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_from_new_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([predep_objects], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([postdep_objects], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([predeps], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([postdeps], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([compiler_lib_search_path], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([postinstall_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([postuninstall_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([no_undefined_flag], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_symbols_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_automatic], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([module_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([module_expsym_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([exclude_expsyms], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([include_expsyms], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_from_new_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([module_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([module_expsym_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_symbols_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([compiler], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([GCC], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([LD], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([thread_safe_flag_spec], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_from_new_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([module_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([module_expsym_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([predep_objects], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([postdep_objects], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([predeps], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([postdeps], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([compiler_lib_search_path], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([no_undefined_flag], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_action], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_minus_L], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_automatic], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([link_all_deplibs], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([fix_srcfile_path], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([always_export_symbols], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_symbols_cmds], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([exclude_expsyms], [GCJ]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([include_expsyms], [GCJ]) +m4trace:configure.ac:218: -1- _m4_warn([obsolete], [The macro `AC_LANG_RESTORE' is obsolete. You should run autoupdate.], [../../lib/autoconf/lang.m4:176: AC_LANG_RESTORE is expanded from... /build/toolchain/lin32/libtool-1.5.22/share/aclocal/libtool.m4:4018: _LT_AC_LANG_GCJ_CONFIG is expanded from... /build/toolchain/lin32/libtool-1.5.22/share/aclocal/libtool.m4:4017: AC_LIBTOOL_LANG_GCJ_CONFIG is expanded from... @@ -8970,10 +8994,10 @@ /build/toolchain/lin32/libtool-1.5.22/share/aclocal/libtool.m4:80: AC_LIBTOOL_SETUP is expanded from... /build/toolchain/lin32/libtool-1.5.22/share/aclocal/libtool.m4:60: _AC_PROG_LIBTOOL is expanded from... /build/toolchain/lin32/libtool-1.5.22/share/aclocal/libtool.m4:25: AC_PROG_LIBTOOL is expanded from... -configure.ac:115: the top level]) -m4trace:configure.ac:115: -1- AC_LIBTOOL_LANG_RC_CONFIG -m4trace:configure.ac:115: -1- _LT_AC_LANG_RC_CONFIG([RC]) -m4trace:configure.ac:115: -1- _m4_warn([obsolete], [The macro `AC_LANG_SAVE' is obsolete. +configure.ac:218: the top level]) +m4trace:configure.ac:218: -1- AC_LIBTOOL_LANG_RC_CONFIG +m4trace:configure.ac:218: -1- _LT_AC_LANG_RC_CONFIG([RC]) +m4trace:configure.ac:218: -1- _m4_warn([obsolete], [The macro `AC_LANG_SAVE' is obsolete. You should run autoupdate.], [../../lib/autoconf/lang.m4:167: AC_LANG_SAVE is expanded from... /build/toolchain/lin32/libtool-1.5.22/share/aclocal/libtool.m4:4078: _LT_AC_LANG_RC_CONFIG is expanded from... /build/toolchain/lin32/libtool-1.5.22/share/aclocal/libtool.m4:4077: AC_LIBTOOL_LANG_RC_CONFIG is expanded from... @@ -8981,100 +9005,100 @@ /build/toolchain/lin32/libtool-1.5.22/share/aclocal/libtool.m4:80: AC_LIBTOOL_SETUP is expanded from... /build/toolchain/lin32/libtool-1.5.22/share/aclocal/libtool.m4:60: _AC_PROG_LIBTOOL is expanded from... /build/toolchain/lin32/libtool-1.5.22/share/aclocal/libtool.m4:25: AC_PROG_LIBTOOL is expanded from... -configure.ac:115: the top level]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([objext], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_SYS_COMPILER -m4trace:configure.ac:115: -1- _LT_COMPILER_BOILERPLATE -m4trace:configure.ac:115: -1- _LT_LINKER_BOILERPLATE -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([compiler], [RC]) -m4trace:configure.ac:115: -1- _LT_CC_BASENAME([$compiler]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [RC]) -m4trace:configure.ac:115: -1- AC_LIBTOOL_CONFIG([RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([compiler], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([CC], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([LD], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([thread_safe_flag_spec], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_cmds], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_from_new_cmds], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([predep_objects], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([postdep_objects], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([predeps], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([postdeps], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([compiler_lib_search_path], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([postinstall_cmds], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([postuninstall_cmds], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([no_undefined_flag], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_symbols_cmds], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_automatic], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([module_cmds], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([module_expsym_cmds], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([exclude_expsyms], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([include_expsyms], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_cmds], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_from_new_cmds], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([module_cmds], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([module_expsym_cmds], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_symbols_cmds], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([compiler], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([GCC], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([LD], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([thread_safe_flag_spec], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_cmds], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_from_new_cmds], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_cmds], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([module_cmds], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([module_expsym_cmds], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([predep_objects], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([postdep_objects], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([predeps], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([postdeps], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([compiler_lib_search_path], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([allow_undefined_flag], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([no_undefined_flag], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_action], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_direct], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_minus_L], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([hardcode_automatic], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([link_all_deplibs], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([fix_srcfile_path], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([always_export_symbols], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([export_symbols_cmds], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([exclude_expsyms], [RC]) -m4trace:configure.ac:115: -1- _LT_AC_TAGVAR([include_expsyms], [RC]) -m4trace:configure.ac:115: -1- _m4_warn([obsolete], [The macro `AC_LANG_RESTORE' is obsolete. +configure.ac:218: the top level]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([objext], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_SYS_COMPILER +m4trace:configure.ac:218: -1- _LT_COMPILER_BOILERPLATE +m4trace:configure.ac:218: -1- _LT_LINKER_BOILERPLATE +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([compiler], [RC]) +m4trace:configure.ac:218: -1- _LT_CC_BASENAME([$compiler]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [RC]) +m4trace:configure.ac:218: -1- AC_LIBTOOL_CONFIG([RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([compiler], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([CC], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([LD], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([thread_safe_flag_spec], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_cmds], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_from_new_cmds], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([predep_objects], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([postdep_objects], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([predeps], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([postdeps], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([compiler_lib_search_path], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([postinstall_cmds], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([postuninstall_cmds], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([no_undefined_flag], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_symbols_cmds], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_automatic], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([module_cmds], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([module_expsym_cmds], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([exclude_expsyms], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([include_expsyms], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_cmds], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_from_new_cmds], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([module_cmds], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([module_expsym_cmds], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_symbols_cmds], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds_need_lc], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([enable_shared_with_static_runtimes], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([compiler], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([GCC], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([LD], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_wl], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_pic], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_cv_prog_compiler_c_o], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_static], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([lt_prog_compiler_no_builtin_flag], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_dynamic_flag_spec], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([whole_archive_flag_spec], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([thread_safe_flag_spec], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_cmds], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_from_new_cmds], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([old_archive_from_expsyms_cmds], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_cmds], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([archive_expsym_cmds], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([module_cmds], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([module_expsym_cmds], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([predep_objects], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([postdep_objects], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([predeps], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([postdeps], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([compiler_lib_search_path], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([allow_undefined_flag], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([no_undefined_flag], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_action], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_flag_spec_ld], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_libdir_separator], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_direct], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_minus_L], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_shlibpath_var], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([hardcode_automatic], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([link_all_deplibs], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([fix_srcfile_path], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([always_export_symbols], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([export_symbols_cmds], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([exclude_expsyms], [RC]) +m4trace:configure.ac:218: -1- _LT_AC_TAGVAR([include_expsyms], [RC]) +m4trace:configure.ac:218: -1- _m4_warn([obsolete], [The macro `AC_LANG_RESTORE' is obsolete. You should run autoupdate.], [../../lib/autoconf/lang.m4:176: AC_LANG_RESTORE is expanded from... /build/toolchain/lin32/libtool-1.5.22/share/aclocal/libtool.m4:4078: _LT_AC_LANG_RC_CONFIG is expanded from... /build/toolchain/lin32/libtool-1.5.22/share/aclocal/libtool.m4:4077: AC_LIBTOOL_LANG_RC_CONFIG is expanded from... @@ -9082,93 +9106,141 @@ /build/toolchain/lin32/libtool-1.5.22/share/aclocal/libtool.m4:80: AC_LIBTOOL_SETUP is expanded from... /build/toolchain/lin32/libtool-1.5.22/share/aclocal/libtool.m4:60: _AC_PROG_LIBTOOL is expanded from... /build/toolchain/lin32/libtool-1.5.22/share/aclocal/libtool.m4:25: AC_PROG_LIBTOOL is expanded from... -configure.ac:115: the top level]) -m4trace:configure.ac:115: -1- m4_pattern_allow([^LIBTOOL$]) -m4trace:configure.ac:115: -1- AC_LIBTOOL_CXX -m4trace:configure.ac:115: -1- _LT_AC_LANG_CXX -m4trace:configure.ac:115: -1- _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX]) -m4trace:configure.ac:115: -1- AC_LIBTOOL_F77 -m4trace:configure.ac:115: -1- _LT_AC_LANG_F77 -m4trace:configure.ac:115: -1- _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77]) -m4trace:configure.ac:117: -1- m4_pattern_allow([^HAVE_PKG_CONFIG$]) -m4trace:configure.ac:131: -1- m4_pattern_allow([^XMKMF$]) -m4trace:configure.ac:131: -1- m4_pattern_allow([^X_DISPLAY_MISSING$]) -m4trace:configure.ac:131: -1- m4_pattern_allow([^X_CFLAGS$]) -m4trace:configure.ac:131: -1- m4_pattern_allow([^X_PRE_LIBS$]) -m4trace:configure.ac:131: -1- m4_pattern_allow([^X_LIBS$]) -m4trace:configure.ac:131: -1- m4_pattern_allow([^X_EXTRA_LIBS$]) -m4trace:configure.ac:287: -1- m4_pattern_allow([^DNET_CONFIG$]) -m4trace:configure.ac:348: -1- m4_pattern_allow([^HAVE__BOOL$]) -m4trace:configure.ac:348: -1- m4_pattern_allow([^HAVE_STDBOOL_H$]) -m4trace:configure.ac:349: -1- m4_pattern_allow([^const$]) -m4trace:configure.ac:350: -1- m4_pattern_allow([^uid_t$]) -m4trace:configure.ac:350: -1- m4_pattern_allow([^gid_t$]) -m4trace:configure.ac:352: -1- m4_pattern_allow([^mode_t$]) -m4trace:configure.ac:353: -1- m4_pattern_allow([^off_t$]) -m4trace:configure.ac:354: -1- m4_pattern_allow([^pid_t$]) -m4trace:configure.ac:355: -1- m4_pattern_allow([^size_t$]) -m4trace:configure.ac:356: -1- m4_pattern_allow([^HAVE_STRUCT_STAT_ST_RDEV$]) -m4trace:configure.ac:357: -1- m4_pattern_allow([^TIME_WITH_SYS_TIME$]) -m4trace:configure.ac:358: -1- m4_pattern_allow([^TM_IN_SYS_TIME$]) -m4trace:configure.ac:359: -1- m4_pattern_allow([^volatile$]) -m4trace:configure.ac:372: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete. +configure.ac:218: the top level]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^LIBTOOL$]) +m4trace:configure.ac:218: -1- AC_LIBTOOL_CXX +m4trace:configure.ac:218: -1- _LT_AC_LANG_CXX +m4trace:configure.ac:218: -1- _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}CXX]) +m4trace:configure.ac:218: -1- AC_LIBTOOL_F77 +m4trace:configure.ac:218: -1- _LT_AC_LANG_F77 +m4trace:configure.ac:218: -1- _LT_AC_SHELL_INIT([tagnames=${tagnames+${tagnames},}F77]) +m4trace:configure.ac:224: -1- m4_pattern_allow([^HAVE_PKG_CONFIG$]) +m4trace:configure.ac:238: -1- m4_pattern_allow([^XMKMF$]) +m4trace:configure.ac:238: -1- m4_pattern_allow([^X_DISPLAY_MISSING$]) +m4trace:configure.ac:238: -1- m4_pattern_allow([^X_CFLAGS$]) +m4trace:configure.ac:238: -1- m4_pattern_allow([^X_PRE_LIBS$]) +m4trace:configure.ac:238: -1- m4_pattern_allow([^X_LIBS$]) +m4trace:configure.ac:238: -1- m4_pattern_allow([^X_EXTRA_LIBS$]) +m4trace:configure.ac:366: -1- m4_pattern_allow([^LIBPNG_CONFIG$]) +m4trace:configure.ac:604: -1- m4_pattern_allow([^NO_PROCPS$]) +m4trace:configure.ac:618: -1- m4_pattern_allow([^DNET_CONFIG$]) +m4trace:configure.ac:629: -1- m4_pattern_allow([^DNET_IS_DUMBNET$]) +m4trace:configure.ac:638: -1- m4_pattern_allow([^NO_DNET$]) +m4trace:configure.ac:649: -1- m4_pattern_allow([^ICU_CONFIG$]) +m4trace:configure.ac:684: -1- m4_pattern_allow([^HAVE_CXX$]) +m4trace:configure.ac:710: -1- m4_pattern_allow([^RPCGEN$]) +m4trace:configure.ac:759: -1- m4_pattern_allow([^HAVE__BOOL$]) +m4trace:configure.ac:759: -1- m4_pattern_allow([^HAVE_STDBOOL_H$]) +m4trace:configure.ac:760: -1- m4_pattern_allow([^const$]) +m4trace:configure.ac:761: -1- m4_pattern_allow([^uid_t$]) +m4trace:configure.ac:761: -1- m4_pattern_allow([^gid_t$]) +m4trace:configure.ac:763: -1- m4_pattern_allow([^mode_t$]) +m4trace:configure.ac:764: -1- m4_pattern_allow([^off_t$]) +m4trace:configure.ac:765: -1- m4_pattern_allow([^pid_t$]) +m4trace:configure.ac:766: -1- m4_pattern_allow([^size_t$]) +m4trace:configure.ac:767: -1- m4_pattern_allow([^HAVE_STRUCT_STAT_ST_RDEV$]) +m4trace:configure.ac:768: -1- m4_pattern_allow([^TIME_WITH_SYS_TIME$]) +m4trace:configure.ac:769: -1- m4_pattern_allow([^TM_IN_SYS_TIME$]) +m4trace:configure.ac:770: -1- m4_pattern_allow([^volatile$]) +m4trace:configure.ac:780: -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:372: the top level]) -m4trace:configure.ac:389: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete. +configure.ac:780: the top level]) +m4trace:configure.ac:798: -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:389: the top level]) -m4trace:configure.ac:415: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete. +configure.ac:798: the top level]) +m4trace:configure.ac:825: -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:415: the top level]) -m4trace:configure.ac:436: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete. +configure.ac:825: the top level]) +m4trace:configure.ac:848: -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:436: the top level]) -m4trace:configure.ac:508: -1- AM_CONDITIONAL([BUILD_HGFSMOUNTER], [test "$buildHgfsmounter" = "yes"]) -m4trace:configure.ac:508: -1- m4_pattern_allow([^BUILD_HGFSMOUNTER_TRUE$]) -m4trace:configure.ac:508: -1- m4_pattern_allow([^BUILD_HGFSMOUNTER_FALSE$]) -m4trace:configure.ac:508: -1- _AM_SUBST_NOTMAKE([BUILD_HGFSMOUNTER_TRUE]) -m4trace:configure.ac:508: -1- _AM_SUBST_NOTMAKE([BUILD_HGFSMOUNTER_FALSE]) -m4trace:configure.ac:509: -1- AM_CONDITIONAL([LINUX], [test "$os" = "linux"]) -m4trace:configure.ac:509: -1- m4_pattern_allow([^LINUX_TRUE$]) -m4trace:configure.ac:509: -1- m4_pattern_allow([^LINUX_FALSE$]) -m4trace:configure.ac:509: -1- _AM_SUBST_NOTMAKE([LINUX_TRUE]) -m4trace:configure.ac:509: -1- _AM_SUBST_NOTMAKE([LINUX_FALSE]) -m4trace:configure.ac:510: -1- AM_CONDITIONAL([SOLARIS], [test "$os" = "solaris"]) -m4trace:configure.ac:510: -1- m4_pattern_allow([^SOLARIS_TRUE$]) -m4trace:configure.ac:510: -1- m4_pattern_allow([^SOLARIS_FALSE$]) -m4trace:configure.ac:510: -1- _AM_SUBST_NOTMAKE([SOLARIS_TRUE]) -m4trace:configure.ac:510: -1- _AM_SUBST_NOTMAKE([SOLARIS_FALSE]) -m4trace:configure.ac:511: -1- AM_CONDITIONAL([THIRTY_TWO_BIT_USERSPACE], [test "$userSpaceBitness" = "32"]) -m4trace:configure.ac:511: -1- m4_pattern_allow([^THIRTY_TWO_BIT_USERSPACE_TRUE$]) -m4trace:configure.ac:511: -1- m4_pattern_allow([^THIRTY_TWO_BIT_USERSPACE_FALSE$]) -m4trace:configure.ac:511: -1- _AM_SUBST_NOTMAKE([THIRTY_TWO_BIT_USERSPACE_TRUE]) -m4trace:configure.ac:511: -1- _AM_SUBST_NOTMAKE([THIRTY_TWO_BIT_USERSPACE_FALSE]) -m4trace:configure.ac:512: -1- AM_CONDITIONAL([HAVE_X11], [test "$have_x" = "yes"]) -m4trace:configure.ac:512: -1- m4_pattern_allow([^HAVE_X11_TRUE$]) -m4trace:configure.ac:512: -1- m4_pattern_allow([^HAVE_X11_FALSE$]) -m4trace:configure.ac:512: -1- _AM_SUBST_NOTMAKE([HAVE_X11_TRUE]) -m4trace:configure.ac:512: -1- _AM_SUBST_NOTMAKE([HAVE_X11_FALSE]) -m4trace:configure.ac:521: -1- m4_pattern_allow([^NO_MULTIMON$]) -m4trace:configure.ac:551: -1- m4_pattern_allow([^MODULES_OS$]) -m4trace:configure.ac:552: -1- m4_pattern_allow([^MODULES$]) -m4trace:configure.ac:553: -1- m4_pattern_allow([^COMMON_CFLAGS$]) -m4trace:configure.ac:554: -1- m4_pattern_allow([^COMMON_PROG_CFLAGS$]) -m4trace:configure.ac:555: -1- m4_pattern_allow([^COMMON_XLIBS$]) -m4trace:configure.ac:556: -1- m4_pattern_allow([^GTK_CFLAGS$]) -m4trace:configure.ac:557: -1- m4_pattern_allow([^GTK_LIBS$]) -m4trace:configure.ac:558: -1- m4_pattern_allow([^DNET_CFLAGS$]) -m4trace:configure.ac:559: -1- m4_pattern_allow([^DNET_LIBS$]) -m4trace:configure.ac:563: -1- m4_pattern_allow([^LIB_AUTH_CFLAGS$]) -m4trace:configure.ac:564: -1- m4_pattern_allow([^LIB_FILE_CFLAGS$]) -m4trace:configure.ac:565: -1- m4_pattern_allow([^LIB_HGFS_SERVER_CFLAGS$]) -m4trace:configure.ac:566: -1- m4_pattern_allow([^LIB_IMPERSONATE_CFLAGS$]) -m4trace:configure.ac:567: -1- m4_pattern_allow([^LIB_MISC_CFLAGS$]) -m4trace:configure.ac:568: -1- m4_pattern_allow([^LIB_PROC_MGR_CFLAGS$]) -m4trace:configure.ac:569: -1- m4_pattern_allow([^LIB_STRING_CFLAGS$]) -m4trace:configure.ac:570: -1- m4_pattern_allow([^LIB_USER_CFLAGS$]) -m4trace:configure.ac:574: -1- m4_pattern_allow([^GUESTD_LDFLAGS$]) -m4trace:configure.ac:576: -1- m4_pattern_allow([^VMWARE_USER_CFLAGS$]) -m4trace:configure.ac:577: -1- m4_pattern_allow([^VMWARE_USER_LDFLAGS$]) -m4trace:configure.ac:651: -1- m4_pattern_allow([^LIB@&t@OBJS$]) -m4trace:configure.ac:651: -1- m4_pattern_allow([^LTLIBOBJS$]) -m4trace:configure.ac:651: -1- _AM_OUTPUT_DEPENDENCY_COMMANDS +configure.ac:848: the top level]) +m4trace:configure.ac:932: -1- AM_CONDITIONAL([BUILD_HGFSMOUNTER], [test "$buildHgfsmounter" = "yes"]) +m4trace:configure.ac:932: -1- m4_pattern_allow([^BUILD_HGFSMOUNTER_TRUE$]) +m4trace:configure.ac:932: -1- m4_pattern_allow([^BUILD_HGFSMOUNTER_FALSE$]) +m4trace:configure.ac:932: -1- _AM_SUBST_NOTMAKE([BUILD_HGFSMOUNTER_TRUE]) +m4trace:configure.ac:932: -1- _AM_SUBST_NOTMAKE([BUILD_HGFSMOUNTER_FALSE]) +m4trace:configure.ac:933: -1- AM_CONDITIONAL([LINUX], [test "$os" = "linux"]) +m4trace:configure.ac:933: -1- m4_pattern_allow([^LINUX_TRUE$]) +m4trace:configure.ac:933: -1- m4_pattern_allow([^LINUX_FALSE$]) +m4trace:configure.ac:933: -1- _AM_SUBST_NOTMAKE([LINUX_TRUE]) +m4trace:configure.ac:933: -1- _AM_SUBST_NOTMAKE([LINUX_FALSE]) +m4trace:configure.ac:934: -1- AM_CONDITIONAL([SOLARIS], [test "$os" = "solaris"]) +m4trace:configure.ac:934: -1- m4_pattern_allow([^SOLARIS_TRUE$]) +m4trace:configure.ac:934: -1- m4_pattern_allow([^SOLARIS_FALSE$]) +m4trace:configure.ac:934: -1- _AM_SUBST_NOTMAKE([SOLARIS_TRUE]) +m4trace:configure.ac:934: -1- _AM_SUBST_NOTMAKE([SOLARIS_FALSE]) +m4trace:configure.ac:935: -1- AM_CONDITIONAL([FREEBSD], [test "$os" = "freebsd"]) +m4trace:configure.ac:935: -1- m4_pattern_allow([^FREEBSD_TRUE$]) +m4trace:configure.ac:935: -1- m4_pattern_allow([^FREEBSD_FALSE$]) +m4trace:configure.ac:935: -1- _AM_SUBST_NOTMAKE([FREEBSD_TRUE]) +m4trace:configure.ac:935: -1- _AM_SUBST_NOTMAKE([FREEBSD_FALSE]) +m4trace:configure.ac:936: -1- AM_CONDITIONAL([THIRTY_TWO_BIT_USERSPACE], [test "$userSpaceBitness" = "32"]) +m4trace:configure.ac:936: -1- m4_pattern_allow([^THIRTY_TWO_BIT_USERSPACE_TRUE$]) +m4trace:configure.ac:936: -1- m4_pattern_allow([^THIRTY_TWO_BIT_USERSPACE_FALSE$]) +m4trace:configure.ac:936: -1- _AM_SUBST_NOTMAKE([THIRTY_TWO_BIT_USERSPACE_TRUE]) +m4trace:configure.ac:936: -1- _AM_SUBST_NOTMAKE([THIRTY_TWO_BIT_USERSPACE_FALSE]) +m4trace:configure.ac:937: -1- AM_CONDITIONAL([HAVE_X11], [test "$have_x" = "yes"]) +m4trace:configure.ac:937: -1- m4_pattern_allow([^HAVE_X11_TRUE$]) +m4trace:configure.ac:937: -1- m4_pattern_allow([^HAVE_X11_FALSE$]) +m4trace:configure.ac:937: -1- _AM_SUBST_NOTMAKE([HAVE_X11_TRUE]) +m4trace:configure.ac:937: -1- _AM_SUBST_NOTMAKE([HAVE_X11_FALSE]) +m4trace:configure.ac:938: -1- AM_CONDITIONAL([HAVE_ICU], [test "$with_icu" = "yes"]) +m4trace:configure.ac:938: -1- m4_pattern_allow([^HAVE_ICU_TRUE$]) +m4trace:configure.ac:938: -1- m4_pattern_allow([^HAVE_ICU_FALSE$]) +m4trace:configure.ac:938: -1- _AM_SUBST_NOTMAKE([HAVE_ICU_TRUE]) +m4trace:configure.ac:938: -1- _AM_SUBST_NOTMAKE([HAVE_ICU_FALSE]) +m4trace:configure.ac:939: -1- AM_CONDITIONAL([WITH_KERNEL_MODULES], [test "$with_kernel_modules" = "yes"]) +m4trace:configure.ac:939: -1- m4_pattern_allow([^WITH_KERNEL_MODULES_TRUE$]) +m4trace:configure.ac:939: -1- m4_pattern_allow([^WITH_KERNEL_MODULES_FALSE$]) +m4trace:configure.ac:939: -1- _AM_SUBST_NOTMAKE([WITH_KERNEL_MODULES_TRUE]) +m4trace:configure.ac:939: -1- _AM_SUBST_NOTMAKE([WITH_KERNEL_MODULES_FALSE]) +m4trace:configure.ac:940: -1- AM_CONDITIONAL([PAMD], [test -d /etc/pam.d]) +m4trace:configure.ac:940: -1- m4_pattern_allow([^PAMD_TRUE$]) +m4trace:configure.ac:940: -1- m4_pattern_allow([^PAMD_FALSE$]) +m4trace:configure.ac:940: -1- _AM_SUBST_NOTMAKE([PAMD_TRUE]) +m4trace:configure.ac:940: -1- _AM_SUBST_NOTMAKE([PAMD_FALSE]) +m4trace:configure.ac:941: -1- AM_CONDITIONAL([ENABLE_UNITY], [test "$enable_unity" = "yes"]) +m4trace:configure.ac:941: -1- m4_pattern_allow([^ENABLE_UNITY_TRUE$]) +m4trace:configure.ac:941: -1- m4_pattern_allow([^ENABLE_UNITY_FALSE$]) +m4trace:configure.ac:941: -1- _AM_SUBST_NOTMAKE([ENABLE_UNITY_TRUE]) +m4trace:configure.ac:941: -1- _AM_SUBST_NOTMAKE([ENABLE_UNITY_FALSE]) +m4trace:configure.ac:942: -1- AM_CONDITIONAL([WITH_ROOT_PRIVILEGES], [test "$with_root_privileges" = "yes"]) +m4trace:configure.ac:942: -1- m4_pattern_allow([^WITH_ROOT_PRIVILEGES_TRUE$]) +m4trace:configure.ac:942: -1- m4_pattern_allow([^WITH_ROOT_PRIVILEGES_FALSE$]) +m4trace:configure.ac:942: -1- _AM_SUBST_NOTMAKE([WITH_ROOT_PRIVILEGES_TRUE]) +m4trace:configure.ac:942: -1- _AM_SUBST_NOTMAKE([WITH_ROOT_PRIVILEGES_FALSE]) +m4trace:configure.ac:953: -1- m4_pattern_allow([^NO_MULTIMON$]) +m4trace:configure.ac:983: -1- m4_pattern_allow([^TARGET_OS$]) +m4trace:configure.ac:984: -1- m4_pattern_allow([^KERNEL_RELEASE$]) +m4trace:configure.ac:985: -1- m4_pattern_allow([^MODULES_OS$]) +m4trace:configure.ac:986: -1- m4_pattern_allow([^MODULES_DIR$]) +m4trace:configure.ac:987: -1- m4_pattern_allow([^MODULES$]) +m4trace:configure.ac:988: -1- m4_pattern_allow([^COMMON_XLIBS$]) +m4trace:configure.ac:989: -1- m4_pattern_allow([^GTK_CPPFLAGS$]) +m4trace:configure.ac:990: -1- m4_pattern_allow([^GTK_LIBS$]) +m4trace:configure.ac:991: -1- m4_pattern_allow([^DNET_CPPFLAGS$]) +m4trace:configure.ac:992: -1- m4_pattern_allow([^DNET_LIBS$]) +m4trace:configure.ac:993: -1- m4_pattern_allow([^PROCPS_LIBS$]) +m4trace:configure.ac:994: -1- m4_pattern_allow([^ICU_CPPFLAGS$]) +m4trace:configure.ac:995: -1- m4_pattern_allow([^ICU_LIBS$]) +m4trace:configure.ac:996: -1- m4_pattern_allow([^PAM_PREFIX$]) +m4trace:configure.ac:997: -1- m4_pattern_allow([^URIPARSER_CPPFLAGS$]) +m4trace:configure.ac:998: -1- m4_pattern_allow([^URIPARSER_LIBS$]) +m4trace:configure.ac:999: -1- m4_pattern_allow([^LIBPNG_CPPFLAGS$]) +m4trace:configure.ac:1000: -1- m4_pattern_allow([^LIBPNG_LIBS$]) +m4trace:configure.ac:1001: -1- m4_pattern_allow([^ZLIB_CPPFLAGS$]) +m4trace:configure.ac:1002: -1- m4_pattern_allow([^ZLIB_LIBS$]) +m4trace:configure.ac:1006: -1- m4_pattern_allow([^LIB_AUTH_CPPFLAGS$]) +m4trace:configure.ac:1007: -1- m4_pattern_allow([^LIB_FILE_CPPFLAGS$]) +m4trace:configure.ac:1008: -1- m4_pattern_allow([^LIB_HGFS_SERVER_CPPFLAGS$]) +m4trace:configure.ac:1009: -1- m4_pattern_allow([^LIB_IMPERSONATE_CPPFLAGS$]) +m4trace:configure.ac:1010: -1- m4_pattern_allow([^LIB_MISC_CPPFLAGS$]) +m4trace:configure.ac:1011: -1- m4_pattern_allow([^LIB_PROC_MGR_CPPFLAGS$]) +m4trace:configure.ac:1012: -1- m4_pattern_allow([^LIB_STRING_CPPFLAGS$]) +m4trace:configure.ac:1013: -1- m4_pattern_allow([^LIB_USER_CPPFLAGS$]) +m4trace:configure.ac:1017: -1- m4_pattern_allow([^GUESTD_LDADD$]) +m4trace:configure.ac:1019: -1- m4_pattern_allow([^VMWARE_USER_CPPFLAGS$]) +m4trace:configure.ac:1020: -1- m4_pattern_allow([^VMWARE_USER_LDADD$]) +m4trace:configure.ac:1106: -1- m4_pattern_allow([^LIB@&t@OBJS$]) +m4trace:configure.ac:1106: -1- m4_pattern_allow([^LTLIBOBJS$]) +m4trace:configure.ac:1106: -1- _AM_OUTPUT_DEPENDENCY_COMMANDS diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/autom4te.cache/traces.1 /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/autom4te.cache/traces.1 --- open-vm-tools-2008.01.23-74039/autom4te.cache/traces.1 2008-01-28 08:03:00.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/autom4te.cache/traces.1 2008-10-13 08:02:10.000000000 +0100 @@ -1,904 +1,1001 @@ -m4trace:configure.ac:25: -1- AC_INIT([open-vm-tools], [2008.01.23-74039], [open-vm-tools-devel@lists.sourceforge.net]) -m4trace:configure.ac:25: -1- m4_pattern_forbid([^_?A[CHUM]_]) -m4trace:configure.ac:25: -1- m4_pattern_forbid([_AC_]) -m4trace:configure.ac:25: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS']) -m4trace:configure.ac:25: -1- m4_pattern_allow([^AS_FLAGS$]) -m4trace:configure.ac:25: -1- m4_pattern_forbid([^_?m4_]) -m4trace:configure.ac:25: -1- m4_pattern_forbid([^dnl$]) -m4trace:configure.ac:25: -1- m4_pattern_forbid([^_?AS_]) -m4trace:configure.ac:25: -1- AC_SUBST([SHELL], [${CONFIG_SHELL-/bin/sh}]) -m4trace:configure.ac:25: -1- AC_SUBST_TRACE([SHELL]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^SHELL$]) -m4trace:configure.ac:25: -1- AC_SUBST([PATH_SEPARATOR]) -m4trace:configure.ac:25: -1- AC_SUBST_TRACE([PATH_SEPARATOR]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^PATH_SEPARATOR$]) -m4trace:configure.ac:25: -1- AC_SUBST([PACKAGE_NAME], [m4_ifdef([AC_PACKAGE_NAME], ['AC_PACKAGE_NAME'])]) -m4trace:configure.ac:25: -1- AC_SUBST_TRACE([PACKAGE_NAME]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^PACKAGE_NAME$]) -m4trace:configure.ac:25: -1- AC_SUBST([PACKAGE_TARNAME], [m4_ifdef([AC_PACKAGE_TARNAME], ['AC_PACKAGE_TARNAME'])]) -m4trace:configure.ac:25: -1- AC_SUBST_TRACE([PACKAGE_TARNAME]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) -m4trace:configure.ac:25: -1- AC_SUBST([PACKAGE_VERSION], [m4_ifdef([AC_PACKAGE_VERSION], ['AC_PACKAGE_VERSION'])]) -m4trace:configure.ac:25: -1- AC_SUBST_TRACE([PACKAGE_VERSION]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^PACKAGE_VERSION$]) -m4trace:configure.ac:25: -1- AC_SUBST([PACKAGE_STRING], [m4_ifdef([AC_PACKAGE_STRING], ['AC_PACKAGE_STRING'])]) -m4trace:configure.ac:25: -1- AC_SUBST_TRACE([PACKAGE_STRING]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^PACKAGE_STRING$]) -m4trace:configure.ac:25: -1- AC_SUBST([PACKAGE_BUGREPORT], [m4_ifdef([AC_PACKAGE_BUGREPORT], ['AC_PACKAGE_BUGREPORT'])]) -m4trace:configure.ac:25: -1- AC_SUBST_TRACE([PACKAGE_BUGREPORT]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) -m4trace:configure.ac:25: -1- AC_SUBST([exec_prefix], [NONE]) -m4trace:configure.ac:25: -1- AC_SUBST_TRACE([exec_prefix]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^exec_prefix$]) -m4trace:configure.ac:25: -1- AC_SUBST([prefix], [NONE]) -m4trace:configure.ac:25: -1- AC_SUBST_TRACE([prefix]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^prefix$]) -m4trace:configure.ac:25: -1- AC_SUBST([program_transform_name], [s,x,x,]) -m4trace:configure.ac:25: -1- AC_SUBST_TRACE([program_transform_name]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^program_transform_name$]) -m4trace:configure.ac:25: -1- AC_SUBST([bindir], ['${exec_prefix}/bin']) -m4trace:configure.ac:25: -1- AC_SUBST_TRACE([bindir]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^bindir$]) -m4trace:configure.ac:25: -1- AC_SUBST([sbindir], ['${exec_prefix}/sbin']) -m4trace:configure.ac:25: -1- AC_SUBST_TRACE([sbindir]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^sbindir$]) -m4trace:configure.ac:25: -1- AC_SUBST([libexecdir], ['${exec_prefix}/libexec']) -m4trace:configure.ac:25: -1- AC_SUBST_TRACE([libexecdir]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^libexecdir$]) -m4trace:configure.ac:25: -1- AC_SUBST([datarootdir], ['${prefix}/share']) -m4trace:configure.ac:25: -1- AC_SUBST_TRACE([datarootdir]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^datarootdir$]) -m4trace:configure.ac:25: -1- AC_SUBST([datadir], ['${datarootdir}']) -m4trace:configure.ac:25: -1- AC_SUBST_TRACE([datadir]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^datadir$]) -m4trace:configure.ac:25: -1- AC_SUBST([sysconfdir], ['${prefix}/etc']) -m4trace:configure.ac:25: -1- AC_SUBST_TRACE([sysconfdir]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^sysconfdir$]) -m4trace:configure.ac:25: -1- AC_SUBST([sharedstatedir], ['${prefix}/com']) -m4trace:configure.ac:25: -1- AC_SUBST_TRACE([sharedstatedir]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^sharedstatedir$]) -m4trace:configure.ac:25: -1- AC_SUBST([localstatedir], ['${prefix}/var']) -m4trace:configure.ac:25: -1- AC_SUBST_TRACE([localstatedir]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^localstatedir$]) -m4trace:configure.ac:25: -1- AC_SUBST([includedir], ['${prefix}/include']) -m4trace:configure.ac:25: -1- AC_SUBST_TRACE([includedir]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^includedir$]) -m4trace:configure.ac:25: -1- AC_SUBST([oldincludedir], ['/usr/include']) -m4trace:configure.ac:25: -1- AC_SUBST_TRACE([oldincludedir]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^oldincludedir$]) -m4trace:configure.ac:25: -1- AC_SUBST([docdir], [m4_ifset([AC_PACKAGE_TARNAME], +m4trace: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:configure.ac:38: -1- AC_INIT([open-vm-tools], [2008.10.10-123053], [open-vm-tools-devel@lists.sourceforge.net]) +m4trace:configure.ac:38: -1- m4_pattern_forbid([^_?A[CHUM]_]) +m4trace:configure.ac:38: -1- m4_pattern_forbid([_AC_]) +m4trace:configure.ac:38: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS']) +m4trace:configure.ac:38: -1- m4_pattern_allow([^AS_FLAGS$]) +m4trace:configure.ac:38: -1- m4_pattern_forbid([^_?m4_]) +m4trace:configure.ac:38: -1- m4_pattern_forbid([^dnl$]) +m4trace:configure.ac:38: -1- m4_pattern_forbid([^_?AS_]) +m4trace:configure.ac:38: -1- AC_SUBST([SHELL], [${CONFIG_SHELL-/bin/sh}]) +m4trace:configure.ac:38: -1- AC_SUBST_TRACE([SHELL]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^SHELL$]) +m4trace:configure.ac:38: -1- AC_SUBST([PATH_SEPARATOR]) +m4trace:configure.ac:38: -1- AC_SUBST_TRACE([PATH_SEPARATOR]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^PATH_SEPARATOR$]) +m4trace:configure.ac:38: -1- AC_SUBST([PACKAGE_NAME], [m4_ifdef([AC_PACKAGE_NAME], ['AC_PACKAGE_NAME'])]) +m4trace:configure.ac:38: -1- AC_SUBST_TRACE([PACKAGE_NAME]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^PACKAGE_NAME$]) +m4trace:configure.ac:38: -1- AC_SUBST([PACKAGE_TARNAME], [m4_ifdef([AC_PACKAGE_TARNAME], ['AC_PACKAGE_TARNAME'])]) +m4trace:configure.ac:38: -1- AC_SUBST_TRACE([PACKAGE_TARNAME]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) +m4trace:configure.ac:38: -1- AC_SUBST([PACKAGE_VERSION], [m4_ifdef([AC_PACKAGE_VERSION], ['AC_PACKAGE_VERSION'])]) +m4trace:configure.ac:38: -1- AC_SUBST_TRACE([PACKAGE_VERSION]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^PACKAGE_VERSION$]) +m4trace:configure.ac:38: -1- AC_SUBST([PACKAGE_STRING], [m4_ifdef([AC_PACKAGE_STRING], ['AC_PACKAGE_STRING'])]) +m4trace:configure.ac:38: -1- AC_SUBST_TRACE([PACKAGE_STRING]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^PACKAGE_STRING$]) +m4trace:configure.ac:38: -1- AC_SUBST([PACKAGE_BUGREPORT], [m4_ifdef([AC_PACKAGE_BUGREPORT], ['AC_PACKAGE_BUGREPORT'])]) +m4trace:configure.ac:38: -1- AC_SUBST_TRACE([PACKAGE_BUGREPORT]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) +m4trace:configure.ac:38: -1- AC_SUBST([exec_prefix], [NONE]) +m4trace:configure.ac:38: -1- AC_SUBST_TRACE([exec_prefix]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^exec_prefix$]) +m4trace:configure.ac:38: -1- AC_SUBST([prefix], [NONE]) +m4trace:configure.ac:38: -1- AC_SUBST_TRACE([prefix]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^prefix$]) +m4trace:configure.ac:38: -1- AC_SUBST([program_transform_name], [s,x,x,]) +m4trace:configure.ac:38: -1- AC_SUBST_TRACE([program_transform_name]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^program_transform_name$]) +m4trace:configure.ac:38: -1- AC_SUBST([bindir], ['${exec_prefix}/bin']) +m4trace:configure.ac:38: -1- AC_SUBST_TRACE([bindir]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^bindir$]) +m4trace:configure.ac:38: -1- AC_SUBST([sbindir], ['${exec_prefix}/sbin']) +m4trace:configure.ac:38: -1- AC_SUBST_TRACE([sbindir]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^sbindir$]) +m4trace:configure.ac:38: -1- AC_SUBST([libexecdir], ['${exec_prefix}/libexec']) +m4trace:configure.ac:38: -1- AC_SUBST_TRACE([libexecdir]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^libexecdir$]) +m4trace:configure.ac:38: -1- AC_SUBST([datarootdir], ['${prefix}/share']) +m4trace:configure.ac:38: -1- AC_SUBST_TRACE([datarootdir]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^datarootdir$]) +m4trace:configure.ac:38: -1- AC_SUBST([datadir], ['${datarootdir}']) +m4trace:configure.ac:38: -1- AC_SUBST_TRACE([datadir]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^datadir$]) +m4trace:configure.ac:38: -1- AC_SUBST([sysconfdir], ['${prefix}/etc']) +m4trace:configure.ac:38: -1- AC_SUBST_TRACE([sysconfdir]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^sysconfdir$]) +m4trace:configure.ac:38: -1- AC_SUBST([sharedstatedir], ['${prefix}/com']) +m4trace:configure.ac:38: -1- AC_SUBST_TRACE([sharedstatedir]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^sharedstatedir$]) +m4trace:configure.ac:38: -1- AC_SUBST([localstatedir], ['${prefix}/var']) +m4trace:configure.ac:38: -1- AC_SUBST_TRACE([localstatedir]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^localstatedir$]) +m4trace:configure.ac:38: -1- AC_SUBST([includedir], ['${prefix}/include']) +m4trace:configure.ac:38: -1- AC_SUBST_TRACE([includedir]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^includedir$]) +m4trace:configure.ac:38: -1- AC_SUBST([oldincludedir], ['/usr/include']) +m4trace:configure.ac:38: -1- AC_SUBST_TRACE([oldincludedir]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^oldincludedir$]) +m4trace:configure.ac:38: -1- AC_SUBST([docdir], [m4_ifset([AC_PACKAGE_TARNAME], ['${datarootdir}/doc/${PACKAGE_TARNAME}'], ['${datarootdir}/doc/${PACKAGE}'])]) -m4trace:configure.ac:25: -1- AC_SUBST_TRACE([docdir]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^docdir$]) -m4trace:configure.ac:25: -1- AC_SUBST([infodir], ['${datarootdir}/info']) -m4trace:configure.ac:25: -1- AC_SUBST_TRACE([infodir]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^infodir$]) -m4trace:configure.ac:25: -1- AC_SUBST([htmldir], ['${docdir}']) -m4trace:configure.ac:25: -1- AC_SUBST_TRACE([htmldir]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^htmldir$]) -m4trace:configure.ac:25: -1- AC_SUBST([dvidir], ['${docdir}']) -m4trace:configure.ac:25: -1- AC_SUBST_TRACE([dvidir]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^dvidir$]) -m4trace:configure.ac:25: -1- AC_SUBST([pdfdir], ['${docdir}']) -m4trace:configure.ac:25: -1- AC_SUBST_TRACE([pdfdir]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^pdfdir$]) -m4trace:configure.ac:25: -1- AC_SUBST([psdir], ['${docdir}']) -m4trace:configure.ac:25: -1- AC_SUBST_TRACE([psdir]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^psdir$]) -m4trace:configure.ac:25: -1- AC_SUBST([libdir], ['${exec_prefix}/lib']) -m4trace:configure.ac:25: -1- AC_SUBST_TRACE([libdir]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^libdir$]) -m4trace:configure.ac:25: -1- AC_SUBST([localedir], ['${datarootdir}/locale']) -m4trace:configure.ac:25: -1- AC_SUBST_TRACE([localedir]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^localedir$]) -m4trace:configure.ac:25: -1- AC_SUBST([mandir], ['${datarootdir}/man']) -m4trace:configure.ac:25: -1- AC_SUBST_TRACE([mandir]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^mandir$]) -m4trace:configure.ac:25: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_NAME]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^PACKAGE_NAME$]) -m4trace:configure.ac:25: -1- AH_OUTPUT([PACKAGE_NAME], [/* Define to the full name of this package. */ +m4trace:configure.ac:38: -1- AC_SUBST_TRACE([docdir]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^docdir$]) +m4trace:configure.ac:38: -1- AC_SUBST([infodir], ['${datarootdir}/info']) +m4trace:configure.ac:38: -1- AC_SUBST_TRACE([infodir]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^infodir$]) +m4trace:configure.ac:38: -1- AC_SUBST([htmldir], ['${docdir}']) +m4trace:configure.ac:38: -1- AC_SUBST_TRACE([htmldir]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^htmldir$]) +m4trace:configure.ac:38: -1- AC_SUBST([dvidir], ['${docdir}']) +m4trace:configure.ac:38: -1- AC_SUBST_TRACE([dvidir]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^dvidir$]) +m4trace:configure.ac:38: -1- AC_SUBST([pdfdir], ['${docdir}']) +m4trace:configure.ac:38: -1- AC_SUBST_TRACE([pdfdir]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^pdfdir$]) +m4trace:configure.ac:38: -1- AC_SUBST([psdir], ['${docdir}']) +m4trace:configure.ac:38: -1- AC_SUBST_TRACE([psdir]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^psdir$]) +m4trace:configure.ac:38: -1- AC_SUBST([libdir], ['${exec_prefix}/lib']) +m4trace:configure.ac:38: -1- AC_SUBST_TRACE([libdir]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^libdir$]) +m4trace:configure.ac:38: -1- AC_SUBST([localedir], ['${datarootdir}/locale']) +m4trace:configure.ac:38: -1- AC_SUBST_TRACE([localedir]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^localedir$]) +m4trace:configure.ac:38: -1- AC_SUBST([mandir], ['${datarootdir}/man']) +m4trace:configure.ac:38: -1- AC_SUBST_TRACE([mandir]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^mandir$]) +m4trace:configure.ac:38: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_NAME]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^PACKAGE_NAME$]) +m4trace:configure.ac:38: -1- AH_OUTPUT([PACKAGE_NAME], [/* Define to the full name of this package. */ #undef PACKAGE_NAME]) -m4trace:configure.ac:25: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_TARNAME]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) -m4trace:configure.ac:25: -1- AH_OUTPUT([PACKAGE_TARNAME], [/* Define to the one symbol short name of this package. */ +m4trace:configure.ac:38: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_TARNAME]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) +m4trace:configure.ac:38: -1- AH_OUTPUT([PACKAGE_TARNAME], [/* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME]) -m4trace:configure.ac:25: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_VERSION]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^PACKAGE_VERSION$]) -m4trace:configure.ac:25: -1- AH_OUTPUT([PACKAGE_VERSION], [/* Define to the version of this package. */ +m4trace:configure.ac:38: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_VERSION]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^PACKAGE_VERSION$]) +m4trace:configure.ac:38: -1- AH_OUTPUT([PACKAGE_VERSION], [/* Define to the version of this package. */ #undef PACKAGE_VERSION]) -m4trace:configure.ac:25: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_STRING]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^PACKAGE_STRING$]) -m4trace:configure.ac:25: -1- AH_OUTPUT([PACKAGE_STRING], [/* Define to the full name and version of this package. */ +m4trace:configure.ac:38: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_STRING]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^PACKAGE_STRING$]) +m4trace:configure.ac:38: -1- AH_OUTPUT([PACKAGE_STRING], [/* Define to the full name and version of this package. */ #undef PACKAGE_STRING]) -m4trace:configure.ac:25: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_BUGREPORT]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) -m4trace:configure.ac:25: -1- AH_OUTPUT([PACKAGE_BUGREPORT], [/* Define to the address where bug reports for this package should be sent. */ +m4trace:configure.ac:38: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_BUGREPORT]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) +m4trace:configure.ac:38: -1- AH_OUTPUT([PACKAGE_BUGREPORT], [/* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT]) -m4trace:configure.ac:25: -1- AC_SUBST([DEFS]) -m4trace:configure.ac:25: -1- AC_SUBST_TRACE([DEFS]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^DEFS$]) -m4trace:configure.ac:25: -1- AC_SUBST([ECHO_C]) -m4trace:configure.ac:25: -1- AC_SUBST_TRACE([ECHO_C]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^ECHO_C$]) -m4trace:configure.ac:25: -1- AC_SUBST([ECHO_N]) -m4trace:configure.ac:25: -1- AC_SUBST_TRACE([ECHO_N]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^ECHO_N$]) -m4trace:configure.ac:25: -1- AC_SUBST([ECHO_T]) -m4trace:configure.ac:25: -1- AC_SUBST_TRACE([ECHO_T]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^ECHO_T$]) -m4trace:configure.ac:25: -1- AC_SUBST([LIBS]) -m4trace:configure.ac:25: -1- AC_SUBST_TRACE([LIBS]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^LIBS$]) -m4trace:configure.ac:25: -1- AC_SUBST([build_alias]) -m4trace:configure.ac:25: -1- AC_SUBST_TRACE([build_alias]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^build_alias$]) -m4trace:configure.ac:25: -1- AC_SUBST([host_alias]) -m4trace:configure.ac:25: -1- AC_SUBST_TRACE([host_alias]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^host_alias$]) -m4trace:configure.ac:25: -1- AC_SUBST([target_alias]) -m4trace:configure.ac:25: -1- AC_SUBST_TRACE([target_alias]) -m4trace:configure.ac:25: -1- m4_pattern_allow([^target_alias$]) -m4trace:configure.ac:51: -1- AC_CANONICAL_HOST -m4trace:configure.ac:51: -1- AC_CANONICAL_BUILD -m4trace:configure.ac:51: -1- AC_REQUIRE_AUX_FILE([config.sub]) -m4trace:configure.ac:51: -1- AC_REQUIRE_AUX_FILE([config.guess]) -m4trace:configure.ac:51: -1- AC_SUBST([build], [$ac_cv_build]) -m4trace:configure.ac:51: -1- AC_SUBST_TRACE([build]) -m4trace:configure.ac:51: -1- m4_pattern_allow([^build$]) -m4trace:configure.ac:51: -1- AC_SUBST([build_cpu], [$[1]]) -m4trace:configure.ac:51: -1- AC_SUBST_TRACE([build_cpu]) -m4trace:configure.ac:51: -1- m4_pattern_allow([^build_cpu$]) -m4trace:configure.ac:51: -1- AC_SUBST([build_vendor], [$[2]]) -m4trace:configure.ac:51: -1- AC_SUBST_TRACE([build_vendor]) -m4trace:configure.ac:51: -1- m4_pattern_allow([^build_vendor$]) -m4trace:configure.ac:51: -1- AC_SUBST([build_os]) -m4trace:configure.ac:51: -1- AC_SUBST_TRACE([build_os]) -m4trace:configure.ac:51: -1- m4_pattern_allow([^build_os$]) -m4trace:configure.ac:51: -1- AC_SUBST([host], [$ac_cv_host]) -m4trace:configure.ac:51: -1- AC_SUBST_TRACE([host]) -m4trace:configure.ac:51: -1- m4_pattern_allow([^host$]) -m4trace:configure.ac:51: -1- AC_SUBST([host_cpu], [$[1]]) -m4trace:configure.ac:51: -1- AC_SUBST_TRACE([host_cpu]) -m4trace:configure.ac:51: -1- m4_pattern_allow([^host_cpu$]) -m4trace:configure.ac:51: -1- AC_SUBST([host_vendor], [$[2]]) -m4trace:configure.ac:51: -1- AC_SUBST_TRACE([host_vendor]) -m4trace:configure.ac:51: -1- m4_pattern_allow([^host_vendor$]) -m4trace:configure.ac:51: -1- AC_SUBST([host_os]) -m4trace:configure.ac:51: -1- AC_SUBST_TRACE([host_os]) -m4trace:configure.ac:51: -1- m4_pattern_allow([^host_os$]) -m4trace:configure.ac:52: -1- AC_CANONICAL_BUILD -m4trace:configure.ac:52: -1- AC_REQUIRE_AUX_FILE([config.sub]) -m4trace:configure.ac:52: -1- AC_REQUIRE_AUX_FILE([config.guess]) -m4trace:configure.ac:52: -1- AC_SUBST([build], [$ac_cv_build]) -m4trace:configure.ac:52: -1- AC_SUBST_TRACE([build]) -m4trace:configure.ac:52: -1- m4_pattern_allow([^build$]) -m4trace:configure.ac:52: -1- AC_SUBST([build_cpu], [$[1]]) -m4trace:configure.ac:52: -1- AC_SUBST_TRACE([build_cpu]) -m4trace:configure.ac:52: -1- m4_pattern_allow([^build_cpu$]) -m4trace:configure.ac:52: -1- AC_SUBST([build_vendor], [$[2]]) -m4trace:configure.ac:52: -1- AC_SUBST_TRACE([build_vendor]) -m4trace:configure.ac:52: -1- m4_pattern_allow([^build_vendor$]) -m4trace:configure.ac:52: -1- AC_SUBST([build_os]) -m4trace:configure.ac:52: -1- AC_SUBST_TRACE([build_os]) -m4trace:configure.ac:52: -1- m4_pattern_allow([^build_os$]) -m4trace:configure.ac:99: -1- AM_INIT_AUTOMAKE -m4trace:configure.ac:99: -1- m4_pattern_allow([^AM_[A-Z]+FLAGS$]) -m4trace:configure.ac:99: -1- AM_AUTOMAKE_VERSION([1.10]) -m4trace:configure.ac:99: -1- AC_REQUIRE_AUX_FILE([install-sh]) -m4trace:configure.ac:99: -1- AC_SUBST([INSTALL_PROGRAM]) -m4trace:configure.ac:99: -1- AC_SUBST_TRACE([INSTALL_PROGRAM]) -m4trace:configure.ac:99: -1- m4_pattern_allow([^INSTALL_PROGRAM$]) -m4trace:configure.ac:99: -1- AC_SUBST([INSTALL_SCRIPT]) -m4trace:configure.ac:99: -1- AC_SUBST_TRACE([INSTALL_SCRIPT]) -m4trace:configure.ac:99: -1- m4_pattern_allow([^INSTALL_SCRIPT$]) -m4trace:configure.ac:99: -1- AC_SUBST([INSTALL_DATA]) -m4trace:configure.ac:99: -1- AC_SUBST_TRACE([INSTALL_DATA]) -m4trace:configure.ac:99: -1- m4_pattern_allow([^INSTALL_DATA$]) -m4trace:configure.ac:99: -1- AC_SUBST([am__isrc], [' -I$(srcdir)']) -m4trace:configure.ac:99: -1- AC_SUBST_TRACE([am__isrc]) -m4trace:configure.ac:99: -1- m4_pattern_allow([^am__isrc$]) -m4trace:configure.ac:99: -1- _AM_SUBST_NOTMAKE([am__isrc]) -m4trace:configure.ac:99: -1- AC_SUBST([CYGPATH_W]) -m4trace:configure.ac:99: -1- AC_SUBST_TRACE([CYGPATH_W]) -m4trace:configure.ac:99: -1- m4_pattern_allow([^CYGPATH_W$]) -m4trace:configure.ac:99: -1- _m4_warn([obsolete], [The macro `AC_FOREACH' is obsolete. +m4trace:configure.ac:38: -1- AC_SUBST([DEFS]) +m4trace:configure.ac:38: -1- AC_SUBST_TRACE([DEFS]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^DEFS$]) +m4trace:configure.ac:38: -1- AC_SUBST([ECHO_C]) +m4trace:configure.ac:38: -1- AC_SUBST_TRACE([ECHO_C]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^ECHO_C$]) +m4trace:configure.ac:38: -1- AC_SUBST([ECHO_N]) +m4trace:configure.ac:38: -1- AC_SUBST_TRACE([ECHO_N]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^ECHO_N$]) +m4trace:configure.ac:38: -1- AC_SUBST([ECHO_T]) +m4trace:configure.ac:38: -1- AC_SUBST_TRACE([ECHO_T]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^ECHO_T$]) +m4trace:configure.ac:38: -1- AC_SUBST([LIBS]) +m4trace:configure.ac:38: -1- AC_SUBST_TRACE([LIBS]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^LIBS$]) +m4trace:configure.ac:38: -1- AC_SUBST([build_alias]) +m4trace:configure.ac:38: -1- AC_SUBST_TRACE([build_alias]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^build_alias$]) +m4trace:configure.ac:38: -1- AC_SUBST([host_alias]) +m4trace:configure.ac:38: -1- AC_SUBST_TRACE([host_alias]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^host_alias$]) +m4trace:configure.ac:38: -1- AC_SUBST([target_alias]) +m4trace:configure.ac:38: -1- AC_SUBST_TRACE([target_alias]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^target_alias$]) +m4trace:configure.ac:66: -1- AC_CONFIG_AUX_DIR([config]) +m4trace:configure.ac:69: -1- AC_CANONICAL_HOST +m4trace:configure.ac:69: -1- AC_CANONICAL_BUILD +m4trace:configure.ac:69: -1- AC_REQUIRE_AUX_FILE([config.sub]) +m4trace:configure.ac:69: -1- AC_REQUIRE_AUX_FILE([config.guess]) +m4trace:configure.ac:69: -1- AC_SUBST([build], [$ac_cv_build]) +m4trace:configure.ac:69: -1- AC_SUBST_TRACE([build]) +m4trace:configure.ac:69: -1- m4_pattern_allow([^build$]) +m4trace:configure.ac:69: -1- AC_SUBST([build_cpu], [$[1]]) +m4trace:configure.ac:69: -1- AC_SUBST_TRACE([build_cpu]) +m4trace:configure.ac:69: -1- m4_pattern_allow([^build_cpu$]) +m4trace:configure.ac:69: -1- AC_SUBST([build_vendor], [$[2]]) +m4trace:configure.ac:69: -1- AC_SUBST_TRACE([build_vendor]) +m4trace:configure.ac:69: -1- m4_pattern_allow([^build_vendor$]) +m4trace:configure.ac:69: -1- AC_SUBST([build_os]) +m4trace:configure.ac:69: -1- AC_SUBST_TRACE([build_os]) +m4trace:configure.ac:69: -1- m4_pattern_allow([^build_os$]) +m4trace:configure.ac:69: -1- AC_SUBST([host], [$ac_cv_host]) +m4trace:configure.ac:69: -1- AC_SUBST_TRACE([host]) +m4trace:configure.ac:69: -1- m4_pattern_allow([^host$]) +m4trace:configure.ac:69: -1- AC_SUBST([host_cpu], [$[1]]) +m4trace:configure.ac:69: -1- AC_SUBST_TRACE([host_cpu]) +m4trace:configure.ac:69: -1- m4_pattern_allow([^host_cpu$]) +m4trace:configure.ac:69: -1- AC_SUBST([host_vendor], [$[2]]) +m4trace:configure.ac:69: -1- AC_SUBST_TRACE([host_vendor]) +m4trace:configure.ac:69: -1- m4_pattern_allow([^host_vendor$]) +m4trace:configure.ac:69: -1- AC_SUBST([host_os]) +m4trace:configure.ac:69: -1- AC_SUBST_TRACE([host_os]) +m4trace:configure.ac:69: -1- m4_pattern_allow([^host_os$]) +m4trace:configure.ac:70: -1- AC_CANONICAL_BUILD +m4trace:configure.ac:70: -1- AC_REQUIRE_AUX_FILE([config.sub]) +m4trace:configure.ac:70: -1- AC_REQUIRE_AUX_FILE([config.guess]) +m4trace:configure.ac:70: -1- AC_SUBST([build], [$ac_cv_build]) +m4trace:configure.ac:70: -1- AC_SUBST_TRACE([build]) +m4trace:configure.ac:70: -1- m4_pattern_allow([^build$]) +m4trace:configure.ac:70: -1- AC_SUBST([build_cpu], [$[1]]) +m4trace:configure.ac:70: -1- AC_SUBST_TRACE([build_cpu]) +m4trace:configure.ac:70: -1- m4_pattern_allow([^build_cpu$]) +m4trace:configure.ac:70: -1- AC_SUBST([build_vendor], [$[2]]) +m4trace:configure.ac:70: -1- AC_SUBST_TRACE([build_vendor]) +m4trace:configure.ac:70: -1- m4_pattern_allow([^build_vendor$]) +m4trace:configure.ac:70: -1- AC_SUBST([build_os]) +m4trace:configure.ac:70: -1- AC_SUBST_TRACE([build_os]) +m4trace:configure.ac:70: -1- m4_pattern_allow([^build_os$]) +m4trace:configure.ac:176: -1- AM_INIT_AUTOMAKE +m4trace:configure.ac:176: -1- m4_pattern_allow([^AM_[A-Z]+FLAGS$]) +m4trace:configure.ac:176: -1- AM_AUTOMAKE_VERSION([1.10]) +m4trace:configure.ac:176: -1- AC_REQUIRE_AUX_FILE([install-sh]) +m4trace:configure.ac:176: -1- AC_SUBST([INSTALL_PROGRAM]) +m4trace:configure.ac:176: -1- AC_SUBST_TRACE([INSTALL_PROGRAM]) +m4trace:configure.ac:176: -1- m4_pattern_allow([^INSTALL_PROGRAM$]) +m4trace:configure.ac:176: -1- AC_SUBST([INSTALL_SCRIPT]) +m4trace:configure.ac:176: -1- AC_SUBST_TRACE([INSTALL_SCRIPT]) +m4trace:configure.ac:176: -1- m4_pattern_allow([^INSTALL_SCRIPT$]) +m4trace:configure.ac:176: -1- AC_SUBST([INSTALL_DATA]) +m4trace:configure.ac:176: -1- AC_SUBST_TRACE([INSTALL_DATA]) +m4trace:configure.ac:176: -1- m4_pattern_allow([^INSTALL_DATA$]) +m4trace:configure.ac:176: -1- AC_SUBST([am__isrc], [' -I$(srcdir)']) +m4trace:configure.ac:176: -1- AC_SUBST_TRACE([am__isrc]) +m4trace:configure.ac:176: -1- m4_pattern_allow([^am__isrc$]) +m4trace:configure.ac:176: -1- _AM_SUBST_NOTMAKE([am__isrc]) +m4trace:configure.ac:176: -1- AC_SUBST([CYGPATH_W]) +m4trace:configure.ac:176: -1- AC_SUBST_TRACE([CYGPATH_W]) +m4trace:configure.ac:176: -1- m4_pattern_allow([^CYGPATH_W$]) +m4trace:configure.ac:176: -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:7065: _AM_SET_OPTIONS is expanded from... -aclocal.m4:6792: AM_INIT_AUTOMAKE is expanded from... -configure.ac:99: the top level]) -m4trace:configure.ac:99: -1- AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME']) -m4trace:configure.ac:99: -1- AC_SUBST_TRACE([PACKAGE]) -m4trace:configure.ac:99: -1- m4_pattern_allow([^PACKAGE$]) -m4trace:configure.ac:99: -1- AC_SUBST([VERSION], ['AC_PACKAGE_VERSION']) -m4trace:configure.ac:99: -1- AC_SUBST_TRACE([VERSION]) -m4trace:configure.ac:99: -1- m4_pattern_allow([^VERSION$]) -m4trace:configure.ac:99: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE]) -m4trace:configure.ac:99: -1- m4_pattern_allow([^PACKAGE$]) -m4trace:configure.ac:99: -1- AH_OUTPUT([PACKAGE], [/* Name of package */ +aclocal.m4:700: _AM_SET_OPTIONS is expanded from... +aclocal.m4:393: AM_INIT_AUTOMAKE is expanded from... +configure.ac:176: the top level]) +m4trace:configure.ac:176: -1- AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME']) +m4trace:configure.ac:176: -1- AC_SUBST_TRACE([PACKAGE]) +m4trace:configure.ac:176: -1- m4_pattern_allow([^PACKAGE$]) +m4trace:configure.ac:176: -1- AC_SUBST([VERSION], ['AC_PACKAGE_VERSION']) +m4trace:configure.ac:176: -1- AC_SUBST_TRACE([VERSION]) +m4trace:configure.ac:176: -1- m4_pattern_allow([^VERSION$]) +m4trace:configure.ac:176: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE]) +m4trace:configure.ac:176: -1- m4_pattern_allow([^PACKAGE$]) +m4trace:configure.ac:176: -1- AH_OUTPUT([PACKAGE], [/* Name of package */ #undef PACKAGE]) -m4trace:configure.ac:99: -1- AC_DEFINE_TRACE_LITERAL([VERSION]) -m4trace:configure.ac:99: -1- m4_pattern_allow([^VERSION$]) -m4trace:configure.ac:99: -1- AH_OUTPUT([VERSION], [/* Version number of package */ +m4trace:configure.ac:176: -1- AC_DEFINE_TRACE_LITERAL([VERSION]) +m4trace:configure.ac:176: -1- m4_pattern_allow([^VERSION$]) +m4trace:configure.ac:176: -1- AH_OUTPUT([VERSION], [/* Version number of package */ #undef VERSION]) -m4trace:configure.ac:99: -1- AC_REQUIRE_AUX_FILE([missing]) -m4trace:configure.ac:99: -1- AC_SUBST([ACLOCAL]) -m4trace:configure.ac:99: -1- AC_SUBST_TRACE([ACLOCAL]) -m4trace:configure.ac:99: -1- m4_pattern_allow([^ACLOCAL$]) -m4trace:configure.ac:99: -1- AC_SUBST([AUTOCONF]) -m4trace:configure.ac:99: -1- AC_SUBST_TRACE([AUTOCONF]) -m4trace:configure.ac:99: -1- m4_pattern_allow([^AUTOCONF$]) -m4trace:configure.ac:99: -1- AC_SUBST([AUTOMAKE]) -m4trace:configure.ac:99: -1- AC_SUBST_TRACE([AUTOMAKE]) -m4trace:configure.ac:99: -1- m4_pattern_allow([^AUTOMAKE$]) -m4trace:configure.ac:99: -1- AC_SUBST([AUTOHEADER]) -m4trace:configure.ac:99: -1- AC_SUBST_TRACE([AUTOHEADER]) -m4trace:configure.ac:99: -1- m4_pattern_allow([^AUTOHEADER$]) -m4trace:configure.ac:99: -1- AC_SUBST([MAKEINFO]) -m4trace:configure.ac:99: -1- AC_SUBST_TRACE([MAKEINFO]) -m4trace:configure.ac:99: -1- m4_pattern_allow([^MAKEINFO$]) -m4trace:configure.ac:99: -1- AC_SUBST([install_sh]) -m4trace:configure.ac:99: -1- AC_SUBST_TRACE([install_sh]) -m4trace:configure.ac:99: -1- m4_pattern_allow([^install_sh$]) -m4trace:configure.ac:99: -1- AC_SUBST([STRIP]) -m4trace:configure.ac:99: -1- AC_SUBST_TRACE([STRIP]) -m4trace:configure.ac:99: -1- m4_pattern_allow([^STRIP$]) -m4trace:configure.ac:99: -1- AC_SUBST([INSTALL_STRIP_PROGRAM]) -m4trace:configure.ac:99: -1- AC_SUBST_TRACE([INSTALL_STRIP_PROGRAM]) -m4trace:configure.ac:99: -1- m4_pattern_allow([^INSTALL_STRIP_PROGRAM$]) -m4trace:configure.ac:99: -1- AC_REQUIRE_AUX_FILE([install-sh]) -m4trace:configure.ac:99: -1- AC_SUBST([mkdir_p], ["$MKDIR_P"]) -m4trace:configure.ac:99: -1- AC_SUBST_TRACE([mkdir_p]) -m4trace:configure.ac:99: -1- m4_pattern_allow([^mkdir_p$]) -m4trace:configure.ac:99: -1- AC_SUBST([AWK]) -m4trace:configure.ac:99: -1- AC_SUBST_TRACE([AWK]) -m4trace:configure.ac:99: -1- m4_pattern_allow([^AWK$]) -m4trace:configure.ac:99: -1- AC_SUBST([SET_MAKE]) -m4trace:configure.ac:99: -1- AC_SUBST_TRACE([SET_MAKE]) -m4trace:configure.ac:99: -1- m4_pattern_allow([^SET_MAKE$]) -m4trace:configure.ac:99: -1- AC_SUBST([am__leading_dot]) -m4trace:configure.ac:99: -1- AC_SUBST_TRACE([am__leading_dot]) -m4trace:configure.ac:99: -1- m4_pattern_allow([^am__leading_dot$]) -m4trace:configure.ac:99: -1- AC_SUBST([AMTAR]) -m4trace:configure.ac:99: -1- AC_SUBST_TRACE([AMTAR]) -m4trace:configure.ac:99: -1- m4_pattern_allow([^AMTAR$]) -m4trace:configure.ac:99: -1- AC_SUBST([am__tar]) -m4trace:configure.ac:99: -1- AC_SUBST_TRACE([am__tar]) -m4trace:configure.ac:99: -1- m4_pattern_allow([^am__tar$]) -m4trace:configure.ac:99: -1- AC_SUBST([am__untar]) -m4trace:configure.ac:99: -1- AC_SUBST_TRACE([am__untar]) -m4trace:configure.ac:99: -1- m4_pattern_allow([^am__untar$]) -m4trace:configure.ac:111: -1- AC_SUBST([CC]) -m4trace:configure.ac:111: -1- AC_SUBST_TRACE([CC]) -m4trace:configure.ac:111: -1- m4_pattern_allow([^CC$]) -m4trace:configure.ac:111: -1- AC_SUBST([CFLAGS]) -m4trace:configure.ac:111: -1- AC_SUBST_TRACE([CFLAGS]) -m4trace:configure.ac:111: -1- m4_pattern_allow([^CFLAGS$]) -m4trace:configure.ac:111: -1- AC_SUBST([LDFLAGS]) -m4trace:configure.ac:111: -1- AC_SUBST_TRACE([LDFLAGS]) -m4trace:configure.ac:111: -1- m4_pattern_allow([^LDFLAGS$]) -m4trace:configure.ac:111: -1- AC_SUBST([LIBS]) -m4trace:configure.ac:111: -1- AC_SUBST_TRACE([LIBS]) -m4trace:configure.ac:111: -1- m4_pattern_allow([^LIBS$]) -m4trace:configure.ac:111: -1- AC_SUBST([CPPFLAGS]) -m4trace:configure.ac:111: -1- AC_SUBST_TRACE([CPPFLAGS]) -m4trace:configure.ac:111: -1- m4_pattern_allow([^CPPFLAGS$]) -m4trace:configure.ac:111: -1- AC_SUBST([CC]) -m4trace:configure.ac:111: -1- AC_SUBST_TRACE([CC]) -m4trace:configure.ac:111: -1- m4_pattern_allow([^CC$]) -m4trace:configure.ac:111: -1- AC_SUBST([CC]) -m4trace:configure.ac:111: -1- AC_SUBST_TRACE([CC]) -m4trace:configure.ac:111: -1- m4_pattern_allow([^CC$]) -m4trace:configure.ac:111: -1- AC_SUBST([CC]) -m4trace:configure.ac:111: -1- AC_SUBST_TRACE([CC]) -m4trace:configure.ac:111: -1- m4_pattern_allow([^CC$]) -m4trace:configure.ac:111: -1- AC_SUBST([CC]) -m4trace:configure.ac:111: -1- AC_SUBST_TRACE([CC]) -m4trace:configure.ac:111: -1- m4_pattern_allow([^CC$]) -m4trace:configure.ac:111: -1- AC_SUBST([ac_ct_CC]) -m4trace:configure.ac:111: -1- AC_SUBST_TRACE([ac_ct_CC]) -m4trace:configure.ac:111: -1- m4_pattern_allow([^ac_ct_CC$]) -m4trace:configure.ac:111: -1- AC_SUBST([EXEEXT], [$ac_cv_exeext]) -m4trace:configure.ac:111: -1- AC_SUBST_TRACE([EXEEXT]) -m4trace:configure.ac:111: -1- m4_pattern_allow([^EXEEXT$]) -m4trace:configure.ac:111: -1- AC_SUBST([OBJEXT], [$ac_cv_objext]) -m4trace:configure.ac:111: -1- AC_SUBST_TRACE([OBJEXT]) -m4trace:configure.ac:111: -1- m4_pattern_allow([^OBJEXT$]) -m4trace:configure.ac:111: -1- AC_SUBST([DEPDIR], ["${am__leading_dot}deps"]) -m4trace:configure.ac:111: -1- AC_SUBST_TRACE([DEPDIR]) -m4trace:configure.ac:111: -1- m4_pattern_allow([^DEPDIR$]) -m4trace:configure.ac:111: -1- AC_SUBST([am__include]) -m4trace:configure.ac:111: -1- AC_SUBST_TRACE([am__include]) -m4trace:configure.ac:111: -1- m4_pattern_allow([^am__include$]) -m4trace:configure.ac:111: -1- AC_SUBST([am__quote]) -m4trace:configure.ac:111: -1- AC_SUBST_TRACE([am__quote]) -m4trace:configure.ac:111: -1- m4_pattern_allow([^am__quote$]) -m4trace:configure.ac:111: -1- AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) -m4trace:configure.ac:111: -1- AC_SUBST([AMDEP_TRUE]) -m4trace:configure.ac:111: -1- AC_SUBST_TRACE([AMDEP_TRUE]) -m4trace:configure.ac:111: -1- m4_pattern_allow([^AMDEP_TRUE$]) -m4trace:configure.ac:111: -1- AC_SUBST([AMDEP_FALSE]) -m4trace:configure.ac:111: -1- AC_SUBST_TRACE([AMDEP_FALSE]) -m4trace:configure.ac:111: -1- m4_pattern_allow([^AMDEP_FALSE$]) -m4trace:configure.ac:111: -1- _AM_SUBST_NOTMAKE([AMDEP_TRUE]) -m4trace:configure.ac:111: -1- _AM_SUBST_NOTMAKE([AMDEP_FALSE]) -m4trace:configure.ac:111: -1- AC_SUBST([AMDEPBACKSLASH]) -m4trace:configure.ac:111: -1- AC_SUBST_TRACE([AMDEPBACKSLASH]) -m4trace:configure.ac:111: -1- m4_pattern_allow([^AMDEPBACKSLASH$]) -m4trace:configure.ac:111: -1- _AM_SUBST_NOTMAKE([AMDEPBACKSLASH]) -m4trace:configure.ac:111: -1- AC_SUBST([CCDEPMODE], [depmode=$am_cv_CC_dependencies_compiler_type]) -m4trace:configure.ac:111: -1- AC_SUBST_TRACE([CCDEPMODE]) -m4trace:configure.ac:111: -1- m4_pattern_allow([^CCDEPMODE$]) -m4trace:configure.ac:111: -1- AM_CONDITIONAL([am__fastdepCC], [ +m4trace:configure.ac:176: -1- AC_REQUIRE_AUX_FILE([missing]) +m4trace:configure.ac:176: -1- AC_SUBST([ACLOCAL]) +m4trace:configure.ac:176: -1- AC_SUBST_TRACE([ACLOCAL]) +m4trace:configure.ac:176: -1- m4_pattern_allow([^ACLOCAL$]) +m4trace:configure.ac:176: -1- AC_SUBST([AUTOCONF]) +m4trace:configure.ac:176: -1- AC_SUBST_TRACE([AUTOCONF]) +m4trace:configure.ac:176: -1- m4_pattern_allow([^AUTOCONF$]) +m4trace:configure.ac:176: -1- AC_SUBST([AUTOMAKE]) +m4trace:configure.ac:176: -1- AC_SUBST_TRACE([AUTOMAKE]) +m4trace:configure.ac:176: -1- m4_pattern_allow([^AUTOMAKE$]) +m4trace:configure.ac:176: -1- AC_SUBST([AUTOHEADER]) +m4trace:configure.ac:176: -1- AC_SUBST_TRACE([AUTOHEADER]) +m4trace:configure.ac:176: -1- m4_pattern_allow([^AUTOHEADER$]) +m4trace:configure.ac:176: -1- AC_SUBST([MAKEINFO]) +m4trace:configure.ac:176: -1- AC_SUBST_TRACE([MAKEINFO]) +m4trace:configure.ac:176: -1- m4_pattern_allow([^MAKEINFO$]) +m4trace:configure.ac:176: -1- AC_SUBST([install_sh]) +m4trace:configure.ac:176: -1- AC_SUBST_TRACE([install_sh]) +m4trace:configure.ac:176: -1- m4_pattern_allow([^install_sh$]) +m4trace:configure.ac:176: -1- AC_SUBST([STRIP]) +m4trace:configure.ac:176: -1- AC_SUBST_TRACE([STRIP]) +m4trace:configure.ac:176: -1- m4_pattern_allow([^STRIP$]) +m4trace:configure.ac:176: -1- AC_SUBST([INSTALL_STRIP_PROGRAM]) +m4trace:configure.ac:176: -1- AC_SUBST_TRACE([INSTALL_STRIP_PROGRAM]) +m4trace:configure.ac:176: -1- m4_pattern_allow([^INSTALL_STRIP_PROGRAM$]) +m4trace:configure.ac:176: -1- AC_REQUIRE_AUX_FILE([install-sh]) +m4trace:configure.ac:176: -1- AC_SUBST([mkdir_p], ["$MKDIR_P"]) +m4trace:configure.ac:176: -1- AC_SUBST_TRACE([mkdir_p]) +m4trace:configure.ac:176: -1- m4_pattern_allow([^mkdir_p$]) +m4trace:configure.ac:176: -1- AC_SUBST([AWK]) +m4trace:configure.ac:176: -1- AC_SUBST_TRACE([AWK]) +m4trace:configure.ac:176: -1- m4_pattern_allow([^AWK$]) +m4trace:configure.ac:176: -1- AC_SUBST([SET_MAKE]) +m4trace:configure.ac:176: -1- AC_SUBST_TRACE([SET_MAKE]) +m4trace:configure.ac:176: -1- m4_pattern_allow([^SET_MAKE$]) +m4trace:configure.ac:176: -1- AC_SUBST([am__leading_dot]) +m4trace:configure.ac:176: -1- AC_SUBST_TRACE([am__leading_dot]) +m4trace:configure.ac:176: -1- m4_pattern_allow([^am__leading_dot$]) +m4trace:configure.ac:176: -1- AC_SUBST([AMTAR]) +m4trace:configure.ac:176: -1- AC_SUBST_TRACE([AMTAR]) +m4trace:configure.ac:176: -1- m4_pattern_allow([^AMTAR$]) +m4trace:configure.ac:176: -1- AC_SUBST([am__tar]) +m4trace:configure.ac:176: -1- AC_SUBST_TRACE([am__tar]) +m4trace:configure.ac:176: -1- m4_pattern_allow([^am__tar$]) +m4trace:configure.ac:176: -1- AC_SUBST([am__untar]) +m4trace:configure.ac:176: -1- AC_SUBST_TRACE([am__untar]) +m4trace:configure.ac:176: -1- m4_pattern_allow([^am__untar$]) +m4trace:configure.ac:199: -1- AC_SUBST([CC]) +m4trace:configure.ac:199: -1- AC_SUBST_TRACE([CC]) +m4trace:configure.ac:199: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:199: -1- AC_SUBST([CFLAGS]) +m4trace:configure.ac:199: -1- AC_SUBST_TRACE([CFLAGS]) +m4trace:configure.ac:199: -1- m4_pattern_allow([^CFLAGS$]) +m4trace:configure.ac:199: -1- AC_SUBST([LDFLAGS]) +m4trace:configure.ac:199: -1- AC_SUBST_TRACE([LDFLAGS]) +m4trace:configure.ac:199: -1- m4_pattern_allow([^LDFLAGS$]) +m4trace:configure.ac:199: -1- AC_SUBST([LIBS]) +m4trace:configure.ac:199: -1- AC_SUBST_TRACE([LIBS]) +m4trace:configure.ac:199: -1- m4_pattern_allow([^LIBS$]) +m4trace:configure.ac:199: -1- AC_SUBST([CPPFLAGS]) +m4trace:configure.ac:199: -1- AC_SUBST_TRACE([CPPFLAGS]) +m4trace:configure.ac:199: -1- m4_pattern_allow([^CPPFLAGS$]) +m4trace:configure.ac:199: -1- AC_SUBST([CC]) +m4trace:configure.ac:199: -1- AC_SUBST_TRACE([CC]) +m4trace:configure.ac:199: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:199: -1- AC_SUBST([CC]) +m4trace:configure.ac:199: -1- AC_SUBST_TRACE([CC]) +m4trace:configure.ac:199: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:199: -1- AC_SUBST([CC]) +m4trace:configure.ac:199: -1- AC_SUBST_TRACE([CC]) +m4trace:configure.ac:199: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:199: -1- AC_SUBST([CC]) +m4trace:configure.ac:199: -1- AC_SUBST_TRACE([CC]) +m4trace:configure.ac:199: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:199: -1- AC_SUBST([ac_ct_CC]) +m4trace:configure.ac:199: -1- AC_SUBST_TRACE([ac_ct_CC]) +m4trace:configure.ac:199: -1- m4_pattern_allow([^ac_ct_CC$]) +m4trace:configure.ac:199: -1- AC_SUBST([EXEEXT], [$ac_cv_exeext]) +m4trace:configure.ac:199: -1- AC_SUBST_TRACE([EXEEXT]) +m4trace:configure.ac:199: -1- m4_pattern_allow([^EXEEXT$]) +m4trace:configure.ac:199: -1- AC_SUBST([OBJEXT], [$ac_cv_objext]) +m4trace:configure.ac:199: -1- AC_SUBST_TRACE([OBJEXT]) +m4trace:configure.ac:199: -1- m4_pattern_allow([^OBJEXT$]) +m4trace:configure.ac:199: -1- AC_SUBST([DEPDIR], ["${am__leading_dot}deps"]) +m4trace:configure.ac:199: -1- AC_SUBST_TRACE([DEPDIR]) +m4trace:configure.ac:199: -1- m4_pattern_allow([^DEPDIR$]) +m4trace:configure.ac:199: -1- AC_SUBST([am__include]) +m4trace:configure.ac:199: -1- AC_SUBST_TRACE([am__include]) +m4trace:configure.ac:199: -1- m4_pattern_allow([^am__include$]) +m4trace:configure.ac:199: -1- AC_SUBST([am__quote]) +m4trace:configure.ac:199: -1- AC_SUBST_TRACE([am__quote]) +m4trace:configure.ac:199: -1- m4_pattern_allow([^am__quote$]) +m4trace:configure.ac:199: -1- AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +m4trace:configure.ac:199: -1- AC_SUBST([AMDEP_TRUE]) +m4trace:configure.ac:199: -1- AC_SUBST_TRACE([AMDEP_TRUE]) +m4trace:configure.ac:199: -1- m4_pattern_allow([^AMDEP_TRUE$]) +m4trace:configure.ac:199: -1- AC_SUBST([AMDEP_FALSE]) +m4trace:configure.ac:199: -1- AC_SUBST_TRACE([AMDEP_FALSE]) +m4trace:configure.ac:199: -1- m4_pattern_allow([^AMDEP_FALSE$]) +m4trace:configure.ac:199: -1- _AM_SUBST_NOTMAKE([AMDEP_TRUE]) +m4trace:configure.ac:199: -1- _AM_SUBST_NOTMAKE([AMDEP_FALSE]) +m4trace:configure.ac:199: -1- AC_SUBST([AMDEPBACKSLASH]) +m4trace:configure.ac:199: -1- AC_SUBST_TRACE([AMDEPBACKSLASH]) +m4trace:configure.ac:199: -1- m4_pattern_allow([^AMDEPBACKSLASH$]) +m4trace:configure.ac:199: -1- _AM_SUBST_NOTMAKE([AMDEPBACKSLASH]) +m4trace:configure.ac:199: -1- AC_SUBST([CCDEPMODE], [depmode=$am_cv_CC_dependencies_compiler_type]) +m4trace:configure.ac:199: -1- AC_SUBST_TRACE([CCDEPMODE]) +m4trace:configure.ac:199: -1- m4_pattern_allow([^CCDEPMODE$]) +m4trace:configure.ac:199: -1- AM_CONDITIONAL([am__fastdepCC], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3]) -m4trace:configure.ac:111: -1- AC_SUBST([am__fastdepCC_TRUE]) -m4trace:configure.ac:111: -1- AC_SUBST_TRACE([am__fastdepCC_TRUE]) -m4trace:configure.ac:111: -1- m4_pattern_allow([^am__fastdepCC_TRUE$]) -m4trace:configure.ac:111: -1- AC_SUBST([am__fastdepCC_FALSE]) -m4trace:configure.ac:111: -1- AC_SUBST_TRACE([am__fastdepCC_FALSE]) -m4trace:configure.ac:111: -1- m4_pattern_allow([^am__fastdepCC_FALSE$]) -m4trace:configure.ac:111: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_TRUE]) -m4trace:configure.ac:111: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_FALSE]) -m4trace:configure.ac:111: -1- AC_SUBST([CPP]) -m4trace:configure.ac:111: -1- AC_SUBST_TRACE([CPP]) -m4trace:configure.ac:111: -1- m4_pattern_allow([^CPP$]) -m4trace:configure.ac:111: -1- AC_SUBST([CPPFLAGS]) -m4trace:configure.ac:111: -1- AC_SUBST_TRACE([CPPFLAGS]) -m4trace:configure.ac:111: -1- m4_pattern_allow([^CPPFLAGS$]) -m4trace:configure.ac:111: -1- AC_SUBST([CPP]) -m4trace:configure.ac:111: -1- AC_SUBST_TRACE([CPP]) -m4trace:configure.ac:111: -1- m4_pattern_allow([^CPP$]) -m4trace:configure.ac:112: -1- AC_SUBST([CC]) -m4trace:configure.ac:112: -1- AC_SUBST_TRACE([CC]) -m4trace:configure.ac:112: -1- m4_pattern_allow([^CC$]) -m4trace:configure.ac:112: -1- AC_SUBST([CFLAGS]) -m4trace:configure.ac:112: -1- AC_SUBST_TRACE([CFLAGS]) -m4trace:configure.ac:112: -1- m4_pattern_allow([^CFLAGS$]) -m4trace:configure.ac:112: -1- AC_SUBST([LDFLAGS]) -m4trace:configure.ac:112: -1- AC_SUBST_TRACE([LDFLAGS]) -m4trace:configure.ac:112: -1- m4_pattern_allow([^LDFLAGS$]) -m4trace:configure.ac:112: -1- AC_SUBST([LIBS]) -m4trace:configure.ac:112: -1- AC_SUBST_TRACE([LIBS]) -m4trace:configure.ac:112: -1- m4_pattern_allow([^LIBS$]) -m4trace:configure.ac:112: -1- AC_SUBST([CPPFLAGS]) -m4trace:configure.ac:112: -1- AC_SUBST_TRACE([CPPFLAGS]) -m4trace:configure.ac:112: -1- m4_pattern_allow([^CPPFLAGS$]) -m4trace:configure.ac:112: -1- AC_SUBST([CC]) -m4trace:configure.ac:112: -1- AC_SUBST_TRACE([CC]) -m4trace:configure.ac:112: -1- m4_pattern_allow([^CC$]) -m4trace:configure.ac:112: -1- AC_SUBST([CC]) -m4trace:configure.ac:112: -1- AC_SUBST_TRACE([CC]) -m4trace:configure.ac:112: -1- m4_pattern_allow([^CC$]) -m4trace:configure.ac:112: -1- AC_SUBST([CC]) -m4trace:configure.ac:112: -1- AC_SUBST_TRACE([CC]) -m4trace:configure.ac:112: -1- m4_pattern_allow([^CC$]) -m4trace:configure.ac:112: -1- AC_SUBST([CC]) -m4trace:configure.ac:112: -1- AC_SUBST_TRACE([CC]) -m4trace:configure.ac:112: -1- m4_pattern_allow([^CC$]) -m4trace:configure.ac:112: -1- AC_SUBST([ac_ct_CC]) -m4trace:configure.ac:112: -1- AC_SUBST_TRACE([ac_ct_CC]) -m4trace:configure.ac:112: -1- m4_pattern_allow([^ac_ct_CC$]) -m4trace:configure.ac:112: -1- AC_SUBST([CCDEPMODE], [depmode=$am_cv_CC_dependencies_compiler_type]) -m4trace:configure.ac:112: -1- AC_SUBST_TRACE([CCDEPMODE]) -m4trace:configure.ac:112: -1- m4_pattern_allow([^CCDEPMODE$]) -m4trace:configure.ac:112: -1- AM_CONDITIONAL([am__fastdepCC], [ +m4trace:configure.ac:199: -1- AC_SUBST([am__fastdepCC_TRUE]) +m4trace:configure.ac:199: -1- AC_SUBST_TRACE([am__fastdepCC_TRUE]) +m4trace:configure.ac:199: -1- m4_pattern_allow([^am__fastdepCC_TRUE$]) +m4trace:configure.ac:199: -1- AC_SUBST([am__fastdepCC_FALSE]) +m4trace:configure.ac:199: -1- AC_SUBST_TRACE([am__fastdepCC_FALSE]) +m4trace:configure.ac:199: -1- m4_pattern_allow([^am__fastdepCC_FALSE$]) +m4trace:configure.ac:199: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_TRUE]) +m4trace:configure.ac:199: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_FALSE]) +m4trace:configure.ac:199: -1- AC_SUBST([CPP]) +m4trace:configure.ac:199: -1- AC_SUBST_TRACE([CPP]) +m4trace:configure.ac:199: -1- m4_pattern_allow([^CPP$]) +m4trace:configure.ac:199: -1- AC_SUBST([CPPFLAGS]) +m4trace:configure.ac:199: -1- AC_SUBST_TRACE([CPPFLAGS]) +m4trace:configure.ac:199: -1- m4_pattern_allow([^CPPFLAGS$]) +m4trace:configure.ac:199: -1- AC_SUBST([CPP]) +m4trace:configure.ac:199: -1- AC_SUBST_TRACE([CPP]) +m4trace:configure.ac:199: -1- m4_pattern_allow([^CPP$]) +m4trace:configure.ac:200: -1- AC_SUBST([CC]) +m4trace:configure.ac:200: -1- AC_SUBST_TRACE([CC]) +m4trace:configure.ac:200: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:200: -1- AC_SUBST([CFLAGS]) +m4trace:configure.ac:200: -1- AC_SUBST_TRACE([CFLAGS]) +m4trace:configure.ac:200: -1- m4_pattern_allow([^CFLAGS$]) +m4trace:configure.ac:200: -1- AC_SUBST([LDFLAGS]) +m4trace:configure.ac:200: -1- AC_SUBST_TRACE([LDFLAGS]) +m4trace:configure.ac:200: -1- m4_pattern_allow([^LDFLAGS$]) +m4trace:configure.ac:200: -1- AC_SUBST([LIBS]) +m4trace:configure.ac:200: -1- AC_SUBST_TRACE([LIBS]) +m4trace:configure.ac:200: -1- m4_pattern_allow([^LIBS$]) +m4trace:configure.ac:200: -1- AC_SUBST([CPPFLAGS]) +m4trace:configure.ac:200: -1- AC_SUBST_TRACE([CPPFLAGS]) +m4trace:configure.ac:200: -1- m4_pattern_allow([^CPPFLAGS$]) +m4trace:configure.ac:200: -1- AC_SUBST([CC]) +m4trace:configure.ac:200: -1- AC_SUBST_TRACE([CC]) +m4trace:configure.ac:200: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:200: -1- AC_SUBST([CC]) +m4trace:configure.ac:200: -1- AC_SUBST_TRACE([CC]) +m4trace:configure.ac:200: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:200: -1- AC_SUBST([CC]) +m4trace:configure.ac:200: -1- AC_SUBST_TRACE([CC]) +m4trace:configure.ac:200: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:200: -1- AC_SUBST([CC]) +m4trace:configure.ac:200: -1- AC_SUBST_TRACE([CC]) +m4trace:configure.ac:200: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:200: -1- AC_SUBST([ac_ct_CC]) +m4trace:configure.ac:200: -1- AC_SUBST_TRACE([ac_ct_CC]) +m4trace:configure.ac:200: -1- m4_pattern_allow([^ac_ct_CC$]) +m4trace:configure.ac:200: -1- AC_SUBST([CCDEPMODE], [depmode=$am_cv_CC_dependencies_compiler_type]) +m4trace:configure.ac:200: -1- AC_SUBST_TRACE([CCDEPMODE]) +m4trace:configure.ac:200: -1- m4_pattern_allow([^CCDEPMODE$]) +m4trace:configure.ac:200: -1- AM_CONDITIONAL([am__fastdepCC], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3]) -m4trace:configure.ac:112: -1- AC_SUBST([am__fastdepCC_TRUE]) -m4trace:configure.ac:112: -1- AC_SUBST_TRACE([am__fastdepCC_TRUE]) -m4trace:configure.ac:112: -1- m4_pattern_allow([^am__fastdepCC_TRUE$]) -m4trace:configure.ac:112: -1- AC_SUBST([am__fastdepCC_FALSE]) -m4trace:configure.ac:112: -1- AC_SUBST_TRACE([am__fastdepCC_FALSE]) -m4trace:configure.ac:112: -1- m4_pattern_allow([^am__fastdepCC_FALSE$]) -m4trace:configure.ac:112: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_TRUE]) -m4trace:configure.ac:112: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_FALSE]) -m4trace:configure.ac:113: -1- AC_REQUIRE_AUX_FILE([install-sh]) -m4trace:configure.ac:113: -1- AC_SUBST([INSTALL_PROGRAM]) -m4trace:configure.ac:113: -1- AC_SUBST_TRACE([INSTALL_PROGRAM]) -m4trace:configure.ac:113: -1- m4_pattern_allow([^INSTALL_PROGRAM$]) -m4trace:configure.ac:113: -1- AC_SUBST([INSTALL_SCRIPT]) -m4trace:configure.ac:113: -1- AC_SUBST_TRACE([INSTALL_SCRIPT]) -m4trace:configure.ac:113: -1- m4_pattern_allow([^INSTALL_SCRIPT$]) -m4trace:configure.ac:113: -1- AC_SUBST([INSTALL_DATA]) -m4trace:configure.ac:113: -1- AC_SUBST_TRACE([INSTALL_DATA]) -m4trace:configure.ac:113: -1- m4_pattern_allow([^INSTALL_DATA$]) -m4trace:configure.ac:115: -1- AC_PROG_LIBTOOL -m4trace:configure.ac:115: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete. -You should run autoupdate.], [../../lib/autoconf/general.m4:209: AC_HELP_STRING is expanded from... -../../lib/autoconf/general.m4:1364: AC_ARG_ENABLE is expanded from... -aclocal.m4:1937: AC_ENABLE_SHARED is expanded from... -aclocal.m4:91: AC_LIBTOOL_SETUP is expanded from... -aclocal.m4:71: _AC_PROG_LIBTOOL is expanded from... -aclocal.m4:36: AC_PROG_LIBTOOL is expanded from... -configure.ac:115: the top level]) -m4trace:configure.ac:115: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete. -You should run autoupdate.], [../../lib/autoconf/general.m4:209: AC_HELP_STRING is expanded from... -../../lib/autoconf/general.m4:1364: AC_ARG_ENABLE is expanded from... -aclocal.m4:1976: AC_ENABLE_STATIC is expanded from... -aclocal.m4:91: AC_LIBTOOL_SETUP is expanded from... -aclocal.m4:71: _AC_PROG_LIBTOOL is expanded from... -aclocal.m4:36: AC_PROG_LIBTOOL is expanded from... -configure.ac:115: the top level]) -m4trace:configure.ac:115: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete. -You should run autoupdate.], [../../lib/autoconf/general.m4:209: AC_HELP_STRING is expanded from... -../../lib/autoconf/general.m4:1364: AC_ARG_ENABLE is expanded from... -aclocal.m4:2015: AC_ENABLE_FAST_INSTALL is expanded from... -aclocal.m4:91: AC_LIBTOOL_SETUP is expanded from... -aclocal.m4:71: _AC_PROG_LIBTOOL is expanded from... -aclocal.m4:36: AC_PROG_LIBTOOL is expanded from... -configure.ac:115: the top level]) -m4trace:configure.ac:115: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete. -You should run autoupdate.], [../../lib/autoconf/general.m4:209: AC_HELP_STRING is expanded from... -../../lib/autoconf/general.m4:1382: AC_ARG_WITH is expanded from... -aclocal.m4:2156: AC_PROG_LD is expanded from... -aclocal.m4:91: AC_LIBTOOL_SETUP is expanded from... -aclocal.m4:71: _AC_PROG_LIBTOOL is expanded from... -aclocal.m4:36: AC_PROG_LIBTOOL is expanded from... -configure.ac:115: the top level]) -m4trace:configure.ac:115: -1- AC_SUBST([SED]) -m4trace:configure.ac:115: -1- AC_SUBST_TRACE([SED]) -m4trace:configure.ac:115: -1- m4_pattern_allow([^SED$]) -m4trace:configure.ac:115: -1- AC_SUBST([GREP]) -m4trace:configure.ac:115: -1- AC_SUBST_TRACE([GREP]) -m4trace:configure.ac:115: -1- m4_pattern_allow([^GREP$]) -m4trace:configure.ac:115: -1- AC_SUBST([GREP]) -m4trace:configure.ac:115: -1- AC_SUBST_TRACE([GREP]) -m4trace:configure.ac:115: -1- m4_pattern_allow([^GREP$]) -m4trace:configure.ac:115: -1- AC_SUBST([EGREP]) -m4trace:configure.ac:115: -1- AC_SUBST_TRACE([EGREP]) -m4trace:configure.ac:115: -1- m4_pattern_allow([^EGREP$]) -m4trace:configure.ac:115: -1- AC_SUBST([EGREP]) -m4trace:configure.ac:115: -1- AC_SUBST_TRACE([EGREP]) -m4trace:configure.ac:115: -1- m4_pattern_allow([^EGREP$]) -m4trace:configure.ac:115: -1- AC_SUBST([LN_S], [$as_ln_s]) -m4trace:configure.ac:115: -1- AC_SUBST_TRACE([LN_S]) -m4trace:configure.ac:115: -1- m4_pattern_allow([^LN_S$]) -m4trace:configure.ac:115: -1- AC_SUBST([ECHO]) -m4trace:configure.ac:115: -1- AC_SUBST_TRACE([ECHO]) -m4trace:configure.ac:115: -1- m4_pattern_allow([^ECHO$]) -m4trace:configure.ac:115: -1- AC_SUBST([AR]) -m4trace:configure.ac:115: -1- AC_SUBST_TRACE([AR]) -m4trace:configure.ac:115: -1- m4_pattern_allow([^AR$]) -m4trace:configure.ac:115: -1- AC_SUBST([RANLIB]) -m4trace:configure.ac:115: -1- AC_SUBST_TRACE([RANLIB]) -m4trace:configure.ac:115: -1- m4_pattern_allow([^RANLIB$]) -m4trace:configure.ac:115: -1- AC_SUBST([STRIP]) -m4trace:configure.ac:115: -1- AC_SUBST_TRACE([STRIP]) -m4trace:configure.ac:115: -1- m4_pattern_allow([^STRIP$]) -m4trace:configure.ac:115: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete. -You should run autoupdate.], [../../lib/autoconf/general.m4:209: AC_HELP_STRING is expanded from... -../../lib/autoconf/general.m4:1364: AC_ARG_ENABLE is expanded from... -aclocal.m4:91: AC_LIBTOOL_SETUP is expanded from... -aclocal.m4:71: _AC_PROG_LIBTOOL is expanded from... -aclocal.m4:36: AC_PROG_LIBTOOL is expanded from... -configure.ac:115: the top level]) -m4trace:configure.ac:115: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete. -You should run autoupdate.], [../../lib/autoconf/general.m4:209: AC_HELP_STRING is expanded from... -../../lib/autoconf/general.m4:1382: AC_ARG_WITH is expanded from... -aclocal.m4:91: AC_LIBTOOL_SETUP is expanded from... -aclocal.m4:71: _AC_PROG_LIBTOOL is expanded from... -aclocal.m4:36: AC_PROG_LIBTOOL is expanded from... -configure.ac:115: the top level]) -m4trace:configure.ac:115: -1- _m4_warn([obsolete], [The macro `AC_TRY_LINK' is obsolete. -You should run autoupdate.], [../../lib/autoconf/general.m4:2414: AC_TRY_LINK is expanded from... -../../lib/m4sugar/m4sh.m4:516: AS_IF is expanded from... -../../lib/autoconf/general.m4:1898: AC_CACHE_VAL is expanded from... -../../lib/autoconf/general.m4:1911: AC_CACHE_CHECK is expanded from... -aclocal.m4:480: _LT_AC_LOCK is expanded from... -aclocal.m4:1084: AC_LIBTOOL_SYS_HARD_LINK_LOCKS is expanded from... -aclocal.m4:2679: _LT_AC_LANG_C_CONFIG is expanded from... -aclocal.m4:2678: AC_LIBTOOL_LANG_C_CONFIG is expanded from... -aclocal.m4:91: AC_LIBTOOL_SETUP is expanded from... -aclocal.m4:71: _AC_PROG_LIBTOOL is expanded from... -aclocal.m4:36: AC_PROG_LIBTOOL is expanded from... -configure.ac:115: the top level]) -m4trace:configure.ac:115: -1- AH_OUTPUT([HAVE_DLFCN_H], [/* Define to 1 if you have the header file. */ +m4trace:configure.ac:200: -1- AC_SUBST([am__fastdepCC_TRUE]) +m4trace:configure.ac:200: -1- AC_SUBST_TRACE([am__fastdepCC_TRUE]) +m4trace:configure.ac:200: -1- m4_pattern_allow([^am__fastdepCC_TRUE$]) +m4trace:configure.ac:200: -1- AC_SUBST([am__fastdepCC_FALSE]) +m4trace:configure.ac:200: -1- AC_SUBST_TRACE([am__fastdepCC_FALSE]) +m4trace:configure.ac:200: -1- m4_pattern_allow([^am__fastdepCC_FALSE$]) +m4trace:configure.ac:200: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_TRUE]) +m4trace:configure.ac:200: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_FALSE]) +m4trace:configure.ac:204: -1- AC_SUBST([CXX]) +m4trace:configure.ac:204: -1- AC_SUBST_TRACE([CXX]) +m4trace:configure.ac:204: -1- m4_pattern_allow([^CXX$]) +m4trace:configure.ac:204: -1- AC_SUBST([CXXFLAGS]) +m4trace:configure.ac:204: -1- AC_SUBST_TRACE([CXXFLAGS]) +m4trace:configure.ac:204: -1- m4_pattern_allow([^CXXFLAGS$]) +m4trace:configure.ac:204: -1- AC_SUBST([LDFLAGS]) +m4trace:configure.ac:204: -1- AC_SUBST_TRACE([LDFLAGS]) +m4trace:configure.ac:204: -1- m4_pattern_allow([^LDFLAGS$]) +m4trace:configure.ac:204: -1- AC_SUBST([LIBS]) +m4trace:configure.ac:204: -1- AC_SUBST_TRACE([LIBS]) +m4trace:configure.ac:204: -1- m4_pattern_allow([^LIBS$]) +m4trace:configure.ac:204: -1- AC_SUBST([CPPFLAGS]) +m4trace:configure.ac:204: -1- AC_SUBST_TRACE([CPPFLAGS]) +m4trace:configure.ac:204: -1- m4_pattern_allow([^CPPFLAGS$]) +m4trace:configure.ac:204: -1- AC_SUBST([CXX]) +m4trace:configure.ac:204: -1- AC_SUBST_TRACE([CXX]) +m4trace:configure.ac:204: -1- m4_pattern_allow([^CXX$]) +m4trace:configure.ac:204: -1- AC_SUBST([ac_ct_CXX]) +m4trace:configure.ac:204: -1- AC_SUBST_TRACE([ac_ct_CXX]) +m4trace:configure.ac:204: -1- m4_pattern_allow([^ac_ct_CXX$]) +m4trace:configure.ac:204: -1- AC_SUBST([CXXDEPMODE], [depmode=$am_cv_CXX_dependencies_compiler_type]) +m4trace:configure.ac:204: -1- AC_SUBST_TRACE([CXXDEPMODE]) +m4trace:configure.ac:204: -1- m4_pattern_allow([^CXXDEPMODE$]) +m4trace:configure.ac:204: -1- AM_CONDITIONAL([am__fastdepCXX], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CXX_dependencies_compiler_type" = gcc3]) +m4trace:configure.ac:204: -1- AC_SUBST([am__fastdepCXX_TRUE]) +m4trace:configure.ac:204: -1- AC_SUBST_TRACE([am__fastdepCXX_TRUE]) +m4trace:configure.ac:204: -1- m4_pattern_allow([^am__fastdepCXX_TRUE$]) +m4trace:configure.ac:204: -1- AC_SUBST([am__fastdepCXX_FALSE]) +m4trace:configure.ac:204: -1- AC_SUBST_TRACE([am__fastdepCXX_FALSE]) +m4trace:configure.ac:204: -1- m4_pattern_allow([^am__fastdepCXX_FALSE$]) +m4trace:configure.ac:204: -1- _AM_SUBST_NOTMAKE([am__fastdepCXX_TRUE]) +m4trace:configure.ac:204: -1- _AM_SUBST_NOTMAKE([am__fastdepCXX_FALSE]) +m4trace:configure.ac:209: -1- AM_PROG_CC_C_O +m4trace:configure.ac:209: -1- AC_DEFINE_TRACE_LITERAL([NO_MINUS_C_MINUS_O]) +m4trace:configure.ac:209: -1- m4_pattern_allow([^NO_MINUS_C_MINUS_O$]) +m4trace:configure.ac:209: -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:209: -1- AC_REQUIRE_AUX_FILE([compile]) +m4trace:configure.ac:212: -1- AC_REQUIRE_AUX_FILE([install-sh]) +m4trace:configure.ac:212: -1- AC_SUBST([INSTALL_PROGRAM]) +m4trace:configure.ac:212: -1- AC_SUBST_TRACE([INSTALL_PROGRAM]) +m4trace:configure.ac:212: -1- m4_pattern_allow([^INSTALL_PROGRAM$]) +m4trace:configure.ac:212: -1- AC_SUBST([INSTALL_SCRIPT]) +m4trace:configure.ac:212: -1- AC_SUBST_TRACE([INSTALL_SCRIPT]) +m4trace:configure.ac:212: -1- m4_pattern_allow([^INSTALL_SCRIPT$]) +m4trace:configure.ac:212: -1- AC_SUBST([INSTALL_DATA]) +m4trace:configure.ac:212: -1- AC_SUBST_TRACE([INSTALL_DATA]) +m4trace:configure.ac:212: -1- m4_pattern_allow([^INSTALL_DATA$]) +m4trace:configure.ac:213: -1- AC_SUBST([SED]) +m4trace:configure.ac:213: -1- AC_SUBST_TRACE([SED]) +m4trace:configure.ac:213: -1- m4_pattern_allow([^SED$]) +m4trace:configure.ac:213: -1- AC_SUBST([SED]) +m4trace:configure.ac:213: -1- AC_SUBST_TRACE([SED]) +m4trace:configure.ac:213: -1- m4_pattern_allow([^SED$]) +m4trace:configure.ac:214: -1- AC_SUBST([LN_S], [$as_ln_s]) +m4trace:configure.ac:214: -1- AC_SUBST_TRACE([LN_S]) +m4trace:configure.ac:214: -1- m4_pattern_allow([^LN_S$]) +m4trace:configure.ac:215: -1- AC_REQUIRE_AUX_FILE([install-sh]) +m4trace:configure.ac:218: -1- AC_PROG_LIBTOOL +m4trace:configure.ac:218: -1- _m4_warn([obsolete], [The macro `AC_PROG_LIBTOOL' is obsolete. +You should run autoupdate.], [m4/libtool.m4:102: AC_PROG_LIBTOOL is expanded from... +configure.ac:218: the top level]) +m4trace:configure.ac:218: -1- LT_INIT +m4trace:configure.ac:218: -1- _m4_warn([obsolete], [back quotes and double quotes must not be escaped in: $as_me:$LINENO: WARNING: Libtool does not cope well with whitespace in \`pwd\`], [m4/libtool.m4:57: _LT_CHECK_BUILDDIR is expanded from... +m4/libtool.m4:67: LT_INIT is expanded from... +m4/libtool.m4:102: AC_PROG_LIBTOOL is expanded from... +configure.ac:218: the top level]) +m4trace:configure.ac:218: -1- _m4_warn([obsolete], [back quotes and double quotes must not be escaped in: $as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`], [m4/libtool.m4:57: _LT_CHECK_BUILDDIR is expanded from... +m4/libtool.m4:67: LT_INIT is expanded from... +m4/libtool.m4:102: AC_PROG_LIBTOOL is expanded from... +configure.ac:218: the top level]) +m4trace:configure.ac:218: -1- m4_pattern_forbid([^_?LT_[A-Z_]+$]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$]) +m4trace:configure.ac:218: -1- AC_REQUIRE_AUX_FILE([ltmain.sh]) +m4trace:configure.ac:218: -1- AC_SUBST([LIBTOOL]) +m4trace:configure.ac:218: -1- AC_SUBST_TRACE([LIBTOOL]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^LIBTOOL$]) +m4trace:configure.ac:218: -1- AC_SUBST([SED]) +m4trace:configure.ac:218: -1- AC_SUBST_TRACE([SED]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^SED$]) +m4trace:configure.ac:218: -1- AC_SUBST([SED]) +m4trace:configure.ac:218: -1- AC_SUBST_TRACE([SED]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^SED$]) +m4trace:configure.ac:218: -1- AC_SUBST([GREP]) +m4trace:configure.ac:218: -1- AC_SUBST_TRACE([GREP]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^GREP$]) +m4trace:configure.ac:218: -1- AC_SUBST([GREP]) +m4trace:configure.ac:218: -1- AC_SUBST_TRACE([GREP]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^GREP$]) +m4trace:configure.ac:218: -1- AC_SUBST([EGREP]) +m4trace:configure.ac:218: -1- AC_SUBST_TRACE([EGREP]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^EGREP$]) +m4trace:configure.ac:218: -1- AC_SUBST([EGREP]) +m4trace:configure.ac:218: -1- AC_SUBST_TRACE([EGREP]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^EGREP$]) +m4trace:configure.ac:218: -1- AC_SUBST([FGREP]) +m4trace:configure.ac:218: -1- AC_SUBST_TRACE([FGREP]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^FGREP$]) +m4trace:configure.ac:218: -1- AC_SUBST([FGREP]) +m4trace:configure.ac:218: -1- AC_SUBST_TRACE([FGREP]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^FGREP$]) +m4trace:configure.ac:218: -1- AC_SUBST([GREP]) +m4trace:configure.ac:218: -1- AC_SUBST_TRACE([GREP]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^GREP$]) +m4trace:configure.ac:218: -1- AC_SUBST([LD]) +m4trace:configure.ac:218: -1- AC_SUBST_TRACE([LD]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^LD$]) +m4trace:configure.ac:218: -1- AC_SUBST([DUMPBIN]) +m4trace:configure.ac:218: -1- AC_SUBST_TRACE([DUMPBIN]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^DUMPBIN$]) +m4trace:configure.ac:218: -1- AC_SUBST([ac_ct_DUMPBIN]) +m4trace:configure.ac:218: -1- AC_SUBST_TRACE([ac_ct_DUMPBIN]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^ac_ct_DUMPBIN$]) +m4trace:configure.ac:218: -1- AC_SUBST([DUMPBIN]) +m4trace:configure.ac:218: -1- AC_SUBST_TRACE([DUMPBIN]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^DUMPBIN$]) +m4trace:configure.ac:218: -1- AC_SUBST([NM]) +m4trace:configure.ac:218: -1- AC_SUBST_TRACE([NM]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^NM$]) +m4trace:configure.ac:218: -1- AC_SUBST([AR]) +m4trace:configure.ac:218: -1- AC_SUBST_TRACE([AR]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^AR$]) +m4trace:configure.ac:218: -1- AC_SUBST([STRIP]) +m4trace:configure.ac:218: -1- AC_SUBST_TRACE([STRIP]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^STRIP$]) +m4trace:configure.ac:218: -1- AC_SUBST([RANLIB]) +m4trace:configure.ac:218: -1- AC_SUBST_TRACE([RANLIB]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^RANLIB$]) +m4trace:configure.ac:218: -1- m4_pattern_allow([LT_OBJDIR]) +m4trace:configure.ac:218: -1- AC_DEFINE_TRACE_LITERAL([LT_OBJDIR]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^LT_OBJDIR$]) +m4trace:configure.ac:218: -1- AH_OUTPUT([LT_OBJDIR], [/* Define to the sub-directory in which libtool stores uninstalled libraries. + */ +#undef LT_OBJDIR]) +m4trace:configure.ac:218: -1- AC_SUBST([lt_ECHO]) +m4trace:configure.ac:218: -1- AC_SUBST_TRACE([lt_ECHO]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^lt_ECHO$]) +m4trace:configure.ac:218: -1- LT_SUPPORTED_TAG([CC]) +m4trace:configure.ac:218: -1- AC_SUBST([DSYMUTIL]) +m4trace:configure.ac:218: -1- AC_SUBST_TRACE([DSYMUTIL]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^DSYMUTIL$]) +m4trace:configure.ac:218: -1- AC_SUBST([NMEDIT]) +m4trace:configure.ac:218: -1- AC_SUBST_TRACE([NMEDIT]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^NMEDIT$]) +m4trace:configure.ac:218: -1- AH_OUTPUT([HAVE_DLFCN_H], [/* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H]) -m4trace:configure.ac:115: -1- AC_DEFINE_TRACE_LITERAL([STDC_HEADERS]) -m4trace:configure.ac:115: -1- m4_pattern_allow([^STDC_HEADERS$]) -m4trace:configure.ac:115: -1- AH_OUTPUT([STDC_HEADERS], [/* Define to 1 if you have the ANSI C header files. */ +m4trace:configure.ac:218: -1- AC_DEFINE_TRACE_LITERAL([STDC_HEADERS]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^STDC_HEADERS$]) +m4trace:configure.ac:218: -1- AH_OUTPUT([STDC_HEADERS], [/* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS]) -m4trace:configure.ac:115: -1- AH_OUTPUT([HAVE_SYS_TYPES_H], [/* Define to 1 if you have the header file. */ +m4trace:configure.ac:218: -1- AH_OUTPUT([HAVE_SYS_TYPES_H], [/* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H]) -m4trace:configure.ac:115: -1- AH_OUTPUT([HAVE_SYS_STAT_H], [/* Define to 1 if you have the header file. */ +m4trace:configure.ac:218: -1- AH_OUTPUT([HAVE_SYS_STAT_H], [/* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H]) -m4trace:configure.ac:115: -1- AH_OUTPUT([HAVE_STDLIB_H], [/* Define to 1 if you have the header file. */ +m4trace:configure.ac:218: -1- AH_OUTPUT([HAVE_STDLIB_H], [/* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H]) -m4trace:configure.ac:115: -1- AH_OUTPUT([HAVE_STRING_H], [/* Define to 1 if you have the header file. */ +m4trace:configure.ac:218: -1- AH_OUTPUT([HAVE_STRING_H], [/* Define to 1 if you have the header file. */ #undef HAVE_STRING_H]) -m4trace:configure.ac:115: -1- AH_OUTPUT([HAVE_MEMORY_H], [/* Define to 1 if you have the header file. */ +m4trace:configure.ac:218: -1- AH_OUTPUT([HAVE_MEMORY_H], [/* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H]) -m4trace:configure.ac:115: -1- AH_OUTPUT([HAVE_STRINGS_H], [/* Define to 1 if you have the header file. */ +m4trace:configure.ac:218: -1- AH_OUTPUT([HAVE_STRINGS_H], [/* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H]) -m4trace:configure.ac:115: -1- AH_OUTPUT([HAVE_INTTYPES_H], [/* Define to 1 if you have the header file. */ +m4trace:configure.ac:218: -1- AH_OUTPUT([HAVE_INTTYPES_H], [/* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H]) -m4trace:configure.ac:115: -1- AH_OUTPUT([HAVE_STDINT_H], [/* Define to 1 if you have the header file. */ +m4trace:configure.ac:218: -1- AH_OUTPUT([HAVE_STDINT_H], [/* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H]) -m4trace:configure.ac:115: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the header file. */ +m4trace:configure.ac:218: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H]) -m4trace:configure.ac:115: -1- _LT_AC_TAGCONFIG -m4trace:configure.ac:115: -1- _m4_warn([obsolete], [The macro `AC_HELP_STRING' is obsolete. -You should run autoupdate.], [../../lib/autoconf/general.m4:209: AC_HELP_STRING is expanded from... -../../lib/autoconf/general.m4:1382: AC_ARG_WITH is expanded from... -aclocal.m4:1815: _LT_AC_TAGCONFIG is expanded from... -aclocal.m4:91: AC_LIBTOOL_SETUP is expanded from... -aclocal.m4:71: _AC_PROG_LIBTOOL is expanded from... -aclocal.m4:36: AC_PROG_LIBTOOL is expanded from... -configure.ac:115: the top level]) -m4trace:configure.ac:115: -1- _m4_warn([obsolete], [back quotes and double quotes must not be escaped in: $as_me:$LINENO: error: tag name \"$tagname\" already exists], [aclocal.m4:1815: _LT_AC_TAGCONFIG is expanded from... -aclocal.m4:91: AC_LIBTOOL_SETUP is expanded from... -aclocal.m4:71: _AC_PROG_LIBTOOL is expanded from... -aclocal.m4:36: AC_PROG_LIBTOOL is expanded from... -configure.ac:115: the top level]) -m4trace:configure.ac:115: -1- _m4_warn([obsolete], [back quotes and double quotes must not be escaped in: $as_me: error: tag name \"$tagname\" already exists], [aclocal.m4:1815: _LT_AC_TAGCONFIG is expanded from... -aclocal.m4:91: AC_LIBTOOL_SETUP is expanded from... -aclocal.m4:71: _AC_PROG_LIBTOOL is expanded from... -aclocal.m4:36: AC_PROG_LIBTOOL is expanded from... -configure.ac:115: the top level]) -m4trace:configure.ac:115: -1- AC_SUBST([CXX]) -m4trace:configure.ac:115: -1- AC_SUBST_TRACE([CXX]) -m4trace:configure.ac:115: -1- m4_pattern_allow([^CXX$]) -m4trace:configure.ac:115: -1- AC_SUBST([CXXFLAGS]) -m4trace:configure.ac:115: -1- AC_SUBST_TRACE([CXXFLAGS]) -m4trace:configure.ac:115: -1- m4_pattern_allow([^CXXFLAGS$]) -m4trace:configure.ac:115: -1- AC_SUBST([LDFLAGS]) -m4trace:configure.ac:115: -1- AC_SUBST_TRACE([LDFLAGS]) -m4trace:configure.ac:115: -1- m4_pattern_allow([^LDFLAGS$]) -m4trace:configure.ac:115: -1- AC_SUBST([LIBS]) -m4trace:configure.ac:115: -1- AC_SUBST_TRACE([LIBS]) -m4trace:configure.ac:115: -1- m4_pattern_allow([^LIBS$]) -m4trace:configure.ac:115: -1- AC_SUBST([CPPFLAGS]) -m4trace:configure.ac:115: -1- AC_SUBST_TRACE([CPPFLAGS]) -m4trace:configure.ac:115: -1- m4_pattern_allow([^CPPFLAGS$]) -m4trace:configure.ac:115: -1- AC_SUBST([CXX]) -m4trace:configure.ac:115: -1- AC_SUBST_TRACE([CXX]) -m4trace:configure.ac:115: -1- m4_pattern_allow([^CXX$]) -m4trace:configure.ac:115: -1- AC_SUBST([ac_ct_CXX]) -m4trace:configure.ac:115: -1- AC_SUBST_TRACE([ac_ct_CXX]) -m4trace:configure.ac:115: -1- m4_pattern_allow([^ac_ct_CXX$]) -m4trace:configure.ac:115: -1- AC_SUBST([CXXDEPMODE], [depmode=$am_cv_CXX_dependencies_compiler_type]) -m4trace:configure.ac:115: -1- AC_SUBST_TRACE([CXXDEPMODE]) -m4trace:configure.ac:115: -1- m4_pattern_allow([^CXXDEPMODE$]) -m4trace:configure.ac:115: -1- AM_CONDITIONAL([am__fastdepCXX], [ +m4trace:configure.ac:218: -1- LT_SUPPORTED_TAG([CXX]) +m4trace:configure.ac:218: -1- AC_SUBST([CXX]) +m4trace:configure.ac:218: -1- AC_SUBST_TRACE([CXX]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^CXX$]) +m4trace:configure.ac:218: -1- AC_SUBST([CXXFLAGS]) +m4trace:configure.ac:218: -1- AC_SUBST_TRACE([CXXFLAGS]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^CXXFLAGS$]) +m4trace:configure.ac:218: -1- AC_SUBST([LDFLAGS]) +m4trace:configure.ac:218: -1- AC_SUBST_TRACE([LDFLAGS]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^LDFLAGS$]) +m4trace:configure.ac:218: -1- AC_SUBST([LIBS]) +m4trace:configure.ac:218: -1- AC_SUBST_TRACE([LIBS]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^LIBS$]) +m4trace:configure.ac:218: -1- AC_SUBST([CPPFLAGS]) +m4trace:configure.ac:218: -1- AC_SUBST_TRACE([CPPFLAGS]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^CPPFLAGS$]) +m4trace:configure.ac:218: -1- AC_SUBST([CXX]) +m4trace:configure.ac:218: -1- AC_SUBST_TRACE([CXX]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^CXX$]) +m4trace:configure.ac:218: -1- AC_SUBST([ac_ct_CXX]) +m4trace:configure.ac:218: -1- AC_SUBST_TRACE([ac_ct_CXX]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^ac_ct_CXX$]) +m4trace:configure.ac:218: -1- AC_SUBST([CXXDEPMODE], [depmode=$am_cv_CXX_dependencies_compiler_type]) +m4trace:configure.ac:218: -1- AC_SUBST_TRACE([CXXDEPMODE]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^CXXDEPMODE$]) +m4trace:configure.ac:218: -1- AM_CONDITIONAL([am__fastdepCXX], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3]) -m4trace:configure.ac:115: -1- AC_SUBST([am__fastdepCXX_TRUE]) -m4trace:configure.ac:115: -1- AC_SUBST_TRACE([am__fastdepCXX_TRUE]) -m4trace:configure.ac:115: -1- m4_pattern_allow([^am__fastdepCXX_TRUE$]) -m4trace:configure.ac:115: -1- AC_SUBST([am__fastdepCXX_FALSE]) -m4trace:configure.ac:115: -1- AC_SUBST_TRACE([am__fastdepCXX_FALSE]) -m4trace:configure.ac:115: -1- m4_pattern_allow([^am__fastdepCXX_FALSE$]) -m4trace:configure.ac:115: -1- _AM_SUBST_NOTMAKE([am__fastdepCXX_TRUE]) -m4trace:configure.ac:115: -1- _AM_SUBST_NOTMAKE([am__fastdepCXX_FALSE]) -m4trace:configure.ac:115: -1- AC_SUBST([CXXCPP]) -m4trace:configure.ac:115: -1- AC_SUBST_TRACE([CXXCPP]) -m4trace:configure.ac:115: -1- m4_pattern_allow([^CXXCPP$]) -m4trace:configure.ac:115: -1- AC_SUBST([CPPFLAGS]) -m4trace:configure.ac:115: -1- AC_SUBST_TRACE([CPPFLAGS]) -m4trace:configure.ac:115: -1- m4_pattern_allow([^CPPFLAGS$]) -m4trace:configure.ac:115: -1- AC_SUBST([CXXCPP]) -m4trace:configure.ac:115: -1- AC_SUBST_TRACE([CXXCPP]) -m4trace:configure.ac:115: -1- m4_pattern_allow([^CXXCPP$]) -m4trace:configure.ac:115: -1- AC_SUBST([F77]) -m4trace:configure.ac:115: -1- AC_SUBST_TRACE([F77]) -m4trace:configure.ac:115: -1- m4_pattern_allow([^F77$]) -m4trace:configure.ac:115: -1- AC_SUBST([FFLAGS]) -m4trace:configure.ac:115: -1- AC_SUBST_TRACE([FFLAGS]) -m4trace:configure.ac:115: -1- m4_pattern_allow([^FFLAGS$]) -m4trace:configure.ac:115: -1- AC_SUBST([LDFLAGS]) -m4trace:configure.ac:115: -1- AC_SUBST_TRACE([LDFLAGS]) -m4trace:configure.ac:115: -1- m4_pattern_allow([^LDFLAGS$]) -m4trace:configure.ac:115: -1- AC_SUBST([LIBS]) -m4trace:configure.ac:115: -1- AC_SUBST_TRACE([LIBS]) -m4trace:configure.ac:115: -1- m4_pattern_allow([^LIBS$]) -m4trace:configure.ac:115: -1- AC_SUBST([F77]) -m4trace:configure.ac:115: -1- AC_SUBST_TRACE([F77]) -m4trace:configure.ac:115: -1- m4_pattern_allow([^F77$]) -m4trace:configure.ac:115: -1- AC_SUBST([ac_ct_F77]) -m4trace:configure.ac:115: -1- AC_SUBST_TRACE([ac_ct_F77]) -m4trace:configure.ac:115: -1- m4_pattern_allow([^ac_ct_F77$]) -m4trace:configure.ac:115: -1- _m4_warn([obsolete], [The macro `AC_LANG_SAVE' is obsolete. -You should run autoupdate.], [../../lib/autoconf/lang.m4:167: AC_LANG_SAVE is expanded from... -aclocal.m4:4021: _LT_AC_LANG_GCJ_CONFIG is expanded from... -aclocal.m4:4020: AC_LIBTOOL_LANG_GCJ_CONFIG is expanded from... -aclocal.m4:1815: _LT_AC_TAGCONFIG is expanded from... -aclocal.m4:91: AC_LIBTOOL_SETUP is expanded from... -aclocal.m4:71: _AC_PROG_LIBTOOL is expanded from... -aclocal.m4:36: AC_PROG_LIBTOOL is expanded from... -configure.ac:115: the top level]) -m4trace:configure.ac:115: -1- _m4_warn([obsolete], [The macro `AC_LANG_RESTORE' is obsolete. -You should run autoupdate.], [../../lib/autoconf/lang.m4:176: AC_LANG_RESTORE is expanded from... -aclocal.m4:4021: _LT_AC_LANG_GCJ_CONFIG is expanded from... -aclocal.m4:4020: AC_LIBTOOL_LANG_GCJ_CONFIG is expanded from... -aclocal.m4:1815: _LT_AC_TAGCONFIG is expanded from... -aclocal.m4:91: AC_LIBTOOL_SETUP is expanded from... -aclocal.m4:71: _AC_PROG_LIBTOOL is expanded from... -aclocal.m4:36: AC_PROG_LIBTOOL is expanded from... -configure.ac:115: the top level]) -m4trace:configure.ac:115: -1- _m4_warn([obsolete], [The macro `AC_LANG_SAVE' is obsolete. -You should run autoupdate.], [../../lib/autoconf/lang.m4:167: AC_LANG_SAVE is expanded from... -aclocal.m4:4077: _LT_AC_LANG_RC_CONFIG is expanded from... -aclocal.m4:4076: AC_LIBTOOL_LANG_RC_CONFIG is expanded from... -aclocal.m4:1815: _LT_AC_TAGCONFIG is expanded from... -aclocal.m4:91: AC_LIBTOOL_SETUP is expanded from... -aclocal.m4:71: _AC_PROG_LIBTOOL is expanded from... -aclocal.m4:36: AC_PROG_LIBTOOL is expanded from... -configure.ac:115: the top level]) -m4trace:configure.ac:115: -1- _m4_warn([obsolete], [The macro `AC_LANG_RESTORE' is obsolete. -You should run autoupdate.], [../../lib/autoconf/lang.m4:176: AC_LANG_RESTORE is expanded from... -aclocal.m4:4077: _LT_AC_LANG_RC_CONFIG is expanded from... -aclocal.m4:4076: AC_LIBTOOL_LANG_RC_CONFIG is expanded from... -aclocal.m4:1815: _LT_AC_TAGCONFIG is expanded from... -aclocal.m4:91: AC_LIBTOOL_SETUP is expanded from... -aclocal.m4:71: _AC_PROG_LIBTOOL is expanded from... -aclocal.m4:36: AC_PROG_LIBTOOL is expanded from... -configure.ac:115: the top level]) -m4trace:configure.ac:115: -1- AC_SUBST([LIBTOOL]) -m4trace:configure.ac:115: -1- AC_SUBST_TRACE([LIBTOOL]) -m4trace:configure.ac:115: -1- m4_pattern_allow([^LIBTOOL$]) -m4trace:configure.ac:117: -1- AC_SUBST([HAVE_PKG_CONFIG]) -m4trace:configure.ac:117: -1- AC_SUBST_TRACE([HAVE_PKG_CONFIG]) -m4trace:configure.ac:117: -1- m4_pattern_allow([^HAVE_PKG_CONFIG$]) -m4trace:configure.ac:131: -1- AC_SUBST([XMKMF]) -m4trace:configure.ac:131: -1- AC_SUBST_TRACE([XMKMF]) -m4trace:configure.ac:131: -1- m4_pattern_allow([^XMKMF$]) -m4trace:configure.ac:131: -1- AC_DEFINE_TRACE_LITERAL([X_DISPLAY_MISSING]) -m4trace:configure.ac:131: -1- m4_pattern_allow([^X_DISPLAY_MISSING$]) -m4trace:configure.ac:131: -1- AH_OUTPUT([X_DISPLAY_MISSING], [/* Define to 1 if the X Window System is missing or not being used. */ +m4trace:configure.ac:218: -1- AC_SUBST([am__fastdepCXX_TRUE]) +m4trace:configure.ac:218: -1- AC_SUBST_TRACE([am__fastdepCXX_TRUE]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^am__fastdepCXX_TRUE$]) +m4trace:configure.ac:218: -1- AC_SUBST([am__fastdepCXX_FALSE]) +m4trace:configure.ac:218: -1- AC_SUBST_TRACE([am__fastdepCXX_FALSE]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^am__fastdepCXX_FALSE$]) +m4trace:configure.ac:218: -1- _AM_SUBST_NOTMAKE([am__fastdepCXX_TRUE]) +m4trace:configure.ac:218: -1- _AM_SUBST_NOTMAKE([am__fastdepCXX_FALSE]) +m4trace:configure.ac:218: -1- AC_SUBST([CXXCPP]) +m4trace:configure.ac:218: -1- AC_SUBST_TRACE([CXXCPP]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^CXXCPP$]) +m4trace:configure.ac:218: -1- AC_SUBST([CPPFLAGS]) +m4trace:configure.ac:218: -1- AC_SUBST_TRACE([CPPFLAGS]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^CPPFLAGS$]) +m4trace:configure.ac:218: -1- AC_SUBST([CXXCPP]) +m4trace:configure.ac:218: -1- AC_SUBST_TRACE([CXXCPP]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^CXXCPP$]) +m4trace:configure.ac:218: -1- AC_SUBST([LD]) +m4trace:configure.ac:218: -1- AC_SUBST_TRACE([LD]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^LD$]) +m4trace:configure.ac:224: -1- AC_SUBST([HAVE_PKG_CONFIG]) +m4trace:configure.ac:224: -1- AC_SUBST_TRACE([HAVE_PKG_CONFIG]) +m4trace:configure.ac:224: -1- m4_pattern_allow([^HAVE_PKG_CONFIG$]) +m4trace:configure.ac:238: -1- AC_SUBST([XMKMF]) +m4trace:configure.ac:238: -1- AC_SUBST_TRACE([XMKMF]) +m4trace:configure.ac:238: -1- m4_pattern_allow([^XMKMF$]) +m4trace:configure.ac:238: -1- AC_DEFINE_TRACE_LITERAL([X_DISPLAY_MISSING]) +m4trace:configure.ac:238: -1- m4_pattern_allow([^X_DISPLAY_MISSING$]) +m4trace:configure.ac:238: -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:131: -1- AC_SUBST([X_CFLAGS]) -m4trace:configure.ac:131: -1- AC_SUBST_TRACE([X_CFLAGS]) -m4trace:configure.ac:131: -1- m4_pattern_allow([^X_CFLAGS$]) -m4trace:configure.ac:131: -1- AC_SUBST([X_PRE_LIBS]) -m4trace:configure.ac:131: -1- AC_SUBST_TRACE([X_PRE_LIBS]) -m4trace:configure.ac:131: -1- m4_pattern_allow([^X_PRE_LIBS$]) -m4trace:configure.ac:131: -1- AC_SUBST([X_LIBS]) -m4trace:configure.ac:131: -1- AC_SUBST_TRACE([X_LIBS]) -m4trace:configure.ac:131: -1- m4_pattern_allow([^X_LIBS$]) -m4trace:configure.ac:131: -1- AC_SUBST([X_EXTRA_LIBS]) -m4trace:configure.ac:131: -1- AC_SUBST_TRACE([X_EXTRA_LIBS]) -m4trace:configure.ac:131: -1- m4_pattern_allow([^X_EXTRA_LIBS$]) -m4trace:configure.ac:263: -1- AH_OUTPUT([HAVE_DLOPEN], [/* Define to 1 if you have the `dlopen\' function. */ +m4trace:configure.ac:238: -1- AC_SUBST([X_CFLAGS]) +m4trace:configure.ac:238: -1- AC_SUBST_TRACE([X_CFLAGS]) +m4trace:configure.ac:238: -1- m4_pattern_allow([^X_CFLAGS$]) +m4trace:configure.ac:238: -1- AC_SUBST([X_PRE_LIBS]) +m4trace:configure.ac:238: -1- AC_SUBST_TRACE([X_PRE_LIBS]) +m4trace:configure.ac:238: -1- m4_pattern_allow([^X_PRE_LIBS$]) +m4trace:configure.ac:238: -1- AC_SUBST([X_LIBS]) +m4trace:configure.ac:238: -1- AC_SUBST_TRACE([X_LIBS]) +m4trace:configure.ac:238: -1- m4_pattern_allow([^X_LIBS$]) +m4trace:configure.ac:238: -1- AC_SUBST([X_EXTRA_LIBS]) +m4trace:configure.ac:238: -1- AC_SUBST_TRACE([X_EXTRA_LIBS]) +m4trace:configure.ac:238: -1- m4_pattern_allow([^X_EXTRA_LIBS$]) +m4trace:configure.ac:366: -1- AC_SUBST([LIBPNG_CONFIG]) +m4trace:configure.ac:366: -1- AC_SUBST_TRACE([LIBPNG_CONFIG]) +m4trace:configure.ac:366: -1- m4_pattern_allow([^LIBPNG_CONFIG$]) +m4trace:configure.ac:546: -1- AH_OUTPUT([HAVE_DLOPEN], [/* Define to 1 if you have the `dlopen\' function. */ #undef HAVE_DLOPEN]) -m4trace:configure.ac:273: -1- AH_OUTPUT([HAVE_ECVT], [/* Define to 1 if you have the `ecvt\' function. */ +m4trace:configure.ac:556: -1- AH_OUTPUT([HAVE_ECVT], [/* Define to 1 if you have the `ecvt\' function. */ #undef HAVE_ECVT]) -m4trace:configure.ac:274: -1- AH_OUTPUT([HAVE_FCVT], [/* Define to 1 if you have the `fcvt\' function. */ +m4trace:configure.ac:557: -1- AH_OUTPUT([HAVE_FCVT], [/* Define to 1 if you have the `fcvt\' function. */ #undef HAVE_FCVT]) -m4trace:configure.ac:287: -1- AC_SUBST([DNET_CONFIG]) -m4trace:configure.ac:287: -1- AC_SUBST_TRACE([DNET_CONFIG]) -m4trace:configure.ac:287: -1- m4_pattern_allow([^DNET_CONFIG$]) -m4trace:configure.ac:308: -1- AH_OUTPUT([HAVE_CRYPT_H], [/* Define to 1 if you have the header file. */ +m4trace:configure.ac:604: -1- AC_DEFINE_TRACE_LITERAL([NO_PROCPS]) +m4trace:configure.ac:604: -1- m4_pattern_allow([^NO_PROCPS$]) +m4trace:configure.ac:604: -1- AH_OUTPUT([NO_PROCPS], [/* Define to 1 if building without procps. */ +#undef NO_PROCPS]) +m4trace:configure.ac:618: -1- AC_SUBST([DNET_CONFIG]) +m4trace:configure.ac:618: -1- AC_SUBST_TRACE([DNET_CONFIG]) +m4trace:configure.ac:618: -1- m4_pattern_allow([^DNET_CONFIG$]) +m4trace:configure.ac:629: -1- AC_DEFINE_TRACE_LITERAL([DNET_IS_DUMBNET]) +m4trace:configure.ac:629: -1- m4_pattern_allow([^DNET_IS_DUMBNET$]) +m4trace:configure.ac:629: -1- AH_OUTPUT([DNET_IS_DUMBNET], [/* Define to 1 if substituting Debian\'s libdumbnet for libdnet. */ +#undef DNET_IS_DUMBNET]) +m4trace:configure.ac:638: -1- AC_DEFINE_TRACE_LITERAL([NO_DNET]) +m4trace:configure.ac:638: -1- m4_pattern_allow([^NO_DNET$]) +m4trace:configure.ac:638: -1- AH_OUTPUT([NO_DNET], [/* Define to 1 if building without libdnet. */ +#undef NO_DNET]) +m4trace:configure.ac:649: -1- AC_SUBST([ICU_CONFIG]) +m4trace:configure.ac:649: -1- AC_SUBST_TRACE([ICU_CONFIG]) +m4trace:configure.ac:649: -1- m4_pattern_allow([^ICU_CONFIG$]) +m4trace:configure.ac:684: -1- AC_SUBST([HAVE_CXX]) +m4trace:configure.ac:684: -1- AC_SUBST_TRACE([HAVE_CXX]) +m4trace:configure.ac:684: -1- m4_pattern_allow([^HAVE_CXX$]) +m4trace:configure.ac:710: -1- AC_SUBST([RPCGEN]) +m4trace:configure.ac:710: -1- AC_SUBST_TRACE([RPCGEN]) +m4trace:configure.ac:710: -1- m4_pattern_allow([^RPCGEN$]) +m4trace:configure.ac:719: -1- AH_OUTPUT([HAVE_CRYPT_H], [/* Define to 1 if you have the header file. */ #undef HAVE_CRYPT_H]) -m4trace:configure.ac:309: -1- AH_OUTPUT([HAVE_INTTYPES_H], [/* Define to 1 if you have the header file. */ +m4trace:configure.ac:720: -1- AH_OUTPUT([HAVE_INTTYPES_H], [/* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H]) -m4trace:configure.ac:310: -1- AH_OUTPUT([HAVE_STDINT_H], [/* Define to 1 if you have the header file. */ +m4trace:configure.ac:721: -1- AH_OUTPUT([HAVE_STDINT_H], [/* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H]) -m4trace:configure.ac:311: -1- AH_OUTPUT([HAVE_STDLIB_H], [/* Define to 1 if you have the header file. */ +m4trace:configure.ac:722: -1- AH_OUTPUT([HAVE_STDLIB_H], [/* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H]) -m4trace:configure.ac:312: -1- AH_OUTPUT([HAVE_WCHAR_H], [/* Define to 1 if you have the header file. */ +m4trace:configure.ac:723: -1- AH_OUTPUT([HAVE_WCHAR_H], [/* Define to 1 if you have the header file. */ #undef HAVE_WCHAR_H]) -m4trace:configure.ac:313: -1- AH_OUTPUT([HAVE_SYS_INTTYPES_H], [/* Define to 1 if you have the header file. */ +m4trace:configure.ac:724: -1- AH_OUTPUT([HAVE_SYS_INTTYPES_H], [/* Define to 1 if you have the header file. */ #undef HAVE_SYS_INTTYPES_H]) -m4trace:configure.ac:314: -1- AH_OUTPUT([HAVE_SYS_IO_H], [/* Define to 1 if you have the header file. */ +m4trace:configure.ac:725: -1- AH_OUTPUT([HAVE_SYS_IO_H], [/* Define to 1 if you have the header file. */ #undef HAVE_SYS_IO_H]) -m4trace:configure.ac:315: -1- AH_OUTPUT([HAVE_SYS_PARAM_H], [/* Define to 1 if you have the header file. */ +m4trace:configure.ac:726: -1- AH_OUTPUT([HAVE_SYS_PARAM_H], [/* Define to 1 if you have the header file. */ #undef HAVE_SYS_PARAM_H]) -m4trace:configure.ac:316: -1- AH_OUTPUT([HAVE_SYS_SYSINFO_H], [/* Define to 1 if you have the header file. */ +m4trace:configure.ac:727: -1- AH_OUTPUT([HAVE_SYS_SYSINFO_H], [/* Define to 1 if you have the header file. */ #undef HAVE_SYS_SYSINFO_H]) -m4trace:configure.ac:317: -1- AH_OUTPUT([HAVE_SYS_TYPES_H], [/* Define to 1 if you have the header file. */ +m4trace:configure.ac:728: -1- AH_OUTPUT([HAVE_SYS_TYPES_H], [/* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H]) -m4trace:configure.ac:318: -1- AH_OUTPUT([HAVE_SYS_USER_H], [/* Define to 1 if you have the header file. */ +m4trace:configure.ac:729: -1- AH_OUTPUT([HAVE_SYS_USER_H], [/* Define to 1 if you have the header file. */ #undef HAVE_SYS_USER_H]) -m4trace:configure.ac:326: -1- AH_OUTPUT([HAVE_SYS_VFS_H], [/* Define to 1 if you have the header file. */ +m4trace:configure.ac:737: -1- AH_OUTPUT([HAVE_SYS_VFS_H], [/* Define to 1 if you have the header file. */ #undef HAVE_SYS_VFS_H]) -m4trace:configure.ac:327: -1- AH_OUTPUT([HAVE_SYSLIMITS_H], [/* Define to 1 if you have the header file. */ +m4trace:configure.ac:738: -1- AH_OUTPUT([HAVE_SYSLIMITS_H], [/* Define to 1 if you have the header file. */ #undef HAVE_SYSLIMITS_H]) -m4trace:configure.ac:328: -1- AH_OUTPUT([HAVE_UNWIND_H], [/* Define to 1 if you have the header file. */ +m4trace:configure.ac:739: -1- AH_OUTPUT([HAVE_UNWIND_H], [/* Define to 1 if you have the header file. */ #undef HAVE_UNWIND_H]) -m4trace:configure.ac:348: -1- AC_DEFINE_TRACE_LITERAL([HAVE__BOOL]) -m4trace:configure.ac:348: -1- m4_pattern_allow([^HAVE__BOOL$]) -m4trace:configure.ac:348: -1- AH_OUTPUT([HAVE__BOOL], [/* Define to 1 if the system has the type `_Bool\'. */ +m4trace:configure.ac:759: -1- AC_DEFINE_TRACE_LITERAL([HAVE__BOOL]) +m4trace:configure.ac:759: -1- m4_pattern_allow([^HAVE__BOOL$]) +m4trace:configure.ac:759: -1- AH_OUTPUT([HAVE__BOOL], [/* Define to 1 if the system has the type `_Bool\'. */ #undef HAVE__BOOL]) -m4trace:configure.ac:348: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STDBOOL_H]) -m4trace:configure.ac:348: -1- m4_pattern_allow([^HAVE_STDBOOL_H$]) -m4trace:configure.ac:348: -1- AH_OUTPUT([HAVE_STDBOOL_H], [/* Define to 1 if stdbool.h conforms to C99. */ +m4trace:configure.ac:759: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STDBOOL_H]) +m4trace:configure.ac:759: -1- m4_pattern_allow([^HAVE_STDBOOL_H$]) +m4trace:configure.ac:759: -1- AH_OUTPUT([HAVE_STDBOOL_H], [/* Define to 1 if stdbool.h conforms to C99. */ #undef HAVE_STDBOOL_H]) -m4trace:configure.ac:349: -1- AC_DEFINE_TRACE_LITERAL([const]) -m4trace:configure.ac:349: -1- m4_pattern_allow([^const$]) -m4trace:configure.ac:349: -1- AH_OUTPUT([const], [/* Define to empty if `const\' does not conform to ANSI C. */ +m4trace:configure.ac:760: -1- AC_DEFINE_TRACE_LITERAL([const]) +m4trace:configure.ac:760: -1- m4_pattern_allow([^const$]) +m4trace:configure.ac:760: -1- AH_OUTPUT([const], [/* Define to empty if `const\' does not conform to ANSI C. */ #undef const]) -m4trace:configure.ac:350: -1- AC_DEFINE_TRACE_LITERAL([uid_t]) -m4trace:configure.ac:350: -1- m4_pattern_allow([^uid_t$]) -m4trace:configure.ac:350: -1- AH_OUTPUT([uid_t], [/* Define to `int\' if doesn\'t define. */ +m4trace:configure.ac:761: -1- AC_DEFINE_TRACE_LITERAL([uid_t]) +m4trace:configure.ac:761: -1- m4_pattern_allow([^uid_t$]) +m4trace:configure.ac:761: -1- AH_OUTPUT([uid_t], [/* Define to `int\' if doesn\'t define. */ #undef uid_t]) -m4trace:configure.ac:350: -1- AC_DEFINE_TRACE_LITERAL([gid_t]) -m4trace:configure.ac:350: -1- m4_pattern_allow([^gid_t$]) -m4trace:configure.ac:350: -1- AH_OUTPUT([gid_t], [/* Define to `int\' if doesn\'t define. */ +m4trace:configure.ac:761: -1- AC_DEFINE_TRACE_LITERAL([gid_t]) +m4trace:configure.ac:761: -1- m4_pattern_allow([^gid_t$]) +m4trace:configure.ac:761: -1- AH_OUTPUT([gid_t], [/* Define to `int\' if doesn\'t define. */ #undef gid_t]) -m4trace:configure.ac:351: -1- AH_OUTPUT([inline], [/* Define to `__inline__\' or `__inline\' if that\'s what the C compiler +m4trace:configure.ac:762: -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:352: -1- AC_DEFINE_TRACE_LITERAL([mode_t]) -m4trace:configure.ac:352: -1- m4_pattern_allow([^mode_t$]) -m4trace:configure.ac:352: -1- AH_OUTPUT([mode_t], [/* Define to `int\' if does not define. */ +m4trace:configure.ac:763: -1- AC_DEFINE_TRACE_LITERAL([mode_t]) +m4trace:configure.ac:763: -1- m4_pattern_allow([^mode_t$]) +m4trace:configure.ac:763: -1- AH_OUTPUT([mode_t], [/* Define to `int\' if does not define. */ #undef mode_t]) -m4trace:configure.ac:353: -1- AC_DEFINE_TRACE_LITERAL([off_t]) -m4trace:configure.ac:353: -1- m4_pattern_allow([^off_t$]) -m4trace:configure.ac:353: -1- AH_OUTPUT([off_t], [/* Define to `long int\' if does not define. */ +m4trace:configure.ac:764: -1- AC_DEFINE_TRACE_LITERAL([off_t]) +m4trace:configure.ac:764: -1- m4_pattern_allow([^off_t$]) +m4trace:configure.ac:764: -1- AH_OUTPUT([off_t], [/* Define to `long int\' if does not define. */ #undef off_t]) -m4trace:configure.ac:354: -1- AC_DEFINE_TRACE_LITERAL([pid_t]) -m4trace:configure.ac:354: -1- m4_pattern_allow([^pid_t$]) -m4trace:configure.ac:354: -1- AH_OUTPUT([pid_t], [/* Define to `int\' if does not define. */ +m4trace:configure.ac:765: -1- AC_DEFINE_TRACE_LITERAL([pid_t]) +m4trace:configure.ac:765: -1- m4_pattern_allow([^pid_t$]) +m4trace:configure.ac:765: -1- AH_OUTPUT([pid_t], [/* Define to `int\' if does not define. */ #undef pid_t]) -m4trace:configure.ac:355: -1- AC_DEFINE_TRACE_LITERAL([size_t]) -m4trace:configure.ac:355: -1- m4_pattern_allow([^size_t$]) -m4trace:configure.ac:355: -1- AH_OUTPUT([size_t], [/* Define to `unsigned int\' if does not define. */ +m4trace:configure.ac:766: -1- AC_DEFINE_TRACE_LITERAL([size_t]) +m4trace:configure.ac:766: -1- m4_pattern_allow([^size_t$]) +m4trace:configure.ac:766: -1- AH_OUTPUT([size_t], [/* Define to `unsigned int\' if does not define. */ #undef size_t]) -m4trace:configure.ac:356: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_STAT_ST_RDEV]) -m4trace:configure.ac:356: -1- m4_pattern_allow([^HAVE_STRUCT_STAT_ST_RDEV$]) -m4trace:configure.ac:356: -1- AH_OUTPUT([HAVE_STRUCT_STAT_ST_RDEV], [/* Define to 1 if `st_rdev\' is member of `struct stat\'. */ +m4trace:configure.ac:767: -1- AC_DEFINE_TRACE_LITERAL([HAVE_STRUCT_STAT_ST_RDEV]) +m4trace:configure.ac:767: -1- m4_pattern_allow([^HAVE_STRUCT_STAT_ST_RDEV$]) +m4trace:configure.ac:767: -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:357: -1- AC_DEFINE_TRACE_LITERAL([TIME_WITH_SYS_TIME]) -m4trace:configure.ac:357: -1- m4_pattern_allow([^TIME_WITH_SYS_TIME$]) -m4trace:configure.ac:357: -1- AH_OUTPUT([TIME_WITH_SYS_TIME], [/* Define to 1 if you can safely include both and . */ +m4trace:configure.ac:768: -1- AC_DEFINE_TRACE_LITERAL([TIME_WITH_SYS_TIME]) +m4trace:configure.ac:768: -1- m4_pattern_allow([^TIME_WITH_SYS_TIME$]) +m4trace:configure.ac:768: -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:358: -1- AC_DEFINE_TRACE_LITERAL([TM_IN_SYS_TIME]) -m4trace:configure.ac:358: -1- m4_pattern_allow([^TM_IN_SYS_TIME$]) -m4trace:configure.ac:358: -1- AH_OUTPUT([TM_IN_SYS_TIME], [/* Define to 1 if your declares `struct tm\'. */ +m4trace:configure.ac:769: -1- AC_DEFINE_TRACE_LITERAL([TM_IN_SYS_TIME]) +m4trace:configure.ac:769: -1- m4_pattern_allow([^TM_IN_SYS_TIME$]) +m4trace:configure.ac:769: -1- AH_OUTPUT([TM_IN_SYS_TIME], [/* Define to 1 if your declares `struct tm\'. */ #undef TM_IN_SYS_TIME]) -m4trace:configure.ac:359: -1- AC_DEFINE_TRACE_LITERAL([volatile]) -m4trace:configure.ac:359: -1- m4_pattern_allow([^volatile$]) -m4trace:configure.ac:359: -1- AH_OUTPUT([volatile], [/* Define to empty if the keyword `volatile\' does not work. Warning: valid +m4trace:configure.ac:770: -1- AC_DEFINE_TRACE_LITERAL([volatile]) +m4trace:configure.ac:770: -1- m4_pattern_allow([^volatile$]) +m4trace:configure.ac:770: -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:372: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete. +m4trace:configure.ac:780: -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:372: the top level]) -m4trace:configure.ac:389: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete. +configure.ac:780: the top level]) +m4trace:configure.ac:798: -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:389: the top level]) -m4trace:configure.ac:406: -1- AH_OUTPUT([HAVE_LSEEK], [/* Define to 1 if you have the `lseek\' function. */ +configure.ac:798: the top level]) +m4trace:configure.ac:815: -1- AH_OUTPUT([HAVE_LSEEK], [/* Define to 1 if you have the `lseek\' function. */ #undef HAVE_LSEEK]) -m4trace:configure.ac:415: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete. +m4trace:configure.ac:825: -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:415: the top level]) -m4trace:configure.ac:436: -1- _m4_warn([obsolete], [The macro `AC_TRY_COMPILE' is obsolete. +configure.ac:825: the top level]) +m4trace:configure.ac:848: -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:436: the top level]) -m4trace:configure.ac:508: -1- AM_CONDITIONAL([BUILD_HGFSMOUNTER], [test "$buildHgfsmounter" = "yes"]) -m4trace:configure.ac:508: -1- AC_SUBST([BUILD_HGFSMOUNTER_TRUE]) -m4trace:configure.ac:508: -1- AC_SUBST_TRACE([BUILD_HGFSMOUNTER_TRUE]) -m4trace:configure.ac:508: -1- m4_pattern_allow([^BUILD_HGFSMOUNTER_TRUE$]) -m4trace:configure.ac:508: -1- AC_SUBST([BUILD_HGFSMOUNTER_FALSE]) -m4trace:configure.ac:508: -1- AC_SUBST_TRACE([BUILD_HGFSMOUNTER_FALSE]) -m4trace:configure.ac:508: -1- m4_pattern_allow([^BUILD_HGFSMOUNTER_FALSE$]) -m4trace:configure.ac:508: -1- _AM_SUBST_NOTMAKE([BUILD_HGFSMOUNTER_TRUE]) -m4trace:configure.ac:508: -1- _AM_SUBST_NOTMAKE([BUILD_HGFSMOUNTER_FALSE]) -m4trace:configure.ac:509: -1- AM_CONDITIONAL([LINUX], [test "$os" = "linux"]) -m4trace:configure.ac:509: -1- AC_SUBST([LINUX_TRUE]) -m4trace:configure.ac:509: -1- AC_SUBST_TRACE([LINUX_TRUE]) -m4trace:configure.ac:509: -1- m4_pattern_allow([^LINUX_TRUE$]) -m4trace:configure.ac:509: -1- AC_SUBST([LINUX_FALSE]) -m4trace:configure.ac:509: -1- AC_SUBST_TRACE([LINUX_FALSE]) -m4trace:configure.ac:509: -1- m4_pattern_allow([^LINUX_FALSE$]) -m4trace:configure.ac:509: -1- _AM_SUBST_NOTMAKE([LINUX_TRUE]) -m4trace:configure.ac:509: -1- _AM_SUBST_NOTMAKE([LINUX_FALSE]) -m4trace:configure.ac:510: -1- AM_CONDITIONAL([SOLARIS], [test "$os" = "solaris"]) -m4trace:configure.ac:510: -1- AC_SUBST([SOLARIS_TRUE]) -m4trace:configure.ac:510: -1- AC_SUBST_TRACE([SOLARIS_TRUE]) -m4trace:configure.ac:510: -1- m4_pattern_allow([^SOLARIS_TRUE$]) -m4trace:configure.ac:510: -1- AC_SUBST([SOLARIS_FALSE]) -m4trace:configure.ac:510: -1- AC_SUBST_TRACE([SOLARIS_FALSE]) -m4trace:configure.ac:510: -1- m4_pattern_allow([^SOLARIS_FALSE$]) -m4trace:configure.ac:510: -1- _AM_SUBST_NOTMAKE([SOLARIS_TRUE]) -m4trace:configure.ac:510: -1- _AM_SUBST_NOTMAKE([SOLARIS_FALSE]) -m4trace:configure.ac:511: -1- AM_CONDITIONAL([THIRTY_TWO_BIT_USERSPACE], [test "$userSpaceBitness" = "32"]) -m4trace:configure.ac:511: -1- AC_SUBST([THIRTY_TWO_BIT_USERSPACE_TRUE]) -m4trace:configure.ac:511: -1- AC_SUBST_TRACE([THIRTY_TWO_BIT_USERSPACE_TRUE]) -m4trace:configure.ac:511: -1- m4_pattern_allow([^THIRTY_TWO_BIT_USERSPACE_TRUE$]) -m4trace:configure.ac:511: -1- AC_SUBST([THIRTY_TWO_BIT_USERSPACE_FALSE]) -m4trace:configure.ac:511: -1- AC_SUBST_TRACE([THIRTY_TWO_BIT_USERSPACE_FALSE]) -m4trace:configure.ac:511: -1- m4_pattern_allow([^THIRTY_TWO_BIT_USERSPACE_FALSE$]) -m4trace:configure.ac:511: -1- _AM_SUBST_NOTMAKE([THIRTY_TWO_BIT_USERSPACE_TRUE]) -m4trace:configure.ac:511: -1- _AM_SUBST_NOTMAKE([THIRTY_TWO_BIT_USERSPACE_FALSE]) -m4trace:configure.ac:512: -1- AM_CONDITIONAL([HAVE_X11], [test "$have_x" = "yes"]) -m4trace:configure.ac:512: -1- AC_SUBST([HAVE_X11_TRUE]) -m4trace:configure.ac:512: -1- AC_SUBST_TRACE([HAVE_X11_TRUE]) -m4trace:configure.ac:512: -1- m4_pattern_allow([^HAVE_X11_TRUE$]) -m4trace:configure.ac:512: -1- AC_SUBST([HAVE_X11_FALSE]) -m4trace:configure.ac:512: -1- AC_SUBST_TRACE([HAVE_X11_FALSE]) -m4trace:configure.ac:512: -1- m4_pattern_allow([^HAVE_X11_FALSE$]) -m4trace:configure.ac:512: -1- _AM_SUBST_NOTMAKE([HAVE_X11_TRUE]) -m4trace:configure.ac:512: -1- _AM_SUBST_NOTMAKE([HAVE_X11_FALSE]) -m4trace:configure.ac:521: -1- AC_DEFINE_TRACE_LITERAL([NO_MULTIMON]) -m4trace:configure.ac:521: -1- m4_pattern_allow([^NO_MULTIMON$]) -m4trace:configure.ac:551: -1- AC_SUBST([MODULES_OS]) -m4trace:configure.ac:551: -1- AC_SUBST_TRACE([MODULES_OS]) -m4trace:configure.ac:551: -1- m4_pattern_allow([^MODULES_OS$]) -m4trace:configure.ac:552: -1- AC_SUBST([MODULES]) -m4trace:configure.ac:552: -1- AC_SUBST_TRACE([MODULES]) -m4trace:configure.ac:552: -1- m4_pattern_allow([^MODULES$]) -m4trace:configure.ac:553: -1- AC_SUBST([COMMON_CFLAGS]) -m4trace:configure.ac:553: -1- AC_SUBST_TRACE([COMMON_CFLAGS]) -m4trace:configure.ac:553: -1- m4_pattern_allow([^COMMON_CFLAGS$]) -m4trace:configure.ac:554: -1- AC_SUBST([COMMON_PROG_CFLAGS]) -m4trace:configure.ac:554: -1- AC_SUBST_TRACE([COMMON_PROG_CFLAGS]) -m4trace:configure.ac:554: -1- m4_pattern_allow([^COMMON_PROG_CFLAGS$]) -m4trace:configure.ac:555: -1- AC_SUBST([COMMON_XLIBS]) -m4trace:configure.ac:555: -1- AC_SUBST_TRACE([COMMON_XLIBS]) -m4trace:configure.ac:555: -1- m4_pattern_allow([^COMMON_XLIBS$]) -m4trace:configure.ac:556: -1- AC_SUBST([GTK_CFLAGS]) -m4trace:configure.ac:556: -1- AC_SUBST_TRACE([GTK_CFLAGS]) -m4trace:configure.ac:556: -1- m4_pattern_allow([^GTK_CFLAGS$]) -m4trace:configure.ac:557: -1- AC_SUBST([GTK_LIBS]) -m4trace:configure.ac:557: -1- AC_SUBST_TRACE([GTK_LIBS]) -m4trace:configure.ac:557: -1- m4_pattern_allow([^GTK_LIBS$]) -m4trace:configure.ac:558: -1- AC_SUBST([DNET_CFLAGS]) -m4trace:configure.ac:558: -1- AC_SUBST_TRACE([DNET_CFLAGS]) -m4trace:configure.ac:558: -1- m4_pattern_allow([^DNET_CFLAGS$]) -m4trace:configure.ac:559: -1- AC_SUBST([DNET_LIBS]) -m4trace:configure.ac:559: -1- AC_SUBST_TRACE([DNET_LIBS]) -m4trace:configure.ac:559: -1- m4_pattern_allow([^DNET_LIBS$]) -m4trace:configure.ac:563: -1- AC_SUBST([LIB_AUTH_CFLAGS]) -m4trace:configure.ac:563: -1- AC_SUBST_TRACE([LIB_AUTH_CFLAGS]) -m4trace:configure.ac:563: -1- m4_pattern_allow([^LIB_AUTH_CFLAGS$]) -m4trace:configure.ac:564: -1- AC_SUBST([LIB_FILE_CFLAGS]) -m4trace:configure.ac:564: -1- AC_SUBST_TRACE([LIB_FILE_CFLAGS]) -m4trace:configure.ac:564: -1- m4_pattern_allow([^LIB_FILE_CFLAGS$]) -m4trace:configure.ac:565: -1- AC_SUBST([LIB_HGFS_SERVER_CFLAGS]) -m4trace:configure.ac:565: -1- AC_SUBST_TRACE([LIB_HGFS_SERVER_CFLAGS]) -m4trace:configure.ac:565: -1- m4_pattern_allow([^LIB_HGFS_SERVER_CFLAGS$]) -m4trace:configure.ac:566: -1- AC_SUBST([LIB_IMPERSONATE_CFLAGS]) -m4trace:configure.ac:566: -1- AC_SUBST_TRACE([LIB_IMPERSONATE_CFLAGS]) -m4trace:configure.ac:566: -1- m4_pattern_allow([^LIB_IMPERSONATE_CFLAGS$]) -m4trace:configure.ac:567: -1- AC_SUBST([LIB_MISC_CFLAGS]) -m4trace:configure.ac:567: -1- AC_SUBST_TRACE([LIB_MISC_CFLAGS]) -m4trace:configure.ac:567: -1- m4_pattern_allow([^LIB_MISC_CFLAGS$]) -m4trace:configure.ac:568: -1- AC_SUBST([LIB_PROC_MGR_CFLAGS]) -m4trace:configure.ac:568: -1- AC_SUBST_TRACE([LIB_PROC_MGR_CFLAGS]) -m4trace:configure.ac:568: -1- m4_pattern_allow([^LIB_PROC_MGR_CFLAGS$]) -m4trace:configure.ac:569: -1- AC_SUBST([LIB_STRING_CFLAGS]) -m4trace:configure.ac:569: -1- AC_SUBST_TRACE([LIB_STRING_CFLAGS]) -m4trace:configure.ac:569: -1- m4_pattern_allow([^LIB_STRING_CFLAGS$]) -m4trace:configure.ac:570: -1- AC_SUBST([LIB_USER_CFLAGS]) -m4trace:configure.ac:570: -1- AC_SUBST_TRACE([LIB_USER_CFLAGS]) -m4trace:configure.ac:570: -1- m4_pattern_allow([^LIB_USER_CFLAGS$]) -m4trace:configure.ac:574: -1- AC_SUBST([GUESTD_LDFLAGS]) -m4trace:configure.ac:574: -1- AC_SUBST_TRACE([GUESTD_LDFLAGS]) -m4trace:configure.ac:574: -1- m4_pattern_allow([^GUESTD_LDFLAGS$]) -m4trace:configure.ac:576: -1- AC_SUBST([VMWARE_USER_CFLAGS]) -m4trace:configure.ac:576: -1- AC_SUBST_TRACE([VMWARE_USER_CFLAGS]) -m4trace:configure.ac:576: -1- m4_pattern_allow([^VMWARE_USER_CFLAGS$]) -m4trace:configure.ac:577: -1- AC_SUBST([VMWARE_USER_LDFLAGS]) -m4trace:configure.ac:577: -1- AC_SUBST_TRACE([VMWARE_USER_LDFLAGS]) -m4trace:configure.ac:577: -1- m4_pattern_allow([^VMWARE_USER_LDFLAGS$]) -m4trace:configure.ac:582: -1- AC_CONFIG_FILES([ \ +configure.ac:848: the top level]) +m4trace:configure.ac:932: -1- AM_CONDITIONAL([BUILD_HGFSMOUNTER], [test "$buildHgfsmounter" = "yes"]) +m4trace:configure.ac:932: -1- AC_SUBST([BUILD_HGFSMOUNTER_TRUE]) +m4trace:configure.ac:932: -1- AC_SUBST_TRACE([BUILD_HGFSMOUNTER_TRUE]) +m4trace:configure.ac:932: -1- m4_pattern_allow([^BUILD_HGFSMOUNTER_TRUE$]) +m4trace:configure.ac:932: -1- AC_SUBST([BUILD_HGFSMOUNTER_FALSE]) +m4trace:configure.ac:932: -1- AC_SUBST_TRACE([BUILD_HGFSMOUNTER_FALSE]) +m4trace:configure.ac:932: -1- m4_pattern_allow([^BUILD_HGFSMOUNTER_FALSE$]) +m4trace:configure.ac:932: -1- _AM_SUBST_NOTMAKE([BUILD_HGFSMOUNTER_TRUE]) +m4trace:configure.ac:932: -1- _AM_SUBST_NOTMAKE([BUILD_HGFSMOUNTER_FALSE]) +m4trace:configure.ac:933: -1- AM_CONDITIONAL([LINUX], [test "$os" = "linux"]) +m4trace:configure.ac:933: -1- AC_SUBST([LINUX_TRUE]) +m4trace:configure.ac:933: -1- AC_SUBST_TRACE([LINUX_TRUE]) +m4trace:configure.ac:933: -1- m4_pattern_allow([^LINUX_TRUE$]) +m4trace:configure.ac:933: -1- AC_SUBST([LINUX_FALSE]) +m4trace:configure.ac:933: -1- AC_SUBST_TRACE([LINUX_FALSE]) +m4trace:configure.ac:933: -1- m4_pattern_allow([^LINUX_FALSE$]) +m4trace:configure.ac:933: -1- _AM_SUBST_NOTMAKE([LINUX_TRUE]) +m4trace:configure.ac:933: -1- _AM_SUBST_NOTMAKE([LINUX_FALSE]) +m4trace:configure.ac:934: -1- AM_CONDITIONAL([SOLARIS], [test "$os" = "solaris"]) +m4trace:configure.ac:934: -1- AC_SUBST([SOLARIS_TRUE]) +m4trace:configure.ac:934: -1- AC_SUBST_TRACE([SOLARIS_TRUE]) +m4trace:configure.ac:934: -1- m4_pattern_allow([^SOLARIS_TRUE$]) +m4trace:configure.ac:934: -1- AC_SUBST([SOLARIS_FALSE]) +m4trace:configure.ac:934: -1- AC_SUBST_TRACE([SOLARIS_FALSE]) +m4trace:configure.ac:934: -1- m4_pattern_allow([^SOLARIS_FALSE$]) +m4trace:configure.ac:934: -1- _AM_SUBST_NOTMAKE([SOLARIS_TRUE]) +m4trace:configure.ac:934: -1- _AM_SUBST_NOTMAKE([SOLARIS_FALSE]) +m4trace:configure.ac:935: -1- AM_CONDITIONAL([FREEBSD], [test "$os" = "freebsd"]) +m4trace:configure.ac:935: -1- AC_SUBST([FREEBSD_TRUE]) +m4trace:configure.ac:935: -1- AC_SUBST_TRACE([FREEBSD_TRUE]) +m4trace:configure.ac:935: -1- m4_pattern_allow([^FREEBSD_TRUE$]) +m4trace:configure.ac:935: -1- AC_SUBST([FREEBSD_FALSE]) +m4trace:configure.ac:935: -1- AC_SUBST_TRACE([FREEBSD_FALSE]) +m4trace:configure.ac:935: -1- m4_pattern_allow([^FREEBSD_FALSE$]) +m4trace:configure.ac:935: -1- _AM_SUBST_NOTMAKE([FREEBSD_TRUE]) +m4trace:configure.ac:935: -1- _AM_SUBST_NOTMAKE([FREEBSD_FALSE]) +m4trace:configure.ac:936: -1- AM_CONDITIONAL([THIRTY_TWO_BIT_USERSPACE], [test "$userSpaceBitness" = "32"]) +m4trace:configure.ac:936: -1- AC_SUBST([THIRTY_TWO_BIT_USERSPACE_TRUE]) +m4trace:configure.ac:936: -1- AC_SUBST_TRACE([THIRTY_TWO_BIT_USERSPACE_TRUE]) +m4trace:configure.ac:936: -1- m4_pattern_allow([^THIRTY_TWO_BIT_USERSPACE_TRUE$]) +m4trace:configure.ac:936: -1- AC_SUBST([THIRTY_TWO_BIT_USERSPACE_FALSE]) +m4trace:configure.ac:936: -1- AC_SUBST_TRACE([THIRTY_TWO_BIT_USERSPACE_FALSE]) +m4trace:configure.ac:936: -1- m4_pattern_allow([^THIRTY_TWO_BIT_USERSPACE_FALSE$]) +m4trace:configure.ac:936: -1- _AM_SUBST_NOTMAKE([THIRTY_TWO_BIT_USERSPACE_TRUE]) +m4trace:configure.ac:936: -1- _AM_SUBST_NOTMAKE([THIRTY_TWO_BIT_USERSPACE_FALSE]) +m4trace:configure.ac:937: -1- AM_CONDITIONAL([HAVE_X11], [test "$have_x" = "yes"]) +m4trace:configure.ac:937: -1- AC_SUBST([HAVE_X11_TRUE]) +m4trace:configure.ac:937: -1- AC_SUBST_TRACE([HAVE_X11_TRUE]) +m4trace:configure.ac:937: -1- m4_pattern_allow([^HAVE_X11_TRUE$]) +m4trace:configure.ac:937: -1- AC_SUBST([HAVE_X11_FALSE]) +m4trace:configure.ac:937: -1- AC_SUBST_TRACE([HAVE_X11_FALSE]) +m4trace:configure.ac:937: -1- m4_pattern_allow([^HAVE_X11_FALSE$]) +m4trace:configure.ac:937: -1- _AM_SUBST_NOTMAKE([HAVE_X11_TRUE]) +m4trace:configure.ac:937: -1- _AM_SUBST_NOTMAKE([HAVE_X11_FALSE]) +m4trace:configure.ac:938: -1- AM_CONDITIONAL([HAVE_ICU], [test "$with_icu" = "yes"]) +m4trace:configure.ac:938: -1- AC_SUBST([HAVE_ICU_TRUE]) +m4trace:configure.ac:938: -1- AC_SUBST_TRACE([HAVE_ICU_TRUE]) +m4trace:configure.ac:938: -1- m4_pattern_allow([^HAVE_ICU_TRUE$]) +m4trace:configure.ac:938: -1- AC_SUBST([HAVE_ICU_FALSE]) +m4trace:configure.ac:938: -1- AC_SUBST_TRACE([HAVE_ICU_FALSE]) +m4trace:configure.ac:938: -1- m4_pattern_allow([^HAVE_ICU_FALSE$]) +m4trace:configure.ac:938: -1- _AM_SUBST_NOTMAKE([HAVE_ICU_TRUE]) +m4trace:configure.ac:938: -1- _AM_SUBST_NOTMAKE([HAVE_ICU_FALSE]) +m4trace:configure.ac:939: -1- AM_CONDITIONAL([WITH_KERNEL_MODULES], [test "$with_kernel_modules" = "yes"]) +m4trace:configure.ac:939: -1- AC_SUBST([WITH_KERNEL_MODULES_TRUE]) +m4trace:configure.ac:939: -1- AC_SUBST_TRACE([WITH_KERNEL_MODULES_TRUE]) +m4trace:configure.ac:939: -1- m4_pattern_allow([^WITH_KERNEL_MODULES_TRUE$]) +m4trace:configure.ac:939: -1- AC_SUBST([WITH_KERNEL_MODULES_FALSE]) +m4trace:configure.ac:939: -1- AC_SUBST_TRACE([WITH_KERNEL_MODULES_FALSE]) +m4trace:configure.ac:939: -1- m4_pattern_allow([^WITH_KERNEL_MODULES_FALSE$]) +m4trace:configure.ac:939: -1- _AM_SUBST_NOTMAKE([WITH_KERNEL_MODULES_TRUE]) +m4trace:configure.ac:939: -1- _AM_SUBST_NOTMAKE([WITH_KERNEL_MODULES_FALSE]) +m4trace:configure.ac:940: -1- AM_CONDITIONAL([PAMD], [test -d /etc/pam.d]) +m4trace:configure.ac:940: -1- AC_SUBST([PAMD_TRUE]) +m4trace:configure.ac:940: -1- AC_SUBST_TRACE([PAMD_TRUE]) +m4trace:configure.ac:940: -1- m4_pattern_allow([^PAMD_TRUE$]) +m4trace:configure.ac:940: -1- AC_SUBST([PAMD_FALSE]) +m4trace:configure.ac:940: -1- AC_SUBST_TRACE([PAMD_FALSE]) +m4trace:configure.ac:940: -1- m4_pattern_allow([^PAMD_FALSE$]) +m4trace:configure.ac:940: -1- _AM_SUBST_NOTMAKE([PAMD_TRUE]) +m4trace:configure.ac:940: -1- _AM_SUBST_NOTMAKE([PAMD_FALSE]) +m4trace:configure.ac:941: -1- AM_CONDITIONAL([ENABLE_UNITY], [test "$enable_unity" = "yes"]) +m4trace:configure.ac:941: -1- AC_SUBST([ENABLE_UNITY_TRUE]) +m4trace:configure.ac:941: -1- AC_SUBST_TRACE([ENABLE_UNITY_TRUE]) +m4trace:configure.ac:941: -1- m4_pattern_allow([^ENABLE_UNITY_TRUE$]) +m4trace:configure.ac:941: -1- AC_SUBST([ENABLE_UNITY_FALSE]) +m4trace:configure.ac:941: -1- AC_SUBST_TRACE([ENABLE_UNITY_FALSE]) +m4trace:configure.ac:941: -1- m4_pattern_allow([^ENABLE_UNITY_FALSE$]) +m4trace:configure.ac:941: -1- _AM_SUBST_NOTMAKE([ENABLE_UNITY_TRUE]) +m4trace:configure.ac:941: -1- _AM_SUBST_NOTMAKE([ENABLE_UNITY_FALSE]) +m4trace:configure.ac:942: -1- AM_CONDITIONAL([WITH_ROOT_PRIVILEGES], [test "$with_root_privileges" = "yes"]) +m4trace:configure.ac:942: -1- AC_SUBST([WITH_ROOT_PRIVILEGES_TRUE]) +m4trace:configure.ac:942: -1- AC_SUBST_TRACE([WITH_ROOT_PRIVILEGES_TRUE]) +m4trace:configure.ac:942: -1- m4_pattern_allow([^WITH_ROOT_PRIVILEGES_TRUE$]) +m4trace:configure.ac:942: -1- AC_SUBST([WITH_ROOT_PRIVILEGES_FALSE]) +m4trace:configure.ac:942: -1- AC_SUBST_TRACE([WITH_ROOT_PRIVILEGES_FALSE]) +m4trace:configure.ac:942: -1- m4_pattern_allow([^WITH_ROOT_PRIVILEGES_FALSE$]) +m4trace:configure.ac:942: -1- _AM_SUBST_NOTMAKE([WITH_ROOT_PRIVILEGES_TRUE]) +m4trace:configure.ac:942: -1- _AM_SUBST_NOTMAKE([WITH_ROOT_PRIVILEGES_FALSE]) +m4trace:configure.ac:953: -1- AC_DEFINE_TRACE_LITERAL([NO_MULTIMON]) +m4trace:configure.ac:953: -1- m4_pattern_allow([^NO_MULTIMON$]) +m4trace:configure.ac:953: -1- AH_OUTPUT([NO_MULTIMON], [/* Define to 1 if building without multimon support. */ +#undef NO_MULTIMON]) +m4trace:configure.ac:983: -1- AC_SUBST([TARGET_OS]) +m4trace:configure.ac:983: -1- AC_SUBST_TRACE([TARGET_OS]) +m4trace:configure.ac:983: -1- m4_pattern_allow([^TARGET_OS$]) +m4trace:configure.ac:984: -1- AC_SUBST([KERNEL_RELEASE]) +m4trace:configure.ac:984: -1- AC_SUBST_TRACE([KERNEL_RELEASE]) +m4trace:configure.ac:984: -1- m4_pattern_allow([^KERNEL_RELEASE$]) +m4trace:configure.ac:985: -1- AC_SUBST([MODULES_OS]) +m4trace:configure.ac:985: -1- AC_SUBST_TRACE([MODULES_OS]) +m4trace:configure.ac:985: -1- m4_pattern_allow([^MODULES_OS$]) +m4trace:configure.ac:986: -1- AC_SUBST([MODULES_DIR]) +m4trace:configure.ac:986: -1- AC_SUBST_TRACE([MODULES_DIR]) +m4trace:configure.ac:986: -1- m4_pattern_allow([^MODULES_DIR$]) +m4trace:configure.ac:987: -1- AC_SUBST([MODULES]) +m4trace:configure.ac:987: -1- AC_SUBST_TRACE([MODULES]) +m4trace:configure.ac:987: -1- m4_pattern_allow([^MODULES$]) +m4trace:configure.ac:988: -1- AC_SUBST([COMMON_XLIBS]) +m4trace:configure.ac:988: -1- AC_SUBST_TRACE([COMMON_XLIBS]) +m4trace:configure.ac:988: -1- m4_pattern_allow([^COMMON_XLIBS$]) +m4trace:configure.ac:989: -1- AC_SUBST([GTK_CPPFLAGS]) +m4trace:configure.ac:989: -1- AC_SUBST_TRACE([GTK_CPPFLAGS]) +m4trace:configure.ac:989: -1- m4_pattern_allow([^GTK_CPPFLAGS$]) +m4trace:configure.ac:990: -1- AC_SUBST([GTK_LIBS]) +m4trace:configure.ac:990: -1- AC_SUBST_TRACE([GTK_LIBS]) +m4trace:configure.ac:990: -1- m4_pattern_allow([^GTK_LIBS$]) +m4trace:configure.ac:991: -1- AC_SUBST([DNET_CPPFLAGS]) +m4trace:configure.ac:991: -1- AC_SUBST_TRACE([DNET_CPPFLAGS]) +m4trace:configure.ac:991: -1- m4_pattern_allow([^DNET_CPPFLAGS$]) +m4trace:configure.ac:992: -1- AC_SUBST([DNET_LIBS]) +m4trace:configure.ac:992: -1- AC_SUBST_TRACE([DNET_LIBS]) +m4trace:configure.ac:992: -1- m4_pattern_allow([^DNET_LIBS$]) +m4trace:configure.ac:993: -1- AC_SUBST([PROCPS_LIBS]) +m4trace:configure.ac:993: -1- AC_SUBST_TRACE([PROCPS_LIBS]) +m4trace:configure.ac:993: -1- m4_pattern_allow([^PROCPS_LIBS$]) +m4trace:configure.ac:994: -1- AC_SUBST([ICU_CPPFLAGS]) +m4trace:configure.ac:994: -1- AC_SUBST_TRACE([ICU_CPPFLAGS]) +m4trace:configure.ac:994: -1- m4_pattern_allow([^ICU_CPPFLAGS$]) +m4trace:configure.ac:995: -1- AC_SUBST([ICU_LIBS]) +m4trace:configure.ac:995: -1- AC_SUBST_TRACE([ICU_LIBS]) +m4trace:configure.ac:995: -1- m4_pattern_allow([^ICU_LIBS$]) +m4trace:configure.ac:996: -1- AC_SUBST([PAM_PREFIX]) +m4trace:configure.ac:996: -1- AC_SUBST_TRACE([PAM_PREFIX]) +m4trace:configure.ac:996: -1- m4_pattern_allow([^PAM_PREFIX$]) +m4trace:configure.ac:997: -1- AC_SUBST([URIPARSER_CPPFLAGS]) +m4trace:configure.ac:997: -1- AC_SUBST_TRACE([URIPARSER_CPPFLAGS]) +m4trace:configure.ac:997: -1- m4_pattern_allow([^URIPARSER_CPPFLAGS$]) +m4trace:configure.ac:998: -1- AC_SUBST([URIPARSER_LIBS]) +m4trace:configure.ac:998: -1- AC_SUBST_TRACE([URIPARSER_LIBS]) +m4trace:configure.ac:998: -1- m4_pattern_allow([^URIPARSER_LIBS$]) +m4trace:configure.ac:999: -1- AC_SUBST([LIBPNG_CPPFLAGS]) +m4trace:configure.ac:999: -1- AC_SUBST_TRACE([LIBPNG_CPPFLAGS]) +m4trace:configure.ac:999: -1- m4_pattern_allow([^LIBPNG_CPPFLAGS$]) +m4trace:configure.ac:1000: -1- AC_SUBST([LIBPNG_LIBS]) +m4trace:configure.ac:1000: -1- AC_SUBST_TRACE([LIBPNG_LIBS]) +m4trace:configure.ac:1000: -1- m4_pattern_allow([^LIBPNG_LIBS$]) +m4trace:configure.ac:1001: -1- AC_SUBST([ZLIB_CPPFLAGS]) +m4trace:configure.ac:1001: -1- AC_SUBST_TRACE([ZLIB_CPPFLAGS]) +m4trace:configure.ac:1001: -1- m4_pattern_allow([^ZLIB_CPPFLAGS$]) +m4trace:configure.ac:1002: -1- AC_SUBST([ZLIB_LIBS]) +m4trace:configure.ac:1002: -1- AC_SUBST_TRACE([ZLIB_LIBS]) +m4trace:configure.ac:1002: -1- m4_pattern_allow([^ZLIB_LIBS$]) +m4trace:configure.ac:1006: -1- AC_SUBST([LIB_AUTH_CPPFLAGS]) +m4trace:configure.ac:1006: -1- AC_SUBST_TRACE([LIB_AUTH_CPPFLAGS]) +m4trace:configure.ac:1006: -1- m4_pattern_allow([^LIB_AUTH_CPPFLAGS$]) +m4trace:configure.ac:1007: -1- AC_SUBST([LIB_FILE_CPPFLAGS]) +m4trace:configure.ac:1007: -1- AC_SUBST_TRACE([LIB_FILE_CPPFLAGS]) +m4trace:configure.ac:1007: -1- m4_pattern_allow([^LIB_FILE_CPPFLAGS$]) +m4trace:configure.ac:1008: -1- AC_SUBST([LIB_HGFS_SERVER_CPPFLAGS]) +m4trace:configure.ac:1008: -1- AC_SUBST_TRACE([LIB_HGFS_SERVER_CPPFLAGS]) +m4trace:configure.ac:1008: -1- m4_pattern_allow([^LIB_HGFS_SERVER_CPPFLAGS$]) +m4trace:configure.ac:1009: -1- AC_SUBST([LIB_IMPERSONATE_CPPFLAGS]) +m4trace:configure.ac:1009: -1- AC_SUBST_TRACE([LIB_IMPERSONATE_CPPFLAGS]) +m4trace:configure.ac:1009: -1- m4_pattern_allow([^LIB_IMPERSONATE_CPPFLAGS$]) +m4trace:configure.ac:1010: -1- AC_SUBST([LIB_MISC_CPPFLAGS]) +m4trace:configure.ac:1010: -1- AC_SUBST_TRACE([LIB_MISC_CPPFLAGS]) +m4trace:configure.ac:1010: -1- m4_pattern_allow([^LIB_MISC_CPPFLAGS$]) +m4trace:configure.ac:1011: -1- AC_SUBST([LIB_PROC_MGR_CPPFLAGS]) +m4trace:configure.ac:1011: -1- AC_SUBST_TRACE([LIB_PROC_MGR_CPPFLAGS]) +m4trace:configure.ac:1011: -1- m4_pattern_allow([^LIB_PROC_MGR_CPPFLAGS$]) +m4trace:configure.ac:1012: -1- AC_SUBST([LIB_STRING_CPPFLAGS]) +m4trace:configure.ac:1012: -1- AC_SUBST_TRACE([LIB_STRING_CPPFLAGS]) +m4trace:configure.ac:1012: -1- m4_pattern_allow([^LIB_STRING_CPPFLAGS$]) +m4trace:configure.ac:1013: -1- AC_SUBST([LIB_USER_CPPFLAGS]) +m4trace:configure.ac:1013: -1- AC_SUBST_TRACE([LIB_USER_CPPFLAGS]) +m4trace:configure.ac:1013: -1- m4_pattern_allow([^LIB_USER_CPPFLAGS$]) +m4trace:configure.ac:1017: -1- AC_SUBST([GUESTD_LDADD]) +m4trace:configure.ac:1017: -1- AC_SUBST_TRACE([GUESTD_LDADD]) +m4trace:configure.ac:1017: -1- m4_pattern_allow([^GUESTD_LDADD$]) +m4trace:configure.ac:1019: -1- AC_SUBST([VMWARE_USER_CPPFLAGS]) +m4trace:configure.ac:1019: -1- AC_SUBST_TRACE([VMWARE_USER_CPPFLAGS]) +m4trace:configure.ac:1019: -1- m4_pattern_allow([^VMWARE_USER_CPPFLAGS$]) +m4trace:configure.ac:1020: -1- AC_SUBST([VMWARE_USER_LDADD]) +m4trace:configure.ac:1020: -1- AC_SUBST_TRACE([VMWARE_USER_LDADD]) +m4trace:configure.ac:1020: -1- m4_pattern_allow([^VMWARE_USER_LDADD$]) +m4trace:configure.ac:1025: -1- AC_CONFIG_FILES([ \ Makefile \ lib/Makefile \ - lib/atomic/Makefile \ - lib/atomic/shared/Makefile \ + lib/appUtil/Makefile \ lib/auth/Makefile \ lib/backdoor/Makefile \ lib/backdoor/shared/Makefile \ lib/conf/Makefile \ lib/dict/Makefile \ lib/dnd/Makefile \ + lib/dynxdr/Makefile \ lib/err/Makefile \ lib/eventManager/Makefile \ lib/file/Makefile \ - lib/fileUtf8/Makefile \ lib/foundryMsg/Makefile \ + lib/ghIntegration/Makefile \ + lib/ghIntegrationStub/Makefile \ lib/guestApp/Makefile \ lib/guestInfo/Makefile \ + lib/guestRpc/Makefile \ lib/hgfs/Makefile \ lib/hgfsBd/Makefile \ lib/hgfsServer/Makefile \ lib/hgfsServerManagerGuest/Makefile \ lib/hgfsServerPolicyGuest/Makefile \ lib/deployPkg/Makefile \ + lib/image/Makefile \ lib/impersonate/Makefile \ lib/message/Makefile \ lib/message/shared/Makefile \ @@ -909,21 +1006,28 @@ lib/panicDefault/Makefile \ lib/printer/Makefile \ lib/procMgr/Makefile \ + lib/raster/Makefile \ + lib/region/Makefile \ + lib/resolution/Makefile \ lib/rpcIn/Makefile \ lib/rpcOut/Makefile \ lib/rpcOut/shared/Makefile \ lib/rpcVmx/Makefile \ lib/SLPv2Parser/Makefile \ lib/socketMgr/Makefile \ - lib/strUtil/Makefile \ lib/string/Makefile \ lib/string/shared/Makefile \ + lib/stubs/Makefile \ + lib/stubs/shared/Makefile \ lib/sync/Makefile \ lib/sync/shared/Makefile \ lib/syncDriver/Makefile \ lib/system/Makefile \ lib/toolsLogger/Makefile \ lib/unicode/Makefile \ + lib/unity/Makefile \ + lib/unityStub/Makefile \ + lib/unityWindowTracker/Makefile \ lib/user/Makefile \ lib/vixTools/Makefile \ lib/vmBackupLib/Makefile \ @@ -932,6 +1036,7 @@ lib/wiper/Makefile \ guestd/Makefile \ vmware-user/Makefile \ + vmware-user-suid-wrapper/Makefile \ toolbox/Makefile \ hgfsclient/Makefile \ hgfsmounter/Makefile \ @@ -939,20 +1044,22 @@ libguestlib/Makefile \ xferlogs/Makefile \ modules/Makefile \ + scripts/Makefile \ ]) -m4trace:configure.ac:651: -1- AC_SUBST([LIB@&t@OBJS], [$ac_libobjs]) -m4trace:configure.ac:651: -1- AC_SUBST_TRACE([LIB@&t@OBJS]) -m4trace:configure.ac:651: -1- m4_pattern_allow([^LIB@&t@OBJS$]) -m4trace:configure.ac:651: -1- AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs]) -m4trace:configure.ac:651: -1- AC_SUBST_TRACE([LTLIBOBJS]) -m4trace:configure.ac:651: -1- m4_pattern_allow([^LTLIBOBJS$]) -m4trace:configure.ac:651: -1- AC_SUBST_TRACE([top_builddir]) -m4trace:configure.ac:651: -1- AC_SUBST_TRACE([srcdir]) -m4trace:configure.ac:651: -1- AC_SUBST_TRACE([abs_srcdir]) -m4trace:configure.ac:651: -1- AC_SUBST_TRACE([top_srcdir]) -m4trace:configure.ac:651: -1- AC_SUBST_TRACE([abs_top_srcdir]) -m4trace:configure.ac:651: -1- AC_SUBST_TRACE([builddir]) -m4trace:configure.ac:651: -1- AC_SUBST_TRACE([abs_builddir]) -m4trace:configure.ac:651: -1- AC_SUBST_TRACE([abs_top_builddir]) -m4trace:configure.ac:651: -1- AC_SUBST_TRACE([INSTALL]) -m4trace:configure.ac:651: -1- AC_SUBST_TRACE([MKDIR_P]) +m4trace:configure.ac:1106: -1- AC_SUBST([LIB@&t@OBJS], [$ac_libobjs]) +m4trace:configure.ac:1106: -1- AC_SUBST_TRACE([LIB@&t@OBJS]) +m4trace:configure.ac:1106: -1- m4_pattern_allow([^LIB@&t@OBJS$]) +m4trace:configure.ac:1106: -1- AC_SUBST([LTLIBOBJS], [$ac_ltlibobjs]) +m4trace:configure.ac:1106: -1- AC_SUBST_TRACE([LTLIBOBJS]) +m4trace:configure.ac:1106: -1- m4_pattern_allow([^LTLIBOBJS$]) +m4trace:configure.ac:1106: -1- AC_SUBST_TRACE([top_builddir]) +m4trace:configure.ac:1106: -1- AC_SUBST_TRACE([srcdir]) +m4trace:configure.ac:1106: -1- AC_SUBST_TRACE([abs_srcdir]) +m4trace:configure.ac:1106: -1- AC_SUBST_TRACE([top_srcdir]) +m4trace:configure.ac:1106: -1- AC_SUBST_TRACE([abs_top_srcdir]) +m4trace:configure.ac:1106: -1- AC_SUBST_TRACE([builddir]) +m4trace:configure.ac:1106: -1- AC_SUBST_TRACE([abs_builddir]) +m4trace:configure.ac:1106: -1- AC_SUBST_TRACE([abs_top_builddir]) +m4trace:configure.ac:1106: -1- AC_SUBST_TRACE([INSTALL]) +m4trace:configure.ac:1106: -1- AC_SUBST_TRACE([MKDIR_P]) +m4trace:configure.ac:1106: -1- AC_REQUIRE_AUX_FILE([ltmain.sh]) diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/autom4te.cache/traces.2 /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/autom4te.cache/traces.2 --- open-vm-tools-2008.01.23-74039/autom4te.cache/traces.2 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/autom4te.cache/traces.2 2008-10-13 08:02:08.000000000 +0100 @@ -0,0 +1,1859 @@ +m4trace:/build/toolchain/lin32/automake-1.10/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:/build/toolchain/lin32/automake-1.10/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:/build/toolchain/lin32/automake-1.10/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:/build/toolchain/lin32/automake-1.10/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:/build/toolchain/lin32/automake-1.10/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:/build/toolchain/lin32/automake-1.10/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:/build/toolchain/lin32/automake-1.10/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:/build/toolchain/lin32/automake-1.10/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:/build/toolchain/lin32/automake-1.10/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:/build/toolchain/lin32/automake-1.10/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:/build/toolchain/lin32/automake-1.10/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:/build/toolchain/lin32/automake-1.10/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:/build/toolchain/lin32/automake-1.10/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:/build/toolchain/lin32/automake-1.10/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:/build/toolchain/lin32/automake-1.10/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:/build/toolchain/lin32/automake-1.10/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:/build/toolchain/lin32/automake-1.10/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:/build/toolchain/lin32/automake-1.10/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:/build/toolchain/lin32/automake-1.10/share/aclocal-1.10/options.m4:13: -1- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) +m4trace:/build/toolchain/lin32/automake-1.10/share/aclocal-1.10/options.m4:19: -1- AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) +m4trace:/build/toolchain/lin32/automake-1.10/share/aclocal-1.10/options.m4:25: -1- AC_DEFUN([_AM_SET_OPTIONS], [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) +m4trace:/build/toolchain/lin32/automake-1.10/share/aclocal-1.10/options.m4:31: -1- AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) +m4trace:/build/toolchain/lin32/automake-1.10/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:/build/toolchain/lin32/automake-1.10/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:/build/toolchain/lin32/automake-1.10/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:/build/toolchain/lin32/automake-1.10/share/aclocal-1.10/substnot.m4:12: -1- AC_DEFUN([_AM_SUBST_NOTMAKE]) +m4trace:/build/toolchain/lin32/automake-1.10/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:67: -1- AC_DEFUN([LT_INIT], [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT +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 + +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:102: -1- AU_DEFUN([AC_PROG_LIBTOOL], [m4_if($#, 0, [LT_INIT], [LT_INIT($@)])]) +m4trace:m4/libtool.m4:102: -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:103: -1- AU_DEFUN([AM_PROG_LIBTOOL], [m4_if($#, 0, [LT_INIT], [LT_INIT($@)])]) +m4trace:m4/libtool.m4:103: -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:564: -1- AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} +AC_MSG_NOTICE([creating $CONFIG_LT]) +cat >"$CONFIG_LT" <<_LTEOF +#! $SHELL +# Generated by $as_me. +# Run this file to recreate a libtool stub with the current configuration. + +lt_cl_silent=false +SHELL=\${CONFIG_SHELL-$SHELL} +_LTEOF + +cat >>"$CONFIG_LT" <<\_LTEOF +AS_SHELL_SANITIZE +_AS_PREPARE + +exec AS_MESSAGE_FD>&1 +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) 2008 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. +if test "$no_create" != yes; then + 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) +fi +]) +m4trace:m4/libtool.m4:759: -1- AC_DEFUN([LT_SUPPORTED_TAG], []) +m4trace:m4/libtool.m4:770: -1- AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl +m4_case([$1], + [C], [_LT_LANG(C)], + [C++], [_LT_LANG(CXX)], + [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:832: -1- AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) +m4trace:m4/libtool.m4:832: -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:833: -1- AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) +m4trace:m4/libtool.m4:833: -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:834: -1- AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) +m4trace:m4/libtool.m4:834: -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:835: -1- AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) +m4trace:m4/libtool.m4:835: -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:1386: -1- AC_DEFUN([_LT_COMPILER_OPTION], [AC_REQUIRE([AC_OBJEXT])dnl +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:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + $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:1429: -1- AU_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [m4_if($#, 0, [_LT_COMPILER_OPTION], [_LT_COMPILER_OPTION($@)])]) +m4trace:m4/libtool.m4:1429: -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:1438: -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 "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + $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:1473: -1- AU_DEFUN([AC_LIBTOOL_LINKER_OPTION], [m4_if($#, 0, [_LT_LINKER_OPTION], [_LT_LINKER_OPTION($@)])]) +m4trace:m4/libtool.m4:1473: -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:1480: -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*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + 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"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ + = "XX$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:1608: -1- AU_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [m4_if($#, 0, [LT_CMD_MAX_LEN], [LT_CMD_MAX_LEN($@)])]) +m4trace:m4/libtool.m4:1608: -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:1713: -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*) + 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:1830: -1- AU_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [m4_if($#, 0, [LT_SYS_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF($@)])]) +m4trace:m4/libtool.m4:1830: -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:2713: -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:2775: -1- AU_DEFUN([AC_PATH_TOOL_PREFIX], [m4_if($#, 0, [_LT_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX($@)])]) +m4trace:m4/libtool.m4:2775: -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:2798: -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 + +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. + AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :) + 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:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:__oline__: $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:__oline__: 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:3223: -1- AU_DEFUN([AM_PROG_NM], [m4_if($#, 0, [LT_PATH_NM], [LT_PATH_NM($@)])]) +m4trace:m4/libtool.m4:3223: -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:3224: -1- AU_DEFUN([AC_PROG_NM], [m4_if($#, 0, [LT_PATH_NM], [LT_PATH_NM($@)])]) +m4trace:m4/libtool.m4:3224: -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:3233: -1- AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl +LIBM= +case $host in +*-*-beos* | *-*-cygwin* | *-*-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:3252: -1- AU_DEFUN([AC_CHECK_LIBM], [m4_if($#, 0, [LT_LIB_M], [LT_LIB_M($@)])]) +m4trace:m4/libtool.m4:3252: -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:6899: -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:6908: -1- AU_DEFUN([LT_AC_PROG_GCJ], [m4_if($#, 0, [LT_PROG_GCJ], [LT_PROG_GCJ($@)])]) +m4trace:m4/libtool.m4:6908: -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:6915: -1- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) +]) +m4trace:m4/libtool.m4:6920: -1- AU_DEFUN([LT_AC_PROG_RC], [m4_if($#, 0, [LT_PROG_RC], [LT_PROG_RC($@)])]) +m4trace:m4/libtool.m4:6920: -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:7019: -1- AU_DEFUN([LT_AC_PROG_SED], [m4_if($#, 0, [AC_PROG_SED], [AC_PROG_SED($@)])]) +m4trace:m4/libtool.m4:7019: -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:13: -1- AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) +m4trace:m4/ltoptions.m4:110: -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:110: -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:145: -1- AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [_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:145: -1- AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_DIAGNOSE([obsolete], [The macro `AC_LIBTOOL_WIN32_DLL' is obsolete. +You should run autoupdate.])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:193: -1- AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [shared]) +]) +m4trace:m4/ltoptions.m4:197: -1- AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) +]) +m4trace:m4/ltoptions.m4:201: -1- AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) +m4trace:m4/ltoptions.m4:201: -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:202: -1- AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) +m4trace:m4/ltoptions.m4:202: -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:247: -1- AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [static]) +]) +m4trace:m4/ltoptions.m4:251: -1- AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) +]) +m4trace:m4/ltoptions.m4:255: -1- AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) +m4trace:m4/ltoptions.m4:255: -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:256: -1- AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) +m4trace:m4/ltoptions.m4:256: -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:301: -1- AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [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:301: -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], [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:308: -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:308: -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:341: -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:341: -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.2' +macro_revision='1.2599' +_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_RC]) +m4trace:m4/lt~obsolete.m4:81: -1- AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG]) +m4trace:m4/lt~obsolete.m4:82: -1- AC_DEFUN([_LT_AC_LANG_C_CONFIG]) +m4trace:m4/lt~obsolete.m4:83: -1- AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG]) +m4trace:m4/lt~obsolete.m4:84: -1- AC_DEFUN([_LT_AC_LANG_CXX_CONFIG]) +m4trace:m4/lt~obsolete.m4:85: -1- AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG]) +m4trace:m4/lt~obsolete.m4:86: -1- AC_DEFUN([_LT_AC_LANG_F77_CONFIG]) +m4trace:m4/lt~obsolete.m4:87: -1- AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG]) +m4trace:m4/lt~obsolete.m4:88: -1- AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG]) +m4trace:m4/lt~obsolete.m4:89: -1- AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG]) +m4trace:m4/lt~obsolete.m4:90: -1- AC_DEFUN([_LT_AC_LANG_RC_CONFIG]) +m4trace:m4/lt~obsolete.m4:91: -1- AC_DEFUN([AC_LIBTOOL_CONFIG]) +m4trace:m4/lt~obsolete.m4:92: -1- AC_DEFUN([_LT_AC_FILE_LTDLL_C]) +m4trace:configure.ac:38: -1- m4_pattern_forbid([^_?A[CHUM]_]) +m4trace:configure.ac:38: -1- m4_pattern_forbid([_AC_]) +m4trace:configure.ac:38: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs LIBOBJS']) +m4trace:configure.ac:38: -1- m4_pattern_allow([^AS_FLAGS$]) +m4trace:configure.ac:38: -1- m4_pattern_forbid([^_?m4_]) +m4trace:configure.ac:38: -1- m4_pattern_forbid([^dnl$]) +m4trace:configure.ac:38: -1- m4_pattern_forbid([^_?AS_]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^SHELL$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^PATH_SEPARATOR$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^PACKAGE_NAME$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^PACKAGE_VERSION$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^PACKAGE_STRING$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^exec_prefix$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^prefix$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^program_transform_name$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^bindir$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^sbindir$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^libexecdir$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^datarootdir$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^datadir$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^sysconfdir$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^sharedstatedir$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^localstatedir$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^includedir$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^oldincludedir$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^docdir$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^infodir$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^htmldir$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^dvidir$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^pdfdir$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^psdir$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^libdir$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^localedir$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^mandir$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^PACKAGE_NAME$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^PACKAGE_TARNAME$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^PACKAGE_VERSION$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^PACKAGE_STRING$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^PACKAGE_BUGREPORT$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^DEFS$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^ECHO_C$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^ECHO_N$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^ECHO_T$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^LIBS$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^build_alias$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^host_alias$]) +m4trace:configure.ac:38: -1- m4_pattern_allow([^target_alias$]) +m4trace:configure.ac:69: -1- m4_pattern_allow([^build$]) +m4trace:configure.ac:69: -1- m4_pattern_allow([^build_cpu$]) +m4trace:configure.ac:69: -1- m4_pattern_allow([^build_vendor$]) +m4trace:configure.ac:69: -1- m4_pattern_allow([^build_os$]) +m4trace:configure.ac:69: -1- m4_pattern_allow([^host$]) +m4trace:configure.ac:69: -1- m4_pattern_allow([^host_cpu$]) +m4trace:configure.ac:69: -1- m4_pattern_allow([^host_vendor$]) +m4trace:configure.ac:69: -1- m4_pattern_allow([^host_os$]) +m4trace:configure.ac:70: -1- m4_pattern_allow([^build$]) +m4trace:configure.ac:70: -1- m4_pattern_allow([^build_cpu$]) +m4trace:configure.ac:70: -1- m4_pattern_allow([^build_vendor$]) +m4trace:configure.ac:70: -1- m4_pattern_allow([^build_os$]) +m4trace:configure.ac:176: -1- AM_INIT_AUTOMAKE +m4trace:configure.ac:176: -1- m4_pattern_allow([^AM_[A-Z]+FLAGS$]) +m4trace:configure.ac:176: -1- AM_SET_CURRENT_AUTOMAKE_VERSION +m4trace:configure.ac:176: -1- AM_AUTOMAKE_VERSION([1.10]) +m4trace:configure.ac:176: -1- _AM_AUTOCONF_VERSION([2.61]) +m4trace:configure.ac:176: -1- m4_pattern_allow([^INSTALL_PROGRAM$]) +m4trace:configure.ac:176: -1- m4_pattern_allow([^INSTALL_SCRIPT$]) +m4trace:configure.ac:176: -1- m4_pattern_allow([^INSTALL_DATA$]) +m4trace:configure.ac:176: -1- m4_pattern_allow([^am__isrc$]) +m4trace:configure.ac:176: -1- _AM_SUBST_NOTMAKE([am__isrc]) +m4trace:configure.ac:176: -1- m4_pattern_allow([^CYGPATH_W$]) +m4trace:configure.ac:176: -1- _AM_SET_OPTIONS([]) +m4trace:configure.ac:176: -1- _m4_warn([obsolete], [The macro `AC_FOREACH' is obsolete. +You should run autoupdate.], [../../lib/autoconf/general.m4:196: AC_FOREACH is expanded from... +/build/toolchain/lin32/automake-1.10/share/aclocal-1.10/options.m4:25: _AM_SET_OPTIONS is expanded from... +/build/toolchain/lin32/automake-1.10/share/aclocal-1.10/init.m4:26: AM_INIT_AUTOMAKE is expanded from... +configure.ac:176: the top level]) +m4trace:configure.ac:176: -1- m4_pattern_allow([^PACKAGE$]) +m4trace:configure.ac:176: -1- m4_pattern_allow([^VERSION$]) +m4trace:configure.ac:176: -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:176: -2- _AM_MANGLE_OPTION([no-define]) +m4trace:configure.ac:176: -1- m4_pattern_allow([^PACKAGE$]) +m4trace:configure.ac:176: -1- m4_pattern_allow([^VERSION$]) +m4trace:configure.ac:176: -1- AM_SANITY_CHECK +m4trace:configure.ac:176: -1- AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) +m4trace:configure.ac:176: -1- AM_MISSING_HAS_RUN +m4trace:configure.ac:176: -1- AM_AUX_DIR_EXPAND +m4trace:configure.ac:176: -1- m4_pattern_allow([^ACLOCAL$]) +m4trace:configure.ac:176: -1- AM_MISSING_PROG([AUTOCONF], [autoconf]) +m4trace:configure.ac:176: -1- m4_pattern_allow([^AUTOCONF$]) +m4trace:configure.ac:176: -1- AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) +m4trace:configure.ac:176: -1- m4_pattern_allow([^AUTOMAKE$]) +m4trace:configure.ac:176: -1- AM_MISSING_PROG([AUTOHEADER], [autoheader]) +m4trace:configure.ac:176: -1- m4_pattern_allow([^AUTOHEADER$]) +m4trace:configure.ac:176: -1- AM_MISSING_PROG([MAKEINFO], [makeinfo]) +m4trace:configure.ac:176: -1- m4_pattern_allow([^MAKEINFO$]) +m4trace:configure.ac:176: -1- AM_PROG_INSTALL_SH +m4trace:configure.ac:176: -1- m4_pattern_allow([^install_sh$]) +m4trace:configure.ac:176: -1- AM_PROG_INSTALL_STRIP +m4trace:configure.ac:176: -1- m4_pattern_allow([^STRIP$]) +m4trace:configure.ac:176: -1- m4_pattern_allow([^INSTALL_STRIP_PROGRAM$]) +m4trace:configure.ac:176: -1- AM_PROG_MKDIR_P +m4trace:configure.ac:176: -1- m4_pattern_allow([^mkdir_p$]) +m4trace:configure.ac:176: -1- m4_pattern_allow([^AWK$]) +m4trace:configure.ac:176: -1- m4_pattern_allow([^SET_MAKE$]) +m4trace:configure.ac:176: -1- AM_SET_LEADING_DOT +m4trace:configure.ac:176: -1- m4_pattern_allow([^am__leading_dot$]) +m4trace:configure.ac:176: -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:176: -2- _AM_MANGLE_OPTION([tar-ustar]) +m4trace:configure.ac:176: -1- _AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])]) +m4trace:configure.ac:176: -2- _AM_MANGLE_OPTION([tar-pax]) +m4trace:configure.ac:176: -1- _AM_PROG_TAR([v7]) +m4trace:configure.ac:176: -1- AM_MISSING_PROG([AMTAR], [tar]) +m4trace:configure.ac:176: -1- m4_pattern_allow([^AMTAR$]) +m4trace:configure.ac:176: -1- m4_pattern_allow([^am__tar$]) +m4trace:configure.ac:176: -1- m4_pattern_allow([^am__untar$]) +m4trace:configure.ac:176: -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:176: -2- _AM_MANGLE_OPTION([no-dependencies]) +m4trace:configure.ac:199: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:199: -1- m4_pattern_allow([^CFLAGS$]) +m4trace:configure.ac:199: -1- m4_pattern_allow([^LDFLAGS$]) +m4trace:configure.ac:199: -1- m4_pattern_allow([^LIBS$]) +m4trace:configure.ac:199: -1- m4_pattern_allow([^CPPFLAGS$]) +m4trace:configure.ac:199: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:199: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:199: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:199: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:199: -1- m4_pattern_allow([^ac_ct_CC$]) +m4trace:configure.ac:199: -1- m4_pattern_allow([^EXEEXT$]) +m4trace:configure.ac:199: -1- m4_pattern_allow([^OBJEXT$]) +m4trace:configure.ac:199: -1- _AM_DEPENDENCIES([CC]) +m4trace:configure.ac:199: -1- AM_SET_DEPDIR +m4trace:configure.ac:199: -1- m4_pattern_allow([^DEPDIR$]) +m4trace:configure.ac:199: -1- AM_OUTPUT_DEPENDENCY_COMMANDS +m4trace:configure.ac:199: -1- AM_MAKE_INCLUDE +m4trace:configure.ac:199: -1- m4_pattern_allow([^am__include$]) +m4trace:configure.ac:199: -1- m4_pattern_allow([^am__quote$]) +m4trace:configure.ac:199: -1- AM_DEP_TRACK +m4trace:configure.ac:199: -1- AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +m4trace:configure.ac:199: -1- m4_pattern_allow([^AMDEP_TRUE$]) +m4trace:configure.ac:199: -1- m4_pattern_allow([^AMDEP_FALSE$]) +m4trace:configure.ac:199: -1- _AM_SUBST_NOTMAKE([AMDEP_TRUE]) +m4trace:configure.ac:199: -1- _AM_SUBST_NOTMAKE([AMDEP_FALSE]) +m4trace:configure.ac:199: -1- m4_pattern_allow([^AMDEPBACKSLASH$]) +m4trace:configure.ac:199: -1- _AM_SUBST_NOTMAKE([AMDEPBACKSLASH]) +m4trace:configure.ac:199: -1- m4_pattern_allow([^CCDEPMODE$]) +m4trace:configure.ac:199: -1- AM_CONDITIONAL([am__fastdepCC], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3]) +m4trace:configure.ac:199: -1- m4_pattern_allow([^am__fastdepCC_TRUE$]) +m4trace:configure.ac:199: -1- m4_pattern_allow([^am__fastdepCC_FALSE$]) +m4trace:configure.ac:199: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_TRUE]) +m4trace:configure.ac:199: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_FALSE]) +m4trace:configure.ac:199: -1- m4_pattern_allow([^CPP$]) +m4trace:configure.ac:199: -1- m4_pattern_allow([^CPPFLAGS$]) +m4trace:configure.ac:199: -1- m4_pattern_allow([^CPP$]) +m4trace:configure.ac:200: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:200: -1- m4_pattern_allow([^CFLAGS$]) +m4trace:configure.ac:200: -1- m4_pattern_allow([^LDFLAGS$]) +m4trace:configure.ac:200: -1- m4_pattern_allow([^LIBS$]) +m4trace:configure.ac:200: -1- m4_pattern_allow([^CPPFLAGS$]) +m4trace:configure.ac:200: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:200: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:200: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:200: -1- m4_pattern_allow([^CC$]) +m4trace:configure.ac:200: -1- m4_pattern_allow([^ac_ct_CC$]) +m4trace:configure.ac:200: -1- _AM_DEPENDENCIES([CC]) +m4trace:configure.ac:200: -1- m4_pattern_allow([^CCDEPMODE$]) +m4trace:configure.ac:200: -1- AM_CONDITIONAL([am__fastdepCC], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3]) +m4trace:configure.ac:200: -1- m4_pattern_allow([^am__fastdepCC_TRUE$]) +m4trace:configure.ac:200: -1- m4_pattern_allow([^am__fastdepCC_FALSE$]) +m4trace:configure.ac:200: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_TRUE]) +m4trace:configure.ac:200: -1- _AM_SUBST_NOTMAKE([am__fastdepCC_FALSE]) +m4trace:configure.ac:204: -1- m4_pattern_allow([^CXX$]) +m4trace:configure.ac:204: -1- m4_pattern_allow([^CXXFLAGS$]) +m4trace:configure.ac:204: -1- m4_pattern_allow([^LDFLAGS$]) +m4trace:configure.ac:204: -1- m4_pattern_allow([^LIBS$]) +m4trace:configure.ac:204: -1- m4_pattern_allow([^CPPFLAGS$]) +m4trace:configure.ac:204: -1- m4_pattern_allow([^CXX$]) +m4trace:configure.ac:204: -1- m4_pattern_allow([^ac_ct_CXX$]) +m4trace:configure.ac:204: -1- _AM_DEPENDENCIES([CXX]) +m4trace:configure.ac:204: -1- m4_pattern_allow([^CXXDEPMODE$]) +m4trace:configure.ac:204: -1- AM_CONDITIONAL([am__fastdepCXX], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CXX_dependencies_compiler_type" = gcc3]) +m4trace:configure.ac:204: -1- m4_pattern_allow([^am__fastdepCXX_TRUE$]) +m4trace:configure.ac:204: -1- m4_pattern_allow([^am__fastdepCXX_FALSE$]) +m4trace:configure.ac:204: -1- _AM_SUBST_NOTMAKE([am__fastdepCXX_TRUE]) +m4trace:configure.ac:204: -1- _AM_SUBST_NOTMAKE([am__fastdepCXX_FALSE]) +m4trace:configure.ac:209: -1- AM_PROG_CC_C_O +m4trace:configure.ac:209: -1- m4_pattern_allow([^NO_MINUS_C_MINUS_O$]) +m4trace:configure.ac:212: -1- m4_pattern_allow([^INSTALL_PROGRAM$]) +m4trace:configure.ac:212: -1- m4_pattern_allow([^INSTALL_SCRIPT$]) +m4trace:configure.ac:212: -1- m4_pattern_allow([^INSTALL_DATA$]) +m4trace:configure.ac:213: -1- m4_pattern_allow([^SED$]) +m4trace:configure.ac:213: -1- m4_pattern_allow([^SED$]) +m4trace:configure.ac:214: -1- m4_pattern_allow([^LN_S$]) +m4trace:configure.ac:218: -1- AC_PROG_LIBTOOL +m4trace:configure.ac:218: -1- _m4_warn([obsolete], [The macro `AC_PROG_LIBTOOL' is obsolete. +You should run autoupdate.], [m4/libtool.m4:102: AC_PROG_LIBTOOL is expanded from... +configure.ac:218: the top level]) +m4trace:configure.ac:218: -1- LT_INIT +m4trace:configure.ac:218: -1- _m4_warn([obsolete], [back quotes and double quotes must not be escaped in: $as_me:$LINENO: WARNING: Libtool does not cope well with whitespace in \`pwd\`], [m4/libtool.m4:57: _LT_CHECK_BUILDDIR is expanded from... +m4/libtool.m4:67: LT_INIT is expanded from... +m4/libtool.m4:102: AC_PROG_LIBTOOL is expanded from... +configure.ac:218: the top level]) +m4trace:configure.ac:218: -1- _m4_warn([obsolete], [back quotes and double quotes must not be escaped in: $as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`], [m4/libtool.m4:57: _LT_CHECK_BUILDDIR is expanded from... +m4/libtool.m4:67: LT_INIT is expanded from... +m4/libtool.m4:102: AC_PROG_LIBTOOL is expanded from... +configure.ac:218: the top level]) +m4trace:configure.ac:218: -1- m4_pattern_forbid([^_?LT_[A-Z_]+$]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$]) +m4trace:configure.ac:218: -1- LTOPTIONS_VERSION +m4trace:configure.ac:218: -1- LTSUGAR_VERSION +m4trace:configure.ac:218: -1- LTVERSION_VERSION +m4trace:configure.ac:218: -1- LTOBSOLETE_VERSION +m4trace:configure.ac:218: -1- _LT_PROG_LTMAIN +m4trace:configure.ac:218: -1- m4_pattern_allow([^LIBTOOL$]) +m4trace:configure.ac:218: -1- LT_PATH_LD +m4trace:configure.ac:218: -1- m4_pattern_allow([^SED$]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^SED$]) +m4trace:configure.ac:218: -1- AC_PROG_EGREP +m4trace:configure.ac:218: -1- m4_pattern_allow([^GREP$]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^GREP$]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^EGREP$]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^EGREP$]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^FGREP$]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^FGREP$]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^GREP$]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^LD$]) +m4trace:configure.ac:218: -1- LT_PATH_NM +m4trace:configure.ac:218: -1- m4_pattern_allow([^DUMPBIN$]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^ac_ct_DUMPBIN$]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^DUMPBIN$]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^NM$]) +m4trace:configure.ac:218: -1- LT_CMD_MAX_LEN +m4trace:configure.ac:218: -1- m4_pattern_allow([^AR$]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^STRIP$]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^RANLIB$]) +m4trace:configure.ac:218: -1- m4_pattern_allow([LT_OBJDIR]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^LT_OBJDIR$]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^lt_ECHO$]) +m4trace:configure.ac:218: -1- _LT_CC_BASENAME([$compiler]) +m4trace:configure.ac:218: -1- _LT_PATH_TOOL_PREFIX([${ac_tool_prefix}file], [/usr/bin$PATH_SEPARATOR$PATH]) +m4trace:configure.ac:218: -1- _LT_PATH_TOOL_PREFIX([file], [/usr/bin$PATH_SEPARATOR$PATH]) +m4trace:configure.ac:218: -1- LT_SUPPORTED_TAG([CC]) +m4trace:configure.ac:218: -1- _LT_COMPILER_BOILERPLATE +m4trace:configure.ac:218: -1- _LT_LINKER_BOILERPLATE +m4trace:configure.ac:218: -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:218: -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:218: -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:218: -1- m4_pattern_allow([^DSYMUTIL$]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^NMEDIT$]) +m4trace:configure.ac:218: -1- LT_SYS_DLOPEN_SELF +m4trace:configure.ac:218: -1- m4_pattern_allow([^STDC_HEADERS$]) +m4trace:configure.ac:218: -1- LT_LANG([CXX]) +m4trace:configure.ac:218: -1- LT_SUPPORTED_TAG([CXX]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^CXX$]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^CXXFLAGS$]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^LDFLAGS$]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^LIBS$]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^CPPFLAGS$]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^CXX$]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^ac_ct_CXX$]) +m4trace:configure.ac:218: -1- _AM_DEPENDENCIES([CXX]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^CXXDEPMODE$]) +m4trace:configure.ac:218: -1- AM_CONDITIONAL([am__fastdepCXX], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CXX_dependencies_compiler_type" = gcc3]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^am__fastdepCXX_TRUE$]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^am__fastdepCXX_FALSE$]) +m4trace:configure.ac:218: -1- _AM_SUBST_NOTMAKE([am__fastdepCXX_TRUE]) +m4trace:configure.ac:218: -1- _AM_SUBST_NOTMAKE([am__fastdepCXX_FALSE]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^CXXCPP$]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^CPPFLAGS$]) +m4trace:configure.ac:218: -1- m4_pattern_allow([^CXXCPP$]) +m4trace:configure.ac:218: -1- _LT_COMPILER_BOILERPLATE +m4trace:configure.ac:218: -1- _LT_LINKER_BOILERPLATE +m4trace:configure.ac:218: -1- _LT_CC_BASENAME([$compiler]) +m4trace:configure.ac:218: -1- LT_PATH_LD +m4trace:configure.ac:218: -1- m4_pattern_allow([^LD$]) +m4trace:configure.ac:218: -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:218: -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:224: -1- m4_pattern_allow([^HAVE_PKG_CONFIG$]) +m4trace:configure.ac:238: -1- m4_pattern_allow([^XMKMF$]) +m4trace:configure.ac:238: -1- m4_pattern_allow([^X_DISPLAY_MISSING$]) +m4trace:configure.ac:238: -1- m4_pattern_allow([^X_CFLAGS$]) +m4trace:configure.ac:238: -1- m4_pattern_allow([^X_PRE_LIBS$]) +m4trace:configure.ac:238: -1- m4_pattern_allow([^X_LIBS$]) +m4trace:configure.ac:238: -1- m4_pattern_allow([^X_EXTRA_LIBS$]) +m4trace:configure.ac:366: -1- m4_pattern_allow([^LIBPNG_CONFIG$]) +m4trace:configure.ac:604: -1- m4_pattern_allow([^NO_PROCPS$]) +m4trace:configure.ac:618: -1- m4_pattern_allow([^DNET_CONFIG$]) +m4trace:configure.ac:629: -1- m4_pattern_allow([^DNET_IS_DUMBNET$]) +m4trace:configure.ac:638: -1- m4_pattern_allow([^NO_DNET$]) +m4trace:configure.ac:649: -1- m4_pattern_allow([^ICU_CONFIG$]) +m4trace:configure.ac:684: -1- m4_pattern_allow([^HAVE_CXX$]) +m4trace:configure.ac:710: -1- m4_pattern_allow([^RPCGEN$]) +m4trace:configure.ac:759: -1- m4_pattern_allow([^HAVE__BOOL$]) +m4trace:configure.ac:759: -1- m4_pattern_allow([^HAVE_STDBOOL_H$]) +m4trace:configure.ac:760: -1- m4_pattern_allow([^const$]) +m4trace:configure.ac:761: -1- m4_pattern_allow([^uid_t$]) +m4trace:configure.ac:761: -1- m4_pattern_allow([^gid_t$]) +m4trace:configure.ac:763: -1- m4_pattern_allow([^mode_t$]) +m4trace:configure.ac:764: -1- m4_pattern_allow([^off_t$]) +m4trace:configure.ac:765: -1- m4_pattern_allow([^pid_t$]) +m4trace:configure.ac:766: -1- m4_pattern_allow([^size_t$]) +m4trace:configure.ac:767: -1- m4_pattern_allow([^HAVE_STRUCT_STAT_ST_RDEV$]) +m4trace:configure.ac:768: -1- m4_pattern_allow([^TIME_WITH_SYS_TIME$]) +m4trace:configure.ac:769: -1- m4_pattern_allow([^TM_IN_SYS_TIME$]) +m4trace:configure.ac:770: -1- m4_pattern_allow([^volatile$]) +m4trace:configure.ac:780: -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:780: the top level]) +m4trace:configure.ac:798: -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:798: the top level]) +m4trace:configure.ac:825: -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:825: the top level]) +m4trace:configure.ac:848: -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:848: the top level]) +m4trace:configure.ac:932: -1- AM_CONDITIONAL([BUILD_HGFSMOUNTER], [test "$buildHgfsmounter" = "yes"]) +m4trace:configure.ac:932: -1- m4_pattern_allow([^BUILD_HGFSMOUNTER_TRUE$]) +m4trace:configure.ac:932: -1- m4_pattern_allow([^BUILD_HGFSMOUNTER_FALSE$]) +m4trace:configure.ac:932: -1- _AM_SUBST_NOTMAKE([BUILD_HGFSMOUNTER_TRUE]) +m4trace:configure.ac:932: -1- _AM_SUBST_NOTMAKE([BUILD_HGFSMOUNTER_FALSE]) +m4trace:configure.ac:933: -1- AM_CONDITIONAL([LINUX], [test "$os" = "linux"]) +m4trace:configure.ac:933: -1- m4_pattern_allow([^LINUX_TRUE$]) +m4trace:configure.ac:933: -1- m4_pattern_allow([^LINUX_FALSE$]) +m4trace:configure.ac:933: -1- _AM_SUBST_NOTMAKE([LINUX_TRUE]) +m4trace:configure.ac:933: -1- _AM_SUBST_NOTMAKE([LINUX_FALSE]) +m4trace:configure.ac:934: -1- AM_CONDITIONAL([SOLARIS], [test "$os" = "solaris"]) +m4trace:configure.ac:934: -1- m4_pattern_allow([^SOLARIS_TRUE$]) +m4trace:configure.ac:934: -1- m4_pattern_allow([^SOLARIS_FALSE$]) +m4trace:configure.ac:934: -1- _AM_SUBST_NOTMAKE([SOLARIS_TRUE]) +m4trace:configure.ac:934: -1- _AM_SUBST_NOTMAKE([SOLARIS_FALSE]) +m4trace:configure.ac:935: -1- AM_CONDITIONAL([FREEBSD], [test "$os" = "freebsd"]) +m4trace:configure.ac:935: -1- m4_pattern_allow([^FREEBSD_TRUE$]) +m4trace:configure.ac:935: -1- m4_pattern_allow([^FREEBSD_FALSE$]) +m4trace:configure.ac:935: -1- _AM_SUBST_NOTMAKE([FREEBSD_TRUE]) +m4trace:configure.ac:935: -1- _AM_SUBST_NOTMAKE([FREEBSD_FALSE]) +m4trace:configure.ac:936: -1- AM_CONDITIONAL([THIRTY_TWO_BIT_USERSPACE], [test "$userSpaceBitness" = "32"]) +m4trace:configure.ac:936: -1- m4_pattern_allow([^THIRTY_TWO_BIT_USERSPACE_TRUE$]) +m4trace:configure.ac:936: -1- m4_pattern_allow([^THIRTY_TWO_BIT_USERSPACE_FALSE$]) +m4trace:configure.ac:936: -1- _AM_SUBST_NOTMAKE([THIRTY_TWO_BIT_USERSPACE_TRUE]) +m4trace:configure.ac:936: -1- _AM_SUBST_NOTMAKE([THIRTY_TWO_BIT_USERSPACE_FALSE]) +m4trace:configure.ac:937: -1- AM_CONDITIONAL([HAVE_X11], [test "$have_x" = "yes"]) +m4trace:configure.ac:937: -1- m4_pattern_allow([^HAVE_X11_TRUE$]) +m4trace:configure.ac:937: -1- m4_pattern_allow([^HAVE_X11_FALSE$]) +m4trace:configure.ac:937: -1- _AM_SUBST_NOTMAKE([HAVE_X11_TRUE]) +m4trace:configure.ac:937: -1- _AM_SUBST_NOTMAKE([HAVE_X11_FALSE]) +m4trace:configure.ac:938: -1- AM_CONDITIONAL([HAVE_ICU], [test "$with_icu" = "yes"]) +m4trace:configure.ac:938: -1- m4_pattern_allow([^HAVE_ICU_TRUE$]) +m4trace:configure.ac:938: -1- m4_pattern_allow([^HAVE_ICU_FALSE$]) +m4trace:configure.ac:938: -1- _AM_SUBST_NOTMAKE([HAVE_ICU_TRUE]) +m4trace:configure.ac:938: -1- _AM_SUBST_NOTMAKE([HAVE_ICU_FALSE]) +m4trace:configure.ac:939: -1- AM_CONDITIONAL([WITH_KERNEL_MODULES], [test "$with_kernel_modules" = "yes"]) +m4trace:configure.ac:939: -1- m4_pattern_allow([^WITH_KERNEL_MODULES_TRUE$]) +m4trace:configure.ac:939: -1- m4_pattern_allow([^WITH_KERNEL_MODULES_FALSE$]) +m4trace:configure.ac:939: -1- _AM_SUBST_NOTMAKE([WITH_KERNEL_MODULES_TRUE]) +m4trace:configure.ac:939: -1- _AM_SUBST_NOTMAKE([WITH_KERNEL_MODULES_FALSE]) +m4trace:configure.ac:940: -1- AM_CONDITIONAL([PAMD], [test -d /etc/pam.d]) +m4trace:configure.ac:940: -1- m4_pattern_allow([^PAMD_TRUE$]) +m4trace:configure.ac:940: -1- m4_pattern_allow([^PAMD_FALSE$]) +m4trace:configure.ac:940: -1- _AM_SUBST_NOTMAKE([PAMD_TRUE]) +m4trace:configure.ac:940: -1- _AM_SUBST_NOTMAKE([PAMD_FALSE]) +m4trace:configure.ac:941: -1- AM_CONDITIONAL([ENABLE_UNITY], [test "$enable_unity" = "yes"]) +m4trace:configure.ac:941: -1- m4_pattern_allow([^ENABLE_UNITY_TRUE$]) +m4trace:configure.ac:941: -1- m4_pattern_allow([^ENABLE_UNITY_FALSE$]) +m4trace:configure.ac:941: -1- _AM_SUBST_NOTMAKE([ENABLE_UNITY_TRUE]) +m4trace:configure.ac:941: -1- _AM_SUBST_NOTMAKE([ENABLE_UNITY_FALSE]) +m4trace:configure.ac:942: -1- AM_CONDITIONAL([WITH_ROOT_PRIVILEGES], [test "$with_root_privileges" = "yes"]) +m4trace:configure.ac:942: -1- m4_pattern_allow([^WITH_ROOT_PRIVILEGES_TRUE$]) +m4trace:configure.ac:942: -1- m4_pattern_allow([^WITH_ROOT_PRIVILEGES_FALSE$]) +m4trace:configure.ac:942: -1- _AM_SUBST_NOTMAKE([WITH_ROOT_PRIVILEGES_TRUE]) +m4trace:configure.ac:942: -1- _AM_SUBST_NOTMAKE([WITH_ROOT_PRIVILEGES_FALSE]) +m4trace:configure.ac:953: -1- m4_pattern_allow([^NO_MULTIMON$]) +m4trace:configure.ac:983: -1- m4_pattern_allow([^TARGET_OS$]) +m4trace:configure.ac:984: -1- m4_pattern_allow([^KERNEL_RELEASE$]) +m4trace:configure.ac:985: -1- m4_pattern_allow([^MODULES_OS$]) +m4trace:configure.ac:986: -1- m4_pattern_allow([^MODULES_DIR$]) +m4trace:configure.ac:987: -1- m4_pattern_allow([^MODULES$]) +m4trace:configure.ac:988: -1- m4_pattern_allow([^COMMON_XLIBS$]) +m4trace:configure.ac:989: -1- m4_pattern_allow([^GTK_CPPFLAGS$]) +m4trace:configure.ac:990: -1- m4_pattern_allow([^GTK_LIBS$]) +m4trace:configure.ac:991: -1- m4_pattern_allow([^DNET_CPPFLAGS$]) +m4trace:configure.ac:992: -1- m4_pattern_allow([^DNET_LIBS$]) +m4trace:configure.ac:993: -1- m4_pattern_allow([^PROCPS_LIBS$]) +m4trace:configure.ac:994: -1- m4_pattern_allow([^ICU_CPPFLAGS$]) +m4trace:configure.ac:995: -1- m4_pattern_allow([^ICU_LIBS$]) +m4trace:configure.ac:996: -1- m4_pattern_allow([^PAM_PREFIX$]) +m4trace:configure.ac:997: -1- m4_pattern_allow([^URIPARSER_CPPFLAGS$]) +m4trace:configure.ac:998: -1- m4_pattern_allow([^URIPARSER_LIBS$]) +m4trace:configure.ac:999: -1- m4_pattern_allow([^LIBPNG_CPPFLAGS$]) +m4trace:configure.ac:1000: -1- m4_pattern_allow([^LIBPNG_LIBS$]) +m4trace:configure.ac:1001: -1- m4_pattern_allow([^ZLIB_CPPFLAGS$]) +m4trace:configure.ac:1002: -1- m4_pattern_allow([^ZLIB_LIBS$]) +m4trace:configure.ac:1006: -1- m4_pattern_allow([^LIB_AUTH_CPPFLAGS$]) +m4trace:configure.ac:1007: -1- m4_pattern_allow([^LIB_FILE_CPPFLAGS$]) +m4trace:configure.ac:1008: -1- m4_pattern_allow([^LIB_HGFS_SERVER_CPPFLAGS$]) +m4trace:configure.ac:1009: -1- m4_pattern_allow([^LIB_IMPERSONATE_CPPFLAGS$]) +m4trace:configure.ac:1010: -1- m4_pattern_allow([^LIB_MISC_CPPFLAGS$]) +m4trace:configure.ac:1011: -1- m4_pattern_allow([^LIB_PROC_MGR_CPPFLAGS$]) +m4trace:configure.ac:1012: -1- m4_pattern_allow([^LIB_STRING_CPPFLAGS$]) +m4trace:configure.ac:1013: -1- m4_pattern_allow([^LIB_USER_CPPFLAGS$]) +m4trace:configure.ac:1017: -1- m4_pattern_allow([^GUESTD_LDADD$]) +m4trace:configure.ac:1019: -1- m4_pattern_allow([^VMWARE_USER_CPPFLAGS$]) +m4trace:configure.ac:1020: -1- m4_pattern_allow([^VMWARE_USER_LDADD$]) +m4trace:configure.ac:1106: -1- m4_pattern_allow([^LIB@&t@OBJS$]) +m4trace:configure.ac:1106: -1- m4_pattern_allow([^LTLIBOBJS$]) +m4trace:configure.ac:1106: -1- _AM_OUTPUT_DEPENDENCY_COMMANDS +m4trace:configure.ac:1106: -1- _LT_PROG_LTMAIN diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/ChangeLog /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/ChangeLog --- open-vm-tools-2008.01.23-74039/ChangeLog 2008-01-28 08:02:43.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/ChangeLog 2008-10-13 08:01:38.000000000 +0100 @@ -1,3 +1,1364 @@ +2008-10-13 Adar Dembo + * Resync with internal trunk (2008.10.09) + + * configure.ac, modules/Makefile.am: Added a command-line option to + skip privileged operations during make install (requested by Dennis + Leroy). Integrated new vmxnet3 kernel module. + + * configure.ac, lib/guestInfo/Makefile.am, + lib/guestInfo/guestInfoPerfMonLinux.c, lib/include/vm_procps.h: + Removed open-vm-tools dependency on libproc-dev by providing some procps + bits and pieces in our own vm_procps.h (Sourceforge bug 1960947). + + * hgfsmounter/Makefile.am: Removed chown calls. Only call chmod + if we're running as root (requested by Dennis Leroy). + + * */foreignVMToolsDaemon.c, */foundryToolsDaemon.[ch], + lib/guestInfo/guestInfo.c, lib/guestInfo/guestInfoServer.c, + lib/include/guestInfoServer.h, lib/include/vixTools.h, + lib/rpcin/rpcin.c, lib/vixTools/vixTools.c, vmware-user/copyPaste.c, + vmware-user/vmware-user.c: More refactoring from the Tools core + services project. + + * */foundryToolsDaemon.c: Changed HGFS mounting behavior such that the + global HGFS share is mounted at /mnt/hgfs instead of relying on + "mount -a". + + * guestd/toolsDaemon.[ch], lib/include/backdoor_def.h, + lib/include/system.h, lib/include/vm_app.h, lib/system/systemLinux.c: + Added backwards time synchronization functionality. Moved Tools scripts + checking from VMX to guestd. + + * hgfsmounter/hgfsmounter.c: Added handling for multiple "-o" flags on + the command line. + + * lib/dynxdr/dynxdr.c: Fixed x_putint32 behavior on 64-bit Solaris. + + * lib/file/*, lib/include/codeset.h, lib/include/file.h, + lib/include/fileIO.h, lib/include/hostinfo.h, + lib/include/loglevel_user.h, lib/include/productState.h, + lib/include/timeutil.h, lib/include/unicodeTypes.h, + lib/include/vixCommands.h, lib/include/vix.h, + lib/include/vm_basic_asm.h, lib/include/vm_basic_types.h, + lib/include/vm_legal.h, lib/include/vm_product.h, + lib/include/win32util.h, lib/include/x86cpuid.h, lib/misc/codeset.c, + lib/misc/codesetOld.[ch], lib/misc/posixPosix.c, lib/misc/timeutil.c, + lib/region/region.c, lib/string/bsd_vsnprintf.c, lib/unicode/*, + lib/user/hostinfoPosix.c, modules/freebsd/vmhgfs/sha1.c, + modules/*/*/vm_device_version.h, modules/linux/*/vmci_iocontrols.h, + modules/linux/*/vmci_version.h, modules/linux/vmhgfs/hgfsEscape.h: + Changes from work unrelated to open-vm-tools on internal trunk. + + * lib/ghIntegration/ghIntegrationX11.c: Fixed some bugs in menu-spec and + desktop-entry-spec support in Linux guests. + + * lib/guestApp/guestApp.c, lib/include/guestApp.h, + lib/include/statelogger_backdoor_def.h, toolbox/Makefile.am, + toolbox/toolbox-cmd.c, toolbox/toolbox-gtk.c, toolbox/toolboxCmdInt.h, + toolbox/toolboxGtkInt.h, toolbox/toolboxInt.h, toolbox/toolboxRecord.c, + toolbox/toolboxcmd-record.c: Patches from Yiwen Zhang to add basic + record/replay controls to the gtk and command-line toolbox apps. + + * lib/guestInfo/guestInfoPosix.c: Fixed a bug where we assumed the + primary interface's addresses were all IPv4 addresses. + + * lib/guestInfo/guestInfoServer.c: Fixed a memory leak. + + * lib/guestRpc/Makefile.am, lib/guestRpc/unityActive.x, + lib/include/guestCaps.h, lib/include/unityCommon.h, lib/unity/unity.c, + vmware-user/Makefile.am: Added new unityActive xdr protocol, used for + tracking whether Unity is enabled or not. + + * lib/hgfsServer/hgfsServer.c, lib/hgfsServer/hgfsServerLinux.c, + lib/hgfsServerPolicyGuest/hgfsServerPolicyGuest.c, + lib/include/hgfsProto.h: Fixed bug where we were invalidating HGFS + handles on the share of entire drive ("/"). Added optional symlink + following behavior to HGFS server. Fixed a UTF-8 validation issue. + Added volume ID field to attribute fields. + + * lib/include/vm_tools_version.h: Bumped internal Tools backdoor + version. + + * lib/include/vm_version.h: Bumped TOOLS_VERSION. + + * lib/procMgr/progMgrPosix.c: Fixed impersonation behavior so that + uids are passed to setresuid instead of gids. Added alternate way to + list processes in situations where a process lacks a command line. + + * lib/region/region.c: Reforked xorg miregion.c and apply open-vm-tools + specific patches. + + * lib/unity/*, lib/unityWindowTracker/unityWindowTracker.c: Fixed an + overflow that lead to a panic when a window title exceeded 1024 bytes. + Fixed some initialization assumptions when using virtual desktops. + + * lib/unity/unityPlatformX11Window.c: Fixed an issue with restacking + windows above non-existent windows. Other minor fixes. + + * modules/*/*/*: Reflected changes from elsewhere. + + * modules/linux/*/Makefile.kernel: Changed clean target to remove + Module.markers and modules.order. + + * modules/linux/vsock/include/compat_sock.h, + modules/linux/vsock/*: Fixed several issues in vsock. + +2008-09-03 Adar Dembo + * Resync with internal trunk (2008.08.29) + + * Makefile.am, aclocal.m4, m4/*: Moved macros to 'm4' subdir. + + * compile, config.guess, config.sub, config/*, depcomp, install-sh, + ltmain.sh, missing: Moved auxiliary build tools to 'config' subdir. + + * configure.ac: Moved macros and auxiliary build tools into separate + subdirectories. Added command line option to force the use of gtk1 over + gtk2. Cosmetic fixes. Reworked libicu detection. Switched over to + libtool-2.2. Added library check for new gdk symbol. Added library + check for libnotify. Reworked use of macros from AC_PATH_XTRA and + some X11 library checks. + + * */foundryToolsDaemon.c, toolbox/toolbox-cmd.c, guestd/main.c, + lib/guestInfo/guestInfoPerfMonLinux.c, lib/guestInfo/guestInfoPosix.c, + lib/misc/posixPosix.c, lib/panic/panic.c, lib/system/systemLinux.c, + modules/linux/vsock/linux/util.c, xferlogs/xferlogs.c: Added checks for + return codes of certain functions and passed %s to formatted string + functions where appropriate (needed to compile on Ubuntu Intrepid). + + * lib/appUtil/appUtilX11.c: Fixed command line skipping logic and added + more icon paths. Removed unnecessary chdir(2) canonicalization logic. + + * lib/deployPkg/runDeployPkgPosix.c, lib/file/fileIO.c, + lib/file/fileIOPosix.c, lib/file/fileLockPrimitive.c, + lib/file/filePosix.c, lib/hgfsServer/hgfsServerLinux.c, + lib/include/bsdfmt.h, lib/include/file.h, lib/include/fileIO.h, + lib/include/iovector.h, lib/include/msgfmt.h, lib/include/str.h, + lib/include/vm_basic_defs.h, lib/include/vm_basic_types.h, + lib/misc/hostname.c, lib/misc/idLinux.c, lib/misc/posixPosix.c, + lib/SLPv2Parser/*.c, lib/wiper/wiperPosix.c, toolbox/toolboxScripts.c: + Added FreeBSD compatibility glue. + + * guestd/toolsDaemon.c, lib/file/file.c, + lib/foundryMsg/foundryPropertyListCommon.c, lib/image/imageUtilPng.c, + lib/include/appUtil.h, lib/include/backdoor_def.h, lib/include/conf.h, + lib/include/cpuid_info.h, lib/include/guest_os.h, + lib/include/hostinfo.h, lib/include/imageUtil.h, + lib/include/imageUtilTypes.h, lib/include/log.h, + lib/include/loglevel_user.h, lib/include/netutil.h, + lib/include/posix.h, lib/include/timeutil.h, lib/include/util.h, + lib/include/uuid.h, lib/include/vix.h, lib/include/vixOpenSource.h, + lib/include/vm_atomic.h, lib/include/vm_legal.h, + lib/include/vm_version.h, lib/include/x86cpuid.h, + lib/misc/codesetOld.c, lib/misc/timeutil.c, lib/string/bsd_vsnprintf.c, + lib/user/util.c, lib/user/utilPosix.c, lib/vixTools/vixTools.c, + modules/linux/*/vmci_kernel_if.h, modules/linux/vmxnet/compat_timer.h, + toolbox/toolboxCmdInt.h, toolbox/toolboxcmd-*.c: + Changes from work unrelated to open-vm-tools on internal trunk. + + * lib/ghIntegration/ghIntegration.c, + lib/guestRpc/ghiGetBinaryHandlers.x: Don't send oversized messages. + Increased maximum number of binary handlers. + + * lib/ghIntegration/ghIntegrationX11.c, lib/guestApp/guestAppPosix.c, + lib/include/guestApp.h, lib/include/system.h, lib/system/systemLinux.c, + toolbox/toolbox-gtk.c: Improved "run program" functionality by + restoring program environment and stripping any VMware wrapper script + changes to LD_LIBRARY_PATH. + + * lib/guestApp/guestAppPosixX11.c: Now using glib to open URLs instead + of system(3). Improved gnome and kde session detection. + + * lib/guestApp/Makefile.am: This library needed GTK_CPPFLAGS too. + + * lib/guestInfo/guestInfoInt.h, lib/guestInfo/guestInfoPosix.c, + lib/guestInfo/guestInfoServer.c: Added logic to optionally convert + subnet mask to an ASCII string. + + * lib/guestRpc/Makefile.am: Cleaned up generated xdr headers better. + + * lib/hgfsServer/hgfsServer.c, lib/hgfsServer/hgfsServerInt.h, + lib/hgfsServer/hgfsServerLinux.c: Fixed problems when packing V3 + replies. + + * lib/hgfsServer/hgfsServerLinux.c: Fixed UTF-8 normal form D/C + conversions on the root directory. + + * lib/include/dndGuest.h: Changed preprocessor usage to allow gtk1 to + access UnityDnD. + + * lib/include/dnd.h, vmware-user/copyPaste.c: Code motion. + + * lib/include/guestCaps.h: Resort the capabilities table. + + * lib/include/rpcin.h, lib/rpcIn/rpcin.c, : Beginnings of the Tools + core services. This is a full-fledged refactoring of the Tools + userlevel apps to a "service" vs. "plugin" programming model. + + * lib/include/vmblock.h, modules/*/vmblock/block.c, + modules/*/vmblock/stubs.c, modules/*/vmblock/stubs.h: Changes needed + to support the fuse-based implementation of vmblock (coming soon). + + * lib/include/vm_tools_version.h: Some Tools version bumps. + + * modules/*/*/*: Reflected changes from elsewhere. + + * modules/*/*/compat/compat_stdarg.h: Added compatibility wrappers for + stdarg features. + + * modules/freebsd/vmhgfs/debug.*: Cosmetic fixes. + + * modules/freebsd/vmhgfs/*: Make driver compliant with HGFSv3. + + * modules/*/vmmemctl/vmballoon.c: Allow module to yield the processor + when allocating many pages. + + * modules/linux/*/autoconf/cachector1.c, + modules/linux/*/include/compat_sched.h, + modules/linux/*/include/compat_semaphore.h, + modules/linux/*/include/compat_slab.h, + modules/linux/vmblock/linux/filesystem.c, + modules/linux/*/Makefile.kernel, + modules/linux/vmhgfs/bdhandler.c, modules/linux/vmhgfs/filesystem.c, + modules/linux/vmhgfs/module.h, modules/linux/vmhgfs/request.c, + modules/linux/vmsync/sync.c, modules/linux/vsock/linux/af_vsock.c: Fix + modules for 2.6.27 kernels. + + * modules/linux/*/Makefile: Fixed DRIVER target. + + * modules/linux/vmci/vmci_drv.c: Moved interrupt registration to be + after driver initialization. + + * modules/linux/vsock/linux/af_vsock.c, + modules/linux/vsock/linux/af_vsock.c: Added optimized flow control + protocol. + + * toolbox/toolboxScripts.c, toolbox/toolboxShrink.c: Cosmetic fixes. + + * vmware-user/copyPaste.c, vmware-user/dnd.c: Fixed edge case behavior + with file copy paste and DnD. + + * vmware-user/modconfig.c, vmware-user/notify.c, + vmware-user/vmware-user.c, vmware-user/vmwareuserInt.h: Added stubbed + modconfig module out-of-date notification framework. Not useful for + open-vm-tools, hence the stubs. + +2008-08-08 Adar Dembo + * Resync with internal trunk (2008.07.24) + + * configure.ac, */Makefile.am: Landed support for command line Toolbox, + Unity, vsock, and vmci. Refactored and reformatted a few things. + Improved portability by using $(SED) and AC_PROG_SED instead of "sed", + $(MKDIR_P) and AC_PROG_MKDIR_P instead of "mkdir -p", $(LN_S) and + AC_PROG_LN_S instead of "ln -s". Changed icu feature detection and + linking to rely on C++ linker instead of C linker. Fixed module + compilation checks on FreeBSD. Fixed $(DESTDIR) handling (patch by Mike + Auty). Refactored lib/strUtil into lib/misc. Changed hgfsmounter + install hook to symlink mount.vmhgfs. Renamed libghIntegrationStub to + libGhIntegrationStub. Fixed compilation of lib/guestApp when using + --without-x (reported by Martin Preishuber). Renamed libunityStub to + libUnityStub. Fix build on FreeBSD by using ":=" instead of "=" when + exporting module directories. The vmware-user desktop link now executes + vmware-user-suid-wrapper. Properly install vmware-user-suid-wrapper. + + * */foundryToolsDaemon.c, lib/vixTools/vixTools.c: Use a larger result + packet when handling impersonated HGFS requests (since HGFSv3 uses + larger packets). + + * guestd/main.c: Moved foreign VM check. + + * guestd/toolsDaemon.*: Added plumbing for HGFS usability library + calls. + + * hgfsmounter/hgfsmounter.c: Added support for passing options to + the MacOS HGFS driver. + + * lib/appUtil/*, lib/include/appUtil.h: New library for Unity support. + + * lib/auth/authPosix.c: Don't try using PAM from the Tools. + + * lib/dnd/dndCommon.c, lib/dnd/dndLinux.c, lib/file/file.c, + lib/file/fileIOPosix.c, lib/file/filePosix.c, lib/include/dnd.h, + lib/include/loglevel_user.h, lib/include/panic.h, lib/include/posix.h, + lib/include/strutil.h, lib/unicode/unicodeBase.h, + lib/include/unicodeOperations.h, lib/include/vix.h, + lib/include/vm_app.h, lib/include/vm_assert.h, + lib/include/vm_product.h, lib/include/x86cpuid.h, lib/misc/codeset.c, + lib/misc/hashTable.c, lib/misc/strutil.c, lib/misc/timeutil.c, + lib/panic/panic.c, lib/string/bsd_vsnprintf.c, lib/strUtil/*, + lib/unicode/unicodeCommon.c, lib/unicode/unicodeSimpleBase.c, + lib/unicode/unicodeStatic.c, lib/user/hostinfoPosix.c, + lib/user/util.c, lib/user/utilPosix.c: Changes from work unrelated to + open-vm-tools on the internal trunk. + + * lib/backdoor/backdoorInt.h, lib/deployPkg/runDeployPkgInt.h, + lib/dnd/dndInt.h, lib/file/fileInt.h, lib/guestInfo/guestInfoInt.h, + lib/hgfs/cpNameInt.h, lib/hgfsServer/hgfsServerInt.h, + lib/impersonate/impersonateInt.h, lib/include/backdoorInt.h, + lib/include/bsd_output_int.h, lib/include/cpNameInt.h, + lib/include/dndInt.h, lib/include/fileInt.h, + lib/include/guestInfoInt.h, lib/hgfsServer/hgfsServerInt.h, + lib/include/impersonateInt.h, lib/include/runDeployPkgInt.h, + lib/include/toolsLoggerInt.h, lib/include/unicodeInt.h, + lib/string/bsd_output_int.h, lib/toolsLogger/toolsLoggerInt.h, + lib/unicode/unicodeInt.h: Moved some internal header files out of + the general include directory and into the appropriate libraries. + + * lib/ghIntegration/*: New library for Unity support. + + * lib/guestApp/guestAppPosixX11.c: Reset the value of LD_LIBRARY_PATH + before running the web browser. + + * lib/guestInfo/guestInfoPosix.c, lib/include/guest_os.h: Fixed a typo + in Mandriva guest detection. Added Asianux. + + * lib/guestInfo/guestInfoServer.c: Fixed behavior for sending nicInfo + updates to the host (patch by Jason Lunz). + + * lib/guestRpc/ghi*.*: New xdr protocol for Unity support. + + * lib/guestRpc/nicinfo.x: Correctly applied LGPL to file. + + * lib/hgfs/cpNameLinux.c: Allow building for versions of Solaris newer + than 10. + + * lib/hgfsServer/hgfsServer.c, + lib/hgfsServerPolicyGuest/hgfsServerPolicyGuest.c, + lib/include/hgfsServerPolicy.h: Provide an override setting for + disabling case conversion during file lookups. + + * lib/hgfsServer/hgfsServerLinux.c: Only perform case insensitive + file lookups if a case sensitive lookup fails. + + * lib/image/imageUtilPng.c, lib/include/imageUtil.h, + lib/include/imageUtilTypes.h: New library for + Unity support. + + * lib/include/conf.h, toolbox/toolbox-gtk.c: Robustified the help page + discovery mechanism. + + * lib/include/dndGuest.h: Allow inclusion of header into source files + without GTK2 support. + + * lib/unity/*, lib/include/guestCaps.h, lib/include/unityCommon.h: New + library for Unity support. + + * lib/include/hgfsUtil.h: Fixed a precedence issue in a macro. + + * lib/raster/*, lib/include/rasterConv.h: New library for Unity support. + + * lib/region/*, lib/include/region.h: New library for Unity support. + + * lib/include/system.h: Added new OS type for WinXP 64-bit, reformatted + enums. + + * lib/unityWindowTracker/*, lib/include/unityWindowTracker.h: New + library for Unity support. + + * lib/include/vm_version.h: Bumped TOOLS_VERSION. + + * lib/wiper/wiperPosix.c: Replaced BSD_VERSION with __FreeBSD_version. + + * modules/*/*/*: Reflected changes from elsewhere. + + * modules/freebsd/vmhgfs/*: Reflected changes from MacOS HGFS work, and + fixed file permissions so that they're not all owned by root. + + * modules/linux/vmblock/linux/dentry.c: Changed d_revalidate to + properly invalidate negative dentries. + + * modules/linux/vmci/*: Landed the Virtual Machine Communication + Interface guest module. + + * modules/linux/vmmemctl/os.c: Fixed vmmemctl to build on 2.6.26 + (reported by Pavol Rusnak). + + * modules/linux/vmsync/sync.c: Fixed vmsync to build on 2.6.26 + (reported by Pavol Rusnak). + + * modules/linux/vsock/*: Landed the VMCI sockets interface module. + + * modules/linux/vmxnet/vmxnet.c, modules/linux/vmxnet/vmxnet2_def.h, + modules/linux/vmxnet/vmxnetInt.h: Increased rx ring size for enhanced + vmxnet2. + + * toolbox/*: Refactored pieces of GTK Toolbox and landed the command + line Toolbox. Fixed mnemonic collisions in the GTK Toolbox. + + * vmware-user/copyPaste.c: Fixed several bugs with file copy paste + behavior. + + * vmware-user/notify.c, vmware-user/vmware-user.c, + vmware-user/vmwareuserInt.h: Added stubs for notification framework. + + * vmware-user/pointer.c: Reverted fix for bug with clipboard retry + behavior. + + * vmware-user/vmware-user.c: Fixed build with gtk 1.2 (reported by + Stephen Duncan). Added signal handlers for SIGUSR1/SIGUSR2 used by + VMware Tools installer to reload vmware-user cleanly during a Tools + upgrader. Reload vmware-user on a fatal X I/O error. Don't panic if + run outside of a VM. Don't leave Unity mode on a Tools reset. + +2008-07-01 Adar Dembo + * Resync with internal trunk (2008.06.30) + + * configure.ac, lib/guestApp/*, toolbox/Makefile.am, + vmware-user/Makefile.am: Split lib/guestApp into two libraries, one + with X11 functionality, and one without. Improved detection of + gnome-open. + + * guestd/*, lib/netUtil/netUtilLinux.c: guestd now compiles for MacOS + guests. + + * guestd/main.c, lib/include/system.h, lib/system/systemLinux.c: + Refactored GuestdWritePidfile into System_Daemon. + + * guestd/toolsDaemon.c: Fixed a backwards time synchronization issue. + Thanks to Eric Castan for reporting the bug. + + * lib/conf/conf.c, lib/include/conf.h: Removed obsolete configuration + keys and values. + + * lib/file/*, lib/dict/*, lib/foundryMsg/*, lib/include/backdoor_def.h, + lib/include/codeset.h, lib/include/config.h, + lib/include/file_extensions.h, lib/include/fileInt.h, + lib/include/loglevel_user.h, lib/include/msg.h, lib/include/msgid.h, + lib/include/posix.h, lib/include/preference.h, lib/include/unity.h, + lib/include/vixCommands.h, lib/include/vix.h, + lib/include/vmbackup_def.h, lib/include/vmBackup.h, + lib/include/vm_basic_defs.h, lib/include/vm_basic_types.h, + lib/include/vm_product.h, lib/include/win32util.h, + lib/include/x86cpuid.h, lib/misc/codeset.c, lib/misc/codesetOld.c, + lib/misc/codesetOld.h, lib/misc/posixPosix.c, lib/strUtil/strutil.c, + lib/user/hostinfoPosix.c, lib/user/util.c, + lib/vmBackupLib/stateMachine.c, modules/*/vmxnet/net.h: Changes from + work unrelated to open-vm-tools on the internal trunk. + + * lib/guestRpc/Makefile.am: Added comment about misuse of CFLAGS. + + * lib/hgfsServer/hgfsServer.c: Corrected pointer arithmetic so that + new node and search allocation works consistently in 64-bit apps. + + * lib/hgfsServer/hgfsServerLinux.c, lib/include/hgfsProto.h: Added + HGFS_ATTR_HIDDEN_FORCED and set it when returning hidden files. + + * lib/hgfsServer/*, lib/hgfsServerPolicy/hgfsServerPolicyGuest.c, + lib/include/hgfsServerInt.h, lib/include/hgfsServerPolicy.h: + Refactored and cleaned up some code. + + * lib/include/resolution.h, lib/resolution/*, + vmware-user/vmware-user.c: Refactored some functions. + + * lib/include/vm_legal.h: Added another patent to the patent string. + + * lib/include/vm_tools_version.h: Added a pair of Tools version macros. + + * lib/include/vm_version.h: Bumped Tools product version. + + * lib/Makefile.am: Included a fix for compilation --without-x. Thanks to + Mark Foster for reporting the issue. + + * lib/misc/Makefile.am, lib/misc/shared/Makefile.am: Realphabetized + some sources and added missing source files. + + * lib/misc/posixWin32.c: Removed unneeded file from tree. + + * lib/procMgr/procMgrPosix.c: Made safe for -fPIC and for MacOS. + + * modules/*/*/*: Reflected changes from elsewhere. + + * modules/freebsd/vmhgfs/*: Added some code to handle codeset + conversions between UTF-8 precomposed and decomposed strings. + + * modules/linux/vmhgfs/*: Refactored string escaping/unescaping code. + + * toolbox/*: Added mnemonics for some buttons. + + * vmware-user/pointer.c: Fixed bug in clipboard retry behavior. + + * vmware-user/vmware-user.c: Added handlers for SIGUSR1 and SIGUSR2 + to facilitate smooth vmware-user upgrades with respect to the vmblock + kernel module. + +2008-06-20 Elliot Lee + + * Resync with internal trunk (2008.06.13) + + * FreeBSD 7/8 fixes from Martin Blapp. + + * Fix getpwnam_r etc. on FreeBSD & Solaris. + + * configure.ac: Add --without-kernel-modules, + --with-linux-release, and --with-linuxdir (gissa). + + * configure.ac, lib/guestRpc/*, lib/guestInfo/guestInfo.c, + lib/guestInfo/guestInfoServer.c, lib/dynxdr/*, + {vmware-user,guestd}/foreignVMToolsNetworking.c, guestd/Makefile.am, + {vmware-user,guestd}/foundryToolsDaemon.c, lib/include/dynxdr.h, + lib/include/guestInfo.h, lib/include/vmxrpc.h, + lib/include/xdrutil.h, lib/Makefile.am, lib/netUtil/*, + lib/vixTools/Makefile.am: Add support for XDR encoding of RPC + values, including the NicInfoV2 structure. + + * guestd/stub.c, hgfsclient/Makefile.am, hgfsclient/stub.c, + hgfsclient/stub-user-util.c, hgfsmounter/Makefile.am, + hgfsmounter/stub.c, lib/stubs/*, libguestlib/Makefile.am, + libguestlib/stubs.c, toolbox/Makefile.am, toolbox/stub.c, + vmware-user/stub.c: Centralize stubs. + + * lib/guestInfo/guestInfoPerfMonLinux.c: Convert ioInRate and + ioOutRate to be in terms of KB instead of pages. + + * lib/hgfsBd/hgfsBd.c, lib/hgfsServer/hgfsServer.c, + lib/hgfsServer/hgfsServerLinux.c: Large packet support, and + additional case-insensitivity fixes. + + * lib/include/hgfsBd.h, lib/include/hgfs.h, + lib/include/hgfsProto.h: Add HGFS error code. + + * lib/hgfs/hgfsUtil.c, lib/guestInfo/Makefile.am, + lib/guestInfo/guestInfoPosix.c, lib/guestApp/guestApp.c, + lib/foundryMsg/foundryMsg.c, lib/file/fileLockPrimitive.c, + lib/file/fileIOPosix.c, lib/file/fileLockPosix.c, + guestd/toolsDaemon.c, guestd/debugStdio.c, guestd/main.c, + lib/hgfsServerManagerGuest/hgfsServerManagerGuest.c, + lib/include/codeset.h, lib/include/cpuid_info.h, + lib/include/dnd.h, lib/include/file_extensions.h, + lib/include/fileInt.h, lib/include/ghIntegration.h, + lib/include/guestApp.h, lib/include/guestStats.h, + lib/include/hgfsServerInt.h, lib/include/hgfsUtil.h, + lib/include/hostinfo.h, lib/include/loglevel_user.h, + lib/include/netutil.h, lib/include/panic.h, lib/include/posix.h, + lib/include/unicode*.h, lib/include/util.h, lib/include/vix.h, + lib/include/vixTools.h, lib/include/vm_app.h, + lib/include/vm_basic_defs.h, lib/include/vm_product.h, + lib/include/vm_tools_version.h, lib/include/vm_version.h, + lib/include/x86cpuid.h, lib/misc/codeset.c, lib/misc/codesetOld.c, + lib/misc/codesetOld.h, lib/misc/hashTable.c, lib/misc/hostname.c, + lib/misc/timeutil.c, lib/panic/panic.c, lib/string/str.c, + lib/sync/syncMutex.c, lib/system/systemLinux.c, lib/unicode/*.c, + lib/unityStub/*, lib/user/hostinfo.c, lib/user/hostinfoPosix.c, + lib/vixTools/*, modules/linux/vmxnet/*, toolbox/debugStdio.c, + vmware-user/debugStdio.c, vmware-user/dnd.c, vmware-user/main.c: + Bug fixes. + + * modules/linux/vmxnet/*: Remove unused BPF code. Add ethtool + callbacks to get & set driver settings. + + * lib/user/util.c: Add function for getting backtraces. + + * lib/resolution/*, vmware-user/*, lib/Makefile.am, configure.ac: + Move resolution-changing code into separate library. + + * guestd/main.c, lib/include/tools.h: Allow disabling tools + version reporting to the host, via config file. + + * lib/rpcIn/*, lib/include/rpcin.h, guestd/toolsDaemon.c, + toolbox/toolbox-gtk.c: Updated RPC API + + * lib/include/dndGuest.h: Helper API for DnD code + + * modules/freebsd/vmhgfs/*, modules/freebsd/vmmemctl/*, + modules/freebsd/vmblock/*, modules/linux/vmhgfs/*, + modules/linux/vmmemctl/*: Reflect changes from main source tree. + + * vmware-user/copyPaste.c: Copy/paste cleanup. + + * vmware-user/vmware-user.c: Updated locking code to use X11 + display instead of lockfiles. + +2008-06-03 Adar Dembo + * Resync with internal trunk (2008.05.28). + + * configure.ac, Makefile.am, */Makefile.am: Added rudimentary + `make install` support. Fixes Sourceforge bug 1839981. + + * configure.ac, Makefile.am, vmware-user-suid-wrapper/*: Added + vmware-user-suid-wrapper to help autostart vmware-user. Added some + informational tags to AC_DEFINE macros. + + * */debugStdio.c: Fixed a format string vulnerability + in Debug. Allocate fd on the stack in DebugToFile. + + * lib/auth/authPosix.c, lib/dnd/dndCommon.c, lib/dnd/dndLinux.c + lib/impersonate/impersonate.c: Add inclusion of vmware.h and refactor + some include statements. + + * lib/file/file.c, lib/include/file.h: Added File_UnlinkNoFollow + function. + + * lib/file/fileIO.c, lib/file/fileLockPrimitive.c, + lib/include/fileIO.h: Added error case for ENAMETOOLONG to FileIO_Lock. + Constified 'buf' in FileIO_Pwrite. + + * lib/file/fileIOPosix.c: Removed coalescing and decoalescing code. + Consolidated some Unicode calls. + + * lib/file/filePosix.c: Reworked some error handling logic. + + * lib/foundryMsg/foundryMsg.c: Refactored buffer encoding and decoding + logic into a single pair of functions. + + * lib/foundryMsg/foundryThreads.c, lib/include/foundryThreads.h + lib/include/util.h, lib/misc/util_misc.c: Changed generic thread type + from uintptr_t to Util_ThreadID. + + * lib/hgfsServer/*, lib/hgfs/hgfsProto.h, modules/linux/vmhgfs/*: + Additional HGFSv3 fixes and refactoring. + + * lib/include/dbllnklst.h, lib/misc/dbllnklst.c: Constified argument to + DblLnkLst_IsLinked. + + * lib/include/dnd.h: Added support for DnD of RTF. + + * lib/include/fileInt.h: Removed prototype of FileLockFileSize. + + * lib/include/hashTable.h, lib/misc/hashTable.c: Cosmetic changes. + Added HashTable_ReplaceIfEqual. + + * lib/include/loglevel_user.h: Added hpet loglevel. + + * lib/include/msg.h: Removed prototype of MsgSetPostStderrBlock. + + * lib/include/posix.h: Removed certain includeCheck allowances. + + * lib/include/productState.h: Added VDM client product. + + * lib/include/unicode*, lib/unicode/*: Ongoing i18n work. + + * lib/include/vixCommands.h: Added command to set snapshot information. + + * lib/include/vix.h: Added more errors and a new flag. + + * lib/include/vixOpenSource.h: Reworked asserts and added VIX_ASSERT. + + * lib/include/vm_app.h: Added Tools tray app. + + * lib/include/vm_product.h: Reworked VMRC product definitions and added + VDM client product definitions. + + * lib/include/vm_tools_version.h: Added WS65 Tools version. + + * lib/include/vm_version.h: Bumped Tools version. Added logic for VMRC + product. + + * lib/include/x86cpuid.h: Modified a flag and trimmed an unneeded macro. + + * lib/misc/codesetOld.c: Implement UTF-16 codest conversion to UTF-8 + for CURRENT_IS_UTF8. + + * lib/misc/dynbuf.c: Modified dynbuf growing behavior. + + * lib/misc/posixDlopen.c, lib/misc/posixInt.h, lib/misc/posixPosix.h: + Refactored codeset conversion code into PosixConvertToCurrent. + + * lib/misc/posixWin32.c: Added some path checks. + + * lib/misc/timeutil.c: Win32-wrappified TimeUtil_GetTimeFormat. + + * lib/misc/vmstdio.c: Reduce virtual memory usage and add '\r' as a line + ending in StdIO_ReadNextLine. + + * lib/rpcout/rpcout.c: Added comments. + + * lib/str/str.c: Cosmetic changes. + + * lib/vixTools/vixTools.c: Added unlink(2) logic to avoid deleting + symlink targets. Cosmetic changes. + + * modules/*/*/*: Reflect changes from elsewhere in the source tree. + + * modules/linux/vmhgfs/super.c: Fix vmhgfs to properly report the + available space on the host (Sourceforge bug 1924246). + + * vmware-user/vmware-user.c: Add advisory locking code to help maintain + only one vmware-user instance per X session. + + * xferlogs/xferlogs.c: Fix a formatted string vulnerability. + +2008-05-12 Elliot Lee + + * Resync with internal trunk (2008.05.08). + + * configure.ac, **/Makefile.am: Use CPPFLAGS instead of + CFLAGS to eliminate warning about proc/sysinfo.h. + + * guestd/foreignVMToolsNetworking.c, + vmware-user/foreignVMToolsNetworking.c + lib/hgfsServer/hgfsServerLinux.c, lib/include/hgfsServerInt.h, + modules/linux/vmhgfs/bdhandler.c, modules/linux/vmhgfs/dir.c, + modules/linux/vmhgfs/file.c, modules/linux/vmhgfs/filesystem.h, + modules/linux/vmhgfs/fsutil.h, modules/linux/vmhgfs/inode.c, + modules/linux/vmhgfs/link.c, modules/linux/vmhgfs/module.h, + modules/linux/vmhgfs/page.c, modules/linux/vmhgfs/request.c, + modules/linux/vmhgfs/request.h: Whitespace cleanups. + + * guestd/main.c: Removed "blessed app" code for starting + vmware-user. Hooray! + + * lib/deployPkg/deployPkg.c: Remove unneeded Utf8 conversion for + Windows. + + * lib/file/filePosix.c: Use new Posix_RealPath implementation. + + * lib/guestApp/guestApp.c, lib/include/guestApp.h: Remove/cleanup + UTF-8 related RPC functions. + + * lib/guestInfo/guestInfoPerfMonLinux.c, + lib/guestInfo/guestInfoPosix.c, lib/include/guestInfo.h, + lib/include/guestInfoInt.h, lib/include/guestStats.h: Rename + structures to GuestMemInfo, GuestNicInfo, and GuestDiskInfo. + + * lib/guestInfo/guestInfoServer.c, lib/include/guest_msg_def.h: As + above, and also GUESTMSG_MAX_IN_SIZE moved to guest_msg_def.h, and + misc locking updates. Also add GuestInfoServer_Main(), and cleanup + whitespace. + + * lib/hgfsServer/hgfsServer.c: Cleanup UTF-8 handling. + + * lib/include/codeset.h: Update defines that indicate whether the + current platform is using UTF-8. + + * lib/include/dnd.h: Add prototypes for a couple of string + conversion functions. + + * lib/include/file_extensions.h: Add OVF and Archived OVF file extensions. + + * lib/include/file.h: C++ guard thingies. Update a couple of + function prototypes to work on file descriptors instead of + filenames. + + * lib/include/hashTable.h, lib/include/guest_os.h, + lib/include/loglevel_defs.h, lib/include/stats_user_defs.h, + lib/include/stats_user_setup.h, lib/include/str.h, + lib/include/unicodeTypes.h, lib/include/util.h: Allow inclusion in + kernel modules... + + * lib/include/loglevel_user.h: As above, and add a couple of + loglevel variables. + + * lib/include/util.h, lib/misc/util_misc.c: Allow inclusion in + kernel modules as above, and add some utility functions on Windows + for manipulating canonical paths. + + * lib/include/hgfsProto.h, lib/include/hgfsUtil.h: Move + request/reply payload macros to hgfsProto.h. + + * lib/include/hgfsServerPolicy.h: Add ShareList management + prototypes and structure members. + + * lib/include/msg.h: Add function prototypes for creating and + posting lists of messages. + + * lib/include/system.h: Add types & functions related to desktop + switch monitoring on Windows. + + * lib/include/unicodeOperations.h: Add/update inline unicode operations. + + * lib/include/vixCommands.h: Add VIX requests and events. + + * lib/include/vmbackup_def.h, lib/vmBackupLib/stateMachine.c: Move + backup status enum to public header. + + * lib/include/vm_basic_asm_x86_64.h: Div643232 now also works on MSC. + + * lib/include/vm_basic_defs.h: Add debug output macros for Windows drivers. + + * lib/include/vm_basic_types.h: Update the FMTPD macro, add + SCANF_DECL macro for arg checking on scanf-like functions. + + * lib/include/x86cpuid.h: Defines for AMD L2/L3 cache separately, and CPUID for Nehalem. + + * lib/misc/codesetOld.c: Bug fixes and general unicode handling updates. + + * lib/system/systemLinux.c: Use Posix_Getenv/Posix_Setenv impls. + + * lib/vixTools/vixTools.c, lib/vmBackupLib/scriptOps.c: Bug fixes. + + * modules/freebsd/*, modules/linux/*: Updates to correspond to + updates of files in main tree. + + * modules/freebsd/vmhgfs/hgfs_kernel.h: Bug fixes. + + * modules/freebsd/vmxnet/vm_device_version: Add + SCSI_IDE_HOSTED_CHANNEL define, update SCSI_MAX_CHANNELS. + + * modules/freebsd/vmxnet/vmnet.def: Add capabilities for IPv6 + checksumming and TSO, and large packet TSO. + + * lib/include/vmblock.h, modules/linux/vmblock/linux/control.c, + modules/linux/vmblock/linux/vmblockInt.h: Use a macro to better + abstract the vmblock mount point & device. + + * vmware-user/vmware-user.c: Add SIGPIPE to the list of signals + that vmware-user handles. + +2008-05-02 Adar Dembo + + * Resync with internal trunk (2008.04.19). + + * configure.ac, guestd/Makefile.am, hgfsclient/Makefile.am, + lib/misc/*/Makefile.am, lib/string/*/Makefile.am, toolbox/Makefile.am, + vmware-user/Makefile.am, xferlogs/Makefile.am: Added libicu support for + codeset conversions. This includes some makefile logic as well as + autoconf arguments for controlling libicu behavior at compile-time. + + * */foreignVMToolsNetworking.c, lib/vixTools/vixTools.c: Unicode fixes. + + * */foundryToolsDaemon.c, lib/foundryMsg/vixTranslateErrOpenSource.c, + lib/panic/panic.c, lib/printer/printer.c: Added calls to Win32 Unicode + wrappers. + + * guestd/main.c: Cleaned up guestInfo server when guestd shuts down. + + * guestd/toolsDaemon.c, vmware-user/resolution.c: Disabled multi-mon + advertisement for Win2k. + + * lib/auth/authPosix.c, lib/dnd/dndLinux.c, lib/file/*, + lib/impersonate/impersonatePosix.c, lib/include/mntinfo.h, + lib/sync/syncWaitQPosix.c, lib/user/hostinfoPosix.c, lib/user/util.c, + lib/user/utilPosix.c, lib/wiper/wiperPosix.c: Added calls to POSIX + Unicode wrappers. + + * lib/file/*: Replaced calls to string functions with calls to + the "safe" family of string functions. + + * lib/dict/dictll.c, lib/include/dictll.h: Detect and tolerate UTF-8 + dictionary files that contain the UTF-8 BOM. + + * lib/err/*, lib/include/err.h, lib/include/msgfmt.h, + lib/include/msg.h: Added support for localization of error strings. + + * lib/foundryMsg/foundryThreads.c, lib/include/foundryThreads.h, + lib/misc/util_misc.c: Added opaque type for threads/process IDs. + + * lib/guestInfo/guestInfoServer.c: Removed separate thread context. + + * lib/hgfsServer/*, lib/include/hgfs*.h: Additional HGFSv3 cleanup. + + * lib/hgfsServer/hgfsServerLinux.c: Added calls to POSIX Unicode + wrappers. Fixed some alias detection code for MacOS. + + * lib/include/backdoor_def.h: Added backdoor call for debugging events. + + * lib/include/bsdfmt.h, lib/string/bsd_vsnprintf.c, + lib/string/bsd_vsnprintfw.c: Replaced BSDFmt_WCSonv with + BSDFmt_WChartoUTF8. + + * lib/include/codeset.h, lib/include/codesetOld.h, lib/misc/codeset.c, + lib/misc/codesetOld.c, lib/string/convertutf.h: Implemented + libicu-backed codeset layer. When building without libicu, fallback on + codesetOld. + + * lib/include/guestApp.h: Added wide versions of dictionary functions. + + * lib/include/loglevel_user.h: Added two new loglevels. + + * lib/include/posix.h, lib/misc/posixPosix.c: Added new POSIX wrappers. + + * lib/include/str.h: Clarified the use of some functions. + + * lib/include/syncMutex.h, lib/include/syncWaitQ.h: Removed unneeded + macros. + + * lib/include/unicode*.h, lib/unicode/*: Ongoing Unicode work. + + * lib/include/util.h: Added Util_FreeStringList, removed Util_FreeList. + + * lib/include/uuid.h: Added new UUID creation scheme. + + * lib/include/vix*.h: Tweaked some VIX commands, errors, and properties. + + * lib/include/vmBackup.h, lib/vmBackupLib/scriptOps.c, + lib/vmBackupLib/stateMachine.c: Moved disabled targets logic from + library to Windows VSS provider. + + * lib/include/vm_basic_asm_x86*.h: Allow emitted FX functions to + modify main memory as a side effect. + + * lib/include/vm_tools_version.h: Bump Tools version. + + * lib/include/vm_version.h: Added several product versions. + + * modules/linux/vmhgfs/*: Additional cleanup for HGFSv3. Use new kthread + wrapper when possible. Bump module version. + + * modules/linux/vmmemctl/*: Use new kthread wrapper when possible. + Remove dead delayed work code. Bump module version. + + * modules/linux/*/compat_kthread.c: Added kthread wrapper implementation + for modules that use kernel threads. + + * modules/*/*/*: Reflect header file changes from elsewhere in the + source code tree. + + * vmware-user/copyPaste.c, vmware-user/pointer.c, + vmware-user/vmwareuserInt.h: Stop wastefully polling for pointer + updates if the VMX is new enough. + + * xferlogs/xferlogs.c: Fixed a warning in the call to fwrite. + (Thanks to Denis Leroy for reporting this bug.) + + +2008-04-14 Elliot Lee + + * Resync with internal trunk (2008.04.01). + + * Fixed legal header on all LGPL-licensed files. + + * vmware-user/resolution.c: Normalize the display topology that + comes in from the host, and report 'global_offset' capability. + + * toolbox/Makefile.am, vmware-user/Makefile.am, + lib/misc/Makefile.am, lib/misc/atomic.c, lib/Makefile.am, + lib/atomic/*, hgfsclient/Makefile.am: Move libAtomic stuff into libmisc + + * vmware-user/foundryToolsDaemon.c, lib/vixTools/vixTools.c, + lib/include/hgfsServerInt.h, guestd/toolsDaemon.c, + guestd/foundryToolsDaemon.c: Remove WIN9XCOMPAT, and some + SOCKET_MGR code. + + * vmware-user/copyPaste.c: Copy/paste fixes for cross-platform + operation. + + * modules/linux/vmxnet/vmnet_def.h: Add SG_SPAN_PAGES capability. + + * modules/linux/vmxnet/vm_device_version.h: Update some device limits. + + * modules/linux/*/compat_sched.h: Add TASK_COMM_LEN define. + + * modules/linux/*/compat_kernel.h, + modules/linux/*/kernelStubsLinux.c: Add vsnprintf define. + + * modules/linux/*/x86cpuid.h: Add new CPUs. + + * modules/linux/vmhgfs/vmhgfs_version.h: Bump HGFS version. + + * modules/linux/*/vm_basic_asm_x86.h, + modules/linux/*/vm_basic_asm_x86_64.h, + lib/include/vm_basic_asm_x86.h, lib/include/vm_basic_asm_x86_64.h: + Formatting fixes, and change asm directives used. + + * modules/linux/vmhgfs/module.h, + modules/linux/vmhgfs/filesystem.c, + modules/linux/vmhgfs/bdhandler.c, + modules/linux/*/compat_kthread.h: compat_kthread fixes. + + * modules/freebsd/vmxnet/net_compat.h, + modules/freebsd/vmxnet/if_vxn.c: Updates for FreeBSD 7.0. + (Thanks to Martin Blapp for contributing to these changes.) + + * lib/misc/util_misc.c, lib/include/loglevel_user.h, + lib/user/hostinfoPosix.c, lib/misc/hostname.c: Bugfix. + + * lib/unityStub/unityStub.c, lib/include/unity.h: Add stub and enums + related to DnD support. + + * lib/unicode/unicodeSimpleTypes.c, + lib/unicode/unicodeSimpleTransforms.c, + lib/unicode/unicodeSimpleBase.c, lib/unicode/unicodeCommon.c, + lib/include/unicodeTypes.h, + lib/include/unicodeTransforms.h, + lib/include/unicodeBase.h, lib/include/unicodeCommon.h: Add + additional Unicode-related functions. + + * lib/sync/syncMutex.c, lib/include/syncMutex.h: Add TryLock method. + + * lib/strUtil/strutil.c: Add int64-related functions. + + * lib/string/str.c: Compile fix + + * lib/string/bsd_output_shared.c: Better handling of floating + point on Windows. + + * lib/include/progMgr.h, lib/procMgr/procMgrPosix.c: Clarify that + the strings are in UTF-8, do conversion as needed. + + * lib/include/posix.h, lib/misc/posixPosix.c, + lib/misc/posixWin32.c, lib/file/filePosix.c: Add new Posix_ + function implementations, and unicodify existing ones. + + * lib/misc/hashTable.c, lib/include/hashTable.h: Add lock-less hash + table functions. + + * lib/misc/util_misc.c, lib/include/w32util.h: Add a couple of + Win32 utility functions. + + * lib/include/vm_version.h: Add WS5 config version. + + * lib/include/vm_atomic.h: Add typecasts to atomic operations to + make compilers stop complaining, and expand the AtomicUseFence option. + + * lib/include/vm_app.h: Add a couple of HGFS-related options. + + * lib/include/vix.h: Update a few errors and other macros. + + * lib/include/vixCommands.h, lib/foundry/foundryMsg.c: Change a + bunch of structure members from int32 to uint32, and add a parsing + function. + + * lib/include/msgfmt.h, lib/include/msg.h: Additional + message-handling prototypes. + + * lib/include/guestInfoInt.h, lib/include/guestInfo.h, + lib/guestInfo/Makefile.am, lib/guestInfo/guestInfoServer.c, + lib/guestInfo/guestInfoPosix.c, + lib/guestInfo/guestInfoPerfMonLinux.c: Add IPv6 support, and the + ability to read mem stats on Linux. + + * lib/include/fileIO.h, lib/file/fileIOPosix.c: Add MacOS function + related to Time Machine. + + * lib/guestApp/guestApp.c: Use Posix_ variants of functions. + + * lib/ghIntegrationStub/ghIntegrationStub.c: Add GHI capabilities + stubs. + + * lib/dnd/dndCommon.c, lib/file/file.c: Use new Unicode_Format() + function, bugfix. + + * guestd/main.c: Fix a security bug. + + * configure.ac: Allow calling libdnet 'dumbnet' for Debian + systems. Detect libprocps. + +2008-03-19 Adar Dembo + + * Resync with internal trunk (2008.03.13). + + * vm_version.h: Updated Tools version. + + * configure.ac: Added dynamic dnet detection and --without-dnet flag. + + * guestd/debugStdio.c, lib/include/system.h, lib/system/systemLinux.c: + Modified debugging to file behavior to prepend debug strings with human + readable timestamps. + + * guestd/main.c, guestd/toolsDaemon.c, lib/conf/conf.c, + lib/guestApp/guestApp.c, lib/include/guestApp.h: Internationalized + GuestApp_GetInstallPath and GuestApp_GetconfPath. + + * lib/auth/authPosix.c, lib/dnd/dndLinux.c, lib/file/*, + lib/impersonate/impersonatePosix.c, lib/include/fileInt.h, + lib/include/posix.h, lib/misc/posix*.c: Refactored, extended, and made + use of the set of POSIX internationalization-safe function wrappers. + + * lib/dnd/dndCommon.c, lib/include/dnd.h, lib/include/dndInt.h, + vmware-user/copyPaste.c, vmware-user/dnd.c: Replaced some duplicated + UTF-8 formatting code with calls to lib/unicode. + + * lib/guestInfo/guestInfoPosix.c: Replaced the old syscall-based + implementation of nicinfo with a simpler implementation that uses dnet. + + * lib/guestInfo/guestInfoServer.c, lib/include/guestInfo.h, + lib/include/guestInfoInt.h: Added Win32 implementation of + meminfo. POSIX implementation to follow. + + * lib/hgfsServer/hgfsServerLinux.c: Replaced a direct readlink(3) call + with a call to the POSIX wrapper for readlink(3). Relax an overeager + ASSERT in symlink checking when using the special empty share. + + * lib/include/codeset.h, lib/string/bsd_vsnprintf.c, lib/string/str.c, + lib/unicode/unicodeSimpleOperations.c, lib/unicode/unicodeSimpleUTF16.h: + Refactored ICU routines from unicodeSimpleUtf16.h to codeset.h, which + is now licensed under the ICU license (BSD variant). + + * lib/include/file.h, lib/file/file.c: Added function File_StripSlashes. + + * lib/include/hgfsProto.h: Removed an A acute from a comment to allow + the file to be built on Windows systems where the default language isn't + English. + + * lib/include/hostinfo.h, lib/include/util.h, lib/user/hostinfoPosix.c, + lib/user/util.c, lib/user/utilPosix.c: More conversions to + lib/unicode. Added Util_ZeroFreeStringW function for Windows in util.h. + + * lib/include/msg.h: Removed obsolete NO_MSGFMT macro. + + * lib/include/unicodeBase.h, lib/unicode/unicodeCommon.c, + lib/unicode/unicodeSimpleBase.c: Added some more encoding functions. + + * lib/include/vixCommands.h, lib/include/vixOpenSource.h: Added another + user credential type, some command flags, some command layouts, some + error codes, some properties, and tweaked existing commands. + + * lib/include/vixTools.h: Added VixToolsUserIsMemberOfAdministratorGroup + function. + + * lib/include/vm_assert.h, lib/include/vm_basic_defs.h: Move IMPLIES to + vm_basic_defs.h. Removed some vprobes definitions. + + * lib/include/vmBackup.h, lib/vmBackupLib/scriptOps.c, + lib/vmBackupLib/stateMachine.c: Added infrastructure to disable + quiescing targets from a config file. + + * lib/include/vm_basic_asm.h: Changed __GET_CPUID2 handling for Windows. + + * lib/include/vm_produt.h: Added VDM product. + + * lib/include/vm_tools_version.h: Bumped internal Tools version. + + * lib/include/win32util.h, lib/misc/hostname.c, lib/misc/util_misc: + Refactored functions to separate set of Win32 wrappers (next to the + POSIX wrappers mentioned earlier). + + * lib/misc/codeset.c: Made CodeSetGetCurrentCodeSet non-static. + + * lib/misc/*/Makefile.am: Added POSIX wrappers to build system. + + * lib/strUtil/strutil.c: Fixed bug in StrUtil_EndsWith function. + + * lib/include/unicodeTypes.h, lib/unicode/unicodeSimpleTypes.c: Removed + ISO-8859-11 encoding. Added cross-reference of IANA character set + names, windows code pages, and ICU encodings. + + * lib/vixTools/vixTools.c: Impersonation tweaks. + + * modules/*/*/*: Reflect header file changes from elsewhere in the + source code tree. + +2008-03-11 Adar Dembo + + * vm_version.h: Updated Tools version. + + * modules/vmblock/linux/*: Make vmblock build under 2.6.25-rc2. + The dentry and mount objects have been moved out of struct + nameidata and into the new struct path. Also, path_release() is + now path_put(). + + * modules/vmsync/linux/*: Make vmsync build under 2.6.25-rc2. + The same changes were needed here as in vmblock above. + +2008-03-10 Adar Dembo + + * vm_version.h: Updated Tools version. + + * modules/vmhgfs/linux/*: Make vmhgfs build under 2.6.25-rc1. + The iget() function has been removed and filesystems are now + expected to implement it themselves using iget_locked(). + +2008-02-27 Elliot Lee + + * configure.ac, guestd/Makefile.am, toolbox/Makefile.am, + vmware-user/Makefile.am: Allow passing custom LDFLAGS in to + build process (patch by Mike Auty). + + * Resync with internal trunk (2008.02.27). + + * guestd/foundryToolsDaemon.c, lib/vixTools/vixTools.c, + vmware-user/foundryToolsDaemon.c: Win9x compat changes. + + * guestd/toolsDaemon.c: Style fixes. + + * hgfsmounter/hgfsmounter.c: Bug fixes. + + * lib/dnd/dndLinux.c, lib/dnd/dndCommon.c: Move some code to the + platform-independant file, some DnDv3 support. + + * lib/include/dnd.h, lib/include/dndInt.h: DnDv3 support. + + * lib/file/file.c, lib/file/fileIO.c, lib/file/fileIOPosix.c, + lib/file/fileLockPrimitive.c, lib/file/filePosix.c, + lib/include/file_extensions.h, lib/include/fileInt.h, + lib/include/fileIO.h: Move functions around, Unicode fixes, misc + fixes. + + * lib/foundryMsg/foundryPropertyListCommon.c: Error handling fixes. + + * lib/hgfsServer/*.c, lib/include/hgfs*.h, + modules/freebsd/vmhgfs/*, modules/linux/vmhgfs/*: HGFS v3 support, + updates to improve code re-use between the FreeBSD and MacOS X + ports, and updates to make the Linux port build on 2.6.25-rc1 (but + not rc2, yet). + + * lib/include/auth.h, lib/include/codeset.h, + lib/include/hostinfo.h, lib/include/str.h, lib/include/unicode*.h, + lib/include/vm_basic_types.h, lib/misc/hostname.c, + lib/unicode/*.c, lib/user/hostinfoPosix.c: Unicode fixes. + + * lib/include/backdoor_def.h: Add a new command for use by the + BIOS in checking the GuestOS against Darwin. + + * lib/include/dynarray.h, lib/misc/dynarray.c, + lib/misc/Makefile.am, lib/misc/shared/Makefile.am: Add Dynarray + implementation. + + * lib/include/bsdfmt.h, lib/include/bsd_output_int.h, + lib/string/bsd_output_shared.c, lib/string/bs_vsnprintf.c, + lib/string/bsd_vsnwprintf.c, lib/string/str.c: Rework built-in + printf implementation, esp. for Unicode fixes. + + * lib/include/ghIntegration.h: Shuffle types around. + + * lib/include/loglevel_user.h, lib/include/unity.h, + lib/syncDriver/syncDriverPosix.c, lib/user/util.c, + toolbox/toolbox-gtk.c: Misc fixes. + + * lib/include/vmBackup.h, lib/vmBackupLib/scriptOps.c, + lib/vmBackupLib/stateMachine.c, lib/vmBackupLib/vmBackupInt.h: + Rework scripts for freeze & thaw operations. + + * lib/include/vm_product.h, lib/include/vm_version.h: Add new + product defs (VMRC). + + * lib/include/vm_tools_version.h: Add ESX 3.5U1 product. + + * lib/include/vixCommands.h, lib/include/vix.h: Add new VIX + commands and error code. + + * lib/include/win32util.h: Add misc Win32 utilities. + + * modules/*/*/*: Reflect header file changes from elsewhere in the + source code tree. + +2008-02-13 Adar Dembo + + * Resync with internal trunk (2008.02.12). + + * configure.ac, lib/unityStub/*, lib/ghIntegrationStub/*, + lib/Makefile.am, vmware-user/Makefile.am, vmware-user/vmware-user.c: + Added lib/unityStub and lib/ghIntegrationStub. Unity and guest-host + integration features for X11 guests are on the way. + + * configure.ac, guestd/Makefile.am, lib/fileUtf8/*, + lib/vixTools/vixTools.c, vmare-user/Makefile.am: lib/file is now fully + internationalized. Removed unneeded lib/fileUtf8. + + * foundryToolsDaemon.c: Fixed a leak of the sync driver handle. + + * guestd/toolsDaemon.c: Send guestd's "config directory" to the VMX for + publishing. + + * hgfsmounter/hgfsmounter.c: Port to MacOS. + + * lib/dnd/*, lib/err/err.c, lib/file/*, lib/include/dnd*, + lib/include/file*, lib/include/unicode*, lib/include/util.h, + lib/unicode/*, lib/user/utilPosix.c: More Unicodification. + + * lib/file/file.c, lib/include/file.h: Added File_EnsureDirectory. + + * lib/foundryMsg/foundryMsg.c, lib/guestInfo/guestInfoServer.c, + lib/misc/codeset.c, lib/misc/vmstdio.c, + lib/SLPv2Parser/SLPv2MsgAssembler.c, lib/user/util.c: Removed some + unneeded casts. + + * lib/foundryMsg/foundryThreads.c, lib/include/foundryThreads.h: Added + FoundryThreads_Free. + + * lib/guestInfo/*, lib/include/guest_os.h, lib/include/guestInfo.h: + Refactored GetSystemBitness. Removed osNames.h. + + * lib/hgfsServer/hgfsServerLinux.c: Modified MacOS alias resolution code + so as not to mount volumes. Made HGFS query volume code more resilient + to failures. + + * lib/include/backdoor_def.h: Added commands for VAssert. + + * lib/include/escape.h, lib/misc/escape.c: Escape_Do is no longer + declared inline. + + * lib/include/hashTable.h, lib/misc/hashTable.c, lib/misc/Makefile.am, + lib/misc/shared/Makefile.am: Renamed from hash.[ch]. + + * lib/include/iovector.h, lib/include/vm_basic_types.h: Added + SectorType definition. + + * lib/include/loglevel_user.h: Added additional log levels. + + * lib/include/msgfmt.h: Modified for use in VMKERNEL. Added + MsgFmt_GetArgswithBuf. + + * lib/include/msg.h: Added Msg_AppendVob for ESX. + + * lib/include/stats_user*: Modified some preprocessing steps. Added + SETUP_WANT_GETVAL to retrieve named stat counter values. + + * lib/include/str.h: Modified behavior Str_* family of functions for + Windows. + + * lib/include/strutil.h, lib/strUtil/strutil.c: Removed Split, Grep, + GrepFd, and GrepFree. Added EndsWith and DecimalStrToUint. + + * lib/include/syncWaitQ.h, lib/sync/*: Modified SyncWaitQ_Add and + SyncWaitQ_Remove to use PollDevHandle fd types instead of int fd types. + + * lib/include/timeutil.h, lib/misc/timeutil.c: Added + TimeUtil_GetLocalWindowsTimeZoneIndex and some helper functions. + + * lib/include/util.h, lib/user/utilPosix.c: Added Util_BumpNoFds. + + * lib/include/vixCommands.h: Added commands for device hotplug and + remote debugging. + + * lib/include/vix.h, lib/include/vixOpenSource.h: Added some new errors + and properties. Added more VM manipulation functions. + + * lib/include/vm_atomic.h: Comment cleanup and added VMKERNEL-specific + calls for fencing. + + * lib/include/vm_basic_asm_x86_64.h: Added inline routines to save and + restore ES1. + + * lib/include/vm_basic_types.h: Added some types and cleaned up a bit. + + * lib/include/vm_legal.h: Updated COPYRIGHT_YEARS. + + * lib/include/vm_product.h: Added hostd service name. + + * lib/include/x86cpuid.h: Cleaned up the file and added some definitions + for Penryn processors. + + * lib/misc/codeset.c: Added new UTF-16 --> UTF-8 conversion routine. + + * lib/misc/util_misc.c, lib/user/util.c: Moved Util_GetCurrentThreadId + and friends to util_misc.c. + + * lib/procMgr/procMgrPosix.c: Cleaned up some code and reworked + asynchronous process execution so as to properly track the grandchild's + pid instead of the child's pid. + + * lib/string/bsd*: Reorganized BSD formatter. + + * lib/string/str.c: Updated unit tests. Added some Windows corner case + behavior for Str_Vsnwprintf. + + * lib/strUtil/strutil.c: Fixed some corner cases in existing functions + that call strtoul. + + * lib/vixTools/vixTools.c: Changed signature of VixToolsImpersonateUser. + Changed error code handling in a few places. + + * modules/freebsd/vmhgfs/*: Refactored a lot of code so that it can be + safely reused within the MacOS vmhgfs module. + + * modules/*/*/kernelStubs*: Removed dead System_Uptime function. + + * modules/linux/*/compat_wait.h: Reworked VMW_HAVE_EPOLL macro. Added + waitqueue helper macros for older kernels. + + * modules/linux/vmhgfs/file.c, modules/linux/vmhgfs/fsutil.*, + modules/linux/vmhgfs/inode.c: Added HgfsSetUidGid function and used it + to preserve uid/gid after creating a directory. + + * modules/linux/vmhgfs/vmhgfs_version.h: Bumped driver version. + + * modules/linux/vmsync/compat_workqueue.h: Basic implementation of + work queues and delayed work queues (using taskqueues and timers) for + older kernels. + + * modules/linux/vmsync/sync.c: Modified internal state to use new + compatible work queue implementation. + + * modules/linux/vmxnet/compat_ioport.h, + modules/linux/vmxnet/compat_netdevice.h, + modules/linux/vmxnet/compat_pci.h, + modules/linux/vmxnet/compat_skbuff.h, + modules/linux/vmxnet/vmxnetInt.h: Added and refactored + compatibility macros for use in vmxnet3 and vmci sockets modules. + + * modules/linux/vmxnet/vmxnet.c: Hide some kernel functions behind + compatibility macros. + 2008-01-23 Adar Dembo * Resync with internal trunk (2008.01.08). @@ -5,7 +1366,7 @@ * configure.ac, guestd/Makefile.am, hgfsclient/Makefile.am, lib/Makefile.am, toolbox/Makefile.am, vmware-user/Makefile.am: integrated lib/unicode for internationalizing strings. - + * guestd/main.c: Stopped using pgrep for finding existing instances of guestd. Removed ancient bandwidth test code. @@ -13,7 +1374,7 @@ when guestd sends its version to when guestd registers its capabilities. - * lib/file/*, lib/public/file*.h : Massive overhaul of lib/file to + * lib/file/*, lib/include/file*.h : Massive overhaul of lib/file to integrate the new unicode strings that are i18n-safe. Quite a bit of cleanup and refactoring as well. @@ -63,7 +1424,7 @@ * lib/include/hash.h, lib/misc/hash.c, lib/misc/Makefile.am, lib/misc/shared/Makefile.am: Added basic hash table implementation. - + * lib/include/hostinfo.h, lib/user/hostinfoPosix.c: Refactored and added several timekeeping functions. @@ -164,7 +1525,7 @@ * modules/linux/vmblock/linux/filesystem.c, modules/linux/vmblock/Makefile.kernel: Added check for newer kernels where the slab allocator's constructor function expects three - arguments. + arguments. Makes it work with 2.6.25-rc1 (but not rc2, yet). * modules/linux/vmblock/linux/vmblock_version.h: Bumped module version. @@ -180,7 +1541,7 @@ 2007-11-15 Elliot Lee * Bandsaw release (2007.11.15). - + * configure.ac: Handle building modules for multiple OS's. Improve X detection to allow building --without-x. Improve Gtk+ detection. Detect libdnet on Solaris. Detect which -Wwarning flags diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/checkvm/checkvm.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/checkvm/checkvm.c --- open-vm-tools-2008.01.23-74039/checkvm/checkvm.c 2008-01-28 08:02:54.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/checkvm/checkvm.c 2008-10-13 08:01:55.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -43,6 +43,8 @@ #include "embed_version.h" VM_EMBED_VERSION(CHECKVM_VERSION_STRING); + + #ifdef __GNUC__ /* diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/checkvm/checkvm_version.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/checkvm/checkvm_version.h --- open-vm-tools-2008.01.23-74039/checkvm/checkvm_version.h 2008-01-28 08:02:54.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/checkvm/checkvm_version.h 2008-10-13 08:01:55.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/checkvm/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/checkvm/Makefile.am --- open-vm-tools-2008.01.23-74039/checkvm/Makefile.am 2008-01-28 08:02:54.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/checkvm/Makefile.am 2008-10-13 08:01:55.000000000 +0100 @@ -15,10 +15,7 @@ ### Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ -noinst_PROGRAMS = checkvm +bin_PROGRAMS = vmware-checkvm -AM_CFLAGS = -AM_CFLAGS += @COMMON_CFLAGS@ - -checkvm_SOURCES = -checkvm_SOURCES += checkvm.c +vmware_checkvm_SOURCES = +vmware_checkvm_SOURCES += checkvm.c diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/checkvm/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/checkvm/Makefile.in --- open-vm-tools-2008.01.23-74039/checkvm/Makefile.in 2008-01-28 08:03:02.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/checkvm/Makefile.in 2008-10-13 08:02:12.000000000 +0100 @@ -49,21 +49,26 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -noinst_PROGRAMS = checkvm$(EXEEXT) +bin_PROGRAMS = vmware-checkvm$(EXEEXT) subdir = checkvm DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in COPYING ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +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)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = -PROGRAMS = $(noinst_PROGRAMS) -am_checkvm_OBJECTS = checkvm.$(OBJEXT) -checkvm_OBJECTS = $(am_checkvm_OBJECTS) -checkvm_LDADD = $(LDADD) +am__installdirs = "$(DESTDIR)$(bindir)" +binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +PROGRAMS = $(bin_PROGRAMS) +am_vmware_checkvm_OBJECTS = checkvm.$(OBJEXT) +vmware_checkvm_OBJECTS = $(am_vmware_checkvm_OBJECTS) +vmware_checkvm_LDADD = $(LDADD) DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp +depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -74,8 +79,8 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ -SOURCES = $(checkvm_SOURCES) -DIST_SOURCES = $(checkvm_SOURCES) +SOURCES = $(vmware_checkvm_SOURCES) +DIST_SOURCES = $(vmware_checkvm_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -89,8 +94,6 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -COMMON_CFLAGS = @COMMON_CFLAGS@ -COMMON_PROG_CFLAGS = @COMMON_PROG_CFLAGS@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -101,45 +104,57 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ -ECHO = @ECHO@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GREP = @GREP@ -GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_AUTH_CFLAGS = @LIB_AUTH_CFLAGS@ -LIB_FILE_CFLAGS = @LIB_FILE_CFLAGS@ -LIB_HGFS_SERVER_CFLAGS = @LIB_HGFS_SERVER_CFLAGS@ -LIB_IMPERSONATE_CFLAGS = @LIB_IMPERSONATE_CFLAGS@ -LIB_MISC_CFLAGS = @LIB_MISC_CFLAGS@ -LIB_PROC_MGR_CFLAGS = @LIB_PROC_MGR_CFLAGS@ -LIB_STRING_CFLAGS = @LIB_STRING_CFLAGS@ -LIB_USER_CFLAGS = @LIB_USER_CFLAGS@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -147,27 +162,35 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ VERSION = @VERSION@ -VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -198,6 +221,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -212,8 +236,7 @@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -AM_CFLAGS = @COMMON_CFLAGS@ -checkvm_SOURCES = checkvm.c +vmware_checkvm_SOURCES = checkvm.c all: all-am .SUFFIXES: @@ -247,16 +270,37 @@ 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-noinstPROGRAMS: - @list='$(noinst_PROGRAMS)'; for p in $$list; do \ +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 -checkvm$(EXEEXT): $(checkvm_OBJECTS) $(checkvm_DEPENDENCIES) - @rm -f checkvm$(EXEEXT) - $(LINK) $(checkvm_OBJECTS) $(checkvm_LDADD) $(LIBS) +vmware-checkvm$(EXEEXT): $(vmware_checkvm_OBJECTS) $(vmware_checkvm_DEPENDENCIES) + @rm -f vmware-checkvm$(EXEEXT) + $(LINK) $(vmware_checkvm_OBJECTS) $(vmware_checkvm_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -371,6 +415,9 @@ 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 @@ -397,8 +444,7 @@ @echo "it deletes files that may require special tools to rebuild." clean: clean-am -clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ - mostlyclean-am +clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) @@ -420,7 +466,7 @@ install-dvi: install-dvi-am -install-exec-am: +install-exec-am: install-binPROGRAMS install-html: install-html-am @@ -452,22 +498,23 @@ ps-am: -uninstall-am: +uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-strip -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstPROGRAMS 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 \ +.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 + 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. diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/config/compile /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/config/compile --- open-vm-tools-2008.01.23-74039/config/compile 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/config/compile 2008-10-13 08:02:11.000000000 +0100 @@ -0,0 +1,142 @@ +#! /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: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/config/config.guess /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/config/config.guess --- open-vm-tools-2008.01.23-74039/config/config.guess 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/config/config.guess 2008-10-13 08:02:11.000000000 +0100 @@ -0,0 +1,1500 @@ +#! /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: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/config/config.sub /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/config/config.sub --- open-vm-tools-2008.01.23-74039/config/config.sub 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/config/config.sub 2008-10-13 08:02:11.000000000 +0100 @@ -0,0 +1,1616 @@ +#! /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: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/config/depcomp /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/config/depcomp --- open-vm-tools-2008.01.23-74039/config/depcomp 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/config/depcomp 2008-10-13 08:02:12.000000000 +0100 @@ -0,0 +1,584 @@ +#! /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: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/config/install-sh /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/config/install-sh --- open-vm-tools-2008.01.23-74039/config/install-sh 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/config/install-sh 2008-10-13 08:02:11.000000000 +0100 @@ -0,0 +1,507 @@ +#!/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: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/config/ltmain.sh /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/config/ltmain.sh --- open-vm-tools-2008.01.23-74039/config/ltmain.sh 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/config/ltmain.sh 2008-10-13 08:02:04.000000000 +0100 @@ -0,0 +1,7750 @@ +# Generated from ltmain.m4sh. + +# ltmain.sh (GNU libtool) 2.2 +# Written by Gordon Matzigkeit , 1996 + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 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 +# --tag=TAG use configuration variables from tag TAG +# -v, --verbose print informational messages (default) +# --version print version information +# -h, --help print short or long 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. +# 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.2 +# automake: $automake_version +# autoconf: $autoconf_version +# +# Report bugs to . + +PROGRAM=ltmain.sh +PACKAGE=libtool +VERSION=2.2 +TIMESTAMP="" +package_revision=1.2599 + +# 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 + +# NLS nuisances: We save the old values to restore during execute mode. +# Only set LANG and LC_ALL to C if already set. +# These must not be set unconditionally because not all systems understand +# e.g. LANG=C (notably SCO). +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 + fi" +done + +$lt_unset CDPATH + + + + + +: ${CP="cp -f"} +: ${ECHO="echo"} +: ${EGREP="/bin/grep -E"} +: ${FGREP="/bin/grep -F"} +: ${GREP="/bin/grep"} +: ${LN_S="ln -s"} +: ${MAKE="make"} +: ${MKDIR="mkdir"} +: ${MV="mv -f"} +: ${RM="rm -f"} +: ${SED="/bin/sed"} +: ${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,^.*/,," + +# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh +# is ksh but when the shell is invoked as "sh" and the current value of +# the _XPG environment variable is not equal to 1 (one), the special +# positional parameter $0, within a function call, is the name of the +# function. +progpath="$0" + +# The name of this program: +# In the unlikely event $progname began with a '-', it would play havoc with +# func_echo (imagine progname=-n), so we prepend ./ in that case: +progname=`$ECHO "X$progpath" | $Xsed -e "$basename" -e 's,^-,./-,'` + +# Make sure we have an absolute path for reexecution: +case $progpath in + [\\/]*|[A-Za-z]:\\*) ;; + *[\\/]*) + progdir=`$ECHO "X$progpath" | $Xsed -e "$dirname"` + progdir=`cd "$progdir" && pwd` + progpath="$progdir/$progname" + ;; + *) + save_IFS="$IFS" + IFS=: + 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' + +# 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 + +# func_echo arg... +# Echo program name prefixed message, along with the current mode +# name if it has been set yet. +func_echo () +{ + $ECHO "$progname${mode+: }$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_error arg... +# Echo program name prefixed message to standard error. +func_error () +{ + $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2 +} + +# func_warning arg... +# Echo program name prefixed warning message to standard error. +func_warning () +{ + $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2 +} + +# 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 "X$my_directory_path" | $Xsed -e "$dirname"` + done + my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e '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 "X$my_tmpdir" | $Xsed +} + + +# 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 "X$1" | $Xsed -e "$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 "X$1" | $Xsed \ + -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_version +# Echo version message to standard output and exit. +func_version () +{ + $SED -n '/^# '$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 () +{ + $SED -n '/^# Usage:/,/# -h/ { + s/^# // + s/^# *$// + s/\$progname/'$progname'/ + p + }' < "$progpath" + $ECHO + $ECHO "run \`$progname --help | more' for full usage" + exit $? +} + +# func_help +# Echo long help message to standard output and exit. +func_help () +{ + $SED -n '/^# Usage:/,/# Report bugs to/ { + 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 --version) 2>/dev/null |$SED 1q`"'/ + s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/ + p + }' < "$progpath" + exit $? +} + +# func_missing_arg argname +# Echo program name prefixed message to standard error and set global +# exit_cmd. +func_missing_arg () +{ + func_error "missing argument for $1" + exit_cmd=exit +} + +exit_cmd=: + + + + + +# Check that we have a working $ECHO. +if test "X$1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X$1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then + # Yippee, $ECHO works! + : +else + # Restart under the correct shell, and then maybe $ECHO will work. + exec $SHELL "$progpath" --no-reexec ${1+"$@"} +fi + +if test "X$1" = X--fallback-echo; then + # used as fallback echo + shift + cat </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_mode_help () +{ + # We need to display help for each of the modes. + case $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 building PIC objects only + -prefer-non-pic try to building 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 + +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 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 + -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 + +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 \`$mode'" + ;; + esac + + $ECHO + $ECHO "Try \`$progname --help' for more information about other modes." + + exit $? +} + +# Generated shell functions inserted here. + + +# Parse options once, thoroughly. This comes as soon as possible in +# the script to make things like `libtool --version' happen quickly. +{ + + # 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 + + # Parse non-mode specific arguments: + while test "$#" -gt 0; do + opt="$1" + shift + + case $opt in + --config) func_config ;; + + --debug) preserve_args="$preserve_args $opt" + func_echo "enabling shell trace mode" + opt_debug='set -x' + $opt_debug + ;; + + -dlopen) test "$#" -eq 0 && func_missing_arg "$opt" && break + execute_dlfiles="$execute_dlfiles $1" + shift + ;; + + --dry-run | -n) opt_dry_run=: ;; + --features) func_features ;; + --finish) mode="finish" ;; + + --mode) test "$#" -eq 0 && func_missing_arg "$opt" && break + case $1 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 + + mode="$1" + shift + ;; + + --preserve-dup-deps) + opt_duplicate_deps=: ;; + + --quiet|--silent) preserve_args="$preserve_args $opt" + opt_silent=: + ;; + + --verbose| -v) preserve_args="$preserve_args $opt" + opt_silent=false + ;; + + --tag) test "$#" -eq 0 && func_missing_arg "$opt" && break + preserve_args="$preserve_args $opt $1" + func_enable_tag "$1" # tagname is set here + shift + ;; + + # Separate optargs to long options: + -dlopen=*|--mode=*|--tag=*) + func_opt_split "$opt" + set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"} + shift + ;; + + -\?|-h) func_usage ;; + --help) opt_help=: ;; + --version) func_version ;; + + -*) func_fatal_help "unrecognized option \`$opt'" ;; + + *) nonopt="$opt" + break + ;; + esac + done + + # Now that we've collected a possible --mode arg, show help if necessary + $opt_help && func_mode_help + + case $host in + *cygwin* | *mingw* | *pw32*) + # don't eliminate duplications in $postdeps and $predeps + opt_duplicate_compiler_generated_deps=: + ;; + *) + opt_duplicate_compiler_generated_deps=$opt_duplicate_deps + ;; + esac + + # Having warned about all mis-specified options, bail out if + # anything was wrong. + $exit_cmd $EXIT_FAILURE +} + +# 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 +} + + +## ----------- ## +## Main. ## +## ----------- ## + +{ + # 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 + + test -z "$mode" && func_fatal_error "error: you must specify a MODE." + + + # Darwin sucks + eval std_shrext=\"$shrext_cmds\" + + + # Only execute mode is allowed to have -dlopen flags. + if test -n "$execute_dlfiles" && test "$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=$mode' for more information." +} + + +# 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 () +{ + $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 -r "$1" && exec 5<&1 <"$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 1<&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_ltwrapper_scriptname_result="" + if func_ltwrapper_executable_p "$1"; then + func_dirname_and_basename "$1" "" "." + func_stripname '' '.exe' "$func_basename_result" + func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" + fi +} + +# 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_win32_libid arg +# return the library type of file 'arg' +# +# Need a lot of goo to handle *both* DLLs and import libs +# Has to be a shell function in order to 'eat' the argument +# that is supplied when $file_magic_command is called. +func_win32_libid () +{ + $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 + if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | + $EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then + win32_nmres=`eval $NM -f posix -A $1 | + $SED -n -e ' + 1,100{ + / I /{ + s,.*,import, + p + q + } + }'` + case $win32_nmres in + import*) win32_libid_type="x86 archive import";; + *) win32_libid_type="x86 archive static";; + esac + fi + ;; + *DLL*) + win32_libid_type="x86 DLL" + ;; + *executable*) # but shell scripts are "executable" too... + case $win32_fileres in + *MS\ Windows\ PE\ Intel*) + win32_libid_type="x86 DLL" + ;; + esac + ;; + esac + $ECHO "$win32_libid_type" +} + + + +# func_infer_tag arg +# Infer tagged configuration to use if any are available and +# if one wasn't chosen via the "--tag" command line option. +# Only attempt this if the compiler in the base compile +# command doesn't match the default compiler. +# arg is usually of the form 'gcc ...' +func_infer_tag () +{ + $opt_debug + if test -n "$available_tags" && test -z "$tagname"; then + CC_quoted= + for arg in $CC; do + func_quote_for_eval "$arg" + CC_quoted="$CC_quoted $func_quote_for_eval_result" + done + case $@ in + # Blanks in the command may have been stripped by the calling shell, + # but not from the CC environment variable when configure was run. + " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;; + # Blanks at the start of $base_compile will cause this to fail + # if we don't check for them as well. + *) + for z in $available_tags; do + if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then + # Evaluate the configuration. + eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" + CC_quoted= + for arg in $CC; do + # Double-quote args containing other shell metacharacters. + func_quote_for_eval "$arg" + CC_quoted="$CC_quoted $func_quote_for_eval_result" + done + case "$@ " in + " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) + # The compiler in the base compile command matches + # the one in the tagged configuration. + # Assume this is the tagged configuration we want. + tagname=$z + break + ;; + esac + fi + done + # If $tagname still isn't set, then no tagged configuration + # was found and let the user know that the "--tag" command + # line option must be used. + if test -z "$tagname"; then + 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_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 + +/* 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 "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + for progfile in $progfiles; do + func_verbose "extracting global C symbols from \`$progfile'" + $opt_dry_run || eval "$NM $progfile | $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* ) + 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* ) + 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" + $opt_dry_run || { + eval '$ECHO ": $name " >> "$nlist"' + eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'" + } + 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; +" + case $host in + *cygwin* | *mingw* ) + $ECHO >> "$output_objdir/$my_dlsyms" "\ +/* DATA imports from DLLs on WIN32 con't be const, because + runtime relocations are performed -- see ld's documentation + on pseudo-relocs. */" + lt_dlsym_const= ;; + *osf5*) + echo >> "$output_objdir/$my_dlsyms" "\ +/* This system does not cope well with relocations in const data */" + lt_dlsym_const= ;; + *) + lt_dlsym_const=const ;; + esac + + $ECHO >> "$output_objdir/$my_dlsyms" "\ +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) ;; + *) symtab_cflags="$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* ) + if test -f "$output_objdir/$my_outputname.def"; then + compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` + else + compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` + fi + ;; + *) + compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` + finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "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 "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` + finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` + 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" + func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 'exit $?' + if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then + : + else + 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 "*) + extracted_serial=`expr $extracted_serial + 1` + my_xlib_u=lt$extracted_serial-$my_xlib ;; + *) break ;; + esac + done + extracted_archives="$extracted_archives $my_xlib_u" + my_xdir="$my_gentop/$my_xlib_u" + + 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| xargs basename | sort -u | $NL2SP` + darwin_file= + darwin_files= + for darwin_file in $darwin_filelist; do + darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` + lipo -create -output "$darwin_file" $darwin_files + done # $darwin_filelist + $RM -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 | $NL2SP` + done + + func_extract_archives_result="$my_oldobjs" +} + + + +# 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 <?"'"'"' &()|`$[]' \ + && 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 + + $opt_dry_run || $RM $removelist + trap "$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE" 1 2 15 + + # On Cygwin there's no "real" PIC flag so we must build both object types + case $host_os in + cygwin* | mingw* | pw32* | os2*) + pic_mode=default + ;; + esac + if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then + # non-PIC code in shared libraries is not supported + pic_mode=default + fi + + # Calculate the filename of the output object if compiler does + # not support -o with -c + if test "$compiler_c_o" = no; then + output_obj=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} + lockfile="$output_obj.lock" + removelist="$removelist $output_obj $lockfile" + trap "$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE" 1 2 15 + else + output_obj= + need_locks=no + lockfile= + fi + + # Lock this critical section if it is needed + # We use this script file to make the link, it avoids creating a new file + if test "$need_locks" = yes; then + until $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 + $ECHO "$srcfile" > "$lockfile" + fi + + if test -n "$fix_srcfile_path"; then + eval srcfile=\"$fix_srcfile_path\" + fi + func_quote_for_eval "$srcfile" + qsrcfile=$func_quote_for_eval_result + + $opt_dry_run || $RM "$libobj" "${libobj}T" + + # 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 + command="$command -o $lobj" + fi + + $opt_dry_run || $RM "$lobj" "$output_obj" + + func_show_eval "$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 + command="$command -o $obj" + fi + + # Suppress compiler output if we already did a PIC compilation. + command="$command$suppress_output" + $opt_dry_run || $RM "$obj" "$output_obj" + func_show_eval "$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 + $RM "$lockfile" + fi + } + + exit $EXIT_SUCCESS +} + +test "$mode" = compile && func_mode_compile ${1+"$@"} + + +# 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 $execute_dlfiles; do + test -f "$file" \ + || func_fatal_help "\`$file' is not a file" + + dir= + case $file in + *.la) + # 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 + dir="$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 + -*) ;; + *) + # Do a test to see if this is really a libtool program. + if func_ltwrapper_script_p "$file"; then + func_source "$file" + elif func_ltwrapper_executable_p "$file"; then + func_ltwrapper_scriptname "$file" + func_source "$func_ltwrapper_scriptname_result" + fi + # Transform arg to wrapped name. + file="$progdir/$program" + ;; + esac + # Quote arguments (to preserve shell metacharacters). + func_quote_for_eval "$file" + args="$args $func_quote_for_eval_result" + 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 "$mode" = execute && func_mode_execute ${1+"$@"} + + +# func_mode_finish arg... +func_mode_finish () +{ + $opt_debug + libdirs="$nonopt" + admincmds= + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + for dir + do + libdirs="$libdirs $dir" + done + + for libdir in $libdirs; do + if test -n "$finish_cmds"; then + # Do each command in the finish commands. + 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" || admincmds="$admincmds + $cmds" + fi + done + fi + + # Exit here if they wanted silent mode. + $opt_silent && exit $EXIT_SUCCESS + + $ECHO "X----------------------------------------------------------------------" | $Xsed + $ECHO "Libraries have been installed in:" + for libdir in $libdirs; do + $ECHO " $libdir" + done + $ECHO + $ECHO "If you ever happen to want to link against installed libraries" + $ECHO "in a given directory, LIBDIR, you must either use libtool, and" + $ECHO "specify the full pathname of the library, or use the \`-LLIBDIR'" + $ECHO "flag during linking and do at least one of the following:" + if test -n "$shlibpath_var"; then + $ECHO " - add LIBDIR to the \`$shlibpath_var' environment variable" + $ECHO " during execution" + fi + if test -n "$runpath_var"; then + $ECHO " - add LIBDIR to the \`$runpath_var' environment variable" + $ECHO " during linking" + fi + if test -n "$hardcode_libdir_flag_spec"; then + libdir=LIBDIR + eval flag=\"$hardcode_libdir_flag_spec\" + + $ECHO " - use the \`$flag' linker flag" + fi + if test -n "$admincmds"; then + $ECHO " - have your system administrator run these commands:$admincmds" + fi + if test -f /etc/ld.so.conf; then + $ECHO " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" + fi + $ECHO + + $ECHO "See any operating system documentation about shared libraries for" + 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 "X----------------------------------------------------------------------" | $Xsed + exit $EXIT_SUCCESS +} + +test "$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. + $ECHO "X$nonopt" | $GREP shtool >/dev/null; 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" + install_prog="$install_prog$func_quote_for_eval_result" + + # We need to accept at least all the BSD install flags. + dest= + files= + opts= + prev= + install_type= + isdir=no + stripme= + for arg + do + if test -n "$dest"; then + files="$files $dest" + dest=$arg + continue + fi + + case $arg in + -d) isdir=yes ;; + -f) + case " $install_prog " in + *[\\\ /]cp\ *) ;; + *) prev=$arg ;; + esac + ;; + -g | -m | -o) + prev=$arg + ;; + -s) + stripme=" -s" + continue + ;; + -*) + ;; + *) + # If the previous option needed an argument, then skip it. + if test -n "$prev"; then + prev= + else + dest=$arg + continue + fi + ;; + esac + + # Aesthetically quote the argument. + func_quote_for_eval "$arg" + install_prog="$install_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 -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. + staticlibs="$staticlibs $file" + ;; + + *.la) + # 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 "*) ;; + *) current_libdirs="$current_libdirs $libdir" ;; + esac + else + # Note the libdir as a future libdir. + case "$future_libdirs " in + *" $libdir "*) ;; + *) future_libdirs="$future_libdirs $libdir" ;; + esac + fi + + func_dirname "$file" "/" "" + dir="$func_dirname_result" + dir="$dir$objdir" + + if test -n "$relink_command"; then + # Determine the prefix the user has applied to our future dir. + inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -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 "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` + else + relink_command=`$ECHO "X$relink_command" | $Xsed -e "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_prog $dir/$srcname $destdir/$realname" \ + 'exit $?' + tstripme="$stripme" + case $host_os in + cygwin* | mingw* | pw32*) + 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" && staticlibs="$staticlibs $dir/$old_library" + ;; + + *.lo) + # Install (i.e. copy) a libtool object. + + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile="$destdir/$destname" + else + 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 "X$lib" | $Xsed -e '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 "X$relink_command" | $Xsed -e '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 "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` + fi + fi + + # remove .exe since cygwin /usr/bin/install will append another + # one anyway + case $install_prog,$host in + */usr/bin/install*,*cygwin*) + case $file:$destfile in + *.exe:*.exe) + # this is ok + ;; + *.exe:*) + destfile=$destfile.exe + ;; + *:*.exe) + 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_show_eval "$install_prog \$file \$oldlib" 'exit $?' + + if test -n "$stripme" && test -n "$old_striplib"; then + func_show_eval "$old_striplib $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 "$mode" = install && func_mode_install ${1+"$@"} + + +# func_emit_wrapper arg +# +# 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 variable +# 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 '.lib' directory. This is a cygwin/mingw-specific +# behavior. +func_emit_wrapper () +{ + func_emit_wrapper_arg1=no + if test -n "$1" ; then + func_emit_wrapper_arg1=$1 + fi + + $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. +Xsed='${SED} -e 1s/^X//' +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 + ECHO=\"$qecho\" + file=\"\$0\" + # Make sure echo works. + if test \"X\$1\" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift + elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then + # Yippee, \$ECHO works! + : + else + # Restart under the correct shell, and then maybe \$ECHO will work. + exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} + fi + fi\ +" + $ECHO "\ + + # Find the directory that this script lives in. + thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` + test \"x\$thisdir\" = \"x\$file\" && thisdir=. + + # Follow symbolic links until we get to the real thisdir. + file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` + while test -n \"\$file\"; do + destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` + + # If there was a directory component, then change thisdir. + if test \"x\$destdir\" != \"x\$file\"; then + case \"\$destdir\" in + [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; + *) thisdir=\"\$thisdir/\$destdir\" ;; + esac + fi + + file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\` + file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` + done + + # 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 \"X\$thisdir\" | \$Xsed -e '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" + + # 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 \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` + + export $shlibpath_var +" + fi + + # fixup the dll searchpath if we need to. + if test -n "$dllsearchpath"; then + $ECHO "\ + # Add the dll search path components to the executable PATH + PATH=$dllsearchpath:\$PATH +" + fi + + $ECHO "\ + if test \"\$libtool_execute_magic\" != \"$magic\"; then + # Run the actual program with our arguments. +" + case $host in + # Backslashes separate directories on plain windows + *-*-mingw | *-*-os2*) + $ECHO "\ + exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} +" + ;; + + *) + $ECHO "\ + exec \"\$progdir/\$program\" \${1+\"\$@\"} +" + ;; + esac + $ECHO "\ + \$ECHO \"\$0: cannot exec \$program \$*\" + exit 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\ +" +} +# end: func_emit_wrapper + +# 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 +#else +# include +# include +#endif +#include +#include +#include +#include +#include +#include +#include + +#if defined(PATH_MAX) +# define LT_PATHMAX PATH_MAX +#elif defined(MAXPATHLEN) +# define LT_PATHMAX MAXPATHLEN +#else +# define LT_PATHMAX 1024 +#endif + +#ifndef S_IXOTH +# define S_IXOTH 0 +#endif +#ifndef S_IXGRP +# define S_IXGRP 0 +#endif + +#ifdef _MSC_VER +# define S_IXUSR _S_IEXEC +# define stat _stat +# ifndef _INTPTR_T_DEFINED +# define intptr_t int +# endif +#endif + +#ifndef DIR_SEPARATOR +# define DIR_SEPARATOR '/' +# define PATH_SEPARATOR ':' +#endif + +#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ + defined (__OS2__) +# define HAVE_DOS_BASED_FILE_SYSTEM +# ifndef DIR_SEPARATOR_2 +# define DIR_SEPARATOR_2 '\\' +# endif +# ifndef PATH_SEPARATOR_2 +# define PATH_SEPARATOR_2 ';' +# endif +#endif + +#ifndef DIR_SEPARATOR_2 +# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) +#else /* DIR_SEPARATOR_2 */ +# define IS_DIR_SEPARATOR(ch) \ + (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) +#endif /* DIR_SEPARATOR_2 */ + +#ifndef PATH_SEPARATOR_2 +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) +#else /* PATH_SEPARATOR_2 */ +# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) +#endif /* PATH_SEPARATOR_2 */ + +#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) +#define XFREE(stale) do { \ + if (stale) { free ((void *) stale); stale = 0; } \ +} while (0) + +#undef LTWRAPPER_DEBUGPRINTF +#if defined DEBUGWRAPPER +# define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args +static void +ltwrapper_debugprintf (const char *fmt, ...) +{ + va_list args; + va_start (args, fmt); + (void) vfprintf (stderr, fmt, args); + va_end (args); +} +#else +# define LTWRAPPER_DEBUGPRINTF(args) +#endif + +const char *program_name = NULL; + +void *xmalloc (size_t num); +char *xstrdup (const char *string); +const char *base_name (const char *name); +char *find_executable (const char *wrapper); +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_fatal (const char *message, ...); + +static const char *script_text = +EOF + + func_emit_wrapper yes | + $SED -e 's/\([\\"]\)/\\\1/g' \ + -e 's/^/ "/' -e 's/$/\\n"/' + echo ";" + + cat </dev/null || echo $SHELL` + case $lt_newargv0 in + *.exe | *.EXE) ;; + *) lt_newargv0=$lt_newargv0.exe ;; + esac + ;; + * ) lt_newargv0=$SHELL ;; + esac + fi + + 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; + + LTWRAPPER_DEBUGPRINTF (("(make_executable) : %s\n", + path ? (*path ? path : "EMPTY!") : "NULL!")); + 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; + + LTWRAPPER_DEBUGPRINTF (("(find_executable) : %s\n", + wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!")); + + if ((wrapper == NULL) || (*wrapper == '\0')) + return NULL; + + /* Absolute path? */ +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') + { + concat_name = xstrdup (wrapper); + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } + else + { +#endif + if (IS_DIR_SEPARATOR (wrapper[0])) + { + concat_name = xstrdup (wrapper); + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } +#if defined (HAVE_DOS_BASED_FILE_SYSTEM) + } +#endif + + for (p = wrapper; *p; p++) + if (*p == '/') + { + has_slash = 1; + break; + } + if (!has_slash) + { + /* no slashes; search PATH */ + const char *path = getenv ("PATH"); + if (path != NULL) + { + for (p = path; *p; p = p_next) + { + const char *q; + size_t p_len; + for (q = p; *q; q++) + if (IS_PATH_SEPARATOR (*q)) + break; + p_len = q - p; + p_next = (*q == '\0' ? q : q + 1); + if (p_len == 0) + { + /* empty path: current directory */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal ("getcwd failed"); + tmp_len = strlen (tmp); + concat_name = + XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + } + else + { + concat_name = + XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, p, p_len); + concat_name[p_len] = '/'; + strcpy (concat_name + p_len + 1, wrapper); + } + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + } + } + /* not found in PATH; assume curdir */ + } + /* Relative path | not found in path: prepend cwd */ + if (getcwd (tmp, LT_PATHMAX) == NULL) + lt_fatal ("getcwd failed"); + tmp_len = strlen (tmp); + concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); + memcpy (concat_name, tmp, tmp_len); + concat_name[tmp_len] = '/'; + strcpy (concat_name + tmp_len + 1, wrapper); + + if (check_executable (concat_name)) + return concat_name; + XFREE (concat_name); + return NULL; +} + +char * +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) + { + LTWRAPPER_DEBUGPRINTF (("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 + { + char *errstr = strerror (errno); + lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr); + } + } + XFREE (tmp_pathspec); + + if (!has_symlinks) + { + return xstrdup (pathspec); + } + + tmp_pathspec = realpath (pathspec, buf); + if (tmp_pathspec == 0) + { + lt_fatal ("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; +} + +static void +lt_error_core (int exit_status, const char *mode, + const char *message, va_list ap) +{ + fprintf (stderr, "%s: %s: ", program_name, mode); + vfprintf (stderr, message, ap); + fprintf (stderr, ".\n"); + + if (exit_status >= 0) + exit (exit_status); +} + +void +lt_fatal (const char *message, ...) +{ + va_list ap; + va_start (ap, message); + lt_error_core (EXIT_FAILURE, "FATAL", message, ap); + va_end (ap); +} +EOF +} +# end: func_emit_cwrapperexe_src + +# func_mode_link arg... +func_mode_link () +{ + $opt_debug + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) + # 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 + 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 + # See comment for -static flag below, for more details. + func_append compile_command " $link_static_flag" + func_append finalize_command " $link_static_flag" + 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 + 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 + dlfiles="$dlfiles $arg" + else + dlprefiles="$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 "*) ;; + *) deplibs="$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 +# moreargs="$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 + dlfiles="$dlfiles $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. + dlprefiles="$dlprefiles $pic_object" + prev= + fi + + # A PIC object. + 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 "*) ;; + *) rpath="$rpath $arg" ;; + esac + else + case "$xrpath " in + *" $arg "*) ;; + *) xrpath="$xrpath $arg" ;; + esac + fi + prev= + continue + ;; + shrext) + shrext_cmds="$arg" + prev= + continue + ;; + weak) + weak_libs="$weak_libs $arg" + prev= + continue + ;; + xcclinker) + linker_flags="$linker_flags $qarg" + compiler_flags="$compiler_flags $qarg" + prev= + func_append compile_command " $qarg" + func_append finalize_command " $qarg" + continue + ;; + xcompiler) + compiler_flags="$compiler_flags $qarg" + prev= + func_append compile_command " $qarg" + func_append finalize_command " $qarg" + continue + ;; + xlinker) + linker_flags="$linker_flags $qarg" + compiler_flags="$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) + # The effects of -all-static are defined in a previous loop. + 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 + ;; + + -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" + dir=$func_stripname_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 "*) ;; + *) + deplibs="$deplibs -L$dir" + lib_search_path="$lib_search_path $dir" + ;; + esac + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) + testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$dir:"*) ;; + *) dllsearchpath="$dllsearchpath:$dir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + *) dllsearchpath="$dllsearchpath:$testbindir";; + esac + ;; + esac + continue + ;; + + -l*) + if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*) + # These systems don't actually have a C or math library (as such) + continue + ;; + *-*-os2*) + # These systems don't actually have a C library (as such) + test "X$arg" = "X-lc" && continue + ;; + *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) + # Do not include libc due to us having libc/libc_r. + test "X$arg" = "X-lc" && continue + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C and math libraries are in the System framework + deplibs="$deplibs 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 + deplibs="$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) + compiler_flags="$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) + compiler_flags="$compiler_flags $arg" + func_append compile_command " $arg" + func_append finalize_command " $arg" + case "$new_inherited_linker_flags " in + *" $arg "*) ;; + * ) new_inherited_linker_flags="$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*) + # 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_fatal_error "only absolute run-paths are allowed" + ;; + esac + case "$xrpath " in + *" $dir "*) ;; + *) xrpath="$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" + arg="$arg $wl$func_quote_for_eval_result" + compiler_flags="$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" + arg="$arg $wl$func_quote_for_eval_result" + compiler_flags="$compiler_flags $wl$func_quote_for_eval_result" + linker_flags="$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" + ;; + + # -64, -mips[0-9] enable 64-bit mode on the SGI compiler + # -r[0-9][0-9]* specifies the processor on the SGI compiler + # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler + # +DA*, +DD* enable 64-bit mode on the HP compiler + # -q* pass through compiler args for the IBM compiler + # -m*, -t[45]*, -txscale* pass through architecture-specific + # compiler args for GCC + # -F/path gives path to uninstalled frameworks, gcc on darwin + # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC + # @file GCC response files + -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ + -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*) + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + func_append compile_command " $arg" + func_append finalize_command " $arg" + compiler_flags="$compiler_flags $arg" + continue + ;; + + # Some other compiler flag. + -* | +*) + func_quote_for_eval "$arg" + arg="$func_quote_for_eval_result" + ;; + + *.$objext) + # A standard object. + objs="$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 + dlfiles="$dlfiles $pic_object" + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + # CHECK ME: I think I busted this. -Ossama + if test "$prev" = dlprefiles; then + # Preload the old-style object. + dlprefiles="$dlprefiles $pic_object" + prev= + fi + + # A PIC object. + 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. + deplibs="$deplibs $arg" + old_deplibs="$old_deplibs $arg" + continue + ;; + + *.la) + # A libtool-controlled library. + + if test "$prev" = dlfiles; then + # This library was specified with -dlopen. + dlfiles="$dlfiles $arg" + prev= + elif test "$prev" = dlprefiles; then + # The library was specified with -dlpreopen. + dlprefiles="$dlprefiles $arg" + prev= + else + deplibs="$deplibs $arg" + fi + continue + ;; + + # Some other compiler argument. + *) + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + 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 \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` + else + shlib_search_path= + fi + eval sys_lib_search_path=\"$sys_lib_search_path_spec\" + eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" + + func_dirname "$output" "/" "" + output_objdir="$func_dirname_result$objdir" + # 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_duplicate_deps ; then + case "$libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + libs="$libs $deplib" + done + + if test "$linkmode" = lib; then + libs="$predeps $libs $compiler_lib_search_path $postdeps" + + # Compute libraries that are listed more than once in $predeps + # $postdeps and mark them as special (i.e., whose duplicates are + # not to be eliminated). + pre_post_deps= + if $opt_duplicate_compiler_generated_deps; then + for pre_post_dep in $predeps $postdeps; do + case "$pre_post_deps " in + *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; + esac + pre_post_deps="$pre_post_deps $pre_post_dep" + done + fi + pre_post_deps= + fi + + deplibs= + newdependency_libs= + newlib_search_path= + need_relink=no # whether we're linking any uninstalled libtool libraries + notinst_deplibs= # not-installed libtool libraries + 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% $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= + case $lib in + *.la) func_source "$lib" ;; + esac + + # Collect preopened libtool deplibs, except any this library + # has declared as weak libs + for deplib in $dependency_libs; do + deplib_base=`$ECHO "X$deplib" | $Xsed -e "$basename"` + case " $weak_libs " in + *" $deplib_base "*) ;; + *) deplibs="$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) + if test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + compiler_flags="$compiler_flags $deplib" + if test "$linkmode" = lib ; then + case "$new_inherited_linker_flags " in + *" $deplib "*) ;; + * ) new_inherited_linker_flags="$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 "*) ;; + * ) new_inherited_linker_flags="$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" + newlib_search_path="$newlib_search_path $func_stripname_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" + newlib_search_path="$newlib_search_path $func_stripname_result" + ;; + *) + func_warning "\`-L' is ignored for archives/objects" + ;; + esac # linkmode + continue + ;; # -L + -R*) + if test "$pass" = link; then + func_stripname '-R' '' "$deplib" + dir=$func_stripname_result + # Make sure the xrpath contains only unique directories. + case "$xrpath " in + *" $dir "*) ;; + *) xrpath="$xrpath $dir" ;; + esac + fi + deplibs="$deplib $deplibs" + continue + ;; + *.la) lib="$deplib" ;; + *.$libext) + if test "$pass" = conv; then + deplibs="$deplib $deplibs" + continue + fi + case $linkmode in + lib) + # 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 \"X$deplib\"" 2>/dev/null | $Xsed -e 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. + newdlprefiles="$newdlprefiles $deplib" + compile_deplibs="$deplib $compile_deplibs" + finalize_deplibs="$deplib $finalize_deplibs" + else + newdlfiles="$newdlfiles $deplib" + fi + fi + continue + ;; + %DEPLIBS%) + alldeplibs=yes + continue + ;; + esac # case $deplib + + if test "$found" = yes || test -f "$lib"; then : + else + 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 "X$inherited_linker_flags" | $Xsed -e '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 "*) ;; + *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";; + esac + done + fi + dependency_libs=`$ECHO "X $dependency_libs" | $Xsed -e '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" && dlfiles="$dlfiles $dlopen" + test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" + fi + + if test "$pass" = conv; then + # Only check for convenience libraries + deplibs="$lib $deplibs" + if test -z "$libdir"; then + if test -z "$old_library"; then + func_fatal_error "cannot find name of link library for \`$lib'" + fi + # It is a libtool convenience library, so add in its objects. + convenience="$convenience $ladir/$objdir/$old_library" + old_convenience="$old_convenience $ladir/$objdir/$old_library" + elif test "$linkmode" != prog && test "$linkmode" != lib; then + func_fatal_error "\`$lib' is not a convenience library" + fi + tmp_libs= + for deplib in $dependency_libs; do + deplibs="$deplib $deplibs" + if $opt_duplicate_deps ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + tmp_libs="$tmp_libs $deplib" + done + continue + fi # $pass = conv + + + # Get the name of the library we link against. + linklib= + for l in $old_library $library_names; do + linklib="$l" + done + if test -z "$linklib"; then + 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. + dlprefiles="$dlprefiles $lib $dependency_libs" + else + newdlfiles="$newdlfiles $lib" + fi + continue + fi # $pass = dlopen + + # We need an absolute path. + case $ladir in + [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; + *) + abs_ladir=`cd "$ladir" && pwd` + if test -z "$abs_ladir"; then + 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 "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then + func_warning "library \`$lib' was moved." + dir="$ladir" + absdir="$abs_ladir" + libdir="$abs_ladir" + else + dir="$libdir" + absdir="$libdir" + fi + test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes + else + if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then + dir="$ladir" + absdir="$abs_ladir" + # Remove this search path later + notinst_path="$notinst_path $abs_ladir" + else + dir="$ladir/$objdir" + absdir="$abs_ladir/$objdir" + # Remove this search path later + notinst_path="$notinst_path $abs_ladir" + fi + fi # $installed = yes + 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 + # Prefer using a static library (so that no silly _DYNAMIC symbols + # are required to link). + if test -n "$old_library"; then + newdlprefiles="$newdlprefiles $dir/$old_library" + # Keep a list of preopened convenience libraries to check + # that they are being used correctly in the link pass. + test -z "$libdir" && \ + dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library" + # Otherwise, use the dlname, so that lt_dlopen finds it. + elif test -n "$dlname"; then + newdlprefiles="$newdlprefiles $dir/$dlname" + else + newdlprefiles="$newdlprefiles $dir/$linklib" + fi + fi # $pass = dlpreopen + + if test -z "$libdir"; then + # Link the convenience library + if test "$linkmode" = lib; then + deplibs="$dir/$old_library $deplibs" + elif test "$linkmode,$pass" = "prog,link"; then + compile_deplibs="$dir/$old_library $compile_deplibs" + finalize_deplibs="$dir/$old_library $finalize_deplibs" + else + deplibs="$lib $deplibs" # used for prog,scan pass + fi + continue + fi + + + if test "$linkmode" = prog && test "$pass" != link; then + newlib_search_path="$newlib_search_path $ladir" + deplibs="$lib $deplibs" + + linkalldeplibs=no + if test "$link_all_deplibs" != no || test -z "$library_names" || + test "$build_libtool_libs" = no; then + linkalldeplibs=yes + fi + + tmp_libs= + for deplib in $dependency_libs; do + case $deplib in + -L*) func_stripname '-L' '' "$deplib" + newlib_search_path="$newlib_search_path $func_stripname_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_duplicate_deps ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + tmp_libs="$tmp_libs $deplib" + done # for deplib + continue + fi # $linkmode = prog... + + if test "$linkmode,$pass" = "prog,link"; then + if test -n "$library_names" && + { { test "$prefer_static_libs" = no || + test "$prefer_static_libs,$installed" = "built,yes"; } || + test -z "$old_library"; }; then + # We need to hardcode the library path + if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then + # Make sure the rpath contains only unique directories. + case "$temp_rpath:" in + *"$absdir:"*) ;; + *) temp_rpath="$temp_rpath$absdir:" ;; + esac + fi + + # Hardcode the library path. + # Skip directories that are in the system default run-time + # search path. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) compile_rpath="$compile_rpath $absdir" + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" + esac + ;; + esac + fi # $linkmode,$pass = prog,link... + + if test "$alldeplibs" = yes && + { test "$deplibs_check_method" = pass_all || + { test "$build_libtool_libs" = yes && + test -n "$library_names"; }; }; then + # We only need to search for static libraries + continue + fi + fi + + link_static=no # Whether the deplib will be linked statically + use_static_libs=$prefer_static_libs + if test "$use_static_libs" = built && test "$installed" = yes; then + use_static_libs=no + fi + if test -n "$library_names" && + { test "$use_static_libs" = no || test -z "$old_library"; }; then + case $host in + *cygwin* | *mingw*) + # No point in relinking DLLs because paths are not encoded + notinst_deplibs="$notinst_deplibs $lib" + need_relink=no + ;; + *) + if test "$installed" = no; then + notinst_deplibs="$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 "*) ;; + *) compile_rpath="$compile_rpath $absdir" + esac + ;; + esac + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" + esac + ;; + esac + fi + + if test -n "$old_archive_from_expsyms_cmds"; then + # figure out the soname + set dummy $library_names + 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*) + major=`expr $current - $age` + versuffix="-$major" + ;; + esac + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + + # Make a new name for the extract_expsyms_cmds to use + soroot="$soname" + 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 "$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$dir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + add_dir="$add_dir -L$inst_prefix_dir$libdir" + ;; + esac + fi + add="-l$name" + elif test "$hardcode_shlibpath_var" = yes; then + add_shlibpath="$dir" + add="-l$name" + else + lib_linked=no + fi + ;; + *) lib_linked=no ;; + esac + + if test "$lib_linked" != yes; then + func_fatal_configuration "unsupported hardcode properties" + fi + + if test -n "$add_shlibpath"; then + case :$compile_shlibpath: in + *":$add_shlibpath:"*) ;; + *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; + esac + fi + if test "$linkmode" = prog; then + test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" + test -n "$add" && compile_deplibs="$add $compile_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + if test "$hardcode_direct" != yes && + test "$hardcode_minus_L" != yes && + test "$hardcode_shlibpath_var" = yes; then + case :$finalize_shlibpath: in + *":$libdir:"*) ;; + *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; + esac + fi + fi + fi + + if test "$linkmode" = prog || test "$mode" = relink; then + add_shlibpath= + add_dir= + add= + # Finalize command for both is simple: just hardcode it. + if test "$hardcode_direct" = yes && + 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:"*) ;; + *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; + esac + add="-l$name" + elif test "$hardcode_automatic" = yes; then + if test -n "$inst_prefix_dir" && + test -f "$inst_prefix_dir$libdir/$linklib" ; then + add="$inst_prefix_dir$libdir/$linklib" + else + add="$libdir/$linklib" + fi + else + # We cannot seem to hardcode it, guess we'll fake it. + add_dir="-L$libdir" + # Try looking first in the location we're being installed to. + if test -n "$inst_prefix_dir"; then + case $libdir in + [\\/]*) + add_dir="$add_dir -L$inst_prefix_dir$libdir" + ;; + esac + fi + add="-l$name" + fi + + if test "$linkmode" = prog; then + test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" + test -n "$add" && finalize_deplibs="$add $finalize_deplibs" + else + test -n "$add_dir" && deplibs="$add_dir $deplibs" + test -n "$add" && deplibs="$add $deplibs" + fi + fi + elif test "$linkmode" = prog; then + # Here we assume that one of hardcode_direct or hardcode_minus_L + # is not unsupported. This is valid on all known static and + # shared platforms. + if test "$hardcode_direct" != unsupported; then + test -n "$old_library" && linklib="$old_library" + compile_deplibs="$dir/$linklib $compile_deplibs" + finalize_deplibs="$dir/$linklib $finalize_deplibs" + else + compile_deplibs="-l$name -L$dir $compile_deplibs" + finalize_deplibs="-l$name -L$dir $finalize_deplibs" + fi + elif test "$build_libtool_libs" = yes; then + # Not a shared library + if test "$deplibs_check_method" != pass_all; then + # We're trying link a shared library against a static one + # but the system doesn't support it. + + # Just print a warning and add the library to dependency_libs so + # that the program can be linked against the static library. + $ECHO + $ECHO "*** Warning: This system can not link to static lib archive $lib." + $ECHO "*** I have the capability to make that library automatically link in when" + $ECHO "*** you link to this library. But I can only do this if you have a" + $ECHO "*** shared version of the library, which you do not appear to have." + if test "$module" = yes; then + $ECHO "*** But as you try to build a module library, libtool will still create " + $ECHO "*** a static module, that should work as long as the dlopening application" + $ECHO "*** is linked with the -dlopen flag to resolve symbols at runtime." + if test -z "$global_symbol_pipe"; then + $ECHO + $ECHO "*** However, this would only work if libtool was able to extract symbol" + $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could" + $ECHO "*** not find such a program. So, this module is probably useless." + $ECHO "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + fi + else + deplibs="$dir/$old_library $deplibs" + link_static=yes + fi + fi # link shared/static library? + + if test "$linkmode" = lib; then + if test -n "$dependency_libs" && + { test "$hardcode_into_libs" != yes || + test "$build_old_libs" = yes || + test "$link_static" = yes; }; then + # Extract -R from dependency_libs + temp_deplibs= + for libdir in $dependency_libs; do + case $libdir in + -R*) func_stripname '-R' '' "$libdir" + temp_xrpath=$func_stripname_result + case " $xrpath " in + *" $temp_xrpath "*) ;; + *) xrpath="$xrpath $temp_xrpath";; + esac;; + *) temp_deplibs="$temp_deplibs $libdir";; + esac + done + dependency_libs="$temp_deplibs" + fi + + newlib_search_path="$newlib_search_path $absdir" + # Link against this library + test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" + # ... and its dependency_libs + tmp_libs= + for deplib in $dependency_libs; do + newdependency_libs="$deplib $newdependency_libs" + if $opt_duplicate_deps ; then + case "$tmp_libs " in + *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; + esac + fi + tmp_libs="$tmp_libs $deplib" + done + + if test "$link_all_deplibs" != no; then + # Add the search paths of all dependency libraries + for deplib in $dependency_libs; do + case $deplib in + -L*) path="$deplib" ;; + *.la) + 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 | $SED -n -e '3q;2,2p' | $SED -e 's/(.*//'` + darwin_install_name=`$ECHO $darwin_install_name` + if test -z "$darwin_install_name"; then + darwin_install_name=`otool64 -L $depdepl | $SED -n -e '3q;2,2p' | $SED -e 's/(.*//'` + darwin_install_name=`$ECHO $darwin_install_name` + fi + compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" + linker_flags="$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 "X $new_inherited_linker_flags" | $Xsed -e '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 "*) ;; + *) lib_search_path="$lib_search_path $dir" ;; + esac + done + newlib_search_path= + fi + + if test "$linkmode,$pass" != "prog,link"; then + vars="deplibs" + else + vars="compile_deplibs finalize_deplibs" + fi + for var in $vars dependency_libs; do + # Add libraries to $var in reverse order + eval tmp_libs=\"\$$var\" + new_libs= + for deplib in $tmp_libs; do + # FIXME: Pedantically, this is the right thing to do, so + # that some nasty dependency loop isn't accidentally + # broken: + #new_libs="$deplib $new_libs" + # Pragmatically, this seems to cause very few problems in + # practice: + case $deplib in + -L*) new_libs="$deplib $new_libs" ;; + -R*) ;; + *) + # And here is the reason: when a library appears more + # than once as an explicit dependence of a library, or + # is implicitly linked in more than once by the + # compiler, it is considered special, and multiple + # occurrences thereof are not removed. Compare this + # with having the same library being listed as a + # dependency of multiple other libraries: in this case, + # we know (pedantically, we assume) the library does not + # need to be listed more than once, so we keep only the + # last copy. This is not always right, but it is rare + # enough that we require users that really mean to play + # such unportable linking tricks to link the library + # using -Wl,-lname, so that libtool does not consider it + # for duplicate removal. + case " $specialdeplibs " in + *" $deplib "*) new_libs="$deplib $new_libs" ;; + *) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$deplib $new_libs" ;; + esac + ;; + esac + ;; + esac + done + tmp_libs= + for deplib in $new_libs; do + case $deplib in + -L*) + case " $tmp_libs " in + *" $deplib "*) ;; + *) tmp_libs="$tmp_libs $deplib" ;; + esac + ;; + *) tmp_libs="$tmp_libs $deplib" ;; + esac + done + eval $var=\"$tmp_libs\" + done # for var + fi + # Last step: remove runtime libs from dependency_libs + # (they stay in deplibs) + tmp_libs= + for i in $dependency_libs ; do + case " $predeps $postdeps $compiler_lib_search_path " in + *" $i "*) + i="" + ;; + esac + if test -n "$i" ; then + tmp_libs="$tmp_libs $i" + fi + done + dependency_libs=$tmp_libs + done # for pass + if test "$linkmode" = prog; then + dlfiles="$newdlfiles" + 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" + objs="$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!" + libobjs="$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 + darwin|linux|osf|windows|none) + current=`expr $number_major + $number_minor` + age="$number_minor" + revision="$number_revision" + ;; + freebsd-aout|freebsd-elf|sunos) + current="$number_major" + revision="$number_minor" + age="0" + ;; + irix|nonstopux) + current=`expr $number_major + $number_minor` + age="$number_minor" + revision="$number_minor" + lt_irix_increment=no + ;; + 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 + major=.`expr $current - $age` + versuffix="$major.$age.$revision" + # Darwin ld doesn't like 0 for these options... + minor_current=`expr $current + 1` + 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 + major=`expr $current - $age` + else + major=`expr $current - $age + 1` + fi + + case $version_type in + nonstopux) verstring_prefix=nonstopux ;; + *) verstring_prefix=sgi ;; + esac + verstring="$verstring_prefix$major.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$revision + while test "$loop" -ne 0; do + iface=`expr $revision - $loop` + loop=`expr $loop - 1` + verstring="$verstring_prefix$major.$iface:$verstring" + done + + # Before this point, $major must not contain `.'. + major=.$major + versuffix="$major.$revision" + ;; + + linux) + major=.`expr $current - $age` + versuffix="$major.$age.$revision" + ;; + + osf) + major=.`expr $current - $age` + versuffix=".$current.$age.$revision" + verstring="$current.$age.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$age + while test "$loop" -ne 0; do + iface=`expr $current - $loop` + loop=`expr $loop - 1` + verstring="$verstring:${iface}.0" + done + + # Make executables depend on our current version. + verstring="$verstring:${current}.0" + ;; + + 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. + major=`expr $current - $age` + 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" + libobjs="$libobjs $symfileobj" + test "X$libobjs" = "X " && libobjs= + + if test "$mode" != relink; then + # Remove our outputs, but don't remove object files since they + # may have been created when compiling PIC objects. + removelist= + tempremovelist=`$ECHO "$output_objdir/*"` + for p in $tempremovelist; do + case $p in + *.$objext) + ;; + $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) + if test "X$precious_files_regex" != "X"; then + if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 + then + continue + fi + fi + removelist="$removelist $p" + ;; + *) ;; + esac + done + 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 + oldlibs="$oldlibs $output_objdir/$libname.$libext" + + # Transform .lo files to .o files. + oldobjs="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` + fi + + # Eliminate all temporary directories. + #for path in $notinst_path; do + # lib_search_path=`$ECHO "X$lib_search_path " | $Xsed -e "s% $path % %g"` + # deplibs=`$ECHO "X$deplibs " | $Xsed -e "s% -L$path % %g"` + # dependency_libs=`$ECHO "X$dependency_libs " | $Xsed -e "s% -L$path % %g"` + #done + + if test -n "$xrpath"; then + # If the user specified any rpath flags, then add them. + temp_xrpath= + for libdir in $xrpath; do + temp_xrpath="$temp_xrpath -R$libdir" + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" ;; + esac + done + if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then + dependency_libs="$temp_xrpath $dependency_libs" + fi + fi + + # Make sure dlfiles contains only unique files that won't be dlpreopened + old_dlfiles="$dlfiles" + dlfiles= + for lib in $old_dlfiles; do + case " $dlprefiles $dlfiles " in + *" $lib "*) ;; + *) dlfiles="$dlfiles $lib" ;; + esac + done + + # Make sure dlprefiles contains only unique files + old_dlprefiles="$dlprefiles" + dlprefiles= + for lib in $old_dlprefiles; do + case "$dlprefiles " in + *" $lib "*) ;; + *) dlprefiles="$dlprefiles $lib" ;; + esac + done + + if test "$build_libtool_libs" = yes; then + if test -n "$rpath"; then + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) + # these systems don't actually have a c library (as such)! + ;; + *-*-rhapsody* | *-*-darwin1.[012]) + # Rhapsody C library is in the System framework + deplibs="$deplibs 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 + deplibs="$deplibs -lc" + fi + ;; + esac + fi + + # Transform deplibs into only deplibs that can be linked in shared. + name_save=$name + libname_save=$libname + release_save=$release + versuffix_save=$versuffix + major_save=$major + # I'm not sure if I'm treating the release correctly. I think + # release should show up in the -l (ie -lgmp5) so we don't want to + # add it in twice. Is that correct? + release="" + versuffix="" + major="" + newdeplibs= + droppeddeps=no + case $deplibs_check_method in + pass_all) + # Don't check for shared/static. Everything works. + # This might be a little naive. We might want to check + # whether the library exists or not. But this is on + # osf3 & osf4 and I'm not really sure... Just + # implementing what was already the behavior. + newdeplibs=$deplibs + ;; + test_compile) + # This code stresses the "libraries are programs" paradigm to its + # limits. Maybe even breaks it. We compile a program, linking it + # against the deplibs as a proxy for the library. Then we can check + # whether they linked in statically or dynamically with ldd. + $opt_dry_run || $RM conftest.c + cat > conftest.c </dev/null` + for potent_lib in $potential_libs; do + # Follow soft links. + if ls -lLd "$potent_lib" 2>/dev/null | + $GREP " -> " >/dev/null; then + continue + fi + # The statement above tries to avoid entering an + # endless loop below, in case of cyclic links. + # We might still enter an endless loop, since a link + # loop can be closed while we follow links, + # but so what? + potlib="$potent_lib" + while test -h "$potlib" 2>/dev/null; do + potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` + case $potliblink in + [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; + *) potlib=`$ECHO "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; + esac + done + if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | + $SED -e 10q | + $EGREP "$file_magic_regex" > /dev/null; then + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + break 2 + fi + done + done + fi + if test -n "$a_deplib" ; then + droppeddeps=yes + $ECHO + $ECHO "*** Warning: linker path does not have real file for library $a_deplib." + $ECHO "*** I have the capability to make that library automatically link in when" + $ECHO "*** you link to this library. But I can only do this if you have a" + $ECHO "*** shared version of the library, which you do not appear to have" + $ECHO "*** because I did check the linker path looking for a file starting" + if test -z "$potlib" ; then + $ECHO "*** with $libname but no candidates were found. (...for file magic test)" + else + $ECHO "*** with $libname and none of the candidates passed a file format test" + $ECHO "*** using a file magic. Last file checked: $potlib" + fi + fi + else + # Add a -L argument. + newdeplibs="$newdeplibs $a_deplib" + fi + done # Gone through all deplibs. + ;; + match_pattern*) + set dummy $deplibs_check_method; shift + match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` + for a_deplib in $deplibs; do + name=`expr $a_deplib : '-l\(.*\)'` + # If $name is empty we are operating on a -L argument. + if test -n "$name" && test "$name" != "0"; then + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + case " $predeps $postdeps " in + *" $a_deplib "*) + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + ;; + esac + fi + if test -n "$a_deplib" ; then + libname=`eval "\\$ECHO \"$libname_spec\""` + for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do + potential_libs=`ls $i/$libname[.-]* 2>/dev/null` + for potent_lib in $potential_libs; do + potlib="$potent_lib" # see symlink-check above in file_magic test + if eval "\$ECHO \"X$potent_lib\"" 2>/dev/null | $Xsed -e 10q | \ + $EGREP "$match_pattern_regex" > /dev/null; then + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + break 2 + fi + done + done + fi + if test -n "$a_deplib" ; then + droppeddeps=yes + $ECHO + $ECHO "*** Warning: linker path does not have real file for library $a_deplib." + $ECHO "*** I have the capability to make that library automatically link in when" + $ECHO "*** you link to this library. But I can only do this if you have a" + $ECHO "*** shared version of the library, which you do not appear to have" + $ECHO "*** because I did check the linker path looking for a file starting" + if test -z "$potlib" ; then + $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" + else + $ECHO "*** with $libname and none of the candidates passed a file format test" + $ECHO "*** using a regex pattern. Last file checked: $potlib" + fi + fi + else + # Add a -L argument. + newdeplibs="$newdeplibs $a_deplib" + fi + done # Gone through all deplibs. + ;; + none | unknown | *) + newdeplibs="" + tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \ + -e 's/ -lc$//' -e 's/ -[LR][^ ]*//g'` + if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then + for i in $predeps $postdeps ; do + # can't use Xsed below, because $i might contain '/' + tmp_deplibs=`$ECHO "X $tmp_deplibs" | $Xsed -e "s,$i,,"` + done + fi + if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' | + $GREP . >/dev/null; then + $ECHO + if test "X$deplibs_check_method" = "Xnone"; then + $ECHO "*** Warning: inter-library dependencies are not supported in this platform." + else + $ECHO "*** Warning: inter-library dependencies are not known to be supported." + fi + $ECHO "*** All declared inter-library dependencies are being dropped." + droppeddeps=yes + fi + ;; + esac + versuffix=$versuffix_save + major=$major_save + release=$release_save + libname=$libname_save + name=$name_save + + case $host in + *-*-rhapsody* | *-*-darwin1.[012]) + # On Rhapsody replace the C library with the System framework + newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e '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 "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` + new_inherited_linker_flags=`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` + deplibs=`$ECHO "X $deplibs" | $Xsed -e '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 "*) + new_libs="$new_libs -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$new_libs $deplib" ;; + esac + ;; + *) new_libs="$new_libs $deplib" ;; + esac + done + deplibs="$new_libs" + + # All the library-specific variables (install_libdir is set above). + library_names= + old_library= + dlname= + + # Test again, we may have decided not to build it any more + if test "$build_libtool_libs" = yes; then + if test "$hardcode_into_libs" = yes; then + # Hardcode the library paths + hardcode_libdirs= + dep_rpath= + rpath="$finalize_rpath" + test "$mode" != relink && rpath="$compile_rpath$rpath" + for libdir in $rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + dep_rpath="$dep_rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) perm_rpath="$perm_rpath $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + if test -n "$hardcode_libdir_flag_spec_ld"; then + eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" + else + eval dep_rpath=\"$hardcode_libdir_flag_spec\" + fi + fi + if test -n "$runpath_var" && test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + rpath="$rpath$dir:" + done + eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" + fi + test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" + fi + + shlibpath="$finalize_shlibpath" + test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" + if test -n "$shlibpath"; then + eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" + fi + + # Get the real and link names of the library. + eval shared_ext=\"$shrext_cmds\" + eval library_names=\"$library_names_spec\" + set dummy $library_names + 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 + linknames="$linknames $link" + done + + # Use standard objects if they are pic + test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$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" + delfiles="$delfiles $export_symbols" + fi + + orig_export_symbols= + case $host_os in + cygwin* | mingw*) + 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 cmd in $cmds; do + IFS="$save_ifs" + eval cmd=\"$cmd\" + if len=`expr "X$cmd" : ".*"` && + test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then + func_show_eval "$cmd" 'exit $?' + 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 "X$include_expsyms" | $Xsed | $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 + delfiles="$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 "*) ;; + *) + tmp_deplibs="$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" + generated="$generated $gentop" + + func_extract_archives $gentop $convenience + libobjs="$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\" + linker_flags="$linker_flags $flag" + fi + + # Make a backup of the uninstalled library when relinking + if test "$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:" && + len=`expr "X$test_cmds" : ".*" 2>/dev/null` && + test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then + : + else + # The command line is too long to link in one step, link piecewise + # 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 + output_la=`$ECHO "X$output" | $Xsed -e "$basename"` + + # Clear the reloadable object creation command queue and + # initialize k to one. + test_cmds= + concat_cmds= + objlist= + 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 + $ECHO "$obj" >> $output + done + $ECHO ')' >> $output + delfiles="$delfiles $output" + 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 + $ECHO "$obj" >> $output + done + delfiles="$delfiles $output" + output=$firstobj\"$file_list_spec$output\" + else + if test -n "$save_libobjs"; then + func_verbose "creating reloadable object files..." + output=$output_objdir/$output_la-${k}.$objext + # Loop over the list of objects to be linked. + for obj in $save_libobjs + do + eval test_cmds=\"$reload_cmds $objlist $last_robj\" + if test "X$objlist" = X || + { len=`expr "X$test_cmds" : ".*" 2>/dev/null` && + test "$len" -le "$max_cmd_len"; }; then + objlist="$objlist $obj" + else + # The command $test_cmds is almost too long, add a + # command to the queue. + if test "$k" -eq 1 ; then + # The first file doesn't have a previous command to add. + eval concat_cmds=\"$reload_cmds $objlist $last_robj\" + else + # All subsequent reloadable object files will link in + # the last one created. + eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj~\$RM $last_robj\" + fi + last_robj=$output_objdir/$output_la-${k}.$objext + k=`expr $k + 1` + output=$output_objdir/$output_la-${k}.$objext + objlist=$obj + len=1 + fi + done + # Handle the remaining objects by creating one last + # reloadable object file. All subsequent reloadable object + # files will link in the last one created. + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" + if test -n "$last_robj"; then + eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" + fi + delfiles="$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 "$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 "X$include_expsyms" | $Xsed | $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 + delfiles="$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" + generated="$generated $gentop" + + func_extract_archives $gentop $dlprefiles + libobjs="$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 "$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 "$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 "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'` + else + gentop="$output_objdir/${obj}x" + generated="$generated $gentop" + + func_extract_archives $gentop $convenience + reload_conv_objs="$reload_objs $func_extract_archives_result" + fi + fi + + # Create the old-style object. + reload_objs="$objs$old_deplibs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test + + output="$obj" + 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 "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'` + finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e '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]) + compile_command="$compile_command ${wl}-bind_at_load" + finalize_command="$finalize_command ${wl}-bind_at_load" + ;; + esac + fi + # Time to change all our "foo.ltframework" stuff back to "-framework foo" + compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` + finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e '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 "*) + new_libs="$new_libs -L$path/$objdir" ;; + esac + ;; + esac + done + for deplib in $compile_deplibs; do + case $deplib in + -L*) + case " $new_libs " in + *" $deplib "*) ;; + *) new_libs="$new_libs $deplib" ;; + esac + ;; + *) new_libs="$new_libs $deplib" ;; + esac + done + compile_deplibs="$new_libs" + + + compile_command="$compile_command $compile_deplibs" + finalize_command="$finalize_command $finalize_deplibs" + + if test -n "$rpath$xrpath"; then + # If the user specified any rpath flags, then add them. + for libdir in $rpath $xrpath; do + # This is the magic to use -rpath. + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" ;; + esac + done + fi + + # Now hardcode the library paths + rpath= + hardcode_libdirs= + for libdir in $compile_rpath $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + rpath="$rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) perm_rpath="$perm_rpath $libdir" ;; + esac + fi + case $host in + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) + testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` + case :$dllsearchpath: in + *":$libdir:"*) ;; + *) dllsearchpath="$dllsearchpath:$libdir";; + esac + case :$dllsearchpath: in + *":$testbindir:"*) ;; + *) dllsearchpath="$dllsearchpath:$testbindir";; + esac + ;; + esac + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + compile_rpath="$rpath" + + rpath= + hardcode_libdirs= + for libdir in $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + rpath="$rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$finalize_perm_rpath " in + *" $libdir "*) ;; + *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + finalize_rpath="$rpath" + + if test -n "$libobjs" && test "$build_old_libs" = yes; then + # Transform all the library objects into standard objects. + compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + fi + + 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 + *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 "X$compile_command" | $Xsed -e '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=$?' + + # 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 + rpath="$rpath$dir:" + done + compile_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + if test -n "$finalize_perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $finalize_perm_rpath; do + rpath="$rpath$dir:" + done + finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + fi + + if test "$no_install" = yes; then + # We don't need to create a wrapper script. + link_command="$compile_var$compile_command$compile_rpath" + # Replace the output file specification. + link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` + # Delete the old output file. + $opt_dry_run || $RM $output + # Link the executable and exit + func_show_eval "$link_command" 'exit $?' + exit $EXIT_SUCCESS + fi + + if test "$hardcode_action" = relink; then + # Fast installation is not supported + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + + 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 "X$compile_var$compile_command$compile_rpath" | $Xsed -e '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 "X$link_command" | $Xsed -e '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 $?' + + # 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 "X$relink_command" | $Xsed -e "$sed_quote_subst"` + fi + + # Quote $ECHO for shipping. + if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then + case $progpath in + [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; + *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; + esac + qecho=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"` + else + qecho=`$ECHO "X$ECHO" | $Xsed -e "$sed_quote_subst"` + fi + + # Only actually do things if 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 + + # we should really use a build-platform specific compiler + # here, but OTOH, the wrappers (shell script and this C one) + # are only useful if you want to execute the "real" binary. + # Since the "real" binary is built for $host, then this + # wrapper might as well be built for $host, too. + $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 || { + $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result + } + ;; + * ) + $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 + oldobjs="$oldobjs $symfileobj" + fi + fi + addlibs="$old_convenience" + fi + + if test -n "$addlibs"; then + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + + func_extract_archives $gentop $addlibs + oldobjs="$oldobjs $func_extract_archives_result" + fi + + # Do each command in the archive commands. + if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then + cmds=$old_archive_from_new_cmds + else + + # Add any objects from preloaded convenience libraries + if test -n "$dlprefiles"; then + gentop="$output_objdir/${outputname}x" + generated="$generated $gentop" + + func_extract_archives $gentop $dlprefiles + oldobjs="$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" + generated="$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 + counter=`expr $counter + 1` + 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" + oldobjs="$oldobjs $gentop/$newobj" + ;; + *) oldobjs="$oldobjs $obj" ;; + esac + done + fi + eval cmds=\"$old_archive_cmds\" + + if len=`expr "X$cmds" : ".*" 2>/dev/null` && + test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then + cmds=$old_archive_cmds + else + # the command line is too long to link in one step, link in parts + func_verbose "using piecewise archive linking..." + save_RANLIB=$RANLIB + RANLIB=: + objlist= + concat_cmds= + save_oldobjs=$oldobjs + # Is there a better way of finding the last object in the list? + for obj in $save_oldobjs + do + last_oldobj=$obj + done + for obj in $save_oldobjs + do + oldobjs="$objlist $obj" + objlist="$objlist $obj" + eval test_cmds=\"$old_archive_cmds\" + if len=`expr "X$test_cmds" : ".*" 2>/dev/null` && + test "$len" -le "$max_cmd_len"; then + : + else + # the above command should be used before it gets too long + oldobjs=$objlist + if test "$obj" = "$last_oldobj" ; then + RANLIB=$save_RANLIB + fi + test -z "$concat_cmds" || concat_cmds=$concat_cmds~ + eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" + objlist= + fi + done + RANLIB=$save_RANLIB + oldobjs=$objlist + if test "X$oldobjs" = "X" ; then + eval cmds=\"\$concat_cmds\" + else + eval cmds=\"\$concat_cmds~\$old_archive_cmds\" + fi + fi + fi + 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 "X$relink_command" | $Xsed -e "$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" + eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` + test -z "$libdir" && \ + func_fatal_error "\`$deplib' is not a valid libtool archive" + newdependency_libs="$newdependency_libs $libdir/$name" + ;; + *) newdependency_libs="$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" + newdlfiles="$newdlfiles $libdir/$name" + ;; + *) newdlfiles="$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" + newdlprefiles="$newdlprefiles $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 + newdlfiles="$newdlfiles $abs" + done + dlfiles="$newdlfiles" + newdlprefiles= + for lib in $dlprefiles; do + case $lib in + [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; + *) abs=`pwd`"/$lib" ;; + esac + newdlprefiles="$newdlprefiles $abs" + done + dlprefiles="$newdlprefiles" + fi + $RM $output + # place dlname in correct position for cygwin + tdlname=$dlname + case $host,$output,$installed,$module,$dlname in + *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; + esac + $ECHO > $output "\ +# $outputname - a libtool library file +# Generated by $PROGRAM (GNU $PACKAGE$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 "$mode" = link || test "$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) RM="$RM $arg"; rmforce=yes ;; + -*) RM="$RM $arg" ;; + *) files="$files $arg" ;; + esac + done + + test -z "$RM" && \ + func_fatal_help "you must specify an RM program" + + rmdirs= + + origobjdir="$objdir" + for file in $files; do + func_dirname "$file" "" "." + dir="$func_dirname_result" + if test "X$dir" = X.; then + objdir="$origobjdir" + else + objdir="$dir/$origobjdir" + fi + func_basename "$file" + name="$func_basename_result" + test "$mode" = uninstall && objdir="$dir" + + # Remember objdir for removal later, being careful to avoid duplicates + if test "$mode" = clean; then + case " $rmdirs " in + *" $objdir "*) ;; + *) rmdirs="$rmdirs $objdir" ;; + esac + fi + + # Don't error if the file doesn't exist and rm -f was used. + if { test -L "$file"; } >/dev/null 2>&1 || + { test -h "$file"; } >/dev/null 2>&1 || + test -f "$file"; then + : + elif test -d "$file"; then + exit_status=1 + continue + elif test "$rmforce" = yes; then + continue + fi + + rmfiles="$file" + + case $name in + *.la) + # Possibly a libtool archive, so verify it. + if func_lalib_p "$file"; then + func_source $dir/$name + + # Delete the libtool libraries and symlinks. + for n in $library_names; do + rmfiles="$rmfiles $objdir/$n" + done + test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" + + case "$mode" in + clean) + case " $library_names " in + # " " in the beginning catches empty $dlname + *" $dlname "*) ;; + *) rmfiles="$rmfiles $objdir/$dlname" ;; + esac + test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" + ;; + uninstall) + if test -n "$library_names"; then + # Do each command in the postuninstall commands. + 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 + rmfiles="$rmfiles $dir/$pic_object" + fi + + # Add non-PIC object to the list of files to remove. + if test -n "$non_pic_object" && + test "$non_pic_object" != none; then + rmfiles="$rmfiles $dir/$non_pic_object" + fi + fi + ;; + + *) + if test "$mode" = clean ; then + noexename=$name + case $file in + *.exe) + 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 + rmfiles="$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 + rmfiles="$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 + rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" + if test "$fast_install" = yes && test -n "$relink_command"; then + rmfiles="$rmfiles $objdir/lt-$name" + fi + if test "X$noexename" != "X$name" ; then + rmfiles="$rmfiles $objdir/lt-${noexename}.c" + fi + fi + fi + ;; + esac + func_show_eval "$RM $rmfiles" 'exit_status=1' + done + objdir="$origobjdir" + + # Try to remove the ${objdir}s in the directories where we deleted files + for dir in $rmdirs; do + if test -d "$dir"; then + func_show_eval "rmdir $dir >/dev/null 2>&1" + fi + done + + exit $exit_status +} + +{ test "$mode" = uninstall || test "$mode" = clean; } && + func_mode_uninstall ${1+"$@"} + +test -z "$mode" && { + help="$generic_help" + func_fatal_help "you must specify a MODE" +} + +test -z "$exec_cmd" && \ + func_fatal_help "invalid operation mode \`$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 + diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/config/missing /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/config/missing --- open-vm-tools-2008.01.23-74039/config/missing 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/config/missing 2008-10-13 08:02:11.000000000 +0100 @@ -0,0 +1,367 @@ +#! /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: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/config.guess /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/config.guess --- open-vm-tools-2008.01.23-74039/config.guess 2008-11-20 23:36:10.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/config.guess 1970-01-01 01:00:00.000000000 +0100 @@ -1,1516 +0,0 @@ -#! /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='2007-07-22' - -# 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 ;; - sh5el) machine=sh5le-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.*:* | i86xen: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 ;; - *: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 ;; - *:Interix*:[3456]*) - case ${UNAME_MACHINE} in - x86) - echo i586-pc-interix${UNAME_RELEASE} - exit ;; - EM64T | authenticamd) - echo x86_64-unknown-interix${UNAME_RELEASE} - exit ;; - esac ;; - [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 ;; - xtensa:Linux:*:*) - echo xtensa-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 ;; - SX-7:SUPER-UX:*:*) - echo sx7-nec-superux${UNAME_RELEASE} - exit ;; - SX-8:SUPER-UX:*:*) - echo sx8-nec-superux${UNAME_RELEASE} - exit ;; - SX-8R:SUPER-UX:*:*) - echo sx8r-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: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/config.sub /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/config.sub --- open-vm-tools-2008.01.23-74039/config.sub 2008-11-20 23:36:10.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/config.sub 1970-01-01 01:00:00.000000000 +0100 @@ -1,1626 +0,0 @@ -#! /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='2007-06-28' - -# 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 \ - | fido | 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 | mep \ - | 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-* | fido-* | 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 - ;; - cr16) - basic_machine=cr16-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 - ;; - mingw32ce) - basic_machine=arm-unknown - os=-mingw32ce - ;; - 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 - ;; - sh5el) - basic_machine=sh5le-unknown - ;; - 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* | -drops*) - # 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 - ;; - mep-*) - os=-elf - ;; - 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: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/configure /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/configure --- open-vm-tools-2008.01.23-74039/configure 2008-01-28 08:03:01.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/configure 2008-10-13 08:02:11.000000000 +0100 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for open-vm-tools 2008.01.23-74039. +# Generated by GNU Autoconf 2.61 for open-vm-tools 2008.10.10-123053. # # Report bugs to . # @@ -555,22 +555,22 @@ # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} -case X$ECHO in +case X$lt_ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). - ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','` + ECHO=`echo "$lt_ECHO" | sed 's,\\\\\$\\$0,'$0','` ;; esac -echo=${ECHO-echo} +ECHO=${lt_ECHO-echo} if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : -elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then - # Yippee, $echo works! +elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then + # Yippee, $ECHO works! : else # Restart under the correct shell. @@ -580,9 +580,9 @@ if test "X$1" = X--fallback-echo; then # used as fallback echo shift - cat </dev/null 2>&1 && unset CDPATH -if test -z "$ECHO"; then -if test "X${echo_test_string+set}" != Xset; then -# find a string as large as possible, as long as the shell can cope with it - for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do - # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... - if (echo_test_string=`eval $cmd`) 2>/dev/null && - echo_test_string=`eval $cmd` && - (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null - then - break - fi - done -fi +if test -z "$lt_ECHO"; then + if test "X${echo_test_string+set}" != Xset; then + # find a string as large as possible, as long as the shell can cope with it + for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do + # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... + if { echo_test_string=`eval $cmd`; } 2>/dev/null && + { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null + then + break + fi + done + fi -if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - : -else - # The Solaris, AIX, and Digital Unix default echo programs unquote - # backslashes. This makes it impossible to quote backslashes using - # echo "$something" | sed 's/\\/\\\\/g' - # - # So, first we look for a working echo in the user's PATH. + if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : + else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for dir in $PATH /usr/ucb; do + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + IFS="$lt_save_ifs" + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + ECHO="$dir/echo" + break + fi + done IFS="$lt_save_ifs" - if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && - test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - echo="$dir/echo" - break - fi - done - IFS="$lt_save_ifs" - if test "X$echo" = Xecho; then - # We didn't find a better echo, so look for alternatives. - if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # This shell has a builtin print -r that does the trick. - echo='print -r' - elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && - test "X$CONFIG_SHELL" != X/bin/ksh; then - # If we have ksh, try running configure again with it. - ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} - export ORIGINAL_CONFIG_SHELL - CONFIG_SHELL=/bin/ksh - export CONFIG_SHELL - exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} - else - # Try using printf. - echo='printf %s\n' - if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && - echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - # Cool, printf works - : - elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL - export CONFIG_SHELL - SHELL="$CONFIG_SHELL" - export SHELL - echo="$CONFIG_SHELL $0 --fallback-echo" - elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && - test "X$echo_testing_string" = 'X\t' && - echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && - test "X$echo_testing_string" = "X$echo_test_string"; then - echo="$CONFIG_SHELL $0 --fallback-echo" + if test "X$ECHO" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + ECHO='print -r' + elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running configure again with it. + ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} else - # maybe with a smaller string... - prev=: + # Try using printf. + ECHO='printf %s\n' + if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + ECHO="$CONFIG_SHELL $0 --fallback-echo" + elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + ECHO="$CONFIG_SHELL $0 --fallback-echo" + else + # maybe with a smaller string... + prev=: - for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do - if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null - then - break - fi - prev="$cmd" - done + for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do + if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null + then + break + fi + prev="$cmd" + done - if test "$prev" != 'sed 50q "$0"'; then - echo_test_string=`eval $prev` - export echo_test_string - exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} - else - # Oops. We lost completely, so just stick with echo. - echo=echo - fi + if test "$prev" != 'sed 50q "$0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} + else + # Oops. We lost completely, so just stick with echo. + ECHO=echo + fi + fi fi fi fi fi -fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. -ECHO=$echo -if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then - ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" +lt_ECHO=$ECHO +if test "X$lt_ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then + lt_ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" fi -tagnames=${tagnames+${tagnames},}CXX - -tagnames=${tagnames+${tagnames},}F77 - exec 7<&0 &1 # Name of the host. @@ -728,8 +723,8 @@ # Identity of this package. PACKAGE_NAME='open-vm-tools' PACKAGE_TARNAME='open-vm-tools' -PACKAGE_VERSION='2008.01.23-74039' -PACKAGE_STRING='open-vm-tools 2008.01.23-74039' +PACKAGE_VERSION='2008.10.10-123053' +PACKAGE_STRING='open-vm-tools 2008.10.10-123053' PACKAGE_BUGREPORT='open-vm-tools-devel@lists.sourceforge.net' ac_unique_file="checkvm/checkvm.c" @@ -853,61 +848,92 @@ am__fastdepCC_TRUE am__fastdepCC_FALSE CPP -SED -GREP -EGREP -LN_S -ECHO -AR -RANLIB CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE -CXXCPP -F77 -FFLAGS -ac_ct_F77 +SED +LN_S LIBTOOL +GREP +EGREP +FGREP +LD +DUMPBIN +ac_ct_DUMPBIN +NM +AR +RANLIB +lt_ECHO +DSYMUTIL +NMEDIT +CXXCPP HAVE_PKG_CONFIG XMKMF X_CFLAGS X_PRE_LIBS X_LIBS X_EXTRA_LIBS +LIBPNG_CONFIG DNET_CONFIG +ICU_CONFIG +HAVE_CXX +RPCGEN BUILD_HGFSMOUNTER_TRUE BUILD_HGFSMOUNTER_FALSE LINUX_TRUE LINUX_FALSE SOLARIS_TRUE SOLARIS_FALSE +FREEBSD_TRUE +FREEBSD_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 +PAMD_TRUE +PAMD_FALSE +ENABLE_UNITY_TRUE +ENABLE_UNITY_FALSE +WITH_ROOT_PRIVILEGES_TRUE +WITH_ROOT_PRIVILEGES_FALSE +TARGET_OS +KERNEL_RELEASE MODULES_OS +MODULES_DIR MODULES -COMMON_CFLAGS -COMMON_PROG_CFLAGS COMMON_XLIBS -GTK_CFLAGS +GTK_CPPFLAGS GTK_LIBS -DNET_CFLAGS +DNET_CPPFLAGS DNET_LIBS -LIB_AUTH_CFLAGS -LIB_FILE_CFLAGS -LIB_HGFS_SERVER_CFLAGS -LIB_IMPERSONATE_CFLAGS -LIB_MISC_CFLAGS -LIB_PROC_MGR_CFLAGS -LIB_STRING_CFLAGS -LIB_USER_CFLAGS -GUESTD_LDFLAGS -VMWARE_USER_CFLAGS -VMWARE_USER_LDFLAGS +PROCPS_LIBS +ICU_CPPFLAGS +ICU_LIBS +PAM_PREFIX +URIPARSER_CPPFLAGS +URIPARSER_LIBS +LIBPNG_CPPFLAGS +LIBPNG_LIBS +ZLIB_CPPFLAGS +ZLIB_LIBS +LIB_AUTH_CPPFLAGS +LIB_FILE_CPPFLAGS +LIB_HGFS_SERVER_CPPFLAGS +LIB_IMPERSONATE_CPPFLAGS +LIB_MISC_CPPFLAGS +LIB_PROC_MGR_CPPFLAGS +LIB_STRING_CPPFLAGS +LIB_USER_CPPFLAGS +GUESTD_LDADD +VMWARE_USER_CPPFLAGS +VMWARE_USER_LDADD LIBOBJS LTLIBOBJS' ac_subst_files='' @@ -924,8 +950,6 @@ CXXFLAGS CCC CXXCPP -F77 -FFLAGS XMKMF' @@ -1429,7 +1453,7 @@ # 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 2008.01.23-74039 to adapt to many kinds of systems. +\`configure' configures open-vm-tools 2008.10.10-123053 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1503,14 +1527,15 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of open-vm-tools 2008.01.23-74039:";; + short | recursive ) echo "Configuration of open-vm-tools 2008.10.10-123053:";; 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-multimon disables multimon, enabled by default + --disable-unity disables Unity, enabled by default --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] @@ -1522,11 +1547,26 @@ Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-gnu-ld assume the C compiler uses GNU ld [default=no] + --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 (falls back on Gtk 1.2) --with-pic try to use only PIC/non-PIC objects [default=use both] - --with-tags[=TAGS] include additional configurations [automatic] + --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-x use the X Window System + --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 @@ -1540,8 +1580,6 @@ CXX C++ compiler command CXXFLAGS C++ compiler flags CXXCPP C++ preprocessor - F77 Fortran 77 compiler command - FFLAGS Fortran 77 compiler flags XMKMF Path to xmkmf, Makefile generator for X Window System Use these variables to override the choices made by `configure' or to help @@ -1608,7 +1646,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -open-vm-tools configure 2008.01.23-74039 +open-vm-tools configure 2008.10.10-123053 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1622,7 +1660,7 @@ 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 2008.01.23-74039, which was +It was created by open-vm-tools $as_me 2008.10.10-123053, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -1997,8 +2035,10 @@ # 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 "$srcdir" "$srcdir/.." "$srcdir/../.."; do +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" @@ -2014,8 +2054,8 @@ fi done if test -z "$ac_aux_dir"; then - { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 -echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} + { { 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 @@ -2028,6 +2068,8 @@ 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 @@ -2173,11 +2215,51 @@ ;; 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="`uname -r | cut -f1 -d. | cut -f1 -d-`" - minor_version="`uname -r | cut -f2 -d. | cut -f1 -d-`" - micro_version="`uname -r | cut -f3 -d. | cut -f1 -d-`" + 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 } @@ -2197,15 +2279,49 @@ ;; esac osVersion="`getOsVersion`" +if test "$os" = "linux"; then + if test "$with_kernel_modules" = "yes"; then + 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 + fi +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; MULTIMON_ENABLED="$enableval" + enableval=$enable_multimon; enable_multimon="$enableval" +else + enable_multimon="yes" +fi + + +# Check whether --enable-unity was given. +if test "${enable_unity+set}" = set; then + enableval=$enable_unity; enable_unity="$enableval" +else + enable_unity="yes" +fi + + + +# Check whether --with-gtk2 was given. +if test "${with_gtk2+set}" = set; then + withval=$with_gtk2; with_gtk2="$withval" else - MULTIMON_ENABLED="yes" + with_gtk2="yes" fi +# If we're not going to use Gtk 2.0, disable Unity. It may be possible to +# get Unity working with Gtk 1.2 (it used to in the past), but that will +# require a great deal of work. +if test "$with_gtk2" != "yes"; then + enable_unity="no" +fi + am__api_version='1.10' # Find a good install program. We prefer a C program (faster), @@ -2512,7 +2628,7 @@ # Define the identity of the package. PACKAGE='open-vm-tools' - VERSION='2008.01.23-74039' + VERSION='2008.10.10-123053' cat >>confdefs.h <<_ACEOF @@ -2664,11 +2780,22 @@ ### # These need to be declared after initialization. -CFLAGS="$CFLAGS -DUSING_AUTOCONF=1" +# 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" ### ### Programs ### +# C preprocessor and compiler. DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" @@ -4772,904 +4899,503 @@ fi -# 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 + +# 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 - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + 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=. - # 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 + 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 - 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' - -# Needed for creating the archives in lib/ and the shared libraries. -# 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 +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + { echo "$as_me:$LINENO: result: $CXX" >&5 +echo "${ECHO_T}$CXX" >&6; } else - enable_shared=yes + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } 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 + test -n "$CXX" && break + done fi - - -# 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 - - -{ echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 -echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6; } -if test "${lt_cv_path_SED+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # Loop through the user's path and test for sed and gsed. -# Then use that list of sed's as ones to test for truncation. -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH +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 - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for lt_ac_prog in sed gsed; do - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then - lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" - fi - done - done -done -IFS=$as_save_IFS -lt_ac_max=0 -lt_ac_count=0 -# Add /usr/xpg4/bin/sed as it is typically found on Solaris -# along with /bin/sed that truncates output. -for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do - test ! -f $lt_ac_sed && continue - cat /dev/null > conftest.in - lt_ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >conftest.in - # Check for GNU sed and select it if it is found. - if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then - lt_cv_path_SED=$lt_ac_sed - break - fi - while true; do - cat conftest.in conftest.in >conftest.tmp - mv conftest.tmp conftest.in - cp conftest.in conftest.nl - echo >>conftest.nl - $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break - cmp -s conftest.out conftest.nl || break - # 10000 chars as input seems more than enough - test $lt_ac_count -gt 10 && break - lt_ac_count=`expr $lt_ac_count + 1` - if test $lt_ac_count -gt $lt_ac_max; then - lt_ac_max=$lt_ac_count - lt_cv_path_SED=$lt_ac_sed - fi - done -done - -fi - -SED=$lt_cv_path_SED - -{ echo "$as_me:$LINENO: result: $SED" >&5 -echo "${ECHO_T}$SED" >&6; } - -{ echo "$as_me:$LINENO: checking for 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 + # 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 - # 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 + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. 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 +for as_dir in $PATH 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 + 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 - -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 - +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 - ac_cv_path_GREP=$GREP -fi - - + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } 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 - + test -n "$ac_ct_CXX" && break done -IFS=$as_save_IFS - + 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 -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 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 - ac_cv_path_EGREP=$EGREP -fi + 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 - 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" - - - -# 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 + ; + 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 - with_gnu_ld=no + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_compiler_gnu=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; } +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + fi -if test "${lt_cv_path_LD+set}" = set; then +{ 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 - 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 conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -LD="$lt_cv_path_LD" -if test -n "$LD"; then - { echo "$as_me:$LINENO: result: $LD" >&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 +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 - # I'd rather use --version here, but apparently some GNU lds only accept -v. -case `$LD -v 2>&1 &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 -fi -{ echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5 -echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; } -with_gnu_ld=$lt_cv_prog_gnu_ld +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. */ -{ 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 +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 - lt_cv_ld_reload_flag='-r' + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + fi -{ echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 -echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6; } -reload_flag=$lt_cv_ld_reload_flag -case $reload_flag in -"" | " "*) ;; -*) reload_flag=" $reload_flag" ;; -esac -reload_cmds='$LD$reload_flag -o $output$reload_objs' -case $host_os in - darwin*) - if test "$GCC" = yes; then - reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' - else - reload_cmds='$LD$reload_flag -o $output$reload_objs' - fi - ;; -esac -{ echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5 -echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6; } -if test "${lt_cv_path_NM+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$NM"; then - # Let the user override the test. - lt_cv_path_NM="$NM" -else - lt_nm_to_check="${ac_tool_prefix}nm" - if test -n "$ac_tool_prefix" && test "$build" = "$host"; then - lt_nm_to_check="$lt_nm_to_check nm" - fi - for lt_tmp_nm in $lt_nm_to_check; do - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - tmp_nm="$ac_dir/$lt_tmp_nm" - if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then - # Check to see if the nm accepts a BSD-compat flag. - # Adding the `sed 1q' prevents false positives on HP-UX, which says: - # nm: unknown option "B" ignored - # Tru64's nm complains that /dev/null is an invalid object file - case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in - */dev/null* | *'Invalid file or object type'*) - lt_cv_path_NM="$tmp_nm -B" - break - ;; - *) - case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in - */dev/null*) - lt_cv_path_NM="$tmp_nm -p" - break - ;; - *) - lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but - continue # so that we can try to find one that supports BSD flags - ;; - esac - ;; - esac - fi - done - IFS="$lt_save_ifs" - done - test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm +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: $lt_cv_path_NM" >&5 -echo "${ECHO_T}$lt_cv_path_NM" >&6; } -NM="$lt_cv_path_NM" -{ 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; } +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 - { echo "$as_me:$LINENO: result: no, using $LN_S" >&5 -echo "${ECHO_T}no, using $LN_S" >&6; } + 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 -{ echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5 -echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6; } -if test "${lt_cv_deplibs_check_method+set}" = set; then +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 - 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. + 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 -case $host_os in -aix4* | aix5*) - lt_cv_deplibs_check_method=pass_all - ;; + 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 -beos*) - lt_cv_deplibs_check_method=pass_all - ;; + 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 -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 - ;; + cd .. + rm -rf conftest.dir +else + am_cv_CXX_dependencies_compiler_type=none +fi -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' - ;; +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 -mingw* | pw32*) - # Base MSYS/MinGW do not provide the 'file' command needed by - # func_win32_libid shell function, so use a weaker test based on 'objdump'. - lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' - lt_cv_file_magic_cmd='$OBJDUMP -f' - ;; + 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 -darwin* | rhapsody*) - lt_cv_deplibs_check_method=pass_all - ;; -freebsd* | kfreebsd*-gnu | dragonfly*) - if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then - case $host_cpu in - i*86 ) - # Not sure whether the presence of OpenBSD here was a mistake. - # Let's accept both of them until this is cleared up. - lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` - ;; - esac - else - lt_cv_deplibs_check_method=pass_all - fi - ;; -gnu*) - lt_cv_deplibs_check_method=pass_all - ;; - -hpux10.20* | hpux11*) - lt_cv_file_magic_cmd=/usr/bin/file - case $host_cpu in - ia64*) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' - lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so - ;; - hppa*64*) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' - lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl - ;; - *) - lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' - lt_cv_file_magic_test_file=/usr/lib/libc.sl - ;; - esac - ;; - -interix3*) - # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' - ;; - -irix5* | irix6* | nonstopux*) - case $LD in - *-32|*"-32 ") libmagic=32-bit;; - *-n32|*"-n32 ") libmagic=N32;; - *-64|*"-64 ") libmagic=64-bit;; - *) libmagic=never-match;; - esac - lt_cv_deplibs_check_method=pass_all - ;; - -# This must be Linux ELF. -linux*) - lt_cv_deplibs_check_method=pass_all - ;; - -netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' - fi - ;; - -newos6*) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' - lt_cv_file_magic_cmd=/usr/bin/file - lt_cv_file_magic_test_file=/usr/lib/libnls.so - ;; - -nto-qnx*) - lt_cv_deplibs_check_method=unknown - ;; - -openbsd*) - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' - else - lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' - fi - ;; - -osf3* | osf4* | osf5*) - lt_cv_deplibs_check_method=pass_all - ;; - -solaris*) - lt_cv_deplibs_check_method=pass_all - ;; - -sysv4 | sysv4.3*) - case $host_vendor in - motorola) - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' - lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` - ;; - ncr) - lt_cv_deplibs_check_method=pass_all - ;; - sequent) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' - ;; - sni) - lt_cv_file_magic_cmd='/bin/file' - lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" - lt_cv_file_magic_test_file=/lib/libc.so - ;; - siemens) - lt_cv_deplibs_check_method=pass_all - ;; - pc) - lt_cv_deplibs_check_method=pass_all - ;; - esac - ;; - -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - lt_cv_deplibs_check_method=pass_all - ;; -esac - -fi -{ echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 -echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6; } -file_magic_cmd=$lt_cv_file_magic_cmd -deplibs_check_method=$lt_cv_deplibs_check_method -test -z "$deplibs_check_method" && deplibs_check_method=unknown - - - - -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} - -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} - -# Allow CC to be a program name with arguments. -compiler=$CC - - -# Check whether --enable-libtool-lock 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 5571 "configure"' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - if test "$lt_cv_prog_gnu_ld" = yes; then - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -melf32bsmip" - ;; - *N32*) - LD="${LD-ld} -melf32bmipn32" - ;; - *64-bit*) - LD="${LD-ld} -melf64bmip" - ;; - esac - else - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -32" - ;; - *N32*) - LD="${LD-ld} -n32" - ;; - *64-bit*) - LD="${LD-ld} -64" - ;; - esac - fi - fi - rm -rf conftest* - ;; - -x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - case `/usr/bin/file conftest.o` in - *32-bit*) - case $host in - x86_64-*linux*) - LD="${LD-ld} -m elf_i386" - ;; - ppc64-*linux*|powerpc64-*linux*) - LD="${LD-ld} -m elf32ppclinux" - ;; - s390x-*linux*) - LD="${LD-ld} -m elf_s390" - ;; - sparc64-*linux*) - LD="${LD-ld} -m elf32_sparc" - ;; - esac - ;; - *64-bit*) - case $host in - x86_64-*linux*) - LD="${LD-ld} -m elf_x86_64" - ;; - ppc*-*linux*|powerpc*-*linux*) - LD="${LD-ld} -m elf64ppc" - ;; - s390*-*linux*) - LD="${LD-ld} -m elf64_s390" - ;; - sparc*-*linux*) - LD="${LD-ld} -m elf64_sparc" - ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; - -*-*-sco3.2v5*) - # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -belf" - { echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 -echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6; } -if test "${lt_cv_cc_needs_belf+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +# 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 () @@ -5679,216 +5405,55 @@ return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in +# 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_link") 2>conftest.er1 + (eval "$ac_try") 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 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 - ;; -sparc*-*solaris*) - # Find out which ABI we are using. - echo 'int i;' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + (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 - case `/usr/bin/file conftest.o` in - *64-bit*) - case $lt_cv_prog_gnu_ld in - yes*) LD="${LD-ld} -m elf64_sparc" ;; - *) LD="${LD-ld} -64" ;; - esac - ;; - esac - fi - rm -rf conftest* - ;; - - -esac - -need_locks="$enable_libtool_lock" - - - -{ 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 + (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_compile") 2>conftest.er1 + (eval "$ac_try") 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 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 + (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_link") 2>&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in + (exit $ac_status); } && + test -f conftest2.$ac_objext && { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac @@ -5896,968 +5461,838 @@ (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : + (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 - 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 + eval ac_cv_prog_cc_${ac_cc}_c_o=no fi +rm -f core conftest* - -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 +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 STDC_HEADERS 1 +#define NO_MINUS_C_MINUS_O 1 _ACEOF fi -# On IRIX 5.3, sys/types and inttypes.h are conflicting. +# 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' -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 "$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 - 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" + 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 - 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 + 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 -fi + $ac_path_SED_found && break 3 + done done +done +IFS=$as_save_IFS -for ac_header in dlfcn.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 +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 -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_cv_path_SED=$SED +fi - ac_header_preproc=no 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 -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ 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 -# 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 "$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 - 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; } + 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 `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF + 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; } -done -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 +# 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.2' +macro_revision='1.2599' + + + + + + + + + + + + + +ltmain="$ac_aux_dir/ltmain.sh" + +{ 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 - if test -n "$CXX"; then - ac_cv_prog_CXX="$CXX" # Let the user override the test. + 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 - 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 + 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 -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; } + ac_cv_path_SED=$SED 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 "$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 - if test -n "$ac_ct_CXX"; then - ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. + # 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 +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 - 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 + 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 -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; } + ac_cv_path_GREP=$GREP 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 +{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 +echo "${ECHO_T}$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" - 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 "$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 - 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 + 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 - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + 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_compiler_gnu=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + $ac_path_EGREP_found && break 3 + done +done + +done +IFS=$as_save_IFS + 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 () -{ +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 - ; - 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 + ac_cv_path_EGREP=$EGREP +fi - 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 () -{ + 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" - ; - 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 - : + +{ 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 - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + 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_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 () -{ + $ac_path_FGREP_found && break 3 + done +done - ; - 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 +done +IFS=$as_save_IFS fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +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 -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + ac_cv_path_FGREP=$FGREP fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_cxx_werror_flag=$ac_save_cxx_werror_flag + + fi 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=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: result: $ac_cv_path_FGREP" >&5 +echo "${ECHO_T}$ac_cv_path_FGREP" >&6; } + FGREP="$ac_cv_path_FGREP" -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 +test -z "$GREP" && GREP=grep - 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 -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 + + +# 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 - ac_cv_prog_CXXCPP=$CXXCPP + with_gnu_ld=no 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 +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 - -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 +if test "${lt_cv_path_LD+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break + 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: 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;} + { 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 -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 -fi -ac_ext=f -ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' -ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_f77_compiler_gnu -if test -n "$ac_tool_prefix"; then - for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn + + + + + + +{ 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 "$ac_tool_prefix"; then + for ac_prog in "dumpbin -symbols" "link -dump -symbols" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_F77+set}" = set; then +if test "${ac_cv_prog_DUMPBIN+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test -n "$F77"; then - ac_cv_prog_F77="$F77" # Let the user override the test. + 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 @@ -6866,7 +6301,7 @@ 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_F77="$ac_tool_prefix$ac_prog" + 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 @@ -6876,32 +6311,32 @@ fi fi -F77=$ac_cv_prog_F77 -if test -n "$F77"; then - { echo "$as_me:$LINENO: result: $F77" >&5 -echo "${ECHO_T}$F77" >&6; } +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 "$F77" && break + test -n "$DUMPBIN" && break done fi -if test -z "$F77"; then - ac_ct_F77=$F77 - for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgf95 lf95 ftn +if test -z "$DUMPBIN"; then + ac_ct_DUMPBIN=$DUMPBIN + for ac_prog in "dumpbin -symbols" "link -dump -symbols" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_F77+set}" = set; then +if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test -n "$ac_ct_F77"; then - ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test. + 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 @@ -6910,7 +6345,7 @@ 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_F77="$ac_prog" + ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -6920,21 +6355,21 @@ fi fi -ac_ct_F77=$ac_cv_prog_ac_ct_F77 -if test -n "$ac_ct_F77"; then - { echo "$as_me:$LINENO: result: $ac_ct_F77" >&5 -echo "${ECHO_T}$ac_ct_F77" >&6; } +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_F77" && break + test -n "$ac_ct_DUMPBIN" && break done - if test "x$ac_ct_F77" = x; then - F77="" + if test "x$ac_ct_DUMPBIN" = x; then + DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) @@ -6946,165 +6381,44 @@ configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac - F77=$ac_ct_F77 + DUMPBIN=$ac_ct_DUMPBIN fi fi -# Provide some information about the compiler. -echo "$as_me:$LINENO: checking for Fortran 77 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); } -rm -f a.out + if test "$DUMPBIN" != ":"; then + NM="$DUMPBIN" + fi +fi +test -z "$NM" && NM=nm -# If we don't use `.F' as extension, the preprocessor is not run on the -# input file. (Note that this only needs to work for GNU compilers.) -ac_save_ext=$ac_ext -ac_ext=F -{ echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6; } -if test "${ac_cv_f77_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF - program main -#ifndef __GNUC__ - choke me -#endif - - end -_ACEOF -rm -f conftest.$ac_objext -if { (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_f77_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_f77_compiler_gnu=$ac_compiler_gnu - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6; } -ac_ext=$ac_save_ext -ac_test_FFLAGS=${FFLAGS+set} -ac_save_FFLAGS=$FFLAGS -FFLAGS= -{ echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5 -echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6; } -if test "${ac_cv_prog_f77_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - FFLAGS=-g -cat >conftest.$ac_ext <<_ACEOF - program main - end -_ACEOF -rm -f conftest.$ac_objext -if { (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_f77_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_f77_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_prog_f77_g=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5 -echo "${ECHO_T}$ac_cv_prog_f77_g" >&6; } -if test "$ac_test_FFLAGS" = set; then - FFLAGS=$ac_save_FFLAGS -elif test $ac_cv_prog_f77_g = yes; then - if test "x$ac_cv_f77_compiler_gnu" = xyes; then - FFLAGS="-g -O2" - else - FFLAGS="-g" - fi -else - if test "x$ac_cv_f77_compiler_gnu" = xyes; then - FFLAGS="-O2" - else - FFLAGS= +{ 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:6407: $ac_compile\"" >&5) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&5 + (eval echo "\"\$as_me:6410: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) + cat conftest.err >&5 + (eval echo "\"\$as_me:6413: 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 - -G77=`test $ac_compiler_gnu = yes && echo yes` -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - -# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers! +{ 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 @@ -7186,30 +6500,41 @@ 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/.*[ ]//'` + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) - # If test is not a shell built-in, we'll probably end up computing a - # maximum length that is only half of the actual maximum length, but - # we can't tell. - SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} - while (test "X"`$SHELL $0 --fallback-echo "X$teststring" 2>/dev/null` \ - = "XX$teststring") >/dev/null 2>&1 && - new_result=`expr "X$teststring" : ".*" 2>&1` && - lt_cv_sys_max_cmd_len=$new_result && - test $i != 17 # 1/2 MB should be enough - do - i=`expr $i + 1` - teststring=$teststring$teststring - done - teststring= - # Add a significant safety factor because C++ compilers can tack on massive - # amounts of additional arguments before passing them to the linker. - # It appears as though 1/2 is a usable value. - lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` + 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"`$SHELL $0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ + = "XX$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 @@ -7222,286 +6547,311 @@ { echo "$as_me:$LINENO: result: none" >&5 echo "${ECHO_T}none" >&6; } fi +max_cmd_len=$lt_cv_sys_max_cmd_len -# 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]*\)' +: ${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"}, \ + = c,a/b,, ) >/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; } -# Transform an extracted symbol line into a proper C declaration -lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'" -# Transform an extracted symbol line into symbol name and symbol address -lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi -# Define system-specific variables. -case $host_os in -aix*) - symcode='[BCDT]' - ;; -cygwin* | mingw* | pw32*) - symcode='[ABCDGISTW]' - ;; -hpux*) # Its linker distinguishes data from code symbols - if test "$host_cpu" = ia64; then - symcode='[ABCDEGRST]' - fi - lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - ;; -linux*) - if test "$host_cpu" = ia64; then - symcode='[ABCDGIRSTW]' - lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" - lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'" - fi - ;; -irix* | nonstopux*) - symcode='[BCDEGRST]' - ;; -osf*) - symcode='[BCDEGQRST]' - ;; -solaris*) - symcode='[BDRT]' - ;; -sco3.2v5*) - symcode='[DT]' - ;; -sysv4.2uw2*) - symcode='[DT]' - ;; -sysv5* | sco5v6* | unixware* | OpenUNIX*) - symcode='[ABDT]' + + + + +# 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' ;; -sysv4) - symcode='[DFNSTU]' + *) # EBCDIC based system + lt_SP2NL='tr \100 \n' + lt_NL2SP='tr \r\n \100\100' ;; esac -# Handle CRLF in mingw tool chain -opt_cr= -case $build_os in -mingw*) - opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp - ;; -esac -# If we're using GNU nm, then use its standard symbol codes. -case `$NM -V 2>&1` in -*GNU* | *'with BFD'*) - symcode='[ABCDGIRSTW]' ;; -esac -# Try without a prefix undercore, then with it. -for ac_symprfx in "" "_"; do - # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. - symxfrm="\\1 $ac_symprfx\\2 \\2" - # Write the raw and C identifiers. - lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" - # Check to see that the pipe works correctly. - pipe_works=no - rm -f conftest* - cat > conftest.$ac_ext <&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # Now try to grab the symbols. - nlist=conftest.nm - if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5 - (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && test -s "$nlist"; then - # Try sorting and uniquifying the output. - if sort "$nlist" | uniq > "$nlist"T; then - mv -f "$nlist"T "$nlist" - else - rm -f "$nlist"T - fi - # Make sure that we snagged all the symbols we need. - if grep ' nm_test_var$' "$nlist" >/dev/null; then - if grep ' nm_test_func$' "$nlist" >/dev/null; then - cat < conftest.$ac_ext -#ifdef __cplusplus -extern "C" { -#endif +{ echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 +echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6; } +if test "${lt_cv_ld_reload_flag+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + lt_cv_ld_reload_flag='-r' +fi +{ echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 +echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6; } +reload_flag=$lt_cv_ld_reload_flag +case $reload_flag in +"" | " "*) ;; +*) reload_flag=" $reload_flag" ;; +esac +reload_cmds='$LD$reload_flag -o $output$reload_objs' +case $host_os in + darwin*) + if test "$GCC" = yes; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi + ;; +esac -EOF - # Now generate the symbol file. - eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext' - cat <> conftest.$ac_ext -#if defined (__STDC__) && __STDC__ -# define lt_ptr_t void * -#else -# define lt_ptr_t char * -# define const -#endif -/* The mapping between symbol names and symbols. */ -const struct { - const char *name; - lt_ptr_t address; -} -lt_preloaded_symbols[] = -{ -EOF - $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext - cat <<\EOF >> conftest.$ac_ext - {0, (lt_ptr_t) 0} -}; -#ifdef __cplusplus -} -#endif -EOF - # Now try linking the two files. - mv conftest.$ac_objext conftstm.$ac_objext - lt_save_LIBS="$LIBS" - lt_save_CFLAGS="$CFLAGS" - LIBS="conftstm.$ac_objext" - CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && test -s conftest${ac_exeext}; then - pipe_works=yes - fi - LIBS="$lt_save_LIBS" - CFLAGS="$lt_save_CFLAGS" - else - echo "cannot find nm_test_func in $nlist" >&5 - fi - else - echo "cannot find nm_test_var in $nlist" >&5 - fi - else - echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 - fi - else - echo "$progname: failed program was:" >&5 - cat conftest.$ac_ext >&5 - fi - rm -f conftest* conftst* - # Do not use the global_symbol_pipe unless it works. - if test "$pipe_works" = yes; then - break - else - lt_cv_sys_global_symbol_pipe= - fi -done -fi -if test -z "$lt_cv_sys_global_symbol_pipe"; then - lt_cv_sys_global_symbol_to_cdecl= -fi -if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then - { echo "$as_me:$LINENO: result: failed" >&5 -echo "${ECHO_T}failed" >&6; } -else - { echo "$as_me:$LINENO: result: ok" >&5 -echo "${ECHO_T}ok" >&6; } -fi -{ echo "$as_me:$LINENO: checking for objdir" >&5 -echo $ECHO_N "checking for objdir... $ECHO_C" >&6; } -if test "${lt_cv_objdir+set}" = set; then + + +{ echo "$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 - 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 + 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' + ;; -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 +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. + if ( 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 + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +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 + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +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 Linux ELF. +linux* | k*bsd*-gnu) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +*nto* | *qnx*) + lt_cv_deplibs_check_method=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 -# 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' +fi +{ echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 +echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6; } +file_magic_cmd=$lt_cv_file_magic_cmd +deplibs_check_method=$lt_cv_deplibs_check_method +test -z "$deplibs_check_method" && deplibs_check_method=unknown + + + + + -# Same as above, but do not quote variable references. -double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g' -# Sed substitution to delay expansion of an escaped shell variable in a -# double_quote_subst'ed string. -delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' -# Sed substitution to avoid accidental globbing in evaled expressions -no_glob_subst='s/\*/\\\*/g' -# Constants: -rm="rm -f" -# Global variables: -default_ofile=libtool -can_build_shared=yes -# All known linkers require a `.a' archive for static linking (except MSVC, -# which needs '.lib'). -libext=a -ltmain="$ac_aux_dir/ltmain.sh" -ofile="$default_ofile" -with_gnu_ld="$lt_cv_prog_gnu_ld" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. @@ -7599,16 +6949,29 @@ AR="$ac_cv_prog_AR" fi +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru + + + + + + + + + + + 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 + # 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_RANLIB+set}" = set; then +if test "${ac_cv_prog_STRIP+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. + 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 @@ -7617,7 +6980,7 @@ 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" + ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -7627,10 +6990,10 @@ fi fi -RANLIB=$ac_cv_prog_RANLIB -if test -n "$RANLIB"; then - { echo "$as_me:$LINENO: result: $RANLIB" >&5 -echo "${ECHO_T}$RANLIB" >&6; } +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; } @@ -7638,17 +7001,17 @@ 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 +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_RANLIB+set}" = set; then +if test "${ac_cv_prog_ac_ct_STRIP+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. + 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 @@ -7657,7 +7020,7 @@ 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" + ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -7667,17 +7030,17 @@ 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; } +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_RANLIB" = x; then - RANLIB=":" + if test "x$ac_ct_STRIP" = x; then + STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) @@ -7689,22 +7052,29 @@ configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac - RANLIB=$ac_ct_RANLIB + STRIP=$ac_ct_STRIP fi else - RANLIB="$ac_cv_prog_RANLIB" + 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}strip", so it can be a program name with args. -set dummy ${ac_tool_prefix}strip; ac_word=$2 + # 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_STRIP+set}" = set; then +if test "${ac_cv_prog_RANLIB+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. + 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 @@ -7713,7 +7083,7 @@ 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" + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -7723,10 +7093,10 @@ fi fi -STRIP=$ac_cv_prog_STRIP -if test -n "$STRIP"; then - { echo "$as_me:$LINENO: result: $STRIP" >&5 -echo "${ECHO_T}$STRIP" >&6; } +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; } @@ -7734,17 +7104,17 @@ 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 +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_STRIP+set}" = set; then +if test "${ac_cv_prog_ac_ct_RANLIB+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. + 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 @@ -7753,7 +7123,7 @@ 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" + ac_cv_prog_ac_ct_RANLIB="ranlib" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -7763,17 +7133,17 @@ 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; } +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_STRIP" = x; then - STRIP=":" + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) @@ -7785,36 +7155,21 @@ configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac - STRIP=$ac_ct_STRIP + RANLIB=$ac_ct_RANLIB fi else - STRIP="$ac_cv_prog_STRIP" + RANLIB="$ac_cv_prog_RANLIB" fi +test -z "$RANLIB" && RANLIB=: + + + -old_CC="$CC" -old_CFLAGS="$CFLAGS" -# Set sane defaults for various variables -test -z "$AR" && AR=ar -test -z "$AR_FLAGS" && AR_FLAGS=cru -test -z "$AS" && AS=as -test -z "$CC" && CC=cc -test -z "$LTCC" && LTCC=$CC -test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS -test -z "$DLLTOOL" && DLLTOOL=dlltool -test -z "$LD" && LD=ld -test -z "$LN_S" && LN_S="ln -s" -test -z "$MAGIC_CMD" && MAGIC_CMD=file -test -z "$NM" && NM=nm -test -z "$SED" && SED=sed -test -z "$OBJDUMP" && OBJDUMP=objdump -test -z "$RANLIB" && RANLIB=: -test -z "$STRIP" && STRIP=: -test -z "$ac_objext" && ac_objext=o # Determine commands to create old-style static archives. -old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs' +old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= @@ -7830,1070 +7185,756 @@ old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi -for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` -# Only perform the check for file, if the check method requires it -case $deplibs_check_method in -file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - { echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 -echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6; } -if test "${lt_cv_path_MAGIC_CMD+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $MAGIC_CMD in -[\\/*] | ?:[\\/]*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; -*) - lt_save_MAGIC_CMD="$MAGIC_CMD" - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" - for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/${ac_tool_prefix}file; then - lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - $EGREP "$file_magic_regex" > /dev/null; then - : - else - cat <&2 -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org -EOF - fi ;; - esac - fi - break - fi - done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" - ;; -esac -fi -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 -echo "${ECHO_T}$MAGIC_CMD" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi -if test -z "$lt_cv_path_MAGIC_CMD"; then - if test -n "$ac_tool_prefix"; then - { echo "$as_me:$LINENO: checking for file" >&5 -echo $ECHO_N "checking for file... $ECHO_C" >&6; } -if test "${lt_cv_path_MAGIC_CMD+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $MAGIC_CMD in -[\\/*] | ?:[\\/]*) - lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. - ;; -*) - lt_save_MAGIC_CMD="$MAGIC_CMD" - lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR - ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" - for ac_dir in $ac_dummy; do - IFS="$lt_save_ifs" - test -z "$ac_dir" && ac_dir=. - if test -f $ac_dir/file; then - lt_cv_path_MAGIC_CMD="$ac_dir/file" - if test -n "$file_magic_test_file"; then - case $deplibs_check_method in - "file_magic "*) - file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` - MAGIC_CMD="$lt_cv_path_MAGIC_CMD" - if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | - $EGREP "$file_magic_regex" > /dev/null; then - : - else - cat <&2 -*** Warning: the command libtool uses to detect shared libraries, -*** $file_magic_cmd, produces output that libtool cannot recognize. -*** The result is that libtool may fail to recognize shared libraries -*** as such. This will affect the creation of libtool libraries that -*** depend on shared libraries, but programs linked with such libtool -*** libraries will work regardless of this problem. Nevertheless, you -*** may want to report the problem to your system manager and/or to -*** bug-libtool@gnu.org -EOF - fi ;; - esac - fi - break - fi - done - IFS="$lt_save_ifs" - MAGIC_CMD="$lt_save_MAGIC_CMD" - ;; -esac -fi -MAGIC_CMD="$lt_cv_path_MAGIC_CMD" -if test -n "$MAGIC_CMD"; then - { echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 -echo "${ECHO_T}$MAGIC_CMD" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - else - MAGIC_CMD=: - fi -fi - fi - ;; -esac -enable_dlopen=no -enable_win32_dll=no -# Check whether --enable-libtool-lock was given. -if test "${enable_libtool_lock+set}" = set; then - enableval=$enable_libtool_lock; -fi -test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes -# Check whether --with-pic was given. -if test "${with_pic+set}" = set; then - withval=$with_pic; pic_mode="$withval" -else - pic_mode=default -fi -test -z "$pic_mode" && pic_mode=default -# Use C for the default configuration in the libtool script -tagname= -lt_save_CC="$CC" -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -# Source file extension for C test sources. -ac_ext=c - -# Object file extension for compiled C test sources. -objext=o -objext=$objext -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;\n" -# Code to be used in simple link tests -lt_simple_link_test_code='int main(){return(0);}\n' -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} -# Allow CC to be a program name with arguments. -compiler=$CC -# save warnings/boilerplate of simple test code -ac_outfile=conftest.$ac_objext -printf "$lt_simple_compile_test_code" >conftest.$ac_ext -eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_compiler_boilerplate=`cat conftest.err` -$rm conftest* -ac_outfile=conftest.$ac_objext -printf "$lt_simple_link_test_code" >conftest.$ac_ext -eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_linker_boilerplate=`cat conftest.err` -$rm conftest* -lt_prog_compiler_no_builtin_flag= -if test "$GCC" = yes; then - lt_prog_compiler_no_builtin_flag=' -fno-builtin' +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} -{ echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 -echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; } -if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_prog_compiler_rtti_exceptions=no - ac_outfile=conftest.$ac_objext - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="-fno-rtti -fno-exceptions" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:8072: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:8076: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_rtti_exceptions=yes - fi - fi - $rm conftest* +# Allow CC to be a program name with arguments. +compiler=$CC -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" +# 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 - : -fi -fi +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] -lt_prog_compiler_wl= -lt_prog_compiler_pic= -lt_prog_compiler_static= +# Character class describing NM global symbol codes. +symcode='[BCDEGRST]' -{ 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; } +# Regexp to match symbols that can be accessed directly from C. +sympat='\([_A-Za-z][_A-Za-z0-9]*\)' - if test "$GCC" = yes; then - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_static='-static' +# Define system-specific variables. +case $host_os in +aix*) + symcode='[BCDT]' + ;; +cygwin* | mingw* | pw32*) + 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 - 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 - ;; +# If we're using GNU nm, then use its standard symbol codes. +case `$NM -V 2>&1` in +*GNU* | *'with BFD'*) + symcode='[ABCDGIRSTW]' ;; +esac - amigaos*) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' - ;; +# 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'" - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; +# 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'" - mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic='-DDLL_EXPORT' - ;; +# 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 - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic='-fno-common' - ;; +# Try without a prefix underscore, then with it. +for ac_symprfx in "" "_"; do - interix3*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. - ;; + # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. + symxfrm="\\1 $ac_symprfx\\2 \\2" - 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 - ;; + # 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};"\ +" /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 - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic=-Kconform_pic - fi - ;; + # Check to see that the pipe works correctly. + pipe_works=no - hpux*) - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic='-fPIC' - ;; - esac - ;; + 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 - *) - lt_prog_compiler_pic='-fPIC' - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - lt_prog_compiler_wl='-Wl,' - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static='-Bstatic' + 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 - lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' + rm -f "$nlist"T fi - ;; - darwin*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - case $cc_basename in - xlc*) - lt_prog_compiler_pic='-qnocommon' - lt_prog_compiler_wl='-Wl,' - ;; - esac - ;; - mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic='-DDLL_EXPORT' - ;; + # 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 +#ifdef __cplusplus +extern "C" { +#endif - 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' - ;; +_LT_EOF + # Now generate the symbol file. + eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' - irix5* | irix6* | nonstopux*) - lt_prog_compiler_wl='-Wl,' - # PIC (with -KPIC) is the default. - lt_prog_compiler_static='-non_shared' - ;; + cat <<_LT_EOF >> conftest.$ac_ext - newsos6) - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; +/* The mapping between symbol names and symbols. */ +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} +}; - linux*) - case $cc_basename in - icc* | ecc*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-static' - ;; - pgcc* | pgf77* | pgf90* | pgf95*) - # Portland Group compilers (*not* the Pentium gcc compiler, - # which looks to be a dead project) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fpic' - lt_prog_compiler_static='-Bstatic' - ;; - ccc*) - lt_prog_compiler_wl='-Wl,' - # All Alpha code is PIC. - lt_prog_compiler_static='-non_shared' - ;; - esac - ;; +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt__PROGRAM__LTX_preloaded_symbols; +} +#endif - osf3* | osf4* | osf5*) - lt_prog_compiler_wl='-Wl,' - # All OSF/1 code is PIC. - lt_prog_compiler_static='-non_shared' - ;; +#ifdef __cplusplus +} +#endif +_LT_EOF + # Now try linking the two files. + mv conftest.$ac_objext conftstm.$ac_objext + lt_save_LIBS="$LIBS" + lt_save_CFLAGS="$CFLAGS" + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS="$lt_save_LIBS" + CFLAGS="$lt_save_CFLAGS" + else + echo "cannot find nm_test_func in $nlist" >&5 + fi + else + echo "cannot find nm_test_var in $nlist" >&5 + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 + fi + else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + fi + rm -rf conftest* conftst* - solaris*) - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - case $cc_basename in - f77* | f90* | f95*) - lt_prog_compiler_wl='-Qoption ld ';; - *) - lt_prog_compiler_wl='-Wl,';; - esac - ;; + # 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 - sunos4*) - lt_prog_compiler_wl='-Qoption ld ' - lt_prog_compiler_pic='-PIC' - lt_prog_compiler_static='-Bstatic' - ;; +fi - sysv4 | sysv4.2uw2* | sysv4.3*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; +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 - sysv4*MP*) - if test -d /usr/nec ;then - lt_prog_compiler_pic='-Kconform_pic' - lt_prog_compiler_static='-Bstatic' - fi - ;; - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-KPIC' - lt_prog_compiler_static='-Bstatic' - ;; - unicos*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_can_build_shared=no - ;; - uts4*) - lt_prog_compiler_pic='-pic' - lt_prog_compiler_static='-Bstatic' - ;; - *) - lt_prog_compiler_can_build_shared=no - ;; - esac - fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic" >&6; } -# -# Check to make sure the PIC flag actually works. -# -if test -n "$lt_prog_compiler_pic"; then -{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 -echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6; } -if test "${lt_prog_compiler_pic_works+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_pic_works=no - ac_outfile=conftest.$ac_objext - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic -DPIC" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:8340: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:8344: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_pic_works=yes - fi - fi - $rm conftest* -fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6; } -if test x"$lt_prog_compiler_pic_works" = xyes; then - case $lt_prog_compiler_pic in - "" | " "*) ;; - *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; - esac -else - lt_prog_compiler_pic= - lt_prog_compiler_can_build_shared=no -fi -fi -case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - lt_prog_compiler_pic= - ;; - *) - lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" - ;; -esac -# -# Check to make sure the static flag actually works. -# -wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" -{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } -if test "${lt_prog_compiler_static_works+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_static_works=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $lt_tmp_static_flag" - printf "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The linker can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&5 - $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_static_works=yes - fi - else - lt_prog_compiler_static_works=yes - fi - fi - $rm conftest* - LDFLAGS="$save_LDFLAGS" -fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5 -echo "${ECHO_T}$lt_prog_compiler_static_works" >&6; } -if test x"$lt_prog_compiler_static_works" = xyes; then - : -else - lt_prog_compiler_static= -fi -{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 -echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } -if test "${lt_cv_prog_compiler_c_o+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_prog_compiler_c_o=no - $rm -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:8444: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:8448: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp - $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then - lt_cv_prog_compiler_c_o=yes - fi - fi - chmod u+w . 2>&5 - $rm conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files - $rm out/* && rmdir out - cd .. - rmdir conftest - $rm conftest* + + + + + +# Check whether --enable-libtool-lock was given. +if test "${enable_libtool_lock+set}" = set; then + enableval=$enable_libtool_lock; fi -{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6; } +test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes -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 +# 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 -else - need_locks=no -fi - -{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } - - runpath_var= - allow_undefined_flag= - enable_shared_with_static_runtimes=no - archive_cmds= - archive_expsym_cmds= - old_archive_From_new_cmds= - old_archive_from_expsyms_cmds= - export_dynamic_flag_spec= - whole_archive_flag_spec= - thread_safe_flag_spec= - hardcode_libdir_flag_spec= - hardcode_libdir_flag_spec_ld= - hardcode_libdir_separator= - hardcode_direct=no - hardcode_minus_L=no - hardcode_shlibpath_var=unsupported - link_all_deplibs=unknown - hardcode_automatic=no - module_cmds= - module_expsym_cmds= - always_export_symbols=no - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - include_expsyms= - # exclude_expsyms can be an extended regexp of symbols to exclude - # it will be wrapped by ` (' and `)$', so one must not match beginning or - # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', - # as well as any symbol that contains `d'. - exclude_expsyms="_GLOBAL_OFFSET_TABLE_" - # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out - # platforms (ab)use it in PIC code, but their linkers get confused if - # the symbol is explicitly referenced. Since portable code cannot - # rely on this symbol name, it's probably fine to never include it in - # preloaded symbol tables. - extract_expsyms_cmds= - # Just being paranoid about ensuring that cc_basename is set. - for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` - - case $host_os in - cygwin* | mingw* | pw32*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - if test "$GCC" != yes; then - with_gnu_ld=no + rm -rf conftest* + ;; +*-*-irix6*) + # Find out which ABI we are using. + echo '#line 7512 "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 - ;; - interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) - with_gnu_ld=yes - ;; - openbsd*) - with_gnu_ld=no - ;; - esac - - ld_shlibs=yes - if test "$with_gnu_ld" = yes; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' + fi + rm -rf conftest* + ;; - # Set some defaults for GNU ld with shared library support. These - # are reset later if shared libraries are not supported. Putting them - # here allows them to be overridden if necessary. - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' - export_dynamic_flag_spec='${wl}--export-dynamic' - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec= - fi - supports_anon_versioning=no - case `$LD -v 2>/dev/null` in - *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 - *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... - *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... - *\ 2.11.*) ;; # other 2.11 versions - *) supports_anon_versioning=yes ;; +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* + ;; - # See if GNU ld supports shared libraries. - case $host_os in - aix3* | aix4* | aix5*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - ld_shlibs=no - cat <&2 - -*** Warning: the GNU linker, at least up to release 2.9.1, is reported -*** to be unable to reliably create shared libraries on AIX. -*** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to modify your PATH -*** so that a non-GNU linker is found, and then restart. +*-*-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 -EOF - fi - ;; + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ - amigaos*) - archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes +int +main () +{ - # Samuel A. Falvo II reports - # that the semantics of dynamic libraries on AmigaOS, at least up - # to version 4, is to share data among multiple programs linked - # with the same dynamic library. Since this doesn't match the - # behavior of shared libraries on other platforms, we can't use - # them. - ld_shlibs=no - ;; + ; + 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 - 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 - ;; + lt_cv_cc_needs_belf=no +fi - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec='-L$libdir' - allow_undefined_flag=unsupported - always_export_symbols=no - enable_shared_with_static_runtimes=yes - export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' +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 - 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 +fi +{ echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 +echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6; } + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +sparc*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) LD="${LD-ld} -m elf64_sparc" ;; + *) + 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 - interix3*) - hardcode_direct=no - hardcode_shlibpath_var=no - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - export_dynamic_flag_spec='${wl}-E' - # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. - # Instead, shared libraries are loaded at an image base (0x10000000 by - # default) and relocated if they conflict, which is a slow very memory - # consuming and fragmenting process. To avoid this, we pick a random, - # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link - # time. Moving up from 0x10000000 also allows more sbrk(2) space. - archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - ;; +need_locks="$enable_libtool_lock" - linux*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - tmp_addflag= - case $cc_basename,$host_cpu in - pgcc*) # Portland Group C compiler - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag' - ;; - pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers - whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag -Mnomain' ;; - ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 - tmp_addflag=' -i_dynamic' ;; - efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 - tmp_addflag=' -i_dynamic -nofor_main' ;; - ifc* | ifort*) # Intel Fortran compiler - tmp_addflag=' -nofor_main' ;; - esac - archive_cmds='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - if test $supports_anon_versioning = yes; then - archive_expsym_cmds='$echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - $echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - fi - else - ld_shlibs=no - fi - ;; + 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 - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - fi - ;; +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 - solaris*) - if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then - ld_shlibs=no - cat <&2 -*** Warning: The releases 2.8.* of the GNU linker cannot reliably -*** create shared libraries on Solaris systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.9.1 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. +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 -EOF - elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; +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 - 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 + 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 -*** 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. + 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 -_LT_EOF - ;; - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - esac - ;; +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 - sunos4*) - archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs=no - fi - ;; - esac +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 - if test "$ld_shlibs" = no; then - runpath_var= - hardcode_libdir_flag_spec= - export_dynamic_flag_spec= - whole_archive_flag_spec= - fi +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 - # 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 - ;; + 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 - aix4* | aix5*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - if $NM -V 2>&1 | grep 'GNU' > /dev/null; then - export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - else - export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - fi - aix_use_runtimelinking=no - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[23]|aix4.[23].*|aix5*) - for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then - aix_use_runtimelinking=yes - break - fi - done - ;; - esac - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - archive_cmds='' - hardcode_direct=yes - hardcode_libdir_separator=':' - link_all_deplibs=yes - if test "$GCC" = yes; then - case $host_os in aix4.[012]|aix4.[012].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && \ - strings "$collect2name" | grep resolve_lib_name >/dev/null - then - # We have reworked collect2 - hardcode_direct=yes - else - # We have old collect2 - hardcode_direct=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - hardcode_minus_L=yes - hardcode_libdir_flag_spec='-L$libdir' - hardcode_libdir_separator= - fi - ;; - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi + + + + + + + { 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. + echo "int foo(void){return 1;}" > conftest.c + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib ${wl}-single_module conftest.c + if test -f libconftest.dylib; then + lt_cv_apple_cc_single_mod=yes + rm -rf libconftest.dylib* fi + rm conftest.c fi - - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - always_export_symbols=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - allow_undefined_flag='-berok' - # Determine the default libpath from the value encoded in an empty executable. - cat >conftest.$ac_ext <<_ACEOF +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 @@ -8926,38 +7967,72 @@ test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi + 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 -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + LDFLAGS="$save_LDFLAGS" - hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag="-z nodefs" - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an empty executable. - cat >conftest.$ac_ext <<_ACEOF +fi +{ echo "$as_me:$LINENO: result: $lt_cv_ld_exported_symbols_list" >&5 +echo "${ECHO_T}$lt_cv_ld_exported_symbols_list" >&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" != ":"; 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 () @@ -8967,14 +8042,14 @@ return 0; } _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" +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_link") 2>conftest.er1 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -8983,4427 +8058,3091 @@ (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 - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi + } && 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_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - - hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - no_undefined_flag=' ${wl}-bernotok' - allow_undefined_flag=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec='$convenience' - archive_cmds_need_lc=yes - # This is similar to how AIX traditionally builds its shared libraries. - archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - amigaos*) - archive_cmds='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - # see comment about different semantics on the GNU ld section - ld_shlibs=no - ;; +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 - bsdi[45]*) - export_dynamic_flag_spec=-rdynamic - ;; +_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* - cygwin* | mingw* | pw32*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - hardcode_libdir_flag_spec=' ' - allow_undefined_flag=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - old_archive_From_new_cmds='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds='lib /OUT:$oldlib$oldobjs$old_deplibs' - fix_srcfile_path='`cygpath -w "$srcfile"`' - enable_shared_with_static_runtimes=yes - ;; +fi - darwin* | rhapsody*) - case $host_os in - rhapsody* | darwin1.[012]) - allow_undefined_flag='${wl}-undefined ${wl}suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[012]) - allow_undefined_flag='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - ;; - 10.*) - allow_undefined_flag='${wl}-undefined ${wl}dynamic_lookup' - ;; - esac - fi - ;; - esac - archive_cmds_need_lc=no - hardcode_direct=no - hardcode_automatic=yes - hardcode_shlibpath_var=unsupported - whole_archive_flag_spec='' - link_all_deplibs=yes - if test "$GCC" = yes ; then - output_verbose_link_cmd='echo' - archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - case $cc_basename in - xlc*) - output_verbose_link_cmd='echo' - archive_cmds='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' - module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - ;; - *) - ld_shlibs=no - ;; - esac - fi - ;; +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 - dgux*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; +_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* - freebsd1*) - ld_shlibs=no - ;; +fi - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor - # support. Future versions do this automatically, but an explicit c++rt0.o - # does not break anything, and helps significantly (at the cost of a little - # extra space). - freebsd2.2*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes - hardcode_minus_L=yes - hardcode_shlibpath_var=no - ;; - - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | kfreebsd*-gnu | dragonfly*) - archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - - hpux9*) - if test "$GCC" = yes; then - archive_cmds='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - archive_cmds='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - fi - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_direct=yes +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 - # 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' - ;; +#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 - hpux10*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: +( 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 - hardcode_direct=yes - export_dynamic_flag_spec='${wl}-E' - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - fi - ;; +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 - hpux11*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - case $host_cpu in - hppa*64*) - archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - else - case $host_cpu in - hppa*64*) - archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' - hardcode_libdir_separator=: +cat >>confdefs.h <<\_ACEOF +#define STDC_HEADERS 1 +_ACEOF - case $host_cpu in - hppa*64*|ia64*) - hardcode_libdir_flag_spec_ld='+b $libdir' - hardcode_direct=no - hardcode_shlibpath_var=no - ;; - *) - hardcode_direct=yes - export_dynamic_flag_spec='${wl}-E' +fi - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L=yes - ;; - esac - fi - ;; +# On IRIX 5.3, sys/types and inttypes.h are conflicting. - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec_ld='-rpath $libdir' - fi - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - link_all_deplibs=yes - ;; - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - hardcode_libdir_flag_spec='-R$libdir' - hardcode_direct=yes - hardcode_shlibpath_var=no - ;; - newsos6) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct=yes - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - hardcode_shlibpath_var=no - ;; - openbsd*) - hardcode_direct=yes - hardcode_shlibpath_var=no - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - export_dynamic_flag_spec='${wl}-E' - else - case $host_os in - openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) - archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-R$libdir' - ;; - *) - archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec='${wl}-rpath,$libdir' - ;; - esac - fi - ;; - os2*) - hardcode_libdir_flag_spec='-L$libdir' - hardcode_minus_L=yes - allow_undefined_flag=unsupported - archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; - osf3*) - if test "$GCC" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - fi - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator=: - ;; - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' - else - allow_undefined_flag=' -expect_unresolved \*' - archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ - $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' - # Both c and cxx compiler support -rpath directly - hardcode_libdir_flag_spec='-rpath $libdir' - fi - hardcode_libdir_separator=: - ;; - solaris*) - no_undefined_flag=' -z text' - if test "$GCC" = yes; then - wlarc='${wl}' - archive_cmds='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' - else - wlarc='' - archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' - fi - hardcode_libdir_flag_spec='-R$libdir' - hardcode_shlibpath_var=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) - # The compiler driver will combine linker options so we - # cannot just pass the convience library names through - # without $wl, iff we do not link with $LD. - # Luckily, gcc supports the same syntax we need for Sun Studio. - # Supported since Solaris 2.6 (maybe 2.5.1?) - case $wlarc in - '') - whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; - *) - whole_archive_flag_spec='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; - esac ;; - esac - link_all_deplibs=yes - ;; +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 - 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 - ;; +#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 - 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 - ;; + eval "$as_ac_Header=no" +fi - sysv4.3*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var=no - export_dynamic_flag_spec='-Bexport' - ;; +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 - 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 - ;; +fi - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) - no_undefined_flag='${wl}-z,text' - archive_cmds_need_lc=no - hardcode_shlibpath_var=no - runpath_var='LD_RUN_PATH' +done - if test "$GCC" = yes; then - archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - sysv5* | sco3.2v5* | sco5v6*) - # Note: We can NOT use -z defs as we might desire, because we do not - # link with -lc, and that would cause any symbols used from libc to - # always be unresolved, which means just about no library would - # ever link correctly. If we're not using GNU ld we use -z text - # though, which does catch some bad symbols but isn't as heavy-handed - # as -z defs. - no_undefined_flag='${wl}-z,text' - allow_undefined_flag='${wl}-z,nodefs' - archive_cmds_need_lc=no - hardcode_shlibpath_var=no - hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' - hardcode_libdir_separator=':' - link_all_deplibs=yes - export_dynamic_flag_spec='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - if test "$GCC" = yes; then - archive_cmds='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; +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 - uts4*) - archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec='-L$libdir' - hardcode_shlibpath_var=no - ;; +#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 - *) - ld_shlibs=no - ;; - esac - fi + eval "$as_ac_Header=no" +fi -{ echo "$as_me:$LINENO: result: $ld_shlibs" >&5 -echo "${ECHO_T}$ld_shlibs" >&6; } -test "$ld_shlibs" = no && can_build_shared=no +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 -# -# 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 +fi - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $archive_cmds in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 -echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } - $rm conftest* - printf "$lt_simple_compile_test_code" > conftest.$ac_ext +done - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl - pic_flag=$lt_prog_compiler_pic - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag - allow_undefined_flag= - if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 - (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - then - archive_cmds_need_lc=no - else - archive_cmds_need_lc=yes - fi - allow_undefined_flag=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $rm conftest* - { echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 -echo "${ECHO_T}$archive_cmds_need_lc" >&6; } - ;; - esac - fi - ;; -esac -{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 -echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } -library_names_spec= -libname_spec='lib$name' -soname_spec= -shrext_cmds=".so" -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi -need_lib_prefix=unknown -hardcode_into_libs=no - -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown - -case $host_os in -aix3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' - shlibpath_var=LIBPATH - - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' - ;; -aix4* | aix5*) - version_type=linux - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test "$host_cpu" = ia64; then - # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH +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 - # 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 + 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 - ;; - -amigaos*) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' - ;; +done +done +IFS=$as_save_IFS -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; +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 -bsdi[45]*) - version_type=linux - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; -cygwin* | mingw* | pw32*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no + 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 - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32*) - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname~ - chmod a+x \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $rm \$dlpath' - shlibpath_overrides_runpath=yes +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 - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" - ;; - mingw*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - ;; - esac - ;; - *) - library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' - ;; - esac - dynamic_linker='Win32 ld.exe' - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; + test -n "$ac_ct_CXX" && break +done -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' - soname_spec='${libname}${release}${major}$shared_ext' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' - # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. - if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` + if test "x$ac_ct_CXX" = x; then + CXX="g++" else - sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' + 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 - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; - -dgux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -freebsd1*) - dynamic_linker=no - ;; +fi -kfreebsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='GNU ld.so' - ;; - -freebsd* | dragonfly*) - # DragonFly does not have aout. When/if they implement a new - # versioning mechanism, adjust this. - if test -x /usr/bin/objformat; then - objformat=`/usr/bin/objformat` - else - case $host_os in - freebsd[123]*) objformat=aout ;; - *) objformat=elf ;; - esac fi - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2*) - shlibpath_overrides_runpath=yes - ;; - freebsd3.[01]* | freebsdelf3.[01]*) - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ - freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - freebsd*) # from 4.6 on - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - esac - ;; - -gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - hardcode_into_libs=yes - ;; - -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - version_type=sunos - need_lib_prefix=no - need_version=no - case $host_cpu in - ia64*) - shrext_cmds='.so' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.so" - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - if test "X$HPUX_IA64_MODE" = X32; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - hppa*64*) - shrext_cmds='.sl' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.sl" - shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - *) - shrext_cmds='.sl' - dynamic_linker="$host_os dld.sl" - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - ;; - esac - # HP-UX runs *really* slowly unless shared libraries are mode 555. - postinstall_cmds='chmod 555 $lib' - ;; - -interix3*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - -irix5* | irix6* | nonstopux*) - case $host_os in - nonstopux*) version_type=nonstopux ;; - *) - if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux - else - version_type=irix - fi ;; - esac - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' - case $host_os in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" - hardcode_into_libs=yes - ;; +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); } -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no - ;; +{ 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. */ -# This must be Linux ELF. -linux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes +int +main () +{ +#ifndef __GNUC__ + choke me +#endif - # find out which ABI we are using - libsuff= - case "$host_cpu" in - x86_64*|s390x*|powerpc64*) - echo '#line 9909 "configure"' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 + ; + 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); }; then - case `/usr/bin/file conftest.$ac_objext` in - *64-bit*) - libsuff=64 - sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" - ;; - esac - fi - rm -rf conftest* - ;; - esac - - # Append ld.so.conf contents to the search path - if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" - fi + (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 - # 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' - ;; + ac_compiler_gnu=no +fi -knetbsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='GNU ld.so' - ;; +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu -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 - ;; +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. */ -newsos6) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; +int +main () +{ -nto-qnx*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; + ; + 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 -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 - ;; + CXXFLAGS="" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -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 - ;; +int +main () +{ -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" - ;; + ; + 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 -solaris*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; + 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. */ -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 - ;; +int +main () +{ -sysv4 | sysv4.3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - export_dynamic_flag_spec='${wl}-Blargedynsym' - runpath_var=LD_RUN_PATH - ;; - siemens) - need_lib_prefix=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; + ; + 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 -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux - library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - version_type=freebsd-elf - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - hardcode_into_libs=yes - if test "$with_gnu_ld" = yes; then - sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' - shlibpath_overrides_runpath=no - else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - shlibpath_overrides_runpath=yes - case $host_os in - sco3.2v5*) - sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" - ;; - esac - fi - sys_lib_dlsearch_path_spec='/usr/lib' - ;; - -uts4*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; - -*) - dynamic_linker=no - ;; -esac -{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5 -echo "${ECHO_T}$dynamic_linker" >&6; } -test "$dynamic_linker" = no && can_build_shared=no +fi -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" +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 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 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi - # We can hardcode non-existant directories. - if test "$hardcode_direct" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, )" != no && - test "$hardcode_minus_L" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action=relink +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 - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action=immediate + CXXFLAGS="-g" fi else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action=unsupported + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi fi -{ echo "$as_me:$LINENO: result: $hardcode_action" >&5 -echo "${ECHO_T}$hardcode_action" >&6; } +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 "$hardcode_action" = relink; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi +depcc="$CXX" am_compiler_list= -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; } +{ 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 -# FIXME - insert some real tests, host_os isn't really good enough - case $host_os in - darwin*) - if test -n "$STRIP" ; then - striplib="$STRIP -x" - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } - else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - ;; - *) - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } - ;; - esac -fi + if test -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 -if test "x$enable_dlopen" != xyes; then - enable_dlopen=unknown - enable_dlopen_self=unknown - enable_dlopen_self_static=unknown + 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 - lt_cv_dlopen=no - lt_cv_dlopen_libs= + am_cv_CXX_dependencies_compiler_type=none +fi - case $host_os in - beos*) - lt_cv_dlopen="load_add_on" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes - ;; +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 - mingw* | pw32*) - lt_cv_dlopen="LoadLibrary" - lt_cv_dlopen_libs= - ;; + 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 - 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 +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 - 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" + # 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 -char dlopen (); -int -main () -{ -return dlopen (); - ; - return 0; -} + Syntax error _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" +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_link") 2>conftest.er1 + (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); } && { - test -z "$ac_c_werror_flag" || + (exit $ac_status); } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_lib_dl_dlopen=yes + }; then + : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_dl_dlopen=no + # Broken: fails on valid input. +continue 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" +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 - lt_cv_dlopen="dyld" - lt_cv_dlopen_libs= - lt_cv_dlopen_self=yes + # 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 - *) - { 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 +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. */ -/* 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; -} + Syntax error _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" +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_link") 2>conftest.er1 + (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); } && { - test -z "$ac_c_werror_flag" || + (exit $ac_status); } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_func_shl_load=yes + }; then + : else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_func_shl_load=no + # Broken: fails on valid input. +continue 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 +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. */ - -/* 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; -} +#include _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" +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_link") 2>conftest.er1 + (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); } && { - test -z "$ac_c_werror_flag" || + (exit $ac_status); } >/dev/null && { + test -z "$ac_cxx_preproc_warn_flag$ac_cxx_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 + }; then + # Broken: success on invalid input. +continue else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_dld_shl_load=no + # Passes both tests. +ac_preproc_ok=: +break 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 +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 + _lt_caught_CXX_error=yes fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 -echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6; } -if test $ac_cv_lib_dld_shl_load = yes; then - lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld" + +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 - { 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 + _lt_caught_CXX_error=yes +fi -/* 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 +# Set options - 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 + enable_dlopen=no - 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. */ + enable_win32_dll=no -/* 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 + # 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 -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS + + + + + + + + + # 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 -{ 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" + + + + + + + + + + +# Check whether --with-pic was given. +if test "${with_pic+set}" = set; then + withval=$with_pic; pic_mode="$withval" 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. */ + pic_mode=default +fi -/* 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 +test -z "$pic_mode" && pic_mode=default -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="-dld" -fi -fi -fi + # 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 -fi -fi - ;; - esac - if test "x$lt_cv_dlopen" != xno; then - enable_dlopen=yes - else - enable_dlopen=no - fi - case $lt_cv_dlopen in - dlopen) - save_CPPFLAGS="$CPPFLAGS" - test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - save_LDFLAGS="$LDFLAGS" - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" - save_LIBS="$LIBS" - LIBS="$lt_cv_dlopen_libs $LIBS" - { echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 -echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6; } -if test "${lt_cv_dlopen_self+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then : - lt_cv_dlopen_self=cross -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext < -#endif +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ltmain" -#include +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif -#ifdef __cplusplus -extern "C" void exit (int); -#endif -void fnord() { int i=42;} -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - /* dlclose (self); */ - } - else - puts (dlerror ()); - exit (status); -} -EOF - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) >&5 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; - x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; - x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; - esac - else : - # compilation failed - lt_cv_dlopen_self=no - fi -fi -rm -fr conftest* -fi -{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 -echo "${ECHO_T}$lt_cv_dlopen_self" >&6; } - if test "x$lt_cv_dlopen_self" = xyes; then - wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" - { echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 -echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6; } -if test "${lt_cv_dlopen_self_static+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then : - lt_cv_dlopen_self_static=cross -else - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext < -#endif -#include -#ifdef RTLD_GLOBAL -# define LT_DLGLOBAL RTLD_GLOBAL -#else -# ifdef DL_GLOBAL -# define LT_DLGLOBAL DL_GLOBAL -# else -# define LT_DLGLOBAL 0 -# endif -#endif -/* We may have to define LT_DLLAZY_OR_NOW in the command line if we - find out it does not work in some platform. */ -#ifndef LT_DLLAZY_OR_NOW -# ifdef RTLD_LAZY -# define LT_DLLAZY_OR_NOW RTLD_LAZY -# else -# ifdef DL_LAZY -# define LT_DLLAZY_OR_NOW DL_LAZY -# else -# ifdef RTLD_NOW -# define LT_DLLAZY_OR_NOW RTLD_NOW -# else -# ifdef DL_NOW -# define LT_DLLAZY_OR_NOW DL_NOW -# else -# define LT_DLLAZY_OR_NOW 0 -# endif -# endif -# endif -# endif -#endif -#ifdef __cplusplus -extern "C" void exit (int); -#endif -void fnord() { int i=42;} -int main () -{ - void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); - int status = $lt_dlunknown; - if (self) - { - if (dlsym (self,"fnord")) status = $lt_dlno_uscore; - else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; - /* dlclose (self); */ - } - else - puts (dlerror ()); - exit (status); -} -EOF - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then - (./conftest; exit; ) >&5 2>/dev/null - lt_status=$? - case x$lt_status in - x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; - x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; - x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; - esac - else : - # compilation failed - lt_cv_dlopen_self_static=no - fi -fi -rm -fr conftest* -fi -{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 -echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6; } - fi - - CPPFLAGS="$save_CPPFLAGS" - LDFLAGS="$save_LDFLAGS" - LIBS="$save_LIBS" - ;; - esac - - case $lt_cv_dlopen_self in - yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; - *) enable_dlopen_self=unknown ;; - esac - case $lt_cv_dlopen_self_static in - yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; - *) enable_dlopen_self_static=unknown ;; - esac -fi -# Report which library types will actually be built -{ echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 -echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6; } -{ echo "$as_me:$LINENO: result: $can_build_shared" >&5 -echo "${ECHO_T}$can_build_shared" >&6; } -{ echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 -echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6; } -test "$can_build_shared" = "no" && enable_shared=no -# On AIX, shared libraries and static libraries use the same namespace, and -# are all built from PIC. -case $host_os in -aix3*) - test "$enable_shared" = yes && enable_static=no - if test -n "$RANLIB"; then - archive_cmds="$archive_cmds~\$RANLIB \$lib" - postinstall_cmds='$RANLIB $lib' - fi - ;; -aix4* | aix5*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no - fi - ;; -esac -{ echo "$as_me:$LINENO: result: $enable_shared" >&5 -echo "${ECHO_T}$enable_shared" >&6; } +test -z "$LN_S" && LN_S="ln -s" -{ echo "$as_me:$LINENO: checking whether to build static libraries" >&5 -echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6; } -# Make sure either enable_shared or enable_static is yes. -test "$enable_shared" = yes || enable_static=yes -{ echo "$as_me:$LINENO: result: $enable_static" >&5 -echo "${ECHO_T}$enable_static" >&6; } -# The else clause should only fire when bootstrapping the -# libtool distribution, otherwise you forgot to ship ltmain.sh -# with your package, and you will get complaints that there are -# no rules to generate ltmain.sh. -if test -f "$ltmain"; then - # See if we are running on zsh, and set the options which allow our commands through - # without removal of \ escapes. - if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST - fi - # Now quote all the things that may contain metacharacters while being - # careful not to overquote the AC_SUBSTed values. We take copies of the - # variables and quote the copies for generation of the libtool script. - for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ - SED SHELL STRIP \ - libname_spec library_names_spec soname_spec extract_expsyms_cmds \ - old_striplib striplib file_magic_cmd finish_cmds finish_eval \ - deplibs_check_method reload_flag reload_cmds need_locks \ - lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ - lt_cv_sys_global_symbol_to_c_name_address \ - sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ - old_postinstall_cmds old_postuninstall_cmds \ - compiler \ - CC \ - LD \ - lt_prog_compiler_wl \ - lt_prog_compiler_pic \ - lt_prog_compiler_static \ - lt_prog_compiler_no_builtin_flag \ - export_dynamic_flag_spec \ - thread_safe_flag_spec \ - whole_archive_flag_spec \ - enable_shared_with_static_runtimes \ - old_archive_cmds \ - old_archive_from_new_cmds \ - predep_objects \ - postdep_objects \ - predeps \ - postdeps \ - compiler_lib_search_path \ - archive_cmds \ - archive_expsym_cmds \ - postinstall_cmds \ - postuninstall_cmds \ - old_archive_from_expsyms_cmds \ - allow_undefined_flag \ - no_undefined_flag \ - export_symbols_cmds \ - hardcode_libdir_flag_spec \ - hardcode_libdir_flag_spec_ld \ - hardcode_libdir_separator \ - hardcode_automatic \ - module_cmds \ - module_expsym_cmds \ - lt_cv_prog_compiler_c_o \ - exclude_expsyms \ - include_expsyms; do - - case $var in - old_archive_cmds | \ - old_archive_from_new_cmds | \ - archive_cmds | \ - archive_expsym_cmds | \ - module_cmds | \ - module_expsym_cmds | \ - old_archive_from_expsyms_cmds | \ - export_symbols_cmds | \ - extract_expsyms_cmds | reload_cmds | finish_cmds | \ - postinstall_cmds | postuninstall_cmds | \ - old_postinstall_cmds | old_postuninstall_cmds | \ - sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) - # Double-quote double-evaled strings. - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" - ;; - *) - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" - ;; - esac - done - case $lt_echo in - *'\$0 --fallback-echo"') - lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` - ;; - esac -cfgfile="${ofile}T" - trap "$rm \"$cfgfile\"; exit 1" 1 2 15 - $rm -f "$cfgfile" - { echo "$as_me:$LINENO: creating $ofile" >&5 -echo "$as_me: creating $ofile" >&6;} - cat <<__EOF__ >> "$cfgfile" -#! $SHELL -# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services. -# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) -# NOTE: Changes made to this file will be lost: look at ltmain.sh. -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 -# Free Software Foundation, Inc. -# -# This file is part of GNU Libtool: -# Originally by Gordon Matzigkeit , 1996 -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. -# A sed program that does not truncate output. -SED=$lt_SED -# Sed that helps us avoid accidentally triggering echo(1) options like -n. -Xsed="$SED -e 1s/^X//" -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH -# The names of the tagged configurations supported by this script. -available_tags= -# ### BEGIN LIBTOOL CONFIG -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi -# Whether or not to build static libraries. -build_old_libs=$enable_static +{ 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 -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$archive_cmds_need_lc -# Whether or not to disallow shared libs when runtime libs are static -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install -# The host system. -host_alias=$host_alias -host=$host -host_os=$host_os -# The build system. -build_alias=$build_alias -build=$build -build_os=$build_os +cat >>confdefs.h <<_ACEOF +#define LT_OBJDIR "$lt_cv_objdir/" +_ACEOF -# An echo program that does not interpret backslashes. -echo=$lt_echo -# The archiver. -AR=$lt_AR -AR_FLAGS=$lt_AR_FLAGS -# A C compiler. -LTCC=$lt_LTCC -# LTCC compiler flags. -LTCFLAGS=$lt_LTCFLAGS -# A language-specific compiler. -CC=$lt_compiler -# Is the compiler the GNU C compiler? -with_gcc=$GCC -gcc_dir=\`$CC -print-file-name=. | $SED 's,/\.$,,'\` -gcc_ver=\`$CC -dumpversion\` -# An ERE matcher. -EGREP=$lt_EGREP -# The linker used to build libraries. -LD=$lt_LD -# Whether we need hard or soft links. -LN_S=$lt_LN_S -# A BSD-compatible nm program. -NM=$lt_NM -# A symbol stripping program -STRIP=$lt_STRIP -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=$MAGIC_CMD -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" -# Used on cygwin: assembler. -AS="$AS" -# The name of the directory that contains temporary libtool files. -objdir=$objdir +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 -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +sed_quote_subst='s/\(["`$\\]\)/\\\1/g' -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl +# Same as above, but do not quote variable references. +double_quote_subst='s/\(["`\\]\)/\\\1/g' -# Object file suffix (normally "o"). -objext="$ac_objext" +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' -# Old archive suffix (normally "a"). -libext="$libext" +# Sed substitution to delay expansion of an escaped single quote. +delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' -# Shared library suffix (normally ".so"). -shrext_cmds='$shrext_cmds' +# Sed substitution to avoid accidental globbing in evaled expressions +no_glob_subst='s/\*/\\\*/g' -# Executable file suffix (normally ""). -exeext="$exeext" +# Global variables: +ofile=libtool +can_build_shared=yes -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic -pic_mode=$pic_mode +# All known linkers require a `.a' archive for static linking (except MSVC, +# which needs '.lib'). +libext=a -# What is the maximum length of a command? -max_cmd_len=$lt_cv_sys_max_cmd_len +with_gnu_ld="$lt_cv_prog_gnu_ld" -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o +old_CC="$CC" +old_CFLAGS="$CFLAGS" -# Must we lock files when doing compilation? -need_locks=$lt_need_locks +# 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 -# Do we need the lib prefix for modules? -need_lib_prefix=$need_lib_prefix +for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` -# Do we need a version for libraries? -need_version=$need_version -# Whether dlopen is supported. -dlopen_support=$enable_dlopen +# 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 -# Whether dlopen of programs is supported. -dlopen_self=$enable_dlopen_self +*** 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 -# Whether dlopen of statically linked programs is supported. -dlopen_self_static=$enable_dlopen_self_static +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_lt_prog_compiler_static - -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag - -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec +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 -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_thread_safe_flag_spec -# Library versioning type. -version_type=$version_type -# Format of library name prefix. -libname_spec=$lt_libname_spec -# List of archive names. First name is the real one, the rest are links. -# The last name is the one that the linker finds with -lNAME. -library_names_spec=$lt_library_names_spec +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 -# The coded name of the library, if different from the real name. -soname_spec=$lt_soname_spec +*** 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 -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_old_archive_cmds -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds +_LT_EOF + fi ;; + esac + fi + break + fi + done + IFS="$lt_save_ifs" + MAGIC_CMD="$lt_save_MAGIC_CMD" + ;; +esac +fi -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds +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 -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds -# Commands used to build and install a shared archive. -archive_cmds=$lt_archive_cmds -archive_expsym_cmds=$lt_archive_expsym_cmds -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds + else + MAGIC_CMD=: + fi +fi -# Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_module_cmds -module_expsym_cmds=$lt_module_expsym_cmds + fi + ;; +esac -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib +# Use C for the default configuration in the libtool script -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects=\`echo $lt_predep_objects | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` - -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects=\`echo $lt_postdep_objects | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` +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 -# Dependencies to place before the objects being linked to create a -# shared library. -predeps=$lt_predeps -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_postdeps +# Source file extension for C test sources. +ac_ext=c -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=\`echo $lt_compiler_lib_search_path | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` +# Object file extension for compiled C test sources. +objext=o +objext=$objext -# Method to check whether dependent libraries are shared objects. -deplibs_check_method=$lt_deplibs_check_method +# Code to be used in simple compile tests +lt_simple_compile_test_code="int some_variable = 0;" -# Command to use when deplibs_check_method == file_magic. -file_magic_cmd=$lt_file_magic_cmd +# Code to be used in simple link tests +lt_simple_link_test_code='int main(){return(0);}' -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$lt_finish_eval -# Take the output of nm and produce a listing of raw symbols and C names. -global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe -# Transform the output of nm in a proper C declaration -global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl -# Transform the output of nm in a C name address pair -global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} -# This is the shared library runtime path variable. -runpath_var=$runpath_var +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} -# This is the shared library path variable. -shlibpath_var=$shlibpath_var +# Allow CC to be a program name with arguments. +compiler=$CC -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath +# 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 -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action +# 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* -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs +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* -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec -# If ld is used when linking, flag to hardcode \$libdir into -# a binary during linking. This must work even if \$libdir does -# not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld +## 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 -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator +lt_prog_compiler_no_builtin_flag= -# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$hardcode_direct +if test "$GCC" = yes; then + lt_prog_compiler_no_builtin_flag=' -fno-builtin' -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$hardcode_minus_L + { 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:9529: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:9533: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_rtti_exceptions=yes + fi + fi + $RM conftest* -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var +fi +{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; } -# 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 +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 -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" +fi -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs -# Compile-time system search path for libraries -sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` -# Run-time system search path for libraries -sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$fix_srcfile_path" -# Set to yes if exported symbols are required. -always_export_symbols=$always_export_symbols -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds + lt_prog_compiler_wl= +lt_prog_compiler_pic= +lt_prog_compiler_static= -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds +{ 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; } -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms + if test "$GCC" = yes; then + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_static='-static' -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms + 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 + ;; -# ### END LIBTOOL CONFIG + amigaos*) + if test "$host_cpu" = m68k; then + # 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' + fi + ;; -__EOF__ + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | cygwin* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; - case $host_os in - aix3*) - cat <<\EOF >> "$cfgfile" - -# AIX sometimes has problems with the GCC collect2 program. For some -# reason, if we set the COLLECT_NAMES environment variable, the problems -# vanish in a puff of smoke. -if test "X${COLLECT_NAMES+set}" != Xset; then - COLLECT_NAMES= - export COLLECT_NAMES -fi -EOF - ;; - esac - - # We use sed instead of cat because bash on DJGPP gets confused if - # if finds mixed CR/LF and LF-only lines. Since sed operates in - # text mode, it properly converts lines to CR/LF. This bash problem - # is reportedly fixed, but why not run on old versions too? - sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1) - - mv -f "$cfgfile" "$ofile" || \ - (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") - chmod +x "$ofile" - -else - # If there is no Makefile yet, we rely on a make rule to execute - # `config.status --recheck' to rerun these tests and create the - # libtool script then. - ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` - if test -f "$ltmain_in"; then - test -f Makefile && make "$ltmain" - fi -fi + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + lt_prog_compiler_pic='-fno-common' + ;; + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + ;; -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 + interix[3-9]*) + # Interix 3.x gcc -fpic/-fPIC options generate broken code. + # Instead, we relocate shared libraries at runtime. + ;; -CC="$lt_save_CC" + 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' + ;; -# Check whether --with-tags was given. -if test "${with_tags+set}" = set; then - withval=$with_tags; tagnames="$withval" -fi + sysv4*MP*) + if test -d /usr/nec; then + lt_prog_compiler_pic=-Kconform_pic + fi + ;; + *) + lt_prog_compiler_pic='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + lt_prog_compiler_wl='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static='-Bstatic' + else + lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' + fi + ;; -if test -f "$ltmain" && test -n "$tagnames"; then - if test ! -f "${ofile}"; then - { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5 -echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;} - fi + mingw* | cygwin* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + lt_prog_compiler_pic='-DDLL_EXPORT' + ;; - if test -z "$LTCC"; then - eval "`$SHELL ${ofile} --config | grep '^LTCC='`" - if test -z "$LTCC"; then - { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5 -echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;} - else - { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5 -echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;} - fi - fi - if test -z "$LTCFLAGS"; then - eval "`$SHELL ${ofile} --config | grep '^LTCFLAGS='`" - fi + 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' + ;; - # Extract list of available tagged configurations in $ofile. - # Note that this assumes the entire list is on one line. - available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'` + irix5* | irix6* | nonstopux*) + lt_prog_compiler_wl='-Wl,' + # PIC (with -KPIC) is the default. + lt_prog_compiler_static='-non_shared' + ;; - lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," - for tagname in $tagnames; do - IFS="$lt_save_ifs" - # Check whether tagname contains only valid characters - case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in - "") ;; - *) { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5 -echo "$as_me: error: invalid tag name: $tagname" >&2;} - { (exit 1); exit 1; }; } + linux* | k*bsd*-gnu) + case $cc_basename in + icc* | ecc* | ifort*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-fpic' + lt_prog_compiler_static='-Bstatic' + ;; + ccc*) + lt_prog_compiler_wl='-Wl,' + # All Alpha code is PIC. + lt_prog_compiler_static='-non_shared' + ;; + xl*) + # IBM XL C 8.0/Fortran 10.1 on PPC + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-qpic' + lt_prog_compiler_static='-qstaticlink' ;; - esac - - if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null - then - { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5 -echo "$as_me: error: tag name \"$tagname\" already exists" >&2;} - { (exit 1); exit 1; }; } - fi + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C 5.9 + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + lt_prog_compiler_wl='-Wl,' + ;; + *Sun\ F*) + # 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='' + ;; + esac + ;; + esac + ;; - # Update the list of available tags. - if test -n "$tagname"; then - echo appending configuration tag \"$tagname\" to $ofile - - case $tagname in - CXX) - if test -n "$CXX" && ( test "X$CXX" != "Xno" && - ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || - (test "X$CXX" != "Xg++"))) ; then - ac_ext=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 + 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' + ;; -archive_cmds_need_lc_CXX=no -allow_undefined_flag_CXX= -always_export_symbols_CXX=no -archive_expsym_cmds_CXX= -export_dynamic_flag_spec_CXX= -hardcode_direct_CXX=no -hardcode_libdir_flag_spec_CXX= -hardcode_libdir_flag_spec_ld_CXX= -hardcode_libdir_separator_CXX= -hardcode_minus_L_CXX=no -hardcode_shlibpath_var_CXX=unsupported -hardcode_automatic_CXX=no -module_cmds_CXX= -module_expsym_cmds_CXX= -link_all_deplibs_CXX=unknown -old_archive_cmds_CXX=$old_archive_cmds -no_undefined_flag_CXX= -whole_archive_flag_spec_CXX= -enable_shared_with_static_runtimes_CXX=no + solaris*) + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + lt_prog_compiler_wl='-Qoption ld ';; + *) + lt_prog_compiler_wl='-Wl,';; + esac + ;; -# 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= + sunos4*) + lt_prog_compiler_wl='-Qoption ld ' + lt_prog_compiler_pic='-PIC' + lt_prog_compiler_static='-Bstatic' + ;; -# Source file extension for C++ test sources. -ac_ext=cpp + sysv4 | sysv4.2uw2* | sysv4.3*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; -# Object file extension for compiled C++ test sources. -objext=o -objext_CXX=$objext + sysv4*MP*) + if test -d /usr/nec ;then + lt_prog_compiler_pic='-Kconform_pic' + lt_prog_compiler_static='-Bstatic' + fi + ;; -# Code to be used in simple compile tests -lt_simple_compile_test_code="int some_variable = 0;\n" + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_pic='-KPIC' + lt_prog_compiler_static='-Bstatic' + ;; -# Code to be used in simple link tests -lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n' + unicos*) + lt_prog_compiler_wl='-Wl,' + lt_prog_compiler_can_build_shared=no + ;; -# ltmain only uses $CC for tagged configurations so make sure $CC is set. + uts4*) + lt_prog_compiler_pic='-pic' + lt_prog_compiler_static='-Bstatic' + ;; -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} + *) + lt_prog_compiler_can_build_shared=no + ;; + esac + fi -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} +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: result: $lt_prog_compiler_pic" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic" >&6; } -# Allow CC to be a program name with arguments. -compiler=$CC -# save warnings/boilerplate of simple test code -ac_outfile=conftest.$ac_objext -printf "$lt_simple_compile_test_code" >conftest.$ac_ext -eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_compiler_boilerplate=`cat conftest.err` -$rm conftest* -ac_outfile=conftest.$ac_objext -printf "$lt_simple_link_test_code" >conftest.$ac_ext -eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_linker_boilerplate=`cat conftest.err` -$rm conftest* -# Allow CC to be a program name with arguments. -lt_save_CC=$CC -lt_save_LD=$LD -lt_save_GCC=$GCC -GCC=$GXX -lt_save_with_gnu_ld=$with_gnu_ld -lt_save_path_LD=$lt_cv_path_LD -if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then - lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx -else - $as_unset lt_cv_prog_gnu_ld -fi -if test -n "${lt_cv_path_LDCXX+set}"; then - lt_cv_path_LD=$lt_cv_path_LDCXX +# +# 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 - $as_unset lt_cv_path_LD -fi -test -z "${LDCXX+set}" || LD=$LDCXX -CC=${CXX-"c++"} -compiler=$CC -compiler_CXX=$CC -for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + 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:9847: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:9851: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_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; } -# We don't want -fno-exception wen compiling C++ code, so set the -# no_builtin_flag separately -if test "$GXX" = yes; then - lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' +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_no_builtin_flag_CXX= + lt_prog_compiler_pic= + lt_prog_compiler_can_build_shared=no fi -if test "$GXX" = yes; then - # Set up default GNU C++ configuration +fi -# 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 + + + +# +# 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 - 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 conftest.$ac_ext + if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then + # The linker can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + # Append any errors to the config.log. + cat conftest.err 1>&5 + $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_static_works=yes + fi + else + lt_cv_prog_compiler_static_works=yes + fi + fi + $RM -r conftest* + LDFLAGS="$save_LDFLAGS" -LD="$lt_cv_path_LD" -if test -n "$LD"; then - { echo "$as_me:$LINENO: result: $LD" >&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 +{ 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 - # I'd rather use --version here, but apparently some GNU lds only accept -v. -case `$LD -v 2>&1 &5 -echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6; } -with_gnu_ld=$lt_cv_prog_gnu_ld - # Check if GNU C++ uses GNU ld as the underlying linker, since the - # archiving commands below assume that GNU ld is being used. - if test "$with_gnu_ld" = yes; then - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-dynamic' - # If archive_cmds runs LD, not CC, wlarc should be empty - # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to - # investigate it a little bit more. (MM) - wlarc='${wl}' - # ancient GNU ld didn't support --whole-archive et. al. - if eval "`$CC -print-prog-name=ld` --help 2>&1" | \ - grep 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec_CXX= - fi - else - with_gnu_ld=no - wlarc= - # A generic and very simple default shared library creation - # command for GNU C++ for the case where it uses the native - # linker, instead of GNU ld. If possible, this setting should - # overridden to take advantage of the native linker features on - # the platform it is being used on. - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - fi + { 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 - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + 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:9952: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:9956: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* -else - GXX=no - with_gnu_ld=no - wlarc= fi +{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6; } -# PORTME: fill in a description of your system's C++ link characteristics -{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } -ld_shlibs_CXX=yes -case $host_os in - aix3*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - aix4* | aix5*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[23]|aix4.[23].*|aix5*) - for ld_flag in $LDFLAGS; do - case $ld_flag in - *-brtl*) - aix_use_runtimelinking=yes - break - ;; - esac - done - ;; - esac - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - archive_cmds_CXX='' - hardcode_direct_CXX=yes - hardcode_libdir_separator_CXX=':' - link_all_deplibs_CXX=yes - if test "$GXX" = yes; then - case $host_os in aix4.[012]|aix4.[012].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && \ - strings "$collect2name" | grep resolve_lib_name >/dev/null - then - # We have reworked collect2 - hardcode_direct_CXX=yes - else - # We have old collect2 - hardcode_direct_CXX=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - hardcode_minus_L_CXX=yes - hardcode_libdir_flag_spec_CXX='-L$libdir' - hardcode_libdir_separator_CXX= - fi - ;; - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - always_export_symbols_CXX=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - allow_undefined_flag_CXX='-berok' - # Determine the default libpath from the value encoded in an empty executable. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -int -main () -{ + { 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 - ; - 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_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:10007: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:10011: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +fi +{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6; } -fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" +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 - archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag_CXX="-z nodefs" - archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an empty executable. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -int -main () -{ - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (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 -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -fi + { 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; } -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi + 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_flag_spec_ld= + 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= - hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - no_undefined_flag_CXX=' ${wl}-bernotok' - allow_undefined_flag_CXX=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec_CXX='$convenience' - archive_cmds_need_lc_CXX=yes - # This is similar to how AIX traditionally builds its shared libraries. - archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi + case $host_os in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no fi ;; - - 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 + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes ;; - - chorus*) - case $cc_basename in - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac + openbsd*) + with_gnu_ld=no ;; + esac - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec_CXX='-L$libdir' - allow_undefined_flag_CXX=unsupported - always_export_symbols_CXX=no - enable_shared_with_static_runtimes_CXX=yes - - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + ld_shlibs=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + export_dynamic_flag_spec='${wl}--export-dynamic' + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else - ld_shlibs_CXX=no + whole_archive_flag_spec= fi - ;; - darwin* | rhapsody*) - case $host_os in - rhapsody* | darwin1.[012]) - allow_undefined_flag_CXX='${wl}-undefined ${wl}suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[012]) - allow_undefined_flag_CXX='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - ;; - 10.*) - allow_undefined_flag_CXX='${wl}-undefined ${wl}dynamic_lookup' - ;; - esac - fi - ;; - esac - archive_cmds_need_lc_CXX=no - hardcode_direct_CXX=no - hardcode_automatic_CXX=yes - hardcode_shlibpath_var_CXX=unsupported - whole_archive_flag_spec_CXX='' - link_all_deplibs_CXX=yes - - if test "$GXX" = yes ; then - lt_int_apple_cc_single_mod=no - output_verbose_link_cmd='echo' - if $CC -dumpspecs 2>&1 | $EGREP 'single_module' >/dev/null ; then - lt_int_apple_cc_single_mod=yes - fi - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - else - archive_cmds_CXX='$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - fi - module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - if test "X$lt_int_apple_cc_single_mod" = Xyes ; then - archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - fi - module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - case $cc_basename in - xlc*) - output_verbose_link_cmd='echo' - archive_cmds_CXX='$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' - module_cmds_CXX='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj ${wl}-single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - ;; - *) - ld_shlibs_CXX=no - ;; - esac - fi - ;; - - dgux*) - case $cc_basename in - ec++*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - ghcx*) - # Green Hills C++ Compiler - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; + supports_anon_versioning=no + case `$LD -v 2>&1` in + *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; esac - ;; - freebsd[12]*) - # C++ shared libraries reported to be fairly broken before switch to ELF - ld_shlibs_CXX=no - ;; - freebsd-elf*) - archive_cmds_need_lc_CXX=no - ;; - freebsd* | kfreebsd*-gnu | dragonfly*) - # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF - # conventions - ld_shlibs_CXX=yes - ;; - gnu*) - ;; - hpux9*) - hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_CXX=: - export_dynamic_flag_spec_CXX='${wl}-E' - hardcode_direct_CXX=yes - hardcode_minus_L_CXX=yes # Not in the search PATH, - # but as the default - # location of the library. - - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - aCC*) - archive_cmds_CXX='$rm $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "[-]L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes; then - archive_cmds_CXX='$rm $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no + + # 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.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +_LT_EOF fi ;; - esac - ;; - hpux10*|hpux11*) - if test $with_gnu_ld = no; then - hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_CXX=: - case $host_cpu in - hppa*64*|ia64*) - hardcode_libdir_flag_spec_ld_CXX='+b $libdir' - ;; - *) - export_dynamic_flag_spec_CXX='${wl}-E' - ;; - esac - fi - case $host_cpu in - hppa*64*|ia64*) - hardcode_direct_CXX=no - hardcode_shlibpath_var_CXX=no + amigaos*) + if test "$host_cpu" = m68k; then + 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 + fi + + # Samuel A. Falvo II reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can't use + # them. + ld_shlibs=no ;; - *) - hardcode_direct_CXX=yes - hardcode_minus_L_CXX=yes # Not in the search PATH, - # but as the default - # location of the library. + + 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 ;; - esac - case $cc_basename in - CC*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - aCC*) - case $host_cpu in - hppa*64*) - archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - ia64*) - archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - *) - archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes; then - if test $with_gnu_ld = no; then - case $host_cpu in - hppa*64*) - archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - ia64*) - archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - *) - archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - ;; - esac - fi + cygwin* | mingw* | pw32*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, + # as there is no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + allow_undefined_flag=unsupported + always_export_symbols=no + enable_shared_with_static_runtimes=yes + export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; else - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - fi - ;; - esac - ;; - interix3*) - hardcode_direct_CXX=no - hardcode_shlibpath_var_CXX=no - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - export_dynamic_flag_spec_CXX='${wl}-E' - # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. - # Instead, shared libraries are loaded at an image base (0x10000000 by - # default) and relocated if they conflict, which is a slow very memory - # consuming and fragmenting process. To avoid this, we pick a random, - # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link - # time. Moving up from 0x10000000 also allows more sbrk(2) space. - archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - ;; - irix5* | irix6*) - case $cc_basename in - CC*) - # SGI C++ - archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - - # Archives containing C++ object files must be created using - # "CC -ar", where "CC" is the IRIX C++ compiler. This is - # necessary to make sure instantiated templates are included - # in the archive. - old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' - ;; - *) - if test "$GXX" = yes; then - if test "$with_gnu_ld" = no; then - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib' - fi - fi - link_all_deplibs_CXX=yes - ;; - esac - hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_CXX=: - ;; - linux*) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' - archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - - hardcode_libdir_flag_spec_CXX='${wl}--rpath,$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-dynamic' - - # Archives containing C++ object files must be created using - # "CC -Bstatic", where "CC" is the KAI C++ compiler. - old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' - ;; - icpc*) - # Intel C++ - with_gnu_ld=yes - # version 8.0 and above of icpc choke on multiply defined symbols - # if we add $predep_objects and $postdep_objects, however 7.1 and - # earlier do not add the objects themselves. - case `$CC -V 2>&1` in - *"Version 7."*) - archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - ;; - *) # Version 8.0 or newer - tmp_idyn= - case $host_cpu in - ia64*) tmp_idyn=' -i_dynamic';; - esac - archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + 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 + ;; + + 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) + 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= + 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; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + xl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; esac - archive_cmds_need_lc_CXX=no - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-dynamic' - whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' - ;; - pgCC*) - # Portland Group C++ compiler - archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' - - hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' - export_dynamic_flag_spec_CXX='${wl}--export-dynamic' - whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - ;; - cxx*) - # Compaq C++ - archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' - - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec_CXX='-rpath $libdir' - hardcode_libdir_separator_CXX=: + 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; $ECHO \"$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' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - esac - ;; - lynxos*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - m88k*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - mvs*) - case $cc_basename in - cxx*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' - wlarc= - hardcode_libdir_flag_spec_CXX='-R$libdir' - hardcode_direct_CXX=yes - hardcode_shlibpath_var_CXX=no - fi - # Workaround some broken pre-1.5 toolchains - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' - ;; - openbsd2*) - # C++ shared libraries are fairly broken - ld_shlibs_CXX=no - ;; - openbsd*) - hardcode_direct_CXX=yes - hardcode_shlibpath_var_CXX=no - archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' - export_dynamic_flag_spec_CXX='${wl}-E' - whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - fi - output_verbose_link_cmd='echo' - ;; - osf3*) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + 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 - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - hardcode_libdir_separator_CXX=: + case $cc_basename in + xlf*) + # 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= + hardcode_libdir_flag_spec_ld='-rpath $libdir' + archive_cmds='$LD -shared $libobjs $deplibs $compiler_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 $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + ld_shlibs=no + fi + ;; - # 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' + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; - ;; - RCC*) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - cxx*) - allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - - hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_CXX=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' - ;; - *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <<_LT_EOF 1>&2 - hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_CXX=: +*** 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. - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' +_LT_EOF + elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; - else - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - fi - ;; - esac - ;; - osf4* | osf5*) - case $cc_basename in - KCC*) - # Kuck and Associates, Inc. (KAI) C++ Compiler - - # KCC will only create a shared library if the output file - # ends with ".so" (or ".sl" for HP-UX), so rename the library - # to its proper name (with version) after linking. - archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' + 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 - hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' - hardcode_libdir_separator_CXX=: +*** 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. - # Archives containing C++ object files must be created using - # the KAI C++ compiler. - old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' - ;; - RCC*) - # Rational C++ 2.4.1 - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no +_LT_EOF ;; - cxx*) - allow_undefined_flag_CXX=' -expect_unresolved \*' - archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ - echo "-hidden">> $lib.exp~ - $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname -Wl,-input -Wl,$lib.exp `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~ - $rm $lib.exp' - - hardcode_libdir_flag_spec_CXX='-rpath $libdir' - hardcode_libdir_separator_CXX=: - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - # - # There doesn't appear to be a way to prevent this compiler from - # explicitly linking system object files so we need to strip them - # from the output so that they don't get included in the library - # dependencies. - output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "ld" | grep -v "ld:"`; templist=`echo $templist | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list' + *) + # 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 ;; - *) - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + esac + ;; - hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_CXX=: + sunos4*) + archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep "\-L"' + 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 + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no + 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 - ;; - esac - ;; - psos*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - lcc*) - # Lucid - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - solaris*) - case $cc_basename in - CC*) - # Sun C++ 4.2, 5.x and Centerline C++ - archive_cmds_need_lc_CXX=yes - no_undefined_flag_CXX=' -zdefs' - archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' - archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + aix_use_runtimelinking=no - hardcode_libdir_flag_spec_CXX='-R$libdir' - hardcode_shlibpath_var_CXX=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) - # The C++ compiler is used as linker so we must use $wl - # flag to pass the commands to the underlying system - # linker. We must also pass each convience library through - # to the system linker between allextract/defaultextract. - # The C++ compiler will combine linker options so we - # cannot just pass the convience library names through - # without $wl. - # Supported since Solaris 2.6 (maybe 2.5.1?) - whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' - ;; + # 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 - link_all_deplibs_CXX=yes - output_verbose_link_cmd='echo' + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi - # 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' + # 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. - # The C++ compiler must be used to create the archive. - old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' - ;; - *) - # GNU C++ compiler with Solaris linker - if test "$GXX" = yes && test "$with_gnu_ld" = no; then - no_undefined_flag_CXX=' ${wl}-z ${wl}defs' - if $CC --version | grep -v '^2\.7' > /dev/null; then - archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' + archive_cmds='' + hardcode_direct=yes + hardcode_direct_absolute=yes + hardcode_libdir_separator=':' + link_all_deplibs=yes + file_list_spec='${wl}-f,' - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + 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 - # g++ 2.7 appears to require `-G' NOT `-shared' on this - # platform. - archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' - archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$rm $lib.exp' - - # Commands to make compiler produce verbose output that lists - # what "hidden" libraries, object files and flags are used when - # linking a shared library. - output_verbose_link_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\"" + # 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 - - hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' fi - ;; - esac - ;; - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) - no_undefined_flag_CXX='${wl}-z,text' - archive_cmds_need_lc_CXX=no - hardcode_shlibpath_var_CXX=no - runpath_var='LD_RUN_PATH' - - case $cc_basename in - CC*) - archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - ;; - sysv5* | sco3.2v5* | sco5v6*) - # Note: We can NOT use -z defs as we might desire, because we do not - # link with -lc, and that would cause any symbols used from libc to - # always be unresolved, which means just about no library would - # ever link correctly. If we're not using GNU ld we use -z text - # though, which does catch some bad symbols but isn't as heavy-handed - # as -z defs. - # For security reasons, it is highly recommended that you always - # use absolute paths for naming shared libraries, and exclude the - # DT_RUNPATH tag from executables and libraries. But doing so - # requires that you compile everything twice, which is a pain. - # So that behaviour is only enabled if SCOABSPATH is set to a - # non-empty value in the environment. Most likely only useful for - # creating official distributions of packages. - # This is a hack until libtool officially supports absolute path - # names for shared libraries. - no_undefined_flag_CXX='${wl}-z,text' - allow_undefined_flag_CXX='${wl}-z,nodefs' - archive_cmds_need_lc_CXX=no - hardcode_shlibpath_var_CXX=no - hardcode_libdir_flag_spec_CXX='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' - hardcode_libdir_separator_CXX=':' - link_all_deplibs_CXX=yes - export_dynamic_flag_spec_CXX='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - - case $cc_basename in - CC*) - archive_cmds_CXX='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds_CXX='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - ;; - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - esac - ;; - vxworks*) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; - *) - # FIXME: insert proper C++ library support - ld_shlibs_CXX=no - ;; -esac -{ echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 -echo "${ECHO_T}$ld_shlibs_CXX" >&6; } -test "$ld_shlibs_CXX" = no && can_build_shared=no - -GCC_CXX="$GXX" -LD_CXX="$LD" + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + always_export_symbols=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -cat > conftest.$ac_ext <&5 - (eval $ac_compile) 2>&5 + ; + 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); }; then - # Parse the compiler output and extract the necessary - # objects, libraries and library flags. + (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 - # Sentinel used to keep track of whether or not we are before - # the conftest object file. - pre_test_object_deps_done=no +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +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 "$aix_libpath"; then + 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 - # The `*' in the case matches for architectures that use `case' in - # $output_verbose_cmd can trigger glob expansion during the loop - # eval without this substitution. - output_verbose_link_cmd=`$echo "X$output_verbose_link_cmd" | $Xsed -e "$no_glob_subst"` - for p in `eval $output_verbose_link_cmd`; do - case $p in +fi - -L* | -R* | -l*) - # Some compilers place space between "-{L,R}" and the path. - # Remove the space. - if test $p = "-L" \ - || test $p = "-R"; then - prev=$p - continue - else - prev= - fi +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - if test "$pre_test_object_deps_done" = no; then - case $p in - -L* | -R*) - # Internal compiler library paths should come after those - # provided the user. The postdeps already come after the - # user supplied libs so there is no need to process them. - if test -z "$compiler_lib_search_path_CXX"; then - compiler_lib_search_path_CXX="${prev}${p}" - else - compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" - fi - ;; - # The "-l" case would never come before the object being - # linked, so don't bother handling this case. - esac - else - if test -z "$postdeps_CXX"; then - postdeps_CXX="${prev}${p}" - else - postdeps_CXX="${postdeps_CXX} ${prev}${p}" - fi - fi - ;; + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag="-z nodefs" + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ - *.$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 +int +main () +{ - 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 - ;; + ; + 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 - *) ;; # Ignore the rest. +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +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 "$aix_libpath"; then + 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 - 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 +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi -# PORTME: override above test on systems where it is broken -case $host_os in -interix3*) - # Interix 3.5 installs completely hosed .la files for C++, so rather than - # hack all around it, let's just trust "g++" to DTRT. - predep_objects_CXX= - postdep_objects_CXX= - postdeps_CXX= - ;; + hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag=' ${wl}-bernotok' + allow_undefined_flag=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec='$convenience' + archive_cmds_need_lc=yes + # This is similar to how AIX traditionally builds its shared libraries. + archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; -solaris*) - case $cc_basename in - CC*) - # Adding this requires a known-good setup of shared libraries for - # Sun compiler versions before 5.6, else PIC objects from an old - # archive will be linked into the output, leading to subtle bugs. - postdeps_CXX='-lCstd -lCrun' - ;; - esac - ;; -esac + amigaos*) + if test "$host_cpu" = m68k; then + 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 + fi + # see comment about different semantics on the GNU ld section + ld_shlibs=no + ;; + bsdi[45]*) + export_dynamic_flag_spec=-rdynamic + ;; -case " $postdeps_CXX " in -*" -lc "*) archive_cmds_need_lc_CXX=no ;; -esac + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # Tell ltmain to make .dll files, not .so files. + shrext_cmds=".dll" + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_from_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' + fix_srcfile_path='`cygpath -w "$srcfile"`' + enable_shared_with_static_runtimes=yes + ;; -lt_prog_compiler_wl_CXX= -lt_prog_compiler_pic_CXX= -lt_prog_compiler_static_CXX= + darwin* | rhapsody*) -{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 -echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } - # C++ specific cases for pic, static, wl, etc. - if test "$GXX" = yes; then - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX='-static' + archive_cmds_need_lc=no + hardcode_direct=no + hardcode_automatic=yes + hardcode_shlibpath_var=unsupported + whole_archive_flag_spec='' + link_all_deplibs=yes + allow_undefined_flag="$_lt_dar_allow_undefined" + if test "$GCC" = "yes"; then + output_verbose_link_cmd=echo + archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_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 - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_CXX='-Bstatic' - fi - ;; - amigaos*) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' ;; - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. + + dgux*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no ;; - mingw* | os2* | pw32*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic_CXX='-DDLL_EXPORT' + + freebsd1*) + ld_shlibs=no ;; - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic_CXX='-fno-common' + + # 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 ;; - *djgpp*) - # DJGPP does not support shared libraries at all - lt_prog_compiler_pic_CXX= + + # 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 ;; - interix3*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no ;; - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic_CXX=-Kconform_pic + + hpux9*) + if test "$GCC" = yes; then + archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + hardcode_minus_L=yes + export_dynamic_flag_spec='${wl}-E' ;; - hpux*) - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - ;; - *) - lt_prog_compiler_pic_CXX='-fPIC' - ;; - esac - ;; - *) - lt_prog_compiler_pic_CXX='-fPIC' + + hpux10*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_flag_spec_ld='+b $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 ;; - esac - else - case $host_os in - aix4* | aix5*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_CXX='-Bstatic' - else - lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' - fi - ;; - chorus*) - case $cc_basename in - cxch68*) - # Green Hills C++ Compiler - # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" + + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac - ;; - darwin*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - case $cc_basename in - xlc*) - lt_prog_compiler_pic_CXX='-qnocommon' - lt_prog_compiler_wl_CXX='-Wl,' - ;; - esac - ;; - dgux*) - case $cc_basename in - ec++*) - lt_prog_compiler_pic_CXX='-KPIC' - ;; - ghcx*) - # Green Hills C++ Compiler - lt_prog_compiler_pic_CXX='-pic' - ;; - *) - ;; - esac - ;; - freebsd* | kfreebsd*-gnu | dragonfly*) - # FreeBSD uses GNU C++ - ;; - hpux9* | hpux10* | hpux11*) - case $cc_basename in - CC*) - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' - if test "$host_cpu" != ia64; then - lt_prog_compiler_pic_CXX='+Z' - fi - ;; - aCC*) - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic_CXX='+Z' - ;; - esac - ;; - *) - ;; - esac - ;; - interix*) - # This is c89, which is MS Visual C++ (no shared libs) - # Anyone wants to do a port? - ;; - irix5* | irix6* | nonstopux*) - case $cc_basename in - CC*) - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_static_CXX='-non_shared' - # CC pic flag -KPIC is the default. - ;; - *) - ;; - esac - ;; - linux*) - case $cc_basename in - KCC*) - # KAI C++ Compiler - lt_prog_compiler_wl_CXX='--backend -Wl,' - lt_prog_compiler_pic_CXX='-fPIC' - ;; - icpc* | ecpc*) - # Intel C++ - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_pic_CXX='-KPIC' - lt_prog_compiler_static_CXX='-static' - ;; - pgCC*) - # Portland Group C++ compiler. - lt_prog_compiler_wl_CXX='-Wl,' - lt_prog_compiler_pic_CXX='-fpic' - lt_prog_compiler_static_CXX='-Bstatic' - ;; - cxx*) - # Compaq C++ - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - lt_prog_compiler_pic_CXX= - lt_prog_compiler_static_CXX='-non_shared' - ;; - *) - ;; - esac - ;; - lynxos*) - ;; - m88k*) - ;; - mvs*) - case $cc_basename in - cxx*) - lt_prog_compiler_pic_CXX='-W c,exportall' - ;; - *) - ;; - esac - ;; - netbsd*) - ;; - osf3* | osf4* | osf5*) - case $cc_basename in - KCC*) - lt_prog_compiler_wl_CXX='--backend -Wl,' - ;; - RCC*) - # Rational C++ 2.4.1 - lt_prog_compiler_pic_CXX='-pic' - ;; - cxx*) - # Digital/Compaq C++ - lt_prog_compiler_wl_CXX='-Wl,' - # Make sure the PIC flag is empty. It appears that all Alpha - # Linux and Compaq Tru64 Unix objects are PIC. - lt_prog_compiler_pic_CXX= - lt_prog_compiler_static_CXX='-non_shared' - ;; - *) - ;; - esac - ;; - psos*) - ;; - solaris*) - case $cc_basename in - CC*) - # Sun C++ 4.2, 5.x and Centerline C++ - lt_prog_compiler_pic_CXX='-KPIC' - lt_prog_compiler_static_CXX='-Bstatic' - lt_prog_compiler_wl_CXX='-Qoption ld ' - ;; - gcx*) - # Green Hills C++ Compiler - lt_prog_compiler_pic_CXX='-PIC' - ;; - *) - ;; - esac - ;; - sunos4*) - case $cc_basename in - CC*) - # Sun C++ 4.x - lt_prog_compiler_pic_CXX='-pic' - lt_prog_compiler_static_CXX='-Bstatic' - ;; - lcc*) - # Lucid - lt_prog_compiler_pic_CXX='-pic' - ;; - *) - ;; + else + case $host_cpu in + hppa*64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; esac - ;; - tandem*) - case $cc_basename in - NCC*) - # NonStop-UX NCC 3.20 - lt_prog_compiler_pic_CXX='-KPIC' - ;; - *) - ;; + 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 - ;; - 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' - ;; + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${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. + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + cat >conftest.$ac_ext <<_ACEOF +int foo(void) {} +_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 + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + +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" + else + archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -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*) + 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" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${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" && $ECHO "X-set_version $verstring" | $Xsed` -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} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${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" && $ECHO "X-set_version $verstring" | $Xsed` -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 "X-set_version $verstring" | $Xsed` -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 ${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 ${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 ;; - vxworks*) + 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??? ;; - *) - lt_prog_compiler_can_build_shared_CXX=no + 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 - fi + esac + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + ;; -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6; } + sysv4.3*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + hardcode_shlibpath_var=no + export_dynamic_flag_spec='-Bexport' + ;; -# -# Check to make sure the PIC flag actually works. -# -if test -n "$lt_prog_compiler_pic_CXX"; then + 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 + ;; -{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 -echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6; } -if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_pic_works_CXX=no - ac_outfile=conftest.$ac_objext - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:13212: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:13216: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_pic_works_CXX=yes - fi - fi - $rm conftest* + 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' -fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6; } + if test "$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 -if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then - case $lt_prog_compiler_pic_CXX in - "" | " "*) ;; - *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; - esac -else - lt_prog_compiler_pic_CXX= - lt_prog_compiler_can_build_shared_CXX=no -fi -fi -case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - lt_prog_compiler_pic_CXX= - ;; - *) - lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" - ;; -esac -# -# Check to make sure the static flag actually works. -# -wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" -{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } -if test "${lt_prog_compiler_static_works_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_static_works_CXX=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $lt_tmp_static_flag" - printf "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The linker can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&5 - $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_static_works_CXX=yes - fi - else - lt_prog_compiler_static_works_CXX=yes - fi - fi - $rm conftest* - LDFLAGS="$save_LDFLAGS" -fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_CXX" >&5 -echo "${ECHO_T}$lt_prog_compiler_static_works_CXX" >&6; } -if test x"$lt_prog_compiler_static_works_CXX" = xyes; then - : -else - lt_prog_compiler_static_CXX= -fi -{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 -echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } -if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_prog_compiler_c_o_CXX=no - $rm -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:13316: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:13320: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp - $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then - lt_cv_prog_compiler_c_o_CXX=yes - fi - fi - chmod u+w . 2>&5 - $rm conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files - $rm out/* && rmdir out - cd .. - rmdir conftest - $rm conftest* -fi -{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6; } -hard_links="nottested" -if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 -echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } - hard_links=yes - $rm conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - { echo "$as_me:$LINENO: result: $hard_links" >&5 -echo "${ECHO_T}$hard_links" >&6; } - if test "$hard_links" = no; then - { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} - need_locks=warn - fi -else - need_locks=no -fi -{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } - export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - case $host_os in - aix4* | aix5*) - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - if $NM -V 2>&1 | grep 'GNU' > /dev/null; then - export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - else - export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - fi - ;; - pw32*) - export_symbols_cmds_CXX="$ltdll_cmds" - ;; - cygwin* | mingw*) - export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/;/^.* __nm__/s/^.* __nm__\([^ ]*\) [^ ]*/\1 DATA/;/^I /d;/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' - ;; - *) - export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - ;; - esac -{ echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 -echo "${ECHO_T}$ld_shlibs_CXX" >&6; } -test "$ld_shlibs_CXX" = no && can_build_shared=no # # Do we need to explicitly link libc? # -case "x$archive_cmds_need_lc_CXX" in +case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added - archive_cmds_need_lc_CXX=yes + archive_cmds_need_lc=yes if test "$enable_shared" = yes && test "$GCC" = yes; then - case $archive_cmds_CXX in + case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; @@ -13413,8 +11152,8 @@ # to ld, don't add -lc before -lgcc. { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } - $rm conftest* - printf "$lt_simple_compile_test_code" > conftest.$ac_ext + $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 @@ -13425,5206 +11164,3934 @@ lib=conftest libobjs=conftest.$ac_objext deplibs= - wl=$lt_prog_compiler_wl_CXX - pic_flag=$lt_prog_compiler_pic_CXX + 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_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 + lt_save_allow_undefined_flag=$allow_undefined_flag + allow_undefined_flag= + if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\"") >&5 + (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then - archive_cmds_need_lc_CXX=no + archive_cmds_need_lc=no else - archive_cmds_need_lc_CXX=yes + archive_cmds_need_lc=yes fi - allow_undefined_flag_CXX=$lt_save_allow_undefined_flag + allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi - $rm conftest* - { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5 -echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6; } + $RM conftest* + { echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 +echo "${ECHO_T}$archive_cmds_need_lc" >&6; } ;; esac fi ;; esac -{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 -echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } -library_names_spec= -libname_spec='lib$name' -soname_spec= -shrext_cmds=".so" -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi -need_lib_prefix=unknown -hardcode_into_libs=no -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown -case $host_os in -aix3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' - shlibpath_var=LIBPATH - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' - ;; -aix4* | aix5*) - version_type=linux - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test "$host_cpu" = ia64; then - # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - aix4 | aix4.[01] | aix4.[01].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; - esac - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then - # If using run time linking (on AIX 4.2 or later) use lib.so - # instead of lib.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - else - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}${shared_ext}$major' - fi - shlibpath_var=LIBPATH - fi - ;; -amigaos*) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' - ;; -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; -bsdi[45]*) - version_type=linux - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; -cygwin* | mingw* | pw32*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32*) - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname~ - chmod a+x \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $rm \$dlpath' - shlibpath_overrides_runpath=yes - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" - ;; - mingw*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - ;; - esac - ;; - *) - library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' - ;; - esac - dynamic_linker='Win32 ld.exe' - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' - soname_spec='${libname}${release}${major}$shared_ext' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' - # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. - if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` - else - sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' - fi - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; -dgux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; -freebsd1*) - dynamic_linker=no - ;; -kfreebsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='GNU ld.so' - ;; -freebsd* | dragonfly*) - # DragonFly does not have aout. When/if they implement a new - # versioning mechanism, adjust this. - if test -x /usr/bin/objformat; then - objformat=`/usr/bin/objformat` - else - case $host_os in - freebsd[123]*) objformat=aout ;; - *) objformat=elf ;; - esac - fi - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2*) - shlibpath_overrides_runpath=yes - ;; - freebsd3.[01]* | freebsdelf3.[01]*) - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ - freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - freebsd*) # from 4.6 on - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - esac - ;; -gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - hardcode_into_libs=yes - ;; -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - version_type=sunos - need_lib_prefix=no - need_version=no - case $host_cpu in - ia64*) - shrext_cmds='.so' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.so" - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - if test "X$HPUX_IA64_MODE" = X32; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - hppa*64*) - shrext_cmds='.sl' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.sl" - shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - *) - shrext_cmds='.sl' - dynamic_linker="$host_os dld.sl" - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - ;; - esac - # HP-UX runs *really* slowly unless shared libraries are mode 555. - postinstall_cmds='chmod 555 $lib' - ;; -interix3*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; -irix5* | irix6* | nonstopux*) - case $host_os in - nonstopux*) version_type=nonstopux ;; - *) - if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux - else - version_type=irix - fi ;; - esac - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' - case $host_os in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac - ;; - esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" - hardcode_into_libs=yes - ;; -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no - ;; -# This must be Linux ELF. -linux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes - # find out which ABI we are using - libsuff= - case "$host_cpu" in - x86_64*|s390x*|powerpc64*) - echo '#line 13852 "configure"' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - case `/usr/bin/file conftest.$ac_objext` in - *64-bit*) - libsuff=64 - sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" - ;; - esac - fi - rm -rf conftest* - ;; - esac - # Append ld.so.conf contents to the search path - if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" - fi - # We used to test for /lib/ld.so.1 and disable shared libraries on - # powerpc, because MkLinux only supported shared libraries with the - # GNU dynamic linker. Since this was broken with cross compilers, - # most powerpc-linux boxes support dynamic linking these days and - # people can always --disable-shared, the test was removed, and we - # assume the GNU/Linux dynamic linker is in use. - dynamic_linker='GNU/Linux ld.so' - ;; -knetbsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='GNU ld.so' - ;; -netbsd*) - version_type=sunos - need_lib_prefix=no - need_version=no - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - dynamic_linker='NetBSD (a.out) ld.so' - else - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='NetBSD ld.elf_so' - fi - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; -newsos6) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; -nto-qnx*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; -openbsd*) - version_type=sunos - sys_lib_dlsearch_path_spec="/usr/lib" - need_lib_prefix=no - # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. - case $host_os in - openbsd3.3 | openbsd3.3.*) need_version=yes ;; - *) need_version=no ;; - esac - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' - shlibpath_var=LD_LIBRARY_PATH - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - case $host_os in - openbsd2.[89] | openbsd2.[89].*) - shlibpath_overrides_runpath=no - ;; - *) - shlibpath_overrides_runpath=yes - ;; - esac - else - shlibpath_overrides_runpath=yes - fi - ;; -os2*) - libname_spec='$name' - shrext_cmds=".dll" - need_lib_prefix=no - library_names_spec='$libname${shared_ext} $libname.a' - dynamic_linker='OS/2 ld.exe' - shlibpath_var=LIBPATH - ;; -osf3* | osf4* | osf5*) - version_type=osf - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" - sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" - ;; -solaris*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; -sunos4*) - version_type=sunos - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' - finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - if test "$with_gnu_ld" = yes; then - need_lib_prefix=no - fi - need_version=yes - ;; -sysv4 | sysv4.3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - export_dynamic_flag_spec='${wl}-Blargedynsym' - runpath_var=LD_RUN_PATH - ;; - siemens) - need_lib_prefix=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux - library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - version_type=freebsd-elf - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - hardcode_into_libs=yes - if test "$with_gnu_ld" = yes; then - sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' - shlibpath_overrides_runpath=no - else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - shlibpath_overrides_runpath=yes - case $host_os in - sco3.2v5*) - sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" - ;; - esac - fi - sys_lib_dlsearch_path_spec='/usr/lib' - ;; -uts4*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; -*) - dynamic_linker=no - ;; -esac -{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5 -echo "${ECHO_T}$dynamic_linker" >&6; } -test "$dynamic_linker" = no && can_build_shared=no -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" -fi -{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 -echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } -hardcode_action_CXX= -if test -n "$hardcode_libdir_flag_spec_CXX" || \ - test -n "$runpath_var_CXX" || \ - test "X$hardcode_automatic_CXX" = "Xyes" ; then - # We can hardcode non-existant directories. - if test "$hardcode_direct_CXX" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no && - test "$hardcode_minus_L_CXX" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action_CXX=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action_CXX=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action_CXX=unsupported -fi -{ echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5 -echo "${ECHO_T}$hardcode_action_CXX" >&6; } -if test "$hardcode_action_CXX" = relink; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless -fi -# The else clause should only fire when bootstrapping the -# libtool distribution, otherwise you forgot to ship ltmain.sh -# with your package, and you will get complaints that there are -# no rules to generate ltmain.sh. -if test -f "$ltmain"; then - # See if we are running on zsh, and set the options which allow our commands through - # without removal of \ escapes. - if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST - fi - # Now quote all the things that may contain metacharacters while being - # careful not to overquote the AC_SUBSTed values. We take copies of the - # variables and quote the copies for generation of the libtool script. - for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ - SED SHELL STRIP \ - libname_spec library_names_spec soname_spec extract_expsyms_cmds \ - old_striplib striplib file_magic_cmd finish_cmds finish_eval \ - deplibs_check_method reload_flag reload_cmds need_locks \ - lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ - lt_cv_sys_global_symbol_to_c_name_address \ - sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ - old_postinstall_cmds old_postuninstall_cmds \ - compiler_CXX \ - CC_CXX \ - LD_CXX \ - lt_prog_compiler_wl_CXX \ - lt_prog_compiler_pic_CXX \ - lt_prog_compiler_static_CXX \ - lt_prog_compiler_no_builtin_flag_CXX \ - export_dynamic_flag_spec_CXX \ - thread_safe_flag_spec_CXX \ - whole_archive_flag_spec_CXX \ - enable_shared_with_static_runtimes_CXX \ - old_archive_cmds_CXX \ - old_archive_from_new_cmds_CXX \ - predep_objects_CXX \ - postdep_objects_CXX \ - predeps_CXX \ - postdeps_CXX \ - compiler_lib_search_path_CXX \ - archive_cmds_CXX \ - archive_expsym_cmds_CXX \ - postinstall_cmds_CXX \ - postuninstall_cmds_CXX \ - old_archive_from_expsyms_cmds_CXX \ - allow_undefined_flag_CXX \ - no_undefined_flag_CXX \ - export_symbols_cmds_CXX \ - hardcode_libdir_flag_spec_CXX \ - hardcode_libdir_flag_spec_ld_CXX \ - hardcode_libdir_separator_CXX \ - hardcode_automatic_CXX \ - module_cmds_CXX \ - module_expsym_cmds_CXX \ - lt_cv_prog_compiler_c_o_CXX \ - exclude_expsyms_CXX \ - include_expsyms_CXX; do - - case $var in - old_archive_cmds_CXX | \ - old_archive_from_new_cmds_CXX | \ - archive_cmds_CXX | \ - archive_expsym_cmds_CXX | \ - module_cmds_CXX | \ - module_expsym_cmds_CXX | \ - old_archive_from_expsyms_cmds_CXX | \ - export_symbols_cmds_CXX | \ - extract_expsyms_cmds | reload_cmds | finish_cmds | \ - postinstall_cmds | postuninstall_cmds | \ - old_postinstall_cmds | old_postuninstall_cmds | \ - sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) - # Double-quote double-evaled strings. - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" - ;; - *) - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" - ;; - esac - done - case $lt_echo in - *'\$0 --fallback-echo"') - lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` - ;; - esac -cfgfile="$ofile" - cat <<__EOF__ >> "$cfgfile" -# ### BEGIN LIBTOOL TAG CONFIG: $tagname -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared -# Whether or not to build static libraries. -build_old_libs=$enable_static -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$archive_cmds_need_lc_CXX -# Whether or not to disallow shared libs when runtime libs are static -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install -# The host system. -host_alias=$host_alias -host=$host -host_os=$host_os -# The build system. -build_alias=$build_alias -build=$build -build_os=$build_os -# An echo program that does not interpret backslashes. -echo=$lt_echo -# The archiver. -AR=$lt_AR -AR_FLAGS=$lt_AR_FLAGS -# A C compiler. -LTCC=$lt_LTCC -# LTCC compiler flags. -LTCFLAGS=$lt_LTCFLAGS -# A language-specific compiler. -CC=$lt_compiler_CXX -# Is the compiler the GNU C compiler? -with_gcc=$GCC_CXX -gcc_dir=\`$CC -print-file-name=. | $SED 's,/\.$,,'\` -gcc_ver=\`$CC -dumpversion\` -# An ERE matcher. -EGREP=$lt_EGREP -# The linker used to build libraries. -LD=$lt_LD_CXX -# Whether we need hard or soft links. -LN_S=$lt_LN_S -# A BSD-compatible nm program. -NM=$lt_NM -# A symbol stripping program -STRIP=$lt_STRIP -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=$MAGIC_CMD -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" -# Used on cygwin: assembler. -AS="$AS" -# The name of the directory that contains temporary libtool files. -objdir=$objdir -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl_CXX -# Object file suffix (normally "o"). -objext="$ac_objext" -# Old archive suffix (normally "a"). -libext="$libext" -# Shared library suffix (normally ".so"). -shrext_cmds='$shrext_cmds' -# Executable file suffix (normally ""). -exeext="$exeext" -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic_CXX -pic_mode=$pic_mode -# What is the maximum length of a command? -max_cmd_len=$lt_cv_sys_max_cmd_len -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX -# Must we lock files when doing compilation? -need_locks=$lt_need_locks -# Do we need the lib prefix for modules? -need_lib_prefix=$need_lib_prefix -# Do we need a version for libraries? -need_version=$need_version -# Whether dlopen is supported. -dlopen_support=$enable_dlopen -# Whether dlopen of programs is supported. -dlopen_self=$enable_dlopen_self -# Whether dlopen of statically linked programs is supported. -dlopen_self_static=$enable_dlopen_self_static -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_lt_prog_compiler_static_CXX -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX -# Library versioning type. -version_type=$version_type -# Format of library name prefix. -libname_spec=$lt_libname_spec -# List of archive names. First name is the real one, the rest are links. -# The last name is the one that the linker finds with -lNAME. -library_names_spec=$lt_library_names_spec -# The coded name of the library, if different from the real name. -soname_spec=$lt_soname_spec -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_old_archive_cmds_CXX -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX -# Commands used to build and install a shared archive. -archive_cmds=$lt_archive_cmds_CXX -archive_expsym_cmds=$lt_archive_expsym_cmds_CXX -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds -# Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_module_cmds_CXX -module_expsym_cmds=$lt_module_expsym_cmds_CXX -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects=\`echo $lt_predep_objects_CXX | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` - -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects=\`echo $lt_postdep_objects_CXX | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` -# Dependencies to place before the objects being linked to create a -# shared library. -predeps=$lt_predeps_CXX -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_postdeps_CXX -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_CXX | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` -# Method to check whether dependent libraries are shared objects. -deplibs_check_method=$lt_deplibs_check_method -# Command to use when deplibs_check_method == file_magic. -file_magic_cmd=$lt_file_magic_cmd -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag_CXX -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag_CXX -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$lt_finish_eval -# Take the output of nm and produce a listing of raw symbols and C names. -global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe -# Transform the output of nm in a proper C declaration -global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl -# Transform the output of nm in a C name address pair -global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address -# This is the shared library runtime path variable. -runpath_var=$runpath_var -# This is the shared library path variable. -shlibpath_var=$shlibpath_var -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action_CXX -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX -# If ld is used when linking, flag to hardcode \$libdir into -# a binary during linking. This must work even if \$libdir does -# not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX -# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$hardcode_direct_CXX -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$hardcode_minus_L_CXX -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX -# Set to yes if building a shared library automatically hardcodes DIR into the library -# and all subsequent libraries and executables linked against it. -hardcode_automatic=$hardcode_automatic_CXX -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs_CXX -# Compile-time system search path for libraries -sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` -# Run-time system search path for libraries -sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$fix_srcfile_path_CXX" -# Set to yes if exported symbols are required. -always_export_symbols=$always_export_symbols_CXX -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds_CXX -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms_CXX -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms_CXX -# ### END LIBTOOL TAG CONFIG: $tagname -__EOF__ -else - # If there is no Makefile yet, we rely on a make rule to execute - # `config.status --recheck' to rerun these tests and create the - # libtool script then. - ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` - if test -f "$ltmain_in"; then - test -f Makefile && make "$ltmain" + + + + + + + + + + + + + + { 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 + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` + else + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # 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; } +}'` + sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` +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 + 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 + 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*) + if test "$host_cpu" = m68k; then + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + else + dynamic_linker=no + fi + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[45]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + 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="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${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 + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[123]*) objformat=aout ;; + *) objformat=elf ;; + esac fi -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 + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; -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 +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' + ;; -CC=$lt_save_CC -LDCXX=$LD -LD=$lt_save_LD -GCC=$lt_save_GCC -with_gnu_ldcxx=$with_gnu_ld -with_gnu_ld=$lt_save_with_gnu_ld -lt_cv_path_LDCXX=$lt_cv_path_LD -lt_cv_path_LD=$lt_save_path_LD -lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld -lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld +interix[3-9]*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux else - tagname="" - fi - ;; - - F77) - if test -n "$F77" && test "X$F77" != "Xno"; then - -ac_ext=f -ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5' -ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_f77_compiler_gnu - - -archive_cmds_need_lc_F77=no -allow_undefined_flag_F77= -always_export_symbols_F77=no -archive_expsym_cmds_F77= -export_dynamic_flag_spec_F77= -hardcode_direct_F77=no -hardcode_libdir_flag_spec_F77= -hardcode_libdir_flag_spec_ld_F77= -hardcode_libdir_separator_F77= -hardcode_minus_L_F77=no -hardcode_automatic_F77=no -module_cmds_F77= -module_expsym_cmds_F77= -link_all_deplibs_F77=unknown -old_archive_cmds_F77=$old_archive_cmds -no_undefined_flag_F77= -whole_archive_flag_spec_F77= -enable_shared_with_static_runtimes_F77=no - -# Source file extension for f77 test sources. -ac_ext=f - -# Object file extension for compiled f77 test sources. -objext=o -objext_F77=$objext - -# Code to be used in simple compile tests -lt_simple_compile_test_code=" subroutine t\n return\n end\n" + 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 + ;; -# Code to be used in simple link tests -lt_simple_link_test_code=" program t\n end\n" +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; -# ltmain only uses $CC for tagged configurations so make sure $CC is set. +# This must be Linux ELF. +linux* | k*bsd*-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' + 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 + 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. */ -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} +int +main () +{ -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + ; + 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 + shlibpath_overrides_runpath=yes +fi -# Allow CC to be a program name with arguments. -compiler=$CC +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -# save warnings/boilerplate of simple test code -ac_outfile=conftest.$ac_objext -printf "$lt_simple_compile_test_code" >conftest.$ac_ext -eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_compiler_boilerplate=`cat conftest.err` -$rm conftest* +fi -ac_outfile=conftest.$ac_objext -printf "$lt_simple_link_test_code" >conftest.$ac_ext -eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_linker_boilerplate=`cat conftest.err` -$rm conftest* +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + # 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 -# Allow CC to be a program name with arguments. -lt_save_CC="$CC" -CC=${F77-"f77"} -compiler=$CC -compiler_F77=$CC -for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + # 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;/^$/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' + ;; -{ 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; } +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 + ;; -{ 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 +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; -# 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 +*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' ;; -aix4* | aix5*) - if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then - test "$enable_shared" = yes && enable_static=no + +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 ;; -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; } +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 + ;; -GCC_F77="$G77" -LD_F77="$LD" +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" + ;; -lt_prog_compiler_wl_F77= -lt_prog_compiler_pic_F77= -lt_prog_compiler_static_F77= +rdos*) + dynamic_linker=no + ;; -{ 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; } +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; - if test "$GCC" = yes; then - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_static_F77='-static' +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 + ;; - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_F77='-Bstatic' - fi +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH ;; - - amigaos*) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4' + siemens) + need_lib_prefix=no ;; - - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; + esac + ;; - mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic_F77='-DDLL_EXPORT' - ;; +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic_F77='-fno-common' - ;; +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' + ;; - interix3*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. - ;; +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux + need_lib_prefix=no + need_version=no + library_name_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 + 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 - msdosdjgpp*) - # Just because we use GCC doesn't mean we suddenly get shared libraries - # on systems that don't support them. - lt_prog_compiler_can_build_shared_F77=no - enable_shared=no - ;; - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic_F77=-Kconform_pic - fi - ;; - hpux*) - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic_F77='-fPIC' - ;; - esac - ;; - *) - lt_prog_compiler_pic_F77='-fPIC' - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - lt_prog_compiler_wl_F77='-Wl,' - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_F77='-Bstatic' - else - lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp' - fi - ;; - darwin*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - case $cc_basename in - xlc*) - lt_prog_compiler_pic_F77='-qnocommon' - lt_prog_compiler_wl_F77='-Wl,' - ;; - esac - ;; - mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic_F77='-DDLL_EXPORT' - ;; - hpux9* | hpux10* | hpux11*) - lt_prog_compiler_wl_F77='-Wl,' - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic_F77='+Z' - ;; - esac - # Is there a better lt_prog_compiler_static that works with the bundled CC? - lt_prog_compiler_static_F77='${wl}-a ${wl}archive' - ;; - irix5* | irix6* | nonstopux*) - lt_prog_compiler_wl_F77='-Wl,' - # PIC (with -KPIC) is the default. - lt_prog_compiler_static_F77='-non_shared' - ;; - newsos6) - lt_prog_compiler_pic_F77='-KPIC' - lt_prog_compiler_static_F77='-Bstatic' - ;; - linux*) - case $cc_basename in - icc* | ecc*) - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_pic_F77='-KPIC' - lt_prog_compiler_static_F77='-static' - ;; - pgcc* | pgf77* | pgf90* | pgf95*) - # Portland Group compilers (*not* the Pentium gcc compiler, - # which looks to be a dead project) - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_pic_F77='-fpic' - lt_prog_compiler_static_F77='-Bstatic' - ;; - ccc*) - lt_prog_compiler_wl_F77='-Wl,' - # All Alpha code is PIC. - lt_prog_compiler_static_F77='-non_shared' - ;; - esac - ;; - osf3* | osf4* | osf5*) - lt_prog_compiler_wl_F77='-Wl,' - # All OSF/1 code is PIC. - lt_prog_compiler_static_F77='-non_shared' - ;; - solaris*) - lt_prog_compiler_pic_F77='-KPIC' - lt_prog_compiler_static_F77='-Bstatic' - case $cc_basename in - f77* | f90* | f95*) - lt_prog_compiler_wl_F77='-Qoption ld ';; - *) - lt_prog_compiler_wl_F77='-Wl,';; - esac - ;; - sunos4*) - lt_prog_compiler_wl_F77='-Qoption ld ' - lt_prog_compiler_pic_F77='-PIC' - lt_prog_compiler_static_F77='-Bstatic' - ;; - sysv4 | sysv4.2uw2* | sysv4.3*) - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_pic_F77='-KPIC' - lt_prog_compiler_static_F77='-Bstatic' - ;; - sysv4*MP*) - if test -d /usr/nec ;then - lt_prog_compiler_pic_F77='-Kconform_pic' - lt_prog_compiler_static_F77='-Bstatic' - fi - ;; - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_pic_F77='-KPIC' - lt_prog_compiler_static_F77='-Bstatic' - ;; - unicos*) - lt_prog_compiler_wl_F77='-Wl,' - lt_prog_compiler_can_build_shared_F77=no - ;; - uts4*) - lt_prog_compiler_pic_F77='-pic' - lt_prog_compiler_static_F77='-Bstatic' - ;; - *) - lt_prog_compiler_can_build_shared_F77=no - ;; - esac - fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6; } -# -# Check to make sure the PIC flag actually works. -# -if test -n "$lt_prog_compiler_pic_F77"; then -{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5 -echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6; } -if test "${lt_prog_compiler_pic_works_F77+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_pic_works_F77=no - ac_outfile=conftest.$ac_objext - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic_F77" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:14910: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:14914: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_pic_works_F77=yes - fi - fi - $rm conftest* -fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6; } -if test x"$lt_prog_compiler_pic_works_F77" = xyes; then - case $lt_prog_compiler_pic_F77 in - "" | " "*) ;; - *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;; - esac -else - lt_prog_compiler_pic_F77= - lt_prog_compiler_can_build_shared_F77=no -fi -fi -case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - lt_prog_compiler_pic_F77= - ;; - *) - lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77" - ;; -esac -# -# Check to make sure the static flag actually works. -# -wl=$lt_prog_compiler_wl_F77 eval lt_tmp_static_flag=\"$lt_prog_compiler_static_F77\" -{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } -if test "${lt_prog_compiler_static_works_F77+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_static_works_F77=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $lt_tmp_static_flag" - printf "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The linker can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&5 - $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_static_works_F77=yes - fi - else - lt_prog_compiler_static_works_F77=yes - fi - fi - $rm conftest* - LDFLAGS="$save_LDFLAGS" -fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_F77" >&5 -echo "${ECHO_T}$lt_prog_compiler_static_works_F77" >&6; } -if test x"$lt_prog_compiler_static_works_F77" = xyes; then - : -else - lt_prog_compiler_static_F77= -fi -{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 -echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } -if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_prog_compiler_c_o_F77=no - $rm -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:15014: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:15018: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp - $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then - lt_cv_prog_compiler_c_o_F77=yes - fi - fi - chmod u+w . 2>&5 - $rm conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files - $rm out/* && rmdir out - cd .. - rmdir conftest - $rm conftest* -fi -{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6; } -hard_links="nottested" -if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 -echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } - hard_links=yes - $rm conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - { echo "$as_me:$LINENO: result: $hard_links" >&5 -echo "${ECHO_T}$hard_links" >&6; } - if test "$hard_links" = no; then - { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} - need_locks=warn - fi -else - need_locks=no -fi -{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } - runpath_var= - allow_undefined_flag_F77= - enable_shared_with_static_runtimes_F77=no - archive_cmds_F77= - archive_expsym_cmds_F77= - old_archive_From_new_cmds_F77= - old_archive_from_expsyms_cmds_F77= - export_dynamic_flag_spec_F77= - whole_archive_flag_spec_F77= - thread_safe_flag_spec_F77= - hardcode_libdir_flag_spec_F77= - hardcode_libdir_flag_spec_ld_F77= - hardcode_libdir_separator_F77= - hardcode_direct_F77=no - hardcode_minus_L_F77=no - hardcode_shlibpath_var_F77=unsupported - link_all_deplibs_F77=unknown - hardcode_automatic_F77=no - module_cmds_F77= - module_expsym_cmds_F77= - always_export_symbols_F77=no - export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - include_expsyms_F77= - # exclude_expsyms can be an extended regexp of symbols to exclude - # it will be wrapped by ` (' and `)$', so one must not match beginning or - # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', - # as well as any symbol that contains `d'. - exclude_expsyms_F77="_GLOBAL_OFFSET_TABLE_" - # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out - # platforms (ab)use it in PIC code, but their linkers get confused if - # the symbol is explicitly referenced. Since portable code cannot - # rely on this symbol name, it's probably fine to never include it in - # preloaded symbol tables. - extract_expsyms_cmds= - # Just being paranoid about ensuring that cc_basename is set. - for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` - case $host_os in - cygwin* | mingw* | pw32*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - if test "$GCC" != yes; then - with_gnu_ld=no - fi - ;; - interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) - with_gnu_ld=yes - ;; - openbsd*) - with_gnu_ld=no - ;; - esac - ld_shlibs_F77=yes - if test "$with_gnu_ld" = yes; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' - # Set some defaults for GNU ld with shared library support. These - # are reset later if shared libraries are not supported. Putting them - # here allows them to be overridden if necessary. - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir' - export_dynamic_flag_spec_F77='${wl}--export-dynamic' - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec_F77= - fi - supports_anon_versioning=no - case `$LD -v 2>/dev/null` in - *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 - *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... - *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... - *\ 2.11.*) ;; # other 2.11 versions - *) supports_anon_versioning=yes ;; - esac - # See if GNU ld supports shared libraries. - case $host_os in - aix3* | aix4* | aix5*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - ld_shlibs_F77=no - cat <&2 -*** Warning: the GNU linker, at least up to release 2.9.1, is reported -*** to be unable to reliably create shared libraries on AIX. -*** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to modify your PATH -*** so that a non-GNU linker is found, and then restart. -EOF - fi - ;; - amigaos*) - archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_minus_L_F77=yes - # Samuel A. Falvo II reports - # that the semantics of dynamic libraries on AmigaOS, at least up - # to version 4, is to share data among multiple programs linked - # with the same dynamic library. Since this doesn't match the - # behavior of shared libraries on other platforms, we can't use - # them. - ld_shlibs_F77=no - ;; - beos*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag_F77=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - ld_shlibs_F77=no - fi - ;; - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec_F77='-L$libdir' - allow_undefined_flag_F77=unsupported - always_export_symbols_F77=no - enable_shared_with_static_runtimes_F77=yes - export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - ld_shlibs_F77=no - fi - ;; - interix3*) - hardcode_direct_F77=no - hardcode_shlibpath_var_F77=no - hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' - export_dynamic_flag_spec_F77='${wl}-E' - # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. - # Instead, shared libraries are loaded at an image base (0x10000000 by - # default) and relocated if they conflict, which is a slow very memory - # consuming and fragmenting process. To avoid this, we pick a random, - # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link - # time. Moving up from 0x10000000 also allows more sbrk(2) space. - archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - archive_expsym_cmds_F77='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - ;; - linux*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - tmp_addflag= - case $cc_basename,$host_cpu in - pgcc*) # Portland Group C compiler - whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag' - ;; - pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers - whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag -Mnomain' ;; - ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 - tmp_addflag=' -i_dynamic' ;; - efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 - tmp_addflag=' -i_dynamic -nofor_main' ;; - ifc* | ifort*) # Intel Fortran compiler - tmp_addflag=' -nofor_main' ;; - esac - archive_cmds_F77='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - if test $supports_anon_versioning = yes; then - archive_expsym_cmds_F77='$echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - $echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - fi - else - ld_shlibs_F77=no - fi - ;; - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - fi - ;; - solaris*) - if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then - ld_shlibs_F77=no - cat <&2 -*** Warning: The releases 2.8.* of the GNU linker cannot reliably -*** create shared libraries on Solaris systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.9.1 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. -EOF - elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs_F77=no - fi - ;; - sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) - case `$LD -v 2>&1` in - *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) - ld_shlibs_F77=no - cat <<_LT_EOF 1>&2 -*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not -*** reliably create shared libraries on SCO systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.16.91.0.3 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. -_LT_EOF - ;; - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' - archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' - archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' - else - ld_shlibs_F77=no - fi - ;; - esac - ;; - sunos4*) - archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - hardcode_direct_F77=yes - hardcode_shlibpath_var_F77=no - ;; - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs_F77=no - fi - ;; - esac - if test "$ld_shlibs_F77" = no; then - runpath_var= - hardcode_libdir_flag_spec_F77= - export_dynamic_flag_spec_F77= - whole_archive_flag_spec_F77= - fi - else - # PORTME fill in a description of your system's linker (not GNU ld) - case $host_os in - aix3*) - allow_undefined_flag_F77=unsupported - always_export_symbols_F77=yes - archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - hardcode_minus_L_F77=yes - if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - hardcode_direct_F77=unsupported - fi - ;; - aix4* | aix5*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - if $NM -V 2>&1 | grep 'GNU' > /dev/null; then - export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - else - export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' - fi - aix_use_runtimelinking=no - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[23]|aix4.[23].*|aix5*) - for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then - aix_use_runtimelinking=yes - break - fi - done - ;; - esac - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - archive_cmds_F77='' - hardcode_direct_F77=yes - hardcode_libdir_separator_F77=':' - link_all_deplibs_F77=yes - if test "$GCC" = yes; then - case $host_os in aix4.[012]|aix4.[012].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && \ - strings "$collect2name" | grep resolve_lib_name >/dev/null - then - # We have reworked collect2 - hardcode_direct_F77=yes - else - # We have old collect2 - hardcode_direct_F77=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - hardcode_minus_L_F77=yes - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_libdir_separator_F77= - fi - ;; - esac - shared_flag='-shared' - if test "$aix_use_runtimelinking" = yes; then - shared_flag="$shared_flag "'${wl}-G' - fi - else - # not using gcc - if test "$host_cpu" = ia64; then - # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release - # chokes on -Wl,-G. The following line is correct: - shared_flag='-G' - else - if test "$aix_use_runtimelinking" = yes; then - shared_flag='${wl}-G' - else - shared_flag='${wl}-bM:SRE' - fi - fi - fi - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - always_export_symbols_F77=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - allow_undefined_flag_F77='-berok' - # Determine the default libpath from the value encoded in an empty executable. - cat >conftest.$ac_ext <<_ACEOF - program main - end -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (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_f77_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag_F77="-z nodefs" - archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an empty executable. - cat >conftest.$ac_ext <<_ACEOF - program main - end -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (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_f77_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - no_undefined_flag_F77=' ${wl}-bernotok' - allow_undefined_flag_F77=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec_F77='$convenience' - archive_cmds_need_lc_F77=yes - # This is similar to how AIX traditionally builds its shared libraries. - archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - amigaos*) - archive_cmds_F77='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_minus_L_F77=yes - # see comment about different semantics on the GNU ld section - ld_shlibs_F77=no - ;; - bsdi[45]*) - export_dynamic_flag_spec_F77=-rdynamic - ;; - cygwin* | mingw* | pw32*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - hardcode_libdir_flag_spec_F77=' ' - allow_undefined_flag_F77=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - old_archive_From_new_cmds_F77='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs' - fix_srcfile_path_F77='`cygpath -w "$srcfile"`' - enable_shared_with_static_runtimes_F77=yes - ;; - darwin* | rhapsody*) - case $host_os in - rhapsody* | darwin1.[012]) - allow_undefined_flag_F77='${wl}-undefined ${wl}suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[012]) - allow_undefined_flag_F77='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - ;; - 10.*) - allow_undefined_flag_F77='${wl}-undefined ${wl}dynamic_lookup' - ;; - esac - fi - ;; - esac - archive_cmds_need_lc_F77=no - hardcode_direct_F77=no - hardcode_automatic_F77=yes - hardcode_shlibpath_var_F77=unsupported - whole_archive_flag_spec_F77='' - link_all_deplibs_F77=yes - if test "$GCC" = yes ; then - output_verbose_link_cmd='echo' - archive_cmds_F77='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - case $cc_basename in - xlc*) - output_verbose_link_cmd='echo' - archive_cmds_F77='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' - module_cmds_F77='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - ;; - *) - ld_shlibs_F77=no - ;; - esac - fi - ;; - dgux*) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_shlibpath_var_F77=no - ;; - freebsd1*) - ld_shlibs_F77=no - ;; - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor - # support. Future versions do this automatically, but an explicit c++rt0.o - # does not break anything, and helps significantly (at the cost of a little - # extra space). - freebsd2.2*) - archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - hardcode_libdir_flag_spec_F77='-R$libdir' - hardcode_direct_F77=yes - hardcode_shlibpath_var_F77=no - ;; - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) - archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_F77=yes - hardcode_minus_L_F77=yes - hardcode_shlibpath_var_F77=no - ;; - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | kfreebsd*-gnu | dragonfly*) - archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec_F77='-R$libdir' - hardcode_direct_F77=yes - hardcode_shlibpath_var_F77=no - ;; + { 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 + - hpux9*) - if test "$GCC" = yes; then - archive_cmds_F77='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - archive_cmds_F77='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - fi - hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_F77=: - hardcode_direct_F77=yes - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_F77=yes - export_dynamic_flag_spec_F77='${wl}-E' - ;; - hpux10*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_F77=: - hardcode_direct_F77=yes - export_dynamic_flag_spec_F77='${wl}-E' - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_F77=yes - fi - ;; + 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= - hpux11*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - case $host_cpu in - hppa*64*) - archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - else - case $host_cpu in - hppa*64*) - archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_F77=: + case $host_os in + beos*) + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; - case $host_cpu in - hppa*64*|ia64*) - hardcode_libdir_flag_spec_ld_F77='+b $libdir' - hardcode_direct_F77=no - hardcode_shlibpath_var_F77=no - ;; - *) - hardcode_direct_F77=yes - export_dynamic_flag_spec_F77='${wl}-E' + mingw* | pw32*) + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_F77=yes - ;; - esac - fi - ;; + cygwin*) + lt_cv_dlopen="dlopen" + lt_cv_dlopen_libs= + ;; - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec_ld_F77='-rpath $libdir' - fi - hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_F77=: - link_all_deplibs_F77=yes - ;; + 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. */ - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - hardcode_libdir_flag_spec_F77='-R$libdir' - hardcode_direct_F77=yes - hardcode_shlibpath_var_F77=no - ;; +/* 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 - newsos6) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_F77=yes - hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_F77=: - hardcode_shlibpath_var_F77=no - ;; + ac_cv_lib_dl_dlopen=no +fi - openbsd*) - hardcode_direct_F77=yes - hardcode_shlibpath_var_F77=no - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' - export_dynamic_flag_spec_F77='${wl}-E' - else - case $host_os in - openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) - archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_F77='-R$libdir' - ;; - *) - archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir' - ;; - esac - fi - ;; +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 - os2*) - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_minus_L_F77=yes - allow_undefined_flag_F77=unsupported - archive_cmds_F77='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; + lt_cv_dlopen="dyld" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes - osf3*) - if test "$GCC" = yes; then - allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - allow_undefined_flag_F77=' -expect_unresolved \*' - archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - fi - hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_F77=: - ;; +fi - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir' - else - allow_undefined_flag_F77=' -expect_unresolved \*' - archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ - $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' + ;; - # Both c and cxx compiler support -rpath directly - hardcode_libdir_flag_spec_F77='-rpath $libdir' - fi - hardcode_libdir_separator_F77=: - ;; + *) + { 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 - solaris*) - no_undefined_flag_F77=' -z text' - if test "$GCC" = yes; then - wlarc='${wl}' - archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' - else - wlarc='' - archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' - fi - hardcode_libdir_flag_spec_F77='-R$libdir' - hardcode_shlibpath_var_F77=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) - # The compiler driver will combine linker options so we - # cannot just pass the convience library names through - # without $wl, iff we do not link with $LD. - # Luckily, gcc supports the same syntax we need for Sun Studio. - # Supported since Solaris 2.6 (maybe 2.5.1?) - case $wlarc in - '') - whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;; - *) - whole_archive_flag_spec_F77='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; - esac ;; - esac - link_all_deplibs_F77=yes - ;; +/* 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. */ - sunos4*) - if test "x$host_vendor" = xsequent; then - # Use $CC to link under sequent, because it throws in some extra .o - # files that make .init and .fini sections work. - archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_direct_F77=yes - hardcode_minus_L_F77=yes - hardcode_shlibpath_var_F77=no - ;; +#ifdef __STDC__ +# include +#else +# include +#endif - sysv4) - case $host_vendor in - sni) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_F77=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags' - reload_cmds_F77='$CC -r -o $output$reload_objs' - hardcode_direct_F77=no - ;; - motorola) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var_F77=no - ;; +#undef shl_load - sysv4.3*) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var_F77=no - export_dynamic_flag_spec_F77='-Bexport' - ;; +/* 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 - sysv4*MP*) - if test -d /usr/nec; then - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var_F77=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ld_shlibs_F77=yes - fi - ;; +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 - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) - no_undefined_flag_F77='${wl}-z,text' - archive_cmds_need_lc_F77=no - hardcode_shlibpath_var_F77=no - runpath_var='LD_RUN_PATH' + ac_cv_func_shl_load=no +fi - if test "$GCC" = yes; then - archive_cmds_F77='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_F77='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; +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. */ - sysv5* | sco3.2v5* | sco5v6*) - # Note: We can NOT use -z defs as we might desire, because we do not - # link with -lc, and that would cause any symbols used from libc to - # always be unresolved, which means just about no library would - # ever link correctly. If we're not using GNU ld we use -z text - # though, which does catch some bad symbols but isn't as heavy-handed - # as -z defs. - no_undefined_flag_F77='${wl}-z,text' - allow_undefined_flag_F77='${wl}-z,nodefs' - archive_cmds_need_lc_F77=no - hardcode_shlibpath_var_F77=no - hardcode_libdir_flag_spec_F77='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' - hardcode_libdir_separator_F77=':' - link_all_deplibs_F77=yes - export_dynamic_flag_spec_F77='${wl}-Bexport' - runpath_var='LD_RUN_PATH' +/* 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 - if test "$GCC" = yes; then - archive_cmds_F77='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_F77='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; + ac_cv_lib_dld_shl_load=no +fi - uts4*) - archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_F77='-L$libdir' - hardcode_shlibpath_var_F77=no - ;; +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 - *) - ld_shlibs_F77=no - ;; - esac - fi +/* 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. */ -{ echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5 -echo "${ECHO_T}$ld_shlibs_F77" >&6; } -test "$ld_shlibs_F77" = no && can_build_shared=no +#ifdef __STDC__ +# include +#else +# include +#endif -# -# Do we need to explicitly link libc? -# -case "x$archive_cmds_need_lc_F77" in -x|xyes) - # Assume -lc should be added - archive_cmds_need_lc_F77=yes +#undef dlopen - if test "$enable_shared" = yes && test "$GCC" = yes; then - case $archive_cmds_F77 in - *'~'*) - # FIXME: we may have to deal with multi-command sequences. - ;; - '$CC '*) - # Test whether the compiler implicitly links with -lc since on some - # systems, -lgcc has to come before -lc. If gcc already passes -lc - # to ld, don't add -lc before -lgcc. - { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 -echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } - $rm conftest* - printf "$lt_simple_compile_test_code" > conftest.$ac_ext +/* 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 - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } 2>conftest.err; then - soname=conftest - lib=conftest - libobjs=conftest.$ac_objext - deplibs= - wl=$lt_prog_compiler_wl_F77 - pic_flag=$lt_prog_compiler_pic_F77 - compiler_flags=-v - linker_flags=-v - verstring= - output_objdir=. - libname=conftest - lt_save_allow_undefined_flag=$allow_undefined_flag_F77 - allow_undefined_flag_F77= - if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 - (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 +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); } - then - archive_cmds_need_lc_F77=no - else - archive_cmds_need_lc_F77=yes - fi - allow_undefined_flag_F77=$lt_save_allow_undefined_flag - else - cat conftest.err 1>&5 - fi - $rm conftest* - { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5 -echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6; } - ;; - esac - fi - ;; -esac - -{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 -echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6; } -library_names_spec= -libname_spec='lib$name' -soname_spec= -shrext_cmds=".so" -postinstall_cmds= -postuninstall_cmds= -finish_cmds= -finish_eval= -shlibpath_var= -shlibpath_overrides_runpath=unknown -version_type=none -dynamic_linker="$host_os ld.so" -sys_lib_dlsearch_path_spec="/lib /usr/lib" -if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi + (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 - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_func_dlopen=no fi -need_lib_prefix=unknown -hardcode_into_libs=no -# when you set need_version to no, make sure it does not cause -set_version -# flags to be left without arguments -need_version=unknown +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 -case $host_os in -aix3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' - shlibpath_var=LIBPATH + ac_cv_lib_dl_dlopen=no +fi - # AIX 3 has no versioning support, so we append a major version to the name. - soname_spec='${libname}${release}${shared_ext}$major' - ;; +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. */ -aix4* | aix5*) - version_type=linux - need_lib_prefix=no - need_version=no - hardcode_into_libs=yes - if test "$host_cpu" = ia64; then - # AIX 5 supports IA64 - library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - else - # With GCC up to 2.95.x, collect2 would create an import file - # for dependence libraries. The import file would start with - # the line `#! .'. This would cause the generated library to - # depend on `.', always an invalid library. This was fixed in - # development snapshots of GCC prior to 3.0. - case $host_os in - aix4 | aix4.[01] | aix4.[01].*) - if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' - echo ' yes ' - echo '#endif'; } | ${CC} -E - | grep yes > /dev/null; then - : - else - can_build_shared=no - fi - ;; - esac - # AIX (on Power*) has no versioning support, so currently we can not hardcode correct - # soname into executable. Probably we can add versioning support to - # collect2, so additional links can be useful in future. - if test "$aix_use_runtimelinking" = yes; then - # If using run time linking (on AIX 4.2 or later) use lib.so - # instead of lib.a to let people know that these are not - # typical AIX shared libraries. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - else - # We preserve .a as extension for shared libraries through AIX4.2 - # and later when we are not doing run time linking. - library_names_spec='${libname}${release}.a $libname.a' - soname_spec='${libname}${release}${shared_ext}$major' - fi - shlibpath_var=LIBPATH - fi - ;; +/* 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 -amigaos*) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' - ;; + ac_cv_lib_svld_dlopen=no +fi -beos*) - library_names_spec='${libname}${shared_ext}' - dynamic_linker="$host_os ld.so" - shlibpath_var=LIBRARY_PATH - ;; +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. */ -bsdi[45]*) - version_type=linux - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' - shlibpath_var=LD_LIBRARY_PATH - sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" - sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" - # the default ld.so.conf also contains /usr/contrib/lib and - # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow - # libtool to hard-code these into programs - ;; +/* 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 -cygwin* | mingw* | pw32*) - version_type=windows - shrext_cmds=".dll" - need_version=no - need_lib_prefix=no + ac_cv_lib_dld_dld_link=no +fi - case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32*) - library_names_spec='$libname.dll.a' - # DLL is installed to $(libdir)/../bin by postinstall_cmds - postinstall_cmds='base_file=`basename \${file}`~ - dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~ - dldir=$destdir/`dirname \$dlpath`~ - test -d \$dldir || mkdir -p \$dldir~ - $install_prog $dir/$dlname \$dldir/$dlname~ - chmod a+x \$dldir/$dlname' - postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ - dlpath=$dir/\$dldll~ - $rm \$dlpath' - shlibpath_overrides_runpath=yes +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 - case $host_os in - cygwin*) - # Cygwin DLLs use 'cyg' prefix rather than 'lib' - soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" - ;; - mingw*) - # MinGW DLLs use traditional 'lib' prefix - soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then - # It is most probably a Windows format PATH printed by - # mingw gcc, but we are running on Cygwin. Gcc prints its search - # path with ; separators, and with drive letters. We can handle the - # drive letters (cygwin fileutils understands them), so leave them, - # especially as we might pass files found there to a mingw objdump, - # which wouldn't understand a cygwinified path. Ahh. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi - ;; - pw32*) - # pw32 DLLs use 'pw' prefix rather than 'lib' - library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - ;; - esac - ;; - *) - library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' - ;; - esac - dynamic_linker='Win32 ld.exe' - # FIXME: first we should search . and the directory the executable is in - shlibpath_var=PATH - ;; +fi -darwin* | rhapsody*) - dynamic_linker="$host_os dyld" - version_type=darwin - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' - soname_spec='${libname}${release}${major}$shared_ext' - shlibpath_overrides_runpath=yes - shlibpath_var=DYLD_LIBRARY_PATH - shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' - # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. - if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` - else - sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' - fi - sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' - ;; -dgux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; +fi -freebsd1*) - dynamic_linker=no - ;; -kfreebsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='GNU ld.so' - ;; +fi -freebsd* | dragonfly*) - # DragonFly does not have aout. When/if they implement a new - # versioning mechanism, adjust this. - if test -x /usr/bin/objformat; then - objformat=`/usr/bin/objformat` - else - case $host_os in - freebsd[123]*) objformat=aout ;; - *) objformat=elf ;; - esac - fi - version_type=freebsd-$objformat - case $version_type in - freebsd-elf*) - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - need_version=no - need_lib_prefix=no - ;; - freebsd-*) - library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' - need_version=yes - ;; - esac - shlibpath_var=LD_LIBRARY_PATH - case $host_os in - freebsd2*) - shlibpath_overrides_runpath=yes - ;; - freebsd3.[01]* | freebsdelf3.[01]*) - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ - freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; - freebsd*) # from 4.6 on - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - ;; - esac - ;; -gnu*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - hardcode_into_libs=yes - ;; +fi -hpux9* | hpux10* | hpux11*) - # Give a soname corresponding to the major version so that dld.sl refuses to - # link against other versions. - version_type=sunos - need_lib_prefix=no - need_version=no - case $host_cpu in - ia64*) - shrext_cmds='.so' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.so" - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - if test "X$HPUX_IA64_MODE" = X32; then - sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" - else - sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" - fi - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - hppa*64*) - shrext_cmds='.sl' - hardcode_into_libs=yes - dynamic_linker="$host_os dld.sl" - shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH - shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" - sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec - ;; - *) - shrext_cmds='.sl' - dynamic_linker="$host_os dld.sl" - shlibpath_var=SHLIB_PATH - shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - ;; - esac - # HP-UX runs *really* slowly unless shared libraries are mode 555. - postinstall_cmds='chmod 555 $lib' - ;; -interix3*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - ;; +fi -irix5* | irix6* | nonstopux*) - case $host_os in - nonstopux*) version_type=nonstopux ;; - *) - if test "$lt_cv_prog_gnu_ld" = yes; then - version_type=linux - else - version_type=irix - fi ;; - esac - need_lib_prefix=no - need_version=no - soname_spec='${libname}${release}${shared_ext}$major' - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' - case $host_os in - irix5* | nonstopux*) - libsuff= shlibsuff= - ;; - *) - case $LD in # libtool.m4 will add one of these switches to LD - *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") - libsuff= shlibsuff= libmagic=32-bit;; - *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") - libsuff=32 shlibsuff=N32 libmagic=N32;; - *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") - libsuff=64 shlibsuff=64 libmagic=64-bit;; - *) libsuff= shlibsuff= libmagic=never-match;; - esac ;; esac - shlibpath_var=LD_LIBRARY${shlibsuff}_PATH - shlibpath_overrides_runpath=no - sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" - sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" - hardcode_into_libs=yes - ;; -# No shared lib support for Linux oldld, aout, or coff. -linux*oldld* | linux*aout* | linux*coff*) - dynamic_linker=no - ;; + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + else + enable_dlopen=no + fi -# This must be Linux ELF. -linux*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - # This implies no fast_install, which is unacceptable. - # Some rework will be needed to allow for fast_install - # before this can be enabled. - hardcode_into_libs=yes + case $lt_cv_dlopen in + dlopen) + save_CPPFLAGS="$CPPFLAGS" + test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" - # find out which ABI we are using - libsuff= - case "$host_cpu" in - x86_64*|s390x*|powerpc64*) - echo '#line 16459 "configure"' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - case `/usr/bin/file conftest.$ac_objext` in - *64-bit*) - libsuff=64 - sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" - ;; - esac - fi - rm -rf conftest* - ;; - esac + 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 12746 "configure" +#include "confdefs.h" - # Append ld.so.conf contents to the search path - if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" - fi +#if HAVE_DLFCN_H +#include +#endif - # 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' - ;; +#include -knetbsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='GNU ld.so' - ;; +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif -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 - ;; +/* 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 -newsos6) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; +#ifdef __cplusplus +extern "C" void exit (int); +#endif -nto-qnx*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - ;; +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; -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 + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } else - shlibpath_overrides_runpath=yes + puts (dlerror ()); + + exit (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* -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" - ;; +fi +{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 +echo "${ECHO_T}$lt_cv_dlopen_self" >&6; } -solaris*) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=yes - hardcode_into_libs=yes - # ldd complains unless libraries are executable - postinstall_cmds='chmod +x $lib' - ;; + 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 12846 "configure" +#include "confdefs.h" -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 - ;; +#if HAVE_DLFCN_H +#include +#endif -sysv4 | sysv4.3*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - case $host_vendor in - sni) - shlibpath_overrides_runpath=no - need_lib_prefix=no - export_dynamic_flag_spec='${wl}-Blargedynsym' - runpath_var=LD_RUN_PATH - ;; - siemens) - need_lib_prefix=no - ;; - motorola) - need_lib_prefix=no - need_version=no - shlibpath_overrides_runpath=no - sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' - ;; - esac - ;; +#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 -sysv4*MP*) - if test -d /usr/nec ;then - version_type=linux - library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' - soname_spec='$libname${shared_ext}.$major' - shlibpath_var=LD_LIBRARY_PATH - fi - ;; +#ifdef __cplusplus +extern "C" void exit (int); +#endif -sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) - version_type=freebsd-elf - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - hardcode_into_libs=yes - if test "$with_gnu_ld" = yes; then - sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' - shlibpath_overrides_runpath=no +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } else - sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - shlibpath_overrides_runpath=yes - case $host_os in - sco3.2v5*) - sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" - ;; + puts (dlerror ()); + + exit (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 - sys_lib_dlsearch_path_spec='/usr/lib' - ;; - -uts4*) - version_type=linux - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - ;; +fi +rm -fr conftest* -*) - dynamic_linker=no - ;; -esac -{ echo "$as_me:$LINENO: result: $dynamic_linker" >&5 -echo "${ECHO_T}$dynamic_linker" >&6; } -test "$dynamic_linker" = no && can_build_shared=no -variables_saved_for_relink="PATH $shlibpath_var $runpath_var" -if test "$GCC" = yes; then - variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi +{ echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 +echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6; } + fi -{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 -echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } -hardcode_action_F77= -if test -n "$hardcode_libdir_flag_spec_F77" || \ - test -n "$runpath_var_F77" || \ - test "X$hardcode_automatic_F77" = "Xyes" ; then + CPPFLAGS="$save_CPPFLAGS" + LDFLAGS="$save_LDFLAGS" + LIBS="$save_LIBS" + ;; + esac - # We can hardcode non-existant directories. - if test "$hardcode_direct_F77" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no && - test "$hardcode_minus_L_F77" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action_F77=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action_F77=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action_F77=unsupported -fi -{ echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5 -echo "${ECHO_T}$hardcode_action_F77" >&6; } + case $lt_cv_dlopen_self in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac -if test "$hardcode_action_F77" = relink; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless + 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 -# The else clause should only fire when bootstrapping the -# libtool distribution, otherwise you forgot to ship ltmain.sh -# with your package, and you will get complaints that there are -# no rules to generate ltmain.sh. -if test -f "$ltmain"; then - # See if we are running on zsh, and set the options which allow our commands through - # without removal of \ escapes. - if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST - fi - # Now quote all the things that may contain metacharacters while being - # careful not to overquote the AC_SUBSTed values. We take copies of the - # variables and quote the copies for generation of the libtool script. - for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ - SED SHELL STRIP \ - libname_spec library_names_spec soname_spec extract_expsyms_cmds \ - old_striplib striplib file_magic_cmd finish_cmds finish_eval \ - deplibs_check_method reload_flag reload_cmds need_locks \ - lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ - lt_cv_sys_global_symbol_to_c_name_address \ - sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ - old_postinstall_cmds old_postuninstall_cmds \ - compiler_F77 \ - CC_F77 \ - LD_F77 \ - lt_prog_compiler_wl_F77 \ - lt_prog_compiler_pic_F77 \ - lt_prog_compiler_static_F77 \ - lt_prog_compiler_no_builtin_flag_F77 \ - export_dynamic_flag_spec_F77 \ - thread_safe_flag_spec_F77 \ - whole_archive_flag_spec_F77 \ - enable_shared_with_static_runtimes_F77 \ - old_archive_cmds_F77 \ - old_archive_from_new_cmds_F77 \ - predep_objects_F77 \ - postdep_objects_F77 \ - predeps_F77 \ - postdeps_F77 \ - compiler_lib_search_path_F77 \ - archive_cmds_F77 \ - archive_expsym_cmds_F77 \ - postinstall_cmds_F77 \ - postuninstall_cmds_F77 \ - old_archive_from_expsyms_cmds_F77 \ - allow_undefined_flag_F77 \ - no_undefined_flag_F77 \ - export_symbols_cmds_F77 \ - hardcode_libdir_flag_spec_F77 \ - hardcode_libdir_flag_spec_ld_F77 \ - hardcode_libdir_separator_F77 \ - hardcode_automatic_F77 \ - module_cmds_F77 \ - module_expsym_cmds_F77 \ - lt_cv_prog_compiler_c_o_F77 \ - exclude_expsyms_F77 \ - include_expsyms_F77; do - - case $var in - old_archive_cmds_F77 | \ - old_archive_from_new_cmds_F77 | \ - archive_cmds_F77 | \ - archive_expsym_cmds_F77 | \ - module_cmds_F77 | \ - module_expsym_cmds_F77 | \ - old_archive_from_expsyms_cmds_F77 | \ - export_symbols_cmds_F77 | \ - extract_expsyms_cmds | reload_cmds | finish_cmds | \ - postinstall_cmds | postuninstall_cmds | \ - old_postinstall_cmds | old_postuninstall_cmds | \ - sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) - # Double-quote double-evaled strings. - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" - ;; - *) - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" - ;; - esac - done - case $lt_echo in - *'\$0 --fallback-echo"') - lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` - ;; - esac -cfgfile="$ofile" - cat <<__EOF__ >> "$cfgfile" -# ### BEGIN LIBTOOL TAG CONFIG: $tagname -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared -# Whether or not to build static libraries. -build_old_libs=$enable_static -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$archive_cmds_need_lc_F77 -# Whether or not to disallow shared libs when runtime libs are static -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77 -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install -# The host system. -host_alias=$host_alias -host=$host -host_os=$host_os -# The build system. -build_alias=$build_alias -build=$build -build_os=$build_os -# An echo program that does not interpret backslashes. -echo=$lt_echo -# The archiver. -AR=$lt_AR -AR_FLAGS=$lt_AR_FLAGS -# A C compiler. -LTCC=$lt_LTCC +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 -# LTCC compiler flags. -LTCFLAGS=$lt_LTCFLAGS -# A language-specific compiler. -CC=$lt_compiler_F77 -# Is the compiler the GNU C compiler? -with_gcc=$GCC_F77 -gcc_dir=\`$CC -print-file-name=. | $SED 's,/\.$,,'\` -gcc_ver=\`$CC -dumpversion\` -# An ERE matcher. -EGREP=$lt_EGREP -# The linker used to build libraries. -LD=$lt_LD_F77 -# Whether we need hard or soft links. -LN_S=$lt_LN_S -# A BSD-compatible nm program. -NM=$lt_NM -# A symbol stripping program -STRIP=$lt_STRIP -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=$MAGIC_CMD -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" + # 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; } -# Used on cygwin: assembler. -AS="$AS" + { 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 -# The name of the directory that contains temporary libtool files. -objdir=$objdir + # 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 + ;; -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds + 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; } -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl_F77 + { 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; } -# Object file suffix (normally "o"). -objext="$ac_objext" -# Old archive suffix (normally "a"). -libext="$libext" -# Shared library suffix (normally ".so"). -shrext_cmds='$shrext_cmds' -# Executable file suffix (normally ""). -exeext="$exeext" +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 -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic_F77 -pic_mode=$pic_mode +CC="$lt_save_CC" -# What is the maximum length of a command? -max_cmd_len=$lt_cv_sys_max_cmd_len -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77 +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 -# Must we lock files when doing compilation? -need_locks=$lt_need_locks +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_flag_spec_ld_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 +no_undefined_flag_CXX= +whole_archive_flag_spec_CXX= +enable_shared_with_static_runtimes_CXX=no -# Do we need the lib prefix for modules? -need_lib_prefix=$need_lib_prefix +# Source file extension for C++ test sources. +ac_ext=cpp -# Do we need a version for libraries? -need_version=$need_version +# Object file extension for compiled C++ test sources. +objext=o +objext_CXX=$objext -# Whether dlopen is supported. -dlopen_support=$enable_dlopen +# 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. -# Whether dlopen of programs is supported. -dlopen_self=$enable_dlopen_self -# Whether dlopen of statically linked programs is supported. -dlopen_self_static=$enable_dlopen_self_static -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_lt_prog_compiler_static_F77 -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77 -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77 -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77 +# If no C compiler was specified, use CC. +LTCC=${LTCC-"$CC"} -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77 +# If no C compiler flags were specified, use CFLAGS. +LTCFLAGS=${LTCFLAGS-"$CFLAGS"} -# Library versioning type. -version_type=$version_type +# Allow CC to be a program name with arguments. +compiler=$CC -# 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 + # 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* -# The coded name of the library, if different from the real name. -soname_spec=$lt_soname_spec + 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* -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_old_archive_cmds_F77 -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77 + # Allow CC to be a program name with arguments. + lt_save_CC=$CC + lt_save_LD=$LD + lt_save_GCC=$GCC + GCC=$GXX + lt_save_with_gnu_ld=$with_gnu_ld + lt_save_path_LD=$lt_cv_path_LD + if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx + else + $as_unset lt_cv_prog_gnu_ld + fi + if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX + else + $as_unset lt_cv_path_LD + fi + test -z "${LDCXX+set}" || LD=$LDCXX + CC=${CXX-"c++"} + compiler=$CC + compiler_CXX=$CC + for cc_temp in $compiler""; do + case $cc_temp in + compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; + distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77 -# Commands used to build and install a shared archive. -archive_cmds=$lt_archive_cmds_F77 -archive_expsym_cmds=$lt_archive_expsym_cmds_F77 -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds + 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 -# Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_module_cmds_F77 -module_expsym_cmds=$lt_module_expsym_cmds_F77 + if test "$GXX" = yes; then + # Set up default GNU C++ configuration -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects=\`echo $lt_predep_objects_F77 | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` - -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects=\`echo $lt_postdep_objects_F77 | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` - -# Dependencies to place before the objects being linked to create a -# shared library. -predeps=$lt_predeps_F77 - -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_postdeps_F77 -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_F77 | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` +# 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 -# Method to check whether dependent libraries are shared objects. -deplibs_check_method=$lt_deplibs_check_method +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 -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag_F77 -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag_F77 -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$lt_finish_eval -# Take the output of nm and produce a listing of raw symbols and C names. -global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe -# Transform the output of nm in a proper C declaration -global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl -# Transform the output of nm in a C name address pair -global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address + # Check if GNU C++ uses GNU ld as the underlying linker, since the + # archiving commands below assume that GNU ld is being used. + if test "$with_gnu_ld" = yes; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + + # If archive_cmds runs LD, not CC, wlarc should be empty + # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to + # investigate it a little bit more. (MM) + wlarc='${wl}' + + # ancient GNU ld didn't support --whole-archive et. al. + if eval "`$CC -print-prog-name=ld` --help 2>&1" | + $GREP 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec_CXX= + fi + else + with_gnu_ld=no + wlarc= -# This is the shared library runtime path variable. -runpath_var=$runpath_var + # 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 -# This is the shared library path variable. -shlibpath_var=$shlibpath_var + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath + else + GXX=no + with_gnu_ld=no + wlarc= + fi -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action_F77 + # 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 -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs + # 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 -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77 + exp_sym_flag='-bexport' + no_entry_flag='-bnoentry' + fi -# If ld is used when linking, flag to hardcode \$libdir into -# a binary during linking. This must work even if \$libdir does -# not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77 - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77 - -# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$hardcode_direct_F77 - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$hardcode_minus_L_F77 - -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var_F77 - -# Set to yes if building a shared library automatically hardcodes DIR into the library -# and all subsequent libraries and executables linked against it. -hardcode_automatic=$hardcode_automatic_F77 + # 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 -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to + # export. + always_export_symbols_CXX=yes + if test "$aix_use_runtimelinking" = yes; then + # Warning - without using the other runtime loading flags (-brtl), + # -berok will link without error, but may produce a broken library. + allow_undefined_flag_CXX='-berok' + # Determine the default libpath from the value encoded in an empty + # executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs_F77 +int +main () +{ -# Compile-time system search path for libraries -sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` + ; + 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 -# Run-time system search path for libraries -sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +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 "$aix_libpath"; then + 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 -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$fix_srcfile_path_F77" -# Set to yes if exported symbols are required. -always_export_symbols=$always_export_symbols_F77 +fi -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds_F77 +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds + hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms_F77 + archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' + allow_undefined_flag_CXX="-z nodefs" + archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" + else + # Determine the default libpath from the value encoded in an + # empty executable. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms_F77 +int +main () +{ -# ### END LIBTOOL TAG CONFIG: $tagname + ; + 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 -__EOF__ +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +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 "$aix_libpath"; then + 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 -else - # If there is no Makefile yet, we rely on a make rule to execute - # `config.status --recheck' to rerun these tests and create the - # libtool script then. - ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` - if test -f "$ltmain_in"; then - test -f Makefile && make "$ltmain" - fi fi +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; 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" + hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" + # Warning - without using the other run time loading flags, + # -berok will link without error, but may produce a broken library. + no_undefined_flag_CXX=' ${wl}-bernotok' + allow_undefined_flag_CXX=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + whole_archive_flag_spec_CXX='$convenience' + archive_cmds_need_lc_CXX=yes + # This is similar to how AIX traditionally builds its shared + # libraries. + archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' + fi + fi + ;; + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag_CXX=unsupported + # Joseph Beckenbach says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else - tagname="" + ld_shlibs_CXX=no fi ;; - GCJ) - if test -n "$GCJ" && test "X$GCJ" != "Xno"; then - - -# Source file extension for Java test sources. -ac_ext=java - -# Object file extension for compiled Java test sources. -objext=o -objext_GCJ=$objext + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; -# Code to be used in simple compile tests -lt_simple_compile_test_code="class foo {}\n" + cygwin* | mingw* | pw32*) + # _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' + allow_undefined_flag_CXX=unsupported + always_export_symbols_CXX=no + enable_shared_with_static_runtimes_CXX=yes + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + # If the export-symbols file already is a .def file (1st line + # is EXPORTS), use it as is; otherwise, prepend... + archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then + cp $export_symbols $output_objdir/$soname.def; + else + echo EXPORTS > $output_objdir/$soname.def; + cat $export_symbols >> $output_objdir/$soname.def; + fi~ + $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' + else + ld_shlibs_CXX=no + fi + ;; + darwin* | rhapsody*) -# Code to be used in simple link tests -lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n' -# ltmain only uses $CC for tagged configurations so make sure $CC is set. + archive_cmds_need_lc_CXX=no + hardcode_direct_CXX=no + hardcode_automatic_CXX=yes + hardcode_shlibpath_var_CXX=unsupported + whole_archive_flag_spec_CXX='' + link_all_deplibs_CXX=yes + allow_undefined_flag_CXX="$_lt_dar_allow_undefined" + if test "$GCC" = "yes"; then + output_verbose_link_cmd=echo + 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 -# If no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} + else + ld_shlibs_CXX=no + fi -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} + ;; -# Allow CC to be a program name with arguments. -compiler=$CC + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + esac + ;; + freebsd[12]*) + # C++ shared libraries reported to be fairly broken before + # switch to ELF + ld_shlibs_CXX=no + ;; -# save warnings/boilerplate of simple test code -ac_outfile=conftest.$ac_objext -printf "$lt_simple_compile_test_code" >conftest.$ac_ext -eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_compiler_boilerplate=`cat conftest.err` -$rm conftest* + freebsd-elf*) + archive_cmds_need_lc_CXX=no + ;; -ac_outfile=conftest.$ac_objext -printf "$lt_simple_link_test_code" >conftest.$ac_ext -eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_linker_boilerplate=`cat conftest.err` -$rm conftest* + freebsd* | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + ld_shlibs_CXX=yes + ;; + gnu*) + ;; -# Allow CC to be a program name with arguments. -lt_save_CC="$CC" -CC=${GCJ-"gcj"} -compiler=$CC -compiler_GCJ=$CC -for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` + 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; $ECHO "X$list" | $Xsed' + ;; + *) + if test "$GXX" = yes; then + archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' + hardcode_libdir_separator_CXX=: -# GCJ did not exist at the time GCC didn't implicitly link libc in. -archive_cmds_need_lc_GCJ=no + 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 -old_archive_cmds_GCJ=$old_archive_cmds + case $cc_basename in + CC*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case $host_cpu in + hppa*64*) + archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; + 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" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + + # Archives containing C++ object files must be created using + # "CC -ar", where "CC" is the IRIX C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -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 + ;; -lt_prog_compiler_no_builtin_flag_GCJ= + linux* | k*bsd*-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; $ECHO "X$list" | $Xsed' + + 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 | $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 | $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 | $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 | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + ;; + *) # Version 6 will 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 -if test "$GCC" = yes; then - lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin' + hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec_CXX='${wl}--export-dynamic' + whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + ;; + cxx*) + # Compaq C++ + archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec_CXX='-rpath $libdir' + hardcode_libdir_separator_CXX=: -{ echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 -echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6; } -if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_prog_compiler_rtti_exceptions=no - ac_outfile=conftest.$ac_objext - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="-fno-rtti -fno-exceptions" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:17236: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:17240: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_cv_prog_compiler_rtti_exceptions=yes - fi - fi - $rm conftest* + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + ;; + xl*) + # 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; $ECHO \"$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='echo' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' + ;; + esac + ;; + esac + ;; -fi -{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6; } + lynxos*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; -if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then - lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions" -else - : -fi + m88k*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; -fi + 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 + ;; -lt_prog_compiler_wl_GCJ= -lt_prog_compiler_pic_GCJ= -lt_prog_compiler_static_GCJ= + 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::"' + ;; -{ 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; } + *nto* | *qnx*) + ld_shlibs_CXX=yes + ;; - if test "$GCC" = yes; then - lt_prog_compiler_wl_GCJ='-Wl,' - lt_prog_compiler_static_GCJ='-static' + openbsd2*) + # C++ shared libraries are fairly broken + ld_shlibs_CXX=no + ;; - case $host_os in - aix*) - # All AIX code is PIC. - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_GCJ='-Bstatic' - fi - ;; + 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=echo + else + ld_shlibs_CXX=no + fi + ;; - amigaos*) - # FIXME: we need at least 68020 code to build shared libraries, but - # adding the `-m68020' flag to GCC prevents building anything better, - # like `-m68040'. - lt_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4' - ;; + 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" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -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" && $ECHO "X-set_version $verstring" | $Xsed` -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 "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~ + $RM $lib.exp' + hardcode_libdir_flag_spec_CXX='-rpath $libdir' + ;; + esac - beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) - # PIC is the default for these OSes. - ;; + hardcode_libdir_separator_CXX=: - mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' - ;; + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + ;; + *) + 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" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + *) + archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${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 "\-L"' + + else + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + fi + ;; + esac + ;; - darwin* | rhapsody*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - lt_prog_compiler_pic_GCJ='-fno-common' - ;; + psos*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no + ;; - interix3*) - # Interix 3.x gcc -fpic/-fPIC options generate broken code. - # Instead, we relocate shared libraries at runtime. - ;; + 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 + ;; - msdosdjgpp*) - # Just because we use GCC doesn't mean we suddenly get shared libraries - # on systems that don't support them. - lt_prog_compiler_can_build_shared_GCJ=no - enable_shared=no - ;; + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + archive_cmds_need_lc_CXX=yes + no_undefined_flag_CXX=' -zdefs' + archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + hardcode_libdir_flag_spec_CXX='-R$libdir' + hardcode_shlibpath_var_CXX=no + case $host_os in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) + # The 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 - sysv4*MP*) - if test -d /usr/nec; then - lt_prog_compiler_pic_GCJ=-Kconform_pic - fi - ;; + output_verbose_link_cmd='echo' - hpux*) - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic_GCJ='-fPIC' - ;; - esac - ;; + # 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' - *) - lt_prog_compiler_pic_GCJ='-fPIC' - ;; - esac - else - # PORTME Check for flag to pass linker flags through the system compiler. - case $host_os in - aix*) - lt_prog_compiler_wl_GCJ='-Wl,' - if test "$host_cpu" = ia64; then - # AIX 5 now supports IA64 processor - lt_prog_compiler_static_GCJ='-Bstatic' - else - lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp' - fi - ;; - darwin*) - # PIC is the default on this platform - # Common symbols not allowed in MH_DYLIB files - case $cc_basename in - xlc*) - lt_prog_compiler_pic_GCJ='-qnocommon' - lt_prog_compiler_wl_GCJ='-Wl,' - ;; - esac - ;; + # The C++ compiler must be used to create the archive. + old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + no_undefined_flag_CXX=' ${wl}-z ${wl}defs' + if $CC --version | $GREP -v '^2\.7' > /dev/null; then + archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + fi + + hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' + 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 + ;; - mingw* | pw32* | os2*) - # This hack is so that the source file can tell whether it is being - # built for inclusion in a dll (and should export symbols for example). - lt_prog_compiler_pic_GCJ='-DDLL_EXPORT' - ;; + 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' - hpux9* | hpux10* | hpux11*) - lt_prog_compiler_wl_GCJ='-Wl,' - # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but - # not for PA HP-UX. - case $host_cpu in - hppa*64*|ia64*) - # +Z the default - ;; - *) - lt_prog_compiler_pic_GCJ='+Z' - ;; + 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 - # Is there a better lt_prog_compiler_static that works with the bundled CC? - lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive' ;; - irix5* | irix6* | nonstopux*) - lt_prog_compiler_wl_GCJ='-Wl,' - # PIC (with -KPIC) is the default. - lt_prog_compiler_static_GCJ='-non_shared' - ;; + 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' - newsos6) - lt_prog_compiler_pic_GCJ='-KPIC' - lt_prog_compiler_static_GCJ='-Bstatic' + 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 ;; - linux*) - case $cc_basename in - icc* | ecc*) - lt_prog_compiler_wl_GCJ='-Wl,' - lt_prog_compiler_pic_GCJ='-KPIC' - lt_prog_compiler_static_GCJ='-static' + 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 ;; - pgcc* | pgf77* | pgf90* | pgf95*) - # Portland Group compilers (*not* the Pentium gcc compiler, - # which looks to be a dead project) - lt_prog_compiler_wl_GCJ='-Wl,' - lt_prog_compiler_pic_GCJ='-fpic' - lt_prog_compiler_static_GCJ='-Bstatic' + + vxworks*) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no ;; - ccc*) - lt_prog_compiler_wl_GCJ='-Wl,' - # All Alpha code is PIC. - lt_prog_compiler_static_GCJ='-non_shared' + + *) + # FIXME: insert proper C++ library support + ld_shlibs_CXX=no ;; - esac - ;; + esac - osf3* | osf4* | osf5*) - lt_prog_compiler_wl_GCJ='-Wl,' - # All OSF/1 code is PIC. - lt_prog_compiler_static_GCJ='-non_shared' - ;; + { 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 - solaris*) - lt_prog_compiler_pic_GCJ='-KPIC' - lt_prog_compiler_static_GCJ='-Bstatic' - case $cc_basename in - f77* | f90* | f95*) - lt_prog_compiler_wl_GCJ='-Qoption ld ';; - *) - lt_prog_compiler_wl_GCJ='-Wl,';; - esac - ;; + GCC_CXX="$GXX" + LD_CXX="$LD" - sunos4*) - lt_prog_compiler_wl_GCJ='-Qoption ld ' - lt_prog_compiler_pic_GCJ='-PIC' - lt_prog_compiler_static_GCJ='-Bstatic' - ;; + ## 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= - sysv4 | sysv4.2uw2* | sysv4.3*) - lt_prog_compiler_wl_GCJ='-Wl,' - lt_prog_compiler_pic_GCJ='-KPIC' - lt_prog_compiler_static_GCJ='-Bstatic' - ;; +cat > conftest.$ac_ext <<_LT_EOF +class Foo +{ +public: + Foo (void) { a = 0; } +private: + int a; +}; +_LT_EOF - sysv4*MP*) - if test -d /usr/nec ;then - lt_prog_compiler_pic_GCJ='-Kconform_pic' - lt_prog_compiler_static_GCJ='-Bstatic' - fi - ;; +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. - sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) - lt_prog_compiler_wl_GCJ='-Wl,' - lt_prog_compiler_pic_GCJ='-KPIC' - lt_prog_compiler_static_GCJ='-Bstatic' - ;; + # Sentinel used to keep track of whether or not we are before + # the conftest object file. + pre_test_object_deps_done=no - unicos*) - lt_prog_compiler_wl_GCJ='-Wl,' - lt_prog_compiler_can_build_shared_GCJ=no - ;; + for p in `eval "$output_verbose_link_cmd"`; do + case $p in - uts4*) - lt_prog_compiler_pic_GCJ='-pic' - lt_prog_compiler_static_GCJ='-Bstatic' - ;; + -L* | -R* | -l*) + # Some compilers place space between "-{L,R}" and the path. + # Remove the space. + if test $p = "-L" || + test $p = "-R"; then + prev=$p + continue + else + prev= + fi - *) - lt_prog_compiler_can_build_shared_GCJ=no - ;; - esac - fi + if test "$pre_test_object_deps_done" = no; then + case $p in + -L* | -R*) + # Internal compiler library paths should come after those + # provided the user. The postdeps already come after the + # user supplied libs so there is no need to process them. + if test -z "$compiler_lib_search_path_CXX"; then + compiler_lib_search_path_CXX="${prev}${p}" + else + compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" + fi + ;; + # The "-l" case would never come before the object being + # linked, so don't bother handling this case. + esac + else + if test -z "$postdeps_CXX"; then + postdeps_CXX="${prev}${p}" + else + postdeps_CXX="${postdeps_CXX} ${prev}${p}" + fi + fi + ;; -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6; } + *.$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 -# -# Check to make sure the PIC flag actually works. -# -if test -n "$lt_prog_compiler_pic_GCJ"; then + 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 + ;; -{ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5 -echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6; } -if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_pic_works_GCJ=no - ac_outfile=conftest.$ac_objext - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="$lt_prog_compiler_pic_GCJ" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - # The option is referenced via a variable to avoid confusing sed. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:17504: $lt_compile\"" >&5) - (eval "$lt_compile" 2>conftest.err) - ac_status=$? - cat conftest.err >&5 - echo "$as_me:17508: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s "$ac_outfile"; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings other than the usual output. - $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_pic_works_GCJ=yes - fi - fi - $rm conftest* + *) ;; # Ignore the rest. -fi -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5 -echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6; } + esac + done -if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then - case $lt_prog_compiler_pic_GCJ in - "" | " "*) ;; - *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;; - esac + # Clean up. + rm -f a.out a.exe else - lt_prog_compiler_pic_GCJ= - lt_prog_compiler_can_build_shared_GCJ=no + echo "libtool.m4: error: problem compiling CXX test program" fi -fi +$RM -f confest.$objext + +# PORTME: override above test on systems where it is broken case $host_os in - # For platforms which do not support PIC, -DPIC is meaningless: - *djgpp*) - lt_prog_compiler_pic_GCJ= +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 ;; - *) - lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ" + esac + ;; + +solaris*) + case $cc_basename in + CC*) + # 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 -# -# Check to make sure the static flag actually works. -# -wl=$lt_prog_compiler_wl_GCJ eval lt_tmp_static_flag=\"$lt_prog_compiler_static_GCJ\" -{ echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6; } -if test "${lt_prog_compiler_static_works_GCJ+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_prog_compiler_static_works_GCJ=no - save_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $lt_tmp_static_flag" - printf "$lt_simple_link_test_code" > conftest.$ac_ext - if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then - # The linker can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s conftest.err; then - # Append any errors to the config.log. - cat conftest.err 1>&5 - $echo "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp - $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 - if diff conftest.exp conftest.er2 >/dev/null; then - lt_prog_compiler_static_works_GCJ=yes - fi - else - lt_prog_compiler_static_works_GCJ=yes - fi - fi - $rm conftest* - LDFLAGS="$save_LDFLAGS" +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 -{ echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works_GCJ" >&5 -echo "${ECHO_T}$lt_prog_compiler_static_works_GCJ" >&6; } -if test x"$lt_prog_compiler_static_works_GCJ" = xyes; then - : -else - lt_prog_compiler_static_GCJ= -fi -{ echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 -echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6; } -if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - lt_cv_prog_compiler_c_o_GCJ=no - $rm -r conftest 2>/dev/null - mkdir conftest - cd conftest - mkdir out - printf "$lt_simple_compile_test_code" > conftest.$ac_ext - lt_compiler_flag="-o out/conftest2.$ac_objext" - # Insert the option either (1) after the last *FLAGS variable, or - # (2) before a word containing "conftest.", or (3) at the end. - # Note that $ac_compile itself does not contain backslashes and begins - # with a dollar sign (not a hyphen), so the echo should work correctly. - lt_compile=`echo "$ac_compile" | $SED \ - -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ - -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ - -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:17608: $lt_compile\"" >&5) - (eval "$lt_compile" 2>out/conftest.err) - ac_status=$? - cat out/conftest.err >&5 - echo "$as_me:17612: \$? = $ac_status" >&5 - if (exit $ac_status) && test -s out/conftest2.$ac_objext - then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - $echo "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp - $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 - if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then - lt_cv_prog_compiler_c_o_GCJ=yes - fi - fi - chmod u+w . 2>&5 - $rm conftest* - # SGI C++ compiler will create directory out/ii_files/ for - # template instantiation - test -d out/ii_files && $rm out/ii_files/* && rmdir out/ii_files - $rm out/* && rmdir out - cd .. - rmdir conftest - $rm conftest* -fi -{ echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5 -echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6; } -hard_links="nottested" -if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then - # do not overwrite the value of need_locks provided by the user - { echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 -echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6; } - hard_links=yes - $rm conftest* - ln conftest.a conftest.b 2>/dev/null && hard_links=no - touch conftest.a - ln conftest.a conftest.b 2>&5 || hard_links=no - ln conftest.a conftest.b 2>/dev/null && hard_links=no - { echo "$as_me:$LINENO: result: $hard_links" >&5 -echo "${ECHO_T}$hard_links" >&6; } - if test "$hard_links" = no; then - { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} - need_locks=warn - fi -else - need_locks=no -fi -{ echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6; } - runpath_var= - allow_undefined_flag_GCJ= - enable_shared_with_static_runtimes_GCJ=no - archive_cmds_GCJ= - archive_expsym_cmds_GCJ= - old_archive_From_new_cmds_GCJ= - old_archive_from_expsyms_cmds_GCJ= - export_dynamic_flag_spec_GCJ= - whole_archive_flag_spec_GCJ= - thread_safe_flag_spec_GCJ= - hardcode_libdir_flag_spec_GCJ= - hardcode_libdir_flag_spec_ld_GCJ= - hardcode_libdir_separator_GCJ= - hardcode_direct_GCJ=no - hardcode_minus_L_GCJ=no - hardcode_shlibpath_var_GCJ=unsupported - link_all_deplibs_GCJ=unknown - hardcode_automatic_GCJ=no - module_cmds_GCJ= - module_expsym_cmds_GCJ= - always_export_symbols_GCJ=no - export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' - # include_expsyms should be a list of space-separated symbols to be *always* - # included in the symbol list - include_expsyms_GCJ= - # exclude_expsyms can be an extended regexp of symbols to exclude - # it will be wrapped by ` (' and `)$', so one must not match beginning or - # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', - # as well as any symbol that contains `d'. - exclude_expsyms_GCJ="_GLOBAL_OFFSET_TABLE_" - # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out - # platforms (ab)use it in PIC code, but their linkers get confused if - # the symbol is explicitly referenced. Since portable code cannot - # rely on this symbol name, it's probably fine to never include it in - # preloaded symbol tables. - extract_expsyms_cmds= - # Just being paranoid about ensuring that cc_basename is set. - for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` - case $host_os in - cygwin* | mingw* | pw32*) - # FIXME: the MSVC++ port hasn't been tested in a loooong time - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - if test "$GCC" != yes; then - with_gnu_ld=no - fi - ;; - interix*) - # we just hope/assume this is gcc and not c89 (= MSVC++) - with_gnu_ld=yes - ;; - openbsd*) - with_gnu_ld=no - ;; - esac - ld_shlibs_GCJ=yes - if test "$with_gnu_ld" = yes; then - # If archive_cmds runs LD, not CC, wlarc should be empty - wlarc='${wl}' - # Set some defaults for GNU ld with shared library support. These - # are reset later if shared libraries are not supported. Putting them - # here allows them to be overridden if necessary. - runpath_var=LD_RUN_PATH - hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir' - export_dynamic_flag_spec_GCJ='${wl}--export-dynamic' - # ancient GNU ld didn't support --whole-archive et. al. - if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then - whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' - else - whole_archive_flag_spec_GCJ= - fi - supports_anon_versioning=no - case `$LD -v 2>/dev/null` in - *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 - *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... - *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... - *\ 2.11.*) ;; # other 2.11 versions - *) supports_anon_versioning=yes ;; - esac - # See if GNU ld supports shared libraries. - case $host_os in - aix3* | aix4* | aix5*) - # On AIX/PPC, the GNU linker is very broken - if test "$host_cpu" != ia64; then - ld_shlibs_GCJ=no - cat <&2 -*** Warning: the GNU linker, at least up to release 2.9.1, is reported -*** to be unable to reliably create shared libraries on AIX. -*** Therefore, libtool is disabling shared libraries support. If you -*** really care for shared libraries, you may want to modify your PATH -*** so that a non-GNU linker is found, and then restart. -EOF - fi - ;; - amigaos*) - archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_minus_L_GCJ=yes - # Samuel A. Falvo II reports - # that the semantics of dynamic libraries on AmigaOS, at least up - # to version 4, is to share data among multiple programs linked - # with the same dynamic library. Since this doesn't match the - # behavior of shared libraries on other platforms, we can't use - # them. - ld_shlibs_GCJ=no - ;; - beos*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - allow_undefined_flag_GCJ=unsupported - # Joseph Beckenbach says some releases of gcc - # support --undefined. This deserves some investigation. FIXME - archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - else - ld_shlibs_GCJ=no - fi - ;; - cygwin* | mingw* | pw32*) - # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless, - # as there is no search path for DLLs. - hardcode_libdir_flag_spec_GCJ='-L$libdir' - allow_undefined_flag_GCJ=unsupported - always_export_symbols_GCJ=no - enable_shared_with_static_runtimes_GCJ=yes - export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols' - if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then - archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - # If the export-symbols file already is a .def file (1st line - # is EXPORTS), use it as is; otherwise, prepend... - archive_expsym_cmds_GCJ='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then - cp $export_symbols $output_objdir/$soname.def; - else - echo EXPORTS > $output_objdir/$soname.def; - cat $export_symbols >> $output_objdir/$soname.def; - fi~ - $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' - else - ld_shlibs_GCJ=no - fi - ;; - interix3*) - hardcode_direct_GCJ=no - hardcode_shlibpath_var_GCJ=no - hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' - export_dynamic_flag_spec_GCJ='${wl}-E' - # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. - # Instead, shared libraries are loaded at an image base (0x10000000 by - # default) and relocated if they conflict, which is a slow very memory - # consuming and fragmenting process. To avoid this, we pick a random, - # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link - # time. Moving up from 0x10000000 also allows more sbrk(2) space. - archive_cmds_GCJ='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - archive_expsym_cmds_GCJ='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' - ;; - linux*) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - tmp_addflag= - case $cc_basename,$host_cpu in - pgcc*) # Portland Group C compiler - whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag' - ;; - pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers - whole_archive_flag_spec_GCJ='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}--no-whole-archive' - tmp_addflag=' $pic_flag -Mnomain' ;; - ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 - tmp_addflag=' -i_dynamic' ;; - efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 - tmp_addflag=' -i_dynamic -nofor_main' ;; - ifc* | ifort*) # Intel Fortran compiler - tmp_addflag=' -nofor_main' ;; - esac - archive_cmds_GCJ='$CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - if test $supports_anon_versioning = yes; then - archive_expsym_cmds_GCJ='$echo "{ global:" > $output_objdir/$libname.ver~ - cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ - $echo "local: *; };" >> $output_objdir/$libname.ver~ - $CC -shared'"$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' - fi - else - ld_shlibs_GCJ=no + + + + + + + + + lt_prog_compiler_wl_CXX= +lt_prog_compiler_pic_CXX= +lt_prog_compiler_static_CXX= + +{ echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6; } + + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_static_CXX='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + lt_prog_compiler_static_CXX='-Bstatic' fi ;; - - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' - wlarc= - else - archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + amigaos*) + if test "$host_cpu" = m68k; then + # 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' fi ;; - - solaris*) - if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then - ld_shlibs_GCJ=no - cat <&2 - -*** Warning: The releases 2.8.* of the GNU linker cannot reliably -*** create shared libraries on Solaris systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.9.1 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -EOF - elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs_GCJ=no + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | cygwin* | os2* | pw32*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # 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= + ;; + 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 ;; - - sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) - case `$LD -v 2>&1` in - *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) - ld_shlibs_GCJ=no - cat <<_LT_EOF 1>&2 - -*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not -*** reliably create shared libraries on SCO systems. Therefore, libtool -*** is disabling shared libraries support. We urge you to upgrade GNU -*** binutils to release 2.16.91.0.3 or newer. Another option is to modify -*** your PATH or compiler configuration so that the native linker is -*** used, and then restart. - -_LT_EOF + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) ;; - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' - archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib' - archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname,\${SCOABSPATH:+${install_libdir}/}$soname,-retain-symbols-file,$export_symbols -o $lib' - else - ld_shlibs_GCJ=no - fi + *) + lt_prog_compiler_pic_CXX='-fPIC' ;; esac ;; - - sunos4*) - archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' - wlarc= - hardcode_direct_GCJ=yes - hardcode_shlibpath_var_GCJ=no + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + lt_prog_compiler_pic_CXX='-fPIC -shared' ;; - *) - if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then - archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' - else - ld_shlibs_GCJ=no - fi + lt_prog_compiler_pic_CXX='-fPIC' ;; esac - - if test "$ld_shlibs_GCJ" = no; then - runpath_var= - hardcode_libdir_flag_spec_GCJ= - export_dynamic_flag_spec_GCJ= - whole_archive_flag_spec_GCJ= - fi else - # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in - aix3*) - allow_undefined_flag_GCJ=unsupported - always_export_symbols_GCJ=yes - archive_expsym_cmds_GCJ='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' - # Note: this linker hardcodes the directories in LIBPATH if there - # are no directories specified by -L. - hardcode_minus_L_GCJ=yes - if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then - # Neither direct hardcoding nor static linking is supported with a - # broken collect2. - hardcode_direct_GCJ=unsupported - fi - ;; - - aix4* | aix5*) - if test "$host_cpu" = ia64; then - # On IA64, the linker does run time linking by default, so we don't - # have to do anything special. - aix_use_runtimelinking=no - exp_sym_flag='-Bexport' - no_entry_flag="" - else - # If we're using GNU nm, then we don't want the "-C" option. - # -C means demangle to AIX nm, but means don't demangle with GNU nm - if $NM -V 2>&1 | grep 'GNU' > /dev/null; then - export_symbols_cmds_GCJ='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + 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 - export_symbols_cmds_GCJ='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols' + lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' fi - aix_use_runtimelinking=no - - # Test if we are trying to use run time linking or normal - # AIX style linking. If -brtl is somewhere in LDFLAGS, we - # need to do runtime linking. - case $host_os in aix4.[23]|aix4.[23].*|aix5*) - for ld_flag in $LDFLAGS; do - if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then - aix_use_runtimelinking=yes - break - fi - done + ;; + 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 - - exp_sym_flag='-bexport' - no_entry_flag='-bnoentry' - fi - - # When large executables or shared objects are built, AIX ld can - # have problems creating the table of contents. If linking a library - # or program results in "error TOC overflow" add -mminimal-toc to - # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not - # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. - - archive_cmds_GCJ='' - hardcode_direct_GCJ=yes - hardcode_libdir_separator_GCJ=':' - link_all_deplibs_GCJ=yes - - if test "$GCC" = yes; then - case $host_os in aix4.[012]|aix4.[012].*) - # We only want to do this on AIX 4.2 and lower, the check - # below for broken collect2 doesn't work under 4.3+ - collect2name=`${CC} -print-prog-name=collect2` - if test -f "$collect2name" && \ - strings "$collect2name" | grep resolve_lib_name >/dev/null - then - # We have reworked collect2 - hardcode_direct_GCJ=yes - else - # We have old collect2 - hardcode_direct_GCJ=unsupported - # It fails to find uninstalled libraries when the uninstalled - # path is not listed in the libpath. Setting hardcode_minus_L - # to unsupported forces relinking - hardcode_minus_L_GCJ=yes - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_libdir_separator_GCJ= - fi - ;; + ;; + 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) + case $cc_basename in + KCC*) + # KAI C++ Compiler + lt_prog_compiler_wl_CXX='--backend -Wl,' + lt_prog_compiler_pic_CXX='-fPIC' + ;; + icpc* | ecpc* ) + # Intel C++ + lt_prog_compiler_wl_CXX='-Wl,' + lt_prog_compiler_pic_CXX='-KPIC' + lt_prog_compiler_static_CXX='-static' + ;; + pgCC* | 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*) + # IBM XL 8.0 on PPC + 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*) + ;; + *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*) + # 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 - 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 + ;; + 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 - # It seems that -bexpall does not export symbols beginning with - # underscore (_), so it is better to generate a list of symbols to export. - always_export_symbols_GCJ=yes - if test "$aix_use_runtimelinking" = yes; then - # Warning - without using the other runtime loading flags (-brtl), - # -berok will link without error, but may produce a broken library. - allow_undefined_flag_GCJ='-berok' - # Determine the default libpath from the value encoded in an empty executable. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ +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: result: $lt_prog_compiler_pic_CXX" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6; } -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 -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi +# +# 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 - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - + 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:14841: $lt_compile\"" >&5) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&5 + echo "$as_me:14845: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s "$ac_outfile"; then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings other than the usual output. + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + lt_cv_prog_compiler_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; } -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - - hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" - archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" - else - if test "$host_cpu" = ia64; then - hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib' - allow_undefined_flag_GCJ="-z nodefs" - archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" - else - # Determine the default libpath from the value encoded in an empty executable. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (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 - -aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'` -# Check for a 64-bit object if we didn't find anything. -if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } -}'`; fi +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 - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - + lt_prog_compiler_pic_CXX= + lt_prog_compiler_can_build_shared_CXX=no fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi - - hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath" - # Warning - without using the other run time loading flags, - # -berok will link without error, but may produce a broken library. - no_undefined_flag_GCJ=' ${wl}-bernotok' - allow_undefined_flag_GCJ=' ${wl}-berok' - # Exported symbols can be pulled into shared objects from archives - whole_archive_flag_spec_GCJ='$convenience' - archive_cmds_need_lc_GCJ=yes - # This is similar to how AIX traditionally builds its shared libraries. - archive_expsym_cmds_GCJ="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' - fi - fi - ;; - - amigaos*) - archive_cmds_GCJ='$rm $output_objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_minus_L_GCJ=yes - # see comment about different semantics on the GNU ld section - ld_shlibs_GCJ=no - ;; - - bsdi[45]*) - export_dynamic_flag_spec_GCJ=-rdynamic - ;; - - cygwin* | mingw* | pw32*) - # When not using gcc, we currently assume that we are using - # Microsoft Visual C++. - # hardcode_libdir_flag_spec is actually meaningless, as there is - # no search path for DLLs. - hardcode_libdir_flag_spec_GCJ=' ' - allow_undefined_flag_GCJ=unsupported - # Tell ltmain to make .lib files, not .a files. - libext=lib - # Tell ltmain to make .dll files, not .so files. - shrext_cmds=".dll" - # FIXME: Setting linknames here is a bad hack. - archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames=' - # The linker will automatically build a .lib file if we build a DLL. - old_archive_From_new_cmds_GCJ='true' - # FIXME: Should let the user specify the lib program. - old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs' - fix_srcfile_path_GCJ='`cygpath -w "$srcfile"`' - enable_shared_with_static_runtimes_GCJ=yes - ;; - - darwin* | rhapsody*) - case $host_os in - rhapsody* | darwin1.[012]) - allow_undefined_flag_GCJ='${wl}-undefined ${wl}suppress' - ;; - *) # Darwin 1.3 on - if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then - allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - else - case ${MACOSX_DEPLOYMENT_TARGET} in - 10.[012]) - allow_undefined_flag_GCJ='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' - ;; - 10.*) - allow_undefined_flag_GCJ='${wl}-undefined ${wl}dynamic_lookup' - ;; - esac - fi - ;; - esac - archive_cmds_need_lc_GCJ=no - hardcode_direct_GCJ=no - hardcode_automatic_GCJ=yes - hardcode_shlibpath_var_GCJ=unsupported - whole_archive_flag_spec_GCJ='' - link_all_deplibs_GCJ=yes - if test "$GCC" = yes ; then - output_verbose_link_cmd='echo' - archive_cmds_GCJ='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring' - module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - else - case $cc_basename in - xlc*) - output_verbose_link_cmd='echo' - archive_cmds_GCJ='$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}`echo $rpath/$soname` $verstring' - module_cmds_GCJ='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags' - # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin lds - archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -qmkshrobj $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-install_name ${wl}$rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}' - ;; - *) - ld_shlibs_GCJ=no - ;; - esac - fi - ;; - - dgux*) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_shlibpath_var_GCJ=no - ;; - - freebsd1*) - ld_shlibs_GCJ=no - ;; - - # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor - # support. Future versions do this automatically, but an explicit c++rt0.o - # does not break anything, and helps significantly (at the cost of a little - # extra space). - freebsd2.2*) - archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' - hardcode_libdir_flag_spec_GCJ='-R$libdir' - hardcode_direct_GCJ=yes - hardcode_shlibpath_var_GCJ=no - ;; - - # Unfortunately, older versions of FreeBSD 2 do not have this feature. - freebsd2*) - archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_GCJ=yes - hardcode_minus_L_GCJ=yes - hardcode_shlibpath_var_GCJ=no - ;; +fi - # FreeBSD 3 and greater uses gcc -shared to do shared libraries. - freebsd* | kfreebsd*-gnu | dragonfly*) - archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec_GCJ='-R$libdir' - hardcode_direct_GCJ=yes - hardcode_shlibpath_var_GCJ=no - ;; - hpux9*) - if test "$GCC" = yes; then - archive_cmds_GCJ='$rm $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - else - archive_cmds_GCJ='$rm $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' - fi - hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_GCJ=: - hardcode_direct_GCJ=yes - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_GCJ=yes - export_dynamic_flag_spec_GCJ='${wl}-E' - ;; +# +# 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 "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + lt_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" - hpux10*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' - fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_GCJ=: +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; } - hardcode_direct_GCJ=yes - export_dynamic_flag_spec_GCJ='${wl}-E' +if test x"$lt_cv_prog_compiler_static_works_CXX" = xyes; then + : +else + lt_prog_compiler_static_CXX= +fi - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_GCJ=yes - fi - ;; - hpux11*) - if test "$GCC" = yes -a "$with_gnu_ld" = no; then - case $host_cpu in - hppa*64*) - archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - else - case $host_cpu in - hppa*64*) - archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - ;; - ia64*) - archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' - ;; - *) - archive_cmds_GCJ='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' - ;; - esac - fi - if test "$with_gnu_ld" = no; then - hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir' - hardcode_libdir_separator_GCJ=: - case $host_cpu in - hppa*64*|ia64*) - hardcode_libdir_flag_spec_ld_GCJ='+b $libdir' - hardcode_direct_GCJ=no - hardcode_shlibpath_var_GCJ=no - ;; - *) - hardcode_direct_GCJ=yes - export_dynamic_flag_spec_GCJ='${wl}-E' - # hardcode_minus_L: Not really in the search PATH, - # but as the default location of the library. - hardcode_minus_L_GCJ=yes - ;; - esac - fi - ;; + { 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 - irix5* | irix6* | nonstopux*) - if test "$GCC" = yes; then - archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir' - fi - hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_GCJ=: - link_all_deplibs_GCJ=yes - ;; + 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:14940: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:14944: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_CXX=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* - netbsd*) - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then - archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out - else - archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF - fi - hardcode_libdir_flag_spec_GCJ='-R$libdir' - hardcode_direct_GCJ=yes - hardcode_shlibpath_var_GCJ=no - ;; +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; } - newsos6) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_GCJ=yes - hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_GCJ=: - hardcode_shlibpath_var_GCJ=no - ;; - openbsd*) - hardcode_direct_GCJ=yes - hardcode_shlibpath_var_GCJ=no - if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then - archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' - hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' - export_dynamic_flag_spec_GCJ='${wl}-E' - else - case $host_os in - openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) - archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_GCJ='-R$libdir' - ;; - *) - archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir' - ;; - esac - fi - ;; - os2*) - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_minus_L_GCJ=yes - allow_undefined_flag_GCJ=unsupported - archive_cmds_GCJ='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' - old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' - ;; + { 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 - osf3*) - if test "$GCC" = yes; then - allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - else - allow_undefined_flag_GCJ=' -expect_unresolved \*' - archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - fi - hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' - hardcode_libdir_separator_GCJ=: - ;; + 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:14992: $lt_compile\"" >&5) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&5 + echo "$as_me:14996: \$? = $ac_status" >&5 + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + lt_cv_prog_compiler_c_o_CXX=yes + fi + fi + chmod u+w . 2>&5 + $RM conftest* + # SGI C++ compiler will create directory out/ii_files/ for + # template instantiation + test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files + $RM out/* && rmdir out + cd .. + $RM -r conftest + $RM conftest* - osf4* | osf5*) # as osf3* with the addition of -msym flag - if test "$GCC" = yes; then - allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*' - archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' - hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir' - else - allow_undefined_flag_GCJ=' -expect_unresolved \*' - archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib' - archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; echo "-hidden">> $lib.exp~ - $LD -shared${allow_undefined_flag} -input $lib.exp $linker_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib~$rm $lib.exp' +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; } - # Both c and cxx compiler support -rpath directly - hardcode_libdir_flag_spec_GCJ='-rpath $libdir' - fi - hardcode_libdir_separator_GCJ=: - ;; - solaris*) - no_undefined_flag_GCJ=' -z text' - if test "$GCC" = yes; then - wlarc='${wl}' - archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp' - else - wlarc='' - archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' - archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ - $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$rm $lib.exp' - fi - hardcode_libdir_flag_spec_GCJ='-R$libdir' - hardcode_shlibpath_var_GCJ=no - case $host_os in - solaris2.[0-5] | solaris2.[0-5].*) ;; - *) - # The compiler driver will combine linker options so we - # cannot just pass the convience library names through - # without $wl, iff we do not link with $LD. - # Luckily, gcc supports the same syntax we need for Sun Studio. - # Supported since Solaris 2.6 (maybe 2.5.1?) - case $wlarc in - '') - whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;; - *) - whole_archive_flag_spec_GCJ='${wl}-z ${wl}allextract`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $echo \"$new_convenience\"` ${wl}-z ${wl}defaultextract' ;; - esac ;; - esac - link_all_deplibs_GCJ=yes - ;; - sunos4*) - if test "x$host_vendor" = xsequent; then - # Use $CC to link under sequent, because it throws in some extra .o - # files that make .init and .fini sections work. - archive_cmds_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' - fi - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_direct_GCJ=yes - hardcode_minus_L_GCJ=yes - hardcode_shlibpath_var_GCJ=no - ;; - sysv4) - case $host_vendor in - sni) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_GCJ=yes # is this really true??? - ;; - siemens) - ## LD is ld it makes a PLAMLIB - ## CC just makes a GrossModule. - archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags' - reload_cmds_GCJ='$CC -r -o $output$reload_objs' - hardcode_direct_GCJ=no - ;; - motorola) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie - ;; - esac - runpath_var='LD_RUN_PATH' - hardcode_shlibpath_var_GCJ=no - ;; +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 - sysv4.3*) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var_GCJ=no - export_dynamic_flag_spec_GCJ='-Bexport' - ;; - sysv4*MP*) - if test -d /usr/nec; then - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_shlibpath_var_GCJ=no - runpath_var=LD_RUN_PATH - hardcode_runpath_var=yes - ld_shlibs_GCJ=yes - fi - ;; - sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7*) - no_undefined_flag_GCJ='${wl}-z,text' - archive_cmds_need_lc_GCJ=no - hardcode_shlibpath_var_GCJ=no - runpath_var='LD_RUN_PATH' + { 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; } - if test "$GCC" = yes; then - archive_cmds_GCJ='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_GCJ='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + 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 + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + export_symbols_cmds_CXX="$ltdll_cmds" + ;; + cygwin* | mingw*) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;/^.*[ ]__nm__/s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' + ;; + *) + export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac + exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' + +{ 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 - sysv5* | sco3.2v5* | sco5v6*) - # Note: We can NOT use -z defs as we might desire, because we do not - # link with -lc, and that would cause any symbols used from libc to - # always be unresolved, which means just about no library would - # ever link correctly. If we're not using GNU ld we use -z text - # though, which does catch some bad symbols but isn't as heavy-handed - # as -z defs. - no_undefined_flag_GCJ='${wl}-z,text' - allow_undefined_flag_GCJ='${wl}-z,nodefs' - archive_cmds_need_lc_GCJ=no - hardcode_shlibpath_var_GCJ=no - hardcode_libdir_flag_spec_GCJ='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' - hardcode_libdir_separator_GCJ=':' - link_all_deplibs_GCJ=yes - export_dynamic_flag_spec_GCJ='${wl}-Bexport' - runpath_var='LD_RUN_PATH' - if test "$GCC" = yes; then - archive_cmds_GCJ='$CC -shared ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_GCJ='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - else - archive_cmds_GCJ='$CC -G ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds_GCJ='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,\${SCOABSPATH:+${install_libdir}/}$soname -o $lib $libobjs $deplibs $compiler_flags' - fi - ;; - uts4*) - archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' - hardcode_libdir_flag_spec_GCJ='-L$libdir' - hardcode_shlibpath_var_GCJ=no - ;; - *) - ld_shlibs_GCJ=no - ;; - esac - fi -{ echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5 -echo "${ECHO_T}$ld_shlibs_GCJ" >&6; } -test "$ld_shlibs_GCJ" = no && can_build_shared=no # # Do we need to explicitly link libc? # -case "x$archive_cmds_need_lc_GCJ" in +case "x$archive_cmds_need_lc_CXX" in x|xyes) # Assume -lc should be added - archive_cmds_need_lc_GCJ=yes + archive_cmds_need_lc_CXX=yes if test "$enable_shared" = yes && test "$GCC" = yes; then - case $archive_cmds_GCJ in + case $archive_cmds_CXX in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; @@ -18634,8 +15101,8 @@ # to ld, don't add -lc before -lgcc. { echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6; } - $rm conftest* - printf "$lt_simple_compile_test_code" > conftest.$ac_ext + $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 @@ -18646,40 +15113,104 @@ lib=conftest libobjs=conftest.$ac_objext deplibs= - wl=$lt_prog_compiler_wl_GCJ - pic_flag=$lt_prog_compiler_pic_GCJ + 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_GCJ - allow_undefined_flag_GCJ= - if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5 - (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5 + lt_save_allow_undefined_flag=$allow_undefined_flag_CXX + allow_undefined_flag_CXX= + if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\"") >&5 + (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then - archive_cmds_need_lc_GCJ=no + archive_cmds_need_lc_CXX=no else - archive_cmds_need_lc_GCJ=yes + archive_cmds_need_lc_CXX=yes fi - allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag + allow_undefined_flag_CXX=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi - $rm conftest* - { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5 -echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6; } + $RM conftest* + { echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5 +echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6; } ;; esac fi ;; esac -{ echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { echo "$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= @@ -18693,20 +15224,6 @@ version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" -if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then - # if the path contains ";" then we assume it to be the separator - # otherwise default to the standard path separator (i.e. ":") - it is - # assumed that no part of a normal pathname contains ";" but that should - # okay in the real world where ";" in dirpaths is itself problematic. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` - else - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` - fi -else - sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" -fi need_lib_prefix=unknown hardcode_into_libs=no @@ -18724,7 +15241,7 @@ soname_spec='${libname}${release}${shared_ext}$major' ;; -aix4* | aix5*) +aix[4-9]*) version_type=linux need_lib_prefix=no need_version=no @@ -18743,7 +15260,7 @@ 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 + echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no @@ -18769,9 +15286,13 @@ ;; amigaos*) - library_names_spec='$libname.ixlibrary $libname.a' - # Create ${libname}_ixlibrary.a entries in /sys/libs. - finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + if test "$host_cpu" = m68k; then + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + else + dynamic_linker=no + fi ;; beos*) @@ -18805,14 +15326,17 @@ 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'\''`~ + 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' + 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' + $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in @@ -18824,17 +15348,17 @@ mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' - sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` - if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then + sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. - sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + 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"` + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) @@ -18858,17 +15382,12 @@ version_type=darwin need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext' + 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`' - # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same. - if test "$GCC" = yes; then - sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"` - else - sys_lib_search_path_spec='/lib /usr/lib /usr/local/lib' - fi + sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; @@ -18885,18 +15404,6 @@ dynamic_linker=no ;; -kfreebsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='GNU ld.so' - ;; - freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. @@ -18934,7 +15441,7 @@ shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; - freebsd*) # from 4.6 on + *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; @@ -18973,18 +15480,18 @@ 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 - ;; - *) + 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 @@ -18997,7 +15504,7 @@ postinstall_cmds='chmod 555 $lib' ;; -interix3*) +interix[3-9]*) version_type=linux need_lib_prefix=no need_version=no @@ -19052,7 +15559,7 @@ ;; # This must be Linux ELF. -linux*) +linux* | k*bsd*-gnu) version_type=linux need_lib_prefix=no need_version=no @@ -19061,36 +15568,69 @@ 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 + 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 + 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 + # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes - # find out which ABI we are using - libsuff= - case "$host_cpu" in - x86_64*|s390x*|powerpc64*) - echo '#line 19073 "configure"' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - case `/usr/bin/file conftest.$ac_objext` in - *64-bit*) - libsuff=64 - sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}" - ;; - esac - fi - rm -rf conftest* - ;; - esac - # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then - lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` - sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra" + 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;/^$/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 @@ -19102,23 +15642,11 @@ dynamic_linker='GNU/Linux ld.so' ;; -knetbsd*-gnu) - version_type=linux - need_lib_prefix=no - need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' - soname_spec='${libname}${release}${shared_ext}$major' - shlibpath_var=LD_LIBRARY_PATH - shlibpath_overrides_runpath=no - hardcode_into_libs=yes - dynamic_linker='GNU ld.so' - ;; - netbsd*) version_type=sunos need_lib_prefix=no need_version=no - if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + 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' @@ -19139,14 +15667,16 @@ shlibpath_overrides_runpath=yes ;; -nto-qnx*) - version_type=linux +*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=yes + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + dynamic_linker='ldqnx.so' ;; openbsd*) @@ -19155,13 +15685,13 @@ 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 ;; + 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 + 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 @@ -19195,6 +15725,10 @@ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; +rdos*) + dynamic_linker=no + ;; + solaris*) version_type=linux need_lib_prefix=no @@ -19229,7 +15763,6 @@ sni) shlibpath_overrides_runpath=no need_lib_prefix=no - export_dynamic_flag_spec='${wl}-Blargedynsym' runpath_var=LD_RUN_PATH ;; siemens) @@ -19260,13 +15793,12 @@ 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' - shlibpath_overrides_runpath=no else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' - shlibpath_overrides_runpath=yes case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" @@ -19276,6 +15808,17 @@ sys_lib_dlsearch_path_spec='/usr/lib' ;; +tpf*) + # TPF is a cross-target only. Preferred cross-host = GNU/Linux. + version_type=linux + need_lib_prefix=no + need_version=no + library_name_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 library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' @@ -19296,1023 +15839,2268 @@ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi -{ echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 -echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6; } -hardcode_action_GCJ= -if test -n "$hardcode_libdir_flag_spec_GCJ" || \ - test -n "$runpath_var_GCJ" || \ - test "X$hardcode_automatic_GCJ" = "Xyes" ; then - - # We can hardcode non-existant directories. - if test "$hardcode_direct_GCJ" != no && - # If the only mechanism to avoid hardcoding is shlibpath_var, we - # have to relink, otherwise we might link with an installed library - # when we should be linking with a yet-to-be-installed one - ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no && - test "$hardcode_minus_L_GCJ" != no; then - # Linking always hardcodes the temporary library directory. - hardcode_action_GCJ=relink - else - # We can link without hardcoding, and we can hardcode nonexisting dirs. - hardcode_action_GCJ=immediate - fi -else - # We cannot hardcode anything, or else we can only hardcode existing - # directories. - hardcode_action_GCJ=unsupported +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 -{ echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5 -echo "${ECHO_T}$hardcode_action_GCJ" >&6; } - -if test "$hardcode_action_GCJ" = relink; then - # Fast installation is not supported - enable_fast_install=no -elif test "$shlibpath_overrides_runpath" = yes || - test "$enable_shared" = no; then - # Fast installation is not necessary - enable_fast_install=needless +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 -# The else clause should only fire when bootstrapping the -# libtool distribution, otherwise you forgot to ship ltmain.sh -# with your package, and you will get complaints that there are -# no rules to generate ltmain.sh. -if test -f "$ltmain"; then - # See if we are running on zsh, and set the options which allow our commands through - # without removal of \ escapes. - if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST - fi - # Now quote all the things that may contain metacharacters while being - # careful not to overquote the AC_SUBSTed values. We take copies of the - # variables and quote the copies for generation of the libtool script. - for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ - SED SHELL STRIP \ - libname_spec library_names_spec soname_spec extract_expsyms_cmds \ - old_striplib striplib file_magic_cmd finish_cmds finish_eval \ - deplibs_check_method reload_flag reload_cmds need_locks \ - lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ - lt_cv_sys_global_symbol_to_c_name_address \ - sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ - old_postinstall_cmds old_postuninstall_cmds \ - compiler_GCJ \ - CC_GCJ \ - LD_GCJ \ - lt_prog_compiler_wl_GCJ \ - lt_prog_compiler_pic_GCJ \ - lt_prog_compiler_static_GCJ \ - lt_prog_compiler_no_builtin_flag_GCJ \ - export_dynamic_flag_spec_GCJ \ - thread_safe_flag_spec_GCJ \ - whole_archive_flag_spec_GCJ \ - enable_shared_with_static_runtimes_GCJ \ - old_archive_cmds_GCJ \ - old_archive_from_new_cmds_GCJ \ - predep_objects_GCJ \ - postdep_objects_GCJ \ - predeps_GCJ \ - postdeps_GCJ \ - compiler_lib_search_path_GCJ \ - archive_cmds_GCJ \ - archive_expsym_cmds_GCJ \ - postinstall_cmds_GCJ \ - postuninstall_cmds_GCJ \ - old_archive_from_expsyms_cmds_GCJ \ - allow_undefined_flag_GCJ \ - no_undefined_flag_GCJ \ - export_symbols_cmds_GCJ \ - hardcode_libdir_flag_spec_GCJ \ - hardcode_libdir_flag_spec_ld_GCJ \ - hardcode_libdir_separator_GCJ \ - hardcode_automatic_GCJ \ - module_cmds_GCJ \ - module_expsym_cmds_GCJ \ - lt_cv_prog_compiler_c_o_GCJ \ - exclude_expsyms_GCJ \ - include_expsyms_GCJ; do - - case $var in - old_archive_cmds_GCJ | \ - old_archive_from_new_cmds_GCJ | \ - archive_cmds_GCJ | \ - archive_expsym_cmds_GCJ | \ - module_cmds_GCJ | \ - module_expsym_cmds_GCJ | \ - old_archive_from_expsyms_cmds_GCJ | \ - export_symbols_cmds_GCJ | \ - extract_expsyms_cmds | reload_cmds | finish_cmds | \ - postinstall_cmds | postuninstall_cmds | \ - old_postinstall_cmds | old_postuninstall_cmds | \ - sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) - # Double-quote double-evaled strings. - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" - ;; - *) - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" - ;; - esac - done - - case $lt_echo in - *'\$0 --fallback-echo"') - lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` - ;; - esac - -cfgfile="$ofile" - cat <<__EOF__ >> "$cfgfile" -# ### BEGIN LIBTOOL TAG CONFIG: $tagname -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared -# Whether or not to build static libraries. -build_old_libs=$enable_static -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$archive_cmds_need_lc_GCJ -# Whether or not to disallow shared libs when runtime libs are static -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install -# The host system. -host_alias=$host_alias -host=$host -host_os=$host_os -# The build system. -build_alias=$build_alias -build=$build -build_os=$build_os -# An echo program that does not interpret backslashes. -echo=$lt_echo -# The archiver. -AR=$lt_AR -AR_FLAGS=$lt_AR_FLAGS -# A C compiler. -LTCC=$lt_LTCC -# LTCC compiler flags. -LTCFLAGS=$lt_LTCFLAGS -# A language-specific compiler. -CC=$lt_compiler_GCJ -# Is the compiler the GNU C compiler? -with_gcc=$GCC_GCJ -gcc_dir=\`$CC -print-file-name=. | $SED 's,/\.$,,'\` -gcc_ver=\`$CC -dumpversion\` -# An ERE matcher. -EGREP=$lt_EGREP -# The linker used to build libraries. -LD=$lt_LD_GCJ -# Whether we need hard or soft links. -LN_S=$lt_LN_S -# A BSD-compatible nm program. -NM=$lt_NM -# A symbol stripping program -STRIP=$lt_STRIP -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=$MAGIC_CMD -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" -# Used on cygwin: assembler. -AS="$AS" -# The name of the directory that contains temporary libtool files. -objdir=$objdir -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl_GCJ -# Object file suffix (normally "o"). -objext="$ac_objext" -# Old archive suffix (normally "a"). -libext="$libext" -# Shared library suffix (normally ".so"). -shrext_cmds='$shrext_cmds' -# Executable file suffix (normally ""). -exeext="$exeext" -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic_GCJ -pic_mode=$pic_mode + { 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 -# What is the maximum length of a command? -max_cmd_len=$lt_cv_sys_max_cmd_len + # 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; } -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ +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 -# Must we lock files when doing compilation? -need_locks=$lt_need_locks -# Do we need the lib prefix for modules? -need_lib_prefix=$need_lib_prefix -# Do we need a version for libraries? -need_version=$need_version -# Whether dlopen is supported. -dlopen_support=$enable_dlopen -# Whether dlopen of programs is supported. -dlopen_self=$enable_dlopen_self -# Whether dlopen of statically linked programs is supported. -dlopen_self_static=$enable_dlopen_self_static -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_lt_prog_compiler_static_GCJ + fi # test -n "$compiler" -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ + CC=$lt_save_CC + 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 -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ +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 -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ -# Library versioning type. -version_type=$version_type -# Format of library name prefix. -libname_spec=$lt_libname_spec -# List of archive names. First name is the real one, the rest are links. -# The last name is the one that the linker finds with -lNAME. -library_names_spec=$lt_library_names_spec -# The coded name of the library, if different from the real name. -soname_spec=$lt_soname_spec -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_old_archive_cmds_GCJ -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ -# Commands used to build and install a shared archive. -archive_cmds=$lt_archive_cmds_GCJ -archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds -# Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_module_cmds_GCJ -module_expsym_cmds=$lt_module_expsym_cmds_GCJ -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects=\`echo $lt_predep_objects_GCJ | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` - -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects=\`echo $lt_postdep_objects_GCJ | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` - -# Dependencies to place before the objects being linked to create a -# shared library. -predeps=$lt_predeps_GCJ - -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_postdeps_GCJ + ac_config_commands="$ac_config_commands libtool" -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_GCJ | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` -# Method to check whether dependent libraries are shared objects. -deplibs_check_method=$lt_deplibs_check_method -# Command to use when deplibs_check_method == file_magic. -file_magic_cmd=$lt_file_magic_cmd -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag_GCJ +# Only expand once: -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag_GCJ -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds +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 -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$lt_finish_eval +# 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 -# 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 + 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 -# Transform the output of nm in a proper C declaration -global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl -# Transform the output of nm in a C name address pair -global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address -# This is the shared library runtime path variable. -runpath_var=$runpath_var +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 -# This is the shared library path variable. -shlibpath_var=$shlibpath_var +### +### Libraries +### -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath +{ echo "$as_me:$LINENO: checking for X" >&5 +echo $ECHO_N "checking for X... $ECHO_C" >&6; } -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action_GCJ -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs +# Check whether --with-x was given. +if test "${with_x+set}" = set; then + withval=$with_x; +fi -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_GCJ +# $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 -# If ld is used when linking, flag to hardcode \$libdir into -# a binary during linking. This must work even if \$libdir does -# not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ - -# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$hardcode_direct_GCJ - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$hardcode_minus_L_GCJ - -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ - -# Set to yes if building a shared library automatically hardcodes DIR into the library -# and all subsequent libraries and executables linked against it. -hardcode_automatic=$hardcode_automatic_GCJ +/usr/include/X11 +/usr/include/X11R6 +/usr/include/X11R5 +/usr/include/X11R4 -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" +/usr/local/X11/include +/usr/local/X11R6/include +/usr/local/X11R5/include +/usr/local/X11R4/include -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs_GCJ +/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 -# Compile-time system search path for libraries -sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` +/usr/openwin/include +/usr/openwin/share/include' -# Run-time system search path for libraries -sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec +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 -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$fix_srcfile_path_GCJ" + 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 -# Set to yes if exported symbols are required. -always_export_symbols=$always_export_symbols_GCJ +rm -f conftest.err conftest.$ac_ext +fi # $ac_x_includes = no -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds_GCJ +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 -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds + 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 -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms_GCJ +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi # $ac_x_libraries = no -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms_GCJ +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 -# ### END LIBTOOL TAG CONFIG: $tagname +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 -__EOF__ +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 there is no Makefile yet, we rely on a make rule to execute - # `config.status --recheck' to rerun these tests and create the - # libtool script then. - ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` - if test -f "$ltmain_in"; then - test -f Makefile && make "$ltmain" + if test -n "$x_includes"; then + X_CFLAGS="$X_CFLAGS -I$x_includes" fi -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. */ -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" +int +main () +{ - else - tagname="" - fi - ;; + ; + 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 - RC) + 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 () +{ -# Source file extension for RC test sources. -ac_ext=rc + ; + 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 -# Object file extension for compiled RC test sources. -objext=o -objext_RC=$objext + { echo "$as_me:$LINENO: result: neither works" >&5 +echo "${ECHO_T}neither works" >&6; } +fi -# Code to be used in simple compile tests -lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n' +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi -# Code to be used in simple link tests -lt_simple_link_test_code="$lt_simple_compile_test_code" +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 -# ltmain only uses $CC for tagged configurations so make sure $CC is set. + # 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 no C compiler was specified, use CC. -LTCC=${LTCC-"$CC"} + 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. */ -# If no C compiler flags were specified, use CFLAGS. -LTCFLAGS=${LTCFLAGS-"$CFLAGS"} +/* 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 -# Allow CC to be a program name with arguments. -compiler=$CC + { 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 -# save warnings/boilerplate of simple test code -ac_outfile=conftest.$ac_objext -printf "$lt_simple_compile_test_code" >conftest.$ac_ext -eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_compiler_boilerplate=`cat conftest.err` -$rm conftest* + ac_cv_lib_dnet_dnet_ntoa=no +fi -ac_outfile=conftest.$ac_objext -printf "$lt_simple_link_test_code" >conftest.$ac_ext -eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err -_lt_linker_boilerplate=`cat conftest.err` -$rm conftest* +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. */ -# Allow CC to be a program name with arguments. -lt_save_CC="$CC" -CC=${RC-"windres"} -compiler=$CC -compiler_RC=$CC -for cc_temp in $compiler""; do - case $cc_temp in - compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; - distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; - \-*) ;; - *) break;; - esac -done -cc_basename=`$echo "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` +/* 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 -lt_cv_prog_compiler_c_o_RC=yes + ac_cv_lib_dnet_stub_dnet_ntoa=no +fi -# The else clause should only fire when bootstrapping the -# libtool distribution, otherwise you forgot to ship ltmain.sh -# with your package, and you will get complaints that there are -# no rules to generate ltmain.sh. -if test -f "$ltmain"; then - # See if we are running on zsh, and set the options which allow our commands through - # without removal of \ escapes. - if test -n "${ZSH_VERSION+set}" ; then - setopt NO_GLOB_SUBST - fi - # Now quote all the things that may contain metacharacters while being - # careful not to overquote the AC_SUBSTed values. We take copies of the - # variables and quote the copies for generation of the libtool script. - for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC LTCFLAGS NM \ - SED SHELL STRIP \ - libname_spec library_names_spec soname_spec extract_expsyms_cmds \ - old_striplib striplib file_magic_cmd finish_cmds finish_eval \ - deplibs_check_method reload_flag reload_cmds need_locks \ - lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \ - lt_cv_sys_global_symbol_to_c_name_address \ - sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ - old_postinstall_cmds old_postuninstall_cmds \ - compiler_RC \ - CC_RC \ - LD_RC \ - lt_prog_compiler_wl_RC \ - lt_prog_compiler_pic_RC \ - lt_prog_compiler_static_RC \ - lt_prog_compiler_no_builtin_flag_RC \ - export_dynamic_flag_spec_RC \ - thread_safe_flag_spec_RC \ - whole_archive_flag_spec_RC \ - enable_shared_with_static_runtimes_RC \ - old_archive_cmds_RC \ - old_archive_from_new_cmds_RC \ - predep_objects_RC \ - postdep_objects_RC \ - predeps_RC \ - postdeps_RC \ - compiler_lib_search_path_RC \ - archive_cmds_RC \ - archive_expsym_cmds_RC \ - postinstall_cmds_RC \ - postuninstall_cmds_RC \ - old_archive_from_expsyms_cmds_RC \ - allow_undefined_flag_RC \ - no_undefined_flag_RC \ - export_symbols_cmds_RC \ - hardcode_libdir_flag_spec_RC \ - hardcode_libdir_flag_spec_ld_RC \ - hardcode_libdir_separator_RC \ - hardcode_automatic_RC \ - module_cmds_RC \ - module_expsym_cmds_RC \ - lt_cv_prog_compiler_c_o_RC \ - exclude_expsyms_RC \ - include_expsyms_RC; do - - case $var in - old_archive_cmds_RC | \ - old_archive_from_new_cmds_RC | \ - archive_cmds_RC | \ - archive_expsym_cmds_RC | \ - module_cmds_RC | \ - module_expsym_cmds_RC | \ - old_archive_from_expsyms_cmds_RC | \ - export_symbols_cmds_RC | \ - extract_expsyms_cmds | reload_cmds | finish_cmds | \ - postinstall_cmds | postuninstall_cmds | \ - old_postinstall_cmds | old_postuninstall_cmds | \ - sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) - # Double-quote double-evaled strings. - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" - ;; - *) - eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" - ;; - esac - done +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 - case $lt_echo in - *'\$0 --fallback-echo"') - lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` - ;; - esac + fi +fi -cfgfile="$ofile" +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$ac_xsave_LIBS" - cat <<__EOF__ >> "$cfgfile" -# ### BEGIN LIBTOOL TAG CONFIG: $tagname + # 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 -# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +/* 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. */ -# Shell to use when invoking shell scripts. -SHELL=$lt_SHELL +#ifdef __STDC__ +# include +#else +# include +#endif -# Whether or not to build shared libraries. -build_libtool_libs=$enable_shared +#undef gethostbyname -# Whether or not to build static libraries. -build_old_libs=$enable_static +/* 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 -# Whether or not to add -lc for building shared libraries. -build_libtool_need_lc=$archive_cmds_need_lc_RC +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 -# Whether or not to disallow shared libs when runtime libs are static -allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC + ac_cv_func_gethostbyname=no +fi -# Whether or not to optimize for fast installation. -fast_install=$enable_fast_install +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; } -# The host system. -host_alias=$host_alias -host=$host -host_os=$host_os + 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. */ -# The build system. -build_alias=$build_alias -build=$build -build_os=$build_os +/* 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 -# An echo program that does not interpret backslashes. -echo=$lt_echo + ac_cv_lib_nsl_gethostbyname=no +fi -# The archiver. -AR=$lt_AR -AR_FLAGS=$lt_AR_FLAGS +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 -# A C compiler. -LTCC=$lt_LTCC + 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. */ -# LTCC compiler flags. -LTCFLAGS=$lt_LTCFLAGS +/* 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 -# A language-specific compiler. -CC=$lt_compiler_RC + ac_cv_lib_bsd_gethostbyname=no +fi -# Is the compiler the GNU C compiler? -with_gcc=$GCC_RC +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 -gcc_dir=\`$CC -print-file-name=. | $SED 's,/\.$,,'\` -gcc_ver=\`$CC -dumpversion\` + fi + fi -# An ERE matcher. -EGREP=$lt_EGREP + # 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 -# The linker used to build libraries. -LD=$lt_LD_RC +/* 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. */ -# Whether we need hard or soft links. -LN_S=$lt_LN_S +#ifdef __STDC__ +# include +#else +# include +#endif -# A BSD-compatible nm program. -NM=$lt_NM +#undef connect -# A symbol stripping program -STRIP=$lt_STRIP +/* 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 -# Used to examine libraries when file_magic_cmd begins "file" -MAGIC_CMD=$MAGIC_CMD +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 -# Used on cygwin: DLL creation program. -DLLTOOL="$DLLTOOL" + ac_cv_func_connect=no +fi -# Used on cygwin: object dumper. -OBJDUMP="$OBJDUMP" +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; } -# Used on cygwin: assembler. -AS="$AS" + 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. */ -# The name of the directory that contains temporary libtool files. -objdir=$objdir +/* 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 -# How to create reloadable object files. -reload_flag=$lt_reload_flag -reload_cmds=$lt_reload_cmds + ac_cv_lib_socket_connect=no +fi -# How to pass a linker flag through the compiler. -wl=$lt_lt_prog_compiler_wl_RC +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 -# Object file suffix (normally "o"). -objext="$ac_objext" + fi -# Old archive suffix (normally "a"). -libext="$libext" + # 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 -# Shared library suffix (normally ".so"). -shrext_cmds='$shrext_cmds' +/* 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. */ -# Executable file suffix (normally ""). -exeext="$exeext" +#ifdef __STDC__ +# include +#else +# include +#endif -# Additional compiler flags for building library objects. -pic_flag=$lt_lt_prog_compiler_pic_RC -pic_mode=$pic_mode +#undef remove -# What is the maximum length of a command? -max_cmd_len=$lt_cv_sys_max_cmd_len +/* 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 -# Does compiler simultaneously support -c and -o options? -compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC +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 -# Must we lock files when doing compilation? -need_locks=$lt_need_locks + ac_cv_func_remove=no +fi -# Do we need the lib prefix for modules? -need_lib_prefix=$need_lib_prefix +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; } -# Do we need a version for libraries? -need_version=$need_version + 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. */ -# Whether dlopen is supported. -dlopen_support=$enable_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 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 -# Whether dlopen of programs is supported. -dlopen_self=$enable_dlopen_self + ac_cv_lib_posix_remove=no +fi -# Whether dlopen of statically linked programs is supported. -dlopen_self_static=$enable_dlopen_self_static +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 -# Compiler flag to prevent dynamic linking. -link_static_flag=$lt_lt_prog_compiler_static_RC + fi -# Compiler flag to turn off builtin functions. -no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC + # 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 -# Compiler flag to allow reflexive dlopens. -export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC +/* 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. */ -# Compiler flag to generate shared objects directly from archives. -whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC +#ifdef __STDC__ +# include +#else +# include +#endif -# Compiler flag to generate thread-safe objects. -thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC +#undef shmat -# Library versioning type. -version_type=$version_type +/* 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 -# Format of library name prefix. -libname_spec=$lt_libname_spec +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 -# 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 + ac_cv_func_shmat=no +fi -# The coded name of the library, if different from the real name. -soname_spec=$lt_soname_spec +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; } -# Commands used to build and install an old-style archive. -RANLIB=$lt_RANLIB -old_archive_cmds=$lt_old_archive_cmds_RC -old_postinstall_cmds=$lt_old_postinstall_cmds -old_postuninstall_cmds=$lt_old_postuninstall_cmds + 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. */ -# Create an old-style archive from a shared archive. -old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC +/* 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 -# Create a temporary old-style archive to link instead of a shared archive. -old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC + ac_cv_lib_ipc_shmat=no +fi -# Commands used to build and install a shared archive. -archive_cmds=$lt_archive_cmds_RC -archive_expsym_cmds=$lt_archive_expsym_cmds_RC -postinstall_cmds=$lt_postinstall_cmds -postuninstall_cmds=$lt_postuninstall_cmds +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 -# Commands used to build a loadable module (assumed same as above if empty) -module_cmds=$lt_module_cmds_RC -module_expsym_cmds=$lt_module_expsym_cmds_RC + fi + fi -# Commands to strip libraries. -old_striplib=$lt_old_striplib -striplib=$lt_striplib + # 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. */ -# Dependencies to place before the objects being linked to create a -# shared library. -predep_objects=\`echo $lt_predep_objects_RC | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` - -# Dependencies to place after the objects being linked to create a -# shared library. -postdep_objects=\`echo $lt_postdep_objects_RC | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` - -# Dependencies to place before the objects being linked to create a -# shared library. -predeps=$lt_predeps_RC - -# Dependencies to place after the objects being linked to create a -# shared library. -postdeps=$lt_postdeps_RC +/* 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 -# The library search path used internally by the compiler when linking -# a shared library. -compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_RC | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` + ac_cv_lib_ICE_IceConnectionNumber=no +fi -# Method to check whether dependent libraries are shared objects. -deplibs_check_method=$lt_deplibs_check_method +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 -# Command to use when deplibs_check_method == file_magic. -file_magic_cmd=$lt_file_magic_cmd + LDFLAGS=$ac_save_LDFLAGS -# Flag that allows shared libraries with undefined symbols to be built. -allow_undefined_flag=$lt_allow_undefined_flag_RC +fi -# Flag that forces no undefined symbols. -no_undefined_flag=$lt_no_undefined_flag_RC -# Commands used to finish a libtool library installation in a directory. -finish_cmds=$lt_finish_cmds +# 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" + enable_unity="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" -# Same as above, but a single script fragment to be evaled but not shown. -finish_eval=$lt_finish_eval + { 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. */ -# 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 +/* 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 -# Transform the output of nm in a proper C declaration -global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl + ac_cv_lib_Xext_XeviQueryVersion=no +fi -# 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 +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 -# This is the shared library runtime path variable. -runpath_var=$runpath_var -# This is the shared library path variable. -shlibpath_var=$shlibpath_var + { 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 -# Is shlibpath searched before the hard-coded library search path? -shlibpath_overrides_runpath=$shlibpath_overrides_runpath +#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 -# How to hardcode a shared library path into an executable. -hardcode_action=$hardcode_action_RC + ac_cv_header_X11_extensions_extutil_h=no +fi -# Whether we should hardcode library paths into libraries. -hardcode_into_libs=$hardcode_into_libs +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 -# Flag to hardcode \$libdir into a binary during linking. -# This must work even if \$libdir does not exist. -hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_RC -# If ld is used when linking, flag to hardcode \$libdir into -# a binary during linking. This must work even if \$libdir does -# not exist. -hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC - -# Whether we need a single -rpath flag with a separated argument. -hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC - -# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the -# resulting binary. -hardcode_direct=$hardcode_direct_RC - -# Set to yes if using the -LDIR flag during linking hardcodes DIR into the -# resulting binary. -hardcode_minus_L=$hardcode_minus_L_RC - -# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into -# the resulting binary. -hardcode_shlibpath_var=$hardcode_shlibpath_var_RC - -# Set to yes if building a shared library automatically hardcodes DIR into the library -# and all subsequent libraries and executables linked against it. -hardcode_automatic=$hardcode_automatic_RC -# Variables whose values should be saved in libtool wrapper scripts and -# restored at relink time. -variables_saved_for_relink="$variables_saved_for_relink" + 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. */ -# Whether libtool must link a program against all its dependency libraries. -link_all_deplibs=$link_all_deplibs_RC +/* 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 -# Compile-time system search path for libraries -sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\` + ac_cv_lib_Xinerama_XineramaQueryVersion=no +fi -# Run-time system search path for libraries -sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec +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 -# Fix the shell variable \$srcfile for the compiler. -fix_srcfile_path="$fix_srcfile_path_RC" + fi -# Set to yes if exported symbols are required. -always_export_symbols=$always_export_symbols_RC + { 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. */ -# The commands to list exported symbols. -export_symbols_cmds=$lt_export_symbols_cmds_RC +/* 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 -# The commands to extract the exported symbol list from a shared archive. -extract_expsyms_cmds=$lt_extract_expsyms_cmds + ac_cv_lib_Xrender_XRenderQueryVersion=no +fi -# Symbols that should not be listed in the preloaded symbols. -exclude_expsyms=$lt_exclude_expsyms_RC +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 -# Symbols that must always be exported. -include_expsyms=$lt_include_expsyms_RC -# ### END LIBTOOL TAG CONFIG: $tagname + { 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. */ -__EOF__ +/* 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 - # If there is no Makefile yet, we rely on a make rule to execute - # `config.status --recheck' to rerun these tests and create the - # libtool script then. - ltmain_in=`echo $ltmain | sed -e 's/\.sh$/.in/'` - if test -f "$ltmain_in"; then - test -f Makefile && make "$ltmain" - fi + { { 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 -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -CC="$lt_save_CC" - - ;; + { echo "$as_me:$LINENO: 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. */ - *) - { { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5 -echo "$as_me: error: Unsupported tag name: $tagname" >&2;} - { (exit 1); exit 1; }; } - ;; - esac +/* 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 - # Append the new tag name to the list of available tags. - if test -n "$tagname" ; then - available_tags="$available_tags $tagname" - fi - fi - done - IFS="$lt_save_ifs" + ac_cv_lib_Xtst_XTestQueryExtension=no +fi - # Now substitute the updated list of available tags. - if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then - mv "${ofile}T" "$ofile" - chmod +x "$ofile" - else - rm -f "${ofile}T" - { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5 -echo "$as_me: error: unable to update list of available tagged configurations." >&2;} +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 fi + # If we're building with support for Unity, we'll need a few additional + # libraries. + if test "$enable_unity" != "no"; then + + # Unity needs the X11 Screen Saver extension library. It should be + # in the same place as the X11 libraries, so no need for any fancy + # path checking. + { echo "$as_me:$LINENO: checking for XScreenSaverQueryExtension in -lXss" >&5 +echo $ECHO_N "checking for XScreenSaverQueryExtension in -lXss... $ECHO_C" >&6; } +if test "${ac_cv_lib_Xss_XScreenSaverQueryExtension+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lXss $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. */ -# This can be used to rebuild libtool when needed -LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh" - -# Always use our own libtool. -LIBTOOL='$(SHELL) $(top_builddir)/libtool' - -# Prevent multiple expansion - +/* 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 XScreenSaverQueryExtension (); +int +main () +{ +return XScreenSaverQueryExtension (); + ; + 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_Xss_XScreenSaverQueryExtension=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_lib_Xss_XScreenSaverQueryExtension=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_Xss_XScreenSaverQueryExtension" >&5 +echo "${ECHO_T}$ac_cv_lib_Xss_XScreenSaverQueryExtension" >&6; } +if test $ac_cv_lib_Xss_XScreenSaverQueryExtension = yes; then + COMMON_XLIBS="-lXss $COMMON_XLIBS" +else + { { echo "$as_me:$LINENO: error: libXss not found. Please configure without Unity (using --disable-unity) or install the libXss devel package." >&5 +echo "$as_me: error: libXss not found. Please configure without Unity (using --disable-unity) or install the libXss devel package." >&2;} + { (exit 1); exit 1; }; } +fi + # Check for the uriparser library and headers. The upstream uriparser + # doesn't appear to ship with either a pkg-config file or a + # uriparser-config binary, so we'll look for it the old-fashioned + # way. + # + # Note that we look for uriFreeQueryListA because it's a relatively + # new symbol that our code needs (it isn't present in the uriparser + # that shipped with Ubuntu Hardy). + ORIGINAL_LDFLAGS="$LDFLAGS" + LDFLAGS="$CUSTOM_URIPARSER_LIBS $LDFLAGS" + { echo "$as_me:$LINENO: checking for uriFreeQueryListA in -luriparser" >&5 +echo $ECHO_N "checking for uriFreeQueryListA in -luriparser... $ECHO_C" >&6; } +if test "${ac_cv_lib_uriparser_uriFreeQueryListA+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-luriparser $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 uriFreeQueryListA (); +int +main () +{ +return uriFreeQueryListA (); + ; + 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_uriparser_uriFreeQueryListA=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_lib_uriparser_uriFreeQueryListA=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_uriparser_uriFreeQueryListA" >&5 +echo "${ECHO_T}$ac_cv_lib_uriparser_uriFreeQueryListA" >&6; } +if test $ac_cv_lib_uriparser_uriFreeQueryListA = yes; then + if test -n "$CUSTOM_URIPARSER_LIBS"; then + URIPARSER_LIBS="$CUSTOM_URIPARSER_LIBS" + else + URIPARSER_LIBS="-luriparser" + fi +else + { { echo "$as_me:$LINENO: error: uriparser library not found or is too old. Please configure without Unity (using --disable-unity) or install the liburiparser devel package." >&5 +echo "$as_me: error: uriparser library not found or is too old. Please configure without Unity (using --disable-unity) or install the liburiparser devel package." >&2;} + { (exit 1); exit 1; }; } +fi + LDFLAGS="$ORIGINAL_LDFLAGS" + if test -n "$CUSTOM_URIPARSER_CPPFLAGS"; then + URIPARSER_CPPFLAGS="$CUSTOM_URIPARSER_CPPFLAGS" + else + # XXX: No pkg-config and no uriparser-config means we need to + # hard-code a sensible default. + URIPARSER_CPPFLAGS="-I/usr/include/uriparser" + fi + ORIGINAL_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$URIPARSER_CPPFLAGS $CPPFLAGS" + if test "${ac_cv_header_Uri_h+set}" = set; then + { echo "$as_me:$LINENO: checking for Uri.h" >&5 +echo $ECHO_N "checking for Uri.h... $ECHO_C" >&6; } +if test "${ac_cv_header_Uri_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_Uri_h" >&5 +echo "${ECHO_T}$ac_cv_header_Uri_h" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking Uri.h usability" >&5 +echo $ECHO_N "checking Uri.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 Uri.h presence" >&5 +echo $ECHO_N "checking Uri.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: Uri.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: Uri.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: Uri.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: Uri.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: Uri.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: Uri.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: Uri.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: Uri.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: Uri.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: Uri.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: Uri.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: Uri.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: Uri.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: Uri.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: Uri.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: Uri.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 Uri.h" >&5 +echo $ECHO_N "checking for Uri.h... $ECHO_C" >&6; } +if test "${ac_cv_header_Uri_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_Uri_h=$ac_header_preproc +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_Uri_h" >&5 +echo "${ECHO_T}$ac_cv_header_Uri_h" >&6; } +fi +if test $ac_cv_header_Uri_h = yes; then + : +else + { { echo "$as_me:$LINENO: error: uriparser headers not found. Please configure without Unity (using --disable-unity) or install the liburiparser devel package" >&5 +echo "$as_me: error: uriparser headers not found. Please configure without Unity (using --disable-unity) or install the liburiparser devel package" >&2;} + { (exit 1); exit 1; }; } +fi + CPPFLAGS="$ORIGINAL_CPPFLAGS" -# 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 + # Check for libpng using pkg-config, or barring that, using + # libpng-config. + if test "$HAVE_PKG_CONFIG" = "yes"; then + { echo "$as_me:$LINENO: checking for libpng (via pkg-config)" >&5 +echo $ECHO_N "checking for libpng (via pkg-config)... $ECHO_C" >&6; } + if pkg-config --exists libpng12; then + LIBPNG_CPPFLAGS="`pkg-config --cflags libpng12`" + LIBPNG_LIBS="`pkg-config --libs libpng12`" + { 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 + else + # Extract the first word of "libpng-config", so it can be a program name with args. +set dummy libpng-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 +if test "${ac_cv_path_LIBPNG_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 + case $LIBPNG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_LIBPNG_CONFIG="$LIBPNG_CONFIG" # 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_prog_HAVE_PKG_CONFIG="yes" + ac_cv_path_LIBPNG_CONFIG="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -20320,139 +18108,179 @@ done IFS=$as_save_IFS - test -z "$ac_cv_prog_HAVE_PKG_CONFIG" && ac_cv_prog_HAVE_PKG_CONFIG="no" -fi + test -z "$ac_cv_path_LIBPNG_CONFIG" && ac_cv_path_LIBPNG_CONFIG="no" + ;; +esac 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; } +LIBPNG_CONFIG=$ac_cv_path_LIBPNG_CONFIG +if test -n "$LIBPNG_CONFIG"; then + { echo "$as_me:$LINENO: result: $LIBPNG_CONFIG" >&5 +echo "${ECHO_T}$LIBPNG_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;} + if test "$LIBPNG_CONFIG" != "no"; then + LIBPNG_CPPFLAGS="`$LIBPNG_CONFIG --cflags`" + LIBPNG_LIBS="`$LIBPNG_CONFIG --libs`" + fi + fi + if test -z "$LIBPNG_CPPFLAGS"; then + { { echo "$as_me:$LINENO: error: libpng not found. Please configure without Unity (using --disable-unity) or install the libpng devel package" >&5 +echo "$as_me: error: libpng not found. Please configure without Unity (using --disable-unity) or install the libpng devel package" >&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 + 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 + # Check for the zlib library and headers. Like uriparser, there + # isn't a pkg-config or zlib-config file. + ORIGINAL_LDFLAGS="$LDFLAGS" + LDFLAGS="$CUSTOM_ZLIB_LIBS $LDFLAGS" + { echo "$as_me:$LINENO: checking for zlibVersion in -lz" >&5 +echo $ECHO_N "checking for zlibVersion in -lz... $ECHO_C" >&6; } +if test "${ac_cv_lib_z_zlibVersion+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}' + ac_check_lib_save_LIBS=$LIBS +LIBS="-lz $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ _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 +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -/usr/include/X11 -/usr/include/X11R6 -/usr/include/X11R5 -/usr/include/X11R4 +/* 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 zlibVersion (); +int +main () +{ +return zlibVersion (); + ; + 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_z_zlibVersion=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 -/usr/local/X11/include -/usr/local/X11R6/include -/usr/local/X11R5/include -/usr/local/X11R4/include + ac_cv_lib_z_zlibVersion=no +fi -/usr/local/include/X11 -/usr/local/include/X11R6 -/usr/local/include/X11R5 -/usr/local/include/X11R4 +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_z_zlibVersion" >&5 +echo "${ECHO_T}$ac_cv_lib_z_zlibVersion" >&6; } +if test $ac_cv_lib_z_zlibVersion = yes; then + if test -n "$CUSTOM_ZLIB_LIBS"; then + ZLIB_LIBS="$CUSTOM_ZLIB_LIBS" + else + ZLIB_LIBS="-lz" + fi +else + { { echo "$as_me:$LINENO: error: zlib library not found. Please configure without Unity (using --disable-unity) or install the zlib devel package." >&5 +echo "$as_me: error: zlib library not found. Please configure without Unity (using --disable-unity) or install the zlib devel package." >&2;} + { (exit 1); exit 1; }; } +fi -/usr/X386/include -/usr/x386/include -/usr/XFree86/include/X11 + LDFLAGS="$ORIGINAL_LDFLAGS" -/usr/include -/usr/local/include -/usr/unsupported/include -/usr/athena/include -/usr/local/x11r5/include -/usr/lpp/Xamples/include + if test -n "$CUSTOM_ZLIB_CPPFLAGS"; then + ZLIB_CPPFLAGS="$CUSTOM_ZLIB_CPPFLAGS" + else + # XXX: No pkg-config and no zlib-config means we need to + # hard-code a sensible default. + ZLIB_CPPFLAGS="-I/usr/include" + fi + ORIGINAL_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$ZLIB_CPPFLAGS $CPPFLAGS" + if test "${ac_cv_header_zlib_h+set}" = set; then + { echo "$as_me:$LINENO: checking for zlib.h" >&5 +echo $ECHO_N "checking for zlib.h... $ECHO_C" >&6; } +if test "${ac_cv_header_zlib_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5 +echo "${ECHO_T}$ac_cv_header_zlib_h" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking zlib.h usability" >&5 +echo $ECHO_N "checking zlib.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 -/usr/openwin/include -/usr/openwin/share/include' + ac_header_compiler=no +fi -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 +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 zlib.h presence" >&5 +echo $ECHO_N "checking zlib.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 +#include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in @@ -20470,40 +18298,101 @@ 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= + ac_header_preproc=yes 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 + ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -fi # $ac_x_includes = no +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } -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 +# 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: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: zlib.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: zlib.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: zlib.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: zlib.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: zlib.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: zlib.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: zlib.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: zlib.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: zlib.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: zlib.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: zlib.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: zlib.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 zlib.h" >&5 +echo $ECHO_N "checking for zlib.h... $ECHO_C" >&6; } +if test "${ac_cv_header_zlib_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_zlib_h=$ac_header_preproc +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5 +echo "${ECHO_T}$ac_cv_header_zlib_h" >&6; } + +fi +if test $ac_cv_header_zlib_h = yes; then + : +else + { { echo "$as_me:$LINENO: error: zlib headers not found. Please configure without Unity (using --disable-unity) or install the zlib devel package" >&5 +echo "$as_me: error: zlib headers not found. Please configure without Unity (using --disable-unity) or install the zlib devel package" >&2;} + { (exit 1); exit 1; }; } +fi + + + CPPFLAGS="$ORIGINAL_CPPFLAGS" + fi # End of library checks for Unity. + + if test -n "$CUSTOM_GTK_CPPFLAGS" -o -n "$CUSTOM_GTK_LIBS"; then + # Check to see if we have some version of GTK. gtk_accel_group_add + # is a random function that is present in Gtk 1.2 but not Gtk + # 2.0. Similarly, gtk_tree_view_new is a random function in Gtk 2.0 + # which is not present in Gtk 1.2. + { echo "$as_me:$LINENO: checking for gtk_accel_group_add in -lgtk" >&5 +echo $ECHO_N "checking for gtk_accel_group_add in -lgtk... $ECHO_C" >&6; } +if test "${ac_cv_lib_gtk_gtk_accel_group_add+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lgtk $CUSTOM_GTK_LIBS $LIBS" +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include + +/* 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 gtk_accel_group_add (); int main () { -XrmInitialize () +return gtk_accel_group_add (); ; return 0; } @@ -20526,97 +18415,50 @@ 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= + ac_cv_lib_gtk_gtk_accel_group_add=yes 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 + ac_cv_lib_gtk_gtk_accel_group_add=no 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 +LIBS=$ac_check_lib_save_LIBS 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; } +{ echo "$as_me:$LINENO: result: $ac_cv_lib_gtk_gtk_accel_group_add" >&5 +echo "${ECHO_T}$ac_cv_lib_gtk_gtk_accel_group_add" >&6; } +if test $ac_cv_lib_gtk_gtk_accel_group_add = yes; then + HAVE_GTK1="yes" 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= + if test "$with_gtk2" != "no"; then + { echo "$as_me:$LINENO: checking for gtk_tree_view_new in -lgtk-x11-2.0" >&5 +echo $ECHO_N "checking for gtk_tree_view_new in -lgtk-x11-2.0... $ECHO_C" >&6; } +if test "${ac_cv_lib_gtk_x11_2_0_gtk_tree_view_new+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 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 + ac_check_lib_save_LIBS=$LIBS +LIBS="-lgtk-x11-2.0 $CUSTOM_GTK_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 gtk_tree_view_new (); int main () { - +return gtk_tree_view_new (); ; return 0; } @@ -20639,25 +18481,138 @@ 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" + ac_cv_lib_gtk_x11_2_0_gtk_tree_view_new=yes 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 + ac_cv_lib_gtk_x11_2_0_gtk_tree_view_new=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_gtk_x11_2_0_gtk_tree_view_new" >&5 +echo "${ECHO_T}$ac_cv_lib_gtk_x11_2_0_gtk_tree_view_new" >&6; } +if test $ac_cv_lib_gtk_x11_2_0_gtk_tree_view_new = yes; then + HAVE_GTK2="yes" +fi + + fi + fi + + # Sometimes pkg-config can find stuff that AC_CHECK_LIB can't, so we use that as well. + if test "$HAVE_PKG_CONFIG" = "yes"; then + if test "$with_gtk2" != "no"; then + { 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 + HAVE_GTK2="yes" + { 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 + fi + + { echo "$as_me:$LINENO: checking for Gtk+ 1.x (via pkg-config)" >&5 +echo $ECHO_N "checking for Gtk+ 1.x (via pkg-config)... $ECHO_C" >&6; } + # The latter half of the test is because pkg-config's fallback + # to gtk-config is broken on systems such as Ubuntu that use + # bash-completion for unknown commands. (On Ubuntu, typing + # 'gtk-config' on a system that doesn't have libgtk1.2-dev + # installed outputs hints about using apt-get, in addition to the + # regular bash "command not found" message.) + if pkg-config --exists gtk+ \ + && test -n "`pkg-config --libs gtk+ 2>/dev/null | grep -v '^ *$'`"; then + HAVE_GTK1="yes" + { 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 + fi + + if test "$HAVE_GTK1" = "yes" -o "$HAVE_GTK2" = "yes"; then + # This bit is to fix builds on OpenSolaris B71, where + # 'pkg-config --cflags gtk+-2.0' gives an error. + if test "$HAVE_GTK2" = "yes" -a "$HAVE_PKG_CONFIG" = "yes" \ + && ! pkg-config --exists gtk+-2.0 \ + && test -z "$CUSTOM_GTK_CPPFLAGS" -a -z "$CUSTOM_GTK_LIBS"; then + HAVE_GTK2="no" + fi + + if test "$HAVE_GTK2" = "yes"; then + # Gtk 2.0 + GTK_CPPFLAGS="$GTK_CPPFLAGS -DGTK2" + gtkPackageName="gtk+-2.0" + elif test "$HAVE_GTK1" = "yes"; then + # Gtk 1.2 + gtkPackageName="gtk+" + + # Unity requires Gtk 2.0. + if test "$enable_unity" != "no"; then + { { echo "$as_me:$LINENO: error: The Unity feature requires Gtk+ 2.0. Please install the Gtk+ 2.0 devel packages or configure without Unity (using --disable-unity)" >&5 +echo "$as_me: error: The Unity feature requires Gtk+ 2.0. Please install the Gtk+ 2.0 devel packages or configure without Unity (using --disable-unity)" >&2;} + { (exit 1); exit 1; }; } + fi + else + # We found Gtk+ 2.0 that turned out to have a non-working + # pkg-config setup, AND Gtk 1.2 wasn't installed. + { { echo "$as_me:$LINENO: error: The Gtk+ library installed on your system is not fully functional. Please contact your OS vendor." >&5 +echo "$as_me: error: The Gtk+ library installed on your system is not fully functional. Please contact your OS vendor." >&2;} + { (exit 1); exit 1; }; } + fi + + # Prefer flags specified, in the environment, by the user. + if test -n "$CUSTOM_GTK_CPPFLAGS" -o -n "$CUSTOM_GTK_LIBS"; then + GTK_CPPFLAGS="$GTK_CPPFLAGS $CUSTOM_GTK_CPPFLAGS" + GTK_LIBS="$GTK_LIBS $CUSTOM_GTK_LIBS" + # Use pkg-config if available and there are no user-specified flags. + elif test "$HAVE_PKG_CONFIG" = "yes"; then + GTK_CPPFLAGS="$GTK_CPPFLAGS $(pkg-config --cflags $gtkPackageName)" + GTK_LIBS="$GTK_LIBS $(pkg-config --libs $gtkPackageName)" + # Otherwise, we have a problem. + else + { { echo "$as_me:$LINENO: error: pkg-config not found. Get pkg-config or set CUSTOM_GTK_CPPFLAGS and CUSTOM_GTK_LIBS to specify gtk header file and library locations." >&5 +echo "$as_me: error: pkg-config not found. Get pkg-config or set CUSTOM_GTK_CPPFLAGS and CUSTOM_GTK_LIBS to specify gtk header file and library locations." >&2;} + { (exit 1); exit 1; }; } + fi + + # Check for a sufficiently new installation of Gtk 2.0. This symbol is, at + # the time of writing, used in vmware-user. We must perform this check + # after GTK_LIBS has been set up. Note: we don't actually use the + # resultant HAVE_NEW_GTK2 variable; it's just set so that the default + # action, which will append gdk-x11-2.0 to LIBS, isn't taken. + if test "$HAVE_GTK2" == "yes"; then + { echo "$as_me:$LINENO: checking for gdk_display_get_default_group in -lgdk-x11-2.0" >&5 +echo $ECHO_N "checking for gdk_display_get_default_group in -lgdk-x11-2.0... $ECHO_C" >&6; } +if test "${ac_cv_lib_gdk_x11_2_0_gdk_display_get_default_group+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lgdk-x11-2.0 $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 gdk_display_get_default_group (); int main () { - +return gdk_display_get_default_group (); ; return 0; } @@ -20680,39 +18635,42 @@ 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" + ac_cv_lib_gdk_x11_2_0_gdk_display_get_default_group=yes 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; } + ac_cv_lib_gdk_x11_2_0_gdk_display_get_default_group=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_gdk_x11_2_0_gdk_display_get_default_group" >&5 +echo "${ECHO_T}$ac_cv_lib_gdk_x11_2_0_gdk_display_get_default_group" >&6; } +if test $ac_cv_lib_gdk_x11_2_0_gdk_display_get_default_group = yes; then + HAVE_NEW_GTK2="yes" +else + { { echo "$as_me:$LINENO: error: Gtk 2.0 installation may be too old. Please upgrade your Gtk 2.0 packages or configure without Gtk 2.0 (using --without-gtk2)" >&5 +echo "$as_me: error: Gtk 2.0 installation may be too old. Please upgrade your Gtk 2.0 packages or configure without Gtk 2.0 (using --without-gtk2)" >&2;} + { (exit 1); exit 1; }; } + $GTK_LIBS 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. + fi - 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 + # Unity requires libgdk_pixbuf_xlib, which most systems don't seem to + # provide via "pkg-config --libs gtk+-2.0". + if test "$enable_unity" != "no"; then + { echo "$as_me:$LINENO: checking for gdk_pixbuf_xlib_init in -lgdk_pixbuf_xlib-2.0" >&5 +echo $ECHO_N "checking for gdk_pixbuf_xlib_init in -lgdk_pixbuf_xlib-2.0... $ECHO_C" >&6; } +if test "${ac_cv_lib_gdk_pixbuf_xlib_2_0_gdk_pixbuf_xlib_init+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lgdk_pixbuf_xlib-2.0 $GTK_LIBS $LIBS" +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -20725,11 +18683,11 @@ #ifdef __cplusplus extern "C" #endif -char XOpenDisplay (); +char gdk_pixbuf_xlib_init (); int main () { -return XOpenDisplay (); +return gdk_pixbuf_xlib_init (); ; return 0; } @@ -20752,18 +18710,43 @@ test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - : + ac_cv_lib_gdk_pixbuf_xlib_2_0_gdk_pixbuf_xlib_init=yes 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 + ac_cv_lib_gdk_pixbuf_xlib_2_0_gdk_pixbuf_xlib_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_gdk_pixbuf_xlib_2_0_gdk_pixbuf_xlib_init" >&5 +echo "${ECHO_T}$ac_cv_lib_gdk_pixbuf_xlib_2_0_gdk_pixbuf_xlib_init" >&6; } +if test $ac_cv_lib_gdk_pixbuf_xlib_2_0_gdk_pixbuf_xlib_init = yes; then + GTK_LIBS="$GTK_LIBS -lgdk_pixbuf_xlib-2.0" +else + { { echo "$as_me:$LINENO: error: gdk_pixbuf_xlib-2.0 not found. Make sure your Gtk 2.0 installation is sane, or configure without Unity (using --disable-unity)." >&5 +echo "$as_me: error: gdk_pixbuf_xlib-2.0 not found. Make sure your Gtk 2.0 installation is sane, or configure without Unity (using --disable-unity)." >&2;} + { (exit 1); exit 1; }; } +fi + + fi + else + { { echo "$as_me:$LINENO: error: libgtk not found. Please install the gtk devel package(s)." >&5 +echo "$as_me: error: libgtk not found. Please install the gtk devel package(s)." >&2;} + { (exit 1); exit 1; }; } + 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="-ldnet $LIBS" +LIBS="-lcrypt $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -20777,11 +18760,11 @@ #ifdef __cplusplus extern "C" #endif -char dnet_ntoa (); +char crypt (); int main () { -return dnet_ntoa (); +return crypt (); ; return 0; } @@ -20804,32 +18787,37 @@ test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - ac_cv_lib_dnet_dnet_ntoa=yes + ac_cv_lib_crypt_crypt=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_dnet_dnet_ntoa=no + 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_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" +{ 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" + GUESTD_LDADD="$GUESTD_LDADD -lcrypt" +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 - 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 "$as_me:$LINENO: checking for notify_init in -lnotify" >&5 +echo $ECHO_N "checking for notify_init in -lnotify... $ECHO_C" >&6; } +if test "${ac_cv_lib_notify_notify_init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-ldnet_stub $LIBS" +LIBS="-lnotify $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -20843,11 +18831,11 @@ #ifdef __cplusplus extern "C" #endif -char dnet_ntoa (); +char notify_init (); int main () { -return dnet_ntoa (); +return notify_init (); ; return 0; } @@ -20870,42 +18858,36 @@ test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - ac_cv_lib_dnet_stub_dnet_ntoa=yes + ac_cv_lib_notify_notify_init=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_dnet_stub_dnet_ntoa=no + ac_cv_lib_notify_notify_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_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" +{ echo "$as_me:$LINENO: result: $ac_cv_lib_notify_notify_init" >&5 +echo "${ECHO_T}$ac_cv_lib_notify_notify_init" >&6; } +if test $ac_cv_lib_notify_notify_init = yes; then + HAVE_NOTIFY="yes" + VMWARE_USER_LDADD="$VMWARE_USER_LDADD -lnotify" +else + { echo "$as_me:$LINENO: WARNING: libnotify not found; notification disabled" >&5 +echo "$as_me: WARNING: libnotify not found; notification disabled" >&2;} 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 +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 @@ -20914,12 +18896,12 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define gethostbyname to an innocuous variant, in case declares gethostbyname. +/* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ -#define gethostbyname innocuous_gethostbyname +#define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char gethostbyname (); below. + which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ @@ -20929,7 +18911,7 @@ # include #endif -#undef gethostbyname +#undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC @@ -20937,18 +18919,18 @@ #ifdef __cplusplus extern "C" #endif -char gethostbyname (); +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_gethostbyname || defined __stub___gethostbyname +#if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { -return gethostbyname (); +return $ac_func (); ; return 0; } @@ -20971,28 +18953,33 @@ test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - ac_cv_func_gethostbyname=yes + eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_func_gethostbyname=no + 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 -{ echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5 -echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6; } +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 - 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 +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="-lnsl $LIBS" +LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -21006,11 +18993,11 @@ #ifdef __cplusplus extern "C" #endif -char gethostbyname (); +char dlopen (); int main () { -return gethostbyname (); +return dlopen (); ; return 0; } @@ -21033,38 +19020,63 @@ test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - ac_cv_lib_nsl_gethostbyname=yes + ac_cv_lib_dl_dlopen=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_nsl_gethostbyname=no + 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_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" +{ 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 + GUESTD_LDADD="$GUESTD_LDADD -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 - 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 +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 - ac_check_lib_save_LIBS=$LIBS -LIBS="-lbsd $LIBS" -cat >conftest.$ac_ext <<_ACEOF + 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 @@ -21072,11 +19084,18 @@ #ifdef __cplusplus extern "C" #endif -char gethostbyname (); +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 gethostbyname (); +return $ac_func (); ; return 0; } @@ -21099,37 +19118,35 @@ test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - ac_cv_lib_bsd_gethostbyname=yes + eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_bsd_gethostbyname=no + eval "$as_ac_var=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" +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 - 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 +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 @@ -21138,12 +19155,12 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Define connect to an innocuous variant, in case declares connect. +/* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ -#define connect innocuous_connect +#define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, - which can conflict with char connect (); below. + which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ @@ -21153,7 +19170,7 @@ # include #endif -#undef connect +#undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC @@ -21161,18 +19178,18 @@ #ifdef __cplusplus extern "C" #endif -char connect (); +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_connect || defined __stub___connect +#if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { -return connect (); +return $ac_func (); ; return 0; } @@ -21195,28 +19212,36 @@ test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - ac_cv_func_connect=yes + eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_func_connect=no + 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 -{ echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5 -echo "${ECHO_T}$ac_cv_func_connect" >&6; } +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 - 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 +fi +done + + +{ 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="-lsocket $X_EXTRA_LIBS $LIBS" +LIBS="-lpthread $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -21230,11 +19255,11 @@ #ifdef __cplusplus extern "C" #endif -char connect (); +char pthread_mutex_init (); int main () { -return connect (); +return pthread_mutex_init (); ; return 0; } @@ -21257,54 +19282,69 @@ test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - ac_cv_lib_socket_connect=yes + 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_socket_connect=no + 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_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" +{ 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 + GUESTD_LDADD="$GUESTD_LDADD -lpthread" + VMWARE_USER_LDADD="$VMWARE_USER_LDADD -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 - # 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 +# 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 + ORIGINAL_LDFLAGS="$LDFLAGS" + LDFLAGS="$CUSTOM_PROCPS_LIBS $LDFLAGS" + { echo "$as_me:$LINENO: checking for getstat in -lproc-3.2.7" >&5 +echo $ECHO_N "checking for getstat in -lproc-3.2.7... $ECHO_C" >&6; } +if test "${ac_cv_lib_proc_3_2_7_getstat+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_check_lib_save_LIBS=$LIBS +LIBS="-lproc-3.2.7 $LIBS" +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 @@ -21312,18 +19352,11 @@ #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 - +char getstat (); int main () { -return remove (); +return getstat (); ; return 0; } @@ -21346,28 +19379,330 @@ test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - ac_cv_func_remove=yes + ac_cv_lib_proc_3_2_7_getstat=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_proc_3_2_7_getstat=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_proc_3_2_7_getstat" >&5 +echo "${ECHO_T}$ac_cv_lib_proc_3_2_7_getstat" >&6; } +if test $ac_cv_lib_proc_3_2_7_getstat = yes; then + if test -n "$CUSTOM_PROCPS_LIBS"; then + PROCPS_LIBS="$CUSTOM_PROCPS_LIBS" + else + PROCPS_LIBS="-lproc-3.2.7" + fi +else + { { 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 + + LDFLAGS="$ORIGINAL_LDFLAGS" + + GUESTD_LDADD="$GUESTD_LDADD $PROCPS_LIBS" + VMWARE_USER_LDADD="$VMWARE_USER_LDADD $PROCPS_LIBS" +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 + + +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. + for ac_prog in dumbnet-config dnet-config +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_DNET_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$DNET_CONFIG"; then + ac_cv_prog_DNET_CONFIG="$DNET_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_DNET_CONFIG="$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 +DNET_CONFIG=$ac_cv_prog_DNET_CONFIG +if test -n "$DNET_CONFIG"; then + { echo "$as_me:$LINENO: result: $DNET_CONFIG" >&5 +echo "${ECHO_T}$DNET_CONFIG" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$DNET_CONFIG" && break +done +test -n "$DNET_CONFIG" || DNET_CONFIG="no" + + + if test "$DNET_CONFIG" != no; then + DNET_CPPFLAGS="`$DNET_CONFIG --cflags`" + DNET_LIBS="`$DNET_CONFIG --libs`" + + GUESTD_LDADD="$GUESTD_LDADD $DNET_LIBS" + VMWARE_USER_LDADD="$VMWARE_USER_LDADD $DNET_LIBS" + if test "$DNET_CONFIG" == dumbnet-config; then + +cat >>confdefs.h <<\_ACEOF +#define DNET_IS_DUMBNET 1 +_ACEOF + + fi + else + { { 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 "$with_icu" = "yes"; 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_ICU_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $ICU_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ICU_CONFIG="$ICU_CONFIG" # 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_ICU_CONFIG="$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_ICU_CONFIG" && ac_cv_path_ICU_CONFIG="no" + ;; +esac +fi +ICU_CONFIG=$ac_cv_path_ICU_CONFIG +if test -n "$ICU_CONFIG"; then + { echo "$as_me:$LINENO: result: $ICU_CONFIG" >&5 +echo "${ECHO_T}$ICU_CONFIG" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + + if test "$ICU_CONFIG" != no; then + ICU_CPPFLAGS="`$ICU_CONFIG --cppflags` -DUSE_ICU" + ICU_LIBS="`$ICU_CONFIG --ldflags`" + + # The icu components are built with C++, so we need to ensure + # that the C++ linker actually exists, and use it when linking + # icu into our applications and when performing configuration + # tests against icu. + # + # XXX: Getting automake to choose between the C linker and the + # C++ linker depending on HAVE_ICU was a royal pain in the ass. + # The classic way to do this is to define an optional source + # file for a program with an extension of .cxx, using + # nodist_EXTRA_fooprogram_SOURCES. This causes automake's + # linker detection algorithm to see a C++ source file and + # automatically set up the C++ linker and link line for us. + # Unfortunately, said linker detection doesn't obey + # conditionals, which means that it'd always pick the C++ + # linker, regardless of the value of HAVE_ICU. Instead, we are + # forced to manually set the correct linker in fooprogram_LINK. + # However, since none of our programs actually contain C++ + # code, automake doesn't make the CXXLINK variable (which + # contains the linker as well as all link flags) available to + # us, so we must hard-code the entire link line into + # fooprogram_LINK. Not exactly a futureproof solution... + # + # Additional references on this problem: + # http://sources.redhat.com/ml/automake/1999-10/msg00101.html + # http://lists.gnu.org/archive/html/bug-automake/2008-04/msg00010.html + # http://www.gnu.org/software/automake/manual/automake.html#Libtool-Convenience-Libraries + # http://www.gnu.org/software/automake/manual/automake.html#C_002b_002b-Support + 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 - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + 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 - ac_cv_func_remove=no +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 -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext + if test "x$ac_ct_HAVE_CXX" = x; then + HAVE_CXX="" + 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 -{ 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 + if test -z "$HAVE_CXX"; then + { { echo "$as_me:$LINENO: error: No C++ compiler was found on your PATH. Please configure without ICU (using --without-icu) or install a C++ compiler." >&5 +echo "$as_me: error: No C++ compiler was found on your PATH. Please configure without ICU (using --without-icu) or install a C++ compiler." >&2;} + { (exit 1); exit 1; }; } + 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 + + { echo "$as_me:$LINENO: checking for ucasemap_utf8ToTitle_3_8 in -licuuc" >&5 +echo $ECHO_N "checking for ucasemap_utf8ToTitle_3_8 in -licuuc... $ECHO_C" >&6; } +if test "${ac_cv_lib_icuuc_ucasemap_utf8ToTitle_3_8+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lposix $LIBS" +LIBS="-licuuc $ICU_LIBS $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -21381,11 +19716,11 @@ #ifdef __cplusplus extern "C" #endif -char remove (); +char ucasemap_utf8ToTitle_3_8 (); int main () { -return remove (); +return ucasemap_utf8ToTitle_3_8 (); ; return 0; } @@ -21404,89 +19739,130 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || + test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && $as_test_x conftest$ac_exeext; then - ac_cv_lib_posix_remove=yes + ac_cv_lib_icuuc_ucasemap_utf8ToTitle_3_8=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_posix_remove=no + ac_cv_lib_icuuc_ucasemap_utf8ToTitle_3_8=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" +{ echo "$as_me:$LINENO: result: $ac_cv_lib_icuuc_ucasemap_utf8ToTitle_3_8" >&5 +echo "${ECHO_T}$ac_cv_lib_icuuc_ucasemap_utf8ToTitle_3_8" >&6; } +if test $ac_cv_lib_icuuc_ucasemap_utf8ToTitle_3_8 = yes; then + have_ICU_38="yes" 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 - # 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 + + if test "$have_ICU_38" = "yes"; then + ICU_CPPFLAGS="$ICU_CPPFLAGS -DHAVE_ICU_38" + fi + + # Easier to give all modules the ICU defines/includes... + CPPFLAGS="$CPPFLAGS $ICU_CPPFLAGS" + else + { { echo "$as_me:$LINENO: error: icu-config was not found on your PATH. Please configure without ICU (using --without-icu) or install ICU - http://www.icu-project.org" >&5 +echo "$as_me: error: icu-config was not found on your PATH. Please configure without ICU (using --without-icu) or install ICU - http://www.icu-project.org" >&2;} + { (exit 1); exit 1; }; } + fi +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 - 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 + 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 -/* 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. */ + 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 -#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 +### +### Headers +### -int -main () -{ -return shmat (); - ; - return 0; -} + +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 -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" +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_link") 2>conftest.er1 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -21495,137 +19871,143 @@ (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 + } && 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_cv_func_shmat=no + ac_header_compiler=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; } +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; } - 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" +# 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. */ - -/* 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; -} +#include <$ac_header> _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" +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_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 +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 - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_ipc_shmat=no + 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; } -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" +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + fi - fi - fi +done - # 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 + +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 - ac_check_lib_save_LIBS=$LIBS -LIBS="-lICE $X_EXTRA_LIBS $LIBS" + # 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. */ - -/* 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; -} +$ac_includes_default +#include <$ac_header> _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" +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_link") 2>conftest.er1 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -21634,153 +20016,143 @@ (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 + } && 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_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 - + 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; } -# If the user explicitly disables X11, then don't try to detect the X-related libraries -if test "$have_x" = "disabled"; then - MULTIMON_ENABLED="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 - LIBS="$LIBS $X_LIBS" - CFLAGS="$CFLAGS $X_CFLAGS" - COMMON_XLIBS="-lX11" - COMMON_XLIBS="-lXext $COMMON_XLIBS" - - if test "$MULTIMON_ENABLED" != "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" +# 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. */ - -/* 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; -} +#include <$ac_header> _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" +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_link") 2>conftest.er1 + (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); } && { - test -z "$ac_c_werror_flag" || + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$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 + }; then + ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_Xinerama_XineramaQueryVersion=no + ac_header_preproc=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" +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 - { { 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; }; } + 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 +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF - { 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 +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 - ac_check_lib_save_LIBS=$LIBS -LIBS="-lXrandr -lXrender $COMMON_XLIBS $LIBS" + # 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. */ - -/* 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; -} +$ac_includes_default +#include <$ac_header> _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" +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_link") 2>conftest.er1 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -21789,144 +20161,143 @@ (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 + } && 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_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" - COMMON_XLIBS="-lXrender $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; }; } + 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; } - { 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" +# 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. */ - -/* 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; -} +#include <$ac_header> _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" +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_link") 2>conftest.er1 + (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); } && { - test -z "$ac_c_werror_flag" || + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$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 + }; then + ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_Xtst_XTestQueryExtension=no + ac_header_preproc=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" +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 - { { 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; }; } + 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 - if test -n "$CUSTOM_GTK_CFLAGS" -o -n "$CUSTOM_GTK_LIBS"; then - # Check to see if we have some version of GTK. gtk_accel_group_add - # is a random function that is present in Gtk 1.2 but not Gtk - # 2.0. Similarly, gtk_tree_view_new is a random function in Gtk 2.0 - # which is not present in Gtk 1.2. - { echo "$as_me:$LINENO: checking for gtk_accel_group_add in -lgtk" >&5 -echo $ECHO_N "checking for gtk_accel_group_add in -lgtk... $ECHO_C" >&6; } -if test "${ac_cv_lib_gtk_gtk_accel_group_add+set}" = set; then +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 - ac_check_lib_save_LIBS=$LIBS -LIBS="-lgtk $CUSTOM_GTK_LIBS $LIBS" + # 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. */ - -/* 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 gtk_accel_group_add (); -int -main () -{ -return gtk_accel_group_add (); - ; - return 0; -} +$ac_includes_default +#include <$ac_header> _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" +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_link") 2>conftest.er1 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -21935,208 +20306,143 @@ (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_gtk_gtk_accel_group_add=yes + } && 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_cv_lib_gtk_gtk_accel_group_add=no + ac_header_compiler=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_gtk_gtk_accel_group_add" >&5 -echo "${ECHO_T}$ac_cv_lib_gtk_gtk_accel_group_add" >&6; } -if test $ac_cv_lib_gtk_gtk_accel_group_add = yes; then - HAVE_GTK1="yes" -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; } - { echo "$as_me:$LINENO: checking for gtk_tree_view_new in -lgtk-x11-2.0" >&5 -echo $ECHO_N "checking for gtk_tree_view_new in -lgtk-x11-2.0... $ECHO_C" >&6; } -if test "${ac_cv_lib_gtk_x11_2_0_gtk_tree_view_new+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lgtk-x11-2.0 $CUSTOM_GTK_LIBS $LIBS" +# 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. */ - -/* 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 gtk_tree_view_new (); -int -main () -{ -return gtk_tree_view_new (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" +#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_link") 2>conftest.er1 + (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); } && { - test -z "$ac_c_werror_flag" || + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_lib_gtk_x11_2_0_gtk_tree_view_new=yes + }; then + ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_gtk_x11_2_0_gtk_tree_view_new=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_gtk_x11_2_0_gtk_tree_view_new" >&5 -echo "${ECHO_T}$ac_cv_lib_gtk_x11_2_0_gtk_tree_view_new" >&6; } -if test $ac_cv_lib_gtk_x11_2_0_gtk_tree_view_new = yes; then - HAVE_GTK2="yes" + ac_header_preproc=no fi - fi - - # Sometimes pkg-config can find stuff that AC_CHECK_LIB can't, so we use that as well. - if test "$HAVE_PKG_CONFIG" = "yes"; then - { 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 - HAVE_GTK2="yes" - { 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 +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } - { echo "$as_me:$LINENO: checking for Gtk+ 1.x (via pkg-config)" >&5 -echo $ECHO_N "checking for Gtk+ 1.x (via pkg-config)... $ECHO_C" >&6; } - # The latter half of the test is because pkg-config's fallback - # to gtk-config is broken on systems such as Ubuntu that use - # bash-completion for unknown commands. (On Ubuntu, typing - # 'gtk-config' on a system that doesn't have libgtk1.2-dev - # installed outputs hints about using apt-get, in addition to the - # regular bash "command not found" message.) - if pkg-config --exists gtk+ \ - && test -n "`pkg-config --libs gtk+ 2>/dev/null | grep -v '^ *$'`"; then - HAVE_GTK1="yes" - { 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 - fi +# 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; } - if test "$HAVE_GTK1" = "yes" -o "$HAVE_GTK2" = "yes"; then - # This bit is to fix builds on OpenSolaris B71, where - # 'pkg-config --cflags gtk+-2.0' gives an error. - if test "$HAVE_GTK2" = "yes" -a "$HAVE_PKG_CONFIG" = "yes" \ - && ! pkg-config --exists gtk+-2.0 \ - && test -z "$CUSTOM_GTK_CFLAGS" -a -z "$CUSTOM_GTK_LIBS"; then - HAVE_GTK2="no" - fi +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF - if test "$HAVE_GTK2" = "yes"; then - # Gtk 2.0 - GTK_CFLAGS="$GTK_CFLAGS -DGTK2" - gtkPackageName="gtk+-2.0" - elif test "$HAVE_GTK1" = "yes"; then - # Gtk 1.2 - gtkPackageName="gtk+" - else - # We found Gtk+ 2.0 that turned out to have a non-working - # pkg-config setup, AND Gtk 1.2 wasn't installed. - { { echo "$as_me:$LINENO: error: The Gtk+ library installed on your system is not fully functional. Please contact your OS vendor." >&5 -echo "$as_me: error: The Gtk+ library installed on your system is not fully functional. Please contact your OS vendor." >&2;} - { (exit 1); exit 1; }; } - fi +fi - # Prefer flags specified, in the environment, by the user. - if test -n "$CUSTOM_GTK_CFLAGS" -o -n "$CUSTOM_GTK_LIBS"; then - GTK_CFLAGS="$GTK_CFLAGS $CUSTOM_GTK_CFLAGS" - GTK_LIBS="$GTK_LIBS $CUSTOM_GTK_LIBS" - # Use pkg-config if available and there are no user-specified flags. - elif test "$HAVE_PKG_CONFIG" = "yes"; then - GTK_CFLAGS="$GTK_CFLAGS $(pkg-config --cflags $gtkPackageName)" - GTK_LIBS="$GTK_LIBS $(pkg-config --libs $gtkPackageName)" - # Otherwise, we have a problem. - else - { { echo "$as_me:$LINENO: error: pkg-config not found. Get pkg-config or set CUSTOM_GTK_CFLAGS and CUSTOM_GTK_LIBS to specify gtk header file and library locations." >&5 -echo "$as_me: error: pkg-config not found. Get pkg-config or set CUSTOM_GTK_CFLAGS and CUSTOM_GTK_LIBS to specify gtk header file and library locations." >&2;} - { (exit 1); exit 1; }; } - fi +done - else - { { echo "$as_me:$LINENO: error: libgtk not found. Please install the gtk devel package(s)." >&5 -echo "$as_me: error: libgtk not found. Please install the gtk devel package(s)." >&2;} - { (exit 1); exit 1; }; } - 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 +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 - ac_check_lib_save_LIBS=$LIBS -LIBS="-lcrypt $LIBS" + # 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. */ - -/* 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; -} +$ac_includes_default +#include <$ac_header> _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" +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_link") 2>conftest.er1 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -22145,161 +20451,143 @@ (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 + } && 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_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" - GUESTD_LDFLAGS="$GUESTD_LDFLAGS -lcrypt" -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; }; } + ac_header_compiler=no 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; -} +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 -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" +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_link") 2>conftest.er1 + (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); } && { - test -z "$ac_c_werror_flag" || + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$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" + }; then + ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_var=no" + ac_header_preproc=no fi -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext +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_var'}'` +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_var'}'` = yes; then + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `echo "HAVE_$ac_header" | $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 +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 - ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" + # 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. */ - -/* 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; -} +$ac_includes_default +#include <$ac_header> _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" +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_link") 2>conftest.er1 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -22308,190 +20596,143 @@ (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 + } && 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_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 - GUESTD_LDFLAGS="$GUESTD_LDFLAGS -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 - + ac_header_compiler=no fi -done - +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; } -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 +# 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. */ -/* 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; -} +#include <$ac_header> _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" +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_link") 2>conftest.er1 + (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); } && { - test -z "$ac_c_werror_flag" || + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$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" + }; 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 - 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 + eval "$as_ac_Header=\$ac_header_preproc" fi -ac_res=`eval echo '${'$as_ac_var'}'` +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_var'}'` = yes; then + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi + done -for ac_func in fcvt +for ac_header in sys/io.h 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 +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 - cat >conftest.$ac_ext <<_ACEOF + # 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. */ -/* 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; -} +$ac_includes_default +#include <$ac_header> _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" +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_link") 2>conftest.er1 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -22500,166 +20741,111 @@ (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" + } && test -s conftest.$ac_objext; then + ac_header_compiler=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 - + ac_header_compiler=no fi -done +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; } -{ 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" +# 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. */ - -/* 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; -} +#include <$ac_header> _ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" +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_link") 2>conftest.er1 + (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); } && { - test -z "$ac_c_werror_flag" || + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$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 + }; then + ac_header_preproc=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 - GUESTD_LDFLAGS="$GUESTD_LDFLAGS -lpthread" - VMWARE_USER_LDFLAGS="$VMWARE_USER_LDFLAGS -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; }; } + 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; } -if test "$os" = "solaris"; then - # libdnet is needed on Solaris to build guestInfoPosix.c. - - # 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_DNET_CONFIG+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $DNET_CONFIG in - [\\/]* | ?:[\\/]*) - ac_cv_path_DNET_CONFIG="$DNET_CONFIG" # 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_DNET_CONFIG="$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_DNET_CONFIG" && ac_cv_path_DNET_CONFIG="no" - ;; +# 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 -fi -DNET_CONFIG=$ac_cv_path_DNET_CONFIG -if test -n "$DNET_CONFIG"; then - { echo "$as_me:$LINENO: result: $DNET_CONFIG" >&5 -echo "${ECHO_T}$DNET_CONFIG" >&6; } +{ 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 - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + 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 - - if test "$DNET_CONFIG" = "no"; then - { { echo "$as_me:$LINENO: error: dnet-config was not found on your PATH. libdnet must be installed in order to build open-vm-tools on Solaris. See http://libdnet.sourceforge.net/" >&5 -echo "$as_me: error: dnet-config was not found on your PATH. libdnet must be installed in order to build open-vm-tools on Solaris. See http://libdnet.sourceforge.net/" >&2;} - { (exit 1); exit 1; }; } - fi - - DNET_CFLAGS="`$DNET_CONFIG --cflags`" - DNET_LIBS="`$DNET_CONFIG --libs`" - - GUESTD_LDFLAGS="$GUESTD_LDFLAGS $DNET_LIBS" - VMWARE_USER_LDFLAGS="$VMWARE_USER_LDFLAGS $DNET_LIBS" fi -### -### Headers -### +done -for ac_header in crypt.h +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 @@ -22802,9 +20988,9 @@ fi done + # Required to make the sys/user.h check work correctly on FreeBSD - -for ac_header in inttypes.h +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 @@ -22949,7 +21135,7 @@ done -for ac_header in stdint.h +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 @@ -23094,7 +21280,69 @@ done -for ac_header in stdlib.h +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 @@ -23239,7 +21487,7 @@ done -for ac_header in wchar.h +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 @@ -23384,7 +21632,7 @@ done -for ac_header in sys/inttypes.h +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 @@ -23529,22 +21777,18 @@ 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 +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 -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +{ 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 $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +{ 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 @@ -23552,7 +21796,7 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -#include <$ac_header> +#include _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" @@ -23584,15 +21828,15 @@ 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; } +{ 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 <$ac_header> +#include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in @@ -23625,25 +21869,25 @@ # 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;} + { 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: $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;} + { 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 ## @@ -23652,52 +21896,171 @@ ) | 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 "$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 - eval "$as_ac_Header=\$ac_header_preproc" + ac_cv_header_wchar_h=$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; } +{ echo "$as_me:$LINENO: result: $ac_cv_header_wchar_h" >&5 +echo "${ECHO_T}$ac_cv_header_wchar_h" >&6; } fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +if test $ac_cv_header_wchar_h = yes; then + HAVE_WCHAR_H="yes" +else + HAVE_WCHAR_H="no" +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 -done +### +### 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); -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> + ; + return 0; +} _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" @@ -23716,133 +22079,156 @@ test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_header_compiler=yes + ac_cv_header_stdbool_h=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_compiler=no + ac_cv_header_stdbool_h=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 +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. */ -#include <$ac_header> +$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 -if { (ac_try="$ac_cpp conftest.$ac_ext" +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_cpp conftest.$ac_ext") 2>conftest.er1 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? 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" || + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || test ! -s conftest.err - }; then - ac_header_preproc=yes + } && 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_header_preproc=no + ac_cv_type__Bool=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" +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; } +{ 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 -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +cat >>confdefs.h <<_ACEOF +#define HAVE__BOOL 1 _ACEOF + fi -done - # Required to make the sys/user.h check work correctly on FreeBSD +if test $ac_cv_header_stdbool_h = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_STDBOOL_H 1 +_ACEOF -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; } + +{ 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 - # 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 + 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> + +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" @@ -23861,133 +22247,83 @@ test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_header_compiler=yes + ac_cv_c_const=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_compiler=no + ac_cv_c_const=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; } +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 -# 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 +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 <$ac_header> +#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 +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "uid_t" >/dev/null 2>&1; then + ac_cv_type_uid_t=yes else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no + ac_cv_type_uid_t=no fi +rm -f conftest* -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; } +{ 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 -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +cat >>confdefs.h <<\_ACEOF +#define uid_t int _ACEOF -fi -done +cat >>confdefs.h <<\_ACEOF +#define gid_t int +_ACEOF +fi -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 "$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 -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 + 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. */ -$ac_includes_default -#include <$ac_header> +#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" @@ -24006,115 +22342,104 @@ test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_header_compiler=yes + ac_cv_c_inline=$ac_kw 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; } + test "$ac_cv_c_inline" != no && break +done -# 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 +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. */ -#include <$ac_header> +$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 -if { (ac_try="$ac_cpp conftest.$ac_ext" +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_cpp conftest.$ac_ext") 2>conftest.er1 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? 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" || + (exit $ac_status); } && { + test -z "$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 + } && test -s conftest.$ac_objext; then + ac_cv_type_mode_t=yes 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; } + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_cv_type_mode_t=no fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +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 -done +cat >>confdefs.h <<_ACEOF +#define mode_t int +_ACEOF +fi -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 "$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 @@ -24123,13 +22448,18 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ - -#ifdef HAVE_SYS_PARAM_H -# include -#endif - - -#include <$ac_header> +$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" @@ -24148,53 +22478,51 @@ test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - eval "$as_ac_Header=yes" + ac_cv_type_off_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_Header=no" + ac_cv_type_off_t=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 +{ 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 -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 "$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 -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 + 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> +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" @@ -24213,133 +22541,112 @@ test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_header_compiler=yes + ac_cv_type_pid_t=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_compiler=no + ac_cv_type_pid_t=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; } +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 -# 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 +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. */ -#include <$ac_header> +$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 -if { (ac_try="$ac_cpp conftest.$ac_ext" +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_cpp conftest.$ac_ext") 2>conftest.er1 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? 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" || + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || test ! -s conftest.err - }; then - ac_header_preproc=yes + } && 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_header_preproc=no + ac_cv_type_size_t=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" +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; } +{ 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 -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +cat >>confdefs.h <<_ACEOF +#define size_t unsigned int _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 "$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 -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 + 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> +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" @@ -24358,133 +22665,92 @@ test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_header_compiler=yes + ac_cv_member_struct_stat_st_rdev=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 +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. */ -#include <$ac_header> +$ac_includes_default +int +main () +{ +static struct stat ac_aggr; +if (sizeof ac_aggr.st_rdev) +return 0; + ; + return 0; +} _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" +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_cpp conftest.$ac_ext") 2>conftest.er1 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? 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" || + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || test ! -s conftest.err - }; then - ac_header_preproc=yes + } && 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_header_preproc=no + ac_cv_member_struct_stat_st_rdev=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" +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; } +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF +{ 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 -fi +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_STAT_ST_RDEV 1 +_ACEOF -done +fi -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 "$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 -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 + 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> +#include +#include +#include + +int +main () +{ +if ((struct tm *) 0) +return 0; + ; + return 0; +} _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" @@ -24503,129 +22769,109 @@ test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_header_compiler=yes + ac_cv_header_time=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_compiler=no + ac_cv_header_time=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; } +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 -# 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 +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 <$ac_header> +#include +#include + +int +main () +{ +struct tm tm; + int *p = &tm.tm_sec; + return !p; + ; + return 0; +} _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" +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_cpp conftest.$ac_ext") 2>conftest.er1 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? 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" || + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || test ! -s conftest.err - }; then - ac_header_preproc=yes + } && 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_header_preproc=no + ac_cv_struct_tm=sys/time.h 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" +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; } +{ 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 -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +cat >>confdefs.h <<\_ACEOF +#define TM_IN_SYS_TIME 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 "$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 -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 + 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 + +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" @@ -24644,122 +22890,114 @@ test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_header_compiler=yes + ac_cv_c_volatile=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_compiler=no + ac_cv_c_volatile=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; } +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 -# 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 +cat >>confdefs.h <<\_ACEOF +#define volatile +_ACEOF + +fi + + +### +### Specific features and OS/arch flags / actions +### + +# Check to see if SYS_setuid32 is defined. If SYS_setuid32 is unknown, we will +# certainly error out. +if test "$os$userSpaceBitness" = "linux32"; then + { echo "$as_me:$LINENO: checking for SYS_setuid32" >&5 +echo $ECHO_N "checking for SYS_setuid32... $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 +#include + #include +int +main () +{ + + syscall(SYS_setuid32, 1); + + ; + return 0; +} _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" +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_cpp conftest.$ac_ext") 2>conftest.er1 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? 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" || + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || test ! -s conftest.err - }; then - ac_header_preproc=yes + } && test -s conftest.$ac_objext; then + HAVE_SYS_SETUID="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 + HAVE_SYS_SETUID="no" 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" +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + { echo "$as_me:$LINENO: result: $HAVE_SYS_SETUID" >&5 +echo "${ECHO_T}$HAVE_SYS_SETUID" >&6; } fi - - -if test "$MULTIMON_ENABLED" != "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 +# Newer iconv (from glibc 2.2 and later on Linux) takes a char ** as the second +# argument. Here, we test for the older form and expect a compiler warning/error +# if the newer form is defined (because, in that case, we would be attempting to +# remove const'ness without an explicit cast). +{ echo "$as_me:$LINENO: checking for the new format of iconv" >&5 +echo $ECHO_N "checking for the new format of iconv... $ECHO_C" >&6; } +ORIGINAL_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS -Werror" +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 () +{ -#include + iconv_t cd; + char const *inbuf; + size_t inbytesleft; + char *outbuf; + size_t outbytesleft; + + iconv(cd, &inbuf, &inbytesleft, &outbuf, &outbytesleft); + + ; + return 0; +} _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" @@ -24778,35 +23016,27 @@ test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_header_X11_extensions_panoramiXproto_h=yes + HAVE_NEW_ICONV="no" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_header_X11_extensions_panoramiXproto_h=no + HAVE_NEW_ICONV="yes" 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 - +CFLAGS="$ORIGINAL_CFLAGS" +{ echo "$as_me:$LINENO: result: $HAVE_NEW_ICONV" >&5 +echo "${ECHO_T}$HAVE_NEW_ICONV" >&6; } -fi +if test "$os" = "linux"; then -### -### 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 +for ac_func in lseek +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 @@ -24815,90 +23045,53 @@ 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 -#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" +/* 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 - struct s { _Bool s: 1; _Bool t; } s; +#undef $ac_func - 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; +/* 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 () { - - *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 $ac_func (); ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" +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_compile") 2>conftest.er1 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -24907,39 +23100,53 @@ (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 + } && 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 - ac_cv_header_stdbool_h=no + eval "$as_ac_var=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +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_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 +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 + HAVE_LSEEK="yes" else - cat >conftest.$ac_ext <<_ACEOF + HAVE_LSEEK="no" +fi +done + + + # setresuid() was wrapped beginning in glibc 2.3.2. + { echo "$as_me:$LINENO: checking for setresuid" >&5 +echo $ECHO_N "checking for setresuid... $ECHO_C" >&6; } + # Ensure an error is thrown if setresuid is unknown. + ORIGINAL_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -Werror-implicit-function-declaration -Werror" + 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_; +#define _GNU_SOURCE + #include int main () { -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; + + setresuid(0, 0, 0); + ; return 0; } @@ -24961,41 +23168,33 @@ test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_type__Bool=yes + HAVE_SETRESUID="yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type__Bool=no + HAVE_SETRESUID="no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CFLAGS="$ORIGINAL_CFLAGS" + { echo "$as_me:$LINENO: result: $HAVE_SETRESUID" >&5 +echo "${ECHO_T}$HAVE_SETRESUID" >&6; } 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 +### General flags / actions +CFLAGS="$CFLAGS -Wall" +CFLAGS="$CFLAGS -Werror" -{ 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 +# -Wno-unknown-pragmas is due to gcc not understanding '#pragma ident' in Xlib.h on OpenSolaris. +for TEST_CFLAG in -Wno-pointer-sign -Wno-unused-value -fno-strict-aliasing \ + -Wno-unknown-pragmas -Wno-uninitialized; 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 @@ -25005,55 +23204,8 @@ 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; ; return 0; @@ -25076,2565 +23228,2865 @@ test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - ac_cv_c_const=yes + 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 -DNO_CORE_ICU" + +INCLUDE_DIR="`cd $srcdir; pwd`/lib/include" +CPPFLAGS="$CPPFLAGS -I$INCLUDE_DIR" + +### 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" + + if test "$osVersion" -ge 202000; then + MODULES="$MODULES vmmemctl vmxnet" + fi + if test "$osVersion" -ge 204000; then + MODULES="$MODULES vmblock vmci vmhgfs vsock" + buildHgfsmounter=yes + fi + if test "$osVersion" -ge 206000; then + MODULES="$MODULES vmxnet3" + fi + if test "$osVersion" -ge 206006; then + MODULES="$MODULES vmsync" + fi +fi + +if test "$os" = "freebsd"; then + 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 vmhgfs" + buildHgfsmounter=yes + 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" + + GUESTD_LDADD="$GUESTD_LDADD -lsocket" + GUESTD_LDADD="$GUESTD_LDADD -lnsl" + GUESTD_LDADD="$GUESTD_LDADD -lrpcsvc" + + VMWARE_USER_CPPFLAGS="$VMWARE_USER_CPPFLAGS -I/usr/X11/include/" + VMWARE_USER_LDADD="$VMWARE_USER_LDADD -lXext" + VMWARE_USER_LDADD="$VMWARE_USER_LDADD -lX11" + VMWARE_USER_LDADD="$VMWARE_USER_LDADD -lsocket" + VMWARE_USER_LDADD="$VMWARE_USER_LDADD -lnsl" + VMWARE_USER_LDADD="$VMWARE_USER_LDADD -lrpcsvc" + + # uname -r on Solaris 10 reports "5.10" + if test "$osVersion" -ge 510000; then + CPPFLAGS="$CPPFLAGS -DSOL10" + 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"; then + FREEBSD_TRUE= + FREEBSD_FALSE='#' +else + FREEBSD_TRUE='#' + FREEBSD_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 -d /etc/pam.d; then + PAMD_TRUE= + PAMD_FALSE='#' else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + PAMD_TRUE='#' + PAMD_FALSE= +fi - ac_cv_c_const=no + if test "$enable_unity" = "yes"; then + ENABLE_UNITY_TRUE= + ENABLE_UNITY_FALSE='#' +else + ENABLE_UNITY_TRUE='#' + ENABLE_UNITY_FALSE= fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + 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 -{ 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 + + +### 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 const +#define NO_MULTIMON 1 _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 +if test "$os$userSpaceBitness" = "linux64" || test "$HAVE_SYS_SETUID" = "yes"; then + LIB_MISC_CPPFLAGS="$LIB_MISC_CPPFLAGS -DGLIBC_VERSION_21" fi -rm -f conftest* +if test "$HAVE_NEW_ICONV" = "yes"; then + LIB_MISC_CPPFLAGS="$LIB_MISC_CPPFLAGS -DGLIBC_VERSION_22" 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 +if test "$HAVE_LSEEK" = "yes"; then + LIB_FILE_CPPFLAGS="$LIB_FILE_CPPFLAGS -DGLIBC_VERSION_21" + LIB_HGFS_SERVER_CPPFLAGS="$LIB_HGFS_SERVER_CPPFLAGS -DGLIBC_VERSION_21" +fi +if test "$HAVE_SETRESUID" = "yes"; then + LIB_PROC_MGR_CPPFLAGS="$LIB_PROC_MGR_CPPFLAGS -DGLIBC_VERSION_23" +fi -cat >>confdefs.h <<\_ACEOF -#define gid_t int -_ACEOF +if test "$HAVE_CRYPT" = "yes"; then + LIB_AUTH_CPPFLAGS="$LIB_AUTH_CPPFLAGS -DGLIBC_VERSION_22" +fi +if test "$HAVE_WCHAR_H" = "yes"; then + LIB_STRING_CPPFLAGS="$LIB_STRING_CPPFLAGS -DGLIBC_VERSION_22" 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 +### General substs + + + + + + + + + + + + + + + + + + + + + + +### 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/backdoor/shared/Makefile lib/conf/Makefile lib/dict/Makefile lib/dnd/Makefile lib/dynxdr/Makefile lib/err/Makefile lib/eventManager/Makefile lib/file/Makefile lib/foundryMsg/Makefile lib/ghIntegration/Makefile lib/ghIntegrationStub/Makefile lib/guestApp/Makefile lib/guestInfo/Makefile lib/guestRpc/Makefile lib/hgfs/Makefile lib/hgfsBd/Makefile lib/hgfsServer/Makefile lib/hgfsServerManagerGuest/Makefile lib/hgfsServerPolicyGuest/Makefile lib/deployPkg/Makefile lib/image/Makefile lib/impersonate/Makefile lib/message/Makefile lib/message/shared/Makefile lib/misc/Makefile lib/misc/shared/Makefile lib/netUtil/Makefile lib/panic/Makefile lib/panicDefault/Makefile lib/printer/Makefile lib/procMgr/Makefile lib/raster/Makefile lib/region/Makefile lib/resolution/Makefile lib/rpcIn/Makefile lib/rpcOut/Makefile lib/rpcOut/shared/Makefile lib/rpcVmx/Makefile lib/SLPv2Parser/Makefile lib/socketMgr/Makefile lib/string/Makefile lib/string/shared/Makefile lib/stubs/Makefile lib/stubs/shared/Makefile lib/sync/Makefile lib/sync/shared/Makefile lib/syncDriver/Makefile lib/system/Makefile lib/toolsLogger/Makefile lib/unicode/Makefile lib/unity/Makefile lib/unityStub/Makefile lib/unityWindowTracker/Makefile lib/user/Makefile lib/vixTools/Makefile lib/vmBackupLib/Makefile lib/vmCheck/Makefile lib/vmSignal/Makefile lib/wiper/Makefile guestd/Makefile vmware-user/Makefile vmware-user-suid-wrapper/Makefile toolbox/Makefile hgfsclient/Makefile hgfsmounter/Makefile checkvm/Makefile libguestlib/Makefile xferlogs/Makefile modules/Makefile scripts/Makefile" + + +### +### 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 -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 +# 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 -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - test "$ac_cv_c_inline" != no && break +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 -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 +LTLIBOBJS=$ac_ltlibobjs -{ 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 +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 - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +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 -{ 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 - +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 - -{ 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 +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 - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +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 -{ 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 - +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 - -{ 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 +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 "${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 - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +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 "${PAMD_TRUE}" && test -z "${PAMD_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"PAMD\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"PAMD\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${ENABLE_UNITY_TRUE}" && test -z "${ENABLE_UNITY_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"ENABLE_UNITY\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"ENABLE_UNITY\" 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 -{ 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 +: ${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 -fi +cat >>$CONFIG_STATUS <<\_ACEOF +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## -{ 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 +# 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 - 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;; + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; 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 + +# 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 -{ 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 +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + as_unset=false +fi - 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;; + +# 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 -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 +# 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='+ ' - ac_cv_member_struct_stat_st_rdev=no -fi +# 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 -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +# 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 -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false 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 +# 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'` -fi +# CDPATH. +$as_unset CDPATH -{ 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; + + 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 } -_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 +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false 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 +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 -{ 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 +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file 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 + 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 -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 +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi - ac_cv_struct_tm=sys/time.h +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 -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 +# 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'" -cat >>confdefs.h <<\_ACEOF -#define TM_IN_SYS_TIME 1 -_ACEOF +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" -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. */ +exec 6>&1 -int -main () -{ +# 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 2008.10.10-123053, which was +generated by GNU Autoconf 2.61. Invocation command line was -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 + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ - ac_cv_c_volatile=no -fi +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" -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 +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +# Files that config.status was made for. +config_files="$ac_config_files" +config_commands="$ac_config_commands" -cat >>confdefs.h <<\_ACEOF -#define volatile _ACEOF -fi +cat >>$CONFIG_STATUS <<\_ACEOF +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. +Usage: $0 [OPTIONS] [FILE]... -### -### Specific features and OS/arch flags / actions -### + -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 -# Capture the CFLAGS, so we can restore them later. -ORIGINAL_CFLAGS="$CFLAGS" +Configuration files: +$config_files + +Configuration commands: +$config_commands + +Report bugs to ." -# Check to see if SYS_setuid32 is defined. If SYS_setuid32 is unknown, we will -# certainly error out. -if test "$os$userSpaceBitness" = "linux32"; then - { echo "$as_me:$LINENO: checking for SYS_setuid32" >&5 -echo $ECHO_N "checking for SYS_setuid32... $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 - #include -int -main () -{ +cat >>$CONFIG_STATUS <<_ACEOF +ac_cs_version="\\ +open-vm-tools config.status 2008.10.10-123053 +configured by $0, generated by GNU Autoconf 2.61, + with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" - syscall(SYS_setuid32, 1); +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." - ; - return 0; -} +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' _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 - HAVE_SYS_SETUID="yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - HAVE_SYS_SETUID="no" +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 -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - { echo "$as_me:$LINENO: result: $HAVE_SYS_SETUID" >&5 -echo "${ECHO_T}$HAVE_SYS_SETUID" >&6; } +_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 -# Newer iconv (from glibc 2.2 and later on Linux) takes a char ** as the second -# argument. Here, we test for the older form and expect a compiler warning/error -# if the newer form is defined (because, in that case, we would be attempting to -# remove const'ness without an explicit cast). -{ echo "$as_me:$LINENO: checking for the new format of iconv" >&5 -echo $ECHO_N "checking for the new format of iconv... $ECHO_C" >&6; } -CFLAGS="$CFLAGS -Werror" -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 () +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" - iconv_t cd; - char const *inbuf; - size_t inbytesleft; - char *outbuf; - size_t outbytesleft; - iconv(cd, &inbuf, &inbytesleft, &outbuf, &outbytesleft); +# 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 - ; - 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;; +sed_quote_subst='$sed_quote_subst' +double_quote_subst='$double_quote_subst' +delay_variable_subst='$delay_variable_subst' +macro_version='`$ECHO "X$macro_version" | $Xsed -e "$delay_single_quote_subst"`' +macro_revision='`$ECHO "X$macro_revision" | $Xsed -e "$delay_single_quote_subst"`' +enable_shared='`$ECHO "X$enable_shared" | $Xsed -e "$delay_single_quote_subst"`' +enable_static='`$ECHO "X$enable_static" | $Xsed -e "$delay_single_quote_subst"`' +pic_mode='`$ECHO "X$pic_mode" | $Xsed -e "$delay_single_quote_subst"`' +enable_fast_install='`$ECHO "X$enable_fast_install" | $Xsed -e "$delay_single_quote_subst"`' +host_alias='`$ECHO "X$host_alias" | $Xsed -e "$delay_single_quote_subst"`' +host='`$ECHO "X$host" | $Xsed -e "$delay_single_quote_subst"`' +host_os='`$ECHO "X$host_os" | $Xsed -e "$delay_single_quote_subst"`' +build_alias='`$ECHO "X$build_alias" | $Xsed -e "$delay_single_quote_subst"`' +build='`$ECHO "X$build" | $Xsed -e "$delay_single_quote_subst"`' +build_os='`$ECHO "X$build_os" | $Xsed -e "$delay_single_quote_subst"`' +SED='`$ECHO "X$SED" | $Xsed -e "$delay_single_quote_subst"`' +Xsed='`$ECHO "X$Xsed" | $Xsed -e "$delay_single_quote_subst"`' +GREP='`$ECHO "X$GREP" | $Xsed -e "$delay_single_quote_subst"`' +EGREP='`$ECHO "X$EGREP" | $Xsed -e "$delay_single_quote_subst"`' +FGREP='`$ECHO "X$FGREP" | $Xsed -e "$delay_single_quote_subst"`' +LD='`$ECHO "X$LD" | $Xsed -e "$delay_single_quote_subst"`' +NM='`$ECHO "X$NM" | $Xsed -e "$delay_single_quote_subst"`' +LN_S='`$ECHO "X$LN_S" | $Xsed -e "$delay_single_quote_subst"`' +max_cmd_len='`$ECHO "X$max_cmd_len" | $Xsed -e "$delay_single_quote_subst"`' +ac_objext='`$ECHO "X$ac_objext" | $Xsed -e "$delay_single_quote_subst"`' +exeext='`$ECHO "X$exeext" | $Xsed -e "$delay_single_quote_subst"`' +lt_unset='`$ECHO "X$lt_unset" | $Xsed -e "$delay_single_quote_subst"`' +lt_SP2NL='`$ECHO "X$lt_SP2NL" | $Xsed -e "$delay_single_quote_subst"`' +lt_NL2SP='`$ECHO "X$lt_NL2SP" | $Xsed -e "$delay_single_quote_subst"`' +reload_flag='`$ECHO "X$reload_flag" | $Xsed -e "$delay_single_quote_subst"`' +reload_cmds='`$ECHO "X$reload_cmds" | $Xsed -e "$delay_single_quote_subst"`' +deplibs_check_method='`$ECHO "X$deplibs_check_method" | $Xsed -e "$delay_single_quote_subst"`' +file_magic_cmd='`$ECHO "X$file_magic_cmd" | $Xsed -e "$delay_single_quote_subst"`' +AR='`$ECHO "X$AR" | $Xsed -e "$delay_single_quote_subst"`' +AR_FLAGS='`$ECHO "X$AR_FLAGS" | $Xsed -e "$delay_single_quote_subst"`' +STRIP='`$ECHO "X$STRIP" | $Xsed -e "$delay_single_quote_subst"`' +RANLIB='`$ECHO "X$RANLIB" | $Xsed -e "$delay_single_quote_subst"`' +old_postinstall_cmds='`$ECHO "X$old_postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +old_postuninstall_cmds='`$ECHO "X$old_postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_cmds='`$ECHO "X$old_archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' +CC='`$ECHO "X$CC" | $Xsed -e "$delay_single_quote_subst"`' +CFLAGS='`$ECHO "X$CFLAGS" | $Xsed -e "$delay_single_quote_subst"`' +compiler='`$ECHO "X$compiler" | $Xsed -e "$delay_single_quote_subst"`' +GCC='`$ECHO "X$GCC" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_pipe='`$ECHO "X$lt_cv_sys_global_symbol_pipe" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_cdecl='`$ECHO "X$lt_cv_sys_global_symbol_to_cdecl" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' +objdir='`$ECHO "X$objdir" | $Xsed -e "$delay_single_quote_subst"`' +SHELL='`$ECHO "X$SHELL" | $Xsed -e "$delay_single_quote_subst"`' +ECHO='`$ECHO "X$ECHO" | $Xsed -e "$delay_single_quote_subst"`' +MAGIC_CMD='`$ECHO "X$MAGIC_CMD" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag='`$ECHO "X$lt_prog_compiler_no_builtin_flag" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_wl='`$ECHO "X$lt_prog_compiler_wl" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_pic='`$ECHO "X$lt_prog_compiler_pic" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_static='`$ECHO "X$lt_prog_compiler_static" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o='`$ECHO "X$lt_cv_prog_compiler_c_o" | $Xsed -e "$delay_single_quote_subst"`' +need_locks='`$ECHO "X$need_locks" | $Xsed -e "$delay_single_quote_subst"`' +DSYMUTIL='`$ECHO "X$DSYMUTIL" | $Xsed -e "$delay_single_quote_subst"`' +NMEDIT='`$ECHO "X$NMEDIT" | $Xsed -e "$delay_single_quote_subst"`' +libext='`$ECHO "X$libext" | $Xsed -e "$delay_single_quote_subst"`' +shrext_cmds='`$ECHO "X$shrext_cmds" | $Xsed -e "$delay_single_quote_subst"`' +extract_expsyms_cmds='`$ECHO "X$extract_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' +archive_cmds_need_lc='`$ECHO "X$archive_cmds_need_lc" | $Xsed -e "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes='`$ECHO "X$enable_shared_with_static_runtimes" | $Xsed -e "$delay_single_quote_subst"`' +export_dynamic_flag_spec='`$ECHO "X$export_dynamic_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' +whole_archive_flag_spec='`$ECHO "X$whole_archive_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' +compiler_needs_object='`$ECHO "X$compiler_needs_object" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_from_new_cmds='`$ECHO "X$old_archive_from_new_cmds" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds='`$ECHO "X$old_archive_from_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' +archive_cmds='`$ECHO "X$archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' +archive_expsym_cmds='`$ECHO "X$archive_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' +module_cmds='`$ECHO "X$module_cmds" | $Xsed -e "$delay_single_quote_subst"`' +module_expsym_cmds='`$ECHO "X$module_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' +with_gnu_ld='`$ECHO "X$with_gnu_ld" | $Xsed -e "$delay_single_quote_subst"`' +allow_undefined_flag='`$ECHO "X$allow_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' +no_undefined_flag='`$ECHO "X$no_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec='`$ECHO "X$hardcode_libdir_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_ld='`$ECHO "X$hardcode_libdir_flag_spec_ld" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_separator='`$ECHO "X$hardcode_libdir_separator" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_direct='`$ECHO "X$hardcode_direct" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_direct_absolute='`$ECHO "X$hardcode_direct_absolute" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_minus_L='`$ECHO "X$hardcode_minus_L" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_shlibpath_var='`$ECHO "X$hardcode_shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_automatic='`$ECHO "X$hardcode_automatic" | $Xsed -e "$delay_single_quote_subst"`' +inherit_rpath='`$ECHO "X$inherit_rpath" | $Xsed -e "$delay_single_quote_subst"`' +link_all_deplibs='`$ECHO "X$link_all_deplibs" | $Xsed -e "$delay_single_quote_subst"`' +fix_srcfile_path='`$ECHO "X$fix_srcfile_path" | $Xsed -e "$delay_single_quote_subst"`' +always_export_symbols='`$ECHO "X$always_export_symbols" | $Xsed -e "$delay_single_quote_subst"`' +export_symbols_cmds='`$ECHO "X$export_symbols_cmds" | $Xsed -e "$delay_single_quote_subst"`' +exclude_expsyms='`$ECHO "X$exclude_expsyms" | $Xsed -e "$delay_single_quote_subst"`' +include_expsyms='`$ECHO "X$include_expsyms" | $Xsed -e "$delay_single_quote_subst"`' +prelink_cmds='`$ECHO "X$prelink_cmds" | $Xsed -e "$delay_single_quote_subst"`' +file_list_spec='`$ECHO "X$file_list_spec" | $Xsed -e "$delay_single_quote_subst"`' +variables_saved_for_relink='`$ECHO "X$variables_saved_for_relink" | $Xsed -e "$delay_single_quote_subst"`' +need_lib_prefix='`$ECHO "X$need_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' +need_version='`$ECHO "X$need_version" | $Xsed -e "$delay_single_quote_subst"`' +version_type='`$ECHO "X$version_type" | $Xsed -e "$delay_single_quote_subst"`' +runpath_var='`$ECHO "X$runpath_var" | $Xsed -e "$delay_single_quote_subst"`' +shlibpath_var='`$ECHO "X$shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' +shlibpath_overrides_runpath='`$ECHO "X$shlibpath_overrides_runpath" | $Xsed -e "$delay_single_quote_subst"`' +libname_spec='`$ECHO "X$libname_spec" | $Xsed -e "$delay_single_quote_subst"`' +library_names_spec='`$ECHO "X$library_names_spec" | $Xsed -e "$delay_single_quote_subst"`' +soname_spec='`$ECHO "X$soname_spec" | $Xsed -e "$delay_single_quote_subst"`' +postinstall_cmds='`$ECHO "X$postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +postuninstall_cmds='`$ECHO "X$postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' +finish_cmds='`$ECHO "X$finish_cmds" | $Xsed -e "$delay_single_quote_subst"`' +finish_eval='`$ECHO "X$finish_eval" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_into_libs='`$ECHO "X$hardcode_into_libs" | $Xsed -e "$delay_single_quote_subst"`' +sys_lib_search_path_spec='`$ECHO "X$sys_lib_search_path_spec" | $Xsed -e "$delay_single_quote_subst"`' +sys_lib_dlsearch_path_spec='`$ECHO "X$sys_lib_dlsearch_path_spec" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_action='`$ECHO "X$hardcode_action" | $Xsed -e "$delay_single_quote_subst"`' +enable_dlopen='`$ECHO "X$enable_dlopen" | $Xsed -e "$delay_single_quote_subst"`' +enable_dlopen_self='`$ECHO "X$enable_dlopen_self" | $Xsed -e "$delay_single_quote_subst"`' +enable_dlopen_self_static='`$ECHO "X$enable_dlopen_self_static" | $Xsed -e "$delay_single_quote_subst"`' +old_striplib='`$ECHO "X$old_striplib" | $Xsed -e "$delay_single_quote_subst"`' +striplib='`$ECHO "X$striplib" | $Xsed -e "$delay_single_quote_subst"`' +compiler_lib_search_dirs='`$ECHO "X$compiler_lib_search_dirs" | $Xsed -e "$delay_single_quote_subst"`' +predep_objects='`$ECHO "X$predep_objects" | $Xsed -e "$delay_single_quote_subst"`' +postdep_objects='`$ECHO "X$postdep_objects" | $Xsed -e "$delay_single_quote_subst"`' +predeps='`$ECHO "X$predeps" | $Xsed -e "$delay_single_quote_subst"`' +postdeps='`$ECHO "X$postdeps" | $Xsed -e "$delay_single_quote_subst"`' +compiler_lib_search_path='`$ECHO "X$compiler_lib_search_path" | $Xsed -e "$delay_single_quote_subst"`' +LD_CXX='`$ECHO "X$LD_CXX" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_cmds_CXX='`$ECHO "X$old_archive_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' +compiler_CXX='`$ECHO "X$compiler_CXX" | $Xsed -e "$delay_single_quote_subst"`' +GCC_CXX='`$ECHO "X$GCC_CXX" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "X$lt_prog_compiler_no_builtin_flag_CXX" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_wl_CXX='`$ECHO "X$lt_prog_compiler_wl_CXX" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_pic_CXX='`$ECHO "X$lt_prog_compiler_pic_CXX" | $Xsed -e "$delay_single_quote_subst"`' +lt_prog_compiler_static_CXX='`$ECHO "X$lt_prog_compiler_static_CXX" | $Xsed -e "$delay_single_quote_subst"`' +lt_cv_prog_compiler_c_o_CXX='`$ECHO "X$lt_cv_prog_compiler_c_o_CXX" | $Xsed -e "$delay_single_quote_subst"`' +archive_cmds_need_lc_CXX='`$ECHO "X$archive_cmds_need_lc_CXX" | $Xsed -e "$delay_single_quote_subst"`' +enable_shared_with_static_runtimes_CXX='`$ECHO "X$enable_shared_with_static_runtimes_CXX" | $Xsed -e "$delay_single_quote_subst"`' +export_dynamic_flag_spec_CXX='`$ECHO "X$export_dynamic_flag_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`' +whole_archive_flag_spec_CXX='`$ECHO "X$whole_archive_flag_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`' +compiler_needs_object_CXX='`$ECHO "X$compiler_needs_object_CXX" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_from_new_cmds_CXX='`$ECHO "X$old_archive_from_new_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' +old_archive_from_expsyms_cmds_CXX='`$ECHO "X$old_archive_from_expsyms_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' +archive_cmds_CXX='`$ECHO "X$archive_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' +archive_expsym_cmds_CXX='`$ECHO "X$archive_expsym_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' +module_cmds_CXX='`$ECHO "X$module_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' +module_expsym_cmds_CXX='`$ECHO "X$module_expsym_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' +with_gnu_ld_CXX='`$ECHO "X$with_gnu_ld_CXX" | $Xsed -e "$delay_single_quote_subst"`' +allow_undefined_flag_CXX='`$ECHO "X$allow_undefined_flag_CXX" | $Xsed -e "$delay_single_quote_subst"`' +no_undefined_flag_CXX='`$ECHO "X$no_undefined_flag_CXX" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_CXX='`$ECHO "X$hardcode_libdir_flag_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_flag_spec_ld_CXX='`$ECHO "X$hardcode_libdir_flag_spec_ld_CXX" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_libdir_separator_CXX='`$ECHO "X$hardcode_libdir_separator_CXX" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_direct_CXX='`$ECHO "X$hardcode_direct_CXX" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_direct_absolute_CXX='`$ECHO "X$hardcode_direct_absolute_CXX" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_minus_L_CXX='`$ECHO "X$hardcode_minus_L_CXX" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_shlibpath_var_CXX='`$ECHO "X$hardcode_shlibpath_var_CXX" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_automatic_CXX='`$ECHO "X$hardcode_automatic_CXX" | $Xsed -e "$delay_single_quote_subst"`' +inherit_rpath_CXX='`$ECHO "X$inherit_rpath_CXX" | $Xsed -e "$delay_single_quote_subst"`' +link_all_deplibs_CXX='`$ECHO "X$link_all_deplibs_CXX" | $Xsed -e "$delay_single_quote_subst"`' +fix_srcfile_path_CXX='`$ECHO "X$fix_srcfile_path_CXX" | $Xsed -e "$delay_single_quote_subst"`' +always_export_symbols_CXX='`$ECHO "X$always_export_symbols_CXX" | $Xsed -e "$delay_single_quote_subst"`' +export_symbols_cmds_CXX='`$ECHO "X$export_symbols_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' +exclude_expsyms_CXX='`$ECHO "X$exclude_expsyms_CXX" | $Xsed -e "$delay_single_quote_subst"`' +include_expsyms_CXX='`$ECHO "X$include_expsyms_CXX" | $Xsed -e "$delay_single_quote_subst"`' +prelink_cmds_CXX='`$ECHO "X$prelink_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' +file_list_spec_CXX='`$ECHO "X$file_list_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`' +hardcode_action_CXX='`$ECHO "X$hardcode_action_CXX" | $Xsed -e "$delay_single_quote_subst"`' +compiler_lib_search_dirs_CXX='`$ECHO "X$compiler_lib_search_dirs_CXX" | $Xsed -e "$delay_single_quote_subst"`' +predep_objects_CXX='`$ECHO "X$predep_objects_CXX" | $Xsed -e "$delay_single_quote_subst"`' +postdep_objects_CXX='`$ECHO "X$postdep_objects_CXX" | $Xsed -e "$delay_single_quote_subst"`' +predeps_CXX='`$ECHO "X$predeps_CXX" | $Xsed -e "$delay_single_quote_subst"`' +postdeps_CXX='`$ECHO "X$postdeps_CXX" | $Xsed -e "$delay_single_quote_subst"`' +compiler_lib_search_path_CXX='`$ECHO "X$compiler_lib_search_path_CXX" | $Xsed -e "$delay_single_quote_subst"`' + +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# Quote evaled strings. +for var in SED \ +GREP \ +EGREP \ +FGREP \ +LD \ +NM \ +LN_S \ +lt_SP2NL \ +lt_NL2SP \ +reload_flag \ +deplibs_check_method \ +file_magic_cmd \ +AR \ +AR_FLAGS \ +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 \ +SHELL \ +ECHO \ +lt_prog_compiler_no_builtin_flag \ +lt_prog_compiler_wl \ +lt_prog_compiler_pic \ +lt_prog_compiler_static \ +lt_cv_prog_compiler_c_o \ +need_locks \ +DSYMUTIL \ +NMEDIT \ +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_flag_spec_ld \ +hardcode_libdir_separator \ +fix_srcfile_path \ +exclude_expsyms \ +include_expsyms \ +file_list_spec \ +variables_saved_for_relink \ +libname_spec \ +library_names_spec \ +soname_spec \ +finish_eval \ +old_striplib \ +striplib \ +compiler_lib_search_dirs \ +predep_objects \ +postdep_objects \ +predeps \ +postdeps \ +compiler_lib_search_path \ +LD_CXX \ +compiler_CXX \ +lt_prog_compiler_no_builtin_flag_CXX \ +lt_prog_compiler_wl_CXX \ +lt_prog_compiler_pic_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_flag_spec_ld_CXX \ +hardcode_libdir_separator_CXX \ +fix_srcfile_path_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 "X\\\\\$\$var"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$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 \ +postinstall_cmds \ +postuninstall_cmds \ +finish_cmds \ +sys_lib_search_path_spec \ +sys_lib_dlsearch_path_spec \ +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; do + case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + *[\\\\\\\`\\"\\\$]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Fix-up fallback echo if it was mangled by the above quoting rules. +case \$lt_ECHO in +*'\\\$0 --fallback-echo"') lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\$0 --fallback-echo"\$/\$0 --fallback-echo"/'\` + ;; 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 - HAVE_NEW_ICONV="no" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - HAVE_NEW_ICONV="yes" +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 -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -CFLAGS="$ORIGINAL_CFLAGS" -{ echo "$as_me:$LINENO: result: $HAVE_NEW_ICONV" >&5 -echo "${ECHO_T}$HAVE_NEW_ICONV" >&6; } -if test "$os" = "linux"; then + PACKAGE='$PACKAGE' + VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' + RM='$RM' + ofile='$ofile' -for ac_func in lseek -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 +cat >>$CONFIG_STATUS <<\_ACEOF -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 - HAVE_LSEEK="yes" -else - HAVE_LSEEK="no" -fi +# 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/backdoor/shared/Makefile") CONFIG_FILES="$CONFIG_FILES lib/backdoor/shared/Makefile" ;; + "lib/conf/Makefile") CONFIG_FILES="$CONFIG_FILES lib/conf/Makefile" ;; + "lib/dict/Makefile") CONFIG_FILES="$CONFIG_FILES lib/dict/Makefile" ;; + "lib/dnd/Makefile") CONFIG_FILES="$CONFIG_FILES lib/dnd/Makefile" ;; + "lib/dynxdr/Makefile") CONFIG_FILES="$CONFIG_FILES lib/dynxdr/Makefile" ;; + "lib/err/Makefile") CONFIG_FILES="$CONFIG_FILES lib/err/Makefile" ;; + "lib/eventManager/Makefile") CONFIG_FILES="$CONFIG_FILES lib/eventManager/Makefile" ;; + "lib/file/Makefile") CONFIG_FILES="$CONFIG_FILES lib/file/Makefile" ;; + "lib/foundryMsg/Makefile") CONFIG_FILES="$CONFIG_FILES lib/foundryMsg/Makefile" ;; + "lib/ghIntegration/Makefile") CONFIG_FILES="$CONFIG_FILES lib/ghIntegration/Makefile" ;; + "lib/ghIntegrationStub/Makefile") CONFIG_FILES="$CONFIG_FILES lib/ghIntegrationStub/Makefile" ;; + "lib/guestApp/Makefile") CONFIG_FILES="$CONFIG_FILES lib/guestApp/Makefile" ;; + "lib/guestInfo/Makefile") CONFIG_FILES="$CONFIG_FILES lib/guestInfo/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/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/deployPkg/Makefile") CONFIG_FILES="$CONFIG_FILES lib/deployPkg/Makefile" ;; + "lib/image/Makefile") CONFIG_FILES="$CONFIG_FILES lib/image/Makefile" ;; + "lib/impersonate/Makefile") CONFIG_FILES="$CONFIG_FILES lib/impersonate/Makefile" ;; + "lib/message/Makefile") CONFIG_FILES="$CONFIG_FILES lib/message/Makefile" ;; + "lib/message/shared/Makefile") CONFIG_FILES="$CONFIG_FILES lib/message/shared/Makefile" ;; + "lib/misc/Makefile") CONFIG_FILES="$CONFIG_FILES lib/misc/Makefile" ;; + "lib/misc/shared/Makefile") CONFIG_FILES="$CONFIG_FILES lib/misc/shared/Makefile" ;; + "lib/netUtil/Makefile") CONFIG_FILES="$CONFIG_FILES lib/netUtil/Makefile" ;; + "lib/panic/Makefile") CONFIG_FILES="$CONFIG_FILES lib/panic/Makefile" ;; + "lib/panicDefault/Makefile") CONFIG_FILES="$CONFIG_FILES lib/panicDefault/Makefile" ;; + "lib/printer/Makefile") CONFIG_FILES="$CONFIG_FILES lib/printer/Makefile" ;; + "lib/procMgr/Makefile") CONFIG_FILES="$CONFIG_FILES lib/procMgr/Makefile" ;; + "lib/raster/Makefile") CONFIG_FILES="$CONFIG_FILES lib/raster/Makefile" ;; + "lib/region/Makefile") CONFIG_FILES="$CONFIG_FILES lib/region/Makefile" ;; + "lib/resolution/Makefile") CONFIG_FILES="$CONFIG_FILES lib/resolution/Makefile" ;; + "lib/rpcIn/Makefile") CONFIG_FILES="$CONFIG_FILES lib/rpcIn/Makefile" ;; + "lib/rpcOut/Makefile") CONFIG_FILES="$CONFIG_FILES lib/rpcOut/Makefile" ;; + "lib/rpcOut/shared/Makefile") CONFIG_FILES="$CONFIG_FILES lib/rpcOut/shared/Makefile" ;; + "lib/rpcVmx/Makefile") CONFIG_FILES="$CONFIG_FILES lib/rpcVmx/Makefile" ;; + "lib/SLPv2Parser/Makefile") CONFIG_FILES="$CONFIG_FILES lib/SLPv2Parser/Makefile" ;; + "lib/socketMgr/Makefile") CONFIG_FILES="$CONFIG_FILES lib/socketMgr/Makefile" ;; + "lib/string/Makefile") CONFIG_FILES="$CONFIG_FILES lib/string/Makefile" ;; + "lib/string/shared/Makefile") CONFIG_FILES="$CONFIG_FILES lib/string/shared/Makefile" ;; + "lib/stubs/Makefile") CONFIG_FILES="$CONFIG_FILES lib/stubs/Makefile" ;; + "lib/stubs/shared/Makefile") CONFIG_FILES="$CONFIG_FILES lib/stubs/shared/Makefile" ;; + "lib/sync/Makefile") CONFIG_FILES="$CONFIG_FILES lib/sync/Makefile" ;; + "lib/sync/shared/Makefile") CONFIG_FILES="$CONFIG_FILES lib/sync/shared/Makefile" ;; + "lib/syncDriver/Makefile") CONFIG_FILES="$CONFIG_FILES lib/syncDriver/Makefile" ;; + "lib/system/Makefile") CONFIG_FILES="$CONFIG_FILES lib/system/Makefile" ;; + "lib/toolsLogger/Makefile") CONFIG_FILES="$CONFIG_FILES lib/toolsLogger/Makefile" ;; + "lib/unicode/Makefile") CONFIG_FILES="$CONFIG_FILES lib/unicode/Makefile" ;; + "lib/unity/Makefile") CONFIG_FILES="$CONFIG_FILES lib/unity/Makefile" ;; + "lib/unityStub/Makefile") CONFIG_FILES="$CONFIG_FILES lib/unityStub/Makefile" ;; + "lib/unityWindowTracker/Makefile") CONFIG_FILES="$CONFIG_FILES lib/unityWindowTracker/Makefile" ;; + "lib/user/Makefile") CONFIG_FILES="$CONFIG_FILES lib/user/Makefile" ;; + "lib/vixTools/Makefile") CONFIG_FILES="$CONFIG_FILES lib/vixTools/Makefile" ;; + "lib/vmBackupLib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/vmBackupLib/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" ;; + "guestd/Makefile") CONFIG_FILES="$CONFIG_FILES guestd/Makefile" ;; + "vmware-user/Makefile") CONFIG_FILES="$CONFIG_FILES vmware-user/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" ;; + "libguestlib/Makefile") CONFIG_FILES="$CONFIG_FILES libguestlib/Makefile" ;; + "xferlogs/Makefile") CONFIG_FILES="$CONFIG_FILES xferlogs/Makefile" ;; + "modules/Makefile") CONFIG_FILES="$CONFIG_FILES modules/Makefile" ;; + "scripts/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/Makefile" ;; + + *) { { 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 - # setresuid() was wrapped beginning in glibc 2.3.2. - { echo "$as_me:$LINENO: checking for setresuid" >&5 -echo $ECHO_N "checking for setresuid... $ECHO_C" >&6; } - # Ensure an error is thrown if setresuid is unknown. - CFLAGS="$CFLAGS -Werror-implicit-function-declaration -Werror" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#define _GNU_SOURCE - #include -int -main () +# 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; } +} - setresuid(0, 0, 0); +# +# Set up the sed scripts for CONFIG_FILES section. +# - ; - 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 - HAVE_SETRESUID="yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +# 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 - HAVE_SETRESUID="no" -fi +_ACEOF -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CFLAGS="$ORIGINAL_CFLAGS" - { echo "$as_me:$LINENO: result: $HAVE_SETRESUID" >&5 -echo "${ECHO_T}$HAVE_SETRESUID" >&6; } -fi -### General flags / actions -COMMON_CFLAGS="$COMMON_CFLAGS -Wall" -COMMON_CFLAGS="$COMMON_CFLAGS -Werror" -# -Wno-unknown-pragmas is due to gcc not understanding '#pragma ident' in Xlib.h on OpenSolaris. -for TEST_CFLAG in -Wno-pointer-sign -Wno-unused-value -fno-strict-aliasing \ - -Wno-unknown-pragmas -Wno-uninitialized; do - { echo "$as_me:$LINENO: checking for GCC flag $TEST_CFLAG" >&5 -echo $ECHO_N "checking for GCC flag $TEST_CFLAG... $ECHO_C" >&6; } - CFLAGS="$CFLAGS $TEST_CFLAG" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ +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 -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -int -main () -{ + 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 - return 0; +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 - ; - return 0; -} +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 -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 - COMMON_CFLAGS="$COMMON_CFLAGS $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" +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 +AR!$AR$ac_delim +RANLIB!$RANLIB$ac_delim +lt_ECHO!$lt_ECHO$ac_delim +DSYMUTIL!$DSYMUTIL$ac_delim +NMEDIT!$NMEDIT$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 +LIBPNG_CONFIG!$LIBPNG_CONFIG$ac_delim +DNET_CONFIG!$DNET_CONFIG$ac_delim +ICU_CONFIG!$ICU_CONFIG$ac_delim +HAVE_CXX!$HAVE_CXX$ac_delim +RPCGEN!$RPCGEN$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 +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 +PAMD_TRUE!$PAMD_TRUE$ac_delim +PAMD_FALSE!$PAMD_FALSE$ac_delim +ENABLE_UNITY_TRUE!$ENABLE_UNITY_TRUE$ac_delim +ENABLE_UNITY_FALSE!$ENABLE_UNITY_FALSE$ac_delim +WITH_ROOT_PRIVILEGES_TRUE!$WITH_ROOT_PRIVILEGES_TRUE$ac_delim +WITH_ROOT_PRIVILEGES_FALSE!$WITH_ROOT_PRIVILEGES_FALSE$ac_delim +TARGET_OS!$TARGET_OS$ac_delim +KERNEL_RELEASE!$KERNEL_RELEASE$ac_delim +MODULES_OS!$MODULES_OS$ac_delim +MODULES_DIR!$MODULES_DIR$ac_delim +MODULES!$MODULES$ac_delim +COMMON_XLIBS!$COMMON_XLIBS$ac_delim +GTK_CPPFLAGS!$GTK_CPPFLAGS$ac_delim +GTK_LIBS!$GTK_LIBS$ac_delim +DNET_CPPFLAGS!$DNET_CPPFLAGS$ac_delim +DNET_LIBS!$DNET_LIBS$ac_delim +PROCPS_LIBS!$PROCPS_LIBS$ac_delim +ICU_CPPFLAGS!$ICU_CPPFLAGS$ac_delim +ICU_LIBS!$ICU_LIBS$ac_delim +PAM_PREFIX!$PAM_PREFIX$ac_delim +URIPARSER_CPPFLAGS!$URIPARSER_CPPFLAGS$ac_delim +URIPARSER_LIBS!$URIPARSER_LIBS$ac_delim +LIBPNG_CPPFLAGS!$LIBPNG_CPPFLAGS$ac_delim +LIBPNG_LIBS!$LIBPNG_LIBS$ac_delim +ZLIB_CPPFLAGS!$ZLIB_CPPFLAGS$ac_delim +ZLIB_LIBS!$ZLIB_LIBS$ac_delim +LIB_AUTH_CPPFLAGS!$LIB_AUTH_CPPFLAGS$ac_delim +LIB_FILE_CPPFLAGS!$LIB_FILE_CPPFLAGS$ac_delim +LIB_HGFS_SERVER_CPPFLAGS!$LIB_HGFS_SERVER_CPPFLAGS$ac_delim +LIB_IMPERSONATE_CPPFLAGS!$LIB_IMPERSONATE_CPPFLAGS$ac_delim +LIB_MISC_CPPFLAGS!$LIB_MISC_CPPFLAGS$ac_delim +LIB_PROC_MGR_CPPFLAGS!$LIB_PROC_MGR_CPPFLAGS$ac_delim +LIB_STRING_CPPFLAGS!$LIB_STRING_CPPFLAGS$ac_delim +LIB_USER_CPPFLAGS!$LIB_USER_CPPFLAGS$ac_delim +GUESTD_LDADD!$GUESTD_LDADD$ac_delim +VMWARE_USER_CPPFLAGS!$VMWARE_USER_CPPFLAGS$ac_delim +VMWARE_USER_LDADD!$VMWARE_USER_LDADD$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` = 75; 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 -COMMON_CFLAGS="$COMMON_CFLAGS -DVMX86_TOOLS" - -INCLUDE_DIR="`cd $srcdir; pwd`/lib/include" -COMMON_CFLAGS="$COMMON_CFLAGS -I$INCLUDE_DIR" - -### OS/arch-specific flags / actions -MODULES="" -MODULES_OS="$os" -buildHgfsmounter=no +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 -if test "$os" = "linux"; then - COMMON_CFLAGS="$COMMON_CFLAGS -D_FILE_OFFSET_BITS=64" - COMMON_CFLAGS="$COMMON_CFLAGS -D_LARGEFILE64_SOURCE" - COMMON_CFLAGS="$COMMON_CFLAGS -D_XOPEN_SOURCE=500" - COMMON_CFLAGS="$COMMON_CFLAGS -D_BSD_SOURCE" - COMMON_CFLAGS="$COMMON_CFLAGS -D_SVID_SOURCE" +cat >>$CONFIG_STATUS <<_ACEOF +cat >"\$tmp/subs-2.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 - if test "$osVersion" -ge 202000; then - MODULES="$MODULES vmxnet vmmemctl" - fi - if test "$osVersion" -ge 204000; then - MODULES="$MODULES vmhgfs vmblock" - buildHgfsmounter=yes - fi - if test "$osVersion" -ge 206006; then - MODULES="$MODULES vmsync" - fi -fi -if test "$os" = "freebsd"; then - if test "$osVersion" -gt 302000; then - MODULES="$MODULES vmmemctl" - fi - if test "$osVersion" -gt 409000; then - MODULES="$MODULES vmxnet" - fi - if test "$osVersion" -gt 600000; then - MODULES="$MODULES vmhgfs vmblock" - buildHgfsmounter=yes - fi +# 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 -if test "$os" = "solaris"; then - LIB_IMPERSONATE_CFLAGS="$LIB_IMPERSONATE_CFLAGS -D_POSIX_PTHREAD_SEMANTICS" - LIB_USER_CFLAGS="$LIB_USER_CFLAGS -D_POSIX_PTHREAD_SEMANTICS" +cat >>$CONFIG_STATUS <<\_ACEOF +fi # test -n "$CONFIG_FILES" - GUESTD_LDFLAGS="$GUESTD_LDFLAGS -lsocket" - GUESTD_LDFLAGS="$GUESTD_LDFLAGS -lnsl" - VMWARE_USER_CFLAGS="$VMWARE_USER_CFLAGS -I/usr/X11/include/" - VMWARE_USER_LDFLAGS="$VMWARE_USER_LDFLAGS -lXext" - VMWARE_USER_LDFLAGS="$VMWARE_USER_LDFLAGS -lX11" - VMWARE_USER_LDFLAGS="$VMWARE_USER_LDFLAGS -lsocket" - VMWARE_USER_LDFLAGS="$VMWARE_USER_LDFLAGS -lnsl" +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 - # uname -r on Solaris 10 reports "5.10" - if test "$osVersion" -ge 510000; then - COMMON_CFLAGS="$COMMON_CFLAGS -DSOL10" - fi -fi + 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 - if test "$buildHgfsmounter" = "yes"; then - BUILD_HGFSMOUNTER_TRUE= - BUILD_HGFSMOUNTER_FALSE='#' -else - BUILD_HGFSMOUNTER_TRUE='#' - BUILD_HGFSMOUNTER_FALSE= -fi + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + 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 - if test "$os" = "linux"; then - LINUX_TRUE= - LINUX_FALSE='#' -else - LINUX_TRUE='#' - LINUX_FALSE= -fi + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin";; + esac + ;; + esac - if test "$os" = "solaris"; then - SOLARIS_TRUE= - SOLARIS_FALSE='#' -else - SOLARIS_TRUE='#' - SOLARIS_FALSE= -fi + 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=. - 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 +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 - if test "$have_x" = "yes"; then - HAVE_X11_TRUE= - HAVE_X11_FALSE='#' -else - HAVE_X11_TRUE='#' - HAVE_X11_FALSE= -fi +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 -### Feature-specific flags / actions -# Combine where possible + case $ac_mode in + :F) + # + # CONFIG_FILE + # -# 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 "$MULTIMON_ENABLED" = "no"; then - cat >>confdefs.h <<\_ACEOF -#define NO_MULTIMON 1 + 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 -fi - -if test "$os$userSpaceBitness" = "linux64" || test "$HAVE_SYS_SETUID" = "yes"; then - LIB_MISC_CFLAGS="$LIB_MISC_CFLAGS -DGLIBC_VERSION_21" -fi - -if test "$HAVE_NEW_ICONV" = "yes"; then - LIB_MISC_CFLAGS="$LIB_MISC_CFLAGS -DGLIBC_VERSION_22" -fi - -if test "$HAVE_LSEEK" = "yes"; then - LIB_FILE_CFLAGS="$LIB_FILE_CFLAGS -DGLIBC_VERSION_21" - LIB_HGFS_SERVER_CFLAGS="$LIB_HGFS_SERVER_CFLAGS -DGLIBC_VERSION_21" -fi +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= -if test "$HAVE_SETRESUID" = "yes"; then - LIB_PROC_MGR_CFLAGS="$LIB_PROC_MGR_CFLAGS -DGLIBC_VERSION_23" -fi +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 -if test "$HAVE_CRYPT" = "yes"; then - LIB_AUTH_CFLAGS="$LIB_AUTH_CFLAGS -DGLIBC_VERSION_22" -fi +# 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" >$tmp/out -if test "$HAVE_WCHAR_H" = "yes"; then - LIB_STRING_CFLAGS="$LIB_STRING_CFLAGS -DGLIBC_VERSION_22" -fi +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;} -### General substs + 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 (GNU $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 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 " -### Lib substs +# ### 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 +# 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//" -### Program substs +# 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 -### -### Create the Makefiles -### -ac_config_files="$ac_config_files Makefile lib/Makefile lib/atomic/Makefile lib/atomic/shared/Makefile lib/auth/Makefile lib/backdoor/Makefile lib/backdoor/shared/Makefile lib/conf/Makefile lib/dict/Makefile lib/dnd/Makefile lib/err/Makefile lib/eventManager/Makefile lib/file/Makefile lib/fileUtf8/Makefile lib/foundryMsg/Makefile lib/guestApp/Makefile lib/guestInfo/Makefile lib/hgfs/Makefile lib/hgfsBd/Makefile lib/hgfsServer/Makefile lib/hgfsServerManagerGuest/Makefile lib/hgfsServerPolicyGuest/Makefile lib/deployPkg/Makefile lib/impersonate/Makefile lib/message/Makefile lib/message/shared/Makefile lib/misc/Makefile lib/misc/shared/Makefile lib/netUtil/Makefile lib/panic/Makefile lib/panicDefault/Makefile lib/printer/Makefile lib/procMgr/Makefile lib/rpcIn/Makefile lib/rpcOut/Makefile lib/rpcOut/shared/Makefile lib/rpcVmx/Makefile lib/SLPv2Parser/Makefile lib/socketMgr/Makefile lib/strUtil/Makefile lib/string/Makefile lib/string/shared/Makefile lib/sync/Makefile lib/sync/shared/Makefile lib/syncDriver/Makefile lib/system/Makefile lib/toolsLogger/Makefile lib/unicode/Makefile lib/user/Makefile lib/vixTools/Makefile lib/vmBackupLib/Makefile lib/vmCheck/Makefile lib/vmSignal/Makefile lib/wiper/Makefile guestd/Makefile vmware-user/Makefile toolbox/Makefile hgfsclient/Makefile hgfsmounter/Makefile checkvm/Makefile libguestlib/Makefile xferlogs/Makefile modules/Makefile" +# Object file suffix (normally "o"). +objext=$ac_objext +# Executable file suffix (normally ""). +exeext=$exeext -### -### 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. +# whether the shell understands "unset". +lt_unset=$lt_unset -_ACEOF +# turn spaces into newlines. +SP2NL=$lt_lt_SP2NL -# 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 +# turn newlines into spaces. +NL2SP=$lt_lt_NL2SP - (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 +# How to create reloadable object files. +reload_flag=$lt_reload_flag +reload_cmds=$lt_reload_cmds -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$lt_deplibs_check_method -# 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` +# Command to use when deplibs_check_method == "file_magic". +file_magic_cmd=$lt_file_magic_cmd +# The archiver. +AR=$lt_AR +AR_FLAGS=$lt_AR_FLAGS -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 +# A symbol stripping program. +STRIP=$lt_STRIP -LTLIBOBJS=$ac_ltlibobjs +# 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 +# A C compiler. +LTCC=$lt_CC -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 "${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 +# LTCC compiler flags. +LTCFLAGS=$lt_CFLAGS -: ${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. +# 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 -debug=false -ac_cs_recheck=false -ac_cs_silent=false -SHELL=\${CONFIG_SHELL-$SHELL} -_ACEOF +# Transform the output of nm in a proper C declaration. +global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl -cat >>$CONFIG_STATUS <<\_ACEOF -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## +# 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 -# 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 +# 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 -fi +# The name of the directory that contains temporary libtool files. +objdir=$objdir +# Shell to use when invoking shell scripts. +SHELL=$lt_SHELL +# An echo program that does not interpret backslashes. +ECHO=$lt_ECHO +# Used to examine libraries when file_magic_cmd begins with "file". +MAGIC_CMD=$MAGIC_CMD -# 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 +# Must we lock files when doing compilation? +need_locks=$lt_need_locks -# 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 +# Tool to manipulate archived DWARF debug symbol files on Mac OS X. +DSYMUTIL=$lt_DSYMUTIL -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi +# Tool to change global to local symbols on Mac OS X. +NMEDIT=$lt_NMEDIT +# Old archive suffix (normally "a"). +libext=$libext -# 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" +# Shared library suffix (normally ".so"). +shrext_cmds=$lt_shrext_cmds -# 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 +# The commands to extract the exported symbol list from a shared archive. +extract_expsyms_cmds=$lt_extract_expsyms_cmds - ;; -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 +# Variables whose values should be saved in libtool wrapper scripts and +# restored at link time. +variables_saved_for_relink=$lt_variables_saved_for_relink -# 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='+ ' +# Do we need the "lib" prefix for modules? +need_lib_prefix=$need_lib_prefix -# 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 +# Do we need a version for libraries? +need_version=$need_version -# 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 +# Library versioning type. +version_type=$version_type -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi +# Shared library runtime path variable. +runpath_var=$runpath_var +# Shared library path variable. +shlibpath_var=$shlibpath_var -# 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'` +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath -# CDPATH. -$as_unset CDPATH +# 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 - 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" || { +# Command to use after installation of a shared archive. +postinstall_cmds=$lt_postinstall_cmds - # 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; }; } +# Command to use after uninstallation of a shared archive. +postuninstall_cmds=$lt_postuninstall_cmds - # 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 -} +# 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 -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi +# Whether we should hardcode library paths into libraries. +hardcode_into_libs=$hardcode_into_libs -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 +# Compile-time system search path for libraries. +sys_lib_search_path_spec=$lt_sys_lib_search_path_spec -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi +# Run-time system search path for libraries. +sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec -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 +# Whether dlopen is supported. +dlopen_support=$enable_dlopen -if mkdir -p . 2>/dev/null; then - as_mkdir_p=: -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self -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 +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static -# 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'" +# Commands to strip libraries. +old_striplib=$lt_old_striplib +striplib=$lt_striplib -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" +# The linker used to build libraries. +LD=$lt_LD -exec 6>&1 +# Commands used to build an old-style archive. +old_archive_cmds=$lt_old_archive_cmds -# 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 2008.01.23-74039, which was -generated by GNU Autoconf 2.61. Invocation command line was +# A language specific compiler. +CC=$lt_compiler - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS - CONFIG_LINKS = $CONFIG_LINKS - CONFIG_COMMANDS = $CONFIG_COMMANDS - $ $0 $@ +# Is the compiler the GNU compiler? +with_gcc=$GCC -on `(hostname || uname -n) 2>/dev/null | sed 1q` -" +# Compiler flag to turn off builtin functions. +no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag -_ACEOF +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl -cat >>$CONFIG_STATUS <<_ACEOF -# Files that config.status was made for. -config_files="$ac_config_files" -config_commands="$ac_config_commands" +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic -_ACEOF +# Compiler flag to prevent dynamic linking. +link_static_flag=$lt_lt_prog_compiler_static -cat >>$CONFIG_STATUS <<\_ACEOF -ac_cs_usage="\ -\`$as_me' instantiates files from templates according to the -current configuration. +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$lt_lt_cv_prog_compiler_c_o -Usage: $0 [OPTIONS] [FILE]... +# Whether or not to add -lc for building shared libraries. +build_libtool_need_lc=$archive_cmds_need_lc - -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 +# Whether or not to disallow shared libs when runtime libs are static. +allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes -Configuration files: -$config_files +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$lt_export_dynamic_flag_spec -Configuration commands: -$config_commands +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec -Report bugs to ." +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF -ac_cs_version="\\ -open-vm-tools config.status 2008.01.23-74039 -configured by $0, generated by GNU Autoconf 2.61, - with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$lt_old_archive_from_new_cmds -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." +# Create a temporary old-style archive to link instead of a shared archive. +old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds -ac_pwd='$ac_pwd' -srcdir='$srcdir' -INSTALL='$INSTALL' -MKDIR_P='$MKDIR_P' -_ACEOF +# Commands used to build a shared archive. +archive_cmds=$lt_archive_cmds +archive_expsym_cmds=$lt_archive_expsym_cmds -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 +# 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 - 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=: ;; +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld - # This is an error. - -*) { echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } ;; +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$lt_allow_undefined_flag - *) ac_config_targets="$ac_config_targets $1" - ac_need_defaults=false ;; +# Flag that enforces no undefined symbols. +no_undefined_flag=$lt_no_undefined_flag - esac - shift -done +# 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 -ac_configure_extra_args= +# If ld is used when linking, flag to hardcode \$libdir into a binary +# during linking. This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld -if $ac_cs_silent; then - exec 6>/dev/null - ac_configure_extra_args="$ac_configure_extra_args --silent" -fi +# Whether we need a single "-rpath" flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator -_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 +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary. +hardcode_direct=$hardcode_direct -_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 +# 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 -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF -# -# INIT-COMMANDS -# -AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" +# Set to "yes" if using the -LDIR flag during linking hardcodes DIR +# into the resulting binary. +hardcode_minus_L=$hardcode_minus_L -_ACEOF +# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR +# into the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var -cat >>$CONFIG_STATUS <<\_ACEOF +# 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 -# Handling of arguments. -for ac_config_target in $ac_config_targets -do - case $ac_config_target in - "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; - "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; - "lib/atomic/Makefile") CONFIG_FILES="$CONFIG_FILES lib/atomic/Makefile" ;; - "lib/atomic/shared/Makefile") CONFIG_FILES="$CONFIG_FILES lib/atomic/shared/Makefile" ;; - "lib/auth/Makefile") CONFIG_FILES="$CONFIG_FILES lib/auth/Makefile" ;; - "lib/backdoor/Makefile") CONFIG_FILES="$CONFIG_FILES lib/backdoor/Makefile" ;; - "lib/backdoor/shared/Makefile") CONFIG_FILES="$CONFIG_FILES lib/backdoor/shared/Makefile" ;; - "lib/conf/Makefile") CONFIG_FILES="$CONFIG_FILES lib/conf/Makefile" ;; - "lib/dict/Makefile") CONFIG_FILES="$CONFIG_FILES lib/dict/Makefile" ;; - "lib/dnd/Makefile") CONFIG_FILES="$CONFIG_FILES lib/dnd/Makefile" ;; - "lib/err/Makefile") CONFIG_FILES="$CONFIG_FILES lib/err/Makefile" ;; - "lib/eventManager/Makefile") CONFIG_FILES="$CONFIG_FILES lib/eventManager/Makefile" ;; - "lib/file/Makefile") CONFIG_FILES="$CONFIG_FILES lib/file/Makefile" ;; - "lib/fileUtf8/Makefile") CONFIG_FILES="$CONFIG_FILES lib/fileUtf8/Makefile" ;; - "lib/foundryMsg/Makefile") CONFIG_FILES="$CONFIG_FILES lib/foundryMsg/Makefile" ;; - "lib/guestApp/Makefile") CONFIG_FILES="$CONFIG_FILES lib/guestApp/Makefile" ;; - "lib/guestInfo/Makefile") CONFIG_FILES="$CONFIG_FILES lib/guestInfo/Makefile" ;; - "lib/hgfs/Makefile") CONFIG_FILES="$CONFIG_FILES lib/hgfs/Makefile" ;; - "lib/hgfsBd/Makefile") CONFIG_FILES="$CONFIG_FILES lib/hgfsBd/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/deployPkg/Makefile") CONFIG_FILES="$CONFIG_FILES lib/deployPkg/Makefile" ;; - "lib/impersonate/Makefile") CONFIG_FILES="$CONFIG_FILES lib/impersonate/Makefile" ;; - "lib/message/Makefile") CONFIG_FILES="$CONFIG_FILES lib/message/Makefile" ;; - "lib/message/shared/Makefile") CONFIG_FILES="$CONFIG_FILES lib/message/shared/Makefile" ;; - "lib/misc/Makefile") CONFIG_FILES="$CONFIG_FILES lib/misc/Makefile" ;; - "lib/misc/shared/Makefile") CONFIG_FILES="$CONFIG_FILES lib/misc/shared/Makefile" ;; - "lib/netUtil/Makefile") CONFIG_FILES="$CONFIG_FILES lib/netUtil/Makefile" ;; - "lib/panic/Makefile") CONFIG_FILES="$CONFIG_FILES lib/panic/Makefile" ;; - "lib/panicDefault/Makefile") CONFIG_FILES="$CONFIG_FILES lib/panicDefault/Makefile" ;; - "lib/printer/Makefile") CONFIG_FILES="$CONFIG_FILES lib/printer/Makefile" ;; - "lib/procMgr/Makefile") CONFIG_FILES="$CONFIG_FILES lib/procMgr/Makefile" ;; - "lib/rpcIn/Makefile") CONFIG_FILES="$CONFIG_FILES lib/rpcIn/Makefile" ;; - "lib/rpcOut/Makefile") CONFIG_FILES="$CONFIG_FILES lib/rpcOut/Makefile" ;; - "lib/rpcOut/shared/Makefile") CONFIG_FILES="$CONFIG_FILES lib/rpcOut/shared/Makefile" ;; - "lib/rpcVmx/Makefile") CONFIG_FILES="$CONFIG_FILES lib/rpcVmx/Makefile" ;; - "lib/SLPv2Parser/Makefile") CONFIG_FILES="$CONFIG_FILES lib/SLPv2Parser/Makefile" ;; - "lib/socketMgr/Makefile") CONFIG_FILES="$CONFIG_FILES lib/socketMgr/Makefile" ;; - "lib/strUtil/Makefile") CONFIG_FILES="$CONFIG_FILES lib/strUtil/Makefile" ;; - "lib/string/Makefile") CONFIG_FILES="$CONFIG_FILES lib/string/Makefile" ;; - "lib/string/shared/Makefile") CONFIG_FILES="$CONFIG_FILES lib/string/shared/Makefile" ;; - "lib/sync/Makefile") CONFIG_FILES="$CONFIG_FILES lib/sync/Makefile" ;; - "lib/sync/shared/Makefile") CONFIG_FILES="$CONFIG_FILES lib/sync/shared/Makefile" ;; - "lib/syncDriver/Makefile") CONFIG_FILES="$CONFIG_FILES lib/syncDriver/Makefile" ;; - "lib/system/Makefile") CONFIG_FILES="$CONFIG_FILES lib/system/Makefile" ;; - "lib/toolsLogger/Makefile") CONFIG_FILES="$CONFIG_FILES lib/toolsLogger/Makefile" ;; - "lib/unicode/Makefile") CONFIG_FILES="$CONFIG_FILES lib/unicode/Makefile" ;; - "lib/user/Makefile") CONFIG_FILES="$CONFIG_FILES lib/user/Makefile" ;; - "lib/vixTools/Makefile") CONFIG_FILES="$CONFIG_FILES lib/vixTools/Makefile" ;; - "lib/vmBackupLib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/vmBackupLib/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" ;; - "guestd/Makefile") CONFIG_FILES="$CONFIG_FILES guestd/Makefile" ;; - "vmware-user/Makefile") CONFIG_FILES="$CONFIG_FILES vmware-user/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" ;; - "libguestlib/Makefile") CONFIG_FILES="$CONFIG_FILES libguestlib/Makefile" ;; - "xferlogs/Makefile") CONFIG_FILES="$CONFIG_FILES xferlogs/Makefile" ;; - "modules/Makefile") CONFIG_FILES="$CONFIG_FILES modules/Makefile" ;; +# 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 + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path=$lt_fix_srcfile_path + +# Set to "yes" if exported symbols are required. +always_export_symbols=$always_export_symbols + +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds + +# 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 + +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec - *) { { 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 +# 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 -# 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 +# 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 -# 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 || + +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 '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + case $xsi_shell in + yes) + cat << \_LT_EOF >> "$cfgfile" +# 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 () { - 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 + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac } -# Create a (secure) tmp directory for tmp files. +# func_basename file +func_basename () { - tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" -} || + func_basename_result="${1##*/}" +} + +# 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 () { - tmp=./conf$$-$RANDOM - (umask 077 && mkdir "$tmp") -} || + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac + func_basename_result="${1##*/}" +} + +# 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_stripname () { - echo "$me: cannot create a temporary directory in ." >&2 - { (exit 1); exit 1; } + # 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}"} } -# -# Set up the sed scripts for CONFIG_FILES section. -# +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=${1%%=*} + func_opt_split_arg=${1#*=} +} -# 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 +# func_lo2o object +func_lo2o () +{ + case ${1} in + *.lo) func_lo2o_result=${1%.lo}.${objext} ;; + *) func_lo2o_result=${1} ;; + esac +} +_LT_EOF + ;; + *) # Bourne compatible functions. + cat << \_LT_EOF >> "$cfgfile" +# 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 () +{ + # Extract subdirectory from the argument. + func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` + if test "X$func_dirname_result" = "X${1}"; then + func_dirname_result="${3}" + else + func_dirname_result="$func_dirname_result${2}" + fi +} -_ACEOF +# func_basename file +func_basename () +{ + func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` +} +# 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 "X${1}" | $Xsed -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 "X${1}" | $Xsed -e "$basename"` +} +# 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 "X${3}" \ + | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "X${3}" \ + | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; + esac +} -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 -SED!$SED$ac_delim -GREP!$GREP$ac_delim -EGREP!$EGREP$ac_delim -LN_S!$LN_S$ac_delim -ECHO!$ECHO$ac_delim -AR!$AR$ac_delim -RANLIB!$RANLIB$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 -_ACEOF +# sed scripts: +my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q' +my_sed_long_arg='1s/^-[^=]*=//' + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` + func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` +} + +# func_lo2o object +func_lo2o () +{ + func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` +} +_LT_EOF +esac + +case $lt_shell_append in + yes) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$1+=\$2" +} +_LT_EOF + ;; + *) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$1=\$$1\$2" +} +_LT_EOF + ;; + esac + + + sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + 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 + +# 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 + +# How to pass a linker flag through the compiler. +wl=$lt_lt_prog_compiler_wl_CXX + +# Additional compiler flags for building library objects. +pic_flag=$lt_lt_prog_compiler_pic_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 - 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 +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX -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 +# Whether the compiler copes with passing no objects directly. +compiler_needs_object=$lt_compiler_needs_object_CXX -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 +# 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 -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - cat >conf$$subs.sed <<_ACEOF -CXXCPP!$CXXCPP$ac_delim -F77!$F77$ac_delim -FFLAGS!$FFLAGS$ac_delim -ac_ct_F77!$ac_ct_F77$ac_delim -LIBTOOL!$LIBTOOL$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 -DNET_CONFIG!$DNET_CONFIG$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 -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 -MODULES_OS!$MODULES_OS$ac_delim -MODULES!$MODULES$ac_delim -COMMON_CFLAGS!$COMMON_CFLAGS$ac_delim -COMMON_PROG_CFLAGS!$COMMON_PROG_CFLAGS$ac_delim -COMMON_XLIBS!$COMMON_XLIBS$ac_delim -GTK_CFLAGS!$GTK_CFLAGS$ac_delim -GTK_LIBS!$GTK_LIBS$ac_delim -DNET_CFLAGS!$DNET_CFLAGS$ac_delim -DNET_LIBS!$DNET_LIBS$ac_delim -LIB_AUTH_CFLAGS!$LIB_AUTH_CFLAGS$ac_delim -LIB_FILE_CFLAGS!$LIB_FILE_CFLAGS$ac_delim -LIB_HGFS_SERVER_CFLAGS!$LIB_HGFS_SERVER_CFLAGS$ac_delim -LIB_IMPERSONATE_CFLAGS!$LIB_IMPERSONATE_CFLAGS$ac_delim -LIB_MISC_CFLAGS!$LIB_MISC_CFLAGS$ac_delim -LIB_PROC_MGR_CFLAGS!$LIB_PROC_MGR_CFLAGS$ac_delim -LIB_STRING_CFLAGS!$LIB_STRING_CFLAGS$ac_delim -LIB_USER_CFLAGS!$LIB_USER_CFLAGS$ac_delim -GUESTD_LDFLAGS!$GUESTD_LDFLAGS$ac_delim -VMWARE_USER_CFLAGS!$VMWARE_USER_CFLAGS$ac_delim -VMWARE_USER_LDFLAGS!$VMWARE_USER_LDFLAGS$ac_delim -LIBOBJS!$LIBOBJS$ac_delim -LTLIBOBJS!$LTLIBOBJS$ac_delim -_ACEOF +# Commands used to build a shared archive. +archive_cmds=$lt_archive_cmds_CXX +archive_expsym_cmds=$lt_archive_expsym_cmds_CXX - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 44; 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 +# 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 -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 +# Whether we are building with GNU ld or not. +with_gnu_ld=$lt_with_gnu_ld_CXX -cat >>$CONFIG_STATUS <<_ACEOF -cat >"\$tmp/subs-2.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 +# 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 -# 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 +# 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 -cat >>$CONFIG_STATUS <<\_ACEOF -fi # test -n "$CONFIG_FILES" +# If ld is used when linking, flag to hardcode \$libdir into a binary +# during linking. This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX +# Whether we need a single "-rpath" flag with a separated argument. +hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX -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 +# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes +# DIR into the resulting binary. +hardcode_direct=$hardcode_direct_CXX - 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 +# 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 - # 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 +# Set to "yes" if using the -LDIR flag during linking hardcodes DIR +# into the resulting binary. +hardcode_minus_L=$hardcode_minus_L_CXX - case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin";; - esac - ;; - esac +# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR +# into the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX - 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=. +# 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 -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 +# Set to yes if linker adds runtime paths of dependent libraries +# to runtime path list. +inherit_rpath=$inherit_rpath_CXX -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 +# Whether libtool must link a program against all its dependency libraries. +link_all_deplibs=$link_all_deplibs_CXX +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path=$lt_fix_srcfile_path_CXX - case $ac_mode in - :F) - # - # CONFIG_FILE - # +# Set to "yes" if exported symbols are required. +always_export_symbols=$always_export_symbols_CXX - 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 +# The commands to list exported symbols. +export_symbols_cmds=$lt_export_symbols_cmds_CXX -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= +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$lt_exclude_expsyms_CXX -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 +# Symbols that must always be exported. +include_expsyms=$lt_include_expsyms_CXX -# 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" >$tmp/out +# Commands necessary for linking programs (against libraries) with templates. +prelink_cmds=$lt_prelink_cmds_CXX -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;} +# Specify filename containing input files. +file_list_spec=$lt_file_list_spec_CXX - 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 - ;; +# 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 - :C) { echo "$as_me:$LINENO: executing $ac_file commands" >&5 -echo "$as_me: executing $ac_file commands" >&6;} - ;; - esac +# 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 - 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 ;; esac diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/configure.ac /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/configure.ac --- open-vm-tools-2008.01.23-74039/configure.ac 2008-01-28 08:02:54.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/configure.ac 2008-10-13 08:01:55.000000000 +0100 @@ -18,13 +18,26 @@ ### 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: +# $CUSTOM_GTK_CPPFLAGS - compile-time flags to find Gtk headers. +# $CUSTOM_GTK_LIBS - link-time flags to find and link the Gtk libraries. +# $CUSTOM_PROCPS_LIBS - link-time flags to find and link the procps library. +# $CUSTOM_URIPARSER_CPPFLAGS - compile-time flags to find the uriparser headers +# $CUSTOM_URIPARSER_LIBS - link-time flags to find and link the uriparser library +# $CUSTOM_ZLIB_CPPFLAGS - compile-time flags to find the zlib headers +# $CUSTOM_ZLIB_LIBS - link-time flags to find and link the zlib library +################################################################################ + ### ### Initialization ### AC_INIT( [open-vm-tools], - [2008.01.23-74039], + [2008.10.10-123053], [open-vm-tools-devel@lists.sourceforge.net]) # In order to make this configure script auto-detect situations where @@ -48,6 +61,11 @@ # 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 @@ -64,11 +82,39 @@ ;; 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="`uname -r | cut -f1 -d. | cut -f1 -d-`" - minor_version="`uname -r | cut -f2 -d. | cut -f1 -d-`" - micro_version="`uname -r | cut -f3 -d. | cut -f1 -d-`" + 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 } @@ -87,14 +133,45 @@ ;; esac osVersion="`getOsVersion`" +if test "$os" = "linux"; then + if test "$with_kernel_modules" = "yes"; then + if test ! -d "$LINUXDIR/kernel/"; then + AC_MSG_ERROR([$LINUXDIR/kernel does not exist]) + fi + fi +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]), - [MULTIMON_ENABLED="$enableval"], - [MULTIMON_ENABLED="yes"]) + [disables multimon, enabled by default]), + [enable_multimon="$enableval"], + [enable_multimon="yes"]) + +AC_ARG_ENABLE( + unity, + AS_HELP_STRING( + [--disable-unity], + [disables Unity, enabled by default]), + [enable_unity="$enableval"], + [enable_unity="yes"]) + +AC_ARG_WITH( + gtk2, + AS_HELP_STRING( + [--without-gtk2], + [compiles without Gtk 2.0 (falls back on Gtk 1.2)]), + [with_gtk2="$withval"], + [with_gtk2="yes"]) + +# If we're not going to use Gtk 2.0, disable Unity. It may be possible to +# get Unity working with Gtk 1.2 (it used to in the past), but that will +# require a great deal of work. +if test "$with_gtk2" != "yes"; then + enable_unity="no" +fi AM_INIT_AUTOMAKE @@ -103,16 +180,46 @@ ### # These need to be declared after initialization. -CFLAGS="$CFLAGS -DUSING_AUTOCONF=1" +# 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" ### ### 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], @@ -132,17 +239,32 @@ # If the user explicitly disables X11, then don't try to detect the X-related libraries if test "$have_x" = "disabled"; then - MULTIMON_ENABLED="no" + enable_multimon="no" + enable_unity="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 - LIBS="$LIBS $X_LIBS" - CFLAGS="$CFLAGS $X_CFLAGS" - COMMON_XLIBS="-lX11" - COMMON_XLIBS="-lXext $COMMON_XLIBS" + CPPFLAGS="$CPPFLAGS $X_CFLAGS" + COMMON_XLIBS="$X_PRE_LIBS $X_LIBS -lX11 $X_EXTRA_LIBS" - if test "$MULTIMON_ENABLED" != "no"; then + 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], @@ -153,13 +275,20 @@ fi 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" - COMMON_XLIBS="-lXrender $COMMON_XLIBS"], + [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).])], - [-lXrender $COMMON_XLIBS]) + [$COMMON_XLIBS]) AC_CHECK_LIB( [Xtst], @@ -169,7 +298,119 @@ [libXtst not found. Please configure without X11 (using --without-x) or install the libXtst devel package(s).])], [$COMMON_XLIBS]) - if test -n "$CUSTOM_GTK_CFLAGS" -o -n "$CUSTOM_GTK_LIBS"; then + # If we're building with support for Unity, we'll need a few additional + # libraries. + if test "$enable_unity" != "no"; then + + # Unity needs the X11 Screen Saver extension library. It should be + # in the same place as the X11 libraries, so no need for any fancy + # path checking. + AC_CHECK_LIB( + [Xss], + [XScreenSaverQueryExtension], + [COMMON_XLIBS="-lXss $COMMON_XLIBS"], + [AC_MSG_ERROR( + [libXss not found. Please configure without Unity (using --disable-unity) or install the libXss devel package.])], + [$COMMON_XLIBS]) + + # Check for the uriparser library and headers. The upstream uriparser + # doesn't appear to ship with either a pkg-config file or a + # uriparser-config binary, so we'll look for it the old-fashioned + # way. + # + # Note that we look for uriFreeQueryListA because it's a relatively + # new symbol that our code needs (it isn't present in the uriparser + # that shipped with Ubuntu Hardy). + ORIGINAL_LDFLAGS="$LDFLAGS" + LDFLAGS="$CUSTOM_URIPARSER_LIBS $LDFLAGS" + AC_CHECK_LIB( + [uriparser], + [uriFreeQueryListA], + [if test -n "$CUSTOM_URIPARSER_LIBS"; then + URIPARSER_LIBS="$CUSTOM_URIPARSER_LIBS" + else + URIPARSER_LIBS="-luriparser" + fi], + [AC_MSG_ERROR( + [uriparser library not found or is too old. Please configure without Unity (using --disable-unity) or install the liburiparser devel package.])]) + LDFLAGS="$ORIGINAL_LDFLAGS" + + if test -n "$CUSTOM_URIPARSER_CPPFLAGS"; then + URIPARSER_CPPFLAGS="$CUSTOM_URIPARSER_CPPFLAGS" + else + # XXX: No pkg-config and no uriparser-config means we need to + # hard-code a sensible default. + URIPARSER_CPPFLAGS="-I/usr/include/uriparser" + fi + ORIGINAL_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$URIPARSER_CPPFLAGS $CPPFLAGS" + AC_CHECK_HEADER( + [Uri.h], + [], + [AC_MSG_ERROR( + [uriparser headers not found. Please configure without Unity (using --disable-unity) or install the liburiparser devel package])]) + CPPFLAGS="$ORIGINAL_CPPFLAGS" + + # Check for libpng using pkg-config, or barring that, using + # libpng-config. + if test "$HAVE_PKG_CONFIG" = "yes"; then + AC_MSG_CHECKING([for libpng (via pkg-config)]) + if pkg-config --exists libpng12; then + LIBPNG_CPPFLAGS="`pkg-config --cflags libpng12`" + LIBPNG_LIBS="`pkg-config --libs libpng12`" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + else + AC_PATH_PROG( + [LIBPNG_CONFIG], + [libpng-config], + [no]) + if test "$LIBPNG_CONFIG" != "no"; then + LIBPNG_CPPFLAGS="`$LIBPNG_CONFIG --cflags`" + LIBPNG_LIBS="`$LIBPNG_CONFIG --libs`" + fi + fi + if test -z "$LIBPNG_CPPFLAGS"; then + AC_MSG_ERROR( + [libpng not found. Please configure without Unity (using --disable-unity) or install the libpng devel package]) + fi + + # Check for the zlib library and headers. Like uriparser, there + # isn't a pkg-config or zlib-config file. + ORIGINAL_LDFLAGS="$LDFLAGS" + LDFLAGS="$CUSTOM_ZLIB_LIBS $LDFLAGS" + AC_CHECK_LIB( + [z], + [zlibVersion], + [if test -n "$CUSTOM_ZLIB_LIBS"; then + ZLIB_LIBS="$CUSTOM_ZLIB_LIBS" + else + ZLIB_LIBS="-lz" + fi], + [AC_MSG_ERROR( + [zlib library not found. Please configure without Unity (using --disable-unity) or install the zlib devel package.])]) + LDFLAGS="$ORIGINAL_LDFLAGS" + + if test -n "$CUSTOM_ZLIB_CPPFLAGS"; then + ZLIB_CPPFLAGS="$CUSTOM_ZLIB_CPPFLAGS" + else + # XXX: No pkg-config and no zlib-config means we need to + # hard-code a sensible default. + ZLIB_CPPFLAGS="-I/usr/include" + fi + ORIGINAL_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$ZLIB_CPPFLAGS $CPPFLAGS" + AC_CHECK_HEADER( + [zlib.h], + [], + [AC_MSG_ERROR( + [zlib headers not found. Please configure without Unity (using --disable-unity) or install the zlib devel package])]) + CPPFLAGS="$ORIGINAL_CPPFLAGS" + fi # End of library checks for Unity. + + if test -n "$CUSTOM_GTK_CPPFLAGS" -o -n "$CUSTOM_GTK_LIBS"; then # Check to see if we have some version of GTK. gtk_accel_group_add # is a random function that is present in Gtk 1.2 but not Gtk # 2.0. Similarly, gtk_tree_view_new is a random function in Gtk 2.0 @@ -179,22 +420,26 @@ [gtk_accel_group_add], [HAVE_GTK1="yes"],, [$CUSTOM_GTK_LIBS]) - AC_CHECK_LIB( - [gtk-x11-2.0], - [gtk_tree_view_new], - [HAVE_GTK2="yes"],, - [$CUSTOM_GTK_LIBS]) + if test "$with_gtk2" != "no"; then + AC_CHECK_LIB( + [gtk-x11-2.0], + [gtk_tree_view_new], + [HAVE_GTK2="yes"],, + [$CUSTOM_GTK_LIBS]) + fi fi # Sometimes pkg-config can find stuff that AC_CHECK_LIB can't, so we use that as well. if test "$HAVE_PKG_CONFIG" = "yes"; then - AC_MSG_CHECKING([for Gtk+ 2.0 (via pkg-config)]) - if pkg-config --exists gtk+-2.0; then - HAVE_GTK2="yes" - AC_MSG_RESULT([yes]) - else - AC_MSG_RESULT([no]) - fi + if test "$with_gtk2" != "no"; then + AC_MSG_CHECKING([for Gtk+ 2.0 (via pkg-config)]) + if pkg-config --exists gtk+-2.0; then + HAVE_GTK2="yes" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + fi AC_MSG_CHECKING([for Gtk+ 1.x (via pkg-config)]) # The latter half of the test is because pkg-config's fallback @@ -217,17 +462,22 @@ # 'pkg-config --cflags gtk+-2.0' gives an error. if test "$HAVE_GTK2" = "yes" -a "$HAVE_PKG_CONFIG" = "yes" \ && ! pkg-config --exists gtk+-2.0 \ - && test -z "$CUSTOM_GTK_CFLAGS" -a -z "$CUSTOM_GTK_LIBS"; then + && test -z "$CUSTOM_GTK_CPPFLAGS" -a -z "$CUSTOM_GTK_LIBS"; then HAVE_GTK2="no" fi if test "$HAVE_GTK2" = "yes"; then - # Gtk 2.0 - GTK_CFLAGS="$GTK_CFLAGS -DGTK2" + # Gtk 2.0 + GTK_CPPFLAGS="$GTK_CPPFLAGS -DGTK2" gtkPackageName="gtk+-2.0" elif test "$HAVE_GTK1" = "yes"; then - # Gtk 1.2 + # Gtk 1.2 gtkPackageName="gtk+" + + # Unity requires Gtk 2.0. + if test "$enable_unity" != "no"; then + AC_MSG_ERROR([The Unity feature requires Gtk+ 2.0. Please install the Gtk+ 2.0 devel packages or configure without Unity (using --disable-unity)]) + fi else # We found Gtk+ 2.0 that turned out to have a non-working # pkg-config setup, AND Gtk 1.2 wasn't installed. @@ -235,18 +485,44 @@ fi # Prefer flags specified, in the environment, by the user. - if test -n "$CUSTOM_GTK_CFLAGS" -o -n "$CUSTOM_GTK_LIBS"; then - GTK_CFLAGS="$GTK_CFLAGS $CUSTOM_GTK_CFLAGS" + if test -n "$CUSTOM_GTK_CPPFLAGS" -o -n "$CUSTOM_GTK_LIBS"; then + GTK_CPPFLAGS="$GTK_CPPFLAGS $CUSTOM_GTK_CPPFLAGS" GTK_LIBS="$GTK_LIBS $CUSTOM_GTK_LIBS" # Use pkg-config if available and there are no user-specified flags. elif test "$HAVE_PKG_CONFIG" = "yes"; then - GTK_CFLAGS="$GTK_CFLAGS $(pkg-config --cflags $gtkPackageName)" + GTK_CPPFLAGS="$GTK_CPPFLAGS $(pkg-config --cflags $gtkPackageName)" GTK_LIBS="$GTK_LIBS $(pkg-config --libs $gtkPackageName)" # Otherwise, we have a problem. else - AC_MSG_ERROR([pkg-config not found. Get pkg-config or set CUSTOM_GTK_CFLAGS and CUSTOM_GTK_LIBS to specify gtk header file and library locations.]) + AC_MSG_ERROR([pkg-config not found. Get pkg-config or set CUSTOM_GTK_CPPFLAGS and CUSTOM_GTK_LIBS to specify gtk header file and library locations.]) + fi + + # Check for a sufficiently new installation of Gtk 2.0. This symbol is, at + # the time of writing, used in vmware-user. We must perform this check + # after GTK_LIBS has been set up. Note: we don't actually use the + # resultant HAVE_NEW_GTK2 variable; it's just set so that the default + # action, which will append gdk-x11-2.0 to LIBS, isn't taken. + if test "$HAVE_GTK2" == "yes"; then + AC_CHECK_LIB( + [gdk-x11-2.0], + [gdk_display_get_default_group], + [HAVE_NEW_GTK2="yes"], + [AC_MSG_ERROR( + [Gtk 2.0 installation may be too old. Please upgrade your Gtk 2.0 packages or configure without Gtk 2.0 (using --without-gtk2)])] + [$GTK_LIBS]) fi + # Unity requires libgdk_pixbuf_xlib, which most systems don't seem to + # provide via "pkg-config --libs gtk+-2.0". + if test "$enable_unity" != "no"; then + AC_CHECK_LIB( + [gdk_pixbuf_xlib-2.0], + [gdk_pixbuf_xlib_init], + [GTK_LIBS="$GTK_LIBS -lgdk_pixbuf_xlib-2.0"], + [AC_MSG_ERROR( + [gdk_pixbuf_xlib-2.0 not found. Make sure your Gtk 2.0 installation is sane, or configure without Unity (using --disable-unity).])], + [$GTK_LIBS]) + fi else AC_MSG_ERROR([libgtk not found. Please install the gtk devel package(s).]) fi @@ -256,17 +532,24 @@ [crypt], [crypt], [HAVE_CRYPT="yes" - GUESTD_LDFLAGS="$GUESTD_LDFLAGS -lcrypt"], + GUESTD_LDADD="$GUESTD_LDADD -lcrypt"], [AC_MSG_ERROR( [libcrypt not found. Please install the libc/libcrypt devel package(s).])]) +AC_CHECK_LIB( + [notify], + [notify_init], + [HAVE_NOTIFY="yes" + VMWARE_USER_LDADD="$VMWARE_USER_LDADD -lnotify"], + [AC_MSG_WARN([libnotify not found; notification disabled])]) + AC_CHECK_FUNCS( dlopen, , [AC_CHECK_LIB( dl, dlopen, - GUESTD_LDFLAGS="$GUESTD_LDFLAGS -ldl", + GUESTD_LDADD="$GUESTD_LDADD -ldl", [AC_MSG_ERROR( [dlopen was not found, but is required for open-vm-tools to function properly. Please contact your OS vendor.])])]) @@ -276,31 +559,159 @@ AC_CHECK_LIB( [pthread], [pthread_mutex_init], - [GUESTD_LDFLAGS="$GUESTD_LDFLAGS -lpthread" - VMWARE_USER_LDFLAGS="$VMWARE_USER_LDFLAGS -lpthread"], + [GUESTD_LDADD="$GUESTD_LDADD -lpthread" + VMWARE_USER_LDADD="$VMWARE_USER_LDADD -lpthread"], [AC_MSG_ERROR( [libpthread not found. Please install the libc/libpthread devel package(s).])]) -if test "$os" = "solaris"; then - # libdnet is needed on Solaris to build guestInfoPosix.c. +# 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)']) - AC_PATH_PROG( - [DNET_CONFIG], - [dnet-config], - [no]) +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 "$DNET_CONFIG" = "no"; then - AC_MSG_ERROR( - [dnet-config was not found on your PATH. libdnet must be installed in order to build open-vm-tools on Solaris. See http://libdnet.sourceforge.net/]) - fi +if test "$with_procps" = "yes"; then + ORIGINAL_LDFLAGS="$LDFLAGS" + LDFLAGS="$CUSTOM_PROCPS_LIBS $LDFLAGS" + AC_CHECK_LIB( + [proc-3.2.7], + [getstat], + [if test -n "$CUSTOM_PROCPS_LIBS"; then + PROCPS_LIBS="$CUSTOM_PROCPS_LIBS" + else + PROCPS_LIBS="-lproc-3.2.7" + fi], + [AC_MSG_ERROR( + [libproc not found. Please configure without procps (using --without-procps) or install procps - http://procps.sourceforge.net])]) + LDFLAGS="$ORIGINAL_LDFLAGS" - DNET_CFLAGS="`$DNET_CONFIG --cflags`" - DNET_LIBS="`$DNET_CONFIG --libs`" + GUESTD_LDADD="$GUESTD_LDADD $PROCPS_LIBS" + VMWARE_USER_LDADD="$VMWARE_USER_LDADD $PROCPS_LIBS" +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]) + +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_CHECK_PROGS([DNET_CONFIG], + [dumbnet-config dnet-config], + [no]) + + if test "$DNET_CONFIG" != no; then + DNET_CPPFLAGS="`$DNET_CONFIG --cflags`" + DNET_LIBS="`$DNET_CONFIG --libs`" + + GUESTD_LDADD="$GUESTD_LDADD $DNET_LIBS" + VMWARE_USER_LDADD="$VMWARE_USER_LDADD $DNET_LIBS" + if test "$DNET_CONFIG" == dumbnet-config; then + AC_DEFINE([DNET_IS_DUMBNET], 1, [Define to 1 if substituting Debian's libdumbnet for libdnet.]) + fi + else + 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 - GUESTD_LDFLAGS="$GUESTD_LDFLAGS $DNET_LIBS" - VMWARE_USER_LDFLAGS="$VMWARE_USER_LDFLAGS $DNET_LIBS" +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 "$with_icu" = "yes"; then + + AC_PATH_PROG([ICU_CONFIG], + [icu-config], + [no]) + + if test "$ICU_CONFIG" != no; then + ICU_CPPFLAGS="`$ICU_CONFIG --cppflags` -DUSE_ICU" + ICU_LIBS="`$ICU_CONFIG --ldflags`" + + # The icu components are built with C++, so we need to ensure + # that the C++ linker actually exists, and use it when linking + # icu into our applications and when performing configuration + # tests against icu. + # + # XXX: Getting automake to choose between the C linker and the + # C++ linker depending on HAVE_ICU was a royal pain in the ass. + # The classic way to do this is to define an optional source + # file for a program with an extension of .cxx, using + # nodist_EXTRA_fooprogram_SOURCES. This causes automake's + # linker detection algorithm to see a C++ source file and + # automatically set up the C++ linker and link line for us. + # Unfortunately, said linker detection doesn't obey + # conditionals, which means that it'd always pick the C++ + # linker, regardless of the value of HAVE_ICU. Instead, we are + # forced to manually set the correct linker in fooprogram_LINK. + # However, since none of our programs actually contain C++ + # code, automake doesn't make the CXXLINK variable (which + # contains the linker as well as all link flags) available to + # us, so we must hard-code the entire link line into + # fooprogram_LINK. Not exactly a futureproof solution... + # + # Additional references on this problem: + # http://sources.redhat.com/ml/automake/1999-10/msg00101.html + # http://lists.gnu.org/archive/html/bug-automake/2008-04/msg00010.html + # http://www.gnu.org/software/automake/manual/automake.html#Libtool-Convenience-Libraries + # http://www.gnu.org/software/automake/manual/automake.html#C_002b_002b-Support + AC_CHECK_TOOL( + [HAVE_CXX], + [$CXX]) + if test -z "$HAVE_CXX"; then + AC_MSG_ERROR( + [No C++ compiler was found on your PATH. Please configure without ICU (using --without-icu) or install a C++ compiler.]) + fi + AC_LANG_PUSH([C++]) + AC_CHECK_LIB([icuuc], + [ucasemap_utf8ToTitle_3_8], + [have_ICU_38="yes"],, + [$ICU_LIBS]) + AC_LANG_POP([C++]) + + if test "$have_ICU_38" = "yes"; then + ICU_CPPFLAGS="$ICU_CPPFLAGS -DHAVE_ICU_38" + fi + + # Easier to give all modules the ICU defines/includes... + CPPFLAGS="$CPPFLAGS $ICU_CPPFLAGS" + else + AC_MSG_ERROR( + [icu-config was not found on your PATH. Please configure without ICU (using --without-icu) or install ICU - http://www.icu-project.org]) + fi +fi + +AC_PATH_PROG( + [RPCGEN], + [rpcgen], + [ AC_MSG_ERROR([rpcgen not found. Please install the libc devel package.]) ]) + ### ### Headers ### @@ -332,7 +743,7 @@ [HAVE_WCHAR_H="yes"], [HAVE_WCHAR_H="no"]) -if test "$MULTIMON_ENABLED" != "no"; then +if test "$enable_multimon" != "no"; then AC_CHECK_HEADER( [X11/extensions/panoramiXproto.h], [], @@ -362,9 +773,6 @@ ### Specific features and OS/arch flags / actions ### -# Capture the CFLAGS, so we can restore them later. -ORIGINAL_CFLAGS="$CFLAGS" - # Check to see if SYS_setuid32 is defined. If SYS_setuid32 is unknown, we will # certainly error out. if test "$os$userSpaceBitness" = "linux32"; then @@ -385,6 +793,7 @@ # if the newer form is defined (because, in that case, we would be attempting to # remove const'ness without an explicit cast). AC_MSG_CHECKING([for the new format of iconv]) +ORIGINAL_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Werror" AC_TRY_COMPILE( [#include ], @@ -411,6 +820,7 @@ # setresuid() was wrapped beginning in glibc 2.3.2. AC_MSG_CHECKING([for setresuid]) # Ensure an error is thrown if setresuid is unknown. + ORIGINAL_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -Werror-implicit-function-declaration -Werror" AC_TRY_COMPILE( [#define _GNU_SOURCE @@ -425,156 +835,189 @@ fi ### General flags / actions -COMMON_CFLAGS="$COMMON_CFLAGS -Wall" -COMMON_CFLAGS="$COMMON_CFLAGS -Werror" +CFLAGS="$CFLAGS -Wall" +CFLAGS="$CFLAGS -Werror" # -Wno-unknown-pragmas is due to gcc not understanding '#pragma ident' in Xlib.h on OpenSolaris. for TEST_CFLAG in -Wno-pointer-sign -Wno-unused-value -fno-strict-aliasing \ -Wno-unknown-pragmas -Wno-uninitialized; do AC_MSG_CHECKING([for GCC flag $TEST_CFLAG]) + ORIGINAL_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $TEST_CFLAG" + NEW_CFLAG="" AC_TRY_COMPILE( [], [ return 0; ], - [COMMON_CFLAGS="$COMMON_CFLAGS $TEST_CFLAG" + [NEW_CFLAG=" $TEST_CFLAG" AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)]) - CFLAGS="$ORIGINAL_CFLAGS" + CFLAGS="$ORIGINAL_CFLAGS$NEW_CFLAG" done -COMMON_CFLAGS="$COMMON_CFLAGS -DVMX86_TOOLS" +CPPFLAGS="$CPPFLAGS -DVMX86_TOOLS" +CPPFLAGS="$CPPFLAGS -DNO_CORE_ICU" INCLUDE_DIR="`cd $srcdir; pwd`/lib/include" -COMMON_CFLAGS="$COMMON_CFLAGS -I$INCLUDE_DIR" +CPPFLAGS="$CPPFLAGS -I$INCLUDE_DIR" ### OS/arch-specific flags / actions MODULES="" MODULES_OS="$os" +TARGET_OS="$os" +MODULES_DIR="" buildHgfsmounter=no if test "$os" = "linux"; then - COMMON_CFLAGS="$COMMON_CFLAGS -D_FILE_OFFSET_BITS=64" - COMMON_CFLAGS="$COMMON_CFLAGS -D_LARGEFILE64_SOURCE" - COMMON_CFLAGS="$COMMON_CFLAGS -D_XOPEN_SOURCE=500" - COMMON_CFLAGS="$COMMON_CFLAGS -D_BSD_SOURCE" - COMMON_CFLAGS="$COMMON_CFLAGS -D_SVID_SOURCE" + 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" if test "$osVersion" -ge 202000; then - MODULES="$MODULES vmxnet vmmemctl" + MODULES="$MODULES vmmemctl vmxnet" fi if test "$osVersion" -ge 204000; then - MODULES="$MODULES vmhgfs vmblock" + MODULES="$MODULES vmblock vmci vmhgfs vsock" buildHgfsmounter=yes fi + if test "$osVersion" -ge 206000; then + MODULES="$MODULES vmxnet3" + fi if test "$osVersion" -ge 206006; then MODULES="$MODULES vmsync" fi fi if test "$os" = "freebsd"; then - if test "$osVersion" -gt 302000; then + MODULES_DIR="/boot/modules" + + if test "$osVersion" -ge 302000; then MODULES="$MODULES vmmemctl" fi - if test "$osVersion" -gt 409000; then + if test "$osVersion" -ge 409000; then MODULES="$MODULES vmxnet" fi - if test "$osVersion" -gt 600000; then - MODULES="$MODULES vmhgfs vmblock" + if test "$osVersion" -ge 600000; then + MODULES="$MODULES vmblock vmhgfs" buildHgfsmounter=yes fi fi if test "$os" = "solaris"; then - LIB_IMPERSONATE_CFLAGS="$LIB_IMPERSONATE_CFLAGS -D_POSIX_PTHREAD_SEMANTICS" - LIB_USER_CFLAGS="$LIB_USER_CFLAGS -D_POSIX_PTHREAD_SEMANTICS" - - GUESTD_LDFLAGS="$GUESTD_LDFLAGS -lsocket" - GUESTD_LDFLAGS="$GUESTD_LDFLAGS -lnsl" + LIB_IMPERSONATE_CPPFLAGS="$LIB_IMPERSONATE_CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS" + LIB_USER_CPPFLAGS="$LIB_USER_CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS" - VMWARE_USER_CFLAGS="$VMWARE_USER_CFLAGS -I/usr/X11/include/" - VMWARE_USER_LDFLAGS="$VMWARE_USER_LDFLAGS -lXext" - VMWARE_USER_LDFLAGS="$VMWARE_USER_LDFLAGS -lX11" - VMWARE_USER_LDFLAGS="$VMWARE_USER_LDFLAGS -lsocket" - VMWARE_USER_LDFLAGS="$VMWARE_USER_LDFLAGS -lnsl" + GUESTD_LDADD="$GUESTD_LDADD -lsocket" + GUESTD_LDADD="$GUESTD_LDADD -lnsl" + GUESTD_LDADD="$GUESTD_LDADD -lrpcsvc" + + VMWARE_USER_CPPFLAGS="$VMWARE_USER_CPPFLAGS -I/usr/X11/include/" + VMWARE_USER_LDADD="$VMWARE_USER_LDADD -lXext" + VMWARE_USER_LDADD="$VMWARE_USER_LDADD -lX11" + VMWARE_USER_LDADD="$VMWARE_USER_LDADD -lsocket" + VMWARE_USER_LDADD="$VMWARE_USER_LDADD -lnsl" + VMWARE_USER_LDADD="$VMWARE_USER_LDADD -lrpcsvc" # uname -r on Solaris 10 reports "5.10" if test "$osVersion" -ge 510000; then - COMMON_CFLAGS="$COMMON_CFLAGS -DSOL10" + CPPFLAGS="$CPPFLAGS -DSOL10" 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") 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(PAMD, test -d /etc/pam.d) +AM_CONDITIONAL(ENABLE_UNITY, test "$enable_unity" = "yes") +AM_CONDITIONAL(WITH_ROOT_PRIVILEGES, test "$with_root_privileges" = "yes") ### 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 "$MULTIMON_ENABLED" = "no"; then - AC_DEFINE([NO_MULTIMON], 1) +# 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 if test "$os$userSpaceBitness" = "linux64" || test "$HAVE_SYS_SETUID" = "yes"; then - LIB_MISC_CFLAGS="$LIB_MISC_CFLAGS -DGLIBC_VERSION_21" + LIB_MISC_CPPFLAGS="$LIB_MISC_CPPFLAGS -DGLIBC_VERSION_21" fi if test "$HAVE_NEW_ICONV" = "yes"; then - LIB_MISC_CFLAGS="$LIB_MISC_CFLAGS -DGLIBC_VERSION_22" + LIB_MISC_CPPFLAGS="$LIB_MISC_CPPFLAGS -DGLIBC_VERSION_22" fi if test "$HAVE_LSEEK" = "yes"; then - LIB_FILE_CFLAGS="$LIB_FILE_CFLAGS -DGLIBC_VERSION_21" - LIB_HGFS_SERVER_CFLAGS="$LIB_HGFS_SERVER_CFLAGS -DGLIBC_VERSION_21" + LIB_FILE_CPPFLAGS="$LIB_FILE_CPPFLAGS -DGLIBC_VERSION_21" + LIB_HGFS_SERVER_CPPFLAGS="$LIB_HGFS_SERVER_CPPFLAGS -DGLIBC_VERSION_21" fi if test "$HAVE_SETRESUID" = "yes"; then - LIB_PROC_MGR_CFLAGS="$LIB_PROC_MGR_CFLAGS -DGLIBC_VERSION_23" + LIB_PROC_MGR_CPPFLAGS="$LIB_PROC_MGR_CPPFLAGS -DGLIBC_VERSION_23" fi if test "$HAVE_CRYPT" = "yes"; then - LIB_AUTH_CFLAGS="$LIB_AUTH_CFLAGS -DGLIBC_VERSION_22" + LIB_AUTH_CPPFLAGS="$LIB_AUTH_CPPFLAGS -DGLIBC_VERSION_22" fi if test "$HAVE_WCHAR_H" = "yes"; then - LIB_STRING_CFLAGS="$LIB_STRING_CFLAGS -DGLIBC_VERSION_22" + LIB_STRING_CPPFLAGS="$LIB_STRING_CPPFLAGS -DGLIBC_VERSION_22" fi ### General substs +AC_SUBST([TARGET_OS]) +AC_SUBST([KERNEL_RELEASE]) AC_SUBST([MODULES_OS]) +AC_SUBST([MODULES_DIR]) AC_SUBST([MODULES]) -AC_SUBST([COMMON_CFLAGS]) -AC_SUBST([COMMON_PROG_CFLAGS]) AC_SUBST([COMMON_XLIBS]) -AC_SUBST([GTK_CFLAGS]) +AC_SUBST([GTK_CPPFLAGS]) AC_SUBST([GTK_LIBS]) -AC_SUBST([DNET_CFLAGS]) +AC_SUBST([DNET_CPPFLAGS]) AC_SUBST([DNET_LIBS]) +AC_SUBST([PROCPS_LIBS]) +AC_SUBST([ICU_CPPFLAGS]) +AC_SUBST([ICU_LIBS]) +AC_SUBST([PAM_PREFIX]) +AC_SUBST([URIPARSER_CPPFLAGS]) +AC_SUBST([URIPARSER_LIBS]) +AC_SUBST([LIBPNG_CPPFLAGS]) +AC_SUBST([LIBPNG_LIBS]) +AC_SUBST([ZLIB_CPPFLAGS]) +AC_SUBST([ZLIB_LIBS]) ### Lib substs -AC_SUBST([LIB_AUTH_CFLAGS]) -AC_SUBST([LIB_FILE_CFLAGS]) -AC_SUBST([LIB_HGFS_SERVER_CFLAGS]) -AC_SUBST([LIB_IMPERSONATE_CFLAGS]) -AC_SUBST([LIB_MISC_CFLAGS]) -AC_SUBST([LIB_PROC_MGR_CFLAGS]) -AC_SUBST([LIB_STRING_CFLAGS]) -AC_SUBST([LIB_USER_CFLAGS]) +AC_SUBST([LIB_AUTH_CPPFLAGS]) +AC_SUBST([LIB_FILE_CPPFLAGS]) +AC_SUBST([LIB_HGFS_SERVER_CPPFLAGS]) +AC_SUBST([LIB_IMPERSONATE_CPPFLAGS]) +AC_SUBST([LIB_MISC_CPPFLAGS]) +AC_SUBST([LIB_PROC_MGR_CPPFLAGS]) +AC_SUBST([LIB_STRING_CPPFLAGS]) +AC_SUBST([LIB_USER_CPPFLAGS]) ### Program substs -AC_SUBST([GUESTD_LDFLAGS]) +AC_SUBST([GUESTD_LDADD]) -AC_SUBST([VMWARE_USER_CFLAGS]) -AC_SUBST([VMWARE_USER_LDFLAGS]) +AC_SUBST([VMWARE_USER_CPPFLAGS]) +AC_SUBST([VMWARE_USER_LDADD]) ### ### Create the Makefiles @@ -582,27 +1025,30 @@ AC_CONFIG_FILES([ \ Makefile \ lib/Makefile \ - lib/atomic/Makefile \ - lib/atomic/shared/Makefile \ + lib/appUtil/Makefile \ lib/auth/Makefile \ lib/backdoor/Makefile \ lib/backdoor/shared/Makefile \ lib/conf/Makefile \ lib/dict/Makefile \ lib/dnd/Makefile \ + lib/dynxdr/Makefile \ lib/err/Makefile \ lib/eventManager/Makefile \ lib/file/Makefile \ - lib/fileUtf8/Makefile \ lib/foundryMsg/Makefile \ + lib/ghIntegration/Makefile \ + lib/ghIntegrationStub/Makefile \ lib/guestApp/Makefile \ lib/guestInfo/Makefile \ + lib/guestRpc/Makefile \ lib/hgfs/Makefile \ lib/hgfsBd/Makefile \ lib/hgfsServer/Makefile \ lib/hgfsServerManagerGuest/Makefile \ lib/hgfsServerPolicyGuest/Makefile \ lib/deployPkg/Makefile \ + lib/image/Makefile \ lib/impersonate/Makefile \ lib/message/Makefile \ lib/message/shared/Makefile \ @@ -613,21 +1059,28 @@ lib/panicDefault/Makefile \ lib/printer/Makefile \ lib/procMgr/Makefile \ + lib/raster/Makefile \ + lib/region/Makefile \ + lib/resolution/Makefile \ lib/rpcIn/Makefile \ lib/rpcOut/Makefile \ lib/rpcOut/shared/Makefile \ lib/rpcVmx/Makefile \ lib/SLPv2Parser/Makefile \ lib/socketMgr/Makefile \ - lib/strUtil/Makefile \ lib/string/Makefile \ lib/string/shared/Makefile \ + lib/stubs/Makefile \ + lib/stubs/shared/Makefile \ lib/sync/Makefile \ lib/sync/shared/Makefile \ lib/syncDriver/Makefile \ lib/system/Makefile \ lib/toolsLogger/Makefile \ lib/unicode/Makefile \ + lib/unity/Makefile \ + lib/unityStub/Makefile \ + lib/unityWindowTracker/Makefile \ lib/user/Makefile \ lib/vixTools/Makefile \ lib/vmBackupLib/Makefile \ @@ -636,6 +1089,7 @@ lib/wiper/Makefile \ guestd/Makefile \ vmware-user/Makefile \ + vmware-user-suid-wrapper/Makefile \ toolbox/Makefile \ hgfsclient/Makefile \ hgfsmounter/Makefile \ @@ -643,6 +1097,7 @@ libguestlib/Makefile \ xferlogs/Makefile \ modules/Makefile \ + scripts/Makefile \ ]) ### diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/debian/changelog /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/debian/changelog --- open-vm-tools-2008.01.23-74039/debian/changelog 2008-11-20 23:36:10.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/debian/changelog 2008-11-20 23:36:11.000000000 +0000 @@ -1,13 +1,215 @@ -open-vm-tools (2008.01.23-74039-0ubuntu1) hardy; urgency=low +open-vm-tools (2008.10.10-123053-3~ppa2-hardy1) hardy; urgency=medium - * New upstream release + * Backport for Hardy: revert to debhelper 6 and removed dh_lintian. - -- Soren Hansen Wed, 13 Feb 2008 13:41:25 +0100 + -- Lowell Alleman Thu, 20 Nov 2008 18:55:55 +0000 -open-vm-tools (2007.11.21-64693-0ubuntu1) hardy; urgency=low +open-vm-tools (2008.10.10-123053-2) unstable; urgency=medium - * Initial release. Many thanks to Meethune Bhowmick for - helping out! + * Correcting typo in dh_installinit call. + * Downgrading depends on module-assistant to recommends. - -- Soren Hansen Thu, 29 Nov 2007 17:12:28 +0100 + -- Daniel Baumann Thu, 23 Oct 2008 15:32:00 +0200 +open-vm-tools (2008.10.10-123053-1) unstable; urgency=low + + * Using patch-stamp rather than patch in rules file. + * Merging upstream version 2008.10.10-123053. + * Updating kvers.dpatch. + + -- Daniel Baumann Thu, 16 Oct 2008 19:05:00 +0200 + +open-vm-tools (2008.09.03-114782-2) unstable; urgency=low + + * Updating kvers.dpatch (Closes: #498620). + * Updating initscript to correctly handle vmxnet (Closes: #479090, #488810). + + -- Daniel Baumann Sun, 14 Sep 2008 14:30:00 +0200 + +open-vm-tools (2008.09.03-114782-1) unstable; urgency=low + + * Merging upstream version 2008.09.03-114782. + * Updating rules to new location of the config.guess and config.sub files. + * Updating vcs fields in control file. + + -- Daniel Baumann Tue, 9 Sep 2008 22:06:00 +0200 + +open-vm-tools (2008.08.08-109361-1) unstable; urgency=low + + * Removing destdir.dpatch, not needed anymore. + * Adjusting rules to upstream changes with respect to the pixmap files. + * Disabling unity, uiparser is too old (see #493073). + * Adding build-depends to liburiparser-dev for new unity feature. + * Adding build-depends to libxss-dev for new unity feature. + * Updating to add new vmci and vsock modules. + * Merging upstream version 2008.08.08-109361. + + -- Daniel Baumann Mon, 11 Aug 2008 15:56:00 +0200 + +open-vm-tools (2008.07.01-102166-3) unstable; urgency=medium + + * Replacing /lib64 with /lib in /etc/pam.d/vmware-guestd-x64. + * Fixing FTBFS on amd64 by renaming /etc/pam.d/vmware-guestd-x64 to + /etc/pam.d/vmware-guestd. + + -- Daniel Baumann Thu, 10 Jul 2008 23:24:00 +0200 + +open-vm-tools (2008.07.01-102166-2) unstable; urgency=medium + + * Adding manpages. + * Stop removing setuid from /sbin/mount.vmhgfs. + * Extending vmxnet_needed() in initscript to also check for availability of + vmxnet.ko for the running kernel, otherwise don't attempt to load vmxnet + (Closes: #488810). + * Adding suggests to xdg-utils in open-vm-toolbox. + * Using modprobe -r rather than rmmod in initscript. + * Starting initscript at position 20, which is before networking comes up + (Closes: #479090). + * Adding vmware-user symlink to xdg autostart. + * Adding symlink from mount.vmhgfs to old vmware-hgfsmounter name. + * Removing executable bit for /etc/pam.d/vmware-guestd file. + + -- Daniel Baumann Fri, 4 Jul 2008 09:59:00 +0200 + +open-vm-tools (2008.07.01-102166-1) unstable; urgency=low + + * Merging upstream version 2008.07.01-102166. + + -- Daniel Baumann Thu, 3 Jul 2008 13:01:00 +0200 + +open-vm-tools (2008.06.20-100027-1) unstable; urgency=low + + * Dropping autobuild patch in favour for upstreams new --without- + kernel-modules configure switch. + * Merging upstream version 2008.06.20-100027. + + -- Daniel Baumann Tue, 1 Jul 2008 22:22:00 +0200 + +open-vm-tools (2008.06.03-96374-2) unstable; urgency=medium + + * Adding debug package. + * Splitting open-vm-tools into open-vm-tools (CLI tools) and open-vm- + toolbox (GUI tools) (Closes: #467042). + + -- Daniel Baumann Fri, 20 Jun 2008 14:51:00 +0200 + +open-vm-tools (2008.06.03-96374-1) unstable; urgency=medium + + * Updating rules file for upstream version 2008.06.03-96374. + * Adding patch to make build-system respect again. + * Adding xauth to recommends of open-vm-tools (Closes: #487088). + * Adding patch to avoid building kernel modules in this new upstream version. + * Merging upstream version 2008.06.03-96374 (Closes: #484242). + * Updating to standards 3.8.0. + + -- Daniel Baumann Fri, 20 Jun 2008 14:12:00 +0200 + +open-vm-tools (2008.05.15-93241-2) unstable; urgency=medium + + * Updating location of vmware-checkvm in init script (Closes: #483056). + * Correcting typo in mount.vmhgfs symlink (Closes: #474694). + + -- Daniel Baumann Tue, 27 May 2008 07:29:00 +0200 + +open-vm-tools (2008.05.15-93241-1) unstable; urgency=medium + + * Moving mount.vmhgfs from /usr/sbin to /sbin, thanks to Lea Wiemann + (Closes: #474694). + * Also loading and unloading vmsync module in init script, thanks to + Lea Wiemann (Closes: #481001). + * Moving vmware-checkvm from /usr/sbin to /usr/bin, thanks to Lea + Wiemann (Closes: #481004). + * Using lintian debhelper to install lintian overrides. + * Correcting manpage section of module-assistant in README.Debian. + * Removing debian todo file. + * Merging upstream version 2008.05.15-93241. + + -- Daniel Baumann Wed, 21 May 2008 09:15:00 +0200 + +open-vm-tools (2008.05.02-90473-1) unstable; urgency=low + + * Adding libicu-dev to build-depends. + * Merging upstream version 2008.05.02-90473. + + -- Daniel Baumann Sat, 3 May 2008 09:44:00 +0200 + +open-vm-tools (2008.04.14-87182-1) unstable; urgency=medium + + * Correcting wrong email address in changelog file. + * Including vmware support scripts (Closes: #469160). + * Correcting symlink for vmware-hgfsmounter (Closes: #474694). + * Updating rules to cover new component xferlogs. + * Adding libdumbnet-dev to build-depends. + * Adding libproc-dev to build-depends. + * Merging upstream version 2008.04.14-87182. + * Adding open-vm-source to open-vm-tools recommends (Closes: #471784). + * Adding zerofree to open-vm-tools suggests, thanks to Thibaut Paumard + (Closes: #472799). + * Updating vcs fields in control. + * Updating package to debhelper 7. + + -- Daniel Baumann Sat, 26 Apr 2008 13:40:00 +0200 + +open-vm-tools (2008.02.13-77928-2) unstable; urgency=medium + + * Rewriting copyright in machine-interpretable format. + * Cleaned up copyright. + * Fixing pathes and binary names in init script (Closes: #469146). + + -- Daniel Baumann Sat, 8 Mar 2008 08:48:00 +0100 + +open-vm-tools (2008.02.13-77928-1) unstable; urgency=low + + * Adding upstream version 2008.02.13-77928. + + -- Daniel Baumann Sun, 24 Feb 2008 20:41:00 +0100 + +open-vm-tools (2008.01.23-74039-2) unstable; urgency=low + + * Adding vcs fields in control. + * Removing watch file. + * Correcting wrong manpage section of module-assistant in + README.Debian. + * Correcting wrong filename of module-source tarball in README.Debian. + * Updating formating of README.Debian. + * Removing config.guess and config.sub from the debian diff. + * Reverting config.guess and config.sub to upstream. + * Adding vmware-guestd init script (Closes: #465276). + + -- Daniel Baumann Sun, 24 Feb 2008 20:20:00 +0100 + +open-vm-tools (2008.01.23-74039-1) unstable; urgency=low + + * New upstream release. + * Fixing manpage section in README.Debian. + * Bumping package to debhelper 6. + * Bumping package to policy 3.7.3. + * Also removing user/ in clean target of rules. + + -- Daniel Baumann Wed, 30 Jan 2008 15:24:00 +0100 + +open-vm-tools (2007.11.21-64693-2) unstable; urgency=low + + * Adding open-vm-source package for module source. + * Upload to unstable. + + -- Daniel Baumann Mon, 26 Nov 2007 11:08:00 +0100 + +open-vm-tools (2007.11.21-64693-1) experimental; urgency=low + + * New upstream release. + + -- Daniel Baumann Mon, 26 Nov 2007 11:07:00 +0100 + +open-vm-tools (2007.09.04-56574-2) experimental; urgency=low + + * Moving package to contrib (Closes: #445439). + * Limiting architectures to amd64 and i386 (Closes: #445374). + + -- Daniel Baumann Tue, 9 Oct 2007 10:05:00 +0200 + +open-vm-tools (2007.09.04-56574-1) experimental; urgency=low + + * Initial release (Closes: #441905). + + -- Daniel Baumann Sun, 9 Sep 2007 16:53:00 +0200 diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/debian/checkvm.1 /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/debian/checkvm.1 --- open-vm-tools-2008.01.23-74039/debian/checkvm.1 2008-11-20 23:36:10.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/debian/checkvm.1 1970-01-01 01:00:00.000000000 +0100 @@ -1,27 +0,0 @@ -.TH CHECKVM 1 "Sep 2007" -.SH NAME -checkvm \- check which version of VMWare you're running in -.SH SYNOPSIS -.B checkvm -.RI [ -rph ] " -.SH DESCRIPTION -This manual page documents briefly the -.B checkvm -command. -.B checkvm -is a program that can tell you if you're running in a VMWare VM and if so, give you information about the VM. -.SH OPTIONS -.TP -.B \-r -Show dimensions of screen -.TP -.B \-p -Show which product you're running in -.TP -.B \-h -Show virtual hardware version of VM -.SH AUTHOR -checkvm is part of VMWare's open-vm-tools. -.PP -This manual page was written by Soren Hansen , -for Ubuntu (but may be used by others). diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/debian/compat /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/debian/compat --- open-vm-tools-2008.01.23-74039/debian/compat 2008-11-20 23:36:10.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/debian/compat 2008-11-20 23:36:11.000000000 +0000 @@ -1 +1 @@ -5 +6 diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/debian/config/vmware-guestd /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/debian/config/vmware-guestd --- open-vm-tools-2008.01.23-74039/debian/config/vmware-guestd 2008-11-20 23:36:10.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/debian/config/vmware-guestd 1970-01-01 01:00:00.000000000 +0100 @@ -1,6 +0,0 @@ -#%PAM-1.0 - -auth sufficient pam_unix2.so shadow nullok -auth required pam_unix_auth.so shadow nullok -account sufficient pam_unix2.so -account required pam_unix_acct.so diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/debian/config/vmware-user.desktop /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/debian/config/vmware-user.desktop --- open-vm-tools-2008.01.23-74039/debian/config/vmware-user.desktop 2008-11-20 23:36:10.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/debian/config/vmware-user.desktop 1970-01-01 01:00:00.000000000 +0100 @@ -1,5 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Exec=vmware-user -Name=VMware User Agent -X-KDE-autostart-phase=1 diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/debian/control /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/debian/control --- open-vm-tools-2008.01.23-74039/debian/control 2008-11-20 23:36:10.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/debian/control 2008-11-20 23:36:11.000000000 +0000 @@ -1,39 +1,64 @@ Source: open-vm-tools -Section: utils +Section: contrib/admin Priority: extra -Maintainer: Ubuntu MOTU Developers -Build-Depends: debhelper (>= 5), quilt, libtool, automake1.10, autotools-dev, libxrandr-dev, libxinerama-dev, libxtst-dev, libgtk2.0-dev -Standards-Version: 3.7.2 +Maintainer: Daniel Baumann +Build-Depends: debhelper (>= 6), autotools-dev, dpatch, bzip2, libdumbnet-dev, libgtk2.0-dev, libicu-dev, libpam0g-dev, libproc-dev, liburiparser-dev, libx11-dev, libxinerama-dev, libxss-dev, libxtst-dev +Standards-Version: 3.8.0 +Homepage: http://open-vm-tools.sourceforge.net/ +Vcs-Browser: http://git.debian.net/?p=debian/open-vm-tools.git +Vcs-Git: git://git.debian.net/git/debian/open-vm-tools.git Package: open-vm-tools -Architecture: i386 amd64 -Depends: ${shlibs:Depends}, lsb-base (>= 3.0-6) -Description: VMWare guest tools (non-GUI parts) - The open-vm-tools are a subset of the VMware Tools, currently composed of - kernel modules for Linux and user-space programs for all VMware supported - Unix like guest operating systems. +Architecture: amd64 i386 +Depends: ${shlibs:Depends}, ${misc:Depends} +Recommends: open-vm-source, ethtool, zerofree +Suggests: open-vm-toolbox +Description: tools and components for VMware guest systems (CLI tools) + The Open Virtual Machine Tools (open-vm-tools) are the open source + implementation of VMware Tools. They are a set of guest operating system + virtualization components that enhance performance and user experience of + virtual machines. . - This package contains the non-GUI parts of open-vm-tools. + As virtualization technology rapidly becomes mainstream, each virtualization + solution provider implements their own set of tools and utilities to supplement + the guest virtual machine. However, most of the implementations are proprietary + and are tied to a specific virtualization platform. -Package: open-vm-tools-gui -Architecture: i386 amd64 -Depends: ${shlibs:Depends}, open-vm-tools (= ${binary:Version}) -Suggests: xserver-xorg-input-vmmouse, xserver-xorg-video-vmware -Description: VMWare guest tools - The open-vm-tools are a subset of the VMware Tools, currently composed of - kernel modules for Linux and user-space programs for all VMware supported - Unix like guest operating systems. +Package: open-vm-toolbox +Architecture: amd64 i386 +Depends: ${shlibs:Depends}, ${misc:Depends}, open-vm-tools (= ${binary:Version}) +Recommends: open-vm-source, xauth, xserver-xorg-input-vmmouse, xserver-xorg-video-vmware +Suggests: xdg-utils +Description: tools and components for VMware guest systems (GUI tools) + The Open Virtual Machine Tools (open-vm-tools) are the open source + implementation of VMware Tools. They are a set of guest operating system + virtualization components that enhance performance and user experience of + virtual machines. . - This package contains the GUI parts of open-vm-tools. + As virtualization technology rapidly becomes mainstream, each virtualization + solution provider implements their own set of tools and utilities to supplement + the guest virtual machine. However, most of the implementations are proprietary + and are tied to a specific virtualization platform. + +Package: open-vm-tools-dbg +Section: contrib/devel +Priority: extra +Architecture: amd64 i386 +Depends: open-vm-tools (= ${binary:Version}), open-vm-toolbox (= ${binary:Version}) +Description: tools and components for VMware guest systems (debug) + The Open Virtual Machine Tools (open-vm-tools) are the open source + implementation of VMware Tools. They are a set of guest operating system + virtualization components that enhance performance and user experience of + virtual machines. + . + This package contains the debugging symbols. Package: open-vm-source Architecture: all -Depends: debhelper (>>4.0.0), make, bzip2 -Suggests: module-assistant, kernel-package, linux-headers | linux-source -Enhances: open-vm-tools -Description: Source for the open-vm drivers +Depends: debhelper (>= 6), dpatch, make, bzip2 +Recommends: module-assistant, open-vm-tools +Suggests: open-vm-toolbox +Description: Source for VMware guest systems driver This package provides the source code for the open-vm kernel modules. The open-vm-tools package is also required in order to make use of these modules. Kernel source or headers are required to compile these modules. - . - NOT needed for Ubuntu systems. diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/debian/control.modules.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/debian/control.modules.in --- open-vm-tools-2008.01.23-74039/debian/control.modules.in 2008-11-20 23:36:10.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/debian/control.modules.in 2008-11-20 23:36:11.000000000 +0000 @@ -1,20 +1,24 @@ Source: open-vm-tools -Section: utils +Section: contrib/admin Priority: extra -Maintainer: Baruch Even -Build-Depends: debhelper (>= 5) -Standards-Version: 3.7.2 +Maintainer: Daniel Baumann +Build-Depends: debhelper (>= 6) +Standards-Version: 3.7.3 +Homepage: http://open-vm-tools.sourceforge.net/ +Vcs-Browser: http://git.debian.net/?p=open-vm-tools.git +Vcs-Git: git://git.debian.net/git/open-vm-tools.git Package: open-vm-modules-_KVERS_ Architecture: any Provides: open-vm-modules +Depends: linux-modules-_KVERS_ | linux-image-_KVERS_ Description: open-vm modules for Linux (kernel _KVERS_). - This package contains the set of loadable kernel modules for - open-vm-tools. + This package contains the set of loadable kernel modules for the + VMware guest systems driver. . This package contains the compiled kernel modules for _KVERS_ . If you have compiled your own kernel, you will most likely need to build your own open-vm-modules. The open-vm-source package has been provided for use with the Debian's module-assistant or kernel-package - utilities to produce a version of open-vm-module for your kernel. + utilities to produce a version of open-vm-modules for your kernel. diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/debian/copyright /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/debian/copyright --- open-vm-tools-2008.01.23-74039/debian/copyright 2008-11-20 23:36:10.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/debian/copyright 2008-11-20 23:36:11.000000000 +0000 @@ -1,111 +1,154 @@ -This package was debianized by Soren Hansen on -Wed, 12 Sep 2007 14:56:50 +0200. +Author: VMware, Inc. +Download: http://open-vm-tools.sourceforge.net/ -It was downloaded from http://sourceforge.net/project/showfiles.php?group_id=204462 +Files: * +Copyright: (C) VMware, Inc. +License: GPL-2.1 + 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; version 2.1 of the License. + . + 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 St, Fifth Floor, Boston, MA 02110-1301 USA + +On Debian systems, the complete text of the GNU Lesser General Public License +can be found in /usr/share/common-licenses/LGPL-2.1 file. + +Files: */Makefile*, modules/* +Copyright: (C) VMware, Inc. +License: GPL-2 + 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; version 2 of the License. + . + 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 + +On Debian systems, the complete text of the GNU General Public License +can be found in /usr/share/common-licenses/GPL-2 file. + +Files: lib/include/bsd*, lib/string/bsd* +Copyright: (C) 1990, 1993 The Regents of the University of California. +License: BSD-3 + 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. + . + 4. Neither the name of the University nor the names of its contributors may be + used to endorse or promote products derived from this software without + specific prior written permission. + . + 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. + +Files: lib/misc/base64.c +Copyright: (C) 1996, 1998 Internet Software Consortium +License: MIT + Permission to use, copy, modify, and distribute this software for any purpose + with or without fee is hereby granted, provided that the above copyright notice + and this permission notice appear in all copies. + . + THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS ALL + WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE CONSORTIUM BE + LIABLE FOR ANY SPECIAL, DIRECT, 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. + . + Portions Copyright (C) 1995 International Business Machines, Inc. + . + International Business Machines, Inc. (hereinafter called IBM) grants + permission under its copyrights to use, copy, modify, and distribute this + Software with or without fee, provided that the above copyright notice and all + paragraphs of this notice appear in all copies, and that the name of IBM not be + used in connection with the marketing of any product incorporating the Software + or modifications thereof, without specific, written prior permission. + . + To the extent it has a right to do so, IBM grants an immunity from suit under + its patents, if any, for the use, sale or manufacture of products to the extent + that such products are used for performing Domain Name System dynamic updates + in TCP/IP networks by means of the Software. No immunity is granted for any + product per se or for any other function of any product. + . + THE SOFTWARE IS PROVIDED "AS IS", AND IBM DISCLAIMS ALL WARRANTIES, INCLUDING + ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. + IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR + CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER ARISING OUT OF OR IN CONNECTION + WITH THE USE OR PERFORMANCE OF THIS SOFTWARE, EVEN IF IBM IS APPRISED OF THE + POSSIBILITY OF SUCH DAMAGES. + +Files: + vmware-user/libvmwarectrl.h + vmware-user/vmwarectrlproto.h + vmware-user/vmwarectrl.h,libvmwarectrl.c + vmware-user/libvmwarectrl.c +Copyright: (C) 2006 VMware, Inc. +License: MIT + 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 + COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + . + Except as contained in this notice, the name of the copyright holder(s) and + author(s) shall not be used in advertising or otherwise to promote the sale, + use or other dealings in this Software without prior written authorization from + the copyright holder(s) and author(s). + +Files: debian/* +Copyright: (C) 2007-2008 Daniel Baumann +License: GPL-2+ + This program is free software; you can redistribute it and/or modify it under + the terms of the GNU General Public License as published by the Free Software + Foundation; either version 2 of the License, or (at your option) any later + version. + . + This program is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A + PARTICULAR PURPOSE. See the GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License along with + this program; if not, write to the Free Software Foundation, Inc., 51 Franklin + St, Fifth Floor, Boston, MA 02110-1301 USA -The kernel modules (i.e. everything beneath modules/) are -Copyright (C) 2002-2007 VMware, Inc. and covered by the following -license: - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -For the full license, see '/usr/share/common-licenses/GPL-2'. - -These files: - lib/string/bsd_vsnprintf.c - lib/string/bsd_output_shared.c - lib/string/bsd_vsnwprintf.c - -are Copyright (c) 1990, 1993 The Regents of the University of California, -and released under the following license: - - 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. - 4. Neither the name of the University nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - - 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. - - -These files: - vmware-user/libvmwarectrl.c - vmware-user/libvmwarectrl.h - vmware-user/vmwarectrl.h - vmware-user/vmwarectrlproto.h - - are Copyright 2006 by VMware, Inc. and released under the following license: - - 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - OTHER DEALINGS IN THE SOFTWARE. - - Except as contained in this notice, the name of the copyright holder(s) - and author(s) shall not be used in advertising or otherwise to promote - the sale, use or other dealings in this Software without prior written - authorization from the copyright holder(s) and author(s). - - -Everything else is copyright (C) 2002-2007 VMware, Inc. and covered by -the following license: - - 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 - -For the full license, see '/usr/share/common-licenses/LGPL-2.1'. - -The Debian packaging is (C) 2007, Soren Hansen and -is licensed under the GPL, see `/usr/share/common-licenses/GPL'. +On Debian systems, the complete text of the GNU General Public License +can be found in /usr/share/common-licenses/GPL-2 file. diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/debian/Makefile /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/debian/Makefile --- open-vm-tools-2008.01.23-74039/debian/Makefile 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/debian/Makefile 2008-11-20 23:36:11.000000000 +0000 @@ -0,0 +1,21 @@ +all: build + +build: + $(MAKE) -C modules/linux/vmblock + $(MAKE) -C modules/linux/vmci + $(MAKE) -C modules/linux/vmhgfs + $(MAKE) -C modules/linux/vmmemctl + $(MAKE) -C modules/linux/vmsync + $(MAKE) -C modules/linux/vmxnet + $(MAKE) -C modules/linux/vsock + +clean: + $(MAKE) -C modules/linux/vmblock clean + $(MAKE) -C modules/linux/vmci clean + $(MAKE) -C modules/linux/vmhgfs clean + $(MAKE) -C modules/linux/vmmemctl clean + $(MAKE) -C modules/linux/vmsync clean + $(MAKE) -C modules/linux/vmxnet clean + $(MAKE) -C modules/linux/vsock clean + +distclean: clean diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/debian/manpage/vmblock.9 /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/debian/manpage/vmblock.9 --- open-vm-tools-2008.01.23-74039/debian/manpage/vmblock.9 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/debian/manpage/vmblock.9 2008-11-20 23:36:11.000000000 +0000 @@ -0,0 +1,52 @@ +.TH VMBLOCK 9 "2008\-07\-04" "2008.07.01\-102166" "Open VM Tools" + +.SH NAME +vmblock \- vmware kernel module + +.SH SYNOPSIS +modprobe vmblock + +.SH DESCRIPTION +This is a kernel filesystem module. Ideally, it should be loaded before any of the Tools userlevel components are allowed to start, though vmblock itself has no dependencies. When loaded, vmblock will establish itself in /proc/fs/vmblock and create two nodes therein, dev and mountPoint. Before mounting a vmblock filesystem, ensure that /tmp/VMwareDnD exists as a directory with permissions 1777, otherwise host to guest drag n' drop operations won't work. +.PP +To mount, issue: +.PP + mount \-t vmblock none /proc/fs/vmblock/mountPoint +.PP +Once mounted, \fIvmware\-user\fR(1) can begin to make use of vmblock to assist with DnD operations. Note that while \fIvmware\-user\fR(1) is running, it'll keep an open file descriptor on /proc/fs/vmblock/dev, and thus all \fIvmware\-user\fR(1) instances must be killed to unmount and unload vmblock. + +.SH OPTIONS +vmblock has no options. + +.SH SEE ALSO +\fIvmware\-checkvm\fR(1) +.br +\fIvmware\-hgfsclient\fR(1) +.br +\fIvmware\-toolbox\fR(1) +.br +\fIvmware\-user\fR(1) +.br +\fIvmware\-xferlogs\fR(1) +.br +\fIvmware\-guestd\fR(8) +.br +\fIvmware\-hgfsmounter\fR(8) +.br +\fIvmware\-user\-suid\-wrapper\fR(8) +.br +\fIvmhgfs\fR(9) +.br +\fIvmmemctl\fR(9) +.br +\fIvmsync\fR(9) +.br +\fIvmxnet\fR(9) + +.SH HOMEPAGE +More information about vmblock and the Open VM Tools can be found at <\fIhttp://open\-vm\-tools.sourceforge.net/\fR>. + +.SH AUTHOR +Open VM Tools were written by VMware, Inc. <\fIhttp://www.vmware.com/\fR>. +.PP +This manual page was put together from homepage materials by Daniel Baumann <\fIdaniel@debian.org\fR>, for the Debian project (but may be used by others). diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/debian/manpage/vmhgfs.9 /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/debian/manpage/vmhgfs.9 --- open-vm-tools-2008.01.23-74039/debian/manpage/vmhgfs.9 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/debian/manpage/vmhgfs.9 2008-11-20 23:36:11.000000000 +0000 @@ -0,0 +1,58 @@ +.TH VMHGFS 9 "2008\-07\-04" "2008.07.01\-102166" "Open VM Tools" + +.SH NAME +vmhgfs \- vmware kernel module + +.SH SYNOPSIS +modprobe vmhgfs + +.SH DESCRIPTION +This is kernel filesystem module. None of the Tools components depend on vmhgfs, nor does it have any dependencies of its own, so it can be loaded at any time in the boot process. +.PP +When mounting, one must use an NFS\-like ":" syntax. The field must be ".host", while the field can be "/", a path to a specific Shared Folder, or a path to a subdirectory within that Shared Folder. Note that mounting may fail if Shared Folders are disabled in the host; don't be alarmed. The vmhgfs filesystem supports a plethora of mount options, run \fIvmware\-hgfsmounter\fR(8) \-h to see them. We typically exclude vmhgfs from the locate database as crawling the Shared Folders is time consuming. To do this, add "vmhgfs" to PRUNEFS within updatedb's configuration file, typically found in /etc/updatedb.conf. +.PP +We also typically mount vmhgfs via: +.PP + mount \-t vmhgfs .host:/ /mnt/hgfs +.PP +Or by adding this line to /etc/fstab: +.PP + host:/ /mnt/hgfs vmhgfs defaults 0 0 +.PP +The net effect is that all Shared Folders appear and disappear at /mnt/hgfs as they're added or removed. + +.SH OPTIONS +vmhgfs has no options. + +.SH SEE ALSO +\fIvmware\-checkvm\fR(1) +.br +\fIvmware\-hgfsclient\fR(1) +.br +\fIvmware\-toolbox\fR(1) +.br +\fIvmware\-user\fR(1) +.br +\fIvmware\-xferlogs\fR(1) +.br +\fIvmware\-guestd\fR(8) +.br +\fIvmware\-hgfsmounter\fR(8) +.br +\fIvmware\-user\-suid\-wrapper\fR(8) +.br +\fIvmblock\fR(9) +.br +\fIvmmemctl\fR(9) +.br +\fIvmsync\fR(9) +.br +\fIvmxnet\fR(9) + +.SH HOMEPAGE +More information about vmhgfs and the Open VM Tools can be found at <\fIhttp://open\-vm\-tools.sourceforge.net/\fR>. + +.SH AUTHOR +Open VM Tools were written by VMware, Inc. <\fIhttp://www.vmware.com/\fR>. +.PP +This manual page was put together from homepage materials by Daniel Baumann <\fIdaniel@debian.org\fR>, for the Debian project (but may be used by others). diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/debian/manpage/vmmemctl.9 /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/debian/manpage/vmmemctl.9 --- open-vm-tools-2008.01.23-74039/debian/manpage/vmmemctl.9 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/debian/manpage/vmmemctl.9 2008-11-20 23:36:11.000000000 +0000 @@ -0,0 +1,46 @@ +.TH VMMEMCTL 9 "2008\-07\-04" "2008.07.01\-102166" "Open VM Tools" + +.SH NAME +vmmemctl \- vmware kernel module + +.SH SYNOPSIS +modprobe vmmemctl + +.SH DESCRIPTION +This is a kernel module. It isn't backed by a virtual hardware device, so it must be loaded manually. It has no dependencies, nor do any Tools components depend on it, so it can be loaded at any time during the boot process. Once loaded, no further action is needed. + +.SH OPTIONS +vmmemctl has no options. + +.SH SEE ALSO +\fIvmware\-checkvm\fR(1) +.br +\fIvmware\-hgfsclient\fR(1) +.br +\fIvmware\-toolbox\fR(1) +.br +\fIvmware\-user\fR(1) +.br +\fIvmware\-xferlogs\fR(1) +.br +\fIvmware\-guestd\fR(8) +.br +\fIvmware\-hgfsmounter\fR(8) +.br +\fIvmware\-user\-suid\-wrapper\fR(8) +.br +\fIvmblock\fR(9) +.br +\fIvmhgfs\fR(9) +.br +\fIvmsync\fR(9) +.br +\fIvmxnet\fR(9) + +.SH HOMEPAGE +More information about vmmemctl and the Open VM Tools can be found at <\fIhttp://open\-vm\-tools.sourceforge.net/\fR>. + +.SH AUTHOR +Open VM Tools were written by VMware, Inc. <\fIhttp://www.vmware.com/\fR>. +.PP +This manual page was put together from homepage materials by Daniel Baumann <\fIdaniel@debian.org\fR>, for the Debian project (but may be used by others). diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/debian/manpage/vmsync.9 /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/debian/manpage/vmsync.9 --- open-vm-tools-2008.01.23-74039/debian/manpage/vmsync.9 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/debian/manpage/vmsync.9 2008-11-20 23:36:11.000000000 +0000 @@ -0,0 +1,46 @@ +.TH VMSYMC 9 "2008\-07\-04" "2008.07.01\-102166" "Open VM Tools" + +.SH NAME +vmsync \- vmware kernel module + +.SH SYNOPSIS +modprobe vmsync + +.SH DESCRIPTION +This is a Linux kernel module. It isn't backed by a virtual hardware device, so it must be loaded manually. It is depended on by \fIvmware\-guestd\fR(8), so ideally it should be loaded prior to starting \fIvmware\-guestd\fR(8) (though \fIvmware\-guestd\fR(8) can function without it). This module is used for freezing and thawing the filesystem. + +.SH OPTIONS +vmsync has no options. + +.SH SEE ALSO +\fIvmware\-checkvm\fR(1) +.br +\fIvmware\-hgfsclient\fR(1) +.br +\fIvmware\-toolbox\fR(1) +.br +\fIvmware\-user\fR(1) +.br +\fIvmware\-xferlogs\fR(1) +.br +\fIvmware\-guestd\fR(8) +.br +\fIvmware\-hgfsmounter\fR(8) +.br +\fIvmware\-user\-suid\-wrapper\fR(8) +.br +\fIvmblock\fR(9) +.br +\fIvmhgfs\fR(9) +.br +\fIvmmemctl\fR(9) +.br +\fIvmxnet\fR(9) + +.SH HOMEPAGE +More information about vmsync and the Open VM Tools can be found at <\fIhttp://open\-vm\-tools.sourceforge.net/\fR>. + +.SH AUTHOR +Open VM Tools were written by VMware, Inc. <\fIhttp://www.vmware.com/\fR>. +.PP +This manual page was put together from homepage materials by Daniel Baumann <\fIdaniel@debian.org\fR>, for the Debian project (but may be used by others). diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/debian/manpage/vmware-checkvm.1 /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/debian/manpage/vmware-checkvm.1 --- open-vm-tools-2008.01.23-74039/debian/manpage/vmware-checkvm.1 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/debian/manpage/vmware-checkvm.1 2008-11-20 23:36:11.000000000 +0000 @@ -0,0 +1,46 @@ +.TH VMWARE\-CHECKVM 1 "2008\-07\-04" "2008.07.01\-102166" "Open VM Tools" + +.SH NAME +vmware\-checkvm \- Check if running in a VM or not + +.SH SYNOPSIS +\fBvmware\-checkvm\fR + +.SH DESCRIPTION +This is a simple console application and can be run as any user. vmware\-checkvm check if is running in a VM (returns 0) or not (returns 1). + +.SH OPTIONS +vmware\-checkvm has no options. + +.SH SEE ALSO +\fIvmware\-hgfsclient\fR(1) +.br +\fIvmware\-toolbox\fR(1) +.br +\fIvmware\-user\fR(1) +.br +\fIvmware\-xferlogs\fR(1) +.br +\fIvmware\-guestd\fR(8) +.br +\fIvmware\-hgfsmounter\fR(8) +.br +\fIvmware\-user\-suid\-wrapper\fR(8) +.br +\fIvmblock\fR(9) +.br +\fIvmhgfs\fR(9) +.br +\fIvmmemctl\fR(9) +.br +\fIvmsync\fR(9) +.br +\fIvmxnet\fR(9) + +.SH HOMEPAGE +More information about vmware\-checkvm and the Open VM Tools can be found at <\fIhttp://open\-vm\-tools.sourceforge.net/\fR>. + +.SH AUTHOR +Open VM Tools were written by VMware, Inc. <\fIhttp://www.vmware.com/\fR>. +.PP +This manual page was put together from homepage materials by Daniel Baumann <\fIdaniel@debian.org\fR>, for the Debian project (but may be used by others). diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/debian/manpage/vmware-guestd.8 /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/debian/manpage/vmware-guestd.8 --- open-vm-tools-2008.01.23-74039/debian/manpage/vmware-guestd.8 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/debian/manpage/vmware-guestd.8 2008-11-20 23:36:11.000000000 +0000 @@ -0,0 +1,51 @@ +.TH VMWARE\-GUESTD 8 "2008\-07\-04" "2008.07.01\-102166" "Open VM Tools" + +.SH NAME +vmware\-guestd \- vmware daemon + +.SH SYNOPSIS +\fBvmware\-guestd\fR + +.SH DESCRIPTION +This is a userlevel daemon process. It runs the default soft power operation scripts in /etc/vmware-tools and starts guest application as a service. + +.SH OPTIONS +vmware\-guestd has no options. + +.SH FILES +\fI/etc/pam.d/vmware\-guestd\fR +.br +\fI/etc/vmware\-tools/*\-default\fR + +.SH SEE ALSO +\fIvmware\-checkvm\fR(1) +.br +\fIvmware\-hgfsclient\fR(1) +.br +\fIvmware\-toolbox\fR(1) +.br +\fIvmware\-user\fR(1) +.br +\fIvmware\-xferlogs\fR(1) +.br +\fIvmware\-hgfsmounter\fR(8) +.br +\fIvmware\-user\-suid\-wrapper\fR(8) +.br +\fIvmblock\fR(9) +.br +\fIvmhgfs\fR(9) +.br +\fIvmmemctl\fR(9) +.br +\fIvmsync\fR(9) +.br +\fIvmxnet\fR(9) + +.SH HOMEPAGE +More information about vmware\-guestd and the Open VM Tools can be found at <\fIhttp://open\-vm\-tools.sourceforge.net/\fR>. + +.SH AUTHOR +Open VM Tools were written by VMware, Inc. <\fIhttp://www.vmware.com/\fR>. +.PP +This manual page was put together from homepage materials by Daniel Baumann <\fIdaniel@debian.org\fR>, for the Debian project (but may be used by others). diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/debian/manpage/vmware-hgfsclient.1 /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/debian/manpage/vmware-hgfsclient.1 --- open-vm-tools-2008.01.23-74039/debian/manpage/vmware-hgfsclient.1 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/debian/manpage/vmware-hgfsclient.1 2008-11-20 23:36:11.000000000 +0000 @@ -0,0 +1,46 @@ +.TH VMWARE\-HGFSCLIENT 1 "2008\-07\-04" "2008.07.01\-102166" "Open VM Tools" + +.SH NAME +vmware\-hgfsclient \- hgfs client access + +.SH SYNOPSIS +\fBvmware\-hgfsclient\fR + +.SH DESCRIPTION +This is a simple console application and can be run as any user. vmware\-hgfsclient is a userspace HGFS client implementation. It will probably one day become a full featured HGFS filesystem driver. + +.SH OPTIONS +vmware\-hgfsclient has no options. + +.SH SEE ALSO +\fIvmware\-checkvm\fR(1) +.br +\fIvmware\-toolbox\fR(1) +.br +\fIvmware\-user\fR(1) +.br +\fIvmware\-xferlogs\fR(1) +.br +\fIvmware\-guestd\fR(8) +.br +\fIvmware\-hgfsmounter\fR(8) +.br +\fIvmware\-user\-suid\-wrapper\fR(8) +.br +\fIvmblock\fR(9) +.br +\fIvmhgfs\fR(9) +.br +\fIvmmemctl\fR(9) +.br +\fIvmsync\fR(9) +.br +\fIvmxnet\fR(9) + +.SH HOMEPAGE +More information about vmware\-hgfsclient and the Open VM Tools can be found at <\fIhttp://open\-vm\-tools.sourceforge.net/\fR>. + +.SH AUTHOR +Open VM Tools were written by VMware, Inc. <\fIhttp://www.vmware.com/\fR>. +.PP +This manual page was put together from homepage materials by Daniel Baumann <\fIdaniel@debian.org\fR>, for the Debian project (but may be used by others). diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/debian/manpage/vmware-hgfsmounter.8 /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/debian/manpage/vmware-hgfsmounter.8 --- open-vm-tools-2008.01.23-74039/debian/manpage/vmware-hgfsmounter.8 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/debian/manpage/vmware-hgfsmounter.8 2008-11-20 23:36:11.000000000 +0000 @@ -0,0 +1,98 @@ +.TH VMWARE\-HGFSMOUNTER 8 "2008\-07\-04" "2008.07.01\-102166" "Open VM Tools" + +.SH NAME +vmware\-hgfsmounter \- program for mounting HGFS shares + +.SH SYNOPSIS +\fBmount.vmhgfs\fR \fISHARE\fR \fIDIRECTORY\fR [ \-o \fIOPTIONS\fR ] +.br +\fBvmware\-hgfsmounter\fR \fISHARE\fR \fIDIRECTORY\fR [ \-o \fIOPTIONS\fR ] + +.SH DESCRIPTION +This is a console\-based mount helper application. It mounts the HGFS share, specified by name, to a local directory. Share names must be in host:dir format. + +.SH OPTIONS +.IP "uid=\fIARGUMENT\fR" 4 +mount owner (by uid or username) +.IP "gid=\fIARGUMENT\fR" 4 +mount group (by gid or groupname) +.IP "fmask=\fIARGUMENT\fR" 4 +file umask (in octal) +.IP "dmask=\fIARGUMENT\fR" 4 +directory umask (in octal) +.IP "ro" 4 +mount read\-only +.IP "rw" 4 +mount read\-write (default) +.IP "nosuid" 4 +ignore suid/sgid bits +.IP "suid" 4 +allow suid/sgid bits (default) +.IP "nodev" 4 +prevent device node access +.IP "dev" 4 +allow device node access (default) +.IP "noexec" 4 +prevent program execution +.IP "exec" 4 +allow program execution (default) +.IP "sync" 4 +file writes are synchronous +.IP "async" 4 +file writes are asynchronous (default) +.IP "mand" 4 +allow mandatory locks +.IP "nomand" 4 +prevent mandatory locks (default) +.IP "noatime" 4 +do not update access times +.IP "atime" 4 +update access times (default) +.IP "nodiratime" 4 +do not update directory access times +.IP "adirtime" 4 +update directory access times (default) +.IP "ttl=\fIARGUMENT\fR" 4 +time before file attributes must be revalidated (in seconds). Improves performance but decreases coherency. Defaults to 1 if not set. + +.SH EXAMPLES +This command is intended to be run from within /bin/mount by passing the option '\-t vmhgfs'. For example: +.PP + mount \-t vmhgfs .host:/ /mnt/hgfs/ +.br + mount \-t vmhgfs .host:/foo /mnt/foo +.br + mount \-t vmhgfs .host:/foo/bar /var/lib/bar + +.SH SEE ALSO +\fIvmware\-checkvm\fR(1) +.br +\fIvmware\-hgfsclient\fR(1) +.br +\fIvmware\-toolbox\fR(1) +.br +\fIvmware\-user\fR(1) +.br +\fIvmware\-xferlogs\fR(1) +.br +\fIvmware\-guestd\fR(8) +.br +\fIvmware\-user\-suid\-wrapper\fR(8) +.br +\fIvmblock\fR(9) +.br +\fIvmhgfs\fR(9) +.br +\fIvmmemctl\fR(9) +.br +\fIvmsync\fR(9) +.br +\fIvmxnet\fR(9) + +.SH HOMEPAGE +More information about vmware\-hgfsmounter and the Open VM Tools can be found at <\fIhttp://open\-vm\-tools.sourceforge.net/\fR>. + +.SH AUTHOR +Open VM Tools were written by VMware, Inc. <\fIhttp://www.vmware.com/\fR>. +.PP +This manual page was put together from homepage materials by Daniel Baumann <\fIdaniel@debian.org\fR>, for the Debian project (but may be used by others). diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/debian/manpage/vmware-toolbox.1 /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/debian/manpage/vmware-toolbox.1 --- open-vm-tools-2008.01.23-74039/debian/manpage/vmware-toolbox.1 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/debian/manpage/vmware-toolbox.1 2008-11-20 23:36:11.000000000 +0000 @@ -0,0 +1,46 @@ +.TH VMWARE\-TOOLBOX 1 "2008\-07\-04" "2008.07.01\-102166" "Open VM Tools" + +.SH NAME +vmware\-toolbox \- GUI toolbox + +.SH SYNOPSIS +\fBvmware\-toolbox\fR + +.SH DESCRIPTION +This is a per\-user process that, like \fIvmware\-user\fR(1), must be run in an X11 session, and isn't needed otherwise. Also like \fIvmware\-user\fR(1), it does not support multiple concurrent users, and depends on certain Gtk shared objects at runtime. + +.SH OPTIONS +vmware\-toolbox has no options. + +.SH SEE ALSO +\fIvmware\-checkvm\fR(1) +.br +\fIvmware\-hgfsclient\fR(1) +.br +\fIvmware\-user\fR(1) +.br +\fIvmware\-xferlogs\fR(1) +.br +\fIvmware\-guestd\fR(8) +.br +\fIvmware\-hgfsmounter\fR(8) +.br +\fIvmware\-user\-suid\-wrapper\fR(8) +.br +\fIvmblock\fR(9) +.br +\fIvmhgfs\fR(9) +.br +\fIvmmemctl\fR(9) +.br +\fIvmsync\fR(9) +.br +\fIvmxnet\fR(9) + +.SH HOMEPAGE +More information about vmware\-toolbox and the Open VM Tools can be found at <\fIhttp://open\-vm\-tools.sourceforge.net/\fR>. + +.SH AUTHOR +Open VM Tools were written by VMware, Inc. <\fIhttp://www.vmware.com/\fR>. +.PP +This manual page was put together from homepage materials by Daniel Baumann <\fIdaniel@debian.org\fR>, for the Debian project (but may be used by others). diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/debian/manpage/vmware-user.1 /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/debian/manpage/vmware-user.1 --- open-vm-tools-2008.01.23-74039/debian/manpage/vmware-user.1 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/debian/manpage/vmware-user.1 2008-11-20 23:36:11.000000000 +0000 @@ -0,0 +1,63 @@ +.TH VMWARE\-USER 1 "2008\-07\-04" "2008.07.01\-102166" "Open VM Tools" + +.SH NAME +vmware\-user \- GUI tool + +.SH SYNOPSIS +\fBvmware\-user\fR + +.SH DESCRIPTION +vmware\-user is a relatively small Gtk application that should run for the duration of an interactive X11 session. It has no dependencies on X11 service daemons (e.g., messaging buses), and so it may be launched at any time during or after session startup. +.PP +It's a hidden window application and handles tools features which we want active all the time, but don't want to impose a visable window on the user. +.PP +Without a running vmware\-user process, interactive X11 sessions will lack GUI features such as drag\-and\-drop (DnD), file and text copy/paste, dynamic display resizing, and Unity. +.PP +vmware\-user depends on a mounted \fIvmblock\fR(9) filesystem for proper host to guest DnD operations. +.PP +Drag\-and\-drop operations depend on a setuid wrapper, \fIvmware\-user\-suid\-wrapper\fR(8). +.PP +A recent change to the Open VM Tools adjusted the nature of the relationship between the VMware Tools service (\fIvmware\-guestd\fR(8)) and the VMware user process (vmware\-user). The two programs have been completely decoupled, and as such \fIvmware\-guestd\fR(8) no longer attempts to automatically start and stop vmware\-user processes on users' behalf. +.PP +Modern display managers implementing the XDG autostart spec support launching applications at session startup via placing a `vmware\-user.desktop' file in a well\-known location (/etc/xdg/autostart). + +.SH OPTIONS +vmware\-user has no options. + +.SH FILES +\fI/etc/vmware\-tools/xautostart.conf\fR +.br +\fI/etc/xdg/autostart/vmware\-user.desktop\fR + +.SH SEE ALSO +\fIvmware\-checkvm\fR(1) +.br +\fIvmware\-hgfsclient\fR(1) +.br +\fIvmware\-toolbox\fR(1) +.br +\fIvmware\-xferlogs\fR(1) +.br +\fIvmware\-guestd\fR(8) +.br +\fIvmware\-hgfsmounter\fR(8) +.br +\fIvmware\-user\-suid\-wrapper\fR(8) +.br +\fIvmblock\fR(9) +.br +\fIvmhgfs\fR(9) +.br +\fIvmmemctl\fR(9) +.br +\fIvmsync\fR(9) +.br +\fIvmxnet\fR(9) + +.SH HOMEPAGE +More information about vmware\-user and the Open VM Tools can be found at <\fIhttp://open\-vm\-tools.sourceforge.net/\fR>. + +.SH AUTHOR +Open VM Tools were written by VMware, Inc. <\fIhttp://www.vmware.com/\fR>. +.PP +This manual page was put together from homepage materials by Daniel Baumann <\fIdaniel@debian.org\fR>, for the Debian project (but may be used by others). diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/debian/manpage/vmware-user-suid-wrapper.8 /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/debian/manpage/vmware-user-suid-wrapper.8 --- open-vm-tools-2008.01.23-74039/debian/manpage/vmware-user-suid-wrapper.8 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/debian/manpage/vmware-user-suid-wrapper.8 2008-11-20 23:36:11.000000000 +0000 @@ -0,0 +1,48 @@ +.TH VMWARE\-USER\-SUID\-WRAPPER 8 "2008\-07\-04" "2008.07.01\-102166" "Open VM Tools" + +.SH NAME +vmware\-user\-suid\-wrapper \- wrapper programm for \fIvmware\-user\fR(1) + +.SH SYNOPSIS +\fBvmware\-user\-suid\-wrapper\fR + +.SH DESCRIPTION +Operations on the \fIvmblock\fR(9) filesystem are considered privileged, and as such may only be issued on a file descriptor acquired by root. This is accomplished by vmware\-user\-suid\-wrapper, a small setuid wrapper whose only purpose is to acquire a filesystem file descriptor, drop superuser privileges, and then execute \fIvmware\-user\fR(1). +. +In particular, prepare the system for vmware-user means that it unmounts the vmblock file system, unloads the vmblock module, then reloads the module, mounts the file system, and opens a file descriptor that vmware-user can use to add and remove blocks. + +.SH OPTIONS +vmware\-user\-suid\-wrapper has no options. + +.SH SEE ALSO +\fIvmware\-checkvm\fR(1) +.br +\fIvmware\-hgfsclient\fR(1) +.br +\fIvmware\-toolbox\fR(1) +.br +\fIvmware\-user\fR(1) +.br +\fIvmware\-xferlogs\fR(1) +.br +\fIvmware\-guestd\fR(8) +.br +\fIvmware\-hgfsmounter\fR(8) +.br +\fIvmblock\fR(9) +.br +\fIvmhgfs\fR(9) +.br +\fIvmmemctl\fR(9) +.br +\fIvmsync\fR(9) +.br +\fIvmxnet\fR(9) + +.SH HOMEPAGE +More information about vmware\-user\-suid\-wrapper and the Open VM Tools can be found at <\fIhttp://open\-vm\-tools.sourceforge.net/\fR>. + +.SH AUTHOR +Open VM Tools were written by VMware, Inc. <\fIhttp://www.vmware.com/\fR>. +.PP +This manual page was put together from homepage materials by Daniel Baumann <\fIdaniel@debian.org\fR>, for the Debian project (but may be used by others). diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/debian/manpage/vmware-xferlogs.1 /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/debian/manpage/vmware-xferlogs.1 --- open-vm-tools-2008.01.23-74039/debian/manpage/vmware-xferlogs.1 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/debian/manpage/vmware-xferlogs.1 2008-11-20 23:36:11.000000000 +0000 @@ -0,0 +1,58 @@ +.TH VMWARE\-XFERLOGS 1 "2008\-07\-04" "2008.07.01\-102166" "Open VM Tools" + +.SH NAME +vmware\-xferlogs \- dump vm\-support output to vmx logfile + +.SH SYNOPSIS +\fBvmware\-xferlogs\fR \fIOPTIONS\fR \fIFILE\fR + +.SH DESCRIPTION +vmware\-xferlogs is a simple console application and can be run as any user. It is based on rpctool to dump the vm\-support output to the vmx log file base64 encoded. It can dump any file supplied on the commandline to the vmx log. It also does the decoding part of it. It can read the vmware.log file decode and write the encoded files in the directory it was invoked. +.PP +Example of a transfer found in the vmx log file: +.PP + Aug 24 18:48:09: vcpu-0| Guest: >Logfile Begins : /root/install.log: ver - 1 + Aug 24 18:48:09: vcpu-0| Guest: >SW5zdGFsbGluZyA0NDEgcGFja2FnZXMKCkluc3RhbGxpbmcgZ2xpYmMtY29tbW9uLTIuMi41LTM0 + Aug 24 18:48:09: vcpu-0| Guest: >LgpJbnN0YWxsaW5nIGh3ZGF0YS0wLjE0LTEuCkluc3RhbGxpbmcgaW5kZXhodG1sLTcuMy0zLgpJ + Aug 24 18:48:09: vcpu-0| Guest: >bnN0YWxsaW5nIG1haWxjYXAtMi4xLjktMi4KSW5zdGFsbGluZyBtYW4tcGFnZXMtMS40OC0yLgpJ + .... + .... + Aug 24 18:48:10: vcpu-0| Guest: >Mi4K + Aug 24 18:48:10: vcpu-0| Guest: >Logfile Ends + +.SH OPTIONS +.IP "enc" 4 +.IP "dec" 4 + +.SH SEE ALSO +\fIvmware\-checkvm\fR(1) +.br +\fIvmware\-hgfsclient\fR(1) +.br +\fIvmware\-toolbox\fR(1) +.br +\fIvmware\-user\fR(1) +.br +\fIvmware\-guestd\fR(8) +.br +\fIvmware\-hgfsmounter\fR(8) +.br +\fIvmware\-user\-suid\-wrapper\fR(8) +.br +\fIvmblock\fR(9) +.br +\fIvmhgfs\fR(9) +.br +\fIvmmemctl\fR(9) +.br +\fIvmsync\fR(9) +.br +\fIvmxnet\fR(9) + +.SH HOMEPAGE +More information about vmware\-xferlogs and the Open VM Tools can be found at <\fIhttp://open\-vm\-tools.sourceforge.net/\fR>. + +.SH AUTHOR +Open VM Tools were written by VMware, Inc. <\fIhttp://www.vmware.com/\fR>. +.PP +This manual page was put together from homepage materials by Daniel Baumann <\fIdaniel@debian.org\fR>, for the Debian project (but may be used by others). diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/debian/manpage/vmxnet.9 /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/debian/manpage/vmxnet.9 --- open-vm-tools-2008.01.23-74039/debian/manpage/vmxnet.9 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/debian/manpage/vmxnet.9 2008-11-20 23:36:11.000000000 +0000 @@ -0,0 +1,53 @@ +.TH VMXNET 9 "2008\-07\-04" "2008.07.01\-102166" "Open VM Tools" + +.SH NAME +vmxnet \- vmware kernel module + +.SH SYNOPSIS +modprobe vmxnet + +.SH DESCRIPTION +This is a Linux kernel device driver module that drives VMware's fast networking device. As it is backed by real (virtual) hardware, it should be automatically loaded by hotplug or udev as needed. For best performance, it is recommended to enable TSO on all interfaces driven by vmxnet using ethtool. +.PP +The shell code to do this might look like this: +.PP +if which ethtool >/dev/null 2>&1; then + for ethif in `ifconfig \-a | grep ^eth | cut \-d' ' \-f1`; do + ethtool \-K $ethif tso on >/dev/null 2>&1 + done +fi +.PP +The VMware backend may present the fast networking device as an AMD vlance device instead of the actual vmxnet device. + +.SH SEE ALSO +\fIvmware\-checkvm\fR(1) +.br +\fIvmware\-hgfsclient\fR(1) +.br +\fIvmware\-toolbox\fR(1) +.br +\fIvmware\-user\fR(1) +.br +\fIvmware\-xferlogs\fR(1) +.br +\fIvmware\-guestd\fR(8) +.br +\fIvmware\-hgfsmounter\fR(8) +.br +\fIvmware\-user\-suid\-wrapper\fR(8) +.br +\fIvmblock\fR(9) +.br +\fIvmhgfs\fR(9) +.br +\fIvmmemctl\fR(9) +.br +\fIvmsync\fR(9) + +.SH HOMEPAGE +More information about vmxnet and the Open VM Tools can be found at <\fIhttp://open\-vm\-tools.sourceforge.net/\fR>. + +.SH AUTHOR +Open VM Tools were written by VMware, Inc. <\fIhttp://www.vmware.com/\fR>. +.PP +This manual page was put together from homepage materials by Daniel Baumann <\fIdaniel@debian.org\fR>, for the Debian project (but may be used by others). diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/debian/open-vm-source.dir /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/debian/open-vm-source.dir --- open-vm-tools-2008.01.23-74039/debian/open-vm-source.dir 2008-11-20 23:36:10.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/debian/open-vm-source.dir 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -usr/src diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/debian/open-vm-source.links /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/debian/open-vm-source.links --- open-vm-tools-2008.01.23-74039/debian/open-vm-source.links 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/debian/open-vm-source.links 2008-11-20 23:36:11.000000000 +0000 @@ -0,0 +1 @@ +/usr/share/modass/packages/default.sh /usr/share/modass/overrides/open-vm-source diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/debian/open-vm-source.README.Debian /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/debian/open-vm-source.README.Debian --- open-vm-tools-2008.01.23-74039/debian/open-vm-source.README.Debian 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/debian/open-vm-source.README.Debian 2008-11-20 23:36:11.000000000 +0000 @@ -0,0 +1,20 @@ +open-vm for Debian +------------------ + +open-vm-source provides the kernel module for open-vm. You also need the +open-vm-tools package to get the necessary user-space support programs. + +The Debian open-vm-source package can be used in several ways: + + * Using module-assistant(8) commands provided by the module-assistant Debian + package: + + # module-assistant prepare open-vm + # module-assistant auto-install open-vm + + * Using the make-kpkg(1) command provided by the kernel-package Debian + package. See the "modules_image" section of the make-kpkg(1) man page. + + * Unpacking /usr/src/open-vm.tar.bz2 and installing the module on your own. + + -- Daniel Baumann Sun, 9 Sep 2007 16:53:00 +0200 diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/debian/open-vm-toolbox.links /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/debian/open-vm-toolbox.links --- open-vm-tools-2008.01.23-74039/debian/open-vm-toolbox.links 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/debian/open-vm-toolbox.links 2008-11-20 23:36:11.000000000 +0000 @@ -0,0 +1 @@ +/usr/share/applications/vmware-user.desktop /etc/xdg/autostart/vmware-user.desktop diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/debian/open-vm-toolbox.manpages /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/debian/open-vm-toolbox.manpages --- open-vm-tools-2008.01.23-74039/debian/open-vm-toolbox.manpages 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/debian/open-vm-toolbox.manpages 2008-11-20 23:36:11.000000000 +0000 @@ -0,0 +1,3 @@ +debian/manpage/vmware-toolbox.1 +debian/manpage/vmware-user.1 +debian/manpage/vmware-user-suid-wrapper.8 diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/debian/open-vm-tools-gui.install /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/debian/open-vm-tools-gui.install --- open-vm-tools-2008.01.23-74039/debian/open-vm-tools-gui.install 2008-11-20 23:36:10.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/debian/open-vm-tools-gui.install 1970-01-01 01:00:00.000000000 +0100 @@ -1,2 +0,0 @@ -toolbox/toolbox usr/bin -vmware-user/vmware-user usr/bin diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/debian/open-vm-tools.init /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/debian/open-vm-tools.init --- open-vm-tools-2008.01.23-74039/debian/open-vm-tools.init 2008-11-20 23:36:10.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/debian/open-vm-tools.init 2008-11-20 23:36:11.000000000 +0000 @@ -1,41 +1,58 @@ #!/bin/sh + ### BEGIN INIT INFO -# Provides: open-vm-tools -# Required-Start: -# Required-Stop: $network -# Default-Start: 2 3 5 -# Default-Stop: 0 6 -# Description: Runs the open-vm-tools services -# Short-Description: Runs the open-vm-tools services +# Provides: open-vm-tools +# Required-Start: $local_fs +# Required-Stop: $local_fs +# X-Start-Before: $network +# X-Stop-After: $network +# Default-Start: S +# Default-Stop: 0 6 +# Description: Runs the open-vm-tools services +# Short-Description: Runs the open-vm-tools services ### END INIT INFO . /lib/lsb/init-functions -vmxnet_needed () { - hwversion=`checkvm -h | head -1 | cut -f5 -d\ ` - for dev in /sys/bus/pci/devices/* +vmxnet_needed () +{ + HWVERSION="$(vmware-checkvm -h | head -1 | cut -f5 -d\ )" + + for DEVICE in /sys/bus/pci/devices/* do - if grep -q 15ad $dev && grep -q 0720 $dev + if grep -q 15ad ${DEVICE}/vendor && grep -q 0720 ${DEVICE}/device then return 0 fi - if [ $hwversion -ge 4 ] && grep -q 1022 $dev && grep -q 2000 $dev + + if [ "${HWVERSION}" -ge "4" ] && grep -q 1022 ${DEVICE}/vendor && grep -q 2000 ${DEVICE}/device then return 0 fi done + + return 1 +} + +vmxnet_found () +{ + if modprobe -n -q vmxnet + then + return 0 + fi + return 1 } exit_if_not_in_vm () { - if ! [ -x /usr/bin/checkvm ] || ! /usr/bin/checkvm > /dev/null 2>&1 + if [ ! -x /usr/bin/vmware-checkvm ] || ! /usr/bin/vmware-checkvm > /dev/null 2>&1 then - echo "Not starting as we're not running in a vm" + echo "Not starting as we're not running in a vm." exit 0 fi } -case "$1" in +case "${1}" in start) # Check if we're running inside VMWare exit_if_not_in_vm @@ -43,47 +60,52 @@ log_daemon_msg "Loading open-vm-tools modules" log_progress_msg "vmhgfs"; modprobe vmhgfs log_progress_msg "vmmemctl"; modprobe vmmemctl + log_progress_msg "vmsync"; modprobe vmsync log_end_msg 0 - if vmxnet_needed + + if vmxnet_found && vmxnet_needed then - rmmod pcnet32 + modprobe -r pcnet32 modprobe vmxnet fi - log_daemon_msg "Starting open-vm guest daemon" "guestd" - guestd --background /var/run/vmware-guestd.pid + + log_daemon_msg "Starting open-vm guest daemon" "vmware-guestd" + vmware-guestd --background /var/run/vmware-guestd.pid log_end_msg 0 - ;; + ;; + stop) # Check if we're running inside VMWare exit_if_not_in_vm - log_daemon_msg "Stopping open-vm guest daemon" "guestd" + log_daemon_msg "Stopping open-vm guest daemon" "vmware-guestd" + if [ -f /var/run/vmware-guestd.pid ] then - kill `cat /var/run/vmware-guestd.pid` - fi + kill $(cat /var/run/vmware-guestd.pid) + fi + log_end_msg 0 - if vmxnet_needed + + if vmxnet_found && vmxnet_needed then - rmmod vmxnet + modprobe -r vmxnet modprobe pcnet32 fi + log_daemon_msg "Removing open-vm-tools modules" log_progress_msg "vmhgfs"; modprobe -r vmhgfs log_progress_msg "vmmemctl"; modprobe -r vmmemctl + log_progress_msg "vmsync"; modprobe -r vmsync log_end_msg 0 - - ;; + ;; + force-reload|restart) - $0 stop ; $0 start - ;; + ${0} stop; ${0} start + ;; + *) - log_success_msg "Usage: /etc/init.d/open-vm-tools {start|stop|restart|force-reload}" + log_success_msg "Usage: ${0} {start|stop|restart|force-reload}" exit 1 - ;; + ;; esac - - - - - diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/debian/open-vm-tools.install /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/debian/open-vm-tools.install --- open-vm-tools-2008.01.23-74039/debian/open-vm-tools.install 2008-11-20 23:36:10.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/debian/open-vm-tools.install 1970-01-01 01:00:00.000000000 +0100 @@ -1,4 +0,0 @@ -checkvm/checkvm usr/bin -guestd/guestd usr/sbin -hgfsclient/hgfsclient usr/bin -hgfsmounter/hgfsmounter usr/sbin diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/debian/open-vm-tools.links /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/debian/open-vm-tools.links --- open-vm-tools-2008.01.23-74039/debian/open-vm-tools.links 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/debian/open-vm-tools.links 2008-11-20 23:36:11.000000000 +0000 @@ -0,0 +1,2 @@ +/sbin/mount.vmhgfs /sbin/vmware-hgfsmounter +/usr/share/man/man8/vmware-hgfsmounter.8 /usr/share/man/man8/mount.vmhgfs.8 diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/debian/open-vm-tools.lintian-overrides /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/debian/open-vm-tools.lintian-overrides --- open-vm-tools-2008.01.23-74039/debian/open-vm-tools.lintian-overrides 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/debian/open-vm-tools.lintian-overrides 2008-11-20 23:36:11.000000000 +0000 @@ -0,0 +1,4 @@ +open-vm-tools: non-dev-pkg-with-shlib-symlink +open-vm-tools: desktop-entry-missing-required-key +open-vm-tools: package-name-doesnt-match-sonames +open-vm-tools: setuid-binary sbin/mount.vmhgfs 4755 root/root diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/debian/open-vm-tools.manpages /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/debian/open-vm-tools.manpages --- open-vm-tools-2008.01.23-74039/debian/open-vm-tools.manpages 2008-11-20 23:36:10.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/debian/open-vm-tools.manpages 2008-11-20 23:36:11.000000000 +0000 @@ -1 +1,6 @@ -debian/checkvm.1 +debian/manpage/vmware-checkvm.1 +debian/manpage/vmware-hgfsclient.1 +debian/manpage/vmware-xferlogs.1 +debian/manpage/vmware-guestd.8 +debian/manpage/vmware-hgfsmounter.8 +debian/manpage/*.9 diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/debian/patches/00list /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/debian/patches/00list --- open-vm-tools-2008.01.23-74039/debian/patches/00list 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/debian/patches/00list 2008-11-20 23:36:11.000000000 +0000 @@ -0,0 +1 @@ +01-kvers.dpatch diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/debian/patches/01-kvers.dpatch /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/debian/patches/01-kvers.dpatch --- open-vm-tools-2008.01.23-74039/debian/patches/01-kvers.dpatch 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/debian/patches/01-kvers.dpatch 2008-11-20 23:36:11.000000000 +0000 @@ -0,0 +1,103 @@ +#!/bin/sh /usr/share/dpatch/dpatch-run +## 01-kvers.dpatch by Cyril Brulebois +## +## DP: Replacing uname call with KVERS, overwriting seemed not to work. + +@DPATCH@ + +diff -Naurp open-vm-tools.orig/modules/linux/vmblock/Makefile open-vm-tools/modules/linux/vmblock/Makefile +--- open-vm-tools.orig/modules/linux/vmblock/Makefile 2008-10-16 07:38:58.000000000 +0200 ++++ open-vm-tools/modules/linux/vmblock/Makefile 2008-10-16 07:37:43.000000000 +0200 +@@ -26,7 +26,7 @@ + #### + SRCROOT = . + +-VM_UNAME = $(shell uname -r) ++VM_UNAME = $(KVERS) + + # Header directory for the running kernel + HEADER_DIR = /lib/modules/$(VM_UNAME)/build/include +diff -Naurp open-vm-tools.orig/modules/linux/vmci/Makefile open-vm-tools/modules/linux/vmci/Makefile +--- open-vm-tools.orig/modules/linux/vmci/Makefile 2008-10-16 07:38:58.000000000 +0200 ++++ open-vm-tools/modules/linux/vmci/Makefile 2008-10-16 07:37:43.000000000 +0200 +@@ -26,7 +26,7 @@ + #### + SRCROOT = . + +-VM_UNAME = $(shell uname -r) ++VM_UNAME = $(KVERS) + + # Header directory for the running kernel + HEADER_DIR = /lib/modules/$(VM_UNAME)/build/include +diff -Naurp open-vm-tools.orig/modules/linux/vmhgfs/Makefile open-vm-tools/modules/linux/vmhgfs/Makefile +--- open-vm-tools.orig/modules/linux/vmhgfs/Makefile 2008-10-16 07:38:58.000000000 +0200 ++++ open-vm-tools/modules/linux/vmhgfs/Makefile 2008-10-16 07:37:43.000000000 +0200 +@@ -26,7 +26,7 @@ + #### + SRCROOT = . + +-VM_UNAME = $(shell uname -r) ++VM_UNAME = $(KVERS) + + # Header directory for the running kernel + HEADER_DIR = /lib/modules/$(VM_UNAME)/build/include +diff -Naurp open-vm-tools.orig/modules/linux/vmmemctl/Makefile open-vm-tools/modules/linux/vmmemctl/Makefile +--- open-vm-tools.orig/modules/linux/vmmemctl/Makefile 2008-10-16 07:38:58.000000000 +0200 ++++ open-vm-tools/modules/linux/vmmemctl/Makefile 2008-10-16 07:37:43.000000000 +0200 +@@ -26,7 +26,7 @@ + #### + SRCROOT = . + +-VM_UNAME = $(shell uname -r) ++VM_UNAME = $(KVERS) + + # Header directory for the running kernel + HEADER_DIR = /lib/modules/$(VM_UNAME)/build/include +diff -Naurp open-vm-tools.orig/modules/linux/vmsync/Makefile open-vm-tools/modules/linux/vmsync/Makefile +--- open-vm-tools.orig/modules/linux/vmsync/Makefile 2008-10-16 07:38:58.000000000 +0200 ++++ open-vm-tools/modules/linux/vmsync/Makefile 2008-10-16 07:37:43.000000000 +0200 +@@ -26,7 +26,7 @@ + #### + SRCROOT = . + +-VM_UNAME = $(shell uname -r) ++VM_UNAME = $(KVERS) + + # Header directory for the running kernel + HEADER_DIR = /lib/modules/$(VM_UNAME)/build/include +diff -Naurp open-vm-tools.orig/modules/linux/vmxnet/Makefile open-vm-tools/modules/linux/vmxnet/Makefile +--- open-vm-tools.orig/modules/linux/vmxnet/Makefile 2008-10-16 07:38:58.000000000 +0200 ++++ open-vm-tools/modules/linux/vmxnet/Makefile 2008-10-16 07:37:43.000000000 +0200 +@@ -26,7 +26,7 @@ + #### + SRCROOT = . + +-VM_UNAME = $(shell uname -r) ++VM_UNAME = $(KVERS) + + # Header directory for the running kernel + HEADER_DIR = /lib/modules/$(VM_UNAME)/build/include +diff -Naurp open-vm-tools.orig/modules/linux/vmxnet3/Makefile open-vm-tools/modules/linux/vmxnet3/Makefile +--- open-vm-tools.orig/modules/linux/vmxnet3/Makefile 2008-10-16 07:38:58.000000000 +0200 ++++ open-vm-tools/modules/linux/vmxnet3/Makefile 2008-10-16 07:38:06.000000000 +0200 +@@ -26,7 +26,7 @@ + #### + SRCROOT = . + +-VM_UNAME = $(shell uname -r) ++VM_UNAME = $(KVERS) + + # Header directory for the running kernel + HEADER_DIR = /lib/modules/$(VM_UNAME)/build/include +diff -Naurp open-vm-tools.orig/modules/linux/vsock/Makefile open-vm-tools/modules/linux/vsock/Makefile +--- open-vm-tools.orig/modules/linux/vsock/Makefile 2008-10-16 07:38:58.000000000 +0200 ++++ open-vm-tools/modules/linux/vsock/Makefile 2008-10-16 07:37:43.000000000 +0200 +@@ -26,7 +26,7 @@ + #### + SRCROOT = . + +-VM_UNAME = $(shell uname -r) ++VM_UNAME = $(KVERS) + + # Header directory for the running kernel + HEADER_DIR = /lib/modules/$(VM_UNAME)/build/include diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/debian/patches/03_kernel_makefile_fix.diff /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/debian/patches/03_kernel_makefile_fix.diff --- open-vm-tools-2008.01.23-74039/debian/patches/03_kernel_makefile_fix.diff 2008-11-20 23:36:10.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/debian/patches/03_kernel_makefile_fix.diff 1970-01-01 01:00:00.000000000 +0100 @@ -1,112 +0,0 @@ -Index: open-vm-tools-2008.01.23-74039/modules/linux/vmblock/Makefile -=================================================================== ---- open-vm-tools-2008.01.23-74039.orig/modules/linux/vmblock/Makefile 2008-01-28 09:02:43.000000000 +0100 -+++ open-vm-tools-2008.01.23-74039/modules/linux/vmblock/Makefile 2008-02-13 14:12:53.588665413 +0100 -@@ -26,12 +26,20 @@ - #### - SRCROOT = . - --VM_UNAME = $(shell uname -r) -+ifeq KVERREL -+ VM_UNAME = $(KEVERREL) -+else -+ VM_UNAME = $(shell uname -r) -+endif - - # Header directory for the running kernel --HEADER_DIR = /lib/modules/$(VM_UNAME)/build/include -+ifeq KERNELDIR -+ BUILD_DIR = $(KERNELDIR) -+else -+ BUILD_DIR = /lib/modules/$(VM_UNAME)/build -+endif - --BUILD_DIR = $(HEADER_DIR)/.. -+HEADER_DIR = $(BUILD_DIR)/include - - DRIVER := vmblock - -Index: open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/Makefile -=================================================================== ---- open-vm-tools-2008.01.23-74039.orig/modules/linux/vmhgfs/Makefile 2008-01-28 09:02:46.000000000 +0100 -+++ open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/Makefile 2008-02-13 14:12:53.588665413 +0100 -@@ -26,12 +26,20 @@ - #### - SRCROOT = . - --VM_UNAME = $(shell uname -r) -+ifeq KVERREL -+ VM_UNAME = $(KEVERREL) -+else -+ VM_UNAME = $(shell uname -r) -+endif - - # Header directory for the running kernel --HEADER_DIR = /lib/modules/$(VM_UNAME)/build/include -+ifeq KERNELDIR -+ BUILD_DIR = $(KERNELDIR) -+else -+ BUILD_DIR = /lib/modules/$(VM_UNAME)/build -+endif - --BUILD_DIR = $(HEADER_DIR)/.. -+HEADER_DIR = $(BUILD_DIR)/include - - DRIVER := vmhgfs - -Index: open-vm-tools-2008.01.23-74039/modules/linux/vmmemctl/Makefile -=================================================================== ---- open-vm-tools-2008.01.23-74039.orig/modules/linux/vmmemctl/Makefile 2008-01-28 09:02:48.000000000 +0100 -+++ open-vm-tools-2008.01.23-74039/modules/linux/vmmemctl/Makefile 2008-02-13 14:12:53.592666037 +0100 -@@ -26,12 +26,20 @@ - #### - SRCROOT = . - --VM_UNAME = $(shell uname -r) -+ifeq KVERREL -+ VM_UNAME = $(KEVERREL) -+else -+ VM_UNAME = $(shell uname -r) -+endif - - # Header directory for the running kernel --HEADER_DIR = /lib/modules/$(VM_UNAME)/build/include -+ifeq KERNELDIR -+ BUILD_DIR = $(KERNELDIR) -+else -+ BUILD_DIR = /lib/modules/$(VM_UNAME)/build -+endif - --BUILD_DIR = $(HEADER_DIR)/.. -+HEADER_DIR = $(BUILD_DIR)/include - - DRIVER := vmmemctl - -Index: open-vm-tools-2008.01.23-74039/modules/linux/vmxnet/Makefile -=================================================================== ---- open-vm-tools-2008.01.23-74039.orig/modules/linux/vmxnet/Makefile 2008-01-28 09:02:48.000000000 +0100 -+++ open-vm-tools-2008.01.23-74039/modules/linux/vmxnet/Makefile 2008-02-13 14:12:53.592666037 +0100 -@@ -26,12 +26,20 @@ - #### - SRCROOT = . - --VM_UNAME = $(shell uname -r) -+ifeq KVERREL -+ VM_UNAME = $(KEVERREL) -+else -+ VM_UNAME = $(shell uname -r) -+endif - - # Header directory for the running kernel --HEADER_DIR = /lib/modules/$(VM_UNAME)/build/include -+ifeq KERNELDIR -+ BUILD_DIR = $(KERNELDIR) -+else -+ BUILD_DIR = /lib/modules/$(VM_UNAME)/build -+endif - --BUILD_DIR = $(HEADER_DIR)/.. -+HEADER_DIR = $(BUILD_DIR)/include - - DRIVER := vmxnet - diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/debian/patches/series /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/debian/patches/series --- open-vm-tools-2008.01.23-74039/debian/patches/series 2008-11-20 23:36:10.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/debian/patches/series 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -03_kernel_makefile_fix.diff diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/debian/postrm.modules.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/debian/postrm.modules.in --- open-vm-tools-2008.01.23-74039/debian/postrm.modules.in 2008-11-20 23:36:10.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/debian/postrm.modules.in 1970-01-01 01:00:00.000000000 +0100 @@ -1,31 +0,0 @@ -#!/bin/sh - -set -e - -drivers="vmblock vmhgfs vmmemctl vmxnet" -dir=/lib/modules/@KERNEL@/kernel/misc - -case "${1}" in - remove) - for driver in $drivers; do - if [ -e "$dir/$driver.ko.linux" ]; then - dpkg-divert --package open-vm-modules-@KERNEL@ --remove --rename \ - --divert $dir/$driver.ko.linux \ - $dir/$driver.ko - fi - done - ;; - - purge|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) - - ;; - - *) - echo "postrm called with unknown argument \`$1'" >&2 - exit 1 - ;; -esac - -#DEBHELPER# - -exit 0 diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/debian/preinst.modules.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/debian/preinst.modules.in --- open-vm-tools-2008.01.23-74039/debian/preinst.modules.in 2008-11-20 23:36:10.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/debian/preinst.modules.in 1970-01-01 01:00:00.000000000 +0100 @@ -1,31 +0,0 @@ -#!/bin/sh - -set -e - -drivers="vmblock vmhgfs vmmemctl vmxnet" -dir=/lib/modules/@KERNEL@/kernel/misc - -case "${1}" in - install|upgrade) - for driver in $drivers; do - if [ -e "$dir/$driver.ko" ]; then - dpkg-divert --package open-vm-modules-@KERNEL@ --add --rename \ - --divert $dir/$driver.ko.linux \ - $dir/$driver.ko - fi - done - ;; - - abort-upgrade) - - ;; - - *) - echo "preinst called with unknown argument \`$1'" >&2 - exit 1 - ;; -esac - -#DEBHELPER# - -exit 0 diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/debian/rules /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/debian/rules --- open-vm-tools-2008.01.23-74039/debian/rules 2008-11-20 23:36:10.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/debian/rules 2008-11-20 23:36:11.000000000 +0000 @@ -1,12 +1,10 @@ #!/usr/bin/make -f - -ifneq "$(wildcard /usr/share/quilt/quilt.make)" "" - include /usr/share/quilt/quilt.make -endif # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 +include /usr/share/dpatch/dpatch.make + # These are used for cross-compiling and for saving the configure script # from having to guess our platform (since we know it already) DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) @@ -20,105 +18,13 @@ CFLAGS += -O2 endif -config.status: configure - dh_testdir - autoreconf -f -v -i - CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man - -build-arch: config.status build-arch-stamp -build-arch-stamp: - dh_testdir - - $(MAKE) - touch $@ - -build-indep: config.status build-indep-stamp -build-indep-stamp: - dh_testdir - - touch $@ - -build: patch build-arch build-indep - -clean: unpatch - dh_testdir - rm -f build-arch-stamp build-indep-stamp - [ ! -f Makefile ] || $(MAKE) distclean -ifneq "$(wildcard /usr/share/misc/config.sub)" "" - cp -f /usr/share/misc/config.sub config.sub -endif -ifneq "$(wildcard /usr/share/misc/config.guess)" "" - cp -f /usr/share/misc/config.guess config.guess -endif - dh_clean - +# some default definitions, important! +# +# Name of the source package psource:=open-vm-source -install: DH_OPTIONS= -install: build - dh_testdir - dh_testroot - dh_clean -k - dh_installdirs - - dh_installdirs -p$(psource) usr/src/modules/$(sname)/debian - dh_installdirs -popen-vm-tools usr/share/modass/packages - # Installing configuration files - install -D -m 0644 debian/config/xautostart.conf debian/open-vm-tools-gui/etc/vmware-tools/xautostart.conf - install -D -m 0644 debian/config/vmware-user.desktop debian/open-vm-tools-gui/usr/share/autostart/vmware-user.desktop - install -D -m 0644 debian/config/vmware-guestd debian/open-vm-tools/etc/pam.d/vmware-guestd - install -D -m 0644 debian/config/tools.conf debian/open-vm-tools/etc/vmware-tools/tools.conf - - dh_install - - # open-vm-source - cp -a modules/linux/* debian/$(psource)/usr/src/modules/$(sname) - cp debian/*modules.in* debian/$(psource)/usr/src/modules/$(sname)/debian - cp debian/rules debian/changelog debian/copyright \ - debian/compat debian/$(psource)/usr/src/modules/$(sname)/debian/ - cd debian/$(psource)/usr/src && tar cjf $(sname).tar.bz2 modules && rm -rf modules - ln -sf default.sh $(CURDIR)/debian/open-vm-tools/usr/share/modass/packages/$(psource) - -# Build architecture-independent files here. -# Pass -i to all debhelper commands in this target to reduce clutter. -binary-indep: build install - dh_testdir -i - dh_testroot -i - dh_installchangelogs -i - dh_installdocs -i - dh_installman -i - dh_link -i - dh_compress -i - dh_fixperms -i - dh_installdeb -i - dh_gencontrol -i - dh_md5sums -i - dh_builddeb -i - -# Build architecture-dependent files here. -binary-arch: build install - dh_testdir -s - dh_testroot -s - dh_installdocs -s - dh_installinit -s - dh_installman -s debian/checkvm.1 - dh_installchangelogs -s - dh_strip -s - dh_link -s - dh_compress -s - dh_fixperms -s - dh_installdeb -s - dh_shlibdeps -s - dh_gencontrol -s - dh_md5sums -s - dh_builddeb -s - -binary: binary-indep binary-arch -.PHONY: build clean binary-indep binary-arch binary install binary-modules kdist kdist_configure kdist_config kdist_image kdist_clean - # The short upstream name, used for the module source directory sname:=open-vm -moddir:=vmblock vmhgfs vmmemctl vmxnet ### KERNEL SETUP ### Setup the stuff needed for making kernel module packages @@ -143,49 +49,149 @@ # The kdist_configure target is called by make-kpkg modules_config and # by kdist* rules by dependency. It should configure the module so it is # ready for compilation (mostly useful for calling configure). -# prep-deb-files from module-assistant creates the neccessary debian/ files -kdist_config kdist_configure: prep-deb-files +# prep-deb-files from module-assistant creates the neccessary debian/ files +kdist_configure: prep-deb-files # the kdist_clean target is called by make-kpkg modules_clean and from # kdist* rules. It is responsible for cleaning up any changes that have # been made by the other kdist_commands (except for the .deb files created) -kdist_clean: - @for i in $(moddir);\ - do \ - $(MAKE) KERNELDIR=$(KSRC) KVERREL=$(KVERS) -C "$$i" clean ; \ - done - rm -f *.o +kdist_clean: clean + $(MAKE) $(MFLAGS) KERNELDIR=$(KSRC) clean # ### end KERNEL SETUP # the binary-modules rule is invoked by module-assistant while processing the # kdist* targets. It is called by module-assistant or make-kpkg and *not* # during a normal build -binary-modules: +binary-modules: prep-deb-files dh_testroot dh_clean -k - dh_installdirs lib/modules/$(KVERS)/misc - dh_installdirs -p$(PKGNAME) lib/modules/$(KVERS)/misc - # Build the modules - # vmblock vmhgfs vmmemctl vmxnet - @for i in $(moddir);\ + # Building the modules + $(MAKE) + + # Installing the modules + set -e; for MODULE in vmblock vmci vmhgfs vmmemctl vmsync vmxnet vsock; \ do \ - $(MAKE) KERNELDIR=$(KSRC) KVERREL=$(KVERS) -C "$$i" ; \ - cp "$$i"/"$$i".ko debian/$(PKGNAME)/lib/modules/$(KVERS)/misc ; \ + install -D -m 0644 modules/linux/$$MODULE.o debian/$(PACKAGE)-$(KVERS)/lib/modules/$(KVERS)/misc/$$MODULE.ko; \ done dh_installdocs dh_installchangelogs - dh_installmodules - sed -e "s/@KERNEL@/$(KVERS)/g" debian/preinst.modules.in > debian/preinst - sed -e "s/@KERNEL@/$(KVERS)/g" debian/postrm.modules.in > debian/postrm dh_compress dh_fixperms + dh_installmodules dh_installdeb dh_gencontrol -- -v$(VERSION) dh_md5sums dh_builddeb --destdir=$(DEB_DESTDIR) dh_clean -k +config.status: configure patch-stamp + dh_testdir + +ifneq "$(wildcard /usr/share/misc/config.sub)" "" + cp -f /usr/share/misc/config.sub config/config.sub +endif +ifneq "$(wildcard /usr/share/misc/config.guess)" "" + cp -f /usr/share/misc/config.guess config/config.guess +endif + + # Configuring package + CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --sysconfdir=/etc --mandir=\$${prefix}/share/man --disable-unity --without-kernel-modules + +build: build-stamp +build-stamp: config.status + dh_testdir + + # Building package + $(MAKE) + + touch build-stamp + +clean: unpatch + dh_testdir + dh_testroot + rm -f build-stamp + rm -f config/config.guess config/config.sub + + # Cleaning package + [ ! -f Makefile ] || $(MAKE) distclean + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + # Installing package + $(MAKE) DESTDIR=$(CURDIR)/debian/open-vm-tools install + + install -D -m 0755 vmware-user-suid-wrapper/vmware-user-suid-wrapper debian/open-vm-toolbox/usr/sbin/vmware-user-suid-wrapper + + install -D -m 0644 toolbox/smallIcon.xpm debian/open-vm-toolbox/usr/share/pixmaps/vmware-toolbox.xpm + + set -e; if [ -e debian/open-vm-tools/etc/pam.d/vmware-guestd-x64 ]; \ + then \ + sed -i -e "s|lib64|lib|g" debian/open-vm-tools/etc/pam.d/vmware-guestd-x64; \ + mv debian/open-vm-tools/etc/pam.d/vmware-guestd-x64 debian/open-vm-tools/etc/pam.d/vmware-guestd; \ + fi + chmod 0644 debian/open-vm-tools/etc/pam.d/vmware-guestd + + # Moving open-vm-tools files + mkdir -p debian/open-vm-tools/sbin + mv debian/open-vm-tools/usr/sbin/mount.vmhgfs debian/open-vm-tools/sbin/mount.vmhgfs + + # Moving open-vm-toolbox files + mkdir -p debian/open-vm-toolbox/usr/bin + mv debian/open-vm-tools/usr/bin/vmware-user debian/open-vm-toolbox/usr/bin + mv debian/open-vm-tools/usr/bin/vmware-toolbox debian/open-vm-toolbox/usr/bin + + mkdir -p debian/open-vm-toolbox/usr/share + mv debian/open-vm-tools/usr/share/applications debian/open-vm-toolbox/usr/share + + # Installing configuration files + install -D -m 0644 debian/config/xautostart.conf debian/open-vm-toolbox/etc/vmware-tools/xautostart.conf + install -D -m 0644 debian/config/tools.conf debian/open-vm-tools/etc/vmware-tools/tools.conf + + # Create the directories to install the source into + dh_installdirs -p$(psource) usr/src/modules/$(sname)/debian + + # Copy only the driver source to the proper location + cp -a modules debian/$(psource)/usr/src/modules/$(sname) + cp debian/Makefile debian/$(psource)/usr/src/modules/$(sname)/Makefile + # Copy the needed debian/ pieces to the proper location + cp debian/*modules.in* \ + debian/$(psource)/usr/src/modules/$(sname)/debian + cp debian/control debian/rules debian/changelog debian/copyright \ + debian/compat debian/$(psource)/usr/src/modules/$(sname)/debian/ + cd debian/$(psource)/usr/src && tar c modules | bzip2 -9 > $(sname).tar.bz2 && rm -rf modules + + dh_install + +binary-indep: build install + +binary-arch: build install + dh_testdir + dh_testroot + dh_installchangelogs + dh_installdocs + dh_install + dh_installman + dh_installinit --update-rcd-params='start 38 S . stop 38 0 6 .' + dh_link + dh_strip --dbg-package=open-vm-tools-dbg + dh_compress + dh_fixperms -Xsbin/mount.vmhgfs + dh_makeshlibs + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install binary-modules kdist kdist_configure kdist_image kdist_clean diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/depcomp /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/depcomp --- open-vm-tools-2008.01.23-74039/depcomp 2008-01-28 08:03:02.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/depcomp 1970-01-01 01:00:00.000000000 +0100 @@ -1,584 +0,0 @@ -#! /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: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/FILES /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/FILES --- open-vm-tools-2008.01.23-74039/FILES 2008-01-28 08:03:06.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/FILES 1970-01-01 01:00:00.000000000 +0100 @@ -1,1184 +0,0 @@ -open-vm-tools-2008.01.23-74039: -total 1636 --rw-r--r-- 1 mts mts 262309 2008-01-28 00:02 aclocal.m4 --rwxr-xr-x 1 mts mts 33 2008-01-28 00:02 AUTHORS -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:03 autom4te.cache --rwxr-xr-x 1 mts mts 15682 2008-01-28 00:02 ChangeLog -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:03 checkvm --r-xr-xr-x 1 mts mts 43668 2007-08-16 17:29 config.guess --r-xr-xr-x 1 mts mts 32151 2007-08-16 17:29 config.sub --rwxr-xr-x 1 mts mts 895735 2008-01-28 00:03 configure --rwxr-xr-x 1 mts mts 19760 2008-01-28 00:02 configure.ac --rwxr-xr-x 1 mts mts 26425 2008-01-28 00:02 COPYING --r-xr-xr-x 1 mts mts 17574 2008-01-28 00:03 depcomp -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:03 guestd -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:03 hgfsclient -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:03 hgfsmounter --r--r--r-- 1 mts mts 9416 2008-01-28 00:03 INSTALL --r-xr-xr-x 1 mts mts 13184 2008-01-28 00:03 install-sh -drwxr-xr-x 48 mts mts 4096 2008-01-28 00:03 lib -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:03 libguestlib --r--r--r-- 1 mts mts 198422 2007-08-16 17:29 ltmain.sh --rwxr-xr-x 1 mts mts 1361 2008-01-28 00:02 Makefile.am --rw-r--r-- 1 mts mts 20946 2008-01-28 00:03 Makefile.in --r-xr-xr-x 1 mts mts 11135 2008-01-28 00:03 missing -drwxr-xr-x 4 mts mts 4096 2008-01-28 00:03 modules --rwxr-xr-x 1 mts mts 688 2008-01-28 00:02 NEWS --rwxr-xr-x 1 mts mts 6311 2008-01-28 00:02 README -drwxr-xr-x 6 mts mts 4096 2008-01-28 00:02 scripts -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:03 toolbox -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:03 vmware-user -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:03 xferlogs - -open-vm-tools-2008.01.23-74039/autom4te.cache: -total 2280 --rw-r--r-- 1 mts mts 897869 2008-01-28 00:02 output.0 --rw-r--r-- 1 mts mts 897299 2008-01-28 00:03 output.1 --rw-r--r-- 1 mts mts 10783 2008-01-28 00:03 requests --rw-r--r-- 1 mts mts 439206 2008-01-28 00:02 traces.0 --rw-r--r-- 1 mts mts 58219 2008-01-28 00:03 traces.1 - -open-vm-tools-2008.01.23-74039/checkvm: -total 60 --r--r--r-- 1 mts mts 7093 2008-01-28 00:02 checkvm.c --r--r--r-- 1 mts mts 1530 2008-01-28 00:02 checkvm_version.h --r--r--r-- 1 mts mts 26425 2008-01-28 00:02 COPYING --r--r--r-- 1 mts mts 1001 2008-01-28 00:02 Makefile.am --rw-r--r-- 1 mts mts 14502 2008-01-28 00:03 Makefile.in - -open-vm-tools-2008.01.23-74039/guestd: -total 352 --r--r--r-- 1 mts mts 26425 2008-01-28 00:02 COPYING --r--r--r-- 1 mts mts 5793 2008-01-28 00:02 debugStdio.c --r--r--r-- 1 mts mts 37352 2008-01-28 00:02 foreignVMToolsDaemon.c --r--r--r-- 1 mts mts 6196 2008-01-28 00:02 foreignVMToolsDaemon.h --r--r--r-- 1 mts mts 37041 2008-01-28 00:02 foreignVMToolsNetworking.c --r--r--r-- 1 mts mts 55322 2008-01-28 00:02 foundryToolsDaemon.c --r--r--r-- 1 mts mts 1752 2008-01-28 00:02 foundryToolsDaemon.h --r--r--r-- 1 mts mts 1507 2008-01-28 00:02 guestd_version.h --r--r--r-- 1 mts mts 60504 2008-01-28 00:02 main.c --r--r--r-- 1 mts mts 3579 2008-01-28 00:02 Makefile.am --rw-r--r-- 1 mts mts 18526 2008-01-28 00:03 Makefile.in --r--r--r-- 1 mts mts 4717 2008-01-28 00:02 stub.c --r--r--r-- 1 mts mts 54587 2008-01-28 00:02 toolsDaemon.c --r--r--r-- 1 mts mts 4035 2008-01-28 00:02 toolsDaemon.h - -open-vm-tools-2008.01.23-74039/hgfsclient: -total 76 --r--r--r-- 1 mts mts 26425 2008-01-28 00:02 COPYING --r--r--r-- 1 mts mts 16742 2008-01-28 00:02 hgfsclient.c --r--r--r-- 1 mts mts 1562 2008-01-28 00:02 hgfsclient_version.h --r--r--r-- 1 mts mts 2197 2008-01-28 00:02 Makefile.am --rw-r--r-- 1 mts mts 15981 2008-01-28 00:03 Makefile.in --r--r--r-- 1 mts mts 2384 2008-01-28 00:02 stub.c - -open-vm-tools-2008.01.23-74039/hgfsmounter: -total 88 --r--r--r-- 1 mts mts 26425 2008-01-28 00:02 COPYING --r--r--r-- 1 mts mts 29316 2008-01-28 00:02 hgfsmounter.c --r--r--r-- 1 mts mts 1564 2008-01-28 00:02 hgfsmounter_version.h --r--r--r-- 1 mts mts 1164 2008-01-28 00:02 Makefile.am --rw-r--r-- 1 mts mts 14804 2008-01-28 00:03 Makefile.in --r--r--r-- 1 mts mts 2099 2008-01-28 00:02 stub.c - -open-vm-tools-2008.01.23-74039/lib: -total 232 -drwxr-xr-x 3 mts mts 4096 2008-01-28 00:03 atomic -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:03 auth -drwxr-xr-x 3 mts mts 4096 2008-01-28 00:03 backdoor -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:03 conf --r--r--r-- 1 mts mts 26425 2008-01-28 00:02 COPYING -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:03 deployPkg -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:03 dict -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:03 dnd -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:03 err -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:03 eventManager -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:03 file -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:03 fileUtf8 -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:03 foundryMsg -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:03 guestApp -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:03 guestInfo -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:03 hgfs -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:03 hgfsBd -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:03 hgfsServer -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:03 hgfsServerManagerGuest -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:03 hgfsServerPolicyGuest -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:03 impersonate -drwxr-xr-x 3 mts mts 4096 2008-01-28 00:02 include --r--r--r-- 1 mts mts 1781 2008-01-28 00:02 Makefile.am --rw-r--r-- 1 mts mts 16265 2008-01-28 00:03 Makefile.in -drwxr-xr-x 3 mts mts 4096 2008-01-28 00:03 message -drwxr-xr-x 3 mts mts 4096 2008-01-28 00:03 misc -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:03 netUtil -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:03 panic -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:03 panicDefault -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:03 printer -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:03 procMgr -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:03 rpcIn -drwxr-xr-x 3 mts mts 4096 2008-01-28 00:03 rpcOut -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:03 rpcVmx -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:03 SLPv2Parser -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:03 socketMgr -drwxr-xr-x 3 mts mts 4096 2008-01-28 00:03 string -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:03 strUtil -drwxr-xr-x 3 mts mts 4096 2008-01-28 00:03 sync -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:03 syncDriver -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:03 system -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:03 toolsLogger -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:03 unicode -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:03 user -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:03 vixTools -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:03 vmBackupLib -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:03 vmCheck -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:03 vmSignal -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:03 wiper - -open-vm-tools-2008.01.23-74039/lib/atomic: -total 32 --r--r--r-- 1 mts mts 1020 2008-01-28 00:02 atomic.c --r--r--r-- 1 mts mts 1042 2008-01-28 00:02 Makefile.am --rw-r--r-- 1 mts mts 18528 2008-01-28 00:03 Makefile.in -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:03 shared - -open-vm-tools-2008.01.23-74039/lib/atomic/shared: -total 20 --r--r--r-- 1 mts mts 1020 2008-01-28 00:02 Makefile.am --rw-r--r-- 1 mts mts 15550 2008-01-28 00:03 Makefile.in - -open-vm-tools-2008.01.23-74039/lib/auth: -total 32 --r--r--r-- 1 mts mts 8560 2008-01-28 00:02 authPosix.c --r--r--r-- 1 mts mts 1041 2008-01-28 00:02 Makefile.am --rw-r--r-- 1 mts mts 14513 2008-01-28 00:03 Makefile.in - -open-vm-tools-2008.01.23-74039/lib/backdoor: -total 52 --r--r--r-- 1 mts mts 6393 2008-01-28 00:02 backdoor.c --r--r--r-- 1 mts mts 6184 2008-01-28 00:02 backdoorGcc32.c --r--r--r-- 1 mts mts 5560 2008-01-28 00:02 backdoorGcc64.c --r--r--r-- 1 mts mts 1177 2008-01-28 00:02 Makefile.am --rw-r--r-- 1 mts mts 19226 2008-01-28 00:03 Makefile.in -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:03 shared - -open-vm-tools-2008.01.23-74039/lib/backdoor/shared: -total 24 --r--r--r-- 1 mts mts 1164 2008-01-28 00:02 Makefile.am --rw-r--r-- 1 mts mts 18103 2008-01-28 00:03 Makefile.in - -open-vm-tools-2008.01.23-74039/lib/conf: -total 28 --r--r--r-- 1 mts mts 5019 2008-01-28 00:02 conf.c --r--r--r-- 1 mts mts 1005 2008-01-28 00:02 Makefile.am --rw-r--r-- 1 mts mts 14480 2008-01-28 00:03 Makefile.in - -open-vm-tools-2008.01.23-74039/lib/deployPkg: -total 40 --r--r--r-- 1 mts mts 8560 2008-01-28 00:02 deployPkg.c --r--r--r-- 1 mts mts 3232 2008-01-28 00:02 deployPkgLog.c --r--r--r-- 1 mts mts 1112 2008-01-28 00:02 Makefile.am --rw-r--r-- 1 mts mts 14849 2008-01-28 00:03 Makefile.in --r--r--r-- 1 mts mts 3591 2008-01-28 00:02 runDeployPkgPosix.c - -open-vm-tools-2008.01.23-74039/lib/dict: -total 36 --r--r--r-- 1 mts mts 14687 2008-01-28 00:02 dictll.c --r--r--r-- 1 mts mts 1008 2008-01-28 00:02 Makefile.am --rw-r--r-- 1 mts mts 14486 2008-01-28 00:03 Makefile.in - -open-vm-tools-2008.01.23-74039/lib/dnd: -total 56 --r--r--r-- 1 mts mts 17786 2008-01-28 00:02 dndCommon.c --r--r--r-- 1 mts mts 15835 2008-01-28 00:02 dndLinux.c --r--r--r-- 1 mts mts 1038 2008-01-28 00:02 Makefile.am --rw-r--r-- 1 mts mts 14576 2008-01-28 00:03 Makefile.in - -open-vm-tools-2008.01.23-74039/lib/err: -total 28 --r--r--r-- 1 mts mts 1401 2008-01-28 00:02 err.c --r--r--r-- 1 mts mts 1510 2008-01-28 00:02 errPosix.c --r--r--r-- 1 mts mts 1033 2008-01-28 00:02 Makefile.am --rw-r--r-- 1 mts mts 14558 2008-01-28 00:03 Makefile.in - -open-vm-tools-2008.01.23-74039/lib/eventManager: -total 28 --r--r--r-- 1 mts mts 7069 2008-01-28 00:02 eventManager.c --r--r--r-- 1 mts mts 1037 2008-01-28 00:02 Makefile.am --rw-r--r-- 1 mts mts 14672 2008-01-28 00:03 Makefile.in - -open-vm-tools-2008.01.23-74039/lib/file: -total 284 --r--r--r-- 1 mts mts 46921 2008-01-28 00:02 file.c --r--r--r-- 1 mts mts 13029 2008-01-28 00:02 fileIO.c --r--r--r-- 1 mts mts 55797 2008-01-28 00:02 fileIOPosix.c --r--r--r-- 1 mts mts 26874 2008-01-28 00:02 fileLockPosix.c --r--r--r-- 1 mts mts 44051 2008-01-28 00:02 fileLockPrimitive.c --r--r--r-- 1 mts mts 62381 2008-01-28 00:02 filePosix.c --r--r--r-- 1 mts mts 1213 2008-01-28 00:02 Makefile.am --rw-r--r-- 1 mts mts 15065 2008-01-28 00:03 Makefile.in - -open-vm-tools-2008.01.23-74039/lib/fileUtf8: -total 48 --r--r--r-- 1 mts mts 5590 2008-01-28 00:02 fileUTF8.c --r--r--r-- 1 mts mts 18573 2008-01-28 00:02 fileUTF8Linux.c --r--r--r-- 1 mts mts 1062 2008-01-28 00:02 Makefile.am --rw-r--r-- 1 mts mts 14693 2008-01-28 00:03 Makefile.in - -open-vm-tools-2008.01.23-74039/lib/foundryMsg: -total 104 --r--r--r-- 1 mts mts 22427 2008-01-28 00:02 foundryMsg.c --r--r--r-- 1 mts mts 41064 2008-01-28 00:02 foundryPropertyListCommon.c --r--r--r-- 1 mts mts 6262 2008-01-28 00:02 foundryThreads.c --r--r--r-- 1 mts mts 1183 2008-01-28 00:02 Makefile.am --rw-r--r-- 1 mts mts 15059 2008-01-28 00:03 Makefile.in --r--r--r-- 1 mts mts 7402 2008-01-28 00:02 vixTranslateErrOpenSource.c - -open-vm-tools-2008.01.23-74039/lib/guestApp: -total 72 --r--r--r-- 1 mts mts 43988 2008-01-28 00:02 guestApp.c --r--r--r-- 1 mts mts 5706 2008-01-28 00:02 guestAppPosix.c --r--r--r-- 1 mts mts 1062 2008-01-28 00:02 Makefile.am --rw-r--r-- 1 mts mts 14693 2008-01-28 00:03 Makefile.in - -open-vm-tools-2008.01.23-74039/lib/guestInfo: -total 100 --r--r--r-- 1 mts mts 30360 2008-01-28 00:02 guestInfoPosix.c --r--r--r-- 1 mts mts 47498 2008-01-28 00:02 guestInfoServer.c --r--r--r-- 1 mts mts 1102 2008-01-28 00:02 Makefile.am --rw-r--r-- 1 mts mts 14756 2008-01-28 00:03 Makefile.in - -open-vm-tools-2008.01.23-74039/lib/hgfs: -total 88 --r--r--r-- 1 mts mts 12055 2008-01-28 00:02 cpName.c --r--r--r-- 1 mts mts 5773 2008-01-28 00:02 cpNameLinux.c --r--r--r-- 1 mts mts 2652 2008-01-28 00:02 cpNameLite.c --r--r--r-- 1 mts mts 9101 2008-01-28 00:02 cpNameUtil.c --r--r--r-- 1 mts mts 1463 2008-01-28 00:02 cpNameUtilInt.h --r--r--r-- 1 mts mts 5599 2008-01-28 00:02 cpNameUtilLinux.c --r--r--r-- 1 mts mts 6832 2008-01-28 00:02 hgfsUtil.c --r--r--r-- 1 mts mts 1217 2008-01-28 00:02 Makefile.am --rw-r--r-- 1 mts mts 15164 2008-01-28 00:03 Makefile.in --r--r--r-- 1 mts mts 8833 2008-01-28 00:02 staticEscape.c - -open-vm-tools-2008.01.23-74039/lib/hgfsBd: -total 32 --r--r--r-- 1 mts mts 8699 2008-01-28 00:02 hgfsBd.c --r--r--r-- 1 mts mts 1013 2008-01-28 00:02 Makefile.am --rw-r--r-- 1 mts mts 14528 2008-01-28 00:03 Makefile.in - -open-vm-tools-2008.01.23-74039/lib/hgfsServer: -total 292 --r--r--r-- 1 mts mts 140841 2008-01-28 00:02 hgfsServer.c --r--r--r-- 1 mts mts 126773 2008-01-28 00:02 hgfsServerLinux.c --r--r--r-- 1 mts mts 1112 2008-01-28 00:02 Makefile.am --rw-r--r-- 1 mts mts 14775 2008-01-28 00:03 Makefile.in - -open-vm-tools-2008.01.23-74039/lib/hgfsServerManagerGuest: -total 28 --r--r--r-- 1 mts mts 6621 2008-01-28 00:02 hgfsServerManagerGuest.c --r--r--r-- 1 mts mts 1077 2008-01-28 00:02 Makefile.am --rw-r--r-- 1 mts mts 14920 2008-01-28 00:03 Makefile.in - -open-vm-tools-2008.01.23-74039/lib/hgfsServerPolicyGuest: -total 36 --r--r--r-- 1 mts mts 13836 2008-01-28 00:02 hgfsServerPolicyGuest.c --r--r--r-- 1 mts mts 1073 2008-01-28 00:02 Makefile.am --rw-r--r-- 1 mts mts 14896 2008-01-28 00:03 Makefile.in - -open-vm-tools-2008.01.23-74039/lib/impersonate: -total 40 --r--r--r-- 1 mts mts 8174 2008-01-28 00:02 impersonate.c --r--r--r-- 1 mts mts 11863 2008-01-28 00:02 impersonatePosix.c --r--r--r-- 1 mts mts 1118 2008-01-28 00:02 Makefile.am --rw-r--r-- 1 mts mts 14802 2008-01-28 00:03 Makefile.in - -open-vm-tools-2008.01.23-74039/lib/include: -total 1136 --r--r--r-- 1 mts mts 2190 2008-01-28 00:02 auth.h --r--r--r-- 1 mts mts 5734 2008-01-28 00:02 backdoor_def.h --r--r--r-- 1 mts mts 1347 2008-01-28 00:02 backdoor.h --r--r--r-- 1 mts mts 1042 2008-01-28 00:02 backdoorInt.h --r--r--r-- 1 mts mts 3553 2008-01-28 00:02 backdoor_types.h --r--r--r-- 1 mts mts 1684 2008-01-28 00:02 base64.h --r--r--r-- 1 mts mts 1904 2008-01-28 00:02 bsd_output.h --r--r--r-- 1 mts mts 4381 2008-01-28 00:02 bsd_output_int.h --r--r--r-- 1 mts mts 269 2008-01-28 00:02 buildNumber.h --r--r--r-- 1 mts mts 10251 2008-01-28 00:02 circList.h --r--r--r-- 1 mts mts 3412 2008-01-28 00:02 codeset.h -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:02 compat --r--r--r-- 1 mts mts 3875 2008-01-28 00:02 conf.h --r--r--r-- 1 mts mts 4796 2008-01-28 00:02 config.h --r--r--r-- 1 mts mts 4184 2008-01-28 00:02 cpName.h --r--r--r-- 1 mts mts 1808 2008-01-28 00:02 cpNameInt.h --r--r--r-- 1 mts mts 1720 2008-01-28 00:02 cpNameLite.h --r--r--r-- 1 mts mts 2607 2008-01-28 00:02 cpNameUtil.h --r--r--r-- 1 mts mts 3074 2008-01-28 00:02 cpuid_info.h --r--r--r-- 1 mts mts 3414 2008-01-28 00:02 cryptoError.h --r--r--r-- 1 mts mts 2360 2008-01-28 00:02 dbllnklst.h --r--r--r-- 1 mts mts 1290 2008-01-28 00:02 debug.h --r--r--r-- 1 mts mts 1100 2008-01-28 00:02 deployPkg.h --r--r--r-- 1 mts mts 1111 2008-01-28 00:02 deployPkgLog.h --r--r--r-- 1 mts mts 1726 2008-01-28 00:02 dictll.h --r--r--r-- 1 mts mts 4313 2008-01-28 00:02 dnd.h --r--r--r-- 1 mts mts 1588 2008-01-28 00:02 dndInt.h --r--r--r-- 1 mts mts 2618 2008-01-28 00:02 dynbuf.h --r--r--r-- 1 mts mts 1695 2008-01-28 00:02 embed_version.h --r--r--r-- 1 mts mts 2655 2008-01-28 00:02 err.h --r--r--r-- 1 mts mts 2042 2008-01-28 00:02 escape.h --r--r--r-- 1 mts mts 3842 2008-01-28 00:02 escBitvector.h --r--r--r-- 1 mts mts 1525 2008-01-28 00:02 eventManager.h --r--r--r-- 1 mts mts 3327 2008-01-28 00:02 file_extensions.h --r--r--r-- 1 mts mts 8494 2008-01-28 00:02 file.h --r--r--r-- 1 mts mts 5846 2008-01-28 00:02 fileInt.h --r--r--r-- 1 mts mts 12782 2008-01-28 00:02 fileIO.h --r--r--r-- 1 mts mts 2394 2008-01-28 00:02 fileLock.h --r--r--r-- 1 mts mts 2939 2008-01-28 00:02 fileUTF8.h --r--r--r-- 1 mts mts 2113 2008-01-28 00:02 foundryThreads.h --r--r--r-- 1 mts mts 4837 2008-01-28 00:02 guestApp.h --r--r--r-- 1 mts mts 7098 2008-01-28 00:02 guestInfo.h --r--r--r-- 1 mts mts 1386 2008-01-28 00:02 guestInfoInt.h --r--r--r-- 1 mts mts 1401 2008-01-28 00:02 guestInfoServer.h --r--r--r-- 1 mts mts 2853 2008-01-28 00:02 guest_msg_def.h --r--r--r-- 1 mts mts 5891 2008-01-28 00:02 guest_os.h --r--r--r-- 1 mts mts 2073 2008-01-28 00:02 hash.h --r--r--r-- 1 mts mts 1460 2008-01-28 00:02 hgfsBd.h --r--r--r-- 1 mts mts 2545 2008-01-28 00:02 hgfsDevLinux.h --r--r--r-- 1 mts mts 8396 2008-01-28 00:02 hgfs.h --r--r--r-- 1 mts mts 28755 2008-01-28 00:02 hgfsProto.h --r--r--r-- 1 mts mts 2058 2008-01-28 00:02 hgfsServer.h --r--r--r-- 1 mts mts 25409 2008-01-28 00:02 hgfsServerInt.h --r--r--r-- 1 mts mts 2198 2008-01-28 00:02 hgfsServerManager.h --r--r--r-- 1 mts mts 2706 2008-01-28 00:02 hgfsServerPolicy.h --r--r--r-- 1 mts mts 3676 2008-01-28 00:02 hgfsUtil.h --r--r--r-- 1 mts mts 1270 2008-01-28 00:02 hgfsVirtualDir.h --r--r--r-- 1 mts mts 3363 2008-01-28 00:02 hostinfo.h --r--r--r-- 1 mts mts 1265 2008-01-28 00:02 hostType.h --r--r--r-- 1 mts mts 1647 2008-01-28 00:02 impersonate.h --r--r--r-- 1 mts mts 2017 2008-01-28 00:02 impersonateInt.h --r--r--r-- 1 mts mts 4272 2008-01-28 00:02 includeCheck.h --r--r--r-- 1 mts mts 4741 2008-01-28 00:02 iovector.h --r--r--r-- 1 mts mts 1286 2008-01-28 00:02 localconfig.h --r--r--r-- 1 mts mts 3864 2008-01-28 00:02 log.h --r--r--r-- 1 mts mts 3873 2008-01-28 00:02 loglevel_defs.h --r--r--r-- 1 mts mts 5318 2008-01-28 00:02 loglevel_user.h --r--r--r-- 1 mts mts 3539 2008-01-28 00:02 message.h --r--r--r-- 1 mts mts 1254 2008-01-28 00:02 miscSolaris.h --r--r--r-- 1 mts mts 7453 2008-01-28 00:02 mntinfo.h --r--r--r-- 1 mts mts 3776 2008-01-28 00:02 msgfmt.h --r--r--r-- 1 mts mts 8377 2008-01-28 00:02 msg.h --r--r--r-- 1 mts mts 1576 2008-01-28 00:02 netutil.h --r--r--r-- 1 mts mts 5663 2008-01-28 00:02 osNames.h --r--r--r-- 1 mts mts 2570 2008-01-28 00:02 panic.h --r--r--r-- 1 mts mts 2009 2008-01-28 00:02 preference.h --r--r--r-- 1 mts mts 1379 2008-01-28 00:02 printer.h --r--r--r-- 1 mts mts 4622 2008-01-28 00:02 procMgr.h --r--r--r-- 1 mts mts 3152 2008-01-28 00:02 productState.h --r--r--r-- 1 mts mts 1330 2008-01-28 00:02 random.h --r--r--r-- 1 mts mts 1148 2008-01-28 00:02 removable_device.h --r--r--r-- 1 mts mts 2319 2008-01-28 00:02 rpcin.h --r--r--r-- 1 mts mts 1973 2008-01-28 00:02 rpcout.h --r--r--r-- 1 mts mts 2694 2008-01-28 00:02 rpcvmx.h --r--r--r-- 1 mts mts 2134 2008-01-28 00:02 runDeployPkgInt.h --r--r--r-- 1 mts mts 4868 2008-01-28 00:02 safetime.h --r--r--r-- 1 mts mts 1921 2008-01-28 00:02 SLPv2.h --r--r--r-- 1 mts mts 12714 2008-01-28 00:02 SLPv2Private.h --r--r--r-- 1 mts mts 3470 2008-01-28 00:02 socketMgr.h --r--r--r-- 1 mts mts 2491 2008-01-28 00:02 staticEscape.h --r--r--r-- 1 mts mts 2359 2008-01-28 00:02 stats_file.h --r--r--r-- 1 mts mts 3266 2008-01-28 00:02 stats_user_defs.h --r--r--r-- 1 mts mts 9160 2008-01-28 00:02 stats_user_setup.h --r--r--r-- 1 mts mts 7004 2008-01-28 00:02 str.h --r--r--r-- 1 mts mts 2335 2008-01-28 00:02 strutil.h --r--r--r-- 1 mts mts 3409 2008-01-28 00:02 su.h --r--r--r-- 1 mts mts 2047 2008-01-28 00:02 syncDriver.h --r--r--r-- 1 mts mts 1550 2008-01-28 00:02 syncDriverIoc.h --r--r--r-- 1 mts mts 2236 2008-01-28 00:02 syncEvent.h --r--r--r-- 1 mts mts 1891 2008-01-28 00:02 syncMutex.h --r--r--r-- 1 mts mts 3386 2008-01-28 00:02 syncWaitQ.h --r--r--r-- 1 mts mts 2724 2008-01-28 00:02 system.h --r--r--r-- 1 mts mts 3168 2008-01-28 00:02 timeutil.h --r--r--r-- 1 mts mts 1737 2008-01-28 00:02 toolsDeployPkg.h --r--r--r-- 1 mts mts 2376 2008-01-28 00:02 toolsLogger.h --r--r--r-- 1 mts mts 1514 2008-01-28 00:02 toolsLoggerInt.h --r--r--r-- 1 mts mts 9128 2008-01-28 00:02 unicodeBase.h --r--r--r-- 1 mts mts 1403 2008-01-28 00:02 unicode.h --r--r--r-- 1 mts mts 1537 2008-01-28 00:02 unicodeInt.h --r--r--r-- 1 mts mts 20742 2008-01-28 00:02 unicodeOperations.h --r--r--r-- 1 mts mts 4797 2008-01-28 00:02 unicodeTypes.h --r--r--r-- 1 mts mts 14336 2008-01-28 00:02 util.h --r--r--r-- 1 mts mts 2980 2008-01-28 00:02 util_shared.h --r--r--r-- 1 mts mts 1818 2008-01-28 00:02 uuid.h --r--r--r-- 1 mts mts 56673 2008-01-28 00:02 vixCommands.h --r--r--r-- 1 mts mts 33683 2008-01-28 00:02 vix.h --r--r--r-- 1 mts mts 13730 2008-01-28 00:02 vixOpenSource.h --r--r--r-- 1 mts mts 3865 2008-01-28 00:02 vixTools.h --r--r--r-- 1 mts mts 3958 2008-01-28 00:02 vm_app.h --r--r--r-- 1 mts mts 9998 2008-01-28 00:02 vm_assert.h --r--r--r-- 1 mts mts 52788 2008-01-28 00:02 vm_atomic.h --r--r--r-- 1 mts mts 3324 2008-01-28 00:02 vmbackup_def.h --r--r--r-- 1 mts mts 6581 2008-01-28 00:02 vmBackup.h --r--r--r-- 1 mts mts 17569 2008-01-28 00:02 vm_basic_asm.h --r--r--r-- 1 mts mts 8569 2008-01-28 00:02 vm_basic_asm_x86_64.h --r--r--r-- 1 mts mts 16053 2008-01-28 00:02 vm_basic_asm_x86.h --r--r--r-- 1 mts mts 12289 2008-01-28 00:02 vm_basic_defs.h --r--r--r-- 1 mts mts 21388 2008-01-28 00:02 vm_basic_types.h --r--r--r-- 1 mts mts 4270 2008-01-28 00:02 vmblock.h --r--r--r-- 1 mts mts 1261 2008-01-28 00:02 vmcheck.h --r--r--r-- 1 mts mts 2416 2008-01-28 00:02 vm_ctype.h --r--r--r-- 1 mts mts 14149 2008-01-28 00:02 vmGuestLib.h --r--r--r-- 1 mts mts 2104 2008-01-28 00:02 vm_legal.h --r--r--r-- 1 mts mts 16241 2008-01-28 00:02 vm_product.h --r--r--r-- 1 mts mts 1073 2008-01-28 00:02 vmSessionId.h --r--r--r-- 1 mts mts 1256 2008-01-28 00:02 vmsignal.h --r--r--r-- 1 mts mts 1322 2008-01-28 00:02 vmstdio.h --r--r--r-- 1 mts mts 28825 2008-01-28 00:02 vm_tools_version.h --r--r--r-- 1 mts mts 15306 2008-01-28 00:02 vm_version.h --r--r--r-- 1 mts mts 1899 2008-01-28 00:02 vmware.h --r--r--r-- 1 mts mts 1326 2008-01-28 00:02 vmware_pack_begin.h --r--r--r-- 1 mts mts 1346 2008-01-28 00:02 vmware_pack_end.h --r--r--r-- 1 mts mts 1966 2008-01-28 00:02 vmware_pack_init.h --r--r--r-- 1 mts mts 2737 2008-01-28 00:02 wiper.h --r--r--r-- 1 mts mts 31566 2008-01-28 00:02 x86cpuid.h - -open-vm-tools-2008.01.23-74039/lib/include/compat: -total 4 --r--r--r-- 1 mts mts 1892 2008-01-28 00:02 compat_stdarg.h - -open-vm-tools-2008.01.23-74039/lib/message: -total 68 --r--r--r-- 1 mts mts 1126 2008-01-28 00:02 Makefile.am --rw-r--r-- 1 mts mts 18789 2008-01-28 00:03 Makefile.in --r--r--r-- 1 mts mts 17275 2008-01-28 00:02 messageBackdoor.c --r--r--r-- 1 mts mts 8264 2008-01-28 00:02 message.c --r--r--r-- 1 mts mts 4737 2008-01-28 00:02 messageStub.c -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:03 shared - -open-vm-tools-2008.01.23-74039/lib/message/shared: -total 24 --r--r--r-- 1 mts mts 1113 2008-01-28 00:02 Makefile.am --rw-r--r-- 1 mts mts 17721 2008-01-28 00:03 Makefile.in - -open-vm-tools-2008.01.23-74039/lib/misc: -total 276 --r--r--r-- 1 mts mts 15371 2008-01-28 00:02 base64.c --r--r--r-- 1 mts mts 44783 2008-01-28 00:02 codeset.c --r--r--r-- 1 mts mts 8227 2008-01-28 00:02 dbllnklst.c --r--r--r-- 1 mts mts 9619 2008-01-28 00:02 dynbuf.c --r--r--r-- 1 mts mts 13760 2008-01-28 00:02 escape.c --r--r--r-- 1 mts mts 14053 2008-01-28 00:02 hash.c --r--r--r-- 1 mts mts 5929 2008-01-28 00:02 hostinfo_misc.c --r--r--r-- 1 mts mts 8216 2008-01-28 00:02 hostname.c --r--r--r-- 1 mts mts 22598 2008-01-28 00:02 idLinux.c --r--r--r-- 1 mts mts 24746 2008-01-28 00:02 iovector.c --r--r--r-- 1 mts mts 14896 2008-01-28 00:02 machineID.c --r--r--r-- 1 mts mts 1545 2008-01-28 00:02 Makefile.am --rw-r--r-- 1 mts mts 20052 2008-01-28 00:03 Makefile.in --r--r--r-- 1 mts mts 2003 2008-01-28 00:02 miscSolaris.c --r--r--r-- 1 mts mts 5929 2008-01-28 00:02 random.c -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:03 shared --r--r--r-- 1 mts mts 14388 2008-01-28 00:02 timeutil.c --r--r--r-- 1 mts mts 7040 2008-01-28 00:02 util_misc.c --r--r--r-- 1 mts mts 6619 2008-01-28 00:02 vmstdio.c - -open-vm-tools-2008.01.23-74039/lib/misc/shared: -total 36 --r--r--r-- 1 mts mts 1584 2008-01-28 00:02 Makefile.am --rw-r--r-- 1 mts mts 30238 2008-01-28 00:03 Makefile.in - -open-vm-tools-2008.01.23-74039/lib/netUtil: -total 28 --r--r--r-- 1 mts mts 1022 2008-01-28 00:02 Makefile.am --rw-r--r-- 1 mts mts 14567 2008-01-28 00:03 Makefile.in --r--r--r-- 1 mts mts 7403 2008-01-28 00:02 netUtilLinux.c - -open-vm-tools-2008.01.23-74039/lib/panic: -total 36 --r--r--r-- 1 mts mts 1009 2008-01-28 00:02 Makefile.am --rw-r--r-- 1 mts mts 14504 2008-01-28 00:03 Makefile.in --r--r--r-- 1 mts mts 12931 2008-01-28 00:02 panic.c - -open-vm-tools-2008.01.23-74039/lib/panicDefault: -total 24 --r--r--r-- 1 mts mts 1030 2008-01-28 00:02 Makefile.am --rw-r--r-- 1 mts mts 14651 2008-01-28 00:03 Makefile.in --r--r--r-- 1 mts mts 1474 2008-01-28 00:02 panic.c - -open-vm-tools-2008.01.23-74039/lib/printer: -total 32 --r--r--r-- 1 mts mts 1017 2008-01-28 00:02 Makefile.am --rw-r--r-- 1 mts mts 14552 2008-01-28 00:03 Makefile.in --r--r--r-- 1 mts mts 9652 2008-01-28 00:02 printer.c - -open-vm-tools-2008.01.23-74039/lib/procMgr: -total 56 --r--r--r-- 1 mts mts 1057 2008-01-28 00:02 Makefile.am --rw-r--r-- 1 mts mts 14589 2008-01-28 00:03 Makefile.in --r--r--r-- 1 mts mts 32851 2008-01-28 00:02 procMgrPosix.c - -open-vm-tools-2008.01.23-74039/lib/rpcIn: -total 40 --r--r--r-- 1 mts mts 1009 2008-01-28 00:02 Makefile.am --rw-r--r-- 1 mts mts 14504 2008-01-28 00:03 Makefile.in --r--r--r-- 1 mts mts 17342 2008-01-28 00:02 rpcin.c - -open-vm-tools-2008.01.23-74039/lib/rpcOut: -total 40 --r--r--r-- 1 mts mts 1042 2008-01-28 00:02 Makefile.am --rw-r--r-- 1 mts mts 18528 2008-01-28 00:03 Makefile.in --r--r--r-- 1 mts mts 11680 2008-01-28 00:02 rpcout.c -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:03 shared - -open-vm-tools-2008.01.23-74039/lib/rpcOut/shared: -total 20 --r--r--r-- 1 mts mts 1021 2008-01-28 00:02 Makefile.am --rw-r--r-- 1 mts mts 15550 2008-01-28 00:03 Makefile.in - -open-vm-tools-2008.01.23-74039/lib/rpcVmx: -total 28 --r--r--r-- 1 mts mts 1013 2008-01-28 00:02 Makefile.am --rw-r--r-- 1 mts mts 14528 2008-01-28 00:03 Makefile.in --r--r--r-- 1 mts mts 7264 2008-01-28 00:02 rpcvmx.c - -open-vm-tools-2008.01.23-74039/lib/SLPv2Parser: -total 68 --r--r--r-- 1 mts mts 1125 2008-01-28 00:02 Makefile.am --rw-r--r-- 1 mts mts 14900 2008-01-28 00:03 Makefile.in --r--r--r-- 1 mts mts 7500 2008-01-28 00:02 SLPv2Match.c --r--r--r-- 1 mts mts 18487 2008-01-28 00:02 SLPv2MsgAssembler.c --r--r--r-- 1 mts mts 16804 2008-01-28 00:02 SLPv2MsgParser.c - -open-vm-tools-2008.01.23-74039/lib/socketMgr: -total 64 --r--r--r-- 1 mts mts 1025 2008-01-28 00:02 Makefile.am --rw-r--r-- 1 mts mts 14600 2008-01-28 00:03 Makefile.in --r--r--r-- 1 mts mts 41891 2008-01-28 00:02 socketMgr.c - -open-vm-tools-2008.01.23-74039/lib/string: -total 200 --r--r--r-- 1 mts mts 6562 2008-01-28 00:02 bsd_output_shared.c --r--r--r-- 1 mts mts 75941 2008-01-28 00:02 bsd_vsnprintf.c --r--r--r-- 1 mts mts 51742 2008-01-28 00:02 bsd_vsnwprintf.c --r--r--r-- 1 mts mts 1194 2008-01-28 00:02 Makefile.am --rw-r--r-- 1 mts mts 18911 2008-01-28 00:03 Makefile.in -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:03 shared --r--r--r-- 1 mts mts 25208 2008-01-28 00:02 str.c - -open-vm-tools-2008.01.23-74039/lib/string/shared: -total 24 --r--r--r-- 1 mts mts 1185 2008-01-28 00:02 Makefile.am --rw-r--r-- 1 mts mts 18808 2008-01-28 00:03 Makefile.in - -open-vm-tools-2008.01.23-74039/lib/strUtil: -total 36 --r--r--r-- 1 mts mts 1017 2008-01-28 00:02 Makefile.am --rw-r--r-- 1 mts mts 14552 2008-01-28 00:03 Makefile.in --r--r--r-- 1 mts mts 13261 2008-01-28 00:02 strutil.c - -open-vm-tools-2008.01.23-74039/lib/sync: -total 60 --r--r--r-- 1 mts mts 1077 2008-01-28 00:02 Makefile.am --rw-r--r-- 1 mts mts 18615 2008-01-28 00:03 Makefile.in -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:03 shared --r--r--r-- 1 mts mts 5980 2008-01-28 00:02 syncMutex.c --r--r--r-- 1 mts mts 21304 2008-01-28 00:02 syncWaitQPosix.c - -open-vm-tools-2008.01.23-74039/lib/sync/shared: -total 24 --r--r--r-- 1 mts mts 1060 2008-01-28 00:02 Makefile.am --rw-r--r-- 1 mts mts 16652 2008-01-28 00:03 Makefile.in - -open-vm-tools-2008.01.23-74039/lib/syncDriver: -total 32 --r--r--r-- 1 mts mts 1034 2008-01-28 00:02 Makefile.am --rw-r--r-- 1 mts mts 14639 2008-01-28 00:03 Makefile.in --r--r--r-- 1 mts mts 8834 2008-01-28 00:02 syncDriverPosix.c - -open-vm-tools-2008.01.23-74039/lib/system: -total 28 --r--r--r-- 1 mts mts 995 2008-01-28 00:02 Makefile.am --rw-r--r-- 1 mts mts 14543 2008-01-28 00:03 Makefile.in --r--r--r-- 1 mts mts 7332 2008-01-28 00:02 systemLinux.c - -open-vm-tools-2008.01.23-74039/lib/toolsLogger: -total 36 --r--r--r-- 1 mts mts 15158 2008-01-28 00:02 logger.c --r--r--r-- 1 mts mts 1028 2008-01-28 00:02 Makefile.am --rw-r--r-- 1 mts mts 14633 2008-01-28 00:03 Makefile.in - -open-vm-tools-2008.01.23-74039/lib/unicode: -total 92 --r--r--r-- 1 mts mts 1203 2008-01-28 00:02 Makefile.am --rw-r--r-- 1 mts mts 15104 2008-01-28 00:03 Makefile.in --r--r--r-- 1 mts mts 10491 2008-01-28 00:02 unicodeCommon.c --r--r--r-- 1 mts mts 1537 2008-01-28 00:02 unicodeInt.h --r--r--r-- 1 mts mts 16281 2008-01-28 00:02 unicodeSimpleBase.c --r--r--r-- 1 mts mts 13648 2008-01-28 00:02 unicodeSimpleOperations.c --r--r--r-- 1 mts mts 8183 2008-01-28 00:02 unicodeSimpleTypes.c --r--r--r-- 1 mts mts 6083 2008-01-28 00:02 unicodeSimpleUTF16.h --r--r--r-- 1 mts mts 4993 2008-01-28 00:02 unicodeStatic.c - -open-vm-tools-2008.01.23-74039/lib/user: -total 132 --r--r--r-- 1 mts mts 9669 2008-01-28 00:02 hostinfo.c --r--r--r-- 1 mts mts 37757 2008-01-28 00:02 hostinfoPosix.c --r--r--r-- 1 mts mts 1138 2008-01-28 00:02 Makefile.am --rw-r--r-- 1 mts mts 14825 2008-01-28 00:03 Makefile.in --r--r--r-- 1 mts mts 40510 2008-01-28 00:02 util.c --r--r--r-- 1 mts mts 16462 2008-01-28 00:02 utilPosix.c - -open-vm-tools-2008.01.23-74039/lib/vixTools: -total 128 --r--r--r-- 1 mts mts 1021 2008-01-28 00:02 Makefile.am --rw-r--r-- 1 mts mts 14576 2008-01-28 00:03 Makefile.in --r--r--r-- 1 mts mts 106069 2008-01-28 00:02 vixTools.c - -open-vm-tools-2008.01.23-74039/lib/vmBackupLib: -total 64 --r--r--r-- 1 mts mts 1118 2008-01-28 00:02 Makefile.am --rw-r--r-- 1 mts mts 14876 2008-01-28 00:03 Makefile.in --r--r--r-- 1 mts mts 10163 2008-01-28 00:02 scriptOps.c --r--r--r-- 1 mts mts 18084 2008-01-28 00:02 stateMachine.c --r--r--r-- 1 mts mts 9022 2008-01-28 00:02 syncDriverOps.c - -open-vm-tools-2008.01.23-74039/lib/vmCheck: -total 28 --r--r--r-- 1 mts mts 1017 2008-01-28 00:02 Makefile.am --rw-r--r-- 1 mts mts 14552 2008-01-28 00:03 Makefile.in --r--r--r-- 1 mts mts 5323 2008-01-28 00:02 vmcheck.c - -open-vm-tools-2008.01.23-74039/lib/vmSignal: -total 24 --r--r--r-- 1 mts mts 1021 2008-01-28 00:02 Makefile.am --rw-r--r-- 1 mts mts 14576 2008-01-28 00:03 Makefile.in --r--r--r-- 1 mts mts 3066 2008-01-28 00:02 vmsignal.c - -open-vm-tools-2008.01.23-74039/lib/wiper: -total 44 --r--r--r-- 1 mts mts 1014 2008-01-28 00:02 Makefile.am --rw-r--r-- 1 mts mts 14519 2008-01-28 00:03 Makefile.in --r--r--r-- 1 mts mts 24417 2008-01-28 00:02 wiperPosix.c - -open-vm-tools-2008.01.23-74039/libguestlib: -total 100 --r--r--r-- 1 mts mts 26425 2008-01-28 00:02 COPYING --r--r--r-- 1 mts mts 1799 2008-01-28 00:02 Makefile.am --rw-r--r-- 1 mts mts 17089 2008-01-28 00:03 Makefile.in --r--r--r-- 1 mts mts 1399 2008-01-28 00:02 stubs.c --r--r--r-- 1 mts mts 26204 2008-01-28 00:02 vmGuestLib.c --r--r--r-- 1 mts mts 4214 2008-01-28 00:02 vmGuestLibInt.h --r--r--r-- 1 mts mts 2422 2008-01-28 00:02 vmGuestLibPanic.c --r--r--r-- 1 mts mts 1533 2008-01-28 00:02 vmguestlib_version.h - -open-vm-tools-2008.01.23-74039/modules: -total 24 -drwxr-xr-x 6 mts mts 4096 2008-01-28 00:02 freebsd -drwxr-xr-x 7 mts mts 4096 2008-01-28 00:02 linux --rwxr-xr-x 1 mts mts 351 2008-01-28 00:02 Makefile.am --rw-r--r-- 1 mts mts 9721 2008-01-28 00:03 Makefile.in - -open-vm-tools-2008.01.23-74039/modules/freebsd: -total 16 -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:02 vmblock -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:02 vmhgfs -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:02 vmmemctl -drwxr-xr-x 3 mts mts 4096 2008-01-28 00:02 vmxnet - -open-vm-tools-2008.01.23-74039/modules/freebsd/vmblock: -total 220 --r--r--r-- 1 mts mts 17267 2008-01-28 00:02 block.c --r--r--r-- 1 mts mts 2375 2008-01-28 00:02 block.h --r--r--r-- 1 mts mts 1430 2008-01-28 00:02 COPYING.BSD --r--r--r-- 1 mts mts 9048 2008-01-28 00:02 dbllnklst.c --r--r--r-- 1 mts mts 3181 2008-01-28 00:02 dbllnklst.h --r--r--r-- 1 mts mts 0 2008-01-28 00:02 includeCheck.h --r--r--r-- 1 mts mts 2151 2008-01-28 00:02 Makefile --r--r--r-- 1 mts mts 5980 2008-01-28 00:02 os.h --r--r--r-- 1 mts mts 2141 2008-01-28 00:02 stubs.c --r--r--r-- 1 mts mts 1888 2008-01-28 00:02 stubs.h --r--r--r-- 1 mts mts 19458 2008-01-28 00:02 subr.c --r--r--r-- 1 mts mts 13036 2008-01-28 00:02 vfsops.c --r--r--r-- 1 mts mts 10819 2008-01-28 00:02 vm_assert.h --r--r--r-- 1 mts mts 13110 2008-01-28 00:02 vm_basic_defs.h --r--r--r-- 1 mts mts 22209 2008-01-28 00:02 vm_basic_types.h --r--r--r-- 1 mts mts 5091 2008-01-28 00:02 vmblock.h --r--r--r-- 1 mts mts 5872 2008-01-28 00:02 vmblock_k.h --r--r--r-- 1 mts mts 2720 2008-01-28 00:02 vmware.h --r--r--r-- 1 mts mts 45731 2008-01-28 00:02 vnops.c - -open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs: -total 680 --r--r--r-- 1 mts mts 6383 2008-01-28 00:02 backdoor.c --r--r--r-- 1 mts mts 5724 2008-01-28 00:02 backdoor_def.h --r--r--r-- 1 mts mts 6174 2008-01-28 00:02 backdoorGcc32.c --r--r--r-- 1 mts mts 5550 2008-01-28 00:02 backdoorGcc64.c --r--r--r-- 1 mts mts 1337 2008-01-28 00:02 backdoor.h --r--r--r-- 1 mts mts 1032 2008-01-28 00:02 backdoorInt.h --r--r--r-- 1 mts mts 3543 2008-01-28 00:02 backdoor_types.h --r--r--r-- 1 mts mts 17987 2008-01-28 00:02 COPYING --r--r--r-- 1 mts mts 12045 2008-01-28 00:02 cpName.c --r--r--r-- 1 mts mts 4174 2008-01-28 00:02 cpName.h --r--r--r-- 1 mts mts 1798 2008-01-28 00:02 cpNameInt.h --r--r--r-- 1 mts mts 5763 2008-01-28 00:02 cpNameLinux.c --r--r--r-- 1 mts mts 2642 2008-01-28 00:02 cpNameLite.c --r--r--r-- 1 mts mts 1710 2008-01-28 00:02 cpNameLite.h --r--r--r-- 1 mts mts 8217 2008-01-28 00:02 dbllnklst.c --r--r--r-- 1 mts mts 2350 2008-01-28 00:02 dbllnklst.h --r--r--r-- 1 mts mts 3142 2008-01-28 00:02 debug.c --r--r--r-- 1 mts mts 2806 2008-01-28 00:02 debug.h --r--r--r-- 1 mts mts 3832 2008-01-28 00:02 escBitvector.h --r--r--r-- 1 mts mts 2843 2008-01-28 00:02 guest_msg_def.h --r--r--r-- 1 mts mts 8689 2008-01-28 00:02 hgfsBd.c --r--r--r-- 1 mts mts 1450 2008-01-28 00:02 hgfsBd.h --r--r--r-- 1 mts mts 8386 2008-01-28 00:02 hgfs.h --r--r--r-- 1 mts mts 3484 2008-01-28 00:02 hgfs_kernel.h --r--r--r-- 1 mts mts 28745 2008-01-28 00:02 hgfsProto.h --r--r--r-- 1 mts mts 6822 2008-01-28 00:02 hgfsUtil.c --r--r--r-- 1 mts mts 3666 2008-01-28 00:02 hgfsUtil.h --r--r--r-- 1 mts mts 4262 2008-01-28 00:02 includeCheck.h --r--r--r-- 1 mts mts 6630 2008-01-28 00:02 kernelStubsBSD.c --r--r--r-- 1 mts mts 4939 2008-01-28 00:02 kernelStubs.h --r--r--r-- 1 mts mts 2467 2008-01-28 00:02 Makefile --r--r--r-- 1 mts mts 17265 2008-01-28 00:02 messageBackdoor.c --r--r--r-- 1 mts mts 8254 2008-01-28 00:02 message.c --r--r--r-- 1 mts mts 3529 2008-01-28 00:02 message.h --r--r--r-- 1 mts mts 22146 2008-01-28 00:02 request.c --r--r--r-- 1 mts mts 3184 2008-01-28 00:02 request.h --r--r--r-- 1 mts mts 6352 2008-01-28 00:02 requestInt.h --r--r--r-- 1 mts mts 11670 2008-01-28 00:02 rpcout.c --r--r--r-- 1 mts mts 1963 2008-01-28 00:02 rpcout.h --r--r--r-- 1 mts mts 6472 2008-01-28 00:02 sha1.c --r--r--r-- 1 mts mts 2176 2008-01-28 00:02 sha1.h --r--r--r-- 1 mts mts 39378 2008-01-28 00:02 state.c --r--r--r-- 1 mts mts 5930 2008-01-28 00:02 state.h --r--r--r-- 1 mts mts 8823 2008-01-28 00:02 staticEscape.c --r--r--r-- 1 mts mts 2481 2008-01-28 00:02 staticEscape.h --r--r--r-- 1 mts mts 9382 2008-01-28 00:02 vfsops.c --r--r--r-- 1 mts mts 9988 2008-01-28 00:02 vm_assert.h --r--r--r-- 1 mts mts 17559 2008-01-28 00:02 vm_basic_asm.h --r--r--r-- 1 mts mts 8559 2008-01-28 00:02 vm_basic_asm_x86_64.h --r--r--r-- 1 mts mts 16043 2008-01-28 00:02 vm_basic_asm_x86.h --r--r--r-- 1 mts mts 12279 2008-01-28 00:02 vm_basic_defs.h --r--r--r-- 1 mts mts 21378 2008-01-28 00:02 vm_basic_types.h --r--r--r-- 1 mts mts 1889 2008-01-28 00:02 vmware.h --r--r--r-- 1 mts mts 1316 2008-01-28 00:02 vmware_pack_begin.h --r--r--r-- 1 mts mts 1336 2008-01-28 00:02 vmware_pack_end.h --r--r--r-- 1 mts mts 1956 2008-01-28 00:02 vmware_pack_init.h --r--r--r-- 1 mts mts 110505 2008-01-28 00:02 vnops.c --r--r--r-- 1 mts mts 6114 2008-01-28 00:02 worker.c --r--r--r-- 1 mts mts 31556 2008-01-28 00:02 x86cpuid.h - -open-vm-tools-2008.01.23-74039/modules/freebsd/vmmemctl: -total 180 --r--r--r-- 1 mts mts 1338 2008-01-28 00:02 backdoor_balloon.h --r--r--r-- 1 mts mts 6174 2008-01-28 00:02 backdoorGcc32.c --r--r--r-- 1 mts mts 5550 2008-01-28 00:02 backdoorGcc64.c --r--r--r-- 1 mts mts 1337 2008-01-28 00:02 backdoor.h --r--r--r-- 1 mts mts 1032 2008-01-28 00:02 backdoorInt.h --r--r--r-- 1 mts mts 3543 2008-01-28 00:02 backdoor_types.h --r--r--r-- 1 mts mts 2622 2008-01-28 00:02 balloon_def.h --r--r--r-- 1 mts mts 17987 2008-01-28 00:02 COPYING --r--r--r-- 1 mts mts 4262 2008-01-28 00:02 includeCheck.h --r--r--r-- 1 mts mts 1259 2008-01-28 00:02 Makefile --r--r--r-- 1 mts mts 10240 2008-01-28 00:02 os.c --r--r--r-- 1 mts mts 2441 2008-01-28 00:02 os.h --r--r--r-- 1 mts mts 430 2008-01-28 00:02 README --r--r--r-- 1 mts mts 9988 2008-01-28 00:02 vm_assert.h --r--r--r-- 1 mts mts 37545 2008-01-28 00:02 vmballoon.c --r--r--r-- 1 mts mts 2048 2008-01-28 00:02 vmballoon.h --r--r--r-- 1 mts mts 12279 2008-01-28 00:02 vm_basic_defs.h --r--r--r-- 1 mts mts 21378 2008-01-28 00:02 vm_basic_types.h - -open-vm-tools-2008.01.23-74039/modules/freebsd/vmxnet: -total 140 -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:02 autoconf --r--r--r-- 1 mts mts 17987 2008-01-28 00:02 COPYING --r--r--r-- 1 mts mts 34864 2008-01-28 00:02 if_vxn.c --r--r--r-- 1 mts mts 0 2008-01-28 00:02 includeCheck.h --r--r--r-- 1 mts mts 1222 2008-01-28 00:02 Makefile --r--r--r-- 1 mts mts 6404 2008-01-28 00:02 net_compat.h --r--r--r-- 1 mts mts 2426 2008-01-28 00:02 net.h --r--r--r-- 1 mts mts 2240 2008-01-28 00:02 net_sg.h --r--r--r-- 1 mts mts 21378 2008-01-28 00:02 vm_basic_types.h --r--r--r-- 1 mts mts 6899 2008-01-28 00:02 vm_device_version.h --r--r--r-- 1 mts mts 2816 2008-01-28 00:02 vmnet_def.h --r--r--r-- 1 mts mts 14595 2008-01-28 00:02 vmxnet2_def.h --r--r--r-- 1 mts mts 6793 2008-01-28 00:02 vmxnet_def.h - -open-vm-tools-2008.01.23-74039/modules/freebsd/vmxnet/autoconf: -total 0 - -open-vm-tools-2008.01.23-74039/modules/linux: -total 20 -drwxr-xr-x 5 mts mts 4096 2008-01-28 00:02 vmblock -drwxr-xr-x 3 mts mts 4096 2008-01-28 00:02 vmhgfs -drwxr-xr-x 3 mts mts 4096 2008-01-28 00:02 vmmemctl -drwxr-xr-x 3 mts mts 4096 2008-01-28 00:02 vmsync -drwxr-xr-x 3 mts mts 4096 2008-01-28 00:02 vmxnet - -open-vm-tools-2008.01.23-74039/modules/linux/vmblock: -total 52 -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:02 autoconf --r--r--r-- 1 mts mts 17987 2008-01-28 00:02 COPYING -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:02 include -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:02 linux --r--r--r-- 1 mts mts 3740 2008-01-28 00:02 Makefile --r--r--r-- 1 mts mts 2009 2008-01-28 00:02 Makefile.kernel --r--r--r-- 1 mts mts 4136 2008-01-28 00:02 Makefile.normal --r--r--r-- 1 mts mts 481 2008-01-28 00:02 README - -open-vm-tools-2008.01.23-74039/modules/linux/vmblock/autoconf: -total 36 --r--r--r-- 1 mts mts 1670 2008-01-28 00:02 cachecreate.c --r--r--r-- 1 mts mts 1718 2008-01-28 00:02 cachector.c --r--r--r-- 1 mts mts 1261 2008-01-28 00:02 epoll.c --r--r--r-- 1 mts mts 1710 2008-01-28 00:02 filldir1.c --r--r--r-- 1 mts mts 1204 2008-01-28 00:02 geninclude.c --r--r--r-- 1 mts mts 1596 2008-01-28 00:02 getsb1.c --r--r--r-- 1 mts mts 1139 2008-01-28 00:02 setnice.c --r--r--r-- 1 mts mts 1259 2008-01-28 00:02 skas1.c --r--r--r-- 1 mts mts 1463 2008-01-28 00:02 statfs1.c - -open-vm-tools-2008.01.23-74039/modules/linux/vmblock/include: -total 168 --r--r--r-- 1 mts mts 6088 2008-01-28 00:02 compat_completion.h --r--r--r-- 1 mts mts 1875 2008-01-28 00:02 compat_file.h --r--r--r-- 1 mts mts 9630 2008-01-28 00:02 compat_fs.h --r--r--r-- 1 mts mts 1261 2008-01-28 00:02 compat_init.h --r--r--r-- 1 mts mts 2439 2008-01-28 00:02 compat_kernel.h --r--r--r-- 1 mts mts 1917 2008-01-28 00:02 compat_list.h --r--r--r-- 1 mts mts 4231 2008-01-28 00:02 compat_mm.h --r--r--r-- 1 mts mts 2298 2008-01-28 00:02 compat_module.h --r--r--r-- 1 mts mts 1570 2008-01-28 00:02 compat_namei.h --r--r--r-- 1 mts mts 2483 2008-01-28 00:02 compat_page.h --r--r--r-- 1 mts mts 9740 2008-01-28 00:02 compat_sched.h --r--r--r-- 1 mts mts 1456 2008-01-28 00:02 compat_semaphore.h --r--r--r-- 1 mts mts 2764 2008-01-28 00:02 compat_slab.h --r--r--r-- 1 mts mts 2438 2008-01-28 00:02 compat_spinlock.h --r--r--r-- 1 mts mts 1222 2008-01-28 00:02 compat_statfs.h --r--r--r-- 1 mts mts 1907 2008-01-28 00:02 compat_string.h --r--r--r-- 1 mts mts 3122 2008-01-28 00:02 compat_uaccess.h --r--r--r-- 1 mts mts 3189 2008-01-28 00:02 compat_version.h --r--r--r-- 1 mts mts 5434 2008-01-28 00:02 compat_wait.h --r--r--r-- 1 mts mts 2216 2008-01-28 00:02 driver-config.h --r--r--r-- 1 mts mts 0 2008-01-28 00:02 includeCheck.h --r--r--r-- 1 mts mts 9988 2008-01-28 00:02 vm_assert.h --r--r--r-- 1 mts mts 12279 2008-01-28 00:02 vm_basic_defs.h --r--r--r-- 1 mts mts 21378 2008-01-28 00:02 vm_basic_types.h --r--r--r-- 1 mts mts 4260 2008-01-28 00:02 vmblock.h --r--r--r-- 1 mts mts 1889 2008-01-28 00:02 vmware.h - -open-vm-tools-2008.01.23-74039/modules/linux/vmblock/linux: -total 140 --r--r--r-- 1 mts mts 16436 2008-01-28 00:02 block.c --r--r--r-- 1 mts mts 1544 2008-01-28 00:02 block.h --r--r--r-- 1 mts mts 8894 2008-01-28 00:02 control.c --r--r--r-- 1 mts mts 8217 2008-01-28 00:02 dbllnklst.c --r--r--r-- 1 mts mts 2350 2008-01-28 00:02 dbllnklst.h --r--r--r-- 1 mts mts 3697 2008-01-28 00:02 dentry.c --r--r--r-- 1 mts mts 8089 2008-01-28 00:02 file.c --r--r--r-- 1 mts mts 17930 2008-01-28 00:02 filesystem.c --r--r--r-- 1 mts mts 4812 2008-01-28 00:02 filesystem.h --r--r--r-- 1 mts mts 6794 2008-01-28 00:02 inode.c --r--r--r-- 1 mts mts 4286 2008-01-28 00:02 module.c --r--r--r-- 1 mts mts 4292 2008-01-28 00:02 os.h --r--r--r-- 1 mts mts 1310 2008-01-28 00:02 stubs.c --r--r--r-- 1 mts mts 1057 2008-01-28 00:02 stubs.h --r--r--r-- 1 mts mts 4793 2008-01-28 00:02 super.c --r--r--r-- 1 mts mts 3399 2008-01-28 00:02 vmblockInt.h --r--r--r-- 1 mts mts 1176 2008-01-28 00:02 vmblock_version.h - -open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs: -total 876 -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:02 autoconf --r--r--r-- 1 mts mts 6383 2008-01-28 00:02 backdoor.c --r--r--r-- 1 mts mts 5724 2008-01-28 00:02 backdoor_def.h --r--r--r-- 1 mts mts 6174 2008-01-28 00:02 backdoorGcc32.c --r--r--r-- 1 mts mts 5550 2008-01-28 00:02 backdoorGcc64.c --r--r--r-- 1 mts mts 1337 2008-01-28 00:02 backdoor.h --r--r--r-- 1 mts mts 1032 2008-01-28 00:02 backdoorInt.h --r--r--r-- 1 mts mts 3543 2008-01-28 00:02 backdoor_types.h --r--r--r-- 1 mts mts 8591 2008-01-28 00:02 bdhandler.c --r--r--r-- 1 mts mts 1167 2008-01-28 00:02 bdhandler.h --r--r--r-- 1 mts mts 6088 2008-01-28 00:02 compat_completion.h --r--r--r-- 1 mts mts 2052 2008-01-28 00:02 compat_dcache.h --r--r--r-- 1 mts mts 1875 2008-01-28 00:02 compat_file.h --r--r--r-- 1 mts mts 9630 2008-01-28 00:02 compat_fs.h --r--r--r-- 1 mts mts 1391 2008-01-28 00:02 compat_highmem.h --r--r--r-- 1 mts mts 2439 2008-01-28 00:02 compat_kernel.h --r--r--r-- 1 mts mts 1917 2008-01-28 00:02 compat_list.h --r--r--r-- 1 mts mts 4231 2008-01-28 00:02 compat_mm.h --r--r--r-- 1 mts mts 2298 2008-01-28 00:02 compat_module.h --r--r--r-- 1 mts mts 1570 2008-01-28 00:02 compat_namei.h --r--r--r-- 1 mts mts 2591 2008-01-28 00:02 compat_page-flags.h --r--r--r-- 1 mts mts 2483 2008-01-28 00:02 compat_page.h --r--r--r-- 1 mts mts 9740 2008-01-28 00:02 compat_sched.h --r--r--r-- 1 mts mts 1456 2008-01-28 00:02 compat_semaphore.h --r--r--r-- 1 mts mts 2764 2008-01-28 00:02 compat_slab.h --r--r--r-- 1 mts mts 2438 2008-01-28 00:02 compat_spinlock.h --r--r--r-- 1 mts mts 1222 2008-01-28 00:02 compat_statfs.h --r--r--r-- 1 mts mts 1907 2008-01-28 00:02 compat_string.h --r--r--r-- 1 mts mts 3122 2008-01-28 00:02 compat_uaccess.h --r--r--r-- 1 mts mts 3189 2008-01-28 00:02 compat_version.h --r--r--r-- 1 mts mts 5434 2008-01-28 00:02 compat_wait.h --r--r--r-- 1 mts mts 17987 2008-01-28 00:02 COPYING --r--r--r-- 1 mts mts 12045 2008-01-28 00:02 cpName.c --r--r--r-- 1 mts mts 4174 2008-01-28 00:02 cpName.h --r--r--r-- 1 mts mts 1798 2008-01-28 00:02 cpNameInt.h --r--r--r-- 1 mts mts 5763 2008-01-28 00:02 cpNameLinux.c --r--r--r-- 1 mts mts 2642 2008-01-28 00:02 cpNameLite.c --r--r--r-- 1 mts mts 1710 2008-01-28 00:02 cpNameLite.h --r--r--r-- 1 mts mts 2350 2008-01-28 00:02 dbllnklst.h --r--r--r-- 1 mts mts 3112 2008-01-28 00:02 dentry.c --r--r--r-- 1 mts mts 22879 2008-01-28 00:02 dir.c --r--r--r-- 1 mts mts 2216 2008-01-28 00:02 driver-config.h --r--r--r-- 1 mts mts 3832 2008-01-28 00:02 escBitvector.h --r--r--r-- 1 mts mts 33035 2008-01-28 00:02 file.c --r--r--r-- 1 mts mts 20297 2008-01-28 00:02 filesystem.c --r--r--r-- 1 mts mts 1233 2008-01-28 00:02 filesystem.h --r--r--r-- 1 mts mts 49609 2008-01-28 00:02 fsutil.c --r--r--r-- 1 mts mts 3730 2008-01-28 00:02 fsutil.h --r--r--r-- 1 mts mts 2843 2008-01-28 00:02 guest_msg_def.h --r--r--r-- 1 mts mts 8689 2008-01-28 00:02 hgfsBd.c --r--r--r-- 1 mts mts 1450 2008-01-28 00:02 hgfsBd.h --r--r--r-- 1 mts mts 2535 2008-01-28 00:02 hgfsDevLinux.h --r--r--r-- 1 mts mts 8386 2008-01-28 00:02 hgfs.h --r--r--r-- 1 mts mts 28745 2008-01-28 00:02 hgfsProto.h --r--r--r-- 1 mts mts 6822 2008-01-28 00:02 hgfsUtil.c --r--r--r-- 1 mts mts 3666 2008-01-28 00:02 hgfsUtil.h --r--r--r-- 1 mts mts 4262 2008-01-28 00:02 includeCheck.h --r--r--r-- 1 mts mts 52784 2008-01-28 00:02 inode.c --r--r--r-- 1 mts mts 1318 2008-01-28 00:02 inode.h --r--r--r-- 1 mts mts 4939 2008-01-28 00:02 kernelStubs.h --r--r--r-- 1 mts mts 17779 2008-01-28 00:02 kernelStubsLinux.c --r--r--r-- 1 mts mts 5304 2008-01-28 00:02 link.c --r--r--r-- 1 mts mts 3739 2008-01-28 00:02 Makefile --r--r--r-- 1 mts mts 2291 2008-01-28 00:02 Makefile.kernel --r--r--r-- 1 mts mts 3429 2008-01-28 00:02 Makefile.normal --r--r--r-- 1 mts mts 17265 2008-01-28 00:02 messageBackdoor.c --r--r--r-- 1 mts mts 8254 2008-01-28 00:02 message.c --r--r--r-- 1 mts mts 3529 2008-01-28 00:02 message.h --r--r--r-- 1 mts mts 2677 2008-01-28 00:02 module.c --r--r--r-- 1 mts mts 8600 2008-01-28 00:02 module.h --r--r--r-- 1 mts mts 24467 2008-01-28 00:02 page.c --r--r--r-- 1 mts mts 6535 2008-01-28 00:02 request.c --r--r--r-- 1 mts mts 3690 2008-01-28 00:02 request.h --r--r--r-- 1 mts mts 11670 2008-01-28 00:02 rpcout.c --r--r--r-- 1 mts mts 1963 2008-01-28 00:02 rpcout.h --r--r--r-- 1 mts mts 8823 2008-01-28 00:02 staticEscape.c --r--r--r-- 1 mts mts 2481 2008-01-28 00:02 staticEscape.h --r--r--r-- 1 mts mts 1985 2008-01-28 00:02 stubs.c --r--r--r-- 1 mts mts 10699 2008-01-28 00:02 super.c --r--r--r-- 1 mts mts 9988 2008-01-28 00:02 vm_assert.h --r--r--r-- 1 mts mts 17559 2008-01-28 00:02 vm_basic_asm.h --r--r--r-- 1 mts mts 8559 2008-01-28 00:02 vm_basic_asm_x86_64.h --r--r--r-- 1 mts mts 16043 2008-01-28 00:02 vm_basic_asm_x86.h --r--r--r-- 1 mts mts 12279 2008-01-28 00:02 vm_basic_defs.h --r--r--r-- 1 mts mts 21378 2008-01-28 00:02 vm_basic_types.h --r--r--r-- 1 mts mts 1168 2008-01-28 00:02 vmhgfs_version.h --r--r--r-- 1 mts mts 1889 2008-01-28 00:02 vmware.h --r--r--r-- 1 mts mts 1316 2008-01-28 00:02 vmware_pack_begin.h --r--r--r-- 1 mts mts 1336 2008-01-28 00:02 vmware_pack_end.h --r--r--r-- 1 mts mts 1956 2008-01-28 00:02 vmware_pack_init.h --r--r--r-- 1 mts mts 31556 2008-01-28 00:02 x86cpuid.h - -open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/autoconf: -total 36 --r--r--r-- 1 mts mts 1670 2008-01-28 00:02 cachecreate.c --r--r--r-- 1 mts mts 1718 2008-01-28 00:02 cachector.c --r--r--r-- 1 mts mts 1261 2008-01-28 00:02 epoll.c --r--r--r-- 1 mts mts 1204 2008-01-28 00:02 geninclude.c --r--r--r-- 1 mts mts 1596 2008-01-28 00:02 getsb1.c --r--r--r-- 1 mts mts 1473 2008-01-28 00:02 inode1.c --r--r--r-- 1 mts mts 1345 2008-01-28 00:02 maxbytes.c --r--r--r-- 1 mts mts 1139 2008-01-28 00:02 setnice.c --r--r--r-- 1 mts mts 1463 2008-01-28 00:02 statfs1.c - -open-vm-tools-2008.01.23-74039/modules/linux/vmmemctl: -total 280 -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:02 autoconf --r--r--r-- 1 mts mts 1338 2008-01-28 00:02 backdoor_balloon.h --r--r--r-- 1 mts mts 5724 2008-01-28 00:02 backdoor_def.h --r--r--r-- 1 mts mts 6174 2008-01-28 00:02 backdoorGcc32.c --r--r--r-- 1 mts mts 5550 2008-01-28 00:02 backdoorGcc64.c --r--r--r-- 1 mts mts 1337 2008-01-28 00:02 backdoor.h --r--r--r-- 1 mts mts 1032 2008-01-28 00:02 backdoorInt.h --r--r--r-- 1 mts mts 3543 2008-01-28 00:02 backdoor_types.h --r--r--r-- 1 mts mts 2622 2008-01-28 00:02 balloon_def.h --r--r--r-- 1 mts mts 6088 2008-01-28 00:02 compat_completion.h --r--r--r-- 1 mts mts 1875 2008-01-28 00:02 compat_file.h --r--r--r-- 1 mts mts 2439 2008-01-28 00:02 compat_kernel.h --r--r--r-- 1 mts mts 1917 2008-01-28 00:02 compat_list.h --r--r--r-- 1 mts mts 4231 2008-01-28 00:02 compat_mm.h --r--r--r-- 1 mts mts 2298 2008-01-28 00:02 compat_module.h --r--r--r-- 1 mts mts 2483 2008-01-28 00:02 compat_page.h --r--r--r-- 1 mts mts 9740 2008-01-28 00:02 compat_sched.h --r--r--r-- 1 mts mts 1456 2008-01-28 00:02 compat_semaphore.h --r--r--r-- 1 mts mts 2438 2008-01-28 00:02 compat_spinlock.h --r--r--r-- 1 mts mts 3189 2008-01-28 00:02 compat_version.h --r--r--r-- 1 mts mts 5434 2008-01-28 00:02 compat_wait.h --r--r--r-- 1 mts mts 17987 2008-01-28 00:02 COPYING --r--r--r-- 1 mts mts 2216 2008-01-28 00:02 driver-config.h --r--r--r-- 1 mts mts 4262 2008-01-28 00:02 includeCheck.h --r--r--r-- 1 mts mts 3741 2008-01-28 00:02 Makefile --r--r--r-- 1 mts mts 1696 2008-01-28 00:02 Makefile.kernel --r--r--r-- 1 mts mts 2868 2008-01-28 00:02 Makefile.normal --r--r--r-- 1 mts mts 14180 2008-01-28 00:02 os.c --r--r--r-- 1 mts mts 2441 2008-01-28 00:02 os.h --r--r--r-- 1 mts mts 453 2008-01-28 00:02 README --r--r--r-- 1 mts mts 9988 2008-01-28 00:02 vm_assert.h --r--r--r-- 1 mts mts 37545 2008-01-28 00:02 vmballoon.c --r--r--r-- 1 mts mts 2048 2008-01-28 00:02 vmballoon.h --r--r--r-- 1 mts mts 12279 2008-01-28 00:02 vm_basic_defs.h --r--r--r-- 1 mts mts 21378 2008-01-28 00:02 vm_basic_types.h --r--r--r-- 1 mts mts 1193 2008-01-28 00:02 vmmemctl_version.h - -open-vm-tools-2008.01.23-74039/modules/linux/vmmemctl/autoconf: -total 12 --r--r--r-- 1 mts mts 1261 2008-01-28 00:02 epoll.c --r--r--r-- 1 mts mts 1204 2008-01-28 00:02 geninclude.c --r--r--r-- 1 mts mts 1139 2008-01-28 00:02 setnice.c - -open-vm-tools-2008.01.23-74039/modules/linux/vmsync: -total 104 -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:02 autoconf --r--r--r-- 1 mts mts 9630 2008-01-28 00:02 compat_fs.h --r--r--r-- 1 mts mts 2298 2008-01-28 00:02 compat_module.h --r--r--r-- 1 mts mts 1570 2008-01-28 00:02 compat_namei.h --r--r--r-- 1 mts mts 2764 2008-01-28 00:02 compat_slab.h --r--r--r-- 1 mts mts 3189 2008-01-28 00:02 compat_version.h --r--r--r-- 1 mts mts 2329 2008-01-28 00:02 compat_workqueue.h --r--r--r-- 1 mts mts 17987 2008-01-28 00:02 COPYING --r--r--r-- 1 mts mts 2216 2008-01-28 00:02 driver-config.h --r--r--r-- 1 mts mts 4262 2008-01-28 00:02 includeCheck.h --r--r--r-- 1 mts mts 3739 2008-01-28 00:02 Makefile --r--r--r-- 1 mts mts 1473 2008-01-28 00:02 Makefile.kernel --r--r--r-- 1 mts mts 18644 2008-01-28 00:02 sync.c --r--r--r-- 1 mts mts 1540 2008-01-28 00:02 syncDriverIoc.h --r--r--r-- 1 mts mts 1168 2008-01-28 00:02 vmsync_version.h - -open-vm-tools-2008.01.23-74039/modules/linux/vmsync/autoconf: -total 8 --r--r--r-- 1 mts mts 1670 2008-01-28 00:02 cachecreate.c --r--r--r-- 1 mts mts 1718 2008-01-28 00:02 cachector.c - -open-vm-tools-2008.01.23-74039/modules/linux/vmxnet: -total 276 -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:02 autoconf --r--r--r-- 1 mts mts 1966 2008-01-28 00:02 bpf_meta.h --r--r--r-- 1 mts mts 1734 2008-01-28 00:02 compat_ethtool.h --r--r--r-- 1 mts mts 1391 2008-01-28 00:02 compat_highmem.h --r--r--r-- 1 mts mts 1261 2008-01-28 00:02 compat_init.h --r--r--r-- 1 mts mts 1700 2008-01-28 00:02 compat_interrupt.h --r--r--r-- 1 mts mts 1338 2008-01-28 00:02 compat_ioport.h --r--r--r-- 1 mts mts 2298 2008-01-28 00:02 compat_module.h --r--r--r-- 1 mts mts 5059 2008-01-28 00:02 compat_netdevice.h --r--r--r-- 1 mts mts 12225 2008-01-28 00:02 compat_pci.h --r--r--r-- 1 mts mts 4106 2008-01-28 00:02 compat_skbuff.h --r--r--r-- 1 mts mts 2764 2008-01-28 00:02 compat_slab.h --r--r--r-- 1 mts mts 2438 2008-01-28 00:02 compat_spinlock.h --r--r--r-- 1 mts mts 2795 2008-01-28 00:02 compat_timer.h --r--r--r-- 1 mts mts 3189 2008-01-28 00:02 compat_version.h --r--r--r-- 1 mts mts 17987 2008-01-28 00:02 COPYING --r--r--r-- 1 mts mts 2216 2008-01-28 00:02 driver-config.h --r--r--r-- 1 mts mts 4262 2008-01-28 00:02 includeCheck.h --r--r--r-- 1 mts mts 3739 2008-01-28 00:02 Makefile --r--r--r-- 1 mts mts 1279 2008-01-28 00:02 Makefile.kernel --r--r--r-- 1 mts mts 2665 2008-01-28 00:02 Makefile.normal --r--r--r-- 1 mts mts 2426 2008-01-28 00:02 net.h --r--r--r-- 1 mts mts 2240 2008-01-28 00:02 net_sg.h --r--r--r-- 1 mts mts 460 2008-01-28 00:02 README --r--r--r-- 1 mts mts 21378 2008-01-28 00:02 vm_basic_types.h --r--r--r-- 1 mts mts 6899 2008-01-28 00:02 vm_device_version.h --r--r--r-- 1 mts mts 2816 2008-01-28 00:02 vmnet_def.h --r--r--r-- 1 mts mts 14595 2008-01-28 00:02 vmxnet2_def.h --r--r--r-- 1 mts mts 68768 2008-01-28 00:02 vmxnet.c --r--r--r-- 1 mts mts 6793 2008-01-28 00:02 vmxnet_def.h --r--r--r-- 1 mts mts 5460 2008-01-28 00:02 vmxnetInt.h --r--r--r-- 1 mts mts 1168 2008-01-28 00:02 vmxnet_version.h - -open-vm-tools-2008.01.23-74039/modules/linux/vmxnet/autoconf: -total 8 --r--r--r-- 1 mts mts 1204 2008-01-28 00:02 geninclude.c --r--r--r-- 1 mts mts 1400 2008-01-28 00:02 skblin.c - -open-vm-tools-2008.01.23-74039/scripts: -total 44 -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:02 common --r--r--r-- 1 mts mts 26425 2008-01-28 00:02 COPYING -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:02 freebsd -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:02 linux -drwxr-xr-x 2 mts mts 4096 2008-01-28 00:02 solaris - -open-vm-tools-2008.01.23-74039/scripts/common: -total 8 --r--r--r-- 1 mts mts 7433 2008-01-28 00:02 vm-support - -open-vm-tools-2008.01.23-74039/scripts/freebsd: -total 16 --r--r--r-- 1 mts mts 1335 2008-01-28 00:02 poweroff-vm-default --r--r--r-- 1 mts mts 1334 2008-01-28 00:02 poweron-vm-default --r--r--r-- 1 mts mts 1374 2008-01-28 00:02 resume-vm-default --r--r--r-- 1 mts mts 1731 2008-01-28 00:02 suspend-vm-default - -open-vm-tools-2008.01.23-74039/scripts/linux: -total 16 --r--r--r-- 1 mts mts 1332 2008-01-28 00:02 poweroff-vm-default --r--r--r-- 1 mts mts 1332 2008-01-28 00:02 poweron-vm-default --r--r--r-- 1 mts mts 3023 2008-01-28 00:02 resume-vm-default --r--r--r-- 1 mts mts 2619 2008-01-28 00:02 suspend-vm-default - -open-vm-tools-2008.01.23-74039/scripts/solaris: -total 16 --r--r--r-- 1 mts mts 1335 2008-01-28 00:02 poweroff-vm-default --r--r--r-- 1 mts mts 1334 2008-01-28 00:02 poweron-vm-default --r--r--r-- 1 mts mts 1534 2008-01-28 00:02 resume-vm-default --r--r--r-- 1 mts mts 1885 2008-01-28 00:02 suspend-vm-default - -open-vm-tools-2008.01.23-74039/toolbox: -total 176 --r--r--r-- 1 mts mts 2696 2008-01-28 00:02 bigIcon.xpm --r--r--r-- 1 mts mts 26425 2008-01-28 00:02 COPYING --r--r--r-- 1 mts mts 5793 2008-01-28 00:02 debugStdio.c --r--r--r-- 1 mts mts 2653 2008-01-28 00:02 Makefile.am --rw-r--r-- 1 mts mts 17142 2008-01-28 00:03 Makefile.in --r--r--r-- 1 mts mts 458 2008-01-28 00:02 smallIcon.xpm --r--r--r-- 1 mts mts 4717 2008-01-28 00:02 stub.c --r--r--r-- 1 mts mts 6309 2008-01-28 00:02 toolboxAbout.c --r--r--r-- 1 mts mts 7071 2008-01-28 00:02 toolboxDevices.c --r--r--r-- 1 mts mts 29568 2008-01-28 00:02 toolbox-gtk.c --r--r--r-- 1 mts mts 1543 2008-01-28 00:02 toolboxgtk_version.h --r--r--r-- 1 mts mts 2821 2008-01-28 00:02 toolboxInt.h --r--r--r-- 1 mts mts 3884 2008-01-28 00:02 toolboxOptions.c --r--r--r-- 1 mts mts 24446 2008-01-28 00:02 toolboxScripts.c --r--r--r-- 1 mts mts 14812 2008-01-28 00:02 toolboxShrink.c - -open-vm-tools-2008.01.23-74039/vmware-user: -total 452 --r--r--r-- 1 mts mts 26425 2008-01-28 00:02 COPYING --r--r--r-- 1 mts mts 64258 2008-01-28 00:02 copyPaste.c --r--r--r-- 1 mts mts 5793 2008-01-28 00:02 debugStdio.c --r--r--r-- 1 mts mts 83231 2008-01-28 00:02 dnd.c --r--r--r-- 1 mts mts 37352 2008-01-28 00:02 foreignVMToolsDaemon.c --r--r--r-- 1 mts mts 6196 2008-01-28 00:02 foreignVMToolsDaemon.h --r--r--r-- 1 mts mts 37041 2008-01-28 00:02 foreignVMToolsNetworking.c --r--r--r-- 1 mts mts 55322 2008-01-28 00:02 foundryToolsDaemon.c --r--r--r-- 1 mts mts 1752 2008-01-28 00:02 foundryToolsDaemon.h --r--r--r-- 1 mts mts 7478 2008-01-28 00:02 libvmwarectrl.c --r--r--r-- 1 mts mts 2031 2008-01-28 00:02 libvmwarectrl.h --r--r--r-- 1 mts mts 3915 2008-01-28 00:02 Makefile.am --rw-r--r-- 1 mts mts 18798 2008-01-28 00:03 Makefile.in --r--r--r-- 1 mts mts 5854 2008-01-28 00:02 pointer.c --r--r--r-- 1 mts mts 15096 2008-01-28 00:02 resolution.c --r--r--r-- 1 mts mts 4717 2008-01-28 00:02 stub.c --r--r--r-- 1 mts mts 1868 2008-01-28 00:02 vmwarectrl.h --r--r--r-- 1 mts mts 3636 2008-01-28 00:02 vmwarectrlproto.h --r--r--r-- 1 mts mts 24020 2008-01-28 00:02 vmware-user.c --r--r--r-- 1 mts mts 2843 2008-01-28 00:02 vmwareuserInt.h --r--r--r-- 1 mts mts 1550 2008-01-28 00:02 vmwareuser_version.h - -open-vm-tools-2008.01.23-74039/xferlogs: -total 64 --r--r--r-- 1 mts mts 26425 2008-01-28 00:02 COPYING --r--r--r-- 1 mts mts 1504 2008-01-28 00:02 Makefile.am --rw-r--r-- 1 mts mts 15083 2008-01-28 00:03 Makefile.in --r--r--r-- 1 mts mts 9197 2008-01-28 00:02 xferlogs.c --r--r--r-- 1 mts mts 1540 2008-01-28 00:02 xferlogs_version.h diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/guestd/debugStdio.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/guestd/debugStdio.c --- open-vm-tools-2008.01.23-74039/guestd/debugStdio.c 2008-01-28 08:02:53.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/guestd/debugStdio.c 2008-10-13 08:01:53.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -24,11 +24,6 @@ * */ -#ifndef VMX86_DEVEL - -#endif - - #include #include #include @@ -48,7 +43,7 @@ #include "fileIO.h" #include "file.h" #include "system.h" - +#include "unicode.h" static char debugFile[FILE_MAXPATH] = {0}; static Bool debugEnabled = FALSE; @@ -168,40 +163,51 @@ { #ifndef _CONSOLE FileIOResult fr; - FileIODescriptor *fd; + FileIODescriptor fd; size_t bytesWritten; - char *str2; - + Unicode timePrefix; + const char *timePrefixUtf8; + char debugFileShadow; + ASSERT(debugFile[0] != 0); - - fd = (FileIODescriptor *) malloc(sizeof(FileIODescriptor)); - ASSERT_NOT_IMPLEMENTED(fd); - FileIO_Invalidate(fd); - - fr = FileIO_Open(fd, debugFile, FILEIO_OPEN_ACCESS_WRITE, FILEIO_OPEN_CREATE); + + FileIO_Invalidate(&fd); + + fr = FileIO_Open(&fd, debugFile, FILEIO_OPEN_ACCESS_WRITE, + FILEIO_OPEN_CREATE); + debugFileShadow = debugFile[0]; + debugFile[0] = '\0'; if (fr != FILEIO_SUCCESS) { Warning("---Error opening file '%s'.\n", debugFile); - debugFile[0] = '\0'; - goto done; } - FileIO_Seek(fd, 0, FILEIO_SEEK_END); + /* + * XXX: Writing the date/time prefix in UTF-8 and the rest of the string in + * an unspecified encoding is rather broken, but it'll have to do until the + * rest of the Tools are made internationalization-safe. + */ + timePrefix = System_GetTimeAsString(); + if (timePrefix == NULL) { + Warning("---Error getting formatted time string.\n"); + goto close; + } + timePrefixUtf8 = UTF8(timePrefix); + ASSERT(timePrefixUtf8); - str2 = Str_Asprintf(NULL, "(%"FMT64"u) ", System_Uptime()); - fr = FileIO_Write(fd, str2, strlen(str2), &bytesWritten); - fr = FileIO_Write(fd, str, strlen(str), &bytesWritten); - free(str2); + FileIO_Seek(&fd, 0, FILEIO_SEEK_END); + fr = FileIO_Write(&fd, timePrefixUtf8, strlen(timePrefixUtf8), &bytesWritten); + fr = FileIO_Write(&fd, str, strlen(str), &bytesWritten); + Unicode_Free(timePrefix); if (fr != FILEIO_SUCCESS) { Warning("---Error writing to file '%s'.\n", debugFile); - goto close; } close: - FileIO_Close(fd); - + FileIO_Close(&fd); + done: - free(fd); + debugFile[0] = debugFileShadow; return; #endif // _CONSOLE } @@ -249,7 +255,7 @@ OutputDebugString(str); #endif #if !defined(_WIN32) || defined(_CONSOLE) - fprintf(stderr, str); + fputs(str, stderr); #endif #endif if (debugFile[0] != '\0') { diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/guestd/foreignVMToolsDaemon.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/guestd/foreignVMToolsDaemon.c --- open-vm-tools-2008.01.23-74039/guestd/foreignVMToolsDaemon.c 2008-01-28 08:02:53.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/guestd/foreignVMToolsDaemon.c 2008-10-13 08:01:54.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -55,7 +55,7 @@ #include #include #include -#if defined(__FreeBSD__) || defined(sun) +#if defined(__FreeBSD__) || defined(sun) || defined(__APPLE__) #include #else #include @@ -92,6 +92,7 @@ VixLockType globalLock; static struct FoundryWorkerThread *selectThread; +static DblLnkLst_Links *gEventQueue; ForeignVMToolsConnection *activeConnectionList = NULL; ForeignVMToolsCommand *globalCommandList = NULL; @@ -105,7 +106,8 @@ static void ForeignToolsSendRunProgramResponse(const char *requestName, VixError resultErr, int exitCode, - int64 pid); + int64 pid, + void *clientData); static VixError ForeignToolsGetUserCredentialForGuest(ForeignVMToolsConnection *connectionState, ForeignVMToolsCommand *commandState); @@ -136,12 +138,14 @@ */ Bool -ForeignTools_Initialize(GuestApp_Dict *configDictionaryParam) // IN +ForeignTools_Initialize(GuestApp_Dict *configDictionaryParam, // IN + DblLnkLst_Links *eventQueue) // IN { VixError err = VIX_OK; Bool success = TRUE; MessageStub_RegisterTransport(); + gEventQueue = eventQueue; /* * Initialize the limited global state that protects us when @@ -160,7 +164,7 @@ configDictionary = configDictionaryParam; VixTools_SetConsoleUserPolicy(TRUE); // allowConsoleUserOpsParam - VixTools_SetRunProgramCallback(ForeignToolsSendRunProgramResponse); + VixTools_SetRunProgramCallback(ForeignToolsSendRunProgramResponse, NULL); success = ForeignTools_InitializeNetworking(); if (!success) { @@ -394,7 +398,8 @@ ForeignToolsSendRunProgramResponse(const char *requestName, // IN VixError resultErr, // IN int exitCode, // IN - int64 pid) // IN + int64 pid, // IN + void *clientData) // IN { VixError err = VIX_OK; int additionalError = 0; @@ -880,7 +885,7 @@ VixError ForeignToolsGetToolsState(ForeignVMToolsCommand *asyncCommand, // IN - VixMsgTrivialRequest *requestMsg) // IN + VixMsgTrivialRequest *requestMsg) // IN { VixError err = VIX_OK; VixPropertyListImpl propList; @@ -901,6 +906,7 @@ asyncCommand->asyncOpName, 1024 * 1024, // maxResultBufferSize, &configDictionary, + gEventQueue, &base64Buffer, &base64BufferLength, &deleteResultValue); @@ -1078,6 +1084,7 @@ commandState->asyncOpName, 1024 * 1024, // maxResultBufferSize, &configDictionary, + gEventQueue, &dummyResponse, &dummyResponseLength, &deleteResultValue); @@ -1129,6 +1136,7 @@ commandState->asyncOpName, 1024 * 1024, // maxResultBufferSize, &configDictionary, + gEventQueue, &(commandState->responseBody), &(commandState->responseBodyLength), &deleteResultValue); @@ -1153,6 +1161,7 @@ commandState->asyncOpName, 1024 * 1024, // maxResultBufferSize, &configDictionary, + gEventQueue, &(commandState->responseBody), &(commandState->responseBodyLength), &deleteResultValue); diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/guestd/foreignVMToolsDaemon.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/guestd/foreignVMToolsDaemon.h --- open-vm-tools-2008.01.23-74039/guestd/foreignVMToolsDaemon.h 2008-01-28 08:02:53.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/guestd/foreignVMToolsDaemon.h 2008-10-13 08:01:54.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/guestd/foreignVMToolsNetworking.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/guestd/foreignVMToolsNetworking.c --- open-vm-tools-2008.01.23-74039/guestd/foreignVMToolsNetworking.c 2008-01-28 08:02:53.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/guestd/foreignVMToolsNetworking.c 2008-10-13 08:01:54.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -48,7 +48,7 @@ #include "SLPv2Private.h" #include "guestInfo.h" #include "netutil.h" -#include "guestInfoInt.h" +#include "guestInfo.h" #include "vixOpenSource.h" #include "syncEvent.h" @@ -57,7 +57,6 @@ #include "foreignVMToolsDaemon.h" - #ifdef _WIN32 #define ASOCK_ENOTCONN WSAENOTCONN #define ASOCK_ENOTSOCK WSAENOTSOCK @@ -86,7 +85,7 @@ * * We cannot link with winsock, since the DLL may not be present in all guests. * That would create a dll link problem that would prevent the tools from loading. - * Instead, we try to get the procedure pointer ourselves at runtime, and quietly + * Instead, we try to get the procedure pointer ourselves at runtime, and quietly * fail if it is not there. *----------------------------------------------------------------------------- */ @@ -147,8 +146,8 @@ int tolen); typedef int (WSAAPI *SendSockOptProcType)(SOCKET s, - int level, - int optname, + int level, + int optname, const void *optval, socklen_t optlen); @@ -215,7 +214,7 @@ #define VMToolsNet_FDIsSet FD_ISSET #define VMToolsNet_Recvfrom recvfrom -#endif +#endif Bool ForeignToolsMakeNonBlocking(int fd); @@ -265,7 +264,7 @@ char *ipAddressStr = NULL; char *destPtr; char *endDestPtr; - NicInfo nicInfo; + GuestNicList nicInfo; #ifdef _WIN32 HMODULE hWs2_32 = NULL; WSADATA wsaData; @@ -281,7 +280,7 @@ } #ifdef _WIN32 - hWs2_32 = LoadLibrary("ws2_32.dll"); + hWs2_32 = LoadLibrary(_T("ws2_32.dll")); if (NULL == hWs2_32) { goto abort; } @@ -412,23 +411,20 @@ VixSocketListenerPort); /* - * Find out how big the IP_ADAPTER_INFO table needs to be. + * Find out how big the IP_ADAPTER_INFO table needs to be. */ - success = GuestInfoGetNicInfo(&nicInfo); + success = GuestInfo_GetNicInfo(&nicInfo); if (success) { - NicEntry *nicEntryPtr = NULL; - DblLnkLst_Links *nicEntryLink; - - DblLnkLst_ForEach(nicEntryLink, &nicInfo.nicList) { - nicEntryPtr = DblLnkLst_Container(nicEntryLink, NicEntry, links); + u_int i; + for (i = 0; i < nicInfo.nics.nics_len; i++) { + GuestNic *nic = &nicInfo.nics.nics_val[i]; destPtr += Str_Snprintf(destPtr, endDestPtr - destPtr, "%s=%s;", VIX_SLPV2_PROPERTY_MAC_ADDR, - nicEntryPtr->nicEntryProto.macAddress); - } - - GuestInfo_FreeDynamicMemoryInNicInfo(&nicInfo); + nic->macAddress); + } + VMX_XDR_FREE(xdr_GuestNicList, &nicInfo); } free(ipAddressStr); @@ -601,8 +597,8 @@ goto abort; } //success = ForeignToolsMakeNonBlocking(tcpListenerSocket); - success = ForeignToolsSocketBind(tcpListenerSocket, - INADDR_ANY, + success = ForeignToolsSocketBind(tcpListenerSocket, + INADDR_ANY, VixSocketListenerPort); if (!success) { goto abort; @@ -615,16 +611,16 @@ goto abort; } //success = ForeignToolsMakeNonBlocking(tcpListenerSocket); - success = ForeignToolsSocketBind(udpListenerSocket, - INADDR_ANY, + success = ForeignToolsSocketBind(udpListenerSocket, + INADDR_ANY, SLPv2SocketListenerPort); if (!success) { goto abort; } - VMToolsNet_SetSockOpt(udpListenerSocket, - SOL_SOCKET, + VMToolsNet_SetSockOpt(udpListenerSocket, + SOL_SOCKET, SO_BROADCAST, - (const void *) &bcast, + (const void *) &bcast, sizeof(bcast)); #ifdef _WIN32 @@ -639,14 +635,14 @@ DWORD dwBytesReturned = 0; BOOL bNewBehavior = FALSE; DWORD status; - status = VMToolsNet_WSAIoctl(udpListenerSocket, + status = VMToolsNet_WSAIoctl(udpListenerSocket, SIO_UDP_CONNRESET, - &bNewBehavior, + &bNewBehavior, sizeof(bNewBehavior), - NULL, - 0, + NULL, + 0, &dwBytesReturned, - NULL, + NULL, NULL); if (SOCKET_ERROR == status) { } @@ -732,7 +728,7 @@ if (udpListenerSocket != -1) { VMToolsNet_CloseSocket(udpListenerSocket); udpListenerSocket = -1; - } + } } // ForeignToolsSelectLoop @@ -773,9 +769,9 @@ } } - + VIX_ENTER_LOCK(&globalLock); - + /* * Allocate some state for the connection */ @@ -818,8 +814,8 @@ /* * Read the message header. */ - result = VMToolsNet_Recv(connectionState->socket, - (char *) &(connectionState->requestHeader), + result = VMToolsNet_Recv(connectionState->socket, + (char *) &(connectionState->requestHeader), sizeof(connectionState->requestHeader), 0); if (result <= 0) { @@ -835,7 +831,7 @@ goto abort; } - connectionState->completeRequest + connectionState->completeRequest = Util_SafeMalloc(connectionState->requestHeader.commonHeader.totalMessageLength); memcpy(connectionState->completeRequest, &(connectionState->requestHeader), @@ -843,12 +839,12 @@ /* * If this request has a variable-sized part, like a body or a user credential, - * then start reading that. Otherwise, if the request only has a fixed-size header, + * then start reading that. Otherwise, if the request only has a fixed-size header, * then we can start processing it now. */ if (connectionState->requestHeader.commonHeader.totalMessageLength > result) { - result = VMToolsNet_Recv(connectionState->socket, - connectionState->completeRequest + result, + result = VMToolsNet_Recv(connectionState->socket, + connectionState->completeRequest + result, connectionState->requestHeader.commonHeader.totalMessageLength - result, 0); if (result <= 0) { @@ -908,9 +904,9 @@ responseHeader->responseFlags |= responseFlags; - result = VMToolsNet_Send(connectionState->socket, + result = VMToolsNet_Send(connectionState->socket, (const char *) responseHeader, - totalMessageSize, + totalMessageSize, 0); if (result <= 0) { } @@ -958,9 +954,9 @@ responseHeader->responseFlags |= responseFlags; - result = VMToolsNet_Send(connectionState->socket, + result = VMToolsNet_Send(connectionState->socket, (const char *) responseHeader, - totalMessageSize, + totalMessageSize, 0); if (result <= 0) { } @@ -997,11 +993,11 @@ char *replyPacket = NULL; int replyPacketSize = 0; - actualPacketLength = VMToolsNet_Recvfrom(udpListenerSocket, - receiveBuffer, + actualPacketLength = VMToolsNet_Recvfrom(udpListenerSocket, + receiveBuffer, sizeof(receiveBuffer), 0, - (struct sockaddr *) &clientAddr, + (struct sockaddr *) &clientAddr, &clientAddrLen); if (actualPacketLength <= 0) { goto abort; @@ -1025,9 +1021,9 @@ "", // LDAPv3 predicate &xid); if (match) { - Str_Sprintf(urlBuffer, - sizeof urlBuffer, - "%s://%s/", + Str_Sprintf(urlBuffer, + sizeof urlBuffer, + "%s://%s/", VIX_SLPV2_SERVICE_NAME_TOOLS_SERVICE, globalHostName); success = SLPv2MsgAssembler_ServiceReply(&replyPacket, @@ -1063,11 +1059,11 @@ * for more responses. */ if (NULL != replyPacket) { - VMToolsNet_Sendto(udpListenerSocket, - replyPacket, + VMToolsNet_Sendto(udpListenerSocket, + replyPacket, replyPacketSize, 0, // flags - (struct sockaddr *) &clientAddr, + (struct sockaddr *) &clientAddr, clientAddrLen); } @@ -1111,7 +1107,7 @@ /* * It's possible that data on a connection arrives late, after we have - * closed it. In that case, VMAutomationReceiveMessage will correctly + * closed it. In that case, VMAutomationReceiveMessage will correctly * not process the data. But, be careful that we don't try to close * the connection again. */ @@ -1145,7 +1141,7 @@ ForeignToolsDiscardCommand(command); } - + command = nextCommand; } // while (NULL != command) @@ -1210,11 +1206,11 @@ localAddr.sin_addr.s_addr = VMToolsNet_htonl(INADDR_ANY); localAddr.sin_port = VMToolsNet_htons(SLPv2SocketListenerPort); - VMToolsNet_Sendto(udpListenerSocket, - packet, + VMToolsNet_Sendto(udpListenerSocket, + packet, sizeof(packet), 0, // flags - (struct sockaddr *) &localAddr, + (struct sockaddr *) &localAddr, sizeof(localAddr)); } // ForeignToolsWakeSelectThread diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/guestd/foundryToolsDaemon.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/guestd/foundryToolsDaemon.c --- open-vm-tools-2008.01.23-74039/guestd/foundryToolsDaemon.c 2008-01-28 08:02:53.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/guestd/foundryToolsDaemon.c 2008-10-13 08:01:54.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -27,11 +27,13 @@ #include #include #include - -#if !defined(__FreeBSD__) && !defined(sun) -#define IMPLEMENT_SOCKET_MGR 1 +#if defined(linux) +#include +#include +#include #endif + #ifdef _WIN32 #include #else @@ -40,7 +42,10 @@ #endif #ifdef _MSC_VER -# include +# include +# include +# include +# include "win32u.h" #elif _WIN32 # include "win95.h" #endif @@ -50,14 +55,21 @@ #include "vm_version.h" #include "vm_app.h" #include "message.h" -#include "eventManager.h" -#include "debug.h" -#include "rpcout.h" -#include "rpcin.h" + +#if defined(VMTOOLS_USE_GLIB) +# include "vixPluginInt.h" +# include "vmtools.h" +#else +# include "debug.h" +# include "eventManager.h" +# include "rpcin.h" +# include "rpcout.h" +#endif + #include "util.h" #include "strutil.h" #include "str.h" -#include "fileUTF8.h" +#include "file.h" #include "err.h" #include "hostinfo.h" #include "guest_os.h" @@ -66,42 +78,42 @@ #include "foundryToolsDaemon.h" #include "printer.h" #include "base64.h" -#include "guestInfoInt.h" #include "syncDriver.h" #include "hgfsServer.h" #include "hgfs.h" #include "system.h" #include "codeset.h" -#if IMPLEMENT_SOCKET_MGR -#include "socketMgr.h" + +#if defined(linux) +#include "hgfsDevLinux.h" #endif #ifndef __FreeBSD__ #include "netutil.h" #endif -/* Stub out impersonation functions for these platforms. */ -#if defined(__FreeBSD__) || defined(sun) || defined(N_PLAT_NLM) -void Impersonate_Init(void) { return; } -#else +/* Only Win32 and Linux use impersonation functions. */ +#if !defined(__FreeBSD__) && !defined(sun) #include "impersonate.h" #endif #include "vixTools.h" #include "vixOpenSource.h" +#if !defined(VMTOOLS_USE_GLIB) static DblLnkLst_Links *globalEventQueue; // event queue for main event loop +#endif #define GUESTMSG_MAX_IN_SIZE (64 * 1024) /* vmx/main/guest_msg.c */ #define MAX64_DECIMAL_DIGITS 20 /* 2^64 = 18,446,744,073,709,551,616 */ -#if defined(linux) || (defined(_WIN32) && !defined(SERVICE9X)) +#if defined(linux) || defined(_WIN32) # if defined(_WIN32) -# define DECLARE_SYNCDRIVER_ERROR(name) DWORD name = ERROR_SUCCESS; +# define DECLARE_SYNCDRIVER_ERROR(name) DWORD name = ERROR_SUCCESS # define SYNCDRIVERERROR ERROR_GEN_FAILURE # else -# define DECLARE_SYNCDRIVER_ERROR(name) int name = 0; +# define DECLARE_SYNCDRIVER_ERROR(name) int name = 0 # define SYNCDRIVERERROR errno # endif @@ -116,56 +128,25 @@ static char * ToolsDaemonTcloGetEncodedQuotedString(const char *args, const char **endOfArg); -Bool ToolsDaemonTcloReceiveVixCommand(char const **result, - size_t *resultLen, - const char *name, - const char *args, - size_t argsSize, - void *clientData); - -static Bool ToolsDaemonTcloCheckUserAccount(char const **result, - size_t *resultLen, - const char *name, - const char *args, - size_t argsSize, - void *clientData); +Bool ToolsDaemonTcloReceiveVixCommand(RpcInData *data); #if !defined(N_PLAT_NLM) -static Bool ToolsDaemonHgfsImpersonated(char const **result, - size_t *resultLen, - const char *name, - const char *args, - size_t argsSize, - void *clientData); -#endif - -#if defined(linux) || (defined(_WIN32) && !defined(SERVICE9X)) -static Bool ToolsDaemonTcloSyncDriverFreeze(char const **result, - size_t *resultLen, - const char *name, - const char *args, - size_t argsSize, - void *clientData); - -static Bool ToolsDaemonTcloSyncDriverThaw(char const **result, - size_t *resultLen, - const char *name, - const char *args, - size_t argsSize, - void *clientData); -#endif - -static Bool ToolsDaemonTcloMountHGFS(char const **result, - size_t *resultLen, - const char *name, - const char *args, - size_t argsSize, - void *clientData); +Bool ToolsDaemonHgfsImpersonated(RpcInData *data); +#endif + +#if defined(linux) || defined(_WIN32) +Bool ToolsDaemonTcloSyncDriverFreeze(RpcInData *data); + +Bool ToolsDaemonTcloSyncDriverThaw(RpcInData *data); +#endif + +Bool ToolsDaemonTcloMountHGFS(RpcInData *data); void ToolsDaemonTcloReportProgramCompleted(const char *requestName, VixError err, int exitCode, - int64 pid); + int64 pid, + void *clientData); /* * These constants are a bad hack. I really should generate the result @@ -174,10 +155,6 @@ */ #define DEFAULT_RESULT_MSG_MAX_LENGTH 1024 -#if IMPLEMENT_SOCKET_MGR -static Bool socketMgrInitialized = FALSE; -#endif - static Bool thisProcessRunsAsRoot = FALSE; @@ -200,12 +177,7 @@ */ Bool -FoundryToolsDaemonRunProgram(char const **result, // OUT - size_t *resultLen, // OUT - const char *name, // IN - const char *args, // IN - size_t argsSize, // Ignored - void *clientData) // IN +FoundryToolsDaemonRunProgram(RpcInData *data) // IN { VixError err = VIX_OK; char *requestName = NULL; @@ -219,18 +191,23 @@ Bool impersonatingVMWareUser = FALSE; void *userToken = NULL; ProcMgr_Pid pid; +#if defined(VMTOOLS_USE_GLIB) + GMainLoop *eventQueue = ((ToolsAppCtx *)data->appCtx)->mainLoop; +#else + DblLnkLst_Links *eventQueue = data->clientData; +#endif /* * Parse the arguments. Some of these are optional, so they * may be NULL. */ - requestName = ToolsDaemonTcloGetQuotedString(args, &args); - commandLine = ToolsDaemonTcloGetEncodedQuotedString(args, &args); - commandLineArgs = ToolsDaemonTcloGetEncodedQuotedString(args, &args); - credentialTypeStr = ToolsDaemonTcloGetQuotedString(args, &args); - obfuscatedNamePassword = ToolsDaemonTcloGetQuotedString(args, &args); - directoryPath = ToolsDaemonTcloGetQuotedString(args, &args); - environmentVariables = ToolsDaemonTcloGetQuotedString(args, &args); + requestName = ToolsDaemonTcloGetQuotedString(data->args, &data->args); + commandLine = ToolsDaemonTcloGetEncodedQuotedString(data->args, &data->args); + commandLineArgs = ToolsDaemonTcloGetEncodedQuotedString(data->args, &data->args); + credentialTypeStr = ToolsDaemonTcloGetQuotedString(data->args, &data->args); + obfuscatedNamePassword = ToolsDaemonTcloGetQuotedString(data->args, &data->args); + directoryPath = ToolsDaemonTcloGetQuotedString(data->args, &data->args); + environmentVariables = ToolsDaemonTcloGetQuotedString(data->args, &data->args); /* * Make sure we are passed the correct arguments. @@ -260,6 +237,7 @@ commandLineArgs, 0, userToken, + eventQueue, (int64 *) &pid); abort: @@ -278,7 +256,7 @@ err, Err_Errno(), (int64) pid); - RpcIn_SetRetVals(result, resultLen, resultBuffer, TRUE); + RPCIN_SETRETVALS(data, resultBuffer, TRUE); /* * These were allocated by ToolsDaemonTcloGetQuotedString. @@ -313,15 +291,9 @@ */ Bool -FoundryToolsDaemonGetToolsProperties(char const **result, // OUT - size_t *resultLen, // OUT - const char *name, // IN - const char *args, // IN - size_t argsSize, // Ignored - void *clientData) // IN +FoundryToolsDaemonGetToolsProperties(RpcInData *data) // IN { VixError err = VIX_OK; - GuestApp_Dict **confDictRef; int additionalError = 0; static char resultBuffer[DEFAULT_RESULT_MSG_MAX_LENGTH]; char *serializedBuffer = NULL; @@ -330,11 +302,16 @@ size_t base64BufferLength = 0; Bool success; char *returnBuffer = NULL; +#if defined(VMTOOLS_USE_GLIB) + GKeyFile *confDictRef; +#else + GuestApp_Dict **confDictRef; +#endif /* * Collect some values about the host. */ - confDictRef = (GuestApp_Dict **) clientData; + confDictRef = data->clientData; err = VixTools_GetToolsPropertiesImpl(confDictRef, &serializedBuffer, @@ -375,7 +352,7 @@ err, additionalError, returnBuffer); - RpcIn_SetRetVals(result, resultLen, resultBuffer, TRUE); + RPCIN_SETRETVALS(data, resultBuffer, TRUE); free(serializedBuffer); free(base64Buffer); @@ -401,12 +378,7 @@ */ Bool -ToolsDaemonTcloCheckUserAccount(char const **result, // OUT - size_t *resultLen, // OUT - const char *name, // IN - const char *args, // IN - size_t argsSize, // Ignored - void *clientData) // IN +ToolsDaemonTcloCheckUserAccount(RpcInData *data) // IN { VixError err = VIX_OK; char *credentialTypeStr = NULL; @@ -419,8 +391,8 @@ /* * Parse the argument */ - credentialTypeStr = ToolsDaemonTcloGetQuotedString(args, &args); - obfuscatedNamePassword = ToolsDaemonTcloGetQuotedString(args, &args); + credentialTypeStr = ToolsDaemonTcloGetQuotedString(data->args, &data->args); + obfuscatedNamePassword = ToolsDaemonTcloGetQuotedString(data->args, &data->args); /* * Make sure we are passed the correct arguments. @@ -456,7 +428,7 @@ "%"FMT64"d %d", err, Err_Errno()); - RpcIn_SetRetVals(result, resultLen, resultBuffer, TRUE); + RPCIN_SETRETVALS(data, resultBuffer, TRUE); /* * These were allocated by ToolsDaemonTcloGetQuotedString. @@ -467,6 +439,31 @@ return TRUE; } // ToolsDaemonTcloCheckUserAccount +#if defined(VMTOOLS_USE_GLIB) + +/** + * Initializes internal state of the Foundry daemon. + * + * @param[in] ctx Application context. + */ + +void +FoundryToolsDaemon_Initialize(ToolsAppCtx *ctx) +{ + thisProcessRunsAsRoot = (strcmp(ctx->name, VMTOOLS_GUEST_SERVICE) == 0); + (void) VixTools_Initialize(thisProcessRunsAsRoot, + ToolsDaemonTcloReportProgramCompleted, + ctx); + +#if defined(linux) || defined(_WIN32) + if (thisProcessRunsAsRoot) { + Impersonate_Init(); + } +#endif + +} + +#else /* *----------------------------------------------------------------------------- @@ -491,7 +488,7 @@ Bool runAsRoot) // IN { static Bool inited = FALSE; -#if defined(linux) || (defined(_WIN32) && !defined(SERVICE9X)) +#if defined(linux) || defined(_WIN32) static Bool sync_driver_inited = FALSE; #endif @@ -502,10 +499,11 @@ thisProcessRunsAsRoot = runAsRoot; globalEventQueue = eventQueue; - (void) VixTools_Initialize(thisProcessRunsAsRoot, - globalEventQueue, - ToolsDaemonTcloReportProgramCompleted); + (void) VixTools_Initialize(thisProcessRunsAsRoot, + ToolsDaemonTcloReportProgramCompleted, + NULL); +#if defined(linux) || defined(_WIN32) /* * Be careful, Impersonate_Init should only be ever called once per process. * @@ -515,44 +513,36 @@ if (!inited && thisProcessRunsAsRoot) { Impersonate_Init(); } +#endif - RpcIn_RegisterCallback(in, - VIX_BACKDOORCOMMAND_RUN_PROGRAM, - FoundryToolsDaemonRunProgram, - NULL); - RpcIn_RegisterCallback(in, - VIX_BACKDOORCOMMAND_GET_PROPERTIES, - FoundryToolsDaemonGetToolsProperties, - confDictRef); - RpcIn_RegisterCallback(in, - VIX_BACKDOORCOMMAND_CHECK_USER_ACCOUNT, - ToolsDaemonTcloCheckUserAccount, - NULL); + RpcIn_RegisterCallbackEx(in, + VIX_BACKDOORCOMMAND_RUN_PROGRAM, + FoundryToolsDaemonRunProgram, + eventQueue); + RpcIn_RegisterCallbackEx(in, + VIX_BACKDOORCOMMAND_GET_PROPERTIES, + FoundryToolsDaemonGetToolsProperties, + confDictRef); + RpcIn_RegisterCallbackEx(in, + VIX_BACKDOORCOMMAND_CHECK_USER_ACCOUNT, + ToolsDaemonTcloCheckUserAccount, + NULL); #if !defined(N_PLAT_NLM) - RpcIn_RegisterCallback(in, - VIX_BACKDOORCOMMAND_SEND_HGFS_PACKET, - ToolsDaemonHgfsImpersonated, - NULL); -#endif - RpcIn_RegisterCallback(in, - VIX_BACKDOORCOMMAND_COMMAND, - ToolsDaemonTcloReceiveVixCommand, - confDictRef); - RpcIn_RegisterCallback(in, - VIX_BACKDOORCOMMAND_MOUNT_VOLUME_LIST, - ToolsDaemonTcloMountHGFS, - NULL); -#if IMPLEMENT_SOCKET_MGR - /* - * We can be called again in certain tools error recovery cases, such - * as restoring from a hibernation. This annoys SocketMgr_Init(). - */ - if (!inited) { - socketMgrInitialized = SocketMgr_Init(globalEventQueue); - } -#endif // IMPLEMENT_SOCKET_MGR + RpcIn_RegisterCallbackEx(in, + VIX_BACKDOORCOMMAND_SEND_HGFS_PACKET, + ToolsDaemonHgfsImpersonated, + NULL); +#endif + RpcIn_RegisterCallbackEx(in, + VIX_BACKDOORCOMMAND_COMMAND, + ToolsDaemonTcloReceiveVixCommand, + confDictRef); + RpcIn_RegisterCallbackEx(in, + VIX_BACKDOORCOMMAND_MOUNT_VOLUME_LIST, + ToolsDaemonTcloMountHGFS, + NULL); -#if defined(linux) || (defined(_WIN32) && !defined(SERVICE9X)) +#if defined(linux) || defined(_WIN32) /* * Only init once, but always register the RpcIn. @@ -568,23 +558,22 @@ * Win2k) but the running of the scripts is implemented using * VIX_BACKDOORCOMMAND_RUN_PROGRAM. */ - RpcIn_RegisterCallback(in, - VIX_BACKDOORCOMMAND_SYNCDRIVER_FREEZE, - ToolsDaemonTcloSyncDriverFreeze, - NULL); - RpcIn_RegisterCallback(in, - VIX_BACKDOORCOMMAND_SYNCDRIVER_THAW, - ToolsDaemonTcloSyncDriverThaw, - NULL); + RpcIn_RegisterCallbackEx(in, + VIX_BACKDOORCOMMAND_SYNCDRIVER_FREEZE, + ToolsDaemonTcloSyncDriverFreeze, + eventQueue); + RpcIn_RegisterCallbackEx(in, + VIX_BACKDOORCOMMAND_SYNCDRIVER_THAW, + ToolsDaemonTcloSyncDriverThaw, + NULL); } else { Debug("FoundryToolsDaemon: Failed to init SyncDriver, skipping command handlers.\n"); } - - inited = TRUE; - #endif + inited = TRUE; } // FoundryToolsDaemon_RegisterRoutines +#endif /* *----------------------------------------------------------------------------- @@ -688,6 +677,7 @@ } +#if !defined(VMTOOLS_USE_GLIB) /* *----------------------------------------------------------------------------- * @@ -705,13 +695,8 @@ *----------------------------------------------------------------------------- */ -static Bool -ToolsDaemonTcloOpenUrl(char const **result, // OUT - size_t *resultLen, // OUT - const char *name, // IN - const char *args, // IN - size_t argsSize, // Ignored - void *clientData) // IN +Bool +ToolsDaemonTcloOpenUrl(RpcInData *data) // IN { static char resultBuffer[DEFAULT_RESULT_MSG_MAX_LENGTH]; VixError err = VIX_OK; @@ -727,11 +712,11 @@ /* * Parse the arguments */ - url = ToolsDaemonTcloGetEncodedQuotedString(args, &args); - windowState = ToolsDaemonTcloGetQuotedString(args, &args); + url = ToolsDaemonTcloGetEncodedQuotedString(data->args, &data->args); + windowState = ToolsDaemonTcloGetQuotedString(data->args, &data->args); // These parameters at the end are optional, so they may be NULL. - credentialTypeStr = ToolsDaemonTcloGetQuotedString(args, &args); - obfuscatedNamePassword = ToolsDaemonTcloGetQuotedString(args, &args); + credentialTypeStr = ToolsDaemonTcloGetQuotedString(data->args, &data->args); + obfuscatedNamePassword = ToolsDaemonTcloGetQuotedString(data->args, &data->args); /* * Validate the arguments. @@ -758,17 +743,11 @@ Debug("Opening URL: \"%s\"\n", url); /* Actually open the URL. */ - #if !defined(WIN9XCOMPAT) if (!GuestApp_OpenUrl(url, strcmp(windowState, "maximize") == 0)) { err = VIX_E_FAIL; Debug("Failed to open the url \"%s\"\n", url); goto abort; } -#else - err = VIX_E_OP_NOT_SUPPORTED_ON_GUEST; - goto abort; -#endif - abort: if (impersonatingVMWareUser) { @@ -781,7 +760,7 @@ * foundry error and a guest-OS-specific error. */ Str_Sprintf(resultBuffer, sizeof resultBuffer, "%"FMT64"d %d", err, sysError); - RpcIn_SetRetVals(result, resultLen, resultBuffer, TRUE); + RPCIN_SETRETVALS(data, resultBuffer, TRUE); /* * These were allocated by ToolsDaemonTcloGetQuotedString. @@ -813,13 +792,8 @@ *----------------------------------------------------------------------------- */ -static Bool -ToolsDaemonTcloSetPrinter(char const **result, // OUT - size_t *resultLen, // OUT - const char *name, // IN - const char *args, // IN - size_t argsSize, // Ignored - void *clientData) // IN +Bool +ToolsDaemonTcloSetPrinter(RpcInData *data) // IN { static char resultBuffer[DEFAULT_RESULT_MSG_MAX_LENGTH]; #if defined(_WIN32) @@ -833,8 +807,8 @@ /* * Parse the arguments */ - printerName = ToolsDaemonTcloGetQuotedString(args, &args); - defaultString = ToolsDaemonTcloGetQuotedString(args, &args); + printerName = ToolsDaemonTcloGetQuotedString(data->args, &data->args); + defaultString = ToolsDaemonTcloGetQuotedString(data->args, &data->args); /* * Validate the arguments. @@ -864,7 +838,7 @@ /* Set this printer as the default if requested. */ if (defaultInt != 0) { - if (!SetDefaultPrinter(printerName)) { + if (!Win32U_SetDefaultPrinter(printerName)) { /* * We couldn't set this printer as default. Oh well. We'll * still report success or failure based purely on whether @@ -881,7 +855,7 @@ * foundry error and a guest-OS-specific error. */ Str_Sprintf(resultBuffer, sizeof resultBuffer, "%"FMT64"d %d", err, sysError); - RpcIn_SetRetVals(result, resultLen, resultBuffer, TRUE); + RPCIN_SETRETVALS(data, resultBuffer, TRUE); /* * These were allocated by ToolsDaemonTcloGetQuotedString. @@ -898,10 +872,11 @@ "%d %d 0", VIX_E_OP_NOT_SUPPORTED_ON_GUEST, Err_Errno()); - RpcIn_SetRetVals(result, resultLen, resultBuffer, TRUE); + RPCIN_SETRETVALS(data, resultBuffer, TRUE); return TRUE; #endif } +#endif /* @@ -921,30 +896,30 @@ *----------------------------------------------------------------------------- */ -#if defined(linux) || (defined(_WIN32) && !defined(SERVICE9X)) -static Bool -ToolsDaemonTcloSyncDriverFreeze(char const **result, // OUT - size_t *resultLen, // OUT - const char *name, // IN - const char *args, // IN - size_t argsSize, // Ignored - void *clientData) // IN +#if defined(linux) || defined(_WIN32) +Bool +ToolsDaemonTcloSyncDriverFreeze(RpcInData *data) { static char resultBuffer[DEFAULT_RESULT_MSG_MAX_LENGTH]; VixError err = VIX_OK; char *driveList = NULL; char *timeout = NULL; int timeoutVal; - Event *cbEvent; DECLARE_SYNCDRIVER_ERROR(sysError); +#if defined(VMTOOLS_USE_GLIB) + ToolsAppCtx *ctx = data->appCtx; + GSource *timer; +#else + Event *cbEvent; +#endif Debug(">ToolsDaemonTcloSyncDriverFreeze\n"); /* * Parse the arguments */ - driveList = ToolsDaemonTcloGetQuotedString(args, &args); - timeout = ToolsDaemonTcloGetQuotedString(args, &args); + driveList = ToolsDaemonTcloGetQuotedString(data->args, &data->args); + timeout = ToolsDaemonTcloGetQuotedString(data->args, &data->args); /* * Validate the arguments. @@ -987,7 +962,12 @@ /* Start the timer callback to automatically thaw. */ if (0 != timeoutVal) { Debug("ToolsDaemonTcloSyncDriverFreeze: Starting timer callback %d\n", timeoutVal); - cbEvent = EventManager_Add(globalEventQueue, +#if defined(VMTOOLS_USE_GLIB) + timer = g_timeout_source_new(timeoutVal * 10); + VMTOOLSAPP_ATTACH_SOURCE(ctx, timer, ToolsDaemonSyncDriverThawCallback, NULL, NULL); + g_source_unref(timer); +#else + cbEvent = EventManager_Add(data->clientData, timeoutVal, ToolsDaemonSyncDriverThawCallback, NULL); @@ -996,10 +976,12 @@ if (!SyncDriver_Thaw(gSyncDriverHandle)) { Debug("ToolsDaemonTcloSyncDriverFreeze: Unable to abort freeze. Oh well.\n"); } + SyncDriver_CloseHandle(&gSyncDriverHandle); err = VIX_E_FAIL; sysError = SYNCDRIVERERROR; goto abort; } +#endif } abort: @@ -1015,7 +997,7 @@ */ Str_Sprintf(resultBuffer, sizeof resultBuffer, "%"FMT64"d %d", err, sysError); Debug("ToolsDaemonTcloMountHGFS\n"); #if defined(linux) /* + * Look for a vmhgfs mount at /mnt/hgfs. If one exists, nothing + * else needs to be done. If one doesn't exist, then mount at + * that location. + */ + FILE *mtab; + struct mntent *mnt; + Bool vmhgfsMntFound = FALSE; + if ((mtab = setmntent(_PATH_MOUNTED, "r")) == NULL) { + err = VIX_E_FAIL; + } else { + while ((mnt = getmntent(mtab)) != NULL) { + if ((strcmp(mnt->mnt_fsname, ".host:/") == 0) && + (strcmp(mnt->mnt_type, HGFS_NAME) == 0) && + (strcmp(mnt->mnt_dir, "/mnt/hgfs") == 0)) { + vmhgfsMntFound = TRUE; + break; + } + } + endmntent(mtab); + } + + if (vmhgfsMntFound) { + /* * We need to call the mount program, not the mount system call. The - * mount program does several additional things, like compute the mount options - * from the contents of /etc/fstab, and invoke custom mount programs like the - * one needed for HGFS. - */ - system("mount -a -t vmhgfs"); + * mount program does several additional things, like compute the mount + * options from the contents of /etc/fstab, and invoke custom mount + * programs like the one needed for HGFS. + */ + int ret = system("mount -t vmhgfs .host:/ /mnt/hgfs"); + if (ret == -1 || WIFSIGNALED(ret) || + (WIFEXITED(ret) && WEXITSTATUS(ret) != 0)) { + err = VIX_E_FAIL; + } + } #endif /* @@ -1420,9 +1420,8 @@ "%"FMT64"d %d", err, Err_Errno()); - RpcIn_SetRetVals(result, resultLen, resultBuffer, TRUE); + RPCIN_SETRETVALS(data, resultBuffer, TRUE); - Debug("args; Bool impersonatingVMWareUser = FALSE; char *credentialTypeStr = NULL; char *obfuscatedNamePassword = NULL; @@ -1487,7 +1481,7 @@ #define OTHER_TEXT_SIZE 4 /* strlen(space zero space quote) */ static char resultPacket[STRLEN_OF_MAX_64_BIT_NUMBER_AS_STRING + OTHER_TEXT_SIZE - + HGFS_PACKET_MAX]; + + HGFS_LARGE_PACKET_MAX]; char *hgfsReplyPacket = resultPacket + STRLEN_OF_MAX_64_BIT_NUMBER_AS_STRING + OTHER_TEXT_SIZE; @@ -1510,8 +1504,8 @@ /* * Get the authentication information. */ - credentialTypeStr = ToolsDaemonTcloGetQuotedString(args, &args); - obfuscatedNamePassword = ToolsDaemonTcloGetQuotedString(args, &args); + credentialTypeStr = ToolsDaemonTcloGetQuotedString(data->args, &data->args); + obfuscatedNamePassword = ToolsDaemonTcloGetQuotedString(data->args, &data->args); /* * Make sure we are passed the correct arguments. @@ -1527,21 +1521,21 @@ * since it will try to eat trailing spaces after a quoted string, * and the HGFS packet might begin with a space. */ - if (((args - origArgs) >= argsSize) || ('#' != *args)) { + if (((data->args - origArgs) >= data->argsSize) || ('#' != *(data->args))) { /* * Buffer too small or we got an unexpected token. */ err = VIX_E_FAIL; goto abort; } - args++; + data->args++; /* * At this point args points to the HGFS packet. * If we're pointing beyond the end of the buffer, we'll * get a negative HGFS packet length and abort. */ - hgfsPacketSize = argsSize - (args - origArgs); + hgfsPacketSize = data->argsSize - (data->args - origArgs); if (hgfsPacketSize <= 0) { err = VIX_E_FAIL; goto abort; @@ -1563,7 +1557,7 @@ * Impersonation was okay, so let's give our packet to * the HGFS server and forward the reply packet back. */ - HgfsServer_DispatchPacket(args, // packet in buf + HgfsServer_DispatchPacket(data->args, // packet in buf hgfsReplyPacket, // packet out buf &hgfsPacketSize); // in/out size @@ -1579,10 +1573,10 @@ free(credentialTypeStr); free(obfuscatedNamePassword); - *result = resultPacket; - *resultLen = STRLEN_OF_MAX_64_BIT_NUMBER_AS_STRING - + OTHER_TEXT_SIZE - + hgfsPacketSize; + data->result = resultPacket; + data->resultLen = STRLEN_OF_MAX_64_BIT_NUMBER_AS_STRING + + OTHER_TEXT_SIZE + + hgfsPacketSize; /* * Render the foundry error codes into the buffer. @@ -1607,7 +1601,7 @@ actualUsed = Str_Snprintf(resultPacket, STRLEN_OF_MAX_64_BIT_NUMBER_AS_STRING, "1 0 #"); - *resultLen = actualUsed; + data->resultLen = actualUsed; } else { /* * We computed the string length correctly. Great! @@ -1658,10 +1652,23 @@ ToolsDaemonTcloReportProgramCompleted(const char *requestName, // IN VixError err, // IN int exitCode, // IN - int64 pid) // IN + int64 pid, // IN + void *clientData) // IN { Bool sentResult; +#if defined(VMTOOLS_USE_GLIB) + ToolsAppCtx *ctx = clientData; + gchar *msg = g_strdup_printf("%s %s %"FMT64"d %d %d %"FMT64"d", + VIX_BACKDOORCOMMAND_RUN_PROGRAM_DONE, + requestName, + err, + Err_Errno(), + exitCode, + (int64) pid); + sentResult = RpcChannel_Send(ctx->rpc, msg, strlen(msg) + 1, NULL, NULL); + g_free(msg); +#else sentResult = RpcOut_sendOne(NULL, NULL, "%s %s %"FMT64"d %d %d %"FMT64"d", @@ -1671,6 +1678,8 @@ Err_Errno(), exitCode, (int64) pid); +#endif + if (!sentResult) { Warning("Unable to send results from polling the result program.\n\n"); } @@ -1694,12 +1703,7 @@ */ Bool -ToolsDaemonTcloReceiveVixCommand(char const **result, // OUT - size_t *resultLen, // OUT - const char *name, // IN - const char *args, // IN - size_t argsSize, // IN: Size of args - void *clientData) // IN +ToolsDaemonTcloReceiveVixCommand(RpcInData *data) // IN { VixError err = VIX_OK; char *requestName = NULL; @@ -1710,39 +1714,47 @@ size_t resultValueLength = 0; Bool deleteResultValue = FALSE; char *destPtr = NULL; - GuestApp_Dict **confDictRef; int vixPrefixDataSize = (MAX64_DECIMAL_DIGITS * 2) + (sizeof(' ') * 2) + sizeof('\0'); + /* - * Our temporary buffer will be the same size as what the + * Our temporary buffer will be the same size as what the * Tclo/RPC system can handle, which is GUESTMSG_MAX_IN_SIZE. */ static char tcloBuffer[GUESTMSG_MAX_IN_SIZE]; - - - requestName = ToolsDaemonTcloGetQuotedString(args, &args); + +#if defined(VMTOOLS_USE_GLIB) + ToolsAppCtx *ctx = data->appCtx; + GMainLoop *eventQueue = ctx->mainLoop; + GKeyFile *confDictRef = ctx->config; +#else + DblLnkLst_Links *eventQueue = globalEventQueue; + GuestApp_Dict **confDictRef = data->clientData; +#endif + + requestName = ToolsDaemonTcloGetQuotedString(data->args, &data->args); /* * Skip the NULL, char, and then the rest of the buffer should just * be a Vix command object. */ - while (*args) { - args += 1; + while (*data->args) { + data->args += 1; } - args += 1; - err = VixMsg_ValidateMessage((char *) args, argsSize); + data->args += 1; + err = VixMsg_ValidateMessage((char *) data->args, data->argsSize); if (VIX_OK != err) { goto abort; } - requestMsg = (VixCommandRequestHeader *) args; - confDictRef = (GuestApp_Dict **) clientData; + requestMsg = (VixCommandRequestHeader *) data->args; maxResultBufferSize = sizeof(tcloBuffer) - vixPrefixDataSize; err = VixTools_ProcessVixCommand(requestMsg, requestName, maxResultBufferSize, confDictRef, + eventQueue, &resultValue, &resultValueLength, &deleteResultValue); @@ -1792,7 +1804,7 @@ if ((NULL != requestMsg) && (requestMsg->commonHeader.commonFlags & VIX_COMMAND_GUEST_RETURNS_BINARY)) { *(destPtr++) = '#'; - *resultLen = destPtr - tcloBuffer + sizeof '#' + resultValueLength; + data->resultLen = destPtr - tcloBuffer + sizeof '#' + resultValueLength; } /* @@ -1807,10 +1819,10 @@ if ((NULL == requestMsg) || !(requestMsg->commonHeader.commonFlags & VIX_COMMAND_GUEST_RETURNS_BINARY)) { *(destPtr++) = 0; - *resultLen = strlen(tcloBuffer); + data->resultLen = strlen(tcloBuffer) + 1; } - *result = tcloBuffer; + data->result = tcloBuffer; if (deleteResultValue) { free(resultValue); diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/guestd/foundryToolsDaemon.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/guestd/foundryToolsDaemon.h --- open-vm-tools-2008.01.23-74039/guestd/foundryToolsDaemon.h 2008-01-28 08:02:53.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/guestd/foundryToolsDaemon.h 2008-10-13 08:01:54.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -29,6 +29,15 @@ # define __VIX_TOOLS_DAEMON_H__ +#if defined(VMTOOLS_USE_GLIB) + +#include "vmtoolsApp.h" + +void +FoundryToolsDaemon_Initialize(ToolsAppCtx *ctx); + +#else /* not vix plugin */ + #include "vm_basic_types.h" #include "rpcin.h" #include "guestApp.h" @@ -47,5 +56,6 @@ Bool FoundryToolsDaemon_RegisterOpenUrlCapability(void); Bool FoundryToolsDaemon_UnregisterOpenUrl(void); +#endif #endif /* __VIX_TOOLS_DAEMON_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/guestd/guestd_version.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/guestd/guestd_version.h --- open-vm-tools-2008.01.23-74039/guestd/guestd_version.h 2008-01-28 08:02:53.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/guestd/guestd_version.h 2008-10-13 08:01:53.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/guestd/main.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/guestd/main.c --- open-vm-tools-2008.01.23-74039/guestd/main.c 2008-01-28 08:02:53.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/guestd/main.c 2008-10-13 08:01:53.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -33,17 +33,6 @@ #include #include #include -#if !defined(__FreeBSD__) && !defined(sun) -#include -#include -#include -#include -#include -#include -#include -#include -#include -#endif #include "vmware.h" @@ -68,10 +57,10 @@ #include "escape.h" #include "vmstdio.h" #include "vmBackup.h" +#include "codeset.h" -#if !defined(__FreeBSD__) && !defined(sun) +#if !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__) #include "socketMgr.h" -#include "dnd.h" #endif /* Header to get prototype of daemon() implementation for Solaris. */ @@ -79,6 +68,7 @@ # include "miscSolaris.h" #endif +/* XXX Refactor this. Push VM_GUESTD_MOUNTS_HGFS to whomever builds this file. */ #if defined(sun) # define VM_GUESTD_MOUNTS_HGFS 1 # define VM_GUESTD_RUNS_HGFS_PSERVER 1 @@ -104,7 +94,12 @@ #include "guestd_version.h" #include "embed_version.h" +/* + * XXX VM_EMBED_VERSION is ELF-specific, and Mac OS doesn't grok that. + */ +#ifndef __APPLE__ VM_EMBED_VERSION(GUESTD_VERSION_STRING); +#endif /* * Global constants @@ -130,19 +125,6 @@ # endif #endif -#if !defined(__FreeBSD__) && !defined(sun) -#define VMWAREUSER_CHECK_TIME 1000 /* 10 seconds */ -#define XAUTOSTART_CONF "xautostart.conf" -#define NR_XBLESSED_APP_DEFAULT 2 -/* Default blessed app for gnome. */ -#define XBLESSED_APP1_DEFAULT "gnome-panel" -/* - * Default blessed app for KDE. Only a few apps can be chosen, because most - * X apps, like kicker, are loaded by kdeinit with empty environ. ksmserver - * is KDE session manager and has environ. - */ -#define XBLESSED_APP2_DEFAULT "ksmserver" -#endif /* * All signals that: * . Can terminate the process @@ -162,17 +144,6 @@ * Global variables */ -#if !defined(__FreeBSD__) && !defined(sun) -static const char *gBinDir; -static char *gDefaultBlessedApp[] = { - XBLESSED_APP1_DEFAULT, - XBLESSED_APP2_DEFAULT, -}; -typedef struct blessedAppNode { - char *name; - struct blessedAppNode *next; -} blessedAppNode; -#endif /* * What a pity that the signal API doesn't allow to pass a clientData @@ -618,704 +589,6 @@ #endif /* VM_GUESTD_MOUNTS_HGFS */ -#if !defined(__FreeBSD__) && !defined(sun) -/* - *---------------------------------------------------------------------- - * - * GuestdInitBlessedAppList -- - * - * Initialize blessed app list. - * - * Results: - * Head of blessed app list. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ -static blessedAppNode* -GuestdInitBlessedAppList(char *name) -{ - blessedAppNode *head; - head = Util_SafeMalloc(sizeof *head); - head->name = name; - head->next = NULL; - return head; -} - - -/* - *---------------------------------------------------------------------- - * - * GuestdAddBlessedAppNode -- - * - * Add a node to end of the blessed app list. - * - * Results: - * None. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ -static void -GuestdAddBlessedAppNode(blessedAppNode *head, char *name) -{ - ASSERT(head); - while (head->next) { - head = head->next; - } - head->next = Util_SafeMalloc(sizeof *head); - head = head->next; - head->name = name; - head->next = NULL; -} - - -/* - *---------------------------------------------------------------------- - * - * GuestdFreeBlessedAppList -- - * - * Free blessed app list. - * - * Results: - * None. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ -static void -GuestdFreeBlessedAppList(blessedAppNode *head) -{ - blessedAppNode *cur = head; - while (cur) { - head = cur->next; - free(cur->name); - free(cur); - cur = head; - } -} - - -/* - *---------------------------------------------------------------------- - * - * GuestdGetBlessedApp -- - * - * Try to get blessed app list from X autostart conf file. The conf - * is used to set blessed file list, which is used to check if X is - * loaded or not. Blessed file lists for different X distro are - * not same. If failed, try to get default list. - * - * Results: - * Blessed app name list if any, NULL otherwise. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ -static blessedAppNode* -GuestdGetBlessedAppList(void) -{ - FILE* confFile = NULL; - char *fileName = NULL; - const char *installPath = GuestApp_GetInstallPath(); - char *appName = NULL; - size_t myLineLen; - int index; - blessedAppNode *ret = NULL; - - ASSERT(installPath); - - fileName = Str_Asprintf(NULL, "%s"DIRSEPS"%s", installPath, XAUTOSTART_CONF); - if (NULL == fileName) { - Debug("GuestdGetBlessedAppList: Unable to allocate memory\n"); - goto exit; - } - confFile = fopen(fileName, "r"); - if (NULL == confFile) { - /* If can not open conf file, use default value. */ - Debug("GuestdGetBlessedAppList: Unable to open conf file, use default value.\n"); - goto default_exit; - } - - while (TRUE) { - switch (StdIO_ReadNextLine(confFile, &appName, 0, &myLineLen)) { - case StdIO_Error: - Debug("GuestdGetBlessedAppList: Unable to read conf file, use default value.\n"); - goto default_exit; - - case StdIO_EOF: - goto exit; - - case StdIO_Success: - if (ret == NULL) { - ret = GuestdInitBlessedAppList(appName); - } else { - GuestdAddBlessedAppNode(ret, appName); - } - break; - - default: - NOT_IMPLEMENTED(); - } - } - NOT_REACHED(); - -default_exit: - if (ret != NULL) { - GuestdFreeBlessedAppList(ret); - ret = NULL; - } - for (index = 0; index < NR_XBLESSED_APP_DEFAULT; index++) { - appName = Str_Asprintf(NULL, "%s", gDefaultBlessedApp[index]); - if (appName == NULL) { - Debug("GuestdGetBlessedAppList: Unable to allocate memory\n"); - goto exit; - } - if (ret == NULL) { - ret = GuestdInitBlessedAppList(appName); - } else { - GuestdAddBlessedAppNode(ret, appName); - } - } -exit: - free(fileName); - if (confFile) { - fclose(confFile); - } - return ret; -} - - -/* - *----------------------------------------------------------------------------- - * - * GuestdGetAppEnv -- - * - * Get an environ string from environ table. - * - * Results: - * Environ string if found, NULL otherwise. - * - * Side effects: - * None. - * - *----------------------------------------------------------------------------- - */ - -static char * -GuestdGetAppEnv(pid_t pid, // IN: app pid; - const char *envName) // IN: env variable name -{ - char *fileName = NULL; - FILE *envFile; - char buffer[65536]; - size_t readSize; - unsigned int index = 0; - char *ret = NULL; - - fileName = Str_Asprintf(NULL, "/proc/%d/environ", pid); - if (NULL == fileName) { - Debug("GuestdGetAppEnv: Unable to allocate memory\n"); - return ret; - } - envFile = fopen(fileName, "r"); - if (NULL == envFile) { - /* - * We may not be able to open the file due to the security reason. - */ - Debug("GuestdGetAppEnv: Unable to open env file for %s.\n", fileName); - free(fileName); - return ret; - } - - readSize = fread(buffer, 1, sizeof buffer, envFile); - - /* Separator in environ is '\0'. */ - while (index < readSize) { - if (!strncmp(&buffer[index], envName, strlen(envName))) { - ret = Str_Asprintf(NULL, "%s", &buffer[index]); - break; - } - index += strlen(&buffer[index]) + 1; - } - free(fileName); - fclose(envFile); - return ret; -} - - -/* - *----------------------------------------------------------------------------- - * - * GuestdGetAppDisplay -- - * - * Get app $DISPLAY from environ. - * - * Results: - * $DISPALY if any, -1 otherwise. - * - * Side effects: - * None. - * - *----------------------------------------------------------------------------- - */ - -static int -GuestdGetAppDisplay(pid_t pid) // IN: app pid -{ - int ret = -1; - int display; - - char *env = GuestdGetAppEnv(pid, "DISPLAY"); - if (env) { - if (sscanf(env, "DISPLAY=:%d.", &display) == 1) { - ret = display; - } - free(env); - } - return ret; -} - - -/* - *----------------------------------------------------------------------------- - * - * GuestdGetActiveXDisplay -- - * - * Get active X display. Call the VT_GETSTATE ioctl on /dev/tty0 or - * /dev/vc/0, this returns the current VT number. Then Iterate all X in - * /tmp/.X#-lock, and get all X PIDs. For each XPID, Iterate the X server's - * file descriptors in /proc//fd/ looking for open /dev/tty# devices. - * Compare the current VT and tty#, find out active $DISPLAY. - * - * Results: - * Active X display, -1 otherwise. - * - * Side effects: - * None - * - *----------------------------------------------------------------------------- - */ - -static int -GuestdGetActiveXDisplay(void) -{ - char fileName[PATH_MAX]; - FILE *xPidFile = NULL; - pid_t xPid = 0; - int tty; - int display; - struct vt_stat state; - DIR *tmpdir = NULL; - struct dirent *tmpent; - char linkName[PATH_MAX]; - char ttyName[32]; - char vcName[32]; - char *dirName = NULL; - int ret = -1; - - /* - * Call the VT_GETSTATE ioctl on /dev/tty0 or /dev/vc/0, this returns the - * current VT number. - */ - tty = open("/dev/tty0", O_RDONLY); - if (tty < 0) { - tty = open("/dev/vc/0", O_RDONLY); - } - - if (tty < 0) { - Debug("GuestdGetActiveXDisplay: Cannot get current tty\n"); - goto exit; - } - - if (ioctl(tty, VT_GETSTATE, &state) < 0) { - Debug("GuestdGetActiveXDisplay: Cannot get state info for tty\n"); - close(tty); - goto exit; - } - close(tty); - - Str_Sprintf(ttyName, sizeof(ttyName), "/dev/tty%u", state.v_active); - Str_Sprintf(vcName, sizeof(vcName), "/dev/vc/%u", state.v_active); - Debug("GuestdGetActiveXDisplay: active tty is %d\n", state.v_active); - - /* Try to get all X PIDs from /tmp/.X#-lock. */ - tmpdir = opendir("/tmp"); - if (NULL == tmpdir) { - Debug("GuestdGetActiveXDisplay: Unable to open /tmp\n"); - goto exit; - } - - while ((tmpent = readdir(tmpdir))) { - int res = sscanf(tmpent->d_name, ".X%u%s", &display, fileName); - if ((res == 2) && (strncmp(fileName, "-lock", 5) == 0)) { - DIR *xdir; - struct dirent *xent; - - Str_Snprintf(fileName, sizeof fileName, "/tmp/%s", tmpent->d_name); - xPidFile = fopen(fileName, "r"); - if (xPidFile) { - fscanf(xPidFile, "%"FMTPID"\n", &xPid); - fclose(xPidFile); - } else { - Debug("GuestdGetActiveXDisplay: Cannot get current X pid.\n"); - goto exit; - } - - /* - * Iterate the X server's file descriptors in /proc//fd/ looking - * for open /dev/tty# devices. - */ - dirName = Str_Asprintf(NULL, "/proc/%d/fd", xPid); - if (NULL == dirName) { - Debug("GuestdGetActiveXDisplay: Unable to allocate memory\n"); - goto exit; - } - xdir = opendir(dirName); - - if (NULL == xdir) { - Debug("GuestdGetActiveXDisplay: Unable to open %s\n", dirName); - free(dirName); - goto exit; - } - free(dirName); - - while ((xent = readdir(xdir))) { - Str_Snprintf(fileName, sizeof fileName, "/proc/%u/fd/%s", - xPid, xent->d_name); - memset(linkName, 0, sizeof linkName); - readlink(fileName, linkName, sizeof linkName); - if ((strcmp(linkName, ttyName) == 0) || - (strcmp(linkName, vcName) == 0)) { - closedir(xdir); - ret = display; - goto exit; - } - } - closedir(xdir); - } - } -exit: - if (tmpdir) { - closedir(tmpdir); - } - return ret; -} - - -/* - *----------------------------------------------------------------------------- - * - * GuestdRunVMwareUser -- - * - * Run vmware-user as "foundUser" with environ from blessedPid. We do this - * so that we get a reasonable login environment for "foundUser". We take - * care to shell escape the username. - * - * Results: - * None. - * - * Side effects: - * May start vmware-user. Because it is running is a separated process, - * in any case it will exit. - * - *----------------------------------------------------------------------------- - */ - -static void -GuestdRunVMwareUser(pid_t blessedPid) // IN: blessed pid -{ - char *fileName = NULL; - char *foundUser = NULL; - char *xauth = NULL; - Bool isXauthSet = FALSE; - FILE *envFile; - char buffer[65536]; - size_t readSize; - char *cmd; - struct passwd *pwd; - unsigned int index = 0; - int blockFd; - - /* - * If current active account is non-root, vmware-user can not initialize - * blocking driver for host->guest file copy paste. So open here before - * setuid and pass fd to vmware-user. - */ - blockFd = DnD_InitializeBlocking(); - if (blockFd < 0) { - Debug("GuestdRunVMwareUser: Unable to initialize block driver.\n"); - } - - /* Try to get user from blessed pid's environ. */ - fileName = Str_Asprintf(NULL, "/proc/%d/environ", blessedPid); - if (NULL == fileName) { - Debug("GuestdRunVMwareUser: Unable to allocate memory\n"); - goto childerror; - } - envFile = fopen(fileName, "r"); - if (NULL == envFile) { - /* - * We may not be able to open the file due to the security reason. - */ - Debug("GuestdRunVMwareUser: Unable to open env file for %s\n", fileName); - free(fileName); - goto childerror; - } - - readSize = fread(buffer, 1, sizeof buffer, envFile); - - /* Separator in environ is '\0'. */ - while (index < readSize) { - if (!strncmp(&buffer[index], "USER=", 5)) { - foundUser = Str_Asprintf(NULL, "%s", &buffer[index + 5]); - if (NULL == foundUser) { - Debug("GuestdRunVMwareUser: Unable to allocate memory\n"); - free(fileName); - fclose(envFile); - goto childerror; - } - break; - } - index += strlen(&buffer[index]) + 1; - } - free(fileName); - fclose(envFile); - - /* Switch from root to foundUser. */ - pwd = getpwnam(foundUser); - if (pwd == NULL) { - Debug("GuestdRunVMwareUser: Unable to lookup UID for %s\n", foundUser); - goto childerror; - } - - if (setgid(pwd->pw_gid) != 0) { - Debug("GuestdRunVMwareUser: Unable to setgid for %s\n", foundUser); - goto childerror; - } - - if (setuid(pwd->pw_uid) != 0) { - Debug("GuestdRunVMwareUser: Unable to setuid for %s\n", foundUser); - goto childerror; - } - - /* Set env. Separator in environ is '\0'. */ - index = 0; - while (index < readSize) { - if (putenv((char *)&buffer[index]) != 0) { - Debug("GuestdRunVMwareUser: Unable to putenv: %s\n", &buffer[index]); - goto childerror; - } - if (!strncmp(&buffer[index], "HOME=", 5)) { - xauth = Str_Asprintf(NULL, "XAUTHORITY=%s/.Xauthority", &buffer[index + 5]); - } - if (!strncmp(&buffer[index], "XAUTHORITY=", 11)) { - isXauthSet = TRUE; - } - index += strlen(&buffer[index]) + 1; - } - - /* In KDE XAUTHORITY may not be set, so set it to default value. */ - if (!isXauthSet) { - if (!xauth || (putenv(xauth) != 0)) { - Debug("GuestdRunVMwareUser: Unable to putenv for xauth\n"); - goto childerror; - } - } - free(foundUser); - foundUser = NULL; - free(xauth); - xauth = NULL; - - /* Load vmware-user. */ - cmd = Str_Asprintf(NULL, "%s/vmware-user", gBinDir); - if (cmd == NULL) { - Debug("GuestdRunVMwareUser unable to allocate \"cmd\"\n"); - goto childerror; - } - Debug("GuestdRunVMwareUser: Run cmd \"%s\"\n", cmd); - - Str_Sprintf(buffer, sizeof buffer, "%d", blockFd); - execl(cmd, cmd, ">/dev/null", "2>&1", "-blockFd", buffer, NULL); - Debug("GuestdRunVMwareUser: Cannot run cmd \"%s\"\n", cmd); - - /* We should only get here from a goto. */ -childerror: - free(foundUser); - free(xauth); - if (blockFd >= 0 && !DnD_UninitializeBlocking(blockFd)) { - Debug("GuestdRunVMwareUser unable to uninitialize blocking.\n"); - } - exit(1); -} - - -/* - *----------------------------------------------------------------------------- - * - * GuestdCheckVMwareUser -- - * - * EventManager callback function that checks up on the vmware-user process. - * If a user is logged in to the active X disaply, vmware-user should be - * running. If no active one, vmware-user should NOT be running. - * - * Results: - * TRUE. If we return FALSE, the event manager falls over. - * - * Side effects: - * May start or kill vmware-user. - * - *----------------------------------------------------------------------------- - */ - -static Bool -GuestdCheckVMwareUser(void *clientData) // IN/OUT: vmware-user's pid -{ - pid_t *pid = (pid_t *)clientData; - pid_t blessedPid = 0; - char *blessedApp = NULL; - char *blessedUser = NULL; - char *userUser = NULL; - char processName[256]; - int iProc = 0; - int activeDisplay = -1; - int userDisplay = -1; - uint32 period = VMWAREUSER_CHECK_TIME; - blessedAppNode *appList; - blessedAppNode *cur; - ProcMgr_ProcList *procList; - - - /* Get active X Window $DISPLAY. */ - activeDisplay = GuestdGetActiveXDisplay(); - Debug("GuestdCheckVMwareUser: Get active x display %d\n", activeDisplay); - - /* Get process list. */ - procList = ProcMgr_ListProcesses(); - if (procList == NULL) { - Debug("GuestdCheckVMwareUser: Could not get process listing\n"); - return FALSE; - } - - /* Get vmware-user id. If not existing, set to 0. */ - *pid = 0; - for (iProc = procList->procCount - 1; iProc >= 0; iProc--) { - Util_GetProcessName(procList->procIdList[iProc], - processName, - sizeof processName); - if (strcmp(processName, "vmware-user") == 0) { - *pid = procList->procIdList[iProc]; - userDisplay = GuestdGetAppDisplay(*pid); - break; - } - } - Debug("GuestdCheckVMwareUser: vmware-user pid is %d\n", *pid); - if (activeDisplay < 0) { - goto stopVMwareUser; - } - - if (activeDisplay == userDisplay) { - goto exit; - } - - if (*pid > 0) { - userUser = GuestdGetAppEnv(*pid, "USER"); - } - - /* - * Get blessed app list, then check if any app is up. App's $DISPLAY - * should also be same as active X display. - */ - appList = GuestdGetBlessedAppList(); - cur = appList; - while (cur) { - blessedApp = cur->name; - Debug("GuestdCheckVMwareUser: Got blessed app %s\n", blessedApp); - for (iProc = procList->procCount - 1; iProc >= 0; iProc--) { - Util_GetProcessName(procList->procIdList[iProc], - processName, - sizeof processName); - if ((strcmp(processName, blessedApp) == 0) && - (GuestdGetAppDisplay(procList->procIdList[iProc]) == activeDisplay)) { - blessedPid = procList->procIdList[iProc]; - break; - } - } - /* If any app started, start vmware-user. */ - if (blessedPid > 0) { - break; - } - cur = cur->next; - } - GuestdFreeBlessedAppList(appList); - - Debug("GuestdCheckVMwareUser: got blessed pid %d\n", blessedPid); - if (blessedPid == 0) { - goto stopVMwareUser; - } - - if (*pid == 0) { - /* - * There is a active X session and vmware-user isn't running, - * we should start it with fork/exec. - */ - *pid = fork(); - if (*pid == -1) { - Debug("GuestdCheckVMwareUser: Unable to fork: %s.\n\n", strerror(errno)); - /* - * Reset pid to 0, maybe we'll be able to fork next time around - */ - *pid = 0; - } else if (*pid == 0) { - /* Child. This function will not return. */ - GuestdRunVMwareUser(blessedPid); - } else { - /* - * This is the parent after the fork. The parent doesn't need to do - * anything special since the child's pid is already recorded. I left this - * comment here anyway as a placeholder. - */ - } - } else { - blessedUser = GuestdGetAppEnv(blessedPid, "USER"); - if ((strcmp(userUser, blessedUser) != 0) || - (userDisplay != activeDisplay)) { - /* - * vmware-user's user name is not right one, or display does match active - * X display so kill current vmware-user and start another one soon. - */ - period /= 10; - goto stopVMwareUser; - } - } - goto exit; - -stopVMwareUser: - if (*pid != 0) { - Debug("GuestdCheckVMwareUser: Killing vmware-user.\n"); - kill(*pid, SIGTERM); - *pid = 0; - } - -exit: - free(userUser); - free(blessedUser); - ProcMgr_FreeProcList(procList); - EventManager_Add(ToolsDaemonEventQueue, period, - GuestdCheckVMwareUser, clientData); - return TRUE; -} -#endif - - /* *----------------------------------------------------------------------------- * @@ -1591,7 +864,7 @@ int maxFd; /* Max fd of all Fd sets */ fd_set readFds; /* Read fd set to select on */ fd_set writeFds; -#if !defined(__FreeBSD__) && !defined(sun) +#if !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__) SocketSelectable *sockReadFds = NULL; SocketSelectable *sockWriteFds = NULL; int numSockReadFds = 0; @@ -1638,7 +911,7 @@ } #endif -#if !defined(__FreeBSD__) && !defined(sun) +#if !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__) SocketMgr_GetSelectables(SOCKETMGR_IN, &sockReadFds, &numSockReadFds); @@ -1696,7 +969,7 @@ curAsyncProc = NULL; } -#if !defined(__FreeBSD__) && !defined(sun) +#if !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__) for (index = 0; index < numSockReadFds; index++) { if (FD_ISSET(sockReadFds[index], &readFds)) { SocketMgr_ProcessSelectable(sockReadFds[index], SOCKETMGR_IN); @@ -1711,7 +984,7 @@ #endif } -#if !defined(__FreeBSD__) && !defined(sun) +#if !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__) free((void *) sockReadFds); free((void *) sockWriteFds); #endif @@ -1740,9 +1013,7 @@ GuestdDaemon(GuestApp_Dict **pConfDict, // IN/OUT int *gDaemonSignalPtr) // IN/OUT { -#if !defined(__FreeBSD__) && !defined(sun) - pid_t vmwareuserPid = 0; -#endif + Bool guestInfoEnabled = FALSE; ToolsDaemon_Data *data = NULL; VmBackupSyncProvider *syncProvider = NULL; @@ -1780,6 +1051,8 @@ data = ToolsDaemon_Init(pConfDict, EXEC_LOG, GuestdExecuteHalt, pConfDict, GuestdExecuteReboot, pConfDict, + NULL, NULL, + NULL, NULL, NULL, NULL); if (!data) { Warning("Unable to start guestd.\n"); @@ -1788,28 +1061,15 @@ ASSERT(data->in); - /* - * Set up the guest info 'server'. On Linux, a separate event loop thread - * is not spawned. - */ + /* Set up the guest info 'server'. */ if (!GuestInfoServer_Init(ToolsDaemonEventQueue)) { Warning("Unable to start guest info server.\n"); } else { + guestInfoEnabled = TRUE; GuestInfoServer_DisableDiskInfoQuery( GuestApp_GetDictEntryBool(*pConfDict, CONFNAME_DISABLEQUERYDISKINFO)); } -#if !defined(__FreeBSD__) && !defined(sun) - gBinDir = GuestApp_GetDictEntry(*pConfDict, CONFNAME_BINDIR); - if (gBinDir == NULL) { - gBinDir = "/usr/bin"; - } - /* - * This function will add itself to the event manager - */ - GuestdCheckVMwareUser(&vmwareuserPid); -#endif - /* * Start listening for VMX requests to create the upgrader. */ @@ -1822,7 +1082,9 @@ */ syncProvider = VmBackup_NewSyncDriverProvider(); if (syncProvider != NULL) { - VmBackup_Init(data->in, ToolsDaemonEventQueue, syncProvider); + Bool loggingEnabled = GuestApp_GetDictEntryBool(*pConfDict, CONFNAME_LOG); + VmBackup_Init(data->in, ToolsDaemonEventQueue, syncProvider, + loggingEnabled); } else { Debug("No vmBackup implementation available!\n"); } @@ -1872,25 +1134,22 @@ NOT_REACHED(); out: + if (guestInfoEnabled) { + GuestInfoServer_Cleanup(); + } #if defined(VM_GUESTD_RUNS_HGFS_PSERVER) HgfsPserver_Cleanup(&globalHgfsState); #elif defined(VM_GUESTD_MOUNTS_HGFS) HgfsMountState_Cleanup(&globalHgfsState); #endif - if (data) { - ToolsDaemon_Cleanup(data); - } - -#if !defined(__FreeBSD__) && !defined(sun) - if (vmwareuserPid != 0) { - kill(vmwareuserPid, SIGTERM); - } -#endif - if (syncProvider != NULL) { VmBackup_Shutdown(data->in); } + if (data) { + ToolsDaemon_Cleanup(data); + } + return *gDaemonSignalPtr == SIGTERM ? TRUE : FALSE; } @@ -1973,8 +1232,12 @@ pidFile = fopen(pidFileName, "r"); if (pidFile) { - fscanf(pidFile, "%"FMTPID"\n", &pid); + int ret; + ret = fscanf(pidFile, "%"FMTPID"\n", &pid); fclose(pidFile); + if (ret != 1) { + return FALSE; + } /* * XXX There is an assumption that if the process with pid is alive, @@ -2006,50 +1269,6 @@ /* *----------------------------------------------------------------------------- * - * GuestdWritePidfile -- - * - * Write a pid into a pidfile - * - * Return value: - * TRUE on success - * FALSE on failure (detail is displayed) - * - * Side effects: - * None - * - *----------------------------------------------------------------------------- - */ - -static Bool -GuestdWritePidfile(char const *fileName, // IN - pid_t pid) // IN -{ - FILE *pidFile; - - pidFile = fopen(fileName, "w+"); - if (pidFile == NULL) { - fprintf(stderr, "Unable to open the \"%s\" PID file: %s.\n\n", fileName, - strerror(errno)); - - return FALSE; - } - - fprintf(pidFile, "%"FMTPID"\n", pid); - - if (fclose(pidFile)) { - fprintf(stderr, "Unable to close the \"%s\" PID file: %s.\n\n", fileName, - strerror(errno)); - - return FALSE; - } - - return TRUE; -} - - -/* - *----------------------------------------------------------------------------- - * * GuestdUsage -- * * Write an help message on stderr and exit @@ -2130,6 +1349,15 @@ int argumentIndex; int expectedArgumentIndex; + if (!VmCheck_IsVirtualWorld()) { +#ifndef ALLOW_TOOLS_IN_FOREIGN_VM + Warning("The VMware service must be run from within a virtual machine.\n"); + return 0; +#else + runningInForeignVM = TRUE; +#endif + } + confDict = Conf_Load(); /* @@ -2247,14 +1475,6 @@ GuestdUsage(argv[0], 0); } - if (!VmCheck_IsVirtualWorld()) { -#ifndef ALLOW_TOOLS_IN_FOREIGN_VM - Panic("The VMware service must be run from within a virtual machine.\n"); -#else - runningInForeignVM = TRUE; -#endif - } - if (rpci) { return GuestdCommandLineRpci(arguments[0]) ? 0 : 1; } @@ -2278,13 +1498,11 @@ } if (pidFile) { - if (daemon(FALSE, FALSE)) { + if (!System_Daemon(FALSE, FALSE, pidFile)) { fprintf(stderr, "Unable to daemonize: %s\n", strerror(errno)); GuestApp_FreeDict(confDict); exit(1); } - /* From here on we are detached from controlling terminal. */ - GuestdWritePidfile(pidFile, getpid()); } retVal = GuestdDaemonWrapper(&confDict) ? 0 : 1; diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/guestd/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/guestd/Makefile.am --- open-vm-tools-2008.01.23-74039/guestd/Makefile.am 2008-01-28 08:02:53.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/guestd/Makefile.am 2008-10-13 08:01:53.000000000 +0100 @@ -15,77 +15,96 @@ ### Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ -### -### This Makefile describes -### - -noinst_PROGRAMS = guestd - -AM_CFLAGS = -AM_CFLAGS += @COMMON_CFLAGS@ - -guestd_LDADD = -guestd_LDADD += ../lib/atomic/libAtomic.a -guestd_LDADD += ../lib/backdoor/libBackdoor.a -guestd_LDADD += ../lib/conf/libConf.a -guestd_LDADD += ../lib/dnd/libDnd.a -guestd_LDADD += ../lib/err/libErr.a -guestd_LDADD += ../lib/eventManager/libEventManager.a -guestd_LDADD += ../lib/file/libFile.a -guestd_LDADD += ../lib/guestApp/libGuestApp.a -guestd_LDADD += ../lib/guestInfo/libGuestInfo.a -guestd_LDADD += ../lib/hgfsServer/libHgfsServer.a -guestd_LDADD += ../lib/hgfsServerManagerGuest/libHgfsServerManagerGuest.a -guestd_LDADD += ../lib/hgfsServerPolicyGuest/libHgfsServerPolicyGuest.a -guestd_LDADD += ../lib/deployPkg/libDeployPkg.a -guestd_LDADD += ../lib/impersonate/libImpersonate.a -guestd_LDADD += ../lib/netUtil/libNetUtil.a -guestd_LDADD += ../lib/printer/libPrinter.a -guestd_LDADD += ../lib/procMgr/libProcMgr.a -guestd_LDADD += ../lib/rpcIn/libRpcIn.a -guestd_LDADD += ../lib/rpcOut/libRpcOut.a -guestd_LDADD += ../lib/rpcVmx/libRpcVmx.a -guestd_LDADD += ../lib/SLPv2Parser/libSLPv2Parser.a -guestd_LDADD += ../lib/socketMgr/libSocketMgr.a -guestd_LDADD += ../lib/strUtil/libStrUtil.a -guestd_LDADD += ../lib/string/libString.a -guestd_LDADD += ../lib/sync/libSync.a -guestd_LDADD += ../lib/syncDriver/libSyncDriver.a -guestd_LDADD += ../lib/system/libSystem.a -guestd_LDADD += ../lib/user/libUser.a -guestd_LDADD += ../lib/vixTools/libVixTools.a -guestd_LDADD += ../lib/vmBackupLib/libVmBackupLib.a -guestd_LDADD += ../lib/vmCheck/libVmCheck.a -guestd_LDADD += ../lib/vmSignal/libVmSignal.a -guestd_LDADD += ../lib/wiper/libWiper.a +sbin_PROGRAMS = vmware-guestd +pamdir = $(PAM_PREFIX)/pam.d + +AM_CFLAGS = -I$(top_builddir)/include + +vmware_guestd_LDADD = +vmware_guestd_LDADD += ../lib/backdoor/libBackdoor.a +vmware_guestd_LDADD += ../lib/conf/libConf.a +vmware_guestd_LDADD += ../lib/dnd/libDnd.a +vmware_guestd_LDADD += ../lib/err/libErr.a +vmware_guestd_LDADD += ../lib/eventManager/libEventManager.a +vmware_guestd_LDADD += ../lib/file/libFile.a +vmware_guestd_LDADD += ../lib/guestApp/libGuestApp.a +vmware_guestd_LDADD += ../lib/guestInfo/libGuestInfo.a +vmware_guestd_LDADD += ../lib/guestRpc/libGuestRpc.a +vmware_guestd_LDADD += ../lib/hgfsServer/libHgfsServer.a +vmware_guestd_LDADD += ../lib/hgfsServerManagerGuest/libHgfsServerManagerGuest.a +vmware_guestd_LDADD += ../lib/hgfsServerPolicyGuest/libHgfsServerPolicyGuest.a +vmware_guestd_LDADD += ../lib/deployPkg/libDeployPkg.a +vmware_guestd_LDADD += ../lib/impersonate/libImpersonate.a +vmware_guestd_LDADD += ../lib/netUtil/libNetUtil.a +vmware_guestd_LDADD += ../lib/printer/libPrinter.a +vmware_guestd_LDADD += ../lib/procMgr/libProcMgr.a +vmware_guestd_LDADD += ../lib/rpcIn/libRpcIn.a +vmware_guestd_LDADD += ../lib/rpcOut/libRpcOut.a +vmware_guestd_LDADD += ../lib/rpcVmx/libRpcVmx.a +vmware_guestd_LDADD += ../lib/SLPv2Parser/libSLPv2Parser.a +vmware_guestd_LDADD += ../lib/socketMgr/libSocketMgr.a +vmware_guestd_LDADD += ../lib/string/libString.a +vmware_guestd_LDADD += ../lib/sync/libSync.a +vmware_guestd_LDADD += ../lib/syncDriver/libSyncDriver.a +vmware_guestd_LDADD += ../lib/system/libSystem.a +vmware_guestd_LDADD += ../lib/user/libUser.a +vmware_guestd_LDADD += ../lib/vixTools/libVixTools.a +vmware_guestd_LDADD += ../lib/vmBackupLib/libVmBackupLib.a +vmware_guestd_LDADD += ../lib/vmCheck/libVmCheck.a +vmware_guestd_LDADD += ../lib/vmSignal/libVmSignal.a +vmware_guestd_LDADD += ../lib/wiper/libWiper.a # In the absence of the linker options --start-group and --end-group (which # can't be put in LDADD), we need to bring the following libraries out of the # alphabetical order so their symbols are properly resolved. -guestd_LDADD += ../lib/dict/libDict.a -guestd_LDADD += ../lib/hgfs/libHgfs.a -guestd_LDADD += ../lib/message/libMessage.a -guestd_LDADD += ../lib/unicode/libUnicode.a -guestd_LDADD += ../lib/misc/libMisc.a -guestd_LDADD += ../lib/foundryMsg/libFoundryMsg.a -guestd_LDADD += ../lib/fileUtf8/libFileUtf8.a -guestd_LDADD += ../lib/auth/libAuth.a -guestd_LDADD += ../lib/panicDefault/libPanicDefault.a -guestd_LDADD += ../lib/panic/libPanic.a +vmware_guestd_LDADD += ../lib/dict/libDict.a +vmware_guestd_LDADD += ../lib/dynxdr/libDynxdr.a +vmware_guestd_LDADD += ../lib/hgfs/libHgfs.a +vmware_guestd_LDADD += ../lib/message/libMessage.a +vmware_guestd_LDADD += ../lib/unicode/libUnicode.a +vmware_guestd_LDADD += ../lib/misc/libMisc.a +vmware_guestd_LDADD += ../lib/foundryMsg/libFoundryMsg.a +vmware_guestd_LDADD += ../lib/auth/libAuth.a +vmware_guestd_LDADD += ../lib/panicDefault/libPanicDefault.a +vmware_guestd_LDADD += ../lib/panic/libPanic.a +vmware_guestd_LDADD += ../lib/stubs/libStubs.a if SOLARIS HGFS_BD = ../lib/hgfsBd/libHgfsBd.a else HGFS_BD = endif -guestd_LDADD += $(HGFS_BD) +vmware_guestd_LDADD += $(HGFS_BD) +vmware_guestd_LDADD += @GUESTD_LDADD@ + +vmware_guestd_SOURCES = +vmware_guestd_SOURCES += debugStdio.c +vmware_guestd_SOURCES += foreignVMToolsDaemon.c +vmware_guestd_SOURCES += foreignVMToolsNetworking.c +vmware_guestd_SOURCES += foundryToolsDaemon.c +vmware_guestd_SOURCES += main.c +vmware_guestd_SOURCES += toolsDaemon.c + +if HAVE_ICU + vmware_guestd_LDADD += @ICU_LIBS@ + vmware_guestd_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CXX) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +else + vmware_guestd_LINK = $(LINK) +endif -guestd_LDFLAGS = -guestd_LDFLAGS += @GUESTD_LDFLAGS@ +if LINUX +if PAMD +if THIRTY_TWO_BIT_USERSPACE +pam_SCRIPTS = ../scripts/linux/pam.d/vmware-guestd +else +pam_SCRIPTS = ../scripts/linux/pam.d/vmware-guestd-x64 +endif !THIRTY_TWO_BIT_USERSPACE +endif PAMD +endif LINUX + +install-exec-hook: + $(INSTALL) -d $(DESTDIR)/etc/vmware-tools + echo 'disable-tools-version = "true"' > $(DESTDIR)/etc/vmware-tools/tools.conf -guestd_SOURCES = -guestd_SOURCES += debugStdio.c -guestd_SOURCES += foreignVMToolsDaemon.c -guestd_SOURCES += foreignVMToolsNetworking.c -guestd_SOURCES += foundryToolsDaemon.c -guestd_SOURCES += main.c -guestd_SOURCES += stub.c -guestd_SOURCES += toolsDaemon.c +uninstall-hook: + $(RM) -rf $(DESTDIR)/etc/vmware-tools diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/guestd/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/guestd/Makefile.in --- open-vm-tools-2008.01.23-74039/guestd/Makefile.in 2008-01-28 08:03:02.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/guestd/Makefile.in 2008-10-13 08:02:12.000000000 +0100 @@ -31,9 +31,6 @@ ### Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ -### -### This Makefile describes -### VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ @@ -53,28 +50,35 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -noinst_PROGRAMS = guestd$(EXEEXT) +sbin_PROGRAMS = vmware-guestd$(EXEEXT) +@HAVE_ICU_TRUE@am__append_1 = @ICU_LIBS@ subdir = guestd DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in COPYING ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +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)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = -PROGRAMS = $(noinst_PROGRAMS) -am_guestd_OBJECTS = debugStdio.$(OBJEXT) \ +am__installdirs = "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(pamdir)" +sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +PROGRAMS = $(sbin_PROGRAMS) +am_vmware_guestd_OBJECTS = debugStdio.$(OBJEXT) \ foreignVMToolsDaemon.$(OBJEXT) \ foreignVMToolsNetworking.$(OBJEXT) \ - foundryToolsDaemon.$(OBJEXT) main.$(OBJEXT) stub.$(OBJEXT) \ + foundryToolsDaemon.$(OBJEXT) main.$(OBJEXT) \ toolsDaemon.$(OBJEXT) -guestd_OBJECTS = $(am_guestd_OBJECTS) +vmware_guestd_OBJECTS = $(am_vmware_guestd_OBJECTS) @SOLARIS_TRUE@am__DEPENDENCIES_1 = ../lib/hgfsBd/libHgfsBd.a -guestd_DEPENDENCIES = ../lib/atomic/libAtomic.a \ - ../lib/backdoor/libBackdoor.a ../lib/conf/libConf.a \ - ../lib/dnd/libDnd.a ../lib/err/libErr.a \ +am__DEPENDENCIES_2 = +vmware_guestd_DEPENDENCIES = ../lib/backdoor/libBackdoor.a \ + ../lib/conf/libConf.a ../lib/dnd/libDnd.a ../lib/err/libErr.a \ ../lib/eventManager/libEventManager.a ../lib/file/libFile.a \ ../lib/guestApp/libGuestApp.a ../lib/guestInfo/libGuestInfo.a \ + ../lib/guestRpc/libGuestRpc.a \ ../lib/hgfsServer/libHgfsServer.a \ ../lib/hgfsServerManagerGuest/libHgfsServerManagerGuest.a \ ../lib/hgfsServerPolicyGuest/libHgfsServerPolicyGuest.a \ @@ -84,24 +88,23 @@ ../lib/procMgr/libProcMgr.a ../lib/rpcIn/libRpcIn.a \ ../lib/rpcOut/libRpcOut.a ../lib/rpcVmx/libRpcVmx.a \ ../lib/SLPv2Parser/libSLPv2Parser.a \ - ../lib/socketMgr/libSocketMgr.a ../lib/strUtil/libStrUtil.a \ - ../lib/string/libString.a ../lib/sync/libSync.a \ - ../lib/syncDriver/libSyncDriver.a ../lib/system/libSystem.a \ - ../lib/user/libUser.a ../lib/vixTools/libVixTools.a \ + ../lib/socketMgr/libSocketMgr.a ../lib/string/libString.a \ + ../lib/sync/libSync.a ../lib/syncDriver/libSyncDriver.a \ + ../lib/system/libSystem.a ../lib/user/libUser.a \ + ../lib/vixTools/libVixTools.a \ ../lib/vmBackupLib/libVmBackupLib.a \ ../lib/vmCheck/libVmCheck.a ../lib/vmSignal/libVmSignal.a \ ../lib/wiper/libWiper.a ../lib/dict/libDict.a \ - ../lib/hgfs/libHgfs.a ../lib/message/libMessage.a \ - ../lib/unicode/libUnicode.a ../lib/misc/libMisc.a \ - ../lib/foundryMsg/libFoundryMsg.a \ - ../lib/fileUtf8/libFileUtf8.a ../lib/auth/libAuth.a \ - ../lib/panicDefault/libPanicDefault.a ../lib/panic/libPanic.a \ - $(am__DEPENDENCIES_1) -guestd_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(guestd_LDFLAGS) \ - $(LDFLAGS) -o $@ + ../lib/dynxdr/libDynxdr.a ../lib/hgfs/libHgfs.a \ + ../lib/message/libMessage.a ../lib/unicode/libUnicode.a \ + ../lib/misc/libMisc.a ../lib/foundryMsg/libFoundryMsg.a \ + ../lib/auth/libAuth.a ../lib/panicDefault/libPanicDefault.a \ + ../lib/panic/libPanic.a ../lib/stubs/libStubs.a \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) +pamSCRIPT_INSTALL = $(INSTALL_SCRIPT) +SCRIPTS = $(pam_SCRIPTS) DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp +depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -112,8 +115,8 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ -SOURCES = $(guestd_SOURCES) -DIST_SOURCES = $(guestd_SOURCES) +SOURCES = $(vmware_guestd_SOURCES) +DIST_SOURCES = $(vmware_guestd_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -127,8 +130,6 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -COMMON_CFLAGS = @COMMON_CFLAGS@ -COMMON_PROG_CFLAGS = @COMMON_PROG_CFLAGS@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -139,45 +140,57 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ -ECHO = @ECHO@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GREP = @GREP@ -GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_AUTH_CFLAGS = @LIB_AUTH_CFLAGS@ -LIB_FILE_CFLAGS = @LIB_FILE_CFLAGS@ -LIB_HGFS_SERVER_CFLAGS = @LIB_HGFS_SERVER_CFLAGS@ -LIB_IMPERSONATE_CFLAGS = @LIB_IMPERSONATE_CFLAGS@ -LIB_MISC_CFLAGS = @LIB_MISC_CFLAGS@ -LIB_PROC_MGR_CFLAGS = @LIB_PROC_MGR_CFLAGS@ -LIB_STRING_CFLAGS = @LIB_STRING_CFLAGS@ -LIB_USER_CFLAGS = @LIB_USER_CFLAGS@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -185,27 +198,35 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ VERSION = @VERSION@ -VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -236,6 +257,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -250,14 +272,16 @@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -AM_CFLAGS = @COMMON_CFLAGS@ +pamdir = $(PAM_PREFIX)/pam.d +AM_CFLAGS = -I$(top_builddir)/include # In the absence of the linker options --start-group and --end-group (which # can't be put in LDADD), we need to bring the following libraries out of the # alphabetical order so their symbols are properly resolved. -guestd_LDADD = ../lib/atomic/libAtomic.a ../lib/backdoor/libBackdoor.a \ +vmware_guestd_LDADD = ../lib/backdoor/libBackdoor.a \ ../lib/conf/libConf.a ../lib/dnd/libDnd.a ../lib/err/libErr.a \ ../lib/eventManager/libEventManager.a ../lib/file/libFile.a \ ../lib/guestApp/libGuestApp.a ../lib/guestInfo/libGuestInfo.a \ + ../lib/guestRpc/libGuestRpc.a \ ../lib/hgfsServer/libHgfsServer.a \ ../lib/hgfsServerManagerGuest/libHgfsServerManagerGuest.a \ ../lib/hgfsServerPolicyGuest/libHgfsServerPolicyGuest.a \ @@ -267,25 +291,31 @@ ../lib/procMgr/libProcMgr.a ../lib/rpcIn/libRpcIn.a \ ../lib/rpcOut/libRpcOut.a ../lib/rpcVmx/libRpcVmx.a \ ../lib/SLPv2Parser/libSLPv2Parser.a \ - ../lib/socketMgr/libSocketMgr.a ../lib/strUtil/libStrUtil.a \ - ../lib/string/libString.a ../lib/sync/libSync.a \ - ../lib/syncDriver/libSyncDriver.a ../lib/system/libSystem.a \ - ../lib/user/libUser.a ../lib/vixTools/libVixTools.a \ + ../lib/socketMgr/libSocketMgr.a ../lib/string/libString.a \ + ../lib/sync/libSync.a ../lib/syncDriver/libSyncDriver.a \ + ../lib/system/libSystem.a ../lib/user/libUser.a \ + ../lib/vixTools/libVixTools.a \ ../lib/vmBackupLib/libVmBackupLib.a \ ../lib/vmCheck/libVmCheck.a ../lib/vmSignal/libVmSignal.a \ ../lib/wiper/libWiper.a ../lib/dict/libDict.a \ - ../lib/hgfs/libHgfs.a ../lib/message/libMessage.a \ - ../lib/unicode/libUnicode.a ../lib/misc/libMisc.a \ - ../lib/foundryMsg/libFoundryMsg.a \ - ../lib/fileUtf8/libFileUtf8.a ../lib/auth/libAuth.a \ - ../lib/panicDefault/libPanicDefault.a ../lib/panic/libPanic.a \ - $(HGFS_BD) + ../lib/dynxdr/libDynxdr.a ../lib/hgfs/libHgfs.a \ + ../lib/message/libMessage.a ../lib/unicode/libUnicode.a \ + ../lib/misc/libMisc.a ../lib/foundryMsg/libFoundryMsg.a \ + ../lib/auth/libAuth.a ../lib/panicDefault/libPanicDefault.a \ + ../lib/panic/libPanic.a ../lib/stubs/libStubs.a $(HGFS_BD) \ + @GUESTD_LDADD@ $(am__append_1) @SOLARIS_FALSE@HGFS_BD = @SOLARIS_TRUE@HGFS_BD = ../lib/hgfsBd/libHgfsBd.a -guestd_LDFLAGS = @GUESTD_LDFLAGS@ -guestd_SOURCES = debugStdio.c foreignVMToolsDaemon.c \ - foreignVMToolsNetworking.c foundryToolsDaemon.c main.c stub.c \ +vmware_guestd_SOURCES = debugStdio.c foreignVMToolsDaemon.c \ + foreignVMToolsNetworking.c foundryToolsDaemon.c main.c \ toolsDaemon.c +@HAVE_ICU_FALSE@vmware_guestd_LINK = $(LINK) +@HAVE_ICU_TRUE@vmware_guestd_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ +@HAVE_ICU_TRUE@ $(LIBTOOLFLAGS) --mode=link $(CXX) $(AM_CXXFLAGS) \ +@HAVE_ICU_TRUE@ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ + +@LINUX_TRUE@@PAMD_TRUE@@THIRTY_TWO_BIT_USERSPACE_FALSE@pam_SCRIPTS = ../scripts/linux/pam.d/vmware-guestd-x64 +@LINUX_TRUE@@PAMD_TRUE@@THIRTY_TWO_BIT_USERSPACE_TRUE@pam_SCRIPTS = ../scripts/linux/pam.d/vmware-guestd all: all-am .SUFFIXES: @@ -319,16 +349,56 @@ 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-noinstPROGRAMS: - @list='$(noinst_PROGRAMS)'; for p in $$list; do \ +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 -guestd$(EXEEXT): $(guestd_OBJECTS) $(guestd_DEPENDENCIES) - @rm -f guestd$(EXEEXT) - $(guestd_LINK) $(guestd_OBJECTS) $(guestd_LDADD) $(LIBS) +vmware-guestd$(EXEEXT): $(vmware_guestd_OBJECTS) $(vmware_guestd_DEPENDENCIES) + @rm -f vmware-guestd$(EXEEXT) + $(vmware_guestd_LINK) $(vmware_guestd_OBJECTS) $(vmware_guestd_LDADD) $(LIBS) +install-pamSCRIPTS: $(pam_SCRIPTS) + @$(NORMAL_INSTALL) + test -z "$(pamdir)" || $(MKDIR_P) "$(DESTDIR)$(pamdir)" + @list='$(pam_SCRIPTS)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + if test -f $$d$$p; then \ + f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ + echo " $(pamSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(pamdir)/$$f'"; \ + $(pamSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(pamdir)/$$f"; \ + else :; fi; \ + done + +uninstall-pamSCRIPTS: + @$(NORMAL_UNINSTALL) + @list='$(pam_SCRIPTS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ + echo " rm -f '$(DESTDIR)$(pamdir)/$$f'"; \ + rm -f "$(DESTDIR)$(pamdir)/$$f"; \ + done mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -341,7 +411,6 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/foreignVMToolsNetworking.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/foundryToolsDaemon.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stub.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/toolsDaemon.Po@am__quote@ .c.o: @@ -447,8 +516,11 @@ done check-am: all-am check: check-am -all-am: Makefile $(PROGRAMS) +all-am: Makefile $(PROGRAMS) $(SCRIPTS) installdirs: + for dir in "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(pamdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done install: install-am install-exec: install-exec-am install-data: install-data-am @@ -475,7 +547,7 @@ @echo "it deletes files that may require special tools to rebuild." clean: clean-am -clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ +clean-am: clean-generic clean-libtool clean-sbinPROGRAMS \ mostlyclean-am distclean: distclean-am @@ -494,11 +566,13 @@ info-am: -install-data-am: +install-data-am: install-pamSCRIPTS install-dvi: install-dvi-am -install-exec-am: +install-exec-am: install-sbinPROGRAMS + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-am @@ -530,23 +604,34 @@ ps-am: -uninstall-am: +uninstall-am: uninstall-pamSCRIPTS uninstall-sbinPROGRAMS + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) uninstall-hook -.MAKE: install-am install-strip +.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-noinstPROGRAMS ctags distclean \ + 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-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 + install-dvi-am install-exec install-exec-am install-exec-hook \ + install-html install-html-am install-info install-info-am \ + install-man install-pamSCRIPTS 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-pamSCRIPTS uninstall-sbinPROGRAMS + + +install-exec-hook: + $(INSTALL) -d $(DESTDIR)/etc/vmware-tools + echo 'disable-tools-version = "true"' > $(DESTDIR)/etc/vmware-tools/tools.conf +uninstall-hook: + $(RM) -rf $(DESTDIR)/etc/vmware-tools # 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: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/guestd/stub.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/guestd/stub.c --- open-vm-tools-2008.01.23-74039/guestd/stub.c 2008-01-28 08:02:53.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/guestd/stub.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,268 +0,0 @@ -/********************************************************* - * Copyright (C) 1998 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 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. - * - *********************************************************/ - -/* - * stub.c -- - * - * Stub for unuseful functions. Stolen from one of the other - * 13 stub.c files in bora. This is necessary because the - * toolbox uses FileIO_* API, which in turn uses these suckers - * below. - * --Ganesh. - * - */ - -#ifndef VMX86_DEVEL - -#endif - - -#include -#include -#include -#include -#include - -#ifdef _MSC_VER -# include -# include -#endif - - -#include "vm_version.h" -#include "vm_assert.h" -#include "vmware.h" -#include "str.h" -#include "debug.h" - -#ifdef _WIN32 -#include "poll.h" -#endif - -#if defined(N_PLAT_NLM) -char * -File_GetTmpDir(Bool useConf) -{ - return NULL; -} -#endif - - -/* - *---------------------------------------------------------------------- - * - * StubVprintf -- - * - * Output error text. - * - * Results: - * - * None. - * - * Side effects: - * - * None. - * - *---------------------------------------------------------------------- - */ - -void -StubVprintf(const char *prefix, - const char *fmt, - va_list args) -{ - char *str; - - /* Doesn't work yet. [greg] */ - - str = Str_Vasprintf(NULL, fmt, args); - -#if defined(_WIN32) - Debug("%s: %s", prefix, str); - printf("%s: %s", prefix, str); - // how do we print to stderr? fprintf(stderr,...) doesn't work -#else - fprintf(stderr, "%s: %s", prefix, str); - fflush(stderr); -#endif - - free(str); -} - -#ifdef N_PLAT_NLM -void -Panic(const char *fmt, ...) -{ - va_list args; - - va_start(args, fmt); - StubVprintf("PANIC", fmt, args); - va_end(args); - - exit(255); - NOT_REACHED(); -} -#endif - -void -Panic_PostPanicMsg(const char *format, - ...) -{} - -void -Log_DisableThrottling(void) -{} - -void -Log_SetAlwaysKeep(Bool unused) -{} - - -Bool -Config_GetBool(Bool defaultValue, - const char *fmt, - ...) -{ - return defaultValue; -} - - -int32 -Config_GetLong(int32 defaultValue, - const char *fmt, - ...) -{ - return defaultValue; -} - - -void -Log(const char *fmt, - ...) -{ - va_list args; - - va_start(args, fmt); - StubVprintf("Log", fmt, args); - va_end(args); -} - -void -Warning(const char *fmt, - ...) -{ - va_list args; - - va_start(args, fmt); - StubVprintf("Warning", fmt, args); - va_end(args); -} - - -void -Msg_Append(const char *idFmt, - ...) -{ - char *str; - - va_list args; - va_start(args, idFmt); - str = Str_Vasprintf(NULL, idFmt, args); - va_end(args); - - Warning("Msg_Append: %s\n", str); - free(str); -} - -unsigned int -Msg_Question(void *buttons, - int defaultAnswer, - char const *fmt, - ...) -{ - char *str; - - va_list args; - va_start(args, fmt); - str = Str_Vasprintf(NULL, fmt, args); - va_end(args); - - Warning("Msg_Question: %s\n", str); - free(str); - - return 0; -} - -typedef int MsgSeverity; - -void -Msg_Post(MsgSeverity severity, - const char *idFmt, - ...) -{ - char *str; - - va_list args; - va_start(args, idFmt); - str = Str_Vasprintf(NULL, idFmt, args); - va_end(args); - - Warning("Msg_Post: %s\n", str); - free(str); -} - - -#ifdef _WIN32 -Bool -Preference_GetBool(Bool defaultValue, - const char *name) -{ - return defaultValue; -} -#endif - -char * -Preference_GetString(char *defaultValue, - const char *name) -{ - return defaultValue; -} - -#ifdef _WIN32 -VMwareStatus -Poll_CB_RTime(PollerFunction f, // IN - void *clientData, // IN - int info, // IN - Bool periodic, // IN - struct DeviceLock *lock) // IN -{ - //NOT_IMPLEMENTED(); - return VMWARE_STATUS_SUCCESS; -} - - -Bool -Poll_CB_RTimeRemove(PollerFunction f, // IN - void *clientData, // IN - Bool periodic) // IN -{ - //NOT_IMPLEMENTED(); - return TRUE; -} -#endif - diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/guestd/toolsDaemon.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/guestd/toolsDaemon.c --- open-vm-tools-2008.01.23-74039/guestd/toolsDaemon.c 2008-01-28 08:02:53.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/guestd/toolsDaemon.c 2008-10-13 08:01:53.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -39,7 +39,9 @@ #ifdef _WIN32 # include -# include "win95.h" +# include "win32u.h" +# include "hgfsUsabilityLib.h" +# include "ServiceHelpers.h" #endif @@ -77,14 +79,24 @@ #include "deployPkg.h" #endif +#ifdef TOOLSDAEMON_HAS_RESOLUTION +# include "resolution.h" +#endif + /* in 1/100 of a second */ #define RPCIN_POLL_TIME 10 /* sync the time once a minute */ #define TIME_SYNC_TIME 6000 +/* only PERCENT_CORRECTION percent is corrected everytime */ +#define PERCENT_CORRECTION 50 /* * Table mapping state changes to their conf file names. */ +/* + * Bug 294328: Mac OS guests do not (yet) support the state change RPCs. + */ +#ifndef __APPLE__ static const char *stateChgConfNames[] = { NULL, /* NONE */ CONFNAME_POWEROFFSCRIPT, /* HALT */ @@ -93,6 +105,7 @@ CONFNAME_RESUMESCRIPT, /* RESUME */ CONFNAME_SUSPENDSCRIPT, /* SUSPEND */ }; +#endif DblLnkLst_Links *ToolsDaemonEventQueue = NULL; // main loop event queue static char *guestTempDirectory = NULL; @@ -119,10 +132,13 @@ */ Bool -ToolsDaemon_SyncTime(Bool syncBackward) +ToolsDaemon_SyncTime(Bool slewCorrection, // IN: Is clock slewing enabled? + Bool syncOnce, // IN: Is this function called in a loop? + void *toolsData) // IN: Opaque data { Backdoor_proto bp; int64 maxTimeLag; + int64 interruptLag; int64 guestSecs; int64 guestUsecs; int64 hostSecs; @@ -130,6 +146,8 @@ int64 diffSecs; int64 diffUsecs; int64 diff; + ToolsDaemon_Data *data = (ToolsDaemon_Data *) toolsData; + Bool timeLagCall = FALSE; #ifdef VMX86_DEBUG static int64 lastHostSecs = 0; int64 secs1, usecs1; @@ -141,26 +159,62 @@ Debug("Daemon: Synchronizing time\n"); /* - * Get the host OS time & the max lag limit. The GETTIME backdoor command - * suffers from a 136-year overflow problem that cannot be corrected - * without breaking backwards compatibility with older Tools. Instead, we - * introduced the newer BDOOR_CMD_GETTIMEFULL (which is overflow safe), and - * we'll try it before falling back on the unsafe BDOOR_CMD_GETTIME. + * We need 3 things from the host, and there exist 3 different versions of + * the calls (described further below): + * 1) host time + * 2) maximum time lag allowed (config option), which is a + * threshold that keeps the tools from being over eager about + * resetting the time when it is only a little bit off. + * 3) interrupt lag + * + * First 2 versions of the call add interrupt lag to the maximum allowed + * time lag, where as in the last call it is returned separately. + * + * Three versions of the call: + * + * - BDOOR_CMD_GETTIME: suffers from a 136-year overflow problem that + * cannot be corrected without breaking backwards compatibility with + * older Tools. So, we have the newer BDOOR_CMD_GETTIMEFULL, which is + * overflow safe. + * + * - BDOOR_CMD_GETTIMEFULL: overcomes the problem above. + * + * - BDOOR_CMD_GETTIMEFULL_WITH_LAG: Both BDOOR_CMD_GETTIMEFULL and + * BDOOR_CMD_GETTIME returns max lag limit as interrupt lag + the maximum + * allowed time lag. BDOOR_CMD_GETTIMEFULL_WITH_LAG separates these two + * values. This is helpful when synchronizing time backwards by slewing + * the clock. + * + * We use BDOOR_CMD_GETTIMEFULL_WITH_LAG first and fall back to + * BDOOR_CMD_GETTIMEFULL or BDOOR_CMD_GETTIME. * - * Note that BDOOR_CMD_GETTIMEFULL will not touch EAX when it succeeds. So - * we check for errors by comparing EAX to BDOOR_MAGIC, which was set by the - * call to Backdoor() prior to touching the backdoor port. + * Note that BDOOR_CMD_GETTIMEFULL and BDOOR_CMD_GETTIMEFULL_WITH_LAG will + * not touch EAX when it succeeds. So we check for errors by comparing EAX to + * BDOOR_MAGIC, which was set by the call to Backdoor() prior to touching the + * backdoor port. */ - bp.in.cx.halfs.low = BDOOR_CMD_GETTIMEFULL; + bp.in.cx.halfs.low = BDOOR_CMD_GETTIMEFULL_WITH_LAG; Backdoor(&bp); if (bp.out.ax.word == BDOOR_MAGIC) { hostSecs = ((uint64)bp.out.si.word << 32) | bp.out.dx.word; + interruptLag = bp.out.di.word; + timeLagCall = TRUE; + Debug("Using BDOOR_CMD_GETTIMEFULL_WITH_LAG\n"); } else { - Debug("New get time command not supported by current host, attempting " - "older command.\n"); - bp.in.cx.halfs.low = BDOOR_CMD_GETTIME; + Debug("BDOOR_CMD_GETTIMEFULL_WITH_LAG not supported by current host, attempting " + "BDOOR_CMD_GETTIMEFULL\n"); + interruptLag = 0; + bp.in.cx.halfs.low = BDOOR_CMD_GETTIMEFULL; Backdoor(&bp); - hostSecs = bp.out.ax.word; + if (bp.out.ax.word == BDOOR_MAGIC) { + hostSecs = ((uint64)bp.out.si.word << 32) | bp.out.dx.word; + } else { + Debug("BDOOR_CMD_GETTIMEFULL not supported by current host, attempting " + "BDOOR_CMD_GETTIME\n"); + bp.in.cx.halfs.low = BDOOR_CMD_GETTIME; + Backdoor(&bp); + hostSecs = bp.out.ax.word; + } } hostUsecs = bp.out.bx.word; maxTimeLag = bp.out.cx.word; @@ -174,9 +228,7 @@ /* Get the guest OS time */ if (!System_GetCurrentTime(&guestSecs, &guestUsecs)) { - Warning("Unable to retrieve the guest OS time: %s.\n\n", - Msg_ErrString()); - + Warning("Unable to retrieve the guest OS time: %s.\n\n", Msg_ErrString()); return FALSE; } @@ -184,7 +236,7 @@ diffUsecs = hostUsecs - guestUsecs; if (diffUsecs < 0) { diffSecs -= 1; - diffUsecs += 1000000L; + diffUsecs += 1000000U; } diff = diffSecs * 1000000L + diffUsecs; @@ -192,20 +244,64 @@ Debug("Daemon: Guest clock lost %.6f secs; limit=%.2f; " "%"FMT64"d secs since last update\n", diff / 1000000.0, maxTimeLag / 1000000.0, hostSecs - lastHostSecs); + Debug("Daemon: %d, %d, %"FMT64"d, %"FMT64"d, %"FMT64"d.\n", + syncOnce, slewCorrection, diff, maxTimeLag, interruptLag); lastHostSecs = hostSecs; #endif - /* - * Adjust the guest OS time to equal the host OS time if the - * difference is significant - */ - if (diff > maxTimeLag || (diff < -maxTimeLag && syncBackward)) { - if (!System_AddToCurrentTime(diffSecs, diffUsecs)) { - Warning("Unable to set the guest OS time: %s.\n\n", - Msg_ErrString()); + if (syncOnce) { + /* + * Non-loop behavior: + * + * Perform a step correction if: + * 1) The guest OS is behind the host OS by more than maxTimeLag + interruptLag. + * 2) The guest OS is ahead of the host OS. + */ + if (diff > maxTimeLag + interruptLag) { + System_DisableTimeSlew(); + if (!System_AddToCurrentTime(diffSecs, diffUsecs)) { + Warning("Unable to set the guest OS time: %s.\n\n", Msg_ErrString()); + return FALSE; + } + } + } else { + + /* + * Loop behavior: + * + * If guest is behind host by more than maxTimeLag + interruptLag + * perform a step correction to the guest clock and ask the monitor + * to drop its accumulated catchup (interruptLag). + * + * Otherwise, perform a slew correction. Adjust the guest's clock + * rate to be either faster or slower than nominal real time, such + * that we expect to correct correctionPercent percent of the error + * during this synchronization cycle. + */ + + if (diff > maxTimeLag + interruptLag) { + System_DisableTimeSlew(); + if (!System_AddToCurrentTime(diffSecs, diffUsecs)) { + Warning("Unable to set the guest OS time: %s.\n\n", Msg_ErrString()); + return FALSE; + } + } else if (slewCorrection && timeLagCall) { + int64 slewDiff; + + /* Don't consider interruptLag during clock slewing. */ + slewDiff = diff - interruptLag; + + /* Correct only data->slewPercentCorrection percent error. */ + slewDiff = (data->slewPercentCorrection * slewDiff) / 100; - return FALSE; + if (!System_EnableTimeSlew(slewDiff, data->timeSyncPeriod)) { + Warning("Unable to slew the guest OS time: %s.\n\n", Msg_ErrString()); + return FALSE; + } + } else { + System_DisableTimeSlew(); } + } #ifdef VMX86_DEBUG System_GetCurrentTime(&secs2, &usecs2); @@ -214,11 +310,11 @@ secs1, usecs1, secs2, usecs2); #endif - /* - * We have just synchronized the guest time to the host time. Ask - * VMware to reset to normal the rate of timer interrupts it forwards - * from the host to the guest. - */ + /* + * If we have stepped the time, ask TimeTracker to reset to normal the rate + * of timer interrupts it forwards from the host to the guest. + */ + if (!System_IsTimeSlewEnabled()) { bp.in.cx.halfs.low = BDOOR_CMD_STOPCATCHUP; Backdoor(&bp); } @@ -251,7 +347,6 @@ ASSERT(pConfDict); - /* * With the addition of the Sync Driver we can get into a state * where the system drive is frozen, preventing the completion of @@ -270,6 +365,7 @@ if (Conf_ReloadFile(pConfDict)) { GuestInfoServer_DisableDiskInfoQuery( GuestApp_GetDictEntryBool(*pConfDict, CONFNAME_DISABLEQUERYDISKINFO)); + Debug_Set(GuestApp_GetDictEntryBool(*pConfDict, CONFNAME_LOG), DEBUG_PREFIX); Debug_EnableToFile(GuestApp_GetDictEntry(*pConfDict, CONFNAME_LOGFILE), @@ -312,21 +408,21 @@ ToolsDaemonTimeSyncLoop(void *clientData) // IN { ToolsDaemon_Data *data = (ToolsDaemon_Data *)clientData; - uint32 period = 0; ASSERT(data); /* The event has fired: it is no longer valid */ data->timeSyncEvent = NULL; - if (!ToolsDaemon_SyncTime(FALSE)) { + if (!data->timeSyncPeriod) { + data->timeSyncPeriod = TIME_SYNC_TIME; + } + if (!ToolsDaemon_SyncTime(data->slewCorrection, FALSE, clientData)) { Warning("Unable to synchronize time.\n\n"); - return FALSE; } - period = data->timeSyncPeriod ? data->timeSyncPeriod * 100 : TIME_SYNC_TIME; - data->timeSyncEvent = EventManager_Add(ToolsDaemonEventQueue, period, + data->timeSyncEvent = EventManager_Add(ToolsDaemonEventQueue, data->timeSyncPeriod, ToolsDaemonTimeSyncLoop, data); if (data->timeSyncEvent == NULL) { Warning("Unable to run the \"time synchronization\" loop.\n\n"); @@ -355,7 +451,7 @@ *----------------------------------------------------------------------------- */ -#if defined(_WIN32) && !defined(SERVICE9X) +#if defined(_WIN32) static Bool ToolsDaemonDisableWinTimeDaemon(void) { @@ -363,37 +459,15 @@ DWORD timeIncrement; DWORD error; BOOL timeAdjustmentDisabled; - Bool success = FALSE; - /* Below needed for privilege junk. */ - TOKEN_PRIVILEGES tp; - LUID luid; - HANDLE token = INVALID_HANDLE_VALUE; + BOOL success = FALSE; /* * We need the SE_SYSTEMTIME_NAME privilege to make the change; get - * the privilege now (or bail it if we can't). + * the privilege now (or bail if we can't). */ - if (!OpenProcessToken(GetCurrentProcess(), - TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, - &token)) { - error = GetLastError(); - Debug("OpenProcessToken failed: %d", error); - goto exit; - } - if (!LookupPrivilegeValue(NULL, SE_SYSTEMTIME_NAME, &luid)) { - error = GetLastError(); - Debug("LookupPrivilegeValue(SE_SYSTEMTIME_NAME) failed: %d", error); - goto exit; - } - - memset(&tp, 0, sizeof tp); - tp.PrivilegeCount = 1; - tp.Privileges[0].Luid = luid; - tp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED; - if (!AdjustTokenPrivileges(token, FALSE, &tp, sizeof tp, NULL, NULL)) { - error = GetLastError(); - Debug("AdjustTokenPrivileges failed: %d", error); - goto exit; + success = System_SetProcessPrivilege(SE_SYSTEMTIME_NAME, TRUE); + if (!success) { + return FALSE; } /* Actually try to stop the time daemon. */ @@ -436,10 +510,8 @@ success = TRUE; exit: - if (token != INVALID_HANDLE_VALUE) { - CloseHandle(token); - } Debug("Stopping time daemon %s.\n", success ? "succeeded" : "failed"); + System_SetProcessPrivilege(SE_SYSTEMTIME_NAME, FALSE); return success; } #endif @@ -477,7 +549,7 @@ return FALSE; } -#if defined(_WIN32) && !defined(SERVICE9X) +#if defined(_WIN32) Debug("Daemon: Attempting to disable Windows Time daemon\n"); if (!ToolsDaemonDisableWinTimeDaemon()) { Debug("Daemon: Failed to disable Windows Time daemon\n"); @@ -487,6 +559,7 @@ return TRUE; } else if (!start && data->timeSyncEvent != NULL) { Debug("Daemon: Stopping time sync loop\n"); + System_DisableTimeSlew(); EventManager_Remove(data->timeSyncEvent); data->timeSyncEvent = NULL; @@ -707,12 +780,7 @@ */ static Bool -ToolsDaemonTcloReset(char const **result, // OUT - size_t *resultLen, // OUT - const char *name, // IN - const char *args, // IN - size_t argsSize, // Ignored - void *clientData) // Ignored +ToolsDaemonTcloReset(RpcInData *data) // IN/OUT { /* * Mandatory reset RPC @@ -726,10 +794,9 @@ * reinitialize the channel if appropriate. [greg] */ EventManager_Add(ToolsDaemonEventQueue, (int) (RPCIN_POLL_TIME * 1.5), - ToolsDaemonResetSent, clientData); + ToolsDaemonResetSent, data->clientData); - return RpcIn_SetRetVals(result, resultLen, "ATR " TOOLS_DAEMON_NAME, - TRUE); + return RPCIN_SETRETVALS(data, "ATR " TOOLS_DAEMON_NAME, TRUE); } @@ -799,6 +866,10 @@ /* + * Bug 294328: Mac OS guests do not (yet) support the state change RPCs. + */ +#ifndef __APPLE__ +/* *----------------------------------------------------------------------------- * * ToolsDaemonTcloStateChange -- @@ -824,6 +895,7 @@ void *clientData) // IN { int i; + ProcMgr_ProcArgs procArgs; ToolsDaemon_Data *data = (ToolsDaemon_Data *)clientData; ASSERT(data); @@ -842,23 +914,20 @@ if (strcmp(name, stateChangeCmdTable[i].tcloCmd) == 0) { const char *script; char *scriptCmd; + unsigned int stateId; - data->stateChgInProgress = (GuestOsState) stateChangeCmdTable[i].id; + stateId = stateChangeCmdTable[i].id; + data->stateChgInProgress = (GuestOsState)stateId; -#ifdef _WIN32 - /* - * Skip scripts on win95 altogether b/c they don't exit properly - * on some distributions of it (command window stays open) - */ - if (isWin95()) { - Debug("Skipping state change script on win 95\n"); + /* Check for the toolScripts option. */ + if (!data->toolScriptOption[stateId]) { ToolsDaemonStateChangeDone(TRUE, data); + Debug("Script for %s not configured to run\n", stateChangeCmdTable[i].tcloCmd); return RpcIn_SetRetVals(result, resultLen, "", TRUE); } -#endif script = GuestApp_GetDictEntry(*data->pConfDict, - stateChgConfNames[stateChangeCmdTable[i].id]); + stateChgConfNames[stateId]); ASSERT(script); if (strlen(script) == 0) { ToolsDaemonStateChangeDone(TRUE, data); @@ -866,28 +935,36 @@ return RpcIn_SetRetVals(result, resultLen, "", TRUE); } #ifdef N_PLAT_NLM + procArgs = NULL; scriptCmd = Str_Asprintf(NULL, "%s", script); #elif !defined(_WIN32) + procArgs = NULL; ASSERT(data->execLogPath); scriptCmd = Str_Asprintf(NULL, "(%s) 2>&1 >> %s", script, data->execLogPath); #else - /* Use different command shells on NT/9x. */ - if (isWinNTFamily()) { - char systemDir[1024]; - - GetSystemDirectory(systemDir, sizeof(systemDir)); + /* + * Pass the CREATE_NO_WINDOW flag to CreateProcess so that the + * cmd.exe window will not be visible to the user in the guest. + */ + memset(&procArgs, 0, sizeof procArgs); + procArgs.bInheritHandles = TRUE; + procArgs.dwCreationFlags = CREATE_NO_WINDOW; + + { + char systemDir[1024 * 3]; + Win32U_GetSystemDirectory(systemDir, sizeof systemDir); scriptCmd = Str_Asprintf(NULL, "%s\\cmd.exe /c \"%s\"", systemDir, script); - } else { - char windowsDir[1024]; - - GetWindowsDirectory(windowsDir, sizeof(windowsDir)); - scriptCmd = Str_Asprintf(NULL, "%s\\command.com /c \"%s\"", - windowsDir, script); } #endif - data->asyncProc = ProcMgr_ExecAsync(scriptCmd, NULL); + if (scriptCmd == NULL) { + Debug("Could not format the cmd to run scripts\n"); + return RpcIn_SetRetVals(result, resultLen, + "Could not format cmd to run scritps", + FALSE); + } + data->asyncProc = ProcMgr_ExecAsync(scriptCmd, &procArgs); if (data->asyncProc) { data->asyncProcCb = ToolsDaemonStateChangeDone; @@ -912,6 +989,7 @@ return RpcIn_SetRetVals(result, resultLen, "Invalid state change command", FALSE); } +#endif // ifndef __APPLE__ /* @@ -942,11 +1020,13 @@ #ifdef _WIN32 unsigned int minResolutionWidth; unsigned int minResolutionHeight; +#endif ToolsDaemon_Data *data; data = (ToolsDaemon_Data *)clientData; ASSERT(data); +#ifdef _WIN32 /* * Inform the VMX that we support setting the guest * resolution and display topology. Currently, this only @@ -960,10 +1040,22 @@ TOOLS_DAEMON_NAME)) { Debug("ToolsDaemonTcloCapReg: Unable to register resolution server capability\n"); } - if (!RpcOut_sendOne(NULL, NULL, "tools.capability.display_topology_set 1")) { + /* + * Bug 149541: Windows 2000 does not currently support multimon. + * + * In addition, NT will never support multimon. 9x guests have + * frozen tools, and will report this capability set to 1, which + * current UIs will treat as unsupported. + */ + if (!RpcOut_sendOne(NULL, NULL, "tools.capability.display_topology_set %s", + System_GetOSType() >= OS_WINXP ? "2" : "0")) { Debug("ToolsDaemonTcloCapReg: Unable to register display topology set " "capability\n"); } + if (!RpcOut_sendOne(NULL, NULL, "tools.capability.display_global_offset 1")) { + Debug("ToolsDaemonTcloCapReg: Unable to register display global offset " + "capability\n"); + } if (!RpcOut_sendOne(NULL, NULL, "tools.capability.color_depth_set 1")) { Debug("ToolsDaemonTcloCapReg: Unable to register color depth set " "capability\n"); @@ -983,6 +1075,14 @@ } #endif +#ifdef TOOLSDAEMON_HAS_RESOLUTION + Resolution_RegisterCaps(); +#endif + + /* + * Bug 294328: Mac OS guests do not (yet) support the state change RPCs. + */ +#ifndef __APPLE__ if (!RpcOut_sendOne(NULL, NULL, "tools.capability.statechange")) { Debug("ToolsDaemonTcloCapReg: VMware doesn't support tools.capability.statechange. " "Trying .haltreboot\n"); @@ -996,31 +1096,46 @@ Debug("ToolsDaemonTcloCapReg: VMX doesn't support " "tools.capability.softpowerop_retry."); } +#endif // ifndef __APPLE__ /* * This is a _WIN32 || linux check, with the additional check since linux is * defined when you build the NetWare Tools. */ #if (defined(_WIN32) || defined(linux)) && !defined(N_PLAT_NLM) - if (!RpcOut_sendOne(NULL, NULL, "tools.capability.auto_upgrade 2")) { - Debug("ToolsDaemonTcloCapReg: Unable to register auto-upgrading capability.\n"); - } + { + if (!RpcOut_sendOne(NULL, NULL, "tools.capability.auto_upgrade 2")) { + Debug("ToolsDaemonTcloCapReg: Unable to register " + "auto-upgrading capability.\n"); + } - if (guestTempDirectory == NULL) { + if (guestTempDirectory == NULL) { #ifdef _WIN32 - guestTempDirectory = File_GetTmpDir(FALSE); + guestTempDirectory = File_GetTmpDir(FALSE); #else - guestTempDirectory = Util_GetSafeTmpDir(FALSE); + guestTempDirectory = Util_GetSafeTmpDir(FALSE); #endif - } + } - if (!RpcOut_sendOne(NULL, NULL, "tools.capability.guest_temp_directory 1 %s", - guestTempDirectory)) { - Debug("ToolsDaemonTcloCapReg: Unable to register guest temp directory capability.\n"); + if (!RpcOut_sendOne(NULL, NULL, "tools.capability.guest_temp_directory 1 %s", + guestTempDirectory)) { + Debug("ToolsDaemonTcloCapReg: Unable to register guest temp " + "directory capability.\n"); + } } #endif #if !defined(N_PLAT_NLM) + { + char *confPath = GuestApp_GetConfPath(); + if (!RpcOut_sendOne(NULL, NULL, "tools.capability.guest_conf_directory %s", + confPath ? confPath : "")) { + Debug("ToolsDaemonTcloCapReg: Unable to register guest conf " + "directory capability.\n"); + } + free(confPath); + } + /* * Send the uptime here so that the VMX can detect soft resets. This must be * sent before the Tools version RPC since the version RPC handler uses the @@ -1031,7 +1146,15 @@ } #endif - if (!GuestApp_SetVersion()) { + /* + * Send the monolithic Tools version. Using a configuration option, users + * can override the Tools version such that the VMX treats the Tools as not + * to be managed by the VMware platform. + */ + if (!RpcOut_sendOne(NULL, NULL, "tools.set.version %u", + GuestApp_GetDictEntryBool(*data->pConfDict, + CONFNAME_DISABLETOOLSVERSION) ? + TOOLS_VERSION_UNMANAGED : TOOLS_VERSION_CURRENT)) { Debug("Daemon: Error setting tools version during 'Capabilities_Register'" "request.\n"); } @@ -1042,6 +1165,13 @@ } #endif +#if defined(WIN32) + HgfsUsability_RegisterServiceCaps(); + if (System_GetOSType() >= OS_VISTA) { + ServiceHelpers_SendResolutionCaps(); + } +#endif + return RpcIn_SetRetVals(result, resultLen, "", TRUE); } @@ -1071,9 +1201,9 @@ size_t argsSize, // Ignored void *clientData) // Ignored { - Bool syncBackward = strcmp(args, "1")==0; + Bool slewCorrection = !strcmp(args, "1"); - if (!ToolsDaemon_SyncTime(syncBackward)) { + if (!ToolsDaemon_SyncTime(slewCorrection, TRUE, clientData)) { return RpcIn_SetRetVals(result, resultLen, "Unable to sync time", FALSE); } else { @@ -1109,7 +1239,7 @@ size_t argsSize, // Ignored void *clientData) // IN { - Bool retVal; + Bool retVal = FALSE; char *option; char *value; unsigned int index = 0; @@ -1133,6 +1263,16 @@ if (strcmp(value, "1") != 0 && strcmp(value, "0") != 0) { goto invalid_value; } + } else if (strcmp(option, TOOLSOPTION_SYNCTIME_SLEWCORRECTION) == 0) { + if (strcmp(value, "1") != 0 && strcmp(value, "0") != 0) { + goto invalid_value; + } + } else if (strcmp(option, TOOLSOPTION_SYNCTIME_PERCENTCORRECTION) == 0) { + int32 percent; + if (!StrUtil_StrToInt(&percent, value) || percent == 0 || percent > 100) { + goto invalid_value; + } + Debug("Daemon: update the slew correction percent.\n"); } else if (strcmp(option, TOOLSOPTION_COPYPASTE) == 0) { if (strcmp(value, "1") != 0 && strcmp(value, "0") != 0) { goto invalid_value; @@ -1155,6 +1295,38 @@ if (strcmp(value, "1") != 0 && strcmp(value, "0") != 0) { goto invalid_value; } + } else if (strcmp(option, TOOLSOPTION_LINK_ROOT_HGFS_SHARE) == 0) { + /* + * Check to make sure that we actually support creating the link + * on this platform. + */ + if (!data->linkHgfsCB || !data->unlinkHgfsCB) { + goto invalid_option; + } + + if (strcmp(value, "1") != 0 && strcmp(value, "0") != 0) { + goto invalid_value; + } + } else if (strcmp(option, TOOLSOPTION_SCRIPTS_POWERON) == 0) { + if (strcmp(value, "1") != 0 && strcmp(value, "0") != 0) { + goto invalid_value; + } + } else if (strcmp(option, TOOLSOPTION_SCRIPTS_POWEROFF) == 0) { + if (strcmp(value, "1") != 0 && strcmp(value, "0") != 0) { + goto invalid_value; + } + } else if (strcmp(option, TOOLSOPTION_SCRIPTS_SUSPEND) == 0) { + if (strcmp(value, "1") != 0 && strcmp(value, "0") != 0) { + goto invalid_value; + } + } else if (strcmp(option, TOOLSOPTION_SCRIPTS_RESUME) == 0) { + if (strcmp(value, "1") != 0 && strcmp(value, "0") != 0) { + goto invalid_value; + } + } else if (strcmp(option, TOOLSOPTION_SCRIPTS_REBOOT) == 0) { + if (strcmp(value, "1") != 0 && strcmp(value, "0") != 0) { + goto invalid_value; + } } else { goto invalid_option; } @@ -1170,17 +1342,9 @@ * Try the one-shot time sync if time sync transitions from * 'off' to 'on'. */ - if (oldTimeSyncValue == 0 && start) { - const char *backwardsAllowed; - - backwardsAllowed = GuestApp_GetDictEntry(data->optionsDict, - TOOLSOPTION_SYNCTIME_ENABLE); - /* - * Preserve backwards compatibility: VMX may not ever send us this - * option, so value may be NULL. - */ - ToolsDaemon_SyncTime(backwardsAllowed && - strcmp(backwardsAllowed, "1") == 0); + if (oldTimeSyncValue == 0 && start && + GuestApp_GetDictEntry(data->optionsDict, TOOLSOPTION_SYNCTIME_ENABLE)) { + ToolsDaemon_SyncTime(data->slewCorrection, TRUE, clientData); } oldTimeSyncValue = start; @@ -1191,6 +1355,14 @@ retVal = FALSE); goto exit; } + } else if (strcmp(option, TOOLSOPTION_SYNCTIME_SLEWCORRECTION) == 0) { + data->slewCorrection = strcmp(value, "0"); + Debug("Daemon: Setting slewCorrection, %d.\n", data->slewCorrection); + } else if (strcmp(option, TOOLSOPTION_SYNCTIME_PERCENTCORRECTION) == 0) { + int32 percent; + if (StrUtil_StrToInt(&percent, value)) { + data->slewPercentCorrection = percent; + } } else if (strcmp(option, TOOLSOPTION_BROADCASTIP) == 0 && strcmp(value, "1") == 0) { char *ip; @@ -1216,7 +1388,7 @@ * just remember the new sync period value. */ if (period != data->timeSyncPeriod) { - data->timeSyncPeriod = period; + data->timeSyncPeriod = period * 100; if (data->timeSyncEvent != NULL) { Bool status; @@ -1242,7 +1414,7 @@ timeSyncStartup = FALSE; if (syncStartupOk) { - if (!ToolsDaemon_SyncTime(TRUE)) { + if (!ToolsDaemon_SyncTime(TRUE, TRUE, clientData)) { RpcIn_SetRetVals(result, resultLen, "Unable to sync time during startup", retVal = FALSE); @@ -1250,6 +1422,36 @@ } } } + } else if (strcmp(option, TOOLSOPTION_LINK_ROOT_HGFS_SHARE) == 0) { + if (strcmp(value, "1") == 0) { + /* Validated that data->linkHgfsCB existed above. */ + retVal = data->linkHgfsCB(data->linkHgfsCBData); + } else if (strcmp(value, "0") == 0) { + /* Validated that data->unlinkHgfsCB existed above. */ + retVal = data->unlinkHgfsCB(data->unlinkHgfsCBData); + } + + if (!retVal) { + RpcIn_SetRetVals(result, resultLen, + "Could not link/unlink root share.", + retVal = FALSE); + goto exit; + } + } else if (strcmp(option, TOOLSOPTION_SCRIPTS_POWERON) == 0) { + data->toolScriptOption[GUESTOS_STATECHANGE_POWERON] = + strcmp(value, "0") ? TRUE : FALSE; + } else if (strcmp(option, TOOLSOPTION_SCRIPTS_POWEROFF) == 0) { + data->toolScriptOption[GUESTOS_STATECHANGE_HALT] = + strcmp(value, "0") ? TRUE : FALSE; + } else if (strcmp(option, TOOLSOPTION_SCRIPTS_SUSPEND) == 0) { + data->toolScriptOption[GUESTOS_STATECHANGE_SUSPEND] = + strcmp(value, "0") ? TRUE : FALSE; + } else if (strcmp(option, TOOLSOPTION_SCRIPTS_RESUME) == 0) { + data->toolScriptOption[GUESTOS_STATECHANGE_RESUME] = + strcmp(value, "0") ? TRUE : FALSE; + } else if (strcmp(option, TOOLSOPTION_SCRIPTS_REBOOT) == 0) { + data->toolScriptOption[GUESTOS_STATECHANGE_REBOOT] = + strcmp(value, "0") ? TRUE : FALSE; } /* success! */ @@ -1321,8 +1523,6 @@ Bool ToolsDaemon_Init_Backdoor(ToolsDaemon_Data * data) // IN/OUT { - int i; - data->in = RpcIn_Construct(ToolsDaemonEventQueue); if (data->in == NULL) { Warning("Unable to create the RpcIn object.\n\n"); @@ -1353,10 +1553,18 @@ RpcIn_RegisterCallback(data->in, "Set_Option", ToolsDaemonTcloSetOption, data); - for (i = 0; i < ARRAYSIZE(stateChangeCmdTable); i++) { - RpcIn_RegisterCallback(data->in, stateChangeCmdTable[i].tcloCmd, - ToolsDaemonTcloStateChange, data); + /* + * Bug 294328: Mac OS guests do not (yet) support the state change RPCs. + */ +#ifndef __APPLE__ + { + int i; + for (i = 0; i < ARRAYSIZE(stateChangeCmdTable); i++) { + RpcIn_RegisterCallback(data->in, stateChangeCmdTable[i].tcloCmd, + ToolsDaemonTcloStateChange, data); + } } +#endif // ifndef __APPLE__ #if !defined(N_PLAT_NLM) FoundryToolsDaemon_RegisterRoutines(data->in, @@ -1372,6 +1580,10 @@ } #endif +#ifdef TOOLSDAEMON_HAS_RESOLUTION + Resolution_InitBackdoor(data->in); +#endif + #if !defined(__FreeBSD__) && !defined(sun) && !defined(N_PLAT_NLM) DeployPkg_Register(data->in); #endif @@ -1398,16 +1610,21 @@ */ ToolsDaemon_Data * -ToolsDaemon_Init(GuestApp_Dict **pConfDict, // IN - const char *execLogPath, // IN - ToolsDaemon_Callback haltCB, // IN - void *haltCBData, // IN - ToolsDaemon_Callback rebootCB, // IN - void *rebootCBData, // IN - ToolsDaemon_Callback resetCB, // IN - void *resetCBData) // IN +ToolsDaemon_Init(GuestApp_Dict **pConfDict, // IN + const char *execLogPath, // IN + ToolsDaemon_Callback haltCB, // IN + void *haltCBData, // IN + ToolsDaemon_Callback rebootCB, // IN + void *rebootCBData, // IN + ToolsDaemon_Callback resetCB, // IN + void *resetCBData, // IN + ToolsDaemon_Callback linkHgfsCB, // IN + void *linkHgfsCBData, // IN + ToolsDaemon_Callback unlinkHgfsCB, // IN + void *unlinkHgfsCBData) // IN { ToolsDaemon_Data *data; + int i; #ifndef N_PLAT_NLM Atomic_Init(); @@ -1415,8 +1632,8 @@ ASSERT(pConfDict); ASSERT(*pConfDict); - ASSERT(haltCB); - ASSERT(rebootCB); + ASSERT(haltCB != NULL); + ASSERT(rebootCB != NULL); data = (ToolsDaemon_Data *) calloc(1, sizeof(ToolsDaemon_Data)); ASSERT_MEM_ALLOC(data); @@ -1432,20 +1649,26 @@ data->lastFailedStateChg = GUESTOS_STATECHANGE_NONE; data->resetCB = resetCB; data->resetCBData = resetCBData; + data->linkHgfsCB = linkHgfsCB; + data->linkHgfsCBData = linkHgfsCBData; + data->unlinkHgfsCB = unlinkHgfsCB; + data->unlinkHgfsCBData = unlinkHgfsCBData; data->timeSyncPeriod = 0; + data->slewPercentCorrection = PERCENT_CORRECTION; + data->slewCorrection = TRUE; + + for (i = 0; i < GUESTOS_STATECHANGE_LAST; i++) { + data->toolScriptOption[i] = TRUE; + } - if (!VmCheck_IsVirtualWorld()) { #if ALLOW_TOOLS_IN_FOREIGN_VM + if (!VmCheck_IsVirtualWorld()) { ToolsDaemon_InitializeForeignVM(data); -#else - Panic("The VMware service must be run from within a virtual machine.\n"); -#endif } +#endif -#ifdef VMX86_DEBUG +#if defined(VMX86_DEBUG) && !defined(__APPLE__) { - int i; - /* Make sure the confDict has all the confs we need */ for (i = 0; i < ARRAYSIZE(stateChangeCmdTable); i++) { const char *confName; @@ -1462,6 +1685,12 @@ goto error; } +#ifdef TOOLSDAEMON_HAS_RESOLUTION + if (!Resolution_Init(TOOLS_DAEMON_NAME, NULL)) { + Debug("%s: Unable to initialize Guest Fit feature\n", __func__); + } +#endif + /* * Load the conf file, then setup a periodic check and reload. */ @@ -1561,6 +1790,10 @@ Debug("%s: Unable to unregister display topology set capability\n", __FUNCTION__); } + if (!RpcOut_sendOne(NULL, NULL, "tools.capability.display_global_offset 0")) { + Debug("%s: Unable to unregister display global offset capability\n", + __FUNCTION__); + } if (!RpcOut_sendOne(NULL, NULL, "tools.capability.color_depth_set 0")) { Debug("%s: Unable to unregister color depth set capability\n", __FUNCTION__); @@ -1572,6 +1805,12 @@ if (!RpcOut_sendOne(NULL, NULL, "tools.capability.resolution_min 0 0")) { Debug("%s: Unable to clear minimum resolution\n", __FUNCTION__); } + + HgfsUsability_UnregisterServiceCaps(); +#endif + +#ifdef TOOLSDAEMON_HAS_RESOLUTION + Resolution_Cleanup(); #endif #if defined(_WIN32) || defined(linux) @@ -1584,6 +1823,13 @@ } #endif +#if !defined(N_PLAT_NLM) + if (!RpcOut_sendOne(NULL, NULL, "tools.capability.guest_conf_directory 0")) { + Debug("%s: Unable to clear guest conf directory capability.\n", + __FUNCTION__); + } +#endif + #if ALLOW_TOOLS_IN_FOREIGN_VM if (runningInForeignVM) { ToolsDaemon_ShutdownForeignVM(); @@ -1746,47 +1992,15 @@ unsigned int *width, // OUT unsigned int *height) // OUT { -#ifdef SERVICE9X - int minResolutionWidth; - int minResolutionHeight; - Bool success; - - ASSERT(dict); - ASSERT(width); - ASSERT(height); - - /* - * Win9x sometimes freaks out with resolutions under 640x480. See - * bug 58681. - */ - success = GuestApp_GetDictEntryInt(dict, - CONFNAME_RESOLUTION_MIN_WIDTH, - &minResolutionWidth); - if (!success) { - Debug("ToolsDaemon_GetMinResolution: Failed to get width\n"); - minResolutionWidth = 640; - } - - success = GuestApp_GetDictEntryInt(dict, - CONFNAME_RESOLUTION_MIN_HEIGHT, - &minResolutionHeight); - if (!success) { - Debug("ToolsDaemon_GetMinResolution: Failed to get height\n"); - minResolutionHeight = 480; - } - - *width = (unsigned int)minResolutionWidth; - *height = (unsigned int)minResolutionHeight; -#else ASSERT(width); ASSERT(height); /* - * It's assumed that other platforms don't have a minimum. + * This code is no longer used for Win9x platforms, and it's assumed that + * all other platforms don't have a minimum. */ *width = 0; *height = 0; -#endif } diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/guestd/toolsDaemon.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/guestd/toolsDaemon.h --- open-vm-tools-2008.01.23-74039/guestd/toolsDaemon.h 2008-01-28 08:02:53.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/guestd/toolsDaemon.h 2008-10-13 08:01:53.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -53,34 +53,45 @@ const char *execLogPath; Bool inError; int errorCount; - GuestApp_Dict *optionsDict; // the options we get from VMware - GuestApp_Dict **pConfDict; // the name/value pairs from the conf file + GuestApp_Dict *optionsDict; // the options we get from VMware + GuestApp_Dict **pConfDict; // the name/value pairs from the conf file struct Event *timeSyncEvent; uint32 timeSyncPeriod; + uint32 slewPercentCorrection; + Bool slewCorrection; struct Event *oldOptionsLoop; - ToolsDaemon_Callback *haltCB; // callback when we do a soft halt - void *haltCBData; // its data - ToolsDaemon_Callback *rebootCB; // callback when we do a soft reboot - void *rebootCBData; // its data - ToolsDaemon_Callback *resetCB; // callback when we receive a reset - void *resetCBData; // its data + ToolsDaemon_Callback *haltCB; // callback when we do a soft halt + void *haltCBData; // its data + ToolsDaemon_Callback *rebootCB; // callback when we do a soft reboot + void *rebootCBData; // its data + ToolsDaemon_Callback *resetCB; // callback when we receive a reset + void *resetCBData; // its data + ToolsDaemon_Callback *linkHgfsCB; // callback to create hgfs link on desktop + void *linkHgfsCBData; // its data + ToolsDaemon_Callback *unlinkHgfsCB; // callback to remove hgfs link on desktop + void *unlinkHgfsCBData; // its data GuestOsState stateChgInProgress; GuestOsState lastFailedStateChg; ProcMgr_AsyncProc *asyncProc; ProcMgr_Callback *asyncProcCb; void *asyncProcCbData; + Bool toolScriptOption[GUESTOS_STATECHANGE_LAST]; // toolsScript option from vmx } ToolsDaemon_Data; ToolsDaemon_Data * -ToolsDaemon_Init(GuestApp_Dict **pConfDict, // IN - const char *execLogPath, // IN - ToolsDaemon_Callback haltCB, // IN - void *haltCBData, // IN - ToolsDaemon_Callback rebootCB, // IN - void *rebootCBData, // IN - ToolsDaemon_Callback resetCB, // IN - void *resetCBData); // IN +ToolsDaemon_Init(GuestApp_Dict **pConfDict, // IN + const char *execLogPath, // IN + ToolsDaemon_Callback haltCB, // IN + void *haltCBData, // IN + ToolsDaemon_Callback rebootCB, // IN + void *rebootCBData, // IN + ToolsDaemon_Callback resetCB, // IN + void *resetCBData, // IN + ToolsDaemon_Callback linkHgfsCB, // IN + void *linkHgfsCBData, // IN + ToolsDaemon_Callback unlinkHgfsCB, // IN + void *unlinkHgfsCBData); // IN Bool ToolsDaemon_Init_Backdoor(ToolsDaemon_Data *data); // IN/OUT @@ -96,7 +107,9 @@ ToolsDaemon_Cleanup_Backdoor(ToolsDaemon_Data *data); // IN/OUT Bool -ToolsDaemon_SyncTime(Bool syncBackward); +ToolsDaemon_SyncTime(Bool syncBackward, // IN + Bool syncOnce, // IN + void *toolsDaemonData); // IN Bool ToolsDaemon_SetOsPhase(Bool stateChangeSucceeded, diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/hgfsclient/hgfsclient.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/hgfsclient/hgfsclient.c --- open-vm-tools-2008.01.23-74039/hgfsclient/hgfsclient.c 2008-01-28 08:02:54.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/hgfsclient/hgfsclient.c 2008-10-13 08:01:55.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/hgfsclient/hgfsclient_version.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/hgfsclient/hgfsclient_version.h --- open-vm-tools-2008.01.23-74039/hgfsclient/hgfsclient_version.h 2008-01-28 08:02:54.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/hgfsclient/hgfsclient_version.h 2008-10-13 08:01:55.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/hgfsclient/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/hgfsclient/Makefile.am --- open-vm-tools-2008.01.23-74039/hgfsclient/Makefile.am 2008-01-28 08:02:54.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/hgfsclient/Makefile.am 2008-10-13 08:01:55.000000000 +0100 @@ -15,36 +15,42 @@ ### Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ -noinst_PROGRAMS = hgfsclient +bin_PROGRAMS = vmware-hgfsclient -AM_CFLAGS = -AM_CFLAGS += @COMMON_CFLAGS@ - -hgfsclient_LDADD = -hgfsclient_LDADD += ../lib/conf/libConf.a -hgfsclient_LDADD += ../lib/guestApp/libGuestApp.a -hgfsclient_LDADD += ../lib/hgfs/libHgfs.a -hgfsclient_LDADD += ../lib/hgfsBd/libHgfsBd.a -hgfsclient_LDADD += ../lib/rpcOut/libRpcOut.a -hgfsclient_LDADD += ../lib/strUtil/libStrUtil.a -hgfsclient_LDADD += ../lib/string/libString.a -hgfsclient_LDADD += ../lib/toolsLogger/libToolsLogger.a -hgfsclient_LDADD += ../lib/vmCheck/libVmCheck.a -hgfsclient_LDADD += ../lib/vmSignal/libVmSignal.a +vmware_hgfsclient_LDADD = +vmware_hgfsclient_LDADD += ../lib/conf/libConf.a +vmware_hgfsclient_LDADD += ../lib/guestApp/libGuestApp.a +vmware_hgfsclient_LDADD += ../lib/hgfs/libHgfs.a +vmware_hgfsclient_LDADD += ../lib/hgfsBd/libHgfsBd.a +vmware_hgfsclient_LDADD += ../lib/rpcOut/libRpcOut.a +vmware_hgfsclient_LDADD += ../lib/string/libString.a +vmware_hgfsclient_LDADD += ../lib/toolsLogger/libToolsLogger.a +vmware_hgfsclient_LDADD += ../lib/vmCheck/libVmCheck.a +vmware_hgfsclient_LDADD += ../lib/vmSignal/libVmSignal.a # In the absence of the linker options --start-group and --end-group (which can't # be put in LDADD), we need to bring the following libraries out of the alphebetical # order so their symbols are properly resolved. -hgfsclient_LDADD += ../lib/backdoor/libBackdoor.a -hgfsclient_LDADD += ../lib/dict/libDict.a -hgfsclient_LDADD += ../lib/err/libErr.a -hgfsclient_LDADD += ../lib/file/libFile.a -hgfsclient_LDADD += ../lib/message/libMessage.a -hgfsclient_LDADD += ../lib/rpcVmx/libRpcVmx.a -hgfsclient_LDADD += ../lib/unicode/libUnicode.a -hgfsclient_LDADD += ../lib/sync/libSync.a -hgfsclient_LDADD += ../lib/misc/libMisc.a -hgfsclient_LDADD += ../lib/atomic/libAtomic.a +vmware_hgfsclient_LDADD += ../lib/backdoor/libBackdoor.a +vmware_hgfsclient_LDADD += ../lib/dict/libDict.a +vmware_hgfsclient_LDADD += ../lib/err/libErr.a +vmware_hgfsclient_LDADD += ../lib/file/libFile.a +vmware_hgfsclient_LDADD += ../lib/message/libMessage.a +vmware_hgfsclient_LDADD += ../lib/rpcVmx/libRpcVmx.a +vmware_hgfsclient_LDADD += ../lib/unicode/libUnicode.a +vmware_hgfsclient_LDADD += ../lib/sync/libSync.a +vmware_hgfsclient_LDADD += ../lib/misc/libMisc.a +vmware_hgfsclient_LDADD += ../lib/stubs/libStubs.a + +vmware_hgfsclient_SOURCES = +vmware_hgfsclient_SOURCES += hgfsclient.c +vmware_hgfsclient_SOURCES += stub-user-util.c -hgfsclient_SOURCES = -hgfsclient_SOURCES += hgfsclient.c -hgfsclient_SOURCES += stub.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 diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/hgfsclient/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/hgfsclient/Makefile.in --- open-vm-tools-2008.01.23-74039/hgfsclient/Makefile.in 2008-01-28 08:03:02.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/hgfsclient/Makefile.in 2008-10-13 08:02:12.000000000 +0100 @@ -49,31 +49,39 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -noinst_PROGRAMS = hgfsclient$(EXEEXT) +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)/configure.ac +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)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = -PROGRAMS = $(noinst_PROGRAMS) -am_hgfsclient_OBJECTS = hgfsclient.$(OBJEXT) stub.$(OBJEXT) -hgfsclient_OBJECTS = $(am_hgfsclient_OBJECTS) -hgfsclient_DEPENDENCIES = ../lib/conf/libConf.a \ +am__installdirs = "$(DESTDIR)$(bindir)" +binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +PROGRAMS = $(bin_PROGRAMS) +am_vmware_hgfsclient_OBJECTS = hgfsclient.$(OBJEXT) \ + stub-user-util.$(OBJEXT) +vmware_hgfsclient_OBJECTS = $(am_vmware_hgfsclient_OBJECTS) +am__DEPENDENCIES_1 = +vmware_hgfsclient_DEPENDENCIES = ../lib/conf/libConf.a \ ../lib/guestApp/libGuestApp.a ../lib/hgfs/libHgfs.a \ ../lib/hgfsBd/libHgfsBd.a ../lib/rpcOut/libRpcOut.a \ - ../lib/strUtil/libStrUtil.a ../lib/string/libString.a \ - ../lib/toolsLogger/libToolsLogger.a \ + ../lib/string/libString.a ../lib/toolsLogger/libToolsLogger.a \ ../lib/vmCheck/libVmCheck.a ../lib/vmSignal/libVmSignal.a \ ../lib/backdoor/libBackdoor.a ../lib/dict/libDict.a \ ../lib/err/libErr.a ../lib/file/libFile.a \ ../lib/message/libMessage.a ../lib/rpcVmx/libRpcVmx.a \ ../lib/unicode/libUnicode.a ../lib/sync/libSync.a \ - ../lib/misc/libMisc.a ../lib/atomic/libAtomic.a + ../lib/misc/libMisc.a ../lib/stubs/libStubs.a \ + $(am__DEPENDENCIES_1) DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp +depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -84,8 +92,8 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ -SOURCES = $(hgfsclient_SOURCES) -DIST_SOURCES = $(hgfsclient_SOURCES) +SOURCES = $(vmware_hgfsclient_SOURCES) +DIST_SOURCES = $(vmware_hgfsclient_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -99,8 +107,6 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -COMMON_CFLAGS = @COMMON_CFLAGS@ -COMMON_PROG_CFLAGS = @COMMON_PROG_CFLAGS@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -111,45 +117,57 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ -ECHO = @ECHO@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GREP = @GREP@ -GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_AUTH_CFLAGS = @LIB_AUTH_CFLAGS@ -LIB_FILE_CFLAGS = @LIB_FILE_CFLAGS@ -LIB_HGFS_SERVER_CFLAGS = @LIB_HGFS_SERVER_CFLAGS@ -LIB_IMPERSONATE_CFLAGS = @LIB_IMPERSONATE_CFLAGS@ -LIB_MISC_CFLAGS = @LIB_MISC_CFLAGS@ -LIB_PROC_MGR_CFLAGS = @LIB_PROC_MGR_CFLAGS@ -LIB_STRING_CFLAGS = @LIB_STRING_CFLAGS@ -LIB_USER_CFLAGS = @LIB_USER_CFLAGS@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -157,27 +175,35 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ VERSION = @VERSION@ -VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -208,6 +234,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -222,21 +249,26 @@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -AM_CFLAGS = @COMMON_CFLAGS@ # In the absence of the linker options --start-group and --end-group (which can't # be put in LDADD), we need to bring the following libraries out of the alphebetical # order so their symbols are properly resolved. -hgfsclient_LDADD = ../lib/conf/libConf.a ../lib/guestApp/libGuestApp.a \ - ../lib/hgfs/libHgfs.a ../lib/hgfsBd/libHgfsBd.a \ - ../lib/rpcOut/libRpcOut.a ../lib/strUtil/libStrUtil.a \ +vmware_hgfsclient_LDADD = ../lib/conf/libConf.a \ + ../lib/guestApp/libGuestApp.a ../lib/hgfs/libHgfs.a \ + ../lib/hgfsBd/libHgfsBd.a ../lib/rpcOut/libRpcOut.a \ ../lib/string/libString.a ../lib/toolsLogger/libToolsLogger.a \ ../lib/vmCheck/libVmCheck.a ../lib/vmSignal/libVmSignal.a \ ../lib/backdoor/libBackdoor.a ../lib/dict/libDict.a \ ../lib/err/libErr.a ../lib/file/libFile.a \ ../lib/message/libMessage.a ../lib/rpcVmx/libRpcVmx.a \ ../lib/unicode/libUnicode.a ../lib/sync/libSync.a \ - ../lib/misc/libMisc.a ../lib/atomic/libAtomic.a -hgfsclient_SOURCES = hgfsclient.c stub.c + ../lib/misc/libMisc.a ../lib/stubs/libStubs.a $(am__append_1) +vmware_hgfsclient_SOURCES = hgfsclient.c stub-user-util.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: @@ -270,16 +302,37 @@ 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-noinstPROGRAMS: - @list='$(noinst_PROGRAMS)'; for p in $$list; do \ +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 -hgfsclient$(EXEEXT): $(hgfsclient_OBJECTS) $(hgfsclient_DEPENDENCIES) - @rm -f hgfsclient$(EXEEXT) - $(LINK) $(hgfsclient_OBJECTS) $(hgfsclient_LDADD) $(LIBS) +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) @@ -288,7 +341,7 @@ -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hgfsclient.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stub.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stub-user-util.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -395,6 +448,9 @@ 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 @@ -421,8 +477,7 @@ @echo "it deletes files that may require special tools to rebuild." clean: clean-am -clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ - mostlyclean-am +clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) @@ -444,7 +499,7 @@ install-dvi: install-dvi-am -install-exec-am: +install-exec-am: install-binPROGRAMS install-html: install-html-am @@ -476,22 +531,23 @@ ps-am: -uninstall-am: +uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-strip -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstPROGRAMS 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 \ +.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 + 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. diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/hgfsclient/stub.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/hgfsclient/stub.c --- open-vm-tools-2008.01.23-74039/hgfsclient/stub.c 2008-01-28 08:02:54.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/hgfsclient/stub.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,123 +0,0 @@ -/********************************************************* - * Copyright (C) 2006 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 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. - * - *********************************************************/ - -/* - * stub.c -- - * - * Stub for unuseful functions. Stolen from the Tools upgrader. - * - */ - -#include -#include -#include -#include -#include - -#ifdef _MSC_VER -# include -# include -#endif - - -#include "vm_assert.h" -#include "str.h" -#include "debug.h" - -typedef int MsgSeverity; - - -Bool -Config_GetBool(Bool defaultValue, - const char *fmt, - ...) -{ - return defaultValue; -} - - -int32 -Config_GetLong(int32 defaultValue, - const char *fmt, - ...) -{ - return defaultValue; -} - - -void -Msg_Append(const char *id, - const char *fmt, - ...) -{ - static char buf[1000]; - - va_list args; - va_start(args, fmt); - Str_Vsnprintf(buf, sizeof buf, fmt, args); - va_end(args); - - Warning("Msg_Append: %s\n", buf); -} - - -unsigned int -Msg_Question(void *buttons, - char const *id, - char const *fmt, - ...) -{ - static char buf[1000]; - - va_list args; - va_start(args, fmt); - Str_Vsnprintf(buf, sizeof buf, fmt, args); - va_end(args); - - Warning("Msg_Question: %s\n", buf); - - return 0; -} - - -Bool -Preference_GetBool(Bool defaultValue, - const char *name) -{ - return defaultValue; -} - - -char * -Preference_GetString(char *defaultValue, - const char *name) -{ - return defaultValue; -} - -const char * -Hostinfo_NameGet(void) -{ - NOT_IMPLEMENTED(); -} - -char * -Util_ExpandString(const char *fileName) -{ - NOT_IMPLEMENTED(); -} diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/hgfsclient/stub-user-util.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/hgfsclient/stub-user-util.c --- open-vm-tools-2008.01.23-74039/hgfsclient/stub-user-util.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/hgfsclient/stub-user-util.c 2008-10-13 08:01:55.000000000 +0100 @@ -0,0 +1,57 @@ +/********************************************************* + * Copyright (C) 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. + * + *********************************************************/ + +/* + * stub-user-util.c -- + * + * Stubs for Util_* functions in lib/user. + * + */ + +#if defined(_WIN32) +# include +#endif + +#include +#include "vm_assert.h" +#include "util.h" + +void +Util_Backtrace(int bugNr) +{ + NOT_IMPLEMENTED(); +} + + +void +Util_ExitProcessAbruptly(int code) // IN +{ +#if defined(_WIN32) + TerminateProcess(GetCurrentProcess(),code); +#else + exit(code); +#endif +} + + +char * +Util_ExpandString(const char *fileName) +{ + NOT_IMPLEMENTED(); +} + diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/hgfsmounter/hgfsmounter.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/hgfsmounter/hgfsmounter.c --- open-vm-tools-2008.01.23-74039/hgfsmounter/hgfsmounter.c 2008-01-28 08:02:54.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/hgfsmounter/hgfsmounter.c 2008-10-13 08:01:55.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -35,7 +35,8 @@ #if defined(linux) # include #endif -#if defined(__FreeBSD__) + +#if defined(__FreeBSD__) || defined(__APPLE__) # include # include # define MS_MANDLOCK 0 @@ -43,7 +44,12 @@ # define MS_SYNCHRONOUS MNT_SYNCHRONOUS # define MS_NOEXEC MNT_NOEXEC # define MS_NOSUID MNT_NOSUID -# define MS_NODEV MNT_NODEV +/* + * 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 @@ -52,12 +58,24 @@ # define MS_JAILDEVFS MNT_JAILDEVFS # define MS_MULTILABEL MNT_MULTILABEL # define MS_ACLS MNT_ACLS -# define MS_NOATIME MNT_NOATIME # 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 @@ -83,8 +101,11 @@ #include "strutil.h" #include "hgfsmounter_version.h" -#include "embed_version.h" -VM_EMBED_VERSION(HGFSMOUNTER_VERSION_STRING); +/* XXX embed_version.h does not currently support Mach-O binaries (OS X). */ +#if defined(linux) || defined(__FreeBSD__) +# include "embed_version.h" + VM_EMBED_VERSION(HGFSMOUNTER_VERSION_STRING); +#endif /* * Not defined in glibc 2.1.3 @@ -145,7 +166,7 @@ *----------------------------------------------------------------------------- */ -static void +static void PrintVersion(void) { printf("%s version: %s\n", thisProgramBase, HGFSMOUNTER_VERSION_STRING); @@ -169,7 +190,7 @@ *----------------------------------------------------------------------------- */ -static void +static void PrintUsage(void) { printf("Usage: %s [-o ]\n", thisProgramBase); @@ -183,8 +204,10 @@ printf(" rw mount read-write (default)\n"); printf(" nosuid ignore suid/sgid bits\n"); printf(" suid allow suid/sgid bits (default)\n"); +#ifdef MS_NODEV printf(" nodev prevent device node access\n"); printf(" dev allow device node access (default)\n"); +#endif printf(" noexec prevent program execution\n"); printf(" exec allow program execution (default)\n"); printf(" sync file writes are synchronous\n"); @@ -215,7 +238,7 @@ * 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 + * 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, @@ -239,12 +262,12 @@ #ifndef PATH_MAX long sysPathMax; - /* - * pathconf(3) may return -1 if the system imposes no pathname bound, or if + /* + * 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 + * 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); @@ -348,7 +371,7 @@ ASSERT(uidString); ASSERT(uid); - /* + /* * The uid can be a direct value or a username which we must first * translate to its numeric value. */ @@ -363,7 +386,7 @@ } } else { struct passwd *pw; - + if (!(pw = getpwnam(uidString))) { printf("Bad user name \"%s\"\n", uidString); } else { @@ -404,7 +427,7 @@ ASSERT(gidString); ASSERT(gid); - /* + /* * The gid can be a direct value or a group name which we must first * translate to its numeric value. */ @@ -419,7 +442,7 @@ } } else { struct group *gr; - + if (!(gr = getgrnam(gidString))) { printf("Bad group name \"%s\"\n", gidString); } else { @@ -469,7 +492,7 @@ LOG("Parsing option string: %s\n", optionString); /* Loop to tokenize ,,. */ - while ((keyVal = StrUtil_GetNextToken(&commaIndex, + while ((keyVal = StrUtil_GetNextToken(&commaIndex, optionString, ",")) != NULL) { /* Now tokenize [=]. */ unsigned int equalsIndex = 0; @@ -479,7 +502,7 @@ goto out; } - /* + /* * Here are all our recognized option keys. Some have corresponding * values, others don't. */ @@ -488,10 +511,10 @@ if (fmaskString != NULL) { unsigned short fmask; - /* + /* * The way to check for an overflow in strtol(3), according to its * man page. - */ + */ errno = 0; fmask = strtol(fmaskString, NULL, 8); free(fmaskString); @@ -511,10 +534,10 @@ if (dmaskString != NULL) { unsigned short dmask; - /* + /* * The way to check for an overflow in strtol(3), according to its * man page. - */ + */ errno = 0; dmask = strtol(dmaskString, NULL, 8); free(dmaskString); @@ -532,8 +555,8 @@ } else if (strcmp(key, "uid") == 0) { char *uidString = StrUtil_GetNextToken(&equalsIndex, keyVal, "="); if (uidString != NULL) { - uid_t uid; - + uid_t uid = 0; + valid = ParseUid(uidString, &uid); free(uidString); if (valid) { @@ -550,8 +573,8 @@ } else if (strcmp(key, "gid") == 0) { char *gidString = StrUtil_GetNextToken(&equalsIndex, keyVal, "="); if (gidString != NULL) { - gid_t gid; - + gid_t gid = 0; + valid = ParseGid(gidString, &gid); free(gidString); if (valid) { @@ -567,7 +590,7 @@ } } else if (strcmp(key, "ttl") == 0) { int32 ttl; - + if (StrUtil_GetNextIntToken(&ttl, &equalsIndex, keyVal, "=") && ttl > 0) { mountInfo->ttl = ttl; LOG("Setting maximum attribute TTL to %u\n", ttl); @@ -587,12 +610,14 @@ } else if (strcmp(key, "suid") == 0) { *flags &= ~MS_NOSUID; LOG("Setting mount option for allowing suid/sgid bits on\n"); +#ifdef MS_NODEV } else if (strcmp(key, "nodev") == 0) { // allow access to device nodes? *flags |= MS_NODEV; LOG("Setting mount option for accessing device nodes off\n"); } else if (strcmp(key, "dev") == 0) { *flags &= ~MS_NODEV; LOG("Setting mount option for accessing device nodes on\n"); +#endif } else if (strcmp(key, "noexec") == 0) { // allow program execution? *flags |= MS_NOEXEC; LOG("Setting mount option for program execution off\n"); @@ -693,7 +718,7 @@ } } - /* + /* * Create the mtab entry to be written. We'll go ahead and try to write * even if we fail to allocate the mount options. */ @@ -708,7 +733,7 @@ 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). @@ -721,9 +746,11 @@ 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); } @@ -768,8 +795,8 @@ #endif -/* - *----------------------------------------------------------------------------- + +/*----------------------------------------------------------------------------- * * main -- * @@ -793,16 +820,20 @@ Bool doMtab = TRUE; #endif char c; - int i, result = EXIT_FAILURE, flags = 0, mntRes = -1; + int i; + int result = EXIT_FAILURE; + int flags = 0; + int mntRes = -1; char *optionString = NULL; - const char *shareNameHost, *shareNameDir; + 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) { @@ -827,7 +858,21 @@ break; #endif case 'o': - optionString = strdup(optarg); + 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; @@ -836,7 +881,7 @@ case 'v': beVerbose = TRUE; break; - case 'V': + case 'V': PrintVersion(); default: printf("Error: unknown mount option %c\n", c); @@ -854,11 +899,11 @@ 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) { @@ -867,7 +912,7 @@ goto out; } else if (!realpath(mountPoint, canonicalizedPath)) { perror("Error: cannot canonicalize mount point"); - goto out; + goto out; } mountPoint = canonicalizedPath; @@ -885,16 +930,16 @@ mountInfo.ttl = HGFS_DEFAULT_TTL; mountInfo.shareNameHost = shareNameHost; mountInfo.shareNameDir = shareNameDir; - - /* + + /* * This'll write the rest of the options into HgfsMountInfo and possibly - * modify the flags. + * 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"); @@ -905,15 +950,15 @@ goto out; } - /* - * Must be root in one flavor or another. If we're suid root, only proceed - * if the user owns the mountpoint. + /* + * 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", + 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 || + } 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; @@ -929,10 +974,20 @@ {"target", sizeof("target")}, {shareName, strlen(shareName) + 1}, {"fspath", sizeof("fspath")}, - {(void *)mountPoint, strlen(mountPoint) + 1}}; + {(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); #endif if (mntRes) { perror("Error: cannot mount filesystem"); diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/hgfsmounter/hgfsmounter_version.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/hgfsmounter/hgfsmounter_version.h --- open-vm-tools-2008.01.23-74039/hgfsmounter/hgfsmounter_version.h 2008-01-28 08:02:54.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/hgfsmounter/hgfsmounter_version.h 2008-10-13 08:01:55.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/hgfsmounter/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/hgfsmounter/Makefile.am --- open-vm-tools-2008.01.23-74039/hgfsmounter/Makefile.am 2008-01-28 08:02:54.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/hgfsmounter/Makefile.am 2008-10-13 08:01:55.000000000 +0100 @@ -15,15 +15,39 @@ ### Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ -noinst_PROGRAMS = hgfsmounter +sbin_PROGRAMS = mount.vmhgfs -AM_CFLAGS = -AM_CFLAGS += @COMMON_CFLAGS@ +mount_vmhgfs_LDADD = +mount_vmhgfs_LDADD += ../lib/misc/libMisc.a +mount_vmhgfs_LDADD += ../lib/string/libString.a +mount_vmhgfs_LDADD += ../lib/panicDefault/libPanicDefault.a +mount_vmhgfs_LDADD += ../lib/panic/libPanic.a +mount_vmhgfs_LDADD += ../lib/stubs/libStubs.a -hgfsmounter_LDADD = -hgfsmounter_LDADD += ../lib/string/libString.a -hgfsmounter_LDADD += ../lib/strUtil/libStrUtil.a +mount_vmhgfs_SOURCES = +mount_vmhgfs_SOURCES += hgfsmounter.c +mount_vmhgfs_SOURCES += stub-user-util.c -hgfsmounter_SOURCES = -hgfsmounter_SOURCES += hgfsmounter.c -hgfsmounter_SOURCES += stub.c +if FREEBSD +install-exec-hook: + $(MV) $(DESTDIR)$(sbindir)/mount.vmhgfs \ + $(DESTDIR)$(sbindir)/mount_vmhgfs +if WITH_ROOT_PRIVILEGES + chmod u+s $(DESTDIR)$(sbindir)/mount_vmhgfs +endif WITH_ROOT_PRIVILEGES + -$(MKDIR_P) $(DESTDIR)/sbin + -$(LN_S) $(DESTDIR)$(sbindir)/mount_vmhgfs \ + $(DESTDIR)/sbin/mount_vmhgfs &> /dev/null +uninstall-hook: + -$(RM) -f $(DESTDIR)$(sbindir)/mount_vmhgfs &> /dev/null +else +install-exec-hook: +if WITH_ROOT_PRIVILEGES + chmod u+s $(DESTDIR)$(sbindir)/mount.vmhgfs +endif WITH_ROOT_PRIVILEGES + -$(MKDIR_P) $(DESTDIR)/sbin + -$(LN_S) $(DESTDIR)$(sbindir)/mount.vmhgfs \ + $(DESTDIR)/sbin/mount.vmhgfs &> /dev/null +uninstall-hook: + -$(RM) -f $(DESTDIR)/sbin/mount.vmhgfs &> /dev/null +endif !FREEBSD diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/hgfsmounter/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/hgfsmounter/Makefile.in --- open-vm-tools-2008.01.23-74039/hgfsmounter/Makefile.in 2008-01-28 08:03:02.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/hgfsmounter/Makefile.in 2008-10-13 08:02:12.000000000 +0100 @@ -49,22 +49,30 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -noinst_PROGRAMS = hgfsmounter$(EXEEXT) +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)/configure.ac +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)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = -PROGRAMS = $(noinst_PROGRAMS) -am_hgfsmounter_OBJECTS = hgfsmounter.$(OBJEXT) stub.$(OBJEXT) -hgfsmounter_OBJECTS = $(am_hgfsmounter_OBJECTS) -hgfsmounter_DEPENDENCIES = ../lib/string/libString.a \ - ../lib/strUtil/libStrUtil.a +am__installdirs = "$(DESTDIR)$(sbindir)" +sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +PROGRAMS = $(sbin_PROGRAMS) +am_mount_vmhgfs_OBJECTS = hgfsmounter.$(OBJEXT) \ + stub-user-util.$(OBJEXT) +mount_vmhgfs_OBJECTS = $(am_mount_vmhgfs_OBJECTS) +mount_vmhgfs_DEPENDENCIES = ../lib/misc/libMisc.a \ + ../lib/string/libString.a \ + ../lib/panicDefault/libPanicDefault.a ../lib/panic/libPanic.a \ + ../lib/stubs/libStubs.a DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp +depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -75,8 +83,8 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ -SOURCES = $(hgfsmounter_SOURCES) -DIST_SOURCES = $(hgfsmounter_SOURCES) +SOURCES = $(mount_vmhgfs_SOURCES) +DIST_SOURCES = $(mount_vmhgfs_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -90,8 +98,6 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -COMMON_CFLAGS = @COMMON_CFLAGS@ -COMMON_PROG_CFLAGS = @COMMON_PROG_CFLAGS@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -102,45 +108,57 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ -ECHO = @ECHO@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GREP = @GREP@ -GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_AUTH_CFLAGS = @LIB_AUTH_CFLAGS@ -LIB_FILE_CFLAGS = @LIB_FILE_CFLAGS@ -LIB_HGFS_SERVER_CFLAGS = @LIB_HGFS_SERVER_CFLAGS@ -LIB_IMPERSONATE_CFLAGS = @LIB_IMPERSONATE_CFLAGS@ -LIB_MISC_CFLAGS = @LIB_MISC_CFLAGS@ -LIB_PROC_MGR_CFLAGS = @LIB_PROC_MGR_CFLAGS@ -LIB_STRING_CFLAGS = @LIB_STRING_CFLAGS@ -LIB_USER_CFLAGS = @LIB_USER_CFLAGS@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -148,27 +166,35 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ VERSION = @VERSION@ -VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -199,6 +225,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -213,10 +240,10 @@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -AM_CFLAGS = @COMMON_CFLAGS@ -hgfsmounter_LDADD = ../lib/string/libString.a \ - ../lib/strUtil/libStrUtil.a -hgfsmounter_SOURCES = hgfsmounter.c stub.c +mount_vmhgfs_LDADD = ../lib/misc/libMisc.a ../lib/string/libString.a \ + ../lib/panicDefault/libPanicDefault.a ../lib/panic/libPanic.a \ + ../lib/stubs/libStubs.a +mount_vmhgfs_SOURCES = hgfsmounter.c stub-user-util.c all: all-am .SUFFIXES: @@ -250,16 +277,37 @@ 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-noinstPROGRAMS: - @list='$(noinst_PROGRAMS)'; for p in $$list; do \ +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 -hgfsmounter$(EXEEXT): $(hgfsmounter_OBJECTS) $(hgfsmounter_DEPENDENCIES) - @rm -f hgfsmounter$(EXEEXT) - $(LINK) $(hgfsmounter_OBJECTS) $(hgfsmounter_LDADD) $(LIBS) +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) @@ -268,7 +316,7 @@ -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hgfsmounter.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stub.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stub-user-util.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -375,6 +423,9 @@ 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 @@ -401,7 +452,7 @@ @echo "it deletes files that may require special tools to rebuild." clean: clean-am -clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ +clean-am: clean-generic clean-libtool clean-sbinPROGRAMS \ mostlyclean-am distclean: distclean-am @@ -424,7 +475,9 @@ install-dvi: install-dvi-am -install-exec-am: +install-exec-am: install-sbinPROGRAMS + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-am @@ -456,23 +509,44 @@ ps-am: -uninstall-am: +uninstall-am: uninstall-sbinPROGRAMS + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) uninstall-hook -.MAKE: install-am install-strip +.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-noinstPROGRAMS ctags distclean \ + 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-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 - + 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@@WITH_ROOT_PRIVILEGES_TRUE@ chmod u+s $(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 &> /dev/null +@FREEBSD_FALSE@install-exec-hook: +@FREEBSD_FALSE@@WITH_ROOT_PRIVILEGES_TRUE@ chmod u+s $(DESTDIR)$(sbindir)/mount.vmhgfs +@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 &> /dev/null # 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: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/hgfsmounter/stub.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/hgfsmounter/stub.c --- open-vm-tools-2008.01.23-74039/hgfsmounter/stub.c 2008-01-28 08:02:54.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/hgfsmounter/stub.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,97 +0,0 @@ -/********************************************************* - * Copyright (C) 2006 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 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. - * - *********************************************************/ - -/* - * stub.c -- - * - * Stub for unuseful functions. Stolen from the Tools upgrader. - * - */ - -#include -#include -#include -#include - -#include "str.h" -#include "vm_assert.h" - - -/* - *---------------------------------------------------------------------- - * - * StubVprintf -- - * - * Output error text. - * - * Results: - * - * None. - * - * Side effects: - * - * None. - * - *---------------------------------------------------------------------- - */ - -void -StubVprintf(const char *prefix, - const char *fmt, - va_list args) -{ - char *str = Str_Vasprintf(NULL, fmt, args); - if (str) { - fprintf(stderr, "%s: %s", prefix, str); - free(str); - } else { - fprintf(stderr, "%s: out of memory in panic!", prefix); - } -} - - -/* - *---------------------------------------------------------------------- - * - * Panic -- - * - * Mmmm...Panic. - * - * Results: - * - * None. - * - * Side effects: - * - * Kills the program. - * - *---------------------------------------------------------------------- - */ - -void -Panic(const char *fmt,...) -{ - va_list args; - - va_start(args, fmt); - StubVprintf("PANIC", fmt, args); - va_end(args); - - exit(255); - NOT_REACHED(); -} diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/hgfsmounter/stub-user-util.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/hgfsmounter/stub-user-util.c --- open-vm-tools-2008.01.23-74039/hgfsmounter/stub-user-util.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/hgfsmounter/stub-user-util.c 2008-10-13 08:01:55.000000000 +0100 @@ -0,0 +1,57 @@ +/********************************************************* + * Copyright (C) 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. + * + *********************************************************/ + +/* + * stub-user-util.c -- + * + * Stubs for Util_* functions in lib/user. + * + */ + +#if defined(_WIN32) +# include +#endif + +#include +#include "vm_assert.h" +#include "util.h" + +void +Util_Backtrace(int bugNr) +{ + NOT_IMPLEMENTED(); +} + + +void +Util_ExitProcessAbruptly(int code) // IN +{ +#if defined(_WIN32) + TerminateProcess(GetCurrentProcess(),code); +#else + exit(code); +#endif +} + + +char * +Util_ExpandString(const char *fileName) +{ + NOT_IMPLEMENTED(); +} + diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/install-sh /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/install-sh --- open-vm-tools-2008.01.23-74039/install-sh 2008-01-28 08:03:02.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/install-sh 1970-01-01 01:00:00.000000000 +0100 @@ -1,507 +0,0 @@ -#!/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: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/appUtil/appUtil.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/appUtil/appUtil.c --- open-vm-tools-2008.01.23-74039/lib/appUtil/appUtil.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/appUtil/appUtil.c 2008-10-13 08:01:50.000000000 +0100 @@ -0,0 +1,83 @@ +/********************************************************* + * Copyright (C) 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. + * + *********************************************************/ + +/* + * appUtil.c -- + * + * Utility functions for guest applications. + */ + +#include +#include + +#include "vmware.h" +#include "debug.h" +#include "guestCaps.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); +} diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/appUtil/appUtilX11.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/appUtil/appUtilX11.c --- open-vm-tools-2008.01.23-74039/lib/appUtil/appUtilX11.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/appUtil/appUtilX11.c 2008-10-13 08:01:50.000000000 +0100 @@ -0,0 +1,764 @@ +/********************************************************* + * Copyright (C) 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. + * + *********************************************************/ + +/* + * 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 + +/* + *----------------------------------------------------------------------------- + * + * 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; + char *baseIconName; + /* + * Use the GtkIconTheme to track down any available icons for this app. + */ + GtkIconTheme *iconTheme = NULL; + char *ctmp2; + Bool foundItInTheme; // Did we find this icon in the GtkIconTheme? + Bool foundItInFile; // 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] != '/') { + char *ctmp2; + char *ctmpext; + int i; + + myIconName = NULL; + ctmpext = strrchr(iconName, '.'); + ctmp2 = g_alloca(PATH_MAX); + for (i = 0; !myIconName && i < ARRAYSIZE(extraIconPaths); i++) { + if (!extraIconPaths[i]) { + continue; + } + + if (ctmpext) { + g_snprintf(ctmp2, PATH_MAX, "%s/%s", extraIconPaths[i], iconName); + if (g_file_test(ctmp2, G_FILE_TEST_EXISTS)) { + myIconName = ctmp2; + foundItInFile = TRUE; + } + } else { + static const char *iconExtensions[] = { + ".png", + ".xpm", + ".gif", + ".svg", + }; + int j; + + for (j = 0; j < ARRAYSIZE(iconExtensions); j++) { + g_snprintf(ctmp2, PATH_MAX, "%s/%s%s", + extraIconPaths[i], + iconName, iconExtensions[j]); + if (g_file_test(ctmp2, G_FILE_TEST_EXISTS)) { + myIconName = ctmp2; + foundItInFile = TRUE; + break; + } + } + } + } + } 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; + + ASSERT(iconName != NULL || windowID != None); + + 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" + }; + 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); +} diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/appUtil/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/appUtil/Makefile.am --- open-vm-tools-2008.01.23-74039/lib/appUtil/Makefile.am 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/appUtil/Makefile.am 2008-10-13 08:01:47.000000000 +0100 @@ -0,0 +1,24 @@ +################################################################################ +### Copyright 2008 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_LIBRARIES = libAppUtil.a + +libAppUtil_a_SOURCES = +libAppUtil_a_SOURCES += appUtil.c +libAppUtil_a_SOURCES += appUtilX11.c + +AM_CFLAGS = @GTK_CPPFLAGS@ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/appUtil/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/appUtil/Makefile.in --- open-vm-tools-2008.01.23-74039/lib/appUtil/Makefile.in 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/appUtil/Makefile.in 2008-10-13 08:02:12.000000000 +0100 @@ -0,0 +1,496 @@ +# 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 2008 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)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) +ARFLAGS = cru +libAppUtil_a_AR = $(AR) $(ARFLAGS) +libAppUtil_a_LIBADD = +am_libAppUtil_a_OBJECTS = appUtil.$(OBJEXT) appUtilX11.$(OBJEXT) +libAppUtil_a_OBJECTS = $(am_libAppUtil_a_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_a_SOURCES) +DIST_SOURCES = $(libAppUtil_a_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_XLIBS = @COMMON_XLIBS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ +DNET_LIBS = @DNET_LIBS@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ +GTK_LIBS = @GTK_LIBS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ +HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ +MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ +RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ +VERSION = @VERSION@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +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@ +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@ +lt_ECHO = @lt_ECHO@ +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_LIBRARIES = libAppUtil.a +libAppUtil_a_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-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) +libAppUtil.a: $(libAppUtil_a_OBJECTS) $(libAppUtil_a_DEPENDENCIES) + -rm -f libAppUtil.a + $(libAppUtil_a_AR) libAppUtil.a $(libAppUtil_a_OBJECTS) $(libAppUtil_a_LIBADD) + $(RANLIB) libAppUtil.a + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/appUtil.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/appUtilX11.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 $(LIBRARIES) +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-noinstLIBRARIES \ + 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-noinstLIBRARIES 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: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/atomic/atomic.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/atomic/atomic.c --- open-vm-tools-2008.01.23-74039/lib/atomic/atomic.c 2008-01-28 08:02:50.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/atomic/atomic.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,25 +0,0 @@ -/********************************************************* - * Copyright (C) 2006 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 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. - * - *********************************************************/ - -#include "vm_atomic.h" - -/* - * Global flag for using fence after interlocked instructions. - * Please see PR107024 for details. - */ -Bool AtomicUseFence = FALSE; diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/atomic/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/atomic/Makefile.am --- open-vm-tools-2008.01.23-74039/lib/atomic/Makefile.am 2008-01-28 08:02:49.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/atomic/Makefile.am 1970-01-01 01:00:00.000000000 +0100 @@ -1,27 +0,0 @@ -################################################################################ -### Copyright 2007 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_LIBRARIES = libAtomic.a - -libAtomic_a_SOURCES = -libAtomic_a_SOURCES += atomic.c - -AM_CFLAGS = -AM_CFLAGS += @COMMON_CFLAGS@ - -SUBDIRS = -SUBDIRS += shared diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/atomic/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/atomic/Makefile.in --- open-vm-tools-2008.01.23-74039/lib/atomic/Makefile.in 2008-01-28 08:03:03.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/atomic/Makefile.in 1970-01-01 01:00:00.000000000 +0100 @@ -1,588 +0,0 @@ -# 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 2007 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/atomic -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_CLEAN_FILES = -LIBRARIES = $(noinst_LIBRARIES) -ARFLAGS = cru -libAtomic_a_AR = $(AR) $(ARFLAGS) -libAtomic_a_LIBADD = -am_libAtomic_a_OBJECTS = atomic.$(OBJEXT) -libAtomic_a_OBJECTS = $(am_libAtomic_a_OBJECTS) -DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/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 = $(libAtomic_a_SOURCES) -DIST_SOURCES = $(libAtomic_a_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 = $(SUBDIRS) -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_CFLAGS = @COMMON_CFLAGS@ -COMMON_PROG_CFLAGS = @COMMON_PROG_CFLAGS@ -COMMON_XLIBS = @COMMON_XLIBS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DNET_CFLAGS = @DNET_CFLAGS@ -DNET_CONFIG = @DNET_CONFIG@ -DNET_LIBS = @DNET_LIBS@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -GREP = @GREP@ -GTK_CFLAGS = @GTK_CFLAGS@ -GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ -HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIB_AUTH_CFLAGS = @LIB_AUTH_CFLAGS@ -LIB_FILE_CFLAGS = @LIB_FILE_CFLAGS@ -LIB_HGFS_SERVER_CFLAGS = @LIB_HGFS_SERVER_CFLAGS@ -LIB_IMPERSONATE_CFLAGS = @LIB_IMPERSONATE_CFLAGS@ -LIB_MISC_CFLAGS = @LIB_MISC_CFLAGS@ -LIB_PROC_MGR_CFLAGS = @LIB_PROC_MGR_CFLAGS@ -LIB_STRING_CFLAGS = @LIB_STRING_CFLAGS@ -LIB_USER_CFLAGS = @LIB_USER_CFLAGS@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MKDIR_P = @MKDIR_P@ -MODULES = @MODULES@ -MODULES_OS = @MODULES_OS@ -OBJEXT = @OBJEXT@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ -XMKMF = @XMKMF@ -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_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -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@ -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_LIBRARIES = libAtomic.a -libAtomic_a_SOURCES = atomic.c -AM_CFLAGS = @COMMON_CFLAGS@ -SUBDIRS = shared -all: all-recursive - -.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/atomic/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu lib/atomic/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-noinstLIBRARIES: - -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) -libAtomic.a: $(libAtomic_a_OBJECTS) $(libAtomic_a_DEPENDENCIES) - -rm -f libAtomic.a - $(libAtomic_a_AR) libAtomic.a $(libAtomic_a_OBJECTS) $(libAtomic_a_LIBADD) - $(RANLIB) libAtomic.a - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atomic.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 - -# 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 $(LIBRARIES) -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 clean-noinstLIBRARIES \ - mostlyclean-am - -distclean: distclean-recursive - -rm -rf ./$(DEPDIR) - -rm -f Makefile -distclean-am: clean-am distclean-compile 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 -rf ./$(DEPDIR) - -rm -f Makefile -maintainer-clean-am: distclean-am maintainer-clean-generic - -mostlyclean: mostlyclean-recursive - -mostlyclean-am: mostlyclean-compile 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 \ - clean-noinstLIBRARIES ctags ctags-recursive 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 \ - installdirs-am maintainer-clean maintainer-clean-generic \ - mostlyclean mostlyclean-compile 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: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/atomic/shared/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/atomic/shared/Makefile.am --- open-vm-tools-2008.01.23-74039/lib/atomic/shared/Makefile.am 2008-01-28 08:02:49.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/atomic/shared/Makefile.am 1970-01-01 01:00:00.000000000 +0100 @@ -1,24 +0,0 @@ -################################################################################ -### Copyright 2007 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 = libAtomic.la - -libAtomic_la_SOURCES = -libAtomic_la_SOURCES += ../atomic.c - -AM_CFLAGS = -AM_CFLAGS += @COMMON_CFLAGS@ \ No newline at end of file diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/atomic/shared/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/atomic/shared/Makefile.in --- open-vm-tools-2008.01.23-74039/lib/atomic/shared/Makefile.in 2008-01-28 08:03:03.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/atomic/shared/Makefile.in 1970-01-01 01:00:00.000000000 +0100 @@ -1,482 +0,0 @@ -# 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 2007 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/atomic/shared -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(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) -libAtomic_la_LIBADD = -am_libAtomic_la_OBJECTS = atomic.lo -libAtomic_la_OBJECTS = $(am_libAtomic_la_OBJECTS) -DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/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 = $(libAtomic_la_SOURCES) -DIST_SOURCES = $(libAtomic_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_CFLAGS = @COMMON_CFLAGS@ -COMMON_PROG_CFLAGS = @COMMON_PROG_CFLAGS@ -COMMON_XLIBS = @COMMON_XLIBS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DNET_CFLAGS = @DNET_CFLAGS@ -DNET_CONFIG = @DNET_CONFIG@ -DNET_LIBS = @DNET_LIBS@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -GREP = @GREP@ -GTK_CFLAGS = @GTK_CFLAGS@ -GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ -HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIB_AUTH_CFLAGS = @LIB_AUTH_CFLAGS@ -LIB_FILE_CFLAGS = @LIB_FILE_CFLAGS@ -LIB_HGFS_SERVER_CFLAGS = @LIB_HGFS_SERVER_CFLAGS@ -LIB_IMPERSONATE_CFLAGS = @LIB_IMPERSONATE_CFLAGS@ -LIB_MISC_CFLAGS = @LIB_MISC_CFLAGS@ -LIB_PROC_MGR_CFLAGS = @LIB_PROC_MGR_CFLAGS@ -LIB_STRING_CFLAGS = @LIB_STRING_CFLAGS@ -LIB_USER_CFLAGS = @LIB_USER_CFLAGS@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MKDIR_P = @MKDIR_P@ -MODULES = @MODULES@ -MODULES_OS = @MODULES_OS@ -OBJEXT = @OBJEXT@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ -XMKMF = @XMKMF@ -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_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -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@ -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 = libAtomic.la -libAtomic_la_SOURCES = ../atomic.c -AM_CFLAGS = @COMMON_CFLAGS@ -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/atomic/shared/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu lib/atomic/shared/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 -libAtomic.la: $(libAtomic_la_OBJECTS) $(libAtomic_la_DEPENDENCIES) - $(LINK) $(libAtomic_la_OBJECTS) $(libAtomic_la_LIBADD) $(LIBS) - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atomic.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 $@ $< - -atomic.lo: ../atomic.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT atomic.lo -MD -MP -MF $(DEPDIR)/atomic.Tpo -c -o atomic.lo `test -f '../atomic.c' || echo '$(srcdir)/'`../atomic.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/atomic.Tpo $(DEPDIR)/atomic.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../atomic.c' object='atomic.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o atomic.lo `test -f '../atomic.c' || echo '$(srcdir)/'`../atomic.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: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/auth/authPosix.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/auth/authPosix.c --- open-vm-tools-2008.01.23-74039/lib/auth/authPosix.c 2008-01-28 08:02:50.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/auth/authPosix.c 2008-10-13 08:01:51.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -29,10 +29,11 @@ #include #endif -#include "auth.h" - +#include "vmware.h" #include "vm_version.h" -#include "vm_assert.h" +#include "posix.h" +#include "auth.h" +#include "str.h" #ifdef USE_PAM # include "file.h" @@ -103,10 +104,17 @@ if (authPamLibraryHandle) { return TRUE; } - pam_library = dlopen(CURRENT_PAM_LIBRARY, RTLD_LAZY | RTLD_GLOBAL); + pam_library = Posix_Dlopen(CURRENT_PAM_LIBRARY, RTLD_LAZY | RTLD_GLOBAL); if (!pam_library) { -#if !defined(VMX86_TOOLS) - char liblocation[FILE_MAXPATH]; +#if defined(VMX86_TOOLS) + /* + * XXX do we even try to configure the pam libraries? + * potential nightmare on all the possible guest OSes + */ + Log("System PAM libraries are unusable: %s\n", dlerror()); + return FALSE; +#else + char *liblocation; char *libdir; libdir = LocalConfig_GetPathName(DEFAULT_LIBDIRECTORY, CONFIG_VMWAREDIR); @@ -114,21 +122,18 @@ Log("System PAM library unusable and bundled one not found.\n"); return FALSE; } - snprintf(liblocation, sizeof liblocation, "%s/lib/%s/%s", libdir, - CURRENT_PAM_LIBRARY, CURRENT_PAM_LIBRARY); - pam_library = dlopen(liblocation, RTLD_LAZY | RTLD_GLOBAL); + liblocation = Str_SafeAsprintf(NULL, "%s/lib/%s/%s", libdir, + CURRENT_PAM_LIBRARY, CURRENT_PAM_LIBRARY); + free(libdir); + + pam_library = Posix_Dlopen(liblocation, RTLD_LAZY | RTLD_GLOBAL); if (!pam_library) { Log("Neither system nor bundled (%s) PAM libraries usable: %s\n", liblocation, dlerror()); + free(liblocation); return FALSE; } -#else - /* - * XXX do we even try to configure the pam libraries? - * potential nightmare on all the possible guest OSes - */ - Log("System PAM libraries are unusable: %s\n", dlerror()); - return FALSE; + free(liblocation); #endif } for (i = 0; i < ARRAYSIZE(authPAMImported); i++) { @@ -263,7 +268,7 @@ #endif /* If this point is reached, the user has been authenticated. */ setpwent(); - pwd = getpwnam(user); + pwd = Posix_Getpwnam(user); endpwent(); #else /* !USE_PAM */ @@ -273,7 +278,7 @@ corresponding #endif below. */ setpwent(); //XXX can kill? - pwd = getpwnam(user); + pwd = Posix_Getpwnam(user); endpwent(); //XXX can kill? if (!pwd) { diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/auth/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/auth/Makefile.am --- open-vm-tools-2008.01.23-74039/lib/auth/Makefile.am 2008-01-28 08:02:49.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/auth/Makefile.am 2008-10-13 08:01:48.000000000 +0100 @@ -20,6 +20,4 @@ libAuth_a_SOURCES = libAuth_a_SOURCES += authPosix.c -AM_CFLAGS = -AM_CFLAGS += @COMMON_CFLAGS@ -AM_CFLAGS += @LIB_AUTH_CFLAGS@ +AM_CFLAGS = @LIB_AUTH_CPPFLAGS@ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/auth/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/auth/Makefile.in --- open-vm-tools-2008.01.23-74039/lib/auth/Makefile.in 2008-01-28 08:03:03.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/auth/Makefile.in 2008-10-13 08:02:12.000000000 +0100 @@ -52,7 +52,10 @@ subdir = lib/auth DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +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)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -64,7 +67,7 @@ am_libAuth_a_OBJECTS = authPosix.$(OBJEXT) libAuth_a_OBJECTS = $(am_libAuth_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp +depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -90,8 +93,6 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -COMMON_CFLAGS = @COMMON_CFLAGS@ -COMMON_PROG_CFLAGS = @COMMON_PROG_CFLAGS@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -102,45 +103,57 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ -ECHO = @ECHO@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GREP = @GREP@ -GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_AUTH_CFLAGS = @LIB_AUTH_CFLAGS@ -LIB_FILE_CFLAGS = @LIB_FILE_CFLAGS@ -LIB_HGFS_SERVER_CFLAGS = @LIB_HGFS_SERVER_CFLAGS@ -LIB_IMPERSONATE_CFLAGS = @LIB_IMPERSONATE_CFLAGS@ -LIB_MISC_CFLAGS = @LIB_MISC_CFLAGS@ -LIB_PROC_MGR_CFLAGS = @LIB_PROC_MGR_CFLAGS@ -LIB_STRING_CFLAGS = @LIB_STRING_CFLAGS@ -LIB_USER_CFLAGS = @LIB_USER_CFLAGS@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -148,27 +161,35 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ VERSION = @VERSION@ -VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -199,6 +220,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -215,7 +237,7 @@ top_srcdir = @top_srcdir@ noinst_LIBRARIES = libAuth.a libAuth_a_SOURCES = authPosix.c -AM_CFLAGS = @COMMON_CFLAGS@ @LIB_AUTH_CFLAGS@ +AM_CFLAGS = @LIB_AUTH_CPPFLAGS@ all: all-am .SUFFIXES: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/backdoor/backdoor.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/backdoor/backdoor.c --- open-vm-tools-2008.01.23-74039/lib/backdoor/backdoor.c 2008-01-28 08:02:50.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/backdoor/backdoor.c 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/backdoor/backdoorGcc32.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/backdoor/backdoorGcc32.c --- open-vm-tools-2008.01.23-74039/lib/backdoor/backdoorGcc32.c 2008-01-28 08:02:50.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/backdoor/backdoorGcc32.c 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/backdoor/backdoorGcc64.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/backdoor/backdoorGcc64.c --- open-vm-tools-2008.01.23-74039/lib/backdoor/backdoorGcc64.c 2008-01-28 08:02:50.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/backdoor/backdoorGcc64.c 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/backdoor/backdoorInt.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/backdoor/backdoorInt.h --- open-vm-tools-2008.01.23-74039/lib/backdoor/backdoorInt.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/backdoor/backdoorInt.h 2008-10-13 08:01:50.000000000 +0100 @@ -0,0 +1,26 @@ +/********************************************************* + * Copyright (C) 2005 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. + * + *********************************************************/ + +/* + * backdoorInt.h -- + * + * Internal function prototypes for the real backdoor work. + */ + +void BackdoorHbIn(Backdoor_proto_hb *bp); +void BackdoorHbOut(Backdoor_proto_hb *bp); diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/backdoor/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/backdoor/Makefile.am --- open-vm-tools-2008.01.23-74039/lib/backdoor/Makefile.am 2008-01-28 08:02:49.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/backdoor/Makefile.am 2008-10-13 08:01:47.000000000 +0100 @@ -25,8 +25,5 @@ libBackdoor_a_SOURCES += backdoorGcc64.c endif -AM_CFLAGS = -AM_CFLAGS += @COMMON_CFLAGS@ - SUBDIRS = SUBDIRS += shared diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/backdoor/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/backdoor/Makefile.in --- open-vm-tools-2008.01.23-74039/lib/backdoor/Makefile.in 2008-01-28 08:03:03.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/backdoor/Makefile.in 2008-10-13 08:02:12.000000000 +0100 @@ -54,7 +54,10 @@ subdir = lib/backdoor DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +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)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -73,7 +76,7 @@ $(am__objects_2) libBackdoor_a_OBJECTS = $(am_libBackdoor_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp +depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -109,8 +112,6 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -COMMON_CFLAGS = @COMMON_CFLAGS@ -COMMON_PROG_CFLAGS = @COMMON_PROG_CFLAGS@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -121,45 +122,57 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ -ECHO = @ECHO@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GREP = @GREP@ -GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_AUTH_CFLAGS = @LIB_AUTH_CFLAGS@ -LIB_FILE_CFLAGS = @LIB_FILE_CFLAGS@ -LIB_HGFS_SERVER_CFLAGS = @LIB_HGFS_SERVER_CFLAGS@ -LIB_IMPERSONATE_CFLAGS = @LIB_IMPERSONATE_CFLAGS@ -LIB_MISC_CFLAGS = @LIB_MISC_CFLAGS@ -LIB_PROC_MGR_CFLAGS = @LIB_PROC_MGR_CFLAGS@ -LIB_STRING_CFLAGS = @LIB_STRING_CFLAGS@ -LIB_USER_CFLAGS = @LIB_USER_CFLAGS@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -167,27 +180,35 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ VERSION = @VERSION@ -VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -218,6 +239,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -234,7 +256,6 @@ top_srcdir = @top_srcdir@ noinst_LIBRARIES = libBackdoor.a libBackdoor_a_SOURCES = backdoor.c $(am__append_1) $(am__append_2) -AM_CFLAGS = @COMMON_CFLAGS@ SUBDIRS = shared all: all-recursive diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/backdoor/shared/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/backdoor/shared/Makefile.am --- open-vm-tools-2008.01.23-74039/lib/backdoor/shared/Makefile.am 2008-01-28 08:02:49.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/backdoor/shared/Makefile.am 2008-10-13 08:01:47.000000000 +0100 @@ -24,6 +24,3 @@ else libBackdoor_la_SOURCES += ../backdoorGcc64.c endif - -AM_CFLAGS = -AM_CFLAGS += @COMMON_CFLAGS@ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/backdoor/shared/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/backdoor/shared/Makefile.in --- open-vm-tools-2008.01.23-74039/lib/backdoor/shared/Makefile.in 2008-01-28 08:03:03.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/backdoor/shared/Makefile.in 2008-10-13 08:02:12.000000000 +0100 @@ -54,7 +54,10 @@ subdir = lib/backdoor/shared DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +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)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -69,7 +72,7 @@ $(am__objects_2) libBackdoor_la_OBJECTS = $(am_libBackdoor_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp +depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -95,8 +98,6 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -COMMON_CFLAGS = @COMMON_CFLAGS@ -COMMON_PROG_CFLAGS = @COMMON_PROG_CFLAGS@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -107,45 +108,57 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ -ECHO = @ECHO@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GREP = @GREP@ -GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_AUTH_CFLAGS = @LIB_AUTH_CFLAGS@ -LIB_FILE_CFLAGS = @LIB_FILE_CFLAGS@ -LIB_HGFS_SERVER_CFLAGS = @LIB_HGFS_SERVER_CFLAGS@ -LIB_IMPERSONATE_CFLAGS = @LIB_IMPERSONATE_CFLAGS@ -LIB_MISC_CFLAGS = @LIB_MISC_CFLAGS@ -LIB_PROC_MGR_CFLAGS = @LIB_PROC_MGR_CFLAGS@ -LIB_STRING_CFLAGS = @LIB_STRING_CFLAGS@ -LIB_USER_CFLAGS = @LIB_USER_CFLAGS@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -153,27 +166,35 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ VERSION = @VERSION@ -VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -204,6 +225,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -220,7 +242,6 @@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libBackdoor.la libBackdoor_la_SOURCES = ../backdoor.c $(am__append_1) $(am__append_2) -AM_CFLAGS = @COMMON_CFLAGS@ all: all-am .SUFFIXES: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/conf/conf.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/conf/conf.c --- open-vm-tools-2008.01.23-74039/lib/conf/conf.c 2008-01-28 08:02:50.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/conf/conf.c 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -71,9 +71,9 @@ { GuestApp_Dict *confDict; char *path; - const char *confPath = GuestApp_GetConfPath(); - const char *installPath = GuestApp_GetInstallPath(); - + char *confPath = GuestApp_GetConfPath(); + char *installPath = GuestApp_GetInstallPath(); + /* We really can't proceed without these paths. */ ASSERT(confPath); ASSERT(installPath); @@ -125,17 +125,12 @@ GuestApp_SetDictEntryDefault(confDict, CONFNAME_MAX_WIPERSIZE, CONFVAL_MAX_WIPERSIZE_DEFAULT); - GuestApp_SetDictEntryDefault(confDict, - CONFNAME_RESOLUTION_MIN_WIDTH, - CONFVAL_RESOLUTION_MIN_WIDTH_DEFAULT); - - GuestApp_SetDictEntryDefault(confDict, - CONFNAME_RESOLUTION_MIN_HEIGHT, - CONFVAL_RESOLUTION_MIN_HEIGHT_DEFAULT); - /* Load the user-configured values from the conf file if it's there */ GuestApp_LoadDict(confDict); - + + free(installPath); + free(confPath); + return confDict; } diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/conf/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/conf/Makefile.am --- open-vm-tools-2008.01.23-74039/lib/conf/Makefile.am 2008-01-28 08:02:49.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/conf/Makefile.am 2008-10-13 08:01:47.000000000 +0100 @@ -19,6 +19,3 @@ libConf_a_SOURCES = libConf_a_SOURCES += conf.c - -AM_CFLAGS = -AM_CFLAGS += @COMMON_CFLAGS@ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/conf/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/conf/Makefile.in --- open-vm-tools-2008.01.23-74039/lib/conf/Makefile.in 2008-01-28 08:03:03.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/conf/Makefile.in 2008-10-13 08:02:12.000000000 +0100 @@ -52,7 +52,10 @@ subdir = lib/conf DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +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)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -64,7 +67,7 @@ am_libConf_a_OBJECTS = conf.$(OBJEXT) libConf_a_OBJECTS = $(am_libConf_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp +depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -90,8 +93,6 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -COMMON_CFLAGS = @COMMON_CFLAGS@ -COMMON_PROG_CFLAGS = @COMMON_PROG_CFLAGS@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -102,45 +103,57 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ -ECHO = @ECHO@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GREP = @GREP@ -GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_AUTH_CFLAGS = @LIB_AUTH_CFLAGS@ -LIB_FILE_CFLAGS = @LIB_FILE_CFLAGS@ -LIB_HGFS_SERVER_CFLAGS = @LIB_HGFS_SERVER_CFLAGS@ -LIB_IMPERSONATE_CFLAGS = @LIB_IMPERSONATE_CFLAGS@ -LIB_MISC_CFLAGS = @LIB_MISC_CFLAGS@ -LIB_PROC_MGR_CFLAGS = @LIB_PROC_MGR_CFLAGS@ -LIB_STRING_CFLAGS = @LIB_STRING_CFLAGS@ -LIB_USER_CFLAGS = @LIB_USER_CFLAGS@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -148,27 +161,35 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ VERSION = @VERSION@ -VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -199,6 +220,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -215,7 +237,6 @@ top_srcdir = @top_srcdir@ noinst_LIBRARIES = libConf.a libConf_a_SOURCES = conf.c -AM_CFLAGS = @COMMON_CFLAGS@ all: all-am .SUFFIXES: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/deployPkg/deployPkg.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/deployPkg/deployPkg.c --- open-vm-tools-2008.01.23-74039/lib/deployPkg/deployPkg.c 2008-01-28 08:02:50.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/deployPkg/deployPkg.c 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -242,7 +242,6 @@ int i = 0; char *dir = NULL; char *newDir = NULL; - char *utf8Dir = NULL; Bool found = FALSE; /* @@ -272,17 +271,7 @@ Warning("DeployPkgGetTempDir Could not create temp directory\n"); goto exit; } - - /* Convert newDir to utf8. */ - if (!CodeSet_CurrentToUtf8(newDir, - strlen(newDir), - &utf8Dir, - NULL)) { - Warning("DeployPkgGetTempDir CodeSet_CurrentToUtf8 failed\n"); - goto exit; - } exit: free(dir); - free(newDir); - return utf8Dir; + return newDir; } diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/deployPkg/deployPkgLog.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/deployPkg/deployPkgLog.c --- open-vm-tools-2008.01.23-74039/lib/deployPkg/deployPkgLog.c 2008-01-28 08:02:50.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/deployPkg/deployPkgLog.c 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/deployPkg/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/deployPkg/Makefile.am --- open-vm-tools-2008.01.23-74039/lib/deployPkg/Makefile.am 2008-01-28 08:02:49.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/deployPkg/Makefile.am 2008-10-13 08:01:47.000000000 +0100 @@ -21,6 +21,3 @@ libDeployPkg_a_SOURCES += deployPkgLog.c libDeployPkg_a_SOURCES += deployPkg.c libDeployPkg_a_SOURCES += runDeployPkgPosix.c - -AM_CFLAGS = -AM_CFLAGS += @COMMON_CFLAGS@ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/deployPkg/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/deployPkg/Makefile.in --- open-vm-tools-2008.01.23-74039/lib/deployPkg/Makefile.in 2008-01-28 08:03:03.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/deployPkg/Makefile.in 2008-10-13 08:02:12.000000000 +0100 @@ -52,7 +52,10 @@ subdir = lib/deployPkg DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +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)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -65,7 +68,7 @@ runDeployPkgPosix.$(OBJEXT) libDeployPkg_a_OBJECTS = $(am_libDeployPkg_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp +depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -91,8 +94,6 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -COMMON_CFLAGS = @COMMON_CFLAGS@ -COMMON_PROG_CFLAGS = @COMMON_PROG_CFLAGS@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -103,45 +104,57 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ -ECHO = @ECHO@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GREP = @GREP@ -GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_AUTH_CFLAGS = @LIB_AUTH_CFLAGS@ -LIB_FILE_CFLAGS = @LIB_FILE_CFLAGS@ -LIB_HGFS_SERVER_CFLAGS = @LIB_HGFS_SERVER_CFLAGS@ -LIB_IMPERSONATE_CFLAGS = @LIB_IMPERSONATE_CFLAGS@ -LIB_MISC_CFLAGS = @LIB_MISC_CFLAGS@ -LIB_PROC_MGR_CFLAGS = @LIB_PROC_MGR_CFLAGS@ -LIB_STRING_CFLAGS = @LIB_STRING_CFLAGS@ -LIB_USER_CFLAGS = @LIB_USER_CFLAGS@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -149,27 +162,35 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ VERSION = @VERSION@ -VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -200,6 +221,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -217,7 +239,6 @@ noinst_LIBRARIES = libDeployPkg.a libDeployPkg_a_SOURCES = deployPkgLog.c deployPkg.c \ runDeployPkgPosix.c -AM_CFLAGS = @COMMON_CFLAGS@ all: all-am .SUFFIXES: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/deployPkg/runDeployPkgInt.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/deployPkg/runDeployPkgInt.h --- open-vm-tools-2008.01.23-74039/lib/deployPkg/runDeployPkgInt.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/deployPkg/runDeployPkgInt.h 2008-10-13 08:01:50.000000000 +0100 @@ -0,0 +1,62 @@ +/********************************************************* + * Copyright (C) 2006 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. + * + *********************************************************/ + +/* + * runDeployPkgInt.h -- + * + * c interface to load the deployPkg library and call the + * DeployPkg_DeployPackageFromFile export + */ + +#ifndef _RUN_DEPLOYPKG_INT_H +#define _RUN_DEPLOYPKG_INT_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include "vm_basic_types.h" +#include "toolsDeployPkg.h" + +/* + * DeployPkg logger. In order to add the LogFunction pointer definition + * to tools, we'd need to populate the component before the service + * build, which would force anyone building tools to connect to the + * component repo. To avoid that, duplicate the definition here: + */ +typedef void (*DeployPkgLogFunction) (int level, const char *fmtstr, ...); + +/* Function pointers for exports in dll/so */ +typedef int (*DeployPkgFromFileFn)(const char*); +typedef void (*DeployPkgSetLogFn)(DeployPkgLogFunction); + +/* Decorated function names from deployPkg.dll */ +#define FNAME_DEPLOYPKGFROMFILE "DeployPkg_DeployPackageFromFile" +#define FNAME_SETLOGGER "DeployPkg_SetLogger" + +ToolsDeployPkgError +DeployPkgDeployPkgInGuest(const char* pkgFile, // IN: the package filename + char* errBuf, // OUT: buffer for msg on fail + int errBufSize); // IN: size of errBuf + +#ifdef __cplusplus +} +#endif + +#endif // _RUN_DEPLOYPKG_INT_H + diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/deployPkg/runDeployPkgPosix.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/deployPkg/runDeployPkgPosix.c --- open-vm-tools-2008.01.23-74039/lib/deployPkg/runDeployPkgPosix.c 2008-01-28 08:02:50.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/deployPkg/runDeployPkgPosix.c 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -34,6 +34,13 @@ #define LIBPATH_DEPLOYPKG "/usr/lib/libDeployPkg.so" +#ifndef RTLD_LOCAL +/* + * Needed for very old FreeBSD versions... + */ +#define RTLD_LOCAL 0 +#endif + /* *---------------------------------------------------------------------- * diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/dict/dictll.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/dict/dictll.c --- open-vm-tools-2008.01.23-74039/lib/dict/dictll.c 2008-01-28 08:02:50.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/dict/dictll.c 2008-10-13 08:01:51.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -34,6 +34,8 @@ #include "dictll.h" #include "util.h" +#define UTF8_BOM "\xEF\xBB\xBF" + /* Duplicate a buffer --hpreg. The result is NUL-terminated */ static void * @@ -380,7 +382,7 @@ */ Bool -DictLL_MarshalLine(DynBuf *output, // IN: output buffer +DictLL_MarshalLine(DynBuf *output, // IN/OUT: output buffer char const *name, // IN: name to marshal char const *value) // IN: value to marshal { @@ -485,3 +487,43 @@ 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; +} diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/dict/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/dict/Makefile.am --- open-vm-tools-2008.01.23-74039/lib/dict/Makefile.am 2008-01-28 08:02:49.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/dict/Makefile.am 2008-10-13 08:01:48.000000000 +0100 @@ -17,8 +17,5 @@ noinst_LIBRARIES = libDict.a -libDict_a_SOURCES = +libDict_a_SOURCES = libDict_a_SOURCES += dictll.c - -AM_CFLAGS = -AM_CFLAGS += @COMMON_CFLAGS@ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/dict/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/dict/Makefile.in --- open-vm-tools-2008.01.23-74039/lib/dict/Makefile.in 2008-01-28 08:03:03.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/dict/Makefile.in 2008-10-13 08:02:12.000000000 +0100 @@ -52,7 +52,10 @@ subdir = lib/dict DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +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)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -64,7 +67,7 @@ am_libDict_a_OBJECTS = dictll.$(OBJEXT) libDict_a_OBJECTS = $(am_libDict_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp +depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -90,8 +93,6 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -COMMON_CFLAGS = @COMMON_CFLAGS@ -COMMON_PROG_CFLAGS = @COMMON_PROG_CFLAGS@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -102,45 +103,57 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ -ECHO = @ECHO@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GREP = @GREP@ -GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_AUTH_CFLAGS = @LIB_AUTH_CFLAGS@ -LIB_FILE_CFLAGS = @LIB_FILE_CFLAGS@ -LIB_HGFS_SERVER_CFLAGS = @LIB_HGFS_SERVER_CFLAGS@ -LIB_IMPERSONATE_CFLAGS = @LIB_IMPERSONATE_CFLAGS@ -LIB_MISC_CFLAGS = @LIB_MISC_CFLAGS@ -LIB_PROC_MGR_CFLAGS = @LIB_PROC_MGR_CFLAGS@ -LIB_STRING_CFLAGS = @LIB_STRING_CFLAGS@ -LIB_USER_CFLAGS = @LIB_USER_CFLAGS@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -148,27 +161,35 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ VERSION = @VERSION@ -VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -199,6 +220,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -215,7 +237,6 @@ top_srcdir = @top_srcdir@ noinst_LIBRARIES = libDict.a libDict_a_SOURCES = dictll.c -AM_CFLAGS = @COMMON_CFLAGS@ all: all-am .SUFFIXES: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/dnd/dndCommon.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/dnd/dndCommon.c --- open-vm-tools-2008.01.23-74039/lib/dnd/dndCommon.c 2008-01-28 08:02:50.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/dnd/dndCommon.c 2008-10-13 08:01:51.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -28,14 +28,18 @@ #include #include +#include "vmware.h" #include "dndInt.h" #include "dnd.h" #include "file.h" #include "str.h" +#include "random.h" #include "util.h" #include "cpNameUtil.h" #include "hgfsServerPolicy.h" #include "hgfsVirtualDir.h" +#include "unicodeOperations.h" +#include "hostinfo.h" #define LOGLEVEL_MODULE dnd #include "loglevel_user.h" @@ -43,13 +47,7 @@ #define WIN_DIRSEPC '\\' #define WIN_DIRSEPS "\\" -const char *DnDCreateRootStagingDirectory(void); -Bool DnDDataContainsIllegalCharacters(const char *data, - const size_t dataSize, - const char *illegalChars); -Bool DnDPrependFileRoot(const char *fileRoot, const char delimiter, - char **src, size_t *srcSize); - +static ConstUnicode DnDCreateRootStagingDirectory(void); /* *----------------------------------------------------------------------------- @@ -79,14 +77,14 @@ *----------------------------------------------------------------------------- */ -char * +Unicode DnD_CreateStagingDirectory(void) { - const char *root; - char **stagingDirList; + ConstUnicode root; + Unicode *stagingDirList; int numStagingDirs; int i; - char *ret = NULL; + Unicode ret = NULL; Bool found = FALSE; /* @@ -98,14 +96,6 @@ return NULL; } - /* - * Now find an existing directory to use or create a new one. - */ - ret = calloc(PATH_MAX, sizeof *ret); - if (!ret) { - return NULL; - } - /* Look for an existing, empty staging directory */ numStagingDirs = File_ListDirectory(root, &stagingDirList); if (numStagingDirs < 0) { @@ -114,51 +104,55 @@ for (i = 0; i < numStagingDirs; i++) { if (!found) { - char stagingDir[PATH_MAX]; + Unicode stagingDir; + + stagingDir = Unicode_Append(root, stagingDirList[i]); - if (Str_Snprintf(stagingDir, sizeof stagingDir, - "%s%s", root, stagingDirList[i]) == -1) { - continue; - } if (File_IsEmptyDirectory(stagingDir) && DnDStagingDirectoryUsable(stagingDir)) { - if (Str_Snprintf(ret, PATH_MAX, - "%s%c", stagingDir, DIRSEPC) == -1) { - continue; - } + ret = Unicode_Append(stagingDir, DIRSEPS); /* * We can use this directory. Make sure to continue to loop * so we don't leak the remaining stagindDirList[i]s. */ found = TRUE; } + + Unicode_Free(stagingDir); } - free(stagingDirList[i]); } - free(stagingDirList); + Unicode_FreeList(stagingDirList, numStagingDirs); /* Only create a directory if we didn't find one above. */ if (!found) { - srand((unsigned)time(NULL)); + void *p; + + p = Random_QuickSeed((unsigned)time(NULL)); for (i = 0; i < 10; i++) { + Unicode temp; + /* Each staging directory is given a random name. */ - if (Str_Snprintf(ret, PATH_MAX, - "%s%08x%c", root, rand(), DIRSEPC) == -1) { - continue; - } + Unicode_Free(ret); + temp = Unicode_Format("%08x%c", Random_Quick(p), DIRSEPC); + ASSERT_MEM_ALLOC(temp); + ret = Unicode_Append(root, temp); + Unicode_Free(temp); + if (File_CreateDirectory(ret) && DnDSetPermissionsOnStagingDir(ret)) { found = TRUE; break; } } + + free(p); } exit: if (!found && ret != NULL) { - free(ret); + Unicode_Free(ret); ret = NULL; } @@ -167,6 +161,80 @@ /* + *----------------------------------------------------------------------------- + * + * DnD_DeleteStagingFiles -- + * + * Attempts to delete all files in the staging directory. This does not + * delete the directory itself. + * + * Results: + * TRUE if all files were deleted. FALSE if there was an error. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +Bool +DnD_DeleteStagingFiles(ConstUnicode stagingDir, // IN: + Bool onReboot) // IN: +{ + Bool ret = TRUE; + + ASSERT(stagingDir); + ASSERT(File_IsDirectory(stagingDir)); + + if (onReboot) { + if (File_UnlinkDelayed(stagingDir)) { + ret = FALSE; + } + } else { + int i; + int numFiles; + Unicode base; + Unicode *fileList = NULL; + + if (!File_Exists(stagingDir)) { + return TRUE; + } + + /* get list of files in current directory */ + numFiles = File_ListDirectory(stagingDir, &fileList); + + if (numFiles == -1) { + return FALSE; + } + + /* delete everything in the directory */ + base = Unicode_Append(stagingDir, DIRSEPS); + + for (i = 0; i < numFiles; i++) { + Unicode curPath; + + curPath = Unicode_Append(base, fileList[i]); + + if (File_IsDirectory(curPath)) { + if (!File_DeleteDirectoryTree(curPath)) { + ret = FALSE; + } + } else { + if (File_Unlink(curPath) == -1) { + ret = FALSE; + } + } + + Unicode_Free(curPath); + } + + Unicode_Free(base); + } + + return ret; +} + +/* *---------------------------------------------------------------------------- * * DnDCreateRootStagingDirectory -- @@ -183,10 +251,10 @@ *---------------------------------------------------------------------------- */ -const char * +static ConstUnicode DnDCreateRootStagingDirectory(void) { - const char *root; + ConstUnicode root; /* * DnD_GetFileRoot() gives us a pointer to a static string, so there's no @@ -237,9 +305,9 @@ */ Bool -DnDDataContainsIllegalCharacters(const char *data, // IN: buffer - const size_t dataSize, // IN: size of buffer - const char *illegalChars) // IN: chars to look for +DnDDataContainsIllegalCharacters(const char *data, // IN: buffer + const size_t dataSize, // IN: size of buffer + const char *illegalChars) // IN: chars to look for { size_t i; @@ -275,8 +343,7 @@ * buffer containing the results. *srcSize is set to the size of the new * buffer, not including the NUL-terminator. * - * We can't simply use Str_Sprintf here because it calls FormatMessage on - * Win32 which doesn't play well with Unicode strings. + * The logic here and in the called functions appears to be UTF8-safe. * * Results: * TRUE on success, FALSE on failure. @@ -289,10 +356,10 @@ */ Bool -DnDPrependFileRoot(const char *fileRoot, // IN : file root to append - const char delimiter, // IN : delimiter for output buffer - char **src, // IN/OUT: NUL-delimited list of paths - size_t *srcSize) // IN/OUT: size of list +DnDPrependFileRoot(ConstUnicode fileRoot, // IN : file root to append + char delimiter, // IN : delimiter for output buffer + char **src, // IN/OUT: NUL-delimited list of paths + size_t *srcSize) // IN/OUT: size of list { char *newData = NULL; size_t newDataLen = 0; @@ -360,55 +427,6 @@ /* - *----------------------------------------------------------------------------- - * - * DnD_UTF8Asprintf -- - * - * Str_Asprintf should not be used with UTF-8 strings as it uses - * FormatMessage. This interprets UTF-8 strings as a string in the current - * locale giving wrong results. This function is otherwise funcationally - * equivalent to Str_Asprintf. The caller must first compute how large the - * output buffer needs to be and pass it in as outBufSize. - * - * Results: - * The allocated string on success. - * NULL on failure. - * - * Side effects: - * None. - * - *----------------------------------------------------------------------------- - */ - -char * -DnD_UTF8Asprintf(unsigned int outBufSize, // IN: size of output buffer - const char *format, // IN - ...) // IN -{ - va_list arguments; - char *buffer = NULL; - - ASSERT(format); - va_start(arguments, format); - - if (!(buffer = (char *)malloc(outBufSize))) { - Log("DnD_UTF8Asprintf: Error creating string.\n"); - goto exit; - } - - if (Str_Vsnprintf(buffer, outBufSize, format, arguments) < 0) { - Log("DnD_UTF8Asprintf: Error writing to string.\n"); - free (buffer); - buffer = NULL; - } - -exit: - va_end(arguments); - return buffer; -} - - -/* *---------------------------------------------------------------------------- * * DnD_LegacyConvertToCPName -- @@ -418,6 +436,8 @@ * this implementation must always convert from Windows path to CPName path, * regardless of the platform we are running on. * + * The logic here and in the called functions appears to be UTF8-safe. + * * Results: * On success, returns the number of bytes used in the cross-platform name, * NOT including the final terminating NUL character. On failure, returns @@ -562,25 +582,88 @@ /* *----------------------------------------------------------------------------- * + * DnD_CPNameListToDynBufArray -- + * + * Export CPName file list from binary buffer to DynBufArray. + * + * Results: + * TRUE if success, FALSE otherwise. + * + * Side effects: + * Memory may allocated for DynBufArray if success. + * + *----------------------------------------------------------------------------- + */ + +Bool +DnD_CPNameListToDynBufArray(char *fileList, // IN: CPName format + size_t listSize, // IN + DynBufArray *dynBufArray) // OUT +{ + DynBuf buf; + BufRead r; + int32 pathLen; + size_t count; + size_t i; + + ASSERT(fileList); + r.pos = fileList; + r.unreadLen = listSize; + + DynBufArray_Init(dynBufArray, 0); + + while (r.unreadLen > 0) { + DynBuf_Init(&buf); + if (!DnDReadBuffer(&r, &pathLen, sizeof pathLen) || + (pathLen > r.unreadLen) || + !DynBuf_Append(&buf, r.pos, pathLen)) { + goto error; + } + + if (!DnDSlideBuffer(&r, pathLen)) { + goto error; + } + + if (!DynBufArray_Push(dynBufArray, buf)) { + goto error; + } + } + return TRUE; + +error: + DynBuf_Destroy(&buf); + + count = DynBufArray_Count(dynBufArray); + for (i = 0; i < count; i++) { + DynBuf *b = DynArray_AddressOf(dynBufArray, i); + DynBuf_Destroy(b); + } + DynBufArray_SetCount(dynBufArray, 0); + DynBufArray_Destroy(dynBufArray); + return FALSE; +} + + +/* + *----------------------------------------------------------------------------- + * * DnD_GetLastDirName -- * * Try to get last directory name from a full path name. * * Results: - * size of dirName if success, 0 otherwise. + * The allocated Unicode string, or NULL on failure. * * Side effects: - * Memory may allocated for dirName if success. + * None. * *----------------------------------------------------------------------------- */ -size_t -DnD_GetLastDirName(const char *str, // IN: can be UTF-8 - size_t strSize, // IN - char **dirName) // OUT +Unicode +DnD_GetLastDirName(ConstUnicode str) // IN { - size_t end = strSize; + size_t end = strlen(str); size_t start; size_t res = 0; @@ -604,8 +687,352 @@ } res = end - start; - *dirName = (char *)Util_SafeMalloc(res + 1); - memcpy(*dirName, str + start, res); - (*dirName)[res] = '\0'; - return res; + return Unicode_AllocWithLength(str + start, res, STRING_ENCODING_UTF8); } + + +/* Transport layer big buffer support functions. */ + +/* + *----------------------------------------------------------------------------- + * + * DnD_TransportBufInit -- + * + * Initialize transport layer buffer with DnD message. + * + * Results: + * None. + * + * Side effects: + * Buffer memory is allocated. + * + *----------------------------------------------------------------------------- + */ + +void +DnD_TransportBufInit(DnDTransportBuffer *buf, // OUT + uint8 *msg, // IN + size_t msgSize, // IN + uint32 seqNum) // IN +{ + ASSERT(buf); + ASSERT(msgSize <= DNDMSG_MAX_ARGSZ); + + free(buf->buffer); + buf->buffer = Util_SafeMalloc(msgSize); + memcpy(buf->buffer, msg, msgSize); + buf->seqNum = seqNum; + buf->totalSize = msgSize; + buf->offset = 0; +} + + +/* + *----------------------------------------------------------------------------- + * + * DnD_TransportBufReset -- + * + * Reset transport layer buffer. + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +void +DnD_TransportBufReset(DnDTransportBuffer *buf) // IN/OUT +{ + ASSERT(buf); + + free(buf->buffer); + buf->buffer = NULL; + + buf->seqNum = 0; + buf->totalSize = 0; + buf->offset = 0; + buf->lastUpdateTime = 0; +} + + +/* + *----------------------------------------------------------------------------- + * + * DnD_TransportBufGetPacket -- + * + * Get a transport layer packet from transport layer buffer. + * + * Results: + * Transport layer packet size, or 0 if failed. + * + * Side effects: + * Memory may be allocated for packet. + * + *----------------------------------------------------------------------------- + */ + +size_t +DnD_TransportBufGetPacket(DnDTransportBuffer *buf, // IN/OUT + DnDTransportPacketHeader **packet) // OUT +{ + size_t payloadSize; + + ASSERT(buf); + + if (buf->totalSize < buf->offset) { + return 0; + } + + if ((buf->totalSize - buf->offset) > DND_MAX_TRANSPORT_PACKET_PAYLOAD_SIZE) { + payloadSize = DND_MAX_TRANSPORT_PACKET_PAYLOAD_SIZE; + } else { + payloadSize = buf->totalSize - buf->offset; + } + + *packet = (DnDTransportPacketHeader *)Util_SafeMalloc( + payloadSize + DND_TRANSPORT_PACKET_HEADER_SIZE); + (*packet)->type = DND_TRANSPORT_PACKET_TYPE_PAYLOAD; + (*packet)->seqNum = buf->seqNum; + (*packet)->totalSize = buf->totalSize; + (*packet)->payloadSize = payloadSize; + (*packet)->offset = buf->offset; + + memcpy((*packet)->payload, + buf->buffer + buf->offset, + payloadSize); + buf->offset += payloadSize; + + /* This time is used for timeout purpose. */ + Hostinfo_GetTimeOfDay(&buf->lastUpdateTime); + + return payloadSize + DND_TRANSPORT_PACKET_HEADER_SIZE; +} + + +/* + *----------------------------------------------------------------------------- + * + * DnD_TransportBufAppendPacket -- + * + * Put a received packet into transport layer buffer. + * + * Results: + * TRUE if success, FALSE otherwise. + * + * Side effects: + * Memory may be allocated for transport layer buffer. + * + *----------------------------------------------------------------------------- + */ + +Bool +DnD_TransportBufAppendPacket(DnDTransportBuffer *buf, // IN/OUT + DnDTransportPacketHeader *packet, // IN + size_t packetSize) // IN +{ + ASSERT(buf); + ASSERT(packetSize == (packet->payloadSize + DND_TRANSPORT_PACKET_HEADER_SIZE) && + packetSize <= DND_MAX_TRANSPORT_PACKET_SIZE && + (packet->payloadSize + packet->offset) <= packet->totalSize && + packet->totalSize <= DNDMSG_MAX_ARGSZ); + + if (packetSize != (packet->payloadSize + DND_TRANSPORT_PACKET_HEADER_SIZE) || + packetSize > DND_MAX_TRANSPORT_PACKET_SIZE || + (packet->payloadSize + packet->offset) > packet->totalSize || + packet->totalSize > DNDMSG_MAX_ARGSZ) { + goto error; + } + + /* + * If seqNum does not match, it means either this is the first packet, or there + * is a timeout in another side. Reset the buffer in all cases. + */ + if (buf->seqNum != packet->seqNum) { + DnD_TransportBufReset(buf); + } + + if (!buf->buffer) { + ASSERT(!packet->offset); + if (packet->offset) { + goto error; + } + buf->buffer = Util_SafeMalloc(packet->totalSize); + buf->totalSize = packet->totalSize; + buf->seqNum = packet->seqNum; + buf->offset = 0; + } + + if (buf->offset != packet->offset) { + goto error; + } + + memcpy(buf->buffer + buf->offset, + packet->payload, + packet->payloadSize); + buf->offset += packet->payloadSize; + return TRUE; + +error: + DnD_TransportBufReset(buf); + return FALSE; +} + + +/* + *----------------------------------------------------------------------------- + * + * DnD_TransportMsgToPacket -- + * + * Get a packet from small size message. + * + * Results: + * Transport layer packet size, or 0 if failed. + * + * Side effects: + * Memory may be allocated for packet. + * + *----------------------------------------------------------------------------- + */ + +size_t +DnD_TransportMsgToPacket(uint8 *msg, // IN + size_t msgSize, // IN + uint32 seqNum, // IN + DnDTransportPacketHeader **packet) // OUT +{ + size_t packetSize; + + ASSERT(msgSize > 0 && msgSize <= DND_MAX_TRANSPORT_PACKET_PAYLOAD_SIZE); + ASSERT(msg); + ASSERT(packet); + + if (msgSize <=0 || + msgSize > DND_MAX_TRANSPORT_PACKET_PAYLOAD_SIZE || + !msg || !packet) { + return 0; + } + + packetSize = msgSize + DND_TRANSPORT_PACKET_HEADER_SIZE; + + *packet = (DnDTransportPacketHeader *)Util_SafeMalloc(packetSize); + + (*packet)->type = DND_TRANSPORT_PACKET_TYPE_SINGLE; + (*packet)->seqNum = seqNum; + (*packet)->totalSize = msgSize; + (*packet)->payloadSize = msgSize; + (*packet)->offset = 0; + + memcpy((*packet)->payload, msg, msgSize); + + return packetSize; +} + + +/* + *----------------------------------------------------------------------------- + * + * DnD_TransportReqPacket -- + * + * Generate a request packet with empty payload. After got a payload, receive + * side should send a DND_TRANSPORT_PACKET_TYPE_REQUEST packet to ask for + * next payload packet. + * + * Results: + * Transport layer packet size. + * + * Side effects: + * Memory is allocated for packet. + * + *----------------------------------------------------------------------------- + */ + +size_t +DnD_TransportReqPacket(DnDTransportBuffer *buf, // IN + DnDTransportPacketHeader **packet) // OUT +{ + *packet = (DnDTransportPacketHeader *)Util_SafeMalloc( + DND_TRANSPORT_PACKET_HEADER_SIZE); + + (*packet)->type = DND_TRANSPORT_PACKET_TYPE_REQUEST; + (*packet)->seqNum = buf->seqNum; + (*packet)->totalSize = buf->totalSize; + (*packet)->payloadSize = 0; + (*packet)->offset = buf->offset; + return DND_TRANSPORT_PACKET_HEADER_SIZE; +} + + +/* + *---------------------------------------------------------------------------- + * + * DnDReadBuffer -- + * + * Copies len bytes of data from b to out. Subsequent calls to this + * function will copy data from the last unread point. + * + * Results: + * TRUE when data is successfully copies to out, FALSE otherwise. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +Bool +DnDReadBuffer(BufRead *b, // IN/OUT: buffer to read from + void *out, // OUT: the output buffer + size_t len) // IN: the amount to read +{ + ASSERT(b); + ASSERT(out); + + if (len > b->unreadLen) { + return FALSE; + } + + memcpy(out, b->pos, len); + if (!DnDSlideBuffer(b, len)) { + return FALSE; + } + + return TRUE; +} + + +/* + *---------------------------------------------------------------------------- + * + * DnDSlideBuffer -- + * + * Ignore len bytes of data in b. Subsequent calls to DnDReadBuffer will + * copy data from the last point. + * + * Results: + * TRUE when pos is successfully changed, FALSE otherwise. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +Bool +DnDSlideBuffer(BufRead *b, // IN/OUT: buffer to read from + size_t len) // IN: the amount to read +{ + ASSERT(b); + + if (len > b->unreadLen) { + return FALSE; + } + + b->pos += len; + b->unreadLen -= len; + + return TRUE; +} + diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/dnd/dndInt.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/dnd/dndInt.h --- open-vm-tools-2008.01.23-74039/lib/dnd/dndInt.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/dnd/dndInt.h 2008-10-13 08:01:51.000000000 +0100 @@ -0,0 +1,57 @@ +/********************************************************* + * Copyright (C) 2005 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. + * + *********************************************************/ + +/* + * dndInt.h -- + * + * Private functions for the Drag and Drop library. + */ + +#ifndef __DND_INT_H__ +#define __DND_INT_H__ + +#include "vm_basic_types.h" +#include "unicodeTypes.h" + +typedef struct { + uint8 *pos; + size_t unreadLen; +} BufRead; + +Bool DnDDataContainsIllegalCharacters(const char *data, + const size_t dataSize, + const char *illegalChars); + +Bool DnDPrependFileRoot(ConstUnicode fileRoot, + char delimiter, + char **src, + size_t *srcSize); + +Bool DnDRootDirUsable(ConstUnicode pathName); + +Bool DnDSetPermissionsOnRootDir(ConstUnicode pathName); + +Bool DnDStagingDirectoryUsable(ConstUnicode pathName); + +Bool DnDSetPermissionsOnStagingDir(ConstUnicode pathName); + +Bool DnDReadBuffer(BufRead *b, void *out, size_t len); + +Bool DnDSlideBuffer(BufRead *b, size_t len); + +#endif /* __DND_INT_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/dnd/dndLinux.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/dnd/dndLinux.c --- open-vm-tools-2008.01.23-74039/lib/dnd/dndLinux.c 2008-01-28 08:02:50.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/dnd/dndLinux.c 2008-10-13 08:01:51.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -29,8 +29,10 @@ #include #include +#include "vmware.h" #include "dndInt.h" #include "dnd.h" +#include "posix.h" #include "file.h" #include "strutil.h" #include "vm_assert.h" @@ -44,6 +46,7 @@ #define LOGLEVEL_MODULE dnd #include "loglevel_user.h" +#include "unicodeOperations.h" #define DND_ROOTDIR_PERMS (S_IRWXU | S_IRWXG | S_IRWXO) @@ -56,47 +59,6 @@ /* *----------------------------------------------------------------------------- * - * DnD_DeleteStagingFiles -- - * - * Attempts to delete all files in the filelist. - * - * Results: - * TRUE if all files were deleted. FALSE if there was an error. - * - * Side effects: - * None - * - *----------------------------------------------------------------------------- - */ - -Bool -DnD_DeleteStagingFiles(const char *fileList, // IN: - Bool onReboot) // IN: unused -{ - char* fileName; - unsigned int index = 0; - Bool ret = TRUE; - - ASSERT(fileList); - - while ((fileName = StrUtil_GetNextToken(&index, fileList, "|")) != NULL) { - if (File_IsFile(fileName)) { - File_Unlink(fileName); - } else if (File_IsDirectory(fileName)) { - File_DeleteDirectoryTree(fileName); - } else { - ret = FALSE; - } - free(fileName); - } - - return ret; -} - - -/* - *----------------------------------------------------------------------------- - * * DnD_GetFileRoot -- * * Gets the root path of the staging directory for DnD file transfers. @@ -110,11 +72,10 @@ *----------------------------------------------------------------------------- */ -const char * +ConstUnicode DnD_GetFileRoot(void) { - static char fileRoot[DND_MAX_PATH] = "/tmp/VMwareDnD/"; - return fileRoot; + return "/tmp/VMwareDnD/"; } @@ -386,7 +347,7 @@ } /* Open device node for communication with vmblock. */ - blockFd = open(VMBLOCK_DEVICE, VMBLOCK_DEVICE_MODE); + blockFd = Posix_Open(VMBLOCK_DEVICE, VMBLOCK_DEVICE_MODE); if (blockFd < 0) { LOG(1, ("DnD_InitializeBlocking: Can not open blocker device (%s)\n", strerror(errno))); @@ -518,11 +479,11 @@ */ Bool -DnDRootDirUsable(const char *dir) // IN +DnDRootDirUsable(ConstUnicode pathName) // IN: { struct stat buf; - if (stat(dir, &buf) < 0) { + if (Posix_Stat(pathName, &buf) < 0) { return FALSE; } @@ -551,9 +512,9 @@ */ Bool -DnDSetPermissionsOnRootDir(const char *dir) // IN +DnDSetPermissionsOnRootDir(ConstUnicode pathName) // IN: { - return chmod(dir, S_ISVTX | DND_ROOTDIR_PERMS) == 0; + return Posix_Chmod(pathName, S_ISVTX | DND_ROOTDIR_PERMS) == 0; } @@ -576,11 +537,11 @@ */ Bool -DnDStagingDirectoryUsable(const char *dir) // IN +DnDStagingDirectoryUsable(ConstUnicode pathName) // IN: { struct stat buf; - if (stat(dir, &buf) < 0) { + if (Posix_Stat(pathName, &buf) < 0) { return FALSE; } @@ -605,7 +566,7 @@ */ Bool -DnDSetPermissionsOnStagingDir(const char *dir) // IN +DnDSetPermissionsOnStagingDir(ConstUnicode pathName) // IN: { - return chmod(dir, DND_STAGINGDIR_PERMS) == 0; + return Posix_Chmod(pathName, DND_STAGINGDIR_PERMS) == 0; } diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/dnd/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/dnd/Makefile.am --- open-vm-tools-2008.01.23-74039/lib/dnd/Makefile.am 2008-01-28 08:02:49.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/dnd/Makefile.am 2008-10-13 08:01:48.000000000 +0100 @@ -20,6 +20,3 @@ libDnd_a_SOURCES = libDnd_a_SOURCES += dndCommon.c libDnd_a_SOURCES += dndLinux.c - -AM_CFLAGS = -AM_CFLAGS += @COMMON_CFLAGS@ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/dnd/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/dnd/Makefile.in --- open-vm-tools-2008.01.23-74039/lib/dnd/Makefile.in 2008-01-28 08:03:03.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/dnd/Makefile.in 2008-10-13 08:02:13.000000000 +0100 @@ -52,7 +52,10 @@ subdir = lib/dnd DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +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)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -64,7 +67,7 @@ am_libDnd_a_OBJECTS = dndCommon.$(OBJEXT) dndLinux.$(OBJEXT) libDnd_a_OBJECTS = $(am_libDnd_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp +depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -90,8 +93,6 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -COMMON_CFLAGS = @COMMON_CFLAGS@ -COMMON_PROG_CFLAGS = @COMMON_PROG_CFLAGS@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -102,45 +103,57 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ -ECHO = @ECHO@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GREP = @GREP@ -GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_AUTH_CFLAGS = @LIB_AUTH_CFLAGS@ -LIB_FILE_CFLAGS = @LIB_FILE_CFLAGS@ -LIB_HGFS_SERVER_CFLAGS = @LIB_HGFS_SERVER_CFLAGS@ -LIB_IMPERSONATE_CFLAGS = @LIB_IMPERSONATE_CFLAGS@ -LIB_MISC_CFLAGS = @LIB_MISC_CFLAGS@ -LIB_PROC_MGR_CFLAGS = @LIB_PROC_MGR_CFLAGS@ -LIB_STRING_CFLAGS = @LIB_STRING_CFLAGS@ -LIB_USER_CFLAGS = @LIB_USER_CFLAGS@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -148,27 +161,35 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ VERSION = @VERSION@ -VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -199,6 +220,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -215,7 +237,6 @@ top_srcdir = @top_srcdir@ noinst_LIBRARIES = libDnd.a libDnd_a_SOURCES = dndCommon.c dndLinux.c -AM_CFLAGS = @COMMON_CFLAGS@ all: all-am .SUFFIXES: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/dynxdr/dynxdr.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/dynxdr/dynxdr.c --- open-vm-tools-2008.01.23-74039/lib/dynxdr/dynxdr.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/dynxdr/dynxdr.c 2008-10-13 08:01:51.000000000 +0100 @@ -0,0 +1,385 @@ +/********************************************************* + * Copyright (C) 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. + * + *********************************************************/ + +#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 + + +/* + *----------------------------------------------------------------------------- + * + * 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); +} + + +#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 long *lp) // IN +{ + int32 out = htonl((int32)*lp); + DynXdrData *priv = (DynXdrData *) xdrs->x_private; + return DynBuf_Append(&priv->data, &out, sizeof out); +} + + +/* + *----------------------------------------------------------------------------- + * + * 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 */ + NULL, /* x_setpostn */ + NULL, /* 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); + } +} + diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/dynxdr/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/dynxdr/Makefile.am --- open-vm-tools-2008.01.23-74039/lib/dynxdr/Makefile.am 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/dynxdr/Makefile.am 2008-10-13 08:01:48.000000000 +0100 @@ -0,0 +1,23 @@ +################################################################################ +### Copyright 2008 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_LIBRARIES = libDynxdr.a + +libDynxdr_a_SOURCES = +libDynxdr_a_SOURCES += dynxdr.c +libDynxdr_a_SOURCES += xdrutil.c + diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/dynxdr/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/dynxdr/Makefile.in --- open-vm-tools-2008.01.23-74039/lib/dynxdr/Makefile.in 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/dynxdr/Makefile.in 2008-10-13 08:02:13.000000000 +0100 @@ -0,0 +1,495 @@ +# 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 2008 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)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) +ARFLAGS = cru +libDynxdr_a_AR = $(AR) $(ARFLAGS) +libDynxdr_a_LIBADD = +am_libDynxdr_a_OBJECTS = dynxdr.$(OBJEXT) xdrutil.$(OBJEXT) +libDynxdr_a_OBJECTS = $(am_libDynxdr_a_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_a_SOURCES) +DIST_SOURCES = $(libDynxdr_a_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_XLIBS = @COMMON_XLIBS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ +DNET_LIBS = @DNET_LIBS@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ +GTK_LIBS = @GTK_LIBS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ +HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ +MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ +RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ +VERSION = @VERSION@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +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@ +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@ +lt_ECHO = @lt_ECHO@ +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_LIBRARIES = libDynxdr.a +libDynxdr_a_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-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) +libDynxdr.a: $(libDynxdr_a_OBJECTS) $(libDynxdr_a_DEPENDENCIES) + -rm -f libDynxdr.a + $(libDynxdr_a_AR) libDynxdr.a $(libDynxdr_a_OBJECTS) $(libDynxdr_a_LIBADD) + $(RANLIB) libDynxdr.a + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dynxdr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xdrutil.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 $(LIBRARIES) +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-noinstLIBRARIES \ + 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-noinstLIBRARIES 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: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/dynxdr/xdrutil.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/dynxdr/xdrutil.c --- open-vm-tools-2008.01.23-74039/lib/dynxdr/xdrutil.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/dynxdr/xdrutil.c 2008-10-13 08:01:51.000000000 +0100 @@ -0,0 +1,69 @@ +/********************************************************* + * Copyright (C) 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. + * + *********************************************************/ + +/* + * xdrutil.c -- + * + * Utility functions for code that uses XDR to encode/decode data. + */ + +#include +#include +#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; +} + diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/err/err.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/err/err.c --- open-vm-tools-2008.01.23-74039/lib/err/err.c 2008-01-28 08:02:50.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/err/err.c 2008-10-13 08:01:51.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -23,11 +23,49 @@ * */ -#ifdef _WIN32 -# include "win32util.h" -#endif +#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 -#include "err.h" + +/* + * Types + */ + +typedef struct ErrInfo { + Err_Number number; + char *string; +} ErrInfo; + + +/* + * Variables + */ + +static Atomic_Ptr errNumTable; +static Atomic_Ptr errPtrTable; + +#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) +#ifdef VMX86_DEBUG +Atomic_Ptr errStrTable; +#define STRTABLE() HashTable_AllocOnce(&errStrTable, HASHTABLE_SIZE, \ + HASH_STRING_KEY | HASH_FLAG_ATOMIC, \ + NULL) +#endif /* @@ -42,6 +80,7 @@ * * Side effects: * None. + * Current error number is preserved. * *---------------------------------------------------------------------- */ @@ -51,3 +90,185 @@ { return Err_Errno2String(Err_Errno()); } + + +/* + *---------------------------------------------------------------------- + * + * Err_Errno2String -- + * + * Return a string that corresponds to the passed error number. + * + * 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); + +#ifdef VMX86_DEBUG + { + 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. + * + * 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 +{ + 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; +} +#endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/err/errInt.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/err/errInt.h --- open-vm-tools-2008.01.23-74039/lib/err/errInt.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/err/errInt.h 2008-10-13 08:01:51.000000000 +0100 @@ -0,0 +1,37 @@ +/********************************************************* + * Copyright (C) 2006 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_ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/err/errPosix.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/err/errPosix.c --- open-vm-tools-2008.01.23-74039/lib/err/errPosix.c 2008-01-28 08:02:50.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/err/errPosix.c 2008-10-13 08:01:51.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -25,31 +25,95 @@ #include #include +#include +#include "vmware.h" +#include "errInt.h" +#include "util.h" #include "str.h" -#include "err.h" /* *---------------------------------------------------------------------- * - * Err_Errno2String -- + * ErrErrno2String -- * - * Returns a string that corresponds to the passed error number. + * Convert an error number to a string in English. + * The returned string may use the supplied buffer or may be + * a static string. * * Results: - * Error message string. + * The error string. * * Side effects: * None. * - * The result should be printed or copied before calling again. - * *---------------------------------------------------------------------- */ const char * -Err_Errno2String(Err_Number errorNumber) // IN +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) + p = strerror_r(errorNumber, buf, bufSize); +#else + p = strerror(errorNumber); +#endif + ASSERT(p != NULL); + return p; +} + + +/* + *---------------------------------------------------------------------- + * + * Err_Errno2LocalString -- + * + * Returns a localized string in UTF-8 that corresponds to the + * passed error number. + * + * XXX doesn't actually work + * + * Results: + * Allocated error message string, caller must free. + * NULL on failure. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +char * +Err_Errno2LocalString(Err_Number errorNumber) // IN { - return strerror(errorNumber); + /* + * XXX The version of glibc (2.2.x) we use doesn't support + * uselocal() or strerror_l(), and we can't set LC_MESSAGES + * globally, so we can't implement this function. + * Instead, we return NULL and the upper level code + * (Msg_LocalizeList1) generates some sort of message. + * We can't do that here because it would require using + * Msg_Format, which is a layer violation (and a linking + * problem). + */ + +#if 0 + // XXX need to cache newLocale if we ever actually use this code + locale_t newLocale = newlocale(1 << LC_MESSAGES, NULL, NULL); + locale_t oldLocale = uselocale(newLocale); + char buf[2048]; + char *p; + + p = strerror_r(errorNumber, buf, sizeof buf); + ASSERT_NOT_IMPLEMENTED(p != NULL); + uselocale(oldLocale); + return Util_SafeStrdup(p); +#else + return NULL; +#endif } diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/err/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/err/Makefile.am --- open-vm-tools-2008.01.23-74039/lib/err/Makefile.am 2008-01-28 08:02:49.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/err/Makefile.am 2008-10-13 08:01:48.000000000 +0100 @@ -17,9 +17,6 @@ noinst_LIBRARIES = libErr.a -libErr_a_SOURCES = +libErr_a_SOURCES = libErr_a_SOURCES += err.c libErr_a_SOURCES += errPosix.c - -AM_CFLAGS = -AM_CFLAGS += @COMMON_CFLAGS@ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/err/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/err/Makefile.in --- open-vm-tools-2008.01.23-74039/lib/err/Makefile.in 2008-01-28 08:03:03.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/err/Makefile.in 2008-10-13 08:02:13.000000000 +0100 @@ -52,7 +52,10 @@ subdir = lib/err DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +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)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -64,7 +67,7 @@ am_libErr_a_OBJECTS = err.$(OBJEXT) errPosix.$(OBJEXT) libErr_a_OBJECTS = $(am_libErr_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp +depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -90,8 +93,6 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -COMMON_CFLAGS = @COMMON_CFLAGS@ -COMMON_PROG_CFLAGS = @COMMON_PROG_CFLAGS@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -102,45 +103,57 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ -ECHO = @ECHO@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GREP = @GREP@ -GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_AUTH_CFLAGS = @LIB_AUTH_CFLAGS@ -LIB_FILE_CFLAGS = @LIB_FILE_CFLAGS@ -LIB_HGFS_SERVER_CFLAGS = @LIB_HGFS_SERVER_CFLAGS@ -LIB_IMPERSONATE_CFLAGS = @LIB_IMPERSONATE_CFLAGS@ -LIB_MISC_CFLAGS = @LIB_MISC_CFLAGS@ -LIB_PROC_MGR_CFLAGS = @LIB_PROC_MGR_CFLAGS@ -LIB_STRING_CFLAGS = @LIB_STRING_CFLAGS@ -LIB_USER_CFLAGS = @LIB_USER_CFLAGS@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -148,27 +161,35 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ VERSION = @VERSION@ -VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -199,6 +220,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -215,7 +237,6 @@ top_srcdir = @top_srcdir@ noinst_LIBRARIES = libErr.a libErr_a_SOURCES = err.c errPosix.c -AM_CFLAGS = @COMMON_CFLAGS@ all: all-am .SUFFIXES: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/eventManager/eventManager.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/eventManager/eventManager.c --- open-vm-tools-2008.01.23-74039/lib/eventManager/eventManager.c 2008-01-28 08:02:50.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/eventManager/eventManager.c 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/eventManager/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/eventManager/Makefile.am --- open-vm-tools-2008.01.23-74039/lib/eventManager/Makefile.am 2008-01-28 08:02:49.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/eventManager/Makefile.am 2008-10-13 08:01:47.000000000 +0100 @@ -19,6 +19,3 @@ libEventManager_a_SOURCES = libEventManager_a_SOURCES += eventManager.c - -AM_CFLAGS = -AM_CFLAGS += @COMMON_CFLAGS@ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/eventManager/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/eventManager/Makefile.in --- open-vm-tools-2008.01.23-74039/lib/eventManager/Makefile.in 2008-01-28 08:03:03.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/eventManager/Makefile.in 2008-10-13 08:02:13.000000000 +0100 @@ -52,7 +52,10 @@ subdir = lib/eventManager DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +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)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -64,7 +67,7 @@ am_libEventManager_a_OBJECTS = eventManager.$(OBJEXT) libEventManager_a_OBJECTS = $(am_libEventManager_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp +depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -90,8 +93,6 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -COMMON_CFLAGS = @COMMON_CFLAGS@ -COMMON_PROG_CFLAGS = @COMMON_PROG_CFLAGS@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -102,45 +103,57 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ -ECHO = @ECHO@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GREP = @GREP@ -GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_AUTH_CFLAGS = @LIB_AUTH_CFLAGS@ -LIB_FILE_CFLAGS = @LIB_FILE_CFLAGS@ -LIB_HGFS_SERVER_CFLAGS = @LIB_HGFS_SERVER_CFLAGS@ -LIB_IMPERSONATE_CFLAGS = @LIB_IMPERSONATE_CFLAGS@ -LIB_MISC_CFLAGS = @LIB_MISC_CFLAGS@ -LIB_PROC_MGR_CFLAGS = @LIB_PROC_MGR_CFLAGS@ -LIB_STRING_CFLAGS = @LIB_STRING_CFLAGS@ -LIB_USER_CFLAGS = @LIB_USER_CFLAGS@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -148,27 +161,35 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ VERSION = @VERSION@ -VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -199,6 +220,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -215,7 +237,6 @@ top_srcdir = @top_srcdir@ noinst_LIBRARIES = libEventManager.a libEventManager_a_SOURCES = eventManager.c -AM_CFLAGS = @COMMON_CFLAGS@ all: all-am .SUFFIXES: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/file/file.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/file/file.c --- open-vm-tools-2008.01.23-74039/lib/file/file.c 2008-01-28 08:02:50.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/file/file.c 2008-10-13 08:01:51.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -43,6 +43,7 @@ #include "msg.h" #include "uuid.h" #include "config.h" +#include "posix.h" #include "file.h" #include "fileIO.h" #include "fileInt.h" @@ -55,7 +56,6 @@ #include "vm_atomic.h" #endif -#include "unicodeTypes.h" #include "unicodeOperations.h" #define SETUP_DEFINE_VARS @@ -73,8 +73,8 @@ * Check if a file exists. * * Results: - * TRUE if it exists - * FALSE if it doesn't exist + * TRUE file exists + * FALSE file doesn't exist or an error occured * * Side effects: * None @@ -83,7 +83,7 @@ */ Bool -File_Exists(ConstUnicode pathName) // IN: +File_Exists(ConstUnicode pathName) // IN: May be NULL. { return FileIO_IsSuccess(FileIO_Access(pathName, FILEIO_ACCESS_EXISTS)); } @@ -129,7 +129,8 @@ * Check if specified file is a directory or not. * * Results: - * Bool - TRUE -> is a directory, FALSE -> not a directory or error + * TRUE is a directory + * FALSE is not a directory or an error occured * * Side effects: * None @@ -148,48 +149,43 @@ /* - *---------------------------------------------------------------------------- + *---------------------------------------------------------------------- * - * File_IsCharDevice -- + * File_Unlink -- * - * 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. + * 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: - * TRUE if the file is char device FALSE otherwise. + * Return 0 if the unlink is successful. Otherwise, returns -1. * * Side effects: - * None + * The file is removed. * - *---------------------------------------------------------------------------- + *---------------------------------------------------------------------- */ -Bool -File_IsCharDevice(ConstUnicode pathName) // IN: +int +File_Unlink(ConstUnicode pathName) // IN: { - FileData fileData; - - return (FileAttributes(pathName, &fileData) == 0) && - (fileData.fileType == FILE_TYPE_CHARDEVICE); + return (FileDeletion(pathName, TRUE) == 0) ? 0 : -1; } - /* *---------------------------------------------------------------------- * - * File_Unlink -- - * - * Unlink the file. + * File_UnlinkNoFollow -- * - * 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. + * 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. + * Return 0 if the unlink is successful. Otherwise, returns -1. * * Side effects: * The file is removed. @@ -198,9 +194,9 @@ */ int -File_Unlink(ConstUnicode pathName) // IN: +File_UnlinkNoFollow(ConstUnicode pathName) // IN: { - return (FileDeletion(pathName, TRUE) == 0) ? 0 : -1; + return (FileDeletion(pathName, FALSE) == 0) ? 0 : -1; } @@ -209,7 +205,8 @@ * * File_GetModTime -- * - * Get the last modification time of a file. + * 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. @@ -223,13 +220,16 @@ int64 File_GetModTime(ConstUnicode pathName) // IN: { - FileData fileData; + int64 theTime; + struct stat statbuf; - if (FileAttributes(pathName, &fileData) != 0) { - return -1; + if (Posix_Stat(pathName, &statbuf) == 0) { + theTime = statbuf.st_mtime; + } else { + theTime = -1; } - return fileData.fileModificationTime; + return theTime; } @@ -259,6 +259,31 @@ /* *---------------------------------------------------------------------- * + * 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(ConstUnicode pathName) // IN: +{ + int res = FileCreateDirectory(pathName); + return ((0 == res) || (EEXIST == res)); +} + + +/* + *---------------------------------------------------------------------- + * * File_DeleteEmptyDirectory -- * * Deletes the specified directory if it is empty. @@ -288,10 +313,11 @@ * Return the old machineID, the one based on Hostinfo_MachineID. * * Results: - * The machineID is returned. + * The machineID is returned. It should not be freed. * * Side effects: - * None. + * Memory allocated for the machineID is never freed, however the + * memory is cached - there is no memory leak. * *---------------------------------------------------------------------- */ @@ -355,7 +381,7 @@ * fails drop back to the older machineID method. * * Results: - * The machineID is returned. + * The machineID is returned. It should not be freed. * * Side effects: * Memory allocated for the machineID is never freed, however the @@ -398,9 +424,9 @@ #endif if (q == NULL) { - p = (char *) GetOldMachineID(); + p = Util_SafeStrdup(GetOldMachineID()); } else { - p = Str_Asprintf(NULL, "uuid=%s", q); + p = Str_SafeAsprintf(NULL, "uuid=%s", q); free(q); /* Surpress any whitespace. */ @@ -570,7 +596,8 @@ * Check if specified file is a regular file. * * Results: - * Bool - TRUE -> is a regular file, FALSE -> not a regular file or error. + * TRUE is a regular file + * FALSE is not a regular file or an error occured. * * Side effects: * None @@ -591,27 +618,43 @@ /* *---------------------------------------------------------------------- * - * FileFindFirstSlash -- + * FileFirstSlashIndex -- * - * Finds the first pathname slash in a path (both slashes count for - * Win32, only forward slash for Unix). + * 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. * *---------------------------------------------------------------------- */ -static char * -FileFindFirstSlash(const char *path) // IN +static UnicodeIndex +FileFirstSlashIndex(ConstUnicode pathName, // IN: + UnicodeIndex startIndex) // IN: { - char *firstFS = Str_Strchr(path, '/'); + UnicodeIndex firstFS; +#if defined(_WIN32) + UnicodeIndex firstBS; +#endif + + ASSERT(pathName); + + firstFS = Unicode_FindSubstrInRange(pathName, startIndex, -1, + "/", 0, 1); + #if defined(_WIN32) - char *firstBS = Str_Strchr(path, '\\'); + firstBS = Unicode_FindSubstrInRange(pathName, startIndex, -1, + "\\", 0, 1); - if (firstFS && firstBS) { + if ((firstFS != UNICODE_INDEX_NOT_FOUND) && + (firstBS != UNICODE_INDEX_NOT_FOUND)) { return MIN(firstFS, firstBS); - } else if (firstFS) { - return firstFS; } else { - return firstBS; + return (firstFS == UNICODE_INDEX_NOT_FOUND) ? firstBS : firstFS; } #else return firstFS; @@ -622,27 +665,43 @@ /* *---------------------------------------------------------------------- * - * File_FindLastSlash -- + * FileLastSlashIndex -- + * + * Finds the last pathname slash index in a path (both slashes count + * for Win32, only forward slash for Unix). * - * Finds the last pathname slash in a path (both slashes count for - * Win32, only forward slash for Unix). + * Results: + * As described. + * + * Side effects: + * None. * *---------------------------------------------------------------------- */ -char * -File_FindLastSlash(const char *path) // IN +static UnicodeIndex +FileLastSlashIndex(ConstUnicode pathName, // IN: + UnicodeIndex startIndex) // IN: { - char *lastFS = Str_Strrchr(path, '/'); + UnicodeIndex lastFS; +#if defined(_WIN32) + UnicodeIndex lastBS; +#endif + + ASSERT(pathName); + + lastFS = Unicode_FindLastSubstrInRange(pathName, startIndex, -1, + "/", 0, 1); + #if defined(_WIN32) - char *lastBS = Str_Strrchr(path, '\\'); + lastBS = Unicode_FindLastSubstrInRange(pathName, startIndex, -1, + "\\", 0, 1); - if (lastFS && lastBS) { + if ((lastFS != UNICODE_INDEX_NOT_FOUND) && + (lastBS != UNICODE_INDEX_NOT_FOUND)) { return MAX(lastFS, lastBS); - } else if (lastFS) { - return lastFS; } else { - return lastBS; + return (lastFS == UNICODE_INDEX_NOT_FOUND) ? lastBS : lastFS; } #else return lastFS; @@ -685,80 +744,88 @@ */ 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; - char *basebegin; - char *volend; - int vollen, dirlen; - size_t len; +File_SplitName(ConstUnicode pathName, // IN: + Unicode *volume, // OUT (OPT): + Unicode *directory, // OUT (OPT): + Unicode *base) // OUT (OPT): +{ + Unicode vol; + Unicode dir; + Unicode bas; + UnicodeIndex volEnd; + UnicodeIndex length; + UnicodeIndex pathLen; + UnicodeIndex baseBegin; + + ASSERT(pathName); - ASSERT(pathname); - len = strlen(pathname); + pathLen = Unicode_LengthInCodeUnits(pathName); /* * Get volume. */ - volend = (char *) pathname; + volEnd = 0; #if defined(_WIN32) - if ((len > 2) && - (!Str_Strncmp("\\\\", pathname, 2) || - !Str_Strncmp("//", pathname, 2))) { + if ((pathLen > 2) && + (Unicode_StartsWith(pathName, "\\\\") || + Unicode_StartsWith(pathName, "//"))) { /* UNC path */ - volend = FileFindFirstSlash(volend + 2); + volEnd = FileFirstSlashIndex(pathName, 2); - if (volend) { - volend = FileFindFirstSlash(volend + 1); + if (volEnd == UNICODE_INDEX_NOT_FOUND) { + /* we have \\foo, which is just bogus */ + volEnd = 0; + } else { + volEnd = FileFirstSlashIndex(pathName, volEnd + 1); - if (!volend) { + if (volEnd == UNICODE_INDEX_NOT_FOUND) { /* we have \\foo\bar, which is legal */ - volend = (char *) pathname + len; + volEnd = pathLen; } - - } else { - /* we have \\foo, which is just bogus */ - volend = (char *) pathname; } - } else if ((len >= 2) && (':' == pathname[1])) { - // drive-letter path - volend = (char *) pathname + 2; + } else if ((pathLen >= 2) && + (Unicode_FindSubstrInRange(pathName, 1, 1, ":", 0, + 1) != UNICODE_INDEX_NOT_FOUND)) { + /* drive-letter path */ + volEnd = 2; } -#endif /* _WIN32 */ - vollen = volend - pathname; - vol = Util_SafeMalloc(vollen + 1); - memcpy(vol, pathname, vollen); - vol[vollen] = 0; + if (volEnd > 0) { + vol = Unicode_Substr(pathName, 0, volEnd); + } else { + vol = Unicode_Duplicate(""); + } +#else + vol = Unicode_Duplicate(""); +#endif /* _WIN32 */ /* * Get base. */ - basebegin = File_FindLastSlash(pathname); - basebegin = (basebegin ? basebegin + 1 : (char *) pathname); + baseBegin = FileLastSlashIndex(pathName, 0); + baseBegin = (baseBegin == UNICODE_INDEX_NOT_FOUND) ? 0 : baseBegin + 1; - if (basebegin < volend) { - basebegin = (char *) pathname + len; + if (baseBegin >= volEnd) { + bas = Unicode_Substr(pathName, baseBegin, -1); + } else { + bas = Unicode_Duplicate(""); } - bas = Util_SafeStrdup(basebegin); - /* * Get dir. */ - dirlen = basebegin - volend; - dir = Util_SafeMalloc(dirlen + 1); - memcpy(dir, volend, dirlen); - dir[dirlen] = 0; - + length = baseBegin - volEnd; + + if (length > 0) { + dir = Unicode_Substr(pathName, volEnd, length); + } else { + dir = Unicode_Duplicate(""); + } + /* * Return what needs to be returned. */ @@ -766,19 +833,19 @@ if (volume) { *volume = vol; } else { - free(vol); + Unicode_Free(vol); } if (directory) { *directory = dir; } else { - free(dir); + Unicode_Free(dir); } if (base) { *base = bas; } else { - free(bas); + Unicode_Free(bas); } } @@ -811,41 +878,114 @@ */ void -File_GetPathName(const char *fullpath, // IN - char **pathname, // OUT (OPT) - char **base) // OUT (OPT) -{ - char *volume = NULL; - char *p; +File_GetPathName(ConstUnicode fullPath, // IN: + Unicode *pathName, // OUT (OPT): + Unicode *baseName) // OUT (OPT): +{ + Unicode volume; + UnicodeIndex len; + UnicodeIndex curLen; - File_SplitName(fullpath, &volume, pathname, base); - if (!pathname) { - free(volume); + File_SplitName(fullPath, &volume, pathName, baseName); + + if (pathName == NULL) { + Unicode_Free(volume); return; } /* - * volume component may be empty. + * The volume component may be empty. */ - if (volume) { - if (volume[0] != '\0') { - char *volPathname = Str_Asprintf(NULL, "%s%s", volume, *pathname); - free(*pathname); - *pathname = volPathname; - } - free(volume); + if (Unicode_LengthInCodeUnits(volume) > 0) { + Unicode temp; + + temp = Unicode_Append(volume, *pathName); + Unicode_Free(*pathName); + *pathName = temp; + } + Unicode_Free(volume); + + /* + * Remove any trailing directory separator characters. + */ + + len = Unicode_LengthInCodeUnits(*pathName); + + curLen = len; + + while ((curLen > 0) && + (FileFirstSlashIndex(*pathName, curLen - 1) == curLen - 1)) { + curLen--; + } + + if (curLen < len) { + Unicode temp; + + temp = Unicode_Substr(*pathName, 0, curLen); + Unicode_Free(*pathName); + *pathName = temp; } +} +/* + *---------------------------------------------------------------------- + * + * File_StripSlashes -- + * + * Strip trailing slashes from the end of a path. + * + * Results: + * The stripped filename. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +Unicode +File_StripSlashes(ConstUnicode path) // IN +{ + Unicode result, volume, dir, base; + /* - * Check for a trailing directory separator, remove it. + * 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. */ - p = Str_Strrchr(*pathname, DIRSEPC); - if (p != NULL) { - if (p == (*pathname + strlen(*pathname) - 1)) { - *p = '\0'; + + 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. + */ +#ifdef _WIN32 + while ((i > 1) && (('/' == dir2[i - 1]) || + ('\\' == dir2[i - 1]))) { +#else + while ((i > 0) && ('/' == dir2[i - 1])) { +#endif + i--; } + + Unicode_Free(dir); + dir = Unicode_AllocWithLength(dir2, i, STRING_ENCODING_UTF8); + free(dir2); } + + result = Unicode_Join(volume, dir, base, NULL); + + Unicode_Free(volume); + Unicode_Free(dir); + Unicode_Free(base); + + return result; } @@ -863,25 +1003,25 @@ * 'fileName' specifies the base filename of the created file. * * Results: - * Open file descriptor or -1; if successful then filename points + * 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. + * Creates a file if successful. Errno is set on error * *---------------------------------------------------------------------- */ int -File_MakeTempEx(ConstUnicode dir, // IN - ConstUnicode fileName, // IN - Unicode *presult) // OUT +File_MakeTempEx(ConstUnicode dir, // IN: + ConstUnicode fileName, // IN: + Unicode *presult) // OUT: { + int fd; + int err; uint32 var; - Unicode temp; - int fd = -1; Unicode path = NULL; Unicode basePath = NULL; @@ -895,50 +1035,50 @@ *presult = NULL; /* construct base full pathname to use */ - temp = Unicode_Append(dir, U(DIRSEPS)); - basePath = Unicode_Append(temp, fileName); - Unicode_Free(temp); + basePath = Unicode_Join(dir, DIRSEPS, fileName, NULL); - for (var = 0; var <= 0xFFFFFFFF; var++) { - char string[16]; + for (var = 0; var < 0xFFFFFFFF; var++) { + Unicode temp; /* construct suffixed pathname to use */ Unicode_Free(path); - Str_Sprintf(string, sizeof string, "%d", var); - temp = Unicode_Alloc(string, STRING_ENCODING_US_ASCII); + temp = Unicode_Format("%d", var); + ASSERT_MEM_ALLOC(temp); path = Unicode_Append(basePath, temp); Unicode_Free(temp); - fd = FileIO_PosixOpen(path, - O_CREAT | O_EXCL | O_BINARY | O_RDWR, - 0600); + fd = Posix_Open(path, O_CREAT | O_EXCL | O_BINARY | O_RDWR, 0600); - if (fd >= 0) { + if (fd != -1) { *presult = path; path = NULL; break; } if (errno != EEXIST) { -// XXX unicode "string" in message + err = errno; Msg_Append(MSGID(file.maketemp.openFailed) "Failed to create temporary file \"%s\": %s.\n", - path, Msg_ErrString()); + UTF8(path), Msg_ErrString()); + errno = err; goto exit; } } - if (-1 == fd) { -// XXX unicode "string" in message + if (fd == -1) { Msg_Append(MSGID(file.maketemp.fullNamespace) "Failed to create temporary file \"%s\": The name space is " - "full.\n", path); + "full.\n", UTF8(path)); + + errno = EAGAIN; } exit: + err = errno; Unicode_Free(basePath); Unicode_Free(path); + errno = err; return fd; } @@ -977,44 +1117,34 @@ * file. * * Side effects: - * Creates a file if successful. + * Creates a file if successful. Errno is set on error * *---------------------------------------------------------------------- */ int -File_MakeTemp(const char *tag, // IN (OPT): +File_MakeTemp(ConstUnicode tag, // IN (OPT): Unicode *presult) // OUT: { - char *dir = NULL, *fileName = NULL; - int fd = -1; - - *presult = NULL; + int fd; + int err; + Unicode dir; + Unicode fileName; if (tag && File_IsFullPath(tag)) { - char *lastSlash; - - dir = Util_SafeStrdup(tag); - lastSlash = Str_Strrchr(dir, DIRSEPC); - ASSERT(lastSlash); - - fileName = Util_SafeStrdup(lastSlash + 1); - *lastSlash = 0; + File_GetPathName(tag, &dir, &fileName); } else { dir = File_GetTmpDir(TRUE); - - if (!dir) { - goto exit; - } - - fileName = Util_SafeStrdup(tag ? tag : "vmware"); + fileName = Unicode_Duplicate(tag ? tag : "vmware"); } fd = File_MakeTempEx(dir, fileName, presult); + err = errno; - exit: - free(dir); - free(fileName); + Unicode_Free(dir); + Unicode_Free(fileName); + + errno = err; return fd; } @@ -1107,10 +1237,9 @@ fret = File_CreatePrompt(&dst, dstName, 0, dstDispose); if (!FileIO_IsSuccess(fret)) { if (fret != FILEIO_CANCELLED) { -// XXX unicode "string" in message Msg_Append(MSGID(File.CopyFromFdToName.create.failure) - "Unable to create a new '%s' file: %s.\n\n", dstName, - FileIO_MsgError(fret)); + "Unable to create a new '%s' file: %s.\n\n", + UTF8(dstName), FileIO_MsgError(fret)); } return FALSE; @@ -1119,9 +1248,8 @@ result = File_CopyFromFdToFd(src, dst); if (FileIO_Close(&dst) != 0) { -// XXX unicode "string" in message Msg_Append(MSGID(File.CopyFromFdToName.close.failure) - "Unable to close the '%s' file: %s.\n\n", dstName, + "Unable to close the '%s' file: %s.\n\n", UTF8(dstName), Msg_ErrString()); result = FALSE; } @@ -1159,6 +1287,7 @@ FileIOOpenAction action; FileIOResult fret; + ASSERT(file); ASSERT(pathName); action = FILEIO_OPEN_CREATE_SAFE; @@ -1173,7 +1302,6 @@ }; int answer; -// XXX unicode "string" in message answer = (prompt != -1) ? prompt : Msg_Question(buttons, 2, MSGID(File.CreatePrompt.question) "The file '%s' already exists.\n" @@ -1181,7 +1309,7 @@ "To retry the operation after you have moved the file " "to another location, select Retry.\n" "To cancel the operation, select Cancel.\n", - pathName); + UTF8(pathName)); if (answer == 2) { fret = FILEIO_CANCELLED; break; @@ -1235,19 +1363,17 @@ fret = FileIO_Open(&src, srcName, FILEIO_OPEN_ACCESS_READ, FILEIO_OPEN); if (!FileIO_IsSuccess(fret)) { -// XXX unicode "string" in message Msg_Append(MSGID(File.CopyFromNameToName.open.failure) "Unable to open the '%s' file for read access: %s.\n\n", - srcName, FileIO_MsgError(fret)); + UTF8(srcName), FileIO_MsgError(fret)); return FALSE; } result = File_CopyFromFdToName(src, dstName, dstDispose); if (FileIO_Close(&src) != 0) { -// XXX unicode "string" in message Msg_Append(MSGID(File.CopyFromNameToName.close.failure) - "Unable to close the '%s' file: %s.\n\n", srcName, + "Unable to close the '%s' file: %s.\n\n", UTF8(srcName), Msg_ErrString()); result = FALSE; } @@ -1293,9 +1419,8 @@ fret = FileIO_Open(&dst, dstName, FILEIO_OPEN_ACCESS_WRITE, action); if (!FileIO_IsSuccess(fret)) { -// XXX unicode "string" in message Msg_Append(MSGID(File.CopyFromFdToName.create.failure) - "Unable to create a new '%s' file: %s.\n\n", dstName, + "Unable to create a new '%s' file: %s.\n\n", UTF8(dstName), FileIO_MsgError(fret)); return FALSE; } @@ -1303,9 +1428,8 @@ result = File_CopyFromFdToFd(src, dst); if (FileIO_Close(&dst) != 0) { -// XXX unicode "string" in message Msg_Append(MSGID(File.CopyFromFdToName.close.failure) - "Unable to close the '%s' file: %s.\n\n", dstName, + "Unable to close the '%s' file: %s.\n\n", UTF8(dstName), Msg_ErrString()); result = FALSE; } @@ -1350,20 +1474,18 @@ fret = FileIO_Open(&src, srcName, FILEIO_OPEN_ACCESS_READ, FILEIO_OPEN); if (!FileIO_IsSuccess(fret)) { -// XXX unicode "string" in message Msg_Append(MSGID(File.Copy.open.failure) "Unable to open the '%s' file for read access: %s.\n\n", - srcName, FileIO_MsgError(fret)); + UTF8(srcName), FileIO_MsgError(fret)); return FALSE; } result = File_CopyFromFd(src, dstName, overwriteExisting); if (FileIO_Close(&src) != 0) { -// XXX unicode "string" in message Msg_Append(MSGID(File.Copy.close.failure) - "Unable to close the '%s' file: %s.\n\n", srcName, - Msg_ErrString()); + "Unable to close the '%s' file: %s.\n\n", UTF8(srcName), + Msg_ErrString()); result = FALSE; } @@ -1455,9 +1577,11 @@ int64 File_GetSize(ConstUnicode pathName) // IN: { - int64 ret = -1; + int64 ret; - if (pathName != NULL) { + if (pathName == NULL) { + ret = -1; + } else { FileIODescriptor fd; FileIOResult res; @@ -1467,6 +1591,8 @@ if (FileIO_IsSuccess(res)) { ret = FileIO_GetSize(&fd); FileIO_Close(&fd); + } else { + ret = -1; } } @@ -1493,9 +1619,9 @@ */ Bool -File_SupportsLargeFiles(const char *filePath) // IN +File_SupportsLargeFiles(ConstUnicode pathName) // IN: { - return File_SupportsFileSize(filePath, CONST64U(0x100000000)); + return File_SupportsFileSize(pathName, CONST64U(0x100000000)); } @@ -1519,13 +1645,7 @@ int64 File_GetSizeByPath(ConstUnicode pathName) { - int64 ret = -1; - - if (pathName != NULL) { - ret = FileIO_GetSizeByPath(pathName); - } - - return ret; + return (pathName == NULL) ? -1 : FileIO_GetSizeByPath(pathName); } @@ -1546,57 +1666,62 @@ */ Bool -File_CreateDirectoryHierarchy(char const *pathName) +File_CreateDirectoryHierarchy(ConstUnicode pathName) { - char *volume; - char *parent; - char *sep; - char sepContents; - Bool success = FALSE; + Unicode volume; + UnicodeIndex index; + UnicodeIndex length; + + if (pathName == NULL) { + return TRUE; + } - if (!pathName || !pathName[0]) { + length = Unicode_LengthInCodeUnits(pathName); + + if (length == 0) { return TRUE; } /* * Skip past any volume/share. */ - parent = Util_SafeStrdup(pathName); + File_SplitName(pathName, &volume, NULL, NULL); - sep = parent + strlen(volume); - free(volume); - if (sep >= parent + strlen(parent)) { - return FALSE; + + index = Unicode_LengthInCodeUnits(volume); + + Unicode_Free(volume); + + if (index >= length) { + return File_IsDirectory(pathName); } /* * Iterate parent directories, splitting on appropriate dir separators. */ - while ((sep = FileFindFirstSlash(sep + 1)) != NULL) { - /* - * Temporarily terminate string here so we can check if this parent - * exists, and create it if not. - */ + while (TRUE) { + Bool failed; + Unicode temp; + + index = FileFirstSlashIndex(pathName, index + 1); - sepContents = *sep; - *sep = 0; - if (!File_IsDirectory(parent) && !File_CreateDirectory(parent)) { - goto fail; + if (index == UNICODE_INDEX_NOT_FOUND) { + break; } - /* - * Restore string and continue walking parents. - */ + temp = Unicode_Substr(pathName, 0, index); - *sep = sepContents; - } + failed = !File_IsDirectory(temp) && !File_CreateDirectory(temp); + + Unicode_Free(temp); - success = File_IsDirectory(pathName) || File_CreateDirectory(pathName); + if (failed) { + return FALSE; + } + } - fail: - free(parent); - return success; + return File_IsDirectory(pathName) || File_CreateDirectory(pathName); } @@ -1619,42 +1744,33 @@ */ Bool -File_DeleteDirectoryTree(char const *pathName) // IN: directory to delete +File_DeleteDirectoryTree(ConstUnicode pathName) // IN: directory to delete { - Bool succeeded = FALSE, sawFileError = FALSE; - char **fileList = NULL; - DynBuf b; - int i, numFiles = 0; + int i; + int numFiles; + Unicode base; - DynBuf_Init(&b); + Unicode *fileList = NULL; + Bool sawFileError = FALSE; if (!File_Exists(pathName)) { - succeeded = TRUE; - goto exit; + return TRUE; } /* get list of files in current directory */ numFiles = File_ListDirectory(pathName, &fileList); - if (-1 == numFiles) { - goto exit; + if (numFiles == -1) { + return FALSE; } /* delete everything in the directory */ - for (i = 0; i < numFiles; i++) { - const char *curPath; + base = Unicode_Append(pathName, DIRSEPS); - /* construct path to this file */ - DynBuf_SetSize(&b, 0); - - if (!DynBuf_Append(&b, pathName, strlen(pathName)) || - !DynBuf_Append(&b, DIRSEPS, 1) || - !DynBuf_Append(&b, fileList[i], strlen(fileList[i])) || - !DynBuf_Append(&b, "\0", 1)) { - goto exit; - } + for (i = 0; i < numFiles; i++) { + Unicode curPath; - curPath = (const char *) DynBuf_Get(&b); + curPath = Unicode_Append(base, fileList[i]); if (File_IsDirectory(curPath)) { /* is dir, recurse */ @@ -1663,33 +1779,28 @@ } } else { /* is file, delete */ - if (-1 == File_Unlink(curPath)) { + if (File_Unlink(curPath) == -1) { sawFileError = TRUE; } } + + Unicode_Free(curPath); } + Unicode_Free(base); + /* delete the now-empty directory */ if (!File_DeleteEmptyDirectory(pathName)) { sawFileError = TRUE; } - if (!sawFileError) { - succeeded = TRUE; + for (i = 0; i < numFiles; i++) { + Unicode_Free(fileList[i]); } - exit: - DynBuf_Destroy(&b); - - if (fileList) { - for (i = 0; i < numFiles; i++) { - free(fileList[i]); - } - - free(fileList); - } + free(fileList); - return succeeded; + return !sawFileError; } @@ -1723,9 +1834,8 @@ ASSERT(searchPath); ASSERT(elem); - newPath = Str_Asprintf(NULL, "%s" FILE_SEARCHPATHTOKEN "%s", + newPath = Str_SafeAsprintf(NULL, "%s" FILE_SEARCHPATHTOKEN "%s", elem, searchPath); - ASSERT_MEM_ALLOC(newPath); n = strlen(elem); path = newPath + n + 1; @@ -1792,7 +1902,7 @@ if (File_IsFullPath(fileIn)) { cur = Util_SafeStrdup(fileIn); } else { - cur = Str_Asprintf(NULL, "%s"DIRSEPS"%s", cwd, fileIn); + cur = Str_SafeAsprintf(NULL, "%s"DIRSEPS"%s", cwd, fileIn); } if (File_Exists(cur)) { @@ -1812,15 +1922,15 @@ while (tok) { if (File_IsFullPath(tok)) { /* Fully Qualified Path. Use it. */ - cur = Str_Asprintf(NULL, "%s%s%s", tok, DIRSEPS, file); + 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_Asprintf(NULL, "%s"DIRSEPS"%s", cwd, file); + cur = Str_SafeAsprintf(NULL, "%s"DIRSEPS"%s", cwd, file); } else { - cur = Str_Asprintf(NULL, "%s"DIRSEPS"%s"DIRSEPS"%s", cwd, - tok, file); + cur = Str_SafeAsprintf(NULL, "%s"DIRSEPS"%s"DIRSEPS"%s", cwd, + tok, file); } } @@ -1856,14 +1966,22 @@ * * File_ReplaceExtension -- * - * Replaces the extension in input with newExtension as long as it is - * listed in ... + * 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. - * If the extension is not found the newExtension is just appended. * * Results: - * The name with newExtension added to it. + * The name with newExtension added to it. The caller is responsible to + * free it when they are done with it. * * Side effects: * None. @@ -1871,42 +1989,72 @@ *----------------------------------------------------------------------------- */ -char * -File_ReplaceExtension(const char *input, // IN - const char *newExtension, // IN - int numExtensions, // IN - ...) // IN -{ - char *p; - char *temp; - char *out; - int i; +Unicode +File_ReplaceExtension(ConstUnicode pathName, // IN: + ConstUnicode newExtension, // IN: + uint32 numExtensions, // IN: + ...) // IN: +{ + Unicode path; + Unicode base; + Unicode result; va_list arguments; + UnicodeIndex index; + + ASSERT(pathName); + ASSERT(newExtension); + ASSERT(Unicode_StartsWith(newExtension, ".")); - va_start(arguments, numExtensions); + File_GetPathName(pathName, &path, &base); - ASSERT(input); - ASSERT(newExtension); - ASSERT(newExtension[0] == '.'); + index = Unicode_FindLast(base, "."); + + if (index != UNICODE_INDEX_NOT_FOUND) { + Unicode oldBase = base; + + if (numExtensions) { + uint32 i; + + /* + * Only truncate the old extension from the base if it exists in + * in the valid extensions list. + */ - temp = Util_SafeStrdup(input); - p = strrchr(temp, '.'); - if (p != NULL) { - for (i = 0; i < numExtensions ; i++) { - char *oldExtension = va_arg(arguments, char *); - ASSERT(oldExtension[0] == '.'); - if (strcmp(p, oldExtension) == 0) { - *p = '\0'; - break; + va_start(arguments, numExtensions); + + for (i = 0; i < numExtensions ; i++) { + Unicode oldExtension = va_arg(arguments, Unicode); + + ASSERT(Unicode_StartsWith(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) { + Unicode_Free(oldBase); } } - out = Str_Asprintf(NULL, "%s%s", temp, newExtension); - free(temp); - ASSERT_MEM_ALLOC(out); - va_end(arguments); - return out; + if (Unicode_IsEmpty(path)) { + result = Unicode_Append(base, newExtension); + } else { + result = Unicode_Join(path, DIRSEPS, base, newExtension, NULL); + } + + Unicode_Free(path); + Unicode_Free(base); + + return result; } diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/file/fileInt.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/file/fileInt.h --- open-vm-tools-2008.01.23-74039/lib/file/fileInt.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/file/fileInt.h 2008-10-13 08:01:51.000000000 +0100 @@ -0,0 +1,244 @@ +/********************************************************* + * Copyright (C) 2007 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 "posix.h" +#include "fileIO.h" +#include "fileLock.h" +#include "unicodeTypes.h" + +#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 AFFS_SUPER_MAGIC 0xADFF +#define EXT_SUPER_MAGIC 0x137D +#define EXT2_OLD_SUPER_MAGIC 0xEF51 +#define EXT2_SUPER_MAGIC 0xEF53 +#define HFSPLUS_SUPER_MAGIC 0x482B +#define NFS_SUPER_MAGIC 0x6969 +#define SMB_SUPER_MAGIC 0x517B + +#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 + +#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; + +#if defined(_WIN32) +EXTERN int FileMapErrorToErrno(char *functionName, + DWORD status); + +EXTERN Bool FileRetryThisError(DWORD error, + uint32 numCodes, + DWORD *codes); + +EXTERN int FileAttributesRetry(ConstUnicode pathName, + uint32 retries, + FileData *fileData); + +EXTERN int FileRenameRetry(ConstUnicode fromPath, + ConstUnicode toPath, + uint32 retries); + +EXTERN int FileDeletionRetry(ConstUnicode pathName, + Bool handleLink, + uint32 retries); + +EXTERN int FileCreateDirectoryRetry(ConstUnicode pathName, + uint32 retries); + +EXTERN int FileRemoveDirectoryRetry(ConstUnicode pathName, + uint32 retries); + +EXTERN int FileListDirectoryRetry(ConstUnicode pathName, + uint32 retries, + Unicode **ids); + +#define FileAttributes(a, b) FileAttributesRetry((a), 0, (b)) +#define FileRename(a, b) FileRenameRetry((a), (b), 0) +#define FileDeletion(a, b) FileDeletionRetry((a), (b), 0) +#define FileCreateDirectory(a) FileCreateDirectoryRetry((a), 0) +#define FileRemoveDirectory(a) FileRemoveDirectoryRetry((a), 0) + +#define FileListDirectoryRobust(a, b) FileListDirectoryRetry((a), 5, (b)) +#define FileAttributesRobust(a, b) FileAttributesRetry((a), 5, (b)) +#define FileRenameRobust(a, b) FileRenameRetry((a), (b), 5) +#define FileDeletionRobust(a, b) FileDeletionRetry((a), (b), 5) +#define FileCreateDirectoryRobust(a) FileCreateDirectoryRetry((a), 5) +#define FileRemoveDirectoryRobust(a) FileRemoveDirectoryRetry((a), 5) +#else +EXTERN char *FilePosixGetBlockDevice(char const *path); + +EXTERN int FileAttributes(ConstUnicode pathName, + FileData *fileData); + +EXTERN int FileRename(ConstUnicode fromPath, + ConstUnicode toPath); + +EXTERN int FileDeletion(ConstUnicode pathName, + Bool handleLink); + +EXTERN int FileCreateDirectory(ConstUnicode pathName); + +EXTERN int FileRemoveDirectory(ConstUnicode pathName); + +#define FileListDirectoryRobust(a, b) File_ListDirectory((a), (b)) +#define FileAttributesRobust(a, b) FileAttributes((a), (b)) +#define FileRenameRobust(a, b) FileRename((a), (b)) +#define FileDeletionRobust(a, b) FileDeletion((a), (b)) +#define FileCreateDirectoryRobust(a) FileCreateDirectory((a)) +#define FileRemoveDirectoryRobust(a) FileRemoveDirectory((a)) +#endif + +typedef struct active_lock +{ + struct active_lock *next; + uint32 age; + Bool marked; + Unicode dirName; +} ActiveLock; + +typedef struct lock_values +{ + char *machineID; + char *executionID; + char *payload; + char *lockType; + char *locationChecksum; + Unicode memberName; + unsigned int lamportNumber; + uint32 waitTime; + uint32 msecMaxWaitTime; + ActiveLock *lockList; +} LockValues; + +#include "file_extensions.h" + +#define FILELOCK_SUFFIX "." LOCK_FILE_EXTENSION + +#define FILELOCK_DATA_SIZE 512 + +#if defined(_WIN32) +typedef HANDLE FILELOCK_FILE_HANDLE; +#else +typedef int FILELOCK_FILE_HANDLE; +#endif + +EXTERN const char *FileLockGetMachineID(void); + +EXTERN char *FileLockGetExecutionID(void); + +EXTERN Bool FileLockMachineIDMatch(char *host, + char *second); + +EXTERN int FileLockMemberValues(ConstUnicode lockDir, + ConstUnicode fileName, + char *buffer, + uint32 size, + LockValues *memberValues); + +EXTERN int FileLockHackVMX(ConstUnicode filePathName); + +EXTERN int FileLockOpenFile(ConstUnicode pathName, + int flags, + FILELOCK_FILE_HANDLE *handle); + +EXTERN int FileLockCloseFile(FILELOCK_FILE_HANDLE handle); + +EXTERN int FileLockReadFile(FILELOCK_FILE_HANDLE handle, + void *buf, + uint32 requestedBytes, + uint32 *resultantBytes); + +EXTERN int FileLockWriteFile(FILELOCK_FILE_HANDLE handle, + void *buf, + uint32 requestedBytes, + uint32 *resultantBytes); + +EXTERN void *FileLockIntrinsic(ConstUnicode filePathName, + Bool exclusivity, + uint32 msecMaxWaitTime, + const char *payload, + int *err); + +EXTERN int FileUnlockIntrinsic(ConstUnicode filePathName, + const void *lockToken); + +EXTERN Bool FileLockValidOwner(const char *executionID, + const char *payload); + +EXTERN Bool FileLockValidName(ConstUnicode fileName); + +#if defined(__APPLE__) +EXTERN int PosixFileOpener(ConstUnicode pathName, + int flags, + mode_t mode); +#else +#define PosixFileOpener(a, b, c) Posix_Open(a, b, c); +#endif + +#endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/file/fileIO.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/file/fileIO.c --- open-vm-tools-2008.01.23-74039/lib/file/fileIO.c 2008-01-28 08:02:51.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/file/fileIO.c 2008-10-13 08:01:51.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -26,12 +26,18 @@ * */ +#include +#include +#include + #include "vmware.h" #include "util.h" #include "fileIO.h" #include "fileLock.h" #include "fileInt.h" #include "msg.h" +#include "unicodeOperations.h" + /* *---------------------------------------------------------------------- @@ -260,13 +266,22 @@ &err); if (file->lockToken == NULL) { - // Describe the lock not acquired situation in detail + /* Describe the lock not acquired situation in detail */ Warning(LGPFX" %s on '%s' failed: %s\n", - __FUNCTION__, file->fileName, + __FUNCTION__, UTF8(file->fileName), (err == 0) ? "Lock timed out" : strerror(err)); - // Return a serious failure status if the locking code did - ret = (err == 0) ? FILEIO_LOCK_FAILED : FILEIO_ERROR; + /* Return a serious failure status if the locking code did */ + switch (err) { + case 0: // file is currently locked + ret = FILEIO_LOCK_FAILED; + break; + case ENAMETOOLONG: // path is too long + ret = FILEIO_FILE_NAME_TOO_LONG; + break; + default: // some sort of locking error + ret = FILEIO_ERROR; + } } } #else @@ -309,7 +324,7 @@ if (err != 0) { Warning(LGPFX" %s on '%s' failed: %s\n", - __FUNCTION__, file->fileName, strerror(err)); + __FUNCTION__, UTF8(file->fileName), strerror(err)); ret = FILEIO_ERROR; } @@ -397,9 +412,8 @@ return; } -// XXX unicode "string" in message Log("FILEIOSTATS | \"%s\" %d %d %d %d %d %d %d %d %d %d %d %d %d %d %"FMT64"d %"FMT64"d\n", - fd->fileName ? fd->fileName : "", + fd->fileName ? UTF8(fd->fileName) : "", fd->readIn, fd->readDirect, fd->writeIn, fd->writeDirect, fd->readvIn, fd->readvDirect, fd->writevIn, fd->writevDirect, fd->preadvIn, fd->preadDirect, fd->pwritevIn, fd->pwriteDirect, @@ -433,10 +447,32 @@ /* - * Pwrite & Pread are not available in the FreeBSD tools build VM + *---------------------------------------------------------------------- + * + * 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. + * + *---------------------------------------------------------------------- */ -#if !defined(VMX86_TOOLS) || !defined(__FreeBSD__) -#if defined(_WIN32) || defined(GLIBC_VERSION_21) || defined(__APPLE__) + +ConstUnicode +FileIO_Filename(FileIODescriptor *fd) // IN +{ + return fd->fileName; +} + + +#if defined(_WIN32) || defined(GLIBC_VERSION_21) || defined(__APPLE__) || \ + defined(__FreeBSD__) /* *---------------------------------------------------------------------- * @@ -494,7 +530,7 @@ FileIOResult FileIO_Pwrite(FileIODescriptor *fd, // IN: File descriptor - void *buf, // IN: Buffer to write from + void const *buf, // IN: Buffer to write from size_t len, // IN: Length of the buffer uint64 offset) // IN: Offset to start writing { @@ -502,13 +538,13 @@ ASSERT(fd); - iov.iov_base = buf; + /* 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); } #endif -#endif #if defined(sun) && __GNUC__ < 3 diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/file/fileIOPosix.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/file/fileIOPosix.c --- open-vm-tools-2008.01.23-74039/lib/file/fileIOPosix.c 2008-01-28 08:02:51.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/file/fileIOPosix.c 2008-10-13 08:01:51.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -35,6 +35,7 @@ #include #include #include +#include #if !defined(N_PLAT_NLM) && defined(linux) /* * These headers are needed to get __USE_LARGEFILE, __USE_LARGEFILE64, @@ -59,11 +60,26 @@ #include #include #include +#include +#else +#if defined(__FreeBSD__) +#include +#include +#else +#if !defined(N_PLAT_NLM) +#include +#if !defined(sun) +#include +#include +#endif +#endif +#endif #endif /* Check for non-matching prototypes */ #include "vmware.h" #include "str.h" +#include "posix.h" #include "file.h" #include "fileIO.h" #include "fileInt.h" @@ -72,11 +88,11 @@ #include "iovector.h" #include "stats_file.h" -#include "unicodeBase.h" #include "unicodeOperations.h" #if defined(__APPLE__) #include "hostinfo.h" +#define XATTR_BACKUP_REENABLED "com.vmware.backupReenabled" #endif static const unsigned int FileIO_SeekOrigins[] = { @@ -145,7 +161,11 @@ return FILEIO_WRITE_ERROR_NOSPC; case EFBIG: return FILEIO_WRITE_ERROR_FBIG; -#ifdef EDQUOT +#if defined(VMX86_SERVER) + case EBUSY: + return FILEIO_LOCK_FAILED; +#endif +#if defined(EDQUOT) case EDQUOT: return FILEIO_WRITE_ERROR_DQUOT; #endif @@ -327,55 +347,6 @@ } -/* - *---------------------------------------------------------------------- - * - * PosixOpen -- - * - * Open a file using POSIX open. - * - * Results: - * -1 error - * >= 0 success (file descriptor) - * - * Side effects: - * errno is set on error - * - *---------------------------------------------------------------------- - */ - -static int -PosixOpen(ConstUnicode pathName, // IN: - int flags, // IN: - int mode) // IN: -{ - int fd; - char *path; - - if (pathName == NULL) { - errno = EFAULT; - return -1; - } - - path = Unicode_GetAllocBytes(pathName, STRING_ENCODING_DEFAULT); - - if (path == NULL) { - fd = -1; - errno = ENOMEM; - } else { - int err; - - fd = open(path, flags, (mode_t) mode); - - err = errno; - free(path); - errno = err; - } - - return fd; -} - - #if defined(__APPLE__) /* *---------------------------------------------------------------------- @@ -545,7 +516,7 @@ } if (pid == 0) { /* child: use fd[0] */ - proxyFD = PosixOpen(pathName, flags, mode); + proxyFD = Posix_Open(pathName, flags, mode); ProxySendResults(fds[0], proxyFD, errno); @@ -588,33 +559,18 @@ ProxyUse(ConstUnicode pathName, // IN: Bool *useProxy) // IN: { - int err; - char *path; + Unicode path; UnicodeIndex index; struct statfs sfbuf; struct stat statbuf; if (pathName == NULL) { - return EFAULT; - } - - /* - * If the file to be opened exists and is a symbolic link use the - * proxy... this is a rare case and the work to fully resolve this - * doesn't seem to be worth it. - */ - - path = Unicode_GetAllocBytes(pathName, STRING_ENCODING_DEFAULT); - - if (path == NULL) { - return ENOMEM; + errno = EFAULT; + return -1; } - err = lstat(path, &statbuf); - - free(path); - - if ((err == 0) && S_ISLNK(statbuf.st_mode)) { + if ((Posix_Lstat(pathName, &statbuf) == 0) && + S_ISLNK(statbuf.st_mode)) { *useProxy = TRUE; return 0; } @@ -623,25 +579,16 @@ * Construct the path to the directory that contains the filePath. */ - index = Unicode_FindLast(pathName, U("/")); + index = Unicode_FindLast(pathName, "/"); if (index == UNICODE_INDEX_NOT_FOUND) { - path = strdup("."); + path = Unicode_Duplicate("."); } else { Unicode temp; - Unicode testPath; temp = Unicode_Substr(pathName, 0, index + 1); - testPath = Unicode_Append(temp, U(".")); - - path = Unicode_GetAllocBytes(testPath, STRING_ENCODING_DEFAULT); - + path = Unicode_Append(temp, "."); Unicode_Free(temp); - Unicode_Free(testPath); - - if (path == NULL) { - return ENOMEM; - } } /* @@ -649,11 +596,7 @@ * containing filePath). */ - err = statfs(path, &sfbuf); - - free(path); - - if (err == 0) { + if (Posix_Statfs(path, &sfbuf) == 0) { /* * The testPath exists; determine proxy usage explicitely. */ @@ -667,52 +610,48 @@ *useProxy = TRUE; } + Unicode_Free(path); + return 0; } -#endif /* *---------------------------------------------------------------------- * - * FileIO_PosixOpen -- + * PosixFileOpener -- * - * Open a file via POSIX open(). + * Open a file. Use a proxy when creating a file or on NFS. * - * Use a proxy when creating a file or on NFS on MacOS X. - * - * Why a proxy? The MacOS 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. + * Why a proxy? The MacOS 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 Error - * >= 0 File descriptor (success) + * -1 on error + * >= 0 on success * * Side effects: - * errno is set on error + * errno is set * *---------------------------------------------------------------------- */ int -FileIO_PosixOpen(ConstUnicode pathName, // IN: - int flags, // IN: - int mode) // IN: +PosixFileOpener(ConstUnicode pathName, // IN: + int flags, // IN: + mode_t mode) // IN: { -#if defined(__APPLE__) Bool useProxy; -#endif -#if defined(__APPLE__) 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; @@ -727,82 +666,9 @@ } return useProxy ? ProxyOpen(pathName, flags, mode) : - PosixOpen(pathName, flags, mode); -#else - return PosixOpen(pathName, flags, mode); -#endif -} - - -/* - *---------------------------------------------------------------------- - * - * FileIO_PosixCreat -- - * - * Create a file via POSIX creat(). - * - * Results: - * -1 Error - * >= 0 File descriptor (success) - * - * Side effects: - * errno is set on error - * - *---------------------------------------------------------------------- - */ - -int -FileIO_PosixCreat(ConstUnicode pathName, // IN: - int mode) // IN: -{ - return FileIO_PosixOpen(pathName, O_CREAT | O_WRONLY | O_TRUNC, mode); -} - - -/* - *---------------------------------------------------------------------- - * - * FileIO_PosixFopen -- - * - * Open a file via POSIX fopen(); - * - * Results: - * -1 Error - * >= 0 File descriptor (success) - * - * Side effects: - * errno is set on error - * - *---------------------------------------------------------------------- - */ - -FILE * -FileIO_PosixFopen(ConstUnicode pathName, // IN: - const char *mode) // IN: -{ - int err; - char *path; - FILE *stream; - - if (pathName == NULL) { - errno = EFAULT; - return NULL; - } - - path = Unicode_GetAllocBytes(pathName, STRING_ENCODING_DEFAULT); - - if (path == NULL) { - errno = ENOMEM; - return NULL; - } - - stream = fopen(path, mode); - err = errno; - free(path); - errno = err; - - return stream; + Posix_Open(pathName, flags, mode); } +#endif /* @@ -836,7 +702,6 @@ int flags = 0; int error; FileIOResult ret; - char *path = NULL; ASSERT(file); @@ -847,11 +712,11 @@ #if defined(VMX86_STATS) { - char *tmp; + Unicode tmp; File_SplitName(pathName, NULL, NULL, &tmp); STATS_USER_INIT_MODULE_ONCE(); file->stats = STATS_USER_INIT_INST(tmp); - free(tmp); + Unicode_Free(tmp); } #endif @@ -872,24 +737,24 @@ * lockfiles. */ if ((access & (FILEIO_OPEN_EXCLUSIVE_LOCK | - FILEIO_OPEN_MULTIWRITER_LOCK)) != 0 || + FILEIO_OPEN_MULTIWRITER_LOCK)) != 0 || (access & (FILEIO_OPEN_ACCESS_READ | FILEIO_OPEN_ACCESS_WRITE | - FILEIO_OPEN_LOCKED)) == + FILEIO_OPEN_LOCKED)) == (FILEIO_OPEN_ACCESS_READ | FILEIO_OPEN_LOCKED)) { if (File_OnVMFS(pathName)) { access &= ~FILEIO_OPEN_LOCKED; - if ((access & FILEIO_OPEN_MULTIWRITER_LOCK) != 0) { - flags |= O_MULTIWRITER_LOCK; - } else { - flags |= O_EXCLUSIVE_LOCK; - } + if ((access & FILEIO_OPEN_MULTIWRITER_LOCK) != 0) { + flags |= O_MULTIWRITER_LOCK; + } else { + flags |= O_EXCLUSIVE_LOCK; + } } } #endif FileIO_Init(file, pathName); ret = FileIO_Lock(file, access); - if (ret != FILEIO_SUCCESS) { + if (!FileIO_IsSuccess(ret)) { goto error; } @@ -912,9 +777,8 @@ flags |= O_DIRECT; #elif !defined(__APPLE__) // Mac hosts need this access flag after opening. access &= ~FILEIO_OPEN_UNBUFFERED; -// XXX unicode "string" in message LOG_ONCE((LGPFX" %s reverting to buffered IO on %s.\n", - __FUNCTION__, pathName)); + __FUNCTION__, UTF8(pathName))); #endif } @@ -929,19 +793,13 @@ SuperUser(TRUE); } - path = Unicode_GetAllocBytes(pathName, STRING_ENCODING_DEFAULT); - - if (path == NULL) { - fd = -1; - errno = ENOMEM; - } else { - fd = FileIO_PosixOpen(path, flags + flags |= #if defined(linux) && !defined(N_PLAT_NLM) - | ((access & FILEIO_OPEN_SYNC) ? O_SYNC : 0) + ((access & FILEIO_OPEN_SYNC) ? O_SYNC : 0) | #endif - | FileIO_OpenActions[action], - mode); - } + FileIO_OpenActions[action]; + + fd = PosixFileOpener(pathName, flags, mode); error = errno; @@ -970,10 +828,23 @@ * Time Machine backs up EVERY file unless explicitly told not to, so this * option uses the API to exclude the file that was just opened. */ - if ((access & FILEIO_OPEN_NO_TIME_MACHINE) && - !FileIO_SetExcludedFromTimeMachine(pathName, TRUE)) { - ret = FILEIO_ERROR; - goto error; + if ((access & FILEIO_OPEN_NO_TIME_MACHINE)) { + if (!FileIO_SetExcludedFromTimeMachine(pathName, TRUE)) { + ret = FILEIO_ERROR; + goto error; + } + } else { + /* + * Fix for Bug 248644: + * The issue with Time Machine that was causing hangs has been fixed in + * 10.5.2, so if the user is in 10.5.2 and the option isn't set, then + * we want to reset the exclusion of the file. + * + * Note that this call ignores errors because there are some files (like + * raw devices) that will fail checking xattrs and Time Machine Exclusion + * status, but we can't detect them at this point. + */ + FileIO_ResetExcludedFromTimeMachine(pathName); } #endif @@ -982,14 +853,12 @@ * 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 (unlink(path) == -1) { + if (Posix_Unlink(pathName) == -1) { ret = FileIOErrno2Result(errno); goto error; } } - free(path); - file->posix = fd; FileIO_StatsInit(file); @@ -999,8 +868,6 @@ error: error = errno; - free(path); - if (fd != -1) { close(fd); } @@ -1203,7 +1070,6 @@ NOT_TESTED(); continue; } - Log(LGPFX" %s failed %d.\n", __FUNCTION__, error); fret = FileIOErrno2Result(error); break; } @@ -1383,11 +1249,6 @@ return fsync(file->posix); } -/* - * readv & writev are not available in the FreeBSD or Solaris Tools builds - */ -#if !defined(VMX86_TOOLS) || (!defined(__FreeBSD__) && !defined(sun)) - /* *----------------------------------------------------------------------------- @@ -1446,8 +1307,7 @@ // 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)); - cBuf = malloc(sizeof(uint8) * inTotalSize); - ASSERT_MEM_ALLOC(cBuf); + cBuf = Util_SafeMalloc(sizeof(uint8) * inTotalSize); if (isWrite) { IOV_WriteIovToBuf(inVec, inCount, cBuf, inTotalSize); @@ -1711,7 +1571,7 @@ } -#if defined(GLIBC_VERSION_21) || defined(__APPLE__) +#if defined(GLIBC_VERSION_21) || defined(__APPLE__) || defined(__FreeBSD__) /* *---------------------------------------------------------------------- @@ -1917,8 +1777,7 @@ return fret; } -#endif /* defined(GLIBC_VERSION_21) || defined(__APPLE__) */ -#endif /* !defined(VMX86_TOOLS) || !(defined(FreeBSD) || defined(sun)) */ +#endif /* defined(GLIBC_VERSION_21) || defined(__APPLE__) || defined(__FreeBSD__) */ #endif /* !defined(N_PLAT_NLM) */ /* @@ -1968,27 +1827,11 @@ FileIO_GetSizeByPath(ConstUnicode pathName) // IN: { int err; - char *path; - struct stat statBuf; - - if (pathName == NULL) { - errno = EFAULT; - return -1; - } - - path = Unicode_GetAllocBytes(pathName, STRING_ENCODING_DEFAULT); - - if (path == NULL) { - errno = EFAULT; - return -1; - } - - err = (stat(path, &statBuf) == -1) ? errno : 0; + struct stat statbuf; - free(path); - errno = err; + err = Posix_Stat(pathName, &statbuf); - return (err == 0) ? statBuf.st_size : -1; + return (err == 0) ? statbuf.st_size : -1; } @@ -2011,20 +1854,16 @@ */ FileIOResult -FileIO_Access(ConstUnicode pathName, // IN: path name to be tested - int accessMode) // IN: access modes to be asserted +FileIO_Access(ConstUnicode pathName, // IN: Path name to be tested. May be NULL. + int accessMode) // IN: Access modes to be asserted { - int err; - int mode; - char *path; + int mode = 0; if (pathName == NULL) { errno = EFAULT; return FILEIO_ERROR; } - mode = 0; - if (accessMode & FILEIO_ACCESS_READ) { mode |= R_OK; } @@ -2038,19 +1877,7 @@ mode |= F_OK; } - path = Unicode_GetAllocBytes(pathName, STRING_ENCODING_DEFAULT); - - if (path == NULL) { - errno = ENOMEM; - return FILEIO_ERROR; - } - - err = (access(path, mode) == -1) ? errno : 0; - - free(path); - errno = err; - - return (err == 0) ? FILEIO_SUCCESS : FILEIO_ERROR; + return (Posix_Access(pathName, mode) == -1) ? FILEIO_ERROR : FILEIO_SUCCESS; } @@ -2188,7 +2015,7 @@ if (suNeeded) { SuperUser(TRUE); } - fd = FileIO_PosixOpen(pathName, flags, 0); + fd = Posix_Open(pathName, flags, 0); if (suNeeded) { int error = errno; @@ -2198,11 +2025,129 @@ return fd; } + +/* + *----------------------------------------------------------------------------- + * + * FileIO_DescriptorToStream + * + * Return a FILE * stream equivalent to the given FileIODescriptor. + * This is the logical equivalent of Posix dup() then fdopen(). + * + * Since the passed descriptor and returned FILE * represent the same + * underlying file, and their cursor is shared, you should avoid + * interleaving uses to both. + * + * Results: + * A FILE * representing the same underlying file as the passed descriptor + * NULL if there was an error. + * Caller should fclose the returned descriptor when finished. + * + * Side effects: + * New fd allocated. + * + *----------------------------------------------------------------------------- + */ + +FILE * +FileIO_DescriptorToStream(FileIODescriptor *fdesc) // IN +{ + int dupFd; + const char *mode; + int tmpFlags; + FILE *stream; + + /* 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); + + dupFd = dup(fdesc->posix); + if (dupFd == -1) { + return NULL; + } + + + + 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__) /* *----------------------------------------------------------------------------- * + * FileIO_ResetExcludedFromTimeMachine -- + * + * Request that the given path have its time machine exclusion reset + * (turned off). We use a special xattr on the file to mark that we have + * done this so that future calls won't clear the file if the user has + * explicitly marked it themselves. + * + * Results: + * A boolean reflecting whether or not reseting the file succeeded. + * + * Side effects: + * Adds a "backup re-enabled" xattr to the file if wasn't already present + * and removing the Time Machine exclusion was successful. + * + *----------------------------------------------------------------------------- + */ + +Bool +FileIO_ResetExcludedFromTimeMachine(char const *pathName) // IN +{ + bool result = TRUE; + char xattr; + ssize_t gXattrResult = getxattr(pathName, XATTR_BACKUP_REENABLED, + &xattr, sizeof(xattr), 0, 0); + if (gXattrResult != -1) { + // We have already seen this file, don't touch it again. + goto exit; + } + if (errno != ENOATTR) { + LOG_ONCE((LGPFX" %s Couldn't get xattr on path [%s]: %s.\n", + __func__, pathName, strerror(errno))); + result = FALSE; + goto exit; + } + result = FileIO_SetExcludedFromTimeMachine(pathName, FALSE); + if (!result) { + goto exit; + } + xattr = '1'; + int sXattrResult = setxattr(pathName, XATTR_BACKUP_REENABLED, + &xattr, sizeof(xattr), 0, 0); + if (sXattrResult == -1) { + LOG_ONCE((LGPFX" %s Couldn't set xattr on path [%s]: %s.\n", + __func__, pathName, strerror(errno))); + result = FALSE; + goto exit; + } + +exit: + return result; +} + + +/* + *----------------------------------------------------------------------------- + * * FileIO_SetExcludedFromTimeMachine -- * * Request that the given path be excluded from Backup processes (namely @@ -2262,7 +2207,7 @@ goto exit; } - ret = (*backupFunc)(item, TRUE, FALSE); + ret = (*backupFunc)(item, isExcluded, FALSE); if (ret != noErr) { /* diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/file/fileLockPosix.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/file/fileLockPosix.c --- open-vm-tools-2008.01.23-74039/lib/file/fileLockPosix.c 2008-01-28 08:02:51.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/file/fileLockPosix.c 2008-10-13 08:01:51.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -44,6 +44,7 @@ #include #include "vmware.h" +#include "posix.h" #include "file.h" #include "fileIO.h" #include "fileLock.h" @@ -55,7 +56,6 @@ #include "hostinfo.h" #include "su.h" -#include "unicodeTypes.h" #include "unicodeOperations.h" #if defined(VMX86_SERVER) @@ -76,7 +76,7 @@ #define LOGLEVEL_MODULE main #include "loglevel_user.h" -#define DEVICE_LOCK_DIR "/var/lock" +#define DEVICE_LOCK_DIR "/var/lock" /* * Parameters used by the file library. @@ -128,7 +128,7 @@ * IsLinkingAvailable -- * * Check if linking is supported in the filesystem where we create - * the lock file. + * the lock file. * * Results: * TRUE is we're sure it's supported. FALSE otherwise. @@ -218,7 +218,7 @@ * FileLockGetPid -- * * Returns the pid of the main thread if we're running in a - * multithreaded process, otherwise return the result of getpid(). + * multithreaded process, otherwise return the result of getpid(). * * Results: * a pid. @@ -324,7 +324,7 @@ char line[1000]; Bool deleteLockFile; - int status; + int status; ASSERT(lockFileName); ASSERT(pid); @@ -332,7 +332,7 @@ su = IsSuperUser(); SuperUser(TRUE); - lockFile = fopen(lockFileName, "r"); + lockFile = Posix_Fopen(lockFileName, "r"); saveErrno = errno; SuperUser(su); @@ -384,11 +384,11 @@ * * IsValidProcess -- * - * Determine if the process, via its pid, is valid (alive). + * Determine if the process, via its pid, is valid (alive). * * Results: - * TRUE Yes - * FALSE No + * TRUE Yes + * FALSE No * * Side effects: * None. @@ -488,8 +488,8 @@ */ SuperUser(TRUE); - lockFD = open(lockFileName, O_CREAT | O_EXCL | O_WRONLY, - S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); + lockFD = Posix_Open(lockFileName, O_CREAT | O_EXCL | O_WRONLY, + S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); saveErrno = errno; SuperUser(su); @@ -552,9 +552,9 @@ * 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. + * This locking method remains due to "minicom" and similar + * programs that use this locking method for access serialization + * of serial ports. * *---------------------------------------------------------------------- */ @@ -564,18 +564,18 @@ { const char *hostID; char uniqueID[1000]; - char lockFileName[FILE_MAXPATH]; - char lockFileLink[FILE_MAXPATH]; + char *lockFileName; + char *lockFileLink; int status = -1; ASSERT(deviceName); - Str_Sprintf(lockFileName, sizeof lockFileName, "%s/LCK..%s", - DEVICE_LOCK_DIR, deviceName); + lockFileName = Str_SafeAsprintf(NULL, "%s/LCK..%s", DEVICE_LOCK_DIR, + deviceName); - Str_Sprintf(lockFileLink, sizeof lockFileLink, "%s/LTMP..%s.t%05d", - DEVICE_LOCK_DIR, deviceName, FileLockGetPid()); + lockFileLink = Str_SafeAsprintf(NULL, "%s/LTMP..%s.t%05d", DEVICE_LOCK_DIR, + deviceName, FileLockGetPid()); LOG(1, ("Requesting lock %s (temp = %s).\n", lockFileName, lockFileLink)); @@ -585,7 +585,7 @@ FileLockGetPid(), hostID); while ((status = CreateLockFile(lockFileName, lockFileLink, - uniqueID)) == 0) { + uniqueID)) == 0) { int pid; char fileID[1000]; @@ -627,6 +627,8 @@ } exit: + free(lockFileName); + free(lockFileLink); return status; } @@ -648,17 +650,16 @@ */ Bool -FileLock_UnlockDevice(const char *deviceName) // IN: +FileLock_UnlockDevice(const char *deviceName) // IN: { Bool su; int ret; int saveErrno; - char path[FILE_MAXPATH]; + char *path; ASSERT(deviceName); - Str_Sprintf(path, sizeof path, "%s/LCK..%s", - DEVICE_LOCK_DIR, deviceName); + path = Str_SafeAsprintf(NULL, "%s/LCK..%s", DEVICE_LOCK_DIR, deviceName); LOG(1, ("Releasing lock %s.\n", path)); @@ -671,10 +672,13 @@ if (ret < 0) { Log(LGPFX" Cannot remove lock file %s (%s).\n", path, strerror(saveErrno)); + free(path); return FALSE; } + free(path); + return TRUE; } @@ -684,10 +688,11 @@ * * ReadSlashProc -- * - * Read the data in a /proc file + * Read the data in a /proc file * * Results: - * + * 0 Data is available + * !0 Error (errno) * * Side effects: * None. @@ -709,7 +714,7 @@ ASSERT(buffer); ASSERT(bufferSize > 0); - fd = open(procPath, O_RDONLY); + fd = Posix_Open(procPath, O_RDONLY, 0); if (fd == -1) { return errno; @@ -741,11 +746,11 @@ * * ProcessCreationTime -- * - * Return the specified process's creation time. + * Return the specified process's creation time. * * Results: - * The process's creation time is returned. If an error occurs the - * reported creation time will be 0. + * The process's creation time is returned. If an error occurs the + * reported creation time will be 0. * * Side effects: * None. @@ -792,6 +797,9 @@ } if (sscanf(p, "%"FMT64"u", &creationTime) != 1) { + Warning(LGPFX" %s creationTime conversion error on %s.\n", + __FUNCTION__, p); + creationTime = 0; } } else { @@ -809,7 +817,7 @@ struct kinfo_proc info; int mib[4]; - // Request information about the specified process + /* Request information about the specified process */ mib[0] = CTL_KERN; mib[1] = KERN_PROC; mib[2] = KERN_PROC_PID; @@ -819,7 +827,7 @@ size = sizeof(info); err = sysctl(mib, ARRAYSIZE(mib), &info, &size, NULL, 0); - // Log any failures + /* Log any failures */ if (err == -1) { Warning(LGPFX" %s sysctl for pid %d failed: %s\n", __FUNCTION__, pid, strerror(errno)); @@ -827,7 +835,7 @@ return 0; } - // Return the process creation time + /* Return the process creation time */ return (info.kp_proc.p_starttime.tv_sec * CONST64U(1000000)) + info.kp_proc.p_starttime.tv_usec; } @@ -845,11 +853,11 @@ * * FileLockValidOwner -- * - * Validate the lock file owner. + * Validate the lock file owner. * * Results: - * TRUE Yes - * FALSE No + * TRUE Yes + * FALSE No * * Side effects: * None. @@ -863,7 +871,7 @@ { int pid; - // Validate the PID. + /* Validate the PID. */ if (sscanf(executionID, "%d", &pid) != 1) { Warning(LGPFX" %s pid conversion error on %s. Assuming valid.\n", __FUNCTION__, executionID); @@ -875,7 +883,7 @@ return FALSE; } - // If there is a payload perform additional validation. + /* If there is a payload perform additional validation. */ if ((payload != NULL) && (strncmp(payload, "pc=", 3) == 0)) { uint64 fileCreationTime; uint64 processCreationTime; @@ -892,7 +900,7 @@ return TRUE; } - // Non-matching process creation times -> pid is not the creator + /* Non-matching process creation times -> pid is not the creator */ processCreationTime = ProcessCreationTime(pid); if ((fileCreationTime != 0) && @@ -911,11 +919,11 @@ * * FileLockOpenFile -- * - * Open the specified file + * Open the specified file * * Results: - * 0 success - * > 0 failure (errno) + * 0 success + * > 0 failure (errno) * * Side effects: * May change the host file system. @@ -930,7 +938,7 @@ { ASSERT(pathName); - *handle = FileIO_PosixOpen(pathName, flags, 0644); + *handle = PosixFileOpener(pathName, flags, 0644); return *handle == -1 ? errno : 0; } @@ -941,11 +949,11 @@ * * FileLockCloseFile -- * - * Close the specified file + * Close the specified file * * Results: - * 0 success - * > 0 failure (errno) + * 0 success + * > 0 failure (errno) * * Side effects: * May change the host file system. @@ -965,11 +973,11 @@ * * FileLockReadFile -- * - * Read a file. + * Read a file. * * Results: - * 0 success - * > 0 failure (errno) + * 0 success + * > 0 failure (errno) * * Side effects: * None @@ -1005,11 +1013,11 @@ * * FileLockWriteFile -- * - * Write a file. + * Write a file. * * Results: - * 0 success - * > 0 failure (errno) + * 0 success + * > 0 failure (errno) * * Side effects: * May change the host file system. @@ -1041,25 +1049,50 @@ /* + *--------------------------------------------------------------------------- + * + * FileLockGetExecutionID -- + * + * Returns the executionID of the caller. + * + * Results: + * The executionID of the caller. + * + * 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) +{ + return Str_SafeAsprintf(NULL, "%d", FileLockGetPid()); +} + + +/* *---------------------------------------------------------------------- * * FileLock_Lock -- * - * Obtain a lock on a file; shared or exclusive access. Also specify - * how long to wait on lock acquisition - msecMaxWaitTime + * 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. + * 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. + * 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: * Changes the host file system. @@ -1075,7 +1108,6 @@ { Unicode fullPath; void *lockToken; - char pidString[16]; char creationTimeString[32]; ASSERT(filePath); @@ -1087,16 +1119,11 @@ return NULL; } - // Encode the callers process creation time - Str_Sprintf(creationTimeString, sizeof creationTimeString, "pc=%"FMT64"u", + Str_Sprintf(creationTimeString, sizeof creationTimeString, "%"FMT64"u", ProcessCreationTime(FileLockGetPid())); - // No thread information encoded - NOT THREAD SAFE - Str_Sprintf(pidString, sizeof pidString, "%d", FileLockGetPid()); - - lockToken = FileLockIntrinsic(FileLockGetMachineID(), pidString, - creationTimeString, fullPath, !readOnly, - msecMaxWaitTime, err); + lockToken = FileLockIntrinsic(fullPath, !readOnly, msecMaxWaitTime, + creationTimeString, err); Unicode_Free(fullPath); @@ -1109,11 +1136,11 @@ * * FileLock_Unlock -- * - * Release the lock held on the specified file. + * Release the lock held on the specified file. * * Results: - * 0 unlocked - * >0 errno + * 0 unlocked + * >0 errno * * Side effects: * Changes the host file system. @@ -1127,7 +1154,6 @@ { int err; Unicode fullPath; - char pidString[16]; ASSERT(filePath); ASSERT(lockToken); @@ -1137,11 +1163,7 @@ return EINVAL; } - // No thread information encoded - NOT THREAD SAFE - Str_Sprintf(pidString, sizeof pidString, "%d", FileLockGetPid()); - - err = FileUnlockIntrinsic(FileLockGetMachineID(), pidString, fullPath, - lockToken); + err = FileUnlockIntrinsic(fullPath, lockToken); Unicode_Free(fullPath); @@ -1154,17 +1176,17 @@ * * FileLock_DeleteFileVMX -- * - * The VMX file delete primitive. + * The VMX file delete primitive. * * Results: - * 0 unlocked - * >0 errno + * 0 unlocked + * >0 errno * * Side effects: * Changes the host file system. * * Note: - * THIS IS A HORRIBLE HACK AND NEEDS TO BE REMOVED ASAP!!! + * THIS IS A HORRIBLE HACK AND NEEDS TO BE REMOVED ASAP!!! * *---------------------------------------------------------------------- */ @@ -1174,7 +1196,6 @@ { int err; Unicode fullPath; - char pidString[16]; ASSERT(filePath); @@ -1183,14 +1204,68 @@ return EINVAL; } - // No thread information encoded - NOT THREAD SAFE - Str_Sprintf(pidString, sizeof pidString, "%d", FileLockGetPid()); - - err = FileLockHackVMX(FileLockGetMachineID(), pidString, fullPath); + err = FileLockHackVMX(fullPath); Unicode_Free(fullPath); return err; } +#else + +/* + * Stub functions for unsupported platforms. + */ + +int +FileLockCloseFile(FILELOCK_FILE_HANDLE handle) // IN +{ + NOT_IMPLEMENTED(); +} + + +char * +FileLockGetExecutionID(void) +{ + NOT_IMPLEMENTED(); +} + + +int +FileLockOpenFile(ConstUnicode pathName, // IN + int flags, // IN + FILELOCK_FILE_HANDLE *handle) // OUT +{ + + NOT_IMPLEMENTED(); +} + + +int +FileLockReadFile(FILELOCK_FILE_HANDLE handle, // IN + void *buf, // IN + uint32 requestedBytes, // IN + uint32 *resultantBytes) // OUT +{ + NOT_IMPLEMENTED(); +} + + +Bool +FileLockValidOwner(const char *executionID, // IN + const char *payload) // IN +{ + NOT_IMPLEMENTED(); +} + + +int +FileLockWriteFile(FILELOCK_FILE_HANDLE handle, // IN + void *buf, // IN + uint32 requestedBytes, // IN + uint32 *resultantBytes) // OUT +{ + NOT_IMPLEMENTED(); +} + #endif /* !__FreeBSD__ && !sun */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/file/fileLockPrimitive.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/file/fileLockPrimitive.c --- open-vm-tools-2008.01.23-74039/lib/file/fileLockPrimitive.c 2008-01-28 08:02:51.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/file/fileLockPrimitive.c 2008-10-13 08:01:51.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -29,8 +29,8 @@ #include #include #include -#include #include +#include #include #if defined(_WIN32) #include @@ -43,6 +43,7 @@ #include "vmware.h" #include "hostinfo.h" #include "util.h" +#include "err.h" #include "log.h" #include "str.h" #include "file.h" @@ -51,35 +52,44 @@ #include "random.h" #include "vm_atomic.h" -#include "unicodeTypes.h" #include "unicodeOperations.h" #define LOGLEVEL_MODULE main #include "loglevel_user.h" -#define LOCK_SHARED "S" -#define LOCK_EXCLUSIVE "X" +#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; + /* *----------------------------------------------------------------------------- * * Sleeper -- * - * 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. + * 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 + * 0 slept + * EAGAIN maximum sleep time exceeded * * Side effects: - * None. + * None. * *----------------------------------------------------------------------------- */ @@ -128,14 +138,14 @@ * * RemoveLockingFile -- * - * Remove the specified file. + * Remove the specified file. * * Results: - * 0 success - * > 0 failure (errno) + * 0 success + * > 0 failure (errno) * * Side effects: - * None. + * None. * *----------------------------------------------------------------------------- */ @@ -145,26 +155,22 @@ ConstUnicode fileName) // IN: { int err; - Unicode temp; Unicode path; ASSERT(lockDir); ASSERT(fileName); - temp = Unicode_Append(lockDir, U(DIRSEPS)); - path = Unicode_Append(temp, fileName); - Unicode_Free(temp); + path = Unicode_Join(lockDir, DIRSEPS, fileName, NULL); - err = FileDeletion(path, FALSE); + err = FileDeletionRobust(path, FALSE); if (err != 0) { if (err == ENOENT) { /* Not there anymore; locker unlocked or timed out */ err = 0; } else { -// XXX unicode "string" in message Warning(LGPFX" %s of '%s' failed: %s\n", __FUNCTION__, - path, strerror(err)); + UTF8(path), strerror(err)); } } @@ -177,13 +183,79 @@ /* *----------------------------------------------------------------------------- * + * 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. + * 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 + * 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 @@ -191,6 +263,8 @@ *----------------------------------------------------------------------------- */ +#define FL_MAX_ARGS 16 + int FileLockMemberValues(ConstUnicode lockDir, // IN: ConstUnicode fileName, // IN: @@ -198,21 +272,23 @@ uint32 requiredSize, // IN: LockValues *memberValues) // OUT: { - uint32 i; + uint32 argc = 0; FILELOCK_FILE_HANDLE handle; uint32 len; - char *argv[4]; + char *argv[FL_MAX_ARGS]; int err; - Unicode temp; Unicode path; FileData fileData; + ParseTable table = { PARSE_TABLE_STRING, + "lc", + (void *) &memberValues->locationChecksum + }; + ASSERT(lockDir); ASSERT(fileName); - temp = Unicode_Append(lockDir, U(DIRSEPS)); - path = Unicode_Append(temp, fileName); - Unicode_Free(temp); + path = Unicode_Join(lockDir, DIRSEPS, fileName, NULL); err = FileLockOpenFile(path, O_RDONLY, &handle); @@ -224,21 +300,19 @@ */ if (err != ENOENT) { -// XXX unicode "string" in message Warning(LGPFX" %s open failure on '%s': %s\n", __FUNCTION__, - path, strerror(err)); + UTF8(path), strerror(err)); } goto bail; } /* Attempt to obtain the lock file attributes now that it is opened */ - err = FileAttributes(path, &fileData); + err = FileAttributesRobust(path, &fileData); if (err != 0) { -// XXX unicode "string" in message - Warning(LGPFX" %s file size failure on '%s': %s\n", __FUNCTION__, path, - strerror(err)); + Warning(LGPFX" %s file size failure on '%s': %s\n", __FUNCTION__, + UTF8(path), strerror(err)); FileLockCloseFile(handle); @@ -247,9 +321,8 @@ /* Complain if the lock file is not the proper size */ if (fileData.fileSize != requiredSize) { -// XXX unicode "string" in message Warning(LGPFX" %s file '%s': size %"FMT64"u, required size %u\n", - __FUNCTION__, path, fileData.fileSize, requiredSize); + __FUNCTION__, UTF8(path), fileData.fileSize, requiredSize); FileLockCloseFile(handle); @@ -262,47 +335,77 @@ FileLockCloseFile(handle); if (err != 0) { -// XXX unicode "string" in message Warning(LGPFX" %s read failure on '%s': %s\n", - __FUNCTION__, path, strerror(err)); + __FUNCTION__, UTF8(path), strerror(err)); goto bail; } if (len != requiredSize) { -// XXX unicode "string" in message Warning(LGPFX" %s read length issue on '%s': %u and %u\n", - __FUNCTION__, path, len, requiredSize); + __FUNCTION__, UTF8(path), len, requiredSize); err = EIO; goto bail; } /* Extract and validate the lock file data. */ - for (i = 0; i < 4; i++) { - argv[i] = strtok((i == 0) ? buffer : NULL, " "); + for (argc = 0; argc < FL_MAX_ARGS; argc++) { + argv[argc] = strtok((argc == 0) ? buffer : NULL, " "); - if (argv[i] == NULL) { - Warning(LGPFX" %s mandatory argument %u is missing!\n", - __FUNCTION__, i); + if (argv[argc] == NULL) { + break; + } + } + if ((argc < 4) || ((argc == FL_MAX_ARGS) && (strtok(NULL, " ") != NULL))) { + goto corrupt; + } + + /* + * Lock file arguments are space separated. There is a minimum of 4 + * arguments - machineID, executionID, Lamport number and lock type. + * The maximum number of arguments is FL_MAX_ARGS. + * + * The fifth argument, if present, is the payload or "[" if there is no + * payload and additional arguments are present. The additional arguments + * form a properly 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 contents, no payload, no list entries + * A B C D [ contents, no payload, no list entries + * A B C D P contents, a payload, no list entries + * A B C D [ x contents, no payload, one list entry + * A B C D P x contents, a payload, one list entry + * A B C D [ x y contents, no payload, two list entries + * A B C D P x y contents, a payload, two list entries + */ + + memberValues->locationChecksum = NULL; + + if (argc == 4) { + memberValues->payload = NULL; + } else { + if (strcmp(argv[4], "[") == 0) { + memberValues->payload = NULL; + } else { + memberValues->payload = argv[4]; + } + + if (FileLockParseArgs(argv, argc - 5, &table, 1)) { goto corrupt; } } - memberValues->payload = strtok(NULL, " "); - if (sscanf(argv[2], "%u", &memberValues->lamportNumber) != 1) { - Warning(LGPFX" %s Lamport number conversion error\n", - __FUNCTION__); - goto corrupt; } if ((strcmp(argv[3], LOCK_SHARED) != 0) && (strcmp(argv[3], LOCK_EXCLUSIVE) != 0)) { - Warning(LGPFX" %s unknown lock type '%s'\n", __FUNCTION__, argv[3]); - goto corrupt; } @@ -316,12 +419,20 @@ return 0; corrupt: -// XXX unicode "string" in message Warning(LGPFX" %s removing problematic lock file '%s'\n", __FUNCTION__, - path); + UTF8(path)); + + if (argc) { + Log(LGPFX" %s '%s' contents are:\n", __FUNCTION__, UTF8(fileName)); + + for (len = 0; len < argc; len++) { + Log(LGPFX" %s %s argv[%d]: '%s'\n", __FUNCTION__, UTF8(fileName), + len, argv[len]); + } + } /* Remove the lock file and behave like it has disappeared */ - err = FileDeletion(path, FALSE); + err = FileDeletionRobust(path, FALSE); if (err == 0) { err = ENOENT; @@ -339,14 +450,14 @@ * * FileLockValidName -- * - * Validate the format of the file name. + * Validate the format of the file name. * * Results: - * TRUE yes - * FALSE No + * TRUE Yes + * FALSE No * * Side effects: - * None + * None * *----------------------------------------------------------------------------- */ @@ -359,21 +470,21 @@ ASSERT(fileName); /* The fileName must start with the ASCII character, 'M', 'D' or 'E' */ - if (Unicode_FindSubstrInRange(U("MDE"), 0, -1, fileName, 0, + 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(U("0123456789"), 0, -1, fileName, i + 1, + 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, U(FILELOCK_SUFFIX)); + return Unicode_EndsWith(fileName, FILELOCK_SUFFIX); } @@ -382,14 +493,14 @@ * * ActivateLockList * - * Insure a lock list entry exists for the lock directory. + * Insure a lock list entry exists for the lock directory. * * Results: - * 0 success - * > 0 error (errno) + * 0 success + * > 0 error (errno) * * Side effects: - * None. + * None. * *----------------------------------------------------------------------------- */ @@ -402,7 +513,7 @@ ASSERT(dirName); - ASSERT(Unicode_StartsWith(dirName, U("D"))); + ASSERT(Unicode_StartsWith(dirName, "D")); /* Search the list for a matching entry */ for (ptr = myValues->lockList; ptr != NULL; ptr = ptr->next) { @@ -413,11 +524,7 @@ /* No entry? Attempt to add one. */ if (ptr == NULL) { - ptr = malloc(sizeof *ptr); - - if (ptr == NULL) { - return ENOMEM; - } + ptr = Util_SafeMalloc(sizeof *ptr); ptr->next = myValues->lockList; myValues->lockList = ptr; @@ -436,17 +543,63 @@ /* *----------------------------------------------------------------------------- * + * FileLockLocationChecksum -- + * + * Compute the location checksum of the argument path. + * + * Results: + * The location checksum as dynamically allocated string. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static char * +FileLockLocationChecksum(ConstUnicode path) // IN: +{ + int c; + uint32 hash = 5381; + +#if defined(_WIN32) + char *p; + Unicode 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) + Unicode_Free(value); +#endif + + return Str_SafeAsprintf(NULL, "%u", hash); +} + + +/* + *----------------------------------------------------------------------------- + * * ScanDirectory -- * - * Call the specified function for each member file found in the - * specified directory. + * Call the specified function for each member file found in the + * specified directory. * * Results: - * 0 success - * > 0 failure + * 0 success + * > 0 failure * * Side effects: - * Anything that this not a valid locking file is deleted. + * Anything that this not a valid locking file is deleted. * *----------------------------------------------------------------------------- */ @@ -463,37 +616,37 @@ Bool cleanUp) // IN: { uint32 i; - int err; - int numEntries; + int err; + int numEntries; - char **fileList = NULL; + Unicode *fileList = NULL; + char *myExecutionID = NULL; + char *locationChecksum = NULL; ASSERT(lockDir); - numEntries = File_ListDirectory(lockDir, &fileList); + numEntries = FileListDirectoryRobust(lockDir, &fileList); if (numEntries == -1) { -// XXX unicode "string" in message - Log(LGPFX" %s: Could not read the directory '%s'.\n", - __FUNCTION__, lockDir); + Log(LGPFX" %s: Could not read the directory '%s': %d\n", + __FUNCTION__, UTF8(lockDir), Err_Errno()); - return EDOM; // out of my domain + 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])) { -// XXX unicode "string" in message Log(LGPFX" %s discarding %s from %s'; invalid file name.\n", - __FUNCTION__, fileList[i], lockDir); + __FUNCTION__, UTF8(fileList[i]), UTF8(lockDir)); err = RemoveLockingFile(lockDir, fileList[i]); if (err != 0) { goto bail; } - free(fileList[i]); + Unicode_Free(fileList[i]); fileList[i] = NULL; continue; @@ -506,7 +659,7 @@ * this will cleaned-up. */ - if (*fileList[i] == 'D') { + if (Unicode_StartsWith(fileList[i], "D")) { if (cleanUp) { err = ActivateLockList(fileList[i], myValues); if (err != 0) { @@ -514,7 +667,7 @@ } } - free(fileList[i]); + Unicode_Free(fileList[i]); fileList[i] = NULL; } } @@ -523,6 +676,9 @@ goto bail; } + myExecutionID = FileLockGetExecutionID(); + locationChecksum = FileLockLocationChecksum(lockDir); + /* Pass 2: Handle the 'M' entries */ for (i = 0, err = 0; i < numEntries; i++) { LockValues *ptr; @@ -530,12 +686,13 @@ LockValues memberValues; char buffer[FILELOCK_DATA_SIZE]; - if ((fileList[i] == NULL) || (*fileList[i] == 'E')) { + if ((fileList[i] == NULL) || + (Unicode_StartsWith(fileList[i], "E"))) { continue; } - myLockFile = strcmp(fileList[i], - myValues->memberName) == 0 ? TRUE : FALSE; + myLockFile = (Unicode_Compare(fileList[i], + myValues->memberName) == 0) ? TRUE : FALSE; if (myLockFile) { /* It's me! No need to read or validate anything. */ @@ -555,23 +712,37 @@ break; } - Unicode_Free(memberValues.memberName); - /* Remove any stale locking files */ if (FileLockMachineIDMatch(myValues->machineID, - memberValues.machineID) && - !FileLockValidOwner(memberValues.executionID, - memberValues.payload)) { -// XXX unicode "string" in message - Log(LGPFX" %s discarding %s from %s'; invalid executionID.\n", - __FUNCTION__, fileList[i], lockDir); + memberValues.machineID)) { + char *dispose = NULL; - err = RemoveLockingFile(lockDir, fileList[i]); - if (err != 0) { - break; + if (FileLockValidOwner(memberValues.executionID, + memberValues.payload)) { + /* 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 = "lock file has been moved."; + } + } else { + dispose = "invalid executionID."; } - continue; + if (dispose) { + Log(LGPFX" %s discarding %s from %s': %s\n", + __FUNCTION__, UTF8(fileList[i]), UTF8(lockDir), dispose); + + Unicode_Free(memberValues.memberName); + + err = RemoveLockingFile(lockDir, fileList[i]); + if (err != 0) { + break; + } + + continue; + } } ptr = &memberValues; @@ -579,6 +750,11 @@ /* Locking file looks good; see what happens */ err = (*func)(lockDir, fileList[i], ptr, myValues); + + if (ptr == &memberValues) { + Unicode_Free(memberValues.memberName); + } + if (err != 0) { break; } @@ -587,10 +763,12 @@ bail: for (i = 0; i < numEntries; i++) { - free(fileList[i]); + Unicode_Free(fileList[i]); } free(fileList); + free(locationChecksum); + free(myExecutionID); return err; } @@ -601,16 +779,16 @@ * * Scanner -- * - * 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. + * 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 + * 0 success + * > 0 failure * * Side effects: - * None + * None * *----------------------------------------------------------------------------- */ @@ -658,28 +836,25 @@ Unicode path; UnicodeIndex index; - ASSERT(Unicode_StartsWith(ptr->dirName, U("D"))); + ASSERT(Unicode_StartsWith(ptr->dirName, "D")); -// XXX unicode "string" in message Log(LGPFX" %s discarding %s data from '%s'.\n", - __FUNCTION__, ptr->dirName, lockDir); + __FUNCTION__, UTF8(ptr->dirName), UTF8(lockDir)); - temp = Unicode_Append(lockDir, U(DIRSEPS)); - path = Unicode_Append(temp, ptr->dirName); - Unicode_Free(temp); + path = Unicode_Join(lockDir, DIRSEPS, ptr->dirName, NULL); - index = Unicode_FindLast(path, U("D")); + index = Unicode_FindLast(path, "D"); ASSERT(index != UNICODE_INDEX_NOT_FOUND); - temp = Unicode_Replace(path, index, 1, U("M")); - FileDeletion(temp, FALSE); + temp = Unicode_Replace(path, index, 1, "M"); + FileDeletionRobust(temp, FALSE); Unicode_Free(temp); - temp = Unicode_Replace(path, index, 1, U("E")); - FileDeletion(temp, FALSE); + temp = Unicode_Replace(path, index, 1, "E"); + FileDeletionRobust(temp, FALSE); Unicode_Free(temp); - FileRemoveDirectory(path); + FileRemoveDirectoryRobust(path); Unicode_Free(path); @@ -728,60 +903,28 @@ * * FileUnlockIntrinsic -- * - * Release a lock on a file. - * - * The locker is required to identify themselves in a "universally - * unique" manner. This is done via two parameters: - * - * machineID -- - * This a machine/hardware identifier string. - * - * The MAC address of a hardware Ethernet, a WWN of a - * hardware FibreChannel HBA, the UUID of an Infiniband HBA - * and a machine serial number (e.g. Macs) are all good - * candidates for a machine identifier. - * - * executionID -- - * This is an string which differentiates one thread of - * execution from another within the host OS. In a - * non-threaded environment this can simply be some form - * of process identifier (e.g. getpid() on UNIXen or - * _getpid() on Windows). When a process makes use of - * threads AND more than one thread may perform locking - * this identifier must discriminate between all threads - * within the process. - * - * All of the ID strings must encode their respective information - * such that any OS may utilize the strings as part of a file name. - * Keep them short and, at a minimum, do not use ':', '/', '\', '.' - * and white space characters. + * Release a lock on a file. * * Results: - * 0 unlocked - * > 0 errno + * 0 unlocked + * > 0 errno * * Side effects: - * None. + * None. * *----------------------------------------------------------------------------- */ int -FileUnlockIntrinsic(const char *machineID, // IN: - const char *executionID, // IN: - ConstUnicode pathName, // IN: - const void *lockToken) // IN: +FileUnlockIntrinsic(ConstUnicode pathName, // IN: + const void *lockToken) // IN: { int err; - ASSERT(machineID); - ASSERT(executionID); ASSERT(pathName); ASSERT(lockToken); -// XXX unicode "string" in message - LOG(1, ("Releasing lock on %s (%s, %s).\n", pathName, - machineID, executionID)); + LOG(1, ("Requesting unlock on %s\n", UTF8(pathName))); if (lockToken == &implicitReadToken) { /* @@ -791,10 +934,10 @@ err = 0; } else { - Unicode dirPath; + Unicode lockDir; /* The lock directory path */ - dirPath = Unicode_Append(pathName, U(FILELOCK_SUFFIX)); + lockDir = Unicode_Append(pathName, FILELOCK_SUFFIX); /* * The lock token is the (unicode) path of the lock file. @@ -803,12 +946,11 @@ * matching the machineID and executionID. */ - err = FileDeletion((Unicode) lockToken, FALSE); + err = FileDeletionRobust((Unicode) lockToken, FALSE); if (err && vmx86_debug) { -// XXX unicode "string" in message Log(LGPFX" %s failed for '%s': %s\n", - __FUNCTION__, (Unicode) lockToken, strerror(err)); + __FUNCTION__, (char *) lockToken, strerror(err)); } /* @@ -818,9 +960,9 @@ Unicode_Free((Unicode) lockToken); - FileRemoveDirectory(dirPath); // just in case we can clean up + FileRemoveDirectoryRobust(lockDir); // just in case we can clean up - Unicode_Free(dirPath); + Unicode_Free(lockDir); } return err; @@ -832,15 +974,15 @@ * * WaitForPossession -- * - * Wait until the caller has a higher priority towards taking - * possession of a lock than the specified file. + * Wait until the caller has a higher priority towards taking + * possession of a lock than the specified file. * * Results: - * 0 success - * > 0 error (errno) + * 0 success + * > 0 error (errno) * * Side effects: - * None. + * None. * *----------------------------------------------------------------------------- */ @@ -863,7 +1005,6 @@ myValues->memberName) < 0))) && ((strcmp(memberValues->lockType, LOCK_EXCLUSIVE) == 0) || (strcmp(myValues->lockType, LOCK_EXCLUSIVE) == 0))) { - Unicode temp; Unicode path; uint32 loopCount; Bool thisMachine; @@ -873,13 +1014,11 @@ loopCount = 0; - temp = Unicode_Append(lockDir, U(DIRSEPS)); - path = Unicode_Append(temp, fileName); - Unicode_Free(temp); + path = Unicode_Join(lockDir, DIRSEPS, fileName, NULL); while ((err = Sleeper(myValues, &loopCount)) == 0) { /* still there? */ - err = FileAttributes(path, NULL); + err = FileAttributesRobust(path, NULL); if (err != 0) { if (err == ENOENT) { /* Not there anymore; locker unlocked or timed out */ @@ -893,9 +1032,8 @@ if (thisMachine && !FileLockValidOwner(memberValues->executionID, memberValues->payload)) { /* Invalid Execution ID; remove the member file */ -// XXX unicode "string" in message Warning(LGPFX" %s discarding file '%s'; invalid executionID.\n", - __FUNCTION__, path); + __FUNCTION__, UTF8(path)); err = RemoveLockingFile(lockDir, fileName); break; @@ -910,13 +1048,11 @@ if ((myValues->msecMaxWaitTime != FILELOCK_TRYLOCK_WAIT) && (err == EAGAIN)) { if (thisMachine) { -// XXX unicode "string" in message Log(LGPFX" %s timeout on '%s' due to a local process (%s)\n", - __FUNCTION__, path, memberValues->executionID); + __FUNCTION__, UTF8(path), memberValues->executionID); } else { -// XXX unicode "string" in message Log(LGPFX" %s timeout on '%s' due to another machine (%s)\n", - __FUNCTION__, path, memberValues->machineID); + __FUNCTION__, UTF8(path), memberValues->machineID); } } @@ -932,14 +1068,14 @@ * * NumberScan -- * - * Determine the maxmimum number value within the current locking set. + * Determine the maxmimum number value within the current locking set. * * Results: - * 0 success - * > 0 failure (errno) + * 0 success + * > 0 failure (errno) * * Side effects: - * None. + * None. * *----------------------------------------------------------------------------- */ @@ -966,13 +1102,13 @@ * * SimpleRandomNumber -- * - * Return a random number in the range of 0 and 2^16-1. + * Return a random number in the range of 0 and 2^16-1. * * Results: - * Random number is returned. + * Random number is returned. * * Side Effects: - * None. + * None. * *----------------------------------------------------------------------------- */ @@ -1022,11 +1158,11 @@ * * MakeDirectory -- * - * Create a directory. + * Create a directory. * * Results: - * 0 success - * > 0 failure (errno) + * 0 success + * > 0 failure (errno) * * Side Effects: * File system may be modified. @@ -1035,19 +1171,21 @@ */ static int -MakeDirectory(ConstUnicode pathName) +MakeDirectory(ConstUnicode pathName) // IN: { int err; - ASSERT(pathName); - #if !defined(_WIN32) mode_t save; + ASSERT(pathName); + save = umask(0); +#else + ASSERT(pathName); #endif - err = FileCreateDirectory(pathName); + err = FileCreateDirectoryRobust(pathName); #if !defined(_WIN32) umask(save); @@ -1062,22 +1200,22 @@ * * CreateEntryDirectory -- * - * Create an entry directory in the specified locking directory. + * Create an entry directory in the specified locking directory. * - * Due to FileLock_UnlockFile() 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. + * Due to FileLock_UnlockFile() 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) + * 0 success + * > 0 failure (errno) * * Side Effects: - * On success returns the number identifying the entry directory and - * the entry directory path name. + * On success returns the number identifying the entry directory and + * the entry directory path name. * *----------------------------------------------------------------------------- */ @@ -1105,11 +1243,9 @@ while (TRUE) { Unicode temp; - Unicode temp2; FileData fileData; - char string[FILELOCK_OVERHEAD]; - err = FileAttributes(lockDir, &fileData); + err = FileAttributesRobust(lockDir, &fileData); if (err == 0) { /* The name exists. Deal with it... */ @@ -1120,9 +1256,8 @@ * automatically upgrade to a new style lock). */ -// XXX unicode "string" in message Log(LGPFX" %s: '%s' exists; an old style lock file?\n", - __FUNCTION__, lockDir); + __FUNCTION__, UTF8(lockDir)); err = EAGAIN; break; @@ -1130,10 +1265,9 @@ if (fileData.fileType != FILE_TYPE_DIRECTORY) { /* Not a directory; attempt to remove the debris */ - if (FileDeletion(lockDir, FALSE) != 0) { -// XXX unicode "string" in message + if (FileDeletionRobust(lockDir, FALSE) != 0) { Warning(LGPFX" %s: '%s' exists and is not a directory.\n", - __FUNCTION__, lockDir); + __FUNCTION__, UTF8(lockDir)); err = ENOTDIR; break; @@ -1147,16 +1281,14 @@ err = MakeDirectory(lockDir); if ((err != 0) && (err != EEXIST)) { -// XXX unicode "string" in message Warning(LGPFX" %s creation failure on '%s': %s\n", - __FUNCTION__, lockDir, strerror(err)); + __FUNCTION__, UTF8(lockDir), strerror(err)); break; } } else { -// XXX unicode "string" in message Warning(LGPFX" %s stat failure on '%s': %s\n", - __FUNCTION__, lockDir, strerror(err)); + __FUNCTION__, UTF8(lockDir), strerror(err)); break; } @@ -1165,32 +1297,17 @@ /* There is a small chance of collision/failure; grab stings now */ randomNumber = SimpleRandomNumber(machineID, executionID); - Str_Sprintf(string, sizeof string, "M%05u%s", randomNumber, - FILELOCK_SUFFIX); + *memberName = Unicode_Format("M%05u%s", randomNumber, FILELOCK_SUFFIX); - *memberName = Unicode_Alloc(string, STRING_ENCODING_US_ASCII); - - Str_Sprintf(string, sizeof string, "D%05u%s", randomNumber, - FILELOCK_SUFFIX); - - temp = Unicode_Append(lockDir, U(DIRSEPS)); - temp2 = Unicode_Alloc(string, STRING_ENCODING_US_ASCII); - *entryDirectory = Unicode_Append(temp, temp2); + temp = Unicode_Format("D%05u%s", randomNumber, FILELOCK_SUFFIX); + *entryDirectory = Unicode_Join(lockDir, DIRSEPS, temp, NULL); Unicode_Free(temp); - Unicode_Free(temp2); - Str_Sprintf(string, sizeof string, "E%05u%s", randomNumber, - FILELOCK_SUFFIX); - - temp = Unicode_Append(lockDir, U(DIRSEPS)); - temp2 = Unicode_Alloc(string, STRING_ENCODING_US_ASCII); - *entryFilePath = Unicode_Append(temp, temp2); + temp = Unicode_Format("E%05u%s", randomNumber, FILELOCK_SUFFIX); + *entryFilePath = Unicode_Join(lockDir, DIRSEPS, temp, NULL); Unicode_Free(temp); - Unicode_Free(temp2); - temp = Unicode_Append(lockDir, U(DIRSEPS)); - *memberFilePath = Unicode_Append(temp, *memberName); - Unicode_Free(temp); + *memberFilePath = Unicode_Join(lockDir, DIRSEPS, *memberName, NULL); err = MakeDirectory(*entryDirectory); @@ -1205,7 +1322,7 @@ * good member files. */ - err = FileAttributes(*memberFilePath, NULL); + err = FileAttributesRobust(*memberFilePath, NULL); if (err != 0) { if (err == ENOENT) { @@ -1214,18 +1331,17 @@ } if (vmx86_debug) { -// XXX unicode "string" in message Log(LGPFX" %s stat failure on '%s': %s\n", - __FUNCTION__, *memberFilePath, strerror(err)); + __FUNCTION__, UTF8(*memberFilePath), strerror(err)); } } - FileRemoveDirectory(*entryDirectory); + FileRemoveDirectoryRobust(*entryDirectory); } else { - if (err != EEXIST) { -// XXX unicode "string" in message + 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)); + __FUNCTION__, UTF8(*entryDirectory), strerror(err)); break; } @@ -1262,14 +1378,14 @@ * * CreateMemberFile -- * - * Create the member file. + * Create the member file. * * Results: - * 0 success - * > 0 failure (errno) + * 0 success + * > 0 failure (errno) * * Side Effects: - * None + * None * *----------------------------------------------------------------------------- */ @@ -1287,19 +1403,32 @@ ASSERT(entryFilePath); ASSERT(memberFilePath); - /* Populate the buffer with appropriate data */ - Str_Sprintf(buffer, sizeof buffer, "%s %s %u %s %s", myValues->machineID, - myValues->executionID, myValues->lamportNumber, + /* + * Populate the buffer with appropriate data + * + * Lock file arguments are space separated. There is a minimum of 4 + * arguments - machineID, executionID, Lamport number and lock type. + * The maximum number of argument is FL_MAX_ARGS. + * + * The fifth argument, if present, is the payload or "[" if there is no + * payload and additional arguments are present. The additional arguments + * form a properly list - one or more "name=value" pairs. + */ + + Str_Sprintf(buffer, sizeof buffer, "%s %s %u %s %s lc=%s", + myValues->machineID, + myValues->executionID, + myValues->lamportNumber, myValues->lockType, - myValues->payload == NULL ? "" : myValues->payload); + myValues->payload == NULL ? "[" : myValues->payload, + myValues->locationChecksum); /* Attempt to write the data */ err = FileLockWriteFile(entryHandle, buffer, sizeof buffer, &len); if (err != 0) { -// XXX unicode "string" in message Warning(LGPFX" %s write of '%s' failed: %s\n", __FUNCTION__, - entryFilePath, strerror(err)); + UTF8(entryFilePath), strerror(err)); FileLockCloseFile(entryHandle); @@ -1309,17 +1438,15 @@ err = FileLockCloseFile(entryHandle); if (err != 0) { -// XXX unicode "string" in message Warning(LGPFX" %s close of '%s' failed: %s\n", __FUNCTION__, - entryFilePath, strerror(err)); + UTF8(entryFilePath), strerror(err)); return err; } if (len != sizeof buffer) { -// XXX unicode "string" in message Warning(LGPFX" %s write length issue on '%s': %u and %"FMTSZ"d\n", - __FUNCTION__, entryFilePath, len, sizeof buffer); + __FUNCTION__, UTF8(entryFilePath), len, sizeof buffer); return EIO; } @@ -1327,21 +1454,18 @@ err = FileRename(entryFilePath, memberFilePath); if (err != 0) { -// XXX unicode "string" in message Warning(LGPFX" %s FileRename of '%s' to '%s' failed: %s\n", - __FUNCTION__, entryFilePath, memberFilePath, + __FUNCTION__, UTF8(entryFilePath), UTF8(memberFilePath), strerror(err)); if (vmx86_debug) { -// XXX unicode "string" in message Log(LGPFX" %s FileLockFileType() of '%s': %s\n", - __FUNCTION__, entryFilePath, - strerror(FileAttributes(entryFilePath, NULL))); + __FUNCTION__, UTF8(entryFilePath), + strerror(FileAttributesRobust(entryFilePath, NULL))); -// XXX unicode "string" in message Log(LGPFX" %s FileLockFileType() of '%s': %s\n", - __FUNCTION__, memberFilePath, - strerror(FileAttributes(memberFilePath, NULL))); + __FUNCTION__, UTF8(memberFilePath), + strerror(FileAttributesRobust(memberFilePath, NULL))); } return err; @@ -1355,114 +1479,71 @@ * * FileLockIntrinsic -- * - * Obtain a lock on a file; shared or exclusive access. - * - * Each locker is required to identify themselves in a "universally - * unique" manner. This is done via two parameters: + * Obtain a lock on a file; shared or exclusive access. * - * machineID -- - * This a machine/hardware identifier string. - * - * The MAC address of a hardware Ethernet, a WWN of a - * hardware FibreChannel HBA, the UUID of an Infiniband HBA - * and a machine serial number (e.g. Macs) are all good - * candidates for a machine identifier. - * - * The machineID is "univerally unique", discriminating - * between all computational platforms. - * - * executionID -- - * This is an string which differentiates one thread of - * execution from another within the host OS. In a - * non-threaded environment this can simply be some form - * of process identifier (e.g. getpid() on UNIXen or - * _getpid() on Windows). When a process makes use of - * threads AND more than one thread may perform locking - * this identifier must discriminate between all threads - * within the process. - * - * All of the ID strings must encode their respective information - * such that any OS may utilize the strings as part of a file name. - * Keep them short and, at a minimum, do not use ':', '/', '\', '.' - * and white space characters. - * - * 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. + * 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. + * 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. + * None. * *----------------------------------------------------------------------------- */ void * -FileLockIntrinsic(const char *machineID, // IN: - const char *executionID, // IN: - const char *payload, // IN: - ConstUnicode pathName, // IN: - Bool exclusivity, // IN: - uint32 msecMaxWaitTime, // IN: - int *err) // OUT: +FileLockIntrinsic(ConstUnicode pathName, // IN: + Bool exclusivity, // IN: + uint32 msecMaxWaitTime, // IN: + const char *payload, // IN: + int *err) // OUT: { FILELOCK_FILE_HANDLE handle; LockValues myValues; - Unicode dirPath = NULL; + Unicode lockDir = NULL; Unicode entryFilePath = NULL; Unicode memberFilePath = NULL; Unicode entryDirectory = NULL; - ASSERT(machineID); - ASSERT(executionID); ASSERT(pathName); ASSERT(err); + /* Construct the locking directory path */ + lockDir = Unicode_Append(pathName, FILELOCK_SUFFIX); + /* establish our values */ - myValues.machineID = (char *) machineID; - myValues.executionID = (char *) executionID; + + myValues.machineID = (char *) FileLockGetMachineID(); // don't free this! + myValues.executionID = FileLockGetExecutionID(); // free this! myValues.payload = (char *) payload; myValues.lockType = exclusivity ? LOCK_EXCLUSIVE : LOCK_SHARED; myValues.lamportNumber = 0; + myValues.locationChecksum = FileLockLocationChecksum(lockDir); // free this! myValues.waitTime = 0; myValues.msecMaxWaitTime = msecMaxWaitTime; myValues.memberName = NULL; -// XXX unicode "string" in message LOG(1, ("Requesting %s lock on %s (%s, %s, %u).\n", - myValues.lockType, pathName, myValues.machineID, + myValues.lockType, UTF8(pathName), myValues.machineID, myValues.executionID, myValues.msecMaxWaitTime)); /* - * Enforce the maximum path length restriction explicitely. Apparently - * the Windows POSIX routine mappings cannot be trusted to return - * ENAMETOOLONG when it is appropriate. - */ - - if ((Unicode_LengthInCodeUnits(pathName) + - FILELOCK_OVERHEAD) >= FILE_MAXPATH) { - *err = ENAMETOOLONG; - goto bail; - } - - /* Construct the locking directory path */ - dirPath = Unicode_Append(pathName, U(FILELOCK_SUFFIX)); - - /* * Attempt to create the locking and entry directories; obtain the * entry and member path names. */ - *err = CreateEntryDirectory(machineID, executionID, dirPath, + *err = CreateEntryDirectory(myValues.machineID, myValues.executionID, + lockDir, &entryDirectory, &entryFilePath, &memberFilePath, &myValues.memberName); @@ -1480,9 +1561,8 @@ * The address of a private variable will be used for the lock token. */ -// XXX unicode "string" in message Warning(LGPFX" %s implicit %s lock succeeded on '%s'.\n", - __FUNCTION__, LOCK_SHARED, pathName); + __FUNCTION__, LOCK_SHARED, UTF8(pathName)); *err = 0; memberFilePath = &implicitReadToken; @@ -1501,21 +1581,21 @@ if (*err != 0) { /* clean up */ - FileRemoveDirectory(entryDirectory); - FileRemoveDirectory(dirPath); + FileRemoveDirectoryRobust(entryDirectory); + FileRemoveDirectoryRobust(lockDir); goto bail; } /* what is max(Number[1]... Number[all lockers])? */ - *err = Scanner(dirPath, NumberScan, &myValues, FALSE); + *err = Scanner(lockDir, NumberScan, &myValues, FALSE); if (*err != 0) { /* clean up */ FileLockCloseFile(handle); - FileDeletion(entryFilePath, FALSE); - FileRemoveDirectory(entryDirectory); - FileRemoveDirectory(dirPath); + FileDeletionRobust(entryFilePath, FALSE); + FileRemoveDirectoryRobust(entryDirectory); + FileRemoveDirectoryRobust(lockDir); goto bail; } @@ -1527,19 +1607,19 @@ *err = CreateMemberFile(handle, &myValues, entryFilePath, memberFilePath); /* Remove entry directory; it has done its job */ - FileRemoveDirectory(entryDirectory); + FileRemoveDirectoryRobust(entryDirectory); if (*err != 0) { /* clean up */ - FileDeletion(entryFilePath, FALSE); - FileDeletion(memberFilePath, FALSE); - FileRemoveDirectory(dirPath); + FileDeletionRobust(entryFilePath, FALSE); + FileDeletionRobust(memberFilePath, FALSE); + FileRemoveDirectoryRobust(lockDir); goto bail; } /* Attempt to acquire the lock */ - *err = Scanner(dirPath, WaitForPossession, &myValues, TRUE); + *err = Scanner(lockDir, WaitForPossession, &myValues, TRUE); switch (*err) { case 0: @@ -1547,8 +1627,8 @@ case EAGAIN: /* clean up */ - FileDeletion(memberFilePath, FALSE); - FileRemoveDirectory(dirPath); + FileDeletionRobust(memberFilePath, FALSE); + FileRemoveDirectoryRobust(lockDir); /* FALL THROUGH */ default: @@ -1557,10 +1637,12 @@ bail: - Unicode_Free(dirPath); + Unicode_Free(lockDir); Unicode_Free(entryDirectory); Unicode_Free(entryFilePath); Unicode_Free(myValues.memberName); + free(myValues.locationChecksum); + free(myValues.executionID); if (*err != 0) { Unicode_Free(memberFilePath); @@ -1580,14 +1662,14 @@ * * ScannerVMX -- * - * VMX hack scanner + * VMX hack scanner * * Results: - * 0 success - * > 0 error (errno) + * 0 success + * > 0 error (errno) * * Side effects: - * None. + * None. * *----------------------------------------------------------------------------- */ @@ -1612,50 +1694,49 @@ * * FileLockHackVMX -- * - * The VMX file delete primitive. + * The VMX file delete primitive. * * Results: - * 0 unlocked - * > 0 errno + * 0 unlocked + * > 0 errno * * Side effects: * Changes the host file system. * * Note: - * THIS IS A HORRIBLE HACK AND NEEDS TO BE REMOVED ASAP!!! + * THIS IS A HORRIBLE HACK AND NEEDS TO BE REMOVED ASAP!!! * *---------------------------------------------------------------------- */ int -FileLockHackVMX(const char *machineID, // IN: - const char *executionID, // IN: - ConstUnicode pathName) // IN: +FileLockHackVMX(ConstUnicode pathName) // IN: { - int err; + int err; LockValues myValues; - Unicode dirPath = NULL; + Unicode lockDir = NULL; Unicode entryFilePath = NULL; Unicode memberFilePath = NULL; Unicode entryDirectory = NULL; ASSERT(pathName); -// XXX unicode "string" in message - LOG(1, ("%s on %s (%s, %s).\n", __FUNCTION__, pathName, - machineID, executionID)); + /* first the locking directory path name */ + lockDir = Unicode_Append(pathName, FILELOCK_SUFFIX); /* establish our values */ - myValues.machineID = (char *) machineID; - myValues.executionID = (char *) executionID; + myValues.machineID = (char *) FileLockGetMachineID(); // don't free this! + myValues.executionID = FileLockGetExecutionID(); // free this! + myValues.locationChecksum = FileLockLocationChecksum(lockDir); // free this! myValues.lamportNumber = 0; myValues.memberName = NULL; - /* first the locking directory path name */ - dirPath = Unicode_Append(pathName, U(FILELOCK_SUFFIX)); + LOG(1, ("%s on %s (%s, %s).\n", __FUNCTION__, UTF8(pathName), + myValues.machineID, myValues.executionID)); - err = CreateEntryDirectory(machineID, executionID, dirPath, + err = CreateEntryDirectory(myValues.machineID, myValues.executionID, + lockDir, &entryDirectory, &entryFilePath, &memberFilePath, &myValues.memberName); @@ -1664,32 +1745,33 @@ } /* Scan the lock directory */ - err = Scanner(dirPath, ScannerVMX, &myValues, FALSE); + err = Scanner(lockDir, ScannerVMX, &myValues, FALSE); if (err == 0) { /* if no members are valid, clean up */ if (myValues.lamportNumber == 1) { - FileDeletion(pathName, FALSE); + FileDeletionRobust(pathName, FALSE); } } else { if (vmx86_debug) { -// XXX unicode "string" in message Warning(LGPFX" %s clean-up failure for '%s': %s\n", - __FUNCTION__, pathName, strerror(err)); + __FUNCTION__, UTF8(pathName), strerror(err)); } } /* clean up */ - FileRemoveDirectory(entryDirectory); - FileRemoveDirectory(dirPath); + FileRemoveDirectoryRobust(entryDirectory); + FileRemoveDirectoryRobust(lockDir); bail: - Unicode_Free(dirPath); + Unicode_Free(lockDir); Unicode_Free(entryDirectory); Unicode_Free(entryFilePath); Unicode_Free(memberFilePath); Unicode_Free(myValues.memberName); + free(myValues.locationChecksum); + free(myValues.executionID); return err; } diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/file/filePosix.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/file/filePosix.c --- open-vm-tools-2008.01.23-74039/lib/file/filePosix.c 2008-01-28 08:02:51.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/file/filePosix.c 2008-10-13 08:01:51.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -24,8 +24,10 @@ #include /* Needed before sys/vfs.h with glibc 2.0 --hpreg */ -#if !__FreeBSD__ -# if !__APPLE__ +#if defined(__FreeBSD__) +# include +#else +# if !defined(__APPLE__) # include # endif # include @@ -51,16 +53,17 @@ #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 "unicodeBase.h" #include "unicodeOperations.h" #if !defined(__FreeBSD__) && !defined(sun) @@ -84,6 +87,31 @@ /* + * XXX + * FTS is not available on all posix platforms that we care about. + * We depend on FTS for a simple pre-order file traversal. For the Windows + * implementation we need to write our own traversal code anyway. When that + * happens the prosix version should be updated to use the generic code. + */ + +#if defined(__USE_FILE_OFFSET64) || defined(sun) +# define CAN_USE_FTS 0 +#else +# define CAN_USE_FTS 1 +#endif + +#if CAN_USE_FTS +# include + +struct WalkDirContextImpl +{ + FTS *fts; +}; + +#endif + + +/* * Local functions */ @@ -110,24 +138,7 @@ int FileRemoveDirectory(ConstUnicode pathName) // IN: { - int err; - char *path; - - if (pathName == NULL) { - return EFAULT; - } - - path = Unicode_GetAllocBytes(pathName, STRING_ENCODING_DEFAULT); - - if (path == NULL) { - err = ENOMEM; - } else { - err = (rmdir(path) == -1) ? errno : 0; - - free(path); - } - - return err; + return (Posix_Rmdir(pathName) == -1) ? errno : 0; } @@ -152,27 +163,7 @@ FileRename(ConstUnicode oldName, // IN: ConstUnicode newName) // IN: { - int err; - char *newPath; - char *oldPath; - - if ((oldName == NULL) || (newName == NULL)) { - return EFAULT; - } - - newPath = Unicode_GetAllocBytes(newName, STRING_ENCODING_DEFAULT); - oldPath = Unicode_GetAllocBytes(oldName, STRING_ENCODING_DEFAULT); - - if ((newPath == NULL) || (oldPath == NULL)) { - err = ENOMEM; - } else { - err = (rename(oldPath, newPath) == -1) ? errno : 0; - } - - free(newPath); - free(oldPath); - - return err; + return (Posix_Rename(oldName, newName) == -1) ? errno : 0; } @@ -196,19 +187,15 @@ FileDeletion(ConstUnicode pathName, // IN: const Bool handleLink) // IN: { - char *primaryPath; - - int err = 0; + int err; char *linkPath = NULL; + char *primaryPath = Unicode_GetAllocBytes(pathName, + STRING_ENCODING_DEFAULT); - if (pathName == NULL) { - return EFAULT; - } - - primaryPath = Unicode_GetAllocBytes(pathName, STRING_ENCODING_DEFAULT); - - if (primaryPath == NULL) { - return ENOMEM; + if (primaryPath == NULL && pathName != NULL) { + Log(LGPFX" %s: failed to convert \"%s\" to current encoding\n", + __FUNCTION__, UTF8(pathName)); + return UNICODE_CONVERSION_ERRNO; } if (handleLink) { @@ -220,12 +207,7 @@ } if (S_ISLNK(statbuf.st_mode)) { - linkPath = malloc(statbuf.st_size + 1); - - if (linkPath == NULL) { - err = ENOMEM; - goto bail; - } + linkPath = Util_SafeMalloc(statbuf.st_size + 1); if (readlink(primaryPath, linkPath, statbuf.st_size) != statbuf.st_size) { @@ -247,10 +229,8 @@ err = (unlink(primaryPath) == -1) ? errno : 0; bail: - free(primaryPath); free(linkPath); - return err; } @@ -283,7 +263,7 @@ * * FileAttributes -- * - * Return the attributes of a file. + * Return the attributes of a file. Time units are in OS native time. * * Results: * 0 success @@ -299,22 +279,10 @@ FileAttributes(ConstUnicode pathName, // IN: FileData *fileData) // OUT: { - char *path; + int err; struct stat statbuf; - int err = 0; - - if (pathName == NULL) { - return EFAULT; - } - - path = Unicode_GetAllocBytes(pathName, STRING_ENCODING_DEFAULT); - - if (path == NULL) { - return ENOMEM; - } - - if (stat(path, &statbuf) == -1) { + if (Posix_Stat(pathName, &statbuf) == -1) { err = errno; } else { if (fileData != NULL) { @@ -357,8 +325,6 @@ err = 0; } - free(path); - return err; } @@ -383,11 +349,11 @@ #if !defined(__FreeBSD__) && !defined(sun) Bool -File_IsRemote(const char *fileName) // IN: File name +File_IsRemote(ConstUnicode pathName) // IN: Path name { struct statfs sfbuf; -#ifdef VMX86_SERVER +#if defined(VMX86_SERVER) /* * On ESX, statfs() will always return VMFS_MAGIC for files on VMFS so this * function is only correct for files on COS, otherwise it always returns @@ -398,13 +364,15 @@ * XXX See PR 158284. It is not clear what the side-effects are of this * function being incorrect for VMFS files. */ + if (HostType_OSIsPureVMK()) { return FALSE; } #endif - if (statfs(fileName, &sfbuf) == -1) { - Log("%s: statfs(%s) failed: %s\n", __func__, fileName, Msg_ErrString()); + if (Posix_Statfs(pathName, &sfbuf) == -1) { + Log(LGPFX" %s: statfs(%s) failed: %s\n", __func__, UTF8(pathName), + strerror(errno)); return TRUE; } #if defined(__APPLE__) @@ -441,26 +409,10 @@ Bool File_IsSymLink(ConstUnicode pathName) // IN: { - char *path; struct stat statbuf; - int err = 0; - - if (pathName == NULL) { - return FALSE; - } - - path = Unicode_GetAllocBytes(pathName, STRING_ENCODING_DEFAULT); - - if (path == NULL) { - return FALSE; - } - - err = (lstat(path, &statbuf) == -1) ? errno : 0; - - free(path); - - return (err == 0) && S_ISLNK(statbuf.st_mode); + return (Posix_Lstat(pathName, &statbuf) == 0) && + S_ISLNK(statbuf.st_mode); } @@ -482,13 +434,14 @@ *---------------------------------------------------------------------- */ -char * -File_Cwd(const char *drive) // IN +Unicode +File_Cwd(ConstUnicode drive) // IN: { char buffer[FILE_MAXPATH]; - if ((drive != NULL) && (drive[0] != '\0')) { - Warning("Drive letter %s on Linux?\n", drive); + if ((drive != NULL) && !Unicode_IsEmpty(drive)) { + Warning(LGPFX" %s: Drive letter %s on Linux?\n", __FUNCTION__, + UTF8(drive)); } if (getcwd(buffer, FILE_MAXPATH) == NULL) { @@ -497,12 +450,13 @@ "Please check if the directory has been deleted or " "unmounted.\n", Msg_ErrString()); - Warning("%s:%d getcwd() failed: %s\n", - __FILE__, __LINE__, Msg_ErrString()); + Warning(LGPFX" %s: getcwd() failed: %s\n", __FUNCTION__, + Msg_ErrString()); + return NULL; }; - return Util_SafeStrdup(buffer); + return Unicode_Alloc(buffer, STRING_ENCODING_DEFAULT); } @@ -511,37 +465,45 @@ * * FileStripFwdSlashes -- * - * Strips off extraneous forward slashes ("/") from the pathnames. + * Returns a new string with the extraneous forward slashes ("/") removed. * * Results: - * Stripped off path over-written in the supplied argument. + * As documented. * * Side effects: - * Argument over-written. + * None * *---------------------------------------------------------------------- */ -static void -FileStripFwdSlashes(char *path) // IN/OUT +static Unicode +FileStripFwdSlashes(ConstUnicode pathName) // IN: { - char *cptr = path; - char *ptr = path; - char *prev = path; - - if (!path) { - return; - } + char *ptr; + char *path; + char *cptr; + char *prev; + Unicode 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. + * 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; - } + *cptr++ = *ptr; + } prev = ptr; } else { *cptr++ = *ptr; @@ -550,6 +512,12 @@ } *cptr = '\0'; + + result = Unicode_AllocWithUTF8(path); + + free(path); + + return result; } @@ -570,51 +538,45 @@ *---------------------------------------------------------------------- */ -char * -File_FullPath(const char *fileName) // IN +Unicode +File_FullPath(ConstUnicode pathName) // IN: { - char *cwd; - char *ret; - char buffer[FILE_MAXPATH]; - char rpath[FILE_MAXPATH]; + Unicode cwd; + Unicode ret; + Unicode temp; - if ((fileName != NULL) && (fileName[0] == '/')) { + if ((pathName != NULL) && File_IsFullPath(pathName)) { cwd = NULL; } else { cwd = File_Cwd(NULL); if (cwd == NULL) { - ret = NULL; - goto end; + return NULL; } } - if ((fileName == NULL) || (fileName[0] == '\0')) { - ret = cwd; - } else if (fileName[0] == '/') { - ret = (char *) fileName; + if ((pathName == NULL) || Unicode_IsEmpty(pathName)) { + temp = Unicode_Duplicate(cwd); + } else if (File_IsFullPath(pathName)) { + temp = Unicode_Duplicate(pathName); } else { - char *p; - int n; + Unicode path; - n = Str_Snprintf(buffer, FILE_MAXPATH, "%s/%s", cwd, fileName); - if (n < 0) { - Warning("%s: Couldn't snprintf\n", __func__); - ret = NULL; - goto end; - } + path = Unicode_Join(cwd, DIRSEPS, pathName, NULL); - p = realpath(buffer, rpath); + temp = Posix_RealPath(path); - ret = (p == NULL) ? buffer : rpath; + if (temp == NULL) { + temp = path; + } else { + Unicode_Free(path); + } } - ret = Util_SafeStrdup(ret); + ret = FileStripFwdSlashes(temp); + + Unicode_Free(temp); + Unicode_Free(cwd); -end: - FileStripFwdSlashes(ret); - if (cwd != NULL) { - free(cwd); - } return ret; } @@ -638,12 +600,9 @@ Bool File_IsFullPath(ConstUnicode pathName) // IN: { - if (pathName == NULL) { - return FALSE; - } - /* start with a slash? */ - return Unicode_StartsWith(pathName, U(DIRSEPS)); + return (pathName == NULL) ? FALSE : + Unicode_StartsWith(pathName, DIRSEPS); } @@ -672,34 +631,18 @@ VmTimeType *writeTime, // OUT: Windows NT time format VmTimeType *attrChangeTime) // OUT: Windows NT time format { - int err; - char *path; struct stat statBuf; - if (pathName == NULL) { - return FALSE; - } - ASSERT(createTime && accessTime && writeTime && attrChangeTime); - path = Unicode_GetAllocBytes(pathName, STRING_ENCODING_DEFAULT); - - if (path == NULL) { - return FALSE; - } - *createTime = -1; *accessTime = -1; *writeTime = -1; *attrChangeTime = -1; - err = (lstat(path, &statBuf) == -1) ? errno : 0; - - free(path); - - if (err != 0) { -// XXX unicode "string" in message - Log(LGPFX" error stating file \"%s\": %s\n", pathName, strerror(err)); + if (Posix_Lstat(pathName, &statBuf) == -1) { + Log(LGPFX" %s: error stating file \"%s\": %s\n", __FUNCTION__, + UTF8(pathName), strerror(errno)); return FALSE; } @@ -714,10 +657,10 @@ #if defined(__FreeBSD__) /* - * FreeBSD: All supported versions have timestamps with nanosecond resolution. - * FreeBSD 5+ has also file creation time. + * FreeBSD: All supported versions have timestamps with nanosecond + * resolution. FreeBSD 5+ has also file creation time. */ -# if BSD_VERSION >= 50 +# if defined(__FreeBSD_version) && __FreeBSD_version >= 500043 *createTime = TimeUtil_UnixTimeToNtTime(statBuf.st_birthtimespec); # endif *accessTime = TimeUtil_UnixTimeToNtTime(statBuf.st_atimespec); @@ -728,6 +671,7 @@ * 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) { /* @@ -736,6 +680,7 @@ * instead of zeroes, we get automatically nanosecond timestamps * when running on host which provides them. */ + struct timespec timeBuf; timeBuf.tv_sec = statBuf.st_atime; @@ -819,16 +764,17 @@ } path = Unicode_GetAllocBytes(pathName, STRING_ENCODING_DEFAULT); - if (path == NULL) { + Log(LGPFX" %s: failed to convert \"%s\" to current encoding\n", + __FUNCTION__, UTF8(pathName)); return FALSE; } err = (lstat(path, &statBuf) == -1) ? errno : 0; if (err != 0) { -// XXX unicode "string" in message - Log(LGPFX" error stating file \"%s\": %s\n", pathName, strerror(err)); + Log(LGPFX" %s: error stating file \"%s\": %s\n", __FUNCTION__, + UTF8(pathName), strerror(err)); free(path); return FALSE; } @@ -840,6 +786,7 @@ * 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; @@ -864,8 +811,8 @@ free(path); if (err != 0) { -// XXX unicode "string" in message - Log(LGPFX" utimes error on file \"%s\": %s\n", pathName, strerror(err)); + Log(LGPFX" %s: utimes error on file \"%s\": %s\n", __FUNCTION__, + UTF8(pathName), strerror(err)); return FALSE; } @@ -901,25 +848,29 @@ */ static Bool -FilePosixGetParent(char const *canPath) // IN/OUT: Canonical file path +FilePosixGetParent(Unicode *canPath) // IN/OUT: Canonical file path { - char *ptr; + Unicode pathName; + Unicode baseName; - ASSERT(canPath[0] == DIRSEPC); - ptr = strrchr(canPath, DIRSEPC); - ASSERT(ptr); - if (ptr != canPath) { - // "/foo/bar" -> "/foo" - } else { - // "/foo" -> "/" - ptr++; + ASSERT(File_IsFullPath(*canPath)); - if (*ptr == '\0') { - // "/" -> "/" - return TRUE; - } + if (Unicode_Compare(*canPath, DIRSEPS) == 0) { + return TRUE; + } + + File_GetPathName(*canPath, &pathName, &baseName); + + Unicode_Free(baseName); + Unicode_Free(*canPath); + + if (Unicode_IsEmpty(pathName)) { + /* empty string which denotes "/" */ + Unicode_Free(pathName); + *canPath = Unicode_Duplicate("/"); + } else { + *canPath = pathName; } - *ptr = '\0'; return FALSE; } @@ -933,7 +884,8 @@ * Calls statfs on a full path (eg. something returned from File_FullPath) * * Results: - * -1 if error + * TRUE statfs succeeded + * FALSE unable to statfs anything along the path * * Side effects: * None @@ -942,28 +894,29 @@ */ static Bool -FileGetStats(const char *fullPath, // IN - struct statfs *pstatfsbuf) // OUT +FileGetStats(ConstUnicode pathName, // IN: + struct statfs *pstatfsbuf) // OUT: { Bool retval = TRUE; - char *dupPath = NULL; + Unicode dupPath = NULL; - while (statfs(dupPath? dupPath : fullPath, pstatfsbuf) == -1) { + while (Posix_Statfs(dupPath ? dupPath : pathName, + pstatfsbuf) == -1) { if (errno != ENOENT) { retval = FALSE; - goto out; + break; } - if (!dupPath) { + if (dupPath == NULL) { /* Dup fullPath, so as not to modify input parameters */ - dupPath = Util_SafeStrdup(fullPath); + dupPath = Unicode_Duplicate(pathName); } - FilePosixGetParent(dupPath); + FilePosixGetParent(&dupPath); } - -out: - free(dupPath); + + Unicode_Free(dupPath); + return retval; } @@ -986,60 +939,67 @@ */ uint64 -File_GetFreeSpace(const char *fileName) // IN: File name +File_GetFreeSpace(ConstUnicode pathName) // IN: File name { - char *fullPath; uint64 ret; + Unicode fullPath; struct statfs statfsbuf; - fullPath = File_FullPath(fileName); + fullPath = File_FullPath(pathName); if (fullPath == NULL) { ret = -1; goto end; } - - if (!FileGetStats(fullPath, &statfsbuf)) { + + if (!FileGetStats(fullPath, &statfsbuf)) { Warning("%s: Couldn't statfs\n", __func__); ret = -1; goto end; } - ret = (uint64)statfsbuf.f_bavail * statfsbuf.f_bsize; -#ifdef VMX86_SERVER - // The following test is never true on VMvisor but we do not care as - // this is only intended for callers going through vmkfs. Direct callers - // as we are always get the right answer from statfs above. + + ret = (uint64)statfsbuf.f_bavail * statfsbuf.f_bsize; + +#if defined(VMX86_SERVER) + /* + * The following test is never true on VMvisor but we do not care as + * this is only intended for callers going through vmkfs. Direct callers + * as we are always get the right answer from statfs above. + */ + if (statfsbuf.f_type == VMFS_MAGIC_NUMBER) { int fd; FS_FreeSpaceArgs args = { 0 }; - char *directory = NULL; + Unicode directory = NULL; File_SplitName(fullPath, NULL, &directory, NULL); /* Must use an ioctl() to get free space for a VMFS file. */ ret = -1; - fd = open(directory, O_RDONLY); + fd = Posix_Open(directory, O_RDONLY, 0); if (fd == -1) { - Warning("%s: open of %s failed with: %s\n", __func__, directory, - Msg_ErrString()); + Warning(LGPFX" %s: open of %s failed with: %s\n", __func__, + UTF8(directory), Msg_ErrString()); } else { - if (ioctl(fd, IOCTLCMD_VMFS_GET_FREE_SPACE, &args) == -1) { - Warning("%s: ioctl on %s failed with: %s\n", __func__, - fullPath, Msg_ErrString()); - } else { - ret = args.bytesFree; + if (ioctl(fd, IOCTLCMD_VMFS_GET_FREE_SPACE, &args) == -1) { + Warning(LGPFX" %s: ioctl on %s failed with: %s\n", __func__, + UTF8(fullPath), Msg_ErrString()); + } else { + ret = args.bytesFree; } - close(fd); + close(fd); } - free(directory); + + Unicode_Free(directory); } #endif end: - free(fullPath); + Unicode_Free(fullPath); + return ret; } -#ifdef VMX86_SERVER +#if defined(VMX86_SERVER) /* *---------------------------------------------------------------------- * @@ -1058,36 +1018,36 @@ */ static int -File_GetVMFSAttributes(const char *fileName, // IN: File to test - FS_PartitionListResult **fsAttrs) // IN/OUT: VMFS Info +File_GetVMFSAttributes(ConstUnicode pathName, // IN: File to test + FS_PartitionListResult **fsAttrs) // IN/OUT: VMFS Info { - int ret = -1; int fd; - char *pathname = File_FullPath(fileName); - char *parentPath; + int ret; + Unicode fullPath; - File_SplitName(pathname, NULL, &parentPath, NULL); + Unicode parentPath = NULL; - if (parentPath == NULL) { - Log(LGPFX "%s: Error acquiring parent path name\n", __func__); - free(pathname); - return -1; + fullPath = File_FullPath(pathName); + if (fullPath == NULL) { + ret = -1; + goto bail; } - if (!File_OnVMFS(fileName)) { - Log(LGPFX "%s: File %s not on VMFS volume\n", __func__, fileName); - free(pathname); - free(parentPath); - return -1; + File_SplitName(fullPath, NULL, &parentPath, NULL); + + if (!File_OnVMFS(pathName)) { + Log(LGPFX" %s: File %s not on VMFS volume\n", __func__, + UTF8(pathName)); + ret = -1; + goto bail; } *fsAttrs = Util_SafeMalloc(FS_PARTITION_ARR_SIZE(FS_PLIST_DEF_MAX_PARTITIONS)); if (*fsAttrs == NULL) { - Log(LGPFX "%s: failed to allocate memory\n", __func__); - free(pathname); - free(parentPath); - return -1; + Log(LGPFX" %s: failed to allocate memory\n", __func__); + ret = -1; + goto bail; } memset(*fsAttrs, 0, FS_PARTITION_ARR_SIZE(FS_PLIST_DEF_MAX_PARTITIONS)); @@ -1095,28 +1055,30 @@ (*fsAttrs)->ioctlAttr.maxPartitions = FS_PLIST_DEF_MAX_PARTITIONS; (*fsAttrs)->ioctlAttr.getAttrSpec = FS_ATTR_SPEC_BASIC; - fd = open(parentPath, O_RDONLY); - if (fd < 0) { - Log(LGPFX "%s: could not open %s.\n", __func__, fileName); - goto done; + fd = Posix_Open(parentPath, O_RDONLY, 0); + + if (fd == -1) { + Log(LGPFX" %s: could not open %s.\n", __func__, UTF8(pathName)); + ret = -1; + goto bail; } ret = ioctl(fd, IOCTLCMD_VMFS_FS_GET_ATTR, (char *) *fsAttrs); - if (ret < 0) { - Log(LGPFX "%s: Could not get volume attributes (ret = %d)\n", __func__, - ret); - } -done: - if (fd) { - close(fd); + close(fd); + if (ret == -1) { + Log(LGPFX" %s: Could not get volume attributes (ret = %d)\n", __func__, + ret); } - free(pathname); - free(parentPath); +bail: + Unicode_Free(fullPath); + Unicode_Free(parentPath); + return ret; } + /* *---------------------------------------------------------------------- * @@ -1135,15 +1097,15 @@ */ static int -File_GetVMFSVersion(const char *fileName, // IN: Filename to test - uint32 *version) // IN/OUT: version number of VMFS +File_GetVMFSVersion(ConstUnicode pathName, // IN: Filename to test + uint32 *version) // IN/OUT: version number of VMFS { int ret = -1; FS_PartitionListResult *fsAttrs = NULL; - ret = File_GetVMFSAttributes(fileName, &fsAttrs); + ret = File_GetVMFSAttributes(pathName, &fsAttrs); if (ret < 0) { - Log(LGPFX "%s: File_GetVMFSAttributes failed\n", __func__); + Log(LGPFX" %s: File_GetVMFSAttributes failed\n", __func__); goto done; } @@ -1156,6 +1118,7 @@ return ret; } + /* *---------------------------------------------------------------------- * @@ -1173,16 +1136,16 @@ *---------------------------------------------------------------------- */ -static int -File_GetVMFSBlockSize(const char *fileName, // IN: File name to test - uint32 *blockSize) // IN/OUT: VMFS block size +int +File_GetVMFSBlockSize(ConstUnicode pathName, // IN: File name to test + uint32 *blockSize) // IN/OUT: VMFS block size { int ret = -1; FS_PartitionListResult *fsAttrs = NULL; - ret = File_GetVMFSAttributes(fileName, &fsAttrs); + ret = File_GetVMFSAttributes(pathName, &fsAttrs); if (ret < 0) { - Log(LGPFX "%s: File_GetVMFSAttributes failed\n", __func__); + Log(LGPFX" %s: File_GetVMFSAttributes failed\n", __func__); goto done; } @@ -1195,6 +1158,7 @@ return ret; } + /* *---------------------------------------------------------------------- * @@ -1213,15 +1177,15 @@ */ static int -File_GetVMFSfsType(const char *fileName, // IN: File name to test - char **fsType) // IN/OUT: VMFS fsType +File_GetVMFSfsType(ConstUnicode pathName, // IN: File name to test + char **fsType) // IN/OUT: VMFS fsType { int ret = -1; FS_PartitionListResult *fsAttrs = NULL; - ret = File_GetVMFSAttributes(fileName, &fsAttrs); + ret = File_GetVMFSAttributes(pathName, &fsAttrs); if (ret < 0) { - Log(LGPFX "%s: File_GetVMFSAttributes failed\n", __func__); + Log(LGPFX" %s: File_GetVMFSAttributes failed\n", __func__); goto done; } @@ -1234,10 +1198,9 @@ } return ret; } - - #endif + /* *---------------------------------------------------------------------- * @@ -1255,14 +1218,13 @@ */ Bool -File_OnVMFS(const char *fileName) +File_OnVMFS(ConstUnicode pathName) { -#ifdef VMX86_SERVER - char *fullPath; +#if defined(VMX86_SERVER) Bool ret; struct statfs statfsbuf; - // XXX See Vmfs_IsVMFSDir. Same caveat about fs exclusion. + /* XXX See Vmfs_IsVMFSDir. Same caveat about fs exclusion. */ if (HostType_OSIsPureVMK()) { return TRUE; } @@ -1272,30 +1234,39 @@ * exists. If file doesn't exist, then get the full path and do a * FileGetStats() to check each of the parent directories. */ - if (statfs(fileName, &statfsbuf) == -1) { - fullPath = File_FullPath(fileName); + + if (Posix_Statfs(pathName, &statfsbuf) == -1) { + int err; + Unicode fullPath; + + fullPath = File_FullPath(pathName); if (fullPath == NULL) { - ret = FALSE; - goto end; + ret = FALSE; + goto end; } - - if (!FileGetStats(fullPath, &statfsbuf)) { - Warning("%s: Couldn't statfs\n", __FUNCTION__); - ret = FALSE; - free(fullPath); - goto end; + + err = FileGetStats(fullPath, &statfsbuf); + + Unicode_Free(fullPath); + + if (err == -1) { + Warning(LGPFX" %s: Couldn't statfs\n", __FUNCTION__); + ret = FALSE; + goto end; } - free(fullPath); } + ret = (statfsbuf.f_type == VMFS_MAGIC_NUMBER); end: + return ret; #else return FALSE; #endif } + /* *---------------------------------------------------------------------- * @@ -1314,20 +1285,20 @@ */ uint64 -File_GetCapacity(const char *fileName) // IN: File name +File_GetCapacity(ConstUnicode pathName) // IN: Path name { - char *fullPath; uint64 ret; + Unicode fullPath; struct statfs statfsbuf; - fullPath = File_FullPath(fileName); + fullPath = File_FullPath(pathName); if (fullPath == NULL) { ret = -1; goto end; } - + if (!FileGetStats(fullPath, &statfsbuf)) { - Warning("%s: Couldn't statfs\n", __func__); + Warning(LGPFX" %s: Couldn't statfs\n", __func__); ret = -1; goto end; } @@ -1335,7 +1306,7 @@ ret = (uint64)statfsbuf.f_blocks * statfsbuf.f_bsize; end: - free(fullPath); + Unicode_Free(fullPath); return ret; } @@ -1366,13 +1337,20 @@ *----------------------------------------------------------------------------- */ -char * +char * File_GetUniqueFileSystemID(char const *path) // IN: File path { -#ifdef VMX86_SERVER - char canPath[FILE_MAXPATH]; +#if defined(VMX86_SERVER) + char *canPath; + char *existPath; - realpath(path, canPath); + existPath = FilePosixNearestExistingAncestor(path); + canPath = Posix_RealPath(existPath); + free(existPath); + + if (canPath == NULL) { + return NULL; + } /* * VCFS doesn't have real mount points, so the mount point lookup below @@ -1380,13 +1358,19 @@ * * See bug 61646 for why we care. */ + if (strncmp(canPath, VCFS_MOUNT_POINT, strlen(VCFS_MOUNT_POINT)) == 0) { char vmfsVolumeName[FILE_MAXPATH]; if (sscanf(canPath, VCFS_MOUNT_PATH "%[^/]%*s", vmfsVolumeName) == 1) { - return Str_Asprintf(NULL, "%s/%s", VCFS_MOUNT_POINT, vmfsVolumeName); + free(canPath); + + return Str_SafeAsprintf(NULL, "%s/%s", VCFS_MOUNT_POINT, + vmfsVolumeName); } } + + free(canPath); #endif return FilePosixGetBlockDevice(path); @@ -1429,7 +1413,7 @@ return NULL; } - // XXX getmntent() is not thread-safe. Use getmntent_r() instead. + /* XXX getmntent() is not thread-safe. Use getmntent_r() instead. */ while ((mnt = getmntent(f)) != NULL) { /* * NB: A call to realpath is not needed as getmntent() already @@ -1439,6 +1423,7 @@ * a filesystem that the caller of the function is not at * all expecting. */ + if (strcmp(mnt->mnt_dir, canPath) == 0) { endmntent(f); @@ -1450,6 +1435,7 @@ * apart in /etc/mtab: the option recorded there is, in both cases, * always "bind". */ + *bind = strstr(mnt->mnt_opts, "bind") != NULL; return Util_SafeStrdup(mnt->mnt_fsname); @@ -1494,12 +1480,10 @@ char canPath[FILE_MAXPATH]; char canPath2[FILE_MAXPATH]; unsigned int retries = 0; + char *realPath; #endif existPath = FilePosixNearestExistingAncestor(path); - if (!existPath) { - return NULL; - } #if defined(__APPLE__) failed = statfs(existPath, &buf) == -1; @@ -1510,22 +1494,27 @@ return Util_SafeStrdup(buf.f_mntfromname); #else - failed = !realpath(existPath, canPath); + realPath = Posix_RealPath(existPath); free(existPath); - if (failed) { + + 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. + /* Find the nearest ancestor of 'canPath' that is a mount point. */ for (;;) { + char *x; Bool bind; char *ptr; ptr = FilePosixLookupMountPoint(canPath, &bind); if (ptr) { + if (bind) { /* * 'canPath' is a mount point mounted with --[r]bind. This is the @@ -1550,6 +1539,7 @@ * /bind/exit14/home -> exit14:/vol/vol0/home * /rbind/exit14/home -> exit14:/vol/vol0/home */ + Bool rbind = TRUE; if (rbind) { @@ -1564,8 +1554,7 @@ if (*diff != '\0') { Str_Sprintf(canPath, sizeof canPath, "%s%s", - strlen(ptr) > 1 ? ptr : "", - diff); + strlen(ptr) > 1 ? ptr : "", diff); } else { Str_Strcpy(canPath, ptr, sizeof canPath); } @@ -1580,9 +1569,10 @@ * 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("%s: The --[r]bind mount count exceeds %u. Giving " + Warning(LGPFX" %s: The --[r]bind mount count exceeds %u. Giving " "up.\n", __func__, 10); return NULL; } @@ -1593,11 +1583,17 @@ return ptr; } - failed = FilePosixGetParent(canPath); +/* 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; } @@ -1617,9 +1613,8 @@ * have any number of non-existing components at its end. * * Results: - * On success: The allocated, NUL-terminated, non-empty path of the - * nearest existing ancestor. - * On failure: NULL. + * The allocated, NUL-terminated, non-empty path of the + * nearest existing ancestor. * * Side effects: * None @@ -1634,10 +1629,7 @@ char *result; resultSize = MAX(strlen(path), 1) + 1; - result = malloc(resultSize); - if (!result) { - return NULL; - } + result = Util_SafeMalloc(resultSize); Str_Strcpy(result, path, resultSize); for (;;) { @@ -1690,8 +1682,8 @@ */ Bool -File_IsSameFile(const char *path1, // IN - const char *path2) // IN +File_IsSameFile(ConstUnicode path1, // IN: + ConstUnicode path2) // IN: { struct stat st1; struct stat st2; @@ -1701,29 +1693,32 @@ ASSERT(path1); ASSERT(path2); -#ifdef VMX86_SERVER +#if defined(VMX86_SERVER) { - char *fs1; - char *fs2; - char realpath1[FILE_MAXPATH]; - char realpath2[FILE_MAXPATH]; + Unicode fs1; + Unicode fs2; - fs1 = realpath(path1, realpath1); - fs2 = realpath(path2, realpath2); + fs1 = Posix_RealPath(path1); + fs2 = Posix_RealPath(path2); /* - * ESX doesn't have real inodes for VMFS disks in User Worlds. So only way - * to check if a file is the same is using real path. So said Satyam. + * ESX doesn't have real inodes for VMFS disks in User Worlds. So only + * way to check if a file is the same is using real path. So said Satyam. */ - if (fs1 && - strncmp(fs1, VCFS_MOUNT_POINT, strlen(VCFS_MOUNT_POINT)) == 0) { - if (!fs2 || strcmp(realpath1, realpath2) != 0) { - return FALSE; - } else { - return TRUE; - } + if (fs1 && Unicode_StartsWith(fs1, VCFS_MOUNT_POINT)) { + Bool res; + + res = (!fs2 || Unicode_Compare(fs1, fs2) != 0) ? FALSE : TRUE; + + Unicode_Free(fs1); + Unicode_Free(fs2); + + return res; } + + Unicode_Free(fs1); + Unicode_Free(fs2); } #endif @@ -1731,15 +1726,16 @@ * First take care of the easy checks. If the paths are identical, or if * the inode numbers don't match, we're done. */ - if (strcmp(path1, path2) == 0) { + + if (Unicode_Compare(path1, path2) == 0) { return TRUE; } - if (stat(path1, &st1) == -1) { + if (Posix_Stat(path1, &st1) == -1) { return FALSE; } - if (stat(path2, &st2) == -1) { + if (Posix_Stat(path2, &st2) == -1) { return FALSE; } @@ -1747,11 +1743,11 @@ return FALSE; } - if (statfs(path1, &stfs1) != 0) { + if (Posix_Statfs(path1, &stfs1) != 0) { return FALSE; } - if (statfs(path2, &stfs2) != 0) { + if (Posix_Statfs(path2, &stfs2) != 0) { return FALSE; } @@ -1760,7 +1756,8 @@ return st1.st_dev == st2.st_dev; } #else - if ((stfs1.f_type != NFS_SUPER_MAGIC) && (stfs2.f_type != NFS_SUPER_MAGIC)) { + if ((stfs1.f_type != NFS_SUPER_MAGIC) && + (stfs2.f_type != NFS_SUPER_MAGIC)) { return st1.st_dev == st2.st_dev; } #endif @@ -1778,6 +1775,7 @@ * and the paths point to a cloned file system, then the we will return a * false positive. */ + if ((st1.st_dev == st2.st_dev) && (st1.st_mode == st2.st_mode) && (st1.st_nlink == st2.st_nlink) && @@ -1817,51 +1815,54 @@ File_Replace(ConstUnicode oldName, // IN: old file ConstUnicode newName) // IN: new file { - Bool status; - char *newPath; - char *oldPath; + int status; + Bool result = FALSE; + char *newPath = NULL; + char *oldPath = NULL; struct stat st; - if ((oldName == NULL) || (newName == NULL)) { - return FALSE; - } - newPath = Unicode_GetAllocBytes(newName, STRING_ENCODING_DEFAULT); + if (newPath == NULL && newName != NULL) { + status = UNICODE_CONVERSION_ERRNO; + Msg_Append(MSGID(filePosix.replaceConversionFailed) + "Failed to convert file path \"%s\" to current encoding\n", + newName); + goto bail; + } oldPath = Unicode_GetAllocBytes(oldName, STRING_ENCODING_DEFAULT); - - if ((oldPath == NULL) || (newPath == NULL)) { - status = FALSE; + if (oldPath == NULL && oldName != NULL) { + status = UNICODE_CONVERSION_ERRNO; + Msg_Append(MSGID(filePosix.replaceConversionFailed) + "Failed to convert file path \"%s\" to current encoding\n", + oldName); goto bail; } - /* UNICODE: path names added to Msg_Append... */ - 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", - oldPath, newPath, Msg_ErrString()); - - status = FALSE; + oldName, newName, Msg_ErrString()); goto bail; } - if (rename(newPath, oldPath) == -1) { + status = (rename(newPath, oldPath) == -1) ? errno : 0; + if (status != 0) { Msg_Append(MSGID(filePosix.replaceRenameFailed) "Failed to rename \"%s\" to \"%s\": %s\n", - newPath, oldPath, Msg_ErrString()); - - status = FALSE; + newName, oldName, Msg_ErrString()); goto bail; } - status = TRUE; + result = TRUE; bail: free(newPath); free(oldPath); - return status; + errno = status; + return result; } @@ -1888,34 +1889,17 @@ FileIsVMFS(ConstUnicode pathName) // IN: file name to test { #if defined(linux) - char *path; - struct statfs statbuf; - - int err = 0; + struct statfs statfsbuf; #if defined(VMX86_SERVER) - // XXX See Vmfs_IsVMFSFile. Same caveat about fs exclusion. + /* XXX See Vmfs_IsVMFSFile. Same caveat about fs exclusion. */ if (HostType_OSIsPureVMK()) { return TRUE; } #endif - if (pathName == NULL) { - return FALSE; - } - - path = Unicode_GetAllocBytes(pathName, STRING_ENCODING_DEFAULT); - - if (path == NULL) { - return FALSE; - } - - err = (statfs(path, &statbuf) == -1) ? errno : 0; - - free(path); - - if (err == 0) { - return statbuf.f_type == VMFS_SUPER_MAGIC; + if (Posix_Statfs(pathName, &statfsbuf) == 0) { + return statfsbuf.f_type == VMFS_SUPER_MAGIC; } #endif @@ -1945,27 +1929,32 @@ */ static Bool -FilePosixCreateTestFileSize(const char *dirName, // IN: directory to create large file - uint64 fileSize) // IN: test file size +FilePosixCreateTestFileSize(ConstUnicode dirName, // IN: directory to create large file + uint64 fileSize) // IN: test file size { - FileIODescriptor fd; - char pathname[FILE_MAXPATH]; Bool retVal; - char *tmpFileName; int posixFD; + Unicode temp; + Unicode path; + FileIODescriptor fd; + + temp = Unicode_Append(dirName, "/.vmBigFileTest"); + posixFD = File_MakeTemp(temp, &path); + Unicode_Free(temp); - Str_Sprintf(pathname, sizeof pathname, "%s/.vmBigFileTest", dirName); - posixFD = File_MakeTemp(pathname, &tmpFileName); if (posixFD == -1) { return FALSE; } - + fd = FileIO_CreateFDPosix(posixFD, O_RDWR); + retVal = FileIO_SupportsFileSize(&fd, fileSize); /* Eventually perform destructive tests here... */ + FileIO_Close(&fd); - File_Unlink(tmpFileName); - free(tmpFileName); + File_Unlink(path); + Unicode_Free(path); + return retVal; } @@ -1996,28 +1985,26 @@ */ static Bool -File_VMFSSupportsFileSize(const char *fileName, // IN - uint64 fileSize) // IN +File_VMFSSupportsFileSize(ConstUnicode pathName, // IN: + uint64 fileSize) // IN: { -#ifdef VMX86_SERVER +#if defined(VMX86_SERVER) uint32 version = -1; uint32 blockSize = -1; uint64 maxFileSize = -1; Bool supported; - char *pathName; - char *parentPath; char *fsType = NULL; - if (File_GetVMFSVersion(fileName, &version) < 0) { - Log(LGPFX "%s: File_GetVMFSVersion Failed\n", __func__); + if (File_GetVMFSVersion(pathName, &version) < 0) { + Log(LGPFX" %s: File_GetVMFSVersion Failed\n", __func__); return FALSE; } - if (File_GetVMFSBlockSize(fileName, &blockSize) < 0) { - Log(LGPFX "%s: File_GetVMFSBlockSize Failed\n", __func__); + if (File_GetVMFSBlockSize(pathName, &blockSize) < 0) { + Log(LGPFX" %s: File_GetVMFSBlockSize Failed\n", __func__); return FALSE; } - if (File_GetVMFSfsType(fileName, &fsType) < 0) { - Log(LGPFX "%s: File_GetVMFSfsType Failed\n", __func__); + if (File_GetVMFSfsType(pathName, &fsType) < 0) { + Log(LGPFX" %s: File_GetVMFSfsType Failed\n", __func__); return FALSE; } @@ -2035,39 +2022,37 @@ free(fsType); return TRUE; } else { - Log(LGPFX "Requested file size (%"FMT64"d) larger than maximum " - "supported filesystem file size (%"FMT64"d)\n", + Log(LGPFX" %s: Requested file size (%"FMT64"d) larger than maximum " + "supported filesystem file size (%"FMT64"d)\n", __FUNCTION__, fileSize, maxFileSize); free(fsType); return FALSE; } - } else { - pathName = File_FullPath(fileName); - if (pathName == NULL) { - Log(LGPFX "%s: Error acquiring full path\n", __func__); - free(fsType); - return FALSE; - } + Unicode fullPath; + Unicode parentPath; - File_SplitName(pathName, NULL, &parentPath, NULL); - if (parentPath == NULL) { - Log(LGPFX "%s: Error acquiring parent path name\n", __func__); + fullPath = File_FullPath(pathName); + + if (fullPath == NULL) { + Log(LGPFX" %s: Error acquiring full path\n", __func__); free(fsType); - free(pathName); return FALSE; } + File_GetPathName(fullPath, &parentPath, NULL); + supported = FilePosixCreateTestFileSize(parentPath, fileSize); - + free(fsType); - free(pathName); - free(parentPath); + Unicode_Free(fullPath); + Unicode_Free(parentPath); + return supported; } - + #endif - Log(LGPFX "%s did not execute properly\n", __func__); + Log(LGPFX" %s: did not execute properly\n", __func__); return FALSE; /* happy compiler */ } @@ -2089,13 +2074,13 @@ */ Bool -File_SupportsFileSize(const char *filePath, // IN - uint64 fileSize) // IN +File_SupportsFileSize(ConstUnicode pathName, // IN: + uint64 fileSize) // IN: { + Unicode fullPath; + Bool supported = FALSE; - char *p; - char *pathname; - char *parentPath = NULL; + Unicode folderPath = NULL; /* All supported filesystems can hold at least 2GB - 1 files. */ if (fileSize <= 0x7FFFFFFF) { @@ -2109,65 +2094,58 @@ * a vmdk created in (setting filePath only to the disk name, not the entire * path. */ - pathname = File_FullPath(filePath); - if (pathname == NULL) { - Log(LGPFX "%s: Error acquiring full path\n", __func__); + + fullPath = File_FullPath(pathName); + if (fullPath == NULL) { + Log(LGPFX" %s: Error acquiring full path\n", __func__); goto out; } /* - * We then truncate the name to point to the parent directory of the file - * created so we can get accurate results from FileIsVMFS. + * This function expects a filename. If given one, truncate the name to point + * to the parent directory so we can get accurate results from FileIsVMFS. + * If handed a directory directly, no truncation is necessary. */ - File_SplitName(pathname, NULL, &parentPath, NULL); - if (parentPath == NULL) { - Log(LGPFX "%s: Error acquiring parent path name\n", __func__); - goto out; + + if (File_IsDirectory(pathName)) { + folderPath = Unicode_Duplicate(fullPath); + } else { + File_SplitName(fullPath, NULL, &folderPath, NULL); } /* * We know that VMFS supports large files - But they have limitations * See function File_VMFSSupportsFileSize() - PR 146965 */ - if (FileIsVMFS(parentPath)) { - supported = File_VMFSSupportsFileSize(filePath, fileSize); + + if (FileIsVMFS(folderPath)) { + supported = File_VMFSSupportsFileSize(pathName, fileSize); goto out; } - if (File_IsFile(filePath)) { - FileIODescriptor fd; + if (File_IsFile(pathName)) { FileIOResult res; + FileIODescriptor fd; FileIO_Invalidate(&fd); - res = FileIO_Open(&fd, filePath, FILEIO_OPEN_ACCESS_READ, FILEIO_OPEN); - if (res == FILEIO_SUCCESS) { + res = FileIO_Open(&fd, pathName, FILEIO_OPEN_ACCESS_READ, FILEIO_OPEN); + if (FileIO_IsSuccess(res)) { supported = FileIO_SupportsFileSize(&fd, fileSize); FileIO_Close(&fd); goto out; } } - p = strrchr(pathname, '/'); - if (p == NULL) { - free(pathname); - pathname = File_Cwd(NULL); - - if (pathname == NULL) { - goto out; - } - } else { - *p = '\0'; - } - /* - * On unknown filesystems create temporary file and use it to test. + * On unknown filesystems create temporary file and use it as a test. */ - supported = FilePosixCreateTestFileSize(parentPath, fileSize); + + supported = FilePosixCreateTestFileSize(folderPath, fileSize); out: - - free(pathname); - free(parentPath); + Unicode_Free(fullPath); + Unicode_Free(folderPath); + return supported; } @@ -2193,20 +2171,12 @@ FileCreateDirectory(ConstUnicode pathName) // IN: { int err; - char *path; if (pathName == NULL) { - return EFAULT; - } - - path = Unicode_GetAllocBytes(pathName, STRING_ENCODING_DEFAULT); - - if (path == NULL) { - err = ENOMEM; + err = errno = EFAULT; } else { - err = (mkdir(path, S_IRWXU | S_IRWXG | S_IRWXO) == -1) ? errno : 0; - - free(path); + err = (Posix_Mkdir(pathName, + S_IRWXU | S_IRWXG | S_IRWXO) == -1) ? errno : 0; } return err; @@ -2224,57 +2194,56 @@ * Returns the number of files returned or -1 on failure. * * Side effects: - * If ids is provided and the function succeeds, memory is allocated - * and must be freed. Array of strings and array itself must be - * freed. + * 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 Unicode_FreeList.) + * The memory allocated for the array may be larger than necessary. + * The caller may trim it with realloc() if it cares. * *---------------------------------------------------------------------- */ int -File_ListDirectory(char const *pathName, // IN - char ***ids) // OUT: relative paths +File_ListDirectory(ConstUnicode pathName, // IN: + Unicode **ids) // OUT: relative paths { int err; DIR *dir; DynBuf b; - int count = 0; + int count; - if (pathName == NULL) { - errno = EFAULT; - return -1; - } + ASSERT(pathName != NULL); - errno = 0; - dir = opendir(pathName); + dir = Posix_OpenDir(pathName); if (dir == (DIR *) NULL) { - // errno is accessible, in the future, for more detail + // errno is preserved return -1; } DynBuf_Init(&b); + count = 0; while (TRUE) { struct dirent *entry; errno = 0; entry = readdir(dir); - if (entry == (struct dirent *) NULL) { err = errno; break; } /* Strip out undesirable paths. No one ever cares about these. */ - if (!strcmp(entry->d_name, ".") || !strcmp(entry->d_name, "..")) { + 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 = Util_SafeStrdup(entry->d_name); - DynBuf_Append(&b, &id, sizeof(&id)); + Unicode id = Unicode_Alloc(entry->d_name, STRING_ENCODING_DEFAULT); + DynBuf_Append(&b, &id, sizeof id); } count++; @@ -2283,17 +2252,199 @@ closedir(dir); if (ids && (err == 0)) { - *ids = DynBuf_AllocGet(&b); - ASSERT_MEM_ALLOC(*ids); + *ids = DynBuf_Detach(&b); } - DynBuf_Destroy(&b); - return (err == 0) ? count : -1; + return (errno = err) == 0 ? count : -1; +} + + +#if CAN_USE_FTS + +/* + *----------------------------------------------------------------------------- + * + * 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. + * + * When done, pass the returned context to File_WalkDirectoryEnd(). + * + * A pre-order, logical traversal will be completed; hard links and + * symbolic links that do not cause a cycle are followed in the directory + * traversal. + * + * 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(ConstUnicode parentPath) // IN +{ + WalkDirContextImpl *context; + char * const traversalRoots[] = + { Unicode_GetAllocBytes(parentPath, STRING_ENCODING_DEFAULT), NULL }; + + context = malloc(sizeof *context); + if (!context) { + return NULL; + } + + context->fts = fts_open(traversalRoots, + FTS_LOGICAL|FTS_NOSTAT|FTS_NOCHDIR, + NULL); + if (!context->fts) { + free(context); + context = NULL; + } + + free(traversalRoots[0]); + + 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 prefixed by parentPath that + * the caller must free (see Unicode_Free). + * + * If FALSE, errno is 0 iff the walk completed sucessfully. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +Bool +File_WalkDirectoryNext(WalkDirContext context, // IN + Unicode *path) // OUT +{ + FTSENT *nextEntry; + + ASSERT(context); + ASSERT(context->fts); + ASSERT(path); + + do { + nextEntry = fts_read(context->fts); + /* + * We'll skip any entries that cannot be read, are errors, or + * are the second traversal (post-order) of a directory. + */ + if ( nextEntry + && nextEntry->fts_info != FTS_DNR + && nextEntry->fts_info != FTS_ERR + && nextEntry->fts_info != FTS_DP) { + *path = Unicode_AllocWithLength(nextEntry->fts_path, + nextEntry->fts_pathlen, + STRING_ENCODING_DEFAULT); + return TRUE; + } + } while (nextEntry); + + return FALSE; +} + + +/* + *----------------------------------------------------------------------------- + * + * File_WalkDirectoryEnd -- + * + * End the directory traversal. + * + * Results: + * None + * + * Side effects: + * The context is now invalid. + * + *----------------------------------------------------------------------------- + */ + +void +File_WalkDirectoryEnd(WalkDirContext context) // IN +{ + ASSERT(context); + ASSERT(context->fts); + + if (fts_close(context->fts) == -1) { + Log(LGPFX" %s: failed to close fts: %p\n", __FUNCTION__, context->fts); + } + free((WalkDirContextImpl *)context); +} + +#else + + +/* + *----------------------------------------------------------------------------- + * + * File_WalkDirectoryStart -- + * File_WalkDirectoryNext -- + * File_WalkDirectoryEnd -- + * + * XXX FTS is not supported on this posix variant. See above. + * + * Results: + * None + * + * Side effects: + * ASSERTs. + * + *----------------------------------------------------------------------------- + */ + +WalkDirContext +File_WalkDirectoryStart(ConstUnicode parentPath) // IN +{ + NOT_IMPLEMENTED(); +} + + +Bool +File_WalkDirectoryNext(WalkDirContext context, // IN + Unicode *path) // OUT +{ + NOT_IMPLEMENTED(); +} + + +void +File_WalkDirectoryEnd(WalkDirContext context) // IN +{ + NOT_IMPLEMENTED(); +} + + +#endif // CAN_USE_FTS + + +/* *---------------------------------------------------------------------- * * File_IsWritableDir -- @@ -2330,7 +2481,6 @@ err = FileAttributes(dirName, &fileData); if ((err != 0) || (fileData.fileType != FILE_TYPE_DIRECTORY)) { - errno = err; return FALSE; } @@ -2339,6 +2489,7 @@ /* 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; } @@ -2500,21 +2651,21 @@ res = getgroups(nr_members, members); if (res == -1) { - Warning("%s: Couldn't getgroups\n", __FUNCTION__); - ret = FALSE; - goto end; + Warning(LGPFX" %s: Couldn't getgroups\n", __FUNCTION__); + ret = FALSE; + goto end; } if (res == nr_members) { - break; + break; } /* Was bug 17760 --hpreg */ new = realloc(members, res * sizeof *members); if (new == NULL) { - Warning("%s: Couldn't realloc\n", __FUNCTION__); - ret = FALSE; - goto end; + Warning(LGPFX" %s: Couldn't realloc\n", __FUNCTION__); + ret = FALSE; + goto end; } members = new; @@ -2523,8 +2674,8 @@ for (res = 0; res < nr_members; res++) { if (members[res] == gid) { - ret = TRUE; - goto end; + ret = TRUE; + goto end; } } ret = FALSE; @@ -2543,6 +2694,8 @@ * 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 * @@ -2555,34 +2708,19 @@ Bool File_MakeCfgFileExecutable(ConstUnicode pathName) { - char *path; - Bool result; + struct stat s; - if (pathName == NULL) { - errno = EFAULT; - return FALSE; - } + if (Posix_Stat(pathName, &s) == 0) { + mode_t newMode = s.st_mode; - path = Unicode_GetAllocBytes(pathName, STRING_ENCODING_DEFAULT); + newMode |= S_IRUSR | S_IWUSR | S_IXUSR; - if (path == NULL) { - errno = ENOMEM; - result = FALSE; - } else { - int err; - - result = chmod(path, - S_IRUSR | S_IWUSR | S_IXUSR | // rwx by user - S_IRGRP | S_IXGRP | // rx by group - S_IROTH | S_IXOTH // rx by others - ) == 0; + ASSERT_ON_COMPILE(S_IRGRP >> 2 == S_IXGRP && S_IROTH >> 2 == S_IXOTH); + newMode |= ((newMode & (S_IRGRP | S_IROTH)) >> 2); - err = errno; - free(path); - errno = err; + return newMode == s.st_mode || Posix_Chmod(pathName, newMode); } - - return result; + return FALSE; } @@ -2610,3 +2748,33 @@ { 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(ConstUnicode pathName) // IN: +{ + FileData fileData; + + return (FileAttributes(pathName, &fileData) == 0) && + (fileData.fileType == FILE_TYPE_CHARDEVICE); +} diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/file/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/file/Makefile.am --- open-vm-tools-2008.01.23-74039/lib/file/Makefile.am 2008-01-28 08:02:49.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/file/Makefile.am 2008-10-13 08:01:48.000000000 +0100 @@ -25,6 +25,4 @@ libFile_a_SOURCES += fileLockPrimitive.c libFile_a_SOURCES += fileLockPosix.c -AM_CFLAGS = -AM_CFLAGS += @COMMON_CFLAGS@ -AM_CFLAGS += @LIB_FILE_CFLAGS@ +AM_CFLAGS = @LIB_FILE_CPPFLAGS@ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/file/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/file/Makefile.in --- open-vm-tools-2008.01.23-74039/lib/file/Makefile.in 2008-01-28 08:03:03.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/file/Makefile.in 2008-10-13 08:02:13.000000000 +0100 @@ -52,7 +52,10 @@ subdir = lib/file DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +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)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -66,7 +69,7 @@ fileLockPrimitive.$(OBJEXT) fileLockPosix.$(OBJEXT) libFile_a_OBJECTS = $(am_libFile_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp +depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -92,8 +95,6 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -COMMON_CFLAGS = @COMMON_CFLAGS@ -COMMON_PROG_CFLAGS = @COMMON_PROG_CFLAGS@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -104,45 +105,57 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ -ECHO = @ECHO@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GREP = @GREP@ -GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_AUTH_CFLAGS = @LIB_AUTH_CFLAGS@ -LIB_FILE_CFLAGS = @LIB_FILE_CFLAGS@ -LIB_HGFS_SERVER_CFLAGS = @LIB_HGFS_SERVER_CFLAGS@ -LIB_IMPERSONATE_CFLAGS = @LIB_IMPERSONATE_CFLAGS@ -LIB_MISC_CFLAGS = @LIB_MISC_CFLAGS@ -LIB_PROC_MGR_CFLAGS = @LIB_PROC_MGR_CFLAGS@ -LIB_STRING_CFLAGS = @LIB_STRING_CFLAGS@ -LIB_USER_CFLAGS = @LIB_USER_CFLAGS@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -150,27 +163,35 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ VERSION = @VERSION@ -VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -201,6 +222,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -218,7 +240,7 @@ noinst_LIBRARIES = libFile.a libFile_a_SOURCES = file.c filePosix.c fileIO.c fileIOPosix.c \ fileLockPrimitive.c fileLockPosix.c -AM_CFLAGS = @COMMON_CFLAGS@ @LIB_FILE_CFLAGS@ +AM_CFLAGS = @LIB_FILE_CPPFLAGS@ all: all-am .SUFFIXES: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/fileUtf8/fileUTF8.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/fileUtf8/fileUTF8.c --- open-vm-tools-2008.01.23-74039/lib/fileUtf8/fileUTF8.c 2008-01-28 08:02:51.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/fileUtf8/fileUTF8.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,187 +0,0 @@ -/********************************************************* - * Copyright (C) 1998 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 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. - * - *********************************************************/ - -/* - * fileUTF8.c -- - * - * Interface to host-specific file functions for Posix hosts - * - */ - -#include "vmware.h" -#include "file.h" -#include "util.h" -#include "str.h" -#include "dynbuf.h" -#include "codeset.h" -#include "fileUTF8.h" - - -/* - *---------------------------------------------------------------------- - * - * FileUTF8_MakeTemp -- - * - * Create a temporary file and, if successful, return an open file - * descriptor to the file. - * - * 'tag' can either be a full pathname, a string, or NULL. - * - * If 'tag' is a full pathname, that path will be used as the root - * path for the file. - * - * If 'tag' is a string, the created file's filename will begin - * with 'tag' and will be created in the default temp directory. - * - * If 'tag' is NULL, then 'tag' is assumed to be "vmware" and the - * above case applies. - * - * This API is technically unsafe if you allow this function to use - * the default temp directory since it's not guaranteed on Windows - * that when the file is closed it is not readable by other users - * (no matter what we specify as the mode to open, the new file - * will inherit DACLs from the parent, and certain temp directories - * on Windows give all Power Users read&write access). Please use - * Util_MakeSafeTemp if your dependencies permit it. - * - * Results: - * Open file descriptor or -1; if successful then filename points - * to a dynamically allocated string with the pathname of the temp - * file. - * - * Side effects: - * Creates a file if successful. - * - *---------------------------------------------------------------------- - */ - -int -FileUTF8_MakeTemp(const char *utf8Tag, // IN (OPT) - char **presult) // OUT -{ - int result = 0; - char *localTag = NULL; - char *localResult = NULL; - size_t resultLength; - - if (NULL != presult) { - *presult = NULL; - } - - if ((NULL != utf8Tag) && !CodeSet_Utf8ToCurrent(utf8Tag, - strlen(utf8Tag), - (char **)&localTag, - NULL)) { - result = -1; - goto abort; - } - - result = File_MakeTemp(localTag, &localResult); - - if ((-1 != result) && (NULL != presult)) { - if (!CodeSet_CurrentToUtf8(localResult, - strlen(localResult), - presult, - &resultLength)) { - result = -1; - goto abort; - } - } - -abort: - free(localTag); - free(localResult); - - return result; -} - - -/* - *---------------------------------------------------------------------- - * - * FileUTF8_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 filename points - * to a dynamically allocated string with the pathname of the temp - * file. - * - * Side effects: - * Creates a file if successful. - * - *---------------------------------------------------------------------- - */ - -int -FileUTF8_MakeTempEx(const char *utf8Dir, // IN - const char *utf8FileName, // IN - char **presult) // OUT -{ - int result = 0; - char *localDir = NULL; - char *localFileName = NULL; - char *localResult = NULL; - size_t resultLength; - - if (NULL != presult) { - *presult = NULL; - } - - if ((NULL != utf8Dir) && !CodeSet_Utf8ToCurrent(utf8Dir, - strlen(utf8Dir), - (char **)&localDir, - NULL)) { - result = -1; - goto abort; - } - - if ((NULL != utf8FileName) && !CodeSet_Utf8ToCurrent(utf8FileName, - strlen(utf8FileName), - (char **)&localFileName, - NULL)) { - result = -1; - goto abort; - } - - result = File_MakeTempEx(localDir, localFileName, &localResult); - - if ((-1 != result) && (NULL != presult)) { - if (!CodeSet_CurrentToUtf8(localResult, - strlen(localResult), - presult, - &resultLength)) { - result = -1; - goto abort; - } - } - -abort: - free(localDir); - free(localFileName); - free(localResult); - - return result; -} diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/fileUtf8/fileUTF8Linux.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/fileUtf8/fileUTF8Linux.c --- open-vm-tools-2008.01.23-74039/lib/fileUtf8/fileUTF8Linux.c 2008-01-28 08:02:51.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/fileUtf8/fileUTF8Linux.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,782 +0,0 @@ -/********************************************************* - * Copyright (C) 1998 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 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. - * - *********************************************************/ - -/* - * fileUTF8Posix.c -- - * - * Interface to host-specific file functions for Posix hosts - * - */ - -#include /* Needed before sys/vfs.h with glibc 2.0 --hpreg */ -#ifndef __FreeBSD__ -#include -#include /* Needed before sys/mnttab.h in Solaris */ -#include -#endif -#include -#include -#include -#include -#include -#include -#include -#ifdef __linux__ -# include -#endif - -#include "vmware.h" -#include "file.h" -#include "util.h" -#include "str.h" -#include "dynbuf.h" -#include "codeset.h" -#include "fileUTF8.h" - - -/* - * There has been uncertainity about whether we should convert from - * the input/output string character set, which is assumed to be UTF-8, and the - * strings passed to the linux libs/systemcalls. Currently, we think this is - * unnecessary, since linux should accept utf-8. - */ -#define CONVERT_STRINGS_FROM_UTF8_TO_LOCAL 0 - - -/* - *----------------------------------------------------------------------------- - * - * FileUTF8_Copy -- - * - * Copy a file from one place to another. An existing file is never - * overwritten. - * - * Results: - * TRUE on success. - * - * Side effects: - * None. - * - *----------------------------------------------------------------------------- - */ - -Bool -FileUTF8_Copy(const char *utf8SrcFile, // IN: old file - const char *utf8DstFile) // IN: new file -{ - Bool result = FALSE; - char *localSrcName = NULL; - char *localDstName = NULL; - -#if CONVERT_STRINGS_FROM_UTF8_TO_LOCAL - if (!CodeSet_Utf8ToCurrent(utf8SrcFile, - strlen(utf8SrcFile), - &localSrcName, - NULL)) { - result = FALSE; - goto abort; - } - if (!CodeSet_Utf8ToCurrent(utf8DstFile, - strlen(utf8DstFile), - &localDstName, - NULL)) { - result = FALSE; - goto abort; - } -#else - localSrcName = (char *) utf8SrcFile; - localDstName = (char *) utf8DstFile; -#endif - - // The "2" on the next line tells the func to return an err if dst exists - result = File_Copy(localSrcName, localDstName, FALSE); - -#if CONVERT_STRINGS_FROM_UTF8_TO_LOCAL -abort: - free(localSrcName); - free(localDstName); -#endif - - return result; -} - - -/* - *----------------------------------------------------------------------------- - * - * FileUTF8_Rename -- - * - * Rename old file to new file. - * - * Results: - * TRUE on success. - * - * Side effects: - * None. - * - *----------------------------------------------------------------------------- - */ - -Bool -FileUTF8_Rename(const char *utf8OldFile, // IN: old file - const char *utf8NewFile) // IN: new file -{ - Bool result = FALSE; - char *localOldName = NULL; - char *localNewName = NULL; - -#if CONVERT_STRINGS_FROM_UTF8_TO_LOCAL - if (!CodeSet_Utf8ToCurrent(utf8OldFile, - strlen(utf8OldFile), - &localOldName, - NULL)) { - result = FALSE; - goto abort; - } - if (!CodeSet_Utf8ToCurrent(utf8NewFile, - strlen(utf8NewFile), - &localNewName, - NULL)) { - result = FALSE; - goto abort; - } -#else - localOldName = (char *) utf8OldFile; - localNewName = (char *) utf8NewFile; -#endif - - result = File_Rename(localOldName, localNewName); - -#if CONVERT_STRINGS_FROM_UTF8_TO_LOCAL -abort: - free(localOldName); - free(localNewName); -#endif - - return result; -} - - -/* - *---------------------------------------------------------------------------- - * - * FileUTF8_GetSize -- - * - * Get size of file. - * - * Results: - * Size of file on success, -1 otherwise. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------------- - */ - -int64 -FileUTF8_GetSize(const char *utf8Name) // IN -{ - int64 result = -1; -#if CONVERT_STRINGS_FROM_UTF8_TO_LOCAL - char *localName = NULL; - - if (CodeSet_Utf8ToCurrent(utf8Name, - strlen(utf8Name), - &localName, - NULL)) { - result = File_GetSize(localName); - free(localName); - } -#else - result = File_GetSize(utf8Name); -#endif - - return result; -} - - -/* - *---------------------------------------------------------------------- - * - * FileUTF8_CreateDirectory -- - * - * Creates the specified directory. - * - * Results: - * True if the directory is successfully created, false otherwise. - * - * Side effects: - * Creates the directory on disk. - * - *---------------------------------------------------------------------- - */ - -Bool -FileUTF8_CreateDirectory(char const *utf8Name) // IN -{ - Bool result = FALSE; - char *localName = NULL; - -#if CONVERT_STRINGS_FROM_UTF8_TO_LOCAL - if (!CodeSet_Utf8ToCurrent(utf8Name, - strlen(utf8Name), - &localName, - NULL)) { - return FALSE; - } -#else - localName = (char *) utf8Name; -#endif - - result = File_CreateDirectory(localName); - -#if CONVERT_STRINGS_FROM_UTF8_TO_LOCAL - free(localName); -#endif - - return result; -} - - -/* - *---------------------------------------------------------------------- - * - * FileUTF8_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 -FileUTF8_DeleteEmptyDirectory(char const *utf8Name) // IN -{ - Bool result = FALSE; - char *localName = NULL; - -#if CONVERT_STRINGS_FROM_UTF8_TO_LOCAL - if (!CodeSet_Utf8ToCurrent(utf8Name, - strlen(utf8Name), - &localName, - NULL)) { - return FALSE; - } -#else - localName = (char *) utf8Name; -#endif - - result = File_DeleteEmptyDirectory(localName); - -#if CONVERT_STRINGS_FROM_UTF8_TO_LOCAL - free(localName); -#endif - - return result; -} - - -/* - *---------------------------------------------------------------------- - * - * FileUTF8_ListDirectory -- - * - * Gets the list of files (and directories) in a directory. - * - * Results: - * Returns the number of files returned or -1 on failure. - * - * Side effects: - * Memory is allocated and must be freed. Array of strings and - * array itself must be freed. - * - *---------------------------------------------------------------------- - */ - -int -FileUTF8_ListDirectory(char const *utf8Name, // IN - char ***ids) // OUT: relative paths -{ - int result = 0; - char *localName = NULL; - int index; - char **strList; - char *currentLocalStr = NULL; -#if CONVERT_STRINGS_FROM_UTF8_TO_LOCAL - int resultLength; -#endif - -#if CONVERT_STRINGS_FROM_UTF8_TO_LOCAL - if (!CodeSet_Utf8ToCurrent(utf8Name, - strlen(utf8Name), - &localName, - NULL)) { - return -1; - } -#else - localName = (char *) utf8Name; -#endif - - result = File_ListDirectory(localName, ids); - - if ((result > 0) && (NULL != ids) && (NULL != *ids)) { - strList = *ids; - for (index = 0; index < result; index++) { - currentLocalStr = strList[index]; - if (NULL == currentLocalStr) { - continue; - } - -#if CONVERT_STRINGS_FROM_UTF8_TO_LOCAL - if (!CodeSet_CurrentToUtf8(currentLocalStr, - strlen(currentLocalStr), - &(strList[index]), - &resultLength)) { - result = -1; - goto abort; - } - free(currentLocalStr); -#else - strList[index] = currentLocalStr; -#endif - currentLocalStr = NULL; - } // for (index = 0; index < result; index++) - } // if ((result > 0) && (NULL != ids) && (NULL != *ids)) - -#if CONVERT_STRINGS_FROM_UTF8_TO_LOCAL -abort: - free(currentLocalStr); - free(localName); -#endif - - return result; -} - - -/* - *---------------------------------------------------------------------- - * - * FileUTF8_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 -FileUTF8_UnlinkIfExists(const char *utf8Name) // IN -{ - int result = 0; - char *localName = NULL; - -#if CONVERT_STRINGS_FROM_UTF8_TO_LOCAL - if (!CodeSet_Utf8ToCurrent(utf8Name, - strlen(utf8Name), - &localName, - NULL)) { - return 0; - } -#else - localName = (char *) utf8Name; -#endif - - result = unlink(localName); - if (result < 0 && ENOENT == errno) { - result = 0; - } - -#if CONVERT_STRINGS_FROM_UTF8_TO_LOCAL - free(localName); -#endif - - return result; -} - - -/* - *---------------------------------------------------------------------- - * - * FileUTF8_IsFile -- - * - * Check if specified file is a file or not - * - * Results: - * Bool - TRUE -> is a file, FALSE -> not a file or error - * - * Side effects: - * None - * - *---------------------------------------------------------------------- - */ - -Bool -FileUTF8_IsFile(const char *utf8Name) // IN -{ - Bool result = FALSE; - char *localName = NULL; - -#if CONVERT_STRINGS_FROM_UTF8_TO_LOCAL - if (!CodeSet_Utf8ToCurrent(utf8Name, - strlen(utf8Name), - &localName, - NULL)) { - return FALSE; - } -#else - localName = (char *) utf8Name; -#endif - - result = File_IsFile(localName); - -#if CONVERT_STRINGS_FROM_UTF8_TO_LOCAL - free(localName); -#endif - return result; -} - - -/* - *---------------------------------------------------------------------- - * - * FileUTF8_IsDirectory -- - * - * Check if specified file is a directory or not - * - * Results: - * Bool - TRUE -> is a directory, FALSE -> not a directory or error - * - * Side effects: - * None - * - *---------------------------------------------------------------------- - */ - -Bool -FileUTF8_IsDirectory(const char *utf8Name) // IN -{ - Bool result = FALSE; - char *localName = NULL; - -#if CONVERT_STRINGS_FROM_UTF8_TO_LOCAL - if (!CodeSet_Utf8ToCurrent(utf8Name, - strlen(utf8Name), - &localName, - NULL)) { - return FALSE; - } -#else - localName = (char *) utf8Name; -#endif - - result = File_IsDirectory(localName); - -#if CONVERT_STRINGS_FROM_UTF8_TO_LOCAL - free(localName); -#endif - return result; -} - - -/* - *---------------------------------------------------------------------- - * - * FileUTF8_IsSymLink -- - * - * Check if the specified file is a symbolic link or not. - * - * Results: - * Returns TRUE if 'name' is a symlink, or FALSE if - * 'name' is not a symlink or there is an error. - * - * Side effects: - * None - * - *---------------------------------------------------------------------- - */ - -Bool -FileUTF8_IsSymLink(char const *utf8Name) // IN: Path to test -{ - Bool result; - char *localName = NULL; - -#if CONVERT_STRINGS_FROM_UTF8_TO_LOCAL - if (!CodeSet_Utf8ToCurrent(utf8Name, - strlen(utf8Name), - &localName, - NULL)) { - return FALSE; - } -#else - localName = (char *) utf8Name; -#endif - - result = File_IsSymLink(localName); - -#if CONVERT_STRINGS_FROM_UTF8_TO_LOCAL - free(localName); -#endif - - return result; -} - - -/* - *---------------------------------------------------------------------- - * - * FileUTF8_Exists -- - * - * Check if a file exists. - * - * Results: - * TRUE if it exists - * FALSE if it doesn't exist - * - * Side effects: - * None - * - *---------------------------------------------------------------------- - */ - -Bool -FileUTF8_Exists(const char *utf8Name) // IN -{ - Bool result = FALSE; - char *localName = NULL; - -#if CONVERT_STRINGS_FROM_UTF8_TO_LOCAL - if (!CodeSet_Utf8ToCurrent(utf8Name, - strlen(utf8Name), - &localName, - NULL)) { - return FALSE; - } -#else - localName = (char *) utf8Name; -#endif - - result = File_Exists(localName); - -#if CONVERT_STRINGS_FROM_UTF8_TO_LOCAL - free(localName); -#endif - - return result; -} - - -/* - *---------------------------------------------------------------------- - * - * FileUTF8_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 -FileUTF8_GetTimes(const char *utf8Name, // 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 -{ - Bool result = FALSE; - char *localName = NULL; - -#if CONVERT_STRINGS_FROM_UTF8_TO_LOCAL - if (!CodeSet_Utf8ToCurrent(utf8Name, - strlen(utf8Name), - &localName, - NULL)) { - return FALSE; - } -#else - localName = (char *)utf8Name; -#endif - - result = File_GetTimes(localName, - createTime, - accessTime, - writeTime, - attrChangeTime); - -#if CONVERT_STRINGS_FROM_UTF8_TO_LOCAL - free(localName); -#endif - - return result; -} - - -/* - *---------------------------------------------------------------------- - * - * FileUTF8_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 utf8Name is a symlink, target's timestamps will be updated. - * Symlink itself's timestamps will not be changed. - * - *---------------------------------------------------------------------- - */ - -Bool -FileUTF8_SetTimes(const char *utf8Name, // IN - VmTimeType createTime, // IN: ignored - VmTimeType accessTime, // IN: Windows NT time format - VmTimeType writeTime, // IN: Windows NT time format - VmTimeType attrChangeTime) // IN: ignored -{ - Bool result = FALSE; - char *localName = NULL; - -#if CONVERT_STRINGS_FROM_UTF8_TO_LOCAL - if (!CodeSet_Utf8ToCurrent(utf8Name, - strlen(utf8Name), - &localName, - NULL)) { - return FALSE; - } -#else - localName = (char *) utf8Name; -#endif - - result = File_SetTimes(localName, createTime, accessTime, writeTime, attrChangeTime); - -#if CONVERT_STRINGS_FROM_UTF8_TO_LOCAL - free(localName); -#endif - - return result; -} - - -/* - *---------------------------------------------------------------------- - * - * FileUTF8_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 if the entire tree was deleted or didn't exist, FALSE otherwise. - * - * Side effects: - * Deletes the directory tree from disk. - * - *---------------------------------------------------------------------- - */ - -Bool -FileUTF8_DeleteDirectoryTree(char const *utf8Name) // IN: directory to delete -{ - Bool result = FALSE; - char *localName = NULL; - -#if CONVERT_STRINGS_FROM_UTF8_TO_LOCAL - if (!CodeSet_Utf8ToCurrent(utf8Name, - strlen(utf8Name), - &localName, - NULL)) { - return FALSE; - } -#else - localName = (char *) utf8Name; -#endif - - result = File_DeleteDirectoryTree(localName); - -#if CONVERT_STRINGS_FROM_UTF8_TO_LOCAL - free(localName); -#endif - - return result; -} - - -/* - *----------------------------------------------------------------------------- - * - * FileUTF8_CreateDirectoryHierarchy -- - * - * Create a directory including any parents that don't already exist. - * - * Results: - * TRUE on success, FALSE on failure. - * - * Side effects: - * Only the obvious. - * - *----------------------------------------------------------------------------- - */ - -Bool -FileUTF8_CreateDirectoryHierarchy(char const *utf8Name) // IN -{ - Bool result = FALSE; - char *localName = NULL; - -#if CONVERT_STRINGS_FROM_UTF8_TO_LOCAL - if (!CodeSet_Utf8ToCurrent(utf8Name, - strlen(utf8Name), - (char **)&localName, - NULL)) { - return FALSE; - } -#else - localName = (char *) utf8Name; -#endif - - result = File_CreateDirectoryHierarchy(localName); - -#if CONVERT_STRINGS_FROM_UTF8_TO_LOCAL - free(localName); -#endif - - return result; -} diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/fileUtf8/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/fileUtf8/Makefile.am --- open-vm-tools-2008.01.23-74039/lib/fileUtf8/Makefile.am 2008-01-28 08:02:49.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/fileUtf8/Makefile.am 1970-01-01 01:00:00.000000000 +0100 @@ -1,25 +0,0 @@ -################################################################################ -### Copyright 2007 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_LIBRARIES = libFileUtf8.a - -libFileUtf8_a_SOURCES = -libFileUtf8_a_SOURCES += fileUTF8.c -libFileUtf8_a_SOURCES += fileUTF8Linux.c - -AM_CFLAGS = -AM_CFLAGS += @COMMON_CFLAGS@ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/fileUtf8/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/fileUtf8/Makefile.in --- open-vm-tools-2008.01.23-74039/lib/fileUtf8/Makefile.in 2008-01-28 08:03:03.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/fileUtf8/Makefile.in 1970-01-01 01:00:00.000000000 +0100 @@ -1,474 +0,0 @@ -# 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 2007 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/fileUtf8 -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_CLEAN_FILES = -LIBRARIES = $(noinst_LIBRARIES) -ARFLAGS = cru -libFileUtf8_a_AR = $(AR) $(ARFLAGS) -libFileUtf8_a_LIBADD = -am_libFileUtf8_a_OBJECTS = fileUTF8.$(OBJEXT) fileUTF8Linux.$(OBJEXT) -libFileUtf8_a_OBJECTS = $(am_libFileUtf8_a_OBJECTS) -DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/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 = $(libFileUtf8_a_SOURCES) -DIST_SOURCES = $(libFileUtf8_a_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_CFLAGS = @COMMON_CFLAGS@ -COMMON_PROG_CFLAGS = @COMMON_PROG_CFLAGS@ -COMMON_XLIBS = @COMMON_XLIBS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DNET_CFLAGS = @DNET_CFLAGS@ -DNET_CONFIG = @DNET_CONFIG@ -DNET_LIBS = @DNET_LIBS@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -GREP = @GREP@ -GTK_CFLAGS = @GTK_CFLAGS@ -GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ -HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIB_AUTH_CFLAGS = @LIB_AUTH_CFLAGS@ -LIB_FILE_CFLAGS = @LIB_FILE_CFLAGS@ -LIB_HGFS_SERVER_CFLAGS = @LIB_HGFS_SERVER_CFLAGS@ -LIB_IMPERSONATE_CFLAGS = @LIB_IMPERSONATE_CFLAGS@ -LIB_MISC_CFLAGS = @LIB_MISC_CFLAGS@ -LIB_PROC_MGR_CFLAGS = @LIB_PROC_MGR_CFLAGS@ -LIB_STRING_CFLAGS = @LIB_STRING_CFLAGS@ -LIB_USER_CFLAGS = @LIB_USER_CFLAGS@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MKDIR_P = @MKDIR_P@ -MODULES = @MODULES@ -MODULES_OS = @MODULES_OS@ -OBJEXT = @OBJEXT@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ -XMKMF = @XMKMF@ -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_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -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@ -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_LIBRARIES = libFileUtf8.a -libFileUtf8_a_SOURCES = fileUTF8.c fileUTF8Linux.c -AM_CFLAGS = @COMMON_CFLAGS@ -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/fileUtf8/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu lib/fileUtf8/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-noinstLIBRARIES: - -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) -libFileUtf8.a: $(libFileUtf8_a_OBJECTS) $(libFileUtf8_a_DEPENDENCIES) - -rm -f libFileUtf8.a - $(libFileUtf8_a_AR) libFileUtf8.a $(libFileUtf8_a_OBJECTS) $(libFileUtf8_a_LIBADD) - $(RANLIB) libFileUtf8.a - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fileUTF8.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fileUTF8Linux.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 $(LIBRARIES) -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-noinstLIBRARIES \ - 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-noinstLIBRARIES 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: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/foundryMsg/foundryMsg.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/foundryMsg/foundryMsg.c --- open-vm-tools-2008.01.23-74039/lib/foundryMsg/foundryMsg.c 2008-01-28 08:02:51.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/foundryMsg/foundryMsg.c 2008-10-13 08:01:51.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -39,6 +39,14 @@ static void VixMsgInitializeObfuscationMapping(void); +static char *VixMsgEncodeBuffer(const uint8 *buffer, + size_t bufferLength, + Bool includeEncodingId); + +static char *VixMsgDecodeBuffer(const char *str, + Bool nullTerminateResult, + size_t *bufferLength); + /* *---------------------------------------------------------------------------- @@ -144,9 +152,9 @@ */ responseHeader->commonHeader.magic = VIX_COMMAND_MAGIC_WORD; responseHeader->commonHeader.messageVersion = VIX_COMMAND_MESSAGE_VERSION; - responseHeader->commonHeader.totalMessageLength = (uint32) totalMessageSize; + responseHeader->commonHeader.totalMessageLength = totalMessageSize; responseHeader->commonHeader.headerLength = sizeof(VixCommandResponseHeader); - responseHeader->commonHeader.bodyLength = (uint32) responseBodyLength; + responseHeader->commonHeader.bodyLength = responseBodyLength; responseHeader->commonHeader.credentialLength = 0; responseHeader->commonHeader.commonFlags = 0; if (NULL != requestHeader) { @@ -226,10 +234,12 @@ commandRequest->commonHeader.magic = VIX_COMMAND_MAGIC_WORD; commandRequest->commonHeader.messageVersion = VIX_COMMAND_MESSAGE_VERSION; - commandRequest->commonHeader.totalMessageLength = (uint32)(msgHeaderAndBodyLength + credentialLength); - commandRequest->commonHeader.headerLength = (uint32)sizeof(VixCommandRequestHeader); - commandRequest->commonHeader.bodyLength = (uint32)(msgHeaderAndBodyLength - sizeof(VixCommandRequestHeader)); - commandRequest->commonHeader.credentialLength = (uint32)credentialLength; + commandRequest->commonHeader.totalMessageLength = + msgHeaderAndBodyLength + credentialLength; + commandRequest->commonHeader.headerLength = sizeof(VixCommandRequestHeader); + commandRequest->commonHeader.bodyLength = msgHeaderAndBodyLength - + sizeof(VixCommandRequestHeader); + commandRequest->commonHeader.credentialLength = credentialLength; commandRequest->commonHeader.commonFlags = VIX_COMMAND_REQUEST; commandRequest->opCode = opCode; @@ -407,6 +417,93 @@ /* *----------------------------------------------------------------------------- * + * VixMsg_ParseWriteVariableRequest -- + * + * Extract the value's name and the value itself from the request + * message, while validating message. + * + * The strings returned from this function just point to memory in + * the message itself, so they must not be free()'d. + * + * Results: + * VixError + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +VixError +VixMsg_ParseWriteVariableRequest(VixMsgWriteVariableRequest *msg, // IN + char **valueName, // OUT + char **value) // OUT +{ + VixError err; + char *valueNameLocal = NULL; + char *valueLocal = NULL; + uint64 headerAndBodyLength; + + if ((NULL == msg) || (NULL == valueName) || (NULL == value)) { + ASSERT(0); + err = VIX_E_FAIL; + goto abort; + } + + *valueName = NULL; + *value = NULL; + + /* + * In most cases we will have already called VixMsg_ValidateResponseMsg() + * on this request before, but call it here so that this function will + * always be sufficient to validate the request. + */ + err = VixMsg_ValidateRequestMsg(msg, + msg->header.commonHeader.totalMessageLength); + if (VIX_OK != err) { + goto abort; + } + + if (msg->header.commonHeader.totalMessageLength < sizeof *msg) { + err = VIX_E_INVALID_MESSAGE_BODY; + goto abort; + } + + headerAndBodyLength = (uint64) msg->header.commonHeader.headerLength + + msg->header.commonHeader.bodyLength; + + if (headerAndBodyLength < ((uint64) sizeof *msg + + msg->nameLength + 1 + + msg->valueLength + 1)) { + err = VIX_E_INVALID_MESSAGE_BODY; + goto abort; + } + + valueNameLocal = ((char *) msg) + sizeof(*msg); + if ('\0' != valueNameLocal[msg->nameLength]) { + err = VIX_E_INVALID_MESSAGE_BODY; + goto abort; + } + + valueLocal = valueNameLocal + msg->nameLength + 1; + if ('\0' != valueLocal[msg->valueLength]) { + err = VIX_E_INVALID_MESSAGE_BODY; + goto abort; + } + + *valueName = valueNameLocal; + *value = valueLocal; + err = VIX_OK; + +abort: + + return err; +} // VixMsg_ParseWriteVariableRequest + + +/* + *----------------------------------------------------------------------------- + * * VixMsgInitializeObfuscationMapping -- * * @@ -486,17 +583,12 @@ VixMsg_ObfuscateNamePassword(const char *userName, // IN const char *password) // IN { - char *packedBufferString = NULL; - char *base64String = NULL; + char *packedBuffer = NULL; char *resultString = NULL; - size_t resultBufferLength = 0; - size_t resultLength = 0; + char *destPtr; + size_t packedBufferLength = 0; size_t nameLength = 0; size_t passwordLength = 0; - char *srcPtr; - char *endSrcPtr; - char *destPtr; - size_t base64Length; if (NULL != userName) { nameLength = strlen(userName); @@ -507,14 +599,9 @@ /* * Leave space for null terminating characters. */ - resultLength = nameLength + 1 + passwordLength + 1; - - /* - * Expand it to make space for base64 encoding, and escaping some characters. - */ - resultBufferLength = resultLength * 3; - packedBufferString = Util_SafeMalloc(resultBufferLength + 1); - destPtr = packedBufferString; + packedBufferLength = nameLength + 1 + passwordLength + 1; + packedBuffer = Util_SafeMalloc(packedBufferLength); + destPtr = packedBuffer; if (NULL != userName) { Str_Strcpy(destPtr, userName, nameLength + 1); destPtr += nameLength; @@ -526,39 +613,9 @@ } *(destPtr++) = 0; - base64String = Util_SafeMalloc(resultBufferLength + 1); - if (!(Base64_Encode((uint8 const *) packedBufferString, - destPtr - packedBufferString, - base64String, - resultBufferLength, - &base64Length))) { - goto abort; - } - - /* - * Now, escape problematic characters. - */ - VixMsgInitializeObfuscationMapping(); - resultString = Util_SafeMalloc(resultBufferLength + 1); - destPtr = resultString; - srcPtr = base64String; - endSrcPtr = base64String + base64Length; - while ( srcPtr < endSrcPtr ) - { - if (PlainToObfuscatedCharMap[(int) (*srcPtr)]) { - *(destPtr++) = '\\'; - *(destPtr++) = PlainToObfuscatedCharMap[(int) (*srcPtr)]; - } else { - *(destPtr++) = *srcPtr; - } - - srcPtr++; - } - *destPtr = 0; + resultString = VixMsgEncodeBuffer(packedBuffer, packedBufferLength, FALSE); -abort: - free(packedBufferString); - free(base64String); + Util_ZeroFree(packedBuffer, packedBufferLength); return(resultString); } // VixMsg_ObfuscateNamePassword @@ -569,11 +626,11 @@ * * VixMsg_DeObfuscateNamePassword -- * - * This reverses VixMsg_ObfuscateNamePassword. - * See the notes for that procedure. + * This reverses VixMsg_ObfuscateNamePassword. + * See the notes for that procedure. * * Results: - * VixError + * Bool. TRUE on success, FALSE otherwise. * * Side effects: * None. @@ -587,39 +644,15 @@ char **passwordResult) // OUT { Bool success = FALSE; - char *base64String = NULL; char *packedString = NULL; char *srcPtr; - char *destPtr; - size_t base64Length; size_t packedStringLength; - - /* - * Remove escaped special characters. - * Do this in a private copy because we will change the string in place. - */ - VixMsgInitializeObfuscationMapping(); - base64String = Util_SafeStrdup(packagedName); - destPtr = base64String; - srcPtr = base64String; - while ( *srcPtr ) { - if ( '\\' == *srcPtr ) { - srcPtr++; - *(destPtr++) = ObfuscatedToPlainCharMap[(int) (*srcPtr)]; - } else { - *(destPtr++) = *srcPtr; - } - srcPtr++; - } - *destPtr = 0; - base64Length = strlen(base64String); - - packedString = Util_SafeMalloc(base64Length + 1); - if (!Base64_Decode(base64String, packedString, base64Length, &packedStringLength)) { + packedString = VixMsgDecodeBuffer(packagedName, FALSE, &packedStringLength); + if (NULL == packedString) { goto abort; } - + srcPtr = packedString; if (NULL != userNameResult) { *userNameResult = Util_SafeStrdup(srcPtr); @@ -632,8 +665,7 @@ success = TRUE; abort: - free(base64String); - free(packedString); + Util_ZeroFree(packedString, packedStringLength); return(success); } // VixMsg_DeObfuscateNamePassword @@ -661,64 +693,103 @@ char * VixMsg_EncodeString(const char *str) // IN { + if (NULL == str) { + str = ""; + } + + return VixMsgEncodeBuffer(str, strlen(str), TRUE); +} // VixMsg_EncodeString + + +/* + *----------------------------------------------------------------------------- + * + * VixMsgEncodeBuffer -- + * + * This makes a string safe to pass over a backdoor Tclo command as a + * string. It base64 encodes a string, which removes quote, space, + * backslash, and other characters. This will also allow us to pass + * UTF-8 strings. + * + * Results: + * VixError + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +char * +VixMsgEncodeBuffer(const uint8 *buffer, // IN + size_t bufferLength, // IN + Bool includeEncodingId) // IN: Add 'a' (ASCII) at start of output +{ char *base64String = NULL; char *resultString = NULL; size_t resultBufferLength = 0; - size_t strLength = 0; char *srcPtr; char *endSrcPtr; char *destPtr; size_t base64Length; - if (NULL == str) { - str = ""; - } - strLength = strlen(str); - - resultBufferLength = (strLength + 1) * 3; - base64String = Util_SafeMalloc(resultBufferLength + 1); - if (!(Base64_Encode((uint8 const *) str, - strLength, + base64Length = Base64_EncodedLength((uint8 const *) buffer, + bufferLength); + base64String = Util_SafeMalloc(base64Length); + if (!(Base64_Encode((uint8 const *) buffer, + bufferLength, base64String, - resultBufferLength, + base64Length, &base64Length))) { goto abort; } VixMsgInitializeObfuscationMapping(); + + /* + * Expand it to make space for escaping some characters. + */ + resultBufferLength = base64Length * 2; + if (includeEncodingId) { + resultBufferLength++; + } + resultString = Util_SafeMalloc(resultBufferLength + 1); destPtr = resultString; srcPtr = base64String; endSrcPtr = base64String + base64Length; - /* - * Start with the character-set type. - * 'a' means ASCII. - */ - *(destPtr++) = 'a'; + if (includeEncodingId) { + /* + * Start with the character-set type. + * 'a' means ASCII. + */ + *(destPtr++) = 'a'; + } /* * Now, escape problematic characters. */ - while ( srcPtr < endSrcPtr ) + while (srcPtr < endSrcPtr) { - if (PlainToObfuscatedCharMap[(int) (*srcPtr)]) { + if (PlainToObfuscatedCharMap[(unsigned int) (*srcPtr)]) { *(destPtr++) = '\\'; - *(destPtr++) = PlainToObfuscatedCharMap[(int) (*srcPtr)]; + *(destPtr++) = PlainToObfuscatedCharMap[(unsigned int) (*srcPtr)]; } else { *(destPtr++) = *srcPtr; } srcPtr++; } + + ASSERT_NOT_IMPLEMENTED((destPtr - resultString) <= resultBufferLength); *destPtr = 0; abort: free(base64String); - return(resultString); -} // VixMsg_EncodeString - + return resultString; +} // VixMsgEncodeBuffer /* *----------------------------------------------------------------------------- @@ -729,7 +800,7 @@ * See the notes for that procedure. * * Results: - * VixError + * A pointer to the decoded string, or NULL on failure. * * Side effects: * None. @@ -740,13 +811,6 @@ char * VixMsg_DecodeString(const char *str) // IN { - char *base64String = NULL; - char *resultStr = NULL; - char *srcPtr; - char *destPtr; - size_t base64Length; - size_t resultStringLength; - /* * Check the character set. * 'a' means ASCII. @@ -754,40 +818,105 @@ if ((NULL == str) || ('a' != *str)) { return(NULL); } - str += 1; - VixMsgInitializeObfuscationMapping(); - base64String = Util_SafeStrdup(str); - destPtr = base64String; - srcPtr = base64String; + return VixMsgDecodeBuffer(str + 1, TRUE, NULL); +} // VixMsg_DecodeString + + +/* + *----------------------------------------------------------------------------- + * + * VixMsgDecodeBuffer -- + * + * This reverses VixMsgEncodeBuffer. + * See the notes for that procedure. + * + * Results: + * A pointer to the decoded string, or NULL on failure. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +char * +VixMsgDecodeBuffer(const char *str, // IN + Bool nullTerminateResult, // OUT + size_t *bufferLength) // OUT: Optional +{ + char *base64String = NULL; + char *resultStr = NULL; + char *srcPtr; + char *destPtr; + size_t resultStrAllocatedLength; + size_t resultStrLogicalLength; + + if (NULL != bufferLength) { + *bufferLength = 0; + } /* * Remove escaped special characters. * Do this in a private copy because we will change the string in place. */ - while ( *srcPtr ) { - if ( '\\' == *srcPtr ) { + VixMsgInitializeObfuscationMapping(); + base64String = Util_SafeStrdup(str); + destPtr = base64String; + srcPtr = base64String; + + while (*srcPtr) { + if ('\\' == *srcPtr) { srcPtr++; - *(destPtr++) = ObfuscatedToPlainCharMap[(int) (*srcPtr)]; + /* + * There should never be a null byte as part of an escape character or + * an escape character than translates into a null byte. + */ + if ((0 == *srcPtr) + || (0 == ObfuscatedToPlainCharMap[(unsigned int) (*srcPtr)])) { + goto abort; + } + *(destPtr++) = ObfuscatedToPlainCharMap[(unsigned int) (*srcPtr)]; } else { *(destPtr++) = *srcPtr; } srcPtr++; } *destPtr = 0; - base64Length = strlen(base64String); - resultStr = Util_SafeMalloc(base64Length + 1); - if (!Base64_Decode(base64String, resultStr, base64Length, &resultStringLength)) { + /* + * Add 1 to the Base64_DecodedLength(), since we base64 encoded the string + * without the NUL terminator and need to add one. + */ + resultStrAllocatedLength = Base64_DecodedLength(base64String, + destPtr - base64String); + if (nullTerminateResult) { + resultStrAllocatedLength += 1; + } + + resultStr = Util_SafeMalloc(resultStrAllocatedLength); + if (!Base64_Decode(base64String, + resultStr, + resultStrAllocatedLength, + &resultStrLogicalLength) + || (resultStrLogicalLength > resultStrAllocatedLength)) { free(resultStr); resultStr = NULL; goto abort; } - resultStr[resultStringLength] = 0; + + if (nullTerminateResult) { + ASSERT_NOT_IMPLEMENTED(resultStrLogicalLength < resultStrAllocatedLength); + resultStr[resultStrLogicalLength] = 0; + } + + if (NULL != bufferLength) { + *bufferLength = resultStrLogicalLength; + } abort: free(base64String); return(resultStr); -} // VixMsg_DecodeString +} // VixMsgDecodeBuffer diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/foundryMsg/foundryPropertyListCommon.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/foundryMsg/foundryPropertyListCommon.c --- open-vm-tools-2008.01.23-74039/lib/foundryMsg/foundryPropertyListCommon.c 2008-01-28 08:02:51.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/foundryMsg/foundryPropertyListCommon.c 2008-10-13 08:01:51.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -403,6 +403,16 @@ pos += propertyTypeSize; lengthPtr = (int*) &(buffer[pos]); pos += propertyValueLengthSize; + + /* + * Do not allow lengths of 0 or fewer bytes. Those do not make sense, + * unless you can pass a NULL blob, which Serialize() does not allow. + * Also, make sure the value is contained within the bounds of the buffer. + */ + if ((*lengthPtr < 1) || ((*lengthPtr + pos) > bufferSize)) { + err = VIX_E_INVALID_SERIALIZED_DATA; + goto abort; + } /* * Create the property if missing @@ -424,6 +434,10 @@ switch(*propertyTypePtr) { //////////////////////////////////////////////////////// case VIX_PROPERTYTYPE_INTEGER: + if (PROPERTY_SIZE_INT32 != *lengthPtr) { + err = VIX_E_INVALID_SERIALIZED_DATA; + goto abort; + } intPtr = (int*) &(buffer[pos]); property->value.intValue = *intPtr; break; @@ -431,18 +445,34 @@ //////////////////////////////////////////////////////// case VIX_PROPERTYTYPE_STRING: strPtr = (char*) &(buffer[pos]); + /* + * The length that Serialize() generates includes the terminating + * NUL character. + */ + if (strPtr[*lengthPtr - 1] != '\0') { + err = VIX_E_INVALID_SERIALIZED_DATA; + goto abort; + } free(property->value.strValue); property->value.strValue = Util_SafeStrdup(strPtr); break; //////////////////////////////////////////////////////// case VIX_PROPERTYTYPE_BOOL: + if (PROPERTY_SIZE_BOOL != *lengthPtr) { + err = VIX_E_INVALID_SERIALIZED_DATA; + goto abort; + } boolPtr = (Bool*) &(buffer[pos]); property->value.boolValue = *boolPtr; break; //////////////////////////////////////////////////////// case VIX_PROPERTYTYPE_INT64: + if (PROPERTY_SIZE_INT64 != *lengthPtr) { + err = VIX_E_INVALID_SERIALIZED_DATA; + goto abort; + } int64Ptr = (int64*) &(buffer[pos]); property->value.int64Value = *int64Ptr; break; @@ -451,6 +481,17 @@ case VIX_PROPERTYTYPE_BLOB: blobPtr = (unsigned char*) &(buffer[pos]); property->value.blobValue.blobSize = *lengthPtr; + /* + * Use regular malloc() when allocating amounts specified by another + * process. Admittedly we've already bounds checked it, but this is + * pretty easy to handle. + */ + free(property->value.blobValue.blobContents); + property->value.blobValue.blobContents = malloc(*lengthPtr); + if (NULL == property->value.blobValue.blobContents) { + err = VIX_E_OUT_OF_MEMORY; + goto abort; + } memcpy(property->value.blobValue.blobContents, blobPtr, *lengthPtr); break; @@ -458,6 +499,10 @@ case VIX_PROPERTYTYPE_POINTER: // The size may be different on different machines. // To be safe, we always use 8 bytes. + if (PROPERTY_SIZE_POINTER != *lengthPtr) { + err = VIX_E_INVALID_SERIALIZED_DATA; + goto abort; + } ptrPtr = (void**) &(buffer[pos]); property->value.ptrValue = *ptrPtr; break; diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/foundryMsg/foundryThreads.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/foundryMsg/foundryThreads.c --- open-vm-tools-2008.01.23-74039/lib/foundryMsg/foundryThreads.c 2008-01-28 08:02:51.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/foundryMsg/foundryThreads.c 2008-10-13 08:01:51.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -146,7 +146,7 @@ #ifdef _WIN32 DWORD waitResult; - ASSERT(threadState->threadId != Util_GetCurrentThreadId()); + ASSERT(threadState->threadId != GetCurrentThreadId()); waitResult = WaitForSingleObject(threadState->threadHandle, 30000); if (WAIT_OBJECT_0 != waitResult) { @@ -164,6 +164,35 @@ free(threadState); } +/* + *----------------------------------------------------------------------------- + * + * FoundryThreads_Free -- + * + * Destroys the thread state. + * + * Results: + * None. + * + * Side effects: + * + *----------------------------------------------------------------------------- + */ + +void +FoundryThreads_Free(FoundryWorkerThread *threadState) // IN +{ + if (NULL != threadState) { +#ifdef _WIN32 + CloseHandle(threadState->threadHandle); + threadState->threadHandle = NULL; +#else + threadState->threadInfo = 0; +#endif + } + + free(threadState); +} /* *----------------------------------------------------------------------------- @@ -189,7 +218,7 @@ } #ifdef _WIN32 { - DWORD id = GetCurrentThreadId(); + Util_ThreadID id = GetCurrentThreadId(); if (id == threadState->threadId) { return TRUE; } diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/foundryMsg/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/foundryMsg/Makefile.am --- open-vm-tools-2008.01.23-74039/lib/foundryMsg/Makefile.am 2008-01-28 08:02:49.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/foundryMsg/Makefile.am 2008-10-13 08:01:48.000000000 +0100 @@ -22,6 +22,3 @@ libFoundryMsg_a_SOURCES += foundryThreads.c libFoundryMsg_a_SOURCES += foundryPropertyListCommon.c libFoundryMsg_a_SOURCES += vixTranslateErrOpenSource.c - -AM_CFLAGS = -AM_CFLAGS += @COMMON_CFLAGS@ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/foundryMsg/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/foundryMsg/Makefile.in --- open-vm-tools-2008.01.23-74039/lib/foundryMsg/Makefile.in 2008-01-28 08:03:03.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/foundryMsg/Makefile.in 2008-10-13 08:02:13.000000000 +0100 @@ -52,7 +52,10 @@ subdir = lib/foundryMsg DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +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)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -66,7 +69,7 @@ vixTranslateErrOpenSource.$(OBJEXT) libFoundryMsg_a_OBJECTS = $(am_libFoundryMsg_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp +depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -92,8 +95,6 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -COMMON_CFLAGS = @COMMON_CFLAGS@ -COMMON_PROG_CFLAGS = @COMMON_PROG_CFLAGS@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -104,45 +105,57 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ -ECHO = @ECHO@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GREP = @GREP@ -GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_AUTH_CFLAGS = @LIB_AUTH_CFLAGS@ -LIB_FILE_CFLAGS = @LIB_FILE_CFLAGS@ -LIB_HGFS_SERVER_CFLAGS = @LIB_HGFS_SERVER_CFLAGS@ -LIB_IMPERSONATE_CFLAGS = @LIB_IMPERSONATE_CFLAGS@ -LIB_MISC_CFLAGS = @LIB_MISC_CFLAGS@ -LIB_PROC_MGR_CFLAGS = @LIB_PROC_MGR_CFLAGS@ -LIB_STRING_CFLAGS = @LIB_STRING_CFLAGS@ -LIB_USER_CFLAGS = @LIB_USER_CFLAGS@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -150,27 +163,35 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ VERSION = @VERSION@ -VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -201,6 +222,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -218,7 +240,6 @@ noinst_LIBRARIES = libFoundryMsg.a libFoundryMsg_a_SOURCES = foundryMsg.c foundryThreads.c \ foundryPropertyListCommon.c vixTranslateErrOpenSource.c -AM_CFLAGS = @COMMON_CFLAGS@ all: all-am .SUFFIXES: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/foundryMsg/vixTranslateErrOpenSource.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/foundryMsg/vixTranslateErrOpenSource.c --- open-vm-tools-2008.01.23-74039/lib/foundryMsg/vixTranslateErrOpenSource.c 2008-01-28 08:02:51.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/foundryMsg/vixTranslateErrOpenSource.c 2008-10-13 08:01:51.000000000 +0100 @@ -8,11 +8,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -37,6 +37,8 @@ #ifndef _WIN32 #include #include +#else +#include "win32u.h" #endif @@ -60,7 +62,7 @@ { VixError err = VIX_E_FAIL; #ifdef _WIN32 - LPVOID lpMsgBuf; + Unicode msg; switch (systemError) { case ERROR_ACCESS_DENIED: @@ -110,13 +112,13 @@ default: err = VIX_E_FAIL; } - FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, - NULL, systemError, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - (LPTSTR) &lpMsgBuf, 0, NULL); + msg = Win32U_FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, + NULL, systemError, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + NULL); Log("Foundry operation failed with system error: %s (%d), translated to %"FMT64"d\n", - lpMsgBuf, systemError, err); - LocalFree(lpMsgBuf); + msg, systemError, err); + Unicode_Free(msg); #else // linux, other *nix switch (systemError) { diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/ghIntegration/ghIntegration.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/ghIntegration/ghIntegration.c --- open-vm-tools-2008.01.23-74039/lib/ghIntegration/ghIntegration.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/ghIntegration/ghIntegration.c 2008-10-13 08:01:50.000000000 +0100 @@ -0,0 +1,967 @@ +/********************************************************* + * Copyright (C) 2007 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. + * + *********************************************************/ + +/* + * ghIntegration.c -- + * + * Guest-host integration functions. + */ + +#include "vmware.h" +#include "appUtil.h" +#include "debug.h" +#include "dynxdr.h" +#include "ghIntegration.h" +#include "ghIntegrationInt.h" +#include "guestCaps.h" +#include "guestrpc/ghiGetBinaryHandlers.h" +#include "guestrpc/ghiProtocolHandler.h" +#include "guest_msg_def.h" +#include "rpcin.h" +#include "rpcout.h" +#include "str.h" +#include "strutil.h" +#include "unityCommon.h" +#include "util.h" + + +/* + * Local functions + */ + +static Bool GHITcloGetBinaryInfo(char const **result, size_t *resultLen, + const char *name, const char *args, + size_t argsSize, void *clientData); +static Bool GHITcloGetBinaryHandlers(RpcInData *data); +static Bool GHITcloGetStartMenuItem(char const **result, + size_t *resultLen, + const char *name, + const char *args, + size_t argsSize, + void *clientData); +static Bool GHITcloOpenStartMenu(char const **result, + size_t *resultLen, + const char *name, + const char *args, + size_t argsSize, + void *clientData); +static Bool GHITcloCloseStartMenu(char const **result, + size_t *resultLen, + const char *name, + const char *args, + size_t argsSize, + void *clientData); +static Bool GHITcloShellOpen(char const **result, + size_t *resultLen, + const char *name, + const char *args, + size_t argsSize, + void *clientData); +static Bool GHITcloShellAction(char const **result, + size_t *resultLen, + const char *name, + const char *args, + size_t argsSize, + void *clientData); +static Bool GHITcloSetGuestHandler(RpcInData *data); +static Bool GHITcloRestoreDefaultGuestHandler(RpcInData *data); + +static Bool GHIUpdateHost(GHIProtocolHandlerList *handlers); + +DynBuf gTcloUpdate; +static GHIPlatform *ghiPlatformData; + +DblLnkLst_Links launchMenu; + +/* + *---------------------------------------------------------------------------- + * + * GHI_IsSupported -- + * + * Determine whether this guest supports guest-host integration. + * + * Results: + * TRUE if the guest supports guest-host integration + * FALSE otherwise + * + * Side effects: + * None + * + *---------------------------------------------------------------------------- + */ + +Bool +GHI_IsSupported(void) +{ + return GHIPlatformIsSupported(); +} + + +/* + *----------------------------------------------------------------------------- + * + * GHI_RegisterCaps -- + * + * Called by the application (VMwareUser) to allow the GHI subsystem to + * register its capabilities. + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +void +GHI_RegisterCaps(void) +{ + /* Register guest platform specific capabilities. */ + GHIPlatformRegisterCaps(ghiPlatformData); +} + + +/* + *----------------------------------------------------------------------------- + * + * GHI_UnregisterCaps -- + * + * Called by the application (VMwareUser) to allow the GHI subsystem to + * unregister its capabilities. + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +void +GHI_UnregisterCaps(void) +{ + /* Unregister guest platform specific capabilities. */ + GHIPlatformUnregisterCaps(ghiPlatformData); +} + + +/* + *----------------------------------------------------------------------------- + * + * GHI_Init -- + * + * One time initialization stuff. + * + * Results: + * None. + * + * Side effects: + * May register with the tools poll loop. + * + *----------------------------------------------------------------------------- + */ + +void +GHI_Init(VMU_ControllerCB *vmuControllerCB, // IN + void *ctx) // IN +{ + Debug("%s\n", __FUNCTION__); + + DblLnkLst_Init(&launchMenu); + + ghiPlatformData = GHIPlatformInit(vmuControllerCB, ctx); +} + + +/* + *----------------------------------------------------------------------------- + * + * GHI_Cleanup -- + * + * One time cleanup. + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +void +GHI_Cleanup(void) +{ + GHIPlatformCleanup(ghiPlatformData); + ghiPlatformData = NULL; +} + + +/* + *----------------------------------------------------------------------------- + * + * GHI_InitBackdoor -- + * + * One time initialization stuff for the backdoor. + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +void +GHI_InitBackdoor(struct RpcIn *rpcIn) // IN +{ + /* + * Only register the callback if the guest is capable of supporting GHI. + * This way, if the VMX/UI sends us a GHI request on a non-supported platform + * (for whatever reason), we will reply with 'command not supported'. + */ + + if (GHI_IsSupported()) { + RpcIn_RegisterCallback(rpcIn, UNITY_RPC_GET_BINARY_INFO, + GHITcloGetBinaryInfo, NULL); + RpcIn_RegisterCallbackEx(rpcIn, UNITY_RPC_GET_BINARY_HANDLERS, + GHITcloGetBinaryHandlers, NULL); + RpcIn_RegisterCallback(rpcIn, UNITY_RPC_OPEN_LAUNCHMENU, + GHITcloOpenStartMenu, NULL); + RpcIn_RegisterCallback(rpcIn, UNITY_RPC_GET_LAUNCHMENU_ITEM, + GHITcloGetStartMenuItem, NULL); + RpcIn_RegisterCallback(rpcIn, UNITY_RPC_CLOSE_LAUNCHMENU, + GHITcloCloseStartMenu, NULL); + RpcIn_RegisterCallback(rpcIn, UNITY_RPC_SHELL_OPEN, + GHITcloShellOpen, NULL); + RpcIn_RegisterCallback(rpcIn, GHI_RPC_GUEST_SHELL_ACTION, + GHITcloShellAction, NULL); + RpcIn_RegisterCallbackEx(rpcIn, GHI_RPC_SET_GUEST_HANDLER, + GHITcloSetGuestHandler, NULL); + RpcIn_RegisterCallbackEx(rpcIn, GHI_RPC_RESTORE_DEFAULT_GUEST_HANDLER, + GHITcloRestoreDefaultGuestHandler, NULL); + } +} + + +/* + *----------------------------------------------------------------------------- + * + * GHI_Gather -- + * + * Collects all the desired guest/host integration mapping details for + * URL Protocol handling and sending an RPC to the host with the collected + * details. Also initializes the global application -> filetype list. + * + * Result + * None. + * + * Side-effects + * Updates the global application -> filetype list. + * + *----------------------------------------------------------------------------- + */ + +void +GHI_Gather(void) +{ + GHIProtocolHandlerList protocolHandlers; + + /* Get Protocol Handler information. */ + protocolHandlers.handlers.handlers_len = 0; + protocolHandlers.handlers.handlers_val = NULL; + + if (!GHIPlatformGetProtocolHandlers(ghiPlatformData, &protocolHandlers)) { + Debug("Failed to get protocol handler info.\n"); + } else { + if (!GHIUpdateHost(&protocolHandlers)) { + Debug("Failed to update the host.\n"); + } + } + + VMX_XDR_FREE(xdr_GHIProtocolHandlerList, &protocolHandlers); + + +#ifdef _WIN32 + AppUtil_BuildGlobalApplicationList(); +#endif // _WIN32 + + Debug("Exited Guest/Host Integration Gather.\n"); +} + + +/* + *---------------------------------------------------------------------------- + * + * GHITcloGetBinaryInfo -- + * + * RPC handler for 'unity.get.binary.info'. Get required binary info + * and send it back to the VMX. + * + * Results: + * TRUE if everything is successful. + * FALSE otherwise. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +static Bool +GHITcloGetBinaryInfo(char const **result, // OUT + size_t *resultLen, // OUT + const char *name, // IN + const char *args, // IN + size_t argsSize, // ignored + void *clientData) // ignored + +{ + char *binaryPathUtf8; + DynBuf *buf = &gTcloUpdate; + unsigned int index = 0; + Bool ret = TRUE; + + Debug("%s name:%s args:'%s'\n", __FUNCTION__, name, args); + + /* Skip the leading space. */ + index++; + + /* The binary path provided by the VMX is in UTF8. */ + binaryPathUtf8 = StrUtil_GetNextToken(&index, args, ""); + + if (!binaryPathUtf8) { + Debug("%s: Invalid RPC arguments.\n", __FUNCTION__); + ret = RpcIn_SetRetVals(result, resultLen, + "Invalid arguments. Expected \"binary_path\"", + FALSE); + goto exit; + } + + DynBuf_SetSize(buf, 0); + if (!GHIPlatformGetBinaryInfo(ghiPlatformData, binaryPathUtf8, buf)) { + Debug("%s: Could not get binary info.\n", __FUNCTION__); + ret = RpcIn_SetRetVals(result, resultLen, + "Could not get binary info", + FALSE); + goto exit; + } + + /* + * Write the final result into the result out parameters and return! + */ + *result = (char *)DynBuf_Get(buf); + *resultLen = DynBuf_GetSize(buf); + +exit: + free(binaryPathUtf8); + return ret; +} + + +/* + *---------------------------------------------------------------------------- + * + * GHITcloGetBinaryHandlers -- + * + * RPC handler for 'unity.get.binary.handlers'. Get filetypes supported + * by the binary and send it back to the VMX. + * + * Results: + * TRUE if everything is successful. + * FALSE otherwise. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +static Bool +GHITcloGetBinaryHandlers(RpcInData *data) // IN/OUT +{ + char *binaryPathUtf8; + XDR xdrs; + unsigned int index = 0; + Bool ret = TRUE; + + Debug("%s name:%s args:'%s'\n", __FUNCTION__, data->name, data->args); + + /* Skip the leading space. */ + index++; + + /* The binary path provided by the VMX is in UTF8. */ + binaryPathUtf8 = StrUtil_GetNextToken(&index, data->args, ""); + + if (!binaryPathUtf8) { + Debug("%s: Invalid RPC arguments.\n", __FUNCTION__); + ret = RPCIN_SETRETVALS(data, "Invalid arguments. Expected \"binary_path\"", FALSE); + goto exit; + } + + DynXdr_Create(&xdrs); + if (!GHIPlatformGetBinaryHandlers(ghiPlatformData, binaryPathUtf8, &xdrs)) { + ret = RPCIN_SETRETVALS(data, "Could not get binary filetypes", FALSE); + DynXdr_Destroy(&xdrs, FALSE); + goto exit; + } + + /* + * If the serialized data exceeds our maximum message size we have little choice + * but to fail the request and log the oversize message. + */ + if (xdr_getpos(&xdrs) > GUESTMSG_MAX_IN_SIZE) { + ret = RPCIN_SETRETVALS(data, "Filetype list too large", FALSE); + DynXdr_Destroy(&xdrs, FALSE); + goto exit; + } + + /* + * Write the final result into the result out parameters and return! + */ + data->result = DynXdr_Get(&xdrs); + data->resultLen = xdr_getpos(&xdrs); + data->freeResult = TRUE; + ret = TRUE; + + /* + * Destroy the XDR structure but leave the data buffer alone since it will be + * freed by the RpcIn layer. + */ + DynXdr_Destroy(&xdrs, FALSE); +exit: + free(binaryPathUtf8); + return ret; +} + + +/* + *---------------------------------------------------------------------------- + * + * GHITcloOpenStartMenu -- + * + * RPC handler for 'unity.launchmenu.open'. Get the start menu sub-tree + * for a given item, save it in the array so it can be accessed + * later when the VMX needs to iterate over the items. Return the count + * of the items in the sub-tree and a handle to this sub-tree. The handle + * will be used by the VMX to iterate over the sub-items. + * + * Results: + * TRUE if everything is successful. + * FALSE otherwise. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +static Bool +GHITcloOpenStartMenu(char const **result, // OUT + size_t *resultLen, // OUT + const char *name, // IN + const char *args, // IN + size_t argsSize, // ignored + void *clientData) // ignored +{ + char *rootUtf8 = NULL; + DynBuf *buf = &gTcloUpdate; + uint32 index = 0; + Bool ret = TRUE; + + Debug("%s name:%s args:'%s'\n", __FUNCTION__, name, args); + + /* Skip the leading space. */ + index++; + + /* The start menu root provided by the VMX is in UTF8. */ + rootUtf8 = StrUtil_GetNextToken(&index, args, ""); + + if (!rootUtf8) { + Debug("%s: Invalid RPC arguments.\n", __FUNCTION__); + ret = RpcIn_SetRetVals(result, resultLen, + "Invalid arguments. Expected \"root\"", + FALSE); + goto exit; + } + + DynBuf_SetSize(buf, 0); + if (!GHIPlatformOpenStartMenuTree(ghiPlatformData, rootUtf8, buf)) { + Debug("%s: Could not open start menu.\n", __FUNCTION__); + ret = RpcIn_SetRetVals(result, resultLen, + "Could not get start menu count", + FALSE); + goto exit; + } + + /* + * Write the final result into the result out parameters and return! + */ + *result = (char *)DynBuf_Get(buf); + *resultLen = DynBuf_GetSize(buf); + +exit: + free(rootUtf8); + return ret; +} + + +/* + *---------------------------------------------------------------------------- + * + * GHITcloGetStartMenuItem -- + * + * RPC handler for 'unity.launchmenu.next'. Get the start menu item + * at the given index for the tree with a given handle. + * If there's no item at the given index, return FALSE. + * + * Results: + * TRUE if the item was found. + * FALSE otherwise (i.e. if the VMX provides a wrong handle or if there's + no items left). + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +static Bool +GHITcloGetStartMenuItem(char const **result, // OUT + size_t *resultLen, // OUT + const char *name, // IN + const char *args, // IN + size_t argsSize, // ignored + void *clientData) // ignored +{ + DynBuf *buf = &gTcloUpdate; + uint32 index = 0; + Bool ret = TRUE; + uint32 itemIndex = 0; + uint32 handle = 0; + + Debug("%s name:%s args:'%s'\n", __FUNCTION__, name, args); + + /* Parse the handle of the menu tree that VMX wants. */ + if (!StrUtil_GetNextUintToken(&handle, &index, args, " ")) { + Debug("%s: Invalid RPC arguments.\n", __FUNCTION__); + return RpcIn_SetRetVals(result, resultLen, + "Invalid arguments. Expected handle index", + FALSE); + } + + /* The index of the menu item to be send back. */ + if (!StrUtil_GetNextUintToken(&itemIndex, &index, args, " ")) { + Debug("%s: Invalid RPC arguments.\n", __FUNCTION__); + return RpcIn_SetRetVals(result, resultLen, + "Invalid arguments. Expected handle index", + FALSE); + } + + DynBuf_SetSize(buf, 0); + if (!GHIPlatformGetStartMenuItem(ghiPlatformData, handle, itemIndex, buf)) { + Debug("%s: Could not get start menu item.\n", __FUNCTION__); + return RpcIn_SetRetVals(result, resultLen, + "Could not get start menu item", + FALSE); + } + + /* + * Write the final result into the result out parameters and return! + */ + *result = (char *)DynBuf_Get(buf); + *resultLen = DynBuf_GetSize(buf); + + return ret; +} + + +/* + *---------------------------------------------------------------------------- + * + * GHITcloCloseStartMenu -- + * + * RPC handler for 'unity.launchmenu.close'. The VMX is done with this + * particular start menu tree. Free all memory and cleanup. + * + * Results: + * None. + * + * Side effects: + * Memory allocated when the start menu tree was opened is finally freed. + * + *---------------------------------------------------------------------------- + */ + +static Bool +GHITcloCloseStartMenu(char const **result, // OUT + size_t *resultLen, // OUT + const char *name, // IN + const char *args, // IN + size_t argsSize, // ignored + void *clientData) // ignored +{ + uint32 index = 0; + uint32 handle = 0; + + Debug("%s name:%s args:'%s'\n", __FUNCTION__, name, args); + + /* Parse the handle of the menu tree that VMX wants. */ + if (!StrUtil_GetNextIntToken(&handle, &index, args, " ")) { + Debug("%s: Invalid RPC arguments.\n", __FUNCTION__); + return RpcIn_SetRetVals(result, resultLen, + "Invalid arguments. Expected handle", + FALSE); + } + + GHIPlatformCloseStartMenuTree(ghiPlatformData, handle); + + return RpcIn_SetRetVals(result, resultLen, "", TRUE); +} + + +/* + *---------------------------------------------------------------------------- + * + * GHITcloShellOpen -- + * + * RPC handler for 'unity.shell.open'. Open the specified file with the + * default shell handler. Note that the file path may be either a URI + * (originated with Tools >= NNNNN), or a regular path (originated with + * Tools < NNNNN). + * + * Results: + * TRUE if everything is successful. + * FALSE otherwise. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +static Bool +GHITcloShellOpen(char const **result, // OUT + size_t *resultLen, // OUT + const char *name, // IN + const char *args, // IN + size_t argsSize, // ignored + void *clientData) // ignored +{ + char *fileUtf8 = NULL; + Bool ret = TRUE; + unsigned int index = 0; + + Debug("%s: name: '%s', args: '%s'\n", __FUNCTION__, name, args); + + /* Skip the leading space. */ + index++; + + /* The file path provided by the VMX is in UTF8. */ + fileUtf8 = StrUtil_GetNextToken(&index, args, ""); + + if (!fileUtf8) { + Debug("%s: Invalid RPC arguments.\n", __FUNCTION__); + return RpcIn_SetRetVals(result, resultLen, + "Invalid arguments. Expected file_name", + FALSE); + } + + ret = GHIPlatformShellOpen(ghiPlatformData, fileUtf8); + free(fileUtf8); + + if (!ret) { + Debug("%s: Could not perform the requested shell open action.\n", __FUNCTION__); + return RpcIn_SetRetVals(result, resultLen, + "Could not perform the requested shell open action.", + FALSE); + } + + return RpcIn_SetRetVals(result, resultLen, "", TRUE); +} + + +/* + *---------------------------------------------------------------------------- + * + * GHITcloShellAction -- + * + * RPC handler for "ghi.guest.shell.action". The action command has three + * arguments: an action URI, a target URI, and an array of location URIs. + * Action URIs are in the form: "x-vmware-action://", where is + * the name of a specific action to perform. + * The target URI is a guest-specific URI that was previously given to the + * host (usually a path to an application to run). Note that this may be + * either a URI (new Tools) or a regular path (old Tools). + * The locations can be files or URLs. Files are typically specified as + * HGFS shared folder locations (see below), but can potentially use the + * "file://" URIs as well. + * Each guest can specify the features it supports using capability flags: + * + * Capability Description + * + * GHI_CAP_CMD_SHELL_ACTION Guest allows 'ghi.guest.shell.action'. + * This encompasses this entire command + * and the rest of the capabilities. + * + * GHI_CAP_SHELL_ACTION_BROWSE Guest supports the 'browse' action verb, + * used to open a file browser window with + * a given set of locations. + * + * GHI_CAP_SHELL_ACTION_RUN Guest supports the 'run' action verb, + * used for running applications as well + * as opening file or URL locations. + * + * GHI_CAP_SHELL_LOCATION_HGFS Guest supports HGFS share location URIs: + * "x-vmware-share://", where + * specifies a shared folder name and an + * optional path within the shared folder. + * + * Results: + * TRUE if everything is successful. + * FALSE otherwise. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +static Bool +GHITcloShellAction(char const **result, // OUT + size_t *resultLen, // OUT + const char *name, // IN + const char *args, // IN + size_t argsSize, // IN + void *clientData) // ignored +{ + Bool ret = TRUE; + XDR xdrs; + + /* + * Build an XDR Stream from the argument data which beings are args + 1 + * since there is a space separator between the RPC name and the XDR serialization. + */ + xdrmem_create(&xdrs, (char *) args + 1, argsSize - 1, XDR_DECODE); + + ret = GHIPlatformShellAction(ghiPlatformData, &xdrs); + + xdr_destroy(&xdrs); + + if (!ret) { + Debug("%s: Could not perform the requested shell action.\n", __FUNCTION__); + return RpcIn_SetRetVals(result, resultLen, + "Could not perform the requested shell action.", + FALSE); + } + + return RpcIn_SetRetVals(result, resultLen, "", TRUE); +} + + +/* + *---------------------------------------------------------------------------- + * + * GHITcloSetGuestHandler -- + * + * RPC handler for 'ghi.guest.handler.set'. Changes the nominated handlerType + * to use the VMwareHostOpen proxy app to open files or URLs in the host. + * + * Results: + * TRUE if everything is successful. + * FALSE otherwise. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +static Bool +GHITcloSetGuestHandler(RpcInData *data) // IN/OUT +{ + Bool ret = FALSE; + XDR xdrs; + + Debug("%s name:%s args length: %"FMTSZ"u\n", __FUNCTION__, data->name, data->argsSize); + + /* + * Build an XDR Stream from the argument data which beings are args + 1 + * since there is a space separator between the RPC name and the XDR serialization. + */ + xdrmem_create(&xdrs, (char *) data->args + 1, data->argsSize - 1, XDR_DECODE); + ret = GHIPlatformSetGuestHandler(ghiPlatformData, &xdrs); + xdr_destroy(&xdrs); + + if (ret == FALSE) { + Debug("%s: Unable to set guest handler\n", __FUNCTION__); + ret = RPCIN_SETRETVALS(data, "Unable to set guest handler", FALSE); + goto exit; + } + /* + * Write the final result into the result out parameters and return! + */ + data->result = ""; + data->resultLen = 0; + data->freeResult = FALSE; + ret = TRUE; + +exit: + return ret; +} + + +/* + *---------------------------------------------------------------------------- + * + * GHITcloRestoreDefaultGuestHandler -- + * + * RPC handler for 'ghi.guest.handler.restoreDefault'. Changes the nominated + * handlerType back to the value in use prior to any changes by tools. + * + * Results: + * TRUE if everything is successful. + * FALSE otherwise. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +static Bool +GHITcloRestoreDefaultGuestHandler(RpcInData *data) // IN/OUT +{ + Bool ret = FALSE; + XDR xdrs; + + Debug("%s name:%s args length: %"FMTSZ"u\n", __FUNCTION__, data->name, data->argsSize); + + /* + * Build an XDR Stream from the argument data which beings are args + 1 + * since there is a space separator between the RPC name and the XDR serialization. + */ + xdrmem_create(&xdrs, (char *) data->args + 1, data->argsSize - 1, XDR_DECODE); + ret = GHIPlatformRestoreDefaultGuestHandler(ghiPlatformData, &xdrs); + xdr_destroy(&xdrs); + + if (ret == FALSE) { + Debug("%s: Unable to restore guest handler\n", __FUNCTION__); + ret = RPCIN_SETRETVALS(data, "Unable to restore guest handler", FALSE); + goto exit; + } + /* + * Write the final result into the result out parameters and return! + */ + data->result = ""; + data->resultLen = 0; + data->freeResult = FALSE; + ret = TRUE; + +exit: + return ret; +} + + +/* + *---------------------------------------------------------------------------- + * + * GHILaunchMenuChangeRPC -- + * + * Informs host that one or more Launch Menu changes have been detected. + * + * Results: + * TRUE on success + * FALSE on error + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +Bool +GHILaunchMenuChangeRPC(void) +{ + if (!RpcOut_sendOne(NULL, NULL, GHI_RPC_LAUNCHMENU_CHANGE)) { + Debug("%s: could not send unity launchmenu change\n", __FUNCTION__); + return FALSE; + } + + return TRUE; +} + + +/* + *----------------------------------------------------------------------------- + * + * GHIUpdateHost -- + * + * Update the host with new guest/host integration information. + * + * Results: + * TRUE on success, FALSE on failure. + * + * Side effects: + * VMDB is updated if the given value has changed. + * + *----------------------------------------------------------------------------- + */ + +Bool +GHIUpdateHost(GHIProtocolHandlerList *handlers) // IN: type specific information +{ + /* +1 for the space separator */ + char request[sizeof GHI_RPC_PROTOCOL_HANDLER_INFO + 1]; + Bool status; + XDR xdrs; + + ASSERT(handlers); + + if (DynXdr_Create(&xdrs) == NULL) { + return FALSE; + } + + Str_Sprintf(request, + sizeof request, + "%s ", + GHI_RPC_PROTOCOL_HANDLER_INFO); + + /* Write preamble and serialized protocol handler info to XDR stream. */ + if (!DynXdr_AppendRaw(&xdrs, request, strlen(request)) || + !xdr_GHIProtocolHandlerList(&xdrs, handlers)) { + Debug("%s: could not serialize protocol handler info\n", __FUNCTION__); + DynXdr_Destroy(&xdrs, TRUE); + return FALSE; + } + + status = RpcOut_SendOneRaw(DynXdr_Get(&xdrs), + xdr_getpos(&xdrs), + NULL, + NULL); + DynXdr_Destroy(&xdrs, TRUE); + + if (!status) { + Debug("%s: failed to update protocol handler information\n", + __FUNCTION__); + } + return status; +} diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/ghIntegration/ghIntegrationInt.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/ghIntegration/ghIntegrationInt.h --- open-vm-tools-2008.01.23-74039/lib/ghIntegration/ghIntegrationInt.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/ghIntegration/ghIntegrationInt.h 2008-10-13 08:01:50.000000000 +0100 @@ -0,0 +1,70 @@ +/********************************************************* + * Copyright (C) 2007 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. + * + *********************************************************/ + +/* + * ghIntegrationInt.h -- + * + * Platform specific functionality + */ + +#ifndef _GH_INTEGRATION_INT_H_ +#define _GH_INTEGRATION_INT_H_ + +#include "dynbuf.h" +#include "unityCommon.h" +#include "guestrpc/ghiProtocolHandler.h" + +typedef struct _GHIPlatform GHIPlatform; + +/* + * Implemented by ghIntegration[Win32|X11|Cocoa (ha!)].c + */ + +Bool GHIPlatformIsSupported(void); +GHIPlatform *GHIPlatformInit(VMU_ControllerCB *vmuControllerCB, void *ctx); +void GHIPlatformCleanup(GHIPlatform *ghip); +Bool GHIPlatformGetBinaryInfo(GHIPlatform *ghip, + const char *pathURIUtf8, + DynBuf *buf); +Bool GHIPlatformGetBinaryHandlers(GHIPlatform *ghip, + const char *pathUtf8, + XDR *xdrs); +Bool GHIPlatformOpenStartMenuTree(GHIPlatform *ghip, + const char *rootUtf8, + DynBuf *buf); +Bool GHIPlatformGetStartMenuItem(GHIPlatform *ghip, + uint32 handle, + uint32 itemIndex, + DynBuf *buf); +Bool GHIPlatformCloseStartMenuTree(GHIPlatform *ghip, + uint32 handle); +Bool GHIPlatformShellOpen(GHIPlatform *ghip, + const char *fileUtf8); +Bool GHIPlatformShellAction(GHIPlatform *ghip, const XDR *xdrs); +Bool GHIPlatformSetGuestHandler(GHIPlatform *ghip, const XDR *xdrs); +Bool GHIPlatformRestoreDefaultGuestHandler(GHIPlatform *ghip, const XDR *xdrs); + +void GHIPlatformRegisterCaps(GHIPlatform *ghip); +void GHIPlatformUnregisterCaps(GHIPlatform *ghip); +Bool GHIPlatformGetProtocolHandlers(GHIPlatform *ghip, + GHIProtocolHandlerList *protocolHandlerList); + +/* Implemented by ghIntegration.c for use by the platform-specific code */ +Bool GHILaunchMenuChangeRPC(void); + +#endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/ghIntegration/ghIntegrationX11.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/ghIntegration/ghIntegrationX11.c --- open-vm-tools-2008.01.23-74039/lib/ghIntegration/ghIntegrationX11.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/ghIntegration/ghIntegrationX11.c 2008-10-13 08:01:50.000000000 +0100 @@ -0,0 +1,2804 @@ +/********************************************************* + * Copyright (C) 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. + * + *********************************************************/ + +/* + * ghIntegrationX11.c -- + * + * Guest-host integration implementation for POSIX-compliant platforms that run X11. + * + * The main tasks done by this code are reading in the system's .desktop files to turn + * them into an internal representation of available applications on the system + * (implemented by GHIPlatformReadAllApplications, GHIPlatformReadApplicationsDir, + * GHIPlatformReadDesktopFile, and kin), and feeding portions of that internal + * representation to the host upon request + * (GHIPlatform{OpenStartMenuTree,GetStartMenuItem,CloseStartMenuTree}). + */ + +#define _BSD_SOURCE 1 // Needed on Linux to get the DT_* values for dirent->d_type +#include +#include +#include +#include +#include +#include + +#include "vmware.h" +#include "base64.h" +#include "rpcin.h" +#include "dbllnklst.h" +#include "debug.h" +#include "util.h" +#include "region.h" +#include "unity.h" +#include "unityCommon.h" +#include "system.h" +#include "codeset.h" +#include "imageUtil.h" +#include "strutil.h" +#include +#include +#include "vm_atomic.h" +#include "ghIntegration.h" +#include "ghIntegrationInt.h" +#include "guest_msg_def.h" +#include "guestCaps.h" +#include "Uri.h" +#define URI_TEXTRANGE_EQUAL(textrange, str) \ + (((textrange).afterLast - (textrange).first) == strlen((str)) \ + && !strncmp((textrange).first, (str), (textrange).afterLast - (textrange).first)) + +#ifndef GTK2 +#error "Gtk 2.0 is required" +#endif + +#include "appUtil.h" + +#include +#include +#include + +/* + * The following defines appear in newer versions of glib 2.x, so + * we define them for backwards compat. + */ +#ifndef G_KEY_FILE_DESKTOP_GROUP +#define G_KEY_FILE_DESKTOP_GROUP "Desktop Entry" +#endif +#ifndef G_KEY_FILE_DESKTOP_KEY_NAME +#define G_KEY_FILE_DESKTOP_KEY_NAME "Name" +#endif +#ifndef G_KEY_FILE_DESKTOP_KEY_ICON +#define G_KEY_FILE_DESKTOP_KEY_ICON "Icon" +#endif +#ifndef G_KEY_FILE_DESKTOP_KEY_EXEC +#define G_KEY_FILE_DESKTOP_KEY_EXEC "Exec" +#endif +#ifndef G_KEY_FILE_DESKTOP_KEY_TRY_EXEC +#define G_KEY_FILE_DESKTOP_KEY_TRY_EXEC "TryExec" +#endif +#ifndef G_KEY_FILE_DESKTOP_KEY_CATEGORIES +#define G_KEY_FILE_DESKTOP_KEY_CATEGORIES "Categories" +#endif +#ifndef G_KEY_FILE_DESKTOP_KEY_NO_DISPLAY +#define G_KEY_FILE_DESKTOP_KEY_NO_DISPLAY "NoDisplay" +#endif +#ifndef G_KEY_FILE_DESKTOP_KEY_HIDDEN +#define G_KEY_FILE_DESKTOP_KEY_HIDDEN "Hidden" +#endif +#ifndef G_KEY_FILE_DESKTOP_KEY_ONLY_SHOW_IN +#define G_KEY_FILE_DESKTOP_KEY_ONLY_SHOW_IN "OnlyShowIn" +#endif +#ifndef G_KEY_FILE_DESKTOP_KEY_NOT_SHOW_IN +#define G_KEY_FILE_DESKTOP_KEY_NOT_SHOW_IN "NotShowIn" +#endif + +/* + * These describe possible start menu item flags. It should come from ghiCommon.h + * eventually. + */ +#define UNITY_START_MENU_ITEM_DIRECTORY (1 << 0) + +/* + * This macro provides an estimate of how much space an icon might take beyond the actual + * icon data when returned from unity.get.binary.info. This makes space for the + * width/height/size strings, and adds enough padding to give some breathing room just in + * case. + * + * > This is only an estimate. < + */ +#define ICON_SPACE_PADDING (sizeof "999x999x65535x" + 25) + +/* + * The GHIDirectoryWatch object represents a watch on a directory to be notified of + * added/removed/changed .desktop files. + * + * XXX Watching directories for added/changed/removed .desktop files is not yet + * implemented. We need to figure out whether we want to use inotify, dnotify, gamin, + * etc. and work through all the backwards compat issues. + */ +typedef struct { + char *directoryPath; +} GHIDirectoryWatch; + +struct _GHIPlatform { + GTree *apps; // Tree of GHIMenuDirectory's, keyed & ordered by their dirname + GHashTable *appsByExecutable; // Translates full executable path to GHIMenuItem + GHashTable *appsByDesktopEntry; // Translates full .desktop path to GHIMenuItem + + Bool trackingEnabled; + GArray *directoriesTracked; + + int nextMenuHandle; + GHashTable *menuHandles; + GHashTable *vmwareEnv; +}; + +#ifdef GTK2 + +/* + * The GHIMenuItem object represents an individual leaf-node menu item (corresponding to + * a .desktop file). + */ +typedef struct { + char *exepath; // The full exe path for use in GHIPlatform::appsByExecutable + char *keyfilePath; // Key to GHIPlatform::appsByDesktopEntry, used in %k field code + GKeyFile *keyfile; // glib data structure representing the parsed .desktop file +} GHIMenuItem; + +/* + * Represents a "start menu folder" so to speak. + */ +typedef struct { + const char *dirname; // The .desktop category that this object represents + GPtrArray *items; // Array of pointers to GHIMenuItems +} GHIMenuDirectory; + +/* + * Represents an active handle for traversing a menu. + */ +typedef struct { + int handleID; + enum { LAUNCH_FOLDER, FIXED_FOLDER, DIRECTORY_FOLDER } handleType; + GHIMenuDirectory *gmd; // Only set for DIRECTORY_FOLDER handles +} GHIMenuHandle; + +/* + * This is used to help us find the Nth GHIMenuDirectory node in the GHIPlatform::apps + * tree, an operation that is needed as part of GHIPlatformGetStartMenuItem... + */ +typedef struct { + int currentItem; + int desiredItem; + GHIMenuDirectory *gmd; // OUT - pointer to the Nth GHIMenuDirectory +} GHITreeTraversal; + +static void GHIPlatformSetMenuTracking(GHIPlatform *ghip, + Bool isEnabled); +static char *GHIPlatformUriPathToString(UriPathSegmentA *path); +static Bool GHIRestoreVMwareEnviron(GHIPlatform *ghip); +static Bool GHISetVMwareEnviron(GHIPlatform *ghip); + + +/* + * This is a list of directories that we search for .desktop files by default. + */ +static const char *desktopDirs[] = { + "/usr/share/applications", + "/opt/gnome/share/applications", + "/opt/kde3/share/applications", + "/opt/kde4/share/applications", + "/opt/kde/share/applications", + "/usr/share/applnk", + "~/.local/share/applications" +}; + + +/* + * GHI capabilities for this platform. + */ +/* + * XXX TODO: re-enable once ShellAction is implemented. + */ +/* +static GuestCapabilities platformGHICaps[] = { + GHI_CAP_CMD_SHELL_ACTION, + GHI_CAP_SHELL_ACTION_BROWSE, + GHI_CAP_SHELL_ACTION_RUN, + GHI_CAP_SHELL_LOCATION_HGFS +}; +*/ + + +/* + *----------------------------------------------------------------------------- + * + * GHIPlatformDestroyMenuItem -- + * + * Frees a menu item object (which right now is just a GKeyFile). + * + * Results: + * None. + * + * Side effects: + * The specified GHIMenuItem is no longer valid. + * + *----------------------------------------------------------------------------- + */ + +static void +GHIPlatformDestroyMenuItem(gpointer data, // IN + gpointer user_data) // IN (unused) +{ + GHIMenuItem *gmi; + + ASSERT(data); + + gmi = data; + g_key_file_free(gmi->keyfile); + g_free(gmi->keyfilePath); + g_free(gmi->exepath); + g_free(gmi); +} + + +/* + *----------------------------------------------------------------------------- + * + * GHIPlatformDestroyMenuDirectory -- + * + * Frees the memory associated with a GHIMenuDirectory object. + * + * Results: + * None. + * + * Side effects: + * The specified GHIMenuDirectory object is no longer valid. + * + *----------------------------------------------------------------------------- + */ + +static void +GHIPlatformDestroyMenuDirectory(gpointer data) // IN +{ + GHIMenuDirectory *gmd = (GHIMenuDirectory *) data; + + // gmd->dirname comes from a static const array, so it should never be freed + g_ptr_array_foreach(gmd->items, GHIPlatformDestroyMenuItem, NULL); + g_ptr_array_free(gmd->items, TRUE); +} +#endif // GTK2 + + +/* + *---------------------------------------------------------------------------- + * + * GHIPlatformIsSupported -- + * + * Determine whether this guest supports guest host integration. + * + * Results: + * TRUE if the guest supports GHI + * FALSE otherwise + * + * Side effects: + * None + * + *---------------------------------------------------------------------------- + */ + +Bool +GHIPlatformIsSupported(void) +{ +#ifdef GTK2 + return TRUE; +#else + return FALSE; +#endif +} + + +/* + *---------------------------------------------------------------------------- + * + * GHIPlatformInit -- + * + * Sets up the platform-specific GHI state. + * + * Results: + * Pointer to platform-specific data (may be NULL). + * + * Side effects: + * None + * + *---------------------------------------------------------------------------- + */ + +GHIPlatform * +GHIPlatformInit(VMU_ControllerCB *vmuControllerCB, // IN + void *ctx) // IN +{ + GHIPlatform *ghip; + + ghip = Util_SafeCalloc(1, sizeof *ghip); + ghip->directoriesTracked = g_array_new(FALSE, FALSE, sizeof(GHIDirectoryWatch)); + AppUtil_Init(); + + return ghip; +} + + +/* + *---------------------------------------------------------------------------- + * + * GHIPlatformRegisterCaps -- + * + * Register guest platform specific capabilities with the VMX. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +void +GHIPlatformRegisterCaps(GHIPlatform *ghip) // IN +{ + ASSERT(ghip); + //ASSERT(platformGHICaps); + + /* + * XXX TODO: re-enable once ShellAction is implemented. + */ + //AppUtil_SendGuestCaps(platformGHICaps, ARRAYSIZE(platformGHICaps), TRUE); +} + + +/* + *---------------------------------------------------------------------------- + * + * GHIPlatformUnregisterCaps -- + * + * Register guest platform specific capabilities with the VMX. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +void +GHIPlatformUnregisterCaps(GHIPlatform *ghip) // IN +{ + ASSERT(ghip); + //ASSERT(platformGHICaps); + + /* + * XXX TODO: re-enable once ShellAction is implemented. + */ + //AppUtil_SendGuestCaps(platformGHICaps, ARRAYSIZE(platformGHICaps), FALSE); +} + + +#ifdef GTK2 +/* + *----------------------------------------------------------------------------- + * + * GHIPlatformFreeValue -- + * + * Frees a hash table entry. Typically called from a g_hashtable + * iterator. Just the value is destroyed, not the key. + * Also called directly from GHIPlatformCloseStartMenu. + * + * Results: + * TRUE always. + * + * Side effects: + * The specified value will no longer be valid. + * + *----------------------------------------------------------------------------- + */ + +static gboolean +GHIPlatformFreeValue(gpointer key, // IN + gpointer value, // IN + gpointer user_data) // IN +{ + g_free(value); + + return TRUE; +} + + +/* + *----------------------------------------------------------------------------- + * + * GHIPlatformFreeKeyAndValue -- + * + * Frees a hash table entry. Typically called from a g_hashtable + * iterator. Both the key, and the value are freed. + * + * Results: + * TRUE always. + * + * Side effects: + * The specified value will no longer be valid. + * + *----------------------------------------------------------------------------- + */ + +static gboolean +GHIPlatformFreeKeyAndValue(gpointer key, // IN + gpointer value, // IN + gpointer user_data) // IN +{ + g_free(key); + g_free(value); + + return TRUE; +} +#endif // GTK2 + + +/* + *----------------------------------------------------------------------------- + * + * GHIPlatformCleanupMenuEntries -- + * + * Frees all the memory associated with the menu information, including active menu + * handles and the internal applications menu representation. + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static void +GHIPlatformCleanupMenuEntries(GHIPlatform *ghip) // IN +{ +#ifdef GTK2 + if (ghip->menuHandles) { + g_hash_table_foreach_remove(ghip->menuHandles, GHIPlatformFreeValue, NULL); + g_hash_table_destroy(ghip->menuHandles); + ghip->menuHandles = NULL; + } + + if (ghip->apps) { + g_hash_table_destroy(ghip->appsByDesktopEntry); + g_hash_table_destroy(ghip->appsByExecutable); + g_tree_destroy(ghip->apps); + ghip->apps = NULL; + } +#endif // GTK2 +} + + +/* + *---------------------------------------------------------------------------- + * + * GHIPlatformCleanup -- + * + * Tears down the platform-specific GHI state. + * + * Results: + * None. + * + * Side effects: + * GHIPlatform is no longer valid. + * + *---------------------------------------------------------------------------- + */ + +void +GHIPlatformCleanup(GHIPlatform *ghip) // IN +{ + if (!ghip) { + return; + } + + GHIPlatformSetMenuTracking(ghip, FALSE); + g_array_free(ghip->directoriesTracked, TRUE); + ghip->directoriesTracked = NULL; + if (ghip->vmwareEnv) { + g_hash_table_foreach_remove(ghip->vmwareEnv, GHIPlatformFreeKeyAndValue, NULL); + g_hash_table_destroy(ghip->vmwareEnv); + ghip->vmwareEnv = NULL; + } + free(ghip); +} + + +#ifdef GTK2 + + +/* + *----------------------------------------------------------------------------- + * + * GHIPlatformCollectIconInfo -- + * + * Sucks all the icon information for a particular application from the system, and + * appends it into the DynBuf for returning to the host. + * + * Results: + * None. + * + * Side effects: + * Adds data into the DynBuf. + * + *----------------------------------------------------------------------------- + */ + +static void +GHIPlatformCollectIconInfo(GHIPlatform *ghip, // IN + GHIMenuItem *ghm, // IN + unsigned long windowID, // IN + DynBuf *buf) // IN/OUT +{ + GPtrArray *pixbufs; + char tbuf[1024]; + gsize totalIconBytes; + char *ctmp = NULL; + int i; + + if (ghm) { + ctmp = g_key_file_get_string(ghm->keyfile, G_KEY_FILE_DESKTOP_GROUP, + G_KEY_FILE_DESKTOP_KEY_ICON, NULL); + } + + pixbufs = AppUtil_CollectIconArray(ctmp, windowID); + + /* + * Now see if all of these icons can fit into our reply. + */ + totalIconBytes = DynBuf_GetSize(buf); + for (i = 0; i < pixbufs->len; i++) { + gsize thisIconBytes; + GdkPixbuf *pixbuf = g_ptr_array_index(pixbufs, i); + + thisIconBytes = ICON_SPACE_PADDING; // Space used by the width/height/size strings, and breathing room + thisIconBytes += gdk_pixbuf_get_width(pixbuf) + * gdk_pixbuf_get_height(pixbuf) + * 4 /* image will be BGRA */; + if ((thisIconBytes + totalIconBytes) < GUESTMSG_MAX_IN_SIZE) { + totalIconBytes += thisIconBytes; + } else if (pixbufs->len == 1) { + GdkPixbuf *newIcon; + double newWidth; + double newHeight; + double scaleFactor; + + newWidth = gdk_pixbuf_get_width(pixbuf); + newHeight = gdk_pixbuf_get_height(pixbuf); + scaleFactor = (GUESTMSG_MAX_IN_SIZE - totalIconBytes - ICON_SPACE_PADDING); + scaleFactor /= (newWidth * newHeight * 4.0); + if (scaleFactor > 0.95) { + /* + * Ensures that we remove at least a little bit of data from the icon. + * Otherwise we can get things like scalefactors of '0.999385' which result + * in an image of exactly the same size. A scaleFactor of 0.95 will remove at + * least one row or column from any icon large enough to go past the limit. + */ + scaleFactor = 0.95; + } + + newWidth *= scaleFactor; + newHeight *= scaleFactor; + + /* + * If this is the only icon available, try scaling it down to the largest icon + * that will comfortably fit in the reply. + * + * Adding 0.5 to newWidth & newHeight is an easy way of rounding to the closest + * integer. + */ + newIcon = gdk_pixbuf_scale_simple(pixbuf, + (int)(newWidth + 0.5), + (int)(newHeight + 0.5), + GDK_INTERP_HYPER); + g_object_unref(G_OBJECT(pixbuf)); + g_ptr_array_index(pixbufs, i) = newIcon; + i--; // Try including the newly scaled-down icon + } else { + g_object_unref(G_OBJECT(pixbuf)); + g_ptr_array_remove_index_fast(pixbufs, i); + i--; + } + } + + /* + * Now that we actually have all available icons loaded and checked, dump their count + * and contents into the reply. + */ + Str_Sprintf(tbuf, sizeof tbuf, "%u", pixbufs->len); + DynBuf_AppendString(buf, tbuf); + + for (i = 0; i < pixbufs->len; i++) { + int width; + int height; + GdkPixbuf *pixbuf; + guchar *pixels; + int x, y; + int rowstride; + int n_channels; + + pixbuf = g_ptr_array_index(pixbufs, i); + + width = gdk_pixbuf_get_width(pixbuf); + height = gdk_pixbuf_get_height(pixbuf); + Str_Sprintf(tbuf, sizeof tbuf, "%d", width); + DynBuf_AppendString(buf, tbuf); + Str_Sprintf(tbuf, sizeof tbuf, "%d", height); + DynBuf_AppendString(buf, tbuf); + + Str_Sprintf(tbuf, sizeof tbuf, "%d", width * height * 4); + DynBuf_AppendString(buf, tbuf); + + ASSERT (gdk_pixbuf_get_colorspace (pixbuf) == GDK_COLORSPACE_RGB); + ASSERT (gdk_pixbuf_get_bits_per_sample (pixbuf) == 8); + rowstride = gdk_pixbuf_get_rowstride(pixbuf); + n_channels = gdk_pixbuf_get_n_channels(pixbuf); + pixels = gdk_pixbuf_get_pixels(pixbuf); + for (y = height - 1; y >= 0; y--) { // GetBinaryInfo icons are bottom-to-top. :( + for (x = 0; x < width; x++) { + char bgra[4]; + guchar *p; // Pointer to RGBA data in GdkPixbuf + + p = pixels + (y * rowstride) + (x * n_channels); + bgra[0] = p[2]; + bgra[1] = p[1]; + bgra[2] = p[0]; + if (n_channels > 3) { + bgra[3] = p[3]; + } else { + bgra[3] = 0xFF; + } + DynBuf_Append(buf, bgra, 4); + } + } + + DynBuf_AppendString(buf, ""); + + } + + AppUtil_FreeIconArray(pixbufs); +} +#endif // GTK2 + + +/* + *---------------------------------------------------------------------------- + * + * GHIPlatformGetBinaryInfo -- + * + * Get binary information (app name and icons). We're passed app info in + * pathURIUtf8 (in URI format), and we find the app info by looking up the + * path in GHIPlatform->appsByExecutable. Once we find it, we can retrieve + * info on the app from the .desktop file. + * + * Results: + * TRUE if everything went ok, FALSE otherwise. + * + * Side effects: + * None + * + *---------------------------------------------------------------------------- + */ + +Bool +GHIPlatformGetBinaryInfo(GHIPlatform *ghip, // IN: platform-specific state + const char *pathURIUtf8, // IN: full path to the binary file + DynBuf *buf) // OUT: binary information +{ +#ifdef GTK2 + const char *realCmd = NULL; + char *keyfilePath = NULL; + unsigned long windowID = 0; + gpointer freeMe = NULL; + GHIMenuItem *ghm = NULL; + char *ctmp; + UriParserStateA state; + UriUriA uri; + + ASSERT(ghip); + ASSERT(pathURIUtf8); + ASSERT(buf); + + memset(&state, 0, sizeof state); + memset(&uri, 0, sizeof uri); + state.uri = &uri; + + if (pathURIUtf8[0] == '/') { + realCmd = pathURIUtf8; + } else if (uriParseUriA(&state, pathURIUtf8) == URI_SUCCESS) { + if (URI_TEXTRANGE_EQUAL(uri.scheme, "file")) { + UriQueryListA *queryList = NULL; + int itemCount; + + realCmd = freeMe = GHIPlatformUriPathToString(uri.pathHead); + if (uriDissectQueryMallocA(&queryList, &itemCount, + uri.query.first, + uri.query.afterLast) == URI_SUCCESS) { + UriQueryListA *cur; + + for (cur = queryList; cur; cur = cur->next) { + if (!cur->value) { + continue; + } + + if (strcmp(cur->key, "WindowXID") == 0) { + sscanf(cur->value, "%lu", &windowID); // Ignore any failures + } else if (strcmp(cur->key, "DesktopEntry") == 0) { + keyfilePath = g_strdup(cur->value); + } + } + + uriFreeQueryListA(queryList); + } + } else { + uriFreeUriMembersA(&uri); + Debug("Binary URI %s does not have a 'file' scheme\n", pathURIUtf8); + return FALSE; + } + } else { + uriFreeUriMembersA(&uri); + return FALSE; + } + + GHIPlatformSetMenuTracking(ghip, TRUE); + + /* + * If for some reason the command we got wasn't a fullly expanded filesystem path, + * then expand the command into a full path. + */ + if (realCmd[0] != '/') { + ctmp = g_find_program_in_path(realCmd); + if (ctmp && *ctmp) { + free(freeMe); + freeMe = ctmp; + realCmd = ctmp; + } else { + free(ctmp); + free(freeMe); + return FALSE; + } + } + + if (keyfilePath) { + ghm = g_hash_table_lookup(ghip->appsByDesktopEntry, keyfilePath); + g_free(keyfilePath); + } + + if (!ghm) { + /* + * Now that we have the full path, look it up in our hash table of GHIMenuItems + */ + ghm = g_hash_table_lookup(ghip->appsByExecutable, realCmd); + } + + if (!ghm) { + /* + * To deal with /usr/bin/gimp being a symlink to gimp-2.x, also try symlinks. + */ + char newPath[PATH_MAX + 1]; + ssize_t linkLen; + + linkLen = readlink(realCmd, newPath, sizeof newPath - 1); + if (linkLen > 0) { + char *slashLoc; + + newPath[linkLen] = '\0'; + slashLoc = strrchr(realCmd, '/'); + if (newPath[0] != '/' && slashLoc) { + ctmp = g_strdup_printf("%.*s%s", + (int)((slashLoc + 1) - realCmd), + realCmd, newPath); + g_free(freeMe); + realCmd = freeMe = ctmp; + } else { + realCmd = newPath; + } + + ghm = g_hash_table_lookup(ghip->appsByExecutable, realCmd); + } + } + /* + * Stick the app name into 'buf'. + */ + if (ghm) { + ctmp = g_key_file_get_string(ghm->keyfile, G_KEY_FILE_DESKTOP_GROUP, + G_KEY_FILE_DESKTOP_KEY_NAME, NULL); + if (!ctmp) { + ctmp = g_path_get_basename(realCmd); + } + DynBuf_AppendString(buf, ctmp); + free(ctmp); + } else { + /* + * If we can't find it, then just tell the host that the app name is the same as + * the basename of the application's path. + */ + ctmp = strrchr(realCmd, '/'); + if (ctmp) { + ctmp++; + } else { + ctmp = (char *) realCmd; + } + DynBuf_AppendString(buf, ctmp); + } + + free(freeMe); + ctmp = freeMe = NULL; + + GHIPlatformCollectIconInfo(ghip, ghm, windowID, buf); + + return TRUE; +#else // !GTK2 + return FALSE; +#endif // GTK2 +} + + +/* + *---------------------------------------------------------------------------- + * + * GHIPlatformGetBinaryHandlers -- + * + * Get the list of filetypes and URL protocols supported by a binary + * (application). We're passed an app path in URI format, and we find + * the app info by looking up the path in GHIPlatform->appsByExecutable. + * Once we find it, we can retrieve info on the app from the .desktop file. + * + * Results: + * TRUE if everything went ok, FALSE otherwise. + * + * Side effects: + * None + * + *---------------------------------------------------------------------------- + */ + +Bool +GHIPlatformGetBinaryHandlers(GHIPlatform *ghip, // IN: platform-specific state + const char *pathUtf8, // IN: full path to the executable + XDR *xdrs) // OUT: binary information +{ + return FALSE; +} + + +#ifdef GTK2 + + +/* + *----------------------------------------------------------------------------- + * + * GHIPlatformGetDesktopName -- + * + * Figures out which desktop environment we're running under. + * + * Results: + * Desktop name if successful, NULL otherwise. + * + * Side effects: + * Allocates memory to hold return value. + * + *----------------------------------------------------------------------------- + */ + +static const char * +GHIPlatformGetDesktopName(void) +{ + int i; + static const char *clientMappings[][2] = { + {"gnome-panel", "GNOME"}, + {"gnome-session", "GNOME"}, + {"nautilus", "GNOME"}, + {"ksmserver", "KDE"}, + {"kicker", "KDE"}, + {"startkde", "KDE"}, + {"konqueror", "KDE"}, + {"xfce-mcs-manage", "XFCE"}, + {"xfwm4", "XFCE"}, + {"ROX-Session", "ROX"} + }; + Display *display; + Window rootWindow; + Window temp1; // throwaway + Window temp2; // throwaway + Window *children = NULL; + unsigned int nchildren; + const char *retval = NULL; + + display = gdk_x11_get_default_xdisplay(); + rootWindow = DefaultRootWindow(display); + + if (XQueryTree(display, rootWindow, &temp1, &temp2, &children, &nchildren) == 0) { + return NULL; + } + + for (i = 0; i < nchildren && !retval; i++) { + char *name = NULL; + int j; + + if ((XFetchName(display, children[i], &name) == 0) || + name == NULL) { + continue; + } + + for (j = 0; j < ARRAYSIZE(clientMappings) && !retval; j++) { + if (!strcmp(clientMappings[j][0], name)) { + retval = clientMappings[j][1]; + } + } + + XFree(name); + } + + XFree(children); + return retval; +} + + +/* + *----------------------------------------------------------------------------- + * + * GHIPlatformIsMenuItemAllowed -- + * + * This routine tells the caller, based on policies defined by the .desktop file, + * whether the requested application should be displayed in the Unity menus. + * + * Results: + * TRUE if the item should be displayed, FALSE if it should not be. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static Bool +GHIPlatformIsMenuItemAllowed(GHIPlatform *ghip, // IN: + GKeyFile *keyfile) // IN: +{ + const char *dtname; + + ASSERT(ghip); + ASSERT(keyfile); + + /* + * Examine the "NoDisplay" and "Hidden" properties. + */ + if (g_key_file_get_boolean(keyfile, + G_KEY_FILE_DESKTOP_GROUP, + G_KEY_FILE_DESKTOP_KEY_NO_DISPLAY, + NULL) || + g_key_file_get_boolean(keyfile, + G_KEY_FILE_DESKTOP_GROUP, + G_KEY_FILE_DESKTOP_KEY_HIDDEN, + NULL)) { + Debug("%s: contains either NoDisplay or Hidden keys.\n", __func__); + return FALSE; + } + + /* + * NB: This may return NULL. + * XXX Perhaps that should be changed to return an empty string? + */ + dtname = GHIPlatformGetDesktopName(); + + /* + * Check our desktop environment name against the OnlyShowIn and NotShowIn + * lists. + * + * NB: If the .desktop file defines OnlyShowIn as an empty string, we + * effectively ignore it. (Another interpretation would be that an application + * shouldn't appear at all, but that's what the NoDisplay and Hidden keys are + * for.) + * + * XXX I didn't see anything in the Key-value file parser reference, but I'm + * wondering if there's some other GLib string list searching goodness that + * would obviate the boilerplate-ish code below. + */ + { + gchar **onlyShowList = NULL; + gsize nstrings; + + onlyShowList = g_key_file_get_string_list(keyfile, G_KEY_FILE_DESKTOP_GROUP, + G_KEY_FILE_DESKTOP_KEY_ONLY_SHOW_IN, + &nstrings, NULL); + if (onlyShowList && nstrings) { + Bool matchedOnlyShowIn = FALSE; + int i; + + if (dtname) { + for (i = 0; i < nstrings; i++) { + if (strcasecmp(dtname, onlyShowList[i]) == 0) { + matchedOnlyShowIn = TRUE; + break; + } + } + } + + if (!matchedOnlyShowIn) { + Debug("%s: OnlyShowIn does not include our desktop environment, %s.\n", + __func__, dtname ? dtname : "(not set)"); + g_strfreev(onlyShowList); + return FALSE; + } + } + g_strfreev(onlyShowList); + } + + if (dtname) { + gchar **notShowList = NULL; + gsize nstrings; + int i; + + notShowList = g_key_file_get_string_list(keyfile, G_KEY_FILE_DESKTOP_GROUP, + G_KEY_FILE_DESKTOP_KEY_NOT_SHOW_IN, + &nstrings, NULL); + if (notShowList && nstrings) { + for (i = 0; i < nstrings; i++) { + if (strcasecmp(dtname, notShowList[i]) == 0) { + Debug("%s: NotShowIn includes our desktop environment, %s.\n", + __func__, dtname); + g_strfreev(notShowList); + return FALSE; + } + } + } + g_strfreev(notShowList); + } + + return TRUE; +} + + +/* + *----------------------------------------------------------------------------- + * + * GHIPlatformGetExecFromKeyFile -- + * + * Given a GLib GKeyFile, extract path(s) from the TryExec or Exec + * keys, normalize them, and return them to the caller. + * + * Results: + * Returns a string pointer to an absolute executable pathname on success or + * NULL on failure. + * + * Side effects: + * This routine returns memory allocated by GLib. Caller is responsible + * for freeing it via g_free. + * + *----------------------------------------------------------------------------- + */ + +static gchar * +GHIPlatformGetExecFromKeyfile(GHIPlatform *ghip, // IN + GKeyFile *keyfile) // IN +{ + gchar *exe = NULL; + + /* + * TryExec is supposed to be a path to an executable without arguments that, + * if set but not found or not executable, indicates that this menu item should + * be skipped. + */ + { + gchar *tryExec; + + tryExec = g_key_file_get_string(keyfile, G_KEY_FILE_DESKTOP_GROUP, + G_KEY_FILE_DESKTOP_KEY_TRY_EXEC, NULL); + if (tryExec) { + gchar *ctmp; + ctmp = g_find_program_in_path(tryExec); + + if (ctmp == NULL) { + Debug("%s: Entry has TryExec=%s, but it was not found in our PATH.\n", + __func__, tryExec); + g_free(tryExec); + return NULL; + } + + g_free(ctmp); + g_free(tryExec); + } + } + + /* + * Next up: Look up Exec key and do some massaging to skip over common interpreters. + */ + { + char *exec; + char **argv; + int argc; + int i; + gboolean parsed; + + exec = g_key_file_get_string(keyfile, G_KEY_FILE_DESKTOP_GROUP, + G_KEY_FILE_DESKTOP_KEY_EXEC, NULL); + + if (!exec) { + Debug("%s: Missing Exec key.\n", __func__); + return NULL; + } + + parsed = g_shell_parse_argv(exec, &argc, &argv, NULL); + g_free(exec); + + if (!parsed) { + Debug("%s: Unable to parse shell arguments.\n", __func__); + return NULL; + } + + for (i = 0; i < argc; i++) { + /* + * The Exec= line in the .desktop file may list other boring helper apps before + * the name of the main app. getproxy is a common one. We need to skip those + * arguments in the cmdline. + */ + if (!AppUtil_AppIsSkippable(argv[i])) { + exe = g_strdup(argv[i]); + break; + } + } + g_strfreev(argv); + } + + /* + * Turn it into a full path. Yes, if we can't get an absolute path, we'll return + * NULL. + */ + if (exe && *exe != '/') { + gchar *ctmp; + + ctmp = g_find_program_in_path(exe); + g_free(exe); + exe = ctmp; + if (!exe) { + Debug("%s: Unable to find program in PATH.\n", __func__); + } + } + + return exe; +} + + +/* + *----------------------------------------------------------------------------- + * + * GHIPlatformAddMenuItem -- + * + * Examines an application's .desktop file and inserts it into an appropriate + * Unity application menu. + * + * Results: + * A new GHIMenuItem will be created. If our desired menu directory doesn't + * already exist, then we'll create that, too. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static void +GHIPlatformAddMenuItem(GHIPlatform *ghip, // IN: + const char *keyfilePath, // IN: + GKeyFile *keyfile, // IN: + char *exePath) // IN: +{ + /* + * A list of categories that a .desktop file should be in in order to be relayed to + * the host. + * + * NB: "Other" is a generic category where we dump applications for which we can't + * determine an appropriate category. This is "safe" as long as menu-spec doesn't + * register it, and I don't expect that to happen any time soon. It is -extremely- + * important that "Other" be the final entry in this list. + */ + static const char *validCategories[] = { + "AudioVideo", + "Development", + "Education", + "Game", + "Graphics", + "Network", + "Office", + "Settings", + "System", + "Utility", + "Other" + }; + + GHIMenuDirectory *gmd; + GHIMenuItem *gmi; + Bool foundIt = FALSE; + char **categories = NULL; + gsize numcats; + int kfIndex; // keyfile categories index/iterator + int vIndex; // validCategories index/iterator + + /* + * Figure out if this .desktop file is in a category we want to put on our menus, + * and if so which one... + */ + categories = g_key_file_get_string_list(keyfile, G_KEY_FILE_DESKTOP_GROUP, + G_KEY_FILE_DESKTOP_KEY_CATEGORIES, + &numcats, NULL); + if (categories) { + for (kfIndex = 0; kfIndex < numcats && !foundIt; kfIndex++) { + /* + * NB: See validCategories' comment re: "Other" being the final, default + * category. It explains why we condition on ARRAYSIZE() - 1. + */ + for (vIndex = 0; vIndex < ARRAYSIZE(validCategories) - 1; vIndex++) { + if (!strcasecmp(categories[kfIndex], validCategories[vIndex])) { + foundIt = TRUE; + break; + } + } + } + g_strfreev(categories); + } + + /* + * If not found, fall back to "Other". + */ + if (!foundIt) { + vIndex = ARRAYSIZE(validCategories) - 1; + } + + /* + * We have all the information we need to create the new GHIMenuItem. + */ + gmi = g_new0(GHIMenuItem, 1); + gmi->keyfilePath = g_strdup(keyfilePath); + gmi->keyfile = keyfile; + gmi->exepath = exePath; + + gmd = g_tree_lookup(ghip->apps, validCategories[vIndex]); + + if (!gmd) { + /* + * A GHIMenuDirectory object does not yet exist for the validCategory + * that this .desktop is in, so create that object. + */ + gmd = g_new0(GHIMenuDirectory, 1); + gmd->dirname = validCategories[vIndex]; + gmd->items = g_ptr_array_new(); + g_tree_insert(ghip->apps, (gpointer)validCategories[vIndex], gmd); + Debug("Created new category '%s'\n", gmd->dirname); + } + + g_ptr_array_add(gmd->items, gmi); + g_hash_table_insert(ghip->appsByExecutable, gmi->exepath, gmi); + g_hash_table_insert(ghip->appsByDesktopEntry, gmi->keyfilePath, gmi); + Debug("Loaded desktop item for %s into %s\n", gmi->exepath, gmd->dirname); +} + + +/* + *----------------------------------------------------------------------------- + * + * GHIPlatformReadDesktopFile -- + * + * Reads a .desktop file into our internal representation of the available + * applications. + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static void +GHIPlatformReadDesktopFile(GHIPlatform *ghip, // IN + const char *path) // IN +{ + GKeyFile *keyfile = NULL; + gchar *exe = NULL; + + Debug("%s: Analyzing %s.\n", __func__, path); + + /* + * First load our .desktop file into a GLib GKeyFile structure. Then perform + * some rudimentary policy checks based on keys like NoDisplay and OnlyShowIn. + */ + + keyfile = g_key_file_new(); + if (!keyfile) { + Debug("%s: g_key_file_new failed.\n", __func__); + return; + } + + if (!g_key_file_load_from_file(keyfile, path, 0, NULL) || + !GHIPlatformIsMenuItemAllowed(ghip, keyfile)) { + g_key_file_free(keyfile); + Debug("%s: Unable to load .desktop file or told to skip it.\n", __func__); + return; + } + + /* + * Okay, policy checks passed. Next up, obtain a normalized executable path, + * and if successful insert it into our menus. + */ + + exe = GHIPlatformGetExecFromKeyfile(ghip, keyfile); + if (exe) { + /* The following routine takes ownership of keyfile and exec. */ + GHIPlatformAddMenuItem(ghip, path, keyfile, exe); + } else { + Debug("%s: Could not find executable for %s\n", __func__, path); + g_key_file_free(keyfile); + } +} + + +/* + *----------------------------------------------------------------------------- + * + * GHIPlatformReadApplicationsDir -- + * + * Reads in the .desktop files in a particular directory. + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static void +GHIPlatformReadApplicationsDir(GHIPlatform *ghip, // IN + const char *dir) // IN +{ + DIR *dirh; + struct dirent *dent; + GHIDirectoryWatch dirWatch; + + ASSERT(ghip); + ASSERT(dir); + + dirh = opendir(dir); + if (!dirh) { + return; + } + + dirWatch.directoryPath = strdup(dir); + g_array_append_val(ghip->directoriesTracked, dirWatch); + + while ((dent = readdir(dirh))) { + char subpath[PATH_MAX]; + struct stat sbuf; + int subpathLen; + + if (!strcmp(dent->d_name, ".") || + !strcmp(dent->d_name, "..") || + !strcmp(dent->d_name, ".hidden")) { + continue; + } + + subpathLen = Str_Sprintf(subpath, sizeof subpath, "%s/%s", dir, dent->d_name); + if (subpathLen >= (sizeof subpath - 1)) { + Warning("There may be a recursive symlink or long path," + " somewhere above %s. Skipping.\n", subpath); + closedir(dirh); + return; + } + if (dent->d_type == DT_UNKNOWN && stat(subpath, &sbuf)) { + continue; + } + + if (dent->d_type == DT_DIR || + (dent->d_type == DT_UNKNOWN + && S_ISDIR(sbuf.st_mode))) { + GHIPlatformReadApplicationsDir(ghip, subpath); + } else if ((dent->d_type == DT_REG || + (dent->d_type == DT_UNKNOWN + && S_ISREG(sbuf.st_mode))) + && StrUtil_EndsWith(dent->d_name, ".desktop")) { + GHIPlatformReadDesktopFile(ghip, subpath); + } + } + + closedir(dirh); +} + + +/* + *----------------------------------------------------------------------------- + * + * GHIPlatformReadAllApplications -- + * + * Reads in information on all the applications that have .desktop files on this + * system. + * + * Results: + * None. + * + * Side effects: + * ghip->applist is created. + * + *----------------------------------------------------------------------------- + */ + +static void +GHIPlatformReadAllApplications(GHIPlatform *ghip) // IN +{ + ASSERT(ghip); + + if (!ghip->apps) { + int i; + + ghip->apps = g_tree_new_full((GCompareDataFunc)strcmp, NULL, NULL, + GHIPlatformDestroyMenuDirectory); + ghip->appsByExecutable = g_hash_table_new(g_str_hash, g_str_equal); + ghip->appsByDesktopEntry = g_hash_table_new(g_str_hash, g_str_equal); + + for (i = 0; i < ARRAYSIZE(desktopDirs); i++) { + if (StrUtil_StartsWith(desktopDirs[i], "~/")) { + char cbuf[PATH_MAX]; + + Str_Sprintf(cbuf, sizeof cbuf, "%s/%s", + g_get_home_dir(), desktopDirs[i] + 2); + GHIPlatformReadApplicationsDir(ghip, cbuf); + } else { + GHIPlatformReadApplicationsDir(ghip, desktopDirs[i]); + } + } + } +} +#endif // GTK2 + + +/* + *---------------------------------------------------------------------------- + * + * GHIPlatformOpenStartMenuTree -- + * + * Get start menu item count for a given root. This function should be + * called before iterating through the menu item subtree. + * To start at the root of the start menu, pass in "" for the root. + * + * The output 'buf' is a string holding two numbers separated by a space: + * 1. A handle ID for this menu tree iterator. + * 2. A count of the items in this iterator. + * + * Results: + * TRUE if we were able to get the count successfully + * FALSE otherwise + * + * Side effects: + * None + * + *---------------------------------------------------------------------------- + */ + +Bool +GHIPlatformOpenStartMenuTree(GHIPlatform *ghip, // IN: platform-specific state + const char *rootUtf8, // IN: root of the tree + DynBuf *buf) // OUT: number of items +{ +#ifdef GTK2 + char temp[64]; + ASSERT(ghip); + GHIMenuHandle *gmh; + int itemCount = 0; + Bool retval = FALSE; + + ASSERT(ghip); + ASSERT(rootUtf8); + ASSERT(buf); + + GHIPlatformSetMenuTracking(ghip, TRUE); + + if (!ghip->menuHandles) { + ghip->menuHandles = g_hash_table_new(g_direct_hash, g_direct_equal); + } + + if (!ghip->apps) { + return FALSE; + } + + gmh = g_new0(GHIMenuHandle, 1); + gmh->handleID = ++ghip->nextMenuHandle; + + if (!strcmp(rootUtf8, UNITY_START_MENU_LAUNCH_FOLDER)) { + gmh->handleType = LAUNCH_FOLDER; + itemCount = g_tree_nnodes(ghip->apps); + retval = TRUE; + } else if (!strcmp(rootUtf8, UNITY_START_MENU_FIXED_FOLDER)) { + /* + * XXX Not yet implemented + */ + gmh->handleType = FIXED_FOLDER; + retval = TRUE; + } else if (*rootUtf8) { + gmh->handleType = DIRECTORY_FOLDER; + + if (StrUtil_StartsWith(rootUtf8, UNITY_START_MENU_LAUNCH_FOLDER)) { + gmh->gmd = g_tree_lookup(ghip->apps, + rootUtf8 + sizeof(UNITY_START_MENU_LAUNCH_FOLDER)); + if (gmh->gmd) { + itemCount = gmh->gmd->items->len; + retval = TRUE; + } + } + } + + if (!retval) { + g_free(gmh); + return retval; + } + + Debug("Opened start menu tree for %s with %d items, handle %d\n", + rootUtf8, itemCount, gmh->handleID); + + g_hash_table_insert(ghip->menuHandles, GINT_TO_POINTER(gmh->handleID), gmh); + + Str_Sprintf(temp, sizeof temp, "%d %d", gmh->handleID, itemCount); + DynBuf_AppendString(buf, temp); + + return TRUE; +#else // !GTK2 + return FALSE; +#endif // GTK2 +} + + +#ifdef GTK2 +/* + *----------------------------------------------------------------------------- + * + * GHIPlatformFindLaunchMenuItem -- + * + * A GTraverseFunc used to find the right item in the list of directories. + * + * Results: + * TRUE if tree traversal should stop, FALSE otherwise. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static gboolean +GHIPlatformFindLaunchMenuItem(gpointer key, // IN + gpointer value, // IN + gpointer data) // IN +{ + GHITreeTraversal *td; + + ASSERT(data); + ASSERT(value); + td = data; + + td->currentItem++; + if (td->currentItem == td->desiredItem) { + td->gmd = value; + return TRUE; + } + + return FALSE; +} +#endif // GTK2 + + +/* + *----------------------------------------------------------------------------- + * + * GHIPlatformMenuItemToURI -- + * + * Returns the URI that would be used to launch a particular GHI menu item + * + * Results: + * Newly allocated URI string + * + * Side effects: + * Allocates memory for the URI. + * + *----------------------------------------------------------------------------- + */ + +static char * +GHIPlatformMenuItemToURI(GHIPlatform *ghip, // IN + GHIMenuItem *gmi) // IN +{ + gchar **argv; + gint argc; + + char *ctmp; + UriQueryListA *queryItems; + int i; + int err; + gboolean res; + int nchars; + char *uriString; + char *queryString; + + ASSERT(ghip); + ASSERT(gmi); + + ctmp = g_key_file_get_string(gmi->keyfile, G_KEY_FILE_DESKTOP_GROUP, + G_KEY_FILE_DESKTOP_KEY_EXEC, NULL); + + res = g_shell_parse_argv(ctmp, &argc, &argv, NULL); + g_free(ctmp); + if (!res) { + return NULL; + } + + queryItems = alloca((argc + 1) * sizeof *queryItems); + + for (i = 0; i < (argc - 1); i++) { + queryItems[i].key = "argv[]"; + queryItems[i].value = argv[i + 1]; + queryItems[i].next = &queryItems[i + 1]; + } + queryItems[i].key = "DesktopEntry"; + queryItems[i].value = gmi->keyfilePath; + queryItems[i].next = NULL; + + /* + * 10 + 3 * len is the formula recommended by uriparser for the maximum URI string + * length. + */ + uriString = alloca(10 + 3 * strlen(gmi->exepath)); + if (uriUnixFilenameToUriStringA(gmi->exepath, uriString)) { + g_strfreev(argv); + return NULL; + } + if (uriComposeQueryCharsRequiredA(queryItems, &nchars) != URI_SUCCESS) { + g_strfreev(argv); + return NULL; + } + queryString = alloca(nchars + 1); + err = uriComposeQueryA(queryString, queryItems, nchars + 1, &i); + g_strfreev(argv); + if (err != URI_SUCCESS) { + return NULL; + } + + return g_strdup_printf("%s?%s", uriString, queryString); +} + + +/* + *---------------------------------------------------------------------------- + * + * GHIPlatformGetStartMenuItem -- + * + * Get start menu item at a given index. This function should be called + * in the loop to get all items for a menu sub-tree. + * If there are no more items, the function will return FALSE. + * + * Upon returning, 'buf' will hold a nul-delimited array of strings: + * 1. User-visible item name. + * 2. UNITY_START_MENU_ITEM_* flag. + * 3. Executable path. + * 4. Localized user-visible item name. + * + * Results: + * TRUE if there's an item at a given index, FALSE otherwise. + * + * Side effects: + * None + * + *---------------------------------------------------------------------------- + */ + +Bool +GHIPlatformGetStartMenuItem(GHIPlatform *ghip, // IN: platform-specific state + uint32 handle, // IN: tree handle + uint32 itemIndex, // IN: the index of the item in the tree + DynBuf *buf) // OUT: item +{ +#ifdef GTK2 + GHIMenuHandle *gmh; + char *itemName = NULL; + uint itemFlags = 0; + char *itemPath = NULL; + char *localizedItemName = NULL; + Bool freeItemName = FALSE; + Bool freeItemPath = FALSE; + Bool freeLocalItemName = FALSE; + char temp[64]; + + ASSERT(ghip); + ASSERT(ghip->menuHandles); + ASSERT(buf); + + gmh = g_hash_table_lookup(ghip->menuHandles, GINT_TO_POINTER(handle)); + if (!gmh) { + return FALSE; + } + + switch (gmh->handleType) { + case LAUNCH_FOLDER: + { + GHITreeTraversal traverseData = { -1, itemIndex, NULL }; + + /* + * We're iterating through the list of directories. + */ + if (!ghip->apps) { + return FALSE; + } + + g_tree_foreach(ghip->apps, GHIPlatformFindLaunchMenuItem, &traverseData); + if (!traverseData.gmd) { + return FALSE; + } + + itemPath = ""; + itemFlags = UNITY_START_MENU_ITEM_DIRECTORY; // It's a directory + itemName = g_strdup_printf("%s/%s", UNITY_START_MENU_LAUNCH_FOLDER, + traverseData.gmd->dirname); + freeItemName = TRUE; + localizedItemName = (char *)traverseData.gmd->dirname; + } + break; + case FIXED_FOLDER: + return FALSE; + + case DIRECTORY_FOLDER: + { + GHIMenuItem *gmi; + + if (gmh->gmd->items->len <= itemIndex) { + return FALSE; + } + + gmi = g_ptr_array_index(gmh->gmd->items, itemIndex); + + /* + * XXX I should get_locale_string here for the localizedItemName, if there's a + * way to do it in the guest user's current language. + */ + localizedItemName = g_key_file_get_string(gmi->keyfile, + G_KEY_FILE_DESKTOP_GROUP, + G_KEY_FILE_DESKTOP_KEY_NAME, + NULL); + freeLocalItemName = TRUE; + itemName = g_strdup_printf("%s/%s/%s", UNITY_START_MENU_LAUNCH_FOLDER, + gmh->gmd->dirname, localizedItemName); + freeItemName = TRUE; + + itemPath = GHIPlatformMenuItemToURI(ghip, gmi); + freeItemPath = TRUE; + } + break; + } + + DynBuf_AppendString(buf, itemName); + Str_Sprintf(temp, sizeof temp, "%u", itemFlags); + DynBuf_AppendString(buf, temp); + DynBuf_AppendString(buf, itemPath ? itemPath : ""); + DynBuf_AppendString(buf, localizedItemName ? localizedItemName : itemName); + + if (freeItemName) { + g_free(itemName); + } + if (freeItemPath) { + g_free(itemPath); + } + if (freeLocalItemName) { + g_free(localizedItemName); + } + + return TRUE; +#else // !GTK2 + return FALSE; +#endif // GTK2 +} + + +/* + *---------------------------------------------------------------------------- + * + * GHIPlatformCloseStartMenu -- + * + * Free all memory associated with this start menu tree and cleanup. + * + * Results: + * TRUE if the handle is valid + * FALSE otherwise + * + * Side effects: + * None + * + *---------------------------------------------------------------------------- + */ + +Bool +GHIPlatformCloseStartMenuTree(GHIPlatform *ghip, // IN: platform-specific state + uint32 handle) // IN: handle to the tree to be closed +{ +#ifdef GTK2 + GHIMenuHandle *gmh; + + ASSERT(ghip); + if (!ghip->menuHandles) { + return TRUE; + } + + gmh = g_hash_table_lookup(ghip->menuHandles, GINT_TO_POINTER(handle)); + if (!gmh) { + return TRUE; + } + + g_hash_table_remove(ghip->menuHandles, GINT_TO_POINTER(gmh->handleID)); + GHIPlatformFreeValue(NULL, gmh, NULL); + + return TRUE; +#else // !GTK2 + return FALSE; +#endif // GTK2 +} + + +#if 0 // REMOVE AFTER IMPLEMENTING GHIPlatformShellAction +/* + *----------------------------------------------------------------------------- + * + * GHIPlatformFindHGFSShare -- + * + * Finds the filesystem path to a particular HGFS sharename + * + * Results: + * Newly heap-allocated path to the top of the specified share. + * + * Side effects: + * Allocates memory for the return value. + * + *----------------------------------------------------------------------------- + */ + +static char * +GHIPlatformFindHGFSShare(GHIPlatform *ghip, // IN + const UriTextRangeA *sharename) // IN +{ + FILE *fh; + struct mntent *ment; + + fh = Posix_Setmntent(_PATH_MOUNTED, "r"); + if (!fh) { + return NULL; + } + + while ((ment = Posix_Getmntent(fh))) { + char *fsSharename; + if (strcmp(ment->mnt_type, "hgfs") && strcmp(ment->mnt_type, "vmhgfs")) { + continue; + } + + if (!StrUtil_StartsWith(ment->mnt_fsname, ".host:")) { + Warning("HGFS filesystem has an fsname of \"%s\" rather than \".host:...\"\n", + ment->mnt_fsname); + continue; + } + + if (ment->mnt_fsname[strlen(".host:")] == '/') { + fsSharename = ment->mnt_fsname + strlen(".host:/"); + } else { + fsSharename = ment->mnt_fsname + strlen(".host:"); + } + + /* + * XXX this function's logic could be improved substantially to do deeper matching + * (e.g. if someone has .host:/foo/bar mounted, but nothing else, and is looking to + * open the document share://foo/bar/baz). Don't know if HGFS allows that, but + * that'd require passing in the whole URI rather than just the sharename. + */ + if (URI_TEXTRANGE_EQUAL(*sharename, fsSharename)) { + char *retval = g_strdup(ment->mnt_dir); + + fclose(fh); + + return retval; + } else if (fsSharename == '\0') { + /* + * This is a mount of the toplevel HGFS directory, so we know it should work. + */ + char *retval = g_strdup_printf("%s/%.*s", + ment->mnt_dir, + (int)(sharename->afterLast - sharename->first), + sharename->first); + fclose(fh); + return retval; + } + } + fclose(fh); + + return NULL; +} +#endif // REMOVE AFTER IMPLEMENTING GHIPlatformShellAction + + +/* + *----------------------------------------------------------------------------- + * + * GHIPlatformUriPathToString -- + * + * Turns a UriPathSegment sequence into a '/' separated filesystem path. + * + * Results: + * Newly heap-allocated string containing the FS path. + * + * Side effects: + * Allocates memory (caller is responsible for freeing it). + * + *----------------------------------------------------------------------------- + */ + +static char * +GHIPlatformUriPathToString(UriPathSegmentA *path) // IN +{ + GString *str; + char *retval; + UriPathSegmentA *cur; + + str = g_string_new(""); + for (cur = path; cur; cur = cur->next) { + g_string_append_c(str, '/'); + g_string_append_len(str, cur->text.first, cur->text.afterLast - cur->text.first); + } + + retval = str->str; + g_string_free(str, FALSE); + + return retval; +} + + +/* + *----------------------------------------------------------------------------- + * + * GHIPlatformURIToArgs -- + * + * Turns a URI into an array of arguments that are useable for execing... + * + * Results: + * TRUE if successful, FALSE otherwise. + * + * Side effects: + * Allocates an array of strings, and returns it in *argv... + * + *----------------------------------------------------------------------------- + */ + +static Bool +GHIPlatformURIToArgs(GHIPlatform *ghip, // IN + const char *uriString, // IN + char ***argv, // IN/OUT + int *argc, // IN/OUT + char **dotDesktopPath) // IN/OUT +{ + UriParserStateA state; + UriUriA uri; + Bool parseQueryString = TRUE; + GPtrArray *newargv; + + ASSERT(ghip); + ASSERT(uriString); + ASSERT(argv); + ASSERT(argc); + ASSERT(dotDesktopPath); + + memset(&state, 0, sizeof state); + memset(&uri, 0, sizeof uri); + state.uri = &uri; + if (uriParseUriA(&state, uriString) != URI_SUCCESS) { + uriFreeUriMembersA(&uri); + return FALSE; + } + + newargv = g_ptr_array_new(); + +#if 0 // Temporary until ShellAction is implemented. + /* + * This is previous code that was used for mapping x-vmware-share and + * x-vmware-action URIs, but it's not being used at the moment. + */ + if (URI_TEXTRANGE_EQUAL(uri.scheme, "x-vmware-share")) { + UriTextRangeA *sharename; + UriPathSegmentA *sharepath; + char *sharedir; + char *subdir; + + /* + * Try to find a mounted HGFS filesystem that has the right path... + * Deals with both share://sharename/baz/baz and share:///sharename/baz/baz + */ + if (uri.hostText.first) { + sharename = &uri.hostText; + sharepath = uri.pathHead; + } else if (uri.pathHead) { + sharename = &uri.pathHead->text; + sharepath = uri.pathHead->next; + } else { + NOT_REACHED(); + } + + sharedir = GHIPlatformFindHGFSShare(ghip, sharename); + if (!sharedir) { + uriFreeUriMembersA(&uri); + g_ptr_array_free(newargv, TRUE); + Debug("Couldn't find a mounted HGFS filesystem for %s\n", uriString); + return FALSE; + } + + subdir = GHIPlatformUriPathToString(sharepath); + g_ptr_array_add(newargv, g_strconcat(sharedir, subdir, NULL)); + g_free(sharedir); + g_free(subdir); + } else if (URI_TEXTRANGE_EQUAL(uri.scheme, "x-vmware-action")) { + if (g_file_test("/usr/bin/gnome-open", G_FILE_TEST_IS_EXECUTABLE)) { + g_ptr_array_add(newargv, g_strdup("/usr/bin/gnome-open")); + } else if (g_file_test("/usr/bin/htmlview", G_FILE_TEST_IS_EXECUTABLE) + && URI_TEXTRANGE_EQUAL(uri.hostText, "browse")) { + g_ptr_array_add(newargv, g_strdup("/usr/bin/htmlview")); + } else { + Debug("Don't know how to handle URI %s. " + "We definitely don't have /usr/bin/gnome-open.\n", + uriString); + NOT_IMPLEMENTED(); + } + } +#endif // Temporary until ShellAction is implemented. + + if (URI_TEXTRANGE_EQUAL(uri.scheme, "file")) { + char *fspath = GHIPlatformUriPathToString(uri.pathHead); + g_ptr_array_add(newargv, fspath); + } else { + /* + * Just append the unparsed URI as-is onto the command line. + */ + g_ptr_array_add(newargv, g_strdup(uriString)); + parseQueryString = FALSE; + } + + *dotDesktopPath = NULL; + if (parseQueryString) { + /* + * We may need additional command-line arguments from the part of the URI after the + * '?'. + */ + + UriQueryListA *queryList; + int itemCount; + + if (uriDissectQueryMallocA(&queryList, &itemCount, + uri.query.first, uri.query.afterLast) == URI_SUCCESS) { + UriQueryListA *cur; + + for (cur = queryList; cur; cur = cur->next) { + if (!cur->value) { + continue; + } + + if (strcmp(cur->key, "argv[]") == 0) { + g_ptr_array_add(newargv, g_strdup(cur->value)); + cur->value = NULL; + } else if (strcmp(cur->key, "DesktopEntry")) { + *dotDesktopPath = g_strdup(cur->value); + } + } + + uriFreeQueryListA(queryList); + } else { + Warning("Dissection of query string in URI %s failed\n", + uriString); + } + } + + uriFreeUriMembersA(&uri); + + *argc = newargv->len; + g_ptr_array_add(newargv, NULL); + *argv = (char **) g_ptr_array_free(newargv, FALSE); + + return TRUE; +} + + +#if 0 // REMOVE AFTER IMPLEMENTING GHIPlatformShellAction +/* + *----------------------------------------------------------------------------- + * + * GHIPlatformStripFieldCodes -- + * + * Strip field codes from an argv-style string array. + * + * Results: + * None. + * + * Side effects: + * Modifies the string array, possibly freeing some members. + * + *----------------------------------------------------------------------------- + */ + +static void +GHIPlatformStripFieldCodes(char **argv, // IN/OUT + int *argc) // IN/OUT +{ + int i; + + ASSERT(argv); + ASSERT(argc); + + for (i = 0; i < *argc; i++) { + if (argv[i][0] == '%' + && argv[i][1] != '\0' + && argv[i][2] == '\0') { + g_free(argv[i]); + /* + * This math may look slightly dodgy - just remember that these + * argv's have a terminating NULL pointer, which is not included in its argc. + */ + g_memmove(argv + i, argv + i + 1, + (*argc - i) * sizeof *argv); + (*argc)--; + } + } +} +#endif // REMOVE AFTER IMPLEMENTING GHIPlatformShellAction + + +/* + *----------------------------------------------------------------------------- + * + * GHIPlatformCombineArgs -- + * + * Takes a target URI and turns it into an argv array that we can actually + * exec(). + * + * XXX TODO: accept location arguments once ShellAction is implemented. + * + * Results: + * TRUE if successful, FALSE otherwise. If TRUE, fullArgv/fullArgc will + * contain the exec-able argument array. + * + * Side effects: + * Allocates a string array in fullArgv (owner is responsible for freeing). + * + *----------------------------------------------------------------------------- + */ + +static Bool +GHIPlatformCombineArgs(GHIPlatform *ghip, // IN + const char *targetUtf8, // IN + char ***fullArgv, // OUT + int *fullArgc) // OUT +{ + char **targetArgv = NULL; + int targetArgc = 0; + char *targetDotDesktop = NULL; + GPtrArray *fullargs = g_ptr_array_new(); + GHIMenuItem *ghm = NULL; + int i; + + ASSERT(ghip); + ASSERT(targetUtf8); + ASSERT(fullArgv); + ASSERT(fullArgc); + + if (!GHIPlatformURIToArgs(ghip, + targetUtf8, + &targetArgv, + &targetArgc, + &targetDotDesktop)) { + Debug("Parsing URI %s failed\n", targetUtf8); + return FALSE; + } + +#if 0 // Temporary until ShellAction is implemented. + /* + * This is previous code that was used for combining file and action + * arguments, but it's not being used at the moment. Our action URI format + * has changed, so this will need to be updated before it's usable. + */ + + /* + * In the context of the .desktop spec + * (http://standards.freedesktop.org/desktop-entry-spec/1.1/ar01s06.html), + * combining the two is not as simple as just concatenating them. + * + * XXX for some random older programs, we may want to do concatenation in the future. + */ + char **srcArgv; + int srcArgc; + char *srcDotDesktop = NULL; + + /* + * First, figure out which argv[] array is the 'main' one, and which one will serve + * only to fill in the file/URL argument in the .desktop file... + */ + if (! *actionArgc) { + srcArgv = *fileArgv; + srcArgc = *fileArgc; + srcDotDesktop = fileDotDesktop; + } else { + srcArgv = *actionArgv; + srcArgc = *actionArgc; + srcDotDesktop = actionDotDesktop; + if (fileDotDesktop) { + GHIPlatformStripFieldCodes(*fileArgv, fileArgc); + } + } +#endif // Temporary until ShellAction is implemented. + + for (i = 0; i < targetArgc; i++) { + const char *thisarg = targetArgv[i]; + + if (thisarg[0] == '%' && thisarg[1] != '\0' && thisarg[2] == '\0') { + switch (thisarg[1]) { + case 'F': // %F expands to multiple filenames + case 'f': // %f expands to a filename + /* + * XXX TODO: add file location arguments + */ + //if (srcArgv != *fileArgv && *fileArgc) { + // g_ptr_array_add(fullargs, g_strdup((*fileArgv)[0])); + //} + break; + case 'U': // %U expands to multiple URLs + case 'u': // %u expands to a URL + /* + * XXX TODO: add URL location arguments + */ + //if (srcArgv != *fileArgv && fileUtf8) { + // g_ptr_array_add(fullargs, g_strdup(fileUtf8)); + //} + break; + + /* + * These three require getting at the .desktop info for the app. + */ + case 'k': + case 'i': + case 'c': + if (!ghm && targetDotDesktop) { + ghm = g_hash_table_lookup(ghip->appsByDesktopEntry, + targetDotDesktop); + } + if (!ghm) { + ASSERT (fullargs->len > 0); + ghm = g_hash_table_lookup(ghip->appsByExecutable, + g_ptr_array_index(fullargs, 0)); + } + + if (ghm) { + switch (thisarg[1]) { + case 'c': // %c expands to the .desktop's Name= + { + // XXX Should use the translated version + char *ctmp = + g_key_file_get_string(ghm->keyfile, + G_KEY_FILE_DESKTOP_GROUP, + G_KEY_FILE_DESKTOP_KEY_NAME, + NULL); + if (ctmp) { + g_ptr_array_add(fullargs, ctmp); + } + } + break; + case 'i': // %i expands to "--icon" then the .desktop's Icon= + { + char *ctmp = + g_key_file_get_string(ghm->keyfile, + G_KEY_FILE_DESKTOP_GROUP, + G_KEY_FILE_DESKTOP_KEY_ICON, + NULL); + if (ctmp && *ctmp) { + g_ptr_array_add(fullargs, g_strdup("--icon")); + g_ptr_array_add(fullargs, ctmp); + } + } + break; + case 'k': // %k expands to the .desktop's path + g_ptr_array_add(fullargs, g_strdup(ghm->keyfilePath)); + break; + } + } + break; + case '%': // Expands to a literal + g_ptr_array_add(fullargs, g_strdup("%")); + break; + default: + /* + * Intentionally ignore an unknown field code. + */ + break; + } + } else { + g_ptr_array_add(fullargs, g_strdup(thisarg)); + } + } + *fullArgc = fullargs->len; + g_ptr_array_add(fullargs, NULL); + *fullArgv = (char **) g_ptr_array_free(fullargs, FALSE); + + g_strfreev(targetArgv); + g_free(targetDotDesktop); + + return *fullArgc ? TRUE : FALSE; +} + + +/* + *---------------------------------------------------------------------------- + * + * GHIPlatformShellOpen -- + * + * Open the specified file with the default shell handler (ShellExecute). + * Note that the file path may be either a URI (originated with + * Tools >= NNNNN), or a regular path (originated with Tools < NNNNN). + * + * Results: + * TRUE if successful, FALSE otherwise. + * + * Side effects: + * None + * + *---------------------------------------------------------------------------- + */ + +Bool +GHIPlatformShellOpen(GHIPlatform *ghip, // IN + const char *fileUtf8) // IN +{ + char **fullArgv = NULL; + int fullArgc = 0; + Bool retval = FALSE; + + ASSERT(ghip); + ASSERT(fileUtf8); + + Debug("%s: file: '%s'\n", __FUNCTION__, fileUtf8); + + if (GHIPlatformCombineArgs(ghip, fileUtf8, &fullArgv, &fullArgc) && + fullArgc > 0) { + GHIRestoreVMwareEnviron(ghip); + retval = g_spawn_async(NULL, fullArgv, NULL, + G_SPAWN_SEARCH_PATH | + G_SPAWN_STDOUT_TO_DEV_NULL | + G_SPAWN_STDERR_TO_DEV_NULL, + NULL, NULL, NULL, NULL); + GHISetVMwareEnviron(ghip); + } + + g_strfreev(fullArgv); + + return retval; +} + + +/* + *---------------------------------------------------------------------------- + * + * GHIPlatformShellAction -- + * Perform the specified shell action with the optional target and + * locations arguments. Note that the target may be either a URI + * (originated with Tools >= NNNNN), or a regular path (originated with + * Tools < NNNNN). + * See the comment at ghIntegration.c::GHITcloShellAction for information + * on the command format and supported actions. + * + * Results: + * TRUE if successful, FALSE otherwise. + * + * Side effects: + * None + * + *---------------------------------------------------------------------------- + */ + +Bool +GHIPlatformShellAction(GHIPlatform *ghip, // IN: platform-specific state + const XDR *xdrs) // IN: XDR Serialized arguments +{ + /* + * TODO: implement the shell action execution. + * The GHIPlatformShellUrlOpen() below is left for reference, but is not + * used right now. Its functionality should be integrated here. + */ + ASSERT(ghip); + ASSERT(xdrs); + + Debug("%s not implemented yet.\n", __FUNCTION__); + + return FALSE; +} + + +#if 0 // REMOVE AFTER IMPLEMENTING GHIPlatformShellAction +/* + *---------------------------------------------------------------------------- + * + * GHIPlatformShellUrlOpen -- + * + * Run ShellExecute on a given file. + * + * Results: + * TRUE if success, FALSE otherwise. + * + * Side effects: + * None + * + *---------------------------------------------------------------------------- + */ + +Bool +GHIPlatformShellUrlOpen(GHIPlatform *ghip, // IN: platform-specific state + const char *fileUtf8, // IN: command/file + const char *actionUtf8) // IN: action +{ +#ifdef GTK2 + char **fileArgv = NULL; + int fileArgc = 0; + char *fileDotDesktop = NULL; + char **actionArgv = NULL; + int actionArgc = 0; + char *actionDotDesktop = NULL; + char **fullArgv = NULL; + int fullArgc = 0; + + Bool retval = FALSE; + + ASSERT(ghip); + + if (!GHIPlatformURIToArgs(ghip, fileUtf8, &fileArgv, &fileArgc, + &fileDotDesktop)) { + Debug("Parsing URI %s failed\n", fileUtf8); + return FALSE; + } + + if (actionUtf8 && !GHIPlatformURIToArgs(ghip, actionUtf8, &actionArgv, &actionArgc, + &actionDotDesktop)) { + Debug("Parsing action URI %s failed\n", actionUtf8); + g_strfreev(fileArgv); + g_free(fileDotDesktop); + return FALSE; + } + + if (GHIPlatformCombineArgs(ghip, + fileUtf8, &fileArgv, &fileArgc, fileDotDesktop, + actionUtf8, &actionArgv, &actionArgc, actionDotDesktop, + &fullArgv, &fullArgc)) { + retval = g_spawn_async(NULL, fullArgv, NULL, + G_SPAWN_SEARCH_PATH | + G_SPAWN_STDOUT_TO_DEV_NULL | + G_SPAWN_STDERR_TO_DEV_NULL, + NULL, NULL, NULL, NULL); + } + + g_strfreev(fileArgv); + g_free(fileDotDesktop); + g_strfreev(actionArgv); + g_free(actionDotDesktop); + g_strfreev(fullArgv); + + return retval; +#else // !GTK2 + return FALSE; +#endif // GTK2 +} +#endif // REMOVE AFTER IMPLEMENTING GHIPlatformShellAction + + +/* + *---------------------------------------------------------------------------- + * + * GHIPlatformSetGuestHandler -- + * + * Set the handler for the specified filetype (or URL protocol) to the + * given value. + * + * Results: + * TRUE if successful, FALSE otherwise. + * + * Side effects: + * None + * + *---------------------------------------------------------------------------- + */ + +Bool +GHIPlatformSetGuestHandler(GHIPlatform *ghip, // IN: platform-specific state + const XDR *xdrs) // IN: XDR Serialized arguments +{ + ASSERT(ghip); + ASSERT(xdrs); + + return FALSE; +} + + +/* + *---------------------------------------------------------------------------- + * + * GHIPlatformRestoreDefaultGuestHandler -- + * + * Restore the handler for a given type to the value in use before any + * changes by tools. + * + * Results: + * TRUE if successful, FALSE otherwise. + * + * Side effects: + * None + * + *---------------------------------------------------------------------------- + */ + +Bool +GHIPlatformRestoreDefaultGuestHandler(GHIPlatform *ghip, // IN: platform-specific state + const XDR *xdrs) // IN: XDR Serialized arguments +{ + ASSERT(ghip); + ASSERT(xdrs); + + return FALSE; +} + + +/* + *----------------------------------------------------------------------------- + * + * GHIPlatformSetMenuTracking -- + * + * Turns menu tracking on/off. + * + * XXX needs additional implementation work, as per the comment above + * GHIDirectoryWatch. + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static void +GHIPlatformSetMenuTracking(GHIPlatform *ghip, // IN + Bool isEnabled) // IN +{ + int i; + ASSERT(ghip); + + if (isEnabled == ghip->trackingEnabled) { + return; + } + + ghip->trackingEnabled = isEnabled; + if (isEnabled) { + GHIPlatformReadAllApplications(ghip); + } else { + GHIPlatformCleanupMenuEntries(ghip); + + for (i = 0; i < ghip->directoriesTracked->len; i++) { + GHIDirectoryWatch *dirWatch; + + dirWatch = &g_array_index(ghip->directoriesTracked, GHIDirectoryWatch, i); + g_free(dirWatch->directoryPath); + } + g_array_set_size(ghip->directoriesTracked, 0); + } +} + + +/* + *------------------------------------------------------------------------------ + * + * GHIPlatformGetProtocolHandlers -- + * + * XXX Needs to be implemented for Linux/X11 guests. + * Retrieve the list of protocol handlers from the guest. + * + * Results: + * TRUE on success + * FALSE on error + * + * Side effects: + * None + * + *------------------------------------------------------------------------------ + */ + +Bool +GHIPlatformGetProtocolHandlers(GHIPlatform *ghip, // UNUSED + GHIProtocolHandlerList *protocolHandlerList) // IN +{ + return FALSE; +} + + +/* + *----------------------------------------------------------------------------- + * + * GHISetVMwareVariable -- + * + * Sets the environment variable passed in to the value passed in. + * + * Results: + * None. + * + * Side effects: + * The specified environment variable is set. + * + *----------------------------------------------------------------------------- + */ + +static void +GHISetVMwareVariable(gpointer key, // IN + gpointer value, // IN + gpointer user_data) // IN (unused) +{ + if (value) { + System_SetEnv(TRUE, key, value); + } else { + System_UnsetEnv(key); + } +} + + +/* + *------------------------------------------------------------------------------ + * + * GHIRestoreVMwareEnviron -- + * + * For each VMWARE_FOO in the environment, putenv its value as FOO + * and save off the previous value of FOO for later restore (iff this + * is the first time we are called, e.g., the hash table was not yet + * created.) This is called by GHIPlatformShellOpen on Linux only to + * undo what the vmwareuser wrapper script did to the environment, + * before we fork and exec. + * + * Results: + * TRUE on success + * FALSE on error + * + * Side effects: + * None + * + *------------------------------------------------------------------------------ + */ + +static Bool +GHIRestoreVMwareEnviron(GHIPlatform *ghip) // IN +{ + extern char **environ; + char **p; + Bool addToHash = FALSE; + + if (!ghip->vmwareEnv) { + ghip->vmwareEnv = g_hash_table_new(g_str_hash, g_str_equal); + addToHash = TRUE; + } + + if (!ghip->vmwareEnv) { + return FALSE; + } + + for (p = environ; p && *p; p++) { + if (!StrUtil_StartsWith(*p, "VMWARE_")) { + continue; + } + + /* + * So we have a variable that starts with VMWARE_. This variable + * was created by the wrapper script that launches us, for each + * variable in the parent environment it modified. For example, if + * the variable it changes is LD_LIBRARY_PATH, then the variable + * VMWARE_LD_LIBRARY_PATH will hold the value before the wrapper + * script modified it. In Unix, we get this variable in the + * environ extern as VMWARE_LD_LIBRARY_PATH=value. So, we want to + * get the lhs of the "=", skip past the VMWARE_ prefix to get to + * the variable name, and extract the rhs of the "=" to get the + * value. + */ + char *lhs; + char *rhs; + unsigned int index; + + index = 0; + lhs = StrUtil_GetNextToken(&index, *p, "="); + if (lhs) { + index++; + rhs = StrUtil_GetNextToken(&index, *p, ""); + if (rhs && *rhs) { + char *q; + q = lhs + sizeof "VMWARE_" - 1; + if (*q) { + Debug("%s: restoring %s\n", __FUNCTION__, q); + if (addToHash) { + g_hash_table_insert(ghip->vmwareEnv, g_strdup(q), + System_GetEnv(TRUE, q)); + } + /* + * If the value is "0", the script told us that + * there was no corresponding variable in the + * environment. XXX why it was compelled to create + * the VMWARE_ counterpart is unclear. It should have + * been set with a value like "VMWARE_UNSET_ENV" + * because "0" is conceivably a value that is legit + * in some instances. Here, we assume no legit var + * had a value of "0". See bug 313450. + */ + if (strcmp(rhs, "0") == 0) { + System_UnsetEnv(q); + } else if (*rhs == '1') { + System_SetEnv(TRUE, q, rhs + 1); + } + } + } + free(rhs); + } + free(lhs); + } + return TRUE; +} + + +/* + *------------------------------------------------------------------------------ + * + * GHISetVMwareEnviron -- + * + * Restore each environment variable in the hash table to the values + * assigned by the wrapper script when vmware-user was executed. + * + * Results: + * TRUE on success + * FALSE on error + * + * Side effects: + * None + * + *------------------------------------------------------------------------------ + */ + +static Bool +GHISetVMwareEnviron(GHIPlatform *ghip) // IN +{ + if (!ghip->vmwareEnv) { + return FALSE; + } + g_hash_table_foreach(ghip->vmwareEnv, GHISetVMwareVariable, NULL); + return TRUE; +} diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/ghIntegration/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/ghIntegration/Makefile.am --- open-vm-tools-2008.01.23-74039/lib/ghIntegration/Makefile.am 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/ghIntegration/Makefile.am 2008-10-13 08:01:47.000000000 +0100 @@ -0,0 +1,27 @@ +################################################################################ +### Copyright 2008 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_LIBRARIES = libGhIntegration.a + +libGhIntegration_a_SOURCES = +libGhIntegration_a_SOURCES += ghIntegration.c +libGhIntegration_a_SOURCES += ghIntegrationX11.c + +AM_CFLAGS = @GTK_CPPFLAGS@ +AM_CFLAGS += @URIPARSER_CPPFLAGS@ +AM_CFLAGS += @LIB_FILE_CPPFLAGS@ +AM_CFLAGS += -I$(top_builddir)/include diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/ghIntegration/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/ghIntegration/Makefile.in --- open-vm-tools-2008.01.23-74039/lib/ghIntegration/Makefile.in 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/ghIntegration/Makefile.in 2008-10-13 08:02:13.000000000 +0100 @@ -0,0 +1,498 @@ +# 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 2008 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/ghIntegration +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)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) +ARFLAGS = cru +libGhIntegration_a_AR = $(AR) $(ARFLAGS) +libGhIntegration_a_LIBADD = +am_libGhIntegration_a_OBJECTS = ghIntegration.$(OBJEXT) \ + ghIntegrationX11.$(OBJEXT) +libGhIntegration_a_OBJECTS = $(am_libGhIntegration_a_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 = $(libGhIntegration_a_SOURCES) +DIST_SOURCES = $(libGhIntegration_a_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_XLIBS = @COMMON_XLIBS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ +DNET_LIBS = @DNET_LIBS@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ +GTK_LIBS = @GTK_LIBS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ +HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ +MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ +RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ +VERSION = @VERSION@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +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@ +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@ +lt_ECHO = @lt_ECHO@ +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_LIBRARIES = libGhIntegration.a +libGhIntegration_a_SOURCES = ghIntegration.c ghIntegrationX11.c +AM_CFLAGS = @GTK_CPPFLAGS@ @URIPARSER_CPPFLAGS@ @LIB_FILE_CPPFLAGS@ \ + -I$(top_builddir)/include +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/ghIntegration/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu lib/ghIntegration/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-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) +libGhIntegration.a: $(libGhIntegration_a_OBJECTS) $(libGhIntegration_a_DEPENDENCIES) + -rm -f libGhIntegration.a + $(libGhIntegration_a_AR) libGhIntegration.a $(libGhIntegration_a_OBJECTS) $(libGhIntegration_a_LIBADD) + $(RANLIB) libGhIntegration.a + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ghIntegration.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ghIntegrationX11.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 $(LIBRARIES) +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-noinstLIBRARIES \ + 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-noinstLIBRARIES 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: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/ghIntegrationStub/ghIntegrationStub.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/ghIntegrationStub/ghIntegrationStub.c --- open-vm-tools-2008.01.23-74039/lib/ghIntegrationStub/ghIntegrationStub.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/ghIntegrationStub/ghIntegrationStub.c 2008-10-13 08:01:50.000000000 +0100 @@ -0,0 +1,52 @@ +/********************************************************* + * Copyright (C) 2006 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. + * + *********************************************************/ + +/* + * ghIntegrationStub.c -- + * + * Guest host integration functions. + */ + +#include "vmware.h" +#include "rpcin.h" +#include "ghIntegration.h" + +void +GHI_Init(VMU_ControllerCB *vmuControllerCB, void *ctx) +{ +} + +void +GHI_InitBackdoor(struct RpcIn *rpcIn) +{ +} + +void +GHI_Cleanup(void) +{ +} + +void +GHI_RegisterCaps(void) +{ +} + +void +GHI_UnregisterCaps(void) +{ +} diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/ghIntegrationStub/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/ghIntegrationStub/Makefile.am --- open-vm-tools-2008.01.23-74039/lib/ghIntegrationStub/Makefile.am 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/ghIntegrationStub/Makefile.am 2008-10-13 08:01:47.000000000 +0100 @@ -0,0 +1,23 @@ +################################################################################ +### Copyright 2008 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_LIBRARIES = libGhIntegrationStub.a + +libGhIntegrationStub_a_SOURCES = +libGhIntegrationStub_a_SOURCES += ghIntegrationStub.c + +AM_CFLAGS = @LIB_FILE_CPPFLAGS@ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/ghIntegrationStub/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/ghIntegrationStub/Makefile.in --- open-vm-tools-2008.01.23-74039/lib/ghIntegrationStub/Makefile.in 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/ghIntegrationStub/Makefile.in 2008-10-13 08:02:13.000000000 +0100 @@ -0,0 +1,495 @@ +# 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 2008 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/ghIntegrationStub +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)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) +ARFLAGS = cru +libGhIntegrationStub_a_AR = $(AR) $(ARFLAGS) +libGhIntegrationStub_a_LIBADD = +am_libGhIntegrationStub_a_OBJECTS = ghIntegrationStub.$(OBJEXT) +libGhIntegrationStub_a_OBJECTS = $(am_libGhIntegrationStub_a_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 = $(libGhIntegrationStub_a_SOURCES) +DIST_SOURCES = $(libGhIntegrationStub_a_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_XLIBS = @COMMON_XLIBS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ +DNET_LIBS = @DNET_LIBS@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ +GTK_LIBS = @GTK_LIBS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ +HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ +MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ +RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ +VERSION = @VERSION@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +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@ +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@ +lt_ECHO = @lt_ECHO@ +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_LIBRARIES = libGhIntegrationStub.a +libGhIntegrationStub_a_SOURCES = ghIntegrationStub.c +AM_CFLAGS = @LIB_FILE_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/ghIntegrationStub/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu lib/ghIntegrationStub/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-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) +libGhIntegrationStub.a: $(libGhIntegrationStub_a_OBJECTS) $(libGhIntegrationStub_a_DEPENDENCIES) + -rm -f libGhIntegrationStub.a + $(libGhIntegrationStub_a_AR) libGhIntegrationStub.a $(libGhIntegrationStub_a_OBJECTS) $(libGhIntegrationStub_a_LIBADD) + $(RANLIB) libGhIntegrationStub.a + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ghIntegrationStub.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 $(LIBRARIES) +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-noinstLIBRARIES \ + 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-noinstLIBRARIES 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: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/guestApp/guestApp.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/guestApp/guestApp.c --- open-vm-tools-2008.01.23-74039/lib/guestApp/guestApp.c 2008-01-28 08:02:50.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/guestApp/guestApp.c 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -50,6 +50,7 @@ #include "vmstdio.h" #include "codeset.h" #include "productState.h" +#include "posix.h" #if !defined(N_PLAT_NLM) # include "hgfs.h" @@ -62,6 +63,22 @@ #include #endif +/* + * For Netware/Linux/BSD/Solaris, the install path + * is the hardcoded value below. For Windows, it is + * determined dynamically in GuestApp_GetInstallPath(), + * so the empty string here is just for completeness. + * XXX. Whoever does the Mac port should do something + * intelligent for that platform as well. + */ + +#if defined(N_PLAT_NLM) +#define GUESTAPP_TOOLS_INSTALL_PATH "SYS:\\ETC\\VMWTOOL" +#elif defined(_WIN32) +#define GUESTAPP_TOOLS_INSTALL_PATH "" +#else +#define GUESTAPP_TOOLS_INSTALL_PATH "/etc/vmware-tools" +#endif /* * An option name/value pair stored locally in the guest app. @@ -84,7 +101,7 @@ /* Function pointer, used in GuestApp_GetConfPath. */ #if defined(_WIN32) -typedef HRESULT (WINAPI *PSHGETFOLDERPATH)(HWND, int, HANDLE, DWORD, LPTSTR); +typedef HRESULT (WINAPI *PSHGETFOLDERPATH)(HWND, int, HANDLE, DWORD, LPWSTR); static PSHGETFOLDERPATH pfnSHGetFolderPath = NULL; #endif @@ -691,58 +708,6 @@ /* *---------------------------------------------------------------------- * - * GuestApp_SetVersion -- - * - * Set the tools version through the backdoor. - * - * Results: - * TRUE if the rpci send succeeded - * FALSE if it failed - * - * Side effects: - * None - * - *---------------------------------------------------------------------- - */ - -Bool -GuestApp_SetVersion(void) -{ - Debug("Setting tools version to '%u'\n", TOOLS_VERSION_CURRENT); - - return RpcOut_sendOne(NULL, NULL, "tools.set.version %u", - TOOLS_VERSION_CURRENT); -} - - -/* - *---------------------------------------------------------------------- - * - * GuestApp_GetCurrentVersion -- - * - * Get the current version of this guest app. This wrapper - * method is provided so that it can be exported in a COM, etc. - * wrapper. - * - * Results: - * The version. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -uint32 -GuestApp_GetCurrentVersion(void) -{ - return TOOLS_VERSION_CURRENT; -} - - -/* - *---------------------------------------------------------------------- - * * GuestApp_LoadDict -- * * Load the dict file into memory. Assumes the @@ -766,7 +731,7 @@ ASSERT(dict); ASSERT(dict->fileName); - stream = fopen(dict->fileName, "r"); + stream = Posix_Fopen(dict->fileName, "r"); if (stream == NULL) { Debug("Unable to open \"%s\"\n", dict->fileName); @@ -851,7 +816,7 @@ ASSERT(dict); ASSERT(dict->fileName); - stream = fopen(dict->fileName, "w"); + stream = Posix_Fopen(dict->fileName, "w"); if (stream == NULL) { Warning("Unable to open \"%s\"\n", dict->fileName); @@ -888,79 +853,76 @@ * * GuestApp_GetInstallPath -- * - * Get the tools installation path. + * Get the tools installation path. The caller is responsible for + * freeing the memory allocated for the path. * * Results: - * The path. + * The path in UTF-8 if successful. + * NULL otherwise. * * Side effects: - * None. + * Allocates memory. * *---------------------------------------------------------------------- */ -const char * +char * GuestApp_GetInstallPath(void) { -#if defined(N_PLAT_NLM) - return "SYS:\\ETC\\VMWTOOL"; -#elif defined(_WIN32) + char *pathUtf8 = NULL; + +#if defined(_WIN32) LONG rv; HKEY key; DWORD type; DWORD len = MAX_PATH; - static char path[MAX_PATH] = ""; - - if (strcmp(path, "") == 0) { - const char *keyName = "Software\\VMware, Inc.\\VMware Tools"; - - rv = RegOpenKey(HKEY_LOCAL_MACHINE, keyName, &key); - - if (rv != ERROR_SUCCESS) { - Warning("Unable to open key '%s': %s\n", keyName, Msg_ErrString()); - return NULL; - } - rv = RegQueryValueEx(key, "InstallPath", 0, &type, (LPBYTE) path, &len); + size_t posLastChar; + WCHAR path[MAX_PATH] = L""; + size_t pathLen = 0; + const WCHAR *keyName = L"Software\\VMware, Inc.\\VMware Tools"; + + rv = RegOpenKeyW(HKEY_LOCAL_MACHINE, keyName, &key); + if (rv != ERROR_SUCCESS) { + Warning("%s: Unable to open product key: error: %s\n", + __FUNCTION__, Msg_ErrString()); + return NULL; + } - RegCloseKey(key); - if (rv != ERROR_SUCCESS) { - Warning("Unable to retrieve key '%s': %s\n", keyName, Msg_ErrString()); - goto error; - } + rv = RegQueryValueExW(key, L"InstallPath", 0, &type, (LPBYTE)path, &len); + RegCloseKey(key); + if (rv != ERROR_SUCCESS) { + Warning("%s: Unable to retrieve key: error: %s\n", + __FUNCTION__, Msg_ErrString()); + return NULL; } /* * Strip off the trailing backslash. This needs to be done with wchars to * ensure that we don't mess up a path that ends with the 5C character. */ - { - WCHAR pathWide[MAX_PATH]; - size_t posLastChar; - if (!MultiByteToWideChar(CP_ACP, 0, path, -1, pathWide, sizeof pathWide)) { - ASSERT(FALSE); - goto error; - } - - posLastChar = wcslen(pathWide) - 1; - if (pathWide[posLastChar] == L'\\') { - pathWide[posLastChar] = L'\0'; + pathLen = wcslen(path); + if (pathLen > 0) { + posLastChar = pathLen - 1; + if (path[posLastChar] == L'\\') { + path[posLastChar] = L'\0'; } + } - if (!WideCharToMultiByte(CP_ACP, 0, pathWide, -1, - path, sizeof path, NULL, NULL)) { - ASSERT(FALSE); - goto error; - } - return path; + /* Convert to UTF-8 before returning to the outside world. */ + if (!CodeSet_Utf16leToUtf8((const char *)path, + wcslen(path) * sizeof(WCHAR), + &pathUtf8, + NULL)) { + Warning("%s: Unable to convert to UTF-8\n", __FUNCTION__); + return NULL; } - error: - Str_Strcpy(path, "", sizeof path); - return NULL; #else - return "/etc/vmware-tools"; + pathUtf8 = Str_Asprintf(NULL, "%s", GUESTAPP_TOOLS_INSTALL_PATH); #endif + + return pathUtf8; } @@ -971,6 +933,9 @@ * * Get the path to the Tools configuration file. * + * The return conf path is a dynamically allocated UTF-8 encoded + * string that should be freed by the caller. + * * XXX: Unfortunately, much of this function is duplicated in * lib/user/win32util.c because we can't use that file inside guest * code. If we do, we'll break Win95 Tools. @@ -987,75 +952,111 @@ * a non-root user process calls this function, the directory exists. * * Results: - * The path, or NULL on failure. + * The path in UTF-8, or NULL on failure. * * Side effects: - * None. + * Allocates memory. * *---------------------------------------------------------------------- */ -const char * +char * GuestApp_GetConfPath(void) { #if defined(_WIN32) - static char path[MAX_PATH] = ""; + char *pathUtf8 = NULL; + char *appFolderPathUtf8 = NULL; + WCHAR appFolderPath[MAX_PATH] = L""; + size_t pathUtf8Size = 0; + const char *productName; /* * XXX: This is racy. But GuestApp_GetInstallPath is racy too. Clearly * that is a good enough justification. */ - if (strcmp(path, "") == 0) { - if (!pfnSHGetFolderPath) { - HMODULE h = LoadLibrary("shfolder.dll"); - if (h) { - pfnSHGetFolderPath = (PSHGETFOLDERPATH) - GetProcAddress(h, "SHGetFolderPathA"); - } - - /* win32util.c avoids calling FreeLibrary() so we will too. */ + if (!pfnSHGetFolderPath) { + HMODULE h = LoadLibraryW(L"shfolder.dll"); + if (h) { + pfnSHGetFolderPath = (PSHGETFOLDERPATH) + GetProcAddress(h, "SHGetFolderPathW"); } + + /* win32util.c avoids calling FreeLibrary() so we will too. */ + } - /* - * Get the Common Application data folder - create if it doesn't - * exist. - */ - if (!pfnSHGetFolderPath || - FAILED(pfnSHGetFolderPath(NULL, CSIDL_COMMON_APPDATA | - CSIDL_FLAG_CREATE, NULL, 0, path))) { - return NULL; - } - - ASSERT(path[0]); - - /* Check to see if subdirectories exist. */ - Str_Strcat(path, "\\" PRODUCT_GENERIC_NAME, MAX_PATH); - if (!File_Exists(path)) { - if (!CreateDirectory(path, NULL)) { - return NULL; - } - } - - if (!File_IsDirectory(path)) { - return NULL; - } - - Str_Strcat(path, "\\", MAX_PATH); - Str_Strcat(path, ProductState_GetName(), MAX_PATH); - if (!File_Exists(path)) { - if (!CreateDirectory(path, NULL)) { - return NULL; - } + /* + * Get the Common Application data folder - create if it doesn't + * exist. + */ + + if (!pfnSHGetFolderPath || + FAILED(pfnSHGetFolderPath(NULL, CSIDL_COMMON_APPDATA | + CSIDL_FLAG_CREATE, NULL, 0, appFolderPath))) { + return NULL; + } + + ASSERT(appFolderPath[0]); + + if (!CodeSet_Utf16leToUtf8((const char *)appFolderPath, + wcslen(appFolderPath) * sizeof *appFolderPath, + &appFolderPathUtf8, + NULL)) { + return NULL; + } + + productName = ProductState_GetName(); + + /* + * Make sure there's enought space for + * appFolderPath\PRODUCT_GENERIC_NAME\PRODUCT_NAME. + */ + + pathUtf8Size = strlen(appFolderPathUtf8) + 1 + + strlen(PRODUCT_GENERIC_NAME) + 1 + + strlen(productName) + 1; + pathUtf8 = malloc(pathUtf8Size); + if (pathUtf8 == NULL) { + free(appFolderPathUtf8); + goto error; + } + + Str_Strcpy(pathUtf8, appFolderPathUtf8, pathUtf8Size); + free(appFolderPathUtf8); + + /* Check to see if subdirectories exist. */ + Str_Strcat(pathUtf8, "\\" PRODUCT_GENERIC_NAME, pathUtf8Size); + if (!File_Exists(pathUtf8)) { + if (!File_CreateDirectory(pathUtf8)) { + goto error; } - - if (!File_IsDirectory(path)) { - return NULL; + } + + if (!File_IsDirectory(pathUtf8)) { + goto error; + } + + Str_Strcat(pathUtf8, "\\", MAX_PATH); + Str_Strcat(pathUtf8, productName, pathUtf8Size); + if (!File_Exists(pathUtf8)) { + if (!File_CreateDirectory(pathUtf8)) { + goto error; } } - return path; + + if (!File_IsDirectory(pathUtf8)) { + goto error; + } + + return pathUtf8; + +error: + free(pathUtf8); + + return NULL; #else - /* Just call into GuestApp_GetInstallPath. */ + + /* Just call into GuestApp_GetInstallPath. */ return GuestApp_GetInstallPath(); #endif } @@ -1066,7 +1067,8 @@ * * GuestApp_GetLogPath -- * - * Get the path that the Tools should log to. + * Get the path that the Tools should log to. The returned path + * is in UTF-8. * * Results: * Allocates the path or NULL on failure. @@ -1081,23 +1083,34 @@ GuestApp_GetLogPath(void) { #if defined(_WIN32) + char *bufferUtf8 = NULL; + Bool conversionRes; /* We should log to %TEMP%. */ - LPTSTR buffer = NULL; + LPWSTR buffer = NULL; DWORD bufferSize = 0, neededSize; - if ((neededSize = GetEnvironmentVariable("TEMP", buffer, bufferSize)) == 0) { + if ((neededSize = GetEnvironmentVariableW(L"TEMP", buffer, bufferSize)) == 0) { return NULL; } - buffer = malloc(neededSize); + buffer = malloc(neededSize * sizeof *buffer); if (buffer == NULL) { return NULL; } bufferSize = neededSize; - if (GetEnvironmentVariable("TEMP", buffer, bufferSize) != neededSize) { + if (GetEnvironmentVariableW(L"TEMP", buffer, bufferSize) != neededSize) { free(buffer); return NULL; } - return buffer; + + conversionRes = CodeSet_Utf16leToUtf8((const char *)buffer, + wcslen(buffer) * sizeof(WCHAR), + &bufferUtf8, + NULL); + free(buffer); + if (!conversionRes) { + return NULL; + } + return bufferUtf8; #else /* XXX: Is this safe for EVERYONE who isn't Windows? */ return strdup("/var/log"); @@ -1134,12 +1147,7 @@ DynBuf_Init(&db); -#ifndef _WIN32 - stream = popen(cmd, "r"); -#else - stream = _popen(cmd, "r"); -#endif - + stream = Posix_Popen(cmd, "r"); if (stream == NULL) { Debug("Unable to get output of command \"%s\"\n", cmd); @@ -1208,7 +1216,7 @@ */ Bool -GuestApp_IsHgfsCapable() +GuestApp_IsHgfsCapable(void) { return RpcOut_sendOne(NULL, NULL, HGFS_SYNC_REQREP_CLIENT_CMD); } @@ -1217,6 +1225,84 @@ /* *----------------------------------------------------------------------------- * + * GuestApp_IsDiskShrinkCapable -- + * + * Is the host capable of doing disk shrinks? + * + * Results: + * TRUE if the host is capable of disk shrink operations + * FALSE if the host is not capable of disk shrink operations + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +Bool +GuestApp_IsDiskShrinkCapable(void) +{ + return RpcOut_sendOne(NULL, NULL, "disk.wiper.enable"); +} + + +/* + *----------------------------------------------------------------------------- + * + * GuestApp_IsDiskShrinkEnabled -- + * + * Is disk shrinking enabled + * + * Results: + * TRUE if disk shrinking is enabled + * FALSE if disk shrinking is not enabled + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +Bool +GuestApp_IsDiskShrinkEnabled(void) { + char *result; + size_t resultLen; + Bool enabled = FALSE; + if (RpcOut_sendOne(&result, &resultLen, "disk.wiper.enable")) { + if (resultLen == 1 && strcmp(result, "1") == 0) { + enabled = TRUE; + } else { + enabled = FALSE; + } + } + free(result); + return enabled; +} + + +/* + *----------------------------------------------------------------------------- + * + * GuestApp_DiskShrink -- + * + * Shrink disk + * + * Results: + * TRUE if the shrinking is successful + * FALSE if disk shrinking is not successful + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +Bool +GuestApp_DiskShrink(void) { + return RpcOut_sendOne(NULL, NULL, "disk.shrink"); +} + + +/* + *----------------------------------------------------------------------------- + * * GuestApp_GetPos -- * * Retrieve the host notion of the guest pointer location. --hpreg @@ -1611,86 +1697,16 @@ } -/* - *----------------------------------------------------------------------------- - * - * GuestApp_RpcSendOneUtf8 -- - * - * Wrapper for RpcOut_SendOneRaw. Sends a single RPCI command with a single string - * argument. The argument will be UTF-8 encoded and sent safely over the backdoor. - * This used instead of RpcOut_SendOne because that function uses Str_Asprintf - * which uses FormatMessage. FormatMessage would interpret the utf8 encoded arg - * as being in the current locale and corrupts the string. This is used for - * commands which pass file paths over the backdoor. - * - * Results: - * TRUE on success. - * FALSE on error. - * - * Side effects: - * None. - * - *----------------------------------------------------------------------------- - */ - -Bool -GuestApp_RpcSendOneUtf8(char const *cmd, // IN: RPCI command - char const *arg, // IN: string arg to be Utf8 encoded - size_t argSize) // IN: size of arg -{ - char *utf8Name; - size_t utf8NameSize; - char *rpcMessage; - size_t messageSize; - - ASSERT(cmd); - ASSERT(arg); - - if (!CodeSet_CurrentToUtf8(arg, argSize, - &utf8Name, &utf8NameSize)) { - Debug("GuestApp_RpcSendOneUtf8: error failed to convert arg to utf8\n"); - return FALSE; - } - - messageSize = strlen(cmd) + 1 + utf8NameSize + 1; - rpcMessage = (char *)malloc(messageSize); - if (!rpcMessage) { - Debug("GuestApp_RpcSendOneUtf8: Error, out of memory\n"); - free(utf8Name); - return FALSE; - } - - Str_Strcpy(rpcMessage, cmd, messageSize); - Str_Strcat(rpcMessage, " ", messageSize); - Str_Strcat(rpcMessage, utf8Name, messageSize); - free(utf8Name); - - Debug("GuestApp_RpcSendOneUtf8: about to send rpc message = *%s*, len = %"FMTSZ"d\n", - rpcMessage, messageSize); - if (!RpcOut_SendOneRaw(rpcMessage, messageSize, NULL, NULL)) { - Debug("GuestApp_RpcSendOneUtf8: Failed to send message to host\n"); - free(rpcMessage); - return FALSE; - } else { - Debug("GuestApp_RpcSendOneUtf8: sent rpc message"); - } - - free(rpcMessage); - return TRUE; -} - - #if !defined(N_PLAT_NLM) /* *---------------------------------------------------------------------------- * - * GuestApp_RpcSendOneUtf8CPName -- + * GuestApp_RpcSendOneArgCPName -- * - * Wrapper for GuestApp_RpcSendOneCPName to enable both UTF-8 and CPName - * conversions. Sends a single RPCI command with arg UTF-8 encoded and - * cpNameArg both UTF-8 and CPName encoded. + * Wrapper for GuestApp_RpcSendOneCPName with an extra argument. Sends a + * single RPCI command with arg and cpNameArg both in UTF-8 encodeding. * - * The UTF-8 encoded string is optional so that one can send a single UTF-8 + * The UTF-8 encoded arg is optional so that one can send a single UTF-8 * and CPName encoded string using this function. * * Note that the UTF-8 string always preceeds the UTF-8 & CPName string in @@ -1707,75 +1723,43 @@ */ Bool -GuestApp_RpcSendOneUtf8CPName(char const *cmd, // IN: RPCI command - char const *arg, // IN: to UTF8 encode - size_t argSize, // IN: size of arg - char delimiter, // IN: arg/cpNameArg delim. - char const *cpNameArg, // IN: to UTF8/CPName encode - size_t cpNameArgSize) // IN: size of cpNameArg +GuestApp_RpcSendOneArgCPName(char const *cmd, // IN: RPCI command + char const *arg, // IN: UTF-8 encoded string + size_t argSize, // IN: size of arg + char delimiter, // IN: arg/cpNameArg delim. + char const *cpNameArg, // IN: UTF-8 encoded CPName + size_t cpNameArgSize) // IN: size of cpNameArg { - size_t utf8cpNameArgSize; - char *utf8cpNameArg; Bool ret = FALSE; ASSERT(cmd); ASSERT(cpNameArg); - /* UTF-8 encode cpNameArg */ Debug("GuestApp_RpcSendOneUtf8CPName: cpNameArg=\"%s\" (%"FMTSZ"u)\n", CPName_Print(cpNameArg, cpNameArgSize), cpNameArgSize); - if (!CodeSet_CurrentToUtf8(cpNameArg, cpNameArgSize, - &utf8cpNameArg, &utf8cpNameArgSize)) { - Debug("GuestApp_RpcSendOneUtf8CPName: error failed to convert arg to utf8\n"); - return FALSE; - } - - Debug("GuestApp_RpcSendOneUtf8CPName: utf8cpNameArg=\"%s\", len=%"FMTSZ"d\n", - CPName_Print(utf8cpNameArg, utf8cpNameArgSize), utf8cpNameArgSize); - - /* UTF-8 encode arg if provided */ if (arg) { char *rpcMessage; - size_t messageSize; - char *utf8Arg; - size_t utf8ArgSize = 0; Debug("GuestApp_RpcSendOneUtf8CPName: arg=\"%s\"\n", arg); - if (!CodeSet_CurrentToUtf8(arg, argSize, &utf8Arg, &utf8ArgSize)) { - Debug("GuestApp_RpcSendOneUtf8CPName: error failed to convert arg to utf8\n"); - goto abort; - } - - Debug("GuestApp_RpcSendOneUtf8CPName: utf8Arg=\"%s\", len=%"FMTSZ"d\n", - utf8Arg, utf8ArgSize); - - /* Merge command and UTF-8 encoded string */ - messageSize = strlen(cmd) + 1 + utf8ArgSize + 1; - rpcMessage = (char *)malloc(messageSize); + /* Merge command and argument */ + rpcMessage = Str_Asprintf(NULL, "%s %s", cmd, arg); if (!rpcMessage) { Debug("GuestApp_RpcSendOneUtf8CPName: Error, out of memory\n"); - free(utf8Arg); goto abort; } - Str_Strcpy(rpcMessage, cmd, messageSize); - Str_Strcat(rpcMessage, " ", messageSize); - Str_Strcat(rpcMessage, utf8Arg, messageSize); - free(utf8Arg); - ret = GuestApp_RpcSendOneCPName(rpcMessage, delimiter, - utf8cpNameArg, utf8cpNameArgSize); + cpNameArg, cpNameArgSize); free(rpcMessage); } else { ret = GuestApp_RpcSendOneCPName(cmd, delimiter, - utf8cpNameArg, utf8cpNameArgSize); + cpNameArg, cpNameArgSize); } abort: - free(utf8cpNameArg); return ret; } @@ -1863,6 +1847,34 @@ } #endif + +/* + *----------------------------------------------------------------------------- + * + * GuestApp_ControlRecord -- + * + * Start or stop recording process, flagged by command. + * Command definition is in statelogger_backdoor_def.h. + * + * Results: + * TRUE on success and FALSE on failure. + * + * Side effects: + * Host VMware product starts or stops recording this vm. + * + *----------------------------------------------------------------------------- + */ + +Bool +GuestApp_ControlRecord(int32 command) // IN: flag of starting or stopping recording +{ + Backdoor_proto bp; + bp.in.size = command; + bp.in.cx.halfs.low = BDOOR_CMD_STATELOGGER; + Backdoor(&bp); + return (bp.out.ax.halfs.low == 1); +} + #ifdef __cplusplus } #endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/guestApp/guestAppPosix.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/guestApp/guestAppPosix.c --- open-vm-tools-2008.01.23-74039/lib/guestApp/guestAppPosix.c 2008-01-28 08:02:50.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/guestApp/guestAppPosix.c 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -35,13 +35,15 @@ #include "guestApp.h" #include "str.h" -#include "escape.h" #include "vm_assert.h" +#include "guestAppPosixInt.h" -static char *gBrowserEscaped = NULL; // a shell escaped browser path -static Bool gBrowserIsNewNetscape = FALSE; - -void GuestAppDetectBrowser(void); +/* + * This variable is passed along to g_spawn_sync when launching (for example) + * a web browser. If NULL, the child will inherit the parent's environment. + * Users may set it with GuestApp_SetSpawnEnviron. + */ +const char **guestAppSpawnEnviron = NULL; /* @@ -64,115 +66,11 @@ GuestApp_OpenUrl(const char *url, // IN Bool maximize) // IN: open the browser maximized? Ignored for now. { - char *buf = NULL; - char *urlEscaped = NULL; - Bool success = FALSE; - int ret; - - ASSERT(url); - - if (!gBrowserEscaped) { - GuestAppDetectBrowser(); - } - - if (!gBrowserEscaped) { - goto abort; - } - urlEscaped = (char*)Escape_Sh(url, strlen(url), NULL); - if (!urlEscaped) { - goto abort; - } - - if (gBrowserIsNewNetscape) { - buf = Str_Asprintf(NULL, - "%s -remote 'openURL('%s', new-window)' >/dev/null 2>&1 &", - gBrowserEscaped, urlEscaped); - } else { - buf = Str_Asprintf(NULL, "%s %s >/dev/null 2>&1 &", gBrowserEscaped, urlEscaped); - } - - if (buf == NULL) { - goto abort; - } - - ret = system(buf); - - /* - * If the program terminated other than by exit() or return, i.e., was - * hit by a signal, or if the exit status indicates something other - * than success, then the URL wasn't opened and we should indicate - * failure. - */ - if (!WIFEXITED(ret) || (WEXITSTATUS(ret) != 0)) { - goto abort; - } - - success = TRUE; - abort: - free(buf); - free(urlEscaped); - - return success; -} - - -/* - *---------------------------------------------------------------------- - * - * GuestAppDetectBrowser -- - * - * Figure out what browser to use, and note if it is a new Netscape. - * Copied from apps/vmuiLinux/app.cc - * - * Results: - * None. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -void -GuestAppDetectBrowser(void) -{ - char *buf; - - if (gBrowserEscaped) { - free(gBrowserEscaped); - gBrowserEscaped = NULL; - gBrowserIsNewNetscape = FALSE; - } - - if (getenv("GNOME_DESKTOP_SESSION_ID") != NULL && - GuestApp_FindProgram("gnome-open")) { - buf = "gnome-open"; - } else if (getenv("KDE_FULL_SESSION") != NULL && - !strcmp(getenv("KDE_FULL_SESSION"), "true") && - GuestApp_FindProgram("konqueror")) { - buf = "konqueror"; - } else if (GuestApp_FindProgram("mozilla-firefox")) { - buf = "mozilla-firefox"; - } else if (GuestApp_FindProgram("firefox")) { - buf = "firefox"; - } else if (GuestApp_FindProgram("mozilla")) { - buf = "mozilla"; - } else if (GuestApp_FindProgram("netscape")) { - buf = "netscape"; - } else { - return; - } - - /* - * netscape >= 6.2 has a bug, in that if we try to reuse an existing - * window, and fail, it will return a success code. We have to test for this - * eventuality, so we can handle it better. - */ - if (!strcmp(buf, "netscape")) { - gBrowserIsNewNetscape = - (system("netscape -remote 'openURL(file:/some/bad/path.htm, new-window'") == 0); - } - gBrowserEscaped = (char *)Escape_Sh(buf, strlen(buf), NULL); +#ifdef GUESTAPP_HAS_X11 + return GuestAppX11OpenUrl(url, maximize); +#else + return FALSE; +#endif } @@ -193,7 +91,7 @@ */ Bool -GuestApp_FindProgram(const char *program) +GuestApp_FindProgram(const char *program) // IN: Wanted program name { const char *path = getenv("PATH"); char *p; @@ -220,6 +118,32 @@ return FALSE; } + +/* + *----------------------------------------------------------------------------- + * + * GuestApp_SetSpawnEnviron -- + * + * Records a separate environment used when spawning applications. + * + * Results: + * guestAppSpawnEnviron will point to caller's argument. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +void +GuestApp_SetSpawnEnviron(const char **spawnEnviron) + // IN; Environment used when spawning. (Does not involve + // Barry White, candlelight, etc.) +{ + guestAppSpawnEnviron = spawnEnviron; +} + + #ifdef __cplusplus } #endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/guestApp/guestAppPosixInt.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/guestApp/guestAppPosixInt.h --- open-vm-tools-2008.01.23-74039/lib/guestApp/guestAppPosixInt.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/guestApp/guestAppPosixInt.h 2008-10-13 08:01:50.000000000 +0100 @@ -0,0 +1,51 @@ +/********************************************************* + * Copyright (C) 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. + * + *********************************************************/ + +/* + * guestAppPosixInt.h -- + * + * Declarations specific to the POSIX flavor of lib/guestapp. + */ + +#ifndef _GUESTAPPPOSIXINT_H_ +#define _GUESTAPPPOSIXINT_H_ + +#define INCLUDE_ALLOW_USERLEVEL +#define INCLUDE_ALLOW_DISTRIBUTE +#include "includeCheck.h" + +#include "vmware.h" + + +/* + * Environment used when launching applications. + */ +extern const char **guestAppSpawnEnviron; + + +/* + * Global functions + */ + +#ifdef GUESTAPP_HAS_X11 +extern Bool GuestAppX11OpenUrl(const char *url, Bool maximize); +#endif + + + +#endif // ifndef _GUESTAPPPOSIXINT_H_ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/guestApp/guestAppPosixX11.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/guestApp/guestAppPosixX11.c --- open-vm-tools-2008.01.23-74039/lib/guestApp/guestAppPosixX11.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/guestApp/guestAppPosixX11.c 2008-10-13 08:01:50.000000000 +0100 @@ -0,0 +1,351 @@ +/********************************************************* + * Copyright (C) 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. + * + *********************************************************/ + + +/* + * guestAppPosixX11.c -- + * + * X11-support functions for guestAppPosix.c. These sources maintained + * separately only to avoid forcing X11 library dependencies where they're + * not needed. + */ + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +#include +#include // for free, system +#include +#include + +#include + +#include +#undef Bool + +#include "guestApp.h" +#include "guestAppPosixInt.h" +#include "str.h" +#include "escape.h" +#include "util.h" +#include "vm_assert.h" +#include "system.h" +#include "debug.h" + +static const char *gBrowser = NULL; // browser path +static Bool gBrowserIsNewNetscape = FALSE; +static XErrorHandler gDefaultXErrorHandler; + +static void GuestAppDetectBrowser(void); +static Bool GuestAppFindX11Client(const char *clientName); +static int GuestAppXErrorHandler(Display *display, XErrorEvent *error_event); + + +/* + *----------------------------------------------------------------------------- + * + * GuestAppX11OpenUrl -- + * + * Open a web browser on the URL. Copied from apps/vmuiLinux/app.cc + * + * Results: + * TRUE on success, FALSE on otherwise + * + * Side effects: + * Spawns off another process which runs a web browser. + * + *----------------------------------------------------------------------------- + */ + +Bool +GuestAppX11OpenUrl(const char *url, // IN + Bool maximize) // IN: open the browser maximized? Ignored for now. +{ + gboolean spawnSuccess; + GError *gerror; + + char *argv[4]; + char *newNetscapeBuf = NULL; + Bool success = FALSE; + int ret; + + ASSERT(url); + + if (!gBrowser) { + GuestAppDetectBrowser(); + } + + if (!gBrowser) { + goto abort; + } + + if (gBrowserIsNewNetscape) { + /* + * Per RFC 2616 §3.2.1, HTTP places no bound on URIs. (Besides, this url + * could really be -any- URI.) I.e., that's why I'm eating the cost of + * allocating memory instead of playing with a static buffer. + */ + newNetscapeBuf = Str_Asprintf(NULL, "openURL('%s', new-window)", url); + if (!newNetscapeBuf) { + goto abort; + } + argv[0] = (char *)gBrowser; + argv[1] = "-remote"; + argv[2] = newNetscapeBuf; + argv[3] = NULL; + } else { + argv[0] = (char *)gBrowser; + argv[1] = (char *)url; + argv[2] = NULL; + } + + spawnSuccess = g_spawn_sync(NULL, // inherit working directory + argv, + /* + * XXX Please don't hate me for casting off the + * qualifier here. Glib does -not- modify the + * environment, at least not in the parent process, + * but their prototype does not specify this argument + * as being const. + */ + (char **)guestAppSpawnEnviron, + G_SPAWN_SEARCH_PATH + | G_SPAWN_STDOUT_TO_DEV_NULL + | G_SPAWN_STDERR_TO_DEV_NULL, + NULL, // no child setup routine + NULL, // param for child setup routine + NULL, // container for stdout + NULL, // container for stderr + &ret, // waitpid-style value + &gerror); // GSpawnError + + if (!spawnSuccess) { + Debug("%s: Unable to launch browser '%s': %d: %s\n", __func__, gBrowser, + gerror->code, gerror->message); + g_error_free(gerror); + goto abort; + } + + /* + * If the program terminated other than by exit() or return, i.e., was + * hit by a signal, or if the exit status indicates something other + * than success, then the URL wasn't opened and we should indicate + * failure. + */ + if (!WIFEXITED(ret) || (WEXITSTATUS(ret) != 0)) { + goto abort; + } + + success = TRUE; + +abort: + free(newNetscapeBuf); + return success; +} + + +/* + *---------------------------------------------------------------------- + * + * GuestAppDetectBrowser -- + * + * Figure out what browser to use, and note if it is a new Netscape. + * Copied from apps/vmuiLinux/app.cc + * + * Results: + * None. + * + * Side effects: + * This routine is not thread-safe. + * + *---------------------------------------------------------------------- + */ + +void +GuestAppDetectBrowser(void) +{ + const char *buf = NULL; + + if (gBrowser) { + gBrowser = NULL; + gBrowserIsNewNetscape = FALSE; + } + + /* + * XXX Since splitting guestd and vmware-user, vmware-user may be launched + * by a -display- manager rather than a session manager, rendering exclusive + * tests for "GNOME_DESKTOP_SESSION_ID" or "KDE_FULL_SESSION" environment + * variables insufficient. + * + * The workaround (*cough*hack*cough*) for the GNOME case is to additionally + * query the root X11 window, and testing for the existence of a "gnome-session" + * window. (The assumption is that if gnome-session is attached to our X11 + * display, the user really is running a GNOME session.) For KDE, we look for + * "ksmserver". + * + * XXX Pull this out s.t. we need only traverse the list of clients once. + * XXX Added gnome-panel, startkde as they were previously in xautostart.conf. + * On my Ubuntu VM, gnome-session is really started via a symlink of + * /usr/bin/x-session-manager -> /etc/alternatives/x-session-manager -> + * /usr/bin/gnome-session. Gnome-session never sets its window title + * string, which I assumed it did, and as a result shows up as a client + * named "x-session-manager". In this case, I'm falling back and + * using existence of "gnome-panel" as a safe bet that the user is + * in a GNOME session. + * XXX This code should be destroyed. + */ + if ((getenv("GNOME_DESKTOP_SESSION_ID") != NULL || + GuestAppFindX11Client("gnome-session") || + GuestAppFindX11Client("gnome-panel")) && + GuestApp_FindProgram("gnome-open")) { + buf = "gnome-open"; + } else if (((getenv("KDE_FULL_SESSION") != NULL && + !strcmp(getenv("KDE_FULL_SESSION"), "true")) || + GuestAppFindX11Client("ksmserver") || + GuestAppFindX11Client("startkde")) && + GuestApp_FindProgram("konqueror")) { + buf = "konqueror"; + } else if (GuestApp_FindProgram("mozilla-firefox")) { + buf = "mozilla-firefox"; + } else if (GuestApp_FindProgram("firefox")) { + buf = "firefox"; + } else if (GuestApp_FindProgram("mozilla")) { + buf = "mozilla"; + } else if (GuestApp_FindProgram("netscape")) { + buf = "netscape"; + } else { + return; + } + + /* + * netscape >= 6.2 has a bug, in that if we try to reuse an existing + * window, and fail, it will return a success code. We have to test for this + * eventuality, so we can handle it better. + */ + if (!strcmp(buf, "netscape")) { + gBrowserIsNewNetscape = + (system("netscape -remote 'openURL(file:/some/bad/path.htm, new-window'") == 0); + } + gBrowser = buf; +} + + +/* + *----------------------------------------------------------------------------- + * + * GuestAppFindX11Client -- + * + * Searches for a top-level window names by clientName. + * + * Results: + * TRUE if such a window was found, FALSE otherwise. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static Bool +GuestAppFindX11Client(const char *clientName) // IN: window title to search for +{ + Display *display; + Window rootWindow; + Window temp1; // throwaway + Window temp2; // throwaway + Window *children = NULL; + unsigned int nchildren; + unsigned int i; + Bool found = FALSE; + + if ((display = XOpenDisplay(NULL)) == NULL) { + return FALSE; + } + + rootWindow = DefaultRootWindow(display); + /* + * I want to fall back to the original error handler for all but the BadWindow + * case. Unfortunately I can't just pass that along, so I need to record the + * original handler via a global variable. + */ + gDefaultXErrorHandler = XSetErrorHandler(GuestAppXErrorHandler); + + if (XQueryTree(display, rootWindow, &temp1, &temp2, &children, &nchildren) == 0) { + goto out; + } + + for (i = 0; (i < nchildren) && !found; i++) { + char *name = NULL; + if ((XFetchName(display, children[i], &name) == 0) || + name == NULL) { + continue; + } + if (strcmp(name, clientName) == 0) { + found = TRUE; + } + XFree(name); + } + +out: + XFree(children); + XSetErrorHandler(gDefaultXErrorHandler); + XCloseDisplay(display); + + return found; +} + + +/* + *----------------------------------------------------------------------------- + * + * GuestAppXErrorHandler -- + * + * Silently ignores BadWindow errors, and passes all others back to the + * default error handler for further processing. + * + * Results: + * Always zero. (Per Xlib, the return value is always ignored.) + * + * Side effects: + * None, except those caused by the default error handler (e.g., killing + * the client). + * + *----------------------------------------------------------------------------- + */ + +static int +GuestAppXErrorHandler(Display *display, + // IN: X11 display on which error occurred + XErrorEvent *error_event) + // IN: error received from X11 server +{ + /* Handoff to the default handler for everything but BadWindow. */ + if ((error_event->error_code != BadWindow) && + gDefaultXErrorHandler) { + gDefaultXErrorHandler(display, error_event); + } + + return 0; +} + +#ifdef __cplusplus +} +#endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/guestApp/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/guestApp/Makefile.am --- open-vm-tools-2008.01.23-74039/lib/guestApp/Makefile.am 2008-01-28 08:02:49.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/guestApp/Makefile.am 2008-10-13 08:01:47.000000000 +0100 @@ -15,11 +15,21 @@ ### Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ + +# We build this library in two flavors: with X11 and without X11. This is +# because the X11 code supports only GuestApp_OpenUrl, and we'd like to not +# force an X11 dependency on applications that don't need one (e.g., guestd). + noinst_LIBRARIES = libGuestApp.a libGuestApp_a_SOURCES = libGuestApp_a_SOURCES += guestApp.c libGuestApp_a_SOURCES += guestAppPosix.c -AM_CFLAGS = -AM_CFLAGS += @COMMON_CFLAGS@ +if HAVE_X11 +noinst_LIBRARIES += libGuestAppX11.a +libGuestAppX11_a_SOURCES = $(libGuestApp_a_SOURCES) +libGuestAppX11_a_SOURCES += guestAppPosixX11.c +libGuestAppX11_a_CPPFLAGS = -DGUESTAPP_HAS_X11 +libGuestAppX11_a_CPPFLAGS += @GTK_CPPFLAGS@ +endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/guestApp/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/guestApp/Makefile.in --- open-vm-tools-2008.01.23-74039/lib/guestApp/Makefile.in 2008-01-28 08:03:03.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/guestApp/Makefile.in 2008-10-13 08:02:13.000000000 +0100 @@ -31,6 +31,10 @@ ### Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ +# We build this library in two flavors: with X11 and without X11. This is +# because the X11 code supports only GuestApp_OpenUrl, and we'd like to not +# force an X11 dependency on applications that don't need one (e.g., guestd). + VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ @@ -49,10 +53,14 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ +@HAVE_X11_TRUE@am__append_1 = libGuestAppX11.a subdir = lib/guestApp DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +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)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -63,8 +71,17 @@ libGuestApp_a_LIBADD = am_libGuestApp_a_OBJECTS = guestApp.$(OBJEXT) guestAppPosix.$(OBJEXT) libGuestApp_a_OBJECTS = $(am_libGuestApp_a_OBJECTS) +libGuestAppX11_a_AR = $(AR) $(ARFLAGS) +libGuestAppX11_a_LIBADD = +am__libGuestAppX11_a_SOURCES_DIST = guestApp.c guestAppPosix.c \ + guestAppPosixX11.c +am__objects_1 = libGuestAppX11_a-guestApp.$(OBJEXT) \ + libGuestAppX11_a-guestAppPosix.$(OBJEXT) +@HAVE_X11_TRUE@am_libGuestAppX11_a_OBJECTS = $(am__objects_1) \ +@HAVE_X11_TRUE@ libGuestAppX11_a-guestAppPosixX11.$(OBJEXT) +libGuestAppX11_a_OBJECTS = $(am_libGuestAppX11_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp +depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -75,8 +92,9 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ -SOURCES = $(libGuestApp_a_SOURCES) -DIST_SOURCES = $(libGuestApp_a_SOURCES) +SOURCES = $(libGuestApp_a_SOURCES) $(libGuestAppX11_a_SOURCES) +DIST_SOURCES = $(libGuestApp_a_SOURCES) \ + $(am__libGuestAppX11_a_SOURCES_DIST) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -90,8 +108,6 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -COMMON_CFLAGS = @COMMON_CFLAGS@ -COMMON_PROG_CFLAGS = @COMMON_PROG_CFLAGS@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -102,45 +118,57 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ -ECHO = @ECHO@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GREP = @GREP@ -GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_AUTH_CFLAGS = @LIB_AUTH_CFLAGS@ -LIB_FILE_CFLAGS = @LIB_FILE_CFLAGS@ -LIB_HGFS_SERVER_CFLAGS = @LIB_HGFS_SERVER_CFLAGS@ -LIB_IMPERSONATE_CFLAGS = @LIB_IMPERSONATE_CFLAGS@ -LIB_MISC_CFLAGS = @LIB_MISC_CFLAGS@ -LIB_PROC_MGR_CFLAGS = @LIB_PROC_MGR_CFLAGS@ -LIB_STRING_CFLAGS = @LIB_STRING_CFLAGS@ -LIB_USER_CFLAGS = @LIB_USER_CFLAGS@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -148,27 +176,35 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ VERSION = @VERSION@ -VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -199,6 +235,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -213,9 +250,12 @@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -noinst_LIBRARIES = libGuestApp.a +noinst_LIBRARIES = libGuestApp.a $(am__append_1) libGuestApp_a_SOURCES = guestApp.c guestAppPosix.c -AM_CFLAGS = @COMMON_CFLAGS@ +@HAVE_X11_TRUE@libGuestAppX11_a_SOURCES = $(libGuestApp_a_SOURCES) \ +@HAVE_X11_TRUE@ guestAppPosixX11.c +@HAVE_X11_TRUE@libGuestAppX11_a_CPPFLAGS = -DGUESTAPP_HAS_X11 \ +@HAVE_X11_TRUE@ @GTK_CPPFLAGS@ $(am__empty) all: all-am .SUFFIXES: @@ -256,6 +296,10 @@ -rm -f libGuestApp.a $(libGuestApp_a_AR) libGuestApp.a $(libGuestApp_a_OBJECTS) $(libGuestApp_a_LIBADD) $(RANLIB) libGuestApp.a +libGuestAppX11.a: $(libGuestAppX11_a_OBJECTS) $(libGuestAppX11_a_DEPENDENCIES) + -rm -f libGuestAppX11.a + $(libGuestAppX11_a_AR) libGuestAppX11.a $(libGuestAppX11_a_OBJECTS) $(libGuestAppX11_a_LIBADD) + $(RANLIB) libGuestAppX11.a mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -265,6 +309,9 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/guestApp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/guestAppPosix.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libGuestAppX11_a-guestApp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libGuestAppX11_a-guestAppPosix.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libGuestAppX11_a-guestAppPosixX11.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -287,6 +334,48 @@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< +libGuestAppX11_a-guestApp.o: guestApp.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libGuestAppX11_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libGuestAppX11_a-guestApp.o -MD -MP -MF $(DEPDIR)/libGuestAppX11_a-guestApp.Tpo -c -o libGuestAppX11_a-guestApp.o `test -f 'guestApp.c' || echo '$(srcdir)/'`guestApp.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libGuestAppX11_a-guestApp.Tpo $(DEPDIR)/libGuestAppX11_a-guestApp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='guestApp.c' object='libGuestAppX11_a-guestApp.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libGuestAppX11_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libGuestAppX11_a-guestApp.o `test -f 'guestApp.c' || echo '$(srcdir)/'`guestApp.c + +libGuestAppX11_a-guestApp.obj: guestApp.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libGuestAppX11_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libGuestAppX11_a-guestApp.obj -MD -MP -MF $(DEPDIR)/libGuestAppX11_a-guestApp.Tpo -c -o libGuestAppX11_a-guestApp.obj `if test -f 'guestApp.c'; then $(CYGPATH_W) 'guestApp.c'; else $(CYGPATH_W) '$(srcdir)/guestApp.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libGuestAppX11_a-guestApp.Tpo $(DEPDIR)/libGuestAppX11_a-guestApp.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='guestApp.c' object='libGuestAppX11_a-guestApp.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libGuestAppX11_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libGuestAppX11_a-guestApp.obj `if test -f 'guestApp.c'; then $(CYGPATH_W) 'guestApp.c'; else $(CYGPATH_W) '$(srcdir)/guestApp.c'; fi` + +libGuestAppX11_a-guestAppPosix.o: guestAppPosix.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libGuestAppX11_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libGuestAppX11_a-guestAppPosix.o -MD -MP -MF $(DEPDIR)/libGuestAppX11_a-guestAppPosix.Tpo -c -o libGuestAppX11_a-guestAppPosix.o `test -f 'guestAppPosix.c' || echo '$(srcdir)/'`guestAppPosix.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libGuestAppX11_a-guestAppPosix.Tpo $(DEPDIR)/libGuestAppX11_a-guestAppPosix.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='guestAppPosix.c' object='libGuestAppX11_a-guestAppPosix.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libGuestAppX11_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libGuestAppX11_a-guestAppPosix.o `test -f 'guestAppPosix.c' || echo '$(srcdir)/'`guestAppPosix.c + +libGuestAppX11_a-guestAppPosix.obj: guestAppPosix.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libGuestAppX11_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libGuestAppX11_a-guestAppPosix.obj -MD -MP -MF $(DEPDIR)/libGuestAppX11_a-guestAppPosix.Tpo -c -o libGuestAppX11_a-guestAppPosix.obj `if test -f 'guestAppPosix.c'; then $(CYGPATH_W) 'guestAppPosix.c'; else $(CYGPATH_W) '$(srcdir)/guestAppPosix.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libGuestAppX11_a-guestAppPosix.Tpo $(DEPDIR)/libGuestAppX11_a-guestAppPosix.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='guestAppPosix.c' object='libGuestAppX11_a-guestAppPosix.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libGuestAppX11_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libGuestAppX11_a-guestAppPosix.obj `if test -f 'guestAppPosix.c'; then $(CYGPATH_W) 'guestAppPosix.c'; else $(CYGPATH_W) '$(srcdir)/guestAppPosix.c'; fi` + +libGuestAppX11_a-guestAppPosixX11.o: guestAppPosixX11.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libGuestAppX11_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libGuestAppX11_a-guestAppPosixX11.o -MD -MP -MF $(DEPDIR)/libGuestAppX11_a-guestAppPosixX11.Tpo -c -o libGuestAppX11_a-guestAppPosixX11.o `test -f 'guestAppPosixX11.c' || echo '$(srcdir)/'`guestAppPosixX11.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libGuestAppX11_a-guestAppPosixX11.Tpo $(DEPDIR)/libGuestAppX11_a-guestAppPosixX11.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='guestAppPosixX11.c' object='libGuestAppX11_a-guestAppPosixX11.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libGuestAppX11_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libGuestAppX11_a-guestAppPosixX11.o `test -f 'guestAppPosixX11.c' || echo '$(srcdir)/'`guestAppPosixX11.c + +libGuestAppX11_a-guestAppPosixX11.obj: guestAppPosixX11.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libGuestAppX11_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libGuestAppX11_a-guestAppPosixX11.obj -MD -MP -MF $(DEPDIR)/libGuestAppX11_a-guestAppPosixX11.Tpo -c -o libGuestAppX11_a-guestAppPosixX11.obj `if test -f 'guestAppPosixX11.c'; then $(CYGPATH_W) 'guestAppPosixX11.c'; else $(CYGPATH_W) '$(srcdir)/guestAppPosixX11.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/libGuestAppX11_a-guestAppPosixX11.Tpo $(DEPDIR)/libGuestAppX11_a-guestAppPosixX11.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='guestAppPosixX11.c' object='libGuestAppX11_a-guestAppPosixX11.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libGuestAppX11_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libGuestAppX11_a-guestAppPosixX11.obj `if test -f 'guestAppPosixX11.c'; then $(CYGPATH_W) 'guestAppPosixX11.c'; else $(CYGPATH_W) '$(srcdir)/guestAppPosixX11.c'; fi` + mostlyclean-libtool: -rm -f *.lo diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/guestInfo/guestInfo.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/guestInfo/guestInfo.c --- open-vm-tools-2008.01.23-74039/lib/guestInfo/guestInfo.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/guestInfo/guestInfo.c 2008-10-13 08:01:50.000000000 +0100 @@ -0,0 +1,397 @@ +/********************************************************* + * Copyright (C) 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. + * + *********************************************************/ + +/* + * guestInfo.c --- + * + * Provides interface to information about the guest, such as hostname, + * NIC/IP address information, etc. + */ + +#include +#include + +#include "vm_assert.h" +#include "debug.h" +#include "guestInfoInt.h" +#include "str.h" +#include "wiper.h" +#include "xdrutil.h" + + +/* + * Global functions + */ + + +/* + *----------------------------------------------------------------------------- + * + * GuestInfo_GetAvailableDiskSpace -- + * + * Get the amount of disk space available on the volume the FCP (file copy/ + * paste) staging area is in. DnD and FCP use same staging area in guest. + * But it is only called in host->guest FCP case. DnD checks guest available + * disk space in host side (UI). + * + * Results: + * Available disk space size if succeed, otherwise 0. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +uint64 +GuestInfo_GetAvailableDiskSpace(char *pathName) +{ + WiperPartition p; + uint64 freeBytes = 0; + uint64 totalBytes = 0; + char *wiperError; + + if (strlen(pathName) > sizeof p.mountPoint) { + Debug("GetAvailableDiskSpace: gFileRoot path too long\n"); + return 0; + } + Str_Strcpy((char *)p.mountPoint, pathName, sizeof p.mountPoint); + wiperError = (char *)WiperSinglePartition_GetSpace(&p, &freeBytes, &totalBytes); + if (strlen(wiperError) > 0) { + Debug("GetAvailableDiskSpace: error using wiper lib: %s\n", wiperError); + return 0; + } + Debug("GetAvailableDiskSpace: free bytes is %"FMT64"u\n", freeBytes); + return freeBytes; +} + + + +/* + *----------------------------------------------------------------------------- + * + * GuestInfo_GetFqdn -- + * + * Returns the guest's hostname. + * + * Results: + * Returns TRUE on success, FALSE on failure. + * Returns the guest's fully qualified domain name in fqdn. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +Bool +GuestInfo_GetFqdn(int outBufLen, // IN: sizeof fqdn + char fqdn[]) // OUT: buffer to store hostname +{ + return GuestInfoGetFqdn(outBufLen, fqdn); +} + + +/* + *----------------------------------------------------------------------------- + * + * GuestInfo_GetNicInfo -- + * + * Returns the guest's hostname. + * + * Results: + * Return MAC addresses of all the NICs in the guest and their + * corresponding IP addresses. + * + * Returns TRUE on success and FALSE on failure. + * Return MAC addresses of all NICs and their corresponding IPs. + * + * Side effects: + * Memory is allocated for each NIC, as well as IP addresses of all NICs + * on successful return. + * + *----------------------------------------------------------------------------- + */ + +Bool +GuestInfo_GetNicInfo(GuestNicList *nicInfo) // OUT: storage for NIC information +{ + return GuestInfoGetNicInfo(nicInfo); +} + + +/* + *---------------------------------------------------------------------- + * + * GuestInfo_GetDiskInfo -- + * + * Get disk information. + * + * Results: + * TRUE if successful, FALSE otherwise. + * + * Side effects: + * Allocates memory for di->partitionList. + * + *---------------------------------------------------------------------- + */ + +Bool +GuestInfo_GetDiskInfo(PGuestDiskInfo di) // IN/OUT +{ + return GuestInfoGetDiskInfo(di); +} + + +/* + *----------------------------------------------------------------------------- + * + * GuestInfoGetOSName -- + * + * Return OS version information. + * + * osFullName format: + * Linux/POSIX: + * + * An example of such string would be: + * Linux 2.4.18-3 Red Hat Linux release 7.3 (Valhalla) + * + * Win32: + * (BUILD ) + * An example of such string would be: + * Windows XP Professional Service Pack 2 (Build 2600) + * + * osName contains an os name in the same format that is used + * in .vmx file. + * + * Results: + * Returns TRUE on success and FALSE on failure. + * Returns the guest's full OS name (osNameFull) + * Returns the guest's OS name in the same format as .vmx file (osName) + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +Bool +GuestInfo_GetOSName(unsigned int outBufFullLen, // IN + unsigned int outBufLen, // IN + char *osNameFull, // OUT + char *osName) // OUT +{ + return GuestInfoGetOSName(outBufFullLen, outBufLen, osNameFull, osName); +} + + +#if defined(N_PLAT_NLM) +/* + *---------------------------------------------------------------------------- + * + * GuestInfo_GetSystemBitness -- + * + * Determines the operating system's bitness. + * + * Return value: + * 32 or 64 on success, negative value on failure. Check errno for more + * details of error. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +int +GuestInfo_GetSystemBitness(void) +{ + return 32; +} +#endif // defined(N_PLAT_NLM) + + +/** + * Add a NIC into the given list. The macAddress of the new GuestNic is + * initialized with the given address. + * + * @param[in,out] nicInfo List of NICs. + * @param[in] macAddress MAC address of new NIC. + * + * @return The new NIC, or NULL on failure. + */ + +GuestNic * +GuestInfoAddNicEntry(GuestNicList *nicInfo, // IN/OUT + const char macAddress[NICINFO_MAC_LEN]) // IN +{ + GuestNic *newNic; + + newNic = XDRUTIL_ARRAYAPPEND(nicInfo, nics, 1); + if (newNic != NULL) { + Str_Strcpy(newNic->macAddress, macAddress, sizeof newNic->macAddress); + } + + return newNic; +} + + +/** + * Add an IP address entry into the GuestNic. + * + * @param[in,out] nic The NIC information. + * @param[in] ipAddr The new IP address to add. + * @param[in] af_type Interface type. + * + * @return Newly allocated IP address struct, NULL on failure. + */ + +VmIpAddress * +GuestInfoAddIpAddress(GuestNic *nic, // IN/OUT + const char *ipAddr, // IN + const uint32 af_type) // IN +{ + VmIpAddress *ip; + + ip = XDRUTIL_ARRAYAPPEND(nic, ips, 1); + if (ip != NULL) { + Str_Strcpy(ip->ipAddress, ipAddr, sizeof ip->ipAddress); + ip->addressFamily = af_type; + } + + return ip; +} + + +/** + * Add an IPV4 subnet mask to the IpAddress in ASCII form. + * + * If convertToMask is true the 'n' bits subnet mask is converted + * to an ASCII string as a hexadecimal number (0xffffff00) and + * added to the IPAddressEntry. If convertToMask is false the value + * is added to the IPAddressEntry in string form - ie '24'. + * + * @param[in,out] ipAddressEntry The IP address info. + * @param[in] subnetMaskBits The mask. + * @param[in] convertToMask See above. + */ + +void +GuestInfoAddSubnetMask(VmIpAddress *ipAddressEntry, // IN/OUT + const uint32 subnetMaskBits, // IN + Bool convertToMask) // IN +{ + int i; + uint32 subnetMask = 0; + + ASSERT(ipAddressEntry); + + if (convertToMask && (subnetMaskBits <= 32)) { + /* + * Convert the subnet mask from a number of bits (ie. '24') to + * hexadecimal notation such 0xffffff00 + */ + for (i = 0; i < subnetMaskBits; i++) { + subnetMask |= (0x80000000 >> i); + } + + // Convert the hexadecimal value to a string and add to the IpAddress Entry + Str_Sprintf(ipAddressEntry->subnetMask, + sizeof ipAddressEntry->subnetMask, + "0x%x", subnetMask); + } else { + Str_Sprintf(ipAddressEntry->subnetMask, + sizeof ipAddressEntry->subnetMask, + "%d", subnetMaskBits); + } + return; +} + + +/** + * Get disk information. + * + * @param[out] di Where to store the disk information. + * + * @return TRUE if successful, FALSE otherwise. + */ + +Bool +GuestInfoGetDiskInfo(PGuestDiskInfo di) +{ + int i = 0; + WiperPartition_List *pl = NULL; + unsigned int partCount = 0; + uint64 freeBytes = 0; + uint64 totalBytes = 0; + WiperPartition nextPartition; + unsigned int partNameSize = 0; + Bool success = FALSE; + + ASSERT(di); + partNameSize = sizeof (di->partitionList)[0].name; + di->numEntries = 0; + di->partitionList = NULL; + + /* Get partition list. */ + pl = WiperPartition_Open(); + if (pl == NULL) { + Debug("GetDiskInfo: ERROR: could not get partition list\n"); + return FALSE; + } + + for (i = 0; i < pl->size; i++) { + nextPartition = pl->partitions[i]; + if (!strlen(nextPartition.comment)) { + PPartitionEntry newPartitionList; + unsigned char *error; + error = WiperSinglePartition_GetSpace(&nextPartition, &freeBytes, &totalBytes); + if (strlen(error)) { + Debug("GetDiskInfo: ERROR: could not get space for partition %s: %s\n", + nextPartition.mountPoint, error); + goto out; + } + + if (strlen(nextPartition.mountPoint) + 1 > partNameSize) { + Debug("GetDiskInfo: ERROR: Partition name buffer too small\n"); + goto out; + } + + newPartitionList = realloc(di->partitionList, + (partCount + 1) * sizeof *di->partitionList); + if (newPartitionList == NULL) { + Debug("GetDiskInfo: ERROR: could not allocate partition list.\n"); + goto out; + } + di->partitionList = newPartitionList; + + Str_Strcpy((di->partitionList)[partCount].name, nextPartition.mountPoint, + partNameSize); + (di->partitionList)[partCount].freeBytes = freeBytes; + (di->partitionList)[partCount].totalBytes = totalBytes; + partCount++; + } + } + + di->numEntries = partCount; + success = TRUE; +out: + WiperPartition_Close(pl); + return success; +} + diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/guestInfo/guestInfoInt.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/guestInfo/guestInfoInt.h --- open-vm-tools-2008.01.23-74039/lib/guestInfo/guestInfoInt.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/guestInfo/guestInfoInt.h 2008-10-13 08:01:50.000000000 +0100 @@ -0,0 +1,51 @@ +/********************************************************* + * Copyright (C) 2001 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. + * + *********************************************************/ + + +/* + * guestInfoInt.h -- + * + * Functions used to communicate guest information to the host. + * + */ + +#ifndef GUEST_INFO_INT_H +#define GUEST_INFO_INT_H + + +#include "guestInfo.h" +#include "guestrpc/nicinfo.h" + +Bool GuestInfoGetFqdn(int outBufLen, char fqdn[]); +Bool GuestInfoGetNicInfo(GuestNicList *nicInfo); +void GuestInfoMemset(void * mem, int value, unsigned int size); +Bool GuestInfoGetDiskInfo(PGuestDiskInfo di); +Bool GuestInfoGetOSName(unsigned int outBufFullLen, unsigned int outBufLen, + char *osNameFull, char *osName); +Bool GuestInfo_PerfMon(struct GuestMemInfo *vmStats); + +GuestNic *GuestInfoAddNicEntry(GuestNicList *nicInfo, + const char macAddress[NICINFO_MAC_LEN]); +VmIpAddress *GuestInfoAddIpAddress(GuestNic *nic, + const char *ipAddr, + const uint32 af_type); +void GuestInfoAddSubnetMask(VmIpAddress *ipAddressEntry, + const uint32 subnetMaskBits, + Bool convertToMask); + +#endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/guestInfo/guestInfoPerfMonLinux.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/guestInfo/guestInfoPerfMonLinux.c --- open-vm-tools-2008.01.23-74039/lib/guestInfo/guestInfoPerfMonLinux.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/guestInfo/guestInfoPerfMonLinux.c 2008-10-13 08:01:50.000000000 +0100 @@ -0,0 +1,209 @@ +/********************************************************* + * Copyright (C) 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. + * + *********************************************************/ + +/* + * This file gathers the virtual memory stats from Linux guest to be + * passed on to the vmx. + */ + +#include +#include +#include +#include +#include +#include + +#include "vmware.h" +#include "guestInfo.h" +#include "strutil.h" +#include "debug.h" + +#ifndef NO_PROCPS +#include "vm_procps.h" +static void GuestInfoMonitorGetStat(GuestMemInfo *vmStats); +static Bool GuestInfoMonitorReadMeminfo(GuestMemInfo *vmStats); +#endif + +#define LINUX_MEMINFO_FLAGS (MEMINFO_MEMTOTAL | MEMINFO_MEMFREE | MEMINFO_MEMBUFF |\ + MEMINFO_MEMCACHE | MEMINFO_MEMACTIVE | MEMINFO_MEMINACTIVE |\ + MEMINFO_SWAPINRATE | MEMINFO_SWAPOUTRATE |\ + MEMINFO_IOINRATE | MEMINFO_IOOUTRATE) + +/* + *---------------------------------------------------------------------- + * + * GuestInfo_PerfMon -- + * + * Gather performance stats. + * + * Results: + * Gathered stats. Returns FALSE on failure. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +Bool +GuestInfo_PerfMon(GuestMemInfo *vmStats) // OUT: filled vmstats +{ +#ifndef NO_PROCPS + ASSERT(vmStats); + GuestInfoMonitorGetStat(vmStats); + if (GuestInfoMonitorReadMeminfo(vmStats)) { + vmStats->flags = LINUX_MEMINFO_FLAGS; + return TRUE; + } +#endif + return FALSE; +} + + +#ifndef NO_PROCPS +/* + *---------------------------------------------------------------------- + * + * GuestInfoMonitorGetStat -- + * + * Calls getstat() to gather memory stats. + * + * Results: + * Gathered stats in vmStats. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +static void +GuestInfoMonitorGetStat(GuestMemInfo *vmStats) // OUT: filled vmstats +{ + uint32 hz = Hertz; + uint32 dummy; + jiff cpuUse[2]; + jiff cpuNic[2]; + jiff cpuSys[2]; + jiff cpuIdl[2]; + jiff cpuIow[2]; + jiff cpuXxx[2]; + jiff cpuYyy[2]; + jiff cpuZzz[2]; + jiff cpuTotal; + jiff cpuHalf; + unsigned long pageIn[2]; + unsigned long pageOut[2]; + unsigned long swapIn[2]; + unsigned long swapOut[2]; + unsigned int dummy2[2]; + unsigned long kb_per_page = sysconf(_SC_PAGESIZE) / 1024ul; + + meminfo(); + getstat(cpuUse, cpuNic, cpuSys, cpuIdl, cpuIow, cpuXxx, cpuYyy, cpuZzz, + pageIn, pageOut, swapIn, swapOut, dummy2, dummy2, &dummy, &dummy, + &dummy, &dummy); + + cpuTotal = *cpuUse + *cpuNic + *cpuSys + *cpuXxx + + *cpuYyy + *cpuIdl + *cpuIow + *cpuZzz; + cpuHalf = cpuTotal / 2UL; + + vmStats->memFree = kb_main_free; + vmStats->memBuff = kb_main_buffers; + vmStats->memCache = kb_main_cached, + vmStats->memInactive = kb_inactive; + vmStats->memActive = kb_active; + + vmStats->swapInRate = (uint64)((*swapIn * kb_per_page * hz + cpuHalf) / cpuTotal); + vmStats->swapOutRate = (uint64)((*swapOut * kb_per_page * hz + cpuHalf) / cpuTotal); + vmStats->ioInRate = (uint64)((*pageIn * kb_per_page * hz + cpuHalf) / cpuTotal); + vmStats->ioOutRate = (uint64)((*pageOut * kb_per_page * hz + cpuHalf) / cpuTotal); + + + Debug("GuestInfoMonitorGetStat: GuestMemInfo: total: %"FMT64"u free: %"FMT64"u"\ + "buff: %"FMT64"u cache: %"FMT64"u swapin: %"FMT64"u swapout: %"FMT64"u ioin:"\ + "%"FMT64"u ioout: %"FMT64"u inactive: %"FMT64"u active: %"FMT64"u"\ + "hugetotal: %"FMT64"u hugefree: %"FMT64"u\n", vmStats->memTotal, + vmStats->memFree, vmStats->memBuff, vmStats->memCache, vmStats->swapInRate, + vmStats->swapOutRate, vmStats->ioInRate, vmStats->ioOutRate, + vmStats->memInactive, vmStats->memActive, vmStats->hugePagesTotal, + vmStats->hugePagesFree); +} + + +/* + *---------------------------------------------------------------------- + * + * GuestInfoMonitorReadMeminfo -- + * + * Reads /proc/meminfo to gather phsycial memory and huge page stats. + * + * Results: + * Read /proc/meminfo for total physical memory and huge pages info. + * Returns FALSE on failure. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +static Bool +GuestInfoMonitorReadMeminfo(GuestMemInfo *vmStats) // OUT: filled vmstats +{ + char buf[512]; + uint64 value; + FILE *fp; + + /* Get the total memory, and huge page info from /proc/meminfo. */ + fp = fopen("/proc/meminfo", "r"); + if (!fp) { + Log("GuestInfoMonitorReadMeminfo: Error opening /proc/meminfo.\n"); + return FALSE; + } + + while(!feof(fp)) { + if (fscanf(fp, "%s %"FMT64"u", buf, &value) != 2) { + continue; + } + if (StrUtil_StartsWith(buf, "MemTotal")) { + vmStats->memTotal = value; + } + if (StrUtil_StartsWith(buf, "HugePages_Total")) { + vmStats->hugePagesTotal = value; + vmStats->flags |= MEMINFO_HUGEPAGESTOTAL; + } + if (StrUtil_StartsWith(buf, "HugePages_Free")) { + vmStats->hugePagesFree = value; + vmStats->flags |= MEMINFO_HUGEPAGESFREE; + } + } + fclose(fp); + + Debug("GuestInfoMonitorReadMeminfo: GuestMemInfo: total: %"FMT64"u free: %"FMT64"u"\ + "buff: %"FMT64"u cache: %"FMT64"u swapin: %"FMT64"u swapout: %"FMT64"u ioin:"\ + "%"FMT64"u ioout: %"FMT64"u inactive: %"FMT64"u active: %"FMT64"u"\ + "hugetotal: %"FMT64"u hugefree: %"FMT64"u\n", vmStats->memTotal, + vmStats->memFree, vmStats->memBuff, vmStats->memCache, vmStats->swapInRate, + vmStats->swapOutRate, vmStats->ioInRate, vmStats->ioOutRate, + vmStats->memInactive, vmStats->memActive, vmStats->hugePagesTotal, + vmStats->hugePagesFree); + + return TRUE; +} +#endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/guestInfo/guestInfoPosix.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/guestInfo/guestInfoPosix.c --- open-vm-tools-2008.01.23-74039/lib/guestInfo/guestInfoPosix.c 2008-01-28 08:02:50.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/guestInfo/guestInfoPosix.c 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -34,33 +34,31 @@ #include #include #ifdef sun -# include # include -# include #endif #include #include #include #include #include -#ifdef __FreeBSD__ -# include -# include -# include +#if defined(__FreeBSD__) || defined(__APPLE__) # include #endif +#ifndef NO_DNET +# ifdef DNET_IS_DUMBNET +# include +# else +# include +# endif +#endif #include "util.h" -#include "arpa/inet.h" #include "sys/utsname.h" -#include "net/if_arp.h" -#include "net/if.h" -#include "netdb.h" #include "sys/ioctl.h" #include "vmware.h" #include "guestInfoInt.h" #include "debug.h" #include "str.h" -#include "osNames.h" +#include "guest_os.h" #include "guestApp.h" #include "guestInfo.h" @@ -135,8 +133,6 @@ {NULL, NULL}, }; -static int GetSystemBitness(void); - /* @@ -171,282 +167,160 @@ } +#ifndef NO_DNET /* *----------------------------------------------------------------------------- * - * GuestInfoGetNicInfo -- + * RecordNetworkAddress -- * - * Return MAC addresses of all the NICs in the guest and their - * corresponding IP addresses. + * Massages a dnet(3)-style interface address (IPv4 or IPv6) and stores it + * as part of a GuestNic structure. * - * Return value: - * Returns TRUE on success and FALSE on failure. - * Return MAC addresses of all NICs and their corresponding IPs. + * Results: + * If addr is IPv4 or IPv6, it will be appended to the GuestNic's list of + * IP addresses. * * Side effects: - * Memory is allocated for each NIC, as well as IP addresses of all NICs - * on successful return. + * None. * *----------------------------------------------------------------------------- - */ + */ -#if defined(__FreeBSD__) -Bool -GuestInfoGetNicInfo(NicInfo *nicInfo) // OUT +static void +RecordNetworkAddress(GuestNic *nic, // IN: operand NIC + const struct addr *addr) // IN: dnet(3) address to process { - struct ifaddrs *ifaces; - struct ifaddrs *cur; - typedef struct IfNameNicMap { // linked list to remember interface names - char *name; - NicEntry *nicEntry; // point to the NIC entry of the interface - DblLnkLst_Links links; - } IfNameNicMap; - IfNameNicMap *ifNamesCur; - DblLnkLst_Links ifNameList; - DblLnkLst_Links *sCurrent; - DblLnkLst_Links *sNext; - DblLnkLst_Links *linkIfName; - - ASSERT(nicInfo); - memset(nicInfo, 0, sizeof *nicInfo); - DblLnkLst_Init(&nicInfo->nicList); - DblLnkLst_Init(&ifNameList); - - if (getifaddrs(&ifaces) < 0) { - Debug("GuestInfo: Error, failed to call getifaddrs(3)\n"); - return FALSE; - } - - /* - * First pass: identify all interfaces with MAC addresses. As we add each - * MAC address to nicInfo, we also track the interface name tied to that - * address. This is because we must later use the interface name to find - * the appropriate MAC given a pair of {name,IP}. - */ - for (cur = ifaces; cur != NULL; cur = cur->ifa_next) { - if (cur->ifa_addr->sa_family == AF_LINK) { - NicEntry *nicEntryCur; - unsigned char tempMacAddress[6]; - char macAddress[MAC_ADDR_SIZE]; - struct sockaddr_dl *sdl = (struct sockaddr_dl *)cur->ifa_addr; - - /* - * By ensuring the address length is 6, we implicitly ignore all - * non-Ethernet addresses (such as loopback). - */ - if (sdl->sdl_alen != sizeof tempMacAddress) { - Debug("GuestInfo: Unexpected length for MAC address, skipping " - "interface\n"); - continue; - } - - /* - * insert the new entry to the end of the nicList - */ - - memcpy(tempMacAddress, LLADDR(sdl), sdl->sdl_alen); - Str_Sprintf(macAddress, - sizeof macAddress, - "%02x:%02x:%02x:%02x:%02x:%02x", - tempMacAddress[0], tempMacAddress[1], tempMacAddress[2], - tempMacAddress[3], tempMacAddress[4], tempMacAddress[5]); - - nicEntryCur = NicInfo_AddNicEntry(nicInfo, macAddress); - - /* - * Make interface name link list - */ - ifNamesCur = Util_SafeCalloc(1, sizeof *ifNamesCur); - ifNamesCur->name = cur->ifa_name; - ifNamesCur->nicEntry = nicEntryCur; - DblLnkLst_Init(&ifNamesCur->links); - DblLnkLst_LinkLast(&ifNameList, &ifNamesCur->links); - } - } - - /* Second pass: tie each IP address to its MAC address. */ - for (cur = ifaces; cur != NULL; cur = cur->ifa_next) { - if (cur->ifa_addr->sa_family == AF_INET) { - struct sockaddr_in *sin = (struct sockaddr_in *)cur->ifa_addr; + char ipAddress[NICINFO_MAX_IP_LEN]; + VmIpAddress *ip = NULL; - /* - * This is tedious but necessary. We iterate over the stored interface - * names looking for the one tied to this IP address. Then we convert - * the IP address to a string and store it in the nicInfo struct. - */ - - DblLnkLst_ForEach(linkIfName, &ifNameList) { - ifNamesCur = DblLnkLst_Container(linkIfName, IfNameNicMap, links); - if (strcmp(ifNamesCur->name, cur->ifa_name) == 0) { - VmIpAddressEntry *ipAddressCur; - NicEntry *entry = ifNamesCur->nicEntry; - char ipAddress[IP_ADDR_SIZE]; - - if (!inet_ntop(AF_INET, - &sin->sin_addr, - ipAddress, - sizeof ipAddress)) { - Debug("GuestInfo: Could not convert IP address, skipping " - "IP\n"); - break; - } - - ipAddressCur = NicEntry_AddIpAddress(entry, - ipAddress, - 0); /* not used */ - break; - } - } - } - } - - freeifaddrs(ifaces); - - /* free alllocated temp memory */ - DblLnkLst_ForEachSafe(sCurrent, sNext, &ifNameList) { - DblLnkLst_Unlink1(sCurrent); - free(DblLnkLst_Container(sCurrent, IfNameNicMap, links)); + switch (addr->addr_type) { + case ADDR_TYPE_IP: + /* + * GuestNicInfo clients expect IPv4 addresses and netmasks to be stored + * as strings in separate fields. As such, we'll use ip_ntop instead of + * addr_ntop to get a string without the netmask bits. + */ + ip_ntop(&addr->addr_ip, ipAddress, sizeof ipAddress); + ip = GuestInfoAddIpAddress(nic, ipAddress, INFO_IP_ADDRESS_FAMILY_IPV4); + if (ip) { + GuestInfoAddSubnetMask(ip, addr->addr_bits, TRUE); + } + break; + case ADDR_TYPE_IP6: + memcpy(ipAddress, addr_ntoa(addr), sizeof ipAddress); + GuestInfoAddIpAddress(nic, ipAddress, INFO_IP_ADDRESS_FAMILY_IPV6); + break; + default: + Debug("%s: Unknown address type: %hu\n", __func__, addr->addr_type); + break; } - - return TRUE; } -#else /* FreeBSD */ -Bool -GuestInfoGetNicInfo(NicInfo *nicInfo) // OUT -{ - Bool retVal = FALSE; - int sockfd; - struct ifconf ifc; - struct ifreq *ifr; - unsigned int numReqs = 30; /* Initial estimate of number of ifreqs. */ - unsigned int i; - char ipAddress[IP_ADDR_SIZE]; - char macAddress[MAC_ADDR_SIZE]; - - ASSERT(nicInfo); - if ((sockfd = socket(AF_INET, SOCK_DGRAM, 0)) == -1) { - Debug("GuestInfo: Error, could not create socket\n"); - return FALSE; - } - - memset(nicInfo, 0, sizeof *nicInfo); - DblLnkLst_Init(&nicInfo->nicList); - ifc.ifc_buf = NULL; - - /* Get all the interface entries for this machine. */ - for (;;) { - void *tmp = ifc.ifc_buf; - ifc.ifc_len = (sizeof *ifr) * numReqs; - if (!(ifc.ifc_buf = realloc(ifc.ifc_buf, ifc.ifc_len))) { - Debug("GuestInfo: Error, failed to allocate ifconf\n"); - free(tmp); - goto out; - } - - if (ioctl(sockfd, SIOCGIFCONF, &ifc) < 0) { - Debug("GuestInfo: SIOCGIFCONF failed\n"); - goto out; - } - if (ifc.ifc_len == (sizeof *ifr) * numReqs) { - /* assume it overflowed and try again */ - numReqs += 10; - continue; - } - break; - } +/* + *----------------------------------------------------------------------------- + * + * ReadInterfaceDetails -- + * + * Callback function called by libdnet when iterating over all the + * NICs on the host. + * + * Return value: + * Returns 0 on success and -1 on failure. + * Adds the MAC addresses of all NICs and their corresponding IPs. + * + * Side effects: + * Memory is allocated for each NIC, as well as IP addresses of all NICs + * on successful return. + * + *----------------------------------------------------------------------------- + */ - /* Get the IP and MAC address for each of these interfaces. */ - ifr = ifc.ifc_req; +int +ReadInterfaceDetails(const struct intf_entry *entry, // IN: current interface entry + void *arg) // IN: Pointer to the GuestNicList +{ + int i; + GuestNicList *nicInfo = arg; - for (i = 0; i * (sizeof *ifr) < ifc.ifc_len; i++, ifr++) { - unsigned char *ptr = NULL; - VmIpAddressEntry *ipAddressCur; - NicEntry *macNicEntry; -# ifdef sun - eth_t *device; - eth_addr_t addr; -# endif + if ((entry->intf_type & INTF_TYPE_ETH) == INTF_TYPE_ETH) { + GuestNic *nic; + char macAddress[NICINFO_MAC_LEN]; - Debug("%s\n", ifr->ifr_name); + Str_Sprintf(macAddress, sizeof macAddress, "%s", + addr_ntoa(&entry->intf_link_addr)); + nic = GuestInfoAddNicEntry(nicInfo, macAddress); - /* - * Get the mac address for this interface. Some interfaces (like the - * loopback interface) have no MAC address, and we skip them. - */ -# ifndef sun - if (ioctl(sockfd, SIOCGIFHWADDR, ifr) < 0) { - Debug("GuestInfo: Failed to get MAC address, skipping interface\n"); - continue; + if (nic == NULL) { + return -1; } - ptr = &ifr->ifr_hwaddr.sa_data[0]; -# else - /* libdnet's eth_* interface gets the ethernet address for us. */ - device = eth_open(ifr->ifr_name); - if (!device) { - Debug("GuestInfo: Failed to open device, skipping interface\n"); - continue; + /* Record the "primary" address. */ + if (entry->intf_addr.addr_type == ADDR_TYPE_IP || + entry->intf_addr.addr_type == ADDR_TYPE_IP6) { + RecordNetworkAddress(nic, &entry->intf_addr); } - if (eth_get(device, &addr) != 0) { - eth_close(device); - Debug("GuestInfo: Failed to get MAC address, skipping interface\n"); - continue; + /* Walk the list of alias's and add those that are IPV4 or IPV6 */ + for (i = 0; i < entry->intf_alias_num; i++) { + const struct addr *alias = &entry->intf_alias_addrs[i]; + if (alias->addr_type == ADDR_TYPE_IP || + alias->addr_type == ADDR_TYPE_IP6) { + RecordNetworkAddress(nic, alias); + } } + } - eth_close(device); - ptr = &addr.data[0]; + return 0; +} #endif - - /* Get the corresponding IP address. */ - ifr->ifr_addr.sa_family = AF_INET; - if (ioctl(sockfd, SIOCGIFADDR, ifr) < 0) { - Debug("GuestInfo: Failed to get ip address, skipping interface\n"); - continue; - } - /* Convert IP to a string. */ - if (!inet_ntop(AF_INET, - &((struct sockaddr_in *)&ifr->ifr_addr)->sin_addr, - ipAddress, sizeof ipAddress)) { - Debug("GuestInfo: Failed in inet_ntop, skipping interface\n"); - continue; - } +/* + *----------------------------------------------------------------------------- + * + * GuestInfoGetNicInfo -- + * + * Return MAC addresses of all the NICs in the guest and their + * corresponding IP addresses. + * + * Return value: + * Returns TRUE on success and FALSE on failure. + * Return MAC addresses of all NICs and their corresponding IPs. + * + * Side effects: + * Memory is allocated for each NIC, as well as IP addresses of all NICs + * on successful return. + * + *----------------------------------------------------------------------------- + */ - Str_Sprintf(macAddress, sizeof macAddress, - "%02x:%02x:%02x:%02x:%02x:%02x", - *ptr, *(ptr + 1), *(ptr + 2), - *(ptr + 3), *(ptr + 4), *(ptr + 5)); +Bool +GuestInfoGetNicInfo(GuestNicList *nicInfo) // OUT +{ +#ifndef NO_DNET + intf_t *intf; - /* Which entry in nic info corresponds to this MAC address? */ - macNicEntry = NicInfo_FindMacAddress(nicInfo, macAddress); - if (NULL == macNicEntry) { - /* This mac address has not been added to nicInfo, get a new entry. */ - macNicEntry = NicInfo_AddNicEntry(nicInfo, - macAddress); - } + memset(nicInfo, 0, sizeof *nicInfo); - ipAddressCur = NicEntry_AddIpAddress(macNicEntry, ipAddress, 0); + /* Get a handle to read the network interface configuration details. */ + if ((intf = intf_open()) == NULL) { + Debug("GuestInfo: Error, failed NULL result from intf_open()\n"); + return FALSE; } - retVal = TRUE; - -out: - if (close(sockfd) == -1) { - Debug("GuestInfo: Close socket failed\n"); - retVal = FALSE; + if (intf_loop(intf, ReadInterfaceDetails, nicInfo) < 0) { + intf_close(intf); + Debug("GuestInfo: Error, negative result from intf_loop\n"); + return FALSE; } - if (ifc.ifc_buf) { - free(ifc.ifc_buf); - } - return retVal; -} + intf_close(intf); + return TRUE; +#else + return FALSE; #endif - +} /* *----------------------------------------------------------------------------- @@ -552,8 +426,8 @@ Str_Strcpy(distroShort, STR_OS_LINUX_FROM_SCRATCH, distroShortSize); } else if (strstr(distroLower, "linux-ppc")) { Str_Strcpy(distroShort, STR_OS_LINUX_PPC, distroShortSize); - } else if (strstr(distroLower, "mandravia")) { - Str_Strcpy(distroShort, STR_OS_MANDRAVIA, distroShortSize); + } else if (strstr(distroLower, "mandriva")) { + Str_Strcpy(distroShort, STR_OS_MANDRIVA, distroShortSize); } else if (strstr(distroLower, "mklinux")) { Str_Strcpy(distroShort, STR_OS_MKLINUX, distroShortSize); } else if (strstr(distroLower, "pld")) { @@ -881,7 +755,7 @@ } } - if (GetSystemBitness() == 64) { + if (GuestInfo_GetSystemBitness() == 64) { if (strlen(osName) + sizeof STR_OS_64BIT_SUFFIX > outBufLen) { Debug("GuestInfoGetOSName: Error: buffer too small\n"); return FALSE; @@ -905,12 +779,12 @@ /* *---------------------------------------------------------------------------- * - * GetSystemBitness -- + * GuestInfo_GetSystemBitness -- * * Determines the operating system's bitness. * * Return value: - * 32 or 64 on success, negative value on failure. Check errno for more + * 32 or 64 on success, negative value on failure. Check errno for more * details of error. * * Side effects: @@ -919,11 +793,11 @@ *---------------------------------------------------------------------------- */ -static int -GetSystemBitness(void) +int +GuestInfo_GetSystemBitness(void) { char buf[MAX_ARCH_NAME_LEN] = { 0 }; -#if defined(__FreeBSD__) +#if defined(__FreeBSD__) || defined(__APPLE__) int mib[2]; size_t len; diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/guestInfo/guestInfoServer.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/guestInfo/guestInfoServer.c --- open-vm-tools-2008.01.23-74039/lib/guestInfo/guestInfoServer.c 2008-01-28 08:02:50.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/guestInfo/guestInfoServer.c 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -21,36 +21,22 @@ * * This is the implementation of the common code in the guest tools * to send out guest information to the host. The guest info server - * is currently a thread spawned by the tools daemon which periodically + * runs in the context of the tools daemon's event loop and periodically * gathers all guest information and sends updates to the host if required. * This file implements the platform independent framework for this. - * A separate thread is only spawned for Windows guests, currently. */ -#ifndef VMX86_DEVEL - -#endif - #include #include #include #include #include -#ifdef _WIN32 -#include -#include /* For Sleep() */ -#include -#define SleepFunction(x) Sleep((uint32)ceil((double)(x) / 1000)) -#else -/* SleepFunction() for Posix defined below; these includes are needed. */ -#include -#endif - #include "vmware.h" #include "eventManager.h" #include "debug.h" +#include "dynxdr.h" #include "str.h" #include "util.h" #include "rpcout.h" @@ -61,10 +47,11 @@ #include "guestInfoInt.h" #include "buildNumber.h" #include "system.h" -#include "wiper.h" // for WiperPartition functions +#include "guest_msg_def.h" // For GUESTMSG_MAX_IN_SIZE +#include "xdrutil.h" +#include "wiper.h" #define GUESTINFO_DEFAULT_DELIMITER ' ' -#define GUESTMSG_MAX_IN_SIZE (64 * 1024) /* vmx/main/guest_msg.c */ /* * Stores information about all guest information sent to the vmx. @@ -72,8 +59,8 @@ typedef struct _GuestInfoCache{ char value[INFO_MAX][MAX_VALUE_LEN]; /* Stores values of all key-value pairs. */ - NicInfo nicInfo; - DiskInfo diskInfo; + GuestNicList nicInfo; + GuestDiskInfo diskInfo; } GuestInfoCache; @@ -83,11 +70,10 @@ static uint32 gDisableQueryDiskInfo = FALSE; static DblLnkLst_Links *gGuestInfoEventQueue; -static uint32 gTimerInterval; /* Local cache of the guest information that was last sent to vmx. */ static GuestInfoCache gInfoCache; -/* +/* * A boolean flag that specifies whether the state of the VM was * changed since the last time guest info was sent to the VMX. * Tools daemon sets it to TRUE after the VM was resumed. @@ -95,115 +81,13 @@ static Bool vmResumed; -/* - * The Windows Guest Info Server runs in a separate thread, - * so we have to synchronize access to 'vmResumed' variable. - * Non-windows guest info server does not run in a separate - * thread, so no locking is needed. - */ - -#if defined(_WIN32) -typedef CRITICAL_SECTION vmResumedLockType; -#define GUESTINFO_DELETE_LOCK(lockPtr) DeleteCriticalSection(lockPtr) -#define GUESTINFO_ENTER_LOCK(lockPtr) EnterCriticalSection(lockPtr) -#define GUESTINFO_LEAVE_LOCK(lockPtr) LeaveCriticalSection(lockPtr) -#define GUESTINFO_INIT_LOCK(lockPtr) InitializeCriticalSection(lockPtr) - -vmResumedLockType vmResumedLock; - -#else // #if LINUX - -typedef int vmResumedLockType; -#define GUESTINFO_DELETE_LOCK(lockPtr) -#define GUESTINFO_ENTER_LOCK(lockPtr) -#define GUESTINFO_LEAVE_LOCK(lockPtr) -#define GUESTINFO_INIT_LOCK(lockPtr) - -#endif // #if LINUX - static Bool GuestInfoGather(void * clientData); static Bool GuestInfoUpdateVmdb(GuestInfoType infoType, void* info); static Bool SetGuestInfo(GuestInfoType key, const char* value, char delimiter); -static Bool NicInfoChanged(NicInfo *nicInfo); -static Bool DiskInfoChanged(PDiskInfo diskInfo); +static Bool NicInfoChanged(GuestNicList *nicInfo); +static Bool DiskInfoChanged(PGuestDiskInfo diskInfo); static void GuestInfoClearCache(void); -static Bool GuestInfoSerializeNicInfo(NicInfo *nicInfo, - char buffer[GUESTMSG_MAX_IN_SIZE], - size_t *bufferLen); -static int PrintNicInfo(NicInfo *nicInfo, int (*PrintFunc)(const char *, ...)); - -#ifdef _WIN32 - -static Bool GuestInfoConvertNicInfoToNicInfoV1(NicInfo *info, NicInfoV1 *infoV1); - - -/* - *----------------------------------------------------------------------------- - * - * GuestInfoServer_Main -- - * - * The main event loop for the guest info server. - * GuestInfoServer_Init() much be called prior to calling this function. - * - * Result - * None - * - * Side-effects - * Events are processed, information gathered and updates sent. - * - *----------------------------------------------------------------------------- - */ - -void -GuestInfoServer_Main(void *data) // IN -{ - int retVal; - uint64 sleepUsecs; - HANDLE *events = (HANDLE *) data; - HANDLE quitEvent; - HANDLE finishedEvent; - - ASSERT(data); - ASSERT(events[0]); - ASSERT(events[1]); - - quitEvent = events[0]; - finishedEvent = events[1]; - - Debug("Starting GuestInfoServer for Windows.\n"); - for(;;) { - DWORD dwError; - - retVal = EventManager_ProcessNext(gGuestInfoEventQueue, &sleepUsecs); - if (retVal != 1) { - Debug("Unexpected end of the guest info loop.\n"); - break; - } - - /* - * The number of micro seconds to sleep should not overflow a long. This - * corresponds to a maximum sleep time of around 4295 seconds (~ 71 minutes) - * which should be more than enough. - */ - - Debug("Sleeping for %"FMT64"u msecs...\n", sleepUsecs / 1000); - dwError = WaitForSingleObject(quitEvent, sleepUsecs / 1000); - if (dwError == WAIT_OBJECT_0) { - GuestApp_Log("GuestInfoServer received quit event.\n"); - Debug("GuestInfoServer received quit event.\n"); - break; - } else if (dwError == WAIT_TIMEOUT) { - Debug("GuestInfoServer woke up.\n"); - } else if (dwError == WAIT_FAILED) { - Debug("GuestInfoServer error waiting on exit event: %d %d\n", - dwError, GetLastError()); - break; - } - } - SetEvent(finishedEvent); - GuestApp_Log("GuestInfoServer exiting.\n"); -} -#endif +static int PrintNicInfo(GuestNicList *nicInfo, int (*PrintFunc)(const char *, ...)); /* @@ -211,23 +95,15 @@ * * GuestInfoServer_Init -- * - * This function must be called before the guest info thread is running. - * Initialize the event queue. If an event queue has been supplied, just - * add the first event to it. If not, create an event queue and then add - * an event to this queue. Initialize vmResumedLock. Even if the function - * fails, the lock is initialized anyway since the main thread calls - * GuestInfoServer_VMResumedNotify() regardless of whether the guest info - * thread was started successfully. - * - * Call GuestInfoServer_Cleanup() to do the necessary cleanup after the - * guest info thread has finished running. + * Initialize some variables and add the first event to the queue. + * + * Call GuestInfoServer_Cleanup() to do the necessary cleanup. * * Result * TRUE on success, FALSE on failure. * * Side-effects - * The timer event queue is initialized and populated with the first event. - * Lock is created for synchronized access to vmResumed variable. + * The timer event queue is populated with the first event. * *----------------------------------------------------------------------------- */ @@ -236,33 +112,24 @@ GuestInfoServer_Init(DblLnkLst_Links *eventQueue) // IN: queue for event loop { Debug("Entered guest info init.\n"); + ASSERT(eventQueue); memset(&gInfoCache, 0, sizeof gInfoCache); - - GUESTINFO_INIT_LOCK(&vmResumedLock); - GUESTINFO_ENTER_LOCK(&vmResumedLock); vmResumed = FALSE; - GUESTINFO_LEAVE_LOCK(&vmResumedLock); - - gGuestInfoEventQueue = eventQueue ? eventQueue: EventManager_Init(); - if(!gGuestInfoEventQueue) { - Debug("Unable to create the event queue.\n"); - return FALSE; - } - - /* - * Get the timer interval. - * XXX: A default value of 30 seconds is acceptable to the VPX team - * This value should however be made configurable. - */ - - gTimerInterval = 3000; /* 30 seconds. */ + gGuestInfoEventQueue = eventQueue; /* Add the first timer event. */ - if (!EventManager_Add(gGuestInfoEventQueue, gTimerInterval, GuestInfoGather, NULL)) { + if (!EventManager_Add(gGuestInfoEventQueue, GUESTINFO_TIME_INTERVAL_MSEC, + GuestInfoGather, NULL)) { Debug("Unable to add initial event.\n"); return FALSE; } + + /* Initialize the wiper library. */ + if (!Wiper_Init(NULL)) { + Debug("GetDiskInfo: ERROR: could not initialize wiper library\n"); + gDisableQueryDiskInfo = TRUE; + } return TRUE; } @@ -275,11 +142,11 @@ * * Set whether to disable/enable querying disk information. * This function is required to provide a work around for bug number 94434. - * On Win 9x/ME querying for the disk information prevents the machine from - * entering standby. So we added a configuration option diable-query-diskinfo + * On Win 9x/ME querying for the disk information prevents the machine from + * entering standby. So we added a configuration option diable-query-diskinfo * for the tools.conf file. We use this function to let the guestd & tools service * control the disabling/enabling of disk information querying. - * + * * Result * None. * @@ -292,7 +159,7 @@ void GuestInfoServer_DisableDiskInfoQuery(Bool disable) { - gDisableQueryDiskInfo = disable; + gDisableQueryDiskInfo = disable; } @@ -307,9 +174,7 @@ * None. * * Side-effects - * Timer event queue is destroyed. - * Deallocate any memory allocated in gInfoCache. - * vmResumedLock is deleted. + * Deallocates any memory allocated in gInfoCache. * *----------------------------------------------------------------------------- */ @@ -318,10 +183,6 @@ GuestInfoServer_Cleanup(void) { GuestInfoClearCache(); - if (gGuestInfoEventQueue) { - EventManager_Destroy(gGuestInfoEventQueue); - } - GUESTINFO_DELETE_LOCK(&vmResumedLock); } @@ -345,41 +206,8 @@ void GuestInfoServer_VMResumedNotify(void) { - GUESTINFO_ENTER_LOCK(&vmResumedLock); vmResumed = TRUE; - GUESTINFO_LEAVE_LOCK(&vmResumedLock); -} - - -#ifndef _WIN32 -/* - *---------------------------------------------------------------------------- - * - * SleepFunction -- - * - * Sleeps in milliseconds. (Posix) - * - * Results: - * None. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------------- - */ - -static inline void -SleepFunction(uint64 tmout) -{ - if (tmout >= INT_MAX * CONST64U(1000)) { - tmout = INT_MAX; - } else { - tmout = (tmout + 999) / 1000; - } - - poll(NULL, 0, tmout); } -#endif /* @@ -404,13 +232,16 @@ char name[255]; char osNameFull[MAX_VALUE_LEN]; char osName[MAX_VALUE_LEN]; - NicInfo nicInfo; - DiskInfo diskInfo; - + GuestNicList nicInfo; + GuestDiskInfo diskInfo; +#if defined(_WIN32) || defined(linux) + GuestMemInfo vmStats = {0}; +#endif + Debug("Entered guest info gather.\n"); memset(&nicInfo, 0, sizeof nicInfo); - + /* Send tools version. */ if (!GuestInfoUpdateVmdb(INFO_TOOLS_VERSION, BUILD_NUMBER)) { /* @@ -432,7 +263,7 @@ Debug("Failed to update VMDB\n"); } } - + if (!gDisableQueryDiskInfo) { if (!GuestInfoGetDiskInfo(&diskInfo)) { Debug("Failed to get disk info.\n"); @@ -446,8 +277,8 @@ free(diskInfo.partitionList); diskInfo.partitionList = NULL; } - } - + } + if(!GuestInfoGetFqdn(sizeof name, name)) { Debug("Failed to get netbios name.\n"); } else { @@ -459,10 +290,20 @@ /* Get NIC information. */ if (!GuestInfoGetNicInfo(&nicInfo)) { Debug("Failed to get nic info.\n"); - } else { - if (!GuestInfoUpdateVmdb(INFO_IPADDRESS, &nicInfo)) { + } else if (NicInfoChanged(&nicInfo)) { + if (GuestInfoUpdateVmdb(INFO_IPADDRESS, &nicInfo)) { + /* + * Update the cache. Release the memory previously used by the cache, + * and copy the new information into the cache. + */ + VMX_XDR_FREE(xdr_GuestNicList, &gInfoCache.nicInfo); + gInfoCache.nicInfo = nicInfo; + } else { Debug("Failed to update VMDB.\n"); } + } else { + Debug("Nic info not changed.\n"); + VMX_XDR_FREE(xdr_GuestNicList, &nicInfo); } /* Send the uptime to VMX so that it can detect soft resets. */ @@ -470,14 +311,28 @@ Debug("Failed to update VMDB with uptime.\n"); } - /* - * Even if one of the updates was unsuccessfull, +#if defined(_WIN32) || defined(linux) + /* Send the vmstats to the VMX. */ + + if (!GuestInfo_PerfMon(&vmStats)) { + Debug("Failed to get vmstats.\n"); + } else { + vmStats.version = 1; + if (!GuestInfoUpdateVmdb(INFO_MEMORY, &vmStats)) { + Debug("Failed to send vmstats.\n"); + } + } +#endif + + /* + * Even if one of the updates was unsuccessfull, * we still add the next timer event. This way * if one of the pieces failed, other information will * still be passed to the host. * */ - if (!EventManager_Add(gGuestInfoEventQueue, gTimerInterval, GuestInfoGather, NULL)) { + if (!EventManager_Add(gGuestInfoEventQueue, GUESTINFO_TIME_INTERVAL_MSEC, + GuestInfoGather, NULL)) { Debug("GuestInfoGather: Unable to add next event.\n"); } @@ -490,87 +345,73 @@ * * GuestInfoConvertNicInfoToNicInfoV1 -- * - * Convert the new dynamic nicInfoNew to fixed size struct NicInfoV1. + * Convert the new dynamic nicInfoNew to fixed size struct GuestNicInfoV1. * * Results: * TRUE if successfully converted * FALSE otherwise * * Side effects: - * If number of NICs or number of IP addresses on any of the NICs + * If number of NICs or number of IP addresses on any of the NICs * exceeding MAX_NICS and MAX_IPS respectively, the extra ones * are truncated, on successful return. - * + * *---------------------------------------------------------------------- */ Bool -GuestInfoConvertNicInfoToNicInfoV1(NicInfo *info, // IN - NicInfoV1 *infoV1) // OUT +GuestInfoConvertNicInfoToNicInfoV1(GuestNicList *info, // IN + GuestNicInfoV1 *infoV1) // OUT { - NicEntry *nicEntryCur; uint32 maxNics; - uint32 nicIndex = 0; - DblLnkLst_Links *nicEntryLink; + u_int i; if ((NULL == info) || (NULL == infoV1)) { return FALSE; } - maxNics = info->nicInfoProto.numNicEntries > MAX_NICS ? - MAX_NICS : info->nicInfoProto.numNicEntries; + maxNics = MIN(info->nics.nics_len, MAX_NICS); infoV1->numNicEntries = maxNics; - if (maxNics < info->nicInfoProto.numNicEntries) { - Debug("Truncating NICs.\n"); + if (maxNics < info->nics.nics_len) { + Debug("GuestInfo: truncating NIC list for backwards compatibility.\n"); } - DblLnkLst_ForEach(nicEntryLink, &info->nicList) { - uint32 ipIndex = 0; + XDRUTIL_FOREACH(i, info, nics) { + u_int j; uint32 maxIPs; - VmIpAddressEntry *ipAddressList; - DblLnkLst_Links *ipAddrLink; - - if (nicIndex >= maxNics) { - break; - } - - nicEntryCur = DblLnkLst_Container(nicEntryLink, - NicEntry, - links); - if (NULL == nicEntryCur) { - return FALSE; - } - - strcpy(infoV1->nicList[nicIndex].macAddress, nicEntryCur->nicEntryProto.macAddress); - - maxIPs = nicEntryCur->nicEntryProto.numIPs > MAX_IPS ? - MAX_IPS : nicEntryCur->nicEntryProto.numIPs; - nicEntryCur -> nicEntryProto.numIPs = maxIPs; - if (maxIPs < nicEntryCur->nicEntryProto.numIPs) { - Debug("Truncating IP addresses for NIC %d.\n", nicIndex); - } + GuestNic *nic = XDRUTIL_GETITEM(info, nics, i); - DblLnkLst_ForEach(ipAddrLink, &nicEntryCur->ipAddressList) { + Str_Strcpy(infoV1->nicList[i].macAddress, + nic->macAddress, + sizeof infoV1->nicList[i].macAddress); - if (ipIndex >= maxIPs) { - break; - } + maxIPs = MIN(nic->ips.ips_len, MAX_IPS); + infoV1->nicList[i].numIPs = 0; - ipAddressList = DblLnkLst_Container(nicEntryCur -> ipAddressList.next, - VmIpAddressEntry, - links); - if (NULL == ipAddressList) { - return FALSE; + XDRUTIL_FOREACH(j, nic, ips) { + VmIpAddress *ip = XDRUTIL_GETITEM(nic, ips, j); + + if (strlen(ip->ipAddress) < sizeof infoV1->nicList[i].ipAddress[j]) { + Str_Strcpy(infoV1->nicList[i].ipAddress[j], + ip->ipAddress, + sizeof infoV1->nicList[i].ipAddress[j]); + infoV1->nicList[i].numIPs++; + if (infoV1->nicList[i].numIPs == maxIPs) { + break; + } + } else { + Debug("GuestInfo: ignoring IPV6 address for compatibility.\n"); } - strcpy(infoV1->nicList[nicIndex].ipAddress[ipIndex], - ipAddressList->ipEntryProto.ipAddress); - - ipIndex++; } - nicIndex++; - } + if (infoV1->nicList[i].numIPs != nic->ips.ips_len) { + Debug("GuestInfo: some IP addresses were ignored for compatibility.\n"); + } + if (i == maxNics) { + break; + } + } return TRUE; } @@ -600,19 +441,11 @@ GuestInfoUpdateVmdb(GuestInfoType infoType, // IN: guest information type void *info) // IN: type specific information { - Bool resumed = FALSE; - ASSERT(info); Debug("Entered update vmdb.\n"); - GUESTINFO_ENTER_LOCK(&vmResumedLock); if (vmResumed) { - resumed = vmResumed; vmResumed = FALSE; - } - GUESTINFO_LEAVE_LOCK(&vmResumedLock); - - if (resumed) { GuestInfoClearCache(); } @@ -643,66 +476,83 @@ break; case INFO_IPADDRESS: - if (NicInfoChanged((NicInfo *)info)) { + { static Bool isCmdV1 = FALSE; - char request[GUESTMSG_MAX_IN_SIZE]; - size_t requestLength = 0; char *reply = NULL; size_t replyLen; Bool status; if (FALSE == isCmdV1) { - Debug("Creating nic info message.\n"); - Str_Sprintf(request, - sizeof request, - "%s %d ", - GUEST_INFO_COMMAND_TWO, - INFO_IPADDRESS); - - if (GuestInfoSerializeNicInfo((NicInfo *)info, - request + strlen(request), - &requestLength)) { - requestLength += strlen(request); - } else { + /* 13 = max size of string representation of an int + 3 spaces. */ + char request[sizeof GUEST_INFO_COMMAND + 13]; + GuestNicProto message; + XDR xdrs; + + if (DynXdr_Create(&xdrs) == NULL) { + return FALSE; + } + + /* Add the RPC preamble: message name, and type. */ + Str_Sprintf(request, sizeof request, "%s %d ", + GUEST_INFO_COMMAND, INFO_IPADDRESS_V2); + + message.ver = NIC_INFO_V2; + message.GuestNicProto_u.nicsV2 = info; + + /* Write preamble and serialized nic info to XDR stream. */ + if (!DynXdr_AppendRaw(&xdrs, request, strlen(request)) || + !xdr_GuestNicProto(&xdrs, &message)) { + Debug("GuestInfo: Error serializing nic info v2 data."); + DynXdr_Destroy(&xdrs, TRUE); return FALSE; } - Debug("GuestInfo: Sending nic info message.\n"); - /* Send all the information in the message. */ - status = RpcOut_SendOneRaw(request, requestLength, &reply, &replyLen); + status = RpcOut_SendOneRaw(DynXdr_Get(&xdrs), + xdr_getpos(&xdrs), + &reply, + &replyLen); + DynXdr_Destroy(&xdrs, TRUE); + if (status) { + Debug("GuestInfo: sent nic info message.\n"); + } else { + Debug("GuestInfo: failed to send V2 nic info message.\n"); + } - Debug("GuestInfo: Just sent nic info message.\n"); + if (RpcVMX_ConfigGetBool(FALSE, "printNicInfo")) { + PrintNicInfo((GuestNicList *) info, + (int (*)(const char *fmt, ...)) RpcVMX_Log); + } } else { status = FALSE; } if (!status) { /* - * Could be that we are talking to the old protocol that NicInfo is + * Could be that we are talking to the old protocol that GuestNicInfo is * still fixed size. Another try to send the fixed sized Nic info. */ - char requestFixedSize[sizeof (NicInfoV1) + sizeof GUEST_INFO_COMMAND + - 2 + /* 2 bytes are for digits of infotype. */ - 3 * sizeof (char)]; /* 3 spaces */ - NicInfoV1 nicInfo; - + char request[sizeof (GuestNicInfoV1) + sizeof GUEST_INFO_COMMAND + + 2 + /* 2 bytes are for digits of infotype. */ + 3 * sizeof (char)]; /* 3 spaces */ + GuestNicInfoV1 nicInfo; + free(reply); reply = NULL; - Str_Sprintf(requestFixedSize, - sizeof requestFixedSize, - "%s %d ", + Str_Sprintf(request, + sizeof request, + "%s %d ", GUEST_INFO_COMMAND, INFO_IPADDRESS); if (GuestInfoConvertNicInfoToNicInfoV1(info, &nicInfo)) { - memcpy(requestFixedSize + strlen(requestFixedSize), - &nicInfo, - sizeof(NicInfoV1)); + memcpy(request + strlen(request), + &nicInfo, + sizeof(GuestNicInfoV1)); Debug("GuestInfo: Sending nic info message.\n"); /* Send all the information in the message. */ - status = RpcOut_SendOneRaw(requestFixedSize, - sizeof requestFixedSize, - &reply, + status = RpcOut_SendOneRaw(request, + sizeof request, + &reply, &replyLen); Debug("GuestInfo: Just sent fixed sized nic info message.\n"); @@ -717,32 +567,38 @@ } } - if (RpcVMX_ConfigGetBool(FALSE, "printNicInfo")) { - PrintNicInfo((NicInfo *) info, (int (*)(const char *fmt, ...)) RpcVMX_Log); - } - Debug("GuestInfo: Updated new NIC information\n"); free(reply); reply = NULL; + } + break; - /* - * Update the cache. Assign info to gInfoCache.nicInfo. First free dynamic - * memory allocated in gInfoCache.nicInfo. Then unlink those in nicInfo and - * link them back to gInfoCache.nicInfo this is sort of hacking. However, it - * works in this case, since nicInfo is not going to be used after this. NOTE, - * nicInfo CAN NOT BE USED AFTER THIS POINT. - */ - GuestInfo_FreeDynamicMemoryInNicInfo(&gInfoCache.nicInfo); - /* assign the fixed memory part */ - gInfoCache.nicInfo = *(NicInfo *)info; - /* assign the dynamic memory part */ - DblLnkLst_Init(&gInfoCache.nicInfo.nicList); - DblLnkLst_Link(&gInfoCache.nicInfo.nicList, ((NicInfo *)info)->nicList.next); - DblLnkLst_Unlink1(&((NicInfo *)info)->nicList); - } else { - Debug("GuestInfo: Nic info not changed.\n"); + case INFO_MEMORY: + { + char request[sizeof(GuestMemInfo) + sizeof GUEST_INFO_COMMAND + + 2 + /* 2 bytes are for digits of infotype. */ + 3 * sizeof (char)]; /* 3 spaces */ + Bool status; + + Debug("GuestInfo: Sending GuestMemInfo message.\n"); + Str_Sprintf(request, + sizeof request, + "%s %d ", + GUEST_INFO_COMMAND, + INFO_MEMORY); + memcpy(request + strlen(request), + info, sizeof(GuestMemInfo)); + + /* Send all the information in the message. */ + status = RpcOut_SendOneRaw(request, sizeof(request), + NULL, NULL); + if (!status) { + Debug("Error sending GuestMemInfo.\n"); + return FALSE; } + Debug("GuestMemInfo sent successfully.\n"); break; + } case INFO_DISK_FREE_SPACE: { @@ -757,14 +613,14 @@ char *reply; size_t replyLen; Bool status; - PDiskInfo pdi = (PDiskInfo)info; + PGuestDiskInfo pdi = (PGuestDiskInfo)info; int j = 0; if (!DiskInfoChanged(pdi)) { Debug("GuestInfo: Disk info not changed.\n"); break; } - + requestSize += sizeof pdi->numEntries + sizeof *pdi->partitionList * pdi->numEntries; request = (char *)calloc(requestSize, sizeof (char)); @@ -773,9 +629,9 @@ break; } - Str_Sprintf(request, requestSize, "%s %d ", GUEST_INFO_COMMAND, + Str_Sprintf(request, requestSize, "%s %d ", GUEST_INFO_COMMAND, INFO_DISK_FREE_SPACE); - + /* partitionCount is a uint8 and cannot be larger than UCHAR_MAX. */ if (pdi->numEntries > UCHAR_MAX) { Debug("GuestInfo: Too many partitions.\n"); @@ -799,7 +655,7 @@ memcpy(request + offset, &partitionCount, sizeof partitionCount); memcpy(request + offset + sizeof partitionCount, pdi->partitionList, sizeof *pdi->partitionList * pdi->numEntries); - + Debug("sizeof request is %d\n", requestSize); status = RpcOut_SendOneRaw(request, requestSize, &reply, &replyLen); @@ -820,11 +676,11 @@ gInfoCache.diskInfo.partitionList = NULL; } gInfoCache.diskInfo.numEntries = pdi->numEntries; - gInfoCache.diskInfo.partitionList = calloc(pdi->numEntries, + gInfoCache.diskInfo.partitionList = calloc(pdi->numEntries, sizeof(PartitionEntry)); if (gInfoCache.diskInfo.partitionList == NULL) { Debug("GuestInfo: could not allocate memory for the disk info cache.\n"); - return FALSE; + return FALSE; } for (j = 0; j < pdi->numEntries; j++) { @@ -882,7 +738,7 @@ delimiter, key, delimiter, value); if (!status) { - Debug("SetGuestInfo: Error sending rpc message: %s\n", + Debug("SetGuestInfo: Error sending rpc message: %s\n", reply ? reply : "NULL"); free(reply); return FALSE; @@ -898,13 +754,13 @@ /* *----------------------------------------------------------------------------- * - * NicInfo_FindMacAddress -- + * GuestInfoFindMacAddress -- * - * Locates a MAC address in the NIC info structure. + * Locates a NIC with the given MAC address in the NIC list. * * Return value: * If there is an entry in nicInfo which corresponds to this MAC address, - * its index is returned. If not -1 is returned. + * it is returned. If not NULL is returned. * * Side effects: * None @@ -912,20 +768,16 @@ *----------------------------------------------------------------------------- */ -NicEntry * -NicInfo_FindMacAddress(NicInfo *nicInfo, const char *macAddress) -{ - NicEntry *nicEntry; - DblLnkLst_Links *sCurrent; - - if (0 == nicInfo->nicInfoProto.numNicEntries) { - return NULL; - } - - DblLnkLst_ForEach(sCurrent, &nicInfo->nicList) { - nicEntry = DblLnkLst_Container(sCurrent, NicEntry, links); - if (Str_Strcasecmp(macAddress, nicEntry->nicEntryProto.macAddress) == 0) { - return nicEntry; +GuestNic * +GuestInfoFindMacAddress(GuestNicList *nicInfo, // IN/OUT + const char *macAddress) // IN +{ + u_int i; + + for (i = 0; i < nicInfo->nics.nics_len; i++) { + GuestNic *nic = &nicInfo->nics.nics_val[i]; + if (strncmp(nic->macAddress, macAddress, NICINFO_MAC_LEN) == 0) { + return nic; } } @@ -953,232 +805,64 @@ */ Bool -NicInfoChanged(NicInfo *nicInfo) // IN: +NicInfoChanged(GuestNicList *nicInfo) // IN { - char *currentMac; - NicInfo *cachedNicInfo; - NicEntry *cachedNic; - DblLnkLst_Links *cachedNicLink; - - cachedNicInfo = &gInfoCache.nicInfo; - cachedNic = DblLnkLst_Container(cachedNicInfo->nicList.next, - NicEntry, - links); + u_int i; + GuestNicList *cachedNicInfo = &gInfoCache.nicInfo; - if (cachedNicInfo->nicInfoProto.numNicEntries != - nicInfo->nicInfoProto.numNicEntries) { + if (cachedNicInfo->nics.nics_len != nicInfo->nics.nics_len) { Debug("GuestInfo: number of nics has changed\n"); return TRUE; } - /* Have any MAC or IP addresses been modified? */ - DblLnkLst_ForEach(cachedNicLink, &cachedNicInfo->nicList) { - NicEntry *matchedNIC; - DblLnkLst_Links *curCachedIpLink; - - cachedNic = DblLnkLst_Container(cachedNicLink, NicEntry, links); - currentMac = cachedNic->nicEntryProto.macAddress; + for (i = 0; i < cachedNicInfo->nics.nics_len; i++) { + u_int j; + GuestNic *cachedNic = &cachedNicInfo->nics.nics_val[i]; + GuestNic *matchedNic; /* Find the corresponding nic in the new nic info. */ - matchedNIC = NicInfo_FindMacAddress(nicInfo, currentMac); + matchedNic = GuestInfoFindMacAddress(nicInfo, cachedNic->macAddress); - if (NULL == matchedNIC) { + if (NULL == matchedNic) { /* This mac address has been deleted. */ - Debug("GuestInfo: mac address %s deleted\n", currentMac); return TRUE; } - if (matchedNIC->nicEntryProto.numIPs != cachedNic->nicEntryProto.numIPs) { - Debug("GuestInfo: count of ip addresses for mac %d\n", - matchedNIC->nicEntryProto.numIPs); + if (matchedNic->ips.ips_len != cachedNic->ips.ips_len) { + Debug("GuestInfo: count of ip addresses for mac %d\n", + matchedNic->ips.ips_len); return TRUE; } /* Which IP addresses have been modified for this NIC? */ - DblLnkLst_ForEach(curCachedIpLink, &cachedNic->ipAddressList) { - char *currentCachedIp; - VmIpAddressEntry *cachedIpAddress; - DblLnkLst_Links * matchedIpAddressLink; + for (j = 0; j < cachedNic->ips.ips_len; j++) { + VmIpAddress *cachedIp = &cachedNic->ips.ips_val[j]; Bool foundIP = FALSE; - - cachedIpAddress = DblLnkLst_Container(curCachedIpLink, - VmIpAddressEntry, - links); + u_int k; - if (cachedIpAddress) { - currentCachedIp = cachedIpAddress->ipEntryProto.ipAddress; - } else { - break; - } - - DblLnkLst_ForEach(matchedIpAddressLink, &matchedNIC->ipAddressList) { - VmIpAddressEntry *matchedIpAddressEntry = - DblLnkLst_Container(matchedIpAddressLink, - VmIpAddressEntry, - links); - - if (matchedIpAddressEntry) { - if (strncmp(matchedIpAddressEntry->ipEntryProto.ipAddress, - currentCachedIp, - IP_ADDR_SIZE) == 0) { - foundIP = TRUE; - break; - } - } else { + for (k = 0; k < matchedNic->ips.ips_len; k++) { + VmIpAddress *matchedIp = &matchedNic->ips.ips_val[k]; + if (0 == strncmp(cachedIp->ipAddress, + matchedIp->ipAddress, + NICINFO_MAX_IP_LEN)) { + foundIP = TRUE; break; } } - if (FALSE == foundIP) { /* This ip address couldn't be found and has been modified. */ - Debug("GuestInfo: mac address %s, ipaddress %s deleted\n", currentMac, - currentCachedIp); + Debug("GuestInfo: mac address %s, ipaddress %s deleted\n", + cachedNic->macAddress, + cachedIp->ipAddress); return TRUE; } - } - - } - - return FALSE; -} - - -/* - *---------------------------------------------------------------------- - * - * GuestInfoSerializeNicInfo -- - * - * Now that NicInfo is not fixed size, serialize nicInfo into a - * buffer, in order to send it over wire. - * - * Results: - * - * TRUE if successful, FALSE otherwise. - * - * Side effects: - * - * None. - * - *---------------------------------------------------------------------- - */ - -Bool -GuestInfoSerializeNicInfo(NicInfo *nicInfo, // IN - char buffer[GUESTMSG_MAX_IN_SIZE], // OUT - size_t *bufferLen) // OUT -{ - char *buf; - char *info; - size_t entrySize; - DblLnkLst_Links *nicEntryLink; - - ASSERT_ON_COMPILE(sizeof nicInfo->nicInfoProto.version == 4); - ASSERT_ON_COMPILE(offsetof(NicInfoProtocol, nicEntrySizeOnWire) == 4); - ASSERT_ON_COMPILE(sizeof nicInfo->nicInfoProto.nicEntrySizeOnWire == 4); - ASSERT_ON_COMPILE(offsetof(NicInfoProtocol, numNicEntries) == 8); - ASSERT_ON_COMPILE(sizeof nicInfo->nicInfoProto.numNicEntries == 4); - ASSERT_ON_COMPILE(offsetof(NicInfoProtocol, totalInfoSizeOnWire) == 12); - ASSERT_ON_COMPILE(sizeof nicInfo->nicInfoProto.totalInfoSizeOnWire == 4); - - if ((NULL == nicInfo) || - (NULL == buffer ) || - (NULL == bufferLen)) { - return FALSE; - } - - if (0 == nicInfo->nicInfoProto.numNicEntries) { - return FALSE; - } - - nicInfo->nicInfoProto.totalInfoSizeOnWire = 0; - nicInfo->nicInfoProto.nicEntrySizeOnWire = sizeof(NicEntryProtocol); - - buf = buffer; - info = (char *)(&nicInfo->nicInfoProto); - entrySize = sizeof nicInfo->nicInfoProto; - - memcpy(buf, info, entrySize); - nicInfo->nicInfoProto.totalInfoSizeOnWire += (uint32) entrySize; - - buf += entrySize; - - DblLnkLst_ForEach(nicEntryLink, &nicInfo->nicList) { - NicEntry *nicEntry; - DblLnkLst_Links *ipAddrLink; - VmIpAddressEntry *ipAddressCur; - char *nicEntryBuf = buf; - - nicEntry = DblLnkLst_Container(nicEntryLink, NicEntry, links); - nicEntry->nicEntryProto.totalNicEntrySizeOnWire = 0; - nicEntry->nicEntryProto.ipAddressSizeOnWire = sizeof(VmIpAddressEntryProtocol); - - info = (char *)(&nicEntry->nicEntryProto); - - entrySize = sizeof nicEntry->nicEntryProto; - - /* to prevent buffer overflow */ - if (buf + entrySize - buffer < GUESTMSG_MAX_IN_SIZE) { - memcpy(buf, info, entrySize); - nicEntry->nicEntryProto.totalNicEntrySizeOnWire += (uint32) entrySize; - nicInfo->nicInfoProto.totalInfoSizeOnWire += (uint32) entrySize; - } else { - return FALSE; } - buf += entrySize; - - entrySize = sizeof ipAddressCur->ipEntryProto; - - DblLnkLst_ForEach(ipAddrLink, &nicEntry->ipAddressList) { - ipAddressCur = DblLnkLst_Container(ipAddrLink, VmIpAddressEntry, links); - ipAddressCur->ipEntryProto.totalIpEntrySizeOnWire = 0; - info = (char *)(&ipAddressCur->ipEntryProto); - - if (info) { - /* to prevent buffer overflow */ - if (buf + entrySize - buffer < GUESTMSG_MAX_IN_SIZE) { - memcpy(buf, info, entrySize); - ipAddressCur->ipEntryProto.totalIpEntrySizeOnWire += - (uint32) entrySize; - nicEntry->nicEntryProto.totalNicEntrySizeOnWire += - (uint32) entrySize; - nicInfo->nicInfoProto.totalInfoSizeOnWire += - (uint32) entrySize; - } else { - return FALSE; - } - } - - /* - * Update total size portion that was just calculated. - */ - memcpy(buf + offsetof(VmIpAddressEntryProtocol, - totalIpEntrySizeOnWire), - &ipAddressCur->ipEntryProto.totalIpEntrySizeOnWire, - sizeof ipAddressCur->ipEntryProto.totalIpEntrySizeOnWire); - buf += entrySize; - } - /* - * Update total size portion that was just calculated. - */ - memcpy(nicEntryBuf + offsetof(NicEntryProtocol , - totalNicEntrySizeOnWire), - &nicEntry->nicEntryProto.totalNicEntrySizeOnWire, - sizeof nicEntry->nicEntryProto.totalNicEntrySizeOnWire); } - *bufferLen = buf + entrySize - buffer; - - /* - * Update total size portion that was just calculated. - */ - memcpy(buffer + offsetof(NicInfoProtocol, totalInfoSizeOnWire), - &nicInfo->nicInfoProto.totalInfoSizeOnWire, - sizeof nicInfo->nicInfoProto.totalInfoSizeOnWire); - - return TRUE; + return FALSE; } @@ -1200,49 +884,32 @@ */ int -PrintNicInfo(NicInfo *nicInfo, // IN +PrintNicInfo(GuestNicList *nicInfo, // IN int (*PrintFunc)(const char *, ...)) // IN { int ret = 0; - uint32 i = 0; - DblLnkLst_Links *nicEntryLink; - - - ret += PrintFunc("NicInfo: count: %d\n", nicInfo->nicInfoProto.numNicEntries); - DblLnkLst_ForEach(nicEntryLink, &nicInfo->nicList) { - uint32 j = 0; - DblLnkLst_Links *ipAddrLink; - NicEntry *nicEntry = DblLnkLst_Container(nicEntryLink, - NicEntry, - links); - if (nicEntry) { - ret += PrintFunc("NicInfo: nic [%d/%d] mac: %s", - i+1, - nicInfo->nicInfoProto.numNicEntries, - nicEntry->nicEntryProto.macAddress); - } else { - break; - } + u_int i = 0; - DblLnkLst_ForEach(ipAddrLink, &nicEntry->ipAddressList) { - VmIpAddressEntry *ipAddress = DblLnkLst_Container( - ipAddrLink, - VmIpAddressEntry, - links); - - if (ipAddress) { - ret += PrintFunc("NicInfo: nic [%d/%d] IP [%d/%d]: %s", - i+1, - nicInfo->nicInfoProto.numNicEntries, - j+1, - nicEntry->nicEntryProto.numIPs, - ipAddress->ipEntryProto.ipAddress); - } else { - break; - } - j++; + ret += PrintFunc("NicInfo: count: %ud\n", nicInfo->nics.nics_len); + for (i = 0; i < nicInfo->nics.nics_len; i++) { + u_int j; + GuestNic *nic = &nicInfo->nics.nics_val[i]; + + ret += PrintFunc("NicInfo: nic [%d/%d] mac: %s", + i+1, + nicInfo->nics.nics_len, + nic->macAddress); + + for (j = 0; j < nic->ips.ips_len; j++) { + VmIpAddress *ipAddress = &nic->ips.ips_val[j]; + + ret += PrintFunc("NicInfo: nic [%d/%d] IP [%d/%d]: %s", + i+1, + nicInfo->nics.nics_len, + j+1, + nic->ips.ips_len, + ipAddress->ipAddress); } - i++; } return ret; @@ -1269,13 +936,13 @@ */ Bool -DiskInfoChanged(PDiskInfo diskInfo) // IN: +DiskInfoChanged(PGuestDiskInfo diskInfo) // IN: { int index; char *name; int i; int matchedPartition; - PDiskInfo cachedDiskInfo; + PGuestDiskInfo cachedDiskInfo; cachedDiskInfo = &gInfoCache.diskInfo; @@ -1302,12 +969,12 @@ return TRUE; } else { /* Compare the free space. */ - if (diskInfo->partitionList[matchedPartition].freeBytes != + if (diskInfo->partitionList[matchedPartition].freeBytes != cachedDiskInfo->partitionList[index].freeBytes) { Debug("GuestInfo: free space changed\n"); return TRUE; } - if (diskInfo->partitionList[matchedPartition].totalBytes != + if (diskInfo->partitionList[matchedPartition].totalBytes != cachedDiskInfo->partitionList[index].totalBytes) { Debug("GuestInfo: total space changed\n"); return TRUE; @@ -1322,100 +989,12 @@ /* *---------------------------------------------------------------------- * - * GuestInfoGetDiskInfo -- - * - * Get disk information. - * - * Results: - * - * TRUE if successful, FALSE otherwise. - * - * Side effects: - * - * Allocates memory for di->partitionList. - * - *---------------------------------------------------------------------- - */ - -Bool -GuestInfoGetDiskInfo(PDiskInfo di) // IN/OUT -{ - int i = 0; - WiperPartition_List *pl = NULL; - unsigned int partCount = 0; - uint64 freeBytes = 0; - uint64 totalBytes = 0; - WiperPartition nextPartition; - unsigned int partNameSize = 0; - Bool success = FALSE; - - ASSERT(di); - partNameSize = sizeof (di->partitionList)[0].name; - di->numEntries = 0; - di->partitionList = NULL; - - /* Get partition list. */ - if (!Wiper_Init(NULL)) { - Debug("GetDiskInfo: ERROR: could not initialize wiper library\n"); - return FALSE; - } - - pl = WiperPartition_Open(); - if (pl == NULL) { - Debug("GetDiskInfo: ERROR: could not get partition list\n"); - return FALSE; - } - - for (i = 0; i < pl->size; i++) { - nextPartition = pl->partitions[i]; - if (!strlen(nextPartition.comment)) { - PPartitionEntry newPartitionList; - unsigned char *error; - error = WiperSinglePartition_GetSpace(&nextPartition, &freeBytes, &totalBytes); - if (strlen(error)) { - Debug("GetDiskInfo: ERROR: could not get space for partition %s: %s\n", - nextPartition.mountPoint, error); - goto out; - } - - if (strlen(nextPartition.mountPoint) + 1 > partNameSize) { - Debug("GetDiskInfo: ERROR: Partition name buffer too small\n"); - goto out; - } - - newPartitionList = realloc(di->partitionList, - (partCount + 1) * sizeof *di->partitionList); - if (newPartitionList == NULL) { - Debug("GetDiskInfo: ERROR: could not allocate partition list.\n"); - goto out; - } - di->partitionList = newPartitionList; - - Str_Strcpy((di->partitionList)[partCount].name, nextPartition.mountPoint, - partNameSize); - (di->partitionList)[partCount].freeBytes = freeBytes; - (di->partitionList)[partCount].totalBytes = totalBytes; - partCount++; - } - } - - di->numEntries = partCount; - success = TRUE; - out: - WiperPartition_Close(pl); - return success; -} - - -/* - *---------------------------------------------------------------------- - * * GuestInfoClearCache -- * * Clears the cached guest info data. * * Results: - * None. + * None. * * Side effects: * gInfoCache is cleared. @@ -1424,67 +1003,16 @@ */ static void -GuestInfoClearCache(void) +GuestInfoClearCache(void) { - int i; + int i; for (i = 0; i < INFO_MAX; i++) { gInfoCache.value[i][0] = 0; } - - GuestInfo_FreeDynamicMemoryInNicInfo(&gInfoCache.nicInfo); - - gInfoCache.nicInfo.nicInfoProto.numNicEntries = 0; - gInfoCache.diskInfo.numEntries = 0; - - if (gInfoCache.diskInfo.partitionList != NULL) { - free(gInfoCache.diskInfo.partitionList); - gInfoCache.diskInfo.partitionList = NULL; - } -} - - -/* - *----------------------------------------------------------------------------- - * - * GetAvailableDiskSpace -- - * - * Get the amount of disk space available on the volume the FCP (file copy/ - * paste) staging area is in. DnD and FCP use same staging area in guest. - * But it is only called in host->guest FCP case. DnD checks guest available - * disk space in host side (UI). - * - * Results: - * Available disk space size if succeed, otherwise 0. - * - * Side effects: - * None. - * - *----------------------------------------------------------------------------- - */ -uint64 -GetAvailableDiskSpace(char *pathName) -{ - WiperPartition p; - uint64 freeBytes = 0; - uint64 totalBytes = 0; - char *wiperError; - - Wiper_Init(NULL); - - if (strlen(pathName) > sizeof p.mountPoint) { - Debug("GetAvailableDiskSpace: gFileRoot path too long\n"); - return 0; - } - Str_Strcpy((char *)p.mountPoint, pathName, sizeof p.mountPoint); - wiperError = (char *)WiperSinglePartition_GetSpace(&p, &freeBytes, &totalBytes); - if (strlen(wiperError) > 0) { - Debug("GetAvailableDiskSpace: error using wiper lib: %s\n", wiperError); - return 0; - } - Debug("GetAvailableDiskSpace: free bytes is %"FMT64"u\n", freeBytes); - return freeBytes; + VMX_XDR_FREE(xdr_GuestNicList, &gInfoCache.nicInfo); + memset(&gInfoCache.nicInfo, 0, sizeof gInfoCache.nicInfo); } @@ -1518,73 +1046,3 @@ return ret; } - -/* - *---------------------------------------------------------------------- - * - * NicInfo_AddNicEntry -- - * - * Add a Nic entry into NicInfo. macAddress of the NicEntry is - * initialized with the input parameter - * - * Results: - * newly allocated NicEntry - * - * Side effects: - * All linked list in the new entry is initialized. Number of Nic - * entries is bumped up by 1. - *---------------------------------------------------------------------- - */ - -NicEntry * -NicInfo_AddNicEntry(NicInfo *nicInfo, // IN/OUT - const char macAddress[MAC_ADDR_SIZE]) // IN -{ - NicEntry *nicEntryCur = NULL; - - nicEntryCur = Util_SafeCalloc(1, sizeof(*nicEntryCur)); - DblLnkLst_Init(&nicEntryCur->ipAddressList); - DblLnkLst_Init(&nicEntryCur->links); - DblLnkLst_LinkLast(&nicInfo->nicList, &nicEntryCur->links); - - Str_Strcpy(nicEntryCur->nicEntryProto.macAddress, macAddress, MAC_ADDR_SIZE); - nicInfo->nicInfoProto.numNicEntries++; - - return nicEntryCur; -} - - -/* - *---------------------------------------------------------------------- - * - * NicEntry_AddIpAddress -- - * - * Add an IP address entry into NicEntry - * - * Results: - * Newly allocated IP address Entry - * - * Side effects: - * Linked list in the new IP address entry is initialized.Number - * of IP addresses on the NIC is bumped up by 1 - * - *---------------------------------------------------------------------- - */ - -VmIpAddressEntry * -NicEntry_AddIpAddress(NicEntry *nicEntry, // IN/OUT - const char *ipAddr, // IN - const uint32 af_type) // IN -{ - VmIpAddressEntry *ipAddressCur; - - ipAddressCur = Util_SafeCalloc(1, sizeof *ipAddressCur); - DblLnkLst_Init(&ipAddressCur->links); - DblLnkLst_LinkLast(&nicEntry->ipAddressList, &ipAddressCur->links); - memcpy(ipAddressCur->ipEntryProto.ipAddress, ipAddr, IP_ADDR_SIZE); - - nicEntry->nicEntryProto.numIPs++; - - return ipAddressCur; -} - diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/guestInfo/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/guestInfo/Makefile.am --- open-vm-tools-2008.01.23-74039/lib/guestInfo/Makefile.am 2008-01-28 08:02:49.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/guestInfo/Makefile.am 2008-10-13 08:01:47.000000000 +0100 @@ -18,9 +18,11 @@ noinst_LIBRARIES = libGuestInfo.a libGuestInfo_a_SOURCES = +libGuestInfo_a_SOURCES += guestInfo.c libGuestInfo_a_SOURCES += guestInfoServer.c libGuestInfo_a_SOURCES += guestInfoPosix.c +libGuestInfo_a_SOURCES += guestInfoPerfMonLinux.c + +AM_CFLAGS = $(DNET_CPPFLAGS) +AM_CFLAGS += -I$(top_builddir)/include -AM_CFLAGS = -AM_CFLAGS += @COMMON_CFLAGS@ -AM_CFLAGS += $(DNET_CFLAGS) diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/guestInfo/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/guestInfo/Makefile.in --- open-vm-tools-2008.01.23-74039/lib/guestInfo/Makefile.in 2008-01-28 08:03:03.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/guestInfo/Makefile.in 2008-10-13 08:02:13.000000000 +0100 @@ -52,7 +52,10 @@ subdir = lib/guestInfo DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +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)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -61,11 +64,12 @@ ARFLAGS = cru libGuestInfo_a_AR = $(AR) $(ARFLAGS) libGuestInfo_a_LIBADD = -am_libGuestInfo_a_OBJECTS = guestInfoServer.$(OBJEXT) \ - guestInfoPosix.$(OBJEXT) +am_libGuestInfo_a_OBJECTS = guestInfo.$(OBJEXT) \ + guestInfoServer.$(OBJEXT) guestInfoPosix.$(OBJEXT) \ + guestInfoPerfMonLinux.$(OBJEXT) libGuestInfo_a_OBJECTS = $(am_libGuestInfo_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp +depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -91,8 +95,6 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -COMMON_CFLAGS = @COMMON_CFLAGS@ -COMMON_PROG_CFLAGS = @COMMON_PROG_CFLAGS@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -103,45 +105,57 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ -ECHO = @ECHO@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GREP = @GREP@ -GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_AUTH_CFLAGS = @LIB_AUTH_CFLAGS@ -LIB_FILE_CFLAGS = @LIB_FILE_CFLAGS@ -LIB_HGFS_SERVER_CFLAGS = @LIB_HGFS_SERVER_CFLAGS@ -LIB_IMPERSONATE_CFLAGS = @LIB_IMPERSONATE_CFLAGS@ -LIB_MISC_CFLAGS = @LIB_MISC_CFLAGS@ -LIB_PROC_MGR_CFLAGS = @LIB_PROC_MGR_CFLAGS@ -LIB_STRING_CFLAGS = @LIB_STRING_CFLAGS@ -LIB_USER_CFLAGS = @LIB_USER_CFLAGS@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -149,27 +163,35 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ VERSION = @VERSION@ -VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -200,6 +222,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -215,8 +238,9 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LIBRARIES = libGuestInfo.a -libGuestInfo_a_SOURCES = guestInfoServer.c guestInfoPosix.c -AM_CFLAGS = @COMMON_CFLAGS@ $(DNET_CFLAGS) +libGuestInfo_a_SOURCES = guestInfo.c guestInfoServer.c \ + guestInfoPosix.c guestInfoPerfMonLinux.c +AM_CFLAGS = $(DNET_CPPFLAGS) -I$(top_builddir)/include all: all-am .SUFFIXES: @@ -264,6 +288,8 @@ distclean-compile: -rm -f *.tab.c +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/guestInfo.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/guestInfoPerfMonLinux.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/guestInfoPosix.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/guestInfoServer.Po@am__quote@ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/guestRpc/ghiCommonDefines.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/guestRpc/ghiCommonDefines.h --- open-vm-tools-2008.01.23-74039/lib/guestRpc/ghiCommonDefines.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/guestRpc/ghiCommonDefines.h 2008-10-13 08:01:50.000000000 +0100 @@ -0,0 +1,41 @@ +/********************************************************* + * Copyright (C) 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. + * + *********************************************************/ + +/* + * ghiCommonDefines.h -- + * + * Common definitions of maximum sizes/lengths for data used in + * guest/host integration XDR serialization. + */ + +#ifndef _GHI_COMMON_DEFINES_H_ +#define _GHI_COMMON_DEFINES_H_ + +#define GHI_MAX_NUM_ACTION_URI_PAIRS 16 +#define GHI_HANDLERS_SUFFIX_MAX_LEN 32 +#define GHI_HANDLERS_MIMETYPE_MAX_LEN 256 +#define GHI_HANDLERS_UTI_MAX_LEN 256 + +/* + * The Windows MAX_PATH define specifies that paths may be up to 260 character + * units in length. To allow for expansion when going to UTF8 we multiply that + * value by 4 here. + */ +#define GHI_HANDLERS_ACTIONURI_MAX_PATH 1040 + +#endif // ifndef _GHI_COMMON_DEFINES_H_ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/guestRpc/ghiGetBinaryHandlers.x /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/guestRpc/ghiGetBinaryHandlers.x --- open-vm-tools-2008.01.23-74039/lib/guestRpc/ghiGetBinaryHandlers.x 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/guestRpc/ghiGetBinaryHandlers.x 2008-10-13 08:01:50.000000000 +0100 @@ -0,0 +1,133 @@ +/********************************************************* + * Copyright (C) 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. + * + *********************************************************/ + +/* + * ghiGetBinaryHandlers.x -- + * + * Definition of the data structures used in the GuestRpc commands to + * provide information about the types of files a given binary supports. + */ + + +/* + * Enumerates the different versions of the messages. + */ +enum GHIBinaryHandlersVersion { + GHI_BINARY_HANDLERS_V1 = 1 +}; + +const GHI_HANDLERS_SUFFIX_MAX_LEN = 32; +const GHI_HANDLERS_MIMETYPE_MAX_LEN = 256; +const GHI_HANDLERS_UTI_MAX_LEN = 256; +const GHI_HANDLERS_FRIENDLY_NAME_MAX_LEN = 256; +const GHI_HANDLERS_MAX_NUM_ICONS = 8; +const GHI_HANDLERS_VERB_MAX_LEN = 64; +const GHI_MAX_NUM_ACTION_URI_PAIRS = 16; + +/* + * The Windows MAX_PATH define specifies that paths may be up to 260 character + * units in length. To allow for expansion when going to UTF8 we multiply that + * value by 4 here. + */ +const GHI_HANDLERS_ACTIONURI_MAX_PATH = 1040; + +/* + * Maximum number of filetypes that may be encoded in a single + * XDR array. + */ +const GHI_MAX_NUM_BINARY_HANDLERS = 128; + +struct GHIBinaryHandlersIconDetails { + /* + * The icon dimensions in pixels + */ + int width; + int height; + + /* + * A string identifier for this icon that can be used to retrieve + * the specific pixel data using GHI_GET_ICON_DATA + */ + string identifier; +}; + +struct GHIBinaryHandlersActionURIPair { + /* + * The verb for the action URI (typically something like run or print). + */ + string verb; + + /* + * The executable path to use when launching the binary with this particular + * filetype and verb. Some filetypes may require additional or different command line + * arguments for a given verb that can be encoded here. + */ + string actionURI; +}; + +struct GHIBinaryHandlersDetails { + /* + * The file suffix (including leading period character). + */ + string suffix; + + /* + * A mimetype - if available. + */ + string mimetype; + + /* + * A UTI (universal type identifier) - if available. + */ + string UTI; + + /* + * A list of the verbs (run, print etc.) and their matching + * action URIs. + */ + struct GHIBinaryHandlersActionURIPair actionURIs; + + /* + * A friendly name displayed for this document/filetype. + */ + string friendlyName; + + /* + * A list of the different sized icons for this filetype. + */ + struct GHIBinaryHandlersIconDetails icons; +}; + +struct GHIBinaryHandlersList { + struct GHIBinaryHandlersDetails handlers; +}; + +/* + * This defines the protocol for a 'get.binary.handlers' message. The union allows + * us to create new versions of the protocol later by creating new values + * in the GHIBinaryHandlersVersion 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 GHIBinaryHandlers switch (GHIBinaryHandlersVersion ver) { +case GHI_BINARY_HANDLERS_V1: + struct GHIBinaryHandlersList *handlersV1; +}; + diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/guestRpc/ghiProtocolHandler.x /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/guestRpc/ghiProtocolHandler.x --- open-vm-tools-2008.01.23-74039/lib/guestRpc/ghiProtocolHandler.x 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/guestRpc/ghiProtocolHandler.x 2008-10-13 08:01:50.000000000 +0100 @@ -0,0 +1,69 @@ +/********************************************************* + * Copyright (C) 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. + * + *********************************************************/ + +/* + * ghiProtocolHandler.x -- + * + * Definition of the data structures used in the GuestRpc commands to + * provide information about the guests protocol handlers (applications + * that are launched when opening URLS). + */ + +/* + * Neither RFC 1630 or 1738 seem to specify an actual maximum, current + * usage implies that 64 bytes should be sufficient + */ +const GHI_URL_SCHEME_NAME_MAX_LEN = 64; + +/* + * The Windows MAX_PATH define specifies that paths may be up to 260 character + * units in length. To allow for expansion when going to UTF8 we multiply that + * value by 4 here. + */ +const GHI_PROTOCOL_HANDLER_MAX_PATH = 1040; + +/* + * Maximum number of Protocol Handlers that may be encoded in a single + * XDR array. + */ +const GHI_MAX_NUM_PROTOCOL_HANDLERS = 32; + + +struct GHIProtocolHandlerDetails { + /* + * The scheme name of a URL is typically, http, ftp, mailto, feed etc. + */ + string schemeName; + + /* + * The action URI is used in conjunction with UNITY_RPC_SHELL_OPEN to + * instruct the guest to open a specified URL. + */ + string handlerActionURI; + + /* + * The executable path can be used as a parameter to + * UNITY_RPC_GET_BINARY_INFO to retrieve additional binary information such + * as Icon images. + */ + string executablePath; +}; + +struct GHIProtocolHandlerList { + struct GHIProtocolHandlerDetails handlers; +}; diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/guestRpc/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/guestRpc/Makefile.am --- open-vm-tools-2008.01.23-74039/lib/guestRpc/Makefile.am 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/guestRpc/Makefile.am 2008-10-13 08:01:47.000000000 +0100 @@ -0,0 +1,99 @@ +################################################################################ +### Copyright 2008 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_LIBRARIES = libGuestRpc.a + +libGuestRpc_a_SOURCES = +libGuestRpc_a_SOURCES += ghiGetBinaryHandlers_xdr.c +libGuestRpc_a_SOURCES += ghiProtocolHandler_xdr.c +libGuestRpc_a_SOURCES += nicinfo_xdr.c +libGuestRpc_a_SOURCES += unityActive_xdr.c + +nodist_libGuestRpc_a_SOURCES = +nodist_libGuestRpc_a_SOURCES += ghiGetBinaryHandlers.h +nodist_libGuestRpc_a_SOURCES += ghiGetBinaryHandlers_xdr.c +nodist_libGuestRpc_a_SOURCES += ghiProtocolHandler.h +nodist_libGuestRpc_a_SOURCES += ghiProtocolHandler_xdr.c +nodist_libGuestRpc_a_SOURCES += nicinfo.h +nodist_libGuestRpc_a_SOURCES += nicinfo_xdr.c +nodist_libGuestRpc_a_SOURCES += unityActive.h +nodist_libGuestRpc_a_SOURCES += unityActive_xdr.c + +# XXX: Autoreconf complains about this and recommends using AM_CFLAGS instead. +# Neither that nor libGuestRpc_a_CFLAGS work, though. What gives? +CFLAGS += -Wno-unused + +CLEANFILES = +CLEANFILES += ghiGetBinaryHandlers.h +CLEANFILES += ghiGetBinaryHandlers_xdr.c +CLEANFILES += ghiProtocolHandler.h +CLEANFILES += ghiProtocolHandler_xdr.c +CLEANFILES += nicinfo.h +CLEANFILES += nicinfo_xdr.c +CLEANFILES += unityActive.h +CLEANFILES += unityActive_xdr.c + +EXTRA_DIST = +EXTRA_DIST += ghiGetBinaryHandlers.x +EXTRA_DIST += ghiProtocolHandler.x +EXTRA_DIST += nicinfo.x +EXTRA_DIST += unityActive.x + +## `make clean` should also remove the copied headers. +clean-local: + $(RM) -rf $(top_builddir)/lib/include/guestrpc + +ghiGetBinaryHandlers.h: ghiGetBinaryHandlers.x + $(RPCGEN) -h -o $@ ghiGetBinaryHandlers.x + $(SED) 's,rpc/rpc\.h,vmxrpc.h,' $@ > $@.tmp + mv $@.tmp $@ + $(MKDIR_P) $(top_builddir)/lib/include/guestrpc + cp $@ $(top_builddir)/lib/include/guestrpc + +ghiGetBinaryHandlers_xdr.c: ghiGetBinaryHandlers.x ghiGetBinaryHandlers.h + $(RPCGEN) -c -o $@ ghiGetBinaryHandlers.x + +ghiProtocolHandler.h: ghiProtocolHandler.x + $(RPCGEN) -h -o $@ ghiProtocolHandler.x + $(SED) 's,rpc/rpc\.h,vmxrpc.h,' $@ > $@.tmp + mv $@.tmp $@ + $(MKDIR_P) $(top_builddir)/lib/include/guestrpc + cp $@ $(top_builddir)/lib/include/guestrpc + +ghiProtocolHandler_xdr.c: ghiProtocolHandler.x ghiProtocolHandler.h + $(RPCGEN) -c -o $@ ghiProtocolHandler.x + +nicinfo.h: nicinfo.x + $(RPCGEN) -h -o $@ nicinfo.x + $(SED) 's,rpc/rpc\.h,vmxrpc.h,' $@ > $@.tmp + mv $@.tmp $@ + $(MKDIR_P) $(top_builddir)/lib/include/guestrpc + cp $@ $(top_builddir)/lib/include/guestrpc + +nicinfo_xdr.c: nicinfo.x nicinfo.h + $(RPCGEN) -c -o $@ nicinfo.x + +unityActive.h: unityActive.x + $(RPCGEN) -h -o $@ unityActive.x + $(SED) 's,rpc/rpc\.h,vmxrpc.h,' $@ > $@.tmp + mv $@.tmp $@ + $(MKDIR_P) $(top_builddir)/lib/include/guestrpc + cp $@ $(top_builddir)/lib/include/guestrpc + +unityActive_xdr.c: unityActive.x unityActive.h + $(RPCGEN) -c -o $@ unityActive.x + diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/guestRpc/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/guestRpc/Makefile.in --- open-vm-tools-2008.01.23-74039/lib/guestRpc/Makefile.in 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/guestRpc/Makefile.in 2008-10-13 08:02:13.000000000 +0100 @@ -0,0 +1,561 @@ +# 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 2008 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)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) +ARFLAGS = cru +libGuestRpc_a_AR = $(AR) $(ARFLAGS) +libGuestRpc_a_LIBADD = +am_libGuestRpc_a_OBJECTS = ghiGetBinaryHandlers_xdr.$(OBJEXT) \ + ghiProtocolHandler_xdr.$(OBJEXT) nicinfo_xdr.$(OBJEXT) \ + unityActive_xdr.$(OBJEXT) +nodist_libGuestRpc_a_OBJECTS = ghiGetBinaryHandlers_xdr.$(OBJEXT) \ + ghiProtocolHandler_xdr.$(OBJEXT) nicinfo_xdr.$(OBJEXT) \ + unityActive_xdr.$(OBJEXT) +libGuestRpc_a_OBJECTS = $(am_libGuestRpc_a_OBJECTS) \ + $(nodist_libGuestRpc_a_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_a_SOURCES) $(nodist_libGuestRpc_a_SOURCES) +DIST_SOURCES = $(libGuestRpc_a_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. +# Neither that nor libGuestRpc_a_CFLAGS work, though. What gives? +CFLAGS = @CFLAGS@ -Wno-unused +COMMON_XLIBS = @COMMON_XLIBS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ +DNET_LIBS = @DNET_LIBS@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ +GTK_LIBS = @GTK_LIBS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ +HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ +MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ +RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ +VERSION = @VERSION@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +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@ +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@ +lt_ECHO = @lt_ECHO@ +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_LIBRARIES = libGuestRpc.a +libGuestRpc_a_SOURCES = ghiGetBinaryHandlers_xdr.c \ + ghiProtocolHandler_xdr.c nicinfo_xdr.c unityActive_xdr.c +nodist_libGuestRpc_a_SOURCES = ghiGetBinaryHandlers.h \ + ghiGetBinaryHandlers_xdr.c ghiProtocolHandler.h \ + ghiProtocolHandler_xdr.c nicinfo.h nicinfo_xdr.c unityActive.h \ + unityActive_xdr.c +CLEANFILES = ghiGetBinaryHandlers.h ghiGetBinaryHandlers_xdr.c \ + ghiProtocolHandler.h ghiProtocolHandler_xdr.c nicinfo.h \ + nicinfo_xdr.c unityActive.h unityActive_xdr.c +EXTRA_DIST = ghiGetBinaryHandlers.x ghiProtocolHandler.x nicinfo.x \ + unityActive.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-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) +libGuestRpc.a: $(libGuestRpc_a_OBJECTS) $(libGuestRpc_a_DEPENDENCIES) + -rm -f libGuestRpc.a + $(libGuestRpc_a_AR) libGuestRpc.a $(libGuestRpc_a_OBJECTS) $(libGuestRpc_a_LIBADD) + $(RANLIB) libGuestRpc.a + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ghiGetBinaryHandlers_xdr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ghiProtocolHandler_xdr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nicinfo_xdr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unityActive_xdr.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 $(LIBRARIES) +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-local \ + clean-noinstLIBRARIES 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-local clean-noinstLIBRARIES 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 + + +clean-local: + $(RM) -rf $(top_builddir)/lib/include/guestrpc + +ghiGetBinaryHandlers.h: ghiGetBinaryHandlers.x + $(RPCGEN) -h -o $@ ghiGetBinaryHandlers.x + $(SED) 's,rpc/rpc\.h,vmxrpc.h,' $@ > $@.tmp + mv $@.tmp $@ + $(MKDIR_P) $(top_builddir)/lib/include/guestrpc + cp $@ $(top_builddir)/lib/include/guestrpc + +ghiGetBinaryHandlers_xdr.c: ghiGetBinaryHandlers.x ghiGetBinaryHandlers.h + $(RPCGEN) -c -o $@ ghiGetBinaryHandlers.x + +ghiProtocolHandler.h: ghiProtocolHandler.x + $(RPCGEN) -h -o $@ ghiProtocolHandler.x + $(SED) 's,rpc/rpc\.h,vmxrpc.h,' $@ > $@.tmp + mv $@.tmp $@ + $(MKDIR_P) $(top_builddir)/lib/include/guestrpc + cp $@ $(top_builddir)/lib/include/guestrpc + +ghiProtocolHandler_xdr.c: ghiProtocolHandler.x ghiProtocolHandler.h + $(RPCGEN) -c -o $@ ghiProtocolHandler.x + +nicinfo.h: nicinfo.x + $(RPCGEN) -h -o $@ nicinfo.x + $(SED) 's,rpc/rpc\.h,vmxrpc.h,' $@ > $@.tmp + mv $@.tmp $@ + $(MKDIR_P) $(top_builddir)/lib/include/guestrpc + cp $@ $(top_builddir)/lib/include/guestrpc + +nicinfo_xdr.c: nicinfo.x nicinfo.h + $(RPCGEN) -c -o $@ nicinfo.x + +unityActive.h: unityActive.x + $(RPCGEN) -h -o $@ unityActive.x + $(SED) 's,rpc/rpc\.h,vmxrpc.h,' $@ > $@.tmp + mv $@.tmp $@ + $(MKDIR_P) $(top_builddir)/lib/include/guestrpc + cp $@ $(top_builddir)/lib/include/guestrpc + +unityActive_xdr.c: unityActive.x unityActive.h + $(RPCGEN) -c -o $@ unityActive.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: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/guestRpc/nicinfo.x /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/guestRpc/nicinfo.x --- open-vm-tools-2008.01.23-74039/lib/guestRpc/nicinfo.x 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/guestRpc/nicinfo.x 2008-10-13 08:01:50.000000000 +0100 @@ -0,0 +1,78 @@ +/********************************************************* + * Copyright (C) 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. + * + *********************************************************/ + +/* + * 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_V2 = 2 +}; + +/* + * 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 = 64; +const NICINFO_MAX_NICS = 16; + +/* MAC Addresses are "AA:BB:CC:DD:EE:FF" = 18 bytes. */ +const NICINFO_MAC_LEN = 18; + +struct VmIpAddress { + uint32 addressFamily; + Bool dhcpEnabled; + char ipAddress[NICINFO_MAX_IP_LEN]; + 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; +}; + +/* + * 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; +}; + diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/guestRpc/unityActive.x /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/guestRpc/unityActive.x --- open-vm-tools-2008.01.23-74039/lib/guestRpc/unityActive.x 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/guestRpc/unityActive.x 2008-10-13 08:01:50.000000000 +0100 @@ -0,0 +1,33 @@ +/********************************************************* + * Copyright (C) 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. + * + *********************************************************/ + +/* + * unityActive.x -- + * + * Definition of the data structures used in the GuestRpc commands to + * provide information about the unity state. + */ + +enum UnityActiveVersion { + UNITY_ACTIVE_V1 = 1 +}; + +union UnityActiveProto switch (UnityActiveVersion ver) { +case UNITY_ACTIVE_V1: + Bool unityActive; +}; diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/hgfs/cpName.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/hgfs/cpName.c --- open-vm-tools-2008.01.23-74039/lib/hgfs/cpName.c 2008-01-28 08:02:51.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/hgfs/cpName.c 2008-10-13 08:01:51.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/hgfs/cpNameInt.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/hgfs/cpNameInt.h --- open-vm-tools-2008.01.23-74039/lib/hgfs/cpNameInt.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/hgfs/cpNameInt.h 2008-10-13 08:01:51.000000000 +0100 @@ -0,0 +1,54 @@ +/********************************************************* + * Copyright (C) 1998 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. + * + *********************************************************/ + +/* + * cpNameInt.h -- + * + * Cross-platform name format used by hgfs. + * + */ + + +#ifndef __CP_NAME_INT_H__ +#define __CP_NAME_INT_H__ + + +#include "vm_basic_types.h" + +/* + * Used by CPName_ConvertFrom + */ +int +CPNameConvertFrom(char const **bufIn, // IN/OUT: Input to convert + size_t *inSize, // IN/OUT: Size of input + size_t *outSize, // IN/OUT: Size of output buffer + char **bufOut, // IN/OUT: Output buffer + char pathSep); // IN: Path separator character + + +/* + * Common code for CPName_ConvertTo + */ +int +CPNameConvertTo(char const *nameIn, // IN: Buf to convert + size_t bufOutSize, // IN: Size of the output buffer + char *bufOut, // OUT: Output buffer + char pathSep, // IN: path separator to use + char *ignores); // IN: chars to not transfer to output + +#endif /* __CP_NAME_INT_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/hgfs/cpNameLinux.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/hgfs/cpNameLinux.c --- open-vm-tools-2008.01.23-74039/lib/hgfs/cpNameLinux.c 2008-01-28 08:02:51.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/hgfs/cpNameLinux.c 2008-10-13 08:01:51.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -24,7 +24,7 @@ * */ -#if defined(sun) && defined(SOL10) +#if defined(sun) && !defined(SOL9) #include #endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/hgfs/cpNameLite.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/hgfs/cpNameLite.c --- open-vm-tools-2008.01.23-74039/lib/hgfs/cpNameLite.c 2008-01-28 08:02:51.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/hgfs/cpNameLite.c 2008-10-13 08:01:51.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/hgfs/cpNameUtil.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/hgfs/cpNameUtil.c --- open-vm-tools-2008.01.23-74039/lib/hgfs/cpNameUtil.c 2008-01-28 08:02:51.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/hgfs/cpNameUtil.c 2008-10-13 08:01:51.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/hgfs/cpNameUtilInt.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/hgfs/cpNameUtilInt.h --- open-vm-tools-2008.01.23-74039/lib/hgfs/cpNameUtilInt.h 2008-01-28 08:02:51.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/hgfs/cpNameUtilInt.h 2008-10-13 08:01:51.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/hgfs/cpNameUtilLinux.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/hgfs/cpNameUtilLinux.c --- open-vm-tools-2008.01.23-74039/lib/hgfs/cpNameUtilLinux.c 2008-01-28 08:02:51.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/hgfs/cpNameUtilLinux.c 2008-10-13 08:01:51.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/hgfs/hgfsUtil.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/hgfs/hgfsUtil.c --- open-vm-tools-2008.01.23-74039/lib/hgfs/hgfsUtil.c 2008-01-28 08:02:51.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/hgfs/hgfsUtil.c 2008-10-13 08:01:51.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -142,7 +142,7 @@ * * Results: * 0 on success - * nonzero if time is not representable on UNIX + * nonzero if time is not representable on UNIX * * Side effects: * None @@ -156,7 +156,7 @@ { struct timespec tm; int ret; - + ret = HgfsConvertFromNtTimeNsec(&tm, ntTime); *unixTime = tm.tv_sec; return ret; @@ -215,6 +215,8 @@ return HGFS_STATUS_NO_SPACE; case ERROR_NOT_SUPPORTED: return HGFS_STATUS_OPERATION_NOT_SUPPORTED; + case ERROR_INVALID_PARAMETER: + return HGFS_STATUS_INVALID_PARAMETER; case HGFS_INTERNAL_STATUS_ERROR: default: return HGFS_STATUS_GENERIC_ERROR; @@ -253,6 +255,8 @@ return HGFS_STATUS_OPERATION_NOT_SUPPORTED; case ENAMETOOLONG: return HGFS_STATUS_NAME_TOO_LONG; + case EPARAMETERNOTSUPPORTED: + return HGFS_STATUS_INVALID_PARAMETER; case HGFS_INTERNAL_STATUS_ERROR: default: return HGFS_STATUS_GENERIC_ERROR; diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/hgfs/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/hgfs/Makefile.am --- open-vm-tools-2008.01.23-74039/lib/hgfs/Makefile.am 2008-01-28 08:02:49.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/hgfs/Makefile.am 2008-10-13 08:01:48.000000000 +0100 @@ -25,6 +25,3 @@ libHgfs_a_SOURCES += cpNameUtilLinux.c libHgfs_a_SOURCES += hgfsUtil.c libHgfs_a_SOURCES += staticEscape.c - -AM_CFLAGS = -AM_CFLAGS += @COMMON_CFLAGS@ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/hgfs/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/hgfs/Makefile.in --- open-vm-tools-2008.01.23-74039/lib/hgfs/Makefile.in 2008-01-28 08:03:04.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/hgfs/Makefile.in 2008-10-13 08:02:13.000000000 +0100 @@ -52,7 +52,10 @@ subdir = lib/hgfs DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +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)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -67,7 +70,7 @@ staticEscape.$(OBJEXT) libHgfs_a_OBJECTS = $(am_libHgfs_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp +depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -93,8 +96,6 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -COMMON_CFLAGS = @COMMON_CFLAGS@ -COMMON_PROG_CFLAGS = @COMMON_PROG_CFLAGS@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -105,45 +106,57 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ -ECHO = @ECHO@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GREP = @GREP@ -GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_AUTH_CFLAGS = @LIB_AUTH_CFLAGS@ -LIB_FILE_CFLAGS = @LIB_FILE_CFLAGS@ -LIB_HGFS_SERVER_CFLAGS = @LIB_HGFS_SERVER_CFLAGS@ -LIB_IMPERSONATE_CFLAGS = @LIB_IMPERSONATE_CFLAGS@ -LIB_MISC_CFLAGS = @LIB_MISC_CFLAGS@ -LIB_PROC_MGR_CFLAGS = @LIB_PROC_MGR_CFLAGS@ -LIB_STRING_CFLAGS = @LIB_STRING_CFLAGS@ -LIB_USER_CFLAGS = @LIB_USER_CFLAGS@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -151,27 +164,35 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ VERSION = @VERSION@ -VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -202,6 +223,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -219,7 +241,6 @@ noinst_LIBRARIES = libHgfs.a libHgfs_a_SOURCES = cpName.c cpNameLite.c cpNameLinux.c cpNameUtil.c \ cpNameUtilLinux.c hgfsUtil.c staticEscape.c -AM_CFLAGS = @COMMON_CFLAGS@ all: all-am .SUFFIXES: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/hgfs/staticEscape.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/hgfs/staticEscape.c --- open-vm-tools-2008.01.23-74039/lib/hgfs/staticEscape.c 2008-01-28 08:02:51.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/hgfs/staticEscape.c 2008-10-13 08:01:51.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/hgfsBd/hgfsBd.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/hgfsBd/hgfsBd.c --- open-vm-tools-2008.01.23-74039/lib/hgfsBd/hgfsBd.c 2008-01-28 08:02:50.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/hgfsBd/hgfsBd.c 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -42,9 +42,11 @@ /* *----------------------------------------------------------------------------- * - * HgfsBd_GetBuf -- + * HgfsBdGetBufInt -- * - * Get a buffer to send hgfs requests in. + * Allocates a buffer to send a hgfs request in. This can be either a + * HGFS_PACKET_MAX or HGFS_LARGE_PACKET_MAX size buffer depending on the + * external funciton called. * * Results: * Pointer to a buffer that has the correct backdoor command prefix for @@ -52,20 +54,20 @@ * NULL on failure (not enough memory). * * Side effects: - * None + * None. * *----------------------------------------------------------------------------- */ -char * -HgfsBd_GetBuf(void) +static char * +HgfsBdGetBufInt(size_t bufSize) { /* * Allocate a buffer that is large enough for an HGFS packet and the * synchronous HGFS command, write the command, and return a pointer that * points into the buffer, after the command. */ - size_t len = HGFS_PACKET_MAX + HGFS_SYNC_REQREP_CLIENT_CMD_LEN; + size_t len = bufSize + HGFS_SYNC_REQREP_CLIENT_CMD_LEN; char *buf = (char*) calloc(sizeof(char), len); if (!buf) { @@ -82,6 +84,51 @@ /* *----------------------------------------------------------------------------- * + * HgfsBd_GetBuf -- + * + * Get a buffer of size HGFS_PACKET_MAX to send hgfs requests in. + * + * Results: + * See HgfsBdGetBufInt. + * + * Side effects: + * Allocates memory that must be freed with a call to HgfsBd_PutBuf. + * + *----------------------------------------------------------------------------- + */ + +char * +HgfsBd_GetBuf(void) +{ + return HgfsBdGetBufInt(HGFS_PACKET_MAX); +} + +/* + *----------------------------------------------------------------------------- + * + * HgfsBd_GetLargeBuf -- + * + * Get a buffer of size HGFS_LARGE_PACKET_MAX to send hgfs requests in. + * + * Results: + * See HgfsBdGetBufInt. + * + * Side effects: + * Allocates memory that must be freed with a call to HgfsBd_PutBuf. + * + *----------------------------------------------------------------------------- + */ + +char * +HgfsBd_GetLargeBuf(void) +{ + return HgfsBdGetBufInt(HGFS_LARGE_PACKET_MAX); +} + + +/* + *----------------------------------------------------------------------------- + * * HgfsBd_PutBuf -- * * Release a buffer obtained with HgfsBd_GetBuf. @@ -215,7 +262,7 @@ return -1; } - ASSERT(replyLen <= HGFS_PACKET_MAX); + ASSERT(replyLen <= HGFS_LARGE_PACKET_MAX); *packetOut = reply; *packetSize = replyLen; diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/hgfsBd/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/hgfsBd/Makefile.am --- open-vm-tools-2008.01.23-74039/lib/hgfsBd/Makefile.am 2008-01-28 08:02:49.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/hgfsBd/Makefile.am 2008-10-13 08:01:47.000000000 +0100 @@ -19,6 +19,3 @@ libHgfsBd_a_SOURCES = libHgfsBd_a_SOURCES += hgfsBd.c - -AM_CFLAGS = -AM_CFLAGS += @COMMON_CFLAGS@ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/hgfsBd/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/hgfsBd/Makefile.in --- open-vm-tools-2008.01.23-74039/lib/hgfsBd/Makefile.in 2008-01-28 08:03:04.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/hgfsBd/Makefile.in 2008-10-13 08:02:13.000000000 +0100 @@ -52,7 +52,10 @@ subdir = lib/hgfsBd DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +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)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -64,7 +67,7 @@ am_libHgfsBd_a_OBJECTS = hgfsBd.$(OBJEXT) libHgfsBd_a_OBJECTS = $(am_libHgfsBd_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp +depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -90,8 +93,6 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -COMMON_CFLAGS = @COMMON_CFLAGS@ -COMMON_PROG_CFLAGS = @COMMON_PROG_CFLAGS@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -102,45 +103,57 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ -ECHO = @ECHO@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GREP = @GREP@ -GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_AUTH_CFLAGS = @LIB_AUTH_CFLAGS@ -LIB_FILE_CFLAGS = @LIB_FILE_CFLAGS@ -LIB_HGFS_SERVER_CFLAGS = @LIB_HGFS_SERVER_CFLAGS@ -LIB_IMPERSONATE_CFLAGS = @LIB_IMPERSONATE_CFLAGS@ -LIB_MISC_CFLAGS = @LIB_MISC_CFLAGS@ -LIB_PROC_MGR_CFLAGS = @LIB_PROC_MGR_CFLAGS@ -LIB_STRING_CFLAGS = @LIB_STRING_CFLAGS@ -LIB_USER_CFLAGS = @LIB_USER_CFLAGS@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -148,27 +161,35 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ VERSION = @VERSION@ -VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -199,6 +220,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -215,7 +237,6 @@ top_srcdir = @top_srcdir@ noinst_LIBRARIES = libHgfsBd.a libHgfsBd_a_SOURCES = hgfsBd.c -AM_CFLAGS = @COMMON_CFLAGS@ all: all-am .SUFFIXES: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/hgfsServer/hgfsServer.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/hgfsServer/hgfsServer.c --- open-vm-tools-2008.01.23-74039/lib/hgfsServer/hgfsServer.c 2008-01-28 08:02:51.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/hgfsServer/hgfsServer.c 2008-10-13 08:01:52.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -36,7 +36,7 @@ #if defined(_WIN32) #include -#else +#else #include #define stricmp strcasecmp #endif // _WIN32 @@ -44,6 +44,44 @@ #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 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 @@ -93,7 +131,7 @@ /* Value of config option to require using host timestamps */ Bool alwaysUseHostTime = FALSE; -/* +/* * Monotonically increasing handle counter used to dish out HgfsHandles. Not * static so that it can be used in the VMX checkpointing code. */ @@ -117,6 +155,9 @@ /* Local functions. */ +static Bool HgfsServerCheckPathPrefix(const char *path, + const char *share, + size_t shareLen); static Bool HgfsAddToCacheInternal(HgfsHandle handle); static Bool HgfsIsCachedInternal(HgfsHandle handle); static Bool HgfsRemoveLruNode(void); @@ -125,7 +166,8 @@ static HgfsSearch *HgfsSearchHandle2Search(HgfsHandle handle); static HgfsHandle HgfsSearch2SearchHandle(HgfsSearch const *search); static HgfsSearch *HgfsAddNewSearch(char const *utf8Dir, - DirectorySearchType type); + DirectorySearchType type, + char const *utf8ShareName); /* @@ -221,7 +263,7 @@ Log("Dumping all nodes\n"); for (i = 0; i < numNodes; i++) { - Log("handle %u, name \"%s\", localdev %u, localInum %"FMT64"u %u\n", + Log("handle %u, name \"%s\", localdev %"FMT64"u, localInum %"FMT64"u %u\n", nodeArray[i].handle, nodeArray[i].utf8Name ? nodeArray[i].utf8Name : "NULL", nodeArray[i].localId.volumeId, @@ -237,7 +279,7 @@ * * HgfsHandle2FileDesc -- * - * Retrieve the file descriptor (host OS file handle) based on the hgfs + * Retrieve the file descriptor (host OS file handle) based on the hgfs * handle. * * Results: @@ -304,7 +346,7 @@ goto exit; } - *appendFlag = fileNode->appendFlag; + *appendFlag = fileNode->flags & HGFS_FILE_NODE_APPEND_FL; found = TRUE; exit: @@ -432,7 +474,7 @@ unsigned int i; Bool found = FALSE; HgfsFileNode *existingFileNode = NULL; - + SyncMutex_Lock(&hgfsNodeArrayLock); for (i = 0; i < numNodes; i++) { existingFileNode = &nodeArray[i]; @@ -446,7 +488,7 @@ SyncMutex_Unlock(&hgfsNodeArrayLock); - return found; + return found; } @@ -484,7 +526,7 @@ if (existingFileNode == NULL) { goto exit_unlock; } - + nameStatus = HgfsServerPolicy_GetShareMode(existingFileNode->shareName, existingFileNode->shareNameLen, shareMode); @@ -492,7 +534,7 @@ exit_unlock: SyncMutex_Unlock(&hgfsNodeArrayLock); - return found; + return found; } @@ -537,7 +579,7 @@ if (name == NULL) { goto exit_unlock; } - nameSize = existingFileNode->utf8NameLen; + nameSize = existingFileNode->utf8NameLen; memcpy(name, existingFileNode->utf8Name, nameSize); name[nameSize] = '\0'; found = TRUE; @@ -546,7 +588,7 @@ SyncMutex_Unlock(&hgfsNodeArrayLock); *fileName = name; *fileNameSize = nameSize; - return found; + return found; } @@ -606,7 +648,7 @@ * * HgfsGetNodeCopy -- * - * Make a copy of the node. The node should not be kept around for long, as + * 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. * @@ -653,11 +695,9 @@ copy->fileDesc = original->fileDesc; copy->mode = original->mode; copy->shareAccess = original->shareAccess; - copy->appendFlag = original->appendFlag; + copy->flags = original->flags; copy->state = original->state; - copy->sequentialOpen = original->sequentialOpen; copy->handle = original->handle; - copy->sharedFolderOpen = original->sharedFolderOpen; found = TRUE; exit: @@ -698,7 +738,7 @@ goto exit; } - *sequentialOpen = node->sequentialOpen; + *sequentialOpen = node->flags & HGFS_FILE_NODE_SEQUENTIAL_FL; success = TRUE; exit: @@ -739,7 +779,7 @@ goto exit; } - *sharedFolderOpen = node->sharedFolderOpen; + *sharedFolderOpen = node->flags & HGFS_FILE_NODE_SHARED_FOLDER_OPEN_FL; success = TRUE; exit: @@ -793,7 +833,7 @@ * * HgfsUpdateNodeServerLock -- * - * Given a file desc (OS handle), update the node with the new oplock + * Given a file desc (OS handle), update the node with the new oplock * information. * * Results: @@ -827,7 +867,7 @@ } SyncMutex_Unlock(&hgfsNodeArrayLock); - return updated; + return updated; } @@ -861,7 +901,9 @@ goto exit; } - node->appendFlag = appendFlag; + if (appendFlag) { + node->flags |= HGFS_FILE_NODE_APPEND_FL; + } updated = TRUE; exit: @@ -895,9 +937,9 @@ Log("Dumping all searches\n"); for (i = 0; i < numSearches; i++) { - Log("handle %u, baseDir \"%s\"\n", - searchArray[i].handle, - searchArray[i].utf8Dir ? + Log("handle %u, baseDir \"%s\"\n", + searchArray[i].handle, + searchArray[i].utf8Dir ? searchArray[i].utf8Dir : "(NULL)"); } Log("Done\n"); @@ -939,7 +981,11 @@ LOG(4, ("HgfsGetNewNode: entered\n")); if (nodeFreeList.next == &nodeFreeList) { - unsigned int ptrDiff; + /* + * 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"); @@ -948,7 +994,7 @@ /* Try to get twice as much memory as we had */ newNumNodes = 2 * numNodes; - newMem = (HgfsFileNode *)realloc(nodeArray, + newMem = (HgfsFileNode *)realloc(nodeArray, newNumNodes * sizeof *nodeArray); if (!newMem) { LOG(4, ("HgfsGetNewNode: can't realloc more nodes\n")); @@ -957,7 +1003,7 @@ ptrDiff = (char *)newMem - (char *)nodeArray; if (ptrDiff) { - unsigned int const oldSize = numNodes * sizeof *nodeArray; + size_t const oldSize = numNodes * sizeof *nodeArray; /* * The portion of memory that contains all our file nodes moved. @@ -966,14 +1012,14 @@ * * We'll need to lock this if we multithread. */ - LOG(4, ("Rebasing pointers, diff is %d, sizeof node is %"FMTSZ"u\n", + LOG(4, ("Rebasing pointers, diff is %"FMTSZ"u, sizeof node is %"FMTSZ"u\n", ptrDiff, sizeof(HgfsFileNode))); LOG(4, ("old: %p new: %p\n", nodeArray, newMem)); ASSERT(newMem == (HgfsFileNode*)((char*)nodeArray + ptrDiff)); -#define HgfsServerRebase(_ptr, _type) \ - if ((unsigned int)((char *)_ptr - (char *)nodeArray) < oldSize) { \ - _ptr = (_type *)((char *)_ptr + ptrDiff); \ +#define HgfsServerRebase(_ptr, _type) \ + if ((size_t)((char *)_ptr - (char *)nodeArray) < oldSize) { \ + _ptr = (_type *)((char *)_ptr + ptrDiff); \ } /* @@ -1129,9 +1175,9 @@ * * HgfsAddNewFileNode -- * - * Gets a free node off the free list, sets its name, localId info, + * Gets a free node off the free list, sets its name, localId info, * file descriptor and permissions. - * + * * hgfsNodeArrayLock should be acquired prior to calling this function. * * Results: @@ -1174,7 +1220,7 @@ 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. */ @@ -1199,16 +1245,23 @@ newNode->utf8Name[newNode->utf8NameLen] = '\0'; newNode->handle = hgfsHandleCounter++; - newNode->sequentialOpen = - HGFS_OPEN_MODE_FLAGS(openInfo->mode) & HGFS_OPEN_SEQUENTIAL; newNode->localId = *localId; newNode->fileDesc = fileDesc; newNode->shareAccess = (openInfo->mask & HGFS_OPEN_VALID_SHARE_ACCESS) ? openInfo->shareAccess : HGFS_DEFAULT_SHARE_ACCESS; - newNode->appendFlag = append; + 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->sharedFolderOpen = sharedFolderOpen; LOG(4, ("HgfsAddNewFileNode: got new node, handle %u\n", HgfsFileNode2Handle(newNode))); @@ -1244,7 +1297,7 @@ /* Check if the node is already cached. */ if (HgfsIsCachedInternal(handle)) { - ASSERT((node = HgfsHandle2FileNode(handle)) && + ASSERT((node = HgfsHandle2FileNode(handle)) && node->state == FILENODE_STATE_IN_USE_CACHED); return TRUE; } @@ -1267,7 +1320,7 @@ node->state = FILENODE_STATE_IN_USE_CACHED; 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 @@ -1290,7 +1343,7 @@ * 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 + * file descriptor. If the node was not already in the cache then nothing * is done. * * hgfsNodeArrayLock should be acquired prior to calling this function. @@ -1322,19 +1375,19 @@ node->state = FILENODE_STATE_IN_USE_NOT_CACHED; numCachedOpenNodes--; - /* - * XXX: From this point and up in the call chain (i.e. this function and - * all callers), Bool is returned instead of the HgfsInternalStatus. - * HgfsCloseFile 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 + /* + * XXX: From this point and up in the call chain (i.e. this function and + * all callers), Bool is returned instead of the HgfsInternalStatus. + * HgfsCloseFile 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 (HgfsCloseFile(node->fileDesc)) { - LOG(4, ("HgfsRemoveFromCacheInternal: Could not close fd %u\n", + LOG(4, ("HgfsRemoveFromCacheInternal: Could not close fd %u\n", node->fileDesc)); return FALSE; } @@ -1422,7 +1475,7 @@ HgfsIsServerLockAllowed() { Bool allowed; - + SyncMutex_Lock(&hgfsNodeArrayLock); allowed = numCachedLockedNodes < MAX_LOCKED_FILENODES; SyncMutex_Unlock(&hgfsNodeArrayLock); @@ -1465,7 +1518,11 @@ LOG(4, ("HgfsGetNewSearch: entered\n")); if (searchFreeList.next == &searchFreeList) { - unsigned int ptrDiff; + /* + * 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"); @@ -1474,7 +1531,7 @@ /* Try to get twice as much memory as we had */ newNumSearches = 2 * numSearches; - newMem = (HgfsSearch *)realloc(searchArray, + newMem = (HgfsSearch *)realloc(searchArray, newNumSearches * sizeof *searchArray); if (!newMem) { LOG(4, ("HgfsGetNewSearch: can't realloc more searches\n")); @@ -1483,7 +1540,7 @@ ptrDiff = (char *)newMem - (char *)searchArray; if (ptrDiff) { - unsigned int const oldSize = numSearches * sizeof *searchArray; + size_t const oldSize = numSearches * sizeof *searchArray; /* * The portion of memory that contains all our searches moved. @@ -1491,14 +1548,14 @@ * must be updated to point to the new portion of memory. */ - LOG(4, ("Rebasing pointers, diff is %d, sizeof search is %"FMTSZ"u\n", + LOG(4, ("Rebasing pointers, diff is %"FMTSZ"u, sizeof search is %"FMTSZ"u\n", ptrDiff, sizeof(HgfsSearch))); LOG(4, ("old: %p new: %p\n", searchArray, newMem)); ASSERT(newMem == (HgfsSearch*)((char*)searchArray + ptrDiff)); -#define HgfsServerRebase(_ptr, _type) \ - if ((unsigned int)((char *)_ptr - (char *)searchArray) < oldSize) { \ - _ptr = (_type *)((char *)_ptr + ptrDiff); \ +#define HgfsServerRebase(_ptr, _type) \ + if ((size_t)((char *)_ptr - (char *)searchArray) < oldSize) { \ + _ptr = (_type *)((char *)_ptr + ptrDiff); \ } /* @@ -1524,6 +1581,8 @@ DblLnkLst_Init(&newMem[i].links); newMem[i].utf8Dir = NULL; newMem[i].utf8DirLen = 0; + newMem[i].utf8ShareName = NULL; + newMem[i].utf8ShareNameLen = 0; newMem[i].dents = NULL; newMem[i].numDents = 0; @@ -1619,6 +1678,14 @@ 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; @@ -1638,7 +1705,7 @@ * * HgfsAddNewSearch -- * - * Gets a free search off the free list, sets its base directory, dents, + * Gets a free search off the free list, sets its base directory, dents, * and type. * * Caller should hold hgfsSearchArrayLock. @@ -1654,8 +1721,9 @@ */ HgfsSearch * -HgfsAddNewSearch(char const *utf8Dir, // IN: UTF8 name of dir to search in - DirectorySearchType type) // IN: What kind of search is this? +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 { HgfsSearch *newSearch; @@ -1674,13 +1742,18 @@ newSearch->handle = hgfsHandleCounter++; newSearch->utf8DirLen = strlen(utf8Dir); - newSearch->utf8Dir = malloc(newSearch->utf8DirLen + 1); + newSearch->utf8Dir = strdup(utf8Dir); if (newSearch->utf8Dir == NULL) { HgfsRemoveSearchInternal(newSearch); return NULL; } - memcpy(newSearch->utf8Dir, utf8Dir, newSearch->utf8DirLen); - newSearch->utf8Dir[newSearch->utf8DirLen] = '\0'; + + newSearch->utf8ShareNameLen = strlen(utf8ShareName); + newSearch->utf8ShareName = strdup(utf8ShareName); + if (newSearch->utf8ShareName == NULL) { + HgfsRemoveSearchInternal(newSearch); + return NULL; + } LOG(4, ("HgfsAddNewSearch: got new search, handle %u\n", HgfsSearch2SearchHandle(newSearch))); @@ -1726,6 +1799,7 @@ } free(search->utf8Dir); + free(search->utf8ShareName); /* Prepend at the beginning of the list */ DblLnkLst_LinkFirst(&searchFreeList, &search->links); @@ -1737,7 +1811,7 @@ * * HgfsRemoveSearch -- * - * Wrapper around HgfsRemoveSearchInternal that first takes the lock and + * Wrapper around HgfsRemoveSearchInternal that first takes the lock and * converts the handle to the search itself. * * Results: @@ -1795,20 +1869,20 @@ HgfsSearch *search; DirectoryEntry *dent = NULL; - SyncMutex_Lock(&hgfsSearchArrayLock); + SyncMutex_Lock(&hgfsSearchArrayLock); search = HgfsSearchHandle2Search(handle); if (search == NULL || search->dents == NULL) { goto out; } - + if (offset >= 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 + /* + * 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. */ @@ -1817,7 +1891,7 @@ /* Shift up the remaining results */ memmove(&search->dents[offset], &search->dents[offset + 1], (search->numDents - (offset + 1)) * sizeof search->dents[0]); - + /* Decrement the number of results */ search->numDents--; } else { @@ -1883,7 +1957,7 @@ HgfsSearch *search = NULL; ASSERT(searchArray); - + /* XXX: This O(n) lookup can and should be optimized. */ for (i = 0; i < numSearches; i++) { if (!DblLnkLst_IsLinked(&searchArray[i].links) && @@ -1980,25 +2054,40 @@ char *packetOut, // OUT: outgoing packet size_t *packetSize) // IN/OUT: size of packet { - HgfsRequestClose *request; - HgfsReplyClose *reply; + HgfsRequest *header = (HgfsRequest *)packetIn; + HgfsHandle *file; + size_t replySize; - request = (HgfsRequestClose *)packetIn; - ASSERT(request); - reply = (HgfsReplyClose *)packetOut; - ASSERT(reply); + ASSERT(packetIn); + ASSERT(packetOut); ASSERT(packetSize); - LOG(4, ("HgfsServerClose: close fh %u\n", request->file)); + if (header->op == HGFS_OP_CLOSE_V3) { + HgfsRequestCloseV3 *request; + HgfsReplyCloseV3 *reply; + request = (HgfsRequestCloseV3 *)HGFS_REQ_GET_PAYLOAD_V3(packetIn); + file = &request->file; + + reply = (HgfsReplyCloseV3 *)HGFS_REP_GET_PAYLOAD_V3(packetOut); + reply->reserved = 0; + replySize = HGFS_REP_PAYLOAD_SIZE_V3(reply); + } else { + HgfsRequestClose *request; + request = (HgfsRequestClose *)packetIn; + file = &request->file; + replySize = sizeof *request; + } + + LOG(4, ("HgfsServerClose: close fh %u\n", *file)); - if (!HgfsRemoveFromCache(request->file)) { + if (!HgfsRemoveFromCache(*file)) { LOG(4, ("HgfsServerClose: Could not remove the node from cache.\n")); return HGFS_INTERNAL_STATUS_ERROR; } else { - HgfsFreeFileNode(request->file); + HgfsFreeFileNode(*file); } - *packetSize = sizeof *reply; + *packetSize = replySize; return 0; } @@ -2025,27 +2114,43 @@ char *packetOut, // OUT: outgoing packet size_t *packetSize) // IN/OUT: size of packet { - HgfsRequestSearchClose *request; - HgfsReplySearchClose *reply; + HgfsRequest *header = (HgfsRequest *)packetIn; + HgfsHandle *search; + size_t replySize; - request = (HgfsRequestSearchClose *)packetIn; - ASSERT(request); - reply = (HgfsReplySearchClose *)packetOut; - ASSERT(reply); + ASSERT(packetIn); + ASSERT(packetOut); ASSERT(packetSize); - LOG(4, ("HgfsServerSearchClose: close search #%u\n", request->search)); + if (header->op == HGFS_OP_SEARCH_CLOSE_V3) { + HgfsRequestSearchCloseV3 *request = + (HgfsRequestSearchCloseV3 *)HGFS_REQ_GET_PAYLOAD_V3(packetIn); + HgfsReplySearchCloseV3 *reply = + (HgfsReplySearchCloseV3 *)HGFS_REP_GET_PAYLOAD_V3(packetOut); + + search = &request->search; + reply->reserved = 0; + replySize = HGFS_REP_PAYLOAD_SIZE_V3(reply); + } else { + HgfsRequestSearchClose *request = (HgfsRequestSearchClose *)packetIn; + HgfsReplySearchClose *reply = (HgfsReplySearchClose *)packetOut; + search = &request->search; + replySize = sizeof *reply; + } - if (!HgfsRemoveSearch(request->search)) { + LOG(4, ("HgfsServerSearchClose: close search #%u\n", *search)); + + if (!HgfsRemoveSearch(*search)) { /* Invalid handle */ - LOG(4, ("HgfsServerSearchClose: invalid handle %u\n", request->search)); + LOG(4, ("HgfsServerSearchClose: invalid handle %u\n", *search)); return HGFS_INTERNAL_STATUS_ERROR; } - *packetSize = sizeof *reply; + *packetSize = replySize; return 0; } +#define HGFS_SIZEOF_OP(type) (sizeof (type) + sizeof (HgfsRequest)) /* Opcode handlers, indexed by opcode */ static struct { @@ -2071,20 +2176,39 @@ { HgfsServerDeleteDir, sizeof (HgfsRequestDelete) }, { HgfsServerRename, sizeof (HgfsRequestRename) }, { HgfsServerQueryVolume, sizeof (HgfsRequestQueryVolume) }, + { HgfsServerOpen, sizeof (HgfsRequestOpenV2) }, { HgfsServerGetattr, sizeof (HgfsRequestGetattrV2) }, - { HgfsServerSetattr, sizeof (HgfsRequestSetattrV2), }, - { HgfsServerSearchRead, sizeof (HgfsRequestSearchReadV2), }, - { HgfsServerSymlinkCreate, sizeof (HgfsRequestSymlinkCreate), }, - { HgfsServerServerLockChange, sizeof (HgfsRequestServerLockChange), }, - { HgfsServerCreateDir, sizeof (HgfsRequestCreateDirV2), }, - { HgfsServerDeleteFile, sizeof (HgfsRequestDeleteV2) }, - { HgfsServerDeleteDir, sizeof (HgfsRequestDeleteV2) }, - { HgfsServerRename, sizeof (HgfsRequestRenameV2) }, + { HgfsServerSetattr, sizeof (HgfsRequestSetattrV2) }, + { HgfsServerSearchRead, sizeof (HgfsRequestSearchReadV2) }, + { HgfsServerSymlinkCreate, sizeof (HgfsRequestSymlinkCreate) }, + { HgfsServerServerLockChange, sizeof (HgfsRequestServerLockChange) }, + { HgfsServerCreateDir, sizeof (HgfsRequestCreateDirV2) }, + { HgfsServerDeleteFile, sizeof (HgfsRequestDeleteV2) }, + { HgfsServerDeleteDir, sizeof (HgfsRequestDeleteV2) }, + { HgfsServerRename, sizeof (HgfsRequestRenameV2) }, + + { HgfsServerOpen, HGFS_SIZEOF_OP(HgfsRequestOpenV3) }, + { HgfsServerRead, HGFS_SIZEOF_OP(HgfsRequestReadV3) }, + { HgfsServerWrite, HGFS_SIZEOF_OP(HgfsRequestWriteV3) }, + { HgfsServerClose, HGFS_SIZEOF_OP(HgfsRequestCloseV3) }, + { HgfsServerSearchOpen, HGFS_SIZEOF_OP(HgfsRequestSearchOpenV3) }, + { HgfsServerSearchRead, HGFS_SIZEOF_OP(HgfsRequestSearchReadV3) }, + { HgfsServerSearchClose, HGFS_SIZEOF_OP(HgfsRequestSearchCloseV3) }, + { HgfsServerGetattr, HGFS_SIZEOF_OP(HgfsRequestGetattrV3) }, + { HgfsServerSetattr, HGFS_SIZEOF_OP(HgfsRequestSetattrV3) }, + { HgfsServerCreateDir, HGFS_SIZEOF_OP(HgfsRequestCreateDirV3) }, + { HgfsServerDeleteFile, HGFS_SIZEOF_OP(HgfsRequestDeleteV3) }, + { HgfsServerDeleteDir, HGFS_SIZEOF_OP(HgfsRequestDeleteV3) }, + { HgfsServerRename, HGFS_SIZEOF_OP(HgfsRequestRenameV3) }, + { HgfsServerQueryVolume, HGFS_SIZEOF_OP(HgfsRequestQueryVolumeV3) }, + { HgfsServerSymlinkCreate, HGFS_SIZEOF_OP(HgfsRequestSymlinkCreateV3) }, + { HgfsServerServerLockChange, sizeof (HgfsRequestServerLockChange) }, }; + /* *----------------------------------------------------------------------------- * @@ -2140,11 +2264,12 @@ id = request->id; op = request->op; + HGFS_ASSERT_MINIMUM_OP(op); if (op < sizeof handlers / sizeof handlers[0]) { if (*packetSize >= handlers[op].minReqSize) { HgfsInternalStatus internalStatus; - internalStatus = (*handlers[op].handler)(packetIn, - packetOut, + internalStatus = (*handlers[op].handler)(packetIn, + packetOut, packetSize); status = HgfsConvertFromInternalStatus(internalStatus); } else { @@ -2158,6 +2283,7 @@ /* Unknown opcode */ status = HGFS_STATUS_PROTOCOL_ERROR; } + HGFS_ASSERT_CLIENT(op); /* * If the status isn't success, set the packetSize to the @@ -2169,7 +2295,7 @@ *packetSize = sizeof *reply; } - ASSERT(*packetSize >= sizeof *reply && *packetSize <= HGFS_PACKET_MAX); + ASSERT(*packetSize >= sizeof *reply && *packetSize <= HGFS_LARGE_PACKET_MAX); reply->id = id; reply->status = status; } @@ -2200,7 +2326,7 @@ ASSERT(shares); LOG(4, ("HgfsServer_InvalidateObjects: Beginning\n")); - /* + /* * Iterate over each node, skipping those that are unused. For each node, * if its filename is no longer within a share, remove it. */ @@ -2212,30 +2338,25 @@ if (nodeArray[i].state == FILENODE_STATE_UNUSED) { continue; } - + handle = HgfsFileNode2Handle(&nodeArray[i]); LOG(4, ("HgfsServer_InvalidateObjects: Examining node with fd %d (%s)\n", handle, nodeArray[i].utf8Name)); - - /* - * For each share, is the node within the share? The answer is yes if the - * share's path is a prefix for the node's path. To make sure we don't - * get any false positives, check for a path separator (or nul - * terminator) right after the matched prefix. - */ + + /* 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 ((strncmp(nodeArray[i].utf8Name, share->path, share->pathLen) == 0) - && (*(nodeArray[i].utf8Name + share->pathLen) == DIRSEPC || - *(nodeArray[i].utf8Name + share->pathLen) == '\0')) { + if (HgfsServerCheckPathPrefix(nodeArray[i].utf8Name, + share->path, + share->pathLen)) { LOG(4, ("HgfsServer_InvalidateObjects: Node is still valid\n")); break; } } - + /* If the node wasn't found in any share, remove it. */ if (l == shares) { LOG(4, ("HgfsServer_InvalidateObjects: Node is invalid, removing\n")); @@ -2249,8 +2370,8 @@ } SyncMutex_Unlock(&hgfsNodeArrayLock); - /* - * Iterate over each search, skipping those that are on the free list. For + /* + * 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. */ SyncMutex_Lock(&hgfsSearchArrayLock); @@ -2266,18 +2387,15 @@ LOG(4, ("HgfsServer_InvalidateObjects: Examining search (%s)\n", searchArray[i].utf8Dir)); - /* - * For each share, is the search within the share? We apply the same - * heuristic as was used for the nodes above. - */ + /* 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 ((strncmp(searchArray[i].utf8Dir, share->path, share->pathLen) == 0) - && (*(searchArray[i].utf8Dir + share->pathLen) == DIRSEPC || - *(searchArray[i].utf8Dir + share->pathLen) == '\0')) { + if (HgfsServerCheckPathPrefix(searchArray[i].utf8Dir, + share->path, + share->pathLen)) { LOG(4, ("HgfsServer_InvalidateObjects: Search is still valid\n")); break; } @@ -2299,6 +2417,66 @@ /* *----------------------------------------------------------------------------- * + * HgfsServerCheckPathPrefix -- + * + * Given a path and a Hgfs host share path, check to see if the given + * share is a prefix of the path. + * + * Results: + * TRUE if share is a prefix of path. + * FALSE otherwise. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static Bool +HgfsServerCheckPathPrefix(const char *path, // IN: Path to check + const char *share, // IN: Prefix of path + size_t shareLen) // IN: Length of share +{ + ASSERT(path); + ASSERT(share); + + /* First make sure that share is a prefix of path. */ + if (strncmp(path, share, shareLen) != 0) { + return FALSE; + } + + /* + * Special case. The root share on Linux or Apple ("/") will not be followed + * by a second path separator. In this case, no additional checks besides the + * initial prefix check are needed. Just return success. + */ + if (shareLen == 1 && *share == DIRSEPC) { + return TRUE; + } + + /* + * Now check to prevent false positives. In particular, consider the case + * where we have two shares: shareName and shareName1. + * Given the path /shareName1/test, the above check will allow through both + * shareName and shareName1. Check to make sure that the given share is + * a full path component. + */ + + if (*(path + shareLen) == DIRSEPC) { + return TRUE; + } + + if (*(path + shareLen) == '\0') { + return TRUE; + } + + return FALSE; +} + + +/* + *----------------------------------------------------------------------------- + * * HgfsServerStatFs -- * * Calls on the wiper library to return the number of free bytes and @@ -2330,26 +2508,26 @@ 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 + * 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 < 0 || pathLength >= sizeof p.mountPoint) { LOG(4, ("HgfsServerStatFs: could not get the volume name\n")); 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, ("HgfsServerQueryVolume: error using wiper lib: %s\n", + LOG(4, ("HgfsServerQueryVolume: error using wiper lib: %s\n", wiperError)); return FALSE; } - + return TRUE; } @@ -2376,43 +2554,44 @@ */ HgfsNameStatus -HgfsServerGetAccess(char const *cpName,// IN: Cross-platform filename to check - size_t cpNameSize, // IN: Size of name cpName - HgfsOpenMode mode, // IN: Requested access mode - char **bufOut, // OUT: File name in local fs - size_t *outLen) // OUT: Length of name out +HgfsServerGetAccess(char *cpName, // IN: Cross-platform filename to check + size_t cpNameSize, // IN: Size of name cpName + 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 { HgfsNameStatus nameStatus; char const *sharePath; char const *inEnd; - char const *next; + char *next; char *myBufOut; - char *myBufOutCurrent; + char *convertedMyBufOut; char *out; size_t outSize; size_t sharePathLen; /* Length of share's path */ + size_t myBufOutLen; + size_t convertedMyBufOutLen; int len; uint32 pathNameLen; char tempBuf[HGFS_PATH_MAX]; size_t tempSize; char *tempPtr; - char *ansiName; - size_t ansiLen; - Bool result; - char *savedPathSepPos; + HgfsInternalStatus result; uint32 startIndex = 0; + HgfsShareOptions shareOptions; ASSERT(cpName); ASSERT(bufOut); inEnd = cpName + cpNameSize; - /* + /* * Get first component. We bypass the higher level CPName_GetComponent * function so we'll have more control over the illegal characters, which, * for the share name, should be none. */ - len = CPName_GetComponentGeneric(cpName, inEnd, "", &next); + len = CPName_GetComponentGeneric(cpName, inEnd, "", (char const **) &next); if (len < 0) { LOG(4, ("HgfsServerGetAccess: get first component failed\n")); return HGFS_NAME_STATUS_FAILURE; @@ -2423,33 +2602,24 @@ return HGFS_NAME_STATUS_INCOMPLETE_BASE; } - /* - * VMDB stores the ANSI name so convert from UTF8 before looking up a share. - * XXX: Ideally, we should store share names in UTF16 so that these - * conversions can be done away with. - */ - if (!CodeSet_Utf8ToCurrent(cpName, - len, - &ansiName, - &ansiLen)) { - LOG(4, ("HgfsServerGetAccess: ANSI conversion failed\n")); - return HGFS_NAME_STATUS_FAILURE; - } - /* Check permission on the share and get the share path */ - nameStatus = HgfsServerPolicy_GetSharePath(ansiName, - ansiLen, + nameStatus = HgfsServerPolicy_GetSharePath(cpName, + len, mode, &sharePathLen, &sharePath); if (nameStatus != HGFS_NAME_STATUS_COMPLETE) { LOG(4, ("HgfsServerGetAccess: No such share (%s) or access denied\n", - ansiName)); - free(ansiName); + cpName)); return nameStatus; } - free(ansiName); + /* Get the config options. */ + nameStatus = HgfsServerPolicy_GetShareOptions(cpName, len, &shareOptions); + if (nameStatus != HGFS_NAME_STATUS_COMPLETE) { + LOG(4, ("HgfsServerGetAccess: no matching share: %s.\n", cpName)); + return nameStatus; + } /* Point to the next component, if any */ cpNameSize -= next - cpName; @@ -2470,7 +2640,7 @@ /* * See if we are dealing with a "root" share or regular share */ - if (strcmp(sharePath, "") == 0) { + if (strlen(sharePath) == 0) { size_t prefixLen; /* @@ -2481,7 +2651,7 @@ */ tempSize = sizeof tempBuf; tempPtr = tempBuf; - nameStatus = CPName_ConvertFromRoot(&cpName, + nameStatus = CPName_ConvertFromRoot((char const **) &cpName, &cpNameSize, &tempSize, &tempPtr); @@ -2504,39 +2674,25 @@ *out = 0; outSize -= prefixLen; } else { - size_t utf8ShareLen; - char *utf8SharePath; - /* - * This is a regular share. Append the UTF8 path to the out buffer. + * This is a regular share. Append the path to the out buffer. */ - if (!CodeSet_CurrentToUtf8(sharePath, - sharePathLen, - &utf8SharePath, - &utf8ShareLen)) { - LOG(4, ("HgfsServerGetAccess: share name UTF8 conversion failed\n")); - nameStatus = HGFS_NAME_STATUS_FAILURE; - goto error; - } - - if (outSize < utf8ShareLen + 1) { + if (outSize < sharePathLen + 1) { LOG(4, ("HgfsServerGetAccess: share path too big\n")); - free(utf8SharePath); nameStatus = HGFS_NAME_STATUS_TOO_LONG; goto error; } - memcpy(out, utf8SharePath, utf8ShareLen + 1); - out += utf8ShareLen; - outSize -= utf8ShareLen; - free(utf8SharePath); + memcpy(out, sharePath, sharePathLen + 1); + out += sharePathLen; + outSize -= sharePathLen; } /* Convert the rest of the input name (if any) to a local name */ tempSize = sizeof tempBuf; tempPtr = tempBuf; - if (CPName_ConvertFrom(&cpName, + if (CPName_ConvertFrom((char const **) &cpName, &cpNameSize, &tempSize, &tempPtr) < 0) { @@ -2545,12 +2701,12 @@ 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) && + if ((out != myBufOut) && (*(out - 1) == DIRSEPC) && (tempBuf[0] == DIRSEPC)) { startIndex++; @@ -2568,60 +2724,19 @@ outSize -= pathNameLen; out += pathNameLen; *out = 0; - - /* - * Verify that our path has no symlinks. We will only check up to the - * parent, because some ops that call us expect to operate on a symlink - * final component. - */ - savedPathSepPos = Str_Strrchr(myBufOut, DIRSEPC); - - /* - * Since cpName is user-supplied, it's possible that the name was invalid - * and did not contain any DIRSEPC characters. If that's the case, fail - * gracefully. - */ - - if (savedPathSepPos == NULL) { - LOG(4, ("HgfsServerGetAccess: no valid path separator in the name\n")); - nameStatus = HGFS_NAME_STATUS_FAILURE; - goto error; - } - - /* If the path starts with a DIRSEPC. */ - if (savedPathSepPos != myBufOut) { - *savedPathSepPos = '\0'; - } - - if (!CodeSet_Utf8ToCurrent(myBufOut, - strlen(myBufOut), - &myBufOutCurrent, - NULL)) { - LOG(4, ("HgfsServerGetAccess: share name UTF8 to current conversion failed\n")); - nameStatus = HGFS_NAME_STATUS_FAILURE; - goto error; - } - - result = HgfsServerHasSymlink(myBufOutCurrent, sharePath); - *savedPathSepPos = DIRSEPC; - free(myBufOutCurrent); - if (result) { - LOG(4, ("HgfsServerGetAccess: parent path contains a symlink\n")); - nameStatus = HGFS_NAME_STATUS_FAILURE; - goto error; - } + 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, - out - myBufOut, - &tempPtr, + if (!CodeSet_Utf8FormCToUtf8FormD(myBufOut, + myBufOutLen, + &tempPtr, &nameLen)) { LOG(4, ("HgfsServerGetAccess: unicode conversion to form D failed.\n")); nameStatus = HGFS_NAME_STATUS_FAILURE; @@ -2631,22 +2746,64 @@ free(myBufOut); LOG(4, ("HgfsServerGetAccess: name is \"%s\"\n", myBufOut)); - /* Save returned pointers for memory trim. */ + /* Save returned pointers, update buffer length. */ myBufOut = tempPtr; out = tempPtr + nameLen; + myBufOutLen = nameLen; } #endif /* defined(__APPLE__) */ + /* + * Convert file name to proper case if host default config option is not set + * and case conversion is required for this platform. + */ + if (!HgfsServerPolicy_IsShareOptionSet(shareOptions, HGFS_SHARE_HOST_DEFAULT_CASE) && + HgfsServerCaseConversionRequired()) { + result = HgfsServerConvertCase(sharePath, sharePathLen, myBufOut, + myBufOutLen, caseFlags, + &convertedMyBufOut, &convertedMyBufOutLen); + + /* + * On success, use the converted file names for further operations. + */ + if (result != 0) { + LOG(4, ("HgfsServerGetAccess: HgfsServerConvertCase failed.\n")); + nameStatus = HGFS_NAME_STATUS_FAILURE; + 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. + */ + result = HgfsServerHasSymlink(myBufOut, myBufOutLen, sharePath, sharePathLen); + if (result != 0) { + LOG(4, ("HgfsServerGetAccess: parent path contains a symlink\n")); + nameStatus = HGFS_NAME_STATUS_FAILURE; + goto error; + } + } + { char *p; - size_t len; /* Trim unused memory */ - len = out - myBufOut; - /* Enough space for resulting string + NUL termination */ - p = realloc(myBufOut, (len + 1) * sizeof *p); + p = realloc(myBufOut, (myBufOutLen + 1) * sizeof *p); if (!p) { LOG(4, ("HgfsServerGetAccess: failed to trim memory\n")); } else { @@ -2654,7 +2811,7 @@ } if (outLen) { - *outLen = len; + *outLen = myBufOutLen; } } @@ -2701,7 +2858,7 @@ inEnd = cpName + cpNameSize; - /* + /* * Get first component. We bypass the higher level CPName_GetComponent * function so we'll have more control over the illegal characters, which, * for the share name, should be none. @@ -2791,8 +2948,6 @@ char const *name; size_t len; Bool done = FALSE; - char *utf8Name; - size_t utf8NameLen; size_t newDirEntryLen; size_t maxLen; @@ -2848,16 +3003,8 @@ myDents = (DirectoryEntry **)p; } - /* This file/directory can be added to the list. Convert to UTF8 first. */ + /* This file/directory can be added to the list. */ LOG(4, ("HgfsServerGetDents: Nextfilename = \"%s\"\n", name)); - if (!CodeSet_CurrentToUtf8((const char *)name, - len, - &utf8Name, - &utf8NameLen)) { - LOG(4, ("HgfsServerGetDents: Unable to convert \"%s\" to utf-8\n", - name)); - goto error; - } /* * Start with the size of the DirectoryEntry struct, subtract the static @@ -2865,20 +3012,18 @@ * just enough space for the UTF-8 name and nul terminator. */ newDirEntryLen = - sizeof *pDirEntry - sizeof pDirEntry->d_name + utf8NameLen + 1; + sizeof *pDirEntry - sizeof pDirEntry->d_name + len + 1; pDirEntry = (DirectoryEntry *)malloc(newDirEntryLen); if (!pDirEntry) { LOG(4, ("HgfsServerGetDents: Couldn't allocate dentry memory\n")); - free(utf8Name); goto error; } pDirEntry->d_reclen = (unsigned short)newDirEntryLen; - memcpy(pDirEntry->d_name, utf8Name, utf8NameLen); - pDirEntry->d_name[utf8NameLen] = 0; + memcpy(pDirEntry->d_name, name, len); + pDirEntry->d_name[len] = 0; myDents[numDents] = pDirEntry; numDents++; - free(utf8Name); } /* We are done; cleanup the state */ @@ -2935,7 +3080,7 @@ * * 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 + * to pass it in, for completeness' sake with respect to * HgfsServerSearchVirtualDir. * * Results: @@ -2952,25 +3097,44 @@ HgfsServerSearchRealDir(char const *baseDir, // IN: Directory to search size_t baseDirLen, // IN: Length of directory DirectorySearchType type, // IN: Kind of search + char const *shareName, // IN: Share name containing the directory HgfsHandle *handle) // OUT: Search handle { HgfsSearch *search = NULL; HgfsInternalStatus status = 0; + HgfsNameStatus nameStatus; int numDents; + Bool followSymlinks; + HgfsShareOptions configOptions; ASSERT(baseDir); ASSERT(handle); ASSERT(type == DIRECTORY_SEARCH_TYPE_DIR); + ASSERT(shareName); SyncMutex_Lock(&hgfsSearchArrayLock); - search = HgfsAddNewSearch(baseDir, type); + search = HgfsAddNewSearch(baseDir, type, shareName); if (!search) { LOG(4, ("HgfsServerSearchRealDir: failed to get new search\n")); status = HGFS_INTERNAL_STATUS_ERROR; goto out; } - status = HgfsServerScandir(baseDir, baseDirLen, &search->dents, &numDents); + /* Get the config options. */ + nameStatus = HgfsServerPolicy_GetShareOptions(shareName, strlen(shareName), + &configOptions); + if (nameStatus != HGFS_NAME_STATUS_COMPLETE) { + LOG(4, ("HgfsServerSearchRealDir: no matching share: %s.\n", shareName)); + status = HGFS_INTERNAL_STATUS_ERROR; + HgfsRemoveSearchInternal(search); + goto out; + } + + followSymlinks = HgfsServerPolicy_IsShareOptionSet(configOptions, + HGFS_SHARE_FOLLOW_SYMLINKS); + + status = HgfsServerScandir(baseDir, baseDirLen, followSymlinks, + &search->dents, &numDents); if (status != 0) { LOG(4, ("HgfsServerSearchRealDir: couldn't scandir\n")); HgfsRemoveSearchInternal(search); @@ -3022,7 +3186,7 @@ ASSERT(handle); SyncMutex_Lock(&hgfsSearchArrayLock); - search = HgfsAddNewSearch("", type); + search = HgfsAddNewSearch("", type, ""); if (!search) { LOG(4, ("HgfsServerSearchVirtualDir: failed to get new search\n")); status = HGFS_INTERNAL_STATUS_ERROR; @@ -3222,8 +3386,6 @@ HgfsFileNode *node = NULL; char const *inEnd; char const *next; - char *shareName = NULL; - size_t shareLen = 0; uint32 len; Bool sharedFolderOpen = FALSE; @@ -3232,7 +3394,7 @@ inEnd = openInfo->cpName + openInfo->cpNameSize; - /* + /* * Get first component. We bypass the higher level CPName_GetComponent * function so we'll have more control over the illegal characters, which, * for the share name, should be none. @@ -3252,28 +3414,14 @@ sharedFolderOpen = TRUE; } - /* - * VMDB stores the ANSI name so convert from UTF8 before looking up a share. - * XXX: Ideally, we should store share names in UTF16 so that these - * conversions can be done away with. - */ - if (!CodeSet_Utf8ToCurrent(openInfo->cpName, - len, - &shareName, - &shareLen)) { - LOG(4, ("HgfsServerGetAccess: ANSI conversion failed\n")); - return FALSE; - } - SyncMutex_Lock(&hgfsNodeArrayLock); node = HgfsAddNewFileNode(openInfo, localId, fileDesc, append, - shareLen, - shareName, + len, + openInfo->cpName, sharedFolderOpen); - free(shareName); if (node == NULL) { LOG(4, ("HgfsCreateAndCacheFileNode: Failed to add new node.\n")); SyncMutex_Unlock(&hgfsNodeArrayLock); @@ -3326,8 +3474,56 @@ request = (HgfsRequest *)packetIn; openInfo->requestType = request->op; + openInfo->caseFlags = HGFS_FILE_NAME_DEFAULT_CASE; switch (openInfo->requestType) { + case HGFS_OP_OPEN_V3: + { + HgfsRequestOpenV3 *requestV3 = + (HgfsRequestOpenV3 *)HGFS_REQ_GET_PAYLOAD_V3(packetIn); + LOG(4, ("HgfsUnpackOpenRequest: HGFS_OP_OPEN_V3\n")); + + + /* Enforced by the dispatch function. */ + ASSERT(packetSize >= HGFS_REQ_PAYLOAD_SIZE_V3(requestV3)); + extra = packetSize - HGFS_REQ_PAYLOAD_SIZE_V3(requestV3); + + if (!(requestV3->mask & HGFS_OPEN_VALID_FILE_NAME)) { + /* We do not support open requests without a valid file name. */ + return FALSE; + } + + /* + * requestV3->fileName.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. */ + 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; + break; + } case HGFS_OP_OPEN_V2: { HgfsRequestOpenV2 *requestV2 = @@ -3374,7 +3570,7 @@ } case HGFS_OP_OPEN: { - HgfsRequestOpen *requestV1 = + HgfsRequestOpen *requestV1 = (HgfsRequestOpen *)packetIn; /* Enforced by the dispatch function. */ @@ -3382,7 +3578,7 @@ extra = packetSize - sizeof *requestV1; /* - * requestV1->fileName.length is user-provided, so this test must be + * requestV1->fileName.length is user-provided, so this test must be * carefully written to prevent wraparounds. */ @@ -3393,7 +3589,7 @@ /* For OpenV1 requests, we know exactly what fields we expect. */ openInfo->mask = HGFS_OPEN_VALID_MODE | - HGFS_OPEN_VALID_FLAGS | + HGFS_OPEN_VALID_FLAGS | HGFS_OPEN_VALID_OWNER_PERMS | HGFS_OPEN_VALID_FILE_NAME; openInfo->mode = requestV1->mode; @@ -3406,7 +3602,7 @@ default: return FALSE; } - + return TRUE; } @@ -3436,17 +3632,34 @@ ASSERT(packetSize); ASSERT(openInfo); - if (openInfo->requestType == HGFS_OP_OPEN_V2) { + switch (openInfo->requestType) { + case HGFS_OP_OPEN_V3: { + HgfsReplyOpenV3 *reply = (HgfsReplyOpenV3 *)HGFS_REP_GET_PAYLOAD_V3(packetOut); + reply->file = openInfo->file; + if (openInfo->mask & HGFS_OPEN_VALID_SERVER_LOCK) { + reply->acquiredLock = openInfo->acquiredLock; + } + reply->reserved = 0; + *packetSize = HGFS_REP_PAYLOAD_SIZE_V3(reply); + break; + } + case HGFS_OP_OPEN_V2: { HgfsReplyOpenV2 *reply = (HgfsReplyOpenV2 *)packetOut; reply->file = openInfo->file; if (openInfo->mask & HGFS_OPEN_VALID_SERVER_LOCK) { reply->acquiredLock = openInfo->acquiredLock; } *packetSize = sizeof *reply; - } else { + break; + } + case HGFS_OP_OPEN: { HgfsReplyOpen *reply = (HgfsReplyOpen *)packetOut; reply->file = openInfo->file; *packetSize = sizeof *reply; + break; + } + default: + return FALSE; } return TRUE; @@ -3463,7 +3676,7 @@ * 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 + * 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. * @@ -3483,10 +3696,9 @@ char **cpName, // OUT: cpName size_t *cpNameSize, // OUT: cpName size HgfsDeleteHint *hints, // OUT: delete hints - HgfsHandle *file) // OUT: file handle + HgfsHandle *file, // OUT: file handle + uint32 *caseFlags) // OUT: case-sensitivity flags { - HgfsRequestDelete *requestV1; - HgfsRequestDeleteV2 *requestV2; HgfsRequest *request; size_t extra; @@ -3495,21 +3707,63 @@ ASSERT(cpNameSize); ASSERT(file); ASSERT(hints); + ASSERT(caseFlags); request = (HgfsRequest *)packetIn; + *caseFlags = HGFS_FILE_NAME_CASE_SENSITIVE; switch (request->op) { + case HGFS_OP_DELETE_FILE_V3: + case HGFS_OP_DELETE_DIR_V3: { + HgfsRequestDeleteV3 *requestV3; + + requestV3 = (HgfsRequestDeleteV3 *)HGFS_REQ_GET_PAYLOAD_V3(packetIn); + LOG(4, ("HgfsUnpackDeleteRequest: HGFS_OP_DELETE_DIR_V3\n")); + + /* Enforced by the dispatch function. */ + ASSERT(packetSize >= HGFS_REQ_PAYLOAD_SIZE_V3(requestV3)); + + *file = HGFS_INVALID_HANDLE; + *hints = requestV3->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 (requestV3->fileName.flags & HGFS_FILE_NAME_USE_FILE_DESC) { + *file = requestV3->fileName.fid; + *cpName = NULL; + *cpNameSize = 0; + *hints |= HGFS_DELETE_HINT_USE_FILE_DESC; + } else { + extra = packetSize - HGFS_REQ_PAYLOAD_SIZE_V3(requestV3); + + /* + * request->fileName.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 */ + return FALSE; + } + *cpName = requestV3->fileName.name; + *cpNameSize = requestV3->fileName.length; + *caseFlags = requestV3->fileName.caseType; + } + break; + } case HGFS_OP_DELETE_FILE_V2: - case HGFS_OP_DELETE_DIR_V2: + case HGFS_OP_DELETE_DIR_V2: { + HgfsRequestDeleteV2 *requestV2; requestV2 = (HgfsRequestDeleteV2 *)packetIn; - + /* Enforced by the dispatch function. */ ASSERT(packetSize >= 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. */ @@ -3521,7 +3775,7 @@ extra = packetSize - sizeof *requestV2; /* - * request->fileName.length is user-provided, so this test must be + * request->fileName.length is user-provided, so this test must be * carefully written to prevent wraparounds. */ if (requestV2->fileName.length > extra) { @@ -3532,9 +3786,11 @@ *cpNameSize = requestV2->fileName.length; } break; - + } case HGFS_OP_DELETE_FILE: - case HGFS_OP_DELETE_DIR: + case HGFS_OP_DELETE_DIR: { + HgfsRequestDelete *requestV1; + requestV1 = (HgfsRequestDelete *)packetIn; /* Enforced by the dispatch function. */ @@ -3553,7 +3809,7 @@ *cpName = requestV1->fileName.name; *cpNameSize = requestV1->fileName.length; break; - + } default: return FALSE; break; @@ -3575,7 +3831,7 @@ * keep the code simple. * * Results: - * Always TRUE. + * TRUE if valid op version reply filled, FALSE otherwise. * * Side effects: * None @@ -3584,18 +3840,38 @@ */ Bool -HgfsPackDeleteReply(char *packetOut, // IN/OUT: outgoing packet +HgfsPackDeleteReply(HgfsOp deleteOp, // IN: delete operation version + char *packetOut, // IN/OUT: outgoing packet size_t *packetSize) // IN/OUT: size of packet { - HgfsReplyDelete *reply = (HgfsReplyDelete *)packetOut; - + Bool result = TRUE; ASSERT(packetOut); ASSERT(packetSize); - *packetSize = sizeof *reply; + switch (deleteOp) { + case HGFS_OP_DELETE_FILE_V3: + case HGFS_OP_DELETE_DIR_V3: { + HgfsReplyDeleteV3 *reply = (HgfsReplyDeleteV3 *)HGFS_REP_GET_PAYLOAD_V3(packetOut); + reply->reserved = 0; + *packetSize = HGFS_REP_PAYLOAD_SIZE_V3(reply); + break; + } + case HGFS_OP_DELETE_FILE_V2: + case HGFS_OP_DELETE_FILE: + case HGFS_OP_DELETE_DIR_V2: + case HGFS_OP_DELETE_DIR: + *packetSize = sizeof(HgfsReplyDelete); + break; + default: + LOG(4, ("HgfsPackDeleteReply: invalid op code %d\n", + deleteOp)); + result = FALSE; + break; + } + ASSERT(result); - return TRUE; + return result; } @@ -3628,12 +3904,11 @@ uint32 *cpNewNameLen, // OUT: rename dst size HgfsRenameHint *hints, // OUT: rename hints HgfsHandle *srcFile, // OUT: src file handle - HgfsHandle *targetFile) // OUT: target file handle + HgfsHandle *targetFile, // OUT: target file handle + uint32 *oldCaseFlags, // OUT: source case-sensitivity flags + uint32 *newCaseFlags) // OUT: dest. case-sensitivity flags { - HgfsRequestRename *requestV1; - HgfsRequestRenameV2 *requestV2; HgfsRequest *request; - HgfsFileName *newName; size_t extra; ASSERT(packetIn); @@ -3644,6 +3919,8 @@ ASSERT(srcFile); ASSERT(targetFile); ASSERT(hints); + ASSERT(oldCaseFlags); + ASSERT(newCaseFlags); request = (HgfsRequest *)packetIn; @@ -3660,16 +3937,84 @@ */ switch (request->op) { + case HGFS_OP_RENAME_V3: + { + HgfsRequestRenameV3 *requestV3; + HgfsFileNameV3 *newName; + + requestV3 = (HgfsRequestRenameV3 *)HGFS_REQ_GET_PAYLOAD_V3(packetIn); + LOG(4, ("HgfsUnpackRenameRequest: HGFS_OP_RENAME_V3\n")); + + /* Enforced by the dispatch function. */ + ASSERT(packetSize >= HGFS_REQ_PAYLOAD_SIZE_V3(requestV3)); + extra = packetSize - HGFS_REQ_PAYLOAD_SIZE_V3(requestV3); + + *hints = requestV3->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 (requestV3->oldName.flags & HGFS_FILE_NAME_USE_FILE_DESC) { + *srcFile = requestV3->oldName.fid; + *cpOldName = NULL; + *cpOldNameLen = 0; + *oldCaseFlags = HGFS_FILE_NAME_DEFAULT_CASE; + *hints |= HGFS_RENAME_HINT_USE_SRCFILE_DESC; + newName = &requestV3->newName; + } else { + + /* + * request->fileName.length is user-provided, so this test must be + * carefully written to prevent wraparounds. + */ + if (requestV3->oldName.length > extra) { + /* The input packet is smaller than the request */ + return FALSE; + } + + /* It is now safe to use the old file name. */ + *cpOldName = requestV3->oldName.name; + *cpOldNameLen = requestV3->oldName.length; + *oldCaseFlags = requestV3->oldName.caseType; + newName = (HgfsFileNameV3 *)(requestV3->oldName.name + 1 + *cpOldNameLen); + } + extra -= *cpOldNameLen; + + if (newName->flags & HGFS_FILE_NAME_USE_FILE_DESC) { + *targetFile = newName->fid; + *cpNewName = NULL; + *cpNewNameLen = 0; + *newCaseFlags = HGFS_FILE_NAME_DEFAULT_CASE; + *hints |= HGFS_RENAME_HINT_USE_TARGETFILE_DESC; + } else { + if (newName->length > extra) { + /* The input packet is smaller than the request */ + return FALSE; + } + + /* It is now safe to use the new file name. */ + *cpNewName = newName->name; + *cpNewNameLen = newName->length; + *newCaseFlags = newName->caseType; + } + break; + } case HGFS_OP_RENAME_V2: + { + HgfsRequestRenameV2 *requestV2; + HgfsFileName *newName; + requestV2 = (HgfsRequestRenameV2 *)packetIn; - + /* Enforced by the dispatch function. */ ASSERT(packetSize >= sizeof *requestV2); extra = packetSize - 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. @@ -3681,7 +4026,7 @@ } else { /* - * request->fileName.length is user-provided, so this test must be + * request->fileName.length is user-provided, so this test must be * carefully written to prevent wraparounds. */ if (requestV2->oldName.length > extra) { @@ -3713,8 +4058,13 @@ *cpNewNameLen = newName->length; } break; + } case HGFS_OP_RENAME: + { + HgfsRequestRename *requestV1; + HgfsFileName *newName; + requestV1 = (HgfsRequestRename *)packetIn; /* Enforced by the dispatch function. */ @@ -3750,6 +4100,7 @@ *cpNewName = newName->name; *cpNewNameLen = newName->length; break; + } default: return FALSE; @@ -3772,7 +4123,7 @@ * keep the code simple. * * Results: - * Always TRUE. + * TRUE if valid op and reply set, FALSE otherwise. * * Side effects: * None @@ -3781,18 +4132,36 @@ */ Bool -HgfsPackRenameReply(char *packetOut, // IN/OUT: outgoing packet +HgfsPackRenameReply(HgfsOp renameOp, // IN: rename operation version + char *packetOut, // IN/OUT: outgoing packet size_t *packetSize) // IN/OUT: size of packet { - HgfsReplyRename *reply = (HgfsReplyRename *)packetOut; - + Bool result = TRUE; ASSERT(packetOut); ASSERT(packetSize); - *packetSize = sizeof *reply; + switch (renameOp) { + case HGFS_OP_RENAME_V3: { + HgfsReplyRenameV3 *reply = (HgfsReplyRenameV3 *)HGFS_REP_GET_PAYLOAD_V3(packetOut); + reply->reserved = 0; + *packetSize = HGFS_REP_PAYLOAD_SIZE_V3(reply); + break; + } + case HGFS_OP_RENAME_V2: + case HGFS_OP_RENAME: + *packetSize = sizeof(HgfsReplyRename); + break; + default: + LOG(4, ("HgfsPackRenameReply: invalid op code %d\n", + renameOp)); + result = FALSE; + break; + } + + ASSERT(result); - return TRUE; + return result; } @@ -3805,7 +4174,7 @@ * HgfsFileAttrInfo structure that is used to pass around getattr request * information. * - * Since the structure of the get attributes request packet hasn't changed + * 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. @@ -3827,10 +4196,9 @@ HgfsAttrHint *hints, // OUT: getattr hints char **cpName, // OUT: cpName size_t *cpNameSize, // OUT: cpName size - HgfsHandle *file) // OUT: file handle + HgfsHandle *file, // OUT: file handle + uint32 *caseType) // OUT: case-sensitivity flags { - HgfsRequestGetattr *requestV1; - HgfsRequestGetattrV2 *requestV2; HgfsRequest *request; size_t extra; @@ -3839,19 +4207,58 @@ ASSERT(cpName); ASSERT(cpNameSize); ASSERT(file); + ASSERT(caseType); request = (HgfsRequest *)packetIn; attrInfo->requestType = request->op; + *caseType = HGFS_FILE_NAME_DEFAULT_CASE; switch (request->op) { - case HGFS_OP_GETATTR_V2: + case HGFS_OP_GETATTR_V3: { + HgfsRequestGetattrV3 *requestV3; + + requestV3 = (HgfsRequestGetattrV3 *)HGFS_REQ_GET_PAYLOAD_V3(packetIn); + + /* Enforced by the dispatch function. */ + ASSERT(packetSize >= HGFS_REQ_PAYLOAD_SIZE_V3(requestV3)); + + /* + * If we've been asked to reuse a handle, we don't need to look at, let + * alone test the filename or its length. + */ + *hints = requestV3->hints; + if (requestV3->fileName.flags & HGFS_FILE_NAME_USE_FILE_DESC) { + *file = requestV3->fileName.fid; + *cpName = NULL; + *cpNameSize = 0; + *hints |= HGFS_ATTR_HINT_USE_FILE_DESC; + } else { + extra = packetSize - HGFS_REQ_PAYLOAD_SIZE_V3(requestV3); + + /* + * request->fileName.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 */ + return FALSE; + } + *cpName = requestV3->fileName.name; + *cpNameSize = requestV3->fileName.length; + *caseType = requestV3->fileName.caseType; + } + LOG(4, ("HgfsUnpackGetattrRequest: HGFS_OP_GETATTR_V3: %u\n", *caseType)); + break; + } + + case HGFS_OP_GETATTR_V2: { + HgfsRequestGetattrV2 *requestV2; requestV2 = (HgfsRequestGetattrV2 *)packetIn; - + /* Enforced by the dispatch function. */ ASSERT(packetSize >= sizeof *requestV2); - - /* + /* * If we've been asked to reuse a handle, we don't need to look at, let * alone test the filename or its length. */ @@ -3864,7 +4271,7 @@ extra = packetSize - sizeof *requestV2; /* - * request->fileName.length is user-provided, so this test must be + * request->fileName.length is user-provided, so this test must be * carefully written to prevent wraparounds. */ if (requestV2->fileName.length > extra) { @@ -3875,8 +4282,10 @@ *cpNameSize = requestV2->fileName.length; } break; + } - case HGFS_OP_GETATTR: + case HGFS_OP_GETATTR: { + HgfsRequestGetattr *requestV1; requestV1 = (HgfsRequestGetattr *)packetIn; /* Enforced by the dispatch function. */ @@ -3895,6 +4304,7 @@ *cpName = requestV1->fileName.name; *cpNameSize = requestV1->fileName.length; break; + } default: return FALSE; @@ -3928,7 +4338,7 @@ * * HgfsPackGetattrReply -- * - * Pack hgfs getattr reply to the HgfsReplyGetattr{V2} structure. + * Pack hgfs getattr reply to the HgfsReplyGetattr structure. * * Results: * TRUE on success. @@ -3951,7 +4361,60 @@ ASSERT(packetSize); ASSERT(attr); - if (attr->requestType == HGFS_OP_GETATTR_V2) { + switch (attr->requestType) { + case HGFS_OP_GETATTR_V3: { + HgfsReplyGetattrV3 *reply = + (HgfsReplyGetattrV3 *)HGFS_REP_GET_PAYLOAD_V3(packetOut); + reply->attr.mask = attr->mask; + reply->attr.type = attr->type; + LOG(4, ("HgfsPackGetattrReply: attr type: %u\n", reply->attr.type)); + + /* + * Is there enough space in the request packet for the utf8 name? + * Our goal is to write the entire name, with nul terminator, into + * the buffer, but set the length to not include the nul termination. + * This is what clients expect. + * + * Also keep in mind that sizeof *reply already contains one character, + * which we'll consider the nul terminator. + */ + if (utf8TargetNameLen > HGFS_PACKET_MAX - HGFS_REP_PAYLOAD_SIZE_V3(reply)) { + return FALSE; + } + 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; + + 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.specialPerms = attr->specialPerms; + reply->attr.ownerPerms = attr->ownerPerms; + reply->attr.groupPerms = attr->groupPerms; + reply->attr.otherPerms = attr->otherPerms; + reply->attr.flags = attr->flags; + reply->attr.allocationSize = attr->allocationSize; + reply->attr.userId = attr->userId; + reply->attr.groupId = attr->groupId; + reply->attr.hostFileId = attr->hostFileId; + reply->attr.volumeId = attr->volumeId; + reply->reserved = 0; + *packetSize = HGFS_REP_PAYLOAD_SIZE_V3(reply) + utf8TargetNameLen; + break; + } + + case HGFS_OP_GETATTR_V2: { HgfsReplyGetattrV2 *reply = (HgfsReplyGetattrV2 *)packetOut; reply->attr.mask = attr->mask; reply->attr.type = attr->type; @@ -3992,8 +4455,12 @@ reply->attr.userId = attr->userId; reply->attr.groupId = attr->groupId; reply->attr.hostFileId = attr->hostFileId; + reply->attr.volumeId = attr->volumeId; *packetSize = sizeof *reply + utf8TargetNameLen; - } else { + break; + } + + case HGFS_OP_GETATTR: { HgfsReplyGetattr *reply = (HgfsReplyGetattr *)packetOut; /* In GetattrV1, symlinks are treated as regular files. */ @@ -4010,6 +4477,12 @@ reply->attr.attrChangeTime = attr->attrChangeTime; reply->attr.permissions = attr->ownerPerms; *packetSize = sizeof *reply; + break; + } + + default: + LOG(4, ("HgfsPackGetattrReply: Invalid GetAttr op.\n")); + return FALSE; } return TRUE; @@ -4046,24 +4519,37 @@ HgfsHandle *hgfsSearchHandle, // OUT: hgfs search handle uint32 *offset) // OUT: entry offset { - HgfsRequestSearchRead *request; - + HgfsRequest *header = (HgfsRequest *)packetIn; ASSERT(packetIn); ASSERT(attr); ASSERT(hgfsSearchHandle); ASSERT(offset); - request = (HgfsRequestSearchRead *)packetIn; + if (header->op == HGFS_OP_SEARCH_READ_V3) { + HgfsRequestSearchReadV3 *request; - /* Enforced by the dispatch function. */ - ASSERT(packetSize >= sizeof *request); + request = (HgfsRequestSearchReadV3 *)HGFS_REQ_GET_PAYLOAD_V3(packetIn); - *hgfsSearchHandle = request->search; - *offset = request->offset; + /* Enforced by the dispatch function. */ + ASSERT(packetSize >= HGFS_REQ_PAYLOAD_SIZE_V3(request)); - /* Initialize the rest of the fields. */ - attr->requestType = request->header.op; + *hgfsSearchHandle = request->search; + *offset = request->offset; + LOG(4, ("HgfsUnpackSearchReadRequest: HGFS_OP_SEARCH_READ_V3\n")); + } else { + HgfsRequestSearchRead *request; + + request = (HgfsRequestSearchRead *)packetIn; + + /* Enforced by the dispatch function. */ + ASSERT(packetSize >= sizeof *request); + + *hgfsSearchHandle = request->search; + *offset = request->offset; + } + + attr->requestType = header->op; attr->mask = HGFS_ATTR_VALID_NONE; attr->type = 0; attr->size = 0; @@ -4109,7 +4595,63 @@ char *packetOut, // IN/OUT: outgoing packet size_t *packetSize) // IN/OUT: size of packet { - if (attr->requestType == HGFS_OP_SEARCH_READ_V2) { + switch (attr->requestType) { + case HGFS_OP_SEARCH_READ_V3: { + HgfsReplySearchReadV3 *reply = + (HgfsReplySearchReadV3 *)HGFS_REP_GET_PAYLOAD_V3(packetOut); + HgfsDirEntry *dirent = (HgfsDirEntry *)reply->payload; + + /* + * Is there enough space in the request packet for the utf8 name? + * Our goal is to write the entire name, with nul terminator, into + * the buffer, but set the length to not include the nul termination. + * This is what clients expect. + * + * Also keep in mind that sizeof *reply already contains one character, + * which we'll consider the nul terminator. + */ + if (utf8NameLen > HGFS_PACKET_MAX - HGFS_REP_PAYLOAD_SIZE_V3(reply) - + sizeof(struct HgfsDirEntry)) { + return FALSE; + } + + *packetSize = HGFS_REP_PAYLOAD_SIZE_V3(reply) + utf8NameLen + sizeof *dirent; + reply->count = 1; + reply->reserved = 0; + dirent->fileName.length = (uint32)utf8NameLen; + dirent->fileName.flags = 0; + dirent->fileName.fid = 0; + dirent->fileName.caseType = HGFS_FILE_NAME_DEFAULT_CASE; + dirent->nextEntry = 0; + + if (utf8NameLen == 0) { + /* No entry. */ + return TRUE; + } + + memcpy(dirent->fileName.name, utf8Name, utf8NameLen); + dirent->fileName.name[utf8NameLen] = 0; + + dirent->attr.mask = attr->mask; + dirent->attr.type = attr->type; + dirent->attr.size = attr->size; + dirent->attr.creationTime = attr->creationTime; + dirent->attr.accessTime = attr->accessTime; + dirent->attr.writeTime = attr->writeTime; + dirent->attr.attrChangeTime = attr->attrChangeTime; + dirent->attr.specialPerms = attr->specialPerms; + dirent->attr.ownerPerms = attr->ownerPerms; + dirent->attr.groupPerms = attr->groupPerms; + dirent->attr.otherPerms = attr->otherPerms; + dirent->attr.flags = attr->flags; + dirent->attr.allocationSize = attr->allocationSize; + dirent->attr.userId = attr->userId; + dirent->attr.groupId = attr->groupId; + dirent->attr.hostFileId = attr->hostFileId; + break; + } + + case HGFS_OP_SEARCH_READ_V2: { HgfsReplySearchReadV2 *reply = (HgfsReplySearchReadV2 *)packetOut; /* @@ -4152,7 +4694,10 @@ reply->attr.userId = attr->userId; reply->attr.groupId = attr->groupId; reply->attr.hostFileId = attr->hostFileId; - } else { + break; + } + + case HGFS_OP_SEARCH_READ: { HgfsReplySearchRead *reply = (HgfsReplySearchRead *)packetOut; /* @@ -4190,6 +4735,13 @@ reply->attr.writeTime = attr->writeTime; reply->attr.attrChangeTime = attr->attrChangeTime; reply->attr.permissions = attr->ownerPerms; + break; + } + + default: { + LOG(4, ("HgfsPackSearchReadReply: Invalid SearchRead Op.")); + return FALSE; + } } return TRUE; @@ -4222,7 +4774,8 @@ HgfsAttrHint *hints, // OUT: setattr hints char **cpName, // OUT: cpName size_t *cpNameSize, // OUT: cpName size - HgfsHandle *file) // OUT: server file ID + HgfsHandle *file, // OUT: server file ID + uint32 *caseType) // OUT: case-sensitivity flags { HgfsRequest *request; size_t extra; @@ -4232,6 +4785,7 @@ ASSERT(cpName); ASSERT(cpNameSize); ASSERT(file); + ASSERT(caseType); request = (HgfsRequest *)packetIn; @@ -4239,9 +4793,62 @@ attr->requestType = request->op; switch (attr->requestType) { + case HGFS_OP_SETATTR_V3: + { + HgfsRequestSetattrV3 *requestV3 = + (HgfsRequestSetattrV3 *)HGFS_REQ_GET_PAYLOAD_V3(packetIn); + + /* Enforced by the dispatch function. */ + ASSERT(packetSize >= HGFS_REQ_PAYLOAD_SIZE_V3(requestV3)); + + attr->mask = requestV3->attr.mask; + attr->type = requestV3->attr.type; + attr->size = requestV3->attr.size; + attr->creationTime = requestV3->attr.creationTime; + attr->accessTime = requestV3->attr.accessTime; + attr->writeTime = requestV3->attr.writeTime; + attr->attrChangeTime = requestV3->attr.attrChangeTime; + attr->specialPerms = requestV3->attr.specialPerms; + attr->ownerPerms = requestV3->attr.ownerPerms; + attr->groupPerms = requestV3->attr.groupPerms; + attr->otherPerms = requestV3->attr.otherPerms; + attr->flags = requestV3->attr.flags; + attr->allocationSize = requestV3->attr.allocationSize; + attr->userId = requestV3->attr.userId; + attr->groupId = requestV3->attr.groupId; + attr->hostFileId = requestV3->attr.hostFileId; + + *hints = requestV3->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 (requestV3->fileName.flags & HGFS_FILE_NAME_USE_FILE_DESC) { + *file = requestV3->fileName.fid; + *cpName = NULL; + *cpNameSize = 0; + *caseType = HGFS_FILE_NAME_DEFAULT_CASE; + *hints |= HGFS_ATTR_HINT_USE_FILE_DESC; + } else { + extra = packetSize - HGFS_REQ_PAYLOAD_SIZE_V3(requestV3); + + if (requestV3->fileName.length > extra) { + /* The input packet is smaller than the request. */ + return FALSE; + } + /* It is now safe to read the file name. */ + *cpName = requestV3->fileName.name; + *cpNameSize = requestV3->fileName.length; + *caseType = requestV3->fileName.caseType; + } + LOG(4, ("HgfsUnpackSetattrRequest: unpacking HGFS_OP_SETATTR_V3, %u\n", *caseType)); + break; + } + case HGFS_OP_SETATTR_V2: { - HgfsRequestSetattrV2 *requestV2 = + HgfsRequestSetattrV2 *requestV2 = (HgfsRequestSetattrV2 *)packetIn; /* Enforced by the dispatch function. */ @@ -4263,11 +4870,11 @@ attr->userId = requestV2->attr.userId; attr->groupId = requestV2->attr.groupId; attr->hostFileId = requestV2->attr.hostFileId; - + *hints = requestV2->hints; - /* - * If we've been asked to reuse a handle, we don't need to look at, + /* + * 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 (*hints & HGFS_ATTR_HINT_USE_FILE_DESC) { @@ -4290,15 +4897,15 @@ } case HGFS_OP_SETATTR: { - HgfsRequestSetattr *requestV1 = + HgfsRequestSetattr *requestV1 = (HgfsRequestSetattr *)packetIn; - + /* Enforced by the dispatch function. */ ASSERT(packetSize >= sizeof *requestV1); extra = packetSize - sizeof *requestV1; - + /* - * requestV1->fileName.length is user-provided, so this test must be + * requestV1->fileName.length is user-provided, so this test must be * carefully written to prevent wraparounds. */ @@ -4306,11 +4913,11 @@ /* The input packet is smaller than the request. */ return FALSE; } - + /* It is now safe to read the file name. */ *cpName = requestV1->fileName.name; *cpNameSize = requestV1->fileName.length; - + attr->mask = 0; attr->mask |= requestV1->update & HGFS_ATTR_SIZE ? @@ -4336,17 +4943,17 @@ 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; @@ -4377,7 +4984,7 @@ * keep the code simple. * * Results: - * Always TRUE. + * TRUE if valid op and reply set, FALSE otherwise. * * Side effects: * None @@ -4386,18 +4993,37 @@ */ Bool -HgfsPackSetattrReply(char *packetOut, // IN/OUT: outgoing packet +HgfsPackSetattrReply(HgfsOp setattrOp, // IN: setattr operation version + char *packetOut, // IN/OUT: outgoing packet size_t *packetSize) // IN/OUT: size of packet { - HgfsReplySetattr *reply = (HgfsReplySetattr *)packetOut; + Bool result = TRUE; ASSERT(packetOut); ASSERT(packetSize); - *packetSize = sizeof *reply; + switch (setattrOp) { + case HGFS_OP_SETATTR_V3: { + HgfsReplySetattrV3 *reply = + (HgfsReplySetattrV3 *)HGFS_REP_GET_PAYLOAD_V3(packetOut); + reply->reserved = 0; + *packetSize = HGFS_REP_PAYLOAD_SIZE_V3(reply); + break; + } + case HGFS_OP_SETATTR_V2: + case HGFS_OP_SETATTR: + *packetSize = sizeof(HgfsReplySetattr); + break; + default: + result = FALSE; + LOG(4, ("HgfsPackSetattrReply: invalid op code %d\n", + setattrOp)); + break; + } - return TRUE; + ASSERT(result); + return result; } @@ -4427,17 +5053,57 @@ { HgfsRequest *request; size_t extra; - + ASSERT(packetIn); ASSERT(info); request = (HgfsRequest *)packetIn; info->requestType = request->op; + info->caseFlags = HGFS_FILE_NAME_DEFAULT_CASE; switch (info->requestType) { + case HGFS_OP_CREATE_DIR_V3: + { + HgfsRequestCreateDirV3 *requestV3 = + (HgfsRequestCreateDirV3 *)HGFS_REQ_GET_PAYLOAD_V3(packetIn); + + /* Enforced by the dispatch function. */ + ASSERT(packetSize >= HGFS_REQ_PAYLOAD_SIZE_V3(requestV3)); + extra = packetSize - HGFS_REQ_PAYLOAD_SIZE_V3(requestV3); + + if (!(requestV3->mask & HGFS_CREATE_DIR_VALID_FILE_NAME)) { + /* We do not support requests without a valid file name. */ + return FALSE; + } + + /* + * requestV3->fileName.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. */ + 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->ownerPerms = requestV3->ownerPerms; + info->groupPerms = requestV3->groupPerms; + info->otherPerms = requestV3->otherPerms; + LOG(4, ("HgfsUnpackCreateDirRequest: HGFS_OP_CREATE_DIR_V3\n")); + break; + } case HGFS_OP_CREATE_DIR_V2: { - HgfsRequestCreateDirV2 *requestV2 = + HgfsRequestCreateDirV2 *requestV2 = (HgfsRequestCreateDirV2 *)packetIn; /* Enforced by the dispatch function. */ @@ -4450,7 +5116,7 @@ } /* - * requestV2->fileName.length is user-provided, so this test must be + * requestV2->fileName.length is user-provided, so this test must be * carefully written to prevent wraparounds. */ if (requestV2->fileName.length > extra) { @@ -4482,7 +5148,7 @@ extra = packetSize - sizeof *requestV1; /* - * requestV1->fileName.length is user-provided, so this test must be + * requestV1->fileName.length is user-provided, so this test must be * carefully written to prevent wraparounds. */ @@ -4492,7 +5158,7 @@ } /* For CreateDirV1 requests, we know exactly what fields we expect. */ - info->mask = + info->mask = HGFS_CREATE_DIR_VALID_OWNER_PERMS | HGFS_CREATE_DIR_VALID_FILE_NAME; info->cpName = requestV1->fileName.name; @@ -4520,7 +5186,7 @@ * keep the code simple. * * Results: - * Always TRUE. + * TRUE if valid op and reply set, FALSE otherwise. * * Side effects: * None @@ -4529,18 +5195,38 @@ */ Bool -HgfsPackCreateDirReply(char *packetOut, // IN/OUT: outgoing packet +HgfsPackCreateDirReply(HgfsOp createdirOp, // IN: create dir operation version + char *packetOut, // IN/OUT: outgoing packet size_t *packetSize) // IN/OUT: size of packet { - HgfsReplyCreateDir *reply = (HgfsReplyCreateDir *)packetOut; + Bool result = TRUE; ASSERT(packetOut); ASSERT(packetSize); - *packetSize = sizeof *reply; + switch (createdirOp) { + case HGFS_OP_CREATE_DIR_V3: { + HgfsReplyCreateDirV3 *reply = + (HgfsReplyCreateDirV3 *)HGFS_REP_GET_PAYLOAD_V3(packetOut); + reply->reserved = 0; + *packetSize = HGFS_REP_PAYLOAD_SIZE_V3(reply); + break; + } + case HGFS_OP_CREATE_DIR_V2: + case HGFS_OP_CREATE_DIR: + *packetSize = sizeof(HgfsReplyCreateDir); + break; + default: + LOG(4, ("HgfsPackCreateDirReply: invalid op code %d\n", + createdirOp)); + result = FALSE; + break; + } - return TRUE; + ASSERT(result); + + return result; } @@ -4677,7 +5363,7 @@ if (nodeArray[i].state == FILENODE_STATE_UNUSED) { continue; } - + handle = HgfsFileNode2Handle(&nodeArray[i]); HgfsRemoveFromCacheInternal(handle); HgfsFreeFileNodeInternal(handle); @@ -4693,7 +5379,7 @@ } free(searchArray); searchArray = NULL; - + SyncMutex_Destroy(&hgfsIOLock); SyncMutex_Destroy(&hgfsSearchArrayLock); SyncMutex_Destroy(&hgfsNodeArrayLock); @@ -4738,8 +5424,8 @@ } reply = (HgfsReplyServerLockChange *)packetIn; lockData = (ServerLockData *)clientData; - - /* + + /* * 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, @@ -4757,12 +5443,12 @@ * * 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. + * 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 + * 2. Once the guest acknowledges the oplock break, the completion * routine GuestRpcServerRequestCallback will fire, causing - * HgfsServerOplockBreakReply to also fire, which will break the oplock + * HgfsServerOplockBreakReply to also fire, which will break the oplock * on the host FS. * * Results: @@ -4784,16 +5470,16 @@ LOG(4, ("HgfsServerOplockBreak: entered\n")); - /* - * XXX: Just because the file in not in the cache on the server, + /* + * 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 + * 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)) { @@ -4811,11 +5497,11 @@ 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 + * 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); @@ -4831,12 +5517,12 @@ 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 + * + * If for some reason we fail, we'll acknowledge the oplock break * immediately. */ if (HgfsServerManager_SendRequest(requestBuffer, @@ -4846,7 +5532,7 @@ return; } free(requestBuffer); - + ack_and_exit: HgfsAckOplockBreak(lockData, HGFS_LOCK_NONE); return; diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/hgfsServer/hgfsServerInt.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/hgfsServer/hgfsServerInt.h --- open-vm-tools-2008.01.23-74039/lib/hgfsServer/hgfsServerInt.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/hgfsServer/hgfsServerInt.h 2008-10-13 08:01:52.000000000 +0100 @@ -0,0 +1,670 @@ +/********************************************************* + * Copyright (C) 1998 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" + +/* + * Definitions of wrapped internal primitives. + * + * We wrap open file handles and directory entries so that cross-platform HGFS + * server code can use them without platform-specific pre-processing. + * + * On Linux, we use dirent64 from the kernel headers so as to alleviate any + * confusion between what the kernel will give us from the getdents64() + * syscall and what userspace will expect. Note that to avoid depending on + * kernel headers directly, I've copied the dirent struct, replacing certain + * kernel basic types with our own. + * + * On Windows, we define our own DirectoryEntry struct with d_reclen and + * d_name, as those are the only two fields we're interested in. It's not + * essential that it match the dirents from another platform, because we + * control how they get created and populated, and they never pass down a wire. + * + * Otherwise, we use the native dirent struct provided by the platform's libc, + * as nobody else seems to suffer from the 32-bit vs. 64-bit ino_t and off_t + * insanity that plagues Linux. + */ +#ifndef _WIN32 +# ifdef linux + typedef struct DirectoryEntry { + uint64 d_ino; + uint64 d_off; + uint16 d_reclen; + uint8 d_type; + int8 d_name[256]; + } DirectoryEntry; +# else +# include + typedef struct dirent DirectoryEntry; +# endif + typedef int fileDesc; +#else +# include + typedef HANDLE fileDesc; + typedef struct DirectoryEntry { + unsigned short d_reclen; /* The total length of this record. */ + char d_name[PATH_MAX * 4]; /* 4 bytes is the maximum size of a utf8 */ + /* representation of utf-16 encoded */ + /* unicode character in the BMP */ + } DirectoryEntry; +#endif + +#include "dbllnklst.h" +#include "hgfsProto.h" +#include "cpName.h" // for HgfsNameStatus +#include "hgfsServerPolicy.h" +#include "hgfsUtil.h" // for HgfsInternalStatus +#include "syncMutex.h" + +/* + * 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 + +/* Value of config option to require using host timestamps */ +EXTERN Bool alwaysUseHostTime; + +/* Identifier for a local file */ +typedef struct HgfsLocalId { + uint64 volumeId; + uint64 fileId; +} HgfsLocalId; + + +/* 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; + +/* 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 + +/* + * 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. */ + HgfsServerLock serverLock; + + /* File node state on lists */ + FileNodeState state; + + /* File flags - see below. */ + uint32 flags; +} 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; + + /* 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 */ + 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; +} HgfsSearch; + + +/* + * 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 */ + HgfsServerLock desiredLock; /* The type of lock desired by the client */ + HgfsServerLock acquiredLock; /* The type of lock acquired by the server */ + uint32 cpNameSize; + char *cpName; + char *utf8Name; + uint32 caseFlags; /* Case-sensitivity flags. */ +} 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 */ +} HgfsFileAttrInfo; + +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; + char *cpName; + uint32 caseFlags; /* Case-sensitivity flags. */ +} HgfsCreateDirInfo; + + +/* Server lock related structure */ +typedef struct { + fileDesc fileDesc; + int32 event; + HgfsServerLock serverLock; +} ServerLockData; + +extern SyncMutex hgfsIOLock; + +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 + +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 + +Bool +HgfsRemoveSearch(HgfsHandle searchHandle); // IN + +void +HgfsServerDumpDents(HgfsHandle searchHandle); // IN: Handle to dump dents from + +DirectoryEntry * +HgfsGetSearchResult(HgfsHandle handle, // IN: Handle to search + 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 + +HgfsInternalStatus +HgfsServerScandir(char const *baseDir, // IN: Directory to search in + size_t baseDirLen, // IN: Length of directory + Bool followSymlinks, // IN: followSymlinks config option + DirectoryEntry ***dents, // OUT: Array of DirectoryEntrys + int *numDents); // OUT: Number of DirectoryEntrys + +HgfsInternalStatus +HgfsServerSearchRealDir(char const *baseDir, // IN: Directory to search + size_t baseDirLen, // IN: Length of directory + DirectorySearchType type, // IN: Kind of search + char const *shareName, // IN: Share name + HgfsHandle *handle); // OUT: Search handle + +HgfsInternalStatus +HgfsServerSearchVirtualDir(HgfsGetNameFunc *getName, // IN: Name enumerator + HgfsInitFunc *initName, // IN: Init function + HgfsCleanupFunc *cleanupName, // IN: Cleanup function + DirectorySearchType type, // IN: Kind of search + HgfsHandle *handle); // OUT: Search handle + +/* + * Opcode handlers + */ + +HgfsInternalStatus +HgfsServerOpen(char const *packetIn, // IN: incoming packet + char *packetOut, // OUT: outgoing packet + size_t *packetSize); // IN/OUT: size of packet + +HgfsInternalStatus +HgfsServerRead(char const *packetIn, // IN: incoming packet + char *packetOut, // OUT: outgoing packet + size_t *packetSize); // IN/OUT: size of packet + +HgfsInternalStatus +HgfsServerWrite(char const *packetIn, // IN: incoming packet + char *packetOut, // OUT: outgoing packet + size_t *packetSize); // IN/OUT: size of packet + +HgfsInternalStatus +HgfsServerSearchOpen(char const *packetIn, // IN: incoming packet + char *packetOut, // OUT: outgoing packet + size_t *packetSize); // IN/OUT: size of packet + +HgfsInternalStatus +HgfsServerSearchRead(char const *packetIn, // IN: incoming packet + char *packetOut, // OUT: outgoing packet + size_t *packetSize); // IN/OUT: size of packet + +HgfsInternalStatus +HgfsServerGetattr(char const *packetIn, // IN: incoming packet + char *packetOut, // OUT: outgoing packet + size_t *packetSize); // IN/OUT: size of packet + +HgfsInternalStatus +HgfsServerSetattr(char const *packetIn, // IN: incoming packet + char *packetOut, // OUT: outgoing packet + size_t *packetSize); // IN/OUT: size of packet + +HgfsInternalStatus +HgfsServerCreateDir(char const *packetIn, // IN: incoming packet + char *packetOut, // OUT: outgoing packet + size_t *packetSize); // IN/OUT: size of packet + +HgfsInternalStatus +HgfsServerDeleteFile(char const *packetIn, // IN: incoming packet + char *packetOut, // OUT: outgoing packet + size_t *packetSize); // IN/OUT: size of packet + +HgfsInternalStatus +HgfsServerDeleteDir(char const *packetIn, // IN: incoming packet + char *packetOut, // OUT: outgoing packet + size_t *packetSize); // IN/OUT: size of packet + +HgfsInternalStatus +HgfsServerRename(char const *packetIn, // IN: incoming packet + char *packetOut, // OUT: outgoing packet + size_t *packetSize); // IN/OUT: size of packet + +HgfsInternalStatus +HgfsServerQueryVolume(char const *packetIn, // IN: incoming packet + char *packetOut, // OUT: outgoing packet + size_t *packetSize); // IN/OUT: size of packet + +HgfsInternalStatus +HgfsServerSymlinkCreate(char const *packetIn, // IN: incoming packet + char *packetOut, // OUT: outgoing packet + size_t *packetSize); // IN/OUT: size of packet + +HgfsInternalStatus +HgfsServerServerLockChange(char const *packetIn, // IN: incoming packet + char *packetOut, // OUT: outgoing packet + size_t *packetSize); // IN/OUT: size of packet + +/* Unpack/pack requests/reply helper functions. */ + +Bool +HgfsUnpackOpenRequest(char const *packetIn, // IN: incoming packet + size_t packetSize, // IN: size of packet + HgfsFileOpenInfo *openInfo); // IN/OUT: open info struct + +Bool +HgfsPackOpenReply(HgfsFileOpenInfo *openInfo, // IN: open info struct + char *packetOut, // OUT: outgoing packet + size_t *packetSize); // OUT: outgoing packet size + +Bool +HgfsUnpackGetattrRequest(char const *packetIn, // IN: request packet + size_t packetSize, // IN: request packet size + HgfsFileAttrInfo *attrInfo, // IN/OUT: unpacked attr struct + HgfsAttrHint *hints, // OUT: getattr hints + char **cpName, // OUT: cpName + size_t *cpNameSize, // OUT: cpName size + HgfsHandle *file, // OUT: file handle + uint32 *caseFlags); // OUT: case-sensitivity flags + +Bool +HgfsUnpackDeleteRequest(char const *packetIn, // IN: request packet + size_t packetSize, // IN: request packet size + 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(HgfsOp deleteOp, // IN: delete operation version + char *packetOut, // IN/OUT: outgoing packet + size_t *packetSize); // IN/OUT: size of packet + +Bool +HgfsUnpackRenameRequest(char const *packetIn, // IN: request packet + size_t packetSize, // IN: request packet size + char **cpOldName, // OUT: rename src + uint32 *cpOldNameLen, // OUT: rename src size + char **cpNewName, // OUT: rename dst + uint32 *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(HgfsOp renameOp, // IN: rename operation version + char *packetOut, // IN/OUT: outgoing packet + size_t *packetSize); // IN/OUT: size of packet + +Bool +HgfsPackGetattrReply(HgfsFileAttrInfo *attr, // IN: attr stucture + const char *utf8TargetName, // IN: optional target name + uint32 utf8TargetNameLen, // IN: file name length + char *packetOut, // IN/OUT: outgoing packet + size_t *packetSize); // IN/OUT: size of packet + +Bool +HgfsUnpackSearchReadRequest(const char *packetIn, // IN: request packet + size_t packetSize, // IN: packet size + HgfsFileAttrInfo *attr, // OUT: unpacked attr struct + HgfsHandle *hgfsSearchHandle, // OUT: hgfs search handle + uint32 *offset); // OUT: entry offset + +Bool +HgfsPackSearchReadReply(const char *utf8Name, // IN: file name + size_t utf8NameLen, // IN: file name length + HgfsFileAttrInfo *attr, // IN: file attr struct + char *packetOut, // IN/OUT: outgoing packet + size_t *packetSize); // IN/OUT: size of packet + +Bool +HgfsUnpackSetattrRequest(char const *packetIn, // IN: request packet + size_t packetSize, // IN: request packet size + HgfsFileAttrInfo *attr, // IN/OUT: getattr info + HgfsAttrHint *hints, // OUT: setattr hints + char **cpName, // OUT: cpName + size_t *cpNameSize, // OUT: cpName size + HgfsHandle *file, // OUT: server file ID + uint32 *caseFlags); // OUT: case-sensitivity flags + +Bool +HgfsPackSetattrReply(HgfsOp setattrOp, // IN: setattrOp operation version + char *packetOut, // IN/OUT: outgoing packet + size_t *packetSize); // IN/OUT: size of packet + + +Bool +HgfsUnpackCreateDirRequest(char const *packetIn, // IN: incoming packet + size_t packetSize, // IN: size of packet + HgfsCreateDirInfo *info); // IN/OUT: info struct + +Bool +HgfsPackCreateDirReply(HgfsOp createdirOp, // IN: createdirOp operation version + char *packetOut, // IN/OUT: outgoing packet + size_t *packetSize); // IN/OUT: size of packet + +/* Node cache functions. */ + +Bool +HgfsRemoveFromCache(HgfsHandle handle); // IN: Hgfs handle of the node + +Bool +HgfsAddToCache(HgfsHandle handle); // IN: Hgfs handle of the node + +Bool +HgfsIsCached(HgfsHandle handle); // IN: Hgfs handle of the node + +Bool +HgfsIsServerLockAllowed(void); + +Bool +HgfsHandle2FileDesc(HgfsHandle handle, // IN: Hgfs file handle + fileDesc *fd); // OUT: OS handle (file descriptor) + +Bool +HgfsFileDesc2Handle(fileDesc fd, // IN: OS handle (file descriptor) + HgfsHandle *handle); // OUT: Hgfs file handle + +Bool +HgfsHandle2ShareMode(HgfsHandle handle, // IN: Hgfs file handle + HgfsOpenMode *shareMode); // OUT: UTF8 file name size + +Bool +HgfsHandle2FileName(HgfsHandle handle, // IN: Hgfs file handle + char **fileName, // OUT: CP file name + size_t *fileNameSize); // OUT: CP file name size + +Bool +HgfsHandle2AppendFlag(HgfsHandle handle, // IN: Hgfs file handle + Bool *appendFlag); // OUT: Append flag + +Bool +HgfsHandle2LocalId(HgfsHandle handle, // IN: Hgfs file handle + HgfsLocalId *localId); // OUT: Local id info + +Bool +HgfsHandle2ServerLock(HgfsHandle handle, // IN: Hgfs file handle + HgfsServerLock *lock); // OUT: Server lock + +Bool +HgfsUpdateNodeFileDesc(HgfsHandle handle, // IN: Hgfs file handle + fileDesc fd); // OUT: OS handle (file desc + +Bool +HgfsUpdateNodeServerLock(fileDesc fd, // IN: OS handle + HgfsServerLock serverLock); // IN: new oplock + +Bool +HgfsUpdateNodeAppendFlag(HgfsHandle handle, // IN: Hgfs file handle + Bool appendFlag); // OUT: Append flag + +Bool +HgfsFileHasServerLock(const char *utf8Name, // IN: Name in UTF8 + HgfsServerLock *serverLock, // OUT: Existing oplock + fileDesc *fileDesc); // OUT: Existing fd +Bool +HgfsGetNodeCopy(HgfsHandle handle, // IN: Hgfs file handle + Bool copyName, // IN: Should we copy the name? + HgfsFileNode *copy); // IN/OUT: Copy of the node + +Bool +HgfsHandleIsSequentialOpen(HgfsHandle handle, // IN: Hgfs file handle + Bool *sequentialOpen); // OUT: If open was sequential + +Bool +HgfsHandleIsSharedFolderOpen(HgfsHandle handle, // IN: Hgfs file handle + Bool *sharedFolderOpen); // OUT: If shared folder + +Bool +HgfsGetSearchCopy(HgfsHandle handle, // IN: Hgfs search handle + HgfsSearch *copy); // IN/OUT: Copy of the search + +HgfsInternalStatus +HgfsCloseFile(fileDesc fileDesc); // IN: OS handle of the file + +Bool +HgfsServerGetOpenMode(HgfsFileOpenInfo *openInfo, // IN: Open info to examine + uint32 *modeOut); // OUT: Local mode + +Bool +HgfsAcquireServerLock(fileDesc fileDesc, // IN: OS handle + HgfsServerLock *serverLock); // IN/OUT: Oplock asked for/granted + +Bool +HgfsServerPlatformInit(void); + +void +HgfsServerPlatformDestroy(void); + +HgfsInternalStatus +HgfsServerHasSymlink(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 +HgfsServerConvertCase(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 + +Bool +HgfsServerCaseConversionRequired(void); + +/* All oplock-specific functionality is defined here. */ +#ifdef HGFS_OPLOCKS +void +HgfsServerOplockBreak(ServerLockData *data); // IN: server lock info + +void +HgfsAckOplockBreak(ServerLockData *lockData, // IN: server lock info + HgfsServerLock replyLock); // IN: client has this lock +#endif + +#endif /* __HGFS_SERVER_INT_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/hgfsServer/hgfsServerLinux.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/hgfsServer/hgfsServerLinux.c --- open-vm-tools-2008.01.23-74039/lib/hgfsServer/hgfsServerLinux.c 2008-01-28 08:02:51.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/hgfsServer/hgfsServerLinux.c 2008-10-13 08:01:52.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -37,6 +37,15 @@ #include // for utimes(2) #include #include +#include +#include + +#if defined(__FreeBSD__) +# include +#else +# include +# include +#endif #include "vmware.h" #include "hgfsServerPolicy.h" // for security policy @@ -44,11 +53,13 @@ #include "str.h" #include "cpNameLite.h" #include "hgfsUtil.h" // for cross-platform time conversion +#include "posix.h" #include "file.h" #include "util.h" #include "syncMutex.h" #include "su.h" #include "codeset.h" +#include "unicodeOperations.h" #if defined(linux) && !defined(SYS_getdents64) /* For DT_UNKNOWN */ @@ -67,7 +78,7 @@ #include // for CFString and CFURL #endif -/* +/* * ALLPERMS (mode 07777) and ACCESSPERMS (mode 0777) are not defined in the * Solaris version of . */ @@ -96,7 +107,7 @@ } #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 @@ -165,7 +176,7 @@ }) #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. @@ -181,7 +192,8 @@ #endif -#if defined(sun) || defined(linux) || (defined(__FreeBSD__) && BSD_VERSION < 49) +#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 @@ -195,10 +207,10 @@ 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. + /* + * 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]; @@ -210,7 +222,7 @@ if (snprintf(nameBuffer, sizeof nameBuffer, PROC_SELF_FD "%d", fd) < 0) { return -1; } - return utimes(nameBuffer, mytimes); + return Posix_Utimes(nameBuffer, mytimes); #else /* !sun */ return futimesat(fd, NULL, times); #endif /* !sun */ @@ -253,16 +265,35 @@ static HgfsInternalStatus HgfsGetattrResolveAlias(char const *fileName, char **targetName); -static HgfsInternalStatus HgfsGetattrFromName(char const *fileName, +static HgfsInternalStatus HgfsGetattrFromName(char *fileName, + HgfsShareOptions configOptions, HgfsFileAttrInfo *attr, char **targetName); -static HgfsInternalStatus HgfsGetattrFromFd(int fd, +static HgfsInternalStatus HgfsGetattrFromFd(int fd, HgfsFileAttrInfo *attr); -static void HgfsStat(struct stat *stats, +static void HgfsStat(struct stat *stats, 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); @@ -278,15 +309,15 @@ struct timeval *modTime, Bool *timesChanged); -static HgfsInternalStatus HgfsSetattrFromFd(HgfsHandle file, +static HgfsInternalStatus HgfsSetattrFromFd(HgfsHandle file, HgfsFileAttrInfo *attr, HgfsAttrHint hints); -static HgfsInternalStatus HgfsSetattrFromName(char *cpName, +static HgfsInternalStatus HgfsSetattrFromName(char *cpName, size_t cpNameSize, - HgfsFileAttrInfo *attr, - HgfsAttrHint hints); - + HgfsFileAttrInfo *attr, + HgfsAttrHint hints, + uint32 caseFlags); #ifdef HGFS_OPLOCKS /* @@ -307,7 +338,7 @@ *----------------------------------------------------------------------------- */ -static void +static void HgfsServerSigOplockBreak(int sigNum, // IN: Signal number siginfo_t *info, // IN: Additional info about signal void *clientData) // IN: Ignored @@ -315,21 +346,21 @@ ServerLockData *lockData; int newLease, fd; HgfsServerLock newServerLock; - + ASSERT(sigNum == SIGIO); ASSERT(info); ASSERT(clientData == NULL); - + fd = info->si_fd; LOG(4, ("HgfsServerSigOplockBreak: Received SIGIO for fd %d\n", 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. @@ -350,8 +381,8 @@ goto error; } - /* - * Setup a ServerLockData struct so that we can make use of + /* + * 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 @@ -363,7 +394,7 @@ lockData->serverLock = newServerLock; lockData->event = 0; // not needed - /* + /* * Relinquish control of this data. It'll get freed later, when the RPC * command completes. */ @@ -372,8 +403,8 @@ } else { Log("HgfsServerSigOplockBreak: Could not allocate memory for lease " "break on behalf of fd %d\n", fd); - } - + } + error: /* Clean up as best we can. */ fcntl(fd, F_SETLEASE, F_UNLCK); @@ -645,7 +676,7 @@ * Closes the file descriptor. * * Results: - * Zero on success. + * Zero on success. * Non-zero on failure. * * Side effects: @@ -700,7 +731,7 @@ * file name still refers to the same pair */ - if (stat(localName, &nodeStat) < 0) { + if (Posix_Stat(localName, &nodeStat) < 0) { int error = errno; LOG(4, ("HgfsCheckFileNode: couldn't stat local file \"%s\": %s\n", localName, strerror(error))); @@ -774,7 +805,7 @@ * in append mode. If not, close the file and reopen it in append * mode. */ - if (append && !node.appendFlag) { + if (append && !(node.flags & HGFS_FILE_NODE_APPEND_FL)) { status = HgfsCloseFile(node.fileDesc); if (status != 0) { LOG(4, ("HgfsGetFd: Couldn't close file \"%s\" for reopening\n", @@ -782,9 +813,9 @@ goto exit; } - /* - * Update the node in the cache with the new value of the append - * flag. + /* + * Update the node in the cache with the new value of the append + * flag. */ if (!HgfsUpdateNodeAppendFlag(hgfsHandle, TRUE)) { LOG(4, ("HgfsGetFd: Could not update the node in the cache\n")); @@ -807,19 +838,19 @@ 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 = open(node.utf8Name, + newFd = Posix_Open(node.utf8Name, node.mode | openFlags | (append ? O_APPEND : 0)); if (newFd < 0) { @@ -879,6 +910,7 @@ static HgfsInternalStatus HgfsValidateOpen(HgfsFileOpenInfo *openInfo, // IN: Open info struct + int followSymlinks, // IN: followSymlinks config option HgfsLocalId *localId, // OUT: Local unique file ID int *fileDesc) // OUT: Handle to the file { @@ -906,7 +938,7 @@ 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. @@ -927,9 +959,17 @@ 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; + } + + /* * Try to open the file with the requested mode, flags and permissions. */ - fd = open(openInfo->utf8Name, + fd = Posix_Open(openInfo->utf8Name, openMode | openFlags, openPerms); if (fd < 0) { @@ -978,7 +1018,7 @@ * * HgfsAcquireServerLock -- * - * Acquire a lease for the open file. Typically we try and get the exact + * 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. * @@ -1014,8 +1054,8 @@ return FALSE; } - /* - * First tell the kernel which signal to send us. SIGIO is already the + /* + * 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. * @@ -1026,8 +1066,8 @@ Log("HgfsAcquireServerLock: Could not set SIGIO as the desired lease " "break signal for fd %d: %s\n", 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. @@ -1040,10 +1080,10 @@ } else { LOG(4, ("HgfsAcquireServerLock: Unknown server lock\n")); 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. @@ -1067,7 +1107,7 @@ } /* Got a lease of some kind. */ - LOG(4, ("HgfsAcquireServerLock: Got %s lease for fd %d\n", + LOG(4, ("HgfsAcquireServerLock: Got %s lease for fd %d\n", leaseType == F_WRLCK ? "write" : "read", fileDesc)); *serverLock = leaseType == F_WRLCK ? HGFS_LOCK_EXCLUSIVE : HGFS_LOCK_SHARED; return TRUE; @@ -1087,7 +1127,7 @@ * otherwise. Unlike symlinks, aliases cannot be broken; if the target file * is deleted, so is the alias. * - * If the given filename is (or contains) an alias, this function will + * If the given filename is (or contains) an alias, this function will * resolve it completely and set targetName to something non-NULL. * * Results: @@ -1101,7 +1141,7 @@ *----------------------------------------------------------------------------- */ -static HgfsInternalStatus +static HgfsInternalStatus HgfsGetattrResolveAlias(char const *fileName, // IN: Input filename char **targetName) // OUT: Target filename { @@ -1117,8 +1157,8 @@ Boolean targetIsFolder; Boolean wasAliased; OSStatus osStatus; - - /* + + /* * 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 the file is an alias, wasAliased will be set to @@ -1128,20 +1168,33 @@ if (osStatus != noErr) { LOG(4, ("HgfsGetattrResolveAlias: could not create file reference: " "error %lu\n", osStatus)); - goto exit; + goto exit; } - osStatus = FSResolveAliasFile(&fileRef, FALSE, &targetIsFolder, - &wasAliased); + /* + * If alias points to an unmounted volume, the volume needs to be explicitly + * mounted on the host. Mount flag kResolveAliasFileNoUI serves the purpose. + * + * 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? + * + * XXX: It also returns errors if it encounters a file with a .alias suffix + * that isn't a real alias. That's OK for now because our caller + * (HgfsGetattrFromName) will assume that an error means the file is a + * regular file. + */ + osStatus = FSResolveAliasFileWithMountFlags(&fileRef, FALSE, &targetIsFolder, + &wasAliased, kResolveAliasFileNoUI); if (osStatus != noErr) { LOG(4, ("HgfsGetattrResolveAlias: could not resolve reference: error " "%lu\n", osStatus)); goto exit; } - + if (wasAliased) { CFIndex maxPath; - /* + /* * This is somewhat convoluted. We create a CFURL from the FSRef because * we want to call CFURLGetFileSystemRepresentation() to get a UTF-8 * string representing the target of the alias. But to call @@ -1170,7 +1223,7 @@ "of memory for target name storage\n", maxPath)); goto exit; } - if (!CFURLGetFileSystemRepresentation(resolvedRef, FALSE, myTargetName, + if (!CFURLGetFileSystemRepresentation(resolvedRef, FALSE, myTargetName, maxPath)) { LOG(4, ("HgfsGetattrResolveAlias: could not convert and copy " "resolved URL reference into allocated buffer\n")); @@ -1228,12 +1281,446 @@ baseName = strrchr(fileName, DIRSEPC); if ((baseName != NULL) && - (baseName[1] == '.') && - (strcmp(&baseName[1], ".") != 0) && + (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; + } +} + + +/* + *----------------------------------------------------------------------------- + * + * 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 = 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))) { + Unicode 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); + Unicode_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 with its length 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 *curDir; + char *nextComponent; + int error = ENOENT; + size_t curDirSize; + char *convertedComponent = NULL; + size_t convertedComponentSize = 0; + + ASSERT(sharePath); + ASSERT(fileName); + ASSERT(convertedFileName); + ASSERT(fileNameLength >= sharePathLength); + + 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. + * Dup the string and return. + */ + *convertedFileName = strdup(fileName); + if (!*convertedFileName) { + error = errno; + *convertedFileName = NULL; + *convertedFileNameLength = 0; + LOG(4, ("%s: strdup on fileName failed.\n", __FUNCTION__)); + } else { + *convertedFileNameLength = strlen(fileName); + } + return 0; + } + + /* Skip a component separator if not in the share path. */ + if (*currentComponent == DIRSEPC) { + currentComponent += 1; + } + + 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); + + 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) { + int ret; + /* + * Copy out the components starting from currentComponent. We do this + * after replacing DIRSEPC, so all the components following + * currentComponent gets copied. + */ + ret = HgfsConstructConvertedPath(&curDir, &curDirSize, currentComponent, + strlen(currentComponent) + 1); + if (ret) { + error = ret; + } + } + + if (error != ENOENT) { + free(curDir); + } + break; + } + + /* Expand curDir and copy out the converted component. */ + error = HgfsConstructConvertedPath(&curDir, &curDirSize, convertedComponent, + convertedComponentSize); + if (error) { + free(curDir); + free(convertedComponent); + break; + } + + /* Free the converted component. */ + free(convertedComponent); + + /* 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; + } + + /* If the conversion was successful, return the result. */ + if (error == 0 || error == ENOENT) { + *convertedFileName = curDir; + *convertedFileNameLength = curDirSize; + } + +exit: + if (error && error != ENOENT) { + *convertedFileName = NULL; + *convertedFileNameLength = 0; + } + return error; +} + + +/* + *----------------------------------------------------------------------------- + * + * HgfsServerConvertCase -- + * + * Converts the fileName to appropriate case depending upon flags. + * + * Results: + * Returns 0 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. + * + *----------------------------------------------------------------------------- + */ + +HgfsInternalStatus +HgfsServerConvertCase(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; + 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 && 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); + /* + * Success or non-ENOENT error code. HgfsCaseInsensitiveLookup can return ENOENT, + * and its ok to continue if it is ENOENT. + */ + if (error == ENOENT) { + error = 0; + } + return error; + } + + *convertedFileName = strdup(fileName); + if (!*convertedFileName) { + error = errno; + LOG(4, ("%s: strdup on fileName failed.\n", __FUNCTION__)); + } else { + *convertedFileNameLength = fileNameLength; + } + return error; +} + + +/* + *----------------------------------------------------------------------------- + * + * HgfsServerCaseConversionRequired -- + * + * Determines if the case conversion is required for this platform. + * + * Results: + * TRUE on Linux / Apple. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +Bool +HgfsServerCaseConversionRequired() +{ + return TRUE; } @@ -1259,23 +1746,34 @@ */ static HgfsInternalStatus -HgfsGetattrFromName(char const *fileName, // IN: Input filename - HgfsFileAttrInfo *attr, // OUT: Struct to copy into - char **targetName) // OUT: Symlink target filename +HgfsGetattrFromName(char *fileName, // IN/OUT: Input filename + HgfsShareOptions configOptions, // IN: Share config options + HgfsFileAttrInfo *attr, // OUT: Struct to copy into + char **targetName) // OUT: Symlink target filename { HgfsInternalStatus status = 0; struct stat stats; int error; + char *myTargetName = NULL; + ASSERT(fileName); ASSERT(attr); + LOG(4, ("HgfsGetattrFromName: getting attrs for \"%s\"\n", fileName)); - error = lstat(fileName, &stats); - if (error < 0) { - error = errno; - LOG(4, ("HgfsGetattrFromName: error stating file: %s\n", - strerror(error))); - status = error; + /* Check the config option to determine if we should follow symlinks. */ + if (HgfsServerPolicy_IsShareOptionSet(configOptions, HGFS_SHARE_FOLLOW_SYMLINKS)) { + errno = 0; + error = Posix_Stat(fileName, &stats); + } else { + errno = 0; + error = Posix_Lstat(fileName, &stats); + } + + if (error) { + status = errno; + LOG(4, ("HgfsGetattrFromName: error stating file: %s\n", + strerror(status))); goto exit; } @@ -1296,23 +1794,14 @@ * caller asked. Use st_size and readlink() to do so. */ if (targetName != NULL) { - char *myTargetName; - /* st_size does not include the nul. */ - myTargetName = malloc(stats.st_size + 1); - if (myTargetName == NULL) { - LOG(4, ("HgfsGetattrFromName: ran out of memory when allocating " - "space for symlink target name.\n")); - status = ENOMEM; - goto exit; - } - if (readlink(fileName, myTargetName, stats.st_size) != stats.st_size) { + myTargetName = Posix_ReadLink(fileName); + if (myTargetName == NULL) { error = errno; LOG(4, ("HgfsGetattrFromName: readlink returned wrong size\n")); - free(myTargetName); - /* - * Because of an unavoidable race between the lstat(2) and the + /* + * 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". @@ -1320,25 +1809,26 @@ status = error ? error : ENOMEM; goto exit; } - /* readlink() does not nul terminate. */ - myTargetName[stats.st_size] = '\0'; - *targetName = myTargetName; } } else { - char *myTargetName = NULL; - - /* + /* * 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, ("HgfsGetattrFromName: NOT a directory or symlink\n")); - status = HgfsGetattrResolveAlias(fileName, &myTargetName); - if (status != 0) { + if (HgfsGetattrResolveAlias(fileName, &myTargetName)) { LOG(4, ("HgfsGetattrFromName: could not resolve file aliases\n")); - goto exit; } 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 @@ -1346,32 +1836,44 @@ */ stats.st_size = strlen(myTargetName); stats.st_mode |= ACCESSPERMS; - - /* - * Note that the caller may not actually care about the alias's - * target filename (though it still wants to know that the file is an - * alias). - */ - if (targetName != NULL) { - *targetName = myTargetName; - } else { - free(myTargetName); - } attr->type = HGFS_FILE_TYPE_SYMLINK; } else { attr->type = HGFS_FILE_TYPE_REGULAR; } } + 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, ("HgfsGetattrFromName: Unable to normalize form C " + "\"%s\"\n", myTargetName)); + status = HgfsConvertFromNameStatus(HGFS_NAME_STATUS_FAILURE); + goto exit; + } +#else + *targetName = myTargetName; + myTargetName = NULL; +#endif + } + HgfsStat(&stats, attr); - /* + /* * In the case we have a Windows client, force the hidden flag. * This will be ignored by Linux, Solaris clients. */ HgfsGetHiddenAttr(fileName, attr); exit: + free(myTargetName); return status; } @@ -1433,7 +1935,7 @@ attr->type = HGFS_FILE_TYPE_REGULAR; LOG(4, ("HgfsGetattrFromFd: NOT a directory or symlink\n")); } - + HgfsStat(&stats, attr); /* @@ -1467,7 +1969,7 @@ goto exit; } - /* + /* * In the case we have a Windows client, force the hidden flag. * This will be ignored by Linux, Solaris clients. */ @@ -1475,7 +1977,7 @@ if (shareMode == HGFS_OPEN_MODE_READ_ONLY) { - /* + /* * Share does not allow write, so tell the client * everything is read only. */ @@ -1488,7 +1990,7 @@ if (attr->mask & HGFS_ATTR_VALID_OTHER_PERMS) { attr->otherPerms &= ~HGFS_PERM_WRITE; } - } + } exit: free(fileName); @@ -1515,7 +2017,7 @@ */ static void -HgfsStat(struct stat *stats, // IN: stat information +HgfsStat(struct stat *stats, // IN: stat information HgfsFileAttrInfo *attr) // OUT: FileAttrInfo to copy into { attr->size = stats->st_size; @@ -1536,7 +2038,7 @@ * FreeBSD: All supported versions have timestamps with nanosecond resolution. * FreeBSD 5+ has also file creation time. */ -# if BSD_VERSION >= 50 +# if __IS_FREEBSD_VER__(500043) attr->creationTime = HgfsConvertTimeSpecToNtTime(&stats->st_birthtimespec); # else attr->creationTime = HgfsConvertTimeSpecToNtTime(&stats->st_atimespec); @@ -1584,7 +2086,7 @@ attr->specialPerms, attr->ownerPerms, attr->groupPerms, attr->otherPerms, attr->size)); #ifdef __FreeBSD__ -# if !defined(VM_X86_64) && BSD_VERSION >= 50 +# if !defined(VM_X86_64) && __FreeBSD_version >= 500043 # define FMTTIMET "" # else # define FMTTIMET "l" @@ -1601,6 +2103,7 @@ 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_CREATE_TIME | @@ -1613,7 +2116,8 @@ HGFS_ATTR_VALID_OTHER_PERMS | HGFS_ATTR_VALID_USERID | HGFS_ATTR_VALID_GROUPID | - HGFS_ATTR_VALID_FILEID; + HGFS_ATTR_VALID_FILEID | + HGFS_ATTR_VALID_VOLID; } @@ -1910,7 +2414,7 @@ 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 @@ -1937,7 +2441,7 @@ idChanged = HgfsSetattrOwnership(attr, &newUid, &newGid); if (idChanged) { - LOG(4, ("HgfsSetattrFromFd: set uid %"FMTUID" and gid %"FMTUID"\n", + LOG(4, ("HgfsSetattrFromFd: set uid %"FMTUID" and gid %"FMTUID"\n", newUid, newGid)); if (fchown(fd, newUid, newGid) < 0) { error = errno; @@ -1949,10 +2453,10 @@ 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 + * 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, &serverLock)) { @@ -1972,16 +2476,16 @@ } } - timesStatus = HgfsSetattrTimes(&statBuf, attr, hints, + timesStatus = HgfsSetattrTimes(&statBuf, attr, hints, ×[0], ×[1], ×Changed); if (timesStatus == 0 && timesChanged) { Bool superUser; LOG(4, ("HgfsSetattrFromFd: setting new times\n")); - /* - * If the VMX is either the file owner or running as root, switch to - * superuser briefly to set the files times using futimes. Otherwise + /* + * If the VMX is either the file owner or running as root, switch to + * superuser briefly to set the files times using futimes. Otherwise * return an error. */ superUser = IsSuperUser(); @@ -2034,7 +2538,8 @@ HgfsSetattrFromName(char *cpName, // IN: Name size_t cpNameSize, // IN: Name length HgfsFileAttrInfo *attr, // IN: attrs to set - HgfsAttrHint hints) // IN: attr hints + HgfsAttrHint hints, // IN: attr hints + uint32 caseFlags) // IN: case-sensitivity flags { HgfsInternalStatus status = 0, timesStatus; HgfsNameStatus nameStatus; @@ -2049,10 +2554,12 @@ Bool timesChanged = FALSE; Bool idChanged = FALSE; HgfsServerLock serverLock; + HgfsShareOptions configOptions; nameStatus = HgfsServerGetAccess(cpName, cpNameSize, HGFS_OPEN_MODE_WRITE_ONLY, + caseFlags, &localName, NULL); if (nameStatus != HGFS_NAME_STATUS_COMPLETE) { @@ -2063,25 +2570,35 @@ ASSERT(localName); - /* - * 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, ("HgfsSetattrFromName: pathname contains a symlink\n")); - status = EINVAL; - goto exit_free; + /* Get the config options. */ + nameStatus = HgfsServerPolicy_GetShareOptions(cpName, cpNameSize, + &configOptions); + if (nameStatus != HGFS_NAME_STATUS_COMPLETE) { + LOG(4, ("HgfsSetattrFromName: no matching share: %s.\n", cpName)); + goto exit; + } + + 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, ("HgfsSetattrFromName: pathname contains a symlink\n")); + status = EINVAL; + goto exit_free; + } } LOG(4, ("HgfsSetattrFromName: setting attrs for \"%s\"\n", localName)); /* We need the old stats so that we can preserve times. */ - if (lstat(localName, &statBuf) == -1) { + if (Posix_Lstat(localName, &statBuf) == -1) { error = errno; LOG(4, ("HgfsSetattrFromName: error stating file \"%s\": %s\n", localName, strerror(error))); @@ -2105,7 +2622,7 @@ permsChanged = HgfsSetattrMode(&statBuf, attr, &newPermissions); if (permsChanged) { LOG(4, ("HgfsSetattrFromName: set mode %o\n", (unsigned)newPermissions)); - if (chmod(localName, newPermissions) < 0) { + if (Posix_Chmod(localName, newPermissions) < 0) { error = errno; LOG(4, ("HgfsSetattrFromName: error chmoding file \"%s\": %s\n", localName, strerror(error))); @@ -2119,7 +2636,7 @@ * not be changed, we pass in -1. */ if (idChanged) { - if (lchown(localName, newUid, newGid) < 0) { + if (Posix_Lchown(localName, newUid, newGid) < 0) { error = errno; LOG(4, ("HgfsSetattrFromName: error chowning file \"%s\": %s\n", localName, strerror(error))); @@ -2128,17 +2645,17 @@ } 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 + * 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 (HgfsFileHasServerLock(localName, &serverLock, &fd)) { LOG(4, ("HgfsSetattrFromName: Client attempted to truncate an " "oplocked file\n")); status = EBUSY; - } else if (truncate(localName, attr->size) < 0) { + } else if (Posix_Truncate(localName, attr->size) < 0) { error = errno; LOG(4, ("HgfsSetattrFromName: error truncating file \"%s\": %s\n", localName, strerror(error))); @@ -2157,7 +2674,7 @@ * when we politely ask with -D_GNU_SOURCE -D_BSD_SOURCE */ - if (utimes(localName, times) < 0) { + if (Posix_Utimes(localName, times) < 0) { error = errno; LOG(4, ("HgfsSetattrFromName: utimes error on file \"%s\": %s\n", localName, strerror(error))); @@ -2198,6 +2715,7 @@ HgfsInternalStatus HgfsServerScandir(char const *baseDir, // IN: Directory to search in size_t baseDirLen, // IN: Ignored + Bool followSymlinks, // IN: followSymlinks config option DirectoryEntry ***dents, // OUT: Array of DirectoryEntrys int *numDents) // OUT: Number of DirectoryEntrys { @@ -2205,15 +2723,21 @@ DirectoryEntry **myDents = NULL; int myNumDents = 0; HgfsInternalStatus status = 0; + int openFlags = O_NONBLOCK | O_RDONLY | O_DIRECTORY | O_NOFOLLOW; - /* + /* * 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]; - /* We want a directory. No FIFOs and no symlinks. */ - result = open(baseDir, O_NONBLOCK | O_RDONLY | O_DIRECTORY | O_NOFOLLOW); + /* 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, ("HgfsServerScandir: error in open: %d (%s)\n", status, @@ -2222,11 +2746,11 @@ } fd = result; - /* + /* * 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, + while ((result = getdents(fd, (void *)buffer, sizeof buffer)) > 0) { size_t offset = 0; while (offset < result) { @@ -2236,7 +2760,7 @@ /* 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) { @@ -2244,9 +2768,9 @@ goto exit; } myDents = newDents; - - /* - * Allocate the new dent and set it up. We do a straight memcpy of + + /* + * 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); @@ -2256,7 +2780,7 @@ } memcpy(myDents[myNumDents], newDent, newDent->d_reclen); - /* + /* * Dent is done. Bump the offset to the batched buffer to process the * next dent within it. */ @@ -2279,7 +2803,7 @@ strerror(status))); } - /* + /* * On error, free all allocated dents. On success, set the dents pointer * given to us by the client. */ @@ -2368,6 +2892,8 @@ HgfsFileOpenInfo openInfo; char *localName = NULL; HgfsServerLock serverLock = HGFS_LOCK_NONE; + HgfsShareOptions configOptions; + int followSymlinks; ASSERT(packetSize); @@ -2386,8 +2912,9 @@ nameStatus = HgfsServerGetAccess(openInfo.cpName, openInfo.cpNameSize, openInfo.mode, + openInfo.caseFlags, &localName, - NULL); + NULL); if (nameStatus != HGFS_NAME_STATUS_COMPLETE) { LOG(4, ("HgfsServerOpen: access check failed\n")); status = HgfsConvertFromNameStatus(nameStatus); @@ -2396,7 +2923,7 @@ ASSERT(localName); openInfo.utf8Name = localName; - + LOG(4, ("HgfsServerOpen: opening \"%s\", mode %u, flags %u, perms " "%u%u%u%u\n", openInfo.utf8Name, (openInfo.mask & HGFS_OPEN_VALID_MODE) ? openInfo.mode : 0, @@ -2410,11 +2937,11 @@ (openInfo.mask & HGFS_OPEN_VALID_OTHER_PERMS) ? openInfo.otherPerms : 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 + /* + * 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 @@ -2422,7 +2949,7 @@ * 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 + * 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(localName, &serverLock, &newFd)) { @@ -2432,12 +2959,25 @@ goto exit; } + /* Get the config options. */ + nameStatus = HgfsServerPolicy_GetShareOptions(openInfo.cpName, + openInfo.cpNameSize, + &configOptions); + if (nameStatus != HGFS_NAME_STATUS_COMPLETE) { + LOG(4, ("HgfsServerSearchRead: no matching share: %s.\n", openInfo.cpName)); + status = ENOENT; + goto exit; + } + + followSymlinks = HgfsServerPolicy_IsShareOptionSet(configOptions, + HGFS_SHARE_FOLLOW_SYMLINKS); + /* See if the name is valid, and if so add it and return the handle. */ - status = HgfsValidateOpen(&openInfo, &localId, &newFd); + status = HgfsValidateOpen(&openInfo, followSymlinks, &localId, &newFd); if (status == 0) { ASSERT(newFd >= 0); - /* + /* * Open succeeded, so make new node and return its handle. If we fail, * it's almost certainly an internal server error. */ @@ -2446,7 +2986,7 @@ goto exit; } - status = HgfsPackOpenReply(&openInfo, packetOut, packetSize) ? + status = HgfsPackOpenReply(&openInfo, packetOut, packetSize) ? 0 : EPROTO; } @@ -2479,43 +3019,67 @@ char *packetOut, // OUT: outgoing packet size_t *packetSize) // IN/OUT: size of packet { - HgfsRequestRead *request; - HgfsReplyRead *reply; + HgfsRequest *header = (HgfsRequest *)packetIn; int fd; - uint64 offset; int error; HgfsInternalStatus status; uint32 extra; - uint32 requiredSize; Bool sequentialOpen; + HgfsHandle file; + uint64 offset; + uint32 requiredSize; + char *payload; + uint32 *replyActualSize; + size_t replySize; - request = (HgfsRequestRead *)packetIn; - ASSERT(request); - reply = (HgfsReplyRead *)packetOut; - ASSERT(reply); + ASSERT(packetIn); + ASSERT(packetOut); ASSERT(packetSize); + if (header->op == HGFS_OP_READ_V3) { + HgfsRequestReadV3 *request = + (HgfsRequestReadV3 *)HGFS_REQ_GET_PAYLOAD_V3(packetIn); + HgfsReplyReadV3 *reply = (HgfsReplyReadV3 *)HGFS_REP_GET_PAYLOAD_V3(packetOut); + + file = request->file; + offset = request->offset; + requiredSize = request->requiredSize; + payload = reply->payload; + replyActualSize = &reply->actualSize; + reply->reserved = 0; + replySize = HGFS_REP_PAYLOAD_SIZE_V3(reply) - 1; + ASSERT(HGFS_LARGE_PACKET_MAX >= replySize); + extra = HGFS_LARGE_PACKET_MAX - replySize; + } else { + HgfsRequestRead *request = (HgfsRequestRead *)packetIn; + HgfsReplyRead *reply = (HgfsReplyRead *)packetOut; + + file = request->file; + offset = request->offset; + requiredSize = request->requiredSize; + payload = reply->payload; + replyActualSize = &reply->actualSize; + replySize = sizeof *reply - 1; + ASSERT(HGFS_PACKET_MAX >= replySize); + extra = HGFS_PACKET_MAX - replySize; + } + LOG(4, ("HgfsServerRead: read fh %u, offset %"FMT64"u, count %u\n", - request->file, request->offset, request->requiredSize)); + file, offset, requiredSize)); /* Get the file descriptor from the cache */ - status = HgfsGetFd(request->file, FALSE, &fd); + status = HgfsGetFd(file, FALSE, &fd); if (status != 0) { LOG(4, ("HgfsServerRead: Could not get file descriptor\n")); return status; } - if (!HgfsHandleIsSequentialOpen(request->file, &sequentialOpen)) { + if (!HgfsHandleIsSequentialOpen(file, &sequentialOpen)) { LOG(4, ("HgfsServerRead: Could not get sequenial open status\n")); return EBADF; } - ASSERT_ON_COMPILE(HGFS_PACKET_MAX >= sizeof *reply - 1); - extra = HGFS_PACKET_MAX - (sizeof *reply - 1); - - requiredSize = request->requiredSize; - /* * requiredSize is user-provided, so this test must be carefully * written to prevent wraparounds. @@ -2528,15 +3092,12 @@ requiredSize = extra; } - offset = request->offset; - - #if defined(GLIBC_VERSION_21) || defined(__APPLE__) /* Read from the file. */ if (sequentialOpen) { - error = read(fd, reply->payload, requiredSize); + error = read(fd, payload, requiredSize); } else { - error = pread(fd, reply->payload, requiredSize, offset); + error = pread(fd, payload, requiredSize, offset); } #else /* @@ -2567,23 +3128,24 @@ } } - error = read(fd, reply->payload, requiredSize); + error = read(fd, payload, requiredSize); SyncMutex_Unlock(&hgfsIOLock); #endif if (error < 0) { status = errno; - LOG(4, ("HgfsServerRead: error reading from file: %s\n", + LOG(4, ("HgfsServerRead: error reading from file: %s\n", strerror(status))); goto error; } LOG(4, ("HgfsServerRead: read %d bytes\n", error)); - reply->actualSize = error; - *packetSize = sizeof *reply - 1 + error; + *replyActualSize = error; + replySize += error; + *packetSize = replySize; return 0; error: - if (!HgfsRemoveFromCache(request->file)) { + if (!HgfsRemoveFromCache(file)) { LOG(4, ("HgfsServerRead: Could not remove the node from cache.\n")); } return status; @@ -2612,28 +3174,65 @@ char *packetOut, // OUT: outgoing packet size_t *packetSize) // IN/OUT: size of packet { - HgfsRequestWrite *request; - HgfsReplyWrite *reply; + HgfsRequest *header = (HgfsRequest *)packetIn; uint32 extra; - uint32 requiredSize; HgfsInternalStatus status; int fd; - uint64 offset; int error; Bool sequentialOpen; + HgfsHandle file; + HgfsWriteFlags flags; + uint64 offset; + uint32 requiredSize; + char *payload; + uint32 *actualSize; + size_t replySize; - request = (HgfsRequestWrite *)packetIn; - ASSERT(request); - reply = (HgfsReplyWrite *)packetOut; - ASSERT(reply); + ASSERT(packetIn); + ASSERT(packetOut); ASSERT(packetSize); - LOG(4, ("HgfsServerWrite: write fh %u, offset %"FMT64"u, count %u\n", - request->file, request->offset, request->requiredSize)); + if (header->op == HGFS_OP_WRITE_V3) { + HgfsRequestWriteV3 *request = + (HgfsRequestWriteV3 *)HGFS_REQ_GET_PAYLOAD_V3(packetIn); + HgfsReplyWriteV3 *reply = + (HgfsReplyWriteV3 *)HGFS_REP_GET_PAYLOAD_V3(packetOut); + + /* Enforced by the dispatch function */ + ASSERT(*packetSize >= HGFS_REQ_PAYLOAD_SIZE_V3(request) - 1); + extra = *packetSize - (HGFS_REQ_PAYLOAD_SIZE_V3(request) - 1); + + file = request->file; + flags = request->flags; + offset = request->offset; + payload = request->payload; + requiredSize = request->requiredSize; + actualSize = &reply->actualSize; + reply->reserved = 0; + replySize = HGFS_REP_PAYLOAD_SIZE_V3(reply); + } else { + HgfsRequestWrite *request = (HgfsRequestWrite *)packetIn; + HgfsReplyWrite *reply = (HgfsReplyWrite *)packetOut; + + /* Enforced by the dispatch function */ + ASSERT(*packetSize >= sizeof *request - 1); + extra = *packetSize - (sizeof *request - 1); + + file = request->file; + flags = request->flags; + offset = request->offset; + payload = request->payload; + requiredSize = request->requiredSize; + actualSize = &reply->actualSize; + replySize = sizeof *reply; + } + + LOG(4, ("HgfsServerWrite: write fh %u, offset %"FMT64"u, count %u, extra %u\n", + file, offset, requiredSize, extra)); /* Get the file desriptor from the cache */ - status = HgfsGetFd(request->file, ((request->flags & HGFS_WRITE_APPEND) ? - TRUE : FALSE), + status = HgfsGetFd(file, ((flags & HGFS_WRITE_APPEND) ? + TRUE : FALSE), &fd); if (status != 0) { @@ -2641,17 +3240,11 @@ return status; } - if (!HgfsHandleIsSequentialOpen(request->file, &sequentialOpen)) { + if (!HgfsHandleIsSequentialOpen(file, &sequentialOpen)) { LOG(4, ("HgfsServerWrite: Could not get sequential open status\n")); return EBADF; } - /* Enforced by the dispatch function */ - ASSERT(*packetSize >= sizeof *request - 1); - extra = *packetSize - (sizeof *request - 1); - - requiredSize = request->requiredSize; - /* * requiredSize is user-provided, so this test must be carefully * written to prevent wraparounds. @@ -2664,14 +3257,12 @@ requiredSize = extra; } - offset = request->offset; - #if defined(GLIBC_VERSION_21) || defined(__APPLE__) /* Write to the file. */ if (sequentialOpen) { - error = write(fd, request->payload, requiredSize); + error = write(fd, payload, requiredSize); } else { - error = pwrite(fd, request->payload, requiredSize, offset); + error = pwrite(fd, payload, requiredSize, offset); } #else /* @@ -2702,23 +3293,23 @@ } } - error = write(fd, request->payload, requiredSize); + error = write(fd, payload, requiredSize); SyncMutex_Unlock(&hgfsIOLock); #endif if (error < 0) { status = errno; - LOG(4, ("HgfsServerWrite: error writing to file: %s\n", + LOG(4, ("HgfsServerWrite: error writing to file: %s\n", strerror(status))); goto error; } LOG(4, ("HgfsServerWrite: wrote %d bytes\n", error)); - reply->actualSize = error; - *packetSize = sizeof *reply; + *actualSize = error; + *packetSize = replySize; return 0; error: - if (!HgfsRemoveFromCache(request->file)) { + if (!HgfsRemoveFromCache(file)) { LOG(4, ("HgfsServerWrite: Could not remove the node from cache.\n")); } return status; @@ -2747,49 +3338,99 @@ char *packetOut, // OUT: outgoing packet size_t *packetSize) // IN/OUT: size of packet { - HgfsRequestSearchOpen *request; - HgfsReplySearchOpen *reply; + HgfsRequest *header; + HgfsHandle *replySearch; uint32 extra; size_t baseDirLen; char *baseDir; HgfsHandle handle; HgfsInternalStatus status; HgfsNameStatus nameStatus; + char *dirName; + uint32 dirNameLength; + HgfsCaseType caseFlags = HGFS_FILE_NAME_DEFAULT_CASE; + size_t replySize; - request = (HgfsRequestSearchOpen *)packetIn; - ASSERT(request); - reply = (HgfsReplySearchOpen *)packetOut; - ASSERT(reply); + ASSERT(packetIn); + ASSERT(packetOut); ASSERT(packetSize); + header = (HgfsRequest *)packetIn; - /* Enforced by the dispatch function */ - ASSERT(*packetSize >= sizeof *request); - extra = *packetSize - sizeof *request; + if (header->op == HGFS_OP_SEARCH_OPEN_V3) { + HgfsRequestSearchOpenV3 *requestV3; + HgfsReplySearchOpenV3 *replyV3; + + requestV3 = (HgfsRequestSearchOpenV3 *)HGFS_REQ_GET_PAYLOAD_V3(packetIn); + replyV3 = (HgfsReplySearchOpenV3 *)HGFS_REP_GET_PAYLOAD_V3(packetOut); + + /* Enforced by the dispatch function */ + ASSERT(*packetSize >= HGFS_REQ_PAYLOAD_SIZE_V3(requestV3)); + extra = *packetSize - HGFS_REQ_PAYLOAD_SIZE_V3(requestV3); + + caseFlags = requestV3->dirName.caseType; + dirName = requestV3->dirName.name; + dirNameLength = requestV3->dirName.length; + replySearch = &replyV3->search; + replyV3->reserved = 0; + + replySize = HGFS_REP_PAYLOAD_SIZE_V3(replyV3); + LOG(4, ("HgfsServerSearchOpen: HGFS_OP_SEARCH_OPEN_V3\n")); + } else { + HgfsRequestSearchOpen *request; + + request = (HgfsRequestSearchOpen *)packetIn; + /* Enforced by the dispatch function */ + ASSERT(*packetSize >= sizeof *request); + extra = *packetSize - sizeof *request; + + dirName = request->dirName.name; + dirNameLength = request->dirName.length; + replySearch = &((HgfsReplySearchOpen *)packetOut)->search; + replySize = sizeof(HgfsReplySearchOpen); + } /* * request->dirName.length is user-provided, so this test must be carefully * written to prevent wraparounds. */ - if (request->dirName.length > extra) { + if (dirNameLength > extra) { /* The input packet is smaller than the request */ status = EPROTO; goto exit; } /* It is now safe to read the dirName */ - nameStatus = HgfsServerGetAccess(request->dirName.name, - request->dirName.length, + nameStatus = HgfsServerGetAccess(dirName, + dirNameLength, HGFS_OPEN_MODE_READ_ONLY, + caseFlags, &baseDir, &baseDirLen); switch (nameStatus) { case HGFS_NAME_STATUS_COMPLETE: + { + char const *inEnd; + char *next; + int len; + ASSERT(baseDir); + LOG(4, ("HgfsServerSearchOpen: searching in \"%s\", %s.\n", baseDir, dirName)); + + inEnd = dirName + dirNameLength; + + /* Get the first component. */ + len = CPName_GetComponentGeneric(dirName, inEnd, "", (char const **) &next); + if (len < 0) { + LOG(4, ("HgfsServerSearchOpen: get first component failed\n")); + status = ENOENT; + goto exit; + } - LOG(4, ("HgfsServerSearchOpen: searching in \"%s\"\n", baseDir)); + LOG(4, ("HgfsServerSearchOpen: dirName: %s.\n", dirName)); status = HgfsServerSearchRealDir(baseDir, baseDirLen, DIRECTORY_SEARCH_TYPE_DIR, + dirName, &handle); free(baseDir); if (status != 0) { @@ -2797,6 +3438,7 @@ goto exit; } break; + } case HGFS_NAME_STATUS_INCOMPLETE_BASE: /* @@ -2829,8 +3471,8 @@ * Return handle to the search object as the reply to the search * open. */ - reply->search = handle; - *packetSize = sizeof *reply; + *replySearch = handle; + *packetSize = replySize; exit: return status; } @@ -2865,6 +3507,7 @@ HgfsHandle hgfsSearchHandle; DirectoryEntry *dent; HgfsSearch search; + HgfsShareOptions configOptions = 0; ASSERT(packetSize); @@ -2885,13 +3528,29 @@ return EBADF; } - while ((dent = HgfsGetSearchResult(hgfsSearchHandle, + /* Get the config options. */ + if (search.utf8ShareNameLen != 0) { + nameStatus = HgfsServerPolicy_GetShareOptions(search.utf8ShareName, + search.utf8ShareNameLen, + &configOptions); + if (nameStatus != HGFS_NAME_STATUS_COMPLETE) { + LOG(4, ("HgfsServerSearchRead: no matching share: %s.\n", search.utf8ShareName)); + free(search.utf8Dir); + free(search.utf8ShareName); + return ENOENT; + } + } + + while ((dent = HgfsGetSearchResult(hgfsSearchHandle, requestedOffset, FALSE)) != NULL) { unsigned int length; char *fullName; - char const *sharePath; + char *sharePath; size_t sharePathLen; size_t fullNameLen; + size_t entryNameLen; + char *entryName = NULL; + Bool freeEntryName = FALSE; length = strlen(dent->d_name); @@ -2899,7 +3558,7 @@ 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. */ @@ -2909,6 +3568,7 @@ LOG(4, ("HgfsServerSearchRead: could not allocate space for " "\"%s\\%s\"\n", search.utf8Dir, dent->d_name)); free(search.utf8Dir); + free(search.utf8ShareName); free(dent); return ENOMEM; } @@ -2917,7 +3577,8 @@ memcpy(&fullName[search.utf8DirLen + 1], dent->d_name, length + 1); LOG(4, ("HgfsServerSearchRead: about to stat \"%s\"\n", fullName)); - status = HgfsGetattrFromName(fullName, &attr, NULL); + + status = HgfsGetattrFromName(fullName, configOptions, &attr, NULL); free(fullName); if (status != 0) { @@ -2926,16 +3587,39 @@ free(dent); continue; } + +#if defined(__APPLE__) + /* + * HGFS clients receive names in unicode normal form C, + * (precomposed) so Mac hosts must convert from normal form D + * (decomposed). + */ + if (!CodeSet_Utf8FormDToUtf8FormC((const char *)dent->d_name, + length, + &entryName, + &entryNameLen)) { + LOG(4, ("HgfsServerSearchRead: Unable to normalize form C \"%s\"\n", + dent->d_name)); + /* Skip this entry and continue. */ + free(dent); + continue; + } + + freeEntryName = TRUE; +#else /* defined(__APPLE__) */ + entryName = dent->d_name; + entryNameLen = length; +#endif /* defined(__APPLE__) */ break; case DIRECTORY_SEARCH_TYPE_BASE: - /* + /* * 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(dent->d_name, ".") == 0 || + if (strcmp(dent->d_name, ".") == 0 || strcmp(dent->d_name, "..") == 0) { LOG(4, ("HgfsServerSearchRead: assigning %s default " "attributes\n", dent->d_name)); @@ -2947,31 +3631,40 @@ length, HGFS_OPEN_MODE_READ_ONLY, &sharePathLen, - &sharePath); + (char const **)&sharePath); if (nameStatus != HGFS_NAME_STATUS_COMPLETE) { LOG(4, ("HgfsServerSearchRead: No such share or access denied\n")); free(dent); free(search.utf8Dir); + free(search.utf8ShareName); return HgfsConvertFromNameStatus(nameStatus); } - status = HgfsGetattrFromName(sharePath, &attr, NULL); + + status = HgfsGetattrFromName(sharePath, configOptions, &attr, NULL); if (status != 0) { - /* + /* * The dent no longer exists. Remove it from the search and get - * the next dent instead. + * the next dent instead. */ LOG(4, ("HgfsServerSearchRead: stat FAILED, removing\n")); - free(HgfsGetSearchResult(hgfsSearchHandle, requestedOffset, + free(HgfsGetSearchResult(hgfsSearchHandle, requestedOffset, TRUE)); free(dent); continue; } } + + /* + * No conversion needed on OS X because dent->d_name is the shareName + * that was converted to normal form C in hgfsServerPolicyHost. + */ + entryName = dent->d_name; + entryNameLen = length; break; case DIRECTORY_SEARCH_TYPE_OTHER: - /* - * The POSIX implementation of HgfsSearchOpen could not have created + /* + * The POSIX implementation of HgfsSearchOpen could not have created * this kind of search. */ NOT_IMPLEMENTED(); @@ -2982,52 +3675,23 @@ } free(search.utf8Dir); + free(search.utf8ShareName); - { - size_t entryNameLen; - char *entryName = NULL; - Bool freeEntryName = FALSE; - -#if defined(__APPLE__) - - /* - * HGFS clients receive names in unicode normal form C, - * (precomposed) so Mac hosts must convert from normal form D - * (decomposed). - */ - if (!CodeSet_Utf8FormDToUtf8FormC((const char *)dent->d_name, - length, - &entryName, - &entryNameLen)) { - LOG(4, ("HgfsServerSearchRead: Unable to normalize form C \"%s\"\n", - dent->d_name)); - /* Skip this entry and continue. */ - free(dent); - continue; - } - - freeEntryName = TRUE; -#else /* defined(__APPLE__) */ - entryName = dent->d_name; - entryNameLen = length; -#endif /* defined(__APPLE__) */ - - LOG(4, ("HgfsServerSearchRead: dent name is \"%s\" len = %"FMTSZ"u\n", - entryName, entryNameLen)); + LOG(4, ("HgfsServerSearchRead: dent name is \"%s\" len = %"FMTSZ"u\n", + entryName, entryNameLen)); - /* - * XXX: HgfsPackSearchReadReply will error out if the dent we - * give it is too large for the packet. Prior to - * HgfsPackSearchReadReply, we'd skip the dent and return the next - * one with success. Now we return an error. This may be a non-issue - * since what filesystems allow dent lengths as high as 6144 bytes? - */ - status = HgfsPackSearchReadReply(entryName, entryNameLen, &attr, - packetOut, packetSize) ? 0 : EPROTO; + /* + * XXX: HgfsPackSearchReadReply will error out if the dent we + * give it is too large for the packet. Prior to + * HgfsPackSearchReadReply, we'd skip the dent and return the next + * one with success. Now we return an error. This may be a non-issue + * since what filesystems allow dent lengths as high as 6144 bytes? + */ + status = HgfsPackSearchReadReply(entryName, entryNameLen, &attr, + packetOut, packetSize) ? 0 : EPROTO; - if (freeEntryName) { - free(entryName); - } + if (freeEntryName) { + free(entryName); } free(dent); @@ -3036,9 +3700,10 @@ /* No entry at this offset */ free(search.utf8Dir); + free(search.utf8ShareName); LOG(4, ("HgfsServerSearchRead: no entry\n")); - return HgfsPackSearchReadReply(NULL, 0, &attr, packetOut, packetSize) ? - 0 : + return HgfsPackSearchReadReply(NULL, 0, &attr, packetOut, packetSize) ? + 0 : EPROTO; } @@ -3075,6 +3740,8 @@ char *targetName = NULL; uint32 targetNameLen; HgfsHandle file = HGFS_INVALID_HANDLE; /* file handle from driver */ + uint32 caseFlags = 0; + HgfsShareOptions configOptions; ASSERT(packetSize); @@ -3084,7 +3751,8 @@ &hints, &cpName, &cpNameSize, - &file)) { + &file, + &caseFlags)) { status = EPROTO; goto exit; } @@ -3109,8 +3777,10 @@ nameStatus = HgfsServerGetAccess(cpName, cpNameSize, HGFS_OPEN_MODE_READ_ONLY, + caseFlags, &localName, NULL); + switch (nameStatus) { case HGFS_NAME_STATUS_INCOMPLETE_BASE: /* @@ -3125,7 +3795,17 @@ /* This is a regular lookup; proceed as usual */ ASSERT(localName); - status = HgfsGetattrFromName(localName, &attr, &targetName); + /* Get the config options. */ + nameStatus = HgfsServerPolicy_GetShareOptions(cpName, cpNameSize, + &configOptions); + if (nameStatus != HGFS_NAME_STATUS_COMPLETE) { + LOG(4, ("HgfsServerGetattr: no matching share: %s.\n", cpName)); + free(localName); + status = ENOENT; + goto exit; + } + + status = HgfsGetattrFromName(localName, configOptions, &attr, &targetName); free(localName); if (status != 0) { goto exit; @@ -3175,6 +3855,7 @@ size_t cpNameSize = 0; HgfsAttrHint hints = 0; HgfsHandle file = HGFS_INVALID_HANDLE; + uint32 caseFlags = 0; ASSERT(packetSize); @@ -3184,7 +3865,8 @@ &hints, &cpName, &cpNameSize, - &file)) { + &file, + &caseFlags)) { status = EPROTO; goto exit; } @@ -3192,12 +3874,15 @@ if (file != HGFS_INVALID_HANDLE) { status = HgfsSetattrFromFd(file, &attr, hints); } else { - status = HgfsSetattrFromName(cpName, - cpNameSize, - &attr, - hints); - } - if (!HgfsPackSetattrReply(packetOut, packetSize)) { + status = HgfsSetattrFromName(cpName, + cpNameSize, + &attr, + hints, + caseFlags); + } + if (!HgfsPackSetattrReply(((HgfsRequest *)packetIn)->op, + packetOut, + packetSize)) { status = EPROTO; } @@ -3245,6 +3930,7 @@ nameStatus = HgfsServerGetAccess(info.cpName, info.cpNameSize, HGFS_OPEN_MODE_WRITE_ONLY, + info.caseFlags, &localName, NULL); if (nameStatus != HGFS_NAME_STATUS_COMPLETE) { @@ -3254,9 +3940,9 @@ ASSERT(localName); - /* + /* * Create mode_t for use in mkdir(). If owner permissions are missing, use - * read/write/execute for the owner permissions. If group or other + * 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 @@ -3277,14 +3963,16 @@ LOG(4, ("HgfsServerCreateDir: making dir \"%s\", mode %"FMTMODE"\n", localName, permissions)); - error = mkdir(localName, permissions); + error = Posix_Mkdir(localName, permissions); free(localName); if (error) { error = errno; LOG(4, ("HgfsServerCreateDir: error: %s\n", strerror(error))); return error; } - return HgfsPackCreateDirReply(packetOut, packetSize) ? 0 : EPROTO; + return HgfsPackCreateDirReply(((HgfsRequest *)packetIn)->op, + packetOut, packetSize) ? + 0 : EPROTO; } @@ -3314,19 +4002,16 @@ size_t *packetSize) // IN/OUT: size of packet { HgfsNameStatus nameStatus; - HgfsRequestDelete *request; - HgfsReplyDelete *reply; char *localName; int error; HgfsHandle file = HGFS_INVALID_HANDLE; HgfsDeleteHint hints = 0; char *cpName; size_t cpNameSize; + uint32 caseFlags; - request = (HgfsRequestDelete *)packetIn; - ASSERT(request); - reply = (HgfsReplyDelete *)packetOut; - ASSERT(reply); + ASSERT(packetIn); + ASSERT(packetOut); ASSERT(packetSize); if (!HgfsUnpackDeleteRequest(packetIn, @@ -3334,7 +4019,8 @@ &cpName, &cpNameSize, &hints, - &file)) { + &file, + &caseFlags)) { return EPROTO; } @@ -3350,6 +4036,7 @@ nameStatus = HgfsServerGetAccess(cpName, cpNameSize, HGFS_OPEN_MODE_WRITE_ONLY, + caseFlags, &localName, NULL); if (nameStatus != HGFS_NAME_STATUS_COMPLETE) { @@ -3361,7 +4048,7 @@ ASSERT(localName); LOG(4, ("HgfsServerDeleteFile: unlinking \"%s\"\n", localName)); - error = unlink(localName); + error = Posix_Unlink(localName); free(localName); if (error) { error = errno; @@ -3369,7 +4056,9 @@ return error; } - return HgfsPackDeleteReply(packetOut, packetSize) ? 0 : EPROTO; + return HgfsPackDeleteReply(((HgfsRequest *)packetIn)->op, + packetOut, packetSize) ? + 0 : EPROTO; } @@ -3399,19 +4088,16 @@ size_t *packetSize) // IN/OUT: size of packet { HgfsNameStatus nameStatus; - HgfsRequestDelete *request; - HgfsReplyDelete *reply; char *localName; int error; HgfsHandle file = HGFS_INVALID_HANDLE; HgfsDeleteHint hints = 0; char *cpName; size_t cpNameSize; + uint32 caseFlags; - request = (HgfsRequestDelete *)packetIn; - ASSERT(request); - reply = (HgfsReplyDelete *)packetOut; - ASSERT(reply); + ASSERT(packetIn); + ASSERT(packetOut); ASSERT(packetSize); if (!HgfsUnpackDeleteRequest(packetIn, @@ -3419,7 +4105,8 @@ &cpName, &cpNameSize, &hints, - &file)) { + &file, + &caseFlags)) { return EPROTO; } @@ -3435,6 +4122,7 @@ nameStatus = HgfsServerGetAccess(cpName, cpNameSize, HGFS_OPEN_MODE_WRITE_ONLY, + caseFlags, &localName, NULL); if (nameStatus != HGFS_NAME_STATUS_COMPLETE) { @@ -3452,7 +4140,7 @@ ASSERT(localName); LOG(4, ("HgfsServerDeleteDir: removing \"%s\"\n", localName)); - error = rmdir(localName); + error = Posix_Rmdir(localName); free(localName); if (error) { error = errno; @@ -3460,7 +4148,9 @@ return error; } - return HgfsPackDeleteReply(packetOut, packetSize) ? 0 : EPROTO; + return HgfsPackDeleteReply(((HgfsRequest *)packetIn)->op, + packetOut, packetSize) ? + 0 : EPROTO; } @@ -3496,14 +4186,14 @@ uint32 cpOldNameLen; char *cpNewName; uint32 cpNewNameLen; - size_t localOldNameLen; - size_t localNewNameLen; HgfsHandle srcFile = HGFS_INVALID_HANDLE; HgfsHandle targetFile = HGFS_INVALID_HANDLE; HgfsRenameHint hints = 0; int error; HgfsInternalStatus status; Bool sharedFolderOpen = FALSE; + uint32 oldCaseFlags = 0; + uint32 newCaseFlags = 0; ASSERT(packetSize); @@ -3515,11 +4205,14 @@ &cpNewNameLen, &hints, &srcFile, - &targetFile)) { + &targetFile, + &oldCaseFlags, + &newCaseFlags)) { return EPROTO; } if (hints & HGFS_RENAME_HINT_USE_SRCFILE_DESC) { + size_t localOldNameLen; if (!HgfsHandle2FileName(srcFile, &localOldName, &localOldNameLen)) { LOG(4, ("HgfsServerDeleteFile: could not map cached source file handle %u\n", @@ -3540,6 +4233,7 @@ nameStatus = HgfsServerGetAccess(cpOldName, cpOldNameLen, HGFS_OPEN_MODE_READ_WRITE, + oldCaseFlags, &localOldName, NULL); if (nameStatus != HGFS_NAME_STATUS_COMPLETE) { @@ -3550,7 +4244,7 @@ ASSERT(localOldName); /* Guest OS is not allowed to rename shared folder. */ - if (HgfsServerIsSharedFolderOnly(cpOldName, + if (HgfsServerIsSharedFolderOnly(cpOldName, cpOldNameLen)){ LOG(4, ("HgfsServerRename: Cannot rename shared folder\n")); status = EPERM; @@ -3559,6 +4253,8 @@ } if (hints & HGFS_RENAME_HINT_USE_TARGETFILE_DESC) { + size_t localNewNameLen; + if (!HgfsHandle2FileName(targetFile, &localNewName, &localNewNameLen)) { LOG(4, ("HgfsServerDeleteFile: could not map cached target file handle %u\n", targetFile)); @@ -3578,6 +4274,7 @@ nameStatus = HgfsServerGetAccess(cpNewName, cpNewNameLen, HGFS_OPEN_MODE_WRITE_ONLY, + newCaseFlags, &localNewName, NULL); if (nameStatus != HGFS_NAME_STATUS_COMPLETE) { @@ -3586,27 +4283,38 @@ goto exit; } } - + ASSERT(localNewName); if (hints & HGFS_RENAME_HINT_NO_REPLACE_EXISTING) { HgfsFileAttrInfo attr; + HgfsShareOptions configOptions; + + /* Get the config options. */ + nameStatus = HgfsServerPolicy_GetShareOptions(cpNewName, cpNewNameLen, + &configOptions); + if (nameStatus != HGFS_NAME_STATUS_COMPLETE) { + LOG(4, ("HgfsServerRename: no matching share: %s.\n", cpNewName)); + status = ENOENT; + goto exit; + } /* - * We are not being asked to replace an existing - * file so fail if the target exists. + * We were asked to avoid replacing an existing file, + * so fail if the target exists. */ - status = HgfsGetattrFromName(localNewName, &attr, NULL); + status = HgfsGetattrFromName(localNewName, configOptions, &attr, NULL); if (status == 0) { /* The target exists, and so must fail the rename. */ LOG(4, ("HgfsServerRename: error: target %s exists\n", localNewName)); status = EEXIST; + goto exit; } } LOG(4, ("HgfsServerRename: renaming \"%s\" to \"%s\"\n", localOldName, localNewName)); - error = rename(localOldName, localNewName); + error = Posix_Rename(localOldName, localNewName); if (error) { error = errno; LOG(4, ("HgfsServerRename: error: %s\n", strerror(error))); @@ -3614,14 +4322,15 @@ goto exit; } - /* + /* * Update all file nodes referring to this filename to the new name. - * + * * XXX: Note that this operation can fail (out of memory), but we'd like * the client to see success anyway, because the rename succeeded. */ HgfsUpdateNodeNames(localOldName, localNewName); - status = HgfsPackRenameReply(packetOut, packetSize) ? + status = HgfsPackRenameReply(((HgfsRequest *)packetIn)->op, + packetOut, packetSize) ? 0 : EPROTO; exit: @@ -3661,8 +4370,7 @@ char *packetOut, // OUT: outgoing packet size_t *packetSize) // IN/OUT: size of packet { - HgfsRequestQueryVolume *request; - HgfsReplyQueryVolume *reply; + HgfsRequest *header; uint32 extra; char *utf8Name = NULL; size_t utf8NameLen; @@ -3676,30 +4384,79 @@ Bool firstShare = TRUE; Bool success; HgfsNameStatus nameStatus; + size_t failed = 0; + size_t shares = 0; + HgfsInternalStatus firstErr = 0; + char *fileName; + uint32 fileNameLength; + uint32 caseFlags = HGFS_FILE_NAME_DEFAULT_CASE; + uint64 *freeBytes; + uint64 *totalBytes; + + ASSERT(packetIn); + ASSERT(packetOut); + header = (HgfsRequest *)packetIn; - request = (HgfsRequestQueryVolume *)packetIn; - ASSERT(request); - reply = (HgfsReplyQueryVolume *)packetOut; - ASSERT(reply); ASSERT(packetSize); + if (header->op == HGFS_OP_QUERY_VOLUME_INFO_V3) { + HgfsRequestQueryVolumeV3 *requestV3; + HgfsReplyQueryVolumeV3 *replyV3; + + requestV3 = (HgfsRequestQueryVolumeV3 *)HGFS_REQ_GET_PAYLOAD_V3(packetIn); + replyV3 = (HgfsReplyQueryVolumeV3 *)HGFS_REP_GET_PAYLOAD_V3(packetOut); + + /* + * We don't yet support file handle for this operation. + * Clients should retry using the file name. + */ + if (requestV3->fileName.flags & HGFS_FILE_NAME_USE_FILE_DESC) { + LOG(4, ("HgfsServerQueryVolume: Doesn't support file handle.\n")); + return EPARAMETERNOTSUPPORTED; + } + + freeBytes = &replyV3->freeBytes; + totalBytes = &replyV3->totalBytes; + replyV3->reserved = 0; + + /* Enforced by the dispatch function. */ + ASSERT(*packetSize >= HGFS_REQ_PAYLOAD_SIZE_V3(requestV3)); + extra = *packetSize - HGFS_REQ_PAYLOAD_SIZE_V3(requestV3); + + caseFlags = requestV3->fileName.caseType; + fileName = requestV3->fileName.name; + fileNameLength = requestV3->fileName.length; + *packetSize = HGFS_REP_PAYLOAD_SIZE_V3(replyV3); + LOG(4, ("HgfsServerQueryVolume: HGFS_OP_QUERY_VOLUME_INFO_V3\n")); + } else { + HgfsRequestQueryVolume *request = (HgfsRequestQueryVolume *)packetIn; + HgfsReplyQueryVolume *reply = (HgfsReplyQueryVolume *)packetOut; - /* Enforced by the dispatch function. */ - ASSERT(*packetSize >= sizeof *request); - extra = *packetSize - sizeof *request; + freeBytes = &reply->freeBytes; + totalBytes = &reply->totalBytes; + + /* Enforced by the dispatch function. */ + ASSERT(*packetSize >= sizeof *request); + extra = *packetSize - sizeof *request; + + fileName = request->fileName.name; + fileNameLength = request->fileName.length; + *packetSize = sizeof *reply; + } /* * request->fileName.length is user-provided, so this test must be carefully * written to prevent wraparounds. */ - if (request->fileName.length > extra) { + if (fileNameLength > extra) { /* The input packet is smaller than the request. */ return EPROTO; } /* It is now safe to read the file name field. */ - nameStatus = HgfsServerGetAccess(request->fileName.name, - request->fileName.length, + nameStatus = HgfsServerGetAccess(fileName, + fileNameLength, HGFS_OPEN_MODE_READ_WRITE, + caseFlags, &utf8Name, &utf8NameLen); switch (nameStatus) { @@ -3719,14 +4476,14 @@ return status; } - /* + /* * 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; #ifndef VMX86_TOOLS { - char *volumeInfoType = Config_GetString("min", + char *volumeInfoType = Config_GetString("min", "tools.hgfs.volumeInfoType"); if (!Str_Strcasecmp(volumeInfoType, "max")) { infoType = VOLUME_INFO_TYPE_MAX; @@ -3734,7 +4491,7 @@ free(volumeInfoType); } #endif - + /* * Now go through all shares and get share paths on the server. * Then retrieve space info for each share's volume. @@ -3746,22 +4503,34 @@ uint64 freeBytes = 0; uint64 totalBytes = 0; unsigned int length; - + 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 + * 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, ("HgfsServerQueryVolume: Skipping fake share %s\n", + LOG(4, ("HgfsServerQueryVolume: Skipping fake share %s\n", dent->d_name)); free(dent); continue; } - - /* Check permission on the share and get the share path. */ + + /* + * 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, @@ -3771,18 +4540,24 @@ if (nameStatus != HGFS_NAME_STATUS_COMPLETE) { LOG(4, ("HgfsServerQueryVolume: No such share or access " "denied\n")); - HgfsRemoveSearch(handle); - return HgfsConvertFromNameStatus(nameStatus); + if (0 == firstErr) { + firstErr = HgfsConvertFromNameStatus(nameStatus); + } + failed++; + continue; } - + if (!HgfsServerStatFs(sharePath, sharePathLen, &freeBytes, &totalBytes)) { LOG(4, ("HgfsServerQueryVolume: error getting volume " "information\n")); - HgfsRemoveSearch(handle); - return EIO; + if (0 == firstErr) { + firstErr = EIO; + } + failed++; + continue; } - + /* * Pick the drive with amount of space available and return that * according to different volume info type. @@ -3808,6 +4583,13 @@ if (!HgfsRemoveSearch(handle)) { LOG(4, ("HgfsServerQueryVolume: could not close search on base\n")); } + if (shares == failed) { + /* + * We failed to query any of the shares. We return the error from the + * first share failure. + */ + return firstErr; + } break; case HGFS_NAME_STATUS_COMPLETE: ASSERT(utf8Name); @@ -3825,10 +4607,8 @@ return HgfsConvertFromNameStatus(nameStatus); } - reply->freeBytes = outFreeBytes; - reply->totalBytes = outTotalBytes; - - *packetSize = sizeof *reply; + *freeBytes = outFreeBytes; + *totalBytes = outTotalBytes; return 0; } @@ -3855,41 +4635,87 @@ char *packetOut, // OUT: outgoing packet size_t *packetSize) // IN/OUT: size of packet { - HgfsRequestSymlinkCreate *request; - HgfsReplySymlinkCreate *reply; + HgfsRequest *header; uint32 extra; char *localSymlinkName; - HgfsFileName *targetName; char localTargetName[HGFS_PACKET_MAX]; int error; HgfsNameStatus nameStatus; + uint32 caseFlags = HGFS_FILE_NAME_DEFAULT_CASE; + char *symlinkName; + uint32 symlinkNameLength; + char *targetName; + uint32 targetNameLength; + HgfsShareOptions configOptions; - request = (HgfsRequestSymlinkCreate *)packetIn; - ASSERT(request); - reply = (HgfsReplySymlinkCreate *)packetOut; - ASSERT(reply); + ASSERT(packetIn); + ASSERT(packetOut); ASSERT(packetSize); + header = (HgfsRequest *)packetIn; - /* Enforced by the dispatch function */ - ASSERT(*packetSize >= sizeof *request); - extra = *packetSize - sizeof *request; + if (header->op == HGFS_OP_CREATE_SYMLINK_V3) { + HgfsRequestSymlinkCreateV3 *requestV3; + HgfsReplySymlinkCreateV3 *replyV3; + HgfsFileNameV3 *targetNameP; + requestV3 = (HgfsRequestSymlinkCreateV3 *)HGFS_REQ_GET_PAYLOAD_V3(packetIn); + LOG(4, ("HgfsServerSymlinkCreate: HGFS_OP_CREATE_SYMLINK_V3\n")); + + /* Enforced by the dispatch function. */ + ASSERT(*packetSize >= HGFS_REQ_PAYLOAD_SIZE_V3(requestV3)); + extra = *packetSize - HGFS_REQ_PAYLOAD_SIZE_V3(requestV3); + + caseFlags = requestV3->symlinkName.caseType; + symlinkName = requestV3->symlinkName.name; + symlinkNameLength = requestV3->symlinkName.length; - /* - * Get the symlink and target filenames from the request. - * - * Getting the new filename is somewhat inconvenient, because we - * don't know where request->targetName actually starts, thanks to the - * fact that request->symlinkName is of variable length. We get around - * this by using an HgfsFileName*, assigning it to the correct address - * just after request->symlinkName ends, and using that to access the - * new name. - */ + /* + * targetName starts after symlinkName + the variable length array + * in symlinkName. + */ + targetNameP = (HgfsFileNameV3 *)(symlinkName + 1 + symlinkNameLength); + targetName = targetNameP->name; + targetNameLength = targetNameP->length; + + /* + * We don't yet support file handle for this operation. + * Clients should retry using the file name. + */ + if (requestV3->symlinkName.flags & HGFS_FILE_NAME_USE_FILE_DESC || + targetNameP->flags & HGFS_FILE_NAME_USE_FILE_DESC) { + LOG(4, ("HgfsServerSymlinkCreate: Doesn't support file handle.\n")); + return EPARAMETERNOTSUPPORTED; + } + + replyV3 = (HgfsReplySymlinkCreateV3 *)HGFS_REP_GET_PAYLOAD_V3(packetOut); + replyV3->reserved = 0; + *packetSize = HGFS_REP_PAYLOAD_SIZE_V3(replyV3); + } else { + HgfsRequestSymlinkCreate *request; + HgfsFileName *targetNameP; + request = (HgfsRequestSymlinkCreate *)packetIn; + + /* Enforced by the dispatch function. */ + ASSERT(*packetSize >= sizeof *request); + extra = *packetSize - sizeof *request; + + symlinkName = request->symlinkName.name; + symlinkNameLength = request->symlinkName.length; + + /* + * targetName starts after symlinkName + the variable length array + * in symlinkName. + */ + targetNameP = (HgfsFileName *)(symlinkName + 1 + symlinkNameLength); + targetName = targetNameP->name; + targetNameLength = targetNameP->length; + *packetSize = sizeof(struct HgfsReplySymlinkCreate); + } /* * request->symlinkName.length is user-provided, so this test must * be carefully written to prevent wraparounds. */ - if (request->symlinkName.length > extra) { + if (symlinkNameLength > extra) { /* The input packet is smaller than the request */ return EPROTO; } @@ -3898,9 +4724,10 @@ * "targetName" field */ - nameStatus = HgfsServerGetAccess(request->symlinkName.name, - request->symlinkName.length, + nameStatus = HgfsServerGetAccess(symlinkName, + symlinkNameLength, HGFS_OPEN_MODE_READ_WRITE, + caseFlags, &localSymlinkName, NULL); if (nameStatus != HGFS_NAME_STATUS_COMPLETE) { @@ -3909,16 +4736,13 @@ } ASSERT(localSymlinkName); - - extra -= request->symlinkName.length; - targetName = (HgfsFileName *)( (char *)(&request->symlinkName + 1) - + request->symlinkName.length); + extra -= symlinkNameLength; /* - * targetName->length is user-provided, so this test must be carefully + * targetNameLength is user-provided, so this test must be carefully * written to prevent wraparounds. */ - if (targetName->length > extra) { + if (targetNameLength > extra) { /* The input packet is smaller than the request */ free(localSymlinkName); return EPROTO; @@ -3926,15 +4750,29 @@ /* It is now safe to read the target file name */ + /* Get the config options. */ + nameStatus = HgfsServerPolicy_GetShareOptions(symlinkName, symlinkNameLength, + &configOptions); + if (nameStatus != HGFS_NAME_STATUS_COMPLETE) { + LOG(4, ("HgfsServerSymlinkCreate: no matching share: %s.\n", symlinkName)); + return HgfsConvertFromNameStatus(nameStatus); + } + /* Convert from CPName-lite to normal and NUL-terminate. */ - memcpy(localTargetName, targetName->name, targetName->length); - CPNameLite_ConvertFrom(localTargetName, targetName->length, DIRSEPC); - localTargetName[targetName->length] = '\0'; + memcpy(localTargetName, targetName, targetNameLength); + CPNameLite_ConvertFrom(localTargetName, targetNameLength, DIRSEPC); + localTargetName[targetNameLength] = '\0'; + + /* Prohibit symlink ceation if symlink following is enabled. */ + if (HgfsServerPolicy_IsShareOptionSet(configOptions, HGFS_SHARE_FOLLOW_SYMLINKS)) { + return EPERM; + } LOG(4, ("HgfsServerSymlinkCreate: creating \"%s\" linked to \"%s\"\n", localSymlinkName, localTargetName)); - error = symlink(localTargetName, localSymlinkName); + /* XXX: Should make use of targetNameP->flags? */ + error = Posix_Symlink(localTargetName, localSymlinkName); free(localSymlinkName); if (error) { error = errno; @@ -3942,7 +4780,6 @@ return error; } - *packetSize = sizeof *reply; return 0; } @@ -3952,20 +4789,37 @@ * * HgfsServerHasSymlink -- * - * This function looks at each directory component from left to - * right, searching for symlinks after the host share path. If any - * component after the share path is found to be a symlink, it returns - * TRUE. Otherwise, it returns FALSE. Note that if the file does not - * exist, we also return FALSE. - * - * Sadly, much of this function was copied from File_IsSymlink - * because that function won't differentiate between a file that isn't - * a symlink and a file that doesn't exist. Since we're checking - * every component, we'd definitely like to know when a file doesn't - * exist so we may short-circuit out. + * 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: - * TRUE if the given path has a symlink, FALSE otherwise. + * 0 if the given path has a symlink, non-zero errno otherwise. * * Side effects: * None. @@ -3973,68 +4827,81 @@ *---------------------------------------------------------------------- */ -Bool +HgfsInternalStatus HgfsServerHasSymlink(const char *fileName, // IN - const char *sharePath) // IN + size_t fileNameLength, // IN + const char *sharePath, // IN + size_t sharePathLength) // IN { - char *path; - char *fullSharePath = NULL; - char *pathSep; - size_t shareLen = 1; - size_t pathLen; - Bool found = FALSE; + char *resolvedFileDirPath = NULL; + char *fileDirName = NULL; + HgfsInternalStatus status; - /* Resolve full path for the share to compare with fileName. */ + ASSERT(fileName); ASSERT(sharePath); - fullSharePath = File_FullPath(sharePath); - if (!fullSharePath) { - LOG(4, ("HgfsServerHasSymlink: File_FullPath failed on sharePath %s\n", sharePath)); - return FALSE; - } - shareLen = strlen(fullSharePath); - - path = File_FullPath(fileName); - if (!path) { - goto out; - } - pathLen = strlen(path); - - LOG(4, ("%s: fileName: %s, sharePath: %s, path: %s, fullSharePath: %s\n", - __FUNCTION__, fileName, sharePath, path, fullSharePath)); + ASSERT(sharePathLength <= fileNameLength); - ASSERT(Str_Strncmp(path, fullSharePath, shareLen < pathLen ? shareLen : pathLen) == 0); - /* If fileName is prefix of sharePath, ignore symlinks. */ - if (shareLen > pathLen) { - goto out; + 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) { + status = 0; + goto exit; } - /* Start with the first component after the share. */ - pathSep = path + shareLen; - - while ((pathSep = Str_Strchr(pathSep, DIRSEPC)) != NULL) { - *pathSep = '\0'; - - if (File_IsSymLink(path)) { - found = TRUE; - goto out; + /* 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) { + status = errno; + LOG(4, ("%s: failed to realloc fileDirName.\n", __FUNCTION__)); + goto exit; + } else { + fileDirName = p; + Str_Strcpy(fileDirName, DIRSEPS, sizeof(DIRSEPS)); } - - *pathSep++ = DIRSEPC; } - /* - * We've checked up until every path separator. Now check the last - * component. + /* + * Resolve parent directory of fileName. + * Use realpath(2) to resolve the parent. */ - if (pathLen > shareLen && File_IsSymLink(path)) { - found = TRUE; + resolvedFileDirPath = Posix_RealPath(fileDirName); + if (resolvedFileDirPath == NULL) { + status = errno; + LOG(4, ("%s: realpath failed: fileDirName: %s: %s\n", + __FUNCTION__, fileDirName, strerror(errno))); + goto exit; } - out: - if (fullSharePath) { - free(fullSharePath); + + /* Resolved parent should match with the shareName. */ + if (Str_Strncmp(sharePath, resolvedFileDirPath, sharePathLength) != 0) { + status = EACCES; + LOG(4, ("%s: resolved parent do not match, parent: %s, resolved: %s#\n", + __FUNCTION__, fileDirName, resolvedFileDirPath)); + goto exit; } - free(path); - return found; + + status = 0; + +exit: + free(resolvedFileDirPath); + free(fileDirName); + return status; } @@ -4098,12 +4965,12 @@ fileDesc = lockData->fileDesc; LOG(4, ("HgfsAckOplockBreak: Acknowledging break on fd %d\n", 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 && + if (lockData->serverLock == HGFS_LOCK_SHARED && replyLock == HGFS_LOCK_SHARED) { newLock = F_RDLCK; actualLock = replyLock; @@ -4125,4 +4992,3 @@ } #endif - diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/hgfsServer/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/hgfsServer/Makefile.am --- open-vm-tools-2008.01.23-74039/lib/hgfsServer/Makefile.am 2008-01-28 08:02:49.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/hgfsServer/Makefile.am 2008-10-13 08:01:48.000000000 +0100 @@ -21,6 +21,4 @@ libHgfsServer_a_SOURCES += hgfsServer.c libHgfsServer_a_SOURCES += hgfsServerLinux.c -AM_CFLAGS = -AM_CFLAGS += @COMMON_CFLAGS@ -AM_CFLAGS += @LIB_HGFS_SERVER_CFLAGS@ +AM_CFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/hgfsServer/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/hgfsServer/Makefile.in --- open-vm-tools-2008.01.23-74039/lib/hgfsServer/Makefile.in 2008-01-28 08:03:04.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/hgfsServer/Makefile.in 2008-10-13 08:02:13.000000000 +0100 @@ -52,7 +52,10 @@ subdir = lib/hgfsServer DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +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)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -65,7 +68,7 @@ hgfsServerLinux.$(OBJEXT) libHgfsServer_a_OBJECTS = $(am_libHgfsServer_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp +depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -91,8 +94,6 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -COMMON_CFLAGS = @COMMON_CFLAGS@ -COMMON_PROG_CFLAGS = @COMMON_PROG_CFLAGS@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -103,45 +104,57 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ -ECHO = @ECHO@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GREP = @GREP@ -GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_AUTH_CFLAGS = @LIB_AUTH_CFLAGS@ -LIB_FILE_CFLAGS = @LIB_FILE_CFLAGS@ -LIB_HGFS_SERVER_CFLAGS = @LIB_HGFS_SERVER_CFLAGS@ -LIB_IMPERSONATE_CFLAGS = @LIB_IMPERSONATE_CFLAGS@ -LIB_MISC_CFLAGS = @LIB_MISC_CFLAGS@ -LIB_PROC_MGR_CFLAGS = @LIB_PROC_MGR_CFLAGS@ -LIB_STRING_CFLAGS = @LIB_STRING_CFLAGS@ -LIB_USER_CFLAGS = @LIB_USER_CFLAGS@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -149,27 +162,35 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ VERSION = @VERSION@ -VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -200,6 +221,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -216,7 +238,7 @@ top_srcdir = @top_srcdir@ noinst_LIBRARIES = libHgfsServer.a libHgfsServer_a_SOURCES = hgfsServer.c hgfsServerLinux.c -AM_CFLAGS = @COMMON_CFLAGS@ @LIB_HGFS_SERVER_CFLAGS@ +AM_CFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ all: all-am .SUFFIXES: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/hgfsServerManagerGuest/hgfsServerManagerGuest.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/hgfsServerManagerGuest/hgfsServerManagerGuest.c --- open-vm-tools-2008.01.23-74039/lib/hgfsServerManagerGuest/hgfsServerManagerGuest.c 2008-01-28 08:02:50.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/hgfsServerManagerGuest/hgfsServerManagerGuest.c 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -66,7 +66,7 @@ void *clientData) // Unused { size_t packetSize; - static char packet[HGFS_PACKET_MAX]; + static char packet[HGFS_LARGE_PACKET_MAX]; ASSERT(clientData == NULL); diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/hgfsServerManagerGuest/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/hgfsServerManagerGuest/Makefile.am --- open-vm-tools-2008.01.23-74039/lib/hgfsServerManagerGuest/Makefile.am 2008-01-28 08:02:49.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/hgfsServerManagerGuest/Makefile.am 2008-10-13 08:01:47.000000000 +0100 @@ -19,6 +19,3 @@ libHgfsServerManagerGuest_a_SOURCES = libHgfsServerManagerGuest_a_SOURCES += hgfsServerManagerGuest.c - -AM_CFLAGS = -AM_CFLAGS += @COMMON_CFLAGS@ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/hgfsServerManagerGuest/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/hgfsServerManagerGuest/Makefile.in --- open-vm-tools-2008.01.23-74039/lib/hgfsServerManagerGuest/Makefile.in 2008-01-28 08:03:04.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/hgfsServerManagerGuest/Makefile.in 2008-10-13 08:02:13.000000000 +0100 @@ -52,7 +52,10 @@ subdir = lib/hgfsServerManagerGuest DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +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)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -66,7 +69,7 @@ libHgfsServerManagerGuest_a_OBJECTS = \ $(am_libHgfsServerManagerGuest_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp +depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -92,8 +95,6 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -COMMON_CFLAGS = @COMMON_CFLAGS@ -COMMON_PROG_CFLAGS = @COMMON_PROG_CFLAGS@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -104,45 +105,57 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ -ECHO = @ECHO@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GREP = @GREP@ -GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_AUTH_CFLAGS = @LIB_AUTH_CFLAGS@ -LIB_FILE_CFLAGS = @LIB_FILE_CFLAGS@ -LIB_HGFS_SERVER_CFLAGS = @LIB_HGFS_SERVER_CFLAGS@ -LIB_IMPERSONATE_CFLAGS = @LIB_IMPERSONATE_CFLAGS@ -LIB_MISC_CFLAGS = @LIB_MISC_CFLAGS@ -LIB_PROC_MGR_CFLAGS = @LIB_PROC_MGR_CFLAGS@ -LIB_STRING_CFLAGS = @LIB_STRING_CFLAGS@ -LIB_USER_CFLAGS = @LIB_USER_CFLAGS@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -150,27 +163,35 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ VERSION = @VERSION@ -VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -201,6 +222,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -217,7 +239,6 @@ top_srcdir = @top_srcdir@ noinst_LIBRARIES = libHgfsServerManagerGuest.a libHgfsServerManagerGuest_a_SOURCES = hgfsServerManagerGuest.c -AM_CFLAGS = @COMMON_CFLAGS@ all: all-am .SUFFIXES: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/hgfsServerPolicyGuest/hgfsServerPolicyGuest.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/hgfsServerPolicyGuest/hgfsServerPolicyGuest.c --- open-vm-tools-2008.01.23-74039/lib/hgfsServerPolicyGuest/hgfsServerPolicyGuest.c 2008-01-28 08:02:50.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/hgfsServerPolicyGuest/hgfsServerPolicyGuest.c 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -129,8 +129,8 @@ { HgfsSharedFolder *rootShare; - /* - * We do not recognize this callback, so make sure our caller doesn't pass + /* + * We do not recognize this callback, so make sure our caller doesn't pass * it in. */ ASSERT(!invalidateObjects); @@ -220,8 +220,8 @@ ASSERT(state); ASSERT(nameIn); - /* - * First try to find a share that matches the given name exactly. + /* + * 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. */ @@ -236,18 +236,18 @@ } } - /* + /* * 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. + * 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. + * Null terminate the input name before a case insensitive comparison. * This is just to protect against bad implementations of strnicmp. */ @@ -273,7 +273,7 @@ free(tempName); } - + return NULL; } @@ -413,7 +413,7 @@ * Results: * An HgfsNameStatus value indicating the result is returned. * - * The local path for the shareName is also returned if a match is found and + * The local path for the shareName is also returned if a match is found and * access is permitted. * * Side effects: @@ -429,14 +429,14 @@ size_t *sharePathLen, // OUT: Length of share path char const **sharePath) // OUT: Share path { - HgfsSharedFolder *share; + HgfsSharedFolder *myShare; ASSERT(nameIn); ASSERT(sharePathLen); ASSERT(sharePath); - share = HgfsServerPolicyGetShare(&myState, nameIn, nameInLen); - if (!share) { + myShare = HgfsServerPolicyGetShare(&myState, nameIn, nameInLen); + if (!myShare) { LOG(4, ("HgfsServerPolicy_GetSharePath: No matching share name\n")); return HGFS_NAME_STATUS_DOES_NOT_EXIST; } @@ -449,21 +449,21 @@ */ switch (HGFS_OPEN_MODE_ACCMODE(mode)) { case HGFS_OPEN_MODE_READ_ONLY: - if (!share->readAccess) { + 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 (!share->writeAccess) { + 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 (!share->readAccess || !share->writeAccess) { + if (!myShare->readAccess || !myShare->writeAccess) { LOG(4, ("HgfsServerPolicy_GetSharePath: Read/write access denied\n")); return HGFS_NAME_STATUS_ACCESS_DENIED; } @@ -475,8 +475,56 @@ break; } - *sharePathLen = share->pathLen; - *sharePath = share->path; + *sharePathLen = myShare->pathLen; + *sharePath = myShare->path; + 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_GetComponentGeneric(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; } @@ -484,14 +532,39 @@ /* *----------------------------------------------------------------------------- * + * 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 + * name, finding the matching share (if any), and returning * the share's access mode. * * Results: - * An HgfsNameStatus value indicating the result is returned. + * An HgfsNameStatus value indicating the result is returned. * * The access mode for the shareName is also returned if a match is found. * diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/hgfsServerPolicyGuest/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/hgfsServerPolicyGuest/Makefile.am --- open-vm-tools-2008.01.23-74039/lib/hgfsServerPolicyGuest/Makefile.am 2008-01-28 08:02:49.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/hgfsServerPolicyGuest/Makefile.am 2008-10-13 08:01:47.000000000 +0100 @@ -19,6 +19,3 @@ libHgfsServerPolicyGuest_a_SOURCES = libHgfsServerPolicyGuest_a_SOURCES += hgfsServerPolicyGuest.c - -AM_CFLAGS = -AM_CFLAGS += @COMMON_CFLAGS@ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/hgfsServerPolicyGuest/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/hgfsServerPolicyGuest/Makefile.in --- open-vm-tools-2008.01.23-74039/lib/hgfsServerPolicyGuest/Makefile.in 2008-01-28 08:03:04.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/hgfsServerPolicyGuest/Makefile.in 2008-10-13 08:02:14.000000000 +0100 @@ -52,7 +52,10 @@ subdir = lib/hgfsServerPolicyGuest DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +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)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -66,7 +69,7 @@ libHgfsServerPolicyGuest_a_OBJECTS = \ $(am_libHgfsServerPolicyGuest_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp +depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -92,8 +95,6 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -COMMON_CFLAGS = @COMMON_CFLAGS@ -COMMON_PROG_CFLAGS = @COMMON_PROG_CFLAGS@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -104,45 +105,57 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ -ECHO = @ECHO@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GREP = @GREP@ -GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_AUTH_CFLAGS = @LIB_AUTH_CFLAGS@ -LIB_FILE_CFLAGS = @LIB_FILE_CFLAGS@ -LIB_HGFS_SERVER_CFLAGS = @LIB_HGFS_SERVER_CFLAGS@ -LIB_IMPERSONATE_CFLAGS = @LIB_IMPERSONATE_CFLAGS@ -LIB_MISC_CFLAGS = @LIB_MISC_CFLAGS@ -LIB_PROC_MGR_CFLAGS = @LIB_PROC_MGR_CFLAGS@ -LIB_STRING_CFLAGS = @LIB_STRING_CFLAGS@ -LIB_USER_CFLAGS = @LIB_USER_CFLAGS@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -150,27 +163,35 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ VERSION = @VERSION@ -VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -201,6 +222,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -217,7 +239,6 @@ top_srcdir = @top_srcdir@ noinst_LIBRARIES = libHgfsServerPolicyGuest.a libHgfsServerPolicyGuest_a_SOURCES = hgfsServerPolicyGuest.c -AM_CFLAGS = @COMMON_CFLAGS@ all: all-am .SUFFIXES: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/image/imageUtilPng.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/image/imageUtilPng.c --- open-vm-tools-2008.01.23-74039/lib/image/imageUtilPng.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/image/imageUtilPng.c 2008-10-13 08:01:52.000000000 +0100 @@ -0,0 +1,534 @@ +/********************************************************* + * Copyright (C) 2002 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. + * + *********************************************************/ + +/* + * imageUtilPng.c -- + * + * This file contains platform independent code to read and write PNG files + * using libpng. + */ + +#include "vmware.h" +#include "imageUtil.h" +#include "rasterConv.h" +#include "util.h" + +#include +#include + +#define PNG_HEADER_CHECK_BUF_SIZE 8 + +typedef struct ImageUtilReadPng { + unsigned char *data; + unsigned int offset; +} ImageUtilReadPng; + +/* + *----------------------------------------------------------------------------- + * + * ImageUtilReadPngCallback -- + * + * Callback function for reading from a PNG file. + * + * Results: + * None. + * + * Side effects: + * Fills buffer `data' by reading from the file. Note that png_error() + * calls longjmp() so that an error will unwind the stack. + * + *----------------------------------------------------------------------------- + */ + +void +ImageUtilReadPngCallback(png_structp png_ptr, // IN: PNG file info structure + png_bytep data, // OUT: input buffer + png_size_t length) // IN: byte count +{ + ImageUtilReadPng *pngData = png_get_io_ptr(png_ptr); + memcpy(data, pngData->data + pngData->offset, length); + pngData->offset += (unsigned int)length; +} + + +/* + *---------------------------------------------------------------------------- + * + * ImageUtil_ReadPNGBuffer -- + * + * Loads and reads the specified PNG file and returns its attributes and + * data in the provided out parameters. + * + * Results: + * TRUE if successful, FALSE otherwise. + * + * Side effects: + * Reads a PNG image from memory. + * + *---------------------------------------------------------------------------- + */ + +Bool +ImageUtil_ReadPNGBuffer(ImageInfo *image, // OUT + const unsigned char *data, // IN + size_t dataLen, // IN + int pngReadFlags) // IN +{ + png_structp png_ptr; + png_infop info_ptr; + int i, channel_depth, color_type, interlace_type, compression_type, filter_type; + png_colorp palette; + int num_palette = 0; + int bytes_per_line; + png_bytep *row_pointers = NULL; + Bool ret = FALSE; + ImageUtilReadPng *pngData = NULL; + png_uint_32 width; + png_uint_32 height; + + if (!image || !data || !dataLen) { + return FALSE; + } + + memset(image, 0, sizeof *image); + + pngData = Util_SafeCalloc(1, sizeof *pngData); + pngData->data = (char *) data; + pngData->offset = 0; + + /* + * Do an initial check to make sure this is a PNG file. This check also + * eliminate the case of 0-byte file due to the previous write error + */ + if (dataLen < PNG_HEADER_CHECK_BUF_SIZE) { + goto exit; + } + + if (png_sig_cmp(pngData->data, 0, PNG_HEADER_CHECK_BUF_SIZE)) { + goto exit; + } + + png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); + + if (png_ptr == NULL) { + goto exit; + } + + /* Allocate/initialize the memory for image information. */ + info_ptr = png_create_info_struct(png_ptr); + if (info_ptr == NULL) { + png_destroy_read_struct(&png_ptr, NULL, NULL); + goto exit; + } + + if (setjmp(png_ptr->jmpbuf)) { + png_destroy_read_struct(&png_ptr, &info_ptr, NULL); + goto exit; + } + + png_set_read_fn(png_ptr, pngData, ImageUtilReadPngCallback); + + png_read_info(png_ptr, info_ptr); + + png_get_IHDR(png_ptr, info_ptr, + &width, &height, + &channel_depth, &color_type, + &interlace_type, &compression_type, &filter_type); + + bytes_per_line = png_get_rowbytes(png_ptr, info_ptr); + + if (color_type == PNG_COLOR_TYPE_RGB_ALPHA) { + image->depth = 24; + if (pngReadFlags & IMAGE_PNG_READ_KEEP_ALPHA) { + image->bpp = 32; + } else { + png_set_strip_alpha(png_ptr); + + /* Update the bytes_per_line now that we've eliminated the alpha channel */ + png_read_update_info(png_ptr, info_ptr); + bytes_per_line = png_get_rowbytes(png_ptr, info_ptr); + + png_get_IHDR(png_ptr, info_ptr, + &width, &height, + &channel_depth, &color_type, &interlace_type, + &compression_type, &filter_type); + + image->bpp = 24; + } + + } else if (color_type == PNG_COLOR_TYPE_RGB) { + image->depth = image->bpp = 24; + } else if (color_type == PNG_COLOR_TYPE_PALETTE) { + /* + * Load palette + */ + if (channel_depth < 8) { + png_set_packing(png_ptr); + png_read_update_info(png_ptr, info_ptr); + bytes_per_line = png_get_rowbytes(png_ptr, info_ptr); + } + + image->depth = image->bpp = 8; + + png_get_PLTE(png_ptr, info_ptr, &palette, &num_palette); + ASSERT(num_palette <= 256); + + for (i = 0; i < num_palette; i++) { + image->palette[i].red = palette[i].red; + image->palette[i].green = palette[i].green; + image->palette[i].blue = palette[i].blue; + image->palette[i].reserved = 0; + } + + image->numColors = num_palette; + } else { + png_destroy_read_struct(&png_ptr, &info_ptr, NULL); + goto exit; + } + + ASSERT(image->depth != 0); + ASSERT(image->bpp != 0); + + image->width = width; + image->height = height; + image->bytesPerLine = DWORD_ALIGN(bytes_per_line); + image->flags = 0; + + /* BGR instead of RGB - Intel byte-order is backwards */ + png_set_bgr(png_ptr); + + /* Allocate the memory to hold the image using the fields of info_ptr. */ + image->data = Util_SafeMalloc(image->bytesPerLine * image->height); + row_pointers = Util_SafeMalloc(sizeof *row_pointers * image->height); + + /* The easiest way to read the image: */ + for (i = 0; i < image->height; i++) { + row_pointers[i] = image->data + i * (DWORD_ALIGN(bytes_per_line)); + } + + png_read_image(png_ptr, row_pointers); + png_read_end(png_ptr, info_ptr); + +#ifdef VMX86_DEVEL + /* Read text fields (XXX eventually read rectangle data here) */ + { + png_text *text_ptr = NULL; + int num_text = 0; + + if (png_get_text(png_ptr, info_ptr, &text_ptr, &num_text) > 0) { + for(i = 0; i < num_text; i++) { + fprintf(stderr, "Png text: (%s) %s\n", text_ptr[i].key, + text_ptr[i].text); + } + } + } +#endif + + png_destroy_read_struct(&png_ptr, &info_ptr, NULL); + ret = TRUE; + + exit: + free(row_pointers); + free(pngData); + return ret; +} + + +/* + *---------------------------------------------------------------------------- + * + * ImageUtilDataWriteCallback + * + * Callback for the png library to write data into the DynBuf. + * + * Results: + * None. + * + * Side effects: + * Writes data to DynBuf. + * + *---------------------------------------------------------------------------- + */ + +void +ImageUtilDataWriteCallback(png_structp png_ptr, // IN + png_bytep data, // IN + png_size_t length) // IN +{ + DynBuf *imageData = png_get_io_ptr(png_ptr); + if (!DynBuf_Append(imageData, data, length)) { + png_error(png_ptr, "Unable to append data"); + } +} + + +/* + *---------------------------------------------------------------------------- + * + * ImageUtil_ConstructPNGBuffer -- + * + * Writes a PNG of the image to the DynBuf passed in. + * + * Results: + * TRUE if successful, FALSE otherwise. + * + * Side effects: + * If successful, imageData should be destroyed. + * + *---------------------------------------------------------------------------- + */ + +Bool +ImageUtil_ConstructPNGBuffer(const ImageInfo *image, // IN + DynBuf *imageData) // OUT + +{ + ImagePngWriteOptions options; + + options.zlibCompressLevel = -1; + options.stripAlphaChannel = TRUE; + + return ImageUtil_ConstructPNGBufferEx(image, &options, imageData); +} + + +/* + *---------------------------------------------------------------------------- + * + * ImageUtil_ConstructPNGBufferEx -- + * + * Writes a PNG of the image to the DynBuf passed in. Accepts a zlib + * compression level (0-9, 0 means no compression, -1 means "use the + * default"). + * + * Results: + * TRUE if successful, FALSE otherwise. + * + * Side effects: + * Allocates memory; If successful, imageData needs to be cleaned up later. + * + *---------------------------------------------------------------------------- + */ + +Bool +ImageUtil_ConstructPNGBufferEx(const ImageInfo *image, // IN + const ImagePngWriteOptions *options, // IN + DynBuf *imageData) // OUT +{ + png_structp png_ptr; + png_infop info_ptr; + int color_type, i; + png_bytep data; + + //png_text text_ptr[1]; +#ifdef RGB_MASK + png_color_8 sig_bit; +#endif + + png_uint_32 k; + + int bytes_per_line; + png_bytep *row_pointers; + + ASSERT(image); + ASSERT(imageData); + ASSERT(options); + + if (!image || !options || !imageData) { + return FALSE; + } + + row_pointers = malloc(sizeof *row_pointers * image->height); + if (!row_pointers) { + return FALSE; + } + + DynBuf_Init(imageData); + + png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); + + if (png_ptr == NULL) { + goto error; + } + + /* Allocate/initialize the image information data. REQUIRED */ + info_ptr = png_create_info_struct(png_ptr); + if (info_ptr == NULL) { + png_destroy_write_struct(&png_ptr, NULL); + goto error; + } + + if (setjmp(png_ptr->jmpbuf)) { + png_destroy_write_struct(&png_ptr, &info_ptr); + goto error; + } + + png_set_write_fn(png_ptr, imageData, ImageUtilDataWriteCallback, NULL); + + if (image->bpp <= 8) { + /* + * Save palette + */ + color_type = PNG_COLOR_TYPE_PALETTE; + } else if (image->bpp == 32) { + /* + * Save with alpha channel + */ + color_type = PNG_COLOR_TYPE_RGB_ALPHA; + } else { + /* + * Everything else is RGB + */ + color_type = PNG_COLOR_TYPE_RGB; + } + + png_set_IHDR(png_ptr, info_ptr, image->width, image->height, 8, color_type, + PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE); + + if (options->zlibCompressLevel >= 0 && options->zlibCompressLevel <= 9) { + png_set_compression_level(png_ptr, options->zlibCompressLevel); + } + +#ifdef RGB_MASK + /* Setup the color depths */ + sig_bit.red = COUNT_BITS(image->redMask); + sig_bit.green = COUNT_BITS(image->greenMask); + sig_bit.blue = COUNT_BITS(image->blueMask); + png_set_sBIT(png_ptr, info_ptr, &sig_bit); + +#if 1 //We probably DO need this + /* Shift the pixels up to a legal bit depth and fill in + * as appropriate to correctly scale the image. + */ + png_set_shift(png_ptr, &sig_bit); +#endif +#endif + + // BGR instead of RGB - Intel byte-order is backwards + png_set_bgr(png_ptr); + + /* + * Optionally write comments into the image, e.g. + * text_ptr[0].key = "Title"; + * text_ptr[0].text = "Mona Lisa"; + * text_ptr[0].compression = PNG_TEXT_COMPRESSION_NONE; + * png_set_text(png_ptr, info_ptr, text_ptr, 1); + */ + + + /* + * Now set up the transformations you want. Note that these are + * all optional. Only call them if you want them. + */ + bytes_per_line = image->bytesPerLine; + +#if 0 + /* pack pixels into bytes */ + png_set_packing(png_ptr); +#endif + + data = image->data; + + if (image->bpp == 24) { + /* + * The image is already RGB, no need for any conversion/processing + */ + } else if (image->bpp <= 8) { + /* + * Save palette + */ + png_color palette[256]; + ASSERT(image->numColors <= 256); + + for (i = 0; i < image->numColors; i++) { + palette[i].red = image->palette[i].red; + palette[i].green = image->palette[i].green; + palette[i].blue = image->palette[i].blue; + } + + png_set_PLTE(png_ptr, info_ptr, palette, image->numColors); + } else if (image->bpp == 32) { + if (options->stripAlphaChannel) { + + /* + * Strip the alpha channel + */ + + png_set_strip_alpha(png_ptr); + + /* + * XXX: Following call appears to leak two allocations of 1 byte + * each deep inside the png library via png_malloc. + */ + png_read_update_info(png_ptr, info_ptr); + } + } else { + /* XXX convert to 24 - we could try and support other modes? */ + bytes_per_line = DWORD_ALIGN(png_get_rowbytes(png_ptr, info_ptr)); + + data = Util_SafeMalloc(bytes_per_line * image->height); + + Raster_ConvertPixels(data, bytes_per_line, 24, + image->data, image->bytesPerLine, + Raster_GetBPPDepth(image->depth, image->bpp), + FALSE, NULL, 0, 0, 0, 0, + image->width, image->height); + } + + /* Write the file header information. REQUIRED */ + png_write_info(png_ptr, info_ptr); + + if ((image->bpp == 32) && options->stripAlphaChannel) { + /* treat the alpha channel byte as filler */ + png_set_filler(png_ptr, 0, PNG_FILLER_AFTER); + } + + for (k = 0; k < image->height; k++) { + int rowIndex; + + if (image->flags & IMAGE_FLAG_BOTTOM_UP) { + rowIndex = image->height - 1 - k; + } else { + rowIndex = k; + } + + row_pointers[rowIndex] = data + k * bytes_per_line; + } + + png_write_image(png_ptr, row_pointers); + + if (data != image->data) { + free(data); + } + + /* It is REQUIRED to call this to finish writing the rest of the file */ + png_write_end(png_ptr, info_ptr); + + /* if you allocated any text comments, free them here */ + + png_destroy_write_struct(&png_ptr, &info_ptr); + + free(row_pointers); + + return TRUE; + error: + free(row_pointers); + DynBuf_Destroy(imageData); + return FALSE; +} + diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/image/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/image/Makefile.am --- open-vm-tools-2008.01.23-74039/lib/image/Makefile.am 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/image/Makefile.am 2008-10-13 08:01:48.000000000 +0100 @@ -0,0 +1,25 @@ +################################################################################ +### Copyright 2008 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_LIBRARIES = libImage.a + +libImage_a_SOURCES = +libImage_a_SOURCES += imageUtilPng.c + +AM_CFLAGS = +AM_CFLAGS += @LIBPNG_CPPFLAGS@ +AM_CFLAGS += @ZLIB_CPPFLAGS@ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/image/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/image/Makefile.in --- open-vm-tools-2008.01.23-74039/lib/image/Makefile.in 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/image/Makefile.in 2008-10-13 08:02:14.000000000 +0100 @@ -0,0 +1,495 @@ +# 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 2008 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/image +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)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) +ARFLAGS = cru +libImage_a_AR = $(AR) $(ARFLAGS) +libImage_a_LIBADD = +am_libImage_a_OBJECTS = imageUtilPng.$(OBJEXT) +libImage_a_OBJECTS = $(am_libImage_a_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 = $(libImage_a_SOURCES) +DIST_SOURCES = $(libImage_a_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_XLIBS = @COMMON_XLIBS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ +DNET_LIBS = @DNET_LIBS@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ +GTK_LIBS = @GTK_LIBS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ +HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ +MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ +RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ +VERSION = @VERSION@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +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@ +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@ +lt_ECHO = @lt_ECHO@ +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_LIBRARIES = libImage.a +libImage_a_SOURCES = imageUtilPng.c +AM_CFLAGS = @LIBPNG_CPPFLAGS@ @ZLIB_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/image/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu lib/image/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-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) +libImage.a: $(libImage_a_OBJECTS) $(libImage_a_DEPENDENCIES) + -rm -f libImage.a + $(libImage_a_AR) libImage.a $(libImage_a_OBJECTS) $(libImage_a_LIBADD) + $(RANLIB) libImage.a + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/imageUtilPng.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 $(LIBRARIES) +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-noinstLIBRARIES \ + 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-noinstLIBRARIES 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: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/impersonate/impersonate.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/impersonate/impersonate.c --- open-vm-tools-2008.01.23-74039/lib/impersonate/impersonate.c 2008-01-28 08:02:51.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/impersonate/impersonate.c 2008-10-13 08:01:52.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -25,8 +25,9 @@ */ #include -#include "auth.h" +#include "vmware.h" +#include "auth.h" #include "impersonateInt.h" Bool impersonationEnabled = FALSE; diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/impersonate/impersonateInt.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/impersonate/impersonateInt.h --- open-vm-tools-2008.01.23-74039/lib/impersonate/impersonateInt.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/impersonate/impersonateInt.h 2008-10-13 08:01:52.000000000 +0100 @@ -0,0 +1,60 @@ +/********************************************************* + * Copyright (C) 2003 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 diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/impersonate/impersonatePosix.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/impersonate/impersonatePosix.c --- open-vm-tools-2008.01.23-74039/lib/impersonate/impersonatePosix.c 2008-01-28 08:02:51.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/impersonate/impersonatePosix.c 2008-10-13 08:01:52.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -38,6 +38,7 @@ #include "impersonateInt.h" #include "su.h" +#include "posix.h" #if !defined(VMX86_TOOLS) static pthread_mutex_t mut = PTHREAD_MUTEX_INITIALIZER; @@ -216,17 +217,17 @@ struct passwd *ppw = &pw; int error; - if (stat(file, &buf) == -1) { + if (Posix_Stat(file, &buf) == -1) { Warning("Failed to lookup owner for: %s. Reason: %s\n", file, strerror(errno)); return FALSE; } - if ((error = getpwuid_r(buf.st_uid, &pw, buffer, BUFSIZ, &ppw)) != 0 || !ppw) { + 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: %d. Reason: %s\n", buf.st_uid, + Warning("Failed to lookup user with uid: %" FMTUID ". Reason: %s\n", buf.st_uid, strerror(error)); return FALSE; } @@ -268,7 +269,7 @@ ASSERT(imp); //ASSERT(imp->impersonatedUser); - if ((error = getpwuid_r(0, &pw, buffer, BUFSIZ, &ppw)) != 0 || !ppw) { + if ((error = Posix_Getpwuid_r(0, &pw, buffer, BUFSIZ, &ppw)) != 0 || !ppw) { if (error == 0) { error = ENOENT; } @@ -303,9 +304,9 @@ } /* Restore root's environment */ - setenv("USER", ppw->pw_name, 1); - setenv("HOME", ppw->pw_dir, 1); - setenv("SHELL", ppw->pw_shell, 1); + 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; @@ -385,9 +386,9 @@ #endif /* Setup the user's environment */ - setenv("USER", pwd->pw_name, 1); - setenv("HOME", pwd->pw_dir, 1); - setenv("SHELL", pwd->pw_shell, 1); + 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); ASSERT_MEM_ALLOC(imp->impersonatedUser); @@ -431,7 +432,7 @@ struct passwd *ppw = &pw; int error; - if ((error = getpwnam_r(user, &pw, buffer, BUFSIZ, &ppw)) != 0 || !ppw) { + if ((error = Posix_Getpwnam_r(user, &pw, buffer, BUFSIZ, &ppw)) != 0 || !ppw) { if (error == 0) { error = ENOENT; } diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/impersonate/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/impersonate/Makefile.am --- open-vm-tools-2008.01.23-74039/lib/impersonate/Makefile.am 2008-01-28 08:02:49.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/impersonate/Makefile.am 2008-10-13 08:01:48.000000000 +0100 @@ -21,6 +21,4 @@ libImpersonate_a_SOURCES += impersonate.c libImpersonate_a_SOURCES += impersonatePosix.c -AM_CFLAGS = -AM_CFLAGS += @COMMON_CFLAGS@ -AM_CFLAGS += @LIB_IMPERSONATE_CFLAGS@ +AM_CFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/impersonate/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/impersonate/Makefile.in --- open-vm-tools-2008.01.23-74039/lib/impersonate/Makefile.in 2008-01-28 08:03:04.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/impersonate/Makefile.in 2008-10-13 08:02:14.000000000 +0100 @@ -52,7 +52,10 @@ subdir = lib/impersonate DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +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)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -65,7 +68,7 @@ impersonatePosix.$(OBJEXT) libImpersonate_a_OBJECTS = $(am_libImpersonate_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp +depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -91,8 +94,6 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -COMMON_CFLAGS = @COMMON_CFLAGS@ -COMMON_PROG_CFLAGS = @COMMON_PROG_CFLAGS@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -103,45 +104,57 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ -ECHO = @ECHO@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GREP = @GREP@ -GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_AUTH_CFLAGS = @LIB_AUTH_CFLAGS@ -LIB_FILE_CFLAGS = @LIB_FILE_CFLAGS@ -LIB_HGFS_SERVER_CFLAGS = @LIB_HGFS_SERVER_CFLAGS@ -LIB_IMPERSONATE_CFLAGS = @LIB_IMPERSONATE_CFLAGS@ -LIB_MISC_CFLAGS = @LIB_MISC_CFLAGS@ -LIB_PROC_MGR_CFLAGS = @LIB_PROC_MGR_CFLAGS@ -LIB_STRING_CFLAGS = @LIB_STRING_CFLAGS@ -LIB_USER_CFLAGS = @LIB_USER_CFLAGS@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -149,27 +162,35 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ VERSION = @VERSION@ -VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -200,6 +221,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -216,7 +238,7 @@ top_srcdir = @top_srcdir@ noinst_LIBRARIES = libImpersonate.a libImpersonate_a_SOURCES = impersonate.c impersonatePosix.c -AM_CFLAGS = @COMMON_CFLAGS@ @LIB_IMPERSONATE_CFLAGS@ +AM_CFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ all: all-am .SUFFIXES: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/appUtil.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/appUtil.h --- open-vm-tools-2008.01.23-74039/lib/include/appUtil.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/appUtil.h 2008-10-13 08:01:49.000000000 +0100 @@ -0,0 +1,93 @@ +/********************************************************* + * Copyright (C) 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. + * + *********************************************************/ + +/* + * appUtil.h -- + * + * Utility functions for guest applications. + */ + +#ifndef _APP_UTIL_H_ +#define _APP_UTIL_H_ + +#include "vmware.h" +#include "guestCaps.h" + + +#ifdef _WIN32 + +typedef struct _AppUtilIconEntry { + uint32 width; + uint32 height; + uint32 widthBytes; + uint32 dataLength; + unsigned char *dataBGRA; +} AppUtilIconEntry; + +typedef struct _AppUtilIconInfo { + uint32 numEntries; + AppUtilIconEntry *iconList; +} AppUtilIconInfo; + +typedef enum { + APPUTIL_UPPER_LEFT_DIB = -1, // the origin is the upper-left corner of the bitmap + APPUTIL_LOWER_LEFT_DIB = 1, // the origin is the lower-left corner of the bitmap +} AppUtilBitmapOrigin; + +Bool AppUtil_GetIconDataByHandle(HICON hIcon, + AppUtilBitmapOrigin origin, + AppUtilIconEntry *icon); + +Bool AppUtil_GetDIBitsAlloc(HDC hdc, + HBITMAP hbmp, + UINT uStartScan, + UINT cScanLines, + LPBITMAPINFO lpbi, + UINT uUsage, + char **bits); + +HICON AppUtil_GetWindowIcon(HWND hwnd, + uint32 iconSize); + +void AppUtil_BuildGlobalApplicationList(void); +char *AppUtil_ActionURIForCommandLine(const WCHAR *commandLineUtf16); + +#endif //_WIN32 + +#if defined(linux) +#include + +void AppUtil_Init(void); +GPtrArray *AppUtil_CollectIconArray(const char *iconName, + unsigned long windowID); +void AppUtil_FreeIconArray(GPtrArray *pixbufs); + +Bool AppUtil_AppIsSkippable(const char *appName); +char *AppUtil_CanonicalizeAppName(const char *appName, + const char *cwd); +#endif + +/* + * Platform-independent functions. + */ +void AppUtil_SendGuestCaps(const GuestCapabilities *caps, + size_t numCaps, + Bool enabled); + +#endif // _APP_UTIL_H_ + diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/auth.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/auth.h --- open-vm-tools-2008.01.23-74039/lib/include/auth.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/auth.h 2008-10-13 08:01:49.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -26,6 +26,7 @@ */ #include "vm_basic_types.h" +#include "unicodeTypes.h" #if _WIN32 # include @@ -60,7 +61,7 @@ #endif -AuthToken Auth_AuthenticateUser(const char *user, const char *pass); +AuthToken Auth_AuthenticateUser(ConstUnicode user, ConstUnicode pass); void Auth_CloseToken(AuthToken token); diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/backdoor_def.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/backdoor_def.h --- open-vm-tools-2008.01.23-74039/lib/include/backdoor_def.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/backdoor_def.h 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -79,7 +79,7 @@ #define BDOOR_CMD_GETUUID 19 #define BDOOR_CMD_GETMEMSIZE 20 #define BDOOR_CMD_HOSTCOPY 21 /* Devel only */ -/* BDOOR_CMD_GETOS2INTCURSOR, 22, is very old and defunct. Reuse. */ +#define BDOOR_CMD_SERVICE_VM 22 /* prototype only */ #define BDOOR_CMD_GETTIME 23 /* Deprecated. Use GETTIMEFULL. */ #define BDOOR_CMD_STOPCATCHUP 24 #define BDOOR_CMD_PUTCHR 25 /* Devel only */ @@ -109,7 +109,12 @@ #define BDOOR_CMD_CHECKFORCEBIOSSETUP 48 #define BDOOR_CMD_LAZYTIMEREMULATION 49 #define BDOOR_CMD_BIOSBBS 50 -#define BDOOR_CMD_MAX 51 +#define BDOOR_CMD_VASSERT 51 +#define BDOOR_CMD_ISGOSDARWIN 52 +#define BDOOR_CMD_DEBUGEVENT 53 +#define BDOOR_CMD_OSNOTMACOSXSERVER 54 +#define BDOOR_CMD_GETTIMEFULL_WITH_LAG 55 +#define BDOOR_CMD_MAX 56 /* * IMPORTANT NOTE: When modifying the behavior of an existing backdoor command, @@ -123,7 +128,8 @@ #define BDOORHB_PORT 0x5659 #define BDOORHB_CMD_MESSAGE 0 -#define BDOORHB_CMD_MAX 1 +#define BDOORHB_CMD_VASSERT 1 +#define BDOORHB_CMD_MAX 2 /* * There is another backdoor which allows access to certain TSC-related diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/backdoor.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/backdoor.h --- open-vm-tools-2008.01.23-74039/lib/include/backdoor.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/backdoor.h 2008-10-13 08:01:49.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/backdoorInt.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/backdoorInt.h --- open-vm-tools-2008.01.23-74039/lib/include/backdoorInt.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/backdoorInt.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,26 +0,0 @@ -/********************************************************* - * Copyright (C) 2005 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 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. - * - *********************************************************/ - -/* - * backdoorInt.h -- - * - * Internal function prototypes for the real backdoor work. - */ - -void BackdoorHbIn(Backdoor_proto_hb *bp); -void BackdoorHbOut(Backdoor_proto_hb *bp); diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/backdoor_types.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/backdoor_types.h --- open-vm-tools-2008.01.23-74039/lib/include/backdoor_types.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/backdoor_types.h 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/base64.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/base64.h --- open-vm-tools-2008.01.23-74039/lib/include/base64.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/base64.h 2008-10-13 08:01:49.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/bsdfmt.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/bsdfmt.h --- open-vm-tools-2008.01.23-74039/lib/include/bsdfmt.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/bsdfmt.h 2008-10-13 08:01:49.000000000 +0100 @@ -0,0 +1,217 @@ +/* ********************************************************** + * Copyright 2008 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. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * 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 *); + + +/* + * Pretend to have wcsrtombs() and wcrtomb(). + * Don't use typedef for mbstate_t because it's actually defined + * in VS2003/VC7/include/wchar.h, but the functions don't exist. + * I don't know why, nor do I care. -- edward + */ + +#ifdef _WIN32 +#define mbstate_t int +#define wcsrtombs(dest, srcp, n, state) wcstombs(dest, *(srcp), n) +#define wcrtomb(dest, wc, state) wctomb(dest, wc) +#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_ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/bsd_output.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/bsd_output.h --- open-vm-tools-2008.01.23-74039/lib/include/bsd_output.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/bsd_output.h 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/bsd_output_int.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/bsd_output_int.h --- open-vm-tools-2008.01.23-74039/lib/include/bsd_output_int.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/bsd_output_int.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,159 +0,0 @@ -/* ********************************************************** - * 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. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * 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" - -#ifdef _WIN32 // { - -#pragma warning(disable : 4018 4047 4101 4102 4146 4244 4267) - -#define INTMAX_MAX 9223372036854775807i64 - -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; - -#endif // } - -#define MAXEXPDIG 6 - -/* For u_int and u_long, and other types we might want. */ -#ifndef _WIN32 -#include -#include -#include -#endif - -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 -}; - -/* - * I/O descriptors for __sfvwrite(). - */ -struct __siov { - void *iov_base; - size_t iov_len; -}; -struct __suio { - struct __siov *uio_iov; - int uio_iovcnt; - int uio_resid; -}; - -#ifndef NO_FLOATING_POINT - -#include -#include - -#define DEFPREC 6 - -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 /* !NO_FLOATING_POINT */ - -#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_ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/buildNumber.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/buildNumber.h --- open-vm-tools-2008.01.23-74039/lib/include/buildNumber.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/buildNumber.h 2008-10-13 08:01:50.000000000 +0100 @@ -1,12 +1,12 @@ #define BUILD_NUMBER \ - "build-74039" + "build-123053" #define BUILD_NUMBER_NUMERIC \ - 74039 + 123053 #define BUILD_NUMBER_NUMERIC_STRING \ - "74039" + "123053" #define PRODUCT_BUILD_NUMBER \ - "product-build-80" + "product-build-345" #define PRODUCT_BUILD_NUMBER_NUMERIC \ - 80 + 345 #define PRODUCT_BUILD_NUMBER_NUMERIC_STRING \ - "80" + "345" diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/circList.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/circList.h --- open-vm-tools-2008.01.23-74039/lib/include/circList.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/circList.h 2008-10-13 08:01:49.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/codeset.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/codeset.h --- open-vm-tools-2008.01.23-74039/lib/include/codeset.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/codeset.h 2008-10-13 08:01:49.000000000 +0100 @@ -1,98 +1,564 @@ -/********************************************************* - * Copyright (C) 1998 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 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. - * - *********************************************************/ +/* ********************************************************** + * Copyright 2007 VMware, Inc. All rights reserved. + * **********************************************************/ /* * codeset.h -- * - * Character set and encoding conversion functions --hpreg + * 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 + * Netware: don't know (either no iconv, or really UTF-8) + */ + +#if defined(__FreeBSD__) || \ + defined(VMX86_SERVER) || \ + defined(__APPLE__) || \ + defined(N_PLAT_NLM) +#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_Utf8ToCurrent(char const *bufIn, // IN - size_t sizeIn, // IN - char **bufOut, // OUT - size_t *sizeOut); // OUT +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_Utf8ToCurrentTranslit(char const *bufIn, // IN - size_t sizeIn, // IN - char **bufOut, // OUT - size_t *sizeOut); // OUT +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_CurrentToUtf8(char const *bufIn, // IN - size_t sizeIn, // IN - char **bufOut, // OUT - size_t *sizeOut); // OUT +CodeSet_Utf8ToCurrent(const char *bufIn, // IN + size_t sizeIn, // IN + char **bufOut, // OUT + size_t *sizeOut); // OUT Bool -CodeSet_Utf16leToUtf8_Db(char const *bufIn, // IN - size_t sizeIn, // IN - DynBuf *db); // IN +CodeSet_CurrentToUtf8(const char *bufIn, // IN + size_t sizeIn, // IN + char **bufOut, // OUT + size_t *sizeOut); // OUT Bool -CodeSet_Utf16leToUtf8(char const *bufIn, // IN - size_t sizeIn, // IN - char **bufOut, // OUT - size_t *sizeOut); // OUT +CodeSet_Utf16leToUtf8Db(const char *bufIn, // IN + size_t sizeIn, // IN + DynBuf *db); // IN Bool -CodeSet_Utf8ToUtf16le(char const *bufIn, // IN - size_t sizeIn, // IN - char **bufOut, // OUT - size_t *sizeOut); // OUT +CodeSet_Utf16leToUtf8(const char *bufIn, // IN + size_t sizeIn, // IN + char **bufOut, // OUT + size_t *sizeOut); // OUT Bool -CodeSet_CurrentToUtf16le(char const *bufIn, // IN - size_t sizeIn, // IN - char **bufOut, // OUT - size_t *sizeOut); // OUT +CodeSet_Utf8ToUtf16le(const char *bufIn, // IN + size_t sizeIn, // IN + char **bufOut, // OUT + size_t *sizeOut); // OUT Bool -CodeSet_Utf16leToCurrent(char const *bufIn, // IN - size_t sizeIn, // IN - char **bufOut, // OUT - size_t *sizeOut); // OUT +CodeSet_CurrentToUtf16le(const char *bufIn, // IN + size_t sizeIn, // IN + char **bufOut, // OUT + size_t *sizeOut); // OUT Bool -CodeSet_Utf16beToCurrent(char const *bufIn, // IN - size_t sizeIn, // IN - char **bufOut, // OUT - size_t *sizeOut); // OUT +CodeSet_Utf16leToCurrent(const char *bufIn, // IN + size_t sizeIn, // IN + char **bufOut, // OUT + size_t *sizeOut); // OUT Bool -CodeSet_Utf8FormDToUtf8FormC(char const *bufIn, // IN +CodeSet_Utf16beToCurrent(const char *bufIn, // IN + size_t sizeIn, // IN + char **bufOut, // OUT + size_t *sizeOut); // OUT + +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 Bool -CodeSet_Utf8FormCToUtf8FormD(char const *bufIn, // IN +CodeSet_Utf8FormCToUtf8FormD(const char *bufIn, // IN size_t sizeIn, // IN char **bufOut, // OUT size_t *sizeOut); // OUT +const char * +CodeSet_GetCurrentCodeSet(void); + +Bool +CodeSet_IsEncodingSupported(const char *name); + +Bool +CodeSet_Validate(const char *buf, // IN: the string + size_t size, // IN: length of string + const char *code); // IN: encoding + + +/* + *----------------------------------------------------------------------------- + * + * 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)) { + ASSERT_MEM_ALLOC(FALSE); + } + + 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)) { + ASSERT_NOT_IMPLEMENTED(0); + } + + 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__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/compat/compat_stdarg.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/compat/compat_stdarg.h --- open-vm-tools-2008.01.23-74039/lib/include/compat/compat_stdarg.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/compat/compat_stdarg.h 2008-10-13 08:01:49.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/conf.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/conf.h --- open-vm-tools-2008.01.23-74039/lib/include/conf.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/conf.h 2008-10-13 08:01:49.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -69,25 +69,29 @@ #define CONFNAME_LOGFILE "log.file" #define CONFNAME_LOGLEVEL "log.level" #define CONFNAME_DISABLEQUERYDISKINFO "disable-query-diskinfo" +#define CONFNAME_DISABLETOOLSVERSION "disable-tools-version" + /* - * Without dnd = "true" in tools.conf, Linux DnD won't work. This will only be used - * to develop Linux DnD. Once the implementation is done, get rid of this (and the - * code that checks it in toolbox-gtk.c and let dnd be enabled by default. + * Tell the tools to show the wireless icon in the guest. */ -#define CONFNAME_HACKY_DND "dnd" + +#define CONFNAME_SHOW_WIRELESS_ICON "wirelessIcon.enable" /* - * Minimum guest resolution size. Fix for bug 58681. + * Directory containing Help files accessed via the Toolbox's "Help" + * button. For now, intended only for toolbox-gtk. */ -#define CONFNAME_RESOLUTION_MIN_WIDTH "resolution.min.width" -#define CONFNAME_RESOLUTION_MIN_HEIGHT "resolution.min.height" -#define CONFVAL_RESOLUTION_MIN_WIDTH_DEFAULT "640" -#define CONFVAL_RESOLUTION_MIN_HEIGHT_DEFAULT "480" +#if !defined(_WIN32) && !defined(N_PLAT_NLM) +# define CONFNAME_HELPDIR "helpdir" +#endif /* - * This is the bin direcotry the user chose while installing the tools + * Directory containing the tools library files. Currently only intended + * for vmware-user. */ -#define CONFNAME_BINDIR "bindir" +#if !defined(_WIN32) && !defined(N_PLAT_NLM) +# define CONFNAME_LIBDIR "libdir" +#endif /* Default maximum size of wiper file in MB */ #define CONFVAL_MAX_WIPERSIZE_DEFAULT "512" diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/config.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/config.h --- open-vm-tools-2008.01.23-74039/lib/include/config.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/config.h 2008-10-13 08:01:49.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -81,6 +81,7 @@ EXTERN double Config_GetDouble(double defaultValue, const char *fmt, ...) PRINTF_DECL(2, 3); EXTERN Bool Config_NotSet(const char *fmt, ...) PRINTF_DECL(1, 2); +EXTERN void Config_UnsetWithPrefix(const char *fmt, ...) PRINTF_DECL(1, 2); EXTERN void Config_Set(void *value, int type, const char *fmt, ...) PRINTF_DECL(3, 4); diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/cpName.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/cpName.h --- open-vm-tools-2008.01.23-74039/lib/include/cpName.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/cpName.h 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/cpNameInt.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/cpNameInt.h --- open-vm-tools-2008.01.23-74039/lib/include/cpNameInt.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/cpNameInt.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,54 +0,0 @@ -/********************************************************* - * Copyright (C) 1998 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 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. - * - *********************************************************/ - -/* - * cpNameInt.h -- - * - * Cross-platform name format used by hgfs. - * - */ - - -#ifndef __CP_NAME_INT_H__ -#define __CP_NAME_INT_H__ - - -#include "vm_basic_types.h" - -/* - * Used by CPName_ConvertFrom - */ -int -CPNameConvertFrom(char const **bufIn, // IN/OUT: Input to convert - size_t *inSize, // IN/OUT: Size of input - size_t *outSize, // IN/OUT: Size of output buffer - char **bufOut, // IN/OUT: Output buffer - char pathSep); // IN: Path separator character - - -/* - * Common code for CPName_ConvertTo - */ -int -CPNameConvertTo(char const *nameIn, // IN: Buf to convert - size_t bufOutSize, // IN: Size of the output buffer - char *bufOut, // OUT: Output buffer - char pathSep, // IN: path separator to use - char *ignores); // IN: chars to not transfer to output - -#endif /* __CP_NAME_INT_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/cpNameLite.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/cpNameLite.h --- open-vm-tools-2008.01.23-74039/lib/include/cpNameLite.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/cpNameLite.h 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/cpNameUtil.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/cpNameUtil.h --- open-vm-tools-2008.01.23-74039/lib/include/cpNameUtil.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/cpNameUtil.h 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/cpuid_info.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/cpuid_info.h --- open-vm-tools-2008.01.23-74039/lib/include/cpuid_info.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/cpuid_info.h 2008-10-13 08:01:50.000000000 +0100 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998 VMware, Inc. All rights reserved. + * Copyright (C) 1998-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 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -26,9 +26,8 @@ #define INCLUDE_ALLOW_VMKERNEL #include "includeCheck.h" -#include "x86cpuid.h" #include "vm_basic_asm.h" - +#include "x86cpuid.h" typedef struct CPUID0 { @@ -60,11 +59,72 @@ typedef struct CPUIDSummary { CPUID0 id0; CPUID1 id1; + CPUIDRegs ida; CPUID80 id80; CPUID81 id81; CPUIDRegs id88, id8a; } CPUIDSummary; + +/* + *---------------------------------------------------------------------- + * + * CPUIDSummary_RegsFromCpuid0 -- + * + * Fills in the given CPUIDRegs struct with the values from the CPUID0 struct. + * + * Results: + * Returns the CPUIDRegs pointer passed in. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ +static INLINE CPUIDRegs* +CPUIDSummary_RegsFromCpuid0(CPUID0* id0In, + CPUIDRegs* id0Out) +{ + id0Out->eax = id0In->numEntries; + id0Out->ebx = *(uint32 *) (id0In->name + 0); + id0Out->edx = *(uint32 *) (id0In->name + 4); + id0Out->ecx = *(uint32 *) (id0In->name + 8); + return id0Out; +} + + +/* + *---------------------------------------------------------------------- + * + * CPUIDSummary_SafeToUseMC0_CTL -- + * + * Determines whether it is safe to write to the MCE control + * register MC0_CTL. + * Known safe: P4, Nahalem, All AMD. + * Known not safe: P6, Core, Core2, Penryn + * Don't know: P2, P3 + * + * Results: + * True iff it is known to be safe. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ +static INLINE Bool +CPUIDSummary_SafeToUseMC0_CTL(CPUIDSummary* cpuidSummary) +{ + CPUIDRegs id0; + + CPUIDSummary_RegsFromCpuid0(&cpuidSummary->id0, &id0); + return CPUID_IsVendorAMD(&id0) || + (CPUID_IsVendorIntel(&id0) && + (CPUID_FAMILY_IS_PENTIUM4(id0.eax) || + CPUID_UARCH_IS_NEHALEM(cpuidSummary->id1.version))); +} + + /* The following two functions return the number of cores per package and set *numThreadsPerCore to the number of hardware threads per core. */ static INLINE uint32 diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/cryptoError.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/cryptoError.h --- open-vm-tools-2008.01.23-74039/lib/include/cryptoError.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/cryptoError.h 2008-10-13 08:01:49.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/dbllnklst.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/dbllnklst.h --- open-vm-tools-2008.01.23-74039/lib/include/dbllnklst.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/dbllnklst.h 2008-10-13 08:01:49.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -58,7 +58,7 @@ void DblLnkLst_Link(DblLnkLst_Links *l1, DblLnkLst_Links *l2); void DblLnkLst_Unlink(DblLnkLst_Links *l1, DblLnkLst_Links *l2); void DblLnkLst_Unlink1(DblLnkLst_Links *l); -Bool DblLnkLst_IsLinked(DblLnkLst_Links *l); +Bool DblLnkLst_IsLinked(DblLnkLst_Links const *l); /* Functions specific to anchored lists. --hpreg */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/debug.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/debug.h --- open-vm-tools-2008.01.23-74039/lib/include/debug.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/debug.h 2008-10-13 08:01:49.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/deployPkg.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/deployPkg.h --- open-vm-tools-2008.01.23-74039/lib/include/deployPkg.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/deployPkg.h 2008-10-13 08:01:49.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/deployPkgLog.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/deployPkgLog.h --- open-vm-tools-2008.01.23-74039/lib/include/deployPkgLog.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/deployPkgLog.h 2008-10-13 08:01:49.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/dictll.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/dictll.h --- open-vm-tools-2008.01.23-74039/lib/include/dictll.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/dictll.h 2008-10-13 08:01:49.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -48,9 +48,13 @@ char **value); // OUT Bool -DictLL_MarshalLine(DynBuf *output, // IN +DictLL_MarshalLine(DynBuf *output, // IN/OUT char const *name, // IN char const *value); // IN +Bool +DictLL_ReadUTF8BOM(FILE *file); // IN/OUT + + #endif /* __DICTLL_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/dndGuest.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/dndGuest.h --- open-vm-tools-2008.01.23-74039/lib/include/dndGuest.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/dndGuest.h 2008-10-13 08:01:49.000000000 +0100 @@ -0,0 +1,52 @@ +/********************************************************* + * Copyright (C) 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 _DND_GUEST_H_ +#define _DND_GUEST_H_ + +#if defined(_WIN32) + +typedef struct { + HWND detWnd; + void (*setMode) (Bool); +} UnityDnD; + +/* + * Callers who desire the gtk implementation must include at least one gtk + * header before this one. + */ +#elif defined(GTK_CHECK_VERSION) + +#include + +typedef struct { + GtkWidget *detWnd; + void (*setMode) (Bool); +} UnityDnD; + + +#else + +/* Probably compiling a stub. */ +typedef struct UnityDnD UnityDnD; + +#endif + +#endif // _DND_GUEST_H_ + diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/dnd.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/dnd.h --- open-vm-tools-2008.01.23-74039/lib/include/dnd.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/dnd.h 2008-10-13 08:01:49.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -35,6 +35,8 @@ #include "includeCheck.h" #include "vm_basic_types.h" +#include "unicodeTypes.h" +#include "dynarray.h" /* Error value returned when data contains illegal characters */ #define DND_ILLEGAL_CHARACTERS "data contains illegal characters" @@ -45,6 +47,14 @@ */ #define DND_MAX_PATH 6144 +#define DNDMSG_HEADERSIZE_V3 ((3 * sizeof (uint32)) + (1 * sizeof (uint8))) +/* Hard limits we never want to exceed */ +/* The maximum size of a serializied DnDMsg. Close to 4M. */ +#define DNDMSG_MAX_ARGSZ ((1 << 22) - DNDMSG_HEADERSIZE_V3) +/* The maximum number of arguments we can hold */ +#define DNDMSG_MAX_ARGS 64 + +/* Linux only defines. Should be in separate dndLinux.h */ /* Strings used for formatting various types of data */ #define DND_URI_LIST_PRE "file://" #define DND_URI_LIST_PRE_KDE "file:" @@ -56,12 +66,34 @@ #define FCP_GNOME_LIST_PRE "file://" #define FCP_GNOME_LIST_POST "\n" +/* FCP target used in gnome. */ +#define FCP_TARGET_NAME_GNOME_COPIED_FILES "x-special/gnome-copied-files" +#define FCP_TARGET_INFO_GNOME_COPIED_FILES 0 +/* FCP target used in KDE. */ +#define FCP_TARGET_NAME_URI_LIST "text/uri-list" +#define FCP_TARGET_INFO_URI_LIST 1 +/* Number of FCP targets. */ +#define NR_FCP_TARGETS 2 + +#define FCP_COPY_DELAY 1000000 // 1 second +#define TARGET_NAME_TIMESTAMP "TIMESTAMP" + +#define DRAG_TARGET_NAME_URI_LIST "text/uri-list" +#define DRAG_LEAVE_TIMEOUT 500 + +/* Guest detection window width and height. */ +#define DRAG_DET_WINDOW_WIDTH 15 + typedef enum { CPFORMAT_UNKNOWN = 0, - CPFORMAT_TEXT, + CPFORMAT_TEXT, /* NUL terminated UTF-8. */ CPFORMAT_FILELIST, + CPFORMAT_RTF, + CPFORMAT_FILELIST_URI, + CPFORMAT_MAX, } DND_CPFORMAT; + enum DND_DROPEFFECT { DROP_UNKNOWN = 1<<31, @@ -71,24 +103,81 @@ DROP_LINK = 1<<2, }; +/* Clipboard item. */ +typedef struct CPClipItem { + void *buf; + uint32 size; + Bool exists; +} CPClipItem; + +/* + * Cross platform clipboard. The native UI will convert host clipboard content + * into cross platform clipboards. + */ +typedef struct { + Bool changed; + CPClipItem items[CPFORMAT_MAX - 1]; +} CPClipboard; + +/* Definitions for transport layer big buffer support (>= V3). */ +typedef enum +{ + DND_TRANSPORT_PACKET_TYPE_UNKNOWN = 0, + DND_TRANSPORT_PACKET_TYPE_SINGLE, + DND_TRANSPORT_PACKET_TYPE_REQUEST, + DND_TRANSPORT_PACKET_TYPE_PAYLOAD, +} DND_TRANSPORT_PACKET_TYPE; + +typedef +#include "vmware_pack_begin.h" +struct DnDTransportPacketHeader { + uint32 type; + uint32 seqNum; + uint32 totalSize; + uint32 payloadSize; + uint32 offset; + uint8 payload[1]; +} +#include "vmware_pack_end.h" +DnDTransportPacketHeader; + +typedef struct DnDTransportBuffer { + size_t seqNum; + uint8 *buffer; + size_t totalSize; + size_t offset; + VmTimeType lastUpdateTime; +} DnDTransportBuffer; + +#define DND_TRANSPORT_PACKET_HEADER_SIZE (5 * sizeof(uint32)) +/* Close to 64k (maximum guestRpc message size). Leave some space for guestRpc header. */ +#define DND_MAX_TRANSPORT_PACKET_SIZE ((1 << 16) - 100) +#define DND_MAX_TRANSPORT_PACKET_PAYLOAD_SIZE (DND_MAX_TRANSPORT_PACKET_SIZE - \ + DND_TRANSPORT_PACKET_HEADER_SIZE) +#define DND_MAX_TRANSPORT_LATENCY_TIME 3 * 1000000 /* 3 seconds. */ + #ifdef _WIN32 /* * Windows-specific functions */ -EXTERN uint32 DnD_GetClipboardFormatFromName(LPCSTR pFormatName); -EXTERN size_t DnD_GetClipboardFormatName(UINT cf, - char *pFormatName, - DWORD dwBufSize); -EXTERN HGLOBAL DnD_CopyStringToGlobal(LPSTR pszString); +EXTERN Unicode DnD_GetClipboardFormatName(UINT cf); +EXTERN HGLOBAL DnD_CopyStringToGlobal(ConstUnicode str); EXTERN HGLOBAL DnD_CopyDWORDToGlobal(DWORD *pDWORD); -EXTERN HGLOBAL DnD_CreateHDrop(const char *path, const char *fileList); -EXTERN HGLOBAL DnD_CreateHDropForGuest(const char *path, - const char *fileList); -EXTERN DWORD DnD_CalcDirectorySize(const char *dir); +EXTERN HGLOBAL DnD_CreateHDrop(ConstUnicode path, ConstUnicode fileList); +EXTERN HGLOBAL DnD_CreateHDropForGuest(ConstUnicode path, + ConstUnicode fileList); +EXTERN size_t DnD_CPStringToLocalString(ConstUnicode bufIn, + utf16_t **bufOut); +EXTERN size_t DnD_LocalStringToCPString(utf16_t *bufIn, + char **bufOut); +EXTERN Bool DnD_SetCPClipboardFromLocalText(CPClipboard *clip, + utf16_t *bufIn); +EXTERN Bool DnD_SetCPClipboardFromLocalRtf(CPClipboard *clip, + char *bufIn); EXTERN Bool DnD_FakeMouseEvent(DWORD flag); EXTERN Bool DnD_FakeMouseState(DWORD key, Bool isDown); EXTERN Bool DnD_FakeEscapeKey(void); -EXTERN Bool DnD_DeleteLocalDirectory(const char *localDir); +EXTERN Bool DnD_DeleteLocalDirectory(ConstUnicode localDir); EXTERN Bool DnD_SetClipboard(UINT format, char *buffer, int len); EXTERN Bool DnD_GetFileList(HDROP hDrop, char **remoteFiles, @@ -109,17 +198,19 @@ /* * Shared functions */ -const char *DnD_GetFileRoot(void); +ConstUnicode DnD_GetFileRoot(void); char *DnD_CreateStagingDirectory(void); -Bool DnD_DeleteStagingFiles(const char *fileList, Bool onReboot); +Bool DnD_DeleteStagingFiles(ConstUnicode stagingDir, Bool onReboot); Bool DnD_DataContainsIllegalCharacters(const char *data, const size_t dataSize); -Bool DnD_PrependFileRoot(const char *fileRoot, char **src, size_t *srcSize); -char *DnD_UTF8Asprintf(unsigned int outBufSize, const char *format, ...); +Bool DnD_PrependFileRoot(ConstUnicode fileRoot, char **src, size_t *srcSize); int DnD_LegacyConvertToCPName(const char *nameIn, size_t bufOutSize, char *bufOut); -size_t DnD_GetLastDirName(const char *str, size_t strSize, char **dirName); +Bool DnD_CPNameListToDynBufArray(char *fileList, + size_t listSize, + DynBufArray *dynBufArray); +Unicode DnD_GetLastDirName(const char *str); /* vmblock support functions. */ int DnD_InitializeBlocking(void); @@ -127,4 +218,22 @@ Bool DnD_AddBlock(int blockFd, const char *blockPath); Bool DnD_RemoveBlock(int blockFd, const char *blockedPath); +/* Transport layer big buffer support functions. */ +void DnD_TransportBufInit(DnDTransportBuffer *buf, + uint8 *msg, + size_t msgSize, + uint32 seqNum); +void DnD_TransportBufReset(DnDTransportBuffer *buf); +size_t DnD_TransportBufGetPacket(DnDTransportBuffer *buf, + DnDTransportPacketHeader **packet); +Bool DnD_TransportBufAppendPacket(DnDTransportBuffer *buf, + DnDTransportPacketHeader *packet, + size_t packetSize); +size_t DnD_TransportMsgToPacket(uint8 *msg, + size_t msgSize, + uint32 seqNum, + DnDTransportPacketHeader **packet); +size_t DnD_TransportReqPacket(DnDTransportBuffer *buf, + DnDTransportPacketHeader **packet); + #endif // _DND_H_ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/dndInt.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/dndInt.h --- open-vm-tools-2008.01.23-74039/lib/include/dndInt.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/dndInt.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,42 +0,0 @@ -/********************************************************* - * Copyright (C) 2005 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 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. - * - *********************************************************/ - -/* - * dndInt.h -- - * - * Private functions for the Drag and Drop library. - */ - -#ifndef __DND_INT_H__ -#define __DND_INT_H__ - -#include "vm_basic_types.h" - -Bool DnDDataContainsIllegalCharacters(const char *data, - const size_t dataSize, - const char *illegalChars); -Bool DnDPrependFileRoot(const char *fileRoot, - const char delimiter, - char **src, - size_t *srcSize); -Bool DnDRootDirUsable(const char *dir); -Bool DnDSetPermissionsOnRootDir(const char *dir); -Bool DnDStagingDirectoryUsable(const char *dir); -Bool DnDSetPermissionsOnStagingDir(const char *dir); - -#endif /* __DND_INT_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/dynarray.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/dynarray.h --- open-vm-tools-2008.01.23-74039/lib/include/dynarray.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/dynarray.h 2008-10-13 08:01:49.000000000 +0100 @@ -0,0 +1,186 @@ +/********************************************************* + * Copyright (C) 2004 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" + +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); + +void * +DynArray_AddressOf(const DynArray *a, unsigned int i); + +unsigned int +DynArray_Count(const DynArray *a); + +Bool +DynArray_SetCount(DynArray *a, unsigned int c); + +unsigned int +DynArray_AllocCount(const DynArray *a); + +Bool +DynArray_Trim(DynArray *a); + +void +DynArray_QSort(DynArray *a, DynArrayCmp compare); + +Bool +DynArray_Copy(DynArray *src, DynArray *dest); + +/* + * 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) \ + \ + typedef int (CDECLCONV *DynArray##T##Cmp)(const TYPE *, \ + const TYPE *); \ + typedef DynArray T##Array; \ + \ + static INLINE void \ + T##Array_Init(T##Array *a, unsigned int count) \ + { \ + 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_ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/dynbuf.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/dynbuf.h --- open-vm-tools-2008.01.23-74039/lib/include/dynbuf.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/dynbuf.h 2008-10-13 08:01:49.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/dynxdr.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/dynxdr.h --- open-vm-tools-2008.01.23-74039/lib/include/dynxdr.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/dynxdr.h 2008-10-13 08:01:49.000000000 +0100 @@ -0,0 +1,48 @@ +/********************************************************* + * Copyright (C) 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 _DYNXDR_H_ +#define _DYNXDR_H_ + +/* + * dynxdr.h -- + * + * Functions for creating and destroying an XDR stream that is backed + * by a dynamic memory buffer. Uses DynBuf, so requires code using it to + * link lib/misc. + * + * This stream only does encoding. For decoding, we generally have data + * already available in the form of a pre-allocated buffer, in which + * case we can use the xdrmem_create() function. + * + * Note: xdr_destroy() is a no-op for this stream. Use DynXdr_Destroy() + * instead. Also, XDR_SETPOS and XDR_INLINE are not supported. + */ + +#include +#include +#include "vm_basic_types.h" + +XDR *DynXdr_Create(XDR *in); +Bool DynXdr_AppendRaw(XDR *xdrs, const void *buf, size_t len); +void *DynXdr_AllocGet(XDR *xdrs); +void *DynXdr_Get(XDR *xdrs); +void DynXdr_Destroy(XDR *xdrs, Bool release); + +#endif /* _DYNXDR_H_ */ + diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/embed_version.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/embed_version.h --- open-vm-tools-2008.01.23-74039/lib/include/embed_version.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/embed_version.h 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/err.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/err.h --- open-vm-tools-2008.01.23-74039/lib/include/err.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/err.h 2008-10-13 08:01:49.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -44,10 +44,20 @@ 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 + +char *Err_Errno2LocalString(Err_Number errorNumber); + /* *---------------------------------------------------------------------- diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/escape.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/escape.h --- open-vm-tools-2008.01.23-74039/lib/include/escape.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/escape.h 2008-10-13 08:01:49.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -34,17 +34,12 @@ size_t sizeIn, // IN size_t *sizeOut); // OUT -static INLINE void * +void * Escape_Do(char escByte, // IN int const *bytesToEsc, // IN void const *bufIn, // IN size_t sizeIn, // IN - size_t *sizeOut) // OUT -{ - const char escStr[] = { escByte, '\0' }; - - return Escape_DoString(escStr, bytesToEsc, bufIn, sizeIn, sizeOut); -} + size_t *sizeOut); // OUT void * Escape_Undo(char escByte, // IN diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/escBitvector.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/escBitvector.h --- open-vm-tools-2008.01.23-74039/lib/include/escBitvector.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/escBitvector.h 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/eventManager.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/eventManager.h --- open-vm-tools-2008.01.23-74039/lib/include/eventManager.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/eventManager.h 2008-10-13 08:01:49.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/file_extensions.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/file_extensions.h --- open-vm-tools-2008.01.23-74039/lib/include/file_extensions.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/file_extensions.h 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -44,6 +44,7 @@ #define VPX_TEMPLATE_EXTENSION "vmtx" // VirtualCenter template #define TEAM_FILE_EXTENSION "vmtm" // Foundry VM team #define POLICY_FILE_EXTENSION "vmpl" // ACE/VRM policy file +#define BUNDLE_FILE_EXTENSION "vmwarevm" // VM configuration bundle directory /* * Snapshot and related file types. @@ -52,6 +53,7 @@ #define MAINMEM_FILE_EXTENSION "vmem" #define SUSPEND_FILE_EXTENSION "vmss" #define CHECKPOINT_FILE_EXTENSION "vmsn" +#define VPLAY_FILE_EXTENSION "vmlog" #define SNAPSHOT_METADATA_EXTENSION "vmsd" #define CHECKPOINT_FILE_EXTENSION_OLD "cpt" // Obsolete synonym for vmsn @@ -79,6 +81,9 @@ #define VIRTUALPC_EXTENSION "vmc" #define SYMANTEC_LIVESTATE_EXTENSION "sv2i" #define STORAGECRAFT_SHADOWSTOR_EXTENSION "spf" +#define ACRONIS_EXTENSION "tib" +#define OPEN_VM_FORMAT_EXTENSION "ovf" +#define ARCHIVED_OPEN_VM_FORMAT_EXTENSION "ova" // "xvm" // VMware console configuration file /* diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/file.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/file.h --- open-vm-tools-2008.01.23-74039/lib/include/file.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/file.h 2008-10-13 08:01:49.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -25,6 +25,10 @@ #ifndef _FILE_H_ #define _FILE_H_ +#ifdef __cplusplus +extern "C"{ +#endif + #include #define INCLUDE_ALLOW_USERLEVEL #define INCLUDE_ALLOW_VMCORE @@ -38,7 +42,10 @@ #elif defined(_WIN32) #define FILE_MAXPATH MAX_PATH #else -# if defined(__FreeBSD__) && BSD_VERSION >= 53 +# ifdef __FreeBSD__ +# include // For __FreeBSD_version +# endif +# if defined(__FreeBSD__) && __FreeBSD_version >= 503000 # include // PATH_MAX # else # include // PATH_MAX @@ -48,6 +55,14 @@ #define FILE_SEARCHPATHTOKEN ";" + +/* + * Opaque, platform-specific stucture for supporting the directory walking API. + */ + +typedef struct WalkDirContextImpl WalkDirContextImpl; +typedef const WalkDirContextImpl *WalkDirContext; + #if defined(__APPLE__) typedef enum { FILEMACOS_UNMOUNT_SUCCESS, @@ -62,13 +77,15 @@ EXTERN void FileMacos_MountDevAsyncNoResult(char const *bsdSliceDev, Bool su); -EXTERN Bool FileMacos_IsOnExternalDevice(char const *path); -EXTERN Bool FileMacos_IsOnSparseDmg(char const *path); +EXTERN Bool FileMacos_IsOnExternalDevice(int fd); +EXTERN Bool FileMacos_IsOnSparseDmg(int fd); EXTERN char *FileMacos_DiskDevToDiskName(char const *bsdDiskDev); EXTERN char *FileMacos_SliceDevToSliceUUID(char const *bsdSliceDev); EXTERN char *FileMacos_SliceUUIDToSliceDev(char const *uuid); +#elif defined VMX86_SERVER +EXTERN int File_GetVMFSBlockSize(ConstUnicode pathName, uint32 *blockSize); #endif EXTERN Bool File_Exists(ConstUnicode pathName); @@ -79,25 +96,39 @@ EXTERN int File_UnlinkDelayed(ConstUnicode pathName); -EXTERN void File_SplitName(const char *path, - char **volume, - char **dir, - char **base); - -EXTERN void File_GetPathName(const char *fullpath, - char **pathname, - char **base); +EXTERN int File_UnlinkNoFollow(ConstUnicode pathName); + +EXTERN void File_SplitName(ConstUnicode pathName, + Unicode *volume, + Unicode *dir, + Unicode *base); + +EXTERN void File_GetPathName(ConstUnicode fullPath, + Unicode *pathName, + Unicode *base); + +EXTERN Unicode File_StripSlashes(ConstUnicode path); EXTERN Bool File_CreateDirectory(ConstUnicode pathName); +EXTERN Bool File_EnsureDirectory(ConstUnicode pathName); EXTERN Bool File_DeleteEmptyDirectory(ConstUnicode pathName); -EXTERN Bool File_CreateDirectoryHierarchy(char const *pathName); +EXTERN Bool File_CreateDirectoryHierarchy(ConstUnicode pathName); -EXTERN Bool File_DeleteDirectoryTree(char const *pathName); +EXTERN Bool File_DeleteDirectoryTree(ConstUnicode pathName); -EXTERN int File_ListDirectory(char const *pathName, - char ***ids); +EXTERN int File_ListDirectory(ConstUnicode pathName, + Unicode **ids); + +/* + * Simple file-system walk. + */ + +EXTERN WalkDirContext File_WalkDirectoryStart(ConstUnicode parentPath); +EXTERN Bool File_WalkDirectoryNext(WalkDirContext context, + Unicode *path); +EXTERN void File_WalkDirectoryEnd(WalkDirContext context); EXTERN Bool File_IsWritableDir(ConstUnicode dirName); @@ -109,27 +140,25 @@ EXTERN Bool File_IsCharDevice(ConstUnicode pathName); -EXTERN Bool File_IsRemote(const char *fileName); +EXTERN Bool File_IsRemote(ConstUnicode pathName); EXTERN Bool File_IsEmptyDirectory(ConstUnicode pathName); -EXTERN char *File_FindLastSlash(const char *path); +EXTERN Unicode File_Cwd(ConstUnicode drive); // XXX belongs to `process' module -EXTERN char *File_Cwd(const char *drive); // XXX belongs to `process' module +EXTERN Unicode File_FullPath(ConstUnicode pathName); -EXTERN char *File_FullPath(const char *fileName); +EXTERN Bool File_IsFullPath(ConstUnicode pathName); -EXTERN Bool File_IsFullPath(const char *fileName); +EXTERN uint64 File_GetFreeSpace(ConstUnicode pathName); -EXTERN uint64 File_GetFreeSpace(const char *fileName); - -EXTERN uint64 File_GetCapacity(const char *fileName); +EXTERN uint64 File_GetCapacity(ConstUnicode pathName); /* Deprecated; use Util_GetSafeTmpDir if you can */ EXTERN char *File_GetTmpDir(Bool useConf); /* Deprecated; use Util_MakeSafeTemp if you can */ -EXTERN int File_MakeTemp(const char *tag, +EXTERN int File_MakeTemp(ConstUnicode tag, Unicode *presult); EXTERN int File_MakeTempEx(ConstUnicode dir, @@ -154,11 +183,10 @@ VmTimeType writeTime, VmTimeType attrChangeTime); -EXTERN Bool File_SupportsFileSize(const char *pathname, +EXTERN Bool File_SupportsFileSize(ConstUnicode pathName, uint64 fileSize); -EXTERN Bool File_SupportsLargeFiles(const char *pathname); - +EXTERN Bool File_SupportsLargeFiles(ConstUnicode pathName); EXTERN Bool File_CopyFromFdToFd(FileIODescriptor src, FileIODescriptor dst); @@ -194,12 +222,12 @@ EXTERN int64 File_GetSizeByPath(ConstUnicode pathName); -EXTERN int64 File_GetSizeAlternate(const char *fileName); +EXTERN int64 File_GetSizeAlternate(ConstUnicode pathName); /* file change notification module */ typedef void (*CbFunction)(void *clientData); -typedef void (*NotifyCallback)(const char *filename, +typedef void (*NotifyCallback)(ConstUnicode pathName, int err, void *data); @@ -217,24 +245,24 @@ EXTERN void File_PollImpersonateOnCheck(Bool check); -EXTERN Bool File_PollAddFile(const char *filename, +EXTERN Bool File_PollAddFile(ConstUnicode pathName, uint32 pollPeriod, NotifyCallback callback, void *data, Bool fPeriodic); -EXTERN Bool File_PollAddDirFile(const char *filename, +EXTERN Bool File_PollAddDirFile(ConstUnicode pathName, uint32 pollPeriod, NotifyCallback callback, void *data, Bool fPeriodic); -EXTERN Bool File_PollRemoveFile(const char *filename, +EXTERN Bool File_PollRemoveFile(ConstUnicode pathName, uint32 pollPeriod, NotifyCallback callback); -EXTERN Bool File_IsSameFile(const char *path1, - const char *path2); +EXTERN Bool File_IsSameFile(ConstUnicode path1, + ConstUnicode path2); EXTERN char *File_PrependToPath(const char *searchPath, const char *elem); @@ -244,14 +272,19 @@ const char *cwd, char **result); -EXTERN char *File_ReplaceExtension(const char *input, - const char *newExtension, - int numExtensions, ...); +EXTERN Unicode File_ReplaceExtension(ConstUnicode pathName, + ConstUnicode newExtension, + uint32 numExtensions, + ...); -EXTERN Bool File_OnVMFS(const char *fileName); +EXTERN Bool File_OnVMFS(ConstUnicode pathName); EXTERN Bool File_MakeCfgFileExecutable(ConstUnicode pathName); EXTERN char *File_ExpandAndCheckDir(const char *dirName); +#ifdef __cplusplus +} // extern "C" { +#endif + #endif // ifndef _FILE_H_ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/fileInt.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/fileInt.h --- open-vm-tools-2008.01.23-74039/lib/include/fileInt.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/fileInt.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,191 +0,0 @@ -/********************************************************* - * Copyright (C) 2007 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 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. - * - *********************************************************/ - -/* - * 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 "fileLock.h" -#include "unicodeBase.h" - -#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 AFFS_SUPER_MAGIC 0xADFF -#define EXT_SUPER_MAGIC 0x137D -#define EXT2_OLD_SUPER_MAGIC 0xEF51 -#define EXT2_SUPER_MAGIC 0xEF53 -#define HFSPLUS_SUPER_MAGIC 0x482B -#define NFS_SUPER_MAGIC 0x6969 -#define SMB_SUPER_MAGIC 0x517B - -#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 - -#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_UNCERTAIN 5 - -typedef struct FileData { - uint64 fileAccessTime; - uint64 fileCreationTime; - uint64 fileModificationTime; - uint64 fileSize; - int fileType; - int fileMode; - int fileOwner; - int fileGroup; -} FileData; - -EXTERN int FileAttributes(ConstUnicode pathName, - FileData *fileData); - -EXTERN int FileRename(ConstUnicode fromPath, - ConstUnicode toPath); - -EXTERN int FileDeletion(ConstUnicode pathName, - Bool handleLink); - -EXTERN int FileCreateDirectory(ConstUnicode pathName); -EXTERN int FileRemoveDirectory(ConstUnicode pathName); - -#if defined(_WIN32) -EXTERN int FileMapErrorToErrno(char *functionName, - DWORD status); -#else -EXTERN char *FilePosixGetBlockDevice(char const *path); -#endif - -typedef struct active_lock -{ - struct active_lock *next; - uint32 age; - Bool marked; - Unicode dirName; -} ActiveLock; - -typedef struct lock_values -{ - char *machineID; - char *executionID; - char *payload; - char *lockType; - Unicode memberName; - unsigned int lamportNumber; - uint32 waitTime; - uint32 msecMaxWaitTime; - ActiveLock *lockList; -} LockValues; - -#include "file_extensions.h" - -#define FILELOCK_SUFFIX "." LOCK_FILE_EXTENSION - -#define FILELOCK_DATA_SIZE 512 - -#if defined(_WIN32) -typedef HANDLE FILELOCK_FILE_HANDLE; -#else -typedef int FILELOCK_FILE_HANDLE; -#endif - -EXTERN const char *FileLockGetMachineID(void); - -EXTERN Bool FileLockMachineIDMatch(char *host, - char *second); - -EXTERN int FileLockMemberValues(ConstUnicode lockDir, - ConstUnicode fileName, - char *buffer, - uint32 size, - LockValues *memberValues); - -EXTERN int FileLockHackVMX(const char *machineID, - const char *executionID, - ConstUnicode filePathName); - -EXTERN int FileLockOpenFile(ConstUnicode pathName, - int flags, - FILELOCK_FILE_HANDLE *handle); - -EXTERN int FileLockCloseFile(FILELOCK_FILE_HANDLE handle); - -EXTERN int FileLockFileSize(FILELOCK_FILE_HANDLE handle, - uint32 *fileSize); - -EXTERN int FileLockReadFile(FILELOCK_FILE_HANDLE handle, - void *buf, - uint32 requestedBytes, - uint32 *resultantBytes); - -EXTERN int FileLockWriteFile(FILELOCK_FILE_HANDLE handle, - void *buf, - uint32 requestedBytes, - uint32 *resultantBytes); - -EXTERN void *FileLockIntrinsic(const char *machineID, - const char *executionID, - const char *payload, - ConstUnicode filePathName, - Bool exclusivity, - uint32 msecMaxWaitTime, - int *err); - -EXTERN int FileUnlockIntrinsic(const char *machineID, - const char *executionID, - ConstUnicode filePathName, - const void *lockToken); - -EXTERN Bool FileLockValidOwner(const char *executionID, - const char *payload); - -EXTERN Bool FileLockValidName(ConstUnicode fileName); - -#endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/fileIO.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/fileIO.h --- open-vm-tools-2008.01.23-74039/lib/include/fileIO.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/fileIO.h 2008-10-13 08:01:49.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -40,15 +40,17 @@ #define INCLUDE_ALLOW_VMCORE #include "includeCheck.h" +#include +#include +#if !defined(_WIN32) +#include +#include +#endif + #include "vm_basic_types.h" #include "unicodeTypes.h" -#if !defined(__FreeBSD__) #include "iovector.h" // for struct iovec -#endif - -#include -#include #if defined(VMX86_STATS) @@ -287,6 +289,7 @@ int count, size_t totalSize, size_t *bytesWritten); +#endif FileIOResult FileIO_Preadv(FileIODescriptor *fd, // IN: File descriptor struct iovec *entries, // IN: Vector to read into @@ -306,10 +309,9 @@ uint64 offset); // IN: Offset to start reading FileIOResult FileIO_Pwrite(FileIODescriptor *fd, // IN: File descriptor - void *buf, // IN: Buffer to write from + void const *buf, // IN: Buffer to write from size_t len, // IN: Length of the buffer uint64 offset); // IN: Offset to start writing -#endif FileIOResult FileIO_Access(ConstUnicode pathName, int accessMode); @@ -340,7 +342,7 @@ /* Only users not using FileIO_Open should use these two */ void FileIO_Init(FileIODescriptor *fd, - const char *fileName); + ConstUnicode pathName); void FileIO_Cleanup(FileIODescriptor *fd); @@ -354,16 +356,6 @@ void FileIO_OptionalSafeInitialize(void); -int FileIO_PosixCreat(ConstUnicode pathName, - int mode); - -int FileIO_PosixOpen(ConstUnicode pathName, - int flags, - int mode); - -FILE *FileIO_PosixFopen(ConstUnicode pathName, - const char *mode); - #if defined(_WIN32) FileIODescriptor FileIO_CreateFDWin32(HANDLE win32, DWORD access, @@ -376,6 +368,9 @@ int flags); #endif +FILE *FileIO_DescriptorToStream(FileIODescriptor *fd); + +ConstUnicode FileIO_Filename(FileIODescriptor *fd); /* *------------------------------------------------------------------------- @@ -410,6 +405,7 @@ #endif #if defined(__APPLE__) +EXTERN Bool FileIO_ResetExcludedFromTimeMachine(char const *pathName); EXTERN Bool FileIO_SetExcludedFromTimeMachine(char const *pathName, Bool isExcluded); #endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/fileLock.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/fileLock.h --- open-vm-tools-2008.01.23-74039/lib/include/fileLock.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/fileLock.h 2008-10-13 08:01:49.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/fileUTF8.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/fileUTF8.h --- open-vm-tools-2008.01.23-74039/lib/include/fileUTF8.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/fileUTF8.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,86 +0,0 @@ -/********************************************************* - * Copyright (C) 2006 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 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. - * - *********************************************************/ - -/* - * fileUTF8.h -- - * - * Interface to host file system and related utility functions. - * These are the same as the File_*** procedures except these accept - * and return all strings in UTF8 form. This means they will convert - * between UTF8 and the local character set, which is needed by the tools - * code. - */ - -#ifndef _FILE_UTF8_H_ -#define _FILE_UTF8_H_ - -#define INCLUDE_ALLOW_USERLEVEL -#define INCLUDE_ALLOW_VMCORE -#include "includeCheck.h" - -#include "fileIO.h" - - -EXTERN Bool FileUTF8_Copy(const char *utf8SrcFile, const char *utf8DstFile); - -EXTERN Bool FileUTF8_Rename(const char *utf8OldFile, const char *utf8NewFile); - -EXTERN int64 FileUTF8_GetSize(const char *utf8Name); - -EXTERN Bool FileUTF8_CreateDirectory(char const *utf8Name); - -EXTERN Bool FileUTF8_CreateDirectoryHierarchy(char const *utf8Name); - -EXTERN Bool FileUTF8_DeleteEmptyDirectory(char const *utf8Name); - -EXTERN int FileUTF8_ListDirectory(char const *utf8Name, char ***ids); - -EXTERN int FileUTF8_UnlinkIfExists(const char *name); - -EXTERN Bool FileUTF8_IsDirectory(const char *utf8Name); - -EXTERN Bool FileUTF8_IsFile(const char *utf8Name); - -EXTERN Bool FileUTF8_IsSymLink(char const *utf8Name); - -EXTERN Bool FileUTF8_Exists(const char *name); - -EXTERN Bool FileUTF8_GetTimes(const char *fileName, - VmTimeType *createTime, - VmTimeType *accessTime, - VmTimeType *writeTime, - VmTimeType *attrChangeTime); - -EXTERN Bool FileUTF8_SetTimes(const char *fileName, - VmTimeType createTime, - VmTimeType accessTime, - VmTimeType writeTime, - VmTimeType attrChangeTime); - -EXTERN Bool FileUTF8_DeleteDirectoryTree(char const *utf8Name); - -EXTERN int FileUTF8_MakeTemp(const char *tag, char **presult); - -EXTERN int FileUTF8_MakeTempEx(const char *utf8Dir, - const char *utf8FileName, - char **presult); - -#endif // ifndef _FILE_UTF8_H_ - - - diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/foundryThreads.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/foundryThreads.h --- open-vm-tools-2008.01.23-74039/lib/include/foundryThreads.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/foundryThreads.h 2008-10-13 08:01:49.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -42,6 +42,7 @@ struct FoundryWorkerThread *FoundryThreads_StartThread(FoundryThreadProc proc, void *threadParam); void FoundryThreads_StopThread(struct FoundryWorkerThread *threadState); +void FoundryThreads_Free(struct FoundryWorkerThread *threadState); Bool FoundryThreads_IsCurrentThread(struct FoundryWorkerThread *threadState); @@ -50,7 +51,7 @@ */ typedef struct FoundryWorkerThread { #if _WIN32 - DWORD threadId; + Util_ThreadID threadId; HANDLE threadHandle; #else pthread_t threadInfo; diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/ghIntegration.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/ghIntegration.h --- open-vm-tools-2008.01.23-74039/lib/include/ghIntegration.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/ghIntegration.h 2008-10-13 08:01:49.000000000 +0100 @@ -0,0 +1,73 @@ +/********************************************************* + * Copyright (C) 2007 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. + * + *********************************************************/ + +/* + * ghIntegration.h -- + * + * Commands for guest host integration. + */ + +#ifndef _GH_INTEGRATION_H_ +#define _GH_INTEGRATION_H_ + +#include "dbllnklst.h" +#include "rpcin.h" + + +extern DblLnkLst_Links launchMenu; + +/* + * If other libraries want to use dynamic adding/removing of event monitoring + * to VMWareUserLoop then following definitions need to move to a header + * file, which is shared by all the libraries. To make such a move simple, following + * definitions do not have GHI prefix, rather it has VMU (aka VMwareUser) + * prefix. + */ +#ifdef _WIN32 +typedef HANDLE VMU_EVENT; +#else +typedef int VMU_EVENT; +#endif + + +typedef enum VmuCallbackAction { + VMU_CALLBACK_ACTION_SUCCESS, + VMU_CALLBACK_ACTION_ABORT +} VmuCallbackAction; +typedef VmuCallbackAction VMU_EventHandler(void *ctx, VMU_EVENT event); + +typedef enum VmuControllerAction { + VMU_CONTROLLER_CB_ADD_EVENT = 1, + VMU_CONTROLLER_CB_REMOVE_EVENT +} VmuControllerAction; +typedef Bool (VMU_ControllerCB)(void *ctx, + VMU_EVENT event, + VMU_EventHandler *eventHandler, + void *cbCtx, + VmuControllerAction action); + +Bool GHI_IsSupported(void); +void GHI_Init(VMU_ControllerCB *vmuControllerCB, void *ctx); +void GHI_Cleanup(void); +void GHI_InitBackdoor(struct RpcIn *rpcIn); +void GHI_RegisterCaps(void); +void GHI_UnregisterCaps(void); +void GHI_Gather(void); + +#endif + diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/guestApp.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/guestApp.h --- open-vm-tools-2008.01.23-74039/lib/include/guestApp.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/guestApp.h 2008-10-13 08:01:49.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -27,6 +27,10 @@ #ifndef __GUESTAPP_H__ # define __GUESTAPP_H__ +#if defined(_WIN32) +#include +#endif + #ifdef __cplusplus extern "C" { #endif @@ -34,7 +38,7 @@ # include "vm_basic_types.h" # include "removable_device.h" -#define ALLOW_TOOLS_IN_FOREIGN_VM 1 +//#define ALLOW_TOOLS_IN_FOREIGN_VM 0 extern Bool runningInForeignVM; typedef struct GuestApp_Dict GuestApp_Dict; @@ -98,18 +102,12 @@ GuestApp_GetPtrGrabCap(const char *channel); // IN Bool -GuestApp_SetVersion(void); - -Bool GuestApp_Log(const char *s); // IN -uint32 -GuestApp_GetCurrentVersion(void); - -const char * +char * GuestApp_GetInstallPath(void); -const char * +char * GuestApp_GetConfPath(void); char * @@ -121,6 +119,15 @@ Bool GuestApp_IsHgfsCapable(void); +Bool +GuestApp_IsDiskShrinkEnabled(void); + +Bool +GuestApp_IsDiskShrinkCapable(void); + +Bool +GuestApp_DiskShrink(void); + void GuestApp_GetPos(int16 *x, // OUT int16 *y); // OUT @@ -154,17 +161,12 @@ GuestApp_HostCopyStep(uint8 c); // IN Bool -GuestApp_RpcSendOneUtf8(char const *cmd, // IN: RPCI command - char const *arg, // IN: string arg to be Utf8 encoded - size_t argSize); // IN: size of arg - -Bool -GuestApp_RpcSendOneUtf8CPName(char const *cmd, // IN: RPCI command - char const *arg, // IN: to UTF8 encode - size_t argSize, // IN: size of arg - char delimiter, // IN: delimiter - char const *cpNameArg, // IN: to UTF8/CPName encode - size_t cpNameArgSize); // IN: size of cpNameArg +GuestApp_RpcSendOneArgCPName(char const *cmd, // IN: RPCI command + char const *arg, // IN: UTF-8 encoded string + size_t argSize, // IN: size of arg + char delimiter, // IN: delimiter + char const *cpNameArg, // IN: UTF-8 encoded CPName + size_t cpNameArgSize); // IN: size of cpNameArg Bool GuestApp_RpcSendOneCPName(char const *cmd, // IN: RPCI command char delimiter, // IN: delimiter @@ -173,10 +175,29 @@ Bool GuestApp_OpenUrl(const char *url, Bool maximize); +#if defined(_WIN32) +void GuestApp_SetDictEntryW(GuestApp_Dict *dict, + const WCHAR *name, + const WCHAR *value); + +void GuestApp_SetDictEntryDefaultW(GuestApp_Dict *dict, + const WCHAR *name, + const WCHAR *defaultVal); + +WCHAR *GuestApp_GetDictEntryW(GuestApp_Dict *dict, + const WCHAR *name); + +WCHAR *GuestApp_GetDictEntryDefaultW(GuestApp_Dict *dict, + const WCHAR *name); +#endif + #ifndef _WIN32 +void GuestApp_SetSpawnEnviron(const char **spawnEnviron); Bool GuestApp_FindProgram(const char *program); #endif +Bool +GuestApp_ControlRecord(int32 command); // IN #ifdef __cplusplus } #endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/guestCaps.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/guestCaps.h --- open-vm-tools-2008.01.23-74039/lib/include/guestCaps.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/guestCaps.h 2008-10-13 08:01:50.000000000 +0100 @@ -0,0 +1,121 @@ +/********************************************************* + * Copyright (C) 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. + * + *********************************************************/ + +/* + * guestCaps.h -- + * + * Common definitions for the guestCaps system that allows a guest to + * register an arbitrary number of boolean capabilites with the vmx. + */ + +#ifndef _GUEST_CAPS_H_ +#define _GUEST_CAPS_H_ + +/* + * Guest capabilities. + * The guest uses this enum to communicate whether a certain + * feature is supported by the tools. + * The guest sends an RPC where it specifies which features + * are turned off and on, for example + * "tools.capability.features 0=1 2=1 3=0". + * In the above example, the guest is capable of showing the + * start menu and setting the work area, but does not support + * multiple monitors. + * + * NOTE: the order for these has to stay constant for backward compatibility + * with older Tools versions. New capabilities must be added at the end. + */ + +typedef enum { + UNITY_CAP_START_MENU = 0, // can show the start menu + UNITY_CAP_VIRTUAL_DESK = 1, // supports virtual desktops + UNITY_CAP_WORK_AREA = 2, // can set the work area + UNITY_CAP_MULTI_MON = 3, // supports multiple monitors + GHI_CAP_SHELL_ACTION_BROWSE = 4, // supports the "browse" action verb + GHI_CAP_SHELL_LOCATION_HGFS = 5, // supports HGFS location URIs + GHI_CAP_SHELL_ACTION_RUN = 6, // supports the "run" action verb + GHI_CAP_CMD_SHELL_ACTION = 7, // allows "ghi.guest.shell.action" command + HGFSU_CAP_MIRROR_DESKTOP = 8, // supports remapping GOS Desktop to HGFS + HGFSU_CAP_MIRROR_DOCUMENTS = 9, // supports remapping GOS Documents to HGFS + HGFSU_CAP_MIRROR_MUSIC = 10, // supports remapping GOS Music to HGFS + HGFSU_CAP_MIRROR_PICTURES = 11, // supports remapping GOS Pictures to HGFS + HGFSU_CAP_DESKTOP_SHORTCUT = 12, // supports creating HGFS link on GOS Desktop + HGFSU_CAP_MAP_DRIVE = 13, // supports mapping a GOS drive letter to HGFS + GHI_CAP_SET_HANDLER = 14, // supports setting the handler for types/protocols + UNITY_CAP_STATUS_UNITY_ACTIVE = 15, // supports GuestRpc bits for Unity Status +} GuestCapabilities; + +typedef struct { + GuestCapabilities cap; + const char *vmdbPath; + const char *vmdbKey; +} GuestCapElem; + +/* guest_rpc command to send over the wire. */ +#define GUEST_CAP_FEATURES "tools.capability.features" + +#if defined(VM_NEED_VMDB_GUEST_CAP_MAPPING) + +/* VMDB paths prefixes to store various capabilities sent from the guest. */ +#define UNITY_CAP_VMDB_PATH "guest/caps/unityFeatures" +#define GHI_CAP_VMDB_PATH "guest/caps/ghiFeatures" +#define HGFSU_CAP_VMDB_PATH "guest/caps/hgfsUsabilityFeatures" + +/* + * If you change these strings, make sure you also change the + * vmdb schema, since these strings are used as vmdb keys. + */ + +/* + * This table must be sorted such that it can be indexed using the + * GuestCapabilities enum above. RPC calls pass the value, and the + * handler code uses it as an index. In other words, the value of the + * caps field at index i must be equal to i as well. This is because + * the code that looks up entries in this table assume as much. It + * also means we don't need the cap field, or, to justify its existence, + * the lookup code should be converted to loop through the table and + * return the entry where cap == the value passed in the RPC call. + * Moral of the story, new entries always at the bottom of the table + * and the cap field must be set to the offset in the array (and make + * sure the enum in GuestCapabilities is also set to that offset). + */ + +static GuestCapElem guestCapTable[] = { + { UNITY_CAP_START_MENU, UNITY_CAP_VMDB_PATH, "startmenu" }, + { UNITY_CAP_VIRTUAL_DESK, UNITY_CAP_VMDB_PATH, "virtualdesk" }, + { UNITY_CAP_WORK_AREA, UNITY_CAP_VMDB_PATH, "workarea" }, + { UNITY_CAP_MULTI_MON, UNITY_CAP_VMDB_PATH, "multimon" }, + + { GHI_CAP_SHELL_ACTION_BROWSE, GHI_CAP_VMDB_PATH, "shellActionBrowse" }, + { GHI_CAP_SHELL_LOCATION_HGFS, GHI_CAP_VMDB_PATH, "shellLocationHGFS" }, + { GHI_CAP_SHELL_ACTION_RUN, GHI_CAP_VMDB_PATH, "shellActionRun" }, + { GHI_CAP_CMD_SHELL_ACTION, GHI_CAP_VMDB_PATH, "cmdShellAction" }, + + { HGFSU_CAP_MIRROR_DESKTOP, HGFSU_CAP_VMDB_PATH, "mirrorDesktop" }, + { HGFSU_CAP_MIRROR_DOCUMENTS, HGFSU_CAP_VMDB_PATH, "mirrorDocuments" }, + { HGFSU_CAP_MIRROR_MUSIC, HGFSU_CAP_VMDB_PATH, "mirrorMusic" }, + { HGFSU_CAP_MIRROR_PICTURES, HGFSU_CAP_VMDB_PATH, "mirrorPictures" }, + { HGFSU_CAP_DESKTOP_SHORTCUT, HGFSU_CAP_VMDB_PATH, "createShortcut" }, + { HGFSU_CAP_MAP_DRIVE, HGFSU_CAP_VMDB_PATH, "mapDrive" }, + { GHI_CAP_SET_HANDLER, GHI_CAP_VMDB_PATH, "setHandler" }, + { UNITY_CAP_STATUS_UNITY_ACTIVE, UNITY_CAP_VMDB_PATH, "unityActive" }, +}; + +#endif // VM_NEED_VMDB_GUEST_CAP_MAPPING + +#endif // _GUEST_CAPS_H_ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/guestInfo.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/guestInfo.h --- open-vm-tools-2008.01.23-74039/lib/include/guestInfo.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/guestInfo.h 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -31,8 +31,9 @@ #include "vm_basic_types.h" #include "dbllnklst.h" +#include "guestStats.h" +#include "guestrpc/nicinfo.h" -#define GUEST_INFO_COMMAND_TWO "SetGuestInfo2" #define GUEST_INFO_COMMAND "SetGuestInfo" #define MAX_VALUE_LEN 100 #define MAX_NICS 16 @@ -40,6 +41,7 @@ #define MAC_ADDR_SIZE 19 #define IP_ADDR_SIZE 16 #define PARTITION_NAME_SIZE MAX_VALUE_LEN +#define GUESTINFO_TIME_INTERVAL_MSEC 3000 /* time interval in msec */ typedef enum { INFO_ERROR, /* Zero is unused so that errors in atoi can be caught. */ @@ -50,30 +52,15 @@ INFO_OS_NAME_FULL, INFO_OS_NAME, INFO_UPTIME, + INFO_MEMORY, + INFO_IPADDRESS_V2, INFO_MAX } GuestInfoType; -/* - * For backward compatibility's sake over wire (from Tools to VMX), new fields - * in this struct must be added at the end. THis is the part that goes over wire. - */ -typedef struct VmIpAddressEntryProtocol { - uint32 addressFamily; /* uint8 should be enough. However we */ - /* need it to be multiple of 4 bytes */ - /* in order to have the same size on */ - /* different hardware architectures */ - uint32 dhcpEnabled; /* This is a boolean. However we need it to be */ - /* multiple of 4 bytes, in order to be the same */ - /* on different hardware architecture */ - char ipAddress[IP_ADDR_SIZE]; - char subnetMask[IP_ADDR_SIZE]; - uint32 totalIpEntrySizeOnWire; -} VmIpAddressEntryProtocol; - -typedef struct VmIpAddressEntry { - DblLnkLst_Links links; - VmIpAddressEntryProtocol ipEntryProto; -} VmIpAddressEntry; +typedef enum { + INFO_IP_ADDRESS_FAMILY_IPV4, + INFO_IP_ADDRESS_FAMILY_IPV6 +} GuestInfoIPAddressFamilyType; typedef struct NicEntryV1 { unsigned int numIPs; @@ -81,54 +68,17 @@ char ipAddress[MAX_IPS][IP_ADDR_SIZE]; } NicEntryV1; -/* - * For backward compatibility's sake over wire (from Tools to VMX), new fields - * in this struct must be added at the end. THis is the part that goes over wire. - */ -typedef struct NicEntryProtocol { - char macAddress[MAC_ADDR_SIZE]; /* In the format "12-23-34-45-56-67" */ - char pad[1]; /* MAC_ADDR_SIZE happens to be 19. */ - /* Pad it to be multiple of 4 bytes */ - uint32 numIPs; - uint32 ipAddressSizeOnWire; /* size of struct VmIpAddresses over wire*/ - uint32 totalNicEntrySizeOnWire; -} NicEntryProtocol; - -typedef struct NicEntry { - DblLnkLst_Links links; - NicEntryProtocol nicEntryProto; - DblLnkLst_Links ipAddressList; -/* DblLnkLst_Links gatewayList; */ -} NicEntry; - -typedef struct NicInfoV1 { +typedef struct GuestNicInfoV1 { unsigned int numNicEntries; NicEntryV1 nicList[MAX_NICS]; -} NicInfoV1; - -/* - * For backward compatibility's sake over wire (from Tools to VMX), new fields - * in this struct must be added at the end. This is the part that goes over wire. - */ -typedef struct NicInfoProtocol { - uint32 version; - uint32 nicEntrySizeOnWire; /* length of NicEntry over wire. Lengths differ */ - /* with different versions. */ - uint32 numNicEntries; - uint32 totalInfoSizeOnWire; -} NicInfoProtocol; - -typedef struct NicInfo { - NicInfoProtocol nicInfoProto; - DblLnkLst_Links nicList; /* Pointers in it must be initialized to NULL */ -} NicInfo; +} GuestNicInfoV1; typedef #include "vmware_pack_begin.h" struct _PartitionEntry { uint64 freeBytes; uint64 totalBytes; - char name[PARTITION_NAME_SIZE]; + char name[PARTITION_NAME_SIZE]; } #include "vmware_pack_end.h" PartitionEntry, *PPartitionEntry; @@ -136,106 +86,21 @@ typedef struct _DiskInfo { unsigned int numEntries; PPartitionEntry partitionList; -} DiskInfo, *PDiskInfo; - - -NicEntry *NicInfo_AddNicEntry(NicInfo *nicInfo, const char macAddress[MAC_ADDR_SIZE]); -VmIpAddressEntry *NicEntry_AddIpAddress(NicEntry *nicEntry, - const char *ipAddr, - const uint32 af_type); - -NicEntry *NicInfo_FindMacAddress(NicInfo *nicInfo, const char *macAddress); - -/* - *---------------------------------------------------------------------- - * - * GuestInfo_FreeDynamicMemoryInNic -- - * - * Traverse the link list and free all dynamically allocated memory. - * - * Results: - * None. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static INLINE void -GuestInfo_FreeDynamicMemoryInNic(NicEntry *nicEntry) // IN -{ - VmIpAddressEntry *ipAddressCur; - DblLnkLst_Links *sCurrent; - DblLnkLst_Links *sNext; - - if (NULL == nicEntry) { - return; - } - - if (0 == nicEntry->nicEntryProto.numIPs) { - return; - } - - DblLnkLst_ForEachSafe(sCurrent, sNext, &nicEntry->ipAddressList) { - - ipAddressCur = DblLnkLst_Container(sCurrent, - VmIpAddressEntry, - links); - - DblLnkLst_Unlink1(&ipAddressCur->links); - free(ipAddressCur); - } +} GuestDiskInfo, *PGuestDiskInfo; - DblLnkLst_Init(&nicEntry->ipAddressList); -} /* - *---------------------------------------------------------------------- - * - * GuestInfo_FreeDynamicMemoryInNicInfo -- - * - * Free all dynamically allocated memory in the struct pointed to - * by nicInfo. - * - * Results: - * None. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- + * Global functions */ -static INLINE void -GuestInfo_FreeDynamicMemoryInNicInfo(NicInfo *nicInfo) // IN -{ - NicEntry *nicEntryCur = NULL; - DblLnkLst_Links *sCurrent; - DblLnkLst_Links *sNext; - - if (NULL == nicInfo) { - return; - } - - if (0 == nicInfo->nicInfoProto.numNicEntries) { - return; - } - - DblLnkLst_ForEachSafe(sCurrent, sNext, &nicInfo->nicList) { - nicEntryCur = DblLnkLst_Container(sCurrent, - NicEntry, - links); - - GuestInfo_FreeDynamicMemoryInNic(nicEntryCur); - DblLnkLst_Unlink1(&nicEntryCur->links); - free (nicEntryCur); - } - - DblLnkLst_Init(&nicInfo->nicList); -} - +extern Bool GuestInfo_GetFqdn(int outBufLen, char fqdn[]); +extern Bool GuestInfo_GetNicInfo(GuestNicList *nicInfo); +extern Bool GuestInfo_GetDiskInfo(PGuestDiskInfo di); +extern Bool GuestInfo_GetOSName(unsigned int outBufFullLen, + unsigned int outBufLen, char *osNameFull, + char *osName); +extern int GuestInfo_GetSystemBitness(void); #endif // _GUEST_INFO_H_ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/guestInfoInt.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/guestInfoInt.h --- open-vm-tools-2008.01.23-74039/lib/include/guestInfoInt.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/guestInfoInt.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,44 +0,0 @@ -/********************************************************* - * Copyright (C) 2001 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 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. - * - *********************************************************/ - - -/* - * guestInfoInt.h -- - * - * Functions used to communicate guest information to the host. - * - */ - -#ifndef GUEST_INFO_INT_H -#define GUEST_INFO_INT_H - - -#include "guestInfo.h" - -Bool GuestInfoGetFqdn(int outBufLen, char fqdn[]); -Bool GuestInfoGetNicInfo(NicInfo *nicInfo); -void GuestInfoMemset(void * mem, int value, unsigned int size); -Bool GuestInfoGetDiskInfo(PDiskInfo di); -Bool GuestInfoGetOSName(unsigned int outBufFullLen, unsigned int outBufLen, - char *osNameFull, char *osName); - - - - - -#endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/guestInfoServer.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/guestInfoServer.h --- open-vm-tools-2008.01.23-74039/lib/include/guestInfoServer.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/guestInfoServer.h 2008-10-13 08:01:49.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -34,7 +34,7 @@ Bool GuestInfoServer_Init(DblLnkLst_Links * eventQueue); void GuestInfoServer_Cleanup(void); void GuestInfoServer_VMResumedNotify(void); -uint64 GetAvailableDiskSpace(char *pathName); +uint64 GuestInfo_GetAvailableDiskSpace(char *pathName); void GuestInfoServer_DisableDiskInfoQuery(Bool disable); Bool GuestInfoServer_SendUptime(void); diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/guest_msg_def.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/guest_msg_def.h --- open-vm-tools-2008.01.23-74039/lib/include/guest_msg_def.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/guest_msg_def.h 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -83,5 +83,10 @@ #define GUESTMSG_FLAG_COOKIE 0x80000000 #define GUESTMSG_FLAG_ALL GUESTMSG_FLAG_COOKIE +/* + * Maximum size of incoming message. This is to prevent denial of host service + * attacks from guest applications. + */ +#define GUESTMSG_MAX_IN_SIZE (64 * 1024) #endif /* _GUEST_MSG_DEF_H_ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/guest_os.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/guest_os.h --- open-vm-tools-2008.01.23-74039/lib/include/guest_os.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/guest_os.h 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -19,6 +19,7 @@ #ifndef _GUEST_OS_H_ #define _GUEST_OS_H_ +#define INCLUDE_ALLOW_MODULE #define INCLUDE_ALLOW_USERLEVEL #define INCLUDE_ALLOW_VMCORE #include "includeCheck.h" @@ -100,7 +101,7 @@ #define ALLWINXP64 BS(WINXPPRO_64) #define ALLWINXP (ALLWINXP32 | ALLWINXP64) -#define ALLFREEBSD BS(FREEBSD) | BS(FREEBSD_64) +#define ALLFREEBSD (BS(FREEBSD) | BS(FREEBSD_64)) #define ALLWINNET32 BS(WINNET) #define ALLWINNET64 BS(WINNET_64) @@ -111,7 +112,7 @@ #define ALLWINVISTA (ALLWINVISTA32 | ALLWINVISTA64) #define ALLWINNT32 (BS(WINNT) | ALLWIN2000 | ALLWINXP32 | ALLWINNET32 | \ - ALLWINVISTA32) + ALLWINVISTA32) #define ALLWINNT64 (ALLWINXP64 | ALLWINNET64 | ALLWINVISTA64) #define ALLWINNT (ALLWINNT32 | ALLWINNT64) @@ -131,4 +132,178 @@ BS(SOLARIS10_64) | BS(FREEBSD_64) | \ BS(WINVISTA_64) | BS(DARWIN_64) | BS(OTHER_64)) + +/* + * These constants are generated by GuestInfoGetOSName which is in + * the bora-vmsoft subtree. + */ + +/* Linux */ +#define STR_OS_ANNVIX "Annvix" +#define STR_OS_ARCH "Arch" +#define STR_OS_ARKLINUX "Arklinux" +#define STR_OS_AUROX "Aurox" +#define STR_OS_ASIANUX "asianux" +#define STR_OS_BLACKCAT "BlackCat" +#define STR_OS_COBALT "Cobalt" +#define STR_OS_CONECTIVA "Conectiva" +#define STR_OS_DEBIAN "Debian" +#define STR_OS_FEDORA "Fedora" +#define STR_OS_GENTOO "Gentoo" +#define STR_OS_IMMUNIX "Immunix" +#define STR_OS_LINUX "linux" +#define STR_OS_LINUX_FROM_SCRATCH "Linux-From-Scratch" +#define STR_OS_LINUX_FULL "Other Linux" +#define STR_OS_LINUX_PPC "Linux-PPC" +#define STR_OS_MANDRAKE "mandrake" +#define STR_OS_MANDRAKE_FULL "Mandrake Linux" +#define STR_OS_MANDRIVA "mandriva" +#define STR_OS_MKLINUX "MkLinux" +#define STR_OS_NOVELL "nld9" +#define STR_OS_NOVELL_FULL "Novell Linux Desktop 9" +#define STR_OS_OTHER "otherlinux" +#define STR_OS_OTHER_24 "other24xlinux" +#define STR_OS_OTHER_24_FULL "Other Linux 2.4.x kernel" +#define STR_OS_OTHER_26 "other26xlinux" +#define STR_OS_OTHER_26_FULL "Other Linux 2.6.x kernel" +#define STR_OS_OTHER_FULL "Other Linux" +#define STR_OS_PLD "PLD" +#define STR_OS_RED_HAT "redhat" +#define STR_OS_RED_HAT_EN "rhel" +#define STR_OS_RED_HAT_EN_2 "rhel2" +#define STR_OS_RED_HAT_EN_2_FULL "Red Hat Enterprise Linux 2" +#define STR_OS_RED_HAT_EN_3 "rhel3" +#define STR_OS_RED_HAT_EN_3_FULL "Red Hat Enterprise Linux 3" +#define STR_OS_RED_HAT_EN_4 "rhel4" +#define STR_OS_RED_HAT_EN_4_FULL "Red Hat Enterprise Linux 4" +#define STR_OS_RED_HAT_FULL "Red Hat Linux" +#define STR_OS_SLACKWARE "Slackware" +#define STR_OS_SMESERVER "SMEServer" +#define STR_OS_SUN_DESK "sjds" +#define STR_OS_SUN_DESK_FULL "Sun Java Desktop System" +#define STR_OS_SUSE "suse" +#define STR_OS_SUSE_EN "sles" +#define STR_OS_SUSE_EN_FULL "SUSE Linux Enterprise Server" +#define STR_OS_SUSE_FULL "SUSE Linux" +#define STR_OS_TINYSOFA "Tiny Sofa" +#define STR_OS_TURBO "turbolinux" +#define STR_OS_TURBO_FULL "Turbolinux" +#define STR_OS_UBUNTU "Ubuntu" +#define STR_OS_ULTRAPENGUIN "UltraPenguin" +#define STR_OS_UNITEDLINUX "UnitedLinux" +#define STR_OS_VALINUX "VALinux" +#define STR_OS_YELLOW_DOG "Yellow Dog" + +/* Windows */ +#define STR_OS_WIN_31 "win31" +#define STR_OS_WIN_31_FULL "Windows 3.1" +#define STR_OS_WIN_95 "win95" +#define STR_OS_WIN_95_FULL "Windows 95" +#define STR_OS_WIN_98 "win98" +#define STR_OS_WIN_98_FULL "Windows 98" +#define STR_OS_WIN_ME "winMe" +#define STR_OS_WIN_ME_FULL "Windows Me" +#define STR_OS_WIN_NT "winNT" +#define STR_OS_WIN_NT_FULL "Windows NT" +#define STR_OS_WIN_2000_PRO "win2000Pro" +#define STR_OS_WIN_2000_PRO_FULL "Windows 2000 Professional" +#define STR_OS_WIN_2000_SERV "win2000Serv" +#define STR_OS_WIN_2000_SERV_FULL "Windows 2000 Server" +#define STR_OS_WIN_2000_ADV_SERV "win2000AdvServ" +#define STR_OS_WIN_2000_ADV_SERV_FULL "Windows 2000 Advanced Server" +#define STR_OS_WIN_2000_DATACENT_SERV "win2000DataCentServ" +#define STR_OS_WIN_2000_DATACENT_SERV_FULL "Windows 2000 Data Center Server" +#define STR_OS_WIN_XP_HOME "winXPHome" +#define STR_OS_WIN_XP_HOME_FULL "Windows XP Home Edition" +#define STR_OS_WIN_XP_PRO "winXPPro" +#define STR_OS_WIN_XP_PRO_FULL "Windows XP Professional" +#define STR_OS_WIN_XP_PRO_X64 "winXPPro-64" +#define STR_OS_WIN_XP_PRO_X64_FULL "Windows XP Professional x64 Edition" +#define STR_OS_WIN_NET_WEB "winNetWeb" +#define STR_OS_WIN_NET_WEB_FULL "Windows Server 2003 Web Edition" +#define STR_OS_WIN_NET_ST "winNetStandard" +#define STR_OS_WIN_NET_ST_FULL "Windows Server 2003 Standard Edition" +#define STR_OS_WIN_NET_EN "winNetEnterprise" +#define STR_OS_WIN_NET_EN_FULL "Windows Server 2003 Enterprise Edition" +#define STR_OS_WIN_NET_BUS "winNetBusiness" +#define STR_OS_WIN_NET_BUS_FULL "Windows Server 2003 Small Business" +#define STR_OS_WIN_NET_COMPCLUSTER "winNetComputeCluster" +#define STR_OS_WIN_NET_COMPCLUSTER_FULL "Windows Server 2003 Compute Cluster Edition" +#define STR_OS_WIN_NET_STORAGESERVER "winNetStorageSvr" +#define STR_OS_WIN_NET_STORAGESERVER_FULL "Windows Storage Server 2003" +#define STR_OS_WIN_NET_DC_FULL "Windows Server 2003 Datacenter Edition" +#define STR_OS_WIN_NET_DC "winNetDatacenter" +#define STR_OS_WIN_LONG "longhorn" +#define STR_OS_WIN_LONG_FULL "Longhorn (experimental)" +#define STR_OS_WIN_VISTA "winVista" +#define STR_OS_WIN_VISTA_FULL "Windows Vista" +#define STR_OS_WIN_VISTA_X64 "winVista-64" +#define STR_OS_WIN_VISTA_X64_FULL "Windows Vista x64 Edition" +#define STR_OS_WIN_VISTA_ULTIMATE "winVistaUltimate-32" +#define STR_OS_WIN_VISTA_ULTIMATE_FULL "Windows Vista Ultimate Edition" +#define STR_OS_WIN_VISTA_HOME_PREMIUM "winVistaHomePremium-32" +#define STR_OS_WIN_VISTA_HOME_PREMIUM_FULL "Windows Vista Home Premium Edition" +#define STR_OS_WIN_VISTA_HOME_BASIC "winVistaHomeBasic-32" +#define STR_OS_WIN_VISTA_HOME_BASIC_FULL "Windows Vista Home Basic Edition" +#define STR_OS_WIN_VISTA_ENTERPRISE "winVistaEnterprise-32" +#define STR_OS_WIN_VISTA_ENTERPRISE_FULL "Windows Vista Enterprise Edition" +#define STR_OS_WIN_VISTA_BUSINESS "winVistaBusiness-32" +#define STR_OS_WIN_VISTA_BUSINESS_FULL "Windows Vista Business Edition" +#define STR_OS_WIN_VISTA_STARTER "winVistaStarter-32" +#define STR_OS_WIN_VISTA_STARTER_FULL "Windows Vista Starter Edition" +#define STR_OS_WIN_2008_CLUSTER "winServer2008Cluster-32" +#define STR_OS_WIN_2008_CLUSTER_FULL "Windows Server 2008 Cluster Server Edition" +#define STR_OS_WIN_2008_DATACENTER "winServer2008Datacenter-32" +#define STR_OS_WIN_2008_DATACENTER_FULL "Windows Server 2008 Datacenter Edition" +#define STR_OS_WIN_2008_DATACENTER_CORE "winServer2008DatacenterCore-32" +#define STR_OS_WIN_2008_DATACENTER_CORE_FULL "Windows Server 2008 Datacenter Edition (core installation)" +#define STR_OS_WIN_2008_ENTERPRISE "winServer2008Enterprise-32" +#define STR_OS_WIN_2008_ENTERPRISE_FULL "Windows Server 2008 Enterprise Edition" +#define STR_OS_WIN_2008_ENTERPRISE_CORE "winServer2008EnterpriseCore-32" +#define STR_OS_WIN_2008_ENTERPRISE_CORE_FULL "Windows Server 2008 Enterprise Edition (core installation)" +#define STR_OS_WIN_2008_ENTERPRISE_ITANIUM "winServer2008EnterpriseItanium-32" +#define STR_OS_WIN_2008_ENTERPRISE_ITANIUM_FULL "Windows Server 2008 Enterprise Edition for Itanium-based Systems" +#define STR_OS_WIN_2008_SMALL_BUSINESS "winServer2008SmallBusiness-32" +#define STR_OS_WIN_2008_SMALL_BUSINESS_FULL "Windows Server 2008 Small Business Server" +#define STR_OS_WIN_2008_SMALL_BUSINESS_PREMIUM "winServer2008SmallBusinessPremium-32" +#define STR_OS_WIN_2008_SMALL_BUSINESS_PREMIUM_FULL "Windows Server 2008 Small Business Server Premium Edition" +#define STR_OS_WIN_2008_STANDARD "winServer2008Standard-32" +#define STR_OS_WIN_2008_STANDARD_FULL "Windows Server 2008 Standard Edition" +#define STR_OS_WIN_2008_STANDARD_CORE "winServer2008StandardCore-32" +#define STR_OS_WIN_2008_STANDARD_CORE_FULL "Windows Server 2008 Standard Edition (core installation)" +#define STR_OS_WIN_2008_WEB_SERVER "winServer2008Web-32" +#define STR_OS_WIN_2008_WEB_SERVER_FULL "Windows Server 2008 Web Server Edition" +#define STR_OS_WIN_VISTA_ULTIMATE_X64 "winVistaUltimate-64" +#define STR_OS_WIN_VISTA_HOME_PREMIUM_X64 "winVistaHomePremium-64" +#define STR_OS_WIN_VISTA_HOME_BASIC_X64 "winVistaHomeBasic-64" +#define STR_OS_WIN_VISTA_ENTERPRISE_X64 "winVistaEnterprise-64" +#define STR_OS_WIN_VISTA_BUSINESS_X64 "winVistaBusiness-64" +#define STR_OS_WIN_VISTA_STARTER_X64 "winVistaStarter-64" +#define STR_OS_WIN_2008_CLUSTER_X64 "winServer2008Cluster-64" +#define STR_OS_WIN_2008_DATACENTER_X64 "winServer2008Datacenter-64" +#define STR_OS_WIN_2008_DATACENTER_CORE_X64 "winServer2008DatacenterCore-64" +#define STR_OS_WIN_2008_ENTERPRISE_X64 "winServer2008Enterprise-64" +#define STR_OS_WIN_2008_ENTERPRISE_CORE_X64 "winServer2008EnterpriseCore-64" +#define STR_OS_WIN_2008_ENTERPRISE_ITANIUM_X64 "winServer2008EnterpriseItanium-64" +#define STR_OS_WIN_2008_SMALL_BUSINESS_X64 "winServer2008SmallBusiness-64" +#define STR_OS_WIN_2008_SMALL_BUSINESS_PREMIUM_X64 "winServer2008SmallBusinessPremium-64" +#define STR_OS_WIN_2008_STANDARD_X64 "winServer2008Standard-64" +#define STR_OS_WIN_2008_STANDARD_CORE_X64 "winServer2008StandardCore-64" +#define STR_OS_WIN_2008_WEB_SERVER_X64 "winServer2008Web-64" + +/* Modifiers for Windows Vista and Windows Server 2008 */ +#define STR_OS_WIN_32_BIT_EXTENSION ", 32-bit" +#define STR_OS_WIN_64_BIT_EXTENSION ", 64-bit" + +/* FreeBSD */ +#define STR_OS_FREEBSD "FreeBSD" + +/* Solaris */ +#define STR_OS_SOLARIS "Solaris" + +/* All */ +#define STR_OS_64BIT_SUFFIX "-64" +#define STR_OS_64BIT_SUFFIX_FULL " (64 bit)" +#define STR_OS_EMPTY "" + #endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/guestStats.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/guestStats.h --- open-vm-tools-2008.01.23-74039/lib/include/guestStats.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/guestStats.h 2008-10-13 08:01:50.000000000 +0100 @@ -0,0 +1,71 @@ +/********************************************************* + * Copyright (C) 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. + * + *********************************************************/ + +/* + * 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" + +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 memFree; /* Physical memory available in Kb. */ + uint64 memBuff; /* Physical memory used as buffer cache in Kb. */ + uint64 memCache; /* Physical memory used as cache in Kb. */ + uint64 memActive; /* Physical memory actively in use in Kb (working set) */ + uint64 memInactive; /* Physical memory inactive in Kb (cold pages) */ + uint64 swapInRate; /* Memory swapped out in Kb / sec. */ + uint64 swapOutRate; /* Memory swapped out in Kb / sec. */ + uint64 ioInRate; /* Amount of I/O in Kb / sec. */ + uint64 ioOutRate; /* Amount of I/O out in Kb / sec. */ + uint64 hugePagesTotal; /* Total number of huge pages. */ + uint64 hugePagesFree; /* Available number of huge pages. */ + uint64 memPinned; /* Unreclaimable physical memory in 4K page size. */ +} +#include "vmware_pack_end.h" +GuestMemInfo; + +/* Flags for GuestMemInfo. */ +#define MEMINFO_MEMTOTAL (1 << 0) +#define MEMINFO_MEMFREE (1 << 1) +#define MEMINFO_MEMBUFF (1 << 2) +#define MEMINFO_MEMCACHE (1 << 3) +#define MEMINFO_MEMACTIVE (1 << 4) +#define MEMINFO_MEMINACTIVE (1 << 5) +#define MEMINFO_SWAPINRATE (1 << 6) +#define MEMINFO_SWAPOUTRATE (1 << 7) +#define MEMINFO_IOINRATE (1 << 8) +#define MEMINFO_IOOUTRATE (1 << 9) +#define MEMINFO_HUGEPAGESTOTAL (1 << 10) +#define MEMINFO_HUGEPAGESFREE (1 << 11) +#define MEMINFO_MEMPINNED (1 << 12) + +#endif // _GUEST_STATS_H_ + diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/hash.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/hash.h --- open-vm-tools-2008.01.23-74039/lib/include/hash.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/hash.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,77 +0,0 @@ -/********************************************************* - * Copyright (C) 2004 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 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. - * - *********************************************************/ - -/* - * hash.h -- - * - * Hash table. - */ - -#ifndef _HASH_H_ -#define _HASH_H_ - -#define INCLUDE_ALLOW_USERLEVEL -#define INCLUDE_ALLOW_VMCORE -#include "includeCheck.h" - - -typedef struct HashTable HashTable; -typedef void (*HashFreeEntryFn)(void *clientData); -typedef int (*HashForEachCallback)(const char *key, void *value, void *clientData); - -#define HASH_STRING_KEY 0 // case-sensitive string key -#define HASH_ISTRING_KEY 1 // case-insensitive string key -#define HASH_INT_KEY 2 // uintptr_t or pointer key - -HashTable * -Hash_Alloc(uint32 numEntries, int keyType, HashFreeEntryFn fn); - -void -Hash_Free(HashTable *hashTable); - -Bool -Hash_Insert(HashTable *hashTable, - const char *keyStr, - void *clientData); - -Bool -Hash_Lookup(HashTable *hashTable, - const char *keyStr, - void **clientData); - -Bool -Hash_Delete(HashTable *hashTable, - const char *keyStr); - -void -Hash_Clear(HashTable *ht); - -void -Hash_ToArray(const HashTable *ht, - void ***clientDatas, - size_t *size); - -size_t -Hash_GetNumElements(const HashTable *ht); - -int -Hash_ForEach(const HashTable *ht, - HashForEachCallback cb, - void *clientData); - -#endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/hashTable.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/hashTable.h --- open-vm-tools-2008.01.23-74039/lib/include/hashTable.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/hashTable.h 2008-10-13 08:01:49.000000000 +0100 @@ -0,0 +1,111 @@ +/********************************************************* + * Copyright (C) 2004 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. + * + *********************************************************/ + +/* + * hashTable.h -- + * + * Hash table. + */ + +#ifndef _HASH_TABLE_H_ +#define _HASH_TABLE_H_ + +#define INCLUDE_ALLOW_MODULE +#define INCLUDE_ALLOW_USERLEVEL +#define INCLUDE_ALLOW_VMCORE +#include "includeCheck.h" + +#include "vm_atomic.h" + + +typedef struct HashTable HashTable; +typedef void (*HashTableFreeEntryFn)(void *clientData); +typedef int (*HashTableForEachCallback)(const char *key, void *value, + void *clientData); + +#define HASH_STRING_KEY 0 // case-sensitive string key +#define HASH_ISTRING_KEY 1 // case-insensitive string key +#define HASH_INT_KEY 2 // uintptr_t or pointer key + +/* + * The flag bits are ored into the type field. + * Atomic hash tables only support insert, lookup, and replace. + */ + +#define HASH_TYPE_MASK 7 +#define HASH_FLAG_MASK (~HASH_TYPE_MASK) +#define HASH_FLAG_ATOMIC 0x08 // thread-safe hash table +#define HASH_FLAG_COPYKEY 0x10 // copy string key + +HashTable * +HashTable_Alloc(uint32 numEntries, int keyType, HashTableFreeEntryFn fn); + +HashTable * +HashTable_AllocOnce(Atomic_Ptr *var, uint32 numEntries, int keyType, + HashTableFreeEntryFn fn); + +void +HashTable_Free(HashTable *hashTable); + +Bool +HashTable_Insert(HashTable *hashTable, + const char *keyStr, + void *clientData); + +Bool +HashTable_Lookup(HashTable *hashTable, + const char *keyStr, + void **clientData); + +void * +HashTable_LookupOrInsert(HashTable *hashTable, + const char *keyStr, + void *clientData); + +Bool +HashTable_ReplaceOrInsert(HashTable *hashTable, + const char *keyStr, + void *clientData); + +Bool +HashTable_ReplaceIfEqual(HashTable *hashTable, + const char *keyStr, + void *oldClientData, + void *newClientData); + +Bool +HashTable_Delete(HashTable *hashTable, + const char *keyStr); + +void +HashTable_Clear(HashTable *ht); + +void +HashTable_ToArray(const HashTable *ht, + void ***clientDatas, + size_t *size); + +size_t +HashTable_GetNumElements(const HashTable *ht); + +int +HashTable_ForEach(const HashTable *ht, + HashTableForEachCallback cb, + void *clientData); + +#endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/hgfsBd.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/hgfsBd.h --- open-vm-tools-2008.01.23-74039/lib/include/hgfsBd.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/hgfsBd.h 2008-10-13 08:01:49.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -29,6 +29,8 @@ char *HgfsBd_GetBuf(void); +char *HgfsBd_GetLargeBuf(void); + void HgfsBd_PutBuf(char *); RpcOut *HgfsBd_GetChannel(void); diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/hgfsDevLinux.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/hgfsDevLinux.h --- open-vm-tools-2008.01.23-74039/lib/include/hgfsDevLinux.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/hgfsDevLinux.h 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/hgfs.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/hgfs.h --- open-vm-tools-2008.01.23-74039/lib/include/hgfs.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/hgfs.h 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -39,6 +39,11 @@ #include "includeCheck.h" #include "vm_assert.h" +/* + * Maximum number of pages to transfer to/from the HGFS server for V3 protocol + * operations that support large requests/replies, e.g. reads and writes. + */ +#define HGFS_LARGE_IO_MAX_PAGES 15 /* * Maximum allowed packet size in bytes. All hgfs code should be made @@ -46,6 +51,19 @@ */ #define HGFS_PACKET_MAX 6144 +/* + * The HGFS_LARGE_PACKET_MAX size is used to allow guests to make + * read / write requests of sizes larger than HGFS_PACKET_MAX. The larger size + * can only be used with server operations that are specified to be large packet + * capable in hgfsProto.h. + */ +#define HGFS_LARGE_PACKET_MAX ((4096 * HGFS_LARGE_IO_MAX_PAGES) + 2048) + +/* Maximum number of bytes to read or write to a hgfs server in a single packet. */ +#define HGFS_IO_MAX 4096 + +/* Maximum number of bytes to read or write to a V3 server in a single hgfs packet. */ +#define HGFS_LARGE_IO_MAX (HGFS_LARGE_IO_MAX_PAGES * 4096) /* * Open mode @@ -113,8 +131,8 @@ * error codes travelled from hgfsProto.h to hgfs.h in that same change. Worse, * we GA'ed a product (Server 1.0) this way. * - * XXX: I've reversed the order because otherwise new HGFS clients working - * against WS55-era HGFS servers will think they got HGFS_STATUS_GENERIC_ERROR + * XXX: I've reversed the order because otherwise new HGFS clients working + * against WS55-era HGFS servers will think they got HGFS_STATUS_GENERIC_ERROR * when the server sent them HGFS_STATUS_INVALID_NAME. This was a problem * the Linux client converts HGFS_STATUS_GENERIC_ERROR to -EIO, which causes * HgfsLookup to fail unexpectedly (normally HGFS_STATUS_INVALID_NAME is @@ -136,6 +154,7 @@ HGFS_STATUS_NO_SPACE, HGFS_STATUS_OPERATION_NOT_SUPPORTED, HGFS_STATUS_NAME_TOO_LONG, + HGFS_STATUS_INVALID_PARAMETER, } HgfsStatus; /* @@ -150,9 +169,9 @@ * the command and the space into some buffer that is then sent over the * backdoor. * - * In Host --> Guest RPC traffic, the host endpoint is TCLO and the guest - * endpoint is RpcIn. TCLO is a particularly confusing name choice which dates - * back to when the host was to send raw TCL code to the guest (TCL Out == + * In Host --> Guest RPC traffic, the host endpoint is TCLO and the guest + * endpoint is RpcIn. TCLO is a particularly confusing name choice which dates + * back to when the host was to send raw TCL code to the guest (TCL Out == * TCLO). * * In Guest --> Host RPC traffic, the guest endpoint is RpcOut and the host @@ -161,11 +180,11 @@ /* * When an RPCI listener registers for this command, HGFS requests are expected - * to be synchronously sent from the guest and replies are expected to be + * to be synchronously sent from the guest and replies are expected to be * synchronously returned. - * - * When an RpcIn listener registers for this command, requests are expected to - * be asynchronously sent from the host and synchronously returned from the + * + * When an RpcIn listener registers for this command, requests are expected to + * be asynchronously sent from the host and synchronously returned from the * guest. * * In short, an endpoint sending this command is sending a request whose reply @@ -176,41 +195,6 @@ #define HGFS_SYNC_REQREP_CLIENT_CMD_LEN (sizeof HGFS_SYNC_REQREP_CLIENT_CMD - 1) /* - * When an RPCI listener registers for this command, HGFS requests are expected - * to be synchronously sent from the guest and replies are expected to be - * asynchronously returned. - * - * When an RpcIn listener registers for this command, requests are expected to - * be asynchronously sent from the host and asynchronously returned from the - * guest. - * - * In short, an endpoint sending this command is sending a request whose reply - * should be returned asynchronously. - */ -#define HGFS_ASYNC_REQUEST_CMD "g" -#define HGFS_ASYNC_REQUEST_CLIENT_CMD HGFS_ASYNC_REQUEST_CMD " " -#define HGFS_ASYNC_REQUEST_CLIENT_CMD_LEN (sizeof HGFS_ASYNC_REQUEST_CLIENT_CMD - 1) - -/* - * An endpoint sending this command is sending an asynchronous HGFS reply to a - * request sent by the HGFS_ASYNC_REQUEST command. - */ -#define HGFS_ASYNC_REPLY_CMD "h" -#define HGFS_ASYNC_REPLY_CLIENT_CMD HGFS_ASYNC_REPLY_CMD " " -#define HGFS_ASYNC_REPLY_CLIENT_CMD_LEN (sizeof HGFS_ASYNC_REPLY_CLIENT_CMD - 1) - -/* - * Ensuring that all commands are the same length eases the implementation of - * HGFS client code. - */ -MY_ASSERTS(HGFS_CMD_LENGTHS, - ASSERT_ON_COMPILE(HGFS_SYNC_REQREP_CLIENT_CMD_LEN == - HGFS_ASYNC_REQUEST_CLIENT_CMD_LEN); - ASSERT_ON_COMPILE(HGFS_ASYNC_REQUEST_CLIENT_CMD_LEN == - HGFS_ASYNC_REPLY_CLIENT_CMD_LEN); -) - -/* * This is just for the sake of macro naming. Since we are guaranteed * equal command lengths, defining command length via a generalized macro name * will prevent confusion. diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/hgfsProto.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/hgfsProto.h --- open-vm-tools-2008.01.23-74039/lib/include/hgfsProto.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/hgfsProto.h 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -66,12 +66,12 @@ HGFS_OP_DELETE_DIR, /* Delete a directory */ HGFS_OP_RENAME, /* Rename a file or directory */ HGFS_OP_QUERY_VOLUME_INFO, /* Query volume information */ - + /* * The following operations are only available in version 2 of the hgfs - * protocol. The corresponding version 1 opcodes above are deprecated. + * protocol. The corresponding version 1 opcodes above are deprecated. */ - + HGFS_OP_OPEN_V2, /* Open file */ HGFS_OP_GETATTR_V2, /* Get file attributes */ HGFS_OP_SETATTR_V2, /* Set file attributes */ @@ -79,14 +79,48 @@ HGFS_OP_CREATE_SYMLINK, /* Create a symlink */ HGFS_OP_SERVER_LOCK_CHANGE, /* Change the oplock on a file */ HGFS_OP_CREATE_DIR_V2, /* Create a directory */ - HGFS_OP_DELETE_FILE_V2, /* Delete a file */ - HGFS_OP_DELETE_DIR_V2, /* Delete a directory */ - HGFS_OP_RENAME_V2, /* Rename a file or directory */ - - HGFS_OP_MAX, /* Dummy op, must be last in enum */ + HGFS_OP_DELETE_FILE_V2, /* Delete a file */ + HGFS_OP_DELETE_DIR_V2, /* Delete a directory */ + HGFS_OP_RENAME_V2, /* Rename a file or directory */ + + /* + * Operations for version 3, deprecating version 2 operations. + */ + + HGFS_OP_OPEN_V3, /* Open file */ + HGFS_OP_READ_V3, /* Read from file */ + HGFS_OP_WRITE_V3, /* Write to file */ + HGFS_OP_CLOSE_V3, /* Close file */ + HGFS_OP_SEARCH_OPEN_V3, /* Start new search */ + HGFS_OP_SEARCH_READ_V3, /* Start new search */ + HGFS_OP_SEARCH_CLOSE_V3, /* End a search */ + HGFS_OP_GETATTR_V3, /* Get file attributes */ + HGFS_OP_SETATTR_V3, /* Set file attributes */ + HGFS_OP_CREATE_DIR_V3, /* Create new directory */ + HGFS_OP_DELETE_FILE_V3, /* Delete a file */ + HGFS_OP_DELETE_DIR_V3, /* Delete a directory */ + HGFS_OP_RENAME_V3, /* Rename a file or directory */ + HGFS_OP_QUERY_VOLUME_INFO_V3, /* Query volume information */ + HGFS_OP_CREATE_SYMLINK_V3, /* Create a symlink */ + HGFS_OP_SERVER_LOCK_CHANGE_V3, /* Change the oplock on a file */ + + HGFS_OP_MAX, /* Dummy op, must be last in enum */ } HgfsOp; +/* HGFS protocol versions. */ +#define HGFS_VERSION_OLD (1 << 0) +#define HGFS_VERSION_3 (1 << 1) + +/* XXX: Needs change when VMCI is supported. */ +#define HGFS_REQ_PAYLOAD_SIZE_V3(hgfsReq) (sizeof *hgfsReq + sizeof(HgfsRequest)) +#define HGFS_REP_PAYLOAD_SIZE_V3(hgfsRep) (sizeof *hgfsRep + sizeof(HgfsReply)) + +/* XXX: Needs change when VMCI is supported. */ +#define HGFS_REQ_GET_PAYLOAD_V3(hgfsReq) ((char *)(hgfsReq) + sizeof(HgfsRequest)) +#define HGFS_REP_GET_PAYLOAD_V3(hgfsRep) ((char *)(hgfsRep) + sizeof(HgfsReply)) + + /* * File types, used in HgfsAttr. We support regular files, * directories, and symlinks. @@ -150,10 +184,10 @@ * * The client can ask the server to acquire opportunistic locking/leasing * from the host FS on its behalf. This is communicated as part of an open request. - * + * * HGFS_LOCK_OPPORTUNISTIC means that the client trusts the server * to decide what kind of locking to request from the host FS. - * All other values tell the server explicitly the type of lock to + * All other values tell the server explicitly the type of lock to * request. * * The server will attempt to acquire the desired lock and will notify the client @@ -189,9 +223,9 @@ /* - * Hints to indicate in a getattr or setattr which attributes + * Hints to indicate in a getattr or setattr which attributes * are valid for the request. - * For setattr only, attributes should be set by host even if + * For setattr only, attributes should be set by host even if * no valid values are specified by the guest. */ @@ -202,7 +236,7 @@ #define HGFS_ATTR_HINT_USE_FILE_DESC (1 << 2) /* - * Hint to determine using a name or a handle to determine + * Hint to determine using a name or a handle to determine * what to delete. */ @@ -211,7 +245,7 @@ #define HGFS_DELETE_HINT_USE_FILE_DESC (1 << 0) /* - * Hint to determine using a name or a handle to determine + * Hint to determine using a name or a handle to determine * what to renames. */ @@ -229,7 +263,7 @@ * units of 100ns since Jan 1, 1601, UTC. */ -/* +/* * Version 1 attributes. Deprecated. * Version 2 should be using HgfsAttrV2. */ @@ -252,14 +286,15 @@ /* Various flags and Windows attributes. */ -typedef uint64 HgfsAttrFlags; +typedef uint64 HgfsAttrFlags; #define HGFS_ATTR_HIDDEN (1 << 0) #define HGFS_ATTR_SYSTEM (1 << 1) #define HGFS_ATTR_ARCHIVE (1 << 2) +#define HGFS_ATTR_HIDDEN_FORCED (1 << 3) -/* +/* * Specifies which open request fields contain * valid values. */ @@ -268,7 +303,7 @@ #define HGFS_OPEN_VALID_NONE 0 #define HGFS_OPEN_VALID_MODE (1 << 0) -#define HGFS_OPEN_VALID_FLAGS (1 << 1) +#define HGFS_OPEN_VALID_FLAGS (1 << 1) #define HGFS_OPEN_VALID_SPECIAL_PERMS (1 << 2) #define HGFS_OPEN_VALID_OWNER_PERMS (1 << 3) #define HGFS_OPEN_VALID_GROUP_PERMS (1 << 4) @@ -281,7 +316,7 @@ #define HGFS_OPEN_VALID_FILE_NAME (1 << 11) -/* +/* * Specifies which attribute fields contain * valid values. */ @@ -301,12 +336,29 @@ #define HGFS_ATTR_VALID_OTHER_PERMS (1 << 9) #define HGFS_ATTR_VALID_FLAGS (1 << 10) #define HGFS_ATTR_VALID_ALLOCATION_SIZE (1 << 11) -#define HGFS_ATTR_VALID_USERID (1 << 12) +#define HGFS_ATTR_VALID_USERID (1 << 12) #define HGFS_ATTR_VALID_GROUPID (1 << 13) #define HGFS_ATTR_VALID_FILEID (1 << 14) - - +#define HGFS_ATTR_VALID_VOLID (1 << 15) /* + * Add our file and volume identifiers. + * NOTE: On Windows hosts, the file identifier is not guaranteed to be valid + * particularly with FAT. A defrag operation could cause it to change. + * Therefore, to not confuse older clients, and non-Windows + * clients we have added a separate flag. + * The Windows client will check for both flags for the + * file ID, and return the information to the guest application. + * However, it will use the ID internally, when it has an open + * handle on the server. + * Non-Windows clients need the file ID to be always guaranteed, + * which is to say, that the ID remains constant over the course of the + * file's lifetime, and will use the HGFS_ATTR_VALID_FILEID flag + * only to determine if the ID is valid. + */ +#define HGFS_ATTR_VALID_NON_STATIC_FILEID (1 << 16) + + +/* * Specifies which create dir request fields contain * valid values. */ @@ -320,12 +372,12 @@ #define HGFS_CREATE_DIR_VALID_OTHER_PERMS (1 << 3) #define HGFS_CREATE_DIR_VALID_FILE_NAME (1 << 4) -/* +/* * Version 2 of HgfsAttr */ -typedef -#include "vmware_pack_begin.h" +typedef +#include "vmware_pack_begin.h" struct HgfsAttrV2 { HgfsAttrValid mask; /* A bit mask to determine valid attribute fields */ HgfsFileType type; /* File type */ @@ -335,23 +387,24 @@ uint64 writeTime; /* Time of last write */ uint64 attrChangeTime; /* Time file attributes were last * changed. Ignored by Windows */ - HgfsPermissions specialPerms; /* Special permissions bits (suid, etc.). + HgfsPermissions specialPerms; /* Special permissions bits (suid, etc.). * Ignored by Windows */ HgfsPermissions ownerPerms; /* Owner permissions bits */ - HgfsPermissions groupPerms; /* Group permissions bits. Ignored by + HgfsPermissions groupPerms; /* Group permissions bits. Ignored by * Windows */ - HgfsPermissions otherPerms; /* Other permissions bits. Ignored by + 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 */ - uint64 reserved1; /* Reserved for future use */ + uint32 volumeId; /* volume identifier, non-zero is valid. */ + uint32 reserved1; /* Reserved for future use */ uint64 reserved2; /* Reserved for future use */ -} -#include "vmware_pack_end.h" -HgfsAttrV2; +} +#include "vmware_pack_end.h" +HgfsAttrV2; /* @@ -382,16 +435,16 @@ * SEARCH_OPEN. * * In the current HGFS server implementation, each request has a minimum packet - * size that must be met for it to be considered valid. This minimum is simply + * size that must be met for it to be considered valid. This minimum is simply * the sizeof the particular request, which includes the solitary byte from the * HgfsFileName struct. For these particular requests, clients add an extra * byte to their payload size, without that byte being present anywhere. * * It isn't clear that this behavior is correct, but the end result is that - * neither end malfunctions, as an extra byte gets sent by the client and is + * neither end malfunctions, as an extra byte gets sent by the client and is * ignored by the server. Unfortunately, it cannot be easily fixed. The * server's minimum packet size can be changed, but the client should continue - * to send an extra byte, otherwise older servers with a slightly longer + * to send an extra byte, otherwise older servers with a slightly longer * minimum packet size may consider the new client's packets to be too short. * * UTF-8 representation @@ -410,11 +463,11 @@ * * Precomposed (normal form C) versus Decomposed (normal form D) * ------------------------------------------------------------- - * Certain Unicode characters can be encoded in more than one way. - * For example, an Á (A acute) can be encoded either precomposed, - * as U+00C1 (LATIN CAPITAL LETTER A WITH ACUTE), or decomposed, + * Certain Unicode characters can be encoded in more than one way. + * For example, an (A acute) can be encoded either precomposed, + * as U+00C1 (LATIN CAPITAL LETTER A WITH ACUTE), or decomposed, * as U+0041 U+0301 (LATIN CAPITAL LETTER A followed by a COMBINING ACUTE ACCENT). - * Precomposed characters are more common in the Windows world, + * Precomposed characters are more common in the Windows world, * whereas decomposed characters are more common on the Mac. * * See UAX 15 (http://unicode.org/reports/tr15/) @@ -431,6 +484,43 @@ /* + * Case-sensitiviy flags are only used when any lookup is + * involved on the server side. + */ + +typedef enum { + HGFS_FILE_NAME_DEFAULT_CASE, + HGFS_FILE_NAME_CASE_SENSITIVE, + HGFS_FILE_NAME_CASE_INSENSITIVE, +} HgfsCaseType; + + +/* + * HgfsFileNameV3 - new header to incorporate case-sensitivity flags along with + * Hgfs file handle. + */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsFileNameV3 { + uint32 length; /* Does NOT include terminating NUL */ + uint32 flags; /* Flags described below. */ + HgfsCaseType caseType; /* Case-sensitivity type. */ + HgfsHandle fid; + char name[1]; +} +#include "vmware_pack_end.h" +HgfsFileNameV3; + + +/* + * HgfsFileNameV3 flags. Case-sensitiviy flags are only used when any lookup is + * involved on the server side. + */ +#define HGFS_FILE_NAME_USE_FILE_DESC (1 << 0) /* Case type ignored if set. */ + + +/* * Request/reply structs. These are the first members of all * operation request and reply messages, respectively. */ @@ -478,26 +568,51 @@ typedef #include "vmware_pack_begin.h" -struct HgfsRequestOpenV2 { - HgfsRequest header; +struct HgfsRequestOpenV2 { + HgfsRequest header; 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 */ + 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 */ HgfsServerLock desiredLock; /* The type of lock desired by the client */ uint64 reserved1; /* Reserved for future use */ uint64 reserved2; /* Reserved for future use */ - HgfsFileName fileName; -} -#include "vmware_pack_end.h" -HgfsRequestOpenV2; + HgfsFileName fileName; +} +#include "vmware_pack_end.h" +HgfsRequestOpenV2; + + +/* Version 3 of HgfsRequestOpen */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestOpenV3 { + 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 */ + HgfsServerLock desiredLock; /* The type of lock desired by the client */ + uint64 reserved1; /* Reserved for future use */ + uint64 reserved2; /* Reserved for future use */ + HgfsFileNameV3 fileName; +} +#include "vmware_pack_end.h" +HgfsRequestOpenV3; /* Deprecated */ @@ -525,6 +640,21 @@ HgfsReplyOpenV2; +/* Version 3 of HgfsReplyOpen */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsReplyOpenV3 { + HgfsHandle file; /* Opaque file ID used by the server */ + HgfsServerLock acquiredLock; /* The type of lock acquired by the server */ + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsReplyOpenV3; + + +/* Deprecated */ + typedef #include "vmware_pack_begin.h" struct HgfsRequestRead { @@ -536,6 +666,7 @@ #include "vmware_pack_end.h" HgfsRequestRead; +/* Deprecated */ typedef #include "vmware_pack_begin.h" @@ -548,6 +679,35 @@ HgfsReplyRead; +/* + * Version 3 of HgfsRequestRead. + * Server must support HGFS_LARGE_PACKET_MAX to implement this op. + */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestReadV3 { + HgfsHandle file; /* Opaque file ID used by the server */ + uint64 offset; + uint32 requiredSize; + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsRequestReadV3; + +typedef +#include "vmware_pack_begin.h" +struct HgfsReplyReadV3 { + uint32 actualSize; + uint64 reserved; /* Reserved for future use */ + char payload[1]; +} +#include "vmware_pack_end.h" +HgfsReplyReadV3; + + +/* Deprecated */ + typedef #include "vmware_pack_begin.h" struct HgfsRequestWrite { @@ -562,6 +722,8 @@ HgfsRequestWrite; +/* Deprecated */ + typedef #include "vmware_pack_begin.h" struct HgfsReplyWrite { @@ -571,6 +733,36 @@ #include "vmware_pack_end.h" HgfsReplyWrite; +/* + * Version 3 of HgfsRequestWrite. + * Server must support HGFS_LARGE_PACKET_MAX to implement this op. + */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestWriteV3 { + HgfsHandle file; /* Opaque file ID used by the server */ + HgfsWriteFlags flags; + uint64 offset; + uint32 requiredSize; + uint64 reserved; /* Reserved for future use */ + char payload[1]; +} +#include "vmware_pack_end.h" +HgfsRequestWriteV3; + + +typedef +#include "vmware_pack_begin.h" +struct HgfsReplyWriteV3 { + uint32 actualSize; + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsReplyWriteV3; + + +/* Deprecated */ typedef #include "vmware_pack_begin.h" @@ -582,6 +774,8 @@ HgfsRequestClose; +/* Deprecated */ + typedef #include "vmware_pack_begin.h" struct HgfsReplyClose { @@ -593,6 +787,27 @@ typedef #include "vmware_pack_begin.h" +struct HgfsRequestCloseV3 { + HgfsHandle file; /* Opaque file ID used by the server */ + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsRequestCloseV3; + + +typedef +#include "vmware_pack_begin.h" +struct HgfsReplyCloseV3 { + uint64 reserved; +} +#include "vmware_pack_end.h" +HgfsReplyCloseV3; + + +/* Deprecated */ + +typedef +#include "vmware_pack_begin.h" struct HgfsRequestSearchOpen { HgfsRequest header; HgfsFileName dirName; @@ -603,6 +818,18 @@ typedef #include "vmware_pack_begin.h" +struct HgfsRequestSearchOpenV3 { + uint64 reserved; /* Reserved for future use */ + HgfsFileNameV3 dirName; +} +#include "vmware_pack_end.h" +HgfsRequestSearchOpenV3; + + +/* Deprecated */ + +typedef +#include "vmware_pack_begin.h" struct HgfsReplySearchOpen { HgfsReply header; HgfsHandle search; /* Opaque search ID used by the server */ @@ -611,6 +838,16 @@ HgfsReplySearchOpen; +typedef +#include "vmware_pack_begin.h" +struct HgfsReplySearchOpenV3 { + HgfsHandle search; /* Opaque search ID used by the server */ + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsReplySearchOpenV3; + + /* Deprecated */ typedef @@ -636,6 +873,17 @@ #include "vmware_pack_end.h" HgfsRequestSearchReadV2; +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestSearchReadV3 { + HgfsHandle search; /* Opaque search ID used by the server */ + uint32 offset; /* The first result is offset 0 */ + uint32 flags; /* Reserved for reading multiple directory entries. */ + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsRequestSearchReadV3; + /* Deprecated */ @@ -655,20 +903,47 @@ typedef #include "vmware_pack_begin.h" -struct HgfsReplySearchReadV2 { - HgfsReply header; +struct HgfsReplySearchReadV2 { + HgfsReply header; HgfsAttrV2 attr; - - /* - * fileName.length = 0 means "no entry at this offset" + + /* + * fileName.length = 0 means "no entry at this offset" * If the file is a symlink (as specified in attr) * this name is the name of the symlink, not the target. - */ - HgfsFileName fileName; -} -#include "vmware_pack_end.h" -HgfsReplySearchReadV2; + */ + HgfsFileName fileName; +} +#include "vmware_pack_end.h" +HgfsReplySearchReadV2; + +/* Directory entry structure. */ + +typedef struct HgfsDirEntry { + uint32 nextEntry; + HgfsAttrV2 attr; + + /* + * fileName.length = 0 means "no entry at this offset" + * If the file is a symlink (as specified in attr) + * this name is the name of the symlink, not the target. + */ + HgfsFileNameV3 fileName; +} HgfsDirEntry; + +typedef +#include "vmware_pack_begin.h" +struct HgfsReplySearchReadV3 { + uint64 count; /* Number of directory entries. */ + uint64 reserved; /* Reserved for future use. */ + char payload[1]; /* Directory entries. */ +} +#include "vmware_pack_end.h" +HgfsReplySearchReadV3; + + +/* Deprecated */ typedef #include "vmware_pack_begin.h" @@ -680,6 +955,8 @@ HgfsRequestSearchClose; +/* Deprecated */ + typedef #include "vmware_pack_begin.h" struct HgfsReplySearchClose { @@ -689,6 +966,25 @@ HgfsReplySearchClose; +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestSearchCloseV3 { + HgfsHandle search; /* Opaque search ID used by the server */ + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsRequestSearchCloseV3; + + +typedef +#include "vmware_pack_begin.h" +struct HgfsReplySearchCloseV3 { + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsReplySearchCloseV3; + + /* Deprecated */ typedef @@ -715,6 +1011,17 @@ HgfsRequestGetattrV2; +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestGetattrV3 { + HgfsAttrHint hints; /* Flags for file handle valid. */ + uint64 reserved; /* Reserved for future use */ + HgfsFileNameV3 fileName; /* Filename used when file handle invalid. */ +} +#include "vmware_pack_end.h" +HgfsRequestGetattrV3; + + /* Deprecated */ typedef @@ -734,10 +1041,10 @@ struct HgfsReplyGetattrV2 { HgfsReply header; HgfsAttrV2 attr; - + /* - * If the file is a symlink, as specified in attr.type, then this is - * the target for the symlink. If the file is not a symlink, this should + * If the file is a symlink, as specified in attr.type, then this is + * the target for the symlink. If the file is not a symlink, this should * be ignored. * * This filename is in "CPNameLite" format. See CPNameLite.c for details. @@ -748,6 +1055,25 @@ HgfsReplyGetattrV2; +typedef +#include "vmware_pack_begin.h" +struct HgfsReplyGetattrV3 { + HgfsAttrV2 attr; + + /* + * If the file is a symlink, as specified in attr.type, then this is + * the target for the symlink. If the file is not a symlink, this should + * be ignored. + * + * This filename is in "CPNameLite" format. See CPNameLite.c for details. + */ + uint64 reserved; /* Reserved for future use */ + HgfsFileNameV3 symlinkTarget; +} +#include "vmware_pack_end.h" +HgfsReplyGetattrV3; + + /* Deprecated */ typedef @@ -777,6 +1103,17 @@ HgfsRequestSetattrV2; +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestSetattrV3 { + HgfsAttrHint hints; + HgfsAttrV2 attr; + uint64 reserved; /* Reserved for future use */ + HgfsFileNameV3 fileName; /* Filename used when file handle invalid. */ +} +#include "vmware_pack_end.h" +HgfsRequestSetattrV3; + /* Deprecated */ typedef @@ -798,6 +1135,27 @@ #include "vmware_pack_end.h" HgfsReplySetattrV2; +typedef +#include "vmware_pack_begin.h" +struct HgfsReplySetattrV3 { + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsReplySetattrV3; + + +/* Deprecated */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestCreateDir { + HgfsRequest header; + HgfsPermissions permissions; + HgfsFileName fileName; +} +#include "vmware_pack_end.h" +HgfsRequestCreateDir; + /* Version 2 of HgfsRequestCreateDir */ @@ -816,17 +1174,32 @@ HgfsRequestCreateDirV2; +/* Version 3 of HgfsRequestCreateDir */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestCreateDirV3 { + HgfsCreateDirValid mask; + HgfsPermissions specialPerms; + HgfsPermissions ownerPerms; + HgfsPermissions groupPerms; + HgfsPermissions otherPerms; + uint64 reserved; /* Reserved for future use */ + HgfsFileNameV3 fileName; +} +#include "vmware_pack_end.h" +HgfsRequestCreateDirV3; + + /* Deprecated */ typedef #include "vmware_pack_begin.h" -struct HgfsRequestCreateDir { - HgfsRequest header; - HgfsPermissions permissions; - HgfsFileName fileName; +struct HgfsReplyCreateDir { + HgfsReply header; } #include "vmware_pack_end.h" -HgfsRequestCreateDir; +HgfsReplyCreateDir; /* Version 2 of HgfsReplyCreateDir */ @@ -840,16 +1213,18 @@ HgfsReplyCreateDirV2; -/* Deprecated */ +/* Version 3 of HgfsReplyCreateDir */ typedef #include "vmware_pack_begin.h" -struct HgfsReplyCreateDir { - HgfsReply header; +struct HgfsReplyCreateDirV3 { + uint64 reserved; /* Reserved for future use */ } #include "vmware_pack_end.h" -HgfsReplyCreateDir; +HgfsReplyCreateDirV3; + +/* Deprecated */ typedef #include "vmware_pack_begin.h" @@ -860,6 +1235,9 @@ #include "vmware_pack_end.h" HgfsRequestDelete; + +/* Version 2 of HgfsRequestDelete */ + typedef #include "vmware_pack_begin.h" struct HgfsRequestDeleteV2 { @@ -871,6 +1249,22 @@ #include "vmware_pack_end.h" HgfsRequestDeleteV2; + +/* Version 3 of HgfsRequestDelete */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestDeleteV3 { + HgfsDeleteHint hints; + uint64 reserved; /* Reserved for future use */ + HgfsFileNameV3 fileName; /* Name used if the file is HGFS_HANDLE_INVALID */ +} +#include "vmware_pack_end.h" +HgfsRequestDeleteV3; + + +/* Deprecated */ + typedef #include "vmware_pack_begin.h" struct HgfsReplyDelete { @@ -889,6 +1283,18 @@ #include "vmware_pack_end.h" HgfsReplyDeleteV2; + +/* Version 2 of HgfsReplyDelete */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsReplyDeleteV3 { + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsReplyDeleteV3; + + /* * The size of the HgfsFileName struct is variable depending on the * length of the name, so you can't use request->newName to get the @@ -942,6 +1348,29 @@ HgfsReplyRenameV2; +/* HgfsRequestRename and HgfsReplyRename for v3. */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestRenameV3 { + HgfsRenameHint hints; + uint64 reserved; /* Reserved for future use */ + HgfsFileNameV3 oldName; + HgfsFileNameV3 newName; +} +#include "vmware_pack_end.h" +HgfsRequestRenameV3; + + +typedef +#include "vmware_pack_begin.h" +struct HgfsReplyRenameV3 { + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsReplyRenameV3; + + typedef #include "vmware_pack_begin.h" struct HgfsRequestQueryVolume { @@ -963,6 +1392,30 @@ HgfsReplyQueryVolume; +/* HgfsRequestQueryVolume and HgfsReplyQueryVolume for v3. */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestQueryVolumeV3 { + uint64 reserved; /* Reserved for future use */ + HgfsFileNameV3 fileName; +} +#include "vmware_pack_end.h" +HgfsRequestQueryVolumeV3; + + +typedef +#include "vmware_pack_begin.h" +struct HgfsReplyQueryVolumeV3 { + uint64 freeBytes; + uint64 totalBytes; + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsReplyQueryVolumeV3; + + + /* New operations for Version 2 */ typedef @@ -1008,4 +1461,28 @@ HgfsReplySymlinkCreate; +/* HgfsRequestSymlinkCreate and HgfsReplySymlinkCreate for v3. */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestSymlinkCreateV3 { + uint64 reserved; /* Reserved for future use */ + HgfsFileNameV3 symlinkName; + + /* This filename is in "CPNameLite" format. See CPNameLite.c for details. */ + HgfsFileNameV3 targetName; +} +#include "vmware_pack_end.h" +HgfsRequestSymlinkCreateV3; + + +typedef +#include "vmware_pack_begin.h" +struct HgfsReplySymlinkCreateV3 { + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsReplySymlinkCreateV3; + + #endif /* _HGFS_PROTO_H_ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/hgfsServer.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/hgfsServer.h --- open-vm-tools-2008.01.23-74039/lib/include/hgfsServer.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/hgfsServer.h 2008-10-13 08:01:49.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/hgfsServerInt.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/hgfsServerInt.h --- open-vm-tools-2008.01.23-74039/lib/include/hgfsServerInt.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/hgfsServerInt.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,637 +0,0 @@ -/********************************************************* - * Copyright (C) 1998 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 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. - * - *********************************************************/ - - -#ifndef __HGFS_SERVER_INT_H__ -# define __HGFS_SERVER_INT_H__ - -#include "vm_basic_types.h" - -/* - * Definitions of wrapped internal primitives. - * - * We wrap open file handles and directory entries so that cross-platform HGFS - * server code can use them without platform-specific pre-processing. - * - * On Linux, we use dirent64 from the kernel headers so as to alleviate any - * confusion between what the kernel will give us from the getdents64() - * syscall and what userspace will expect. Note that to avoid depending on - * kernel headers directly, I've copied the dirent struct, replacing certain - * kernel basic types with our own. - * - * On Windows, we define our own DirectoryEntry struct with d_reclen and - * d_name, as those are the only two fields we're interested in. It's not - * essential that it match the dirents from another platform, because we - * control how they get created and populated, and they never pass down a wire. - * - * Otherwise, we use the native dirent struct provided by the platform's libc, - * as nobody else seems to suffer from the 32-bit vs. 64-bit ino_t and off_t - * insanity that plagues Linux. - */ -#ifndef _WIN32 -# ifdef linux - typedef struct DirectoryEntry { - uint64 d_ino; - uint64 d_off; - uint16 d_reclen; - uint8 d_type; - int8 d_name[256]; - } DirectoryEntry; -# else -# include - typedef struct dirent DirectoryEntry; -# endif - typedef int fileDesc; -#else -# include - typedef HANDLE fileDesc; - typedef struct DirectoryEntry { - unsigned short d_reclen; /* The total length of this record. */ - char d_name[PATH_MAX * 4]; /* 4 bytes is the maximum size of a utf8 */ - /* representation of utf-16 encoded */ - /* unicode character in the BMP */ - } DirectoryEntry; -#endif - -#include "dbllnklst.h" -#include "hgfsProto.h" -#include "cpName.h" // for HgfsNameStatus -#include "hgfsServerPolicy.h" -#include "hgfsUtil.h" // for HgfsInternalStatus -#include "syncMutex.h" - -/* - * 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 - -/* Value of config option to require using host timestamps */ -EXTERN Bool alwaysUseHostTime; - -/* Identifier for a local file */ -typedef struct HgfsLocalId { - uint32 volumeId; - uint64 fileId; -} HgfsLocalId; - - -/* 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; - -/* 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 -# ifdef HGFS_OLDER_NT -# define HGFS_DEFAULT_SHARE_ACCESS (FILE_SHARE_READ | FILE_SHARE_WRITE) -# else -# define HGFS_DEFAULT_SHARE_ACCESS (FILE_SHARE_READ | FILE_SHARE_WRITE | \ - FILE_SHARE_DELETE) -# endif // HGFS_OLDER_NT -#else -# define HGFS_DEFAULT_SHARE_ACCESS 0 -#endif // _WIN32 - -/* - * 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; - - /* TRUE if opened in append mode */ - Bool appendFlag; - - /* The server lock that the node currently has. */ - HgfsServerLock serverLock; - - /* File node state on lists */ - FileNodeState state; - - /* Whether this file was opened in sequential mode. */ - Bool sequentialOpen; - - /* Whether this a shared folder open. */ - Bool sharedFolderOpen; -} HgfsFileNode; - - -/* - * 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; - - /* 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; - - /* Directory entries for this search */ - 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; -} HgfsSearch; - - -/* - * 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 */ - HgfsServerLock desiredLock; /* The type of lock desired by the client */ - HgfsServerLock acquiredLock; /* The type of lock acquired by the server */ - uint32 cpNameSize; - char *cpName; - char *utf8Name; -} 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 */ -} HgfsFileAttrInfo; - -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; - char *cpName; -} HgfsCreateDirInfo; - - -/* Server lock related structure */ -typedef struct { - fileDesc fileDesc; - int32 event; - HgfsServerLock serverLock; -} ServerLockData; - -extern SyncMutex hgfsIOLock; - -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 - -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 - -Bool -HgfsRemoveSearch(HgfsHandle searchHandle); // IN - -void -HgfsServerDumpDents(HgfsHandle searchHandle); // IN: Handle to dump dents from - -DirectoryEntry * -HgfsGetSearchResult(HgfsHandle handle, // IN: Handle to search - 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 const *in, // IN: CP filename to check - size_t inSize, // IN: Size of name in - HgfsOpenMode mode, // IN: Requested access mode - 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 - -HgfsInternalStatus -HgfsServerScandir(char const *baseDir, // IN: Directory to search in - size_t baseDirLen, // IN: Length of directory - DirectoryEntry ***dents, // OUT: Array of DirectoryEntrys - int *numDents); // OUT: Number of DirectoryEntrys - -HgfsInternalStatus -HgfsServerSearchRealDir(char const *baseDir, // IN: Directory to search - size_t baseDirLen, // IN: Length of directory - DirectorySearchType type, // IN: Kind of search - HgfsHandle *handle); // OUT: Search handle - -HgfsInternalStatus -HgfsServerSearchVirtualDir(HgfsGetNameFunc *getName, // IN: Name enumerator - HgfsInitFunc *initName, // IN: Init function - HgfsCleanupFunc *cleanupName, // IN: Cleanup function - DirectorySearchType type, // IN: Kind of search - HgfsHandle *handle); // OUT: Search handle - -/* - * Opcode handlers - */ - -HgfsInternalStatus -HgfsServerOpen(char const *packetIn, // IN: incoming packet - char *packetOut, // OUT: outgoing packet - size_t *packetSize); // IN/OUT: size of packet - -HgfsInternalStatus -HgfsServerRead(char const *packetIn, // IN: incoming packet - char *packetOut, // OUT: outgoing packet - size_t *packetSize); // IN/OUT: size of packet - -HgfsInternalStatus -HgfsServerWrite(char const *packetIn, // IN: incoming packet - char *packetOut, // OUT: outgoing packet - size_t *packetSize); // IN/OUT: size of packet - -HgfsInternalStatus -HgfsServerSearchOpen(char const *packetIn, // IN: incoming packet - char *packetOut, // OUT: outgoing packet - size_t *packetSize); // IN/OUT: size of packet - -HgfsInternalStatus -HgfsServerSearchRead(char const *packetIn, // IN: incoming packet - char *packetOut, // OUT: outgoing packet - size_t *packetSize); // IN/OUT: size of packet - -HgfsInternalStatus -HgfsServerGetattr(char const *packetIn, // IN: incoming packet - char *packetOut, // OUT: outgoing packet - size_t *packetSize); // IN/OUT: size of packet - -HgfsInternalStatus -HgfsServerSetattr(char const *packetIn, // IN: incoming packet - char *packetOut, // OUT: outgoing packet - size_t *packetSize); // IN/OUT: size of packet - -HgfsInternalStatus -HgfsServerCreateDir(char const *packetIn, // IN: incoming packet - char *packetOut, // OUT: outgoing packet - size_t *packetSize); // IN/OUT: size of packet - -HgfsInternalStatus -HgfsServerDeleteFile(char const *packetIn, // IN: incoming packet - char *packetOut, // OUT: outgoing packet - size_t *packetSize); // IN/OUT: size of packet - -HgfsInternalStatus -HgfsServerDeleteDir(char const *packetIn, // IN: incoming packet - char *packetOut, // OUT: outgoing packet - size_t *packetSize); // IN/OUT: size of packet - -HgfsInternalStatus -HgfsServerRename(char const *packetIn, // IN: incoming packet - char *packetOut, // OUT: outgoing packet - size_t *packetSize); // IN/OUT: size of packet - -HgfsInternalStatus -HgfsServerQueryVolume(char const *packetIn, // IN: incoming packet - char *packetOut, // OUT: outgoing packet - size_t *packetSize); // IN/OUT: size of packet - -HgfsInternalStatus -HgfsServerSymlinkCreate(char const *packetIn, // IN: incoming packet - char *packetOut, // OUT: outgoing packet - size_t *packetSize); // IN/OUT: size of packet - -HgfsInternalStatus -HgfsServerServerLockChange(char const *packetIn, // IN: incoming packet - char *packetOut, // OUT: outgoing packet - size_t *packetSize); // IN/OUT: size of packet - -/* Unpack/pack requests/reply helper functions. */ - -Bool -HgfsUnpackOpenRequest(char const *packetIn, // IN: incoming packet - size_t packetSize, // IN: size of packet - HgfsFileOpenInfo *openInfo); // IN/OUT: open info struct - -Bool -HgfsPackOpenReply(HgfsFileOpenInfo *openInfo, // IN: open info struct - char *packetOut, // OUT: outgoing packet - size_t *packetSize); // OUT: outgoing packet size - -Bool -HgfsUnpackGetattrRequest(char const *packetIn, // IN: request packet - size_t packetSize, // IN: request packet size - HgfsFileAttrInfo *attrInfo, // IN/OUT: unpacked attr struct - HgfsAttrHint *hints, // OUT: getattr hints - char **cpName, // OUT: cpName - size_t *cpNameSize, // OUT: cpName size - HgfsHandle *file); // OUT: file handle - -Bool -HgfsUnpackDeleteRequest(char const *packetIn, // IN: request packet - size_t packetSize, // IN: request packet size - char **cpName, // OUT: cpName - size_t *cpNameSize, // OUT: cpName size - HgfsDeleteHint *hints, // OUT: delete hints - HgfsHandle *file); // OUT: file handle - -Bool -HgfsPackDeleteReply(char *packetOut, // IN/OUT: outgoing packet - size_t *packetSize); // IN/OUT: size of packet - -Bool -HgfsUnpackRenameRequest(char const *packetIn, // IN: request packet - size_t packetSize, // IN: request packet size - char **cpOldName, // OUT: rename src - uint32 *cpOldNameLen, // OUT: rename src size - char **cpNewName, // OUT: rename dst - uint32 *cpNewNameLen, // OUT: rename dst size - HgfsRenameHint *hints, // OUT: rename hints - HgfsHandle *srcFile, // OUT: src file handle - HgfsHandle *targetFile); // OUT: target file handle - -Bool -HgfsPackRenameReply(char *packetOut, // IN/OUT: outgoing packet - size_t *packetSize); // IN/OUT: size of packet - -Bool -HgfsPackGetattrReply(HgfsFileAttrInfo *attr, // IN: attr stucture - const char *utf8TargetName, // IN: optional target name - uint32 utf8TargetNameLen, // IN: file name length - char *packetOut, // IN/OUT: outgoing packet - size_t *packetSize); // IN/OUT: size of packet - -Bool -HgfsUnpackSearchReadRequest(const char *packetIn, // IN: request packet - size_t packetSize, // IN: packet size - HgfsFileAttrInfo *attr, // OUT: unpacked attr struct - HgfsHandle *hgfsSearchHandle, // OUT: hgfs search handle - uint32 *offset); // OUT: entry offset - -Bool -HgfsPackSearchReadReply(const char *utf8Name, // IN: file name - size_t utf8NameLen, // IN: file name length - HgfsFileAttrInfo *attr, // IN: file attr struct - char *packetOut, // IN/OUT: outgoing packet - size_t *packetSize); // IN/OUT: size of packet - -Bool -HgfsUnpackSetattrRequest(char const *packetIn, // IN: request packet - size_t packetSize, // IN: request packet size - HgfsFileAttrInfo *attr, // IN/OUT: getattr info - HgfsAttrHint *hints, // OUT: setattr hints - char **cpName, // OUT: cpName - size_t *cpNameSize, // OUT: cpName size - HgfsHandle *file); // OUT: server file ID - -Bool -HgfsPackSetattrReply(char *packetOut, // IN/OUT: outgoing packet - size_t *packetSize); // IN/OUT: size of packet - - -Bool -HgfsUnpackCreateDirRequest(char const *packetIn, // IN: incoming packet - size_t packetSize, // IN: size of packet - HgfsCreateDirInfo *info); // IN/OUT: info struct - -Bool -HgfsPackCreateDirReply(char *packetOut, // IN/OUT: outgoing packet - size_t *packetSize); // IN/OUT: size of packet - -/* Node cache functions. */ - -Bool -HgfsRemoveFromCache(HgfsHandle handle); // IN: Hgfs handle of the node - -Bool -HgfsAddToCache(HgfsHandle handle); // IN: Hgfs handle of the node - -Bool -HgfsIsCached(HgfsHandle handle); // IN: Hgfs handle of the node - -Bool -HgfsIsServerLockAllowed(void); - -Bool -HgfsHandle2FileDesc(HgfsHandle handle, // IN: Hgfs file handle - fileDesc *fd); // OUT: OS handle (file descriptor) - -Bool -HgfsFileDesc2Handle(fileDesc fd, // IN: OS handle (file descriptor) - HgfsHandle *handle); // OUT: Hgfs file handle - -Bool -HgfsHandle2ShareMode(HgfsHandle handle, // IN: Hgfs file handle - HgfsOpenMode *shareMode); // OUT: UTF8 file name size - -Bool -HgfsHandle2FileName(HgfsHandle handle, // IN: Hgfs file handle - char **fileName, // OUT: CP file name - size_t *fileNameSize); // OUT: CP file name size - -Bool -HgfsHandle2AppendFlag(HgfsHandle handle, // IN: Hgfs file handle - Bool *appendFlag); // OUT: Append flag - -Bool -HgfsHandle2LocalId(HgfsHandle handle, // IN: Hgfs file handle - HgfsLocalId *localId); // OUT: Local id info - -Bool -HgfsHandle2ServerLock(HgfsHandle handle, // IN: Hgfs file handle - HgfsServerLock *lock); // OUT: Server lock - -Bool -HgfsUpdateNodeFileDesc(HgfsHandle handle, // IN: Hgfs file handle - fileDesc fd); // OUT: OS handle (file desc - -Bool -HgfsUpdateNodeServerLock(fileDesc fd, // IN: OS handle - HgfsServerLock serverLock); // IN: new oplock - -Bool -HgfsUpdateNodeAppendFlag(HgfsHandle handle, // IN: Hgfs file handle - Bool appendFlag); // OUT: Append flag - -Bool -HgfsFileHasServerLock(const char *utf8Name, // IN: Name in UTF8 - HgfsServerLock *serverLock, // OUT: Existing oplock - fileDesc *fileDesc); // OUT: Existing fd -Bool -HgfsGetNodeCopy(HgfsHandle handle, // IN: Hgfs file handle - Bool copyName, // IN: Should we copy the name? - HgfsFileNode *copy); // IN/OUT: Copy of the node - -Bool -HgfsHandleIsSequentialOpen(HgfsHandle handle, // IN: Hgfs file handle - Bool *sequentialOpen); // OUT: If open was sequential - -Bool -HgfsHandleIsSharedFolderOpen(HgfsHandle handle, // IN: Hgfs file handle - Bool *sharedFolderOpen); // OUT: If shared folder - -Bool -HgfsGetSearchCopy(HgfsHandle handle, // IN: Hgfs search handle - HgfsSearch *copy); // IN/OUT: Copy of the search - -HgfsInternalStatus -HgfsCloseFile(fileDesc fileDesc); // IN: OS handle of the file - -Bool -HgfsServerGetOpenMode(HgfsFileOpenInfo *openInfo, // IN: Open info to examine - uint32 *modeOut); // OUT: Local mode - -Bool -HgfsAcquireServerLock(fileDesc fileDesc, // IN: OS handle - HgfsServerLock *serverLock); // IN/OUT: Oplock asked for/granted - -Bool -HgfsServerPlatformInit(void); - -void -HgfsServerPlatformDestroy(void); - -Bool -HgfsServerHasSymlink(const char *fileName, // IN - const char *sharePath); // IN - -/* All oplock-specific functionality is defined here. */ -#ifdef HGFS_OPLOCKS -void -HgfsServerOplockBreak(ServerLockData *data); // IN: server lock info - -void -HgfsAckOplockBreak(ServerLockData *lockData, // IN: server lock info - HgfsServerLock replyLock); // IN: client has this lock -#endif - -#endif /* __HGFS_SERVER_INT_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/hgfsServerManager.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/hgfsServerManager.h --- open-vm-tools-2008.01.23-74039/lib/include/hgfsServerManager.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/hgfsServerManager.h 2008-10-13 08:01:49.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/hgfsServerPolicy.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/hgfsServerPolicy.h --- open-vm-tools-2008.01.23-74039/lib/include/hgfsServerPolicy.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/hgfsServerPolicy.h 2008-10-13 08:01:49.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -37,6 +37,9 @@ Bool HgfsServerPolicy_Cleanup(void); + +typedef uint32 HgfsShareOptions; + /* * Structure representing one shared folder. We maintain a list of * these to check accesses against. @@ -48,26 +51,52 @@ * Path of share in server's filesystem. Should * not include final path separator. */ - 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 */ + 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. */ } 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; + /* Defined in hgfsServerInt.h */ HgfsGetNameFunc HgfsServerPolicy_GetShares; HgfsInitFunc HgfsServerPolicy_GetSharesInit; HgfsCleanupFunc HgfsServerPolicy_GetSharesCleanup; HgfsNameStatus -HgfsServerPolicy_GetSharePath(char const *nameIn, // IN: - size_t nameInLen, // IN: - HgfsOpenMode mode, // IN: - size_t *sharePathLen, // OUT: - char const **sharePath); // OUT: +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 + +void +HgfsServerPolicy_FreeShareList(HgfsServerPolicy_ShareList *shareList); // IN: list to free + +HgfsServerPolicy_ShareList * +HgfsServerPolicy_GetSharesWithTag(const char *tag); // IN: tag to search for #endif // _HGFS_SERVER_POLICY_H_ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/hgfsUtil.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/hgfsUtil.h --- open-vm-tools-2008.01.23-74039/lib/include/hgfsUtil.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/hgfsUtil.h 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -19,7 +19,7 @@ /* * hgfsUtil.h -- - * + * * Utility functions and macros used by hgfs. */ @@ -29,15 +29,15 @@ # if defined(__linux__) && defined(__KERNEL__) # include "driver-config.h" -# include // for time_t and timespec +# include // for time_t and timespec /* Include time.h in userspace code, but not in Solaris kernel code. */ # elif defined(__FreeBSD__) && defined(_KERNEL) /* Do nothing. */ # elif defined(__APPLE__) && defined(KERNEL) # include -# else +# else # include -# endif +# endif # include "vm_basic_types.h" # if !defined(_STRUCT_TIMESPEC) && \ !defined(_TIMESPEC_DECLARED) && \ @@ -71,15 +71,27 @@ typedef DWORD HgfsInternalStatus; #endif -/* - * Unfortunately, we need a catch-all "generic error" to use with +/* + * Unfortunately, we need a catch-all "generic error" to use with * HgfsInternalStatus, because there are times when cross-platform code needs - * to return its own errors along with errors from platform specific code. + * to return its own errors along with errors from platform specific code. * * Using -1 should be safe because we expect our platforms to use zero as * success and a positive range of numbers as error values. */ -#define HGFS_INTERNAL_STATUS_ERROR -1 +#define HGFS_INTERNAL_STATUS_ERROR (-1) + +#ifndef _WIN32 +/* + * This error code is used to notify the client that some of the parameters passed + * (e.g. file handles) are not supported. Clients are expected to correct + * the parameter (e.g. pass file name instead) and retry. + * + * Note that this error code is artificially made up and in future may conflict + * with an "official" error code when added. + */ +#define EPARAMETERNOTSUPPORTED (MAX_INT32 - 1) +#endif /* * FreeBSD (pre-6.0) does not define EPROTO, so we'll define our own error code. @@ -89,6 +101,7 @@ #endif #define HGFS_NAME_BUFFER_SIZE(request) (HGFS_PACKET_MAX - (sizeof *request - 1)) +#define HGFS_NAME_BUFFER_SIZET(sizet) (HGFS_PACKET_MAX - ((sizet) - 1)) #ifndef _WIN32 /* @@ -114,3 +127,4 @@ HgfsStatus HgfsConvertFromInternalStatus(HgfsInternalStatus status); // IN #endif /* _HGFSUTIL_H_ */ + diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/hgfsVirtualDir.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/hgfsVirtualDir.h --- open-vm-tools-2008.01.23-74039/lib/include/hgfsVirtualDir.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/hgfsVirtualDir.h 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/hostinfo.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/hostinfo.h --- open-vm-tools-2008.01.23-74039/lib/include/hostinfo.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/hostinfo.h 2008-10-13 08:01:49.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -32,9 +32,10 @@ #include "vm_basic_types.h" #include "x86cpuid.h" +#include "unicodeTypes.h" -extern const char *Hostinfo_NameGet(void); /* don't free result */ -extern const char *Hostinfo_HostName(void); /* free result */ +extern Unicode Hostinfo_NameGet(void); /* don't free result */ +extern Unicode Hostinfo_HostName(void); /* free result */ extern void Hostinfo_MachineID(uint32 *hostNameHash, uint64 *hostHardwareID); @@ -42,11 +43,21 @@ extern Bool Hostinfo_GetMemoryInfoInPages(unsigned int *minSize, unsigned int *maxSize, unsigned int *currentSize); +#ifdef __linux__ +extern Bool Hostinfo_GetSwapInfoInPages(unsigned int *totalSwap, + unsigned int *freeSwap); +#endif +#ifdef VMX86_SERVER +extern Bool Hostinfo_GetCOSMemoryInfoInPages(unsigned int *minSize, + unsigned int *maxSize, + unsigned int *currentSize); +#endif extern Bool Hostinfo_GetRatedCpuMhz(int32 cpuNumber, uint32 *mHz); extern char* Hostinfo_GetCpuDescription(uint32 cpuNumber); extern void Hostinfo_GetTimeOfDay(VmTimeType *time); extern VmTimeType Hostinfo_SystemUpTime(void); +extern VmTimeType Hostinfo_RawSystemTimerUS(void); extern VmTimeType Hostinfo_SystemTimerUS(void); extern int Hostinfo_OSVersion(int i); extern const char *Hostinfo_OSVersionString(void); @@ -57,7 +68,10 @@ #endif extern Bool Hostinfo_TouchBackDoor(void); extern Bool Hostinfo_TouchXen(void); -extern char *Hostinfo_GetModulePath(void); + +#define HGMP_PRIVILEGE 0 +#define HGMP_NO_PRIVILEGE 1 +extern Unicode Hostinfo_GetModulePath(uint32 priv); #if !defined(_WIN32) @@ -66,7 +80,7 @@ Bool wait); #endif -extern char *Hostinfo_GetUser(void); +extern Unicode Hostinfo_GetUser(void); extern void Hostinfo_LogMemUsage(void); @@ -106,7 +120,7 @@ Bool Hostinfo_GetMhzOfProcessor(int32 processorNumber, uint32 *currentMhz, uint32 *maxMhz); uint64 Hostinfo_SystemIdleTime(void); -Bool Hostinfo_GetAllCpuid(CPUIDResult* info); +Bool Hostinfo_GetAllCpuid(CPUIDQuery *query); #endif void Hostinfo_LogLoadAverage(void); Bool Hostinfo_GetLoadAverage(uint32 *l); diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/hostType.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/hostType.h --- open-vm-tools-2008.01.23-74039/lib/include/hostType.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/hostType.h 2008-10-13 08:01:49.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/imageUtil.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/imageUtil.h --- open-vm-tools-2008.01.23-74039/lib/include/imageUtil.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/imageUtil.h 2008-10-13 08:01:49.000000000 +0100 @@ -0,0 +1,88 @@ +/********************************************************* + * Copyright (C) 1998 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. + * + *********************************************************/ + +/* + * imageUtil.h -- + * + */ + +#ifndef _IMAGEUTIL_H_ +#define _IMAGEUTIL_H_ + +#include "imageUtilTypes.h" +#include "dynbuf.h" +#include "unicodeTypes.h" + +#ifdef _WIN32 + +typedef char Bool; + +typedef struct tagDIBINFOHEADER { + BITMAPINFOHEADER bmiHeader; + RGBQUAD bmiColors[256]; + LPBYTE bitmapBits; +} DIBINFOHEADER, FAR *LPDIBINFOHEADER, *PDIBINFOHEADER; + +BOOL ImageUtil_SavePNG(LPDIBINFOHEADER image, ConstUnicode fileName); +EXTERN HBITMAP ImageUtil_LoadPNG(ConstUnicode fileName, int pngReadFlags); +EXTERN HBITMAP ImageUtil_LoadPNGFromBuffer(const unsigned char *imageData, + unsigned int dataLen, int pngReadFlags); +EXTERN HBITMAP ImageUtil_LoadImage(ConstUnicode filename, unsigned int width, + unsigned int height); + +#else +#ifndef NO_X11_XLIB_H /* XXX Carbon and X both define 'Cursor' + * but we don't use ImgUtil_SavePNG in mksQuartz.h + * Remove after we have implemeted imageUtil with + * Quartz. + */ +#include +#undef Bool // XXX conflict with vm_basic_types.h +#define XBool int +#undef Cursor + +Bool ImageUtil_SavePNG(const XImage *image, + unsigned int numColors, unsigned short colors[256][3], + const char *fileName); +#endif //USE_IMAGE_UTIL_H +#endif + +#define DWORD_ALIGN(x) ((((x)+3) >> 2) << 2) + +EXTERN Bool ImageUtil_ReadPNG(ImageInfo *image, + ConstUnicode pathName, + int pngReadFlags); + +EXTERN Bool ImageUtil_WriteImage(const ImageInfo *image, + ConstUnicode pathName, + ImageType imageType); + +EXTERN Bool ImageUtil_ReadPNGBuffer(ImageInfo *image, + const unsigned char *imageData, + size_t dataLen, + int pngReadFlags); +EXTERN Bool ImageUtil_ConstructPNGBuffer(const ImageInfo *image, DynBuf *imageData); +EXTERN Bool ImageUtil_ConstructPNGBufferEx(const ImageInfo *image, + const ImagePngWriteOptions *options, + DynBuf *imageData); +EXTERN Bool ImageUtil_ConstructBMPBuffer(const ImageInfo *image, DynBuf *imageData); +EXTERN Bool ImageUtil_ConstructBuffer(const ImageInfo *image, ImageType imageType, + DynBuf *imageData); +EXTERN void ImageUtil_FreeImageData(ImageInfo *image); + +#endif // _IMAGEUTIL_H_ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/imageUtilTypes.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/imageUtilTypes.h --- open-vm-tools-2008.01.23-74039/lib/include/imageUtilTypes.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/imageUtilTypes.h 2008-10-13 08:01:49.000000000 +0100 @@ -0,0 +1,83 @@ +/********************************************************* + * Copyright (C) 2003 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. + * + *********************************************************/ + +/* + * imageUtilTypes.h -- + * + */ + +#ifndef _IMAGEUTIL_TYPES_H_ +#define _IMAGEUTIL_TYPES_H_ + +typedef enum { + IMAGE_TYPE_PNG, + IMAGE_TYPE_BMP +} ImageType; + +typedef enum { + IMAGE_FLAG_TOP_DOWN = 0, /* Top-down scanlines are the default */ + IMAGE_FLAG_BOTTOM_UP = (1 << 0), /* Bottom-up storage (BMP or OpenGL style) */ +} ImageFlags; + +typedef struct { + unsigned char blue; + unsigned char green; + unsigned char red; + unsigned char reserved; +} ImageColor; + +typedef struct { + unsigned int width; + unsigned int height; + + /* + * 'depth' is the color depth (in bits per pixel) used for the image. 'bpp' + * is the number of bits actually consumed per pixel in memory. (For + * example, an image that uses 5 bits for each of R, G, B has depth=15 and + * bpp=16. It's always true that depth <= bpp. + * + * Also see the comment to Raster_ConvertPixels. + */ + unsigned int depth; + unsigned int bpp; + unsigned int bytesPerLine; + ImageFlags flags; + union { + struct { + unsigned int numColors; + ImageColor palette[256]; + }; + struct { + unsigned int redMask; + unsigned int blueMask; + unsigned int greenMask; + }; + }; + unsigned char *data; +} ImageInfo; + +typedef struct { + int zlibCompressLevel; + Bool stripAlphaChannel; +} ImagePngWriteOptions; + +typedef enum { + IMAGE_PNG_READ_KEEP_ALPHA = (1 << 0), +} ImagePngReadFlags; + +#endif // _IMAGEUTIL_TYPES_H_ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/impersonate.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/impersonate.h --- open-vm-tools-2008.01.23-74039/lib/include/impersonate.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/impersonate.h 2008-10-13 08:01:49.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/impersonateInt.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/impersonateInt.h --- open-vm-tools-2008.01.23-74039/lib/include/impersonateInt.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/impersonateInt.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,60 +0,0 @@ -/********************************************************* - * Copyright (C) 2003 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 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. - * - *********************************************************/ - -/* - * 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 diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/includeCheck.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/includeCheck.h --- open-vm-tools-2008.01.23-74039/lib/include/includeCheck.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/includeCheck.h 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/iovector.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/iovector.h --- open-vm-tools-2008.01.23-74039/lib/include/iovector.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/iovector.h 2008-10-13 08:01:49.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -32,9 +32,9 @@ /* * Ugly definition of struct iovec. */ -#if __linux__ || sun || __APPLE__ +#if defined(__linux__) || defined(sun) || defined(__APPLE__) || defined(__FreeBSD__) #include // for struct iovec -#else // if __linux__ || sun || __APPLE__ +#else #ifndef HAS_IOVEC struct iovec { @@ -46,12 +46,6 @@ #endif /* - * This type should be used for variables that contain sector - * position/quantity. - */ -typedef uint64 SectorType; - -/* * An I/O Vector. */ typedef struct VMIOVec { diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/localconfig.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/localconfig.h --- open-vm-tools-2008.01.23-74039/lib/include/localconfig.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/localconfig.h 2008-10-13 08:01:49.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/log.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/log.h --- open-vm-tools-2008.01.23-74039/lib/include/log.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/log.h 2008-10-13 08:01:49.000000000 +0100 @@ -7,17 +7,17 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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 _LOG_H_ -#define _LOG_H_ +#ifndef VMWARE_LOG_H +#define VMWARE_LOG_H #define INCLUDE_ALLOW_USERLEVEL #define INCLUDE_ALLOW_VMCORE @@ -31,16 +31,30 @@ struct LogState; +typedef struct +{ + const char *fileName; // File name, if known + const char *config; // Config variable to look up + const char *suffix; // Suffix to generate log file name + const char *appName; // App name for log header + const char *appVersion; // App version for log header + Bool logging; // Logging is enabled or not + Bool append; // Append to log file + unsigned int keepOld; // Number of old logs to keep + unsigned int throttleThreshold; // Threshold for throttling + unsigned int throttleBytesPerSec; // BPS for throttle + Bool switchFile; // Switch the initial log file + unsigned int rotateSize; // Size at which log should be rotated +} LogInitParams; + +EXTERN void Log_GetInitDefaults(const char *fileName, const char *config, + const char *suffix, LogInitParams *params); + EXTERN Bool Log_Init(const char *fileName, const char *config, const char *suffix); EXTERN Bool Log_InitForApp(const char *fileName, const char *config, const char *suffix, const char *appName, const char *appVersion); -EXTERN Bool Log_InitEx(const char *fileName, const char *config, const char *suffix, - const char *appName, const char *appVersion, - Bool logging, Bool append, - unsigned int keepOld, unsigned int throttleThreshold, - unsigned int throttleBytesPerSec, Bool switchFile, - unsigned int rotateSize); +EXTERN Bool Log_InitEx(const LogInitParams *params); EXTERN void Log_Exit(void); EXTERN void Log_SetConfigDir(const char *configDir); EXTERN void Log_SetLockFunc(void (*f)(Bool locking)); @@ -111,4 +125,4 @@ EXTERN void Log_Histogram(uint32 n, uint32 histo[], int nbuckets, const char *message, int *count, int limit); -#endif +#endif /* VMWARE_LOG_H */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/loglevel_defs.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/loglevel_defs.h --- open-vm-tools-2008.01.23-74039/lib/include/loglevel_defs.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/loglevel_defs.h 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -19,6 +19,7 @@ #ifndef _LOGLEVEL_DEFS_H_ #define _LOGLEVEL_DEFS_H_ +#define INCLUDE_ALLOW_MODULE #define INCLUDE_ALLOW_USERLEVEL #define INCLUDE_ALLOW_VMMEXT #define INCLUDE_ALLOW_VMCORE diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/loglevel_user.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/loglevel_user.h --- open-vm-tools-2008.01.23-74039/lib/include/loglevel_user.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/loglevel_user.h 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -19,6 +19,7 @@ #ifndef _LOGLEVEL_USER_H_ #define _LOGLEVEL_USER_H_ +#define INCLUDE_ALLOW_MODULE #define INCLUDE_ALLOW_USERLEVEL #include "includeCheck.h" @@ -55,6 +56,8 @@ LOGLEVEL_VAR(parallel), \ LOGLEVEL_VAR(chipset), \ LOGLEVEL_VAR(smc), \ + LOGLEVEL_VAR(ich7m), \ + LOGLEVEL_VAR(hpet), \ LOGLEVEL_VAR(extcfgdevice), \ LOGLEVEL_VAR(flashram), \ LOGLEVEL_VAR(pci), \ @@ -64,6 +67,9 @@ LOGLEVEL_VAR(pci_ehci), \ LOGLEVEL_VAR(ehci), \ LOGLEVEL_VAR(usb), \ + LOGLEVEL_VAR(vusbmouse), \ + LOGLEVEL_VAR(vusbkeyboard), \ + LOGLEVEL_VAR(hidQueue), \ LOGLEVEL_VAR(pci_1394), \ LOGLEVEL_VAR(1394), \ LOGLEVEL_VAR(pci_vlance), \ @@ -72,8 +78,8 @@ LOGLEVEL_VAR(pci_hyper), \ LOGLEVEL_VAR(pcibridge), \ LOGLEVEL_VAR(vide), \ + LOGLEVEL_VAR(ideCdrom), \ LOGLEVEL_VAR(hostonly), \ - LOGLEVEL_VAR(timeTracker), \ LOGLEVEL_VAR(backdoorAbsMouse), \ LOGLEVEL_VAR(oprom), \ LOGLEVEL_VAR(http), \ @@ -88,6 +94,7 @@ LOGLEVEL_VAR(aioWin32), \ LOGLEVEL_VAR(aioWin32Completion), \ LOGLEVEL_VAR(aioLinux), \ + LOGLEVEL_VAR(aioHttp), \ LOGLEVEL_VAR(aioGeneric), \ LOGLEVEL_VAR(cdrom), \ LOGLEVEL_VAR(checksum), \ @@ -96,6 +103,7 @@ LOGLEVEL_VAR(checkpoint), \ LOGLEVEL_VAR(dumper), \ LOGLEVEL_VAR(migrate), \ + LOGLEVEL_VAR(fsresx), \ \ /* user/gui */ \ LOGLEVEL_VAR(gui), \ @@ -107,12 +115,16 @@ LOGLEVEL_VAR(mksMouse), \ LOGLEVEL_VAR(mksHostOps), \ LOGLEVEL_VAR(mksGLManager), \ + LOGLEVEL_VAR(mksGLShader), \ \ /* user/sound */ \ LOGLEVEL_VAR(sound), \ + LOGLEVEL_VAR(hdaudio), \ + LOGLEVEL_VAR(pci_hdaudio), \ \ /* user/disklib */ \ LOGLEVEL_VAR(disklib), \ + LOGLEVEL_VAR(dmg), \ LOGLEVEL_VAR(sparseChecker), \ LOGLEVEL_VAR(dataCache), \ /* more */ \ @@ -123,9 +135,11 @@ 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(vmxfer), \ LOGLEVEL_VAR(poll), \ LOGLEVEL_VAR(barrier), \ @@ -133,6 +147,7 @@ LOGLEVEL_VAR(vmLock), \ LOGLEVEL_VAR(buslogic), \ LOGLEVEL_VAR(lsilogic), \ + LOGLEVEL_VAR(pvscsi), \ LOGLEVEL_VAR(diskVmnix), \ LOGLEVEL_VAR(hbaCommon), \ LOGLEVEL_VAR(backdoor), \ @@ -167,19 +182,27 @@ LOGLEVEL_VAR(shader), \ LOGLEVEL_VAR(numa), \ LOGLEVEL_VAR(machPoll), \ + LOGLEVEL_VAR(replayVMX), \ LOGLEVEL_VAR(vmWindowController), \ LOGLEVEL_VAR(dui), \ LOGLEVEL_VAR(duiMKS), \ LOGLEVEL_VAR(worker), \ LOGLEVEL_VAR(duiDevices), \ + LOGLEVEL_VAR(duiProxyApps), \ LOGLEVEL_VAR(uwt), /* lib/unityWindowTracker */ \ LOGLEVEL_VAR(cui), \ LOGLEVEL_VAR(automation), \ LOGLEVEL_VAR(oemDevice), \ LOGLEVEL_VAR(cptOps), \ - LOGLEVEL_VAR(vprobeExec), \ - LOGLEVEL_VAR(vp), \ - + LOGLEVEL_VAR(VProbeExec), \ + LOGLEVEL_VAR(VProbeVP), \ + LOGLEVEL_VAR(device), \ + LOGLEVEL_VAR(devicePowerOn), \ + LOGLEVEL_VAR(vmxvmdbCallbacks), \ + LOGLEVEL_VAR(guestInstall), \ + LOGLEVEL_VAR(migrateVM), \ + LOGLEVEL_VAR(vmUpsellController), \ + LOGLEVEL_VAR(objc), /* lib/objc */ \ LOGLEVEL_EXTENSION_DECLARE(LOGLEVEL_USER); diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/message.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/message.h --- open-vm-tools-2008.01.23-74039/lib/include/message.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/message.h 2008-10-13 08:01:49.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/miscSolaris.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/miscSolaris.h --- open-vm-tools-2008.01.23-74039/lib/include/miscSolaris.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/miscSolaris.h 2008-10-13 08:01:49.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/mntinfo.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/mntinfo.h --- open-vm-tools-2008.01.23-74039/lib/include/mntinfo.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/mntinfo.h 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -37,6 +37,7 @@ #elif defined(__FreeBSD__) # include #endif +#include "posix.h" /* *---------------------------------------------------------------------------- @@ -86,8 +87,8 @@ # define MNTINFO struct mnttab # define DECLARE_MNTINFO(name) struct mnttab __ ## name; \ struct mnttab *name = &__ ## name -# define OPEN_MNTFILE(mode) fopen(MNTFILE, mode) -# define GETNEXT_MNTINFO(fp, mnt) (getmntent(fp, mnt) == 0) +# 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 @@ -98,8 +99,8 @@ # define MNTHANDLE FILE * # define MNTINFO struct mntent # define DECLARE_MNTINFO(name) struct mntent *name -# define OPEN_MNTFILE(mode) setmntent(MNTFILE, mode) -# define GETNEXT_MNTINFO(fp, mnt) ((mnt = getmntent(fp)) != NULL) +# 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 diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/msgfmt.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/msgfmt.h --- open-vm-tools-2008.01.23-74039/lib/include/msgfmt.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/msgfmt.h 2008-10-13 08:01:49.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -27,9 +27,12 @@ #define INCLUDE_ALLOW_USERLEVEL #define INCLUDE_ALLOW_VMCORE +#define INCLUDE_ALLOW_VMKERNEL #include "includeCheck.h" +#ifndef VMKERNEL #include "str.h" // for HAS_BSD_PRINTF +#endif /* @@ -63,6 +66,13 @@ /* * A format argument + * + * In addition to being a internal data structure, + * MsgFmt_Arg defines the Vob (vmkernel observations) protocol + * between vmkernel and vmx. As such, it must be carefully aligned, + * so that all the fields (except the pointers) have fixed sizes + * and the same offsets in the 64-bit vmkernel, the 32-bit vmx, + * and the 64-bit vmx. */ typedef enum MsgFmt_ArgType { @@ -75,10 +85,19 @@ MSGFMT_ARG_STRING8, MSGFMT_ARG_STRING16, MSGFMT_ARG_STRING32, + MSGFMT_ARG_ERRNO, } MsgFmt_ArgType; +typedef enum MsgFmt_ArgPlatform { + MSGFMT_PLATFORM_UNKNOWN, + MSGFMT_PLATFORM_LINUX, + MSGFMT_PLATFORM_WINDOWS, + MSGFMT_PLATFORM_MACOS, +} MsgFmt_ArgPlatform; + typedef struct MsgFmt_Arg { - MsgFmt_ArgType type; + int32 type; + int32 pad; union { int32 signed32; int64 signed64; @@ -88,15 +107,31 @@ int8 *string8; int16 *string16; int32 *string32; + int32 offset; - // private - struct { - void *ptr; // must align with string{8,16,32} - int precision; - } s; + void *ptr; // private } v; + struct { + int32 platform; + int32 number; + } e; + union { // private + int32 precision; + char *localString; + uint64 pad; + } p; } MsgFmt_Arg; +#if defined __linux__ +#define MSGFMT_CURRENT_PLATFORM MSGFMT_PLATFORM_LINUX +#elif defined _WIN32 +#define MSGFMT_CURRENT_PLATFORM MSGFMT_PLATFORM_WINDOWS +#elif defined __APPLE__ +#define MSGFMT_CURRENT_PLATFORM MSGFMT_PLATFORM_MACOS +#else +#define MSGFMT_CURRENT_PLATFORM MSGFMT_PLATFORM_UNKNOWN +#endif + /* * Global functions @@ -125,14 +160,21 @@ Bool MsgFmt_GetArgs(const char *fmt, va_list va, MsgFmt_Arg **args, int *numArgs, char **error); +Bool MsgFmt_GetArgsWithBuf(const char *fmt, va_list va, + MsgFmt_Arg **args, int *numArgs, char **error, + void *buf, size_t *bufSize); void MsgFmt_FreeArgs(MsgFmt_Arg *args, int numArgs); +void MsgFmt_SwizzleArgs(MsgFmt_Arg *args, + int numArgs); +void MsgFmt_UnswizzleArgs(MsgFmt_Arg *args, + int numArgs); -#ifdef HAS_BSD_PRINTF +MsgFmt_Arg* MsgFmt_CopyArgs(MsgFmt_Arg* copyArgs, + int numArgs); int MsgFmt_Snprintf(char *buf, size_t size, const char *format, const MsgFmt_Arg *args, int numArgs); char *MsgFmt_Asprintf(size_t *length, const char *format, const MsgFmt_Arg *args, int numArgs); -#endif #endif // ifndef _MSGFMT_H_ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/msg.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/msg.h --- open-vm-tools-2008.01.23-74039/lib/include/msg.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/msg.h 2008-10-13 08:01:49.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -33,35 +33,11 @@ #include #include "err.h" #include "vm_basic_types.h" -#ifndef NO_MSGFMT +#include "msgid.h" #include "msgfmt.h" -#endif - -/* - * 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 BUTTONID(id) MSG_MAGIC "(button." #id ")" -#define INVALID_MSG_CODE -1 +#define INVALID_MSG_CODE (-1) /* * Data structures, types, and constants @@ -95,7 +71,6 @@ HINT_OKCANCEL } HintOptions; -#ifndef NO_MSGFMT typedef struct Msg_List Msg_List; struct Msg_List { Msg_List *next; @@ -104,7 +79,6 @@ MsgFmt_Arg *args; int numArgs; }; -#endif typedef struct MsgCallback { void (*post)(MsgSeverity severity, const char *msgID, const char *message); @@ -119,19 +93,17 @@ void (*lazyProgress)(void *handle, int percent); void (*lazyProgressEnd)(void *handle); -#ifndef NO_MSGFMT void (*postList)(MsgSeverity severity, Msg_List *messages); int (*questionList)(const Msg_String *buttons, int defaultAnswer, Msg_List *messages); int (*progressList)(Msg_List *messages, int percent, Bool cancelButton); HintResult (*hintList)(HintOptions options, Msg_List *messages); void *(*lazyProgressStartList)(Msg_List *messages); -#endif } MsgCallback; #define MSG_QUESTION_MAX_BUTTONS 10 -#define MSG_PROGRESS_START -1 +#define MSG_PROGRESS_START (-1) #define MSG_PROGRESS_STOP 101 EXTERN Msg_String const Msg_YesNoButtons[]; @@ -151,13 +123,19 @@ PRINTF_DECL(1, 2); EXTERN void Msg_Post(MsgSeverity severity, const char *idFmt, ...) PRINTF_DECL(2, 3); +EXTERN void Msg_PostMsgList(MsgSeverity severity, Msg_List *msg); + EXTERN char *Msg_Format(const char *idFmt, ...) PRINTF_DECL(1, 2); EXTERN char *Msg_VFormat(const char *idFmt, va_list arguments); EXTERN unsigned Msg_Question(Msg_String const *buttons, int defaultAnswer, const char *idFmt, ...) PRINTF_DECL(3, 4); -EXTERN char *Msg_ChooseFile(const char *idTitle, const char *defaultName); +EXTERN void Msg_AppendMsgList(char* id, + char* fmt, + MsgFmt_Arg *args, + int numArgs); +EXTERN Msg_List *Msg_VCreateMsgList(const char *idFmt, va_list args); /* * Unfortunately, gcc warns about both NULL and "" being passed as format @@ -178,11 +156,12 @@ EXTERN HintResult Msg_Hint(Bool defaultShow, HintOptions options, const char *idFmt, ...) PRINTF_DECL(3, 4); +EXTERN HintResult Msg_HintMsgList(Bool defaultShow, HintOptions options, Msg_List *msg); EXTERN int Msg_CompareAnswer(Msg_String const *buttons, unsigned answer, const char *string); EXTERN char *Msg_GetString(const char *idString); EXTERN char *Msg_GetStringSafe(const char *idString); -EXTERN char *Msg_GetUtf8String(const char *idString); +EXTERN char *Msg_GetPlainButtonText(const char *idString); EXTERN const char *Msg_GetLocale(void); EXTERN void Msg_SetLocale(const char *locale, const char *binaryName); EXTERN char *Msg_GetMessageFilePath(const char *locale, const char *binaryName, @@ -198,12 +177,10 @@ EXTERN const char *Msg_GetMessages(void); EXTERN const char *Msg_GetMessagesAndReset(void); -#ifndef NO_MSGFMT EXTERN Msg_List *Msg_GetMsgList(void); EXTERN Msg_List *Msg_GetMsgListAndReset(void); EXTERN void Msg_FreeMsgList(Msg_List *messages); EXTERN char *Msg_LocalizeList(Msg_List *messages); -#endif EXTERN void Msg_Reset(Bool log); EXTERN Bool Msg_Present(void); EXTERN void Msg_Exit(void); @@ -243,7 +220,6 @@ EXTERN void Msg_SetCallback(MsgCallback *cb); EXTERN void Msg_GetCallback(MsgCallback *cb); -EXTERN void MsgSetPostStderrBlock(Bool block); // XXX don't know -- edward /* @@ -254,42 +230,6 @@ #define Msg_Errno2String(errorNumber) ( \ Err_Errno2String(errorNumber) ) -/* - *----------------------------------------------------------------------------- - * - * Msg_StripMSGID -- - * - * Returns the string that is inside the MSGID() or if it doesn't - * have a MSGID just return the string. - * - * Results: - * The non localized string. - * - * Side Effects: - * None - * - *----------------------------------------------------------------------------- - */ - -static INLINE const char * -Msg_StripMSGID(const char *idString) // IN -{ - if (idString && strncmp(idString, MSG_MAGIC"X", MSG_MAGIC_LEN) == 0) { - const char *strp; - - /* - * Find the beginning of the ID (idp) and the string (strp). - */ - - strp = idString + MSG_MAGIC_LEN; - strp++; - strp = strchr(strp, ')'); - strp++; - return strp; - } - return idString; -} - #ifdef _WIN32 EXTERN const char *Msg_HResult2String(long hr); #endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/msgid.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/msgid.h --- open-vm-tools-2008.01.23-74039/lib/include/msgid.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/msgid.h 2008-10-13 08:01:49.000000000 +0100 @@ -0,0 +1,98 @@ +/********************************************************* + * Copyright (C) 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. + * + *********************************************************/ + +/* + * msgid.h -- + * + * Message ID magic + */ + +#ifndef _MSGID_H_ +#define _MSGID_H_ + +#define INCLUDE_ALLOW_USERLEVEL +#define INCLUDE_ALLOW_VMCORE +#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 ")" + +// the X hides MSG_MAGIC so it won't appear in the object file +#define MSG_MAGICAL(s) (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_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 +{ + if (idString != NULL && MSG_MAGICAL(idString)) { + idString += MSG_MAGIC_LEN; + idString++; + idString = strchr(idString, ')'); + idString++; + } + return idString; +} + + +#endif // ifndef _MSGID_H_ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/netutil.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/netutil.h --- open-vm-tools-2008.01.23-74039/lib/include/netutil.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/netutil.h 2008-10-13 08:01:49.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -28,17 +28,32 @@ #ifndef __NETUTIL_H__ #define __NETUTIL_H__ -#include "vm_basic_types.h" -#include "guestInfo.h" - #ifdef _WIN32 -#include +#include #include +#include +#endif + +#include "vm_basic_types.h" + +#if !defined(N_PLAT_NLM) +# include "guestInfo.h" +#endif + + +/* + * Modified from iptypes.h... + */ +#if (NTDDI_VERSION < NTDDI_WIN2KSP1) +typedef FIXED_INFO_W2KSP1 FIXED_INFO; +typedef FIXED_INFO_W2KSP1 *PFIXED_INFO; #endif char *NetUtil_GetPrimaryIP(void); -NicEntry *NetUtil_GetPrimaryNicEntry(void); +#if !defined(N_PLAT_NLM) +GuestNic *NetUtil_GetPrimaryNic(void); +#endif #ifdef _WIN32 DWORD NetUtil_LoadIpHlpApiDll(void); @@ -48,6 +63,11 @@ /* 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); #endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/osNames.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/osNames.h --- open-vm-tools-2008.01.23-74039/lib/include/osNames.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/osNames.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,140 +0,0 @@ -/********************************************************* - * Copyright (C) 2007 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 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. - * - *********************************************************/ - -/* - * osNames.h -- - * - * This file contains strings often found in various guest OS names. - */ - -#ifndef _OS_NAMES_H_ -#define _OS_NAMES_H_ - -/* Linux */ -#define STR_OS_ANNVIX "Annvix" -#define STR_OS_ARCH "Arch" -#define STR_OS_ARKLINUX "Arklinux" -#define STR_OS_AUROX "Aurox" -#define STR_OS_BLACKCAT "BlackCat" -#define STR_OS_COBALT "Cobalt" -#define STR_OS_CONECTIVA "Conectiva" -#define STR_OS_DEBIAN "Debian" -#define STR_OS_FEDORA "Fedora" -#define STR_OS_GENTOO "Gentoo" -#define STR_OS_IMMUNIX "Immunix" -#define STR_OS_LINUX "linux" -#define STR_OS_LINUX_FROM_SCRATCH "Linux-From-Scratch" -#define STR_OS_LINUX_FULL "Other Linux" -#define STR_OS_LINUX_PPC "Linux-PPC" -#define STR_OS_MANDRAKE "mandrake" -#define STR_OS_MANDRAKE_FULL "Mandrake Linux" -#define STR_OS_MANDRAVIA "Mandriva" -#define STR_OS_MKLINUX "MkLinux" -#define STR_OS_NOVELL "nld9" -#define STR_OS_NOVELL_FULL "Novell Linux Desktop 9" -#define STR_OS_OTHER "otherlinux" -#define STR_OS_OTHER_24 "other24xlinux" -#define STR_OS_OTHER_24_FULL "Other Linux 2.4.x kernel" -#define STR_OS_OTHER_26 "other26xlinux" -#define STR_OS_OTHER_26_FULL "Other Linux 2.6.x kernel" -#define STR_OS_OTHER_FULL "Other Linux" -#define STR_OS_PLD "PLD" -#define STR_OS_RED_HAT "redhat" -#define STR_OS_RED_HAT_EN "rhel" -#define STR_OS_RED_HAT_EN_2 "rhel2" -#define STR_OS_RED_HAT_EN_2_FULL "Red Hat Enterprise Linux 2" -#define STR_OS_RED_HAT_EN_3 "rhel3" -#define STR_OS_RED_HAT_EN_3_FULL "Red Hat Enterprise Linux 3" -#define STR_OS_RED_HAT_EN_4 "rhel4" -#define STR_OS_RED_HAT_EN_4_FULL "Red Hat Enterprise Linux 4" -#define STR_OS_RED_HAT_FULL "Red Hat Linux" -#define STR_OS_SLACKWARE "Slackware" -#define STR_OS_SMESERVER "SMEServer" -#define STR_OS_SUN_DESK "sjds" -#define STR_OS_SUN_DESK_FULL "Sun Java Desktop System" -#define STR_OS_SUSE "suse" -#define STR_OS_SUSE_EN "sles" -#define STR_OS_SUSE_EN_FULL "SUSE Linux Enterprise Server" -#define STR_OS_SUSE_FULL "SUSE Linux" -#define STR_OS_TINYSOFA "Tiny Sofa" -#define STR_OS_TURBO "turbolinux" -#define STR_OS_TURBO_FULL "Turbolinux" -#define STR_OS_UBUNTU "Ubuntu" -#define STR_OS_ULTRAPENGUIN "UltraPenguin" -#define STR_OS_UNITEDLINUX "UnitedLinux" -#define STR_OS_VALINUX "VALinux" -#define STR_OS_YELLOW_DOG "Yellow Dog" - -/* Windows */ -#define STR_OS_WIN_31 "win31" -#define STR_OS_WIN_31_FULL "Windows 3.1" -#define STR_OS_WIN_95 "win95" -#define STR_OS_WIN_95_FULL "Windows 95" -#define STR_OS_WIN_98 "win98" -#define STR_OS_WIN_98_FULL "Windows 98" -#define STR_OS_WIN_ME "winMe" -#define STR_OS_WIN_ME_FULL "Windows Me" -#define STR_OS_WIN_NT "winNT" -#define STR_OS_WIN_NT_FULL "Windows NT" -#define STR_OS_WIN_2000_PRO "win2000Pro" -#define STR_OS_WIN_2000_PRO_FULL "Windows 2000 Professional" -#define STR_OS_WIN_2000_SERV "win2000Serv" -#define STR_OS_WIN_2000_SERV_FULL "Windows 2000 Server" -#define STR_OS_WIN_2000_ADV_SERV "win2000AdvServ" -#define STR_OS_WIN_2000_ADV_SERV_FULL "Windows 2000 Advanced Server" -#define STR_OS_WIN_2000_DATACENT_SERV "win2000DataCentServ" -#define STR_OS_WIN_2000_DATACENT_SERV_FULL "Windows 2000 Data Center Server" -#define STR_OS_WIN_XP_HOME "winXPHome" -#define STR_OS_WIN_XP_HOME_FULL "Windows XP Home Edition" -#define STR_OS_WIN_XP_PRO "winXPPro" -#define STR_OS_WIN_XP_PRO_FULL "Windows XP Professional" -#define STR_OS_WIN_XP_PRO_X64 "winXPPro-64" -#define STR_OS_WIN_XP_PRO_X64_FULL "Windows XP Professional x64 Edition" -#define STR_OS_WIN_NET_WEB "winNetWeb" -#define STR_OS_WIN_NET_WEB_FULL "Windows Server 2003 Web Edition" -#define STR_OS_WIN_NET_ST "winNetStandard" -#define STR_OS_WIN_NET_ST_FULL "Windows Server 2003 Standard Edition" -#define STR_OS_WIN_NET_EN "winNetEnterprise" -#define STR_OS_WIN_NET_EN_FULL "Windows Server 2003 Enterprise Edition" -#define STR_OS_WIN_NET_BUS "winNetBusiness" -#define STR_OS_WIN_NET_BUS_FULL "Windows Server 2003 Small Business" -#define STR_OS_WIN_NET_COMPCLUSTER "winNetComputeCluster" -#define STR_OS_WIN_NET_COMPCLUSTER_FULL "Windows Server 2003 Compute Cluster Edition" -#define STR_OS_WIN_NET_STORAGESERVER "winNetStorageSvr" -#define STR_OS_WIN_NET_STORAGESERVER_FULL "Windows Storage Server 2003" -#define STR_OS_WIN_NET_DC_FULL "Windows Server 2003 Datacenter Edition" -#define STR_OS_WIN_NET_DC "winNetDatacenter" -#define STR_OS_WIN_LONG "longhorn" -#define STR_OS_WIN_LONG_FULL "Longhorn (experimental)" -#define STR_OS_WIN_VISTA "winVista" -#define STR_OS_WIN_VISTA_FULL "Windows Vista" -#define STR_OS_WIN_VISTA_X64 "winVista-64" -#define STR_OS_WIN_VISTA_X64_FULL "Windows Vista x64 Edition" - -/* FreeBSD */ -#define STR_OS_FREEBSD "FreeBSD" - -/* Solaris */ -#define STR_OS_SOLARIS "Solaris" - -/* All */ -#define STR_OS_64BIT_SUFFIX "-64" -#define STR_OS_64BIT_SUFFIX_FULL " (64 bit)" -#define STR_OS_EMPTY "" - -#endif // _OS_NAMES_H_ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/panic.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/panic.h --- open-vm-tools-2008.01.23-74039/lib/include/panic.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/panic.h 2008-10-13 08:01:49.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -72,13 +72,12 @@ EXTERN void Panic_SetCoreDumpFileName(const char *fileName); EXTERN const char *Panic_GetCoreDumpFileName(void); EXTERN int Panic_GetCoreDumpFlags(void); +EXTERN void Panic_SetCoreDumpFlags(int flags); /* * Extra debugging information that Panic module knows how to dump. */ -#ifdef _WIN32 EXTERN void Panic_DumpGuiResources(void); -#endif #endif // _PANIC_H_ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/posix.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/posix.h --- open-vm-tools-2008.01.23-74039/lib/include/posix.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/posix.h 2008-10-13 08:01:49.000000000 +0100 @@ -0,0 +1,633 @@ +/********************************************************* + * Copyright (C) 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 _POSIX_H_ +#define _POSIX_H_ + +#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 "unicodeBase.h" +#include "codeset.h" + +/* + * Force all users of these wrappers to use the LFS (large file) interface + * versions of the functions wrapper therein. If we don't do this the + * wrappers may be built with the LFS versions and the callers might not + * leading to a (potentially undetected) mismatch. + */ + +#if defined(linux) && !defined(N_PLAT_NLM) && \ + (!defined(_LARGEFILE64_SOURCE) || _FILE_OFFSET_BITS != 64) +#error LFS support is not enabled! +#endif + +struct stat; + +#if defined(_WIN32) +typedef int mode_t; +#else +struct statfs; +struct utimbuf; +struct timeval; +struct passwd; +#if !defined(sun) +struct mntent; +#else +struct mnttab; +#endif +#endif + + +int Posix_Creat(ConstUnicode pathName, mode_t mode); +int Posix_Open(ConstUnicode pathName, int flags, ...); +FILE *Posix_Fopen(ConstUnicode pathName, const char *mode); +FILE *Posix_Popen(ConstUnicode pathName, const char *mode); +int Posix_Rename(ConstUnicode fromPathName, ConstUnicode toPathName); +int Posix_Rmdir(ConstUnicode pathName); +int Posix_Unlink(ConstUnicode pathName); +FILE *Posix_Freopen(ConstUnicode pathName, const char *mode, FILE *stream); +int Posix_Access(ConstUnicode pathName, int mode); +int Posix_Stat(ConstUnicode pathName, struct stat *statbuf); +int Posix_Chmod(ConstUnicode pathName, mode_t mode); +void Posix_Perror(ConstUnicode str); +int Posix_Printf(ConstUnicode format, ...); +int Posix_Fprintf(FILE *stream, ConstUnicode format, ...); + +#if !defined(N_PLAT_NLM) +int Posix_Mkdir(ConstUnicode pathName, mode_t mode); +int Posix_Chdir(ConstUnicode pathName); +Unicode Posix_Getenv(ConstUnicode name); +long Posix_Pathconf(ConstUnicode pathName, int name); +#endif + +#if !defined(_WIN32) +/* + * These Windows APIs actually work with non-ASCII (MBCS) strings. + * Make them NULL wrappers for all other platforms. + */ +#define Posix_GetHostName gethostname +#define Posix_GetHostByName gethostbyname +#define Posix_GetAddrInfo getaddrinfo +#define Posix_GetNameInfo getnameinfo + +void *Posix_Dlopen(ConstUnicode pathName, int flags); + +int Posix_Utime(ConstUnicode pathName, const struct utimbuf *times); + +#if !defined(N_PLAT_NLM) +int Posix_Mknod(ConstUnicode pathName, mode_t mode, dev_t dev); +int Posix_Chown(ConstUnicode pathName, uid_t owner, gid_t group); +int Posix_Lchown(ConstUnicode pathName, uid_t owner, gid_t group); +int Posix_Link(ConstUnicode pathName1, ConstUnicode pathName2); +int Posix_Symlink(ConstUnicode pathName1, ConstUnicode pathName2); +int Posix_Mkfifo(ConstUnicode pathName, mode_t mode); +int Posix_Truncate(ConstUnicode pathName, off_t length); +int Posix_Utimes(ConstUnicode pathName, const struct timeval *time); +int Posix_Execl(ConstUnicode pathName, ConstUnicode arg0, ...); +int Posix_Execlp(ConstUnicode fileName, ConstUnicode arg0, ...); +int Posix_Execv(ConstUnicode pathName, Unicode const argVal[]); +int Posix_Execve(ConstUnicode pathName, Unicode const argVal[], + Unicode const envPtr[]); +int Posix_Execvp(ConstUnicode fileName, Unicode const argVal[]); +int Posix_Lstat(ConstUnicode pathName, struct stat *statbuf); +DIR *Posix_OpenDir(ConstUnicode pathName); +int Posix_System(ConstUnicode command); +int Posix_Putenv(Unicode name); +void Posix_Unsetenv(ConstUnicode name); + +/* + * These functions return dynamically allocated stings that have to be + * freed by the caller so they must be used in the ESX environment. They + * are different than their POSIX "base" functions. + */ +Unicode Posix_RealPath(ConstUnicode pathName); +Unicode Posix_ReadLink(ConstUnicode pathName); + +struct passwd *Posix_Getpwnam(ConstUnicode name); +struct passwd *Posix_Getpwuid(uid_t uid); + +#if !defined(sun) +int Posix_Statfs(ConstUnicode pathName, struct statfs *statfsbuf); +#endif + +int Posix_Setenv(ConstUnicode name, ConstUnicode value, int overWrite); + +int Posix_Getpwnam_r(ConstUnicode name, struct passwd *pw, + char *buf, size_t size, struct passwd **ppw); +int Posix_Getpwuid_r(uid_t uid, struct passwd *pw, + char *buf, size_t size, struct passwd **ppw); +struct passwd *Posix_Getpwent(void); +#if !defined(sun) +int Posix_GetGroupList(ConstUnicode user, gid_t group, gid_t *groups, + int *ngroups); +#endif +struct group *Posix_Getgrnam(ConstUnicode name); +int Posix_Getgrnam_r(ConstUnicode name, struct group *gr, + char *buf, size_t size, struct group **pgr); + +#if !defined(sun) +#if !defined(__APPLE__) && !defined(__FreeBSD__) +int Posix_Mount(ConstUnicode source, ConstUnicode target, + const char *filesystemtype, unsigned long mountflags, + const void *data); +int Posix_Umount(ConstUnicode target); +FILE *Posix_Setmntent(ConstUnicode pathName, const char *mode); +struct mntent *Posix_Getmntent(FILE *fp); +struct mntent *Posix_Getmntent_r(FILE *fp, struct mntent *m, + char *buf, int size); + +#endif // !defined(__APPLE__) && !defined(__FreeBSD__) +#else // !defined(sun) +int Posix_Getmntent(FILE *fp, struct mnttab *mp); + +#endif // !defined(sun) +#endif // !defined(N_PLAT_NLM) +#else // !define(_WIN32) + + +#if defined(_WINSOCKAPI_) || defined(_WINSOCK2API_) +#include +#include "vm_atomic.h" + + +/* + *---------------------------------------------------------------------- + * + * Posix_GetHostName -- + * + * Wrapper for gethostname(). + * + * Results: + * 0 Success + * -1 Error + * + * Side effects: + * On error, error code returned by WSAGetLastError() is updated. + * + *---------------------------------------------------------------------- + */ + +static INLINE int +Posix_GetHostName(Unicode name, // OUT + int namelen) // IN +{ + char *nameMBCS = (char *)Util_SafeMalloc(namelen); + Unicode nameUTF8; + int retval; + + ASSERT(name); + + retval = gethostname(nameMBCS, namelen); + + if (retval == 0) { + nameUTF8 = Unicode_Alloc(nameMBCS, STRING_ENCODING_DEFAULT); + if (!Unicode_CopyBytes(name, nameUTF8, namelen, NULL, STRING_ENCODING_UTF8)) { + retval = -1; + WSASetLastError(WSAEFAULT); + } + Unicode_Free(nameUTF8); + } + + free(nameMBCS); + + return retval; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_GetHostByName -- + * + * Wrapper for gethostbyname(). Caller should release memory + * allocated for the hostent structure returned by calling + * Posix_FreeHostent(). + * + * TODO: Implement this wrapper and Posix_FreeHostent() for the + * non-Windows platforms. + * + * Results: + * NULL Error + * !NULL Pointer to hostent structure + * + * Side effects: + * On error, error code returned by WSAGetLastError() is updated. + * + *---------------------------------------------------------------------- + */ + +static INLINE struct hostent* +Posix_GetHostByName(ConstUnicode name) // IN +{ + struct hostent *newhostent; + char *nameMBCS; + struct hostent *hostentMBCS; + struct hostent *ret = NULL; + + ASSERT(name); + + nameMBCS = (char *)Unicode_GetAllocBytes(name, STRING_ENCODING_DEFAULT); + + if (nameMBCS != NULL) { + hostentMBCS = gethostbyname(nameMBCS); + free(nameMBCS); + + if (hostentMBCS != NULL) { + newhostent = (struct hostent *)Util_SafeMalloc(sizeof *newhostent); + + newhostent->h_name = Unicode_Alloc(hostentMBCS->h_name, + STRING_ENCODING_DEFAULT); + if (hostentMBCS->h_aliases) { + newhostent->h_aliases = Unicode_AllocList(hostentMBCS->h_aliases, -1, + STRING_ENCODING_DEFAULT); + } else { + newhostent->h_aliases = NULL; + } + newhostent->h_addrtype = hostentMBCS->h_addrtype; + newhostent->h_length = hostentMBCS->h_length; + newhostent->h_addr_list = hostentMBCS->h_addr_list; + ret = newhostent; + } + } else { + /* There has been an error converting from UTF-8 to local encoding. */ + WSASetLastError(WSANO_RECOVERY); + } + + return ret; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_FreeHostent -- + * + * Free the memory allocated for an hostent structure returned + * by Posix_AllocGetHostByName. + * + * Results: + * None. + * + * Side effects: + * NOne. + * + *---------------------------------------------------------------------- + */ + +static INLINE void +Posix_FreeHostent(struct hostent *he) +{ + if (he) { + Unicode_Free(he->h_name); + if (he->h_aliases) { + Unicode_FreeList(he->h_aliases, -1); + } + free(he); + } +} +#endif // defined(_WINSOCKAPI_) || defined(_WINSOCK2API_) + +#ifdef _WS2TCPIP_H_ +typedef int (WINAPI *GetAddrInfoWFnType)(PCWSTR pNodeName, PCWSTR pServiceName, + const struct addrinfo *pHints, + struct addrinfo **ppResult); +typedef int (WINAPI *GetNameInfoWFnType)(const SOCKADDR *pSockaddr, + socklen_t SockAddrLength, + PWCHAR pNodeBuffer, + DWORD NodeBufferSize, + PWCHAR pServiceBuffer, + DWORD ServiceBufferSize, + INT flags); + + +/* + *---------------------------------------------------------------------- + * + * Posix_GetAddrInfo -- + * + * Wrapper for getaddrinfo(). + * + * Results: + * 0 Success + * != 0 Error + * + * Side effects: + * On error, error code returned by WSAGetLastError() is updated. + * + *---------------------------------------------------------------------- + */ + +static INLINE int +Posix_GetAddrInfo(ConstUnicode nodename, // IN + ConstUnicode servname, // IN + const struct addrinfo *hints, // IN + struct addrinfo **res) // OUT +{ + HMODULE hWs2_32; + int retval; + char *nodenameMBCS; + char *servnameMBCS; + GetAddrInfoWFnType GetAddrInfoWFn; + + ASSERT(nodename || servname); + ASSERT(res); + + hWs2_32 = LoadLibraryA("ws2_32"); + + if (hWs2_32) { + /* + * If the unicode version of getaddrinfo exists, use it. The string + * conversion required is between UTF-8 and UTF-16 encodings. Note + * that struct addrinfo and ADDRINFOW are identical except for the + * fields ai_canonname (char * vs. PWSTR) and ai_next (obviously). + */ + + GetAddrInfoWFn = (GetAddrInfoWFnType)GetProcAddress(hWs2_32, "GetAddrInfoW"); + + if (GetAddrInfoWFn) { + utf16_t *nodenameW = Unicode_GetAllocUTF16(nodename); + utf16_t *servnameW = Unicode_GetAllocUTF16(servname); + + retval = (*GetAddrInfoWFn)(nodenameW, servnameW, hints, res); + + if (retval == 0) { + struct addrinfo *cur; + utf16_t *tempW; + + for (cur = *res; cur != NULL; cur = cur->ai_next) { + if (cur->ai_canonname) { + tempW = (utf16_t *)cur->ai_canonname; + cur->ai_canonname = Unicode_AllocWithUTF16(tempW); + free(tempW); + } + } + } + + free(nodenameW); + free(servnameW); + + goto exit; + } + } + + /* + * We did not find the unicode version of getaddrinfo, so we need to + * convert strings to and from the local encoding. + */ + + nodenameMBCS = (char *)Unicode_GetAllocBytes(nodename, STRING_ENCODING_DEFAULT); + servnameMBCS = (char *)Unicode_GetAllocBytes(servname, STRING_ENCODING_DEFAULT); + + retval = getaddrinfo(nodenameMBCS, servnameMBCS, hints, res); + + if (retval == 0) { + struct addrinfo *cur; + char *temp; + + for (cur = *res; cur != NULL; cur = cur->ai_next) { + if (cur->ai_canonname) { + temp = cur->ai_canonname; + cur->ai_canonname = Unicode_Alloc(temp, STRING_ENCODING_DEFAULT); + free(temp); + } + } + } + + free(nodenameMBCS); + free(servnameMBCS); + +exit: + if (hWs2_32) { + FreeLibrary(hWs2_32); + } + + return retval; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_GetNameInfo -- + * + * Wrapper for getnameinfo(). + * + * Results: + * 0 Success + * != 0 Error + * + * Side effects: + * On error, error code returned by WSAGetLastError() is updated. + * + *---------------------------------------------------------------------- + */ + +static INLINE int +Posix_GetNameInfo(const struct sockaddr *sa, // IN + socklen_t salen, // IN + Unicode host, // OUT + DWORD hostlen, // IN + Unicode serv, // OUT + DWORD servlen, // IN + int flags) // IN +{ + HMODULE hWs2_32; + int retval; + char *hostMBCS = NULL; + char *servMBCS = NULL; + utf16_t *hostW = NULL; + utf16_t *servW = NULL; + Unicode hostUTF8 = NULL; + Unicode servUTF8 = NULL; + GetNameInfoWFnType GetNameInfoWFn; + + hWs2_32 = LoadLibraryA("ws2_32"); + + if (hWs2_32) { + /* + * If the unicode version of getnameinfo exists, use it. The string + * conversion required is between UTF-8 and UTF-16 encodings. + */ + + GetNameInfoWFn = (GetNameInfoWFnType)GetProcAddress(hWs2_32, "GetNameInfoW"); + + if (GetNameInfoWFn) { + if (host) { + hostW = (utf16_t *)Util_SafeMalloc(hostlen * sizeof *hostW); + } + if (serv) { + servW = (utf16_t *)Util_SafeMalloc(servlen * sizeof *servW); + } + + retval = (*GetNameInfoWFn)(sa, salen, hostW, hostlen, servW, servlen, flags); + + if (retval == 0) { + if (host) { + hostUTF8 = Unicode_AllocWithUTF16(hostW); + + if (!Unicode_CopyBytes(host, hostUTF8, hostlen, NULL, + STRING_ENCODING_UTF8)) { + retval = EAI_MEMORY; + WSASetLastError(WSA_NOT_ENOUGH_MEMORY); + goto exit; + } + } + if (serv) { + servUTF8 = Unicode_AllocWithUTF16(servW); + + if (!Unicode_CopyBytes(serv, servUTF8, servlen, NULL, + STRING_ENCODING_UTF8)) { + retval = EAI_MEMORY; + WSASetLastError(WSA_NOT_ENOUGH_MEMORY); + goto exit; + } + } + } + + goto exit; + } + } + + /* + * We did not find the unicode version of getnameinfo, so we need to + * convert strings to and from the local encoding. + */ + + if (host) { + hostMBCS = (char *)Util_SafeMalloc(hostlen * sizeof *hostMBCS); + } + if (serv) { + servMBCS = (char *)Util_SafeMalloc(servlen * sizeof *servMBCS); + } + + retval = getnameinfo(sa, salen, hostMBCS, hostlen, servMBCS, servlen, flags); + + if (retval == 0) { + if (host) { + hostUTF8 = Unicode_Alloc(hostMBCS, STRING_ENCODING_DEFAULT); + + if (!Unicode_CopyBytes(host, hostUTF8, hostlen, NULL, + STRING_ENCODING_UTF8)) { + retval = EAI_MEMORY; + WSASetLastError(WSA_NOT_ENOUGH_MEMORY); + goto exit; + } + } + if (serv) { + servUTF8 = Unicode_Alloc(servMBCS, STRING_ENCODING_DEFAULT); + + if (!Unicode_CopyBytes(serv, servUTF8, servlen, NULL, + STRING_ENCODING_UTF8)) { + retval = EAI_MEMORY; + WSASetLastError(WSA_NOT_ENOUGH_MEMORY); + goto exit; + } + } + } + +exit: + if (hWs2_32) { + FreeLibrary(hWs2_32); + free(hostW); + free(servW); + } + free(hostMBCS); + free(servMBCS); + free(hostUTF8); + free(servUTF8); + + return retval; +} +#endif // ifdef _WS2TCPIP_H_ +#endif // !define(_WIN32) + +#if (defined(VMX86_SERVER) || defined(__APPLE__)) && \ + !defined(UNICODE_BUILDING_POSIX_WRAPPERS) +/* + * ESX and MacOS X are UTF-8 environments so these functions can be + * "defined away" - the POSIX wrapper call can be directly mapped to the + * POSIX function avoiding unneccesary (call and handling) overhead. + * + * NOTE: PLEASE KEEP THESE IN SORTED ORDER + */ +#define Posix_Access access +#define Posix_Chdir chdir +#define Posix_Chmod chmod +#define Posix_Chown chown +#define Posix_Creat creat +#define Posix_Dlopen dlopen +#define Posix_Execl execl +#define Posix_Execlp execlp +#define Posix_Execv execv +#define Posix_Execve execve +#define Posix_Execvp execvp +#define Posix_Fopen fopen +#define Posix_Fprintf fprintf +#define Posix_Freopen freopen +#define Posix_Getenv getenv +#define Posix_GetGroupList getgrouplist +#define Posix_Getmntent getmntent +#define Posix_Getmntent_r getmntent_r +#define Posix_Getpwnam getpwnam +#define Posix_Getpwnam_r getpwnam_r +#define Posix_Getpwuid getpwuid +#define Posix_Getpwuid_r getpwuid_r +#define Posix_Getgrnam getgrnam +#define Posix_Getgrnam_r getgrnam_r +#define Posix_Lchown lchown +#define Posix_Link link +#define Posix_Lstat lstat +#define Posix_Mkdir mkdir +#define Posix_Mkfifo mkfifo +#define Posix_Mknod mknod +#define Posix_Mount mount +#define Posix_Open open +#define Posix_OpenDir opendir +#define Posix_Pathconf pathconf +#define Posix_Perror perror +#define Posix_Popen popen +#define Posix_Printf printf +#define Posix_Putenv putenv +#define Posix_Rename rename +#define Posix_Rmdir rmdir +#define Posix_Setenv setenv +#define Posix_Setmntent setmntent +#define Posix_Stat stat +#define Posix_Statfs statfs +#define Posix_Symlink symlink +#define Posix_System system +#define Posix_Truncate truncate +#define Posix_Umount umount +#define Posix_Unlink unlink +#define Posix_Unsetenv unsetenv +#define Posix_Utime utime +#define Posix_Utimes utimes +#endif + +#endif // _POSIX_H_ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/preference.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/preference.h --- open-vm-tools-2008.01.23-74039/lib/include/preference.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/preference.h 2008-10-13 08:01:49.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -30,7 +30,6 @@ extern Bool Preference_Init(void); extern Bool Preference_InitEx(struct KeyLocatorState *klState); extern void Preference_Exit(void); -extern void Preference_Reset(void); extern Bool Preference_GetBool(Bool defaultValue, const char *fmt); extern int32 Preference_GetTriState(int32 defaultValue, const char *fmt); extern int32 Preference_GetLong(int32 defaultValue, const char *fmt); diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/printer.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/printer.h --- open-vm-tools-2008.01.23-74039/lib/include/printer.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/printer.h 2008-10-13 08:01:49.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/procMgr.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/procMgr.h --- open-vm-tools-2008.01.23-74039/lib/include/procMgr.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/procMgr.h 2008-10-13 08:01:49.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -28,7 +28,6 @@ #ifndef __PROCMGR_H__ # define __PROCMGR_H__ - #include "vm_basic_types.h" #if !defined(N_PLAT_NLM) #include "auth.h" @@ -60,8 +59,8 @@ size_t procCount; ProcMgr_Pid *procIdList; - char **procCmdList; - char **procOwnerList; + char **procCmdList; // UTF-8 + char **procOwnerList; // UTF-8 #if defined(_WIN32) Bool *procDebugged; #endif @@ -103,13 +102,13 @@ typedef struct ProcMgr_ProcArgs { HANDLE hToken; - LPCTSTR lpApplicationName; + LPCWSTR lpApplicationName; LPSECURITY_ATTRIBUTES lpProcessAttributes; LPSECURITY_ATTRIBUTES lpThreadAttributes; BOOL bInheritHandles; DWORD dwCreationFlags; LPVOID lpEnvironment; - LPCTSTR lpCurrentDirectory; + LPCWSTR lpCurrentDirectory; LPSTARTUPINFO lpStartupInfo; } ProcMgr_ProcArgs; #else @@ -130,8 +129,11 @@ void ProcMgr_FreeProcList(ProcMgr_ProcList *procList); Bool ProcMgr_KillByPid(ProcMgr_Pid procId); -Bool ProcMgr_ExecSync(char const *cmd, ProcMgr_ProcArgs *userArgs); -ProcMgr_AsyncProc *ProcMgr_ExecAsync(char const *cmd, ProcMgr_ProcArgs *userArgs); + +Bool ProcMgr_ExecSync(char const *cmd, // UTF-8 + ProcMgr_ProcArgs *userArgs); +ProcMgr_AsyncProc *ProcMgr_ExecAsync(char const *cmd, // UTF-8 + ProcMgr_ProcArgs *userArgs); void ProcMgr_Kill(ProcMgr_AsyncProc *asyncProc); Bool ProcMgr_GetAsyncStatus(ProcMgr_AsyncProc *asyncProc, Bool *status); Selectable ProcMgr_GetAsyncProcSelectable(ProcMgr_AsyncProc *asyncProc); @@ -139,10 +141,10 @@ Bool ProcMgr_IsAsyncProcRunning(ProcMgr_AsyncProc *asyncProc); int ProcMgr_GetExitCode(ProcMgr_AsyncProc *asyncProc, int *result); void ProcMgr_Free(ProcMgr_AsyncProc *asyncProc); -#if !defined(N_PLAT_NLM) -Bool ProcMgr_ImpersonateUserStart(const char *user, AuthToken token); +#if !defined(N_PLAT_NLM) && !defined(_WIN32) +Bool ProcMgr_ImpersonateUserStart(const char *user, // UTF-8 + AuthToken token); Bool ProcMgr_ImpersonateUserStop(void); #endif - #endif /* __PROCMGR_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/productState.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/productState.h --- open-vm-tools-2008.01.23-74039/lib/include/productState.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/productState.h 2008-10-13 08:01:49.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -41,6 +41,8 @@ PRODUCT_ESX = 1 << 2, PRODUCT_PLAYER = 1 << 3, PRODUCT_TOOLS = 1 << 4, + PRODUCT_VDM_CLIENT = 1 << 5, + PRODUCT_CVP = 1 << 6, /* etc */ } Product; typedef uint64 ProductMask; diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/random.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/random.h --- open-vm-tools-2008.01.23-74039/lib/include/random.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/random.h 2008-10-13 08:01:49.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/rasterConv.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/rasterConv.h --- open-vm-tools-2008.01.23-74039/lib/include/rasterConv.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/rasterConv.h 2008-10-13 08:01:50.000000000 +0100 @@ -0,0 +1,88 @@ +/********************************************************* + * Copyright (C) 1998 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. + * + *********************************************************/ + +/* + * rasterConv.h -- + * + * Pixel conversion routines + */ + +#ifndef _RASTER_CONV_H_ +#define _RASTER_CONV_H_ + +#define INCLUDE_ALLOW_USERLEVEL +#include "includeCheck.h" + +/* + * To minimize the amount of code needed to support the rarely-useful + * BGR111 and BGR222 modes, their masks are defined to match the + * appropriate number of high bits of the BGR233 masks. + */ + +#define REDMASK_BGR111 0x04 +#define GREENMASK_BGR111 0x20 +#define BLUEMASK_BGR111 0x80 + +#define REDMASK_RGB222 0x30 +#define GREENMASK_RGB222 0x0c +#define BLUEMASK_RGB222 0x03 + +#define REDMASK_BGR222 0x03 +#define GREENMASK_BGR222 0x0c +#define BLUEMASK_BGR222 0x30 + +#define REDMASK_BGR233 0x07 +#define GREENMASK_BGR233 0x38 +#define BLUEMASK_BGR233 0xc0 + +#define REDMASK_15 0x7c00 +#define GREENMASK_15 0x03e0 +#define BLUEMASK_15 0x001f + +#define GREEN_HIBIT_15 0x0200 +#define GREEN_HILOSHIFT_15 4 + +#define REDMASK_16 0xf800 +#define GREENMASK_16 0x07e0 +#define BLUEMASK_16 0x001f + +#define REDMASK_24 0x00ff0000 +#define GREENMASK_24 0x0000ff00 +#define BLUEMASK_24 0x000000ff + +#define REDMASK_32 0x00ff0000 +#define GREENMASK_32 0x0000ff00 +#define BLUEMASK_32 0x000000ff + +Bool Raster_IsModeReasonable(uint32 depth, uint32 bpp, Bool pseudocolor); + +int Raster_GetBPPDepth(uint32 depth, uint32 bpp); + +void Raster_ConvertPixels(uint8 *tof, int32 line_increment, int bppdepth, + uint8 *src, int32 src_increment, int src_bppdepth, + Bool pseudoColor, uint32 *pixels, + uint32 src_x, uint32 src_y, + uint32 x, uint32 y, uint32 w, uint32 h); + +uint32 Raster_ConvertOnePixel(uint32 pixel, int src_depth, int depth, + Bool pseudoColor, uint32 *pixels); + +Bool Raster_ConversionParameters(int depth, uint32 *redMask, + uint32 *greenMask, uint32 *blueMask); + +#endif // _RASTER_CONV_H_ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/region.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/region.h --- open-vm-tools-2008.01.23-74039/lib/include/region.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/region.h 2008-10-13 08:01:49.000000000 +0100 @@ -0,0 +1,267 @@ +/* ********************************************************** + * Copyright (C) 2002 VMware, Inc. + * All Rights Reserved + * **********************************************************/ + +/* $Xorg: regionstr.h,v 1.4 2001/02/09 02:05:15 xorgcvs Exp $ */ +/*********************************************************** + +Copyright 1987, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +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 +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + + +Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Digital not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +DIGITAL BE LIABLE FOR 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. + +******************************************************************/ +/* $XFree86: xc/programs/Xserver/include/regionstr.h,v 1.7 2001/12/14 19:59:56 dawes Exp $ */ + +/* + * region.h -- + * + * Interface definition for miRegion operations. Originally from X11 + * source distribution. This version includes modifications made for the + * VNC Reflector package. + * + * ChangeLog: + * + * 07/21/2003 rrdharan - added miRegionArea function prototype + * - added REGION_AREA wrapper macro + * - added this header, removed whitespace + * 08/02/2005 akan - fixed conflicting definition of MINSHORT + * and MAXSHORT with winnt.h + * 04/03/2007 shelleygong - use int instead of short for data + * inside the region + */ + +#ifndef __REGION_H__ +#define __REGION_H__ + +#include "vmware.h" + +#ifdef _WIN32 +/* + * lib/region has terrible short/long confusion problems. For MSFT, + * disable the warning. See PR142264. + */ +#pragma warning( disable: 4242 ) +#endif + +/* Return values from RectIn() */ +#define rgnOUT 0 +#define rgnIN 1 +#define rgnPART 2 + +#define NullBox ((BoxPtr)0) +#define NullRegion ((RegionPtr)0) + +#define R_MAXSHORT 32767 +#define R_MINSHORT (-R_MAXSHORT) + +#define R_MAXINT 0x7FFFFFFF +#define R_MININT 0x8FFFFFFF + +#define CT_YXBANDED 18 + +#define xalloc(n) malloc(n) +#define xrealloc(ptr, n) realloc((ptr), (n)) +#define xfree(ptr) free(ptr) + +typedef enum { + UpdateRect, + ROPFillRect, + Present3dRect, + MaxRect +} RectInfoType; + +typedef struct RectInfo { + RectInfoType type; + union { + struct { + uint32 rop; + uint32 color; + } ROPFill; + struct { + uint32 sid; + uint32 srcx, srcy; + } Present3d; + /* add more here, then update miRectInfosEqual and miPrintRegion. */ + }; +} RectInfo, *RectInfoPtr; + +#define RECTINFO_ISVALID(info) \ + ((info).type >= UpdateRect && (info).type < MaxRect) + +/* + * X data types + */ + +typedef struct _Box { + int x1, y1, x2, y2; + RectInfo info; +} BoxRec, *BoxPtr; + +typedef struct _xPoint { + int x, y; +} xPoint, *xPointPtr; + +typedef xPoint DDXPointRec, *DDXPointPtr; + +typedef struct _xRectangle { + int x, y; + unsigned short width, height; + RectInfo info; +} xRectangle, *xRectanglePtr; + +/* + * clip region + */ + +typedef struct _RegData { + int size; + int numRects; +/* BoxRec rects[size]; in memory but not explicitly declared */ +} RegDataRec, *RegDataPtr; + +typedef struct _Region { + BoxRec extents; + RegDataPtr data; +} RegionRec, *RegionPtr; + +extern BoxRec miEmptyBox; +extern RegDataRec miEmptyData; +extern RegDataRec miBrokenData; + +#define REGION_EXTENTS(reg) (&(reg)->extents) +#define REGION_NIL(reg) ((reg)->data && !(reg)->data->numRects) +#define REGION_NAR(reg) ((reg)->data == &miBrokenData) +#define REGION_NUM_RECTS(reg) ((reg)->data ? (reg)->data->numRects : 1) +#define REGION_SIZE(reg) ((reg)->data ? (reg)->data->size : 0) +#define REGION_RECTS(reg) ((reg)->data ? (BoxPtr)((reg)->data + 1) \ + : &(reg)->extents) +#define REGION_BOXPTR(reg) ((BoxPtr)((reg)->data + 1)) +#define REGION_BOX(reg,i) (®ION_BOXPTR(reg)[i]) +#define REGION_TOP(reg) REGION_BOX(reg, (reg)->data->numRects) +#define REGION_END(reg) REGION_BOX(reg, (reg)->data->numRects - 1) +#define REGION_SZOF(n) (sizeof(RegDataRec) + ((n) * sizeof(BoxRec))) + +#define REGION_VALIDINDEX(reg, i) (i >= 0 && i < REGION_NUM_RECTS((reg))) + +#define RECT_SETBOX(r, rx, ry, rw, rh) do { \ + (r)->x1 = (rx); \ + (r)->x2 = (rx) + (rw); \ + (r)->y1 = (ry); \ + (r)->y2 = (ry) + (rh); \ + (r)->info.type = UpdateRect; \ +} while (FALSE) + +#define RECT_SETRECT(r, rx1, ry1, rx2, ry2) do { \ + RECT_SETBOX((r), (rx1), (ry1), ((rx2) - (rx1)), ((ry2) - (ry1))); \ +} while (FALSE) + +/* + * This will only work if the intersection is not empty. + */ +#define RECT_INTERSECT(r, r1, r2) \ +{ \ + (r)->x1 = MAX((r1)->x1, (r2)->x1); \ + (r)->x2 = MIN((r1)->x2, (r2)->x2); \ + (r)->y1 = MAX((r1)->y1, (r2)->y1); \ + (r)->y2 = MIN((r1)->y2, (r2)->y2); \ +} + +/* + * True iff the two boxes overlap. + */ +#define RECT_EXTENTCHECK(r1, r2) \ + (!( ((r1)->x2 <= (r2)->x1) || \ + ((r1)->x1 >= (r2)->x2) || \ + ((r1)->y2 <= (r2)->y1) || \ + ((r1)->y1 >= (r2)->y2) ) ) + +/* + * True iff both the BoxRecs are identical. + */ +#define RECT_IDENTICAL(r1, r2) \ + (( ((r1)->x1 == (r2)->x1) && \ + ((r1)->x2 == (r2)->x2) && \ + ((r1)->y1 == (r2)->y1) && \ + ((r1)->y2 == (r2)->y2) ) ) + + +extern RegionPtr miRegionCreate(BoxPtr rect, int size); +extern void miRegionInit(RegionPtr pReg, BoxPtr rect, int size); +extern void miRegionDestroy(RegionPtr pReg); +extern void miRegionUninit(RegionPtr pReg); +extern Bool miRegionCopy(RegionPtr dst, RegionPtr src); +extern Bool miIntersect(RegionPtr newReg, RegionPtr reg1, RegionPtr reg2); +extern Bool miUnion(RegionPtr newReg, RegionPtr reg1, RegionPtr reg2); +extern Bool miRegionAppend(RegionPtr dstrgn, RegionPtr rgn); +extern Bool miRegionValidate(RegionPtr badreg, Bool *pOverlap); +extern RegionPtr miRectsToRegion(int nrects, xRectanglePtr prect, int ctype); +extern RegionPtr miRectsToRegionbyBoundary(int nrects, xRectanglePtr prect, int ctype, + int minValue, int maxValue); +extern Bool miSubtract(RegionPtr regD, RegionPtr regM, RegionPtr regS); +extern Bool miInverse(RegionPtr newReg, RegionPtr reg1, BoxPtr invRect); +extern int miRectIn(RegionPtr region, BoxPtr prect); +extern void miTranslateRegion(RegionPtr pReg, int x, int y); +extern void miTranslateRegionByBoundary(RegionPtr pReg, int x, int y, + int minValue, int maxValue); +extern void miRegionReset(RegionPtr pReg, BoxPtr pBox); +extern Bool miRegionBreak(RegionPtr pReg); +extern Bool miPointInRegion(RegionPtr pReg, int x, int y, BoxPtr box); +extern Bool miRegionNotEmpty(RegionPtr pReg); +extern void miRegionEmpty(RegionPtr pReg); +extern Bool miRegionsEqual(RegionPtr reg1, RegionPtr reg2); +extern BoxPtr miRegionExtents(RegionPtr pReg); +extern int miRegionArea(RegionPtr pReg); +extern void miRegionPack(RegionPtr pReg, int threshold); + +extern Bool miApplyRect(RegionPtr newReg, RegionPtr reg, BoxPtr rect, + Bool (*op) (RegionPtr, RegionPtr, RegionPtr)); +extern int miPrintRegion(RegionPtr rgn); + +typedef Bool (*miRegionMatchFunc)(BoxPtr box, uintptr_t userData); +extern Bool miRegionMatch(RegionPtr newReg, RegionPtr reg, + miRegionMatchFunc match, uintptr_t userData); + +// Extension to REGION_NIL that also checks for a 0 x 0 bounding rect. +extern Bool miIsRegionVoid(RegionPtr pReg); + +#endif /* __REGION_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/removable_device.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/removable_device.h --- open-vm-tools-2008.01.23-74039/lib/include/removable_device.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/removable_device.h 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/resolution.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/resolution.h --- open-vm-tools-2008.01.23-74039/lib/include/resolution.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/resolution.h 2008-10-13 08:01:49.000000000 +0100 @@ -0,0 +1,90 @@ +/********************************************************* + * Copyright (C) 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. + * + *********************************************************/ + +/* + * resolution.h -- + * + * Library for the guest resolution and topology fit/resize capabilities. + * This library handles its own RPC callbacks, and it's intended to more + * or less operate independently of the client application. + * + * Client applications are expected to do (roughly) the following: + * // Init library. + * Resolution_Init(); + * + * // Register RpcIn callbacks. + * Resolution_InitBackdoor(); + * + * // Call this in response to getting a/ capreg message from the host. + * Resolution_RegisterCaps(); + * + * // Call this when you're finished with the library and wish to reclaim + * // resources. + * Resolution_Cleanup(); + * + * In response to a TCLO reset or to otherwise (temporarily) disable the + * library, one can also call Resolution_UnregisterCaps(). (This routine + * is also called implicitly by Resolution_Cleanup().) + */ + +#ifndef _LIB_RESOLUTION_H_ +#define _LIB_RESOLUTION_H_ + +#define INCLUDE_ALLOW_USERLEVEL +#define INCLUDE_ALLOW_DISTRIBUTE +#include "includeCheck.h" + +#include "vmware.h" +#include "rpcin.h" + + +/* + * Data types + */ + +/* + * Argument to be passed to Resolution_Init(). Users of the X11 backend + * should provide a Display *. Not sure what users of Mac OS X will need + * to provide, if anything. + */ +#if defined(RESOLUTION_X11) +# include +# undef Bool +typedef Display * InitHandle; + +#elif defined(__APPLE__) +typedef void * InitHandle; +#else +# error Unknown display backend +#endif + + +/* + * Global functions + */ + +Bool Resolution_Init(const char *tcloChannel, InitHandle handle); +void Resolution_Cleanup(void); + +void Resolution_InitBackdoor(RpcIn *rpcIn); +void Resolution_CleanupBackdoor(void); + +Bool Resolution_RegisterCaps(void); +Bool Resolution_UnregisterCaps(void); + +#endif // ifndef _LIB_RESOLUTION_H_ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/rpcin.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/rpcin.h --- open-vm-tools-2008.01.23-74039/lib/include/rpcin.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/rpcin.h 2008-10-13 08:01:49.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -27,36 +27,91 @@ #ifndef __RPCIN_H__ # define __RPCIN_H__ -#include "dbllnklst.h" +#if defined(VMTOOLS_USE_GLIB) +# include +#else +# include "dbllnklst.h" +#endif + +/* Helper macro for porting old callbacks that currently use RpcIn_SetRetVals. */ +#define RPCIN_SETRETVALS(data, val, retVal) \ + RpcIn_SetRetVals((char const **) &(data)->result, &(data)->resultLen, \ + (val), (retVal)) typedef void RpcIn_ErrorFunc(void *clientData, char const *status); typedef struct RpcIn RpcIn; +/* Data passed to new-style RpcIn callbacks. */ +typedef struct RpcInData { + /* Data from the host's RPC request. */ + const char *name; + const char *args; + size_t argsSize; + /* Data to be returned to the host. */ + char *result; + size_t resultLen; + Bool freeResult; + /* Client data. */ + void *appCtx; + void *clientData; +} RpcInData; + + /* - * Type for RpcIn callbacks. The command is the prefix of message and - * that result may be NULL. The callback function is responsible for + * Type for RpcIn callbacks. The callback function is responsible for * allocating memory for the result string. */ +typedef Bool (*RpcIn_Callback)(RpcInData *data); + + +#if defined(VMTOOLS_USE_GLIB) + +RpcIn *RpcIn_Construct(GMainLoop *mainLoop, + RpcIn_Callback dispatch, + gpointer clientData); + +Bool RpcIn_start(RpcIn *in, unsigned int delay, + RpcIn_ErrorFunc *errorFunc, void *errorData); + +#else + +/* + * Type for old RpcIn callbacks. Don't use this anymore - this is here + * for backwards compatibility. + */ typedef Bool -(*RpcIn_Callback)(char const **result, // OUT - size_t *resultLen, // OUT - const char *name, // IN - const char *args, // IN - size_t argsSize, // IN - void *clientData); // IN +(*RpcIn_CallbackOld)(char const **result, // OUT + size_t *resultLen, // OUT + const char *name, // IN + const char *args, // IN + size_t argsSize, // IN + void *clientData); // IN RpcIn *RpcIn_Construct(DblLnkLst_Links *eventQueue); -void RpcIn_Destruct(RpcIn *in); + Bool RpcIn_start(RpcIn *in, unsigned int delay, RpcIn_Callback resetCallback, void *resetClientData, RpcIn_ErrorFunc *errorFunc, void *errorData); -Bool RpcIn_restart(RpcIn *in); -Bool RpcIn_stop(RpcIn *in); + +/* + * Don't use this function anymore - it's here only for backwards compatibility. + * Use RpcIn_RegisterCallbackEx() instead. + */ void RpcIn_RegisterCallback(RpcIn *in, const char *name, - RpcIn_Callback callback, void *clientData); + RpcIn_CallbackOld callback, void *clientData); + +void RpcIn_RegisterCallbackEx(RpcIn *in, const char *name, + RpcIn_Callback callback, void *clientData); void RpcIn_UnregisterCallback(RpcIn *in, const char *name); + +#endif + +void RpcIn_Destruct(RpcIn *in); +Bool RpcIn_restart(RpcIn *in); +Bool RpcIn_stop(RpcIn *in); + unsigned int RpcIn_SetRetVals(char const **result, size_t *resultLen, const char *resultVal, Bool retVal); - #endif /* __RPCIN_H__ */ + diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/rpcout.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/rpcout.h --- open-vm-tools-2008.01.23-74039/lib/include/rpcout.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/rpcout.h 2008-10-13 08:01:49.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/rpcvmx.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/rpcvmx.h --- open-vm-tools-2008.01.23-74039/lib/include/rpcvmx.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/rpcvmx.h 2008-10-13 08:01:49.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/runDeployPkgInt.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/runDeployPkgInt.h --- open-vm-tools-2008.01.23-74039/lib/include/runDeployPkgInt.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/runDeployPkgInt.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,62 +0,0 @@ -/********************************************************* - * Copyright (C) 2006 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 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. - * - *********************************************************/ - -/* - * runDeployPkgInt.h -- - * - * c interface to load the deployPkg library and call the - * DeployPkg_DeployPackageFromFile export - */ - -#ifndef _RUN_DEPLOYPKG_INT_H -#define _RUN_DEPLOYPKG_INT_H - -#ifdef __cplusplus -extern "C" { -#endif - -#include "vm_basic_types.h" -#include "toolsDeployPkg.h" - -/* - * DeployPkg logger. In order to add the LogFunction pointer definition - * to tools, we'd need to populate the component before the service - * build, which would force anyone building tools to connect to the - * component repo. To avoid that, duplicate the definition here: - */ -typedef void (*DeployPkgLogFunction) (int level, const char *fmtstr, ...); - -/* Function pointers for exports in dll/so */ -typedef int (*DeployPkgFromFileFn)(const char*); -typedef void (*DeployPkgSetLogFn)(DeployPkgLogFunction); - -/* Decorated function names from deployPkg.dll */ -#define FNAME_DEPLOYPKGFROMFILE "DeployPkg_DeployPackageFromFile" -#define FNAME_SETLOGGER "DeployPkg_SetLogger" - -ToolsDeployPkgError -DeployPkgDeployPkgInGuest(const char* pkgFile, // IN: the package filename - char* errBuf, // OUT: buffer for msg on fail - int errBufSize); // IN: size of errBuf - -#ifdef __cplusplus -} -#endif - -#endif // _RUN_DEPLOYPKG_INT_H - diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/safetime.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/safetime.h --- open-vm-tools-2008.01.23-74039/lib/include/safetime.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/safetime.h 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/SLPv2.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/SLPv2.h --- open-vm-tools-2008.01.23-74039/lib/include/SLPv2.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/SLPv2.h 2008-10-13 08:01:49.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/SLPv2Private.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/SLPv2Private.h --- open-vm-tools-2008.01.23-74039/lib/include/SLPv2Private.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/SLPv2Private.h 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/socketMgr.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/socketMgr.h --- open-vm-tools-2008.01.23-74039/lib/include/socketMgr.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/socketMgr.h 2008-10-13 08:01:49.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/statelogger_backdoor_def.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/statelogger_backdoor_def.h --- open-vm-tools-2008.01.23-74039/lib/include/statelogger_backdoor_def.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/statelogger_backdoor_def.h 2008-10-13 08:01:50.000000000 +0100 @@ -0,0 +1,42 @@ +/********************************************************* + * Copyright (C) 2007 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. + * + *********************************************************/ + +/* + * statelogger_backdoor_def.h -- + * + * Backdoor command definitions for record/replay. + */ + +#ifndef _STATELOGGER_BACKDOOR_DEF_H_ +#define _STATELOGGER_BACKDOOR_DEF_H_ + +#define INCLUDE_ALLOW_MODULE +#define INCLUDE_ALLOW_USERLEVEL +#define INCLUDE_ALLOW_VMMEXT +#define INCLUDE_ALLOW_VMCORE +#define INCLUDE_ALLOW_VMKERNEL +#include "includeCheck.h" + +#define STATELOGGER_BKDR_VM_REPLAYABLE 0 +#define STATELOGGER_BKDR_START_LOGGING 1 +#define STATELOGGER_BKDR_STOP_LOGGING 2 +#define STATELOGGER_BKDR_LAST_SNAPSHOT_UID 3 +#define STATELOGGER_BKDR_GET_BRANCH_COUNT 4 +#define STATELOGGER_BKDR_START_REPLAYING 100 + +#endif /* _STATELOGGER_BACKDOOR_DEF_H_ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/staticEscape.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/staticEscape.h --- open-vm-tools-2008.01.23-74039/lib/include/staticEscape.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/staticEscape.h 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/stats_file.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/stats_file.h --- open-vm-tools-2008.01.23-74039/lib/include/stats_file.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/stats_file.h 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/stats_user_defs.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/stats_user_defs.h --- open-vm-tools-2008.01.23-74039/lib/include/stats_user_defs.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/stats_user_defs.h 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -27,6 +27,7 @@ #ifndef STATS_USER_DEFS_H #define STATS_USER_DEFS_H +#define INCLUDE_ALLOW_MODULE #define INCLUDE_ALLOW_USERLEVEL #define INCLUDE_ALLOW_VMCORE #include "includeCheck.h" @@ -45,7 +46,7 @@ #define STATS_USER_INST_NAME(name) \ XCONC(STATINST_, XCONC(STATS_MODULE, _##name)) #define STATS_USER_INIT_INST_FN(name) XCONC(name, _InitInstance) - +#define STATS_USER_GETVAL_FN(name) XCONC(name, _StatsGetVal) typedef struct StatsUserEntry { uint32 count; @@ -60,6 +61,7 @@ EXTERN StatsUserBlock STATS_USER_BLKVAR; +#ifndef STATS_SKIP_ACCESSORS #define STATS_IS_INITIALIZED() (STATS_USER_BLKVAR.counters != NULL) #define STAT_GET(stat) \ (&(STATS_USER_BLKVAR.counters[STATS_USER_NAME(stat)])) @@ -86,4 +88,5 @@ # define STAT_INST_DEC_BY(inst,stat,inc) # define STAT_INST_DEBUG_INC(stat) #endif +#endif /* STATS_SKIP_ACCESSORS */ #endif /* STATS_DEFS_H */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/stats_user_setup.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/stats_user_setup.h --- open-vm-tools-2008.01.23-74039/lib/include/stats_user_setup.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/stats_user_setup.h 2008-10-13 08:01:50.000000000 +0100 @@ -7,15 +7,16 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ +#define INCLUDE_ALLOW_MODULE #define INCLUDE_ALLOW_USERLEVEL #define INCLUDE_ALLOW_VMCORE #include "includeCheck.h" @@ -34,6 +35,10 @@ * is what you need in order to STAT_INC() / DEC() / etc. * - SETUP_DEFINE_VARS: Declares the actual StatsUserBlock with all the * information-- stat names, storage for the counters, etc. + * + * Orthogonally, one can also supply: + * - SETUP_WANT_GETVAL: If the includer wants to also {declare, define} + * a function to retrieve named stat counter values. */ /* @@ -86,6 +91,11 @@ EXTERN void STATS_USER_LOG_FN(STATS_MODULE)(unsigned int epoch, void (*LogFunc)(const char *fmt, ...)); + #ifdef SETUP_WANT_GETVAL + EXTERN Bool STATS_USER_GETVAL_FN(STATS_MODULE)(const char *name, + uint32 *val); + #endif /* SETUP_WANT_GETVAL */ + #undef STAT #undef STAT_INST #endif @@ -176,6 +186,49 @@ } } } + + #ifdef SETUP_WANT_GETVAL + /* + *---------------------------------------------------------------------- + * + * STATS_USER_GETVAL_FN -- + * + * Retrieves the value of a named user stat counter. Returns + * TRUE iff NAME is a recognized user stat counter, and sets + * *VAL to the current value of that counter. + * + * This is an optional function. If a library needs it, use + * SETUP_WANT_GETVAL (see top of the header). + * + * Results: + * See above. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + + Bool + STATS_USER_GETVAL_FN(STATS_MODULE)(const char *name, // IN: counter name + uint32 *val) // OUT: counter val + { + unsigned int i; + + if (!STATS_IS_INITIALIZED()) { + return FALSE; + } + + for (i = 0; i < STATS_USER_BLKVAR.size; i++) { + if (strcmp(STATS_USER_STR_TABLE[i], name) == 0) { + *val = STATS_USER_BLKVAR.counters[i].count; + return TRUE; + } + } + return FALSE; + } + #endif /* SETUP_WANT_GETVAL */ + #undef STATS_USER_STR_TABLE #undef STATS_USER_INST_STR_TABLE #endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/str.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/str.h --- open-vm-tools-2008.01.23-74039/lib/include/str.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/str.h 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -25,6 +25,7 @@ #ifndef _STR_H_ #define _STR_H_ +#define INCLUDE_ALLOW_MODULE #define INCLUDE_ALLOW_USERLEVEL #define INCLUDE_ALLOW_VMCORE #include "includeCheck.h" @@ -46,7 +47,7 @@ * This does not mean it has bsd_vsnwprintf(). */ #if defined _WIN32 && !defined STR_NO_WIN32_LIBS || \ - defined __linux__ && !defined N_PLAT_NLM || __APPLE__ + defined __linux__ && !defined N_PLAT_NLM || defined __APPLE__ #define HAS_BSD_PRINTF 1 #endif @@ -64,6 +65,12 @@ * 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 ASSERT_NOT_IMPLEMENTED. + * + * NOTE: "%s" refers to strings of "char" units, while "%S" refers to + * strings of "wchar_t" units, regardless of platform. */ EXTERN int Str_Sprintf(char *buf, size_t max, @@ -76,18 +83,29 @@ EXTERN char *Str_Strcpy(char *dst, const char *src, size_t maxLen); EXTERN char *Str_Strcat(char *dst, const char *src, size_t maxLen); EXTERN char *Str_Strncat(char *buf, size_t bufSize, const char *src, size_t n); + EXTERN char *Str_Asprintf(size_t *length, const char *format, ...) PRINTF_DECL(2, 3); EXTERN char *Str_Vasprintf(size_t *length, const char *format, va_list arguments); +EXTERN char *Str_SafeAsprintf(size_t *length, + const char *format, ...) PRINTF_DECL(2, 3); +EXTERN char *Str_SafeVasprintf(size_t *length, const char *format, + va_list arguments); -#if defined(_WIN32) || defined(GLIBC_VERSION_22) +#if defined(_WIN32) || defined(GLIBC_VERSION_22) // { /* * 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 ASSERT_NOT_IMPLEMENTED. + * + * NOTE: "%s" refers to strings of "char" units, while "%S" refers to + * strings of "wchar_t" units, regardless of platform. */ EXTERN int Str_Swprintf(wchar_t *buf, size_t max, @@ -100,104 +118,86 @@ EXTERN wchar_t *Str_Wcscat(wchar_t *dst, const wchar_t *src, size_t maxLen); EXTERN wchar_t *Str_Wcsncat(wchar_t *buf, size_t bufSize, const wchar_t *src, size_t n); + EXTERN wchar_t *Str_Aswprintf(size_t *length, const wchar_t *format, ...); EXTERN wchar_t *Str_Vaswprintf(size_t *length, const wchar_t *format, va_list arguments); +EXTERN wchar_t *Str_SafeAswprintf(size_t *length, + const wchar_t *format, ...); +EXTERN wchar_t *Str_SafeVaswprintf(size_t *length, const wchar_t *format, + va_list arguments); + +unsigned char *Str_Mbscpy(char *buf, const char *src, + size_t maxSize); +unsigned char *Str_Mbscat(char *buf, const char *src, + size_t maxSize); + +/* + * 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_Stprintf Str_Swprintf - #define Str_Sntprintf Str_Snwprintf - #define Str_Vsntprintf Str_Vsnwprintf - #define Str_Tcscpy Str_Wcscpy - #define Str_Tcscat Str_Wcscat - #define Str_Tcsncat Str_Wcsncat - #define Str_Astprintf Str_Aswprintf - #define Str_Vastprintf Str_Vaswprintf + #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_Stprintf Str_Sprintf - #define Str_Sntprintf Str_Snprintf - #define Str_Vsntprintf Str_Vsnprintf - #define Str_Tcscpy Str_Strcpy - #define Str_Tcscat Str_Strcat - #define Str_Tcsncat Str_Strncat - #define Str_Astprintf Str_Asprintf - #define Str_Vastprintf Str_Vasprintf + #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(GLIBC_VERSION_22) +#endif // } defined(_WIN32) || defined(GLIBC_VERSION_22) /* - * MsgFmt version of vsnprintf + * Wrappers for standard string functions + * + * These are either for Windows-Posix compatibility, + * or just gratuitous wrapping for consistency. */ -#ifdef HAS_BSD_PRINTF -struct MsgFmt_Arg; -int Str_MsgFmtSnprintfWork(char **outbuf, size_t bufSize, const char *fmt0, - const struct MsgFmt_Arg *args, int numArgs); -#endif +#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) -/* - *---------------------------------------------------------------------- - * - * Str_Strchr -- - * Str_Strrchr -- - * Str_Strspn -- - * Str_Strcspn -- - * - * Str_Strchr, Str_Strrchr: - * const char *str - null-terminated string to search - * int c - character to be located - * Str_Strspn, Str_Strcspn: - * const char *str1 - null-terminated string to search - * const char *str2 - null-terminated string of chars to search for - * - * Macros for MBCS implementation. - * - * All Str_xxxx functions work exactly the same way as the - * corresponding run-time library strxxxx functions. - * - * For Windows implementation, they are mapped to the generic international - * string function names, so that they are compiled either single-byte (ANSI), - * multi-byte (MBCS) or wide char (UNICODE) implementation. - * - * The reason for this work is to mainly take care of filename parsing - * involving DBCS, especially in cases where a DBCS consists of the - * backslash '\' as the 2nd character. - * - * '.' & '/' characters are not affected in DBCS parsing because they - * are defined to be illegal 2nd byte character. - * - *---------------------------------------------------------------------- - */ -#if _WIN32 - #define Str_Strchr(str, c) _tcschr(str, c) - #define Str_Strrchr(str, c) _tcsrchr(str, c) - #define Str_Strspn(str1, str2) _tcsspn(str1, str2) - #define Str_Strcspn(str1, str2) _tcscspn(str1, str2) - #define Str_Strcasecmp(_s1,_s2) _stricmp((_s1),(_s2)) - #define Str_Strncasecmp(_s1,_s2,_n) _strnicmp((_s1),(_s2),(_n)) - #define Str_Strncmp(_s1,_s2,_n) strncmp((_s1),(_s2),(_n)) - #define Str_ToUpper(str) _tcsupr(str) - #define Str_ToLower(str) _tcslwr(str) +#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) +#elif defined(N_PLAT_NLM) + #define Str_Strcasecmp(s1, s2) stricmp(s1, s2) + #define Str_Strncasecmp(s1, s2, n) strnicmp(s1, s2, n) + char *Str_ToUpper(char *string); + char *Str_ToLower(char *string); #else - #define Str_Strchr(str, c) strchr(str, c) - #define Str_Strrchr(str, c) strrchr(str, c) - #define Str_Strspn(str1, str2) strspn(str1, str2) - #define Str_Strcspn(str1, str2) strcspn(str1, str2) - #define Str_Strcasecmp(_s1,_s2) strcasecmp((_s1),(_s2)) - #define Str_Strncasecmp(_s1,_s2,_n) strncasecmp((_s1),(_s2),(_n)) - #define Str_Strncmp(_s1,_s2,_n) strncmp((_s1),(_s2),(_n)) - - EXTERN char * _Str_ToUpper(char *str); - #define Str_ToUpper(str) _Str_ToUpper((str)) - - EXTERN char * _Str_ToLower(char *str); - #define Str_ToLower(str) _Str_ToLower((str)) -#endif // _WIN32 + #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_ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/strutil.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/strutil.h --- open-vm-tools-2008.01.23-74039/lib/include/strutil.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/strutil.h 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -26,7 +26,10 @@ #ifndef STRUTIL_H #define STRUTIL_H +#include + #include "fileIO.h" +#include "dynbuf.h" char * StrUtil_GetNextToken(unsigned int *index, const char *str, const char *delimiters); @@ -39,24 +42,18 @@ Bool StrUtil_StrToInt(int32 *out, const char *str); Bool StrUtil_StrToUint(uint32 *out, const char *str); Bool StrUtil_StrToInt64(int64 *out, const char *str); +Bool StrUtil_StrToSizet(size_t *out, const char *str); +Bool StrUtil_DecimalStrToUint(unsigned int *out, const char **str); char * StrUtil_FormatSizeInBytesUnlocalized(uint64 size); size_t StrUtil_GetLongestLineLength(const char *buf, size_t bufLength); -char **StrUtil_Split(const char *filename, - const char *delimiter); - -char **StrUtil_Grep(const char *filename, - const char *search, - const char *delimiter); - -char **StrUtil_GrepFd(FileIODescriptor *fd, - const char *search, - const char *delimiter); - -void StrUtil_GrepFree(char **retval); - Bool StrUtil_StartsWith(const char *s, const char *prefix); Bool StrUtil_CaselessStartsWith(const char *s, const char *prefix); +Bool StrUtil_EndsWith(const char *s, const char *suffix); + +Bool StrUtil_VDynBufPrintf(DynBuf *b, const char *fmt, va_list args); +Bool StrUtil_DynBufPrintf(DynBuf *b, const char *fmt, ...); +void StrUtil_SafeDynBufPrintf(DynBuf *b, const char *fmt, ...); #endif /* STRUTIL_H */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/su.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/su.h --- open-vm-tools-2008.01.23-74039/lib/include/su.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/su.h 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/syncDriver.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/syncDriver.h --- open-vm-tools-2008.01.23-74039/lib/include/syncDriver.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/syncDriver.h 2008-10-13 08:01:49.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/syncDriverIoc.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/syncDriverIoc.h --- open-vm-tools-2008.01.23-74039/lib/include/syncDriverIoc.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/syncDriverIoc.h 2008-10-13 08:01:49.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/syncEvent.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/syncEvent.h --- open-vm-tools-2008.01.23-74039/lib/include/syncEvent.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/syncEvent.h 2008-10-13 08:01:49.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/syncMutex.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/syncMutex.h --- open-vm-tools-2008.01.23-74039/lib/include/syncMutex.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/syncMutex.h 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -47,8 +47,6 @@ * SyncMutex -- */ -#define MUTEX_MAX_PATH WAITQ_MAX_PATH - typedef struct SyncMutex { #if defined(N_PLAT_NLM) LONG semaphoreHandle; @@ -69,6 +67,10 @@ Bool SyncMutex_Lock(SyncMutex *that); Bool SyncMutex_Unlock(SyncMutex *that); +#if !defined(N_PLAT_NLM) +Bool SyncMutex_Trylock(SyncMutex *that); +#endif + SyncMutex *SyncMutex_CreateSingleton(Atomic_Ptr *lckStorage); #endif // #ifndef _SYNC_MUTEX_H_ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/syncWaitQ.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/syncWaitQ.h --- open-vm-tools-2008.01.23-74039/lib/include/syncWaitQ.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/syncWaitQ.h 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -69,8 +69,6 @@ */ -#define WAITQ_MAX_PATH 0x100 - typedef struct SyncWaitQ { /* * Common members used for both named and unnamed objects @@ -88,7 +86,7 @@ */ // Name of the waitqueue object (FIFO path on Linux or Event name on Win32) - char path[WAITQ_MAX_PATH]; + char *pathName; /* * The following handles are only used only in the case of @@ -102,9 +100,9 @@ */ #ifdef _WIN32 - Atomic_uint32 readHandle; + Atomic_uint64 readHandle; #else - Atomic_uint64 rwHandles; + Atomic_uint64 rwHandles; # if __APPLE__ pthread_mutex_t mutex; # endif @@ -113,8 +111,8 @@ Bool SyncWaitQ_Init(SyncWaitQ *that, char const *path); void SyncWaitQ_Destroy(SyncWaitQ *that); -int SyncWaitQ_Add(SyncWaitQ *that); -Bool SyncWaitQ_Remove(SyncWaitQ *that, int fd); +PollDevHandle SyncWaitQ_Add(SyncWaitQ *that); +Bool SyncWaitQ_Remove(SyncWaitQ *that, PollDevHandle fd); Bool SyncWaitQ_WakeUp(SyncWaitQ *that); #endif // #infdef _SYNC_WAITQ_H_ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/system.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/system.h --- open-vm-tools-2008.01.23-74039/lib/include/system.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/system.h 2008-10-13 08:01:49.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -29,11 +29,16 @@ # define __SYSTEM_H__ #include "vm_basic_types.h" +#include "unicode.h" uint64 System_Uptime(void); Bool System_GetCurrentTime(int64 *secs, int64 *usecs); Bool System_AddToCurrentTime(int64 deltaSecs, int64 deltaUsecs); +Unicode System_GetTimeAsString(void); +Bool System_EnableTimeSlew(int64 delta, uint32 timeSyncPeriod); +Bool System_DisableTimeSlew(void); +Bool System_IsTimeSlewEnabled(void); Bool System_IsACPI(void); void System_Shutdown(Bool reboot); Bool System_IsUserAdmin(void); @@ -42,40 +47,81 @@ int System_SetEnv(Bool global, char *valueName, char *value); #ifdef _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_UNKNOWN = 9} 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_WIN2K3 = 12, - OS_DETAIL_WIN2K3_WEB = 13, - OS_DETAIL_WIN2K3_ST = 14, - OS_DETAIL_WIN2K3_EN = 15, - OS_DETAIL_WIN2K3_BUS = 16, - OS_DETAIL_VISTA = 17, - OS_DETAIL_UNKNOWN = 18} OS_DETAIL_TYPE; +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_UNKNOWN = 9 +} 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_UNKNOWN = 19 +} OS_DETAIL_TYPE; + +typedef void (*DesktopSwitchNotifyCB)(void *); +typedef struct { + DesktopSwitchNotifyCB cb; // callback to invoke. + void *cbdata; // data to pass to callback +} DesktopSwitchThreadArgs; -BOOL System_SetProcessPrivilege(char *lpszPrivilege, Bool bEnablePrivilege); +/* + * 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(LPCTSTR lpszPrivilege, Bool bEnablePrivilege); OS_TYPE System_GetOSType(void); OS_DETAIL_TYPE System_GetOSDetailType(void); int32 System_GetSPVersion(void); +Bool System_IsLoginScreenActive(void); +Bool System_IsScreenSaverActive(void); +Bool System_IsScreenSaverRunning(void); +Bool System_StartDesktopSwitchThread(DesktopSwitchThreadArgs *args); +Bool System_KillDesktopSwitchThread(void); +Bool System_DisableAndKillScreenSaver(void); +DWORD System_GetServiceState(LPCWSTR szServiceName); #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) && !defined(N_PLAT_NLM) +Bool System_WritePidFile(const char *fileName, pid_t pid); +Bool System_Daemon(Bool nochdir, Bool noclose, const char *pidFile); +const char **System_GetNativeEnviron(const char **compatEnviron); +void System_FreeNativeEnviron(const char **nativeEnviron); +int System_UnsetEnv(const char *variableName); +char *System_SetLDPath(const char *path, const Bool native); +#endif + #endif /* __SYSTEM_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/timeutil.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/timeutil.h --- open-vm-tools-2008.01.23-74039/lib/include/timeutil.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/timeutil.h 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -35,18 +35,19 @@ #include "vm_assert.h" -#define MAX_DAYSLEFT 1024 +#define MAX_DAYSLEFT 1024 struct timeval; +/* Similar to a struct tm but with slightly less weird semantics. */ typedef struct TimeUtil_Date { - unsigned int year; - unsigned int month; - unsigned int day; - unsigned int hour; - unsigned int minute; - unsigned int second; + 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; @@ -75,6 +76,17 @@ } TimeUtil_Expiration; +EXTERN time_t TimeUtil_MakeTime(const TimeUtil_Date *d); + +EXTERN Bool TimeUtil_StringToDate(TimeUtil_Date *d, // IN/OUT + char const *date); // IN: 'YYYYMMDD' or 'YYYY/MM/DD' or 'YYYY-MM-DD' + +EXTERN Bool TimeUtil_DaysSubtract(TimeUtil_Date *d, // IN/OUT + unsigned int nr); // IN + +EXTERN int TimeUtil_DeltaDays(TimeUtil_Date const *left, // IN + TimeUtil_Date const *right); // IN + EXTERN void TimeUtil_DaysAdd(TimeUtil_Date *d, // IN/OUT unsigned int nr); // IN @@ -107,4 +119,6 @@ SYSTEMTIME *systemTime); // OUT #endif +EXTERN int TimeUtil_GetLocalWindowsTimeZoneIndex(void); + #endif // _TIMEUTIL_H_ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/toolsDeployPkg.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/toolsDeployPkg.h --- open-vm-tools-2008.01.23-74039/lib/include/toolsDeployPkg.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/toolsDeployPkg.h 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/toolsLogger.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/toolsLogger.h --- open-vm-tools-2008.01.23-74039/lib/include/toolsLogger.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/toolsLogger.h 2008-10-13 08:01:49.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/toolsLoggerInt.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/toolsLoggerInt.h --- open-vm-tools-2008.01.23-74039/lib/include/toolsLoggerInt.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/toolsLoggerInt.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,53 +0,0 @@ -/********************************************************* - * Copyright (C) 2006 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 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. - * - *********************************************************/ - -/* - * toolsLoggerInt.h -- - * - * All-purpose logging facility. This header file contains - * declarations that are intended just to be seen internally. - * - */ - - -#ifndef __TOOLSLOGGERINT_H__ -# define __TOOLSLOGGERINT_H__ - - -/* - * Log sinks - */ -typedef enum { - TOOLSLOG_SINK_FILE, - TOOLSLOG_SINK_CONSOLE, - TOOLSLOG_SINK_SYSLOG, - TOOLSLOG_SINK_HOST, - TOOLSLOG_SINK_STDERR, - - TOOLSLOG_SINK_LAST /* Must be the last one */ -} ToolsLogSink; - - -/* - * Tools log file name - */ -#define CONFNAME_LOGFILE "log.file" -#define CONFVAL_LOGFILE_DEFAULT "vmware-tools.log" - - -#endif /* __TOOLSLOGGERINT_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/unicodeBase.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/unicodeBase.h --- open-vm-tools-2008.01.23-74039/lib/include/unicodeBase.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/unicodeBase.h 2008-10-13 08:01:49.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -27,6 +27,8 @@ #define INCLUDE_ALLOW_USERLEVEL #define INCLUDE_ALLOW_VMCORE +#define INCLUDE_ALLOW_VMKERNEL +#define INCLUDE_ALLOW_VMNIXMOD #include "includeCheck.h" #ifdef __cplusplus @@ -34,30 +36,18 @@ #endif #include +#include +#include "util.h" #include "unicodeTypes.h" -/* - * Static Unicode string literal macros. - * - * Given an ASCII const char * literal ("abcd"), returns a static - * ConstUnicode string. - * - * These strings are never freed, so this is not to be used for - * general runtime Unicode string creation. Instead, use it to - * replace: - * - * const char *extension = ".vmdk"; - * - * with: - * - * ConstUnicode extension = U(".vmdk"); - */ -#define U(x) Unicode_GetStatic(x, FALSE) /* - * Same as U(), but also unescapes \\uABCD to Unicode code point + * 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"; @@ -66,10 +56,21 @@ * * ConstUnicode 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. * @@ -90,15 +91,14 @@ * 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. * - * If the buffer contains an invalid sequence of the specified - * encoding or memory could not be allocated, returns NULL. - * * Results: * An allocated Unicode string containing the decoded characters - * in buffer, or NULL on failure. Caller must pass to + * in buffer, or NULL if input is NULL. Caller must pass to * Unicode_Free to free. * * Side effects: @@ -122,12 +122,11 @@ * * Allocates a new Unicode string given a NUL-terminated UTF-8 string. * - * If the input contains an invalid UTF-8 byte sequence or memory could - * not be allocated, returns NULL. + * If utf8String is NULL, then NULL is returned. * * Results: * An allocated Unicode string containing the characters in - * utf8String, or NULL on failure. Caller must pass to + * utf8String, or NULL if utf8String is NULL. Caller must pass to * Unicode_Free to free. * * Side effects: @@ -151,12 +150,11 @@ * Allocates a new Unicode string given a NUL-terminated UTF-16 * string in host-endian order. * - * If the input contains an invalid UTF-16 sequence or memory could - * not be allocated, returns NULL. + * If utf16String is NULL, then NULL is returned. * * Results: * An allocated Unicode string containing the characters in - * utf16String, or NULL on failure. Caller must pass to + * utf16String, or NULL if utf16String is NULL. Caller must pass to * Unicode_Free to free. * * Side effects: @@ -175,15 +173,65 @@ Unicode Unicode_Duplicate(ConstUnicode str); void Unicode_Free(Unicode str); + +Unicode *Unicode_AllocList(char **srcList, ssize_t length, + StringEncoding encoding); + +Unicode *Unicode_GetAllocList(Unicode const srcList[], ssize_t length, + StringEncoding encoding); + /* - * Accessors for NUL-terminated UTF-8 and UTF-16 host-endian - * representations of this Unicode string. + *----------------------------------------------------------------------------- + * + * 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 Unicode_FreeList. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static INLINE Unicode * +Unicode_AllocListWithUTF16(utf16_t **utf16list, // IN: + ssize_t length) // IN: +{ + return Unicode_AllocList((char **) utf16list, length, + STRING_ENCODING_UTF16); +} + +void Unicode_FreeList(Unicode *list, ssize_t length); + + +/* + * Accessor for the NUL-terminated UTF-8 representation of this + * Unicode string. * * Memory is managed inside this string, so callers do not need to * free. */ const char *Unicode_GetUTF8(ConstUnicode str); -const utf16_t *Unicode_GetUTF16(ConstUnicode str); + +/* + * Convenience wrapper with a short name for this often-used function. + */ +static INLINE const char * +UTF8(ConstUnicode str) +{ + return Unicode_GetUTF8(str); +} + +/* + * 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. @@ -191,6 +239,11 @@ 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, @@ -198,6 +251,21 @@ StringEncoding encoding); /* + * Tests if the buffer's unicode contents can be converted to the + * specified encoding. + */ +Bool Unicode_CanGetBytesWithEncoding(ConstUnicode 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. */ @@ -222,7 +290,12 @@ static INLINE Bool Unicode_IsEmpty(ConstUnicode str) // IN: { - return Unicode_LengthInCodeUnits(str) == 0; +#ifdef SUPPORT_UNICODE_OPAQUE + NOT_IMPLEMENTED(); +#else + ASSERT(str != NULL); + return str[0] == '\0'; +#endif } @@ -236,56 +309,24 @@ /* * Extracts the contents of the Unicode string into a NUL-terminated - * buffer using the specified encoding. Returns -1 if - * maxLengthInBytes isn't enough to hold the encoded string. - */ -ssize_t Unicode_CopyBytes(ConstUnicode str, - void *buffer, - size_t maxLengthInBytes, - StringEncoding encoding); - - -/* - *----------------------------------------------------------------------------- - * - * Unicode_GetAllocBytes -- - * - * Allocates and returns a NUL terminated buffer into which the contents - * of the unicode string are extracted using the specified encoding. - * - * NOTE: The length of the NUL can depend on the encoding. - * UTF-16 NUL is "\0\0"; UTF-32 NUL is "\0\0\0\0". - * - * Results: - * Pointer to the dynamically allocated memory or NULL on failure. - * - * Caller is responsible to free the memory allocated by this routine. - * - * Side effects: - * None - * - *----------------------------------------------------------------------------- - */ - -static INLINE void * -Unicode_GetAllocBytes(ConstUnicode str, // IN: - StringEncoding encoding) // IN: -{ - void *memory; - - size_t length = Unicode_BytesRequired(str, encoding); - - memory = malloc(length); - - if (memory != NULL) { - if (Unicode_CopyBytes(str, memory, length, encoding) == -1) { - free(memory); - memory = NULL; - } - } - - return memory; -} + * 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, + ConstUnicode srcBuffer, + size_t maxLengthInBytes, + size_t *retLength, + StringEncoding encoding); + +void *Unicode_GetAllocBytes(ConstUnicode str, + StringEncoding encoding); + +void *Unicode_GetAllocBytesWithLength(ConstUnicode str, + StringEncoding encoding, + ssize_t lengthInBytes); /* @@ -295,13 +336,13 @@ * * Allocates and returns a NUL terminated buffer into which the contents * of the unicode string are extracted using the (host native) UTF-16 - * encoding. + * encoding. (Note that UTF-16 NUL is two bytes: "\0\0".) * - * NOTE: The length of the NUL can depend on the encoding. - * UTF-16 NUL is "\0\0"; UTF-32 NUL is "\0\0\0\0". + * NULL is returned for NULL argument. * * Results: - * Pointer to the dynamically allocated memory or NULL on failure. + * Pointer to the dynamically allocated memory, + * or NULL on NULL argument. * * Caller is responsible to free the memory allocated by this routine. * @@ -325,6 +366,24 @@ ConstUnicode Unicode_GetStatic(const char *asciiBytes, Bool unescape); +/* + * Helper macros for Win32 Unicode string transition. + * + * Eventually, when the Unicode type becomes opaque + * (SUPPORT_UNICODE_OPAQUE), we can store UTF-16 directly inside + * it, which is a huge optimization for Win32 programmers. + * + * At that point, UNICODE_GET_UTF16/UNICODE_RELEASE_UTF16 can become + * constant-time operations. + * + * Until then, Win32 programmers need to alloc and free the UTF-16 + * representation of the Unicode string. + */ +#if defined(_WIN32) + #define UNICODE_GET_UTF16(s) Unicode_GetAllocUTF16(s) + #define UNICODE_RELEASE_UTF16(s) free((utf16_t *)s) +#endif + #ifdef __cplusplus } #endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/unicode.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/unicode.h --- open-vm-tools-2008.01.23-74039/lib/include/unicode.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/unicode.h 2008-10-13 08:01:49.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -27,19 +27,22 @@ #define INCLUDE_ALLOW_USERLEVEL #define INCLUDE_ALLOW_VMCORE +#define INCLUDE_ALLOW_VMKERNEL +#define INCLUDE_ALLOW_VMNIXMOD #include "includeCheck.h" // Start here: string creation, destruction, and encoding conversion. #include "unicodeBase.h" -/* - * To be added: - * - * unicodeOperations.h - * Basic string operations: length, append, find, insert, replace. - * - * unicodeTransforms.h - * Character transformations: upper/lower/title case, case folding, etc. - */ +// 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_ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/unicodeICU.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/unicodeICU.h --- open-vm-tools-2008.01.23-74039/lib/include/unicodeICU.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/unicodeICU.h 2008-10-13 08:01:50.000000000 +0100 @@ -0,0 +1,99 @@ +/********************************************************* + * Copyright (C) 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. + * + *********************************************************/ + +/* + * 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(ConstUnicode str1, + ConstUnicode 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. + */ +Unicode Unicode_ToLower(ConstUnicode str, const char *locale); +Unicode Unicode_ToUpper(ConstUnicode str, const char *locale); + +#ifdef HAVE_ICU_38 +Unicode Unicode_ToTitle(ConstUnicode 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. + */ +Unicode Unicode_Normalize(ConstUnicode str, + UnicodeNormalizationForm form); + +#ifdef __cplusplus +} +#endif + +#endif // _UNICODE_ICU_H_ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/unicodeInt.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/unicodeInt.h --- open-vm-tools-2008.01.23-74039/lib/include/unicodeInt.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/unicodeInt.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,49 +0,0 @@ -/********************************************************* - * Copyright (C) 2007 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 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. - * - *********************************************************/ - -/* - * unicodeInt.h -- - * - * Internal functions common to all implementations of the - * Unicode library. - */ - -#ifndef _UNICODE_INT_H -#define _UNICODE_INT_H - -#include "unicodeTypes.h" - -#ifdef __cplusplus -extern "C" { -#endif - -Unicode UnicodeAllocInternal(const void *buffer, - ssize_t lengthInBytes, - StringEncoding encoding); -Unicode UnicodeAllocStatic(const char *asciiBytes, - Bool unescape); - -void UnicodePinIndices(ConstUnicode str, - UnicodeIndex *strStart, - UnicodeIndex *strLength); - -#ifdef __cplusplus -} -#endif - -#endif // _UNICODE_INT_H diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/unicodeOperations.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/unicodeOperations.h --- open-vm-tools-2008.01.23-74039/lib/include/unicodeOperations.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/unicodeOperations.h 2008-10-13 08:01:49.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -40,8 +40,12 @@ #define INCLUDE_ALLOW_USERLEVEL #define INCLUDE_ALLOW_VMCORE +#define INCLUDE_ALLOW_VMKERNEL +#define INCLUDE_ALLOW_VMNIXMOD #include "includeCheck.h" +#include + #include "unicodeBase.h" #include "vm_assert.h" @@ -56,6 +60,7 @@ * Pass -1 for any length parameter to indicate "from start until end * of string". */ + int Unicode_CompareRange(ConstUnicode str1, UnicodeIndex str1Start, UnicodeIndex str1Length, @@ -63,12 +68,14 @@ UnicodeIndex str2Start, UnicodeIndex str2Length, Bool ignoreCase); + UnicodeIndex Unicode_FindSubstrInRange(ConstUnicode str, UnicodeIndex strStart, UnicodeIndex strLength, ConstUnicode strToFind, UnicodeIndex strToFindStart, UnicodeIndex strToFindLength); + UnicodeIndex Unicode_FindLastSubstrInRange(ConstUnicode str, UnicodeIndex strStart, UnicodeIndex strLength, @@ -78,6 +85,7 @@ Unicode Unicode_Substr(ConstUnicode str, UnicodeIndex start, UnicodeIndex length); + Unicode Unicode_ReplaceRange(ConstUnicode destination, UnicodeIndex destinationStart, UnicodeIndex destinationLength, @@ -85,6 +93,49 @@ UnicodeIndex sourceStart, UnicodeIndex sourceLength); +Unicode Unicode_Join(ConstUnicode first, + ...); + +Unicode Unicode_Format(const char *fmt, ...); + + +/* + * Simple in-line functions that may be used below. + */ + + +/* + *----------------------------------------------------------------------------- + * + * Unicode_IsIndexAtCodePointBoundary -- + * + * Check a string index 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(ConstUnicode str, // IN + UnicodeIndex index) // IN +{ + ASSERT(index >= 0 && index <= Unicode_LengthInCodeUnits(str)); + +#ifdef SUPPORT_UNICODE_OPAQUE + NOT_IMPLEMENTED(); +#else + return (str[index] & 0xc0) != 0x80; +#endif +} + /* * Other operations, each based upon calls to primitives. @@ -153,36 +204,6 @@ } -#ifdef SUPPORT_UNICODE - -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(ConstUnicode str1, - ConstUnicode str2, - const char *locale, - UnicodeCompareOption compareOption); - -#endif - - /* *----------------------------------------------------------------------------- * @@ -256,7 +277,9 @@ /* *----------------------------------------------------------------------------- * + * UnicodeEndsWith -- * Unicode_EndsWith -- + * Unicode_EndsWithIgnoreCase -- * * Tests if 'str' ends with 'suffix'. * @@ -270,23 +293,44 @@ */ static INLINE Bool -Unicode_EndsWith(ConstUnicode str, // IN - ConstUnicode suffix) // IN +UnicodeEndsWith(ConstUnicode str, // IN + ConstUnicode suffix, // IN + Bool ignoreCase) // IN { UnicodeIndex strLength = Unicode_LengthInCodeUnits(str); UnicodeIndex suffixLength = Unicode_LengthInCodeUnits(suffix); + UnicodeIndex offset = strLength - suffixLength; if (suffixLength > strLength) { return FALSE; } + if (!Unicode_IsIndexAtCodePointBoundary(str, offset)) { + return FALSE; + } return Unicode_CompareRange(str, - strLength - suffixLength, + offset, suffixLength, suffix, 0, suffixLength, - FALSE) == 0; + ignoreCase) == 0; +} + + +static INLINE Bool +Unicode_EndsWith(ConstUnicode str, // IN + ConstUnicode suffix) // IN +{ + return UnicodeEndsWith(str, suffix, FALSE); +} + + +static INLINE Bool +Unicode_EndsWithIgnoreCase(ConstUnicode str, // IN + ConstUnicode suffix) // IN +{ + return UnicodeEndsWith(str, suffix, TRUE); } @@ -610,7 +654,7 @@ UnicodeIndex start, UnicodeIndex length) { - return Unicode_ReplaceRange(destination, start, length, U(""), 0, 0); + return Unicode_ReplaceRange(destination, start, length, "", 0, 0); } @@ -651,7 +695,9 @@ /* *----------------------------------------------------------------------------- * + * UnicodeStartsWith -- * Unicode_StartsWith -- + * Unicode_StartsWithIgnoreCase -- * * Tests if 'str' starts with 'prefix'. * @@ -665,18 +711,43 @@ */ static INLINE Bool -Unicode_StartsWith(ConstUnicode str, // IN - ConstUnicode prefix) // IN +UnicodeStartsWith(ConstUnicode str, // IN + ConstUnicode prefix, // IN + Bool ignoreCase) // IN { + UnicodeIndex strLength = Unicode_LengthInCodeUnits(str); UnicodeIndex prefixLength = Unicode_LengthInCodeUnits(prefix); + if (prefixLength > strLength) { + return FALSE; + } + if (!Unicode_IsIndexAtCodePointBoundary(str, prefixLength)) { + return FALSE; + } + return Unicode_CompareRange(str, 0, prefixLength, prefix, 0, prefixLength, - FALSE) == 0; + ignoreCase) == 0; +} + + +static INLINE Bool +Unicode_StartsWith(ConstUnicode str, // IN + ConstUnicode prefix) // IN +{ + return UnicodeStartsWith(str, prefix, FALSE); +} + + +static INLINE Bool +Unicode_StartsWithIgnoreCase(ConstUnicode str, // IN + ConstUnicode prefix) // IN +{ + return UnicodeStartsWith(str, prefix, TRUE); } diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/unicodeTransforms.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/unicodeTransforms.h --- open-vm-tools-2008.01.23-74039/lib/include/unicodeTransforms.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/unicodeTransforms.h 2008-10-13 08:01:49.000000000 +0100 @@ -0,0 +1,61 @@ +/********************************************************* + * Copyright (C) 2007 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. + * + *********************************************************/ + +/* + * unicodeTransforms.h -- + * + * Operations that transform all the characters in a string. + * + * Transform operations like uppercase and lowercase are + * locale-sensitive (depending on the user's country and language + * preferences). + */ + +#ifndef _UNICODE_TRANSFORMS_H_ +#define _UNICODE_TRANSFORMS_H_ + +#define INCLUDE_ALLOW_USERLEVEL +#define INCLUDE_ALLOW_VMCORE +#define INCLUDE_ALLOW_VMKERNEL +#define INCLUDE_ALLOW_VMNIXMOD +#include "includeCheck.h" + +#include "unicodeTypes.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Standardizes the case of the string by doing a locale-agnostic + * uppercase operation, then a locale-agnostic lowercase operation. + */ +Unicode Unicode_FoldCase(ConstUnicode str); + +/* + * Trims whitespace from either side of the string. + */ +Unicode Unicode_Trim(ConstUnicode str); +Unicode Unicode_TrimLeft(ConstUnicode str); +Unicode Unicode_TrimRight(ConstUnicode str); + +#ifdef __cplusplus +} +#endif + +#endif // _UNICODE_TRANSFORMS_H_ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/unicodeTypes.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/unicodeTypes.h --- open-vm-tools-2008.01.23-74039/lib/include/unicodeTypes.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/unicodeTypes.h 2008-10-13 08:01:49.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -25,46 +25,48 @@ #ifndef _UNICODE_TYPES_H_ #define _UNICODE_TYPES_H_ +#define INCLUDE_ALLOW_MODULE #define INCLUDE_ALLOW_USERLEVEL #define INCLUDE_ALLOW_VMCORE +#define INCLUDE_ALLOW_VMKERNEL +#define INCLUDE_ALLOW_VMNIXMOD #include "includeCheck.h" + +#ifdef __cplusplus +extern "C" { +#endif + #include "vm_basic_types.h" +#include "vm_assert.h" + +#if defined(SUPPORT_UNICODE_OPAQUE) -#ifdef SUPPORT_UNICODE /* - * When Unicode support is turned on, the types become opaque containers. + * To assist with finding code that hasn't been internationalized, we + * support building with an opaque Unicode type. This catches users + * passing a char * of unknown encoding to Unicode functions, and + * assigning a Unicode to a char *. */ -typedef void * Unicode; -typedef const void * ConstUnicode; + +typedef struct UnicodeImpl UnicodeImpl; +typedef UnicodeImpl * Unicode; +typedef const UnicodeImpl * ConstUnicode; + #else + /* - * As a short-term development tactic to prevent code churn while the + * As a transitionary development tactic to prevent code churn while the * Unicode libraries are being developed, we'll start with a simple * implementation of Unicode as UTF-8 char *. */ typedef char * Unicode; typedef const char * ConstUnicode; + #endif typedef ssize_t UnicodeIndex; -#ifdef _WIN32 -#include -/* - * To ensure we interoperate with Win32 APIs (possibly C++ - * name-mangled) that use WCHAR, this typedef is used for - * Unicode_AllocWithUTF16() and Unicode_GetUTF16(). - * - * WCHAR can either be unsigned short or the intrinsic type wchar_t, - * depending on if _NATIVE_WCHAR_T_DEFINED is set. It's always - * exactly 16 bits wide. - */ -typedef WCHAR utf16_t; -#else -typedef uint16 utf16_t; -#endif - /* * Special UnicodeIndex value returned when a string is not found. */ @@ -72,12 +74,14 @@ 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, @@ -87,15 +91,16 @@ * 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, // Host-endian UTF-16. 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, // Host-endian UTF-32. 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. @@ -104,6 +109,7 @@ /* * Latin encodings */ + STRING_ENCODING_US_ASCII, STRING_ENCODING_ISO_8859_1, STRING_ENCODING_ISO_8859_2, @@ -115,7 +121,7 @@ STRING_ENCODING_ISO_8859_8, STRING_ENCODING_ISO_8859_9, STRING_ENCODING_ISO_8859_10, - STRING_ENCODING_ISO_8859_11, + // ISO-8859-11 is unused. // Oddly, there is no ISO-8859-12. STRING_ENCODING_ISO_8859_13, STRING_ENCODING_ISO_8859_14, @@ -124,6 +130,7 @@ /* * Chinese encodings */ + STRING_ENCODING_GB_18030, STRING_ENCODING_BIG_5, STRING_ENCODING_BIG_5_HK, @@ -134,6 +141,7 @@ /* * Japanese encodings */ + STRING_ENCODING_SHIFT_JIS, STRING_ENCODING_EUC_JP, STRING_ENCODING_ISO_2022_JP, @@ -143,12 +151,14 @@ /* * Korean encodings */ + STRING_ENCODING_EUC_KR, STRING_ENCODING_ISO_2022_KR, /* * Windows encodings */ + STRING_ENCODING_WINDOWS_1250, STRING_ENCODING_WINDOWS_1251, STRING_ENCODING_WINDOWS_1252, @@ -159,6 +169,280 @@ 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_IBM850, + STRING_ENCODING_PC8_DANISH_NORWEGIAN, + STRING_ENCODING_IBM862, + 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_IBM037, + STRING_ENCODING_IBM038, + STRING_ENCODING_IBM273, + STRING_ENCODING_IBM274, + STRING_ENCODING_IBM275, + STRING_ENCODING_IBM277, + STRING_ENCODING_IBM278, + STRING_ENCODING_IBM280, + STRING_ENCODING_IBM281, + STRING_ENCODING_IBM284, + STRING_ENCODING_IBM285, + STRING_ENCODING_IBM290, + STRING_ENCODING_IBM297, + STRING_ENCODING_IBM420, + STRING_ENCODING_IBM423, + STRING_ENCODING_IBM424, + STRING_ENCODING_IBM437, + STRING_ENCODING_IBM500, + STRING_ENCODING_IBM851, + STRING_ENCODING_IBM852, + STRING_ENCODING_IBM855, + STRING_ENCODING_IBM857, + STRING_ENCODING_IBM860, + STRING_ENCODING_IBM861, + STRING_ENCODING_IBM863, + STRING_ENCODING_IBM864, + STRING_ENCODING_IBM865, + STRING_ENCODING_IBM868, + STRING_ENCODING_IBM869, + STRING_ENCODING_IBM870, + STRING_ENCODING_IBM871, + STRING_ENCODING_IBM880, + STRING_ENCODING_IBM891, + STRING_ENCODING_IBM903, + STRING_ENCODING_IBM904, + STRING_ENCODING_IBM905, + STRING_ENCODING_IBM918, + STRING_ENCODING_IBM1026, + 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_IBM866, + STRING_ENCODING_IBM775, + STRING_ENCODING_KOI8_U, + STRING_ENCODING_IBM00858, + STRING_ENCODING_IBM00924, + STRING_ENCODING_IBM01140, + STRING_ENCODING_IBM01141, + STRING_ENCODING_IBM01142, + STRING_ENCODING_IBM01143, + STRING_ENCODING_IBM01144, + STRING_ENCODING_IBM01145, + STRING_ENCODING_IBM01146, + STRING_ENCODING_IBM01147, + STRING_ENCODING_IBM01148, + STRING_ENCODING_IBM01149, + STRING_ENCODING_IBM1047, + 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, + // Add more encodings here. // Sentinel value after the last explicitly specified encoding. @@ -167,11 +451,93 @@ /* * 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 UnicodeGetCurrentEncodingInternal(void); + + +/* + *----------------------------------------------------------------------------- + * + * Unicode_GetCurrentEncoding -- + * + * Return the current encoding (corresponding to + * CodeSet_GetCurrentCodeSet()). + * + * Results: + * The current encoding. + * + * Side effects: + * Since the return value of CodeSet_GetCurrentCodeSet() and + * our look-up table do not change, we memoize the value. + * + *----------------------------------------------------------------------------- + */ + +static INLINE StringEncoding +Unicode_GetCurrentEncoding(void) +{ + static StringEncoding encoding = STRING_ENCODING_UNKNOWN; + + if (UNLIKELY(encoding == STRING_ENCODING_UNKNOWN)) { + encoding = UnicodeGetCurrentEncodingInternal(); + } + return encoding; +} + + +/* + *----------------------------------------------------------------------------- + * + * Unicode_ResolveEncoding -- + * + * Resolves a meta-encoding enum value (e.g. STRING_ENCODING_DEFAULT) to + * a concrete one (e.g. STRING_ENCODING_UTF8). + * + * Results: + * A StringEncoding enum value. May return STRING_ENCODING_UNKNOWN. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static INLINE StringEncoding +Unicode_ResolveEncoding(StringEncoding encoding) // IN +{ + if (encoding == STRING_ENCODING_DEFAULT) { + encoding = Unicode_GetCurrentEncoding(); + } + ASSERT(Unicode_IsEncodingValid(encoding)); + return encoding; +} + + +#ifdef __cplusplus +} +#endif #endif // _UNICODE_TYPES_H_ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/unityCommon.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/unityCommon.h --- open-vm-tools-2008.01.23-74039/lib/include/unityCommon.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/unityCommon.h 2008-10-13 08:01:50.000000000 +0100 @@ -0,0 +1,183 @@ +/********************************************************* + * Copyright (C) 2007-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. + * + *********************************************************/ + +/* + * unityCommon.h -- + * + * Types and GuestRPC commands that comprise the Unity protocol. + */ + +#ifndef _UNITY_COMMON_H_ +#define _UNITY_COMMON_H_ + +#define UNITY_MAX_SETTOP_WINDOW_COUNT 100 + +/* RPC messages between host and guest that are part of Unity protocol. */ + +/* Host -> Guest */ +#define UNITY_RPC_ENTER "unity.enter" +#define UNITY_RPC_GET_UPDATE "unity.get.update" +#define UNITY_RPC_GET_WINDOW_PATH "unity.get.window.path" +#define UNITY_RPC_GET_BINARY_INFO "unity.get.binary.info" +#define UNITY_RPC_GET_BINARY_HANDLERS "unity.get.binary.handlers" +#define UNITY_RPC_OPEN_LAUNCHMENU "unity.launchmenu.open" +#define UNITY_RPC_GET_LAUNCHMENU_ITEM "unity.launchmenu.get.item" +#define UNITY_RPC_CLOSE_LAUNCHMENU "unity.launchmenu.close" +#define UNITY_RPC_WINDOW_RESTORE "unity.window.restore" +#define UNITY_RPC_WINDOW_SETTOP "unity.window.settop" +#define UNITY_RPC_WINDOW_CLOSE "unity.window.close" +#define UNITY_RPC_GET_WINDOW_CONTENTS "unity.get.window.contents" +#define UNITY_RPC_GET_ICON_DATA "unity.get.icon.data" +#define UNITY_RPC_EXIT "unity.exit" +#define UNITY_RPC_GET_UPDATE_FULL "unity.get.update.full" +#define UNITY_RPC_GET_UPDATE_INCREMENTAL "unity.get.update.incremental" +#define UNITY_RPC_SHELL_OPEN "unity.shell.open" +#define UNITY_RPC_SHOW_TASKBAR "unity.show.taskbar" +#define UNITY_RPC_WINDOW_MOVE_RESIZE "unity.window.move_resize" +#define UNITY_RPC_DESKTOP_WORK_AREA_SET "unity.desktop.work_area.set" +#define UNITY_RPC_WINDOW_SHOW "unity.window.show" +#define UNITY_RPC_WINDOW_HIDE "unity.window.hide" +#define UNITY_RPC_WINDOW_MINIMIZE "unity.window.minimize" +#define UNITY_RPC_WINDOW_MAXIMIZE "unity.window.maximize" +#define UNITY_RPC_WINDOW_UNMAXIMIZE "unity.window.unmaximize" +#define UNITY_RPC_DESKTOP_CONFIG_SET "unity.desktop.config.set" +#define UNITY_RPC_DESKTOP_ACTIVE_SET "unity.desktop.active.set" +#define UNITY_RPC_WINDOW_DESKTOP_SET "unity.window.desktop.set" +#define UNITY_RPC_UNITY_ACTIVE "unity.active" + +#define GHI_RPC_GUEST_SHELL_ACTION "ghi.guest.shell.action" +#define GHI_RPC_SET_GUEST_HANDLER "ghi.guest.handler.set" +#define GHI_RPC_RESTORE_DEFAULT_GUEST_HANDLER "ghi.guest.handler.restoreDefault" + +/* Guest -> Host */ +#define UNITY_RPC_PUSH_UPDATE_CMD "tools.unity.push.update" +#define UNITY_RPC_VMX_SHOW_TASKBAR "vmx.unity.show.taskbar" +#define UNITY_RPC_UNITY_CAP "tools.capability.unity" +#define UNITY_RPC_SHOW_TASKBAR_CAP "tools.capability.unity.taskbar" +#define GHI_RPC_LAUNCHMENU_CHANGE "tools.ghi.launchmenu.change" +#define GHI_RPC_PROTOCOL_HANDLER_INFO "tools.ghi.protocolhandler.info" + +#define GHI_RPC_HOST_SHELL_ACTION "ghi.host.shell.action" + +/* + * Currently we have four possible unity start menu roots. + * + * UNITY_START_MENU_LAUNCH_FOLDER is for all guest start menu 'Programs' items + * plus favorite items from guest start menu folder. + * + * UNITY_START_MENU_FIXED_FOLDER is for special items like 'My Computer', + * 'My Documents', 'Control Panel', etc. + * + * UNITY_START_MENU_ALL_HANDLERS_FOLDER is for all the applications that are known + * by the guest to open files. + * + * UNITY_START_MENU_RESOLVED_LAUNCH_FOLDER is the same contents as + * UNITY_START_MENU_LAUNCH_FOLDER however each item that is a shortcut (link) is resolved + * into its destination path. + */ + +#define UNITY_START_MENU_LAUNCH_FOLDER "VMGuestLaunchItems" +#define UNITY_START_MENU_FIXED_FOLDER "VMGuestFixedItems" +#define UNITY_START_MENU_ALL_HANDLERS_FOLDER "VMGuestAllHandlers" +#define UNITY_START_MENU_RESOLVED_LAUNCH_FOLDER "VMGuestResolvedItems" + +typedef uint32 UnityWindowId; + +typedef int32 UnityDesktopId; + +/* + * Unity window state tracks the current state of the window (right now we only have + * minimized, might have more in the future). + * + * These are deprecated in favor of window attributes and window types, and are retained + * for compatibility purposes only. + */ + +#define UNITY_WINDOW_STATE_MINIMIZED (1 << 0) +#define UNITY_WINDOW_STATE_IN_FOCUS (1 << 1) +#define UNITY_WINDOW_STATE_TOPMOST (1 << 2) + +/* + * Unity window attributes are boolean flags that can be set in combination on a window. + * If they are not set by the guest, it is up to the host to decide on a reasonable + * default. + * + * If you add attributes here, please also update unityAttributeNames in + * unityWindowTracker.c. + */ + +typedef enum { + UNITY_WINDOW_ATTR_BORDERLESS = 0, + UNITY_WINDOW_ATTR_MINIMIZABLE = 1, + UNITY_WINDOW_ATTR_MAXIMIZABLE = 2, + UNITY_WINDOW_ATTR_MAXIMIZED = 3, + UNITY_WINDOW_ATTR_CLOSABLE = 5, + UNITY_WINDOW_ATTR_HAS_TITLEBAR = 6, + UNITY_WINDOW_ATTR_VISIBLE = 7, + UNITY_WINDOW_ATTR_CHILD_WINDOW = 8, + UNITY_WINDOW_ATTR_HAS_TOOLBAR_BTN = 9, + UNITY_WINDOW_ATTR_BELONGS_TO_APP = 10, + UNITY_WINDOW_ATTR_DROPSHADOWED = 11, + UNITY_WINDOW_ATTR_ALWAYS_ABOVE = 12, + UNITY_WINDOW_ATTR_ALWAYS_BELOW = 13, + UNITY_WINDOW_ATTR_DISABLED = 14, + UNITY_WINDOW_ATTR_NOACTIVATE = 15, + UNITY_WINDOW_ATTR_SYSMENU = 16, + UNITY_WINDOW_ATTR_TOOLWINDOW = 17, + UNITY_WINDOW_ATTR_APPWINDOW = 18, + UNITY_WINDOW_ATTR_FULLSCREENABLE = 19, + UNITY_WINDOW_ATTR_FULLSCREENED = 20, + UNITY_WINDOW_ATTR_ATTN_WANTED = 21, + UNITY_WINDOW_ATTR_SHADEABLE = 22, + UNITY_WINDOW_ATTR_SHADED = 23, + UNITY_WINDOW_ATTR_STICKABLE = 24, + UNITY_WINDOW_ATTR_STICKY = 25, + UNITY_WINDOW_ATTR_MODAL = 26, + + UNITY_MAX_ATTRIBUTES // Not a valid attribute +} UnityWindowAttribute; + +typedef enum { + UNITY_WINDOW_TYPE_NONE = -1, + UNITY_WINDOW_TYPE_NORMAL = 0, + UNITY_WINDOW_TYPE_PANEL, + UNITY_WINDOW_TYPE_DIALOG, + UNITY_WINDOW_TYPE_MENU, + UNITY_WINDOW_TYPE_TOOLTIP, + UNITY_WINDOW_TYPE_SPLASH, + UNITY_WINDOW_TYPE_TOOLBAR, + UNITY_WINDOW_TYPE_DOCK, + UNITY_WINDOW_TYPE_DESKTOP, + UNITY_WINDOW_TYPE_COMBOBOX, + UNITY_WINDOW_TYPE_WIDGET, + + UNITY_MAX_WINDOW_TYPES // Not a valid window type +} UnityWindowType; + +typedef enum { + UNITY_ICON_TYPE_MAIN = 0, + + UNITY_MAX_ICONS // Not a valid icon type +} UnityIconType; + +typedef uint32 UnityIconSize; // Number of pixels on the larger side of the icon (which is usually square anyways). +#define UNITY_MAX_ICON_DATA_CHUNK ((1 << 16) - 100) // 64k, minus space for a few other return values + +#define UNITY_DEFAULT_COLOR "#c0c0c0" + +#endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/unity.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/unity.h --- open-vm-tools-2008.01.23-74039/lib/include/unity.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/unity.h 2008-10-13 08:01:49.000000000 +0100 @@ -0,0 +1,90 @@ +/********************************************************* + * Copyright (C) 2007 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. + * + *********************************************************/ + +/* + * unity.h -- + * + * Commands for unity window manager intergration. + */ + +#ifndef _UNITY_H_ +#define _UNITY_H_ + +#include +#include "dndGuest.h" +#include "dbllnklst.h" +#include "guestApp.h" +#include "dynbuf.h" +#include "str.h" +#include "rpcin.h" +#ifdef _WIN32 +#include "unityCommon.h" +#endif +/* + * In Unity mode, all our DnD detection windows will be ignored and not displayed + * on host desktop. Right now we have 4 DnD detection window. 2 for DnD version 2 + * or older, 2 for DnD version 3 or newer. + */ +enum{ + UNITY_BLOCKED_WND_DND_FULL_DET_V2 = 0, + UNITY_BLOCKED_WND_DND_DET_V2 = 1, + UNITY_BLOCKED_WND_DND_FULL_DET_V3 = 2, + UNITY_BLOCKED_WND_DND_DET_V3 = 3, + UNITY_BLOCKED_WND_MAX = 4, +}; + +/* + * Maximum number of virtual desktops supported. + */ + +#define MAX_VIRT_DESK 64 + +/* + * Represents a virtual desktop coordinates in the virtual desktop grid. + * The grid might look like {1,1} {1,2} {2,1} {2,2} or {1,1} {1,2} {1,2} etc. + */ + +typedef struct UnityVirtualDesktop { + int32 x; + int32 y; +} UnityVirtualDesktop; + +/* + * Represents a virtual desktop configuration. + */ + +typedef struct UnityVirtualDesktopArray { + size_t desktopCount; // number of desktops in the grid + UnityVirtualDesktop desktops[MAX_VIRT_DESK]; // array of desktops +} UnityVirtualDesktopArray; + + +void Unity_Init(GuestApp_Dict *conf, int* blockedWnd); +void Unity_InitBackdoor(struct RpcIn *rpcIn); +Bool Unity_IsSupported(void); +void Unity_SetActiveDnDDetWnd(UnityDnD *state); +void Unity_Exit(void); +void Unity_Cleanup(void); +void Unity_RegisterCaps(void); +void Unity_UnregisterCaps(void); +#ifdef _WIN32 +HWND Unity_GetHwndFromUnityId(UnityWindowId id); +#endif + +#endif + diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/unityWindowTracker.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/unityWindowTracker.h --- open-vm-tools-2008.01.23-74039/lib/include/unityWindowTracker.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/unityWindowTracker.h 2008-10-13 08:01:50.000000000 +0100 @@ -0,0 +1,376 @@ +/********************************************************* + * Copyright (C) 2007 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. + * + *********************************************************/ + +/* + * unityWindowTracker.h -- + * + * Used to buffer state about a window manager. + * + * In general, clients will notify the window tracker of changes to the window + * manager state via: + * + * UnityWindowTracker_AddWindow + * UnityWindowTracker_RemoveWindow + * UnityWindowTracker_MoveWindow + * UnityWindowTracker_ChangeWindowRegion + * etc. etc. + * + * And then call UnityWindowTracker_RequestUpdates to pull a summary of the updates + * out. The user may call the AddWindow, RemoveWindow, etc functions as often as they + * like. The window tracker's job is to compress a series of notifications into the + * smallest delta between updates. + * + * Typical use works something like: + * + * UnityWindowTracker_Init(...) + * many times do { + * many times to { + * UnityWindowTracker_AddWindow, UnityWindowTracker_MoveWindow, etc. + * } + * UnityWindowTracker_RequestUpdates(...) + * } + * UnityWindowTracker_Cleanup(...) + * + */ + +#ifndef _UNITY_WINDOW_TRACKER_H_ +#define _UNITY_WINDOW_TRACKER_H_ + +#include "hashTable.h" +#include "region.h" +#include "dynbuf.h" +#include "unityCommon.h" + +/* The maximum number of windows that this tracker can track */ +#define UNITY_MAX_WINDOWS 1024 + +/* + * UNITY_CHANGE_* track changes to windows as we're accumulating state for + * an update. + */ +#define UNITY_CHANGED_POSITION (1 << 0) +#define UNITY_CHANGED_REGION (1 << 1) +#define UNITY_CHANGED_ADDED (1 << 2) +#define UNITY_CHANGED_REMOVED (1 << 3) +#define UNITY_CHANGED_TITLE (1 << 4) +#define UNITY_CHANGED_ZORDER (1 << 5) +#define UNITY_CHANGED_WINDOW_STATE (1 << 6) +#define UNITY_CHANGED_WINDOW_ATTRIBUTES (1 << 7) +#define UNITY_CHANGED_WINDOW_TYPE (1 << 8) +#define UNITY_CHANGED_WINDOW_ICONS (1 << 9) +#define UNITY_CHANGED_WINDOW_DESKTOP (1 << 10) +#define UNITY_CHANGED_ACTIVE_DESKTOP (1 << 11) + +/* + * UNITY_UPDATE_* flags are passed to UnityWindowTracker_RequestUpdates + */ +#define UNITY_UPDATE_INCREMENTAL (1 << 0) +#define UNITY_UPDATE_REMOVE_UNTOUCHED (1 << 1) + +typedef enum { + UNITY_WINDOW_ORDER_TOP = 0, + UNITY_WINDOW_ORDER_BOTTOM = UNITY_MAX_WINDOWS +} UnityZOrder; + +/* + * Unity callbacks passed to UnityWindowTracker_Init used to notify the + * caller of changes to the window system. + */ +typedef enum { + UNITY_UPDATE_ADD_WINDOW, + UNITY_UPDATE_MOVE_WINDOW, + UNITY_UPDATE_REMOVE_WINDOW, + UNITY_UPDATE_CHANGE_WINDOW_REGION, + UNITY_UPDATE_CHANGE_WINDOW_TITLE, + UNITY_UPDATE_CHANGE_ZORDER, + UNITY_UPDATE_CHANGE_WINDOW_STATE, + UNITY_UPDATE_CHANGE_WINDOW_ATTRIBUTE, + UNITY_UPDATE_CHANGE_WINDOW_TYPE, + UNITY_UPDATE_CHANGE_WINDOW_ICON, + UNITY_UPDATE_CHANGE_WINDOW_DESKTOP, + UNITY_UPDATE_CHANGE_ACTIVE_DESKTOP +} UnityUpdateType; + +/* + * Single UnityUpdate struct that gets passed into the UnityUpdateCallback + * function. Unity updates have a very long way to travel (tools -> + * vmx -> mks -> vnc -> (wire) -> vnc -> ui) and having a single callback + * function greatly reduces the amount of plumbing that has to be written + * for every singe command. + */ + +typedef struct UnityUpdate { + UnityUpdateType type; + union { + struct { + UnityWindowId id; + } addWindow; + + struct { + UnityWindowId id; + } removeWindow; + + struct { + UnityWindowId id; + BoxRec rect; + } moveWindow; + + struct { + UnityWindowId id; + RegionPtr region; + } changeWindowRegion; + + struct { + UnityWindowId id; + DynBuf titleUtf8; + } changeWindowTitle; + + struct { + uint32 count; + UnityWindowId ids[UNITY_MAX_WINDOWS]; + } zorder; + + struct { + UnityWindowId id; + uint32 state; + } changeWindowState; + + struct { + UnityWindowId id; + UnityWindowAttribute attr; + uint32 value; + } changeWindowAttribute; + + struct { + UnityWindowId id; + UnityWindowType winType; + } changeWindowType; + + struct { + UnityWindowId id; + UnityIconType iconType; + } changeWindowIcon; + + struct { + UnityWindowId id; + UnityDesktopId desktopId; + } changeWindowDesktop; + + struct { + UnityDesktopId desktopId; + } changeActiveDesktop; + + } u; +} UnityUpdate; + +typedef void (*UnityUpdateCallback)(void *param, UnityUpdate *update); + +/* + * Internal state -- + * Do not fiddle with these bits! They are included in this header to aid in debugging. + * Enjoy looking at them, but consider them READ ONLY (!!) + * + */ + +#define UNITY_INFO_ATTR_EXISTS (1 << 7) +#define UNITY_INFO_ATTR_CHANGED (1 << 6) +#define UNITY_INFO_ATTR_ENABLED (1 << 0) + +typedef struct { + UnityWindowId id; + DynBuf titleUtf8; + RegionPtr region; + BoxRec rect; + uint32 state; + UnityWindowType type; + UnityDesktopId desktopId; + + /* Each element is an OR of the UNITY_INFO_ATTR_* values */ + unsigned char attributes[UNITY_MAX_ATTRIBUTES]; + /* Ditto, but only EXISTS and CHANGED apply... */ + unsigned char icons[UNITY_MAX_ICONS]; + + Bool reap; + /* + * Used to track if a window was reported during the last update cycle (whether or not + * its properties actually changed), so that we can automatically have windows removed + * in Unity implementations that poll for changes (such as Win32). + */ + Bool touched; + /* + * Used to track which properties of a window changed during the last update cycle. + */ + int changed; + + void *data; + + /* + * This points back to the tracker. It's either this, or a bigger hack in + * lib/misc/hash.c + */ + void *tracker; +} UnityWindowInfo; + +typedef struct _UnityWindowTracker UnityWindowTracker; + +typedef void (*UnityDataFreeFunc)(UnityWindowTracker *tracker, + UnityWindowInfo *windowInfo, + void *data); + +struct _UnityWindowTracker { + HashTable *windows; + UnityWindowId zorder[UNITY_MAX_WINDOWS]; + uint32 count; // in zorder array + Bool zorderChanged; + + UnityDesktopId activeDesktopId; + Bool activeDesktopChanged; + + void *cbparam; + UnityUpdateCallback cb; + uint32 updateFlags; + + UnityDataFreeFunc freeFn; +}; + +/* + * Public Functions -- + */ + +void UnityWindowTracker_Init(UnityWindowTracker *tracker, + UnityUpdateCallback cb); +void UnityWindowTracker_Cleanup(UnityWindowTracker *tracker); +void UnityWindowTracker_SetDataFreeFunc(UnityWindowTracker *tracker, + UnityDataFreeFunc freeFn); +UnityWindowInfo *UnityWindowTracker_AddWindow(UnityWindowTracker *tracker, + UnityWindowId id); +UnityWindowInfo *UnityWindowTracker_AddWindowWithData(UnityWindowTracker *tracker, + UnityWindowId id, + void *data); +void UnityWindowTracker_MoveWindow(UnityWindowTracker *tracker, + UnityWindowId id, int x1, int y1, int x2, + int y2); +void UnityWindowTracker_ChangeWindowRegion(UnityWindowTracker *tracker, + UnityWindowId id, RegionPtr region); +void UnityWindowTracker_RemoveWindow(UnityWindowTracker *tracker, + UnityWindowId id); +void UnityWindowTracker_SendUpdate(UnityWindowTracker *tracker, + UnityUpdate *update); +void UnityWindowTracker_SetWindowTitle(UnityWindowTracker *tracker, + UnityWindowId id, + DynBuf *titleUtf8); + +/* + * Please note that calling ChangeWindowState directly is deprecated. Use + * SetWindowAttribute and SetWindowType instead. + */ +void UnityWindowTracker_ChangeWindowState(UnityWindowTracker *tracker, + UnityWindowId id, + uint32 state); +/* + * Deprecated. Use GetWindowAttribute and GetWindowType instead. + */ +Bool UnityWindowTracker_GetWindowState(UnityWindowTracker *tracker, + UnityWindowId id, + uint32 *state); + +void UnityWindowTracker_ChangeWindowAttribute(UnityWindowTracker *tracker, + UnityWindowId id, + UnityWindowAttribute attr, + Bool enabled); +Bool UnityWindowTracker_GetWindowAttribute(UnityWindowTracker *tracker, + UnityWindowId id, + UnityWindowAttribute attr, + Bool *enabled); +void UnityWindowTracker_ChangeWindowType(UnityWindowTracker *tracker, + UnityWindowId id, + UnityWindowType winType); +Bool UnityWindowTracker_GetWindowType(UnityWindowTracker *tracker, + UnityWindowId id, + UnityWindowType *winType); +void UnityWindowTracker_NotifyIconChanged(UnityWindowTracker *tracker, + UnityWindowId id, + UnityIconType iconType); +void UnityWindowTracker_ChangeWindowDesktop(UnityWindowTracker *tracker, + UnityWindowId id, + UnityDesktopId desktopId); +Bool UnityWindowTracker_GetWindowDesktop(UnityWindowTracker *tracker, + UnityWindowId id, + UnityDesktopId *desktopId); +void UnityWindowTracker_ChangeActiveDesktop(UnityWindowTracker *tracker, + UnityDesktopId desktopId); +UnityDesktopId UnityWindowTracker_GetActiveDesktop(UnityWindowTracker *tracker); +void UnityWindowTracker_SetZOrder(UnityWindowTracker *tracker, UnityWindowId zorder[], + int count); +void UnityWindowTracker_SetZPosition(UnityWindowTracker *tracker, UnityWindowId window, + uint32 zorder); +void UnityWindowTracker_RequestUpdates(UnityWindowTracker *tracker, + uint32 flags, void *param); +UnityWindowInfo *UnityWindowTracker_LookupWindow(UnityWindowTracker *tracker, + UnityWindowId id); + + +/* + *----------------------------------------------------------------------------- + * + * UnityWindowTracker_GetWindowData -- + * + * Returns the app data pointer associated with a particular Unity window. + * + * Results: + * Pointer to the app data. May be NULL if no data is set or 'info' is invalid. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static INLINE void * +UnityWindowTracker_GetWindowData(UnityWindowTracker *tracker, // IN + UnityWindowInfo *info) // IN +{ + return info ? info->data : NULL; +} + + +/* + *----------------------------------------------------------------------------- + * + * UnityWindowTracker_GetWindowDataById -- + * + * Returns the app data pointer associated with a particular Unity window ID. + * + * Results: + * Pointer to the app data. May be NULL if no data is set or 'info' is invalid. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static INLINE void * +UnityWindowTracker_GetWindowDataById(UnityWindowTracker *tracker, // IN + UnityWindowId winId) // IN +{ + return UnityWindowTracker_GetWindowData(tracker, + UnityWindowTracker_LookupWindow(tracker, + winId)); +} +#endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/util.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/util.h --- open-vm-tools-2008.01.23-74039/lib/include/util.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/util.h 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -25,6 +25,7 @@ #ifndef UTIL_H #define UTIL_H +#define INCLUDE_ALLOW_MODULE #define INCLUDE_ALLOW_USERLEVEL #define INCLUDE_ALLOW_VMCORE #include "includeCheck.h" @@ -48,9 +49,21 @@ #include #endif -#include "vm_basic_types.h" #include "vm_assert.h" +#include "unicodeTypes.h" +/* + * Define the Util_ThreadID type. + */ +#if defined(__APPLE__) || defined(__FreeBSD__) +#include +typedef pthread_t Util_ThreadID; +#elif defined(_WIN32) +typedef DWORD Util_ThreadID; +#else // Linux et al +#include +typedef pid_t Util_ThreadID; +#endif #ifdef __APPLE__ EXTERN char *Util_CFStringToUTF8CString(CFStringRef s); @@ -64,7 +77,6 @@ EXTERN io_service_t Util_IORegGetDeviceObjectByName(const char *deviceName); EXTERN char *Util_GetBSDName(const char *deviceName); EXTERN char *Util_IORegGetDriveType(const char *deviceName); -EXTERN char *Util_GetMacOSUserHomeDirectory(); EXTERN char *Util_GetMacOSDefaultVMPath(); #endif // __APPLE__ @@ -73,8 +85,7 @@ EXTERN uint32 Util_Checksum32(uint32 *buf, int len); EXTERN uint32 Util_Checksum(uint8 *buf, int len); EXTERN uint32 Util_Checksumv(void *iov, int numEntries); -EXTERN void Util_ShortenPath(char *dst, const char *src, int maxLen); -EXTERN char *Util_ExpandString(const char *fileName); +EXTERN Unicode Util_ExpandString(ConstUnicode fileName); EXTERN void Util_ExitThread(int); EXTERN NORETURN void Util_ExitProcessAbruptly(int); EXTERN int Util_HasAdminPriv(void); @@ -86,12 +97,15 @@ size_t dataSize); EXTERN char *Util_GetCanonicalPath(const char *path); #ifdef _WIN32 -EXTERN char *Util_GetLowerCaseCanonicalPath(const char *path); +EXTERN char *Util_CompatGetCanonicalPath(const char *path); +EXTERN char *Util_GetCanonicalPathForHash(const char *path); +EXTERN char *Util_CompatGetLowerCaseCanonicalPath(const char* path); #endif +EXTERN int Util_BumpNoFds(uint32 *cur, uint32 *wanted); EXTERN Bool Util_CanonicalPathsIdentical(const char *path1, const char *path2); EXTERN Bool Util_IsAbsolutePath(const char *path); EXTERN unsigned Util_GetPrime(unsigned n0); -EXTERN uint32 Util_GetCurrentThreadId(void); +EXTERN Util_ThreadID Util_GetCurrentThreadId(void); EXTERN char *Util_DeriveFileName(const char *source, const char *name, @@ -101,7 +115,9 @@ EXTERN char **Util_SeparateStrings(char *source, int *count); EXTERN char *Util_GetSafeTmpDir(Bool useConf); -EXTERN int Util_MakeSafeTemp(const char *tag, char **presult); + +EXTERN int Util_MakeSafeTemp(ConstUnicode tag, + Unicode *presult); #if defined(__linux__) || defined(__FreeBSD__) || defined(sun) EXTERN Bool Util_GetProcessName(pid_t pid, char *bufOut, size_t bufOutSize); @@ -128,7 +144,9 @@ int Util_CompareDotted(const char *s1, const char *s2); - +#if defined(__linux__) +void Util_PrintLoadedObjects(void *addr_inside_exec); +#endif /* * In util_shared.h @@ -199,8 +217,11 @@ # define VALID_DIRSEPS "\\/:" #elif _WIN32 # define DIRSEPS "\\" +# define DIRSEPS_W L"\\" # define DIRSEPC '\\' -# define VALID_DIRSEPS "\\/" +# define DIRSEPC_W L'\\' +# define VALID_DIRSEPS "\\/" +# define VALID_DIRSEPS_W L"\\/" #else # define DIRSEPS "/" # define DIRSEPC '/' @@ -277,7 +298,7 @@ { void *result = malloc(size); - if (result == NULL) { + if (result == NULL && size != 0) { if (bugNumber == -1) { Panic("Unrecoverable memory allocation failure at %s:%d\n", file, lineno); @@ -313,7 +334,7 @@ { void *result = calloc(nmemb, size); - if (result == NULL) { + if (result == NULL && nmemb != 0 && size != 0) { if (bugNumber == -1) { Panic("Unrecoverable memory allocation failure at %s:%d\n", file, lineno); @@ -343,7 +364,11 @@ if (s == NULL) { return NULL; } +#ifdef _WIN32 + if ((result = _strdup(s)) == NULL) { +#else if ((result = strdup(s)) == NULL) { +#endif if (bugNumber == -1) { Panic("Unrecoverable memory allocation failure at %s:%d\n", file, lineno); @@ -511,4 +536,91 @@ } } + +#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 +{ + if (str != NULL) { + Util_Zero(str, wcslen(str) * sizeof(wchar_t)); + 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: 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: the list to free + ssize_t length) // IN: the length +{ + Util_FreeList((void **) list, length); +} + #endif /* UTIL_H */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/util_shared.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/util_shared.h --- open-vm-tools-2008.01.23-74039/lib/include/util_shared.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/util_shared.h 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/uuid.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/uuid.h --- open-vm-tools-2008.01.23-74039/lib/include/uuid.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/uuid.h 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -26,6 +26,7 @@ #define _UUID_H_ #define INCLUDE_ALLOW_USERLEVEL +#define INCLUDE_ALLOW_VMCORE #include "includeCheck.h" #define UUID_SIZE 16 @@ -34,9 +35,11 @@ Bool UUID_ConvertToBin(uint8 dest_id[UUID_SIZE], const char *text); char *UUID_ConvertToText(const uint8 id[UUID_SIZE]); -#define UUID_CREATE_WS4 0 /* the "original", WS4 and earlier scheme */ -#define UUID_CREATE_WS5 1 /* the WS5 scheme */ -#define UUID_CREATE_WS6 2 /* the WS6 scheme */ +#define UUID_CREATE_WS4 0 /* the "original", WS4 and earlier scheme */ +#define UUID_CREATE_WS5 1 /* the WS5 scheme */ +#define UUID_CREATE_WS6 2 /* the WS6 scheme - "native" path */ +#define UUID_CREATE_WS65 3 /* the WS65 scheme - UTF-8 path */ +#define UUID_CREATE_CURRENT 3 /* the current scheme - always the latest */ char *UUID_Create(const char *configFileFullPath, int schemeControl); diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/vixCommands.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/vixCommands.h --- open-vm-tools-2008.01.23-74039/lib/include/vixCommands.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/vixCommands.h 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -58,6 +58,7 @@ #define VIX_USER_CREDENTIAL_CONSOLE_USER 5 #define VIX_USER_CREDENTIAL_HOST_CONFIG_SECRET 6 #define VIX_USER_CREDENTIAL_HOST_CONFIG_HASHED_SECRET 7 +#define VIX_USER_CREDENTIAL_NAMED_INTERACTIVE_USER 8 #define VIX_SHARED_SECRET_CONFIG_USER_NAME "__VMware_Vix_Shared_Secret_1__" @@ -91,7 +92,8 @@ enum { VIX_REQUESTMSG_ONLY_RELOAD_NETWORKS = 0x01, VIX_REQUESTMSG_RETURN_ON_INITIATING_TOOLS_UPGRADE = 0x02, - VIX_REQUESTMSG_RUN_IN_ANY_VMX_STATE = 0x04 + VIX_REQUESTMSG_RUN_IN_ANY_VMX_STATE = 0x04, + VIX_REQUESTMSG_REQUIRES_INTERACTIVE_ENVIRONMENT = 0x08, }; @@ -252,6 +254,21 @@ VixMsgProgressEvent; +/* + * This is an event sent from the VMX to all clients when some property changes. + * It may be used for any runtime property. + */ +typedef +#include "vmware_pack_begin.h" +struct VixMsgPropertyChangedEvent { + VixMsgEventHeader eventHeader; + int options; + uint32 propertyListSize; +} +#include "vmware_pack_end.h" +VixMsgPropertyChangedEvent; + + /* * ********************************************************** @@ -260,8 +277,8 @@ typedef #include "vmware_pack_begin.h" struct VixCommandNamePassword { - int32 nameLength; - int32 passwordLength; + uint32 nameLength; + uint32 passwordLength; } #include "vmware_pack_end.h" VixCommandNamePassword; @@ -278,8 +295,8 @@ struct VixMsgVMOpenRequest { VixCommandRequestHeader header; int32 options; //options for VM_Open or CreateWorkingCopy - int32 xmlPathNameSize; - int32 vmxPathNameSize; + uint32 xmlPathNameSize; + uint32 vmxPathNameSize; //this is followed by the xml pathname and the vmx pathname } #include "vmware_pack_end.h" @@ -290,7 +307,7 @@ struct VixMsgVMOpenResponse { VixCommandResponseHeader header; int32 vmPowerState; - int32 vmxPathNameSize; + uint32 vmxPathNameSize; } #include "vmware_pack_end.h" VixMsgVMOpenResponse; @@ -313,7 +330,6 @@ - /* * ********************************************************** * Set NIC request. The response is just a generic @@ -364,7 +380,7 @@ #include "vmware_pack_begin.h" struct VixMsgGetVMStateResponse { VixCommandResponseHeader header; - int32 bufferSize; + uint32 bufferSize; // This is followed by the buffer of serialized properties } #include "vmware_pack_end.h" @@ -375,7 +391,7 @@ #include "vmware_pack_begin.h" struct VixMsgSetVMStateRequest { VixCommandRequestHeader header; - int32 bufferSize; + uint32 bufferSize; // This is followed by the buffer of serialized properties } #include "vmware_pack_end.h" @@ -412,7 +428,7 @@ #include "vmware_pack_begin.h" struct VixMsgConfigurationObjectType { int32 configurationType; - int32 objectSize; + uint32 objectSize; } #include "vmware_pack_end.h" VixMsgConfigurationObjectType; @@ -443,7 +459,28 @@ VIX_LAN_SEGMENT_SETTING_CONFIG = 1, }; +/* + * Commands related to Record|Replay State. + */ +typedef +#include "vmware_pack_begin.h" +struct VixMsgRecordReplayStateCommandRequest { + VixCommandRequestHeader header; + + int32 options; + uint32 propertyListBufferSize; +} +#include "vmware_pack_end.h" +VixMsgRecordReplayStateCommandRequest; +typedef +#include "vmware_pack_begin.h" +struct VixMsgRecordReplayStateCommandResponse { + VixCommandResponseHeader header; + uint32 propertyListBufferSize; +} +#include "vmware_pack_end.h" +VixMsgRecordReplayStateCommandResponse; /* @@ -473,8 +510,8 @@ VixCommandRequestHeader header; int32 runProgramOptions; - int32 programNameLength; - int32 commandLineArgsLength; + uint32 programNameLength; + uint32 commandLineArgsLength; } #include "vmware_pack_end.h" VixMsgRunProgramRequest; @@ -501,8 +538,8 @@ VmTimeType deltaTime; int64 pid; - int32 stdOutLength; - int32 stdErrLength; + uint32 stdOutLength; + uint32 stdErrLength; } #include "vmware_pack_end.h" VixMsgRunProgramResponse; @@ -518,7 +555,7 @@ VixCommandRequestHeader header; int32 installOptions; - int32 commandLineArgsLength; + uint32 commandLineArgsLength; } #include "vmware_pack_end.h" VixMsgInstallToolsRequest; @@ -570,7 +607,7 @@ int32 options; int64 targetPid; int32 numKeyStrokes; - int32 windowNameLength; + uint32 windowNameLength; } #include "vmware_pack_end.h" VixMsgSendKeyStrokesRequest; @@ -604,9 +641,9 @@ struct VixMsgRegistryRequest { VixCommandRequestHeader header; - int32 registryKeyLength; + uint32 registryKeyLength; int32 expectedRegistryKeyType; - int32 dataToWriteSize; + uint32 dataToWriteSize; } #include "vmware_pack_end.h" VixMsgRegistryRequest; @@ -623,9 +660,9 @@ VixCommandRequestHeader header; int32 copyFileOptions; - int32 oldPathNameLength; - int32 newPathNameLength; - int32 filePropertiesLength; + uint32 oldPathNameLength; + uint32 newPathNameLength; + uint32 filePropertiesLength; } #include "vmware_pack_end.h" VixCommandRenameFileRequest; @@ -635,7 +672,7 @@ struct VixCommandHgfsSendPacket { VixCommandRequestHeader header; - int32 hgfsPacketSize; + uint32 hgfsPacketSize; int32 timeout; } #include "vmware_pack_end.h" @@ -653,7 +690,7 @@ VixCommandRequestHeader header; int32 fileOptions; - int32 guestPathNameLength; + uint32 guestPathNameLength; } #include "vmware_pack_end.h" VixMsgSimpleFileRequest; @@ -664,7 +701,7 @@ VixCommandRequestHeader header; int32 fileOptions; - int32 guestPathNameLength; + uint32 guestPathNameLength; int64 offset; } #include "vmware_pack_end.h" @@ -700,8 +737,8 @@ VixCommandRequestHeader header; int32 fileOptions; - int32 guestPathNameLength; - int32 filePropertiesLength; + uint32 guestPathNameLength; + uint32 filePropertiesLength; } #include "vmware_pack_end.h" VixMsgCreateFileRequest; @@ -716,11 +753,11 @@ struct VixMsgHotDiskRequest { VixCommandRequestHeader header; int32 hotDiskOptions; - int32 adapterTypeLength; - int32 typeLength; - int32 nameLength; - int32 modeLength; - int32 deviceTypeLength; + uint32 adapterTypeLength; + uint32 typeLength; + uint32 nameLength; + uint32 modeLength; + uint32 deviceTypeLength; int32 adapterNum; int32 targetNum; } @@ -737,10 +774,10 @@ struct VixMsgHotExtendDiskRequest { VixCommandRequestHeader header; int32 hotDiskOptions; - int32 typeLength; + uint32 typeLength; int32 adapterNum; int32 targetNum; - uint64 newNumSectors; + uint64 newNumSectors; } #include "vmware_pack_end.h" VixMsgHotExtendDiskRequest; @@ -748,6 +785,76 @@ /* * ********************************************************** + * Hot plug CPU in a running VM. + */ +typedef +#include "vmware_pack_begin.h" +struct VixMsgHotPlugCPURequest { + VixCommandRequestHeader header; + uint32 newNumCPU; +} +#include "vmware_pack_end.h" +VixMsgHotPlugCPURequest; + + +/* + * ********************************************************** + * Hot plug memory in a running VM. + */ +typedef +#include "vmware_pack_begin.h" +struct VixMsgHotPlugMemoryRequest { + VixCommandRequestHeader header; + uint32 newSizeMb; +} +#include "vmware_pack_end.h" +VixMsgHotPlugMemoryRequest; + + +/* + * ********************************************************** + * Hot add device in a running VM. + */ +typedef +#include "vmware_pack_begin.h" +struct VixMsgHotAddDeviceRequest { + VixCommandRequestHeader header; + int32 deviceType; + uint32 devicePropsBufferSize; + int32 backingType; + uint32 backingPropsBufferSize; +} +#include "vmware_pack_end.h" +VixMsgHotAddDeviceRequest; + +typedef +#include "vmware_pack_begin.h" +struct VixMsgHotAddDeviceResponse { + VixCommandResponseHeader header; + int32 adapterNum; + int32 targetNum; +} +#include "vmware_pack_end.h" +VixMsgHotAddDeviceResponse; + + +/* + * ********************************************************** + * Hot remove device in a running VM. + */ +typedef +#include "vmware_pack_begin.h" +struct VixMsgHotRemoveDeviceRequest { + VixCommandRequestHeader header; + int32 deviceType; + uint32 devicePropsBufferSize; +} +#include "vmware_pack_end.h" +VixMsgHotRemoveDeviceRequest; + + +/* + * ********************************************************** * Create a snapshot of a running VM. */ typedef @@ -760,8 +867,8 @@ Bool powerOff; Bool saveDeviceState; - int32 nameLength; - int32 descriptionLength; + uint32 nameLength; + uint32 descriptionLength; } #include "vmware_pack_end.h" VixMsgCreateSnapshotRequest; @@ -791,6 +898,65 @@ #include "vmware_pack_end.h" VixMsgSnapshotRequest; +typedef +#include "vmware_pack_begin.h" +struct VixMsgSnapshotUpdateEvent { + VixMsgEventHeader eventHeader; + + int32 options; + uint32 propertyListLength; + /* + * This is followed by a serialized property list. + */ +} +#include "vmware_pack_end.h" +VixMsgSnapshotUpdateEvent; + +typedef +#include "vmware_pack_begin.h" +struct VixMsgSnapshotMRURequest { + VixCommandRequestHeader header; + + int32 snapshotId; + int32 maxMRU; +} +#include "vmware_pack_end.h" +VixMsgSnapshotMRURequest; + +typedef +#include "vmware_pack_begin.h" +struct VixMsgSetSnapshotInfoRequest { + VixCommandRequestHeader header; + + int32 snapshotId; + int32 clientFlags; + int32 numTierUIDs; + + uint32 displayNameLength; + uint32 descriptionLength; + uint32 propertyListLength; + uint32 tierUIDListLength; + + /* + * Followed by: + * displayName string + * description string + * serialized property list. + */ +} +#include "vmware_pack_end.h" +VixMsgSetSnapshotInfoRequest; + +typedef +#include "vmware_pack_begin.h" +struct VixMsgSetSnapshotInfoResponse { + VixCommandResponseHeader header; + + uint32 propertyListLength; +} +#include "vmware_pack_end.h" +VixMsgSetSnapshotInfoResponse; + /* * Fork a running VM. @@ -803,8 +969,8 @@ int32 options; Bool disconnectRemovable; - int32 cfgFileNameLen; - int32 displayNameLen; + uint32 cfgFileNameLen; + uint32 displayNameLen; } #include "vmware_pack_end.h" VixMsgVMForkRequest; @@ -844,12 +1010,33 @@ VixMsgRecordReplayEvent; typedef +#include "vmware_pack_begin.h" +struct VixMsgTimeMarkerEncounteredEvent { + VixMsgEventHeader eventHeader; + uint32 propertyListSize; +} +#include "vmware_pack_end.h" +VixMsgTimeMarkerEncounteredEvent; + +typedef +#include "vmware_pack_begin.h" +struct VixMsgDebuggerEvent { + VixMsgEventHeader eventHeader; + + int32 blobLength; + /* + * This is followed by the blob buffer. + */ +} +#include "vmware_pack_end.h" +VixMsgDebuggerEvent; +typedef #include "vmware_pack_begin.h" struct VixMsgGetRecordReplayInfoResponse { VixCommandResponseHeader header; uint32 propertyListSize; -} +} #include "vmware_pack_end.h" VixMsgGetRecordReplayInfoResponse; @@ -865,33 +1052,29 @@ #include "vmware_pack_end.h" VixMsgVMSnapshotSetReplaySpeedRequest; -typedef uint32 VixReplayStopAtType; -enum { - VIX_REPLAY_STOPAT_EIPECXBRCNT = 1, -}; - typedef #include "vmware_pack_begin.h" -struct VixMsgVMSetReplayStopAtRequest { +struct VixMsgVMAddTimeMarkerRequest { VixCommandRequestHeader header; - - int32 options; - VixReplayStopAtType stopAtType; + uint32 options; + uint32 action; + uint32 propertyListSize; } #include "vmware_pack_end.h" -VixMsgVMSetReplayStopAtRequest; +VixMsgVMAddTimeMarkerRequest; typedef #include "vmware_pack_begin.h" -struct VixMsgVMSetReplayStopAtEipEcxBrCntRequest { - VixMsgVMSetReplayStopAtRequest stopAtCommonRequest; - uint32 mask; - uint64 eip; - uint64 ecx; - int64 brCnt; +struct VixMsgVMGetTimeMarkerRequest { + VixCommandRequestHeader header; + uint32 options; + uint32 whence; + uint32 index; + uint32 propertyListSize; } #include "vmware_pack_end.h" -VixMsgVMSetReplayStopAtEipEcxBrCntRequest; +VixMsgVMGetTimeMarkerRequest; + /* * Fault Tolerance Automation @@ -903,7 +1086,7 @@ int32 command; char uuid[48]; - int32 vmxPathLen; + uint32 vmxPathLen; char vmxFilePath[1]; } #include "vmware_pack_end.h" @@ -922,8 +1105,8 @@ int32 options; int32 index; - int32 shareNameLength; - int32 hostPathNameLength; + uint32 shareNameLength; + uint32 hostPathNameLength; } #include "vmware_pack_end.h" VixMsgSharedFolderRequest; @@ -944,8 +1127,8 @@ struct VixMsgGetSharedFolderInfoResponse { VixCommandResponseHeader header; - int32 shareNameLength; - int32 hostPathNameLength; + uint32 shareNameLength; + uint32 hostPathNameLength; int32 sharedFolderFlags; } #include "vmware_pack_end.h" @@ -961,8 +1144,8 @@ VixCommandRequestHeader header; int32 options; - int32 shareNameLength; - int32 hostPathNameLength; + uint32 shareNameLength; + uint32 hostPathNameLength; } #include "vmware_pack_end.h" VixMsgSetSharedFolderRequest; @@ -979,7 +1162,7 @@ VixCommandRequestHeader header; int32 options; - int32 diskPathNameLength; + uint32 diskPathNameLength; } #include "vmware_pack_end.h" VixMsgGetDiskPropertiesRequest; @@ -992,7 +1175,7 @@ int64 capacity; int64 spaceUsed; int32 diskLibDiskType; - int32 physicalPathLength; + uint32 physicalPathLength; } #include "vmware_pack_end.h" VixMsgGetDiskPropertiesResponse; @@ -1038,7 +1221,7 @@ VixCommandResponseHeader header; int32 format; // Format of the data in the response. - int32 dataOffset; // Relative to the address of this struct. + uint32 dataOffset; // Relative to the address of this struct. } #include "vmware_pack_end.h" VixMsgCaptureScreenResponse; @@ -1054,9 +1237,9 @@ int32 scriptOptions; - int32 interpreterNameLength; - int32 scriptLength; - int32 propertiesLength; + uint32 interpreterNameLength; + uint32 scriptLength; + uint32 propertiesLength; } #include "vmware_pack_end.h" VixMsgRunScriptRequest; @@ -1088,7 +1271,7 @@ int32 keyOptions; int32 timeout; - int32 responseKeyLength; + uint32 responseKeyLength; int32 responseKeyCypherType; int32 cypherType; } @@ -1103,7 +1286,7 @@ int32 keyOptions; int32 timeout; - int32 keyLength; + uint32 keyLength; int32 cypherType; } #include "vmware_pack_end.h" @@ -1133,39 +1316,6 @@ VixCommandKillProcessRequest; - -/* - * ********************************************************** - * Manage a socket connection between the host and guest. - */ - -typedef -#include "vmware_pack_begin.h" -struct VixCommandGuestSocketRequest { - VixCommandRequestHeader header; - - int64 socket; - unsigned short port; - uint32 timeoutMS; - uint32 backlog; - uint32 dataLen; -} -#include "vmware_pack_end.h" -VixCommandGuestSocketRequest; - -typedef -#include "vmware_pack_begin.h" -struct VixCommandGuestSocketResponse { - VixCommandResponseHeader header; - - int64 socket; - uint32 dataLen; -} -#include "vmware_pack_end.h" -VixCommandGuestSocketResponse; - - - /* * ********************************************************** * Read and write variables like guest variables and config values. @@ -1177,7 +1327,7 @@ int32 variableType; int32 options; - int32 nameLength; + uint32 nameLength; } #include "vmware_pack_end.h" VixMsgReadVariableRequest; @@ -1190,7 +1340,7 @@ int32 valueType; int32 valueProperties; - int32 valueLength; + uint32 valueLength; } #include "vmware_pack_end.h" VixMsgReadVariableResponse; @@ -1207,8 +1357,8 @@ int32 variableType; int32 options; - int32 nameLength; - int32 valueLength; + uint32 nameLength; + uint32 valueLength; } #include "vmware_pack_end.h" VixMsgWriteVariableRequest; @@ -1227,9 +1377,9 @@ VixCommandRequestHeader header; int32 options; - int32 propertyNameLength; - int32 filePrefixLength; - int32 fileSuffixLength; + uint32 propertyNameLength; + uint32 filePrefixLength; + uint32 fileSuffixLength; } #include "vmware_pack_end.h" VixMsgCreateTempFileRequest; @@ -1246,7 +1396,7 @@ VixCommandRequestHeader header; int32 options; Bool connected; - int32 nameLength; + uint32 nameLength; } #include "vmware_pack_end.h" VixMsgConnectDeviceRequest; @@ -1300,7 +1450,7 @@ VixCommandRequestHeader header; int32 options; - int32 nameLength; + uint32 nameLength; } #include "vmware_pack_end.h" VixMsgGetDeviceStateRequest; @@ -1357,7 +1507,7 @@ int32 mountType; /* The str path list has the form "host1\0dest1\0host2\0dest2\0host3\0dest3\0\0" */ - int32 pathListLength; + uint32 pathListLength; } #include "vmware_pack_end.h" VixMsgMountHGFSRequest; @@ -1365,22 +1515,6 @@ /* * ********************************************************** - * Wait for the VM to be in a specific state. - */ - -typedef -#include "vmware_pack_begin.h" -struct VixMsgWaitForState { - VixCommandRequestHeader header; - int32 state; - int32 options; -} -#include "vmware_pack_end.h" -VixMsgWaitForState; - - -/* - * ********************************************************** * Get the state of all USB devices. */ @@ -1394,9 +1528,9 @@ VixCommandResponseHeader header; int32 numRunningDevices; - int32 runningDeviceListLength; + uint32 runningDeviceListLength; - int32 patternListLength; + uint32 patternListLength; } #include "vmware_pack_end.h" VixMsgGetUSBDeviceListResponse; @@ -1452,7 +1586,7 @@ #include "vmware_pack_begin.h" struct VixMsgGetPerformanceDataResponse { VixCommandResponseHeader header; - int32 bufferSize; + uint32 bufferSize; // This is followed by the buffer of serialized properties } #include "vmware_pack_end.h" @@ -1485,7 +1619,7 @@ VixCommandRequestHeader header; int32 intArg; - int32 strArgLength; + uint32 strArgLength; } #include "vmware_pack_end.h" VixMsgSampleCommandRequest; @@ -1496,7 +1630,7 @@ VixCommandResponseHeader header; int32 intResult; - int32 strResultLength; + uint32 strResultLength; } #include "vmware_pack_end.h" VixMsgSampleCommandResponse; @@ -1524,6 +1658,7 @@ int32 dialogType; uint64 dialogCookie; + int32 dialogOptions; int32 severity; int32 defaultAnswer; @@ -1531,11 +1666,13 @@ int32 cancelButton; int32 hintOptions; + uint32 localeStrLength; int32 numMessages; int32 numButtons; /* * Followed by: + * A locale string (a null-terminated string) * A list of messages, each is stored in one VixMsgDialogStr. * A list of button strings (each is a null-terminated string. */ @@ -1543,6 +1680,13 @@ #include "vmware_pack_end.h" VixMsgOpenMsgPostEvent; +/* + * These are the flags set in the dialogOptions field. + */ +enum VixMsgPostStateValues { + VIX_COMMAND_DIALOG_OPTIONS_VMX_IS_BLOCKED = 0x01, +}; + /* * This is one string in the message. It corresponds to a @@ -1551,8 +1695,8 @@ typedef #include "vmware_pack_begin.h" struct VixMsgDialogStr { - int32 idLength; - int32 formatLength; + uint32 idLength; + uint32 formatLength; int32 numArgs; /* * Followed by: @@ -1573,7 +1717,7 @@ #include "vmware_pack_begin.h" struct VixMsgDialogStrArg { int32 argType; - int32 argSize; + uint32 argSize; /* * Followed by the actual argument data. */ @@ -1583,44 +1727,6 @@ /* - * Vix_WaitForUserActionInGuest Request - * VIX_COMMAND_WAIT_FOR_USER_ACTION_IN_GUEST - */ - -enum { - // userType - VIX_USERTYPE_ANY = 0, -}; - -enum { - // userAction - VIX_USERACTION_UNKNOWN = -1, - VIX_USERACTION_LOGIN = 0, -}; - -typedef -#include "vmware_pack_begin.h" -struct VixMsgWaitForUserActionRequest { - VixCommandResponseHeader header; - - int32 userType; - int32 userAction; - - int32 timeoutInSeconds; - int32 options; - - int32 userNameLength; - int32 propertyBufferSize; - - // This is followed by: - // userName - // buffer of serialized properties -} -#include "vmware_pack_end.h" -VixMsgWaitForUserActionRequest; - - -/* * This is used to report a MsgPost is closing. */ typedef @@ -1640,111 +1746,193 @@ VixMsgCloseUIDialogEvent; +/* + * Answer a Msg_Post post/hint/question + */ typedef #include "vmware_pack_begin.h" -struct VixMsgWaitForUserActionResponse { - VixCommandRequestHeader header; +struct VixMsgAnswerMsgPost { + VixCommandRequestHeader header; - Bool actionHappened; + uint64 dialogCookie; - int32 bufferSize; - // This is followed by the buffer of serialized properties + int32 options; + + int32 answer; + void *progressState; + + uint32 idStrSize; + uint32 propertyListBufferSize; + + /* + * Followed by: + * msgIdStr. + * The serialized properties + */ } #include "vmware_pack_end.h" -VixMsgWaitForUserActionResponse; +VixMsgAnswerMsgPost; + +typedef +#include "vmware_pack_begin.h" +struct VixMsgSetLocaleRequest { + VixCommandRequestHeader header; + int32 localeOptions; + + uint32 localeStrLength; + char localeStr[1]; + // This is followed by the country code string. +} +#include "vmware_pack_end.h" +VixMsgSetLocaleRequest; /* - * This is used to report a MsgPost is opening. - * This is the localized version. It passes the localized message. - * - * See VixMsgOpenMsgPostEvent for the non-localized version. + * This is used to report progress. */ typedef #include "vmware_pack_begin.h" -struct VixMsgOpenMsgPostEventLocalized { +struct VixMsgLazyProgressEvent { VixMsgEventHeader eventHeader; - int32 dialogType; uint64 dialogCookie; - - int32 severity; - int32 defaultAnswer; int32 percent; - int32 cancelButton; - int32 hintOptions; - - int32 localeStrLength; - int32 numMessages; - int32 numButtons; - - /* - * Followed by: - * A locale string (a null-terminated string) - * A list of localized message strings (each is a null-terminated string). - * A list of localized button strings (each is a null-terminated string). - */ } #include "vmware_pack_end.h" -VixMsgOpenMsgPostEventLocalized; +VixMsgLazyProgressEvent; + /* - * Answer a Msg_Post post/hint/question + * ********************************************************** + * Debugger related commands. */ + typedef #include "vmware_pack_begin.h" -struct VixMsgAnswerMsgPost { +struct VixMsgAttachDebuggerRequest { VixCommandRequestHeader header; - - uint64 dialogCookie; - + int32 options; + uint32 propertyListBufferSize; +} +#include "vmware_pack_end.h" +VixMsgAttachDebuggerRequest; - int32 answer; - void *progressState; +typedef +#include "vmware_pack_begin.h" +struct VixMsgAttachDebuggerResponse { + VixCommandResponseHeader header; + uint32 propertyListBufferSize; +} +#include "vmware_pack_end.h" +VixMsgAttachDebuggerResponse; - uint32 idStrSize; +typedef +#include "vmware_pack_begin.h" +struct VixMsgIssueDebuggerCommandRequest { + VixCommandRequestHeader header; + + int32 options; uint32 propertyListBufferSize; + uint32 debuggerBlobBufferSize; } #include "vmware_pack_end.h" -VixMsgAnswerMsgPost; +VixMsgIssueDebuggerCommandRequest; +typedef +#include "vmware_pack_begin.h" +struct VixMsgIssueDebuggerCommandResponse { + VixCommandResponseHeader header; + uint32 propertyListBufferSize; + uint32 debuggerBlobBufferSize; +} +#include "vmware_pack_end.h" +VixMsgIssueDebuggerCommandResponse; +typedef +#include "vmware_pack_begin.h" +struct VixMsgDetachDebuggerRequest { + VixCommandRequestHeader header; + + int32 options; + uint32 propertyListBufferSize; +} +#include "vmware_pack_end.h" +VixMsgDetachDebuggerRequest; typedef #include "vmware_pack_begin.h" -struct VixMsgSetLocaleRequest { - VixCommandRequestHeader header; +struct VixMsgDetachDebuggerResponse { + VixCommandResponseHeader header; + uint32 propertyListBufferSize; +} +#include "vmware_pack_end.h" +VixMsgDetachDebuggerResponse; - int32 localeOptions; - - int32 localeStrLength; - char localeStr[1]; - // This is followed by the country code string. +/* + * ********************************************************** + * VM Pause state change event format + */ + +typedef +#include "vmware_pack_begin.h" +struct VixMsgPauseStateChangedEvent { + VixMsgEventHeader eventHeader; + Bool paused; } #include "vmware_pack_end.h" -VixMsgSetLocaleRequest; +VixMsgPauseStateChangedEvent; +/* + * ********************************************************** + * Wait for a user action, such as a user logging into the guest. + */ /* - * This is used to report progress. + * Vix_WaitForUserActionInGuest Request + * VIX_COMMAND_WAIT_FOR_USER_ACTION_IN_GUEST */ + typedef #include "vmware_pack_begin.h" -struct VixMsgLazyProgressEvent { - VixMsgEventHeader eventHeader; +struct VixMsgWaitForUserActionRequest { + VixCommandResponseHeader header; - uint64 dialogCookie; - int32 percent; + int32 userType; + int32 userAction; + + int32 timeoutInSeconds; + int32 options; + + uint32 userNameLength; + uint32 propertyBufferSize; + + // This is followed by: + // userName + // buffer of serialized properties } #include "vmware_pack_end.h" -VixMsgLazyProgressEvent; +VixMsgWaitForUserActionRequest; + + +typedef +#include "vmware_pack_begin.h" +struct VixMsgWaitForUserActionResponse { + VixCommandRequestHeader header; + + Bool actionHappened; + + uint32 bufferSize; + // This is followed by the buffer of serialized properties +} +#include "vmware_pack_end.h" +VixMsgWaitForUserActionResponse; @@ -1830,12 +2018,6 @@ VIX_COMMAND_SET_VMDB_VALUES = 60, VIX_COMMAND_READ_XML_FILE = 61, VIX_COMMAND_GET_TOOLS_STATE = 62, - VIX_COMMAND_GUEST_SOCKET_CONNECT = 63, - VIX_COMMAND_GUEST_SOCKET_LISTEN = 64, - VIX_COMMAND_GUEST_SOCKET_ACCEPT = 65, - VIX_COMMAND_GUEST_SOCKET_RECEIVE = 66, - VIX_COMMAND_GUEST_SOCKET_SEND = 67, - VIX_COMMAND_GUEST_SOCKET_CLOSE = 68, VIX_COMMAND_CHANGE_SCREEN_RESOLUTION = 69, VIX_COMMAND_DIRECTORY_EXISTS = 70, VIX_COMMAND_DELETE_GUEST_REGISTRY_KEY = 71, @@ -1876,7 +2058,6 @@ VIX_COMMAND_LIST_USB_DEVICES = 109, VIX_COMMAND_CONNECT_HOST = 110, - VIX_COMMAND_WAIT_FOR_OPPORTUNE_MOMENT = 111, VIX_COMMAND_CREATE_LINKED_CLONE = 112, @@ -1913,12 +2094,45 @@ VIX_COMMAND_REFRESH_RUNTIME_PROPERTIES = 129, VIX_COMMAND_GET_SNAPSHOT_SCREENSHOT = 130, - VIX_COMMAND_SET_REPLAY_STOP_POINT = 131, + VIX_COMMAND_ADD_TIMEMARKER = 131, VIX_COMMAND_WAIT_FOR_USER_ACTION_IN_GUEST = 132, VIX_COMMAND_VMDB_END_TRANSACTION = 133, VIX_COMMAND_VMDB_SET = 134, + VIX_COMMAND_CHANGE_VIRTUAL_HARDWARE = 135, + + VIX_COMMAND_HOT_PLUG_CPU = 136, + VIX_COMMAND_HOT_PLUG_MEMORY = 137, + VIX_COMMAND_HOT_ADD_DEVICE = 138, + VIX_COMMAND_HOT_REMOVE_DEVICE = 139, + + VIX_COMMAND_DEBUGGER_ATTACH = 140, + VIX_COMMAND_DEBUGGER_DETACH = 141, + VIX_COMMAND_DEBUGGER_SEND_COMMAND = 142, + + VIX_COMMAND_GET_RECORD_STATE = 143, + VIX_COMMAND_SET_RECORD_STATE = 144, + VIX_COMMAND_REMOVE_RECORD_STATE = 145, + VIX_COMMAND_GET_REPLAY_STATE = 146, + VIX_COMMAND_SET_REPLAY_STATE = 147, + VIX_COMMAND_REMOVE_REPLAY_STATE = 148, + + VIX_COMMAND_CANCEL_USER_PROGRESS_MESSAGE = 150, + + VIX_COMMAND_GET_VMX_DEVICE_STATE = 151, + + VIX_COMMAND_GET_NUM_TIMEMARKERS = 152, + VIX_COMMAND_GET_TIMEMARKER = 153, + VIX_COMMAND_REMOVE_TIMEMARKER = 154, + + VIX_COMMAND_SET_SNAPSHOT_INFO = 155, + VIX_COMMAND_SNAPSHOT_SET_MRU = 156, + + VIX_COMMAND_LOGOUT_HOST = 157, + + VIX_COMMAND_LAST_NORMAL_COMMAND = 158, + VIX_TEST_UNSUPPORTED_TOOLS_OPCODE_COMMAND = 998, VIX_TEST_UNSUPPORTED_VMX_OPCODE_COMMAND = 999, }; @@ -1972,7 +2186,6 @@ * to the VMX. */ #define VIX_BACKDOORCOMMAND_RUN_PROGRAM_DONE "Run_Program_Done" -#define VIX_BACKDOORCOMMAND_TOOLS_CMD_DONE "Tools_Command_Done" #define VIX_BACKDOORCOMMAND_PROXY_MESSAGE "VIX_Proxy_Msg" @@ -2039,6 +2252,10 @@ VixError VixMsg_ValidateResponseMsg(void *vMsg, size_t msgLength); +VixError VixMsg_ParseWriteVariableRequest(VixMsgWriteVariableRequest *msg, + char **valueName, + char **value); + char *VixMsg_ObfuscateNamePassword(const char *userName, const char *password); diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/vix.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/vix.h --- open-vm-tools-2008.01.23-74039/lib/include/vix.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/vix.h 2008-10-13 08:01:50.000000000 +0100 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2004-2007 VMware, Inc. All rights reserved. + * Copyright (C) 2004-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 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -56,6 +56,7 @@ VIX_HANDLETYPE_NETWORK = 5, VIX_HANDLETYPE_JOB = 6, VIX_HANDLETYPE_SNAPSHOT = 7, + VIX_HANDLETYPE_PROPERTY_LIST = 9, VIX_HANDLETYPE_METADATA_CONTAINER = 11 }; @@ -101,6 +102,10 @@ 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_UNFINISHED_JOB = 29, + /* Handle Errors */ VIX_E_INVALID_HANDLE = 1000, @@ -142,6 +147,11 @@ VIX_E_NOT_ALLOWED_DURING_VM_REPLAY = 3030, 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, + VIX_E_CANNOT_POWER_ON_VM = 3040, /* VM Errors */ VIX_E_VM_NOT_FOUND = 4000, @@ -150,12 +160,13 @@ VIX_E_TEMPLATE_VM = 4003, VIX_E_VM_ALREADY_LOADED = 4004, VIX_E_VM_ALREADY_UP_TO_DATE = 4006, - + /* 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, /* Completion Errors */ VIX_E_BAD_VM_INDEX = 8000, @@ -183,6 +194,9 @@ 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, /* Host Errors */ VIX_E_HOST_DISK_INVALID_VALUE = 14003, @@ -226,6 +240,10 @@ 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, /* Crypto Library Errors */ VIX_E_CRYPTO_UNKNOWN_ALGORITHM = 17000, @@ -245,13 +263,37 @@ /* 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, + + /* 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, + VIX_E_TOOLS_INSTALL_ERROR = 21009, + + /* Wrapper Errors */ + VIX_E_WRAPPER_WORKSTATION_NOT_INSTALLED = 22001, + VIX_E_WRAPPER_VERSION_NOT_FOUND = 22002, + VIX_E_WRAPPER_SERVICEPROVIDER_NOT_FOUND = 22003, }; const char *Vix_GetErrorText(VixError err, const char *locale); @@ -307,6 +349,8 @@ VIX_PROPERTY_VM_TOOLS_STATE = 152, VIX_PROPERTY_VM_IS_RUNNING = 196, VIX_PROPERTY_VM_SUPPORTED_FEATURES = 197, + VIX_PROPERTY_VM_IS_RECORDING = 236, + VIX_PROPERTY_VM_IS_REPLAYING = 237, /* Result properties; these are returned by various procedures */ VIX_PROPERTY_JOB_RESULT_ERROR_CODE = 3000, @@ -330,6 +374,10 @@ 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, /* Event properties; these are sent in the moreEventInfo for some events. */ VIX_PROPERTY_FOUND_ITEM_LOCATION = 4010, @@ -338,6 +386,8 @@ VIX_PROPERTY_SNAPSHOT_DISPLAYNAME = 4200, VIX_PROPERTY_SNAPSHOT_DESCRIPTION = 4201, VIX_PROPERTY_SNAPSHOT_POWERSTATE = 4205, + VIX_PROPERTY_SNAPSHOT_IS_REPLAYABLE = 4207, + }; /* @@ -379,6 +429,10 @@ void Vix_ReleaseHandle(VixHandle handle); +#ifndef VIX_HIDE_FROM_JAVA +void Vix_AddRefHandle(VixHandle handle); +#endif + VixHandleType Vix_GetHandleType(VixHandle handle); VixError Vix_GetProperties(VixHandle handle, @@ -408,7 +462,6 @@ VIX_SERVICEPROVIDER_DEFAULT = 1, VIX_SERVICEPROVIDER_VMWARE_SERVER = 2, VIX_SERVICEPROVIDER_VMWARE_WORKSTATION = 3, - VIX_SERVICEPROVIDER_VMWARE_ESX = 5, VIX_SERVICEPROVIDER_VMWARE_VI_SERVER = 10, }; @@ -418,7 +471,7 @@ * parameter. */ enum { - VIX_API_VERSION = 4 + VIX_API_VERSION = -1 }; VixHandle VixHost_Connect(int apiVersion, @@ -480,6 +533,22 @@ /* *----------------------------------------------------------------------------- * + * 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 @@ -496,8 +565,10 @@ 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_LAUNCH_GUI = 0x0200, + VIX_VMPOWEROP_START_VM_PAUSED = 0x1000, }; /* @@ -516,12 +587,24 @@ void *clientData); VixHandle VixVM_Reset(VixHandle vmHandle, - VixVMPowerOpOptions powerOnOptions, + VixVMPowerOpOptions resetOptions, VixEventProc *callbackProc, void *clientData); VixHandle VixVM_Suspend(VixHandle vmHandle, - VixVMPowerOpOptions powerOffOptions, + 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); @@ -550,6 +633,8 @@ 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; @@ -578,8 +663,47 @@ */ #define VIX_ANONYMOUS_USER_NAME "__VMware_Vix_Guest_User_Anonymous__" -#define VIX_ADMINISTRATOR_USER_NAME "__VMware_Vix_Guest_User_Admin__" -#define VIX_CONSOLE_USER_NAME "__VMware_Vix_Guest_Console_User__" + +/* + * 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__" + + +/* + * Record/replay operations + */ +VixHandle VixVM_BeginRecording(VixHandle vmHandle, + const char *displayName, + const char *description, + int options, + VixHandle propertyList, + VixEventProc *callbackProc, + void *clientData); + +VixHandle VixVM_EndRecording(VixHandle vmHandle, + int options, + VixHandle propertyList, + VixEventProc *callbackProc, + void *clientData); + +VixHandle VixVM_BeginReplay(VixHandle vmHandle, + VixHandle snapshotHandle, + int options, + VixHandle propertyList, + VixEventProc *callbackProc, + void *clientData); + +VixHandle VixVM_EndReplay(VixHandle vmHandle, + int options, + VixHandle propertyList, + VixEventProc *callbackProc, + void *clientData); /* @@ -591,6 +715,13 @@ 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, @@ -692,6 +823,11 @@ VixEventProc *callbackProc, void *clientData); +VixHandle VixVM_GetFileInfoInGuest(VixHandle vmHandle, + const char *pathName, + VixEventProc *callbackProc, + void *clientData); + /* * Guest Directory functions @@ -844,6 +980,47 @@ /* + * 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 */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/vixOpenSource.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/vixOpenSource.h --- open-vm-tools-2008.01.23-74039/lib/include/vixOpenSource.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/vixOpenSource.h 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -88,6 +88,17 @@ VixError Vix_TranslateCOMError(HRESULT comError); #endif +/* + * This defines additional error codes. + * The public error codes are defined in vix.h + * These error codes are in addition to those. + */ +enum { + VIX_E_OP_NOT_SUPPORTED_ON_NON_VMWARE_VM = 3038 + + /* WARNING. Do not exceed 2**16 */ +}; + #endif // VIX_HIDE_BORA_DEPENDENCIES @@ -135,6 +146,8 @@ VIX_PROPERTY_VM_DEFAULT_GATEWAY = 4516, VIX_PROPERTY_VM_DNS_SERVER_DHCP_ENABLED = 4517, VIX_PROPERTY_VM_DNS_SERVER = 4518, + VIX_PROPERTY_GUEST_TOOLS_WORD_SIZE = 4519, + VIX_PROPERTY_GUEST_OS_VERSION_SHORT = 4520, }; @@ -273,14 +286,13 @@ VixError VixPropertyList_Remove(VixHandle propertyListHandle, int propertyID); +VixError VixPropertyList_RemoveFromImpl(VixPropertyListImpl *propList, + int propertyID); + VixError VixPropertyList_AppendProperties(VixHandle handle, int firstPropertyID, ...); -VixError VixPropertyList_AllocPropertyList(VixHandle *resultHandle, - int firstPropertyID, - ...); - VixError VixPropertyList_FindProperty(VixPropertyListImpl *propList, int propertyID, VixPropertyType type, @@ -348,6 +360,16 @@ VIX_VMDB_VARIABLE = 5, }; +/* + * Options for RunProgramInGuest(). + */ +enum { + //VIX_RUNPROGRAM_RETURN_IMMEDIATELY = 0x0001, + //VIX_RUNPROGRAM_ACTIVATE_WINDOW = 0x0002, + /* DEPRECATED VIX_RUNPROGRAM_USE_INTERACTIVE_SESSION = 0x0004, */ + VIX_RUNPROGRAM_RUN_AS_LOCAL_SYSTEM = 0x0008, +}; + /* *----------------------------------------------------------------------------- @@ -374,22 +396,50 @@ #ifndef VIX_HIDE_FROM_JAVA extern int vixDebugGlobalSpewLevel; -extern char *VixAllocDebugString(char *fmt, ...); -extern void VixDebugInit(int level); +extern char *VixAllocDebugString(char *fmt, ...); +extern void VixDebugInit(int level, Bool panicOnVixAssert); +extern const char *VixDebug_GetFileBaseName(const char *path); +extern void VixAssert(const char *cond, const char *file, int lineNum); /* * preference name for client and vmx */ -#define VIX_DEBUG_PREFERENCE_NAME "vix.debugLevel" +#define VIX_DEBUG_PREFERENCE_NAME "vix.debugLevel" +#define VIX_ASSERT_PREFERENCE_NAME "vix.doAssert" -#define VIX_DEBUG_LEVEL(logLevel, s) if (logLevel <= vixDebugGlobalSpewLevel) \ +/* + * Assertions. Normally we'd just use ASSERT(), but we've hit many cases + * where ASSERT() is desired by foundry developers, but not by foundry users. + * So we have our own VIX_ASSERT(), which is configured via a preference, + * vix.doAssert, off by default. + */ +#ifdef VMX86_DEBUG +# ifdef __cplusplus +# define VIX_ASSERT(cond) (UNLIKELY(!(cond)) ? VixAssert(#cond, __FILE__, __LINE__) : (void) 0) +# else +# define VIX_ASSERT(cond) (UNLIKELY(!(cond)) ? VixAssert(#cond, __FILE__, __LINE__) : 0) +# endif +#else +#define VIX_ASSERT(cond) +#endif + +#define DEFAULT_VIX_LOG_LEVEL 0 + +#define VIX_DEBUG_LEVEL(logLevel, s) if (logLevel <= vixDebugGlobalSpewLevel) \ { char *debugString = VixAllocDebugString s; \ - Log("Vix Debug: [%s:%d]: %s", __FILE__, __LINE__, debugString); \ + Log("Vix: [%lu %s:%d]: %s", (unsigned long)Util_GetCurrentThreadId(), \ + VixDebug_GetFileBaseName(__FILE__), __LINE__, debugString); \ free(debugString); } -#define VIX_DEBUG(s) if (0 != vixDebugGlobalSpewLevel) \ +#define VIX_DEBUG(s) if (0 != vixDebugGlobalSpewLevel) \ { char *debugString = VixAllocDebugString s; \ - Log("Vix Debug: [%s:%d]: %s", __FILE__, __LINE__, debugString); \ + Log("Vix: [%lu %s:%d]: %s", (unsigned long)Util_GetCurrentThreadId(), \ + VixDebug_GetFileBaseName(__FILE__), __LINE__, debugString); \ + free(debugString); } + +#define VIX_DEBUG_ALWAYS(s) { char *debugString = VixAllocDebugString s; \ + Log("Vix: [%lu %s:%d]: %s", (unsigned long) Util_GetCurrentThreadId(), \ + VixDebug_GetFileBaseName(__FILE__), __LINE__, debugString); \ free(debugString); } #endif // VIX_HIDE_FROM_JAVA diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/vixTools.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/vixTools.h --- open-vm-tools-2008.01.23-74039/lib/include/vixTools.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/vixTools.h 2008-10-13 08:01:49.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -34,23 +34,17 @@ typedef void (*VixToolsReportProgramDoneProcType)(const char *requestName, VixError err, int exitCode, - int64 pid); + int64 pid, + void *clientData); VixError VixTools_Initialize(Bool thisProcessRunsAsRootArg, - struct DblLnkLst_Links *globalEventQueue, - VixToolsReportProgramDoneProcType reportProgramDoneProc); + VixToolsReportProgramDoneProcType reportProgramDoneProc, + void *clientData); void VixTools_SetConsoleUserPolicy(Bool allowConsoleUserOpsParam); -void VixTools_SetRunProgramCallback(VixToolsReportProgramDoneProcType reportProgramDoneProc); - -VixError VixTools_ProcessVixCommand(VixCommandRequestHeader *requestMsg, - char *requestName, - size_t maxResultBufferSize, - struct GuestApp_Dict **confDictRef, - char **resultBuffer, - size_t *resultLen, - Bool *deleteResultBufferResult); +void VixTools_SetRunProgramCallback(VixToolsReportProgramDoneProcType reportProgramDoneProc, + void *clientData); /* * These are internal procedures that are exposed for the legacy @@ -61,12 +55,41 @@ char *commandLineArgs, int runProgramOptions, void *userToken, + void *eventQueue, int64 *pid); +#if defined(VMTOOLS_USE_GLIB) +# include + +VixError VixTools_GetToolsPropertiesImpl(GKeyFile *confDictRef, + char **resultBuffer, + size_t *resultBufferLength); + +VixError VixTools_ProcessVixCommand(VixCommandRequestHeader *requestMsg, + char *requestName, + size_t maxResultBufferSize, + GKeyFile *confDictRef, + GMainLoop *eventQueue, + char **resultBuffer, + size_t *resultLen, + Bool *deleteResultBufferResult); + +#else VixError VixTools_GetToolsPropertiesImpl(struct GuestApp_Dict **confDictRef, char **resultBuffer, size_t *resultBufferLength); +VixError VixTools_ProcessVixCommand(VixCommandRequestHeader *requestMsg, + char *requestName, + size_t maxResultBufferSize, + struct GuestApp_Dict **confDictRef, + DblLnkLst_Links *eventQueue, + char **resultBuffer, + size_t *resultLen, + Bool *deleteResultBufferResult); + +#endif + Bool VixToolsImpersonateUserImpl(char const *credentialTypeStr, int credentialType, char const *password, @@ -76,9 +99,13 @@ void VixToolsLogoutUser(void *userToken); +#ifdef _WIN32 VixError VixToolsGetUserTmpDir(void *userToken, char **tmpDirPath); +Bool VixToolsUserIsMemberOfAdministratorGroup(VixCommandRequestHeader *requestMsg); +#endif // _WIN32 + #if IMPLEMENT_SOCKET_MGR VixError VixToolsSocketConnect(VixCommandRequestHeader *requestMsg, char **result); diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/vm_app.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/vm_app.h --- open-vm-tools-2008.01.23-74039/lib/include/vm_app.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/vm_app.h 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -77,6 +77,15 @@ #define TOOLSOPTION_SYNCTIME_PERIOD "synctime.period" #define TOOLSOPTION_SYNCTIME_ENABLE "time.synchronize.tools.enable" #define TOOLSOPTION_SYNCTIME_STARTUP "time.synchronize.tools.startup" +#define TOOLSOPTION_SCRIPTS_POWERON "toolScripts.afterPowerOn" +#define TOOLSOPTION_SCRIPTS_POWEROFF "toolScripts.beforePowerOff" +#define TOOLSOPTION_SCRIPTS_RESUME "toolScripts.afterResume" +#define TOOLSOPTION_SCRIPTS_SUSPEND "toolScripts.beforeSuspend" +#define TOOLSOPTION_SCRIPTS_REBOOT "toolScripts.beforePowerOff" +#define TOOLSOPTION_SYNCTIME_SLEWCORRECTION "time.synchronize.tools.slewCorrection" +#define TOOLSOPTION_SYNCTIME_PERCENTCORRECTION "time.synchronize.tools.percentCorrection" +#define TOOLSOPTION_MAP_ROOT_HGFS_SHARE "mapRootHgfsShare" +#define TOOLSOPTION_LINK_ROOT_HGFS_SHARE "linkRootHgfsShare" /* * The max selection buffer length has to be less than the @@ -84,10 +93,10 @@ * and then through the backdoor to the tools. Also, leave * some room for ipc msg overhead. [greg] */ -#define MAX_SELECTION_BUFFER_LENGTH (1 << 16) - 100 +#define MAX_SELECTION_BUFFER_LENGTH ((1 << 16) - 100) -#define VMWARE_DONT_EXCHANGE_SELECTIONS -2 -#define VMWARE_SELECTION_NOT_READY -1 +#define VMWARE_DONT_EXCHANGE_SELECTIONS (-2) +#define VMWARE_SELECTION_NOT_READY (-1) #define VMWARE_GUI_AUTO_GRAB 0x001 #define VMWARE_GUI_AUTO_UNGRAB 0x002 @@ -116,10 +125,10 @@ */ static const GuestOsStateChangeCmd stateChangeCmdTable[] = { { GUESTOS_STATECHANGE_POWERON, "poweron", "OS_PowerOn" }, - { GUESTOS_STATECHANGE_RESUME, "resume", "OS_Resume" }, + { GUESTOS_STATECHANGE_RESUME, "resume", "OS_Resume" }, { GUESTOS_STATECHANGE_SUSPEND, "suspend", "OS_Suspend" }, - { GUESTOS_STATECHANGE_HALT, "halt", "OS_Halt" }, - { GUESTOS_STATECHANGE_REBOOT, "reboot", "OS_Reboot" }, + { GUESTOS_STATECHANGE_HALT, "halt", "OS_Halt" }, + { GUESTOS_STATECHANGE_REBOOT, "reboot", "OS_Reboot" }, }; diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/vm_assert.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/vm_assert.h --- open-vm-tools-2008.01.23-74039/lib/include/vm_assert.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/vm_assert.h 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -98,8 +98,6 @@ * ASSERT() is special cased because of interaction with Windows DDK. */ -#define IMPLIES(a,b) (!(a) || (b)) - #if defined VMX86_DEBUG || defined ASSERT_ALWAYS_AVAILABLE #undef ASSERT #define ASSERT(cond) \ @@ -243,12 +241,21 @@ /* - * Compile-time assertions + * 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). */ #define ASSERT_ON_COMPILE(e) \ do { \ - typedef char AssertOnCompileType[(e) ? 1 : -1]; \ + enum { AssertOnCompileMisused = ((e) ? 1 : -1) }; \ + typedef char AssertOnCompileFailed[AssertOnCompileMisused]; \ } while (0) diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/vm_atomic.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/vm_atomic.h --- open-vm-tools-2008.01.23-74039/lib/include/vm_atomic.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/vm_atomic.h 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -38,7 +38,6 @@ #define INCLUDE_ALLOW_VMIROM #include "includeCheck.h" - #include "vm_basic_types.h" @@ -117,53 +116,93 @@ return (Atomic_uint32 *)var; } -EXTERN Bool AtomicUseFence; - - /* - *---------------------------------------------------------------------- + *----------------------------------------------------------------------------- * - * Atomic_SetFence -- + * Atomic_Init, Atomic_SetFence, AtomicUseFence -- * - * Control the use of lfence after an atomic operation + * Determine whether an lfence intruction is executed after + * every locked instruction. * - *---------------------------------------------------------------------- + * Certain AMD processes 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. + * 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__) /* PR136775 */ +#define ATOMIC_USE_FENCE +#endif + +#if defined(VMATOMIC_IMPORT_DLLDATA) +VMX86_EXTERN_DATA Bool AtomicUseFence; +#else +EXTERN Bool AtomicUseFence; +#endif + +EXTERN Bool atomicFenceInitialized; + +void AtomicInitFence(void); + +static INLINE void +Atomic_Init(void) +{ +#ifdef ATOMIC_USE_FENCE + if (!atomicFenceInitialized) { + AtomicInitFence(); + } +#endif +} + static INLINE void Atomic_SetFence(Bool fenceAfterLock) /* IN: TRUE to enable lfence */ /* FALSE to disable. */ { AtomicUseFence = fenceAfterLock; +#if defined(__VMKERNEL__) + extern void Atomic_SetFenceVMKAPI(Bool fenceAfterLock); + Atomic_SetFenceVMKAPI(fenceAfterLock); +#endif + atomicFenceInitialized = TRUE; } -/* - * Atomic_Init() is a #define instead of a function in lib/atomic to - * avoid lib/user symbol conflicts with stub code in bora_vmsoft - */ -#define Atomic_Init() \ -do { \ - HostinfoCpuIdInfo info; \ - Atomic_SetFence(Hostinfo_GetCpuid(&info) && (info.numLogCPUs > 1) && \ - CPUID_RequiresFence(info.vendor, info.version)); \ -} while (0); /* Conditionally execute fence after interlocked instruction. */ static INLINE void AtomicEpilogue(void) { -// The freebsd assembler doesn't know the lfence instruction -#if defined(__GNUC__) && \ - __GNUC__ >= 3 && \ - !defined(BSD_VERSION) && \ - (!defined(MODULE) || defined(__VMKERNEL_MODULE__)) && \ - !defined(__APPLE__) /* PR136775 */ +#ifdef ATOMIC_USE_FENCE if (UNLIKELY(AtomicUseFence)) { asm volatile ("lfence" ::: "memory"); } #endif } + /* * All the assembly code is tricky and written conservatively. * For example, to make sure gcc won't introduce copies, @@ -434,7 +473,7 @@ * * Atomic_And -- * - * Atomic read, logical AND with a value, write. + * Atomic read, bitwise AND with a value, write. * * Results: * None @@ -485,7 +524,7 @@ * * Atomic_And64 -- * - * Atomic read, logical AND with a value, write. + * Atomic read, bitwise AND with a value, write. * * Results: * None @@ -523,7 +562,7 @@ * * Atomic_Or -- * - * Atomic read, logical OR with a value, write. + * Atomic read, bitwise OR with a value, write. * * Results: * None @@ -574,7 +613,7 @@ * * Atomic_Or64 -- * - * Atomic read, logical OR with a value, write. + * Atomic read, bitwise OR with a value, write. * * Results: * None @@ -612,7 +651,7 @@ * * Atomic_Xor -- * - * Atomic read, logical XOR with a value, write. + * Atomic read, bitwise XOR with a value, write. * * Results: * None @@ -663,7 +702,7 @@ * * Atomic_Xor64 -- * - * Atomic read, logical XOR with a value, write. + * Atomic read, bitwise XOR with a value, write. * * Results: * None @@ -1047,7 +1086,7 @@ * * Atomic_FetchAndOr -- * - * Atomic read (returned), logical OR with a value, write. + * Atomic read (returned), bitwise OR with a value, write. * * Results: * The value of the variable before the operation. @@ -1077,7 +1116,7 @@ * * Atomic_FetchAndAnd -- * - * Atomic read (returned), logical And with a value, write. + * Atomic read (returned), bitwise And with a value, write. * * Results: * The value of the variable before the operation. @@ -1109,7 +1148,7 @@ * * Atomic_ReadOr64 -- * - * Atomic read (returned), logical OR with a value, write. + * Atomic read (returned), bitwise OR with a value, write. * * Results: * The value of the variable before the operation. @@ -1799,15 +1838,26 @@ } -/* Template code for the Atomic_ type and its operators. --hpreg */ -#define MAKE_ATOMIC_TYPE(name, size, in, out) \ +/* + * Template code for the Atomic_ type and its operators. + * + * The cast argument is an intermedia 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 + */ + +#define MAKE_ATOMIC_TYPE(name, size, in, out, cast) \ typedef Atomic_uint ## size Atomic_ ## name; \ \ \ static INLINE out \ Atomic_Read ## name(Atomic_ ## name const *var) \ { \ - return (out)Atomic_Read ## size(var); \ + return (out)(cast)Atomic_Read ## size(var); \ } \ \ \ @@ -1815,7 +1865,7 @@ Atomic_Write ## name(Atomic_ ## name *var, \ in val) \ { \ - Atomic_Write ## size(var, (uint ## size)val); \ + Atomic_Write ## size(var, (uint ## size)(cast)val); \ } \ \ \ @@ -1823,7 +1873,8 @@ Atomic_ReadWrite ## name(Atomic_ ## name *var, \ in val) \ { \ - return (out)Atomic_ReadWrite ## size(var, (uint ## size)val); \ + return (out)(cast)Atomic_ReadWrite ## size(var, \ + (uint ## size)(cast)val); \ } \ \ \ @@ -1832,8 +1883,8 @@ in oldVal, \ in newVal) \ { \ - return (out)Atomic_ReadIfEqualWrite ## size(var, \ - (uint ## size)oldVal, (uint ## size)newVal); \ + return (out)(cast)Atomic_ReadIfEqualWrite ## size(var, \ + (uint ## size)(cast)oldVal, (uint ## size)(cast)newVal); \ } \ \ \ @@ -1841,7 +1892,7 @@ Atomic_And ## name(Atomic_ ## name *var, \ in val) \ { \ - Atomic_And ## size(var, (uint ## size)val); \ + Atomic_And ## size(var, (uint ## size)(cast)val); \ } \ \ \ @@ -1849,7 +1900,7 @@ Atomic_Or ## name(Atomic_ ## name *var, \ in val) \ { \ - Atomic_Or ## size(var, (uint ## size)val); \ + Atomic_Or ## size(var, (uint ## size)(cast)val); \ } \ \ \ @@ -1857,7 +1908,7 @@ Atomic_Xor ## name(Atomic_ ## name *var, \ in val) \ { \ - Atomic_Xor ## size(var, (uint ## size)val); \ + Atomic_Xor ## size(var, (uint ## size)(cast)val); \ } \ \ \ @@ -1865,7 +1916,7 @@ Atomic_Add ## name(Atomic_ ## name *var, \ in val) \ { \ - Atomic_Add ## size(var, (uint ## size)val); \ + Atomic_Add ## size(var, (uint ## size)(cast)val); \ } \ \ \ @@ -1873,7 +1924,7 @@ Atomic_Sub ## name(Atomic_ ## name *var, \ in val) \ { \ - Atomic_Sub ## size(var, (uint ## size)val); \ + Atomic_Sub ## size(var, (uint ## size)(cast)val); \ } \ \ \ @@ -1895,7 +1946,7 @@ Atomic_ReadOr ## name(Atomic_ ## name *var, \ in val) \ { \ - return (out)Atomic_ReadOr ## size(var, (uint ## size)val); \ + return (out)(cast)Atomic_ReadOr ## size(var, (uint ## size)(cast)val); \ } \ \ \ @@ -1903,21 +1954,21 @@ Atomic_ReadAdd ## name(Atomic_ ## name *var, \ in val) \ { \ - return (out)Atomic_ReadAdd ## size(var, (uint ## size)val); \ + return (out)(cast)Atomic_ReadAdd ## size(var, (uint ## size)(cast)val); \ } \ \ \ static INLINE out \ Atomic_ReadInc ## name(Atomic_ ## name *var) \ { \ - return (out)Atomic_ReadInc ## size(var); \ + return (out)(cast)Atomic_ReadInc ## size(var); \ } \ \ \ static INLINE out \ Atomic_ReadDec ## name(Atomic_ ## name *var) \ { \ - return (out)Atomic_ReadDec ## size(var); \ + return (out)(cast)Atomic_ReadDec ## size(var); \ } @@ -1960,11 +2011,11 @@ * Atomic_ReadDecInt -- */ #if defined(__x86_64__) -MAKE_ATOMIC_TYPE(Ptr, 64, void const *, void *) -MAKE_ATOMIC_TYPE(Int, 64, int, int) +MAKE_ATOMIC_TYPE(Ptr, 64, void const *, void *, uintptr_t) +MAKE_ATOMIC_TYPE(Int, 64, int, int, int) #else -MAKE_ATOMIC_TYPE(Ptr, 32, void const *, void *) -MAKE_ATOMIC_TYPE(Int, 32, int, int) +MAKE_ATOMIC_TYPE(Ptr, 32, void const *, void *, uintptr_t) +MAKE_ATOMIC_TYPE(Int, 32, int, int, int) #endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/vmbackup_def.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/vmbackup_def.h --- open-vm-tools-2008.01.23-74039/lib/include/vmbackup_def.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/vmbackup_def.h 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -71,9 +71,20 @@ #define VMBACKUP_EVENT_WRITER_ERROR "req.writerError" #define VMBACKUP_EVENT_KEEP_ALIVE "req.keepAlive" +/* These are the event codes sent with the events */ +typedef enum { + VMBACKUP_SUCCESS = 0, + VMBACKUP_INVALID_STATE, + VMBACKUP_SCRIPT_ERROR, + VMBACKUP_SYNC_ERROR, + VMBACKUP_REMOTE_ABORT, + VMBACKUP_UNEXPECTED_ERROR +} VmBackupStatus; + /* Event name used for communnication between the VSS components. */ #ifdef _WIN32 #define VMVSS_RESUME_MSG TEXT("VmVss_ResumeSnapshotProvider") +#define VMVSS_LOGGING_EVENT TEXT("VmVss_DebugLoggingEvent") #endif #endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/vmBackup.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/vmBackup.h --- open-vm-tools-2008.01.23-74039/lib/include/vmBackup.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/vmBackup.h 2008-10-13 08:01:49.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -35,7 +35,6 @@ #include "rpcin.h" #include "str.h" - typedef enum { VMBACKUP_STATUS_PENDING, VMBACKUP_STATUS_FINISHED, @@ -85,6 +84,10 @@ Bool generateManifests; Bool clientAborted; intptr_t clientData; + void *scripts; + const char *configDir; + ssize_t currentScript; + Bool loggingEnabled; } VmBackupState; typedef Bool (*VmBackupCallback)(VmBackupState *); @@ -111,7 +114,8 @@ Bool VmBackup_Init(RpcIn *rpcin, DblLnkLst_Links *eventQueue, - VmBackupSyncProvider *provider); + VmBackupSyncProvider *provider, + Bool loggingEnabled); void VmBackup_Shutdown(RpcIn *rpcin); diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/vm_basic_asm.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/vm_basic_asm.h --- open-vm-tools-2008.01.23-74039/lib/include/vm_basic_asm.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/vm_basic_asm.h 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -413,12 +413,21 @@ #endif } +#ifdef VM_X86_64 + +/* + * No inline assembly in Win64. Implemented in bora/lib/user 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) { -#ifdef VM_X86_64 - *(int*)0 = 0; // NOT_IMPLEMENTED(); -#else __asm push esi __asm push ebx __asm push ecx @@ -437,8 +446,8 @@ __asm pop ecx __asm pop ebx __asm pop esi -#endif } +#endif static INLINE uint32 __GET_EAX_FROM_CPUID(int input) @@ -713,26 +722,50 @@ /* *----------------------------------------------------------------------------- * - * Bswap -- + * Bswap32 -- * - * Swap the 4 bytes of "v" as follows: 3210 -> 0123. + * Swap the 4 bytes of "v" as follows: 3210 -> 0123. * *----------------------------------------------------------------------------- */ -#ifdef __GNUC__ // { static INLINE uint32 -Bswap(uint32 v) +Bswap32(uint32 v) // IN { - /* Checked against the Intel manual and GCC --hpreg */ +#ifdef __GNUC__ // { + /* Checked against the Intel manual and GCC. --hpreg */ __asm__( - "bswap %0" + "bswap %0" : "=r" (v) : "0" (v) ); return v; -} +#else // } { + return (v >> 24) + | ((v >> 8) & 0xFF00) + | ((v & 0xFF00) << 8) + | (v << 24) ; #endif // } +} +#define Bswap Bswap32 + + +/* + *----------------------------------------------------------------------------- + * + * Bswap64 -- + * + * Swap the 8 bytes of "v" as follows: 76543210 -> 01234567. + * + *----------------------------------------------------------------------------- + */ + +static INLINE uint64 +Bswap64(uint64 v) // IN +{ + return ((uint64)Bswap((uint32)v) << 32) | Bswap((uint32)(v >> 32)); +} + #ifdef __GNUC__ // { /* diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/vm_basic_asm_x86_64.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/vm_basic_asm_x86_64.h --- open-vm-tools-2008.01.23-74039/lib/include/vm_basic_asm_x86_64.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/vm_basic_asm_x86_64.h 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -84,16 +84,25 @@ static INLINE void FXSAVE_ES1(uint8 *save) { - asm ("fxsaveq %0 \n" - : "=m" (*save)); + __asm__ __volatile__ ("fxsaveq %0 \n" : "=m" (*save) : : "memory"); +} + +static INLINE void +FXSAVE_COMPAT_ES1(uint8 *save) +{ + __asm__ __volatile__ ("fxsave %0 \n" : "=m" (*save) : : "memory"); } static INLINE void FXRSTOR_ES1(const uint8 *load) { - asm ("fxrstorq %0 \n" - : - : "m" (*load)); + __asm__ __volatile__ ("fxrstorq %0 \n" : : "m" (*load) : "memory"); +} + +static INLINE void +FXRSTOR_COMPAT_ES1(const uint8 *load) +{ + __asm__ __volatile__ ("fxrstor %0 \n" : : "m" (*load) : "memory"); } static INLINE void @@ -101,7 +110,8 @@ { uint64 dummy = 0; - asm ("fnstsw %%ax \n" // Grab x87 ES bit + __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 @@ -112,10 +122,10 @@ "fxrstorq %1 \n" : : "m" (dummy), "m" (*load) - : "ax"); + : "ax", "memory"); } -#endif +#endif /* __GNUC__ */ /* @@ -152,14 +162,14 @@ uint64 result, dummy; const uint64 multiplier64 = multiplier; - asm("mulq %3 \n\t" - "shrdq %1, %0 \n\t" - : "=a" (result), - "=d" (dummy) - : "0" (multiplier64), - "rm" (multiplicand), + __asm__("mulq %3 \n\t" + "shrdq %1, %0 \n\t" + : "=a" (result), + "=d" (dummy) + : "0" (multiplier64), + "rm" (multiplicand), "c" (shift) - : "cc"); + : "cc"); return result; } @@ -211,7 +221,7 @@ int64 result, dummy; const int64 multiplier64 = multiplier; - asm("imulq %3 \n\t" + __asm__("imulq %3 \n\t" "shrdq %1, %0 \n\t" : "=a" (result), "=d" (dummy) @@ -276,7 +286,7 @@ *----------------------------------------------------------------------------- */ -#if defined(__GNUC__) +#if defined(__GNUC__) || defined(_MSC_VER) static INLINE void Div643232(uint64 dividend, // IN @@ -284,8 +294,8 @@ uint32 *quotient, // OUT uint32 *remainder) // OUT { - *quotient = dividend / divisor; - *remainder = dividend % divisor; + *quotient = (uint32)(dividend / divisor); + *remainder = (uint32)(dividend % divisor); } #endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/vm_basic_asm_x86.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/vm_basic_asm_x86.h --- open-vm-tools-2008.01.23-74039/lib/include/vm_basic_asm_x86.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/vm_basic_asm_x86.h 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -100,16 +100,13 @@ static INLINE void FXSAVE_ES1(uint8 *save) { - asm ("fxsave %0 \n" - : "=m" (*save)); + __asm__ __volatile__ ("fxsave %0\n" : "=m" (*save) : : "memory"); } static INLINE void FXRSTOR_ES1(const uint8 *load) { - asm ("fxrstor %0 \n" - : - : "m" (*load)); + __asm__ __volatile__ ("fxrstor %0\n" : : "m" (*load) : "memory"); } static INLINE void @@ -117,7 +114,8 @@ { uint64 dummy = 0; - asm ("fnstsw %%ax \n" // Grab x87 ES bit + __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 @@ -128,10 +126,9 @@ "fxrstor %1 \n" : : "m" (dummy), "m" (*load) - : "ax"); + : "ax", "memory"); } - -#endif +#endif /* __GNUC__ */ /* *----------------------------------------------------------------------------- @@ -306,42 +303,42 @@ * smart enough, at least in the version we are currently using. */ if (shift < 32) { - asm("mov %%eax, %2 \n\t" // Save lo(multiplicand) in tmp2 - "mov %%edx, %%eax \n\t" // Get hi(multiplicand) - "mull %4 \n\t" // p2 = hi(multiplicand) * multiplier - "xchg %%eax, %2 \n\t" // Save lo(p2) in tmp2, get lo(multiplicand) - "mov %%edx, %1 \n\t" // Save hi(p2) in tmp1 - "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 - "shrdl %%edx, %%eax \n\t" // result = hi(p2):hi(p1):lo(p1) >> shift - "shrdl %1, %%edx" - : "=A" (result), - "=&r" (tmp1), // use in shrdl requires it to be a register - "=&r" (tmp2) // could be "=&rm" but "m" is slower - : "0" (multiplicand), - "rm" (multiplier), - "c" (shift) - : "cc" - ); + __asm__("mov %%eax, %2 \n\t" // Save lo(multiplicand) in tmp2 + "mov %%edx, %%eax \n\t" // Get hi(multiplicand) + "mull %4 \n\t" // p2 = hi(multiplicand) * multiplier + "xchg %%eax, %2 \n\t" // Save lo(p2) in tmp2, get lo(multiplicand) + "mov %%edx, %1 \n\t" // Save hi(p2) in tmp1 + "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 + "shrdl %%edx, %%eax \n\t" // result = hi(p2):hi(p1):lo(p1) >> shift + "shrdl %1, %%edx" + : "=A" (result), + "=&r" (tmp1), // use in shrdl requires it to be a register + "=&r" (tmp2) // could be "=&rm" but "m" is slower + : "0" (multiplicand), + "rm" (multiplier), + "c" (shift) + : "cc" + ); } else { - asm("mov %%edx, %2 \n\t" // Save hi(multiplicand) in tmp2 - "mull %4 \n\t" // p1 = lo(multiplicand) * multiplier - "mov %%edx, %1 \n\t" // Save hi(p1) in tmp1 - "mov %2, %%eax \n\t" // Discard lo(p1), get hi(multiplicand) - "mull %4 \n\t" // p2 = hi(multiplicand) * multiplier - "addl %1, %%eax \n\t" // lo(p2) += hi(p1) - "adcl $0, %%edx \n\t" // hi(p2) += carry from previous step - "shrdl %%edx, %%eax \n\t" // result = p2 >> (shift & 31) - "shrl %%cl, %%edx" - : "=A" (result), - "=&r" (tmp1), // could be "=&rm" but "m" is slower - "=&r" (tmp2) // could be "=&rm" but "m" is slower - : "0" (multiplicand), - "rm" (multiplier), - "c" (shift) - : "cc" - ); + __asm__("mov %%edx, %2 \n\t" // Save hi(multiplicand) in tmp2 + "mull %4 \n\t" // p1 = lo(multiplicand) * multiplier + "mov %%edx, %1 \n\t" // Save hi(p1) in tmp1 + "mov %2, %%eax \n\t" // Discard lo(p1), get hi(multiplicand) + "mull %4 \n\t" // p2 = hi(multiplicand) * multiplier + "addl %1, %%eax \n\t" // lo(p2) += hi(p1) + "adcl $0, %%edx \n\t" // hi(p2) += carry from previous step + "shrdl %%edx, %%eax \n\t" // result = p2 >> (shift & 31) + "shrl %%cl, %%edx" + : "=A" (result), + "=&r" (tmp1), // could be "=&rm" but "m" is slower + "=&r" (tmp2) // could be "=&rm" but "m" is slower + : "0" (multiplicand), + "rm" (multiplier), + "c" (shift) + : "cc" + ); } return result; } @@ -418,38 +415,38 @@ int64 result; uint32 tmp1, tmp2; // ASSERT(shift >= 0 && shift < 64); - + /* Written and tested by mann, checked by dbudko and hpreg */ /* XXX hpreg suggested some improvements that we haven't converged on yet */ - 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 - "mov %%edx, %%eax\n\t" // result = hi(p2):hi(p1) >> (shift & 31) - "mov %1, %%edx\n\t" - "shrdl %%edx, %%eax\n\t" - "sarl %%cl, %%edx\n\t" - "jmp 3f\n" - "2:\n\t" - "shrdl %%edx, %%eax\n\t" // result = hi(p2):hi(p1):lo(p1) >> shift - "shrdl %1, %%edx\n" - "3:\n\t" - : "=A" (result), "=&r" (tmp1), "=&r" (tmp2) - : "0" (multiplicand), "rm" (multiplier), "c" (shift) - : "cc"); + __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 + "mov %%edx, %%eax\n\t" // result = hi(p2):hi(p1) >> (shift & 31) + "mov %1, %%edx\n\t" + "shrdl %%edx, %%eax\n\t" + "sarl %%cl, %%edx\n\t" + "jmp 3f\n" + "2:\n\t" + "shrdl %%edx, %%eax\n\t" // result = hi(p2):hi(p1):lo(p1) >> shift + "shrdl %1, %%edx\n" + "3:\n\t" + : "=A" (result), "=&r" (tmp1), "=&r" (tmp2) + : "0" (multiplicand), "rm" (multiplier), "c" (shift) + : "cc"); return result; } diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/vm_basic_defs.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/vm_basic_defs.h --- open-vm-tools-2008.01.23-74039/lib/include/vm_basic_defs.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/vm_basic_defs.h 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -39,6 +39,10 @@ #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 re-define offsetof macro from stddef, make @@ -52,7 +56,8 @@ * Simple macros */ -#if defined __APPLE__ && !defined KERNEL +#if (defined __APPLE__ || defined __FreeBSD__) && \ + (!defined KERNEL && !defined _KERNEL && !defined VMKERNEL && !defined __KERNEL__) # include #else // XXX the __cplusplus one matches that of VC++, to prevent redefinition warning @@ -108,6 +113,7 @@ #define DWORD_ALIGN(x) ((((x)+3) >> 2) << 2) #define QWORD_ALIGN(x) ((((x)+4) >> 3) << 3) +#define IMPLIES(a,b) (!(a) || (b)) /* * Not everybody (e.g., the monitor) has NULL @@ -313,7 +319,22 @@ #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 // { @@ -324,7 +345,7 @@ * guarantee. Bummer. --Jeremy. */ -#if defined(N_PLAT_NLM) || defined(__FreeBSD__) +#if defined(N_PLAT_NLM) /* We do not have YIELD() as we do not need it yet... */ #elif defined(_WIN32) # define YIELD() Sleep(0) @@ -450,12 +471,23 @@ */ #undef DEBUG_ONLY +#undef SL_DEBUG_ONLY +#undef VMX86_SL_DEBUG #ifdef VMX86_DEBUG -#define vmx86_debug 1 -#define DEBUG_ONLY(x) x +#define vmx86_debug 1 +#define DEBUG_ONLY(x) x +/* + * Be very, very, very careful with SL_DEBUG. Pls ask ganesh or min before + * using it. + */ +#define VMX86_SL_DEBUG +#define vmx86_sl_debug 1 +#define SL_DEBUG_ONLY(x) x #else -#define vmx86_debug 0 +#define vmx86_debug 0 #define DEBUG_ONLY(x) +#define vmx86_sl_debug 0 +#define SL_DEBUG_ONLY(x) #endif #ifdef VMX86_STATS @@ -543,18 +575,32 @@ #endif #endif -#ifdef VMX86_VPROBES -#define vmx86_vprobes 1 -#define VPROBES_ONLY(x) x +#ifdef _WIN32 +#define VMW_INVALID_HANDLE INVALID_HANDLE_VALUE +#else +#define VMW_INVALID_HANDLE (-1) +#endif + +#ifdef _WIN32 +#define fsync(fd) _commit(fd) +#define fileno(f) _fileno(f) #else -#define vmx86_vprobes 0 -#define VPROBES_ONLY(x) #endif +/* + * Debug output macros for Windows drivers (the Eng variant is for + * display/printer drivers only. + */ #ifdef _WIN32 -#define VMW_INVALID_HANDLE INVALID_HANDLE_VALUE +#ifndef USES_OLD_WINDDK +#if defined(VMX86_DEBUG) || defined(ASSERT_ALWAYS_AVAILABLE) +#define WinDrvPrint(arg, ...) DbgPrint(arg, __VA_ARGS__) +#define WinDrvEngPrint(arg, ...) EngDbgPrint(arg, __VA_ARGS__) #else -#define VMW_INVALID_HANDLE -1 +#define WinDrvPrint(arg, ...) +#define WinDrvEngPrint(arg, ...) #endif +#endif +#endif // _WIN32 #endif // ifndef _VM_BASIC_DEFS_H_ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/vm_basic_types.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/vm_basic_types.h --- open-vm-tools-2008.01.23-74039/lib/include/vm_basic_types.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/vm_basic_types.h 2008-10-13 08:01:50.000000000 +0100 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998-2007 VMware, Inc. All rights reserved. + * Copyright (C) 1998-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 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -92,10 +92,6 @@ #pragma warning (disable :4305) // truncation from 'const int' to 'short' #pragma warning (disable :4244) // conversion from 'unsigned short' to 'unsigned char' #pragma warning (disable :4267) // truncation of 'size_t' -#if !defined VMX86_DEVEL // XXX until we clean up all the code -- edward -#pragma warning (disable :4133) // incompatible types - from 'struct VM *' to 'int *' -#pragma warning (disable :4047) // differs in levels of indirection -#endif #pragma warning (disable :4146) // unary minus operator applied to unsigned type, result still unsigned #pragma warning (disable :4142) // benign redefinition of type @@ -154,12 +150,16 @@ #include #endif +#ifdef __FreeBSD__ +#include /* For __FreeBSD_version */ +#endif + #if !defined(USING_AUTOCONF) # if defined(__FreeBSD__) || defined(sun) # ifdef KLD_MODULE # include # else -# if (BSD_VERSION >= 50) +# if !defined(VMKERNEL) && (__FreeBSD_version >= 500043) # include # include # else @@ -254,7 +254,12 @@ || (defined(_POSIX2_VERSION) && _POSIX2_VERSION >= 200112L) /* BSD/Darwin, Linux */ #define FMTSZ "z" - #define FMTPD "t" + + #if defined(VM_X86_64) || defined(__APPLE__) + #define FMTPD "l" + #else + #define FMTPD "" + #endif #else /* Systems with a pre-C99 libc */ #define FMTSZ "Z" @@ -338,8 +343,8 @@ * Type big enough to hold an integer between 0..100 */ typedef uint8 Percent; -#define asPercent(v) ((Percent)(v)) -#define CHOOSE_PERCENT asPercent(-1) +#define AsPercent(v) ((Percent)(v)) +#define CHOOSE_PERCENT AsPercent(101) typedef uintptr_t VA; @@ -371,6 +376,9 @@ typedef User_CartelID User_CartelGroupID; #define INVALID_CARTELGROUP_ID INVALID_CARTEL_ID +typedef uint32 Worldlet_ID; +#define INVALID_WORLDLET_ID ((Worldlet_ID)0) + /* world page number */ typedef uint32 WPN; @@ -381,6 +389,12 @@ #endif /* + * This type should be used for variables that contain sector + * position/quantity. + */ +typedef uint64 SectorType; + +/* * Linear address */ @@ -434,6 +448,7 @@ typedef VA32 UserVA32; typedef VA64 UserVA64; typedef UserVA32 UserVAConst; /* Userspace ptr to data that we may only read. */ +typedef UserVA64 UserVA64Const; /* Used by 64-bit syscalls until conversion is finished. */ #ifdef VMKERNEL typedef UserVA32 UserVA; #else @@ -447,10 +462,10 @@ * for any region other than buserror. */ #define PHYSMEM_MAX_PPN ((PPN)0xffffffff) -#define MAX_PPN ((PPN)0x0fffffff) /* Maximal observable PPN value. */ -#define INVALID_PPN ((PPN)-1) +#define MAX_PPN ((PPN)0x1fffffff) /* Maximal observable PPN value. */ +#define INVALID_PPN ((PPN)0xffffffff) -#define INVALID_BPN ((BPN) 0x3fffffff) /* BPNs don't use the high two bits. */ +#define INVALID_BPN ((BPN) 0x1fffffff) #define INVALID_MPN ((MPN)-1) #define MEMREF_MPN ((MPN)-2) @@ -480,8 +495,9 @@ # define FMTVPN "" #endif - +#ifndef EXTERN #define EXTERN extern +#endif #define CONST const @@ -631,6 +647,12 @@ # define PRINTF_DECL(fmtPos, varPos) #endif +#if defined(__GNUC__) +# define SCANF_DECL(fmtPos, varPos) __attribute__((__format__(__scanf__, fmtPos, varPos))) +#else +# define SCANF_DECL(fmtPos, varPos) +#endif + /* * UNUSED_PARAM should surround the parameter name and type declaration, * e.g. "int MyFunction(int var1, UNUSED_PARAM(int var2))" @@ -677,6 +699,52 @@ #endif /* + *********************************************************************** + * STRUCT_OFFSET_CHECK -- */ /** + * + * \brief Check if the actual offsef of a member in a structure + * is what is expected + * + * + * \param[in] STRUCT Structure the member is a part of. + * \param[in] MEMBER Member to check the offset of. + * \param[in] OFFSET Expected offset of MEMBER in STRUCTURE. + * \param[in] DEBUG_EXTRA Additional bytes to be added to OFFSET to + * compensate for extra info in debug builds. + * + *********************************************************************** + */ +#ifdef VMX86_DEBUG +#define STRUCT_OFFSET_CHECK(STRUCT, MEMBER, OFFSET, DEBUG_EXTRA) \ + ASSERT_ON_COMPILE(vmk_offsetof(STRUCT, MEMBER) == (OFFSET + DEBUG_EXTRA)) +#else +#define STRUCT_OFFSET_CHECK(STRUCT, MEMBER, OFFSET, DEBUG_EXTRA) \ + ASSERT_ON_COMPILE(vmk_offsetof(STRUCT, MEMBER) == OFFSET) +#endif + +/* + *********************************************************************** + * STRUCT_SIZE_CHECK -- */ /** + * + * \brief Check if the actual size of a structure is what is expected + * + * + * \param[in] STRUCT Structure whose size is to be checked. + * \param[in] SIZE Expected size of STRUCT. + * \param[in] DEBUG_EXTRA Additional bytes to be added to SIZE to + * compensate for extra info in debug builds. + * + *********************************************************************** + */ +#ifdef VMX86_DEBUG +#define STRUCT_SIZE_CHECK(STRUCT, SIZE, DEBUG_EXTRA) \ + ASSERT_ON_COMPILE(sizeof(STRUCT) == (SIZE + DEBUG_EXTRA)) +#else +#define STRUCT_SIZE_CHECK(STRUCT, SIZE, DEBUG_EXTRA) \ + ASSERT_ON_COMPILE(sizeof(STRUCT) == SIZE) +#endif + +/* * __func__ is a stringified function name that is part of the C99 standard. The block * below defines __func__ on older systems where the compiler does not support that * macro. @@ -831,4 +899,14 @@ typedef int PollDevHandle; #endif +/* + * Define the utf16_t type. + */ + +#if defined(_WIN32) && defined(_NATIVE_WCHAR_T_DEFINED) +typedef wchar_t utf16_t; +#else +typedef uint16 utf16_t; +#endif + #endif /* _VM_BASIC_TYPES_H_ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/vmblock.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/vmblock.h --- open-vm-tools-2008.01.23-74039/lib/include/vmblock.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/vmblock.h 2008-10-13 08:01:50.000000000 +0100 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2006 VMware, Inc. All rights reserved. + * Copyright (C) 2006-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 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -20,6 +20,25 @@ * vmblock.h -- * * User-level interface to the vmblock device. + * + * VMBLOCK_DEVICE should be opened with VMBLOCK_DEVICE_MODE mode. Then + * VMBLOCK_CONTROL should be called to perform blocking operations. + * The links which can be blocked are in the directory VMBLOCK_MOUNT_POINT. + * + * VMBLOCK_CONTROL takes the file descriptor of the VMBLOCK_DEVICE, an + * operation, and the path of the target of the file being operated on (if + * applicable). + * + * The operation should be one of: + * VMBLOCK_ADD_FILEBLOCK + * VMBLOCK_DEL_FILEBLOCK + * VMBLOCK_LIST_FILEBLOCKS + * + * path should be something in /tmp/VMwareDnD/ rather than in + * VMBLOCK_MOUNT_POINT. + * + * VMBLOCK_CONTROL returns 0 on success or returns -1 and sets errno on + * failure. */ #ifndef _VMBLOCK_H_ @@ -36,7 +55,69 @@ #define VMBLOCK_FS_NAME "vmblock" /* Commands for the control half of vmblock driver */ -#if defined(linux) +#if defined(vmblock_fuse) +# include +# include +# include +# include +# include "vm_basic_types.h" +# define VMBLOCK_ADD_FILEBLOCK 'a' +# define VMBLOCK_DEL_FILEBLOCK 'd' +# ifdef VMX86_DEVEL +# define VMBLOCK_LIST_FILEBLOCKS 'l' +# endif /* VMX86_DEVEL */ +/* + * Some of the following names don't actually make much sense on their own. + * They're used for consistency with the other ports. See the file header for + * explanations of what they're used for. + */ +# define VMBLOCK_DEVICE_NAME "dev" +# define VMBLOCK_CONTROL_MOUNTPOINT "blockdir" +# define VMBLOCK_DEVICE "/tmp/vmblock/" VMBLOCK_DEVICE_NAME +# define VMBLOCK_DEVICE_MODE O_WRONLY +# define VMBLOCK_MOUNT_POINT "/tmp/vmblock/" VMBLOCK_CONTROL_MOUNTPOINT +static INLINE ssize_t + VMBLOCK_CONTROL(int fd, char op, const char *path) +{ + /* + * buffer needs room for an operation character and a string with max length + * PATH_MAX - 1. + */ + + char buffer[PATH_MAX]; + size_t pathLength; + + pathLength = strlen(path); + if (pathLength >= PATH_MAX) { + errno = ENAMETOOLONG; + return -1; + } + + buffer[0] = op; + memcpy(buffer + 1, path, pathLength); + + /* + * The lseek is only to prevent the file pointer from overflowing; + * vmblock-fuse ignores the file pointer / offset. Overflowing the file + * pointer causes write to fail: + * http://article.gmane.org/gmane.comp.file-systems.fuse.devel/6648 + * There's also a race condition here where many threads all calling + * VMBLOCK_CONTROL at the same time could have all their seeks executed one + * after the other, followed by all the writes. Again, it's not a problem + * unless the file pointer overflows which is very unlikely with 32 bit + * offsets and practically impossible with 64 bit offsets. + */ + + if (lseek(fd, 0, SEEK_SET) < 0) { + return -1; + } + if (write(fd, buffer, pathLength + 1) < 0) { + return -1; + } + return 0; +} + +#elif defined(linux) # define VMBLOCK_ADD_FILEBLOCK 98 # define VMBLOCK_DEL_FILEBLOCK 99 # ifdef VMX86_DEVEL @@ -45,10 +126,11 @@ # define VMBLOCK_CONTROL_DIRNAME VMBLOCK_FS_NAME # define VMBLOCK_CONTROL_DEVNAME "dev" # define VMBLOCK_CONTROL_MOUNTPOINT "mountPoint" +# define VMBLOCK_CONTROL_PROC_DIRNAME "fs/" VMBLOCK_CONTROL_DIRNAME -# define VMBLOCK_MOUNT_POINT "/proc/fs/" VMBLOCK_CONTROL_DIRNAME \ +# define VMBLOCK_MOUNT_POINT "/proc/" VMBLOCK_CONTROL_PROC_DIRNAME \ "/" VMBLOCK_CONTROL_MOUNTPOINT -# define VMBLOCK_DEVICE "/proc/fs/" VMBLOCK_CONTROL_DIRNAME \ +# define VMBLOCK_DEVICE "/proc/" VMBLOCK_CONTROL_PROC_DIRNAME \ "/" VMBLOCK_CONTROL_DEVNAME # define VMBLOCK_DEVICE_MODE O_WRONLY # define VMBLOCK_CONTROL(fd, op, path) write(fd, path, op) diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/vmcheck.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/vmcheck.h --- open-vm-tools-2008.01.23-74039/lib/include/vmcheck.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/vmcheck.h 2008-10-13 08:01:49.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/vm_ctype.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/vm_ctype.h --- open-vm-tools-2008.01.23-74039/lib/include/vm_ctype.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/vm_ctype.h 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/vmGuestLib.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/vmGuestLib.h --- open-vm-tools-2008.01.23-74039/lib/include/vmGuestLib.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/vmGuestLib.h 2008-10-13 08:01:50.000000000 +0100 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2003-2007 VMware, Inc. All rights reserved. + * 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 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/vm_legal.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/vm_legal.h --- open-vm-tools-2008.01.23-74039/lib/include/vm_legal.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/vm_legal.h 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -30,11 +30,29 @@ #include "vm_version.h" -#define COPYRIGHT_YEARS "1998-2007" +/* XXX: Sadly, the legalese is replicated in: + * apps/acesc-config/html/about.html + * apps/acesc-config/js/ascc_pagestr_en.js + * apps/acesc-config/js/ascc_pagestr_ja.js + * apps/lib/foundry/doc/copyright.html + * apps/lib/foundry/doc/Server_C_API_Preview_Programming_Manual.html + * apps/vcb/README + * apps/scripts/perlAPI-samplecode/VmPerl_samples/README.txt + * apps/vixDiskLib/doc/copyright.html + * and in a whole bunch of Mac OS files for different locales that I'm not + * going to enumerate here. + * + * Note about the newlines: Keep at most 6 patents per line, but be careful + * with the last line which will have "; patents pending" appended. + */ +#define COPYRIGHT_YEARS "1998-2008" #define COPYRIGHT_STRING "Copyright \251 " COPYRIGHT_YEARS " " COMPANY_NAME #define UTF8_COPYRIGHT_STRING "Copyright \302\251 " COPYRIGHT_YEARS " " COMPANY_NAME +#define GENERIC_COPYRIGHT_STRING "Copyright (C) " COPYRIGHT_YEARS " " COMPANY_NAME #define RIGHT_RESERVED "All rights reserved." -#define PATENTS_STRING "Protected by one or more U.S. Patent Nos.\n6,397,242, 6,496,847, 6,704,925, 6,711,672, 6,725,289, 6,735,601,\n6,785,886, 6,789,156, 6,795,966, 6,880,022, 6,944,699, 6,961,806,\n6,961,941, 7,069,413, 7,082,598, 7,089,377, 7,111,086, 7,111,145,\n7,117,481, 7,149,843, 7,155,558, 7,222,221, 7,260,815, 7,260,820,\n7,269,683, 7,275,136, 7,277,998, 7,277,999, 7,278,030, 7,281,102\nand 7,290,253; patents pending." +#define PATENTS_LIST "6,397,242, 6,496,847, 6,704,925, 6,711,672, 6,725,289, 6,735,601,\n6,785,886, 6,789,156, 6,795,966, 6,880,022, 6,944,699, 6,961,806,\n6,961,941, 7,069,413, 7,082,598, 7,089,377, 7,111,086, 7,111,145,\n7,117,481, 7,149,843, 7,155,558, 7,222,221, 7,260,815, 7,260,820,\n7,269,683, 7,275,136, 7,277,998, 7,277,999, 7,278,030, 7,281,102,\n7,290,253, 7,356,679, 7,409,487, 7,412,492, 7,412,702, 7,424,710\n" +#define PATENTS_LAST "7,428,636" +#define PATENTS_STRING "Protected by one or more U.S. Patent Nos.\n" PATENTS_LIST "and " PATENTS_LAST "; patents pending." #define TRADEMARK_STRING "VMware, the VMware \"boxes\" logo and design, Virtual SMP and VMotion are\nregistered trademarks or trademarks of VMware, Inc. in the United States\nand/or other jurisdictions." #define GENERIC_TRADEMARK_STRING "All other marks and names mentioned herein may be trademarks of their\nrespective companies." diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/vm_procps.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/vm_procps.h --- open-vm-tools-2008.01.23-74039/lib/include/vm_procps.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/vm_procps.h 2008-10-13 08:01:50.000000000 +0100 @@ -0,0 +1,76 @@ +/********************************************************* + * Copyright (C) 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. + * + *********************************************************/ + +/* + * 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_ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/vm_product.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/vm_product.h --- open-vm-tools-2008.01.23-74039/lib/include/vm_product.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/vm_product.h 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -59,7 +59,7 @@ /* * Brief names are used when the VMware prefix is not wanted. */ -#define PRODUCT_SCALABLE_SERVER_BRIEF_NAME "ESX Server" +#define PRODUCT_SCALABLE_SERVER_BRIEF_NAME "ESX" #define PRODUCT_WGS_BRIEF_NAME "Server" #define PRODUCT_GSX_BRIEF_NAME "GSX Server" #define PRODUCT_WORKSTATION_BRIEF_NAME "Workstation" @@ -96,8 +96,8 @@ #define PRODUCT_VMLS_SHORT_NAME "VMLS" #define PRODUCT_VMLS_NAME MAKE_NAME("License Server") -#define PRODUCT_LICENSE_SHORT_NAME "LICENSE" -#define PRODUCT_LICENSE_NAME MAKE_NAME("License Infrastructure") +#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") @@ -126,12 +126,24 @@ #define PRODUCT_DDK_NAME MAKE_NAME("ESX DDK") +#define PRODUCT_VDM_SHORT_NAME "VDM" +#define PRODUCT_VDM_NAME MAKE_NAME("Virtual Desktop Manager") + +#define PRODUCT_VDM_CLIENT_NAME MAKE_NAME("VDM Client") +#define PRODUCT_VDM_CLIENT_NAME_FOR_LICENSE PRODUCT_VDM_CLIENT_NAME + // 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") +// #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") + +/* + * VMware Remote Console (VMRC) version definitions + */ #define PRODUCT_VMRC_SHORT_NAME "VMRC" -#define PRODUCT_VMRC_NAME MAKE_NAME("Virtual Machine Remote Console") +#define PRODUCT_VMRC_NAME MAKE_NAME("Remote Console") #define PRODUCT_VMRC_PLUGIN_NAME PRODUCT_VMRC_NAME " Plug-in" #define PRODUCT_VMRC_DESCRIPTION "Enables remote interaction with virtual machines." #ifdef _WIN32 @@ -141,6 +153,70 @@ #endif /* + * VMRC ActiveX CLSIDs and ProgIDs + */ +#define PRODUCT_VMRC_PLUGIN_GUID_WEB B94C2238-346E-4c5e-9B36-8CC627F35574 +#define PRODUCT_VMRC_PLUGIN_GUID_WEB_TYPELIB 84D652E1-9364-4536-B13C-24F16FBEBCFE +#define PRODUCT_VMRC_PLUGIN_WEB_CLSID CLSID:##PRODUCT_VMRC_PLUGIN_GUID_WEB +#define PRODUCT_VMRC_PLUGIN_WEB_PROGID_BASE "VMware.web.VMwareRemoteConsole" +#define PRODUCT_VMRC_PLUGIN_WEB_PROGID PRODUCT_VMRC_PLUGIN_WEB_PROGID_BASE "." \ + XSTR(VMRC_PLUGIN_VERSION_BASE) + +#define PRODUCT_VMRC_PLUGIN_GUID B94C2248-346E-4C5E-9B36-8CC627F35574 +#define PRODUCT_VMRC_PLUGIN_GUID_EMBEDDED B94C2249-346E-4C5E-9B36-8CC627F35574 +#define PRODUCT_VMRC_PLUGIN_GUID_QUICKMKSAXCTL 338095E4-1806-4BA3-AB51-38A3179200E9 +#define PRODUCT_VMRC_PLUGIN_GUID_TYPELIB A51B0CB2-1545-43AD-B66E-AD322009406C +#define PRODUCT_VMRC_PLUGIN_PROGID_BASE "VMware.hosted.VMwareRemoteConsole" +#define PRODUCT_VMRC_PLUGIN_PROGID PRODUCT_VMRC_PLUGIN_PROGID_BASE "." \ + XSTR(VMRC_PLUGIN_VERSION_BASE) +#define PRODUCT_VMRC_PLUGIN_PROGID_EMBEDDED_BASE "VMware.hosted.VMwareEmbeddedRemoteConsole" +#define PRODUCT_VMRC_PLUGIN_PROGID_EMBEDDED PRODUCT_VMRC_PLUGIN_PROGID_EMBEDDED_BASE "." \ + XSTR(VMRC_PLUGIN_VERSION_BASE) + +/* + * VMRC MIME types + */ +#ifdef _WIN32 +#define PRODUCT_VMRC_MIMETYPE_SEPARATOR "|" +#define PRODUCT_VMRC_MIMETYPE_TERMINATOR "" +#else +#define PRODUCT_VMRC_MIMETYPE_SEPARATOR "::" PRODUCT_VMRC_PLUGIN_NAME ";" +#define PRODUCT_VMRC_MIMETYPE_TERMINATOR "::" PRODUCT_VMRC_PLUGIN_NAME ";" +#endif + +#define PRODUCT_VMRC_PLUGIN_CURRENT_MIMETYPE \ + "application/x-vmware-vmrc;version=" VMRC_PLUGIN_VERSION + +/* + * previously shipped plugin mimetypes (updated as we ship them) + * + * XXX It is important that the mimetypes be listed in strictly decreasing + * order by version. Server 2.0 Web Access (WBC) only checks the first VMRC + * mimetype for compatibility, and others might make the same mistake in + * the future. + */ +#define PRODUCT_VMRC_PLUGIN_PREVIOUS_MIMETYPES \ + "application/x-vmware-vmrc;version=2.5.0.116460" PRODUCT_VMRC_MIMETYPE_SEPARATOR \ + "application/x-vmware-vmrc;version=2.5.0.0" + +/* + * legacy plugin mimetypes (currently unused but here for reference) + */ +#define PRODUCT_VMRC_PLUGIN_LEGACY_MIMETYPES \ + "application/x-vmware-mks;version=2.1.0.0" PRODUCT_VMRC_MIMETYPE_SEPARATOR \ + "application/x-vmware-mks;version=2.0.1.0" PRODUCT_VMRC_MIMETYPE_SEPARATOR \ + "application/x-vmware-mks;version=2.0.0.0" PRODUCT_VMRC_MIMETYPE_SEPARATOR + +/* + * All supported plugin mimetypes + * + * NB: See above for constraints on the ordering of this list. + */ +#define PRODUCT_VMRC_PLUGIN_MIMETYPES \ + PRODUCT_VMRC_PLUGIN_PREVIOUS_MIMETYPES PRODUCT_VMRC_MIMETYPE_SEPARATOR \ + PRODUCT_VMRC_PLUGIN_CURRENT_MIMETYPE PRODUCT_VMRC_MIMETYPE_TERMINATOR + +/* * 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. @@ -162,7 +238,7 @@ || defined(VMX86_SYSIMAGE) \ || defined(VMX86_VCB) \ || defined(VMX86_VMLS) \ - || defined(VMX86_LICENSE) \ + || defined(VMX86_VLICENSE) \ || defined(VMX86_P2V) \ || defined(VMX86_DDK)) # if defined(_WIN32) @@ -223,8 +299,8 @@ # define PRODUCT_SHORT_NAME PRODUCT_VCB_NAME #elif defined(VMX86_VMLS) # define PRODUCT_SHORT_NAME PRODUCT_VMLS_NAME -#elif defined(VMX86_LICENSE) -# define PRODUCT_SHORT_NAME PRODUCT_LICENSE_NAME +#elif defined(VMX86_VLICENSE) +# define PRODUCT_SHORT_NAME PRODUCT_VLICENSE_NAME #elif defined(VMX86_DDK) # define PRODUCT_SHORT_NAME PRODUCT_DDK_NAME #endif @@ -275,8 +351,16 @@ # 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 PRODUCT_NAME +# define PRODUCT_NAME_FOR_LICENSE "VMware ESX Server" # define PRODUCT_SMP_NAME_FOR_LICENSE PRODUCT_ESX_SMP_NAME # elif defined(VMX86_DESKTOP) # define PRODUCT_NAME_FOR_LICENSE PRODUCT_NAME " for " PRODUCT_OS @@ -423,6 +507,8 @@ # 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" #else # ifdef VMX86_TOOLS # error "Define a product string for this platform." @@ -435,9 +521,9 @@ * 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 + * 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 + * A similar reason is used also for the PRODUCT_VERSION_STRING_FOR_LICENSE * definition in the vm_version.h */ @@ -449,4 +535,10 @@ #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" + #endif /* VM_PRODUCT_H */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/vmSessionId.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/vmSessionId.h --- open-vm-tools-2008.01.23-74039/lib/include/vmSessionId.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/vmSessionId.h 2008-10-13 08:01:50.000000000 +0100 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2006 VMware, Inc. All rights reserved. + * Copyright (C) 2006-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 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/vmsignal.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/vmsignal.h --- open-vm-tools-2008.01.23-74039/lib/include/vmsignal.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/vmsignal.h 2008-10-13 08:01:49.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/vmstdio.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/vmstdio.h --- open-vm-tools-2008.01.23-74039/lib/include/vmstdio.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/vmstdio.h 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/vm_tools_version.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/vm_tools_version.h --- open-vm-tools-2008.01.23-74039/lib/include/vm_tools_version.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/vm_tools_version.h 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -68,6 +68,18 @@ #endif +/* + * Reserve the highest possible Tools version for Tools whose lifecycle isn't + * to be managed by VMware's platform. + * + * Even though the ToolsVersion type is defined as uint32 above, the VMX had, + * for a long time, scanned it via sscanf(3) using "%d". To preserve backwards + * compatibility with such a VMX, the "highest possible" version is defined to + * be the largest signed 32-bit integer instead of the largest unsigned 32-bit + * integer. + */ +#define TOOLS_VERSION_UNMANAGED 0x7fffffff + #define STRINGER(MJR, MNR, BASE) #MJR "." #MNR "." #BASE #define TOOLS_VERSION_STRINGER(MJR, MNR, BASE) STRINGER(MJR, MNR, BASE) @@ -691,6 +703,13 @@ #define TOOLS_VERSION_ESX310_RELEASE_V_BASE 3 #ifndef RC_INVOKED +#define TOOLS_VERSION_ESX310_UPDATE1 TOOLS_VERSION_TO_UINT(TOOLS_VERSION_ESX310_UPDATE1_V) +#endif /* RC_INVOKED */ +#define TOOLS_VERSION_ESX310_UPDATE1_V_MJR 7 +#define TOOLS_VERSION_ESX310_UPDATE1_V_MNR 4 +#define TOOLS_VERSION_ESX310_UPDATE1_V_BASE 4 + +#ifndef RC_INVOKED #define TOOLS_VERSION_SERVER20_FF TOOLS_VERSION_TO_UINT(TOOLS_VERSION_SERVER20_FF_V) #endif /* RC_INVOKED */ #define TOOLS_VERSION_SERVER20_FF_V_MJR 7 @@ -725,9 +744,124 @@ #define TOOLS_VERSION_SERVER20_BETA1_V_MNR 7 #define TOOLS_VERSION_SERVER20_BETA1_V_BASE 0 -#define TOOLS_VERSION_CURRENT TOOLS_VERSION_SERVER20_BETA1 -#define TOOLS_VERSION_CURRENT_STR TOOLS_VERSION_TO_STR(TOOLS_VERSION_SERVER20_BETA1) -#define TOOLS_VERSION_CURRENT_CSV TOOLS_VERSION_TO_CSV(TOOLS_VERSION_SERVER20_BETA1) +#ifndef RC_INVOKED +#define TOOLS_VERSION_SERVER20_BETA2 TOOLS_VERSION_TO_UINT(TOOLS_VERSION_SERVER20_BETA2_V) +#endif /* RC_INVOKED */ +#define TOOLS_VERSION_SERVER20_BETA2_V_MJR 7 +#define TOOLS_VERSION_SERVER20_BETA2_V_MNR 7 +#define TOOLS_VERSION_SERVER20_BETA2_V_BASE 1 + +#ifndef RC_INVOKED +#define TOOLS_VERSION_SERVER20_RC1 TOOLS_VERSION_TO_UINT(TOOLS_VERSION_SERVER20_RC1_V) +#endif /* RC_INVOKED */ +#define TOOLS_VERSION_SERVER20_RC1_V_MJR 7 +#define TOOLS_VERSION_SERVER20_RC1_V_MNR 7 +#define TOOLS_VERSION_SERVER20_RC1_V_BASE 2 + +#ifndef RC_INVOKED +#define TOOLS_VERSION_SERVER20_RC2 TOOLS_VERSION_TO_UINT(TOOLS_VERSION_SERVER20_RC2_V) +#endif /* RC_INVOKED */ +#define TOOLS_VERSION_SERVER20_RC2_V_MJR 7 +#define TOOLS_VERSION_SERVER20_RC2_V_MNR 7 +#define TOOLS_VERSION_SERVER20_RC2_V_BASE 3 + +#ifndef RC_INVOKED +#define TOOLS_VERSION_SERVER20_RELEASE TOOLS_VERSION_TO_UINT(TOOLS_VERSION_SERVER20_RELEASE_V) +#endif /* RC_INVOKED */ +#define TOOLS_VERSION_SERVER20_RELEASE_V_MJR 7 +#define TOOLS_VERSION_SERVER20_RELEASE_V_MNR 7 +#define TOOLS_VERSION_SERVER20_RELEASE_V_BASE 4 + + +/* + * XXX: Chromium (WS 6.5) releases should have 7.8.x numbers. + * We still haven't used that range (beta 1 was released with 7.7.1). + */ + +#ifndef RC_INVOKED +#define TOOLS_VERSION_WS65_BETA1 TOOLS_VERSION_TO_UINT(TOOLS_VERSION_WS65_BETA1_V) +#endif /* RC_INVOKED */ +#define TOOLS_VERSION_WS65_BETA1_V_MJR 7 +#define TOOLS_VERSION_WS65_BETA1_V_MNR 8 +#define TOOLS_VERSION_WS65_BETA1_V_BASE 0 + +#ifndef RC_INVOKED +#define TOOLS_VERSION_WS65_BETA2 TOOLS_VERSION_TO_UINT(TOOLS_VERSION_WS65_BETA2_V) +#endif /* RC_INVOKED */ +#define TOOLS_VERSION_WS65_BETA2_V_MJR 7 +#define TOOLS_VERSION_WS65_BETA2_V_MNR 8 +#define TOOLS_VERSION_WS65_BETA2_V_BASE 1 + +#ifndef RC_INVOKED +#define TOOLS_VERSION_WS65_RC1 TOOLS_VERSION_TO_UINT(TOOLS_VERSION_WS65_RC1_V) +#endif /* RC_INVOKED */ +#define TOOLS_VERSION_WS65_RC1_V_MJR 7 +#define TOOLS_VERSION_WS65_RC1_V_MNR 8 +#define TOOLS_VERSION_WS65_RC1_V_BASE 2 + +#ifndef RC_INVOKED +#define TOOLS_VERSION_WS65_RELEASE TOOLS_VERSION_TO_UINT(TOOLS_VERSION_WS65_RELEASE_V) +#endif /* RC_INVOKED */ +#define TOOLS_VERSION_WS65_RELEASE_V_MJR 7 +#define TOOLS_VERSION_WS65_RELEASE_V_MNR 8 +#define TOOLS_VERSION_WS65_RELEASE_V_BASE 3 + +#ifndef RC_INVOKED +#define TOOLS_VERSION_WS65_UPDATE1 TOOLS_VERSION_TO_UINT(TOOLS_VERSION_WS65_UPDATE1_V) +#endif /* RC_INVOKED */ +#define TOOLS_VERSION_WS65_UPDATE1_V_MJR 7 +#define TOOLS_VERSION_WS65_UPDATE1_V_MNR 8 +#define TOOLS_VERSION_WS65_UPDATE1_V_BASE 4 + +#ifndef RC_INVOKED +#define TOOLS_VERSION_FUSION15_BETA1 TOOLS_VERSION_TO_UINT(TOOLS_VERSION_FUSION15_BETA1_V) +#endif /* RC_INVOKED */ +#define TOOLS_VERSION_FUSION15_BETA1_V_MJR 7 +#define TOOLS_VERSION_FUSION15_BETA1_V_MNR 9 +#define TOOLS_VERSION_FUSION15_BETA1_V_BASE 0 + +#ifndef RC_INVOKED +#define TOOLS_VERSION_FUSION15_BETA2 TOOLS_VERSION_TO_UINT(TOOLS_VERSION_FUSION15_BETA2_V) +#endif /* RC_INVOKED */ +#define TOOLS_VERSION_FUSION15_BETA2_V_MJR 7 +#define TOOLS_VERSION_FUSION15_BETA2_V_MNR 9 +#define TOOLS_VERSION_FUSION15_BETA2_V_BASE 1 + +#ifndef RC_INVOKED +#define TOOLS_VERSION_FUSION15_RC1 TOOLS_VERSION_TO_UINT(TOOLS_VERSION_FUSION15_RC1_V) +#endif /* RC_INVOKED */ +#define TOOLS_VERSION_FUSION15_RC1_V_MJR 7 +#define TOOLS_VERSION_FUSION15_RC1_V_MNR 9 +#define TOOLS_VERSION_FUSION15_RC1_V_BASE 2 + +#ifndef RC_INVOKED +#define TOOLS_VERSION_FUSION15_RELEASE TOOLS_VERSION_TO_UINT(TOOLS_VERSION_FUSION15_RELEASE_V) +#endif /* RC_INVOKED */ +#define TOOLS_VERSION_FUSION15_RELEASE_V_MJR 7 +#define TOOLS_VERSION_FUSION15_RELEASE_V_MNR 9 +#define TOOLS_VERSION_FUSION15_RELEASE_V_BASE 3 + +#ifndef RC_INVOKED +#define TOOLS_VERSION_FUSION15_UPDATE1 TOOLS_VERSION_TO_UINT(TOOLS_VERSION_FUSION15_UPDATE1_V) +#endif /* RC_INVOKED */ +#define TOOLS_VERSION_FUSION15_UPDATE1_V_MJR 7 +#define TOOLS_VERSION_FUSION15_UPDATE1_V_MNR 9 +#define TOOLS_VERSION_FUSION15_UPDATE1_V_BASE 4 + +/* + * At the request of CPD, ESX 4.0 receives its own major version (8.0.0). + */ +#ifndef RC_INVOKED +#define TOOLS_VERSION_ESX40_RC1 TOOLS_VERSION_TO_UINT(TOOLS_VERSION_ESX40_RC1_V) +#endif /* RC_INVOKED */ +#define TOOLS_VERSION_ESX40_RC1_V_MJR 8 +#define TOOLS_VERSION_ESX40_RC1_V_MNR 0 +#define TOOLS_VERSION_ESX40_RC1_V_BASE 0 + +#define TOOLS_VERSION_CURRENT TOOLS_VERSION_ESX40_RC1 +#define TOOLS_VERSION_CURRENT_STR TOOLS_VERSION_TO_STR(TOOLS_VERSION_ESX40_RC1) +#define TOOLS_VERSION_CURRENT_CSV TOOLS_VERSION_TO_CSV(TOOLS_VERSION_ESX40_RC1) + /* * The extended Tools version is the current Tools version with the diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/vm_version.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/vm_version.h --- open-vm-tools-2008.01.23-74039/lib/include/vm_version.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/vm_version.h 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -84,25 +84,25 @@ #define ENCODE_DATE(year, month, day) ((year) * ((DATE_MONTH_MAX + 1) * (DATE_DAY_MAX + 1)) + (month) * (DATE_DAY_MAX + 1) + (day)) #if !defined(VMX86_DEVEL) && defined(BUILD_EXPIRE) # if defined(VMX86_SERVER) -# define HARD_EXPIRE ENCODE_DATE(2008, 07, 31) +# define HARD_EXPIRE ENCODE_DATE(2009, 1, 31) # elif defined(VMX86_WGS) -# define HARD_EXPIRE ENCODE_DATE(2008, 07, 31) +# define HARD_EXPIRE ENCODE_DATE(2009, 1, 31) # elif defined(VMX86_DESKTOP) -# define HARD_EXPIRE ENCODE_DATE(2008, 07, 31) +# define HARD_EXPIRE ENCODE_DATE(2009, 1, 31) # elif defined(VMX86_P2V) -# define HARD_EXPIRE ENCODE_DATE(2008, 07, 31) +# define HARD_EXPIRE ENCODE_DATE(2009, 1, 31) # elif defined(VMX86_V2V) -# define HARD_EXPIRE ENCODE_DATE(2008, 07, 31) +# define HARD_EXPIRE ENCODE_DATE(2009, 1, 31) # elif defined(VMX86_SYSIMAGE) -# define HARD_EXPIRE ENCODE_DATE(2008, 07, 31) +# define HARD_EXPIRE ENCODE_DATE(2009, 1, 31) # elif defined(VMX86_VCB) -# define HARD_EXPIRE ENCODE_DATE(2008, 07, 31) +# define HARD_EXPIRE ENCODE_DATE(2009, 1, 31) # elif defined(VMX86_VPX) -# define HARD_EXPIRE ENCODE_DATE(2008, 07, 31) +# define HARD_EXPIRE ENCODE_DATE(2009, 1, 31) # elif defined(VMX86_WBC) -# define HARD_EXPIRE ENCODE_DATE(2008, 07, 31) +# define HARD_EXPIRE ENCODE_DATE(2009, 1, 31) # elif defined(VMX86_SDK) -# define HARD_EXPIRE ENCODE_DATE(2008, 07, 31) +# define HARD_EXPIRE ENCODE_DATE(2009, 1, 31) # endif #endif @@ -149,7 +149,7 @@ * VMI 2.0 : 3.1.0 * P2VA 3.0 : 3.?.? */ -#define VIE_FILEVERSION 3,1,0,PRODUCT_BUILD_NUMBER_NUMERIC +#define VIE_FILEVERSION 3,2,0,PRODUCT_BUILD_NUMBER_NUMERIC /* * This string can be a little more "free form". The license @@ -160,9 +160,15 @@ * * Manage version numbers for each product here. * - * NOTE: BE AWARE that Makefiles and build scripts depend + * NOTE: BE AWARE that Scons/Makefiles and build scripts depend * on these defines. * + * In particular, only the first quoted token after the + * macro name will be used for the macro value by the build + * system. Also, if VERSION_MAJOR, VERSION_MINOR, and + * VERSION_MAINT macros are defined, they override the + * VERSION macro in the build system. + * */ /* @@ -177,17 +183,54 @@ * - A change that deprecates or obsoletes any existing interfaces * requires a major version bump. */ -#define API_SCRIPTING_VERSION "e.x.p" +#define API_SCRIPTING_VERSION "4.1.0" +#define API_VMDB_VERSION "4.1.0" -#define API_VMDB_VERSION "e.x.p" -#define ESX_VERSION "e.x.p" +/* + * When updating the ESX_VERSION* and ESX_RELEASE* macros, you will also + * need to update: + * + * > bora/install/server/weasel/packages.xml + * > bora/support/gobuild/targets/server.py + * > console-os26/SOURCES/kernel-2.6.spec + * + * Rules for updating the ESX_RELEASE_* macros: + * + * Set UPDATE to 0 for all experimental/prerelease/and initial major and minor + * releases. Increment update for each update release. + * + * Set PATCH to 0 for all experimental builds. Increment it for each build + * that will be delivered externally. + * + * THEORETICAL EXAMPLES: + * + * 4.0.0-0.0: experimental version + * 4.0.0-0.1: beta 1 + * 4.0.0-0.2: beta 2 + * 4.0.0-0.3; rc1 + * 4.0.0-0.4: GA + * 4.0.0-0.5: patch 1 + * 4.0.0-0.6: patch 2 + * 4.0.0-1.7: update 1 + * 4.0.0-1.8: patch 3 + */ +#define ESX_VERSION_MAJOR "4" +#define ESX_VERSION_MINOR "1" +#define ESX_VERSION_MAINT "0" +#define ESX_VERSION ESX_VERSION_MAJOR "." ESX_VERSION_MINOR "." \ + ESX_VERSION_MAINT +#define ESX_VERSION_THIRD_PARTY ESX_VERSION_MAJOR ESX_VERSION_MINOR \ + ESX_VERSION_MAINT +#define ESX_RELEASE_UPDATE "0" /* 0 = Pre-release/GA, 1 = Update 1 */ +#define ESX_RELEASE_PATCH "0" /* 0 = experimental */ +#define ESX_RELEASE ESX_RELEASE_UPDATE "." ESX_RELEASE_PATCH #define GSX_VERSION "e.x.p" #define VMSERVER_VERSION "e.x.p" #define WORKSTATION_VERSION "e.x.p" #define WORKSTATION_ENTERPRISE_VERSION "e.x.p" #define ACE_MANAGEMENT_SERVER_VERSION "e.x.p" -#define MUI_VERSION "e.x.p" -#define CONSOLE_VERSION "e.x.p" +#define MUI_VERSION "4.1.0" +#define CONSOLE_VERSION "4.1.0" #define P2V_VERSION "e.x.p" #define P2V_FILE_VERSION 3,0,0,0 #define PLAYER_VERSION "e.x.p" @@ -198,19 +241,45 @@ #define SYSIMAGE_VERSION "4.0.0" #define SYSIMAGE_FILE_VERSION VIE_FILEVERSION -#define VCB_VERSION "e.x.p" -#define VCB_FILE_VERSION 1,0,0,0 +#define VCB_VERSION "4.0.0" +#define VCB_FILE_VERSION 4,0,0,0 #define VPX_VERSION "e.x.p" #define WBC_VERSION "e.x.p" -#define SDK_VERSION "e.x.p" +#define SDK_VERSION "4.1.0" #define FOUNDRY_VERSION "e.x.p" +#define FOUNDRY_FILE_VERSION 1,6,2,PRODUCT_BUILD_NUMBER_NUMERIC #define VMLS_VERSION "e.x.p" -#define LICENSE_VERSION "e.x.p" +#define VLICENSE_VERSION "e.x.p" #define DDK_VERSION "e.x.p" -#define VIM_API_VERSION "2.5.0" +#define VIM_API_VERSION "4.0" #define VIPERL_VERSION "1.1.0" -#define RCLI_VERSION "1.5.0" -#define TOOLS_VERSION "2008.01.23" +#define RCLI_VERSION "4.0.0" +#define VDM_VERSION "e.x.p" +#define VDM_CLIENT_VERSION "e.x.p" + +// VMRC_PLUGIN_VERSION should match PLAYER_VERSION but can't be e.x.p +#ifndef MAKESTR +#define MAKESTR(x) #x +#define XSTR(x) MAKESTR(x) +#endif + +#define VMRC_PLUGIN_VERSION_MAJOR 2 +#define VMRC_PLUGIN_VERSION_MINOR 5 +#define VMRC_PLUGIN_VERSION_Z 0 +#define VMRC_PLUGIN_VERSION_BASE VMRC_PLUGIN_VERSION_MAJOR.VMRC_PLUGIN_VERSION_MINOR + +#define VMRC_PLUGIN_VERSION \ + XSTR(VMRC_PLUGIN_VERSION_BASE) "." XSTR(VMRC_PLUGIN_VERSION_Z) "." BUILD_NUMBER_NUMERIC_STRING +#define VMRC_PLUGIN_VERSION_COMMAS \ + VMRC_PLUGIN_VERSION_MAJOR,VMRC_PLUGIN_VERSION_MINOR,0,PRODUCT_BUILD_NUMBER_NUMERIC + +/* + * When setting the Tools product version, please use the string corresponding + * to TOOLS_VERSION_CURRENT_STR from vm_tools_version.h. + * + * XXX: The extract-macro script should be updated to handle this special case. + */ +#define TOOLS_VERSION "2008.10.10" #ifdef VMX86_VPX #define VIM_API_TYPE "VirtualCenter" @@ -258,8 +327,8 @@ # define PRODUCT_VERSION_NUMBER FOUNDRY_VERSION #elif defined(VMX86_VMLS) # define PRODUCT_VERSION_NUMBER VMLS_VERSION -#elif defined(VMX86_LICENSE) -# define PRODUCT_VERSION_NUMBER LICENSE_VERSION +#elif defined(VMX86_VLICENSE) +# define PRODUCT_VERSION_NUMBER VLICENSE_VERSION #elif defined(VMX86_DDK) # define PRODUCT_VERSION_NUMBER DDK_VERSION #elif defined(VMX86_TOOLS) @@ -280,13 +349,21 @@ * If platforms are on different version numbers, manage it here. */ +/* + * 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_TOOLS) /* This product doesn't use a license */ # define PRODUCT_VERSION_STRING_FOR_LICENSE "" # define PRODUCT_LICENSE_VERSION "0.0" #else # if defined(VMX86_SERVER) -# define PRODUCT_LICENSE_VERSION "2.0" +# define PRODUCT_LICENSE_VERSION "4.0" # elif defined(VMX86_WGS_MIGRATION) # define PRODUCT_LICENSE_VERSION "1.0" # elif defined(VMX86_WGS) @@ -325,7 +402,6 @@ #define ACE_MGMT_SERVER_VERSION_STRING_FOR_LICENSE "2.0" - /* * The configuration file version string should be changed * whenever we make incompatible changes to the config file @@ -355,8 +431,9 @@ #define CONFIG_VERSION_UNDOPOINT "7" /* Undopoint paradigm (WS40) */ #define CONFIG_VERSION_WS4 "7" /* config version of WS4.0.x */ #define CONFIG_VERSION_MSNAP "8" /* Multiple Snapshots */ +#define CONFIG_VERSION_WS5 "8" /* WS5.0 */ -#define VMVISOR_VERSION "99.99.99" +#define VMVISOR_VERSION "4.1.0" /* @@ -370,7 +447,7 @@ #define PRODUCT_VERSION_SCALABLE_SERVER_30 PRODUCT_SCALABLE_SERVER_BRIEF_NAME " 3.0" #define PRODUCT_VERSION_SCALABLE_SERVER_31 PRODUCT_SCALABLE_SERVER_BRIEF_NAME " 3.5" #define PRODUCT_VERSION_WGS_1 PRODUCT_WGS_BRIEF_NAME " 1.x" -#define PRODUCT_VERSION_WGS_2 PRODUCT_WGS_BRIEF_NAME " 2.x" +#define PRODUCT_VERSION_WGS_2 PRODUCT_WGS_BRIEF_NAME " 2.0" #define PRODUCT_VERSION_GSX_2 PRODUCT_GSX_BRIEF_NAME " 2.x" #define PRODUCT_VERSION_GSX_3 PRODUCT_GSX_BRIEF_NAME " 3.x" #define PRODUCT_VERSION_WORKSTATION_4 PRODUCT_WORKSTATION_BRIEF_NAME " 4.x" @@ -382,7 +459,7 @@ #define PRODUCT_VERSION_WORKSTATION_ENTERPRISE_25 "ACE 2.5" #define PRODUCT_VERSION_PLAYER_1 PRODUCT_PLAYER_BRIEF_NAME " 1.x" #define PRODUCT_VERSION_MAC_DESKTOP_1 PRODUCT_MAC_DESKTOP_BRIEF_NAME " 1.1" -#define PRODUCT_VERSION_MAC_DESKTOP_15 PRODUCT_MAC_DESKTOP_BRIEF_NAME " 1.5" +#define PRODUCT_VERSION_MAC_DESKTOP_2 PRODUCT_MAC_DESKTOP_BRIEF_NAME " 2.0" /* diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/vmware.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/vmware.h --- open-vm-tools-2008.01.23-74039/lib/include/vmware.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/vmware.h 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/vmware_pack_begin.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/vmware_pack_begin.h --- open-vm-tools-2008.01.23-74039/lib/include/vmware_pack_begin.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/vmware_pack_begin.h 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/vmware_pack_end.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/vmware_pack_end.h --- open-vm-tools-2008.01.23-74039/lib/include/vmware_pack_end.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/vmware_pack_end.h 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/vmware_pack_init.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/vmware_pack_init.h --- open-vm-tools-2008.01.23-74039/lib/include/vmware_pack_init.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/vmware_pack_init.h 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/vmxrpc.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/vmxrpc.h --- open-vm-tools-2008.01.23-74039/lib/include/vmxrpc.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/vmxrpc.h 2008-10-13 08:01:50.000000000 +0100 @@ -0,0 +1,267 @@ +/********************************************************* + * Copyright (C) 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. + * + *********************************************************/ + +/* + * vmxrpc.h -- + * + * VMware extensions to XDR types. Wrappers to allow the use of types declared + * in vm_basic_types.h in structures. + */ + +#ifndef _VMXRPC_H_ +#define _VMXRPC_H_ + +#include +#include +#include "vm_basic_types.h" + +/* + * glibc and Solaris headers seem to define functions for unsigned types with + * slightly different names than all other platforms. Provide macros to + * translate the names to the more common ones. + */ +#if defined(__GLIBC__) || defined(sun) +# define xdr_u_int16_t(x, i) xdr_uint16_t(x, i) +# define xdr_u_int32_t(x, i) xdr_uint32_t(x, i) +# define xdr_u_int64_t(x, i) xdr_uint64_t(x, i) +#endif + + +/* Wrapper around xdr_free that does casting automatically. */ +#define VMX_XDR_FREE(func, data) xdr_free((xdrproc_t)(func), (char *)(data)) + + +/* + *----------------------------------------------------------------------------- + * + * xdr_int8 -- + * + * XDR function for encoding/decoding int8. + * + * Results: + * Whether the call succeeded. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static INLINE bool_t +xdr_int8(XDR *xdrs, // IN + int8 *ip) // IN/OUT +{ + return xdr_char(xdrs, ip); +} + + +/* + *----------------------------------------------------------------------------- + * + * xdr_uint8 -- + * + * XDR function for encoding/decoding uint8. + * + * Results: + * Whether the call succeeded. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static INLINE bool_t +xdr_uint8(XDR *xdrs, // IN + uint8 *ip) // IN/OUT +{ + return xdr_u_char(xdrs, ip); +} + + +/* + *----------------------------------------------------------------------------- + * + * xdr_int16 -- + * + * XDR function for encoding/decoding int16. + * + * Results: + * Whether the call succeeded. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static INLINE bool_t +xdr_int16(XDR *xdrs, // IN + int16 *ip) // IN/OUT +{ + return xdr_int16_t(xdrs, ip); +} + + +/* + *----------------------------------------------------------------------------- + * + * xdr_uint16 -- + * + * XDR function for encoding/decoding uint16. + * + * Results: + * Whether the call succeeded. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static INLINE bool_t +xdr_uint16(XDR *xdrs, // IN + uint16 *ip) // IN/OUT +{ + return xdr_u_int16_t(xdrs, ip); +} + + +/* + *----------------------------------------------------------------------------- + * + * xdr_int32 -- + * + * XDR function for encoding/decoding int32. + * + * Results: + * Whether the call succeeded. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static INLINE bool_t +xdr_int32(XDR *xdrs, // IN + int32 *ip) // IN/OUT +{ + return xdr_int32_t(xdrs, ip); +} + + +/* + *----------------------------------------------------------------------------- + * + * xdr_uint32 -- + * + * XDR function for encoding/decoding uint32. + * + * Results: + * Whether the call succeeded. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static INLINE bool_t +xdr_uint32(XDR *xdrs, // IN + uint32 *ip) // IN/OUT +{ + return xdr_u_int32_t(xdrs, ip); +} + + +/* + *----------------------------------------------------------------------------- + * + * xdr_int64 -- + * + * XDR function for encoding/decoding int64. + * + * Results: + * Whether the call succeeded. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static INLINE bool_t +xdr_int64(XDR *xdrs, // IN + int64 *ip) // IN/OUT +{ + return xdr_int64_t(xdrs, ip); +} + + +/* + *----------------------------------------------------------------------------- + * + * xdr_uint64 -- + * + * XDR function for encoding/decoding uint64. + * + * Results: + * Whether the call succeeded. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static INLINE bool_t +xdr_uint64(XDR *xdrs, // IN + uint64 *ip) // IN/OUT +{ + return xdr_u_int64_t(xdrs, ip); +} + + +/* See vm_basic_types.h. X defines a different Bool. */ +#if !defined(__STRICT_ANSI__) || defined(__FreeBSD__) +/* + *----------------------------------------------------------------------------- + * + * xdr_Bool -- + * + * XDR function for encoding/decoding Bool. + * + * Results: + * Whether the call succeeded. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ +static INLINE bool_t +xdr_Bool(XDR *xdrs, // IN + Bool *ip) // IN/OUT +{ + return xdr_char(xdrs, ip); +} +#endif + +#endif /* _VMXRPC_H_ */ + diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/win32util.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/win32util.h --- open-vm-tools-2008.01.23-74039/lib/include/win32util.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/win32util.h 2008-10-13 08:01:50.000000000 +0100 @@ -0,0 +1,209 @@ +/********************************************************* + * Copyright (C) 1998 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 "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 */ + +Unicode W32Util_GetInstallPath(void); +Unicode W32Util_GetInstallPath64(void); + +/* + * The string returned is allocated on the heap and must be freed by the + * calling routine. + */ + + +Unicode W32Util_GetAppDataFilePath(ConstUnicode fileName); +Unicode W32Util_GetLocalAppDataFilePath(ConstUnicode fileName); + +Unicode W32Util_GetCommonAppDataFilePath(ConstUnicode fileName); +Unicode W32Util_GetVmwareCommonAppDataFilePath(ConstUnicode fileName); + +Unicode W32Util_GetMyDocumentPath(void); +Unicode W32Util_GetMyVideoPath(BOOL myDocumentsOnFail); + +Unicode W32Util_GetDefaultVMPath(ConstUnicode pref); +Unicode W32Util_GetInstalledFilePath(ConstUnicode fileName); +Unicode W32Util_GetInstalledFilePath64(ConstUnicode fileName); + +HKEY W32Util_OpenProductRegKey(REGSAM access); +HKEY W32Util_OpenUserRegKey(REGSAM access); + +LPTOP_LEVEL_EXCEPTION_FILTER W32Util_SetUnhandledExceptionFilter(void); + +/* + * Duplicated from util.h, including this header introduces + * other problems such as dependencies on vm_assert.h, as well + * as redefining Windows macros in windows-specific files. + * So we define it here also. + */ + +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 + +Unicode W32Util_RealPath(ConstUnicode path); + +BOOL W32Util_CheckForPrivilegeHeld(HANDLE token, LPCTSTR priv); + +typedef BOOL (*SidFilterFunction)(PSID psid, void *cbData); +BOOL W32Util_GetEffectiveRightsForName(ConstUnicode user, + ConstUnicode path, + DWORD *rights); +BOOL W32Util_GetEffectiveRightsForSid(PSID psid, + ConstUnicode path, + DWORD *rights); + +BOOL W32Util_ModifyRights(PSID psid, + ConstUnicode path, + DWORD rights, + BOOL isAllow); +void W32Util_FreeSids(PSID *sidList); +BOOL W32Util_GetMatchingSids(ConstUnicode 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, + ConstUnicode name, + ConstUnicode displayName, + ConstUnicode description, + ConstUnicode binaryPath, + Unicode *errString); + +Bool W32Util_DebugService(ConstUnicode dbgFile); + +Bool W32Util_RegisterEventLog(ConstUnicode serviceName, + DWORD typesSupported, + ConstUnicode eventMsgFile, + ConstUnicode categoryMsgFile, + DWORD categoryCount, + ConstUnicode paramMsgFile); +Bool W32Util_UnregisterEventLog(ConstUnicode serviceName); + +Bool W32Util_SetSDWithVmGroupPriv(PSECURITY_DESCRIPTOR pSecurityDescriptor, + DWORD accessType, PACL *pAcl, + Unicode *errString); + +Bool W32Util_SetSDWithVmGroupPrivEx(PSECURITY_DESCRIPTOR pSecurityDescriptor, + DWORD accessType, Bool addCurrentUser, + PACL *pAcl, Unicode *errString); + +BOOL W32Util_SetSecurityDescriptorW(PSECURITY_DESCRIPTOR pSecurityDescriptor, + ConstUnicode 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(ConstUnicode filename, ACCESS_MASK desiredAccess, + HANDLE token); + +Bool W32Util_GetSecurityDescriptor(ConstUnicode 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_GetLocalAdminGroupSid(PSID *pSid); +Bool W32Util_MakeSafeDirectory(ConstUnicode path); +Bool W32Util_IsDirectorySafe(ConstUnicode path); +Bool W32Util_DoesVolumeSupportAcls(ConstUnicode path); + +Bool W32Util_GetRegistryAutorun(AutorunState* state); +Bool W32Util_SetRegistryAutorun(const AutorunState state); + +Bool W32Util_AllowAdminCOM(void); + +Unicode W32Util_GetAppDataPath(void); +Unicode W32Util_RobustGetLongPath(ConstUnicode 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); + +#endif // _WIN32 +#endif // WIN32UTIL_H_ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/wiper.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/wiper.h --- open-vm-tools-2008.01.23-74039/lib/include/wiper.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/wiper.h 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -47,6 +47,7 @@ /* Max size of a path */ #define NATIVE_MAX_PATH 256 +#define MAX_WIPER_FILE_SIZE (2 << 30) /* The maximum wiper file size in bytes */ typedef struct WiperPartition { unsigned char mountPoint[NATIVE_MAX_PATH]; diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/x86cpuid.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/x86cpuid.h --- open-vm-tools-2008.01.23-74039/lib/include/x86cpuid.h 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/x86cpuid.h 2008-10-13 08:01:50.000000000 +0100 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998 VMware, Inc. All rights reserved. + * Copyright (C) 1998-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 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -54,17 +54,36 @@ } CPUIDRegsUnion; /* - * Results of calling cpuid(eaxArg) on all logical processors. + * Results of calling cpuid(eax, ecx) on all host logical CPU. */ #ifdef _MSC_VER #pragma warning (disable :4200) // non-std extension: zero-sized array in struct #endif -typedef struct CPUIDResult { - uint32 numLogicalCPUs; - uint32 eaxArg; - CPUIDRegs regs[0]; -} CPUIDResult; +typedef +#include "vmware_pack_begin.h" +struct CPUIDReply { + /* + * Unique host logical CPU identifier. It does not change across queries, so + * we use it to correlate the replies of multiple queries. + */ + uint64 tag; // OUT + + CPUIDRegs regs; // OUT +} +#include "vmware_pack_end.h" +CPUIDReply; + +typedef +#include "vmware_pack_begin.h" +struct CPUIDQuery { + uint32 eax; // IN + uint32 ecx; // IN + uint32 numLogicalCPUs; // IN/OUT + CPUIDReply logicalCPUs[0]; // OUT +} +#include "vmware_pack_end.h" +CPUIDQuery; /* * CPUID levels the monitor caches and ones that are not cached, but @@ -83,6 +102,8 @@ #define CPUID_CACHED_LEVELS \ CPUIDLEVEL(TRUE, 0, 0) \ CPUIDLEVEL(TRUE, 1, 1) \ + CPUIDLEVEL(FALSE,400, 0x40000000) \ + CPUIDLEVEL(FALSE,410, 0x40000010) \ CPUIDLEVEL(FALSE, 80, 0x80000000) \ CPUIDLEVEL(TRUE, 81, 0x80000001) \ CPUIDLEVEL(FALSE, 88, 0x80000008) \ @@ -90,6 +111,8 @@ #define CPUID_UNCACHED_LEVELS \ CPUIDLEVEL(FALSE, 4, 4) \ + CPUIDLEVEL(FALSE, 5, 5) \ + CPUIDLEVEL(FALSE, 6, 6) \ CPUIDLEVEL(FALSE, A, 0xA) \ CPUIDLEVEL(FALSE, 86, 0x80000006) \ CPUIDLEVEL(FALSE, 87, 0x80000007) \ @@ -128,21 +151,23 @@ */ typedef enum { + CPUID_VENDOR_UNKNOWN, CPUID_VENDOR_COMMON, CPUID_VENDOR_INTEL, CPUID_VENDOR_AMD, CPUID_VENDOR_CYRIX, - CPUID_VENDOR_UNKNOWN, CPUID_NUM_VENDORS } CpuidVendors; #define CPUID_INTEL_VENDOR_STRING "GenuntelineI" #define CPUID_AMD_VENDOR_STRING "AuthcAMDenti" #define CPUID_CYRIX_VENDOR_STRING "CyriteadxIns" +#define CPUID_HYPERV_HYPERVISOR_VENDOR_STRING "Microsoft Hv" #define CPUID_INTEL_VENDOR_STRING_FIXED "GenuineIntel" #define CPUID_AMD_VENDOR_STRING_FIXED "AuthenticAMD" #define CPUID_CYRIX_VENDOR_STRING_FIXED "CyrixInstead" +#define CPUID_HYPERV_HYPERVISOR_VENDOR_STRING "Microsoft Hv" /* * FIELDDEF can be defined to process the CPUID information provided @@ -207,179 +232,233 @@ CPUID_NUM_FIELD_MASKS } CpuidFieldMasks; -/* LEVEL, REG, VENDOR, POS, SIZE, NAME, MASK TYPE, SET TO, [FUNC] */ + +typedef enum { + CPUID_FIELD_SUPPORTED_NO, + CPUID_FIELD_SUPPORTED_YES, + CPUID_FIELD_SUPPORTED_ANY, + CPUID_FIELD_SUPPORTED_NA, + CPUID_NUM_FIELD_SUPPORTEDS +} CpuidFieldSupported; + + +/* LEVEL, REG, VENDOR, POS, SIZE, NAME, MON SUPP, MASK TYPE, SET TO, CPL3, [FUNC] */ #define CPUID_FIELD_DATA_LEVEL_0 \ -FIELDDEF( 0, EAX, COMMON, 0, 32, NUMLEVELS, IGNORE, 0) \ -FIELDDEF( 0, EBX, COMMON, 0, 32, VENDOR1, HOST, 0) \ -FIELDDEF( 0, ECX, COMMON, 0, 32, VENDOR3, HOST, 0) \ -FIELDDEF( 0, EDX, COMMON, 0, 32, VENDOR2, HOST, 0) +FIELDDEF( 0, EAX, COMMON, 0, 32, NUMLEVELS, ANY, IGNORE, 0, FALSE) \ +FIELDDEF( 0, EBX, COMMON, 0, 32, VENDOR1, YES, HOST, 0, TRUE) \ +FIELDDEF( 0, ECX, COMMON, 0, 32, VENDOR3, YES, HOST, 0, TRUE) \ +FIELDDEF( 0, EDX, COMMON, 0, 32, VENDOR2, YES, HOST, 0, TRUE) -/* LEVEL, REG, VENDOR, POS, SIZE, NAME, MASK TYPE, SET TO, [FUNC] */ +/* LEVEL, REG, VENDOR, POS, SIZE, NAME, MON SUPP, MASK TYPE, SET TO, CPL3, [FUNC] */ #define CPUID_FIELD_DATA_LEVEL_1 \ -FIELDDEFA( 1, EAX, COMMON, 0, 4, STEPPING, IGNORE, 0, STEPPING) \ -FIELDDEFA( 1, EAX, COMMON, 4, 4, MODEL, IGNORE, 0, MODEL) \ -FIELDDEFA( 1, EAX, COMMON, 8, 4, FAMILY, HOST, 0, FAMILY) \ -FIELDDEF( 1, EAX, COMMON, 12, 2, TYPE, IGNORE, 0) \ -FIELDDEFA( 1, EAX, COMMON, 16, 4, EXTMODEL, IGNORE, 0, EXT_MODEL) \ -FIELDDEFA( 1, EAX, COMMON, 20, 8, EXTFAMILY, HOST, 0, EXT_FAMILY) \ -FIELDDEF( 1, EBX, COMMON, 0, 8, BRAND_ID, IGNORE, 0) \ -FIELDDEF( 1, EBX, COMMON, 8, 8, CLFL_SIZE, IGNORE, 0) \ -FIELDDEFA( 1, EBX, COMMON, 16, 8, LCPU_COUNT, IGNORE, 0, LCPU_COUNT) \ -FIELDDEFA( 1, EBX, COMMON, 24, 8, APICID, IGNORE, 0, APICID) \ -FLAGDEFA( 1, ECX, COMMON, 0, 1, SSE3, HOST, 0, SSE3) \ -FLAGDEFA( 1, ECX, INTEL, 3, 1, MWAIT, MASK, 0, MWAIT) \ -FLAGDEF( 1, ECX, INTEL, 4, 1, DSCPL, HOST, 0) \ -FLAGDEFA( 1, ECX, INTEL, 5, 1, VMX, MASK, 0, VMX) \ -FLAGDEF( 1, ECX, INTEL, 6, 1, SMX, MASK, 0) \ -FLAGDEF( 1, ECX, INTEL, 7, 1, EST, MASK, 0) \ -FLAGDEF( 1, ECX, INTEL, 8, 1, TM2, MASK, 0) \ -FLAGDEFA( 1, ECX, COMMON, 9, 1, SSSE3, HOST, 0, SSSE3) \ -FLAGDEF( 1, ECX, INTEL, 10, 1, HTCACHE, MASK, 0) \ -FLAGDEFA( 1, ECX, COMMON, 13, 1, CMPX16, HOST, 0, CMPX16) \ -FLAGDEF( 1, ECX, INTEL, 14, 1, xPPR, MASK, 0) \ -FLAGDEF( 1, ECX, INTEL, 15, 1, PERF_MSR, MASK, 0) \ -FLAGDEF( 1, ECX, INTEL, 16, 1, NDA16, MASK, 0) \ -FLAGDEF( 1, ECX, INTEL, 18, 1, DCA, MASK, 0) \ -FLAGDEFA( 1, ECX, INTEL, 19, 1, SSE41, HOST, 0, SSE41) \ -FLAGDEFA( 1, ECX, INTEL, 20, 1, SSE42, HOST, 0, SSE42) \ -FLAGDEFA( 1, ECX, COMMON, 23, 1, POPCNT, HOST, 0, POPCNT) \ -FLAGDEFA( 1, EDX, COMMON, 0, 1, FPU, HOST, 0, FPU) \ -FLAGDEFA( 1, EDX, COMMON, 1, 1, VME, HOST, 0, VME) \ -FLAGDEF( 1, EDX, COMMON, 2, 1, DBGE, HOST, 0) \ -FLAGDEF( 1, EDX, COMMON, 3, 1, PGSZE, HOST, 0) \ -FLAGDEFA( 1, EDX, COMMON, 4, 1, TSC, HOST, 0, TSC) \ -FLAGDEF( 1, EDX, COMMON, 5, 1, MSR, HOST, 0) \ -FLAGDEFA( 1, EDX, COMMON, 6, 1, PAE, HOST, 0, PAE) \ -FLAGDEF( 1, EDX, COMMON, 7, 1, MCK, HOST, 0) \ -FLAGDEF( 1, EDX, COMMON, 8, 1, CPMX, HOST, 0) \ -FLAGDEFA( 1, EDX, COMMON, 9, 1, APIC, MASK, 1, APIC) \ -FLAGDEFA( 1, EDX, COMMON, 11, 1, SEP, HOST, 0, SEP) \ -FLAGDEFA( 1, EDX, COMMON, 12, 1, MTRR, HOST, 0, MTRR) \ -FLAGDEFA( 1, EDX, COMMON, 13, 1, PGE, HOST, 0, PGE) \ -FLAGDEFA( 1, EDX, COMMON, 14, 1, MCA, HOST, 0, MCA) \ -FLAGDEFA( 1, EDX, COMMON, 15, 1, CMOV, HOST, 0, CMOV) \ -FLAGDEFA( 1, EDX, COMMON, 16, 1, PAT, HOST, 0, PAT) \ -FLAGDEF( 1, EDX, COMMON, 17, 1, 36PG, HOST, 0) \ -FLAGDEF( 1, EDX, INTEL, 18, 1, PSN, HOST, 0) \ -FLAGDEFA( 1, EDX, COMMON, 19, 1, CLFL, HOST, 0, CLFL) \ -FLAGDEF( 1, EDX, INTEL, 21, 1, DTES, HOST, 0) \ -FLAGDEF( 1, EDX, INTEL, 22, 1, ACPI, HOST, 0) \ -FLAGDEFA( 1, EDX, COMMON, 23, 1, MMX, HOST, 0, MMX) \ -FLAGDEFA( 1, EDX, COMMON, 24, 1, FXSAVE, HOST, 0, FXSAVE) \ -FLAGDEFA( 1, EDX, COMMON, 25, 1, SSE, HOST, 0, SSE) \ -FLAGDEFA( 1, EDX, COMMON, 26, 1, SSE2, HOST, 0, SSE2) \ -FLAGDEF( 1, EDX, INTEL, 27, 1, SS, HOST, 0) \ -FLAGDEFA( 1, EDX, COMMON, 28, 1, HT, MASK, 0, HT) \ -FLAGDEF( 1, EDX, INTEL, 29, 1, TM, MASK, 0) \ -FLAGDEF( 1, EDX, INTEL, 30, 1, IA64, MASK, 0) \ -FLAGDEF( 1, EDX, INTEL, 31, 1, PBE, MASK, 0) +FIELDDEFA( 1, EAX, COMMON, 0, 4, STEPPING, ANY, IGNORE, 0, FALSE, STEPPING) \ +FIELDDEFA( 1, EAX, COMMON, 4, 4, MODEL, ANY, IGNORE, 0, FALSE, MODEL) \ +FIELDDEFA( 1, EAX, COMMON, 8, 4, FAMILY, YES, HOST, 0, FALSE, FAMILY) \ +FIELDDEF( 1, EAX, COMMON, 12, 2, TYPE, ANY, IGNORE, 0, FALSE) \ +FIELDDEFA( 1, EAX, COMMON, 16, 4, EXTMODEL, ANY, IGNORE, 0, FALSE, EXT_MODEL) \ +FIELDDEFA( 1, EAX, COMMON, 20, 8, EXTFAMILY, YES, HOST, 0, FALSE, EXT_FAMILY) \ +FIELDDEF( 1, EBX, COMMON, 0, 8, BRAND_ID, ANY, IGNORE, 0, FALSE) \ +FIELDDEF( 1, EBX, COMMON, 8, 8, CLFL_SIZE, ANY, IGNORE, 0, FALSE) \ +FIELDDEFA( 1, EBX, COMMON, 16, 8, LCPU_COUNT, ANY, IGNORE, 0, FALSE, LCPU_COUNT) \ +FIELDDEFA( 1, EBX, COMMON, 24, 8, APICID, ANY, IGNORE, 0, FALSE, APICID) \ +FLAGDEFA( 1, ECX, COMMON, 0, 1, SSE3, YES, HOST, 0, TRUE, SSE3) \ +FLAGDEF( 1, ECX, INTEL, 2, 1, NDA2, NO, MASK, 0, FALSE) \ +FLAGDEFA( 1, ECX, COMMON, 3, 1, MWAIT, NO, MASK, 0, FALSE, MWAIT) \ +FLAGDEFA( 1, ECX, INTEL, 4, 1, DSCPL, NO, MASK, 0, FALSE, DSCPL) \ +FLAGDEFA( 1, ECX, INTEL, 5, 1, VMX, NO, MASK, 0, FALSE, VMX) \ +FLAGDEF( 1, ECX, INTEL, 6, 1, SMX, NO, MASK, 0, FALSE) \ +FLAGDEF( 1, ECX, INTEL, 7, 1, EST, NO, MASK, 0, FALSE) \ +FLAGDEF( 1, ECX, INTEL, 8, 1, TM2, NO, MASK, 0, FALSE) \ +FLAGDEFA( 1, ECX, COMMON, 9, 1, SSSE3, YES, HOST, 0, TRUE, SSSE3) \ +FLAGDEF( 1, ECX, INTEL, 10, 1, HTCACHE, NO, MASK, 0, FALSE) \ +FLAGDEFA( 1, ECX, COMMON, 13, 1, CMPX16, YES, HOST, 0, TRUE, CMPX16) \ +FLAGDEF( 1, ECX, INTEL, 14, 1, xPPR, NO, MASK, 0, FALSE) \ +FLAGDEF( 1, ECX, INTEL, 15, 1, PERF_MSR, NO, MASK, 0, FALSE) \ +FLAGDEF( 1, ECX, INTEL, 18, 1, DCA, NO, MASK, 0, FALSE) \ +FLAGDEFA( 1, ECX, INTEL, 19, 1, SSE41, YES, HOST, 0, TRUE, SSE41) \ +FLAGDEFA( 1, ECX, INTEL, 20, 1, SSE42, YES, HOST, 0, TRUE, SSE42) \ +FLAGDEF( 1, ECX, INTEL, 21, 1, X2APIC, NO, MASK, 0, FALSE) \ +FLAGDEF( 1, ECX, INTEL, 22, 1, MOVBE, NO, RSVD, 0, TRUE) \ +FLAGDEFA( 1, ECX, COMMON, 23, 1, POPCNT, YES, HOST, 0, TRUE, POPCNT) \ +FLAGDEF( 1, ECX, INTEL, 24, 1, ULE, NO, RSVD, 0, TRUE) \ +FLAGDEF( 1, ECX, INTEL, 26, 1, XSAVE, NO, MASK, 0, FALSE) \ +FLAGDEF( 1, ECX, INTEL, 27, 1, OSXSAVE, NO, RSVD, 0, TRUE) \ +FLAGDEFA( 1, ECX, COMMON, 31, 1, HYPERVISOR, ANY, IGNORE, 0, FALSE, HYPERVISOR)\ +FLAGDEFA( 1, EDX, COMMON, 0, 1, FPU, YES, HOST, 0, TRUE, FPU) \ +FLAGDEFA( 1, EDX, COMMON, 1, 1, VME, YES, HOST, 0, FALSE, VME) \ +FLAGDEF( 1, EDX, COMMON, 2, 1, DBGE, YES, HOST, 0, FALSE) \ +FLAGDEF( 1, EDX, COMMON, 3, 1, PGSZE, YES, HOST, 0, FALSE) \ +FLAGDEFA( 1, EDX, COMMON, 4, 1, TSC, YES, HOST, 0, TRUE, TSC) \ +FLAGDEF( 1, EDX, COMMON, 5, 1, MSR, YES, HOST, 0, FALSE) \ +FLAGDEFA( 1, EDX, COMMON, 6, 1, PAE, YES, HOST, 0, FALSE, PAE) \ +FLAGDEF( 1, EDX, COMMON, 7, 1, MCK, YES, HOST, 0, FALSE) \ +FLAGDEF( 1, EDX, COMMON, 8, 1, CPMX, YES, HOST, 0, TRUE) \ +FLAGDEFA( 1, EDX, COMMON, 9, 1, APIC, ANY, MASK, 1, FALSE, APIC) \ +FLAGDEFA( 1, EDX, COMMON, 11, 1, SEP, YES, HOST, 0, TRUE, SEP) \ +FLAGDEFA( 1, EDX, COMMON, 12, 1, MTRR, YES, HOST, 0, FALSE, MTRR) \ +FLAGDEFA( 1, EDX, COMMON, 13, 1, PGE, YES, HOST, 0, FALSE, PGE) \ +FLAGDEFA( 1, EDX, COMMON, 14, 1, MCA, YES, HOST, 0, FALSE, MCA) \ +FLAGDEFA( 1, EDX, COMMON, 15, 1, CMOV, YES, HOST, 0, TRUE, CMOV) \ +FLAGDEFA( 1, EDX, COMMON, 16, 1, PAT, YES, HOST, 0, FALSE, PAT) \ +FLAGDEF( 1, EDX, COMMON, 17, 1, 36PG, YES, HOST, 0, FALSE) \ +FLAGDEF( 1, EDX, INTEL, 18, 1, PSN, YES, HOST, 0, FALSE) \ +FLAGDEFA( 1, EDX, COMMON, 19, 1, CLFL, YES, HOST, 0, TRUE, CLFL) \ +FLAGDEF( 1, EDX, INTEL, 21, 1, DTES, YES, HOST, 0, FALSE) \ +FLAGDEF( 1, EDX, INTEL, 22, 1, ACPI, YES, HOST, 0, FALSE) \ +FLAGDEFA( 1, EDX, COMMON, 23, 1, MMX, YES, HOST, 0, TRUE, MMX) \ +FLAGDEFA( 1, EDX, COMMON, 24, 1, FXSAVE, YES, HOST, 0, TRUE, FXSAVE) \ +FLAGDEFA( 1, EDX, COMMON, 25, 1, SSE, YES, HOST, 0, TRUE, SSE) \ +FLAGDEFA( 1, EDX, COMMON, 26, 1, SSE2, YES, HOST, 0, TRUE, SSE2) \ +FLAGDEF( 1, EDX, INTEL, 27, 1, SS, YES, HOST, 0, FALSE) \ +FLAGDEFA( 1, EDX, COMMON, 28, 1, HT, NO, MASK, 0, FALSE, HT) \ +FLAGDEF( 1, EDX, INTEL, 29, 1, TM, NO, MASK, 0, FALSE) \ +FLAGDEF( 1, EDX, INTEL, 30, 1, IA64, NO, MASK, 0, FALSE) \ +FLAGDEF( 1, EDX, INTEL, 31, 1, PBE, NO, MASK, 0, FALSE) -/* LEVEL, REG, VENDOR, POS, SIZE, NAME, MASK TYPE, SET TO, [FUNC] */ +/* LEVEL, REG, VENDOR, POS, SIZE, NAME, MON SUPP, MASK TYPE, SET TO, CPL3, [FUNC] */ #define CPUID_FIELD_DATA_LEVEL_4 \ -FIELDDEF( 4, EAX, INTEL, 0, 5, CACHE_TYPE, IGNORE, 0) \ -FIELDDEF( 4, EAX, INTEL, 5, 3, CACHE_LEVEL, IGNORE, 0) \ -FIELDDEF( 4, EAX, INTEL, 14, 12, CACHE_NUMHT_SHARING, IGNORE, 0) \ -FIELDDEFA( 4, EAX, INTEL, 26, 6, CORE_COUNT, IGNORE, 0, INTEL_CORE_COUNT) \ -FIELDDEF( 4, EBX, INTEL, 0, 12, CACHE_LINE, IGNORE, 0) \ -FIELDDEF( 4, EBX, INTEL, 12, 10, CACHE_PART, IGNORE, 0) \ -FIELDDEF( 4, EBX, INTEL, 22, 10, CACHE_WAYS, IGNORE, 0) +FIELDDEF( 4, EAX, INTEL, 0, 5, CACHE_TYPE, NA, IGNORE, 0, FALSE) \ +FIELDDEF( 4, EAX, INTEL, 5, 3, CACHE_LEVEL, NA, IGNORE, 0, FALSE) \ +FIELDDEF( 4, EAX, INTEL, 14, 12, CACHE_NUMHT_SHARING, NA, IGNORE, 0, FALSE) \ +FIELDDEFA( 4, EAX, INTEL, 26, 6, CORE_COUNT, NA, IGNORE, 0, FALSE, INTEL_CORE_COUNT) \ +FIELDDEF( 4, EBX, INTEL, 0, 12, CACHE_LINE, NA, IGNORE, 0, FALSE) \ +FIELDDEF( 4, EBX, INTEL, 12, 10, CACHE_PART, NA, IGNORE, 0, FALSE) \ +FIELDDEF( 4, EBX, INTEL, 22, 10, CACHE_WAYS, NA, IGNORE, 0, FALSE) + +/* LEVEL, REG, VENDOR, POS, SIZE, NAME, MON SUPP, MASK TYPE, SET TO, CPL3, [FUNC] */ +#define CPUID_FIELD_DATA_LEVEL_5 \ +FIELDDEF( 5, EAX, COMMON, 0, 16, MWAIT_MIN_SIZE, NA, IGNORE, 0, FALSE) \ +FIELDDEF( 5, EBX, COMMON, 0, 16, MWAIT_MAX_SIZE, NA, IGNORE, 0, FALSE) \ +FLAGDEF( 5, ECX, COMMON, 0, 1, MWAIT_EXTENSIONS, NA, IGNORE, 0, FALSE) \ +FLAGDEF( 5, ECX, COMMON, 1, 1, MWAIT_INTR_BREAK, NA, IGNORE, 0, FALSE) \ +FIELDDEF( 5, EDX, INTEL, 0, 4, MWAIT_C0_SUBSTATE, NA, IGNORE, 0, FALSE) \ +FIELDDEF( 5, EDX, INTEL, 4, 4, MWAIT_C1_SUBSTATE, NA, IGNORE, 0, FALSE) \ +FIELDDEF( 5, EDX, INTEL, 8, 4, MWAIT_C2_SUBSTATE, NA, IGNORE, 0, FALSE) \ +FIELDDEF( 5, EDX, INTEL, 12, 4, MWAIT_C3_SUBSTATE, NA, IGNORE, 0, FALSE) \ +FIELDDEF( 5, EDX, INTEL, 16, 4, MWAIT_C4_SUBSTATE, NA, IGNORE, 0, FALSE) + +/* LEVEL, REG, VENDOR, POS, SIZE, NAME, MON SUPP, MASK TYPE, SET TO, CPL3, [FUNC] */ +#define CPUID_FIELD_DATA_LEVEL_6 \ +FLAGDEF( 6, EAX, INTEL, 0, 1, THERMAL_SENSOR, NA, IGNORE, 0, FALSE) \ +FLAGDEF( 6, EAX, INTEL, 1, 1, TURBO_MODE, NA, IGNORE, 0, FALSE) \ +FIELDDEF( 6, EBX, INTEL, 0, 4, NUM_INTR_THRESHOLDS, NA, IGNORE, 0, FALSE) \ +FLAGDEF( 6, ECX, INTEL, 0, 1, HW_COORD_FEEDBACK, NA, IGNORE, 0, FALSE) -/* LEVEL, REG, VENDOR, POS, SIZE, NAME, MASK TYPE, SET TO, [FUNC] */ +/* LEVEL, REG, VENDOR, POS, SIZE, NAME, MON SUPP, MASK TYPE, SET TO, CPL3, [FUNC] */ #define CPUID_FIELD_DATA_LEVEL_A \ -FIELDDEF( A, EAX, INTEL, 0, 8, PMC_VERSION, IGNORE, 0) \ -FIELDDEFA( A, EAX, INTEL, 8, 8, NUM_PMCS, IGNORE, 0, NUM_PMCS) \ -FIELDDEF( A, EAX, INTEL, 16, 8, PMC_BIT_WIDTH, IGNORE, 0) \ -FIELDDEF( A, EAX, INTEL, 24, 8, PMC_EBX_LENGTH, IGNORE, 0) \ -FLAGDEF( A, EBX, INTEL, 0, 1, PMC_CORE_CYCLE, IGNORE, 0) \ -FLAGDEF( A, EBX, INTEL, 1, 1, PMC_INSTR_RETIRED, IGNORE, 0) \ -FLAGDEF( A, EBX, INTEL, 2, 1, PMC_REF_CYCLES, IGNORE, 0) \ -FLAGDEF( A, EBX, INTEL, 3, 1, PMC_LAST_LVL_CREF, IGNORE, 0) \ -FLAGDEF( A, EBX, INTEL, 4, 1, PMC_LAST_LVL_CMISS, IGNORE, 0) \ -FLAGDEF( A, EBX, INTEL, 5, 1, PMC_BR_INST_RETIRED, IGNORE, 0) \ -FLAGDEF( A, EBX, INTEL, 6, 1, PMC_BR_MISS_RETIRED, IGNORE, 0) +FIELDDEFA( A, EAX, INTEL, 0, 8, PMC_VERSION, NA, IGNORE, 0, FALSE, PMC_VERSION) \ +FIELDDEFA( A, EAX, INTEL, 8, 8, NUM_PMCS, NA, IGNORE, 0, FALSE, NUM_PMCS) \ +FIELDDEF( A, EAX, INTEL, 16, 8, PMC_BIT_WIDTH, NA, IGNORE, 0, FALSE) \ +FIELDDEFA( A, EAX, INTEL, 24, 8, PMC_EBX_LENGTH, NA, IGNORE, 0, FALSE, PMC_EBX_LENGTH) \ +FLAGDEF( A, EBX, INTEL, 0, 1, PMC_CORE_CYCLE, NA, IGNORE, 0, FALSE) \ +FLAGDEF( A, EBX, INTEL, 1, 1, PMC_INSTR_RETIRED, NA, IGNORE, 0, FALSE) \ +FLAGDEF( A, EBX, INTEL, 2, 1, PMC_REF_CYCLES, NA, IGNORE, 0, FALSE) \ +FLAGDEF( A, EBX, INTEL, 3, 1, PMC_LAST_LVL_CREF, NA, IGNORE, 0, FALSE) \ +FLAGDEF( A, EBX, INTEL, 4, 1, PMC_LAST_LVL_CMISS, NA, IGNORE, 0, FALSE) \ +FLAGDEF( A, EBX, INTEL, 5, 1, PMC_BR_INST_RETIRED, NA, IGNORE, 0, FALSE) \ +FLAGDEF( A, EBX, INTEL, 6, 1, PMC_BR_MISS_RETIRED, NA, IGNORE, 0, FALSE) -/* LEVEL, REG, VENDOR, POS, SIZE, NAME, MASK TYPE, SET TO, [FUNC] */ +/* LEVEL, REG, VENDOR, POS, SIZE, NAME, MON SUPP, MASK TYPE, SET TO, CPL3, [FUNC] */ #define CPUID_FIELD_DATA_LEVEL_80 \ -FIELDDEF( 80, EAX, COMMON, 0, 32, NUM_EXT_LEVELS, IGNORE, 0) \ -FIELDDEF( 80, EBX, AMD, 0, 32, AMD_VENDOR1, IGNORE, 0) \ -FIELDDEF( 80, ECX, AMD, 0, 32, AMD_VENDOR3, IGNORE, 0) \ -FIELDDEF( 80, EDX, AMD, 0, 32, AMD_VENDOR2, IGNORE, 0) +FIELDDEF( 80, EAX, COMMON, 0, 32, NUM_EXT_LEVELS, NA, IGNORE, 0, FALSE) \ +FIELDDEF( 80, EBX, AMD, 0, 32, AMD_VENDOR1, NA, IGNORE, 0, FALSE) \ +FIELDDEF( 80, ECX, AMD, 0, 32, AMD_VENDOR3, NA, IGNORE, 0, FALSE) \ +FIELDDEF( 80, EDX, AMD, 0, 32, AMD_VENDOR2, NA, IGNORE, 0, FALSE) -/* LEVEL, REG, VENDOR, POS, SIZE, NAME, MASK TYPE, SET TO, [FUNC] */ +/* LEVEL, REG, VENDOR, POS, SIZE, NAME, MON SUPP, MASK TYPE, SET TO, CPL3, [FUNC] */ #define CPUID_FIELD_DATA_LEVEL_81 \ -FIELDDEF( 81, EAX, INTEL, 0, 32, UNKNOWN81EAX, IGNORE, 0) \ -FIELDDEF( 81, EAX, AMD, 0, 4, STEPPING, IGNORE, 0) \ -FIELDDEF( 81, EAX, AMD, 4, 4, MODEL, IGNORE, 0) \ -FIELDDEF( 81, EAX, AMD, 8, 4, FAMILY, IGNORE, 0) \ -FIELDDEF( 81, EAX, AMD, 12, 2, TYPE, IGNORE, 0) \ -FIELDDEF( 81, EAX, AMD, 16, 4, EXTMODEL, IGNORE, 0) \ -FIELDDEF( 81, EAX, AMD, 20, 8, EXTFAMILY, IGNORE, 0) \ -FIELDDEF( 81, EBX, INTEL, 0, 32, UNKNOWN81EBX, IGNORE, 0) \ -FIELDDEF( 81, EBX, AMD, 0, 16, BRAND_ID, IGNORE, 0) \ -FIELDDEF( 81, EBX, AMD, 16, 16, UNDEF, IGNORE, 0) \ -FLAGDEFA( 81, ECX, COMMON, 0, 1, LAHF, HOST, 0, LAHF64) \ -FLAGDEFA( 81, ECX, AMD, 1, 1, CMPLEGACY, MASK, 0, CMPLEGACY) \ -FLAGDEFA( 81, ECX, AMD, 2, 1, SVM, MASK, 0, SVM) \ -FLAGDEFA( 81, ECX, AMD, 3, 1, EXTAPICSPC, HOST, 0, EXTAPICSPC) \ -FLAGDEFA( 81, ECX, AMD, 4, 1, CR8AVAIL, MASK, 0, CR8AVAIL) \ -FLAGDEFA( 81, ECX, AMD, 5, 1, ABM, HOST, 0, ABM) \ -FLAGDEFA( 81, ECX, AMD, 6, 1, SSE4A, HOST, 0, SSE4A) \ -FLAGDEF( 81, ECX, AMD, 7, 1, MISALIGNED_SSE, HOST, 0) \ -FLAGDEF( 81, ECX, AMD, 8, 1, 3DNPREFETCH, HOST, 0) \ -FLAGDEF( 81, EDX, AMD, 0, 1, FPU, HOST, 0) \ -FLAGDEF( 81, EDX, AMD, 1, 1, VME, HOST, 0) \ -FLAGDEF( 81, EDX, AMD, 2, 1, DBGE, HOST, 0) \ -FLAGDEF( 81, EDX, AMD, 3, 1, PGSZE, HOST, 0) \ -FLAGDEF( 81, EDX, AMD, 4, 1, TSC, HOST, 0) \ -FLAGDEF( 81, EDX, AMD, 5, 1, MSR, HOST, 0) \ -FLAGDEF( 81, EDX, AMD, 6, 1, PAE, HOST, 0) \ -FLAGDEF( 81, EDX, AMD, 7, 1, MCK, HOST, 0) \ -FLAGDEF( 81, EDX, AMD, 8, 1, CPMX, HOST, 0) \ -FLAGDEF( 81, EDX, AMD, 9, 1, APIC, MASK, 1) \ -FLAGDEFA( 81, EDX, COMMON, 11, 1, SYSC, IGNORE, 0, SYSC) \ -FLAGDEF( 81, EDX, AMD, 12, 1, MTRR, HOST, 0) \ -FLAGDEF( 81, EDX, AMD, 13, 1, PGE, HOST, 0) \ -FLAGDEF( 81, EDX, AMD, 14, 1, MCA, HOST, 0) \ -FLAGDEF( 81, EDX, AMD, 15, 1, CMOV, HOST, 0) \ -FLAGDEF( 81, EDX, AMD, 16, 1, PAT, HOST, 0) \ -FLAGDEF( 81, EDX, AMD, 17, 1, 36PG, HOST, 0) \ -FLAGDEFA( 81, EDX, COMMON, 20, 1, NX, HOST, 0, NX) \ -FLAGDEFA( 81, EDX, AMD, 22, 1, MMXEXT, HOST, 0, MMXEXT) \ -FLAGDEF( 81, EDX, AMD, 23, 1, MMX, HOST, 0) \ -FLAGDEF( 81, EDX, AMD, 24, 1, FXSAVE, HOST, 0) \ -FLAGDEFA( 81, EDX, AMD, 25, 1, FFXSR, HOST, 0, FFXSR) \ -FLAGDEF( 81, EDX, AMD, 26, 1, PDPE1GB, MASK, 0) \ -FLAGDEFA( 81, EDX, COMMON, 27, 1, RDTSCP, HOST, 0, RDTSCP) \ -FLAGDEFA( 81, EDX, COMMON, 29, 1, LM, TEST, 1, LM) \ -FLAGDEFA( 81, EDX, AMD, 30, 1, 3DNOWPLUS, HOST, 0, 3DNOWPLUS) \ -FLAGDEFA( 81, EDX, AMD, 31, 1, 3DNOW, HOST, 0, 3DNOW) +FIELDDEF( 81, EAX, INTEL, 0, 32, UNKNOWN81EAX, ANY, IGNORE, 0, FALSE) \ +FIELDDEF( 81, EAX, AMD, 0, 4, STEPPING, ANY, IGNORE, 0, FALSE) \ +FIELDDEF( 81, EAX, AMD, 4, 4, MODEL, ANY, IGNORE, 0, FALSE) \ +FIELDDEF( 81, EAX, AMD, 8, 4, FAMILY, ANY, IGNORE, 0, FALSE) \ +FIELDDEF( 81, EAX, AMD, 12, 2, TYPE, ANY, IGNORE, 0, FALSE) \ +FIELDDEF( 81, EAX, AMD, 16, 4, EXTMODEL, ANY, IGNORE, 0, FALSE) \ +FIELDDEF( 81, EAX, AMD, 20, 8, EXTFAMILY, ANY, IGNORE, 0, FALSE) \ +FIELDDEF( 81, EBX, INTEL, 0, 32, UNKNOWN81EBX, ANY, IGNORE, 0, FALSE) \ +FIELDDEF( 81, EBX, AMD, 0, 16, BRAND_ID, ANY, IGNORE, 0, FALSE) \ +FIELDDEF( 81, EBX, AMD, 16, 16, UNDEF, ANY, IGNORE, 0, FALSE) \ +FLAGDEFA( 81, ECX, COMMON, 0, 1, LAHF, YES, HOST, 0, TRUE, LAHF64) \ +FLAGDEFA( 81, ECX, AMD, 1, 1, CMPLEGACY, NO, MASK, 0, FALSE, CMPLEGACY) \ +FLAGDEFA( 81, ECX, AMD, 2, 1, SVM, NO, MASK, 0, FALSE, SVM) \ +FLAGDEFA( 81, ECX, AMD, 3, 1, EXTAPICSPC, YES, HOST, 0, FALSE, EXTAPICSPC) \ +FLAGDEFA( 81, ECX, AMD, 4, 1, CR8AVAIL, NO, MASK, 0, FALSE, CR8AVAIL) \ +FLAGDEFA( 81, ECX, AMD, 5, 1, ABM, YES, HOST, 0, TRUE, ABM) \ +FLAGDEFA( 81, ECX, AMD, 6, 1, SSE4A, YES, HOST, 0, TRUE, SSE4A) \ +FLAGDEF( 81, ECX, AMD, 7, 1, MISALIGNED_SSE, YES, HOST, 0, TRUE) \ +FLAGDEFA( 81, ECX, AMD, 8, 1, 3DNPREFETCH, YES, HOST, 0, TRUE, 3DNPREFETCH) \ +FLAGDEF( 81, ECX, AMD, 9, 1, OSVW, NO, MASK, 0, FALSE) \ +FLAGDEF( 81, ECX, AMD, 10, 1, IBS, NO, MASK, 0, FALSE) \ +FLAGDEF( 81, ECX, AMD, 11, 1, SSE5, NO, RSVD, 0, TRUE) \ +FLAGDEF( 81, ECX, AMD, 12, 1, SKINIT, NO, MASK, 0, FALSE) \ +FLAGDEF( 81, ECX, AMD, 13, 1, WATCHDOG, NO, MASK, 0, FALSE) \ +FLAGDEF( 81, EDX, AMD, 0, 1, FPU, YES, HOST, 0, TRUE) \ +FLAGDEF( 81, EDX, AMD, 1, 1, VME, YES, HOST, 0, FALSE) \ +FLAGDEF( 81, EDX, AMD, 2, 1, DBGE, YES, HOST, 0, FALSE) \ +FLAGDEF( 81, EDX, AMD, 3, 1, PGSZE, YES, HOST, 0, FALSE) \ +FLAGDEF( 81, EDX, AMD, 4, 1, TSC, YES, HOST, 0, TRUE) \ +FLAGDEF( 81, EDX, AMD, 5, 1, MSR, YES, HOST, 0, FALSE) \ +FLAGDEF( 81, EDX, AMD, 6, 1, PAE, YES, HOST, 0, FALSE) \ +FLAGDEF( 81, EDX, AMD, 7, 1, MCK, YES, HOST, 0, FALSE) \ +FLAGDEF( 81, EDX, AMD, 8, 1, CPMX, YES, HOST, 0, TRUE) \ +FLAGDEF( 81, EDX, AMD, 9, 1, APIC, ANY, MASK, 1, FALSE) \ +FLAGDEFA( 81, EDX, COMMON, 11, 1, SYSC, ANY, IGNORE, 0, TRUE, SYSC) \ +FLAGDEF( 81, EDX, AMD, 12, 1, MTRR, YES, HOST, 0, FALSE) \ +FLAGDEF( 81, EDX, AMD, 13, 1, PGE, YES, HOST, 0, FALSE) \ +FLAGDEF( 81, EDX, AMD, 14, 1, MCA, YES, HOST, 0, FALSE) \ +FLAGDEF( 81, EDX, AMD, 15, 1, CMOV, YES, HOST, 0, TRUE) \ +FLAGDEF( 81, EDX, AMD, 16, 1, PAT, YES, HOST, 0, FALSE) \ +FLAGDEF( 81, EDX, AMD, 17, 1, 36PG, YES, HOST, 0, FALSE) \ +FLAGDEFA( 81, EDX, COMMON, 20, 1, NX, YES, HOST, 0, FALSE, NX) \ +FLAGDEFA( 81, EDX, AMD, 22, 1, MMXEXT, YES, HOST, 0, TRUE, MMXEXT) \ +FLAGDEF( 81, EDX, AMD, 23, 1, MMX, YES, HOST, 0, TRUE) \ +FLAGDEF( 81, EDX, AMD, 24, 1, FXSAVE, YES, HOST, 0, TRUE) \ +FLAGDEFA( 81, EDX, AMD, 25, 1, FFXSR, YES, HOST, 0, FALSE, FFXSR) \ +FLAGDEF( 81, EDX, AMD, 26, 1, PDPE1GB, NO, MASK, 0, FALSE) \ +FLAGDEFA( 81, EDX, COMMON, 27, 1, RDTSCP, YES, HOST, 0, TRUE, RDTSCP) \ +FLAGDEFA( 81, EDX, COMMON, 29, 1, LM, YES, TEST, 1, FALSE, LM) \ +FLAGDEFA( 81, EDX, AMD, 30, 1, 3DNOWPLUS, YES, HOST, 0, TRUE, 3DNOWPLUS) \ +FLAGDEFA( 81, EDX, AMD, 31, 1, 3DNOW, YES, HOST, 0, TRUE, 3DNOW) -/* LEVEL, REG, VENDOR, POS, SIZE, NAME, MASK TYPE, SET TO, [FUNC] */ +/* LEVEL, REG, VENDOR, POS, SIZE, NAME, MON SUPP, MASK TYPE, SET TO, CPL3, [FUNC] */ #define CPUID_FIELD_DATA_LEVEL_8x \ -FIELDDEF( 86, ECX, AMD, 0, 8, CACHE_LINE, IGNORE, 0) \ -FIELDDEF( 86, ECX, AMD, 8, 4, CACHE_LINE_PER_TAG, IGNORE, 0) \ -FIELDDEF( 86, ECX, AMD, 12, 4, CACHE_WAYS, IGNORE, 0) \ -FIELDDEF( 86, ECX, AMD, 16, 16, CACHE_SIZE, IGNORE, 0) \ -FLAGDEF( 87, EDX, AMD, 8, 1, TSC_INVARIANT, IGNORE, 0) \ -FIELDDEFA(88, EAX, COMMON, 0, 8, PHYSBITS, IGNORE, 0, PHYS_BITS) \ -FIELDDEFA(88, EAX, COMMON, 8, 8, VIRTBITS, IGNORE, 0, VIRT_BITS) \ -FIELDDEFA(88, ECX, AMD, 0, 8, CORE_COUNT, IGNORE, 0, AMD_CORE_COUNT) \ -FIELDDEF( 88, ECX, AMD, 12, 4, APICID_COREID_SIZE, IGNORE, 0) \ -FIELDDEFA(8A, EAX, AMD, 0, 8, SVM_REVISION, MASK, 0, SVM_REVISION) \ -FLAGDEF( 8A, EAX, AMD, 8, 1, SVM_HYPERVISOR, MASK, 0) \ -FIELDDEF( 8A, EAX, AMD, 9, 23, SVMEAX_RSVD, MASK, 0) \ -FIELDDEF( 8A, EBX, AMD, 0, 32, SVM_N_ASIDS, MASK, 0) \ -FIELDDEF( 8A, ECX, AMD, 0, 32, SVMECX_RSVD, MASK, 0) \ -FLAGDEF( 8A, EDX, AMD, 0, 1, SVM_NP, MASK, 0) \ -FLAGDEF( 8A, EDX, AMD, 1, 1, SVM_LBR, MASK, 0) \ -FLAGDEF( 8A, EDX, AMD, 2, 1, SVM_LOCK, MASK, 0) \ -FLAGDEF( 8A, EDX, AMD, 3, 1, SVM_NRIP, MASK, 0) \ -FIELDDEF( 8A, EDX, AMD, 4, 28, SVMEDX_RSVD, MASK, 0) +FIELDDEF( 86, ECX, AMD, 0, 8, L2CACHE_LINE, NA, IGNORE, 0, FALSE) \ +FIELDDEF( 86, ECX, AMD, 8, 4, L2CACHE_LINE_PER_TAG, NA, IGNORE, 0, FALSE) \ +FIELDDEF( 86, ECX, AMD, 12, 4, L2CACHE_WAYS, NA, IGNORE, 0, FALSE) \ +FIELDDEF( 86, ECX, AMD, 16, 16, L2CACHE_SIZE, NA, IGNORE, 0, FALSE) \ +FIELDDEF( 86, EDX, AMD, 0, 8, L3CACHE_LINE, NA, IGNORE, 0, FALSE) \ +FIELDDEF( 86, EDX, AMD, 8, 4, L3CACHE_LINE_PER_TAG,NA, IGNORE, 0, FALSE) \ +FIELDDEF( 86, EDX, AMD, 12, 4, L3CACHE_WAYS, NA, IGNORE, 0, FALSE) \ +FIELDDEF( 86, EDX, AMD, 18, 14, L3CACHE_SIZE, NA, IGNORE, 0, FALSE) \ +FLAGDEF( 87, EDX, AMD, 0, 1, TS, NA, IGNORE, 0, FALSE) \ +FLAGDEF( 87, EDX, AMD, 1, 1, FID, NA, IGNORE, 0, FALSE) \ +FLAGDEF( 87, EDX, AMD, 2, 1, VID, NA, IGNORE, 0, FALSE) \ +FLAGDEF( 87, EDX, AMD, 3, 1, TTP, NA, IGNORE, 0, FALSE) \ +FLAGDEF( 87, EDX, AMD, 4, 1, TM, NA, IGNORE, 0, FALSE) \ +FLAGDEF( 87, EDX, AMD, 5, 1, STC, NA, IGNORE, 0, FALSE) \ +FLAGDEF( 87, EDX, AMD, 6, 1, 100MHZSTEPS, NA, IGNORE, 0, FALSE) \ +FLAGDEF( 87, EDX, AMD, 7, 1, HWPSTATE, NA, IGNORE, 0, FALSE) \ +FLAGDEF( 87, EDX, AMD, 8, 1, TSC_INVARIANT, NA, IGNORE, 0, FALSE) \ +FIELDDEFA(88, EAX, COMMON, 0, 8, PHYSBITS, NA, IGNORE, 0, FALSE, PHYS_BITS) \ +FIELDDEFA(88, EAX, COMMON, 8, 8, VIRTBITS, NA, IGNORE, 0, FALSE, VIRT_BITS) \ +FIELDDEFA(88, ECX, AMD, 0, 8, CORE_COUNT, NA, IGNORE, 0, FALSE, AMD_CORE_COUNT) \ +FIELDDEFA(88, ECX, AMD, 12, 4, APICID_COREID_SIZE, NA, IGNORE, 0, FALSE, AMD_APICID_COREID_SIZE) \ +FIELDDEFA(8A, EAX, AMD, 0, 8, SVM_REVISION, NO, MASK, 0, FALSE, SVM_REVISION) \ +FLAGDEF( 8A, EAX, AMD, 8, 1, SVM_HYPERVISOR, NO, MASK, 0, FALSE) \ +FIELDDEF( 8A, EAX, AMD, 9, 23, SVMEAX_RSVD, NO, MASK, 0, FALSE) \ +FIELDDEF( 8A, EBX, AMD, 0, 32, SVM_N_ASIDS, NO, MASK, 0, FALSE) \ +FIELDDEF( 8A, ECX, AMD, 0, 32, SVMECX_RSVD, NO, MASK, 0, FALSE) \ +FLAGDEFA( 8A, EDX, AMD, 0, 1, SVM_NP, NO, MASK, 0, FALSE, NPT) \ +FLAGDEF( 8A, EDX, AMD, 1, 1, SVM_LBR, NO, MASK, 0, FALSE) \ +FLAGDEF( 8A, EDX, AMD, 2, 1, SVM_LOCK, NO, MASK, 0, FALSE) \ +FLAGDEF( 8A, EDX, AMD, 3, 1, SVM_NRIP, NO, MASK, 0, FALSE) \ +FIELDDEF( 8A, EDX, AMD, 4, 28, SVMEDX_RSVD, NO, MASK, 0, FALSE) #define CPUID_FIELD_DATA \ CPUID_FIELD_DATA_LEVEL_0 \ CPUID_FIELD_DATA_LEVEL_1 \ CPUID_FIELD_DATA_LEVEL_4 \ + CPUID_FIELD_DATA_LEVEL_5 \ + CPUID_FIELD_DATA_LEVEL_6 \ CPUID_FIELD_DATA_LEVEL_A \ CPUID_FIELD_DATA_LEVEL_80 \ CPUID_FIELD_DATA_LEVEL_81 \ @@ -402,15 +481,20 @@ */ #define VMW_BIT_MASK(shift) (((1 << (shift - 1)) << 1) - 1) -#define FIELDDEF(lvl, reg, vend, bitpos, size, name, m, v) \ +#define FIELDDEF(lvl, reg, vend, bitpos, size, name, s, m, v, c3) \ CPUID_##vend##_ID##lvl##reg##_##name##_SHIFT = bitpos, \ CPUID_##vend##_ID##lvl##reg##_##name##_MASK = \ VMW_BIT_MASK(size) << bitpos, \ CPUID_FEATURE_##vend##_ID##lvl##reg##_##name = \ CPUID_##vend##_ID##lvl##reg##_##name##_MASK, -#define FIELDDEFA(lvl, reg, vend, bitpos, size, name, m, v, f) \ - FIELDDEF(lvl, reg, vend, bitpos, size, name, m, v) +/* Before simplifying this take a look at bug 293638... */ +#define FIELDDEFA(lvl, reg, vend, bitpos, size, name, s, m, v, c3, f) \ + CPUID_##vend##_ID##lvl##reg##_##name##_SHIFT = bitpos, \ + CPUID_##vend##_ID##lvl##reg##_##name##_MASK = \ + VMW_BIT_MASK(size) << bitpos, \ + CPUID_FEATURE_##vend##_ID##lvl##reg##_##name = \ + CPUID_##vend##_ID##lvl##reg##_##name##_MASK, #define FLAGDEFA FIELDDEFA #define FLAGDEF FIELDDEF @@ -508,6 +592,13 @@ FIELD_FUNC(AMD_APICID_COREID_SIZE, CPUID_AMD_ID88ECX_APICID_COREID_SIZE) FIELD_FUNC(AMD_EXTAPICSPC, CPUID_AMD_ID81ECX_EXTAPICSPC) FIELD_FUNC(NUM_PMCS, CPUID_INTEL_IDAEAX_NUM_PMCS) +FIELD_FUNC(MWAIT_MIN_SIZE, CPUID_COMMON_ID5EAX_MWAIT_MIN_SIZE) +FIELD_FUNC(MWAIT_MAX_SIZE, CPUID_COMMON_ID5EBX_MWAIT_MAX_SIZE) +FIELD_FUNC(MWAIT_C0_SUBSTATE, CPUID_INTEL_ID5EDX_MWAIT_C0_SUBSTATE) +FIELD_FUNC(MWAIT_C1_SUBSTATE, CPUID_INTEL_ID5EDX_MWAIT_C1_SUBSTATE) +FIELD_FUNC(MWAIT_C2_SUBSTATE, CPUID_INTEL_ID5EDX_MWAIT_C2_SUBSTATE) +FIELD_FUNC(MWAIT_C3_SUBSTATE, CPUID_INTEL_ID5EDX_MWAIT_C3_SUBSTATE) +FIELD_FUNC(MWAIT_C4_SUBSTATE, CPUID_INTEL_ID5EDX_MWAIT_C4_SUBSTATE) #undef FIELD_FUNC @@ -534,15 +625,58 @@ /* Intel model information */ #define CPUID_MODEL_PPRO 1 -#define CPUID_MODEL_PII_3 3 -#define CPUID_MODEL_PII_5 5 -#define CPUID_MODEL_CELERON_6 6 -#define CPUID_MODEL_PIII_7 7 -#define CPUID_MODEL_PIII_8 8 -#define CPUID_MODEL_PM 9 -#define CPUID_MODEL_PIII_A 10 -#define CPUID_MODEL_CORE 14 -#define CPUID_MODEL_CORE2 15 +#define CPUID_MODEL_PII_03 3 +#define CPUID_MODEL_PII_05 5 +#define CPUID_MODEL_CELERON_06 6 +#define CPUID_MODEL_PM_09 9 +#define CPUID_MODEL_PM_0D 13 +#define CPUID_MODEL_PM_0E 14 // Yonah / Sossaman +#define CPUID_MODEL_CORE_0F 15 // Conroe / Merom +#define CPUID_MODEL_CORE_17 0x17 // Penryn +#define CPUID_MODEL_NEHALEM_1A 0x1a // Nehalem / Gainestown +#define CPUID_MODEL_ATOM_1C 0x1c // Silverthorne / Diamondville +#define CPUID_MODEL_CORE_1D 0x1d // Dunnington + +#define CPUID_MODEL_PIII_07 7 +#define CPUID_MODEL_PIII_08 8 +#define CPUID_MODEL_PIII_0A 10 + +/* + *---------------------------------------------------------------------- + * + * CPUID_IsVendor{AMD,Intel} -- + * + * Determines if the vendor string in cpuid id0 is from {AMD,Intel}. + * + * Results: + * True iff vendor string is CPUID_{AMD,INTEL}_VENDOR_STRING + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ +static INLINE Bool +CPUID_IsRawVendor(CPUIDRegs *id0, const char* vendor) +{ + // hard to get strcmp() in some environments, so do it in the raw + return (id0->ebx == *(const uint32 *) (vendor + 0) && + id0->ecx == *(const uint32 *) (vendor + 4) && + id0->edx == *(const uint32 *) (vendor + 8)); +} + +static INLINE Bool +CPUID_IsVendorAMD(CPUIDRegs *id0) +{ + return CPUID_IsRawVendor(id0, CPUID_AMD_VENDOR_STRING); +} + +static INLINE Bool +CPUID_IsVendorIntel(CPUIDRegs *id0) +{ + return CPUID_IsRawVendor(id0, CPUID_INTEL_VENDOR_STRING); +} + static INLINE uint32 CPUID_EFFECTIVE_FAMILY(uint32 v) /* %eax from CPUID with %eax=1. */ @@ -590,15 +724,44 @@ return CPUID_EFFECTIVE_FAMILY(_eax) == CPUID_FAMILY_P4; } -/* Intel Core processors are Yonah, Merom, Conroe, Woodcrest, - * Clovertown, Penryn, ... +/* + * Intel Pentium M processors are Yonah/Sossaman or an older P-M */ static INLINE Bool -CPUID_FAMILY_IS_CORE(uint32 v) // IN: %eax from CPUID with %eax=1. +CPUID_UARCH_IS_PENTIUM_M(uint32 v) // IN: %eax from CPUID with %eax=1. { /* Assumes the CPU manufacturer is Intel. */ return CPUID_FAMILY_IS_P6(v) && - CPUID_EFFECTIVE_MODEL(v) >= CPUID_MODEL_CORE; + (CPUID_EFFECTIVE_MODEL(v) == CPUID_MODEL_PM_09 || + CPUID_EFFECTIVE_MODEL(v) == CPUID_MODEL_PM_0D || + CPUID_EFFECTIVE_MODEL(v) == CPUID_MODEL_PM_0E); +} + +/* + * Intel Core processors are Merom, Conroe, Woodcrest, Clovertown, + * Penryn, Dunnington, Kentsfield, Yorktown, Harpertown, ........ + */ +static INLINE Bool +CPUID_UARCH_IS_CORE(uint32 v) // IN: %eax from CPUID with %eax=1. +{ + uint32 model = CPUID_EFFECTIVE_MODEL(v); + /* Assumes the CPU manufacturer is Intel. */ + return CPUID_FAMILY_IS_P6(v) && + model >= CPUID_MODEL_CORE_0F && + (model < CPUID_MODEL_NEHALEM_1A || + model == CPUID_MODEL_CORE_1D); +} + + +/* + * Intel Nehalem processors are: Nehalem, Gainestown. + */ +static INLINE Bool +CPUID_UARCH_IS_NEHALEM(uint32 v) // IN: %eax from CPUID with %eax=1. +{ + /* Assumes the CPU manufacturer is Intel. */ + return CPUID_FAMILY_IS_P6(v) && + CPUID_EFFECTIVE_MODEL(v) == CPUID_MODEL_NEHALEM_1A; } @@ -680,26 +843,94 @@ */ return !((isIntel && ((CPUID_FAMILY_IS_P6(v) && - CPUID_EFFECTIVE_MODEL(v) < CPUID_MODEL_CORE) || + CPUID_EFFECTIVE_MODEL(v) < CPUID_MODEL_PM_0E) || (CPUID_FAMILY_IS_PENTIUM4(v) && CPUID_EFFECTIVE_MODEL(v) < 3))) || (!isIntel && CPUID_FAMILY(v) < CPUID_FAMILY_K8)); } + /* * For certain AMD processors, an lfence instruction is necessary at various * places to ensure ordering. */ + +static INLINE Bool +CPUID_VendorRequiresFence(CpuidVendors vendor) +{ + return vendor == CPUID_VENDOR_AMD; +} + +static INLINE Bool +CPUID_VersionRequiresFence(uint32 version) +{ + return CPUID_EFFECTIVE_FAMILY(version) == CPUID_FAMILY_K8 && + CPUID_EFFECTIVE_MODEL(version) < 0x40; +} + +static INLINE Bool +CPUID_ID0RequiresFence(CPUIDRegs *id0) +{ + if (id0->eax == 0) { + return FALSE; + } + return CPUID_IsVendorAMD(id0); +} + +static INLINE Bool +CPUID_ID1RequiresFence(CPUIDRegs *id1) +{ + return CPUID_VersionRequiresFence(id1->eax); +} + static INLINE Bool CPUID_RequiresFence(CpuidVendors vendor, // IN uint32 version) // IN: %eax from CPUID with %eax=1. { - return ((vendor == CPUID_VENDOR_AMD) && - (CPUID_EFFECTIVE_FAMILY(version) == CPUID_FAMILY_K8) && - (CPUID_EFFECTIVE_MODEL(version) < 0x40)); + return CPUID_VendorRequiresFence(vendor) && + CPUID_VersionRequiresFence(version); +} + + +/* + *---------------------------------------------------------------------- + * + * CPUID_CountsCPUIDAsBranch -- + * + * Returns TRUE iff the cpuid given counts CPUID as a branch + * (i.e. is a pre-Merom E CPU). + * + *---------------------------------------------------------------------- + */ + +static INLINE Bool +CPUID_CountsCPUIDAsBranch(uint32 v) /* %eax from CPUID with %eax=1 */ +{ + /* + * CPUID no longer a branch starting with Merom E. Bug 148411. + * Penryn (Extended Model: 1) also has this fixed. + * + * Merom E is: CPUID.1.eax & 0xfff = 0x6f9 + */ + return !(CPUID_FAMILY_IS_P6(v) && + (CPUID_EFFECTIVE_MODEL(v) > CPUID_MODEL_CORE_0F || + (CPUID_EFFECTIVE_MODEL(v) == CPUID_MODEL_CORE_0F && + CPUID_STEPPING(v) >= 9))); } +/* + * On Merom and later Intel chips, not present PDPTEs with reserved bits + * set do not fault with a #GP. See PR# 109120. + */ +static INLINE Bool +CPUID_FaultOnNPReservedPDPTE(uint32 v) // IN: %eax from CPUID with %eax=1. +{ + return !(CPUID_FAMILY_IS_P6(v) && + (CPUID_EFFECTIVE_MODEL(v) >= CPUID_MODEL_CORE_0F)); +} + + /* * The following low-level functions compute the number of * cores per cpu. They should be used cautiously because @@ -722,4 +953,15 @@ return 1 + CPUID_AMD_CORE_COUNT(v); } +/* + * Hypervisor CPUID space is 0x400000XX. + */ +static INLINE Bool +CPUID_IsHypervisorLevel(uint32 level, uint32 *offset) +{ + *offset = level & 0xff; + return (level & 0xffffff00) == 0x40000000; +} + + #endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/include/xdrutil.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/xdrutil.h --- open-vm-tools-2008.01.23-74039/lib/include/xdrutil.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/include/xdrutil.h 2008-10-13 08:01:50.000000000 +0100 @@ -0,0 +1,71 @@ +/********************************************************* + * Copyright (C) 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 _XDRUTIL_H_ +#define _XDRUTIL_H_ + +/* + * xdrutil.h -- + * + * Utility functions for code that uses XDR to encode/decode data. + */ + +#include +#include "vm_basic_types.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_FOREACH(counter, ptr, field) \ + for ((counter) = 0; (counter) < (ptr)->field.field##_len; (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. + */ +#define XDRUTIL_ARRAYAPPEND(ptr, field, cnt) \ + XdrUtil_ArrayAppend((void **) &(ptr)->field.field##_val, \ + &(ptr)->field.field##_len, \ + sizeof *(ptr)->field.field##_val, \ + (cnt)); + +void * +XdrUtil_ArrayAppend(void **array, u_int *arrayLen, size_t elemSz, u_int elemCnt); + +#endif /* _XDRUTIL_H_ */ + diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/Makefile.am --- open-vm-tools-2008.01.23-74039/lib/Makefile.am 2008-01-28 08:02:49.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/Makefile.am 2008-10-13 08:01:47.000000000 +0100 @@ -16,17 +16,26 @@ ################################################################################ SUBDIRS = -SUBDIRS += atomic +SUBDIRS += guestRpc +if ENABLE_UNITY + SUBDIRS += appUtil +endif SUBDIRS += auth SUBDIRS += backdoor SUBDIRS += conf SUBDIRS += dict +SUBDIRS += deployPkg SUBDIRS += dnd +SUBDIRS += dynxdr SUBDIRS += err SUBDIRS += eventManager SUBDIRS += file -SUBDIRS += fileUtf8 SUBDIRS += foundryMsg +if ENABLE_UNITY + SUBDIRS += ghIntegration +else + SUBDIRS += ghIntegrationStub +endif SUBDIRS += guestApp SUBDIRS += guestInfo SUBDIRS += hgfs @@ -34,7 +43,9 @@ SUBDIRS += hgfsServer SUBDIRS += hgfsServerManagerGuest SUBDIRS += hgfsServerPolicyGuest -SUBDIRS += deployPkg +if ENABLE_UNITY + SUBDIRS += image +endif SUBDIRS += impersonate SUBDIRS += message SUBDIRS += misc @@ -43,18 +54,31 @@ SUBDIRS += panicDefault SUBDIRS += printer SUBDIRS += procMgr +if ENABLE_UNITY + SUBDIRS += raster + SUBDIRS += region +endif +if HAVE_X11 + SUBDIRS += resolution +endif SUBDIRS += rpcIn SUBDIRS += rpcOut SUBDIRS += rpcVmx SUBDIRS += SLPv2Parser SUBDIRS += socketMgr -SUBDIRS += strUtil SUBDIRS += string +SUBDIRS += stubs SUBDIRS += sync SUBDIRS += syncDriver SUBDIRS += system SUBDIRS += toolsLogger SUBDIRS += unicode +if ENABLE_UNITY + SUBDIRS += unity + SUBDIRS += unityWindowTracker +else + SUBDIRS += unityStub +endif SUBDIRS += user SUBDIRS += vixTools SUBDIRS += vmBackupLib diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/Makefile.in --- open-vm-tools-2008.01.23-74039/lib/Makefile.in 2008-01-28 08:03:02.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/Makefile.in 2008-10-13 08:02:12.000000000 +0100 @@ -48,10 +48,21 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ +@ENABLE_UNITY_TRUE@am__append_1 = appUtil +@ENABLE_UNITY_TRUE@am__append_2 = ghIntegration +@ENABLE_UNITY_FALSE@am__append_3 = ghIntegrationStub +@ENABLE_UNITY_TRUE@am__append_4 = image +@ENABLE_UNITY_TRUE@am__append_5 = raster region +@HAVE_X11_TRUE@am__append_6 = resolution +@ENABLE_UNITY_TRUE@am__append_7 = unity unityWindowTracker +@ENABLE_UNITY_FALSE@am__append_8 = unityStub subdir = lib DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in COPYING ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +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)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -69,7 +80,15 @@ distclean-recursive maintainer-clean-recursive ETAGS = etags CTAGS = ctags -DIST_SUBDIRS = $(SUBDIRS) +DIST_SUBDIRS = guestRpc appUtil auth backdoor conf dict deployPkg dnd \ + dynxdr err eventManager file foundryMsg ghIntegration \ + ghIntegrationStub guestApp guestInfo hgfs hgfsBd hgfsServer \ + hgfsServerManagerGuest hgfsServerPolicyGuest image impersonate \ + message misc netUtil panic panicDefault printer procMgr raster \ + region resolution rpcIn rpcOut rpcVmx SLPv2Parser socketMgr \ + string stubs sync syncDriver system toolsLogger unicode unity \ + unityWindowTracker unityStub user vixTools vmBackupLib vmCheck \ + vmSignal wiper DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ @@ -81,8 +100,6 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -COMMON_CFLAGS = @COMMON_CFLAGS@ -COMMON_PROG_CFLAGS = @COMMON_PROG_CFLAGS@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -93,45 +110,57 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ -ECHO = @ECHO@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GREP = @GREP@ -GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_AUTH_CFLAGS = @LIB_AUTH_CFLAGS@ -LIB_FILE_CFLAGS = @LIB_FILE_CFLAGS@ -LIB_HGFS_SERVER_CFLAGS = @LIB_HGFS_SERVER_CFLAGS@ -LIB_IMPERSONATE_CFLAGS = @LIB_IMPERSONATE_CFLAGS@ -LIB_MISC_CFLAGS = @LIB_MISC_CFLAGS@ -LIB_PROC_MGR_CFLAGS = @LIB_PROC_MGR_CFLAGS@ -LIB_STRING_CFLAGS = @LIB_STRING_CFLAGS@ -LIB_USER_CFLAGS = @LIB_USER_CFLAGS@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -139,27 +168,35 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ VERSION = @VERSION@ -VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -190,6 +227,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -204,12 +242,14 @@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -SUBDIRS = atomic auth backdoor conf dict dnd err eventManager file \ - fileUtf8 foundryMsg guestApp guestInfo hgfs hgfsBd hgfsServer \ - hgfsServerManagerGuest hgfsServerPolicyGuest deployPkg \ +SUBDIRS = guestRpc $(am__append_1) auth backdoor conf dict deployPkg \ + dnd dynxdr err eventManager file foundryMsg $(am__append_2) \ + $(am__append_3) guestApp guestInfo hgfs hgfsBd hgfsServer \ + hgfsServerManagerGuest hgfsServerPolicyGuest $(am__append_4) \ impersonate message misc netUtil panic panicDefault printer \ - procMgr rpcIn rpcOut rpcVmx SLPv2Parser socketMgr strUtil \ - string sync syncDriver system toolsLogger unicode user \ + procMgr $(am__append_5) $(am__append_6) rpcIn rpcOut rpcVmx \ + SLPv2Parser socketMgr string stubs sync syncDriver system \ + toolsLogger unicode $(am__append_7) $(am__append_8) user \ vixTools vmBackupLib vmCheck vmSignal wiper all: all-recursive diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/message/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/message/Makefile.am --- open-vm-tools-2008.01.23-74039/lib/message/Makefile.am 2008-01-28 08:02:49.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/message/Makefile.am 2008-10-13 08:01:47.000000000 +0100 @@ -22,8 +22,5 @@ libMessage_a_SOURCES += messageBackdoor.c libMessage_a_SOURCES += messageStub.c -AM_CFLAGS = -AM_CFLAGS += @COMMON_CFLAGS@ - SUBDIRS = SUBDIRS += shared diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/message/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/message/Makefile.in --- open-vm-tools-2008.01.23-74039/lib/message/Makefile.in 2008-01-28 08:03:04.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/message/Makefile.in 2008-10-13 08:02:14.000000000 +0100 @@ -52,7 +52,10 @@ subdir = lib/message DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +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)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -65,7 +68,7 @@ messageStub.$(OBJEXT) libMessage_a_OBJECTS = $(am_libMessage_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp +depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -101,8 +104,6 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -COMMON_CFLAGS = @COMMON_CFLAGS@ -COMMON_PROG_CFLAGS = @COMMON_PROG_CFLAGS@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -113,45 +114,57 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ -ECHO = @ECHO@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GREP = @GREP@ -GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_AUTH_CFLAGS = @LIB_AUTH_CFLAGS@ -LIB_FILE_CFLAGS = @LIB_FILE_CFLAGS@ -LIB_HGFS_SERVER_CFLAGS = @LIB_HGFS_SERVER_CFLAGS@ -LIB_IMPERSONATE_CFLAGS = @LIB_IMPERSONATE_CFLAGS@ -LIB_MISC_CFLAGS = @LIB_MISC_CFLAGS@ -LIB_PROC_MGR_CFLAGS = @LIB_PROC_MGR_CFLAGS@ -LIB_STRING_CFLAGS = @LIB_STRING_CFLAGS@ -LIB_USER_CFLAGS = @LIB_USER_CFLAGS@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -159,27 +172,35 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ VERSION = @VERSION@ -VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -210,6 +231,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -226,7 +248,6 @@ top_srcdir = @top_srcdir@ noinst_LIBRARIES = libMessage.a libMessage_a_SOURCES = message.c messageBackdoor.c messageStub.c -AM_CFLAGS = @COMMON_CFLAGS@ SUBDIRS = shared all: all-recursive diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/message/messageBackdoor.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/message/messageBackdoor.c --- open-vm-tools-2008.01.23-74039/lib/message/messageBackdoor.c 2008-01-28 08:02:50.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/message/messageBackdoor.c 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/message/message.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/message/message.c --- open-vm-tools-2008.01.23-74039/lib/message/message.c 2008-01-28 08:02:50.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/message/message.c 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/message/messageStub.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/message/messageStub.c --- open-vm-tools-2008.01.23-74039/lib/message/messageStub.c 2008-01-28 08:02:50.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/message/messageStub.c 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/message/shared/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/message/shared/Makefile.am --- open-vm-tools-2008.01.23-74039/lib/message/shared/Makefile.am 2008-01-28 08:02:49.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/message/shared/Makefile.am 2008-10-13 08:01:47.000000000 +0100 @@ -21,6 +21,3 @@ libMessage_la_SOURCES += ../message.c libMessage_la_SOURCES += ../messageBackdoor.c libMessage_la_SOURCES += ../messageStub.c - -AM_CFLAGS = -AM_CFLAGS += @COMMON_CFLAGS@ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/message/shared/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/message/shared/Makefile.in --- open-vm-tools-2008.01.23-74039/lib/message/shared/Makefile.in 2008-01-28 08:03:04.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/message/shared/Makefile.in 2008-10-13 08:02:14.000000000 +0100 @@ -52,7 +52,10 @@ subdir = lib/message/shared DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +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)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -63,7 +66,7 @@ messageStub.lo libMessage_la_OBJECTS = $(am_libMessage_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp +depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -89,8 +92,6 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -COMMON_CFLAGS = @COMMON_CFLAGS@ -COMMON_PROG_CFLAGS = @COMMON_PROG_CFLAGS@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -101,45 +102,57 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ -ECHO = @ECHO@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GREP = @GREP@ -GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_AUTH_CFLAGS = @LIB_AUTH_CFLAGS@ -LIB_FILE_CFLAGS = @LIB_FILE_CFLAGS@ -LIB_HGFS_SERVER_CFLAGS = @LIB_HGFS_SERVER_CFLAGS@ -LIB_IMPERSONATE_CFLAGS = @LIB_IMPERSONATE_CFLAGS@ -LIB_MISC_CFLAGS = @LIB_MISC_CFLAGS@ -LIB_PROC_MGR_CFLAGS = @LIB_PROC_MGR_CFLAGS@ -LIB_STRING_CFLAGS = @LIB_STRING_CFLAGS@ -LIB_USER_CFLAGS = @LIB_USER_CFLAGS@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -147,27 +160,35 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ VERSION = @VERSION@ -VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -198,6 +219,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -215,7 +237,6 @@ noinst_LTLIBRARIES = libMessage.la libMessage_la_SOURCES = ../message.c ../messageBackdoor.c \ ../messageStub.c -AM_CFLAGS = @COMMON_CFLAGS@ all: all-am .SUFFIXES: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/misc/atomic.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/misc/atomic.c --- open-vm-tools-2008.01.23-74039/lib/misc/atomic.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/misc/atomic.c 2008-10-13 08:01:52.000000000 +0100 @@ -0,0 +1,81 @@ +/********************************************************* + * Copyright (C) 2006 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. + * + *********************************************************/ + +/* + * atomic.c -- + * + * Support for atomic instructions. + * + * This is the user-level version. + * The monitor-only version is in vmcore/vmm/main. + */ + +#include "vmware.h" +#include "vm_atomic.h" +#include "x86cpuid.h" +#include "vm_basic_asm.h" + + +Bool AtomicUseFence; + +Bool atomicFenceInitialized; + + +/* + *----------------------------------------------------------------------------- + * + * AtomicInitFence -- + * + * Compute AtomicUseFence. + * + * This version of fence initialization doesn't take into account + * the number of CPUs. Code that cares uses Atomic_SetFence() directly. + * See Atomic_Init in vm_atomic.h. + * + * This code is rather weird because while the logic belongs + * in x86cpuid.h, it's almost impossible to put this whole function + * there, so here it is. -- edward + * + * Results: + * None. + * + * Side effects: + * As described. + * + *----------------------------------------------------------------------------- + */ + +void +AtomicInitFence(void) +{ + CPUIDRegs regs; + Bool needFence; + + ASSERT(!atomicFenceInitialized); + + needFence = FALSE; + __GET_CPUID(0, ®s); + if (CPUID_ID0RequiresFence(®s)) { + __GET_CPUID(1, ®s); + if (CPUID_ID1RequiresFence(®s)) { + needFence = TRUE; + } + } + + Atomic_SetFence(needFence); +} diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/misc/codeset.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/misc/codeset.c --- open-vm-tools-2008.01.23-74039/lib/misc/codeset.c 2008-01-28 08:02:51.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/misc/codeset.c 2008-10-13 08:01:52.000000000 +0100 @@ -1,863 +1,1024 @@ -/********************************************************* - * Copyright (C) 1998 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 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. - * - *********************************************************/ +/* ********************************************************** + * Copyright 1998 VMware, Inc. All rights reserved. + * **********************************************************/ /* * codeset.c -- * - * Character set and encoding conversion functions --hpreg - */ - - -/* - * Windows have their own logic for conversion. On Posix systems with iconv - * available we use iconv. On systems without iconv use simple 1:1 translation - * for UTF8 <-> Current. We also use 1:1 translation also for MacOS's conversion - * between 'current' and 'UTF-8', as MacOS is UTF-8 only. + * Character set and encoding conversion functions, using ICU. + * + * + * Some definitions borrow from header files from the ICU 1.8.1 + * library. + * + * 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. */ #if defined(_WIN32) # include # include +# include #else +# define _GNU_SOURCE # include # include # include -# if defined(__FreeBSD__) || (defined(__linux__) && !defined(GLIBC_VERSION_21)) -# define CURRENT_IS_UTF8 -# else -# define USE_ICONV -# include -# include -# ifdef __linux__ -# include "str.h" -# endif -# if defined(__APPLE__) -# define CURRENT_IS_UTF8 -# include /* for CFString */ -# endif -# endif +# include +# include +# include "hostinfo.h" +# include "hostType.h" #endif -#include "vm_assert.h" +#if defined(__APPLE__) +#include +#endif + +#include +#include "vmware.h" +#include "vm_product.h" +#include "unicode/ucnv.h" +#include "unicode/putil.h" +#include "file.h" +#include "util.h" #include "codeset.h" +#include "codesetOld.h" +#include "str.h" + +/* + * Macros + */ + +#define CODESET_CAN_FALLBACK_ON_NON_ICU TRUE + +#if defined(__APPLE__) +#define POSIX_ICU_DIR DEFAULT_LIBDIRECTORY "/icu" +#elif !defined(WIN32) +#define POSIX_ICU_DIR "/etc/vmware/icu" +#endif + +/* + * XXX These should be passed in from the build system, + * but I don't have time to deal with bora-vmsoft. -- edward + */ -#define CSGTG_NORMAL 0x0000 /* Without any information loss. */ -#define CSGTG_TRANSLIT 0x0001 /* Transliterate unknown characters. */ -#define CSGTG_IGNORE 0x0002 /* Skip over untranslatable characters. */ +#define ICU_DATA_FILE "icudt38l.dat" +#ifdef _WIN32 +#define ICU_DATA_FILE_DIR "%TCROOT%/noarch/icu-data-3.8-1" +#else +#define ICU_DATA_FILE_DIR "/build/toolchain/noarch/icu-data-3.8-1" +#endif -#if defined(__FreeBSD__) || defined(sun) -static const char nul[] = {'\0', '\0'}; +#ifdef _WIN32 +#define ICU_DATA_FILE_W XCONC(L, ICU_DATA_FILE) +#define ICU_DATA_FILE_DIR_W XCONC(L, ICU_DATA_FILE_DIR) +#define ICU_DATA_FILE_PATH ICU_DATA_FILE_DIR_W DIRSEPS_W ICU_DATA_FILE_W #else -static const wchar_t nul = L'\0'; +#define ICU_DATA_FILE_PATH ICU_DATA_FILE_DIR DIRSEPS ICU_DATA_FILE #endif -#if defined(CURRENT_IS_UTF8) || defined(_WIN32) /* - *----------------------------------------------------------------------------- + * Variables + */ + +static Bool dontUseIcu = TRUE; +DEBUG_ONLY(static Bool initedIcu = FALSE;) + + +/* + * Functions + */ + +#ifdef _WIN32 + +/* + *---------------------------------------------------------------------------- * - * CodeSetDuplicateStr -- + * CodeSetGetModulePath -- * - * Duplicate input string, appending zero terminator to its end. Only - * used on Windows and on platforms where current encoding is always - * UTF-8, on other iconv-capable platforms we just use iconv even for - * UTF-8 to UTF-8 translation. Note that this function is more like - * memdup() than strdup(), so it can be used for duplicating UTF-16 - * strings as well - string is always terminated by wide character NUL, - * which is supposed to be longest NUL character occuring on specified - * host. + * Returns the wide-character current module path. We can't use + * Win32U_GetModuleFileName because it invokes codeset.c conversion + * routines. * - * Results: - * TRUE on success - * FALSE on failure + * Returns: + * NULL, or a utf16 string (free with free). * * Side effects: - * None. + * None. * - *----------------------------------------------------------------------------- + *---------------------------------------------------------------------------- */ -static Bool -CodeSetDuplicateStr(const char *bufIn, // IN: Input string - size_t sizeIn, // IN: Input string length - char **bufOut, // OUT: "Converted" string - size_t *sizeOut) // OUT: Length of string +static utf16_t * +CodeSetGetModulePath(HANDLE hModule) // IN { - char *myBufOut; + utf16_t *pathW = NULL; + DWORD size = MAX_PATH; - myBufOut = malloc(sizeIn + sizeof nul); - if (myBufOut == NULL) { - return FALSE; - } + while (TRUE) { + DWORD res; - memcpy(myBufOut, bufIn, sizeIn); - memset(myBufOut + sizeIn, 0, sizeof nul); + pathW = realloc(pathW, size * sizeof(wchar_t)); + if (!pathW) { + return NULL; + } - *bufOut = myBufOut; - if (sizeOut) { - *sizeOut = sizeIn; + res = GetModuleFileNameW(hModule, pathW, size); + + if (res == 0) { + /* fatal error */ + goto exit; + } else if (res == size) { + /* buffer too small */ + size *= 2; + } else { + /* success */ + break; + } } - return TRUE; + + exit: + return pathW; } -#endif +#elif vmx86_devel // _WIN32 /* *----------------------------------------------------------------------------- * - * CodeSetDynBufFinalize -- + * CodeSetGetModulePath -- * - * Append NUL terminator to the buffer, and return pointer to buffer - * and its data size (before appending terminator). Destroys buffer - * on failure. + * Retrieve the full path to the executable. Not supported under + * VMvisor. Based on HostInfo_GetModulePath, simplified for safe + * use before ICU is initialized. * * Results: - * TRUE on success - * FALSE on failure + * On success: The allocated, NUL-terminated file path. + * Note: This path can be a symbolic or hard link; it's just one + * possible path to access the executable. + * + * On failure: NULL. * * Side effects: - * None. + * None * *----------------------------------------------------------------------------- */ -static Bool -CodeSetDynBufFinalize(Bool ok, // IN: Earlier steps succeeded - DynBuf *db, // IN: Buffer with converted string - char **bufOut, // OUT: Converted string - size_t *sizeOut) // OUT: Length of string in bytes +static char * +CodeSetGetModulePath(uint32 priv) { - if (!ok || !DynBuf_Append(db, &nul, sizeof nul) || !DynBuf_Trim(db)) { - DynBuf_Destroy(db); - return FALSE; + char path[PATH_MAX]; + Bool ret = FALSE; +#if defined(__APPLE__) + uint32_t size; +#else + ssize_t size; + Bool isSuper = FALSE; +#endif + + if ((priv != HGMP_PRIVILEGE) && (priv != HGMP_NO_PRIVILEGE)) { + return NULL; } - *bufOut = DynBuf_Get(db); - if (sizeOut) { - *sizeOut = DynBuf_GetSize(db) - sizeof nul; +#if defined(__APPLE__) + size = sizeof path; + if (_NSGetExecutablePath(path, &size)) { + goto exit; + } + +#else +#if defined(VMX86_SERVER) + if (HostType_OSIsPureVMK()) { + goto exit; + } +#endif + + if (priv == HGMP_PRIVILEGE) { + isSuper = IsSuperUser(); + SuperUser(TRUE); + } + + size = readlink("/proc/self/exe", path, sizeof path); + if (-1 == size) { + SuperUser(isSuper); + goto exit; + } + + path[size] = '\0'; + + if (priv == HGMP_PRIVILEGE) { + SuperUser(isSuper); + } +#endif + + ret = TRUE; + + exit: + if (ret) { + return strdup(path); + } else { + return NULL; } - return TRUE; } +#endif // _WIN32 + /* *----------------------------------------------------------------------------- * - * CodeSetUtf8ToUtf16le -- + * CodeSet_GetAltPathName -- * - * Append the content of a buffer (that uses the UTF-8 encoding) to a - * DynBuf (that uses the UTF-16LE encoding) + * The Unicode path is probably not compatible in the current encoding. + * Try to convert the path into a short name so it may work with + * local encoding. + * + * XXX -- this function is a temporary fix. It should be removed once + * we fix the 3rd party library pathname issue. * * Results: - * TRUE on success - * FALSE on failure + * NULL, or a char string (free with free). * * Side effects: - * None + * None. * *----------------------------------------------------------------------------- */ -static Bool -CodeSetUtf8ToUtf16le(const char *bufIn, // IN - size_t sizeIn, // IN - DynBuf *db) // IN +char * +CodeSet_GetAltPathName(const utf16_t *pathW) // IN { - size_t currentSize; - size_t allocatedSize; - uint16 *buf; - - currentSize = DynBuf_GetSize(db); - allocatedSize = DynBuf_GetAllocatedSize(db); - buf = (uint16 *)((char *)DynBuf_Get(db) + currentSize); - while (sizeIn--) { - unsigned int uniChar = *bufIn++ & 0xFF; - size_t neededSize; - - if (uniChar >= 0x80) { - size_t charLen; - size_t idx; - - if (uniChar < 0xC2) { - /* 80-BF cannot start UTF8 sequence. C0-C1 cannot appear in UTF8 stream at all. */ - return FALSE; - } else if (uniChar < 0xE0) { - uniChar -= 0xC0; - charLen = 1; - } else if (uniChar < 0xF0) { - uniChar -= 0xE0; - charLen = 2; - } else if (uniChar < 0xF8) { - uniChar -= 0xF0; - charLen = 3; - } else if (uniChar < 0xFC) { - uniChar -= 0xF8; - charLen = 4; - } else if (uniChar < 0xFE) { - uniChar -= 0xFC; - charLen = 5; - } else { - return FALSE; - } - if (sizeIn < charLen) { - return FALSE; - } - for (idx = 0; idx < charLen; idx++) { - unsigned int nextChar; + char *path = NULL; +#if defined(_WIN32) + utf16_t shortPathW[_MAX_PATH]; - nextChar = *bufIn++ & 0xFF; - if (nextChar < 0x80 || nextChar >= 0xC0) { - return FALSE; - } - uniChar = (uniChar << 6) + nextChar - 0x80; - sizeIn--; - } + ASSERT(pathW); - /* - * Shorter encoding available. UTF-8 mandates that shortest possible encoding - * is used, as otherwise doing UTF-8 => anything => UTF-8 could bypass some - * important tests, like '/' for path separator or \0 for string termination. - * - * This test is not correct for charLen == 1, as its disallowed range is - * 0x00-0x7F, while this test disallows only 0x00-0x3F. But this part of - * problem is solved by stopping when 0xC1 is encountered, as 0xC1 0xXX - * describes just this range. This also means that 0xC0 and 0xC1 cannot - * ever occur in valid UTF-8 string. - */ - if (uniChar < 1U << (charLen * 5 + 1)) { - return FALSE; - } - } - - /* - * Here we have UCS-4 character in uniChar, between 0 and 0x7FFFFFFF. - * Let's convert it to UTF-16. - */ + if (GetShortPathNameW(pathW, shortPathW, ARRAYSIZE(shortPathW)) == 0) { + goto exit; + } - /* Non-paired surrogates are illegal in UTF-16. */ - if (uniChar >= 0xD800 && uniChar < 0xE000) { - return FALSE; - } - if (uniChar < 0x10000) { - neededSize = currentSize + sizeof *buf; - } else if (uniChar < 0x110000) { - neededSize = currentSize + 2 * sizeof *buf; - } else { - /* This character cannot be represented in UTF-16. */ - return FALSE; - } - if (allocatedSize < neededSize) { - if (DynBuf_Enlarge(db, neededSize) == FALSE) { - return FALSE; - } - allocatedSize = DynBuf_GetAllocatedSize(db); - ASSERT(neededSize <= allocatedSize); - buf = (uint16 *)((char *)DynBuf_Get(db) + currentSize); - } - if (uniChar < 0x10000) { - *buf++ = uniChar; - } else { - *buf++ = 0xD800 + ((uniChar - 0x10000) >> 10); - *buf++ = 0xDC00 + ((uniChar - 0x10000) & 0x3FF); - } - currentSize = neededSize; + if (!CodeSetOld_Utf16leToCurrent((const char *)shortPathW, + wcslen(shortPathW) * sizeof *shortPathW, + &path, NULL)) { + goto exit; } - /* All went fine, update buffer size. */ - DynBuf_SetSize(db, currentSize); - return TRUE; -} + exit: +#endif // _WIN32 -#if defined(_WIN32) + return path; +} -static Bool IsWin95(void); -static DWORD GetInvalidCharsFlag(void); /* - * Win32-specific remarks: here is my understanding of those terms as of - * 2002/02/12: + *----------------------------------------------------------------------------- * - * ANSI code page - * The character set used internally by Windows applications (when they are - * not fully Unicode). + * CodeSet_DontUseIcu -- * - * OEM code page - * The character set used by MS-DOS and stored in the FAT filesystem. + * Tell codeset not to load or use ICU (or stop using it if it's + * already loaded). Codeset will fall back on codesetOld.c, which + * relies on system internationalization APIs (and may have more + * limited functionality). Not all APIs have a fallback, however + * (namely GenericToGeneric). * - * --hpreg + * Results: + * TRUE on success + * FALSE on failure + * + * Side effects: + * See above + * + *----------------------------------------------------------------------------- */ +void +CodeSet_DontUseIcu(void) +{ + dontUseIcu = TRUE; +} + /* *----------------------------------------------------------------------------- * - * CodeSetGenericToUtf16le -- + * CodeSet_Init -- * - * Append the content of a buffer (that uses the specified encoding) to a - * DynBuf (that uses the UTF-16LE encoding) --hpreg + * Looks for ICU's data file in some platform-specific + * directory. If present, inits ICU by feeding it the path to that + * directory. If already inited, returns the current state (init + * failed/succeeded). + * + * Call while single-threaded. + * + * *********** WARNING *********** + * Do not call CodeSet_Init directly, it is called already by + * Unicode_Init. Lots of code depends on codeset. Please call + * Unicode_Init as early as possible. + * ******************************* * * Results: * TRUE on success * FALSE on failure * * Side effects: - * None + * See above * *----------------------------------------------------------------------------- */ -static Bool -CodeSetGenericToUtf16le(UINT codeIn, // IN - char const *bufIn, // IN - size_t sizeIn, // IN - DynBuf *db) // IN -{ - /* - * Undocumented: calling MultiByteToWideChar() with sizeIn == 0 returns 0 - * with GetLastError() set to ERROR_INVALID_PARAMETER. Isn't this API - * robust? --hpreg - */ - if (sizeIn) { - size_t initialSize; - DWORD flags = GetInvalidCharsFlag(); - Bool invalidCharsCheck = ((flags & MB_ERR_INVALID_CHARS) != 0); - - initialSize = DynBuf_GetSize(db); - for (;;) { - int result; - int resultReverse; - DWORD error = ERROR_SUCCESS; +Bool +CodeSet_Init(const char *icuDataDir) // IN: ICU data file location in Current code page. + // Default is used if NULL. +{ + DynBuf dbpath; +#ifdef _WIN32 + DWORD attribs; + utf16_t *modPath = NULL; + utf16_t *lastSlash; +#else + struct stat finfo; +#endif + char *path = NULL; + Bool ret = FALSE; - if (DynBuf_Enlarge(db, sizeof(wchar_t)) == FALSE) { - return FALSE; - } + DynBuf_Init(&dbpath); - /* - * Must fail if bufIn has any invalid characters. - * So MB_ERR_INVALID_CHARS added, otherwise can - * lead to security issues see bug 154114. - */ - result = MultiByteToWideChar(codeIn, - flags, - bufIn, - (int) sizeIn, - (wchar_t *)((char *)DynBuf_Get(db) + initialSize), - (int) ((DynBuf_GetAllocatedSize(db) - initialSize) / - sizeof(wchar_t))); + DEBUG_ONLY(ASSERT(!initedIcu);) + DEBUG_ONLY(initedIcu = TRUE;) - if (0 == result) { - error = GetLastError(); // may be ERROR_NO_UNICODE_TRANSLATION - } +#ifdef USE_ICU + /* + * We're using system ICU, which finds its own data. So nothing to + * do here. + */ + dontUseIcu = FALSE; + ret = TRUE; + goto exit; +#endif - /* - * Success if: result is > 0 and is the same number - * of characters as the input string contains. If there - * are any invalid characters, the Win2K SP4 or later will - * fail, but for earlier OS versions, these invalid characters - * will be dropped. Thus only succeed if we have no dropped - * characters. - * For the older platforms which don't fail for invalid characters - * we see if the reverse conversion of the converted string - * yields the same string size that was passed in. - * If not, then dropped characters so fail. - */ - if (!invalidCharsCheck) { - resultReverse = WideCharToMultiByte(codeIn, 0, - (wchar_t *)((char *)DynBuf_Get(db) + initialSize), - result, NULL, 0, 0, 0); - } - if (result > 0 && - (invalidCharsCheck || - (sizeIn == resultReverse))) { - DynBuf_SetSize(db, initialSize + result * sizeof(wchar_t)); - break; - } + /* + * ********************* WARNING + * Must avoid recursive calls into the codeset library here, hence + * the idiotic hoop-jumping. DO NOT change any of these calls to + * wrapper equivalents or call any other functions that may perform + * string conversion. + * ********************* WARNING + */ - if (result > 0 && (!invalidCharsCheck && sizeIn != resultReverse)) { - return FALSE; +#ifdef _WIN32 // { + +#if vmx86_devel + /* + * Devel builds use toolchain directory first. + */ + { + WCHAR icuFilePath[MAX_PATH] = { 0 }; + DWORD n = ExpandEnvironmentStringsW(ICU_DATA_FILE_PATH, + icuFilePath, ARRAYSIZE(icuFilePath)); + if (n > 0 && n < ARRAYSIZE(icuFilePath)) { + attribs = GetFileAttributesW(icuFilePath); + if ((INVALID_FILE_ATTRIBUTES != attribs) || + (attribs & FILE_ATTRIBUTE_DIRECTORY) == 0) { + if (!CodeSetOld_Utf16leToCurrent((const char *) icuFilePath, + n * sizeof *icuFilePath, + &path, NULL)) { + goto exit; + } + goto found; } + } + } +#endif - ASSERT(result == 0); + if (icuDataDir) { + /* + * Data file must be in the specified directory. + */ + size_t length = strlen(icuDataDir); - if (error != ERROR_INSUFFICIENT_BUFFER) { - return FALSE; + if (!DynBuf_Append(&dbpath, icuDataDir, length)) { + goto exit; + } + if (length && icuDataDir[length - 1] != DIRSEPC) { + if (!DynBuf_Append(&dbpath, DIRSEPS, strlen(DIRSEPS))) { + goto exit; } + } + if (!DynBuf_Append(&dbpath, ICU_DATA_FILE, strlen(ICU_DATA_FILE)) || + !DynBuf_Append(&dbpath, "\0", 1)) { + goto exit; + } - /* Need a larger buffer --hpreg */ + /* + * Check for file existence. + */ + attribs = GetFileAttributesA(DynBuf_Get(&dbpath)); + + if ((INVALID_FILE_ATTRIBUTES == attribs) || + (attribs & FILE_ATTRIBUTE_DIRECTORY)) { + goto exit; } - } - return TRUE; -} + path = (char *) DynBuf_Detach(&dbpath); + } else { + /* + * Data file must be in current module directory. + */ + modPath = CodeSetGetModulePath(NULL); + if (!modPath) { + goto exit; + } + lastSlash = wcsrchr(modPath, DIRSEPC_W); + if (!lastSlash) { + goto exit; + } -/* - *----------------------------------------------------------------------------- - * - * CodeSetUtf16leToGeneric -- - * - * Append the content of a buffer (that uses the UTF-16LE encoding) to a - * DynBuf (that uses the specified encoding) --hpreg - * - * Results: - * TRUE on success - * FALSE on failure - * - * Side effects: - * None - * - *----------------------------------------------------------------------------- - */ + *lastSlash = L'\0'; -static Bool -CodeSetUtf16leToGeneric(char const *bufIn, // IN - size_t sizeIn, // IN - UINT codeOut, // IN - DynBuf *db) // IN -{ - /* - * Undocumented: calling WideCharToMultiByte() with sizeIn == 0 returns 0 - * with GetLastError() set to ERROR_INVALID_PARAMETER. Isn't this API - * robust? --hpreg - */ - if (sizeIn) { - size_t initialSize; - - initialSize = DynBuf_GetSize(db); - for (;;) { - int result; - DWORD error; + if (!DynBuf_Append(&dbpath, modPath, + wcslen(modPath) * sizeof(utf16_t)) || + !DynBuf_Append(&dbpath, DIRSEPS_W, + wcslen(DIRSEPS_W) * sizeof(utf16_t)) || + !DynBuf_Append(&dbpath, ICU_DATA_FILE_W, + wcslen(ICU_DATA_FILE_W) * sizeof(utf16_t)) || + !DynBuf_Append(&dbpath, L"\0", 2)) { + goto exit; + } - if (DynBuf_Enlarge(db, 1) == FALSE) { - return FALSE; - } + /* + * Check for file existence. + */ + attribs = GetFileAttributesW((LPCWSTR) DynBuf_Get(&dbpath)); + + if ((INVALID_FILE_ATTRIBUTES == attribs) || + (attribs & FILE_ATTRIBUTE_DIRECTORY)) { + goto exit; + } - result = WideCharToMultiByte(codeOut, - 0, - (wchar_t const *)bufIn, - (int) (sizeIn / sizeof(wchar_t)), - (char *)DynBuf_Get(db) + initialSize, - (int) (DynBuf_GetAllocatedSize(db) - initialSize), - NULL, - /* - * XXX We may need to pass that argument - * to know when the conversion was - * not possible --hpreg - */ - NULL); - if (result > 0) { - DynBuf_SetSize(db, initialSize + result); - break; + /* + * Convert path to local encoding using system APIs (old codeset). + */ + if (!CodeSetOld_Utf16leToCurrent(DynBuf_Get(&dbpath), + DynBuf_GetSize(&dbpath), + &path, NULL)) { + + /* + * The unicode path is not compatible in the current encoding. + */ + path = CodeSet_GetAltPathName(DynBuf_Get(&dbpath)); + if (!path) { + goto exit; } + } + } + +#else // } _WIN32 { - ASSERT(result == 0); +#if vmx86_devel + { + char *modPath; + char *lastSlash; - /* Must come first --hpreg */ - error = GetLastError(); + /* + * Devel builds use toolchain directory first. + */ + if (stat(ICU_DATA_FILE_PATH, &finfo) >= 0 && !S_ISDIR(finfo.st_mode)) { + if ((path = strdup(ICU_DATA_FILE_PATH)) == NULL) { + goto exit; + } + goto found; + } - if (error != ERROR_INSUFFICIENT_BUFFER) { - return FALSE; + /* + * Then we try module directory, if we can get it. + */ + modPath = CodeSetGetModulePath(HGMP_PRIVILEGE); + if (modPath) { + lastSlash = strrchr(modPath, DIRSEPC); + if (lastSlash) { + *lastSlash = '\0'; + + if (DynBuf_Append(&dbpath, modPath, strlen(modPath)) && + DynBuf_Append(&dbpath, DIRSEPS, strlen(DIRSEPS)) && + DynBuf_Append(&dbpath, ICU_DATA_FILE, + strlen(ICU_DATA_FILE)) && + DynBuf_Append(&dbpath, "\0", 1)) { + + if ((stat((const char *) DynBuf_Get(&dbpath), &finfo) >= 0) && + !S_ISDIR(finfo.st_mode)) { + free(modPath); + path = DynBuf_Detach(&dbpath); + goto found; + } else { + DynBuf_SetSize(&dbpath, 0); + } + } } - /* Need a larger buffer --hpreg */ + free(modPath); } } +#endif // vmx86_devel /* - * Undocumented: if the input buffer is not NUL-terminated, the output - * buffer will not be NUL-terminated either --hpreg + * Data file is either in POSIX_ICU_DIR or user specified dir. */ - return TRUE; + if (!icuDataDir) { + icuDataDir = POSIX_ICU_DIR; + } + if (!DynBuf_Append(&dbpath, icuDataDir, strlen(icuDataDir)) || + !DynBuf_Append(&dbpath, DIRSEPS, strlen(DIRSEPS)) || + !DynBuf_Append(&dbpath, ICU_DATA_FILE, strlen(ICU_DATA_FILE)) || + !DynBuf_Append(&dbpath, "\0", 1)) { + goto exit; + } + + /* + * Check for file existence. (DO NOT CHANGE TO 'stat' WRAPPER). + */ + path = (char *) DynBuf_Detach(&dbpath); + if (stat(path, &finfo) < 0 || S_ISDIR(finfo.st_mode)) { + goto exit; + } + +#endif // } _WIN32 + +#if vmx86_devel +found: +#endif + + /* + * Tell ICU to use this directory. + */ + u_setDataDirectory(path); + + dontUseIcu = FALSE; + ret = TRUE; + + exit: + if (!ret) { + /* + * There was an error initing ICU, but if we can fall back on + * non-ICU (old CodeSet) then things are OK. + */ + if (CODESET_CAN_FALLBACK_ON_NON_ICU) { + ret = TRUE; + dontUseIcu = TRUE; + +#ifdef _WIN32 + OutputDebugStringW(L"CodeSet_Init: no ICU\n"); +#endif + } + } + +#ifdef _WIN32 + free(modPath); +#endif + free(path); + DynBuf_Destroy(&dbpath); + + return ret; } +#if defined(CURRENT_IS_UTF8) + /* *----------------------------------------------------------------------------- * - * CodeSetUtf16leToCurrent -- + * CodeSetDuplicateUtf8Str -- * - * Convert the content of a buffer (that uses the UTF-16LE encoding) into - * another buffer (that uses the current encoding) --hpreg + * Duplicate UTF-8 string, appending zero terminator to its end. * * Results: - * TRUE on success: '*bufOut' contains the allocated, NUL terminated buffer. - * If not NULL, '*sizeOut' contains the size of the buffer - * (excluding the NUL terminator) + * TRUE on success * FALSE on failure * * Side effects: - * None + * None. * *----------------------------------------------------------------------------- */ static Bool -CodeSetUtf16leToCurrent(char const *bufIn, // IN - size_t sizeIn, // IN - char **bufOut, // OUT - size_t *sizeOut) // OUT +CodeSetDuplicateUtf8Str(const char *bufIn, // IN: Input string + size_t sizeIn, // IN: Input string length + char **bufOut, // OUT: "Converted" string + size_t *sizeOut) // OUT: Length of string { - DynBuf db; - Bool ok; + char *myBufOut; - DynBuf_Init(&db); - /* XXX We should probably use CP_THREAD_ACP on Windows 2000/XP --hpreg */ - ok = CodeSetUtf16leToGeneric(bufIn, sizeIn, CP_ACP, &db); - return CodeSetDynBufFinalize(ok, &db, bufOut, sizeOut); + myBufOut = malloc(sizeIn + 1); + if (myBufOut == NULL) { + return FALSE; + } + + memcpy(myBufOut, bufIn, sizeIn); + memset(myBufOut + sizeIn, 0, 1); + + *bufOut = myBufOut; + if (sizeOut) { + *sizeOut = sizeIn; + } + return TRUE; } -#endif + +#endif // defined(CURRENT_IS_UTF8) -#if defined(__APPLE__) /* *----------------------------------------------------------------------------- * - * CodeSetUtf8Normalize -- + * CodeSetDynBufFinalize -- * - * Convert the content of a buffer (that uses the UTF-8 encoding) into - * another buffer (that uses the UTF-8 encoding) that is in precomposed - (Normalization Form C) or decomposed (Normalization Form D). + * Append NUL terminator to the buffer, and return pointer to + * buffer and its data size (before appending terminator). Destroys + * buffer on failure. * * Results: - * TRUE on success: '*bufOut' contains a NUL terminated buffer. - * If not NULL, '*sizeOut' contains the size of the buffer - * (excluding the NUL terminator) + * TRUE on success * FALSE on failure * * Side effects: - * '*bufOut' contains the allocated, NUL terminated buffer. + * None. * *----------------------------------------------------------------------------- */ static Bool -CodeSetUtf8Normalize(char const *bufIn, // IN - size_t sizeIn, // IN - Bool precomposed, // IN - DynBuf *db) // OUT -{ - Bool ok = FALSE; - CFStringRef str = NULL; - CFMutableStringRef mutStr = NULL; - CFIndex len, lenMut; - size_t initialSize = DynBuf_GetSize(db); - - str = CFStringCreateWithCString(NULL, - bufIn, - kCFStringEncodingUTF8); - if (str == NULL) { - goto exit; - } - - mutStr = CFStringCreateMutableCopy(NULL, 0, str); - if (mutStr == NULL) { - goto exit; - } - - /* - * Normalize the string, Form C - precomposed or D, not. - */ - CFStringNormalize(mutStr, - (precomposed ? kCFStringNormalizationFormC : - kCFStringNormalizationFormD)); - - /* - * Get the number (in terms of UTF-16 code units) - * of characters in a string. - */ - lenMut = CFStringGetLength(mutStr); - - /* - * Retrieve the maximum number of bytes a string of a - * specified length (in UTF-16 code units) will take up - * if encoded in a specified encoding. - */ - len = CFStringGetMaximumSizeForEncoding(lenMut, - kCFStringEncodingUTF8); - if (len + 1 > initialSize) { - if (DynBuf_Enlarge(db, len + 1 - initialSize) == FALSE) { - ok = FALSE; - goto exit; - } - } - +CodeSetDynBufFinalize(Bool ok, // IN: Earlier steps succeeded + DynBuf *db, // IN: Buffer with converted string + char **bufOut, // OUT: Converted string + size_t *sizeOut) // OUT: Length of string in bytes +{ /* - * Copies the character contents of a string to a local C - * string buffer after converting the characters to UTF-8. + * NUL can be as long as 4 bytes if UTF-32, make no assumptions. */ - ok = CFStringGetCString(mutStr, - (char *)DynBuf_Get(db), - len + 1, - kCFStringEncodingUTF8); - if (ok) { - /* Remove the NUL terminator that the above includes. */ - DynBuf_SetSize(db, strlen((char *)DynBuf_Get(db))); + if (!ok || !DynBuf_Append(db, "\0\0\0\0", 4) || !DynBuf_Trim(db)) { + DynBuf_Destroy(db); + return FALSE; } -exit: - if (str) { - CFRelease(str); - } - if (mutStr) { - CFRelease(mutStr); + *bufOut = DynBuf_Get(db); + if (sizeOut) { + *sizeOut = DynBuf_GetSize(db) - 4; } - - return ok; + return TRUE; } -#endif /* defined(__APPLE__) */ - -#ifdef USE_ICONV /* - * Linux-specific remarks: + *----------------------------------------------------------------------------- + * + * CodeSetUtf8ToUtf16le -- * - * We use UTF-16 instead of UCS-2, because Windows 2000 introduces support - * for basic input, output, and simple sorting of surrogates. + * Append the content of a buffer (that uses the UTF-8 encoding) to a + * DynBuf (that uses the UTF-16LE encoding) + * + * Results: + * TRUE on success + * FALSE on failure * - * We use UTF-16LE instead of UTF-16 so that iconv() does not prepend a BOM. + * Side effects: + * None * - * --hpreg + *----------------------------------------------------------------------------- */ +static Bool +CodeSetUtf8ToUtf16le(const char *bufIn, // IN + size_t sizeIn, // IN + DynBuf *db) // IN +{ + return CodeSet_GenericToGenericDb("UTF-8", bufIn, sizeIn, "UTF-16LE", 0, + db); +} + + +#if defined(__APPLE__) /* *----------------------------------------------------------------------------- * - * CodeSetGetCurrentCodeSet -- + * CodeSet_Utf8Normalize -- * - * Return currently active code set - always UTF-8 on Apple (and old Linux), - * and reported by nl_langinfo on Linux & Solaris. + * Calls down to CodeSetOld_Utf8Normalize. * * Results: - * TRUE on success - * FALSE on failure + * See CodeSetOld_Utf8Normalize. * * Side effects: - * None + * See CodeSetOld_Utf8Normalize. * *----------------------------------------------------------------------------- */ -static INLINE const char * -CodeSetGetCurrentCodeSet(void) +Bool +CodeSet_Utf8Normalize(const char *bufIn, // IN + size_t sizeIn, // IN + Bool precomposed, // IN + DynBuf *db) // OUT { -#if defined(CURRENT_IS_UTF8) - /* - * This code is used in - * 1. tools which need to support older glibc versions in which - * internationalization functions are not available. - * 2. Mac OS which we always assume UTF-8 - * On such systems we revert to the original behaviour of this code which - * simply copies the input buffer into the output. - */ - - return "UTF-8"; -#else - return nl_langinfo(CODESET); -#endif + return CodeSetOld_Utf8Normalize(bufIn, sizeIn, precomposed, db); } +#endif /* defined(__APPLE__) */ -#if defined(USE_ICONV) /* *----------------------------------------------------------------------------- * - * CodeSetIconvOpen -- + * CodeSet_GetCurrentCodeSet -- * - * Open iconv translator with requested flags. Currently only no flags, - * and both CSGTG_TRANSLIT and CSGTG_IGNORE together are supported, as - * this is only thing we need. If translit/ignore convertor fails, - * then non-transliterating conversion is used. + * Return native code set name. Always calls down to + * CodeSetOld_GetCurrentCodeSet. See there for more details. * * Results: - * (iconv_t)-1 on failure - * iconv handle on success + * See CodeSetOld_GetCurrentCodeSet. * * Side effects: - * None. + * See CodeSetOld_GetCurrentCodeSet. * *----------------------------------------------------------------------------- */ -static INLINE_SINGLE_CALLER iconv_t -CodeSetIconvOpen(const char *codeIn, // IN - const char *codeOut, // IN - unsigned int flags) // IN -{ -#ifdef __linux__ - if (flags) { - char *codeOutExt; - - ASSERT(flags == (CSGTG_TRANSLIT | CSGTG_IGNORE)); - /* - * We should be using //TRANSLIT,IGNORE, but glibc versions older than - * 2.3.4 (in particular, the version that ships with redhat linux 9.0) - * are subtly broken when passing options with a comma, in such a way - * that iconv_open will succeed but iconv_close can crash. For now, we - * only use TRANSLIT and bail out after the first non-translitible - * character. - */ - codeOutExt = Str_Asprintf(NULL, "%s//TRANSLIT", codeOut); - if (codeOutExt) { - iconv_t cd = iconv_open(codeOutExt, codeIn); - free(codeOutExt); - if (cd != (iconv_t)-1) { - return cd; - } - } - } -#endif - return iconv_open(codeOut, codeIn); +const char * +CodeSet_GetCurrentCodeSet(void) +{ + return CodeSetOld_GetCurrentCodeSet(); } /* *----------------------------------------------------------------------------- * - * CodeSetGenericToGeneric -- + * CodeSet_GenericToGenericDb -- * * Append the content of a buffer (that uses the specified encoding) to a - * DynBuf (that uses the specified encoding). --hpreg + * DynBuf (that uses the specified encoding). * * Results: * TRUE on success * FALSE on failure * * Side effects: - * None + * String (sans NUL-termination) is appended to db. * *----------------------------------------------------------------------------- */ -static Bool -CodeSetGenericToGeneric(char const *codeIn, // IN - char const *bufIn, // IN - size_t sizeIn, // IN - char const *codeOut, // IN - DynBuf *db, // IN/OUT - size_t flags) // IN -{ - iconv_t cd; +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 result = FALSE; + UErrorCode uerr; + const char *bufInCur; + const char *bufInEnd; + UChar bufPiv[1024]; + UChar *bufPivSource; + UChar *bufPivTarget; + UChar *bufPivEnd; + char *bufOut; + char *bufOutCur; + char *bufOutEnd; + size_t bufOutSize; + size_t bufOutOffset; + UConverter *cvin = NULL; + UConverter *cvout = NULL; + UConverterToUCallback toUCb; + UConverterFromUCallback fromUCb; ASSERT(codeIn); ASSERT(sizeIn == 0 || bufIn); ASSERT(codeOut); ASSERT(db); + ASSERT((CSGTG_NORMAL == flags) || (CSGTG_TRANSLIT == flags) || + (CSGTG_IGNORE == flags)); - cd = CodeSetIconvOpen(codeIn, codeOut, flags); - if (cd == (iconv_t)-1) { - return FALSE; + if (dontUseIcu) { + // fall back + return CodeSetOld_GenericToGenericDb(codeIn, bufIn, sizeIn, codeOut, + flags, db); } + /* + * Trivial case. + */ + + if ((0 == sizeIn) || (NULL == bufIn)) { + result = TRUE; + goto exit; + } + + /* + * Open converters. + */ + + uerr = U_ZERO_ERROR; + cvin = ucnv_open(codeIn, &uerr); + if (!cvin) { + goto exit; + } + + uerr = U_ZERO_ERROR; + cvout = ucnv_open(codeOut, &uerr); + if (!cvout) { + goto exit; + } + + /* + * Set callbacks according to flags. + */ + + switch (flags) { + case CSGTG_NORMAL: + toUCb = UCNV_TO_U_CALLBACK_STOP; + fromUCb = UCNV_FROM_U_CALLBACK_STOP; + break; + + case CSGTG_TRANSLIT: + toUCb = UCNV_TO_U_CALLBACK_SUBSTITUTE; + fromUCb = UCNV_FROM_U_CALLBACK_SUBSTITUTE; + break; + + case CSGTG_IGNORE: + toUCb = UCNV_TO_U_CALLBACK_SKIP; + fromUCb = UCNV_FROM_U_CALLBACK_SKIP; + break; + + default: + NOT_IMPLEMENTED(); + break; + } + + uerr = U_ZERO_ERROR; + ucnv_setToUCallBack(cvin, toUCb, NULL, NULL, NULL, &uerr); + if (U_ZERO_ERROR != uerr) { + goto exit; + } + + uerr = U_ZERO_ERROR; + ucnv_setFromUCallBack(cvout, fromUCb, NULL, NULL, NULL, &uerr); + if (U_ZERO_ERROR != uerr) { + goto exit; + } + + /* + * Convert using ucnv_convertEx(). + * As a starting guess, make the output buffer the same size as + * the input string (with a fudge constant added in to avoid degen + * cases). + */ + + bufInCur = bufIn; + bufInEnd = bufIn + sizeIn; + bufOutSize = sizeIn + 4; + bufOutOffset = 0; + bufPivSource = bufPiv; + bufPivTarget = bufPiv; + bufPivEnd = bufPiv + ARRAYSIZE(bufPiv); + for (;;) { - size_t size; - char *out; - char *outOrig; - size_t outLeft; - size_t status; + if (!DynBuf_Enlarge(db, bufOutSize)) { + goto exit; + } + bufOut = DynBuf_Get(db); + bufOutCur = bufOut + bufOutOffset; + bufOutSize = DynBuf_GetAllocatedSize(db); + bufOutEnd = bufOut + bufOutSize; + + uerr = U_ZERO_ERROR; + ucnv_convertEx(cvout, cvin, &bufOutCur, bufOutEnd, + &bufInCur, bufInEnd, + bufPiv, &bufPivSource, &bufPivTarget, bufPivEnd, + FALSE, TRUE, &uerr); - /* - * Every character we care about can occupy at most - * 4 bytes - UCS-4 is 4 bytes, UTF-16 is 2+2 bytes, - * and UTF-8 is also at most 4 bytes for all - * characters under 0x1FFFFF. - * - * If we allocate too small buffer nothing critical - * happens except that in //IGNORE case some - * implementations might return EILSEQ instead of - * E2BIG. By having at least 4 bytes available we - * can be sure that at least one character is - * converted each call to iconv(). - */ - size = DynBuf_GetSize(db); - if (DynBuf_Enlarge(db, size + 4) == FALSE) { - goto error; + if (!U_FAILURE(uerr)) { + /* + * "This was a triumph. + * I'm making a note here: + * HUGE SUCCESS. + * It's hard to overstate + * my satisfaction." + */ + + break; } - out = (int8 *)DynBuf_Get(db) + size; - outOrig = out; - outLeft = DynBuf_GetAllocatedSize(db) - size; + if (U_BUFFER_OVERFLOW_ERROR != uerr) { + // failure + goto exit; + } /* - * From glibc 2.2 onward bufIn is no longer const due to a change - * in the standard. However, the implementation of iconv doesn't - * change bufIn so a simple cast is safe. --plangdale + * Our guess at 'bufOutSize' was obviously wrong, just double it. + * We'll be reallocating bufOut, so will need to recompute bufOutCur + * based on bufOutOffset. */ -#if defined(GLIBC_VERSION_22) - status = iconv(cd, (char **)&bufIn, &sizeIn, &out, &outLeft); -#else - status = iconv(cd, &bufIn, &sizeIn, &out, &outLeft); -#endif - DynBuf_SetSize(db, size + out - outOrig); + bufOutSize *= 2; + bufOutOffset = bufOutCur - bufOut; + } - /* - * If all input characters were consumed, we are done. - * Otherwise if at least one character was produced by conversion - * then just increase buffer size and try again - with //IGNORE - * iconv() returns an error (EILSEQ) but still processes as - * many characters as possible. If no characters were produced, - * then consult error code - do not consult return value in other - * cases, it can be either random positive value (if some - * characters were transliterated) or even -1 with errno set to - * EILSEQ (if some characters were ignored). - */ - if (sizeIn == 0) { - break; - } - if (out == outOrig) { - if (status != -1) { - goto error; - } - /* - * Some libc implementations (one on ESX3, and one on Ganesh's - * box) silently ignore //IGNORE. So if caller asked for - * getting conversion done at any cost, just return success - * even if failure occured. User will get truncated - * message, but that's our best. We have no idea whether - * incoming encoding is 8bit, 16bit, or what, so we cannot - * skip over characters in input stream and recover :-( - */ - if ((flags & CSGTG_IGNORE) && errno == EILSEQ) { - break; - } - if (errno != E2BIG) { - goto error; - } - } - /* Need a larger buffer --hpreg */ + /* + * Set final size and return. + */ + + DynBuf_SetSize(db, bufOutCur - bufOut); + + result = TRUE; + + exit: + if (cvin) { + ucnv_close(cvin); } - if (iconv_close(cd) < 0) { - return FALSE; + if (cvout) { + ucnv_close(cvout); } - return TRUE; + return result; +} -error: - iconv_close(cd); - return FALSE; +/* + *----------------------------------------------------------------------------- + * + * CodeSet_GenericToGeneric -- + * + * Non-db version of CodeSet_GenericToGenericDb. + * + * Results: + * TRUE on success, plus allocated string + * FALSE on failure + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +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, // OUT + size_t *sizeOut) // OUT +{ + DynBuf db; + Bool ok; + + DynBuf_Init(&db); + ok = CodeSet_GenericToGenericDb(codeIn, bufIn, sizeIn, codeOut, flags, &db); + return CodeSetDynBufFinalize(ok, &db, bufOut, sizeOut); } -#endif -#endif /* @@ -909,7 +1070,7 @@ * CodeSet_Utf8ToCurrent -- * * Convert the content of a buffer (that uses the UTF-8 encoding) into - * another buffer (that uses the current encoding) --hpreg + * another buffer (that uses the current encoding). * * Results: * TRUE on success: '*bufOut' contains the allocated, NUL terminated buffer. @@ -924,110 +1085,30 @@ */ Bool -CodeSet_Utf8ToCurrent(char const *bufIn, // IN - size_t sizeIn, // IN - char **bufOut, // OUT - size_t *sizeOut) // OUT +CodeSet_Utf8ToCurrent(const char *bufIn, // IN + size_t sizeIn, // IN + char **bufOut, // OUT + size_t *sizeOut) // OUT { -#if defined(CURRENT_IS_UTF8) - return CodeSetDuplicateStr(bufIn, sizeIn, bufOut, sizeOut); -#elif defined(USE_ICONV) +#if !defined(CURRENT_IS_UTF8) DynBuf db; Bool ok; - - DynBuf_Init(&db); - ok = CodeSetGenericToGeneric("UTF-8", bufIn, sizeIn, - CodeSetGetCurrentCodeSet(), &db, CSGTG_NORMAL); - return CodeSetDynBufFinalize(ok, &db, bufOut, sizeOut); -#elif defined(_WIN32) - char *buf; - size_t size; - Bool status; - - if (CodeSet_Utf8ToUtf16le(bufIn, sizeIn, &buf, &size) == FALSE) { - if (IsWin95()) { - /* - * Win95 doesnt support UTF-8 by default. If we are here, - * it means that the application was not linked with unicows.lib. - * So simply copy the buffer as is. - */ - return CodeSetDuplicateStr(bufIn, sizeIn, bufOut, sizeOut); - } - return FALSE; - } - - status = CodeSetUtf16leToCurrent(buf, size, bufOut, sizeOut); - free(buf); - - return status; -#else - return FALSE; #endif -} - -/* - *----------------------------------------------------------------------------- - * - * CodeSet_Utf8ToCurrentTranslit -- - * - * Convert the content of a buffer (that uses the UTF-8 encoding) into - * another buffer (that uses the current encoding). Transliterate - * characters which can be transliterated, and ignore characters which - * cannot be even transliterated. - * - * Results: - * TRUE on success: '*bufOut' contains the allocated, NUL terminated buffer. - * If not NULL, '*sizeOut' contains the size of the buffer - * (excluding the NUL terminator) - * FALSE on failure - * - * Side effects: - * None - * - *----------------------------------------------------------------------------- - */ + /* + * Fallback if necessary. + */ + if (dontUseIcu) { + return CodeSetOld_Utf8ToCurrent(bufIn, sizeIn, bufOut, sizeOut); + } -Bool -CodeSet_Utf8ToCurrentTranslit(char const *bufIn, // IN - size_t sizeIn, // IN - char **bufOut, // OUT - size_t *sizeOut) // OUT -{ #if defined(CURRENT_IS_UTF8) - return CodeSetDuplicateStr(bufIn, sizeIn, bufOut, sizeOut); -#elif defined(USE_ICONV) - DynBuf db; - Bool ok; - + return CodeSetDuplicateUtf8Str(bufIn, sizeIn, bufOut, sizeOut); +#else DynBuf_Init(&db); - ok = CodeSetGenericToGeneric("UTF-8", bufIn, sizeIn, - CodeSetGetCurrentCodeSet(), &db, - CSGTG_TRANSLIT | CSGTG_IGNORE); + ok = CodeSet_GenericToGenericDb("UTF-8", bufIn, sizeIn, + CodeSet_GetCurrentCodeSet(), 0, &db); return CodeSetDynBufFinalize(ok, &db, bufOut, sizeOut); -#elif defined(_WIN32) - char *buf; - size_t size; - Bool status; - - if (CodeSet_Utf8ToUtf16le(bufIn, sizeIn, &buf, &size) == FALSE) { - if (IsWin95()) { - /* - * Win95 doesnt support UTF-8 by default. If we are here, - * it means that the application was not linked with unicows.lib. - * So simply copy the buffer as is. - */ - return CodeSetDuplicateStr(bufIn, sizeIn, bufOut, sizeOut); - } - return FALSE; - } - - status = CodeSetUtf16leToCurrent(buf, size, bufOut, sizeOut); - free(buf); - - return status; -#else - return FALSE; #endif } @@ -1038,7 +1119,7 @@ * CodeSet_CurrentToUtf8 -- * * Convert the content of a buffer (that uses the current encoding) into - * another buffer (that uses the UTF-8 encoding) --hpreg + * another buffer (that uses the UTF-8 encoding). * * Results: * TRUE on success: '*bufOut' contains the allocated, NUL terminated buffer. @@ -1053,43 +1134,30 @@ */ Bool -CodeSet_CurrentToUtf8(char const *bufIn, // IN - size_t sizeIn, // IN - char **bufOut, // OUT - size_t *sizeOut) // OUT +CodeSet_CurrentToUtf8(const char *bufIn, // IN + size_t sizeIn, // IN + char **bufOut, // OUT + size_t *sizeOut) // OUT { -#if defined(CURRENT_IS_UTF8) - return CodeSetDuplicateStr(bufIn, sizeIn, bufOut, sizeOut); -#elif defined(USE_ICONV) +#if !defined(CURRENT_IS_UTF8) DynBuf db; Bool ok; +#endif - DynBuf_Init(&db); - ok = CodeSetGenericToGeneric(CodeSetGetCurrentCodeSet(), bufIn, sizeIn, - "UTF-8", &db, CSGTG_NORMAL); - return CodeSetDynBufFinalize(ok, &db, bufOut, sizeOut); -#elif defined(_WIN32) - char *buf; - size_t size; - Bool status; - - if (CodeSet_CurrentToUtf16le(bufIn, sizeIn, &buf, &size) == FALSE) { - return FALSE; + /* + * Fallback if necessary. + */ + if (dontUseIcu) { + return CodeSetOld_CurrentToUtf8(bufIn, sizeIn, bufOut, sizeOut); } - status = CodeSet_Utf16leToUtf8(buf, size, bufOut, sizeOut); - free(buf); - if (!status && IsWin95()) { - /* - * Win95 doesnt support UTF-8 by default. If we are here, - * it means that the application was not linked with unicows.lib. - * So simply copy the buffer as is. - */ - return CodeSetDuplicateStr(bufIn, sizeIn, bufOut, sizeOut); - } - return status; +#if defined(CURRENT_IS_UTF8) + return CodeSetDuplicateUtf8Str(bufIn, sizeIn, bufOut, sizeOut); #else - return FALSE; + DynBuf_Init(&db); + ok = CodeSet_GenericToGenericDb(CodeSet_GetCurrentCodeSet(), bufIn, sizeIn, + "UTF-8", 0, &db); + return CodeSetDynBufFinalize(ok, &db, bufOut, sizeOut); #endif } @@ -1097,10 +1165,10 @@ /* *----------------------------------------------------------------------------- * - * CodeSet_Utf16leToUtf8_Db -- + * CodeSet_Utf16leToUtf8Db -- * * Append the content of a buffer (that uses the UTF-16LE encoding) to a - * DynBuf (that uses the UTF-8 encoding). --hpreg + * DynBuf (that uses the UTF-8 encoding). * * Results: * TRUE on success @@ -1113,18 +1181,19 @@ */ Bool -CodeSet_Utf16leToUtf8_Db(char const *bufIn, // IN - size_t sizeIn, // IN - DynBuf *db) // IN -{ -#if defined(USE_ICONV) - return CodeSetGenericToGeneric("UTF-16LE", bufIn, sizeIn, "UTF-8", db, CSGTG_NORMAL); -#elif defined(_WIN32) - return CodeSetUtf16leToGeneric(bufIn, sizeIn, CP_UTF8, db); -#else - NOT_IMPLEMENTED(); - return FALSE; -#endif +CodeSet_Utf16leToUtf8Db(const char *bufIn, // IN + size_t sizeIn, // IN + DynBuf *db) // IN +{ + /* + * Fallback if necessary. + */ + if (dontUseIcu) { + return CodeSetOld_Utf16leToUtf8Db(bufIn, sizeIn, db); + } + + return CodeSet_GenericToGenericDb("UTF-16LE", bufIn, sizeIn, "UTF-8", 0, + db); } @@ -1134,7 +1203,7 @@ * CodeSet_Utf16leToUtf8 -- * * Convert the content of a buffer (that uses the UTF-16LE encoding) into - * another buffer (that uses the UTF-8 encoding). --hpreg + * another buffer (that uses the UTF-8 encoding). * * The operation is inversible (its inverse is CodeSet_Utf8ToUtf16le). * @@ -1151,16 +1220,23 @@ */ Bool -CodeSet_Utf16leToUtf8(char const *bufIn, // IN - size_t sizeIn, // IN - char **bufOut, // OUT - size_t *sizeOut) // OUT +CodeSet_Utf16leToUtf8(const char *bufIn, // IN + size_t sizeIn, // IN + char **bufOut, // OUT + size_t *sizeOut) // OUT { DynBuf db; Bool ok; + /* + * Fallback if necessary. + */ + if (dontUseIcu) { + return CodeSetOld_Utf16leToUtf8(bufIn, sizeIn, bufOut, sizeOut); + } + DynBuf_Init(&db); - ok = CodeSet_Utf16leToUtf8_Db(bufIn, sizeIn, &db); + ok = CodeSet_Utf16leToUtf8Db(bufIn, sizeIn, &db); return CodeSetDynBufFinalize(ok, &db, bufOut, sizeOut); } @@ -1171,7 +1247,7 @@ * CodeSet_Utf8ToUtf16le -- * * Convert the content of a buffer (that uses the UTF-8 encoding) into - * another buffer (that uses the UTF-16LE encoding). --hpreg + * another buffer (that uses the UTF-16LE encoding). * * The operation is inversible (its inverse is CodeSet_Utf16leToUtf8). * @@ -1188,14 +1264,21 @@ */ Bool -CodeSet_Utf8ToUtf16le(char const *bufIn, // IN - size_t sizeIn, // IN - char **bufOut, // OUT - size_t *sizeOut) // OUT +CodeSet_Utf8ToUtf16le(const char *bufIn, // IN + size_t sizeIn, // IN + char **bufOut, // OUT + size_t *sizeOut) // OUT { DynBuf db; Bool ok; + /* + * Fallback if necessary. + */ + if (dontUseIcu) { + return CodeSetOld_Utf8ToUtf16le(bufIn, sizeIn, bufOut, sizeOut); + } + DynBuf_Init(&db); ok = CodeSetUtf8ToUtf16le(bufIn, sizeIn, &db); return CodeSetDynBufFinalize(ok, &db, bufOut, sizeOut); @@ -1225,16 +1308,23 @@ */ Bool -CodeSet_Utf8FormDToUtf8FormC(char const *bufIn, // IN +CodeSet_Utf8FormDToUtf8FormC(const char *bufIn, // IN size_t sizeIn, // IN char **bufOut, // OUT size_t *sizeOut) // OUT { + /* + * Fallback if necessary. + */ + if (dontUseIcu) { + return CodeSetOld_Utf8FormDToUtf8FormC(bufIn, sizeIn, bufOut, sizeOut); + } + #if defined(__APPLE__) DynBuf db; Bool ok; DynBuf_Init(&db); - ok = CodeSetUtf8Normalize(bufIn, sizeIn, TRUE, &db); + ok = CodeSet_Utf8Normalize(bufIn, sizeIn, TRUE, &db); return CodeSetDynBufFinalize(ok, &db, bufOut, sizeOut); #else NOT_IMPLEMENTED(); @@ -1265,16 +1355,23 @@ */ Bool -CodeSet_Utf8FormCToUtf8FormD(char const *bufIn, // IN +CodeSet_Utf8FormCToUtf8FormD(const char *bufIn, // IN size_t sizeIn, // IN char **bufOut, // OUT size_t *sizeOut) // OUT { + /* + * Fallback if necessary. + */ + if (dontUseIcu) { + return CodeSetOld_Utf8FormCToUtf8FormD(bufIn, sizeIn, bufOut, sizeOut); + } + #if defined(__APPLE__) DynBuf db; Bool ok; DynBuf_Init(&db); - ok = CodeSetUtf8Normalize(bufIn, sizeIn, FALSE, &db); + ok = CodeSet_Utf8Normalize(bufIn, sizeIn, FALSE, &db); return CodeSetDynBufFinalize(ok, &db, bufOut, sizeOut); #else NOT_IMPLEMENTED(); @@ -1303,26 +1400,24 @@ */ Bool -CodeSet_CurrentToUtf16le(char const *bufIn, // IN - size_t sizeIn, // IN - char **bufOut, // OUT - size_t *sizeOut) // OUT +CodeSet_CurrentToUtf16le(const char *bufIn, // IN + size_t sizeIn, // IN + char **bufOut, // OUT + size_t *sizeOut) // OUT { DynBuf db; Bool ok; + /* + * Fallback if necessary. + */ + if (dontUseIcu) { + return CodeSetOld_CurrentToUtf16le(bufIn, sizeIn, bufOut, sizeOut); + } + DynBuf_Init(&db); -#if defined(CURRENT_IS_UTF8) - ok = CodeSetUtf8ToUtf16le(bufIn, sizeIn, &db); -#elif defined(USE_ICONV) - ok = CodeSetGenericToGeneric(CodeSetGetCurrentCodeSet(), bufIn, sizeIn, - "UTF-16LE", &db, CSGTG_NORMAL); -#elif defined(_WIN32) - /* XXX We should probably use CP_THREAD_ACP on Windows 2000/XP. */ - ok = CodeSetGenericToUtf16le(CP_ACP, bufIn, sizeIn, &db); -#else - ok = FALSE; -#endif + ok = CodeSet_GenericToGenericDb(CodeSet_GetCurrentCodeSet(), bufIn, sizeIn, + "UTF-16LE", 0, &db); return CodeSetDynBufFinalize(ok, &db, bufOut, sizeOut); } @@ -1348,24 +1443,25 @@ */ Bool -CodeSet_Utf16leToCurrent(char const *bufIn, // IN - size_t sizeIn, // IN - char **bufOut, // OUT - size_t *sizeOut) // OUT +CodeSet_Utf16leToCurrent(const char *bufIn, // IN + size_t sizeIn, // IN + char **bufOut, // OUT + size_t *sizeOut) // OUT { -#if defined(USE_ICONV) DynBuf db; Bool ok; + /* + * Fallback if necessary. + */ + if (dontUseIcu) { + return CodeSetOld_Utf16leToCurrent(bufIn, sizeIn, bufOut, sizeOut); + } + DynBuf_Init(&db); - ok = CodeSetGenericToGeneric("UTF-16LE", bufIn, sizeIn, - CodeSetGetCurrentCodeSet(), &db, CSGTG_NORMAL); + ok = CodeSet_GenericToGenericDb("UTF-16LE", bufIn, sizeIn, + CodeSet_GetCurrentCodeSet(), 0, &db); return CodeSetDynBufFinalize(ok, &db, bufOut, sizeOut); -#elif defined(_WIN32) - return CodeSetUtf16leToCurrent(bufIn, sizeIn, bufOut, sizeOut); -#else // Not Windows or Linux or Solaris - return FALSE; -#endif } @@ -1390,99 +1486,66 @@ */ Bool -CodeSet_Utf16beToCurrent(char const *bufIn, // IN - size_t sizeIn, // IN - char **bufOut, // OUT - size_t *sizeOut) // OUT +CodeSet_Utf16beToCurrent(const char *bufIn, // IN + size_t sizeIn, // IN + char **bufOut, // OUT + size_t *sizeOut) // OUT { -#if defined(USE_ICONV) DynBuf db; Bool ok; - DynBuf_Init(&db); - ok = CodeSetGenericToGeneric("UTF-16BE", bufIn, sizeIn, - CodeSetGetCurrentCodeSet(), &db, CSGTG_NORMAL); - return CodeSetDynBufFinalize(ok, &db, bufOut, sizeOut); -#elif defined(_WIN32) - char c; - char *bufIn_dup; - int i; - Bool status = FALSE; - - bufIn_dup = NULL; - - /* sizeIn must be even */ - ASSERT((sizeIn & 1) == 0); - - /* Make a non-const copy */ - bufIn_dup = malloc(sizeIn); - if (bufIn_dup == NULL) { - goto error; - } - memcpy(bufIn_dup, bufIn, sizeIn); - - /* Swap pairs of bytes */ - for (i = 0; i < sizeIn; i += 2) { - c = bufIn_dup[i]; - bufIn_dup[i] = bufIn_dup[i + 1]; - bufIn_dup[i + 1] = c; + /* + * Fallback if necessary. + */ + if (dontUseIcu) { + return CodeSetOld_Utf16beToCurrent(bufIn, sizeIn, bufOut, sizeOut); } - status = CodeSetUtf16leToCurrent(bufIn_dup, sizeIn, bufOut, sizeOut); - - error: - free(bufIn_dup); - return status; -#else // Not Windows or Linux or Solaris - return FALSE; -#endif + DynBuf_Init(&db); + ok = CodeSet_GenericToGenericDb("UTF-16BE", bufIn, sizeIn, + CodeSet_GetCurrentCodeSet(), 0, &db); + return CodeSetDynBufFinalize(ok, &db, bufOut, sizeOut); } -#if defined(_WIN32) /* *----------------------------------------------------------------------------- * - * IsWin95 -- + * CodeSet_IsEncodingSupported -- * - * Is the current OS Windows 95? + * Ask ICU if it supports the specific encoding. * * Results: - * TRUE if this is Win95 - * FALSE if this is not Win95. + * TRUE on success + * FALSE on failure * * Side effects: - * none + * None * *----------------------------------------------------------------------------- */ -static Bool -IsWin95(void) +Bool +CodeSet_IsEncodingSupported(const char *name) // IN { - OSVERSIONINFOEX osvi; - BOOL bOsVersionInfoEx; + UConverter *cv; + UErrorCode uerr; /* - * Try calling GetVersionEx using the OSVERSIONINFOEX structure. - * If that fails, try using the OSVERSIONINFO structure. + * Fallback if necessary. */ - - ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX)); - osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); - - if(!(bOsVersionInfoEx = GetVersionEx ((OSVERSIONINFO *) &osvi))) { - /* If OSVERSIONINFOEX doesn't work, try OSVERSIONINFO. */ - osvi.dwOSVersionInfoSize = sizeof (OSVERSIONINFO); - if (!GetVersionEx((OSVERSIONINFO *) &osvi)) { - return FALSE; - } + if (dontUseIcu) { + return CodeSetOld_IsEncodingSupported(name); } - if (osvi.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) { - if (osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 0) { - return TRUE; - } + /* + * Try to open the encoding. + */ + uerr = U_ZERO_ERROR; + cv = ucnv_open(name, &uerr); + if (cv) { + ucnv_close(cv); + return TRUE; } return FALSE; @@ -1492,65 +1555,57 @@ /* *----------------------------------------------------------------------------- * - * GetInvalidCharsFlag -- + * CodeSet_Validate -- * - * The flag MB_ERR_INVALID_CHARS can only be passed to MultiByteToWideChar - * on Win2000 SP4 or later. If it's passed to an NT or 9x system, - * MultiByteToWideChar fails with ERR_INVALID_FLAGS. + * Validate a string in the given encoding. * * Results: - * returns MB_ERR_INVALID_CHARS if this flag is supported under current OS - * returns zero if the flag would case MultiByteToWideChar failure. + * TRUE if string is valid, + * FALSE otherwise. * * Side effects: - * none + * None * *----------------------------------------------------------------------------- */ -static DWORD -GetInvalidCharsFlag(void) +Bool +CodeSet_Validate(const char *buf, // IN: the string + size_t size, // IN: length of string + const char *code) // IN: encoding { - static volatile Bool bFirstCall = TRUE; - static DWORD retval; + UConverter *cv; + UErrorCode uerr; - OSVERSIONINFOEX osvi; - BOOL bOsVersionInfoEx; + // ucnv_toUChars takes 32-bit int size + ASSERT_NOT_IMPLEMENTED(size <= (size_t) MAX_INT32); - if (!bFirstCall) { // We can return a cached result for subsequent calls - return retval; + if (size == 0) { + return TRUE; } /* - * Try calling GetVersionEx using the OSVERSIONINFOEX structure. + * Fallback if necessary. */ - ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX)); - osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); - - if(!(bOsVersionInfoEx = GetVersionEx((OSVERSIONINFO *) &osvi))) { - /* - * If GetVersionEx failed, we are running something earlier than NT4+SP6, - * thus we cannot use MB_ERR_INVALID_CHARS - */ - retval = 0; - bFirstCall = FALSE; - return retval; + if (dontUseIcu) { + return CodeSetOld_Validate(buf, size, code); } - if (osvi.dwMajorVersion > 5) { - retval = MB_ERR_INVALID_CHARS; // Vista or later - } else if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion > 0) { - retval = MB_ERR_INVALID_CHARS; // XP, 2003 - } else if (osvi.dwMajorVersion == 5 - && osvi.dwMinorVersion == 0 - && osvi.wServicePackMajor >= 4) { // Win2000 + SP4 - retval = MB_ERR_INVALID_CHARS; - } else { - retval = 0; // Do not use MB_ERR_INVALID_CHARS on this OS. - } + /* + * Calling ucnv_toUChars() this way is the idiom to precompute + * the length of the output. (See preflighting in the ICU User Guide.) + * So if the error is not U_BUFFER_OVERFLOW_ERROR, then the input + * is bad. + */ - bFirstCall = FALSE; - return retval; + uerr = U_ZERO_ERROR; + cv = ucnv_open(code, &uerr); + ASSERT_NOT_IMPLEMENTED(uerr == U_ZERO_ERROR); + ucnv_setToUCallBack(cv, UCNV_TO_U_CALLBACK_STOP, NULL, NULL, NULL, &uerr); + ASSERT_NOT_IMPLEMENTED(uerr == U_ZERO_ERROR); + ucnv_toUChars(cv, NULL, 0, buf, size, &uerr); + ucnv_close(cv); + + return uerr == U_BUFFER_OVERFLOW_ERROR; } -#endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/misc/codesetOld.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/misc/codesetOld.c --- open-vm-tools-2008.01.23-74039/lib/misc/codesetOld.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/misc/codesetOld.c 2008-10-13 08:01:52.000000000 +0100 @@ -0,0 +1,2242 @@ +/********************************************************* + * Copyright (C) 1998 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. + * + *********************************************************/ + +/* + * codesetOld.c -- + * + * The old codeset implementation that depends on system libraries. + * Used for fallback if ICU isn't available. + */ + + +#if defined(_WIN32) +# include +# include +# include +#else +# if defined(__linux__) +# define _GNU_SOURCE // see nl_langinfo_l explanation below +# endif +# include +# include +# include +# include +#endif + +#if defined(__APPLE__) +# include /* for CFString */ +#endif + +#include "vmware.h" +#include "codeset.h" +#include "codesetOld.h" +#include "unicodeTypes.h" +#include "util.h" +#include "str.h" + +#if defined(USE_ICONV) + /* + * Use nl_langinfo_l on Linux. To get the nl_langinfo_l + * related definitions in local.h, we need to define _GNU_SOURCE, + * which has to be done above because one of the other standard include + * files sucks it in. + */ + #include + #if defined(__linux__) && !defined(LC_CTYPE_MASK) // Prior to glibc 2.3 + #define LC_CTYPE_MASK (1 << LC_CTYPE) + #define locale_t __locale_t + #define newlocale __newlocale + #define freelocale __freelocale + #define nl_langinfo_l __nl_langinfo_l + #endif + #include + #include + #include +#endif + + +#if defined(__FreeBSD__) || defined(sun) +static const char nul[] = {'\0', '\0'}; +#else +static const wchar_t nul = L'\0'; +#endif + + +/* + *----------------------------------------------------------------------------- + * + * CodeSetOldGetUtf8 -- + * + * Parse the next UTF-8 sequence. + * + * Results: + * 0 on failure. + * Length of sequence and Unicode character in *uchar on success. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static INLINE int +CodeSetOldGetUtf8(const char *string, // IN: string + const char *end, // IN: end of string + uint32 *uchar) // OUT: the Unicode character +{ + uint8 *p = (uint8 *) string; + uint8 *e; + uint32 c; + int len; + + ASSERT(string < end); + + c = *p; + + if (c < 0x80) { + // ASCII + len = 1; + goto out; + } + + if (c < 0xc2) { + // 0x81 to 0xbf are not valid first bytes + // 0xc0 and 0xc1 cannot appear in UTF-8, see below + return 0; + } + + if (c < 0xe0) { + c -= 0xc0; + len = 2; + } else if (c <= 0xf0) { + c -= 0xe0; + len = 3; + } else if (c <= 0xf8) { + c -= 0xf0; + len = 4; + } else { + // bad first byte + return 0; + } + + if ((e = p + len) > (uint8 *) end) { + // input too short + return 0; + } + + while (++p < e) { + if ((*p & 0xc0) != 0x80) { + // bad trailing byte + return 0; + } + c <<= 6; + c += *p - 0x80; + } + + /* + * Enforce shortest encoding. + * UTF-8 mandates that shortest possible encoding is used, + * as otherwise doing UTF-8 => anything => UTF-8 could bypass some + * important tests, like '/' for path separator or \0 for string + * termination. + * + * This test does not work for len == 2, but that case is handled + * by requiring the first byte to be 0xc2 or greater (see above). + */ + + if (c < 1U << (len * 5 - 4)) { + return 0; + } + +out: + if (uchar != NULL) { + *uchar = c; + } + return len; +} + + +#if defined(CURRENT_IS_UTF8) || defined(_WIN32) +/* + *----------------------------------------------------------------------------- + * + * CodeSetOldDuplicateStr -- + * + * Duplicate input string, appending zero terminator to its end. Only + * used on Windows and on platforms where current encoding is always + * UTF-8, on other iconv-capable platforms we just use iconv even for + * UTF-8 to UTF-8 translation. Note that this function is more like + * memdup() than strdup(), so it can be used for duplicating UTF-16 + * strings as well - string is always terminated by wide character NUL, + * which is supposed to be longest NUL character occuring on specified + * host. + * + * Results: + * TRUE on success + * FALSE on failure + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static Bool +CodeSetOldDuplicateStr(const char *bufIn, // IN: Input string + size_t sizeIn, // IN: Input string length + char **bufOut, // OUT: "Converted" string + size_t *sizeOut) // OUT: Length of string +{ + char *myBufOut; + + myBufOut = malloc(sizeIn + sizeof nul); + if (myBufOut == NULL) { + return FALSE; + } + + memcpy(myBufOut, bufIn, sizeIn); + memset(myBufOut + sizeIn, 0, sizeof nul); + + *bufOut = myBufOut; + if (sizeOut) { + *sizeOut = sizeIn; + } + return TRUE; +} +#endif + + +/* + *----------------------------------------------------------------------------- + * + * CodeSetOldDynBufFinalize -- + * + * Append NUL terminator to the buffer, and return pointer to buffer + * and its data size (before appending terminator). Destroys buffer + * on failure. + * + * Results: + * TRUE on success + * FALSE on failure + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static Bool +CodeSetOldDynBufFinalize(Bool ok, // IN: Earlier steps succeeded + DynBuf *db, // IN: Buffer with converted string + char **bufOut, // OUT: Converted string + size_t *sizeOut) // OUT: Length of string in bytes +{ + if (!ok || !DynBuf_Append(db, &nul, sizeof nul) || !DynBuf_Trim(db)) { + DynBuf_Destroy(db); + return FALSE; + } + + *bufOut = DynBuf_Get(db); + if (sizeOut) { + *sizeOut = DynBuf_GetSize(db) - sizeof nul; + } + return TRUE; +} + + +/* + *----------------------------------------------------------------------------- + * + * CodeSetOldUtf8ToUtf16leDb -- + * + * Append the content of a buffer (that uses the UTF-8 encoding) to a + * DynBuf (that uses the UTF-16LE encoding) + * + * Results: + * TRUE on success + * FALSE on failure + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static Bool +CodeSetOldUtf8ToUtf16leDb(const char *bufIn, // IN + size_t sizeIn, // IN + DynBuf *db) // IN +{ + const char *bufEnd = bufIn + sizeIn; + size_t currentSize; + size_t allocatedSize; + uint16 *buf; + + currentSize = DynBuf_GetSize(db); + allocatedSize = DynBuf_GetAllocatedSize(db); + buf = (uint16 *)((char *)DynBuf_Get(db) + currentSize); + while (bufIn < bufEnd) { + size_t neededSize; + uint32 uniChar; + int n = CodeSetOldGetUtf8(bufIn, bufEnd, &uniChar); + + if (n <= 0) { + return FALSE; + } + bufIn += n; + + /* + * Here we have UCS-4 character in uniChar, between 0 and 0x7FFFFFFF. + * Let's convert it to UTF-16. + */ + + /* Non-paired surrogates are illegal in UTF-16. */ + if (uniChar >= 0xD800 && uniChar < 0xE000) { + return FALSE; + } + if (uniChar < 0x10000) { + neededSize = currentSize + sizeof *buf; + } else if (uniChar < 0x110000) { + neededSize = currentSize + 2 * sizeof *buf; + } else { + /* This character cannot be represented in UTF-16. */ + return FALSE; + } + if (allocatedSize < neededSize) { + if (DynBuf_Enlarge(db, neededSize) == FALSE) { + return FALSE; + } + allocatedSize = DynBuf_GetAllocatedSize(db); + ASSERT(neededSize <= allocatedSize); + buf = (uint16 *)((char *)DynBuf_Get(db) + currentSize); + } + if (uniChar < 0x10000) { + *buf++ = uniChar; + } else { + *buf++ = 0xD800 + ((uniChar - 0x10000) >> 10); + *buf++ = 0xDC00 + ((uniChar - 0x10000) & 0x3FF); + } + currentSize = neededSize; + } + /* All went fine, update buffer size. */ + DynBuf_SetSize(db, currentSize); + return TRUE; +} + + +#if defined(_WIN32) // { + +static DWORD GetInvalidCharsFlag(void); + +/* + * Win32-specific remarks: here is my understanding of those terms as of + * 2002/02/12: + * + * ANSI code page + * The character set used internally by Windows applications (when they are + * not fully Unicode). + * + * OEM code page + * The character set used by MS-DOS and stored in the FAT filesystem. + * + * --hpreg + */ + + +/* + *----------------------------------------------------------------------------- + * + * CodeSetOldGenericToUtf16leDb -- + * + * Append the content of a buffer (that uses the specified encoding) to a + * DynBuf (that uses the UTF-16LE encoding) --hpreg + * + * Results: + * TRUE on success + * FALSE on failure + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static Bool +CodeSetOldGenericToUtf16leDb(UINT codeIn, // IN + char const *bufIn, // IN + size_t sizeIn, // IN + DynBuf *db) // IN +{ + /* + * Undocumented: calling MultiByteToWideChar() with sizeIn == 0 returns 0 + * with GetLastError() set to ERROR_INVALID_PARAMETER. Isn't this API + * robust? --hpreg + */ + if (sizeIn) { + size_t initialSize; + DWORD flags = GetInvalidCharsFlag(); + Bool invalidCharsCheck = ((flags & MB_ERR_INVALID_CHARS) != 0); + + initialSize = DynBuf_GetSize(db); + for (;;) { + int result; + int resultReverse; + DWORD error = ERROR_SUCCESS; + + if (DynBuf_Enlarge(db, sizeof(wchar_t)) == FALSE) { + return FALSE; + } + + /* + * Must fail if bufIn has any invalid characters. + * So MB_ERR_INVALID_CHARS added, otherwise can + * lead to security issues see bug 154114. + */ + result = MultiByteToWideChar(codeIn, + flags, + bufIn, + sizeIn, + (wchar_t *)((char *)DynBuf_Get(db) + initialSize), + (DynBuf_GetAllocatedSize(db) - initialSize) / + sizeof(wchar_t)); + + if (0 == result) { + error = GetLastError(); // may be ERROR_NO_UNICODE_TRANSLATION + } + + /* + * Success if: result is > 0 and is the same number + * of characters as the input string contains. If there + * are any invalid characters, the Win2K SP4 or later will + * fail, but for earlier OS versions, these invalid characters + * will be dropped. Thus only succeed if we have no dropped + * characters. + * For the older platforms which don't fail for invalid characters + * we see if the reverse conversion of the converted string + * yields the same string size that was passed in. + * If not, then dropped characters so fail. + */ + if (!invalidCharsCheck) { + resultReverse = WideCharToMultiByte(codeIn, 0, + (wchar_t *)((char *)DynBuf_Get(db) + initialSize), + result, NULL, 0, 0, 0); + } + if (result > 0 && + (invalidCharsCheck || + (sizeIn == resultReverse))) { + DynBuf_SetSize(db, initialSize + result * sizeof(wchar_t)); + break; + } + + if (result > 0 && (!invalidCharsCheck && sizeIn != resultReverse)) { + return FALSE; + } + + ASSERT(result == 0); + + if (error != ERROR_INSUFFICIENT_BUFFER) { + return FALSE; + } + + /* Need a larger buffer --hpreg */ + } + } + + return TRUE; +} + + +/* + *----------------------------------------------------------------------------- + * + * CodeSetOldUtf16leToGeneric -- + * + * Append the content of a buffer (that uses the UTF-16LE encoding) to a + * DynBuf (that uses the specified encoding) --hpreg + * + * Results: + * TRUE on success + * FALSE on failure + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static Bool +CodeSetOldUtf16leToGeneric(char const *bufIn, // IN + size_t sizeIn, // IN + UINT codeOut, // IN + DynBuf *db) // IN +{ + /* + * Undocumented: calling WideCharToMultiByte() with sizeIn == 0 returns 0 + * with GetLastError() set to ERROR_INVALID_PARAMETER. Isn't this API + * robust? --hpreg + */ + if (sizeIn) { + size_t initialSize; + Bool canHaveSubstitution = codeOut != CP_UTF8 && codeOut != CP_UTF7; + + initialSize = DynBuf_GetSize(db); + for (;;) { + int result; + DWORD error; + BOOL usedSubstitution = FALSE; + + if (DynBuf_Enlarge(db, 1) == FALSE) { + return FALSE; + } + + result = WideCharToMultiByte(codeOut, + canHaveSubstitution ? WC_NO_BEST_FIT_CHARS : 0, + (wchar_t const *)bufIn, + sizeIn / sizeof(wchar_t), + (char *)DynBuf_Get(db) + initialSize, + DynBuf_GetAllocatedSize(db) - initialSize, + NULL, + canHaveSubstitution ? &usedSubstitution : NULL); + + if (usedSubstitution) { + return FALSE; + } + + if (result > 0) { + DynBuf_SetSize(db, initialSize + result); + break; + } + + ASSERT(result == 0); + + /* Must come first --hpreg */ + error = GetLastError(); + + if (error != ERROR_INSUFFICIENT_BUFFER) { + return FALSE; + } + + /* Need a larger buffer --hpreg */ + } + } + + /* + * Undocumented: if the input buffer is not NUL-terminated, the output + * buffer will not be NUL-terminated either --hpreg + */ + return TRUE; +} + + +/* + *----------------------------------------------------------------------------- + * + * CodeSetOldUtf16leToCurrent -- + * + * Convert the content of a buffer (that uses the UTF-16LE encoding) into + * another buffer (that uses the current encoding) --hpreg + * + * Results: + * TRUE on success: '*bufOut' contains the allocated, NUL terminated buffer. + * If not NULL, '*sizeOut' contains the size of the buffer + * (excluding the NUL terminator) + * FALSE on failure + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static Bool +CodeSetOldUtf16leToCurrent(char const *bufIn, // IN + size_t sizeIn, // IN + char **bufOut, // OUT + size_t *sizeOut) // OUT +{ + DynBuf db; + Bool ok; + + DynBuf_Init(&db); + /* XXX We should probably use CP_THREAD_ACP on Windows 2000/XP --hpreg */ + ok = CodeSetOldUtf16leToGeneric(bufIn, sizeIn, CP_ACP, &db); + return CodeSetOldDynBufFinalize(ok, &db, bufOut, sizeOut); +} + +#endif // } + + +#if defined(__APPLE__) +/* + *----------------------------------------------------------------------------- + * + * CodeSetOld_Utf8Normalize -- + * + * Convert the content of a buffer (that uses the UTF-8 encoding) into + * another buffer (that uses the UTF-8 encoding) that is in precomposed + * (Normalization Form C) or decomposed (Normalization Form D). + * + * Results: + * TRUE on success: '*bufOut' contains a NUL terminated buffer. + * If not NULL, '*sizeOut' contains the size of the buffer + * (excluding the NUL terminator) + * FALSE on failure + * + * Side effects: + * '*bufOut' contains the allocated, NUL terminated buffer. + * + *----------------------------------------------------------------------------- + */ + +Bool +CodeSetOld_Utf8Normalize(char const *bufIn, // IN + size_t sizeIn, // IN + Bool precomposed, // IN + DynBuf *db) // OUT +{ + Bool ok = FALSE; + CFStringRef str = NULL; + CFMutableStringRef mutStr = NULL; + CFIndex len, lenMut; + size_t initialSize = DynBuf_GetSize(db); + + str = CFStringCreateWithCString(NULL, + bufIn, + kCFStringEncodingUTF8); + if (str == NULL) { + goto exit; + } + + mutStr = CFStringCreateMutableCopy(NULL, 0, str); + if (mutStr == NULL) { + goto exit; + } + + /* + * Normalize the string, Form C - precomposed or D, not. + */ + CFStringNormalize(mutStr, + (precomposed ? kCFStringNormalizationFormC : + kCFStringNormalizationFormD)); + + /* + * Get the number (in terms of UTF-16 code units) + * of characters in a string. + */ + lenMut = CFStringGetLength(mutStr); + + /* + * Retrieve the maximum number of bytes a string of a + * specified length (in UTF-16 code units) will take up + * if encoded in a specified encoding. + */ + len = CFStringGetMaximumSizeForEncoding(lenMut, + kCFStringEncodingUTF8); + if (len + 1 > initialSize) { + if (DynBuf_Enlarge(db, len + 1 - initialSize) == FALSE) { + ok = FALSE; + goto exit; + } + } + + /* + * Copies the character contents of a string to a local C + * string buffer after converting the characters to UTF-8. + */ + ok = CFStringGetCString(mutStr, + (char *)DynBuf_Get(db), + len + 1, + kCFStringEncodingUTF8); + if (ok) { + /* Remove the NUL terminator that the above includes. */ + DynBuf_SetSize(db, strlen((char *)DynBuf_Get(db))); + } + +exit: + if (str) { + CFRelease(str); + } + if (mutStr) { + CFRelease(mutStr); + } + + return ok; +} +#endif /* defined(__APPLE__) */ + + +/* + * Linux-specific remarks: + * + * We use UTF-16 instead of UCS-2, because Windows 2000 introduces support + * for basic input, output, and simple sorting of surrogates. + * + * We use UTF-16LE instead of UTF-16 so that iconv() does not prepend a BOM. + * + * --hpreg + */ + + +#if defined(USE_ICONV) // { +/* + *----------------------------------------------------------------------------- + * + * CodeSetOldGetCodeSetFromLocale -- + * + * Extract the native code set from LC_CTYPE. + * + * Results: + * + * The name of the current code set on success. The return value depends + * on how LC_CTYPE is set in the locale, even if setlocale has not been + * previously called. + * + * Side effects: + * + * May briefly set and restore locale on some systems, which is not + * thread-safe. + * + *----------------------------------------------------------------------------- + */ + +static char * +CodeSetOldGetCodeSetFromLocale(void) +{ + char *codeset; + +#if defined(__linux__) + + locale_t new = newlocale(LC_CTYPE_MASK, "", NULL); + if (!new) { + /* + * If the machine is configured incorrectly (no current locale), + * newlocale() could return NULL. Try to fall back on the "C" + * locale. + */ + + new = newlocale(LC_CTYPE_MASK, "C", NULL); + ASSERT(new); + } + codeset = Util_SafeStrdup(nl_langinfo_l(CODESET, new)); + freelocale(new); + +#elif defined(sun) + + char *locale = setlocale(LC_CTYPE, NULL); + if (!setlocale(LC_CTYPE, "")) { + /* + * If the machine is configured incorrectly (no current locale), + * setlocale() can fail. Try to fall back on the "C" locale. + */ + + setlocale(LC_CTYPE, "C"); + } + codeset = Util_SafeStrdup(nl_langinfo(CODESET)); + setlocale(LC_CTYPE, locale); + +#else +#error +#endif + + return codeset; +} +#endif // } USE_ICONV + + +/* + *----------------------------------------------------------------------------- + * + * CodeSetOld_GetCurrentCodeSet -- + * + * Return native code set name - always "UTF-8" on Apple, FreeBSD, + * old Linux, and ESX. Obtained from GetACP on Windows and + * nl_langinfo on Linux, Solaris, etc. On first invocation + * initialize a cache with the code set name. + * + * Results: + * + * The name of the current code set on success. On systems that + * use iconv the return value depends on how LC_CTYPE is set in the + * locale, even if setlocale has not been previously called. + * + * Side effects: + * + * During first invocation may briefly set and restore locale on + * some systems, which is not thread-safe. + * + *----------------------------------------------------------------------------- + */ + +const char * +CodeSetOld_GetCurrentCodeSet(void) +{ +#if defined(CURRENT_IS_UTF8) + return "UTF-8"; +#elif defined(_WIN32) + static char ret[20]; // max is "windows-4294967296" + if (ret[0] == '\0') { + Str_Sprintf(ret, sizeof(ret), "windows-%u", GetACP()); + } + + return ret; +#elif defined(USE_ICONV) + static char *cachedCodeset; + + /* + * Mirror GLib behavior: + * + * $G_FILENAME_ENCODING can have one or more encoding names + * in a comma separated list. + * + * If the first entry in $G_FILENAME_ENCODING is set to + * "@locale", get the code set from the environment. + * + * If the first entry in $G_FILENAME_ENCODING is not set to + * "@locale", then it is the encoding name. + * + * If $G_FILENAME_ENCODING is not set and $G_BROKEN_FILENAMES + * is set, the get the code set from the environment. + * + * If none of the above are met, the code set is UTF-8. + * + * XXX - TODO - Support multiple encodings in the list. + * While G_FILENAME_ENCODING is documented to be a list, + * the current implementation (GLib 2.16) ignores all but + * the first entry when converting to/from UTF-8. + */ + + if (!cachedCodeset) { + char *gFilenameEncoding = getenv("G_FILENAME_ENCODING"); + char *p; + + if (gFilenameEncoding && *gFilenameEncoding) { + gFilenameEncoding = Util_SafeStrdup(gFilenameEncoding); + p = strchr(gFilenameEncoding, ','); + if (p) { + *p = '\0'; + } + if (!strcmp(gFilenameEncoding, "@locale")) { + free(gFilenameEncoding); + cachedCodeset = CodeSetOldGetCodeSetFromLocale(); + return cachedCodeset; + } + cachedCodeset = gFilenameEncoding; + return cachedCodeset; + } + + if (getenv("G_BROKEN_FILENAMES")) { + cachedCodeset = CodeSetOldGetCodeSetFromLocale(); + return cachedCodeset; + } + + cachedCodeset = "UTF-8"; + } + + return cachedCodeset; +#else +#error +#endif +} + +#if defined(USE_ICONV) // { + +/* + *----------------------------------------------------------------------------- + * + * CodeSetOldIconvOpen -- + * + * Open iconv translator with requested flags. Currently only no flags, + * and both CSGTG_TRANSLIT and CSGTG_IGNORE together are supported, as + * this is only thing we need. If translit/ignore convertor fails, + * then non-transliterating conversion is used. + * + * Results: + * (iconv_t)-1 on failure + * iconv handle on success + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static INLINE_SINGLE_CALLER iconv_t +CodeSetOldIconvOpen(const char *codeIn, // IN + const char *codeOut, // IN + unsigned int flags) // IN +{ +#ifdef __linux__ + if (flags) { + char *codeOutExt; + + ASSERT(flags == (CSGTG_TRANSLIT | CSGTG_IGNORE)); + /* + * We should be using //TRANSLIT,IGNORE, but glibc versions older than + * 2.3.4 (in particular, the version that ships with redhat linux 9.0) + * are subtly broken when passing options with a comma, in such a way + * that iconv_open will succeed but iconv_close can crash. For now, we + * only use TRANSLIT and bail out after the first non-translitible + * character. + */ + codeOutExt = Str_Asprintf(NULL, "%s//TRANSLIT", codeOut); + if (codeOutExt) { + iconv_t cd = iconv_open(codeOutExt, codeIn); + free(codeOutExt); + if (cd != (iconv_t)-1) { + return cd; + } + } + } +#endif + return iconv_open(codeOut, codeIn); +} + + +/* + *----------------------------------------------------------------------------- + * + * CodeSetOld_GenericToGenericDb -- + * + * Append the content of a buffer (that uses the specified encoding) to a + * DynBuf (that uses the specified encoding). --hpreg + * + * Results: + * TRUE on success + * FALSE on failure + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +Bool +CodeSetOld_GenericToGenericDb(char const *codeIn, // IN + char const *bufIn, // IN + size_t sizeIn, // IN + char const *codeOut, // IN + unsigned int flags, // IN + DynBuf *db) // IN/OUT +{ + iconv_t cd; + + ASSERT(codeIn); + ASSERT(sizeIn == 0 || bufIn); + ASSERT(codeOut); + ASSERT(db); + + // XXX make CodeSetOldIconvOpen happy + if (flags != 0) { + flags = CSGTG_TRANSLIT | CSGTG_IGNORE; + } + + cd = CodeSetOldIconvOpen(codeIn, codeOut, flags); + if (cd == (iconv_t)-1) { + return FALSE; + } + + for (;;) { + size_t size; + char *out; + char *outOrig; + size_t outLeft; + size_t status; + + /* + * Every character we care about can occupy at most + * 4 bytes - UCS-4 is 4 bytes, UTF-16 is 2+2 bytes, + * and UTF-8 is also at most 4 bytes for all + * characters under 0x1FFFFF. + * + * If we allocate too small buffer nothing critical + * happens except that in //IGNORE case some + * implementations might return EILSEQ instead of + * E2BIG. By having at least 4 bytes available we + * can be sure that at least one character is + * converted each call to iconv(). + */ + size = DynBuf_GetSize(db); + if (DynBuf_Enlarge(db, size + 4) == FALSE) { + goto error; + } + + out = (int8 *)DynBuf_Get(db) + size; + outOrig = out; + outLeft = DynBuf_GetAllocatedSize(db) - size; + + /* + * From glibc 2.2 onward bufIn is no longer const due to a change + * in the standard. However, the implementation of iconv doesn't + * change bufIn so a simple cast is safe. --plangdale + */ +#if defined(GLIBC_VERSION_22) + status = iconv(cd, (char **)&bufIn, &sizeIn, &out, &outLeft); +#else + status = iconv(cd, &bufIn, &sizeIn, &out, &outLeft); +#endif + + DynBuf_SetSize(db, size + out - outOrig); + + /* + * If all input characters were consumed, we are done. + * Otherwise if at least one character was produced by conversion + * then just increase buffer size and try again - with //IGNORE + * iconv() returns an error (EILSEQ) but still processes as + * many characters as possible. If no characters were produced, + * then consult error code - do not consult return value in other + * cases, it can be either random positive value (if some + * characters were transliterated) or even -1 with errno set to + * EILSEQ (if some characters were ignored). + */ + if (sizeIn == 0) { + break; + } + if (out == outOrig) { + if (status != -1) { + goto error; + } + /* + * Some libc implementations (one on ESX3, and one on Ganesh's + * box) silently ignore //IGNORE. So if caller asked for + * getting conversion done at any cost, just return success + * even if failure occured. User will get truncated + * message, but that's our best. We have no idea whether + * incoming encoding is 8bit, 16bit, or what, so we cannot + * skip over characters in input stream and recover :-( + */ + if ((flags & CSGTG_IGNORE) && errno == EILSEQ) { + break; + } + if (errno != E2BIG) { + goto error; + } + } + /* Need a larger buffer --hpreg */ + } + + if (iconv_close(cd) < 0) { + return FALSE; + } + + return TRUE; + +error: + iconv_close(cd); + + return FALSE; +} + +#else // USE_ICONV } { + +/* + *----------------------------------------------------------------------------- + * + * CodeSetOld_GenericToGenericDb + * + * This non-iconv version can only handle common encodings. + * + * Results: + * TRUE on success + * FALSE on failure + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +Bool +CodeSetOld_GenericToGenericDb(char const *codeIn, // IN + char const *bufIn, // IN + size_t sizeIn, // IN + char const *codeOut, // IN + unsigned int flags, // IN + DynBuf *db) // IN/OUT +{ + Bool ret = FALSE; + StringEncoding encIn = Unicode_EncodingNameToEnum(codeIn); + StringEncoding encOut = Unicode_EncodingNameToEnum(codeOut); + StringEncoding rawCurEnc = Unicode_GetCurrentEncoding(); + char *bufOut = NULL; + size_t sizeOut; + + /* + * Trivial case. + */ + + if ((0 == sizeIn) || (NULL == bufIn)) { + ret = TRUE; + goto exit; + } + + if (encIn == encOut) { + if (encIn == STRING_ENCODING_UTF8) { + if (!CodeSetOld_Utf8ToUtf16le(bufIn, sizeIn, &bufOut, &sizeOut)) { + goto exit; + } + } else if (encIn == STRING_ENCODING_UTF16_LE) { + if (!CodeSetOld_Utf16leToUtf8(bufIn, sizeIn, &bufOut, &sizeOut)) { + goto exit; + } + } else if (encIn == STRING_ENCODING_UTF16_BE) { + if (!CodeSetOld_Utf16beToUtf8(bufIn, sizeIn, &bufOut, &sizeOut)) { + goto exit; + } + } else if (encIn == STRING_ENCODING_US_ASCII) { + if (!CodeSetOld_AsciiToUtf8(bufIn, sizeIn, 0, &bufOut, &sizeOut)) { + goto exit; + } + } else if (encIn == rawCurEnc) { + if (!CodeSetOld_CurrentToUtf8(bufIn, sizeIn, &bufOut, &sizeOut)) { + goto exit; + } + } + free(bufOut); + bufOut = NULL; + if (!DynBuf_Append(db, bufIn, sizeIn)) { + goto exit; + } + } else if (rawCurEnc == encIn) { + if (STRING_ENCODING_UTF8 == encOut) { + if (!CodeSetOld_CurrentToUtf8(bufIn, sizeIn, &bufOut, &sizeOut)) { + goto exit; + } + } else if (STRING_ENCODING_UTF16_LE == encOut) { + if (!CodeSetOld_CurrentToUtf16le(bufIn, sizeIn, &bufOut, &sizeOut)) { + goto exit; + } + } else { + goto exit; + } + } else if (STRING_ENCODING_UTF8 == encIn) { + if (rawCurEnc == encOut) { + if (!CodeSetOld_Utf8ToCurrent(bufIn, sizeIn, &bufOut, &sizeOut)) { + goto exit; + } + } else if (STRING_ENCODING_UTF16_LE == encOut) { + if (!CodeSetOldUtf8ToUtf16leDb(bufIn, sizeIn, db)) { + goto exit; + } + } else if (STRING_ENCODING_US_ASCII == encOut) { + if (!CodeSetOld_Utf8ToAsciiDb(bufIn, sizeIn, flags, db)) { + goto exit; + } + } else { + goto exit; + } + } else if (STRING_ENCODING_UTF16_LE == encIn) { + if (rawCurEnc == encOut) { + if (!CodeSetOld_Utf16leToCurrent(bufIn, sizeIn, &bufOut, &sizeOut)) { + goto exit; + } + } else if (STRING_ENCODING_UTF8 == encOut) { + if (!CodeSetOld_Utf16leToUtf8Db(bufIn, sizeIn, db)) { + goto exit; + } + } else { + goto exit; + } + } else if (STRING_ENCODING_UTF16_BE == encIn) { + if (rawCurEnc == encOut) { + if (!CodeSetOld_Utf16beToCurrent(bufIn, sizeIn, &bufOut, &sizeOut)) { + goto exit; + } + } else if (STRING_ENCODING_UTF8 == encOut) { + if (!CodeSetOld_Utf16beToUtf8Db(bufIn, sizeIn, db)) { + goto exit; + } + } else { + goto exit; + } + } else if (STRING_ENCODING_US_ASCII == encIn) { + if (STRING_ENCODING_UTF8 == encOut) { + if (!CodeSetOld_AsciiToUtf8Db(bufIn, sizeIn, flags, db)) { + goto exit; + } + } else { + goto exit; + } + } else { + goto exit; + } + + if (bufOut != NULL) { + if (DynBuf_GetSize(db) == 0) { + DynBuf_Attach(db, sizeOut, bufOut); + bufOut = NULL; + } else { + if (!DynBuf_Append(db, bufOut, sizeOut)) { + goto exit; + } + } + } + + ret = TRUE; + + exit: + free(bufOut); + return ret; +} + +#endif // USE_ICONV } + +/* + *----------------------------------------------------------------------------- + * + * CodeSetOld_GenericToGeneric -- + * + * Non-db version of CodeSetOld_GenericToGenericDb. + * + * Results: + * TRUE on success, plus allocated string + * FALSE on failure + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +Bool +CodeSetOld_GenericToGeneric(const char *codeIn, // IN + const char *bufIn, // IN + size_t sizeIn, // IN + const char *codeOut, // IN + unsigned int flags, // IN + char **bufOut, // OUT + size_t *sizeOut) // OUT +{ + DynBuf db; + Bool ok; + + DynBuf_Init(&db); + ok = CodeSetOld_GenericToGenericDb(codeIn, bufIn, sizeIn, + codeOut, flags, &db); + return CodeSetOldDynBufFinalize(ok, &db, bufOut, sizeOut); +} + + +/* + * Generic remarks: here is my understanding of those terms as of 2001/12/27: + * + * BOM + * Byte-Order Mark + * + * BMP + * Basic Multilingual Plane. This plane comprises the first 2^16 code + * positions of ISO/IEC 10646's canonical code space + * + * UCS + * Universal Character Set. Encoding form specified by ISO/IEC 10646 + * + * UCS-2 + * Directly store all Unicode scalar value (code point) from U+0000 to + * U+FFFF on 2 bytes. Consequently, this representation can only hold + * characters in the BMP + * + * UCS-4 + * Directly store a Unicode scalar value (code point) from U-00000000 to + * U-FFFFFFFF on 4 bytes + * + * UTF + * Abbreviation for Unicode (or UCS) Transformation Format + * + * UTF-8 + * Unicode (or UCS) Transformation Format, 8-bit encoding form. UTF-8 is the + * Unicode Transformation Format that serializes a Unicode scalar value + * (code point) as a sequence of 1 to 6 bytes + * + * UTF-16 + * UCS-2 + surrogate mechanism: allow to encode some non-BMP Unicode + * characters in a UCS-2 string, by using 2 2-byte units. See the Unicode + * standard, v2.0 + * + * UTF-32 + * Directly store all Unicode scalar value (code point) from U-00000000 to + * U-0010FFFF on 4 bytes. This is a subset of UCS-4 + * + * --hpreg + */ + + +/* + *----------------------------------------------------------------------------- + * + * CodeSetOld_Utf8ToCurrent -- + * + * Convert the content of a buffer (that uses the UTF-8 encoding) into + * another buffer (that uses the current encoding) --hpreg + * + * Results: + * TRUE on success: '*bufOut' contains the allocated, NUL terminated buffer. + * If not NULL, '*sizeOut' contains the size of the buffer + * (excluding the NUL terminator) + * FALSE on failure + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +Bool +CodeSetOld_Utf8ToCurrent(char const *bufIn, // IN + size_t sizeIn, // IN + char **bufOut, // OUT + size_t *sizeOut) // OUT +{ +#if defined(CURRENT_IS_UTF8) + return CodeSetOldDuplicateStr(bufIn, sizeIn, bufOut, sizeOut); +#elif defined(USE_ICONV) + DynBuf db; + Bool ok; + + DynBuf_Init(&db); + ok = CodeSetOld_GenericToGenericDb("UTF-8", bufIn, sizeIn, + CodeSetOld_GetCurrentCodeSet(), + 0, &db); + return CodeSetOldDynBufFinalize(ok, &db, bufOut, sizeOut); +#elif defined(_WIN32) + char *buf; + size_t size; + Bool status; + + if (CodeSetOld_Utf8ToUtf16le(bufIn, sizeIn, &buf, &size) == FALSE) { + return FALSE; + } + + status = CodeSetOldUtf16leToCurrent(buf, size, bufOut, sizeOut); + free(buf); + + return status; +#else +#error +#endif +} + + +/* + *----------------------------------------------------------------------------- + * + * CodeSetOld_CurrentToUtf8 -- + * + * Convert the content of a buffer (that uses the current encoding) into + * another buffer (that uses the UTF-8 encoding) --hpreg + * + * Results: + * TRUE on success: '*bufOut' contains the allocated, NUL terminated buffer. + * If not NULL, '*sizeOut' contains the size of the buffer + * (excluding the NUL terminator) + * FALSE on failure + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +Bool +CodeSetOld_CurrentToUtf8(char const *bufIn, // IN + size_t sizeIn, // IN + char **bufOut, // OUT + size_t *sizeOut) // OUT +{ +#if defined(CURRENT_IS_UTF8) + return CodeSetOldDuplicateStr(bufIn, sizeIn, bufOut, sizeOut); +#elif defined(USE_ICONV) + DynBuf db; + Bool ok; + + DynBuf_Init(&db); + ok = CodeSetOld_GenericToGenericDb(CodeSetOld_GetCurrentCodeSet(), bufIn, + sizeIn, "UTF-8", 0, &db); + return CodeSetOldDynBufFinalize(ok, &db, bufOut, sizeOut); +#elif defined(_WIN32) + char *buf; + size_t size; + Bool status; + + if (CodeSetOld_CurrentToUtf16le(bufIn, sizeIn, &buf, &size) == FALSE) { + return FALSE; + } + + status = CodeSetOld_Utf16leToUtf8(buf, size, bufOut, sizeOut); + free(buf); + return status; +#else +#error +#endif +} + + +/* + *----------------------------------------------------------------------------- + * + * CodeSetOld_Utf16leToUtf8Db -- + * + * Append the content of a buffer (that uses the UTF-16LE encoding) to a + * DynBuf (that uses the UTF-8 encoding). --hpreg + * + * Results: + * TRUE on success + * FALSE on failure + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +Bool +CodeSetOld_Utf16leToUtf8Db(char const *bufIn, // IN + size_t sizeIn, // IN + DynBuf *db) // IN +{ + const uint16 *utf16In; + size_t numCodeUnits; + size_t codeUnitIndex; + + if (sizeIn % sizeof *utf16In != 0) { + return FALSE; + } + + utf16In = (const uint16 *)bufIn; + numCodeUnits = sizeIn / 2; + + for (codeUnitIndex = 0; codeUnitIndex < numCodeUnits; codeUnitIndex++) { + uint32 codePoint; + uint8 *dbBytes; + size_t size; + + if ( utf16In[codeUnitIndex] < 0xD800 + || utf16In[codeUnitIndex] > 0xDFFF) { + // Non-surrogate UTF-16 code units directly represent a code point. + codePoint = utf16In[codeUnitIndex]; + } else { + static const uint32 SURROGATE_OFFSET = + (0xD800 << 10UL) + 0xDC00 - 0x10000; + + uint16 surrogateLead = utf16In[codeUnitIndex]; + uint16 surrogateTrail; + + // We need one more code unit for the trailing surrogate. + codeUnitIndex++; + if (codeUnitIndex == numCodeUnits) { + return FALSE; + } + + surrogateTrail = utf16In[codeUnitIndex]; + + // Ensure we have a lead surrogate followed by a trail surrogate. + if ( surrogateLead > 0xDBFF + || surrogateTrail < 0xDC00 + || surrogateTrail > 0xDFFF) { + return FALSE; + } + + /* + * To get a code point between 0x10000 and 0x10FFFF (2^16 to + * (2^21) - 1): + * + * 1) Ensure surrogateLead is in the range [0xD800, 0xDBFF] + * + * 2) Ensure surrogateTrail is in the range [0xDC00, 0xDFFF] + * + * 3) Mask off all but the low 10 bits of lead and shift that + * left 10 bits: ((surrogateLead << 10) - (0xD800 << 10)) + * -> result [0, 0xFFC00] + * + * 4) Add to that the low 10 bits of trail: (surrogateTrail - 0xDC00) + * -> result [0, 0xFFFFF] + * + * 5) Add to that 0x10000: + * -> result [0x10000, 0x10FFFF] + */ + codePoint = ((uint32)surrogateLead << 10UL) + + (uint32)surrogateTrail - SURROGATE_OFFSET; + + ASSERT(codePoint >= 0x10000 && codePoint <= 0x10FFFF); + } + + size = DynBuf_GetSize(db); + + // We'll need at most 4 more bytes for this code point. + if ( DynBuf_GetAllocatedSize(db) < size + 4 + && DynBuf_Enlarge(db, size + 4) == FALSE) { + return FALSE; + } + + dbBytes = (uint8 *)DynBuf_Get(db) + size; + + // Convert the code point to UTF-8. + if (codePoint <= 0x007F) { + // U+0000 - U+007F: 1 byte of UTF-8. + dbBytes[0] = codePoint; + size += 1; + } else if (codePoint <= 0x07FF) { + // U+0080 - U+07FF: 2 bytes of UTF-8. + dbBytes[0] = 0xC0 | (codePoint >> 6); + dbBytes[1] = 0x80 | (codePoint & 0x3F); + size += 2; + } else if (codePoint <= 0xFFFF) { + // U+0800 - U+FFFF: 3 bytes of UTF-8. + dbBytes[0] = 0xE0 | (codePoint >> 12); + dbBytes[1] = 0x80 | ((codePoint >> 6) & 0x3F); + dbBytes[2] = 0x80 | (codePoint & 0x3F); + size += 3; + } else { + /* + * U+10000 - U+10FFFF: 4 bytes of UTF-8. + * + * See the surrogate pair handling block above for the math + * that ensures we're in the range [0x10000, 0x10FFFF] here. + */ + ASSERT(codePoint <= 0x10FFFF); + dbBytes[0] = 0xF0 | (codePoint >> 18); + dbBytes[1] = 0x80 | ((codePoint >> 12) & 0x3F); + dbBytes[2] = 0x80 | ((codePoint >> 6) & 0x3F); + dbBytes[3] = 0x80 | (codePoint & 0x3F); + size += 4; + } + + DynBuf_SetSize(db, size); + } + + return TRUE; +} + + +/* + *----------------------------------------------------------------------------- + * + * CodeSetOld_Utf16leToUtf8 -- + * + * Convert the content of a buffer (that uses the UTF-16LE encoding) into + * another buffer (that uses the UTF-8 encoding). --hpreg + * + * The operation is inversible (its inverse is CodeSetOld_Utf8ToUtf16le). + * + * Results: + * TRUE on success: '*bufOut' contains the allocated, NUL terminated buffer. + * If not NULL, '*sizeOut' contains the size of the buffer + * (excluding the NUL terminator) + * FALSE on failure + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +Bool +CodeSetOld_Utf16leToUtf8(char const *bufIn, // IN + size_t sizeIn, // IN + char **bufOut, // OUT + size_t *sizeOut) // OUT +{ + DynBuf db; + Bool ok; + + DynBuf_Init(&db); + ok = CodeSetOld_Utf16leToUtf8Db(bufIn, sizeIn, &db); + return CodeSetOldDynBufFinalize(ok, &db, bufOut, sizeOut); +} + + +/* + *----------------------------------------------------------------------------- + * + * CodeSetOld_Utf8ToUtf16le -- + * + * Convert the content of a buffer (that uses the UTF-8 encoding) into + * another buffer (that uses the UTF-16LE encoding). --hpreg + * + * The operation is inversible (its inverse is CodeSetOld_Utf16leToUtf8). + * + * Results: + * TRUE on success: '*bufOut' contains the allocated, NUL terminated buffer. + * If not NULL, '*sizeOut' contains the size of the buffer + * (excluding the NUL terminator) + * FALSE on failure + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +Bool +CodeSetOld_Utf8ToUtf16le(char const *bufIn, // IN + size_t sizeIn, // IN + char **bufOut, // OUT + size_t *sizeOut) // OUT +{ + DynBuf db; + Bool ok; + + DynBuf_Init(&db); + ok = CodeSetOldUtf8ToUtf16leDb(bufIn, sizeIn, &db); + return CodeSetOldDynBufFinalize(ok, &db, bufOut, sizeOut); +} + + +/* + *----------------------------------------------------------------------------- + * + * CodeSetOld_Utf8FormDToUtf8FormC -- + * + * Convert the content of a buffer (that uses the UTF-8 encoding) + * which is in normal form D (decomposed) into another buffer + * (that uses the UTF-8 encoding) and is normalized as + * precomposed (Normalization Form C). + * + * Results: + * TRUE on success: '*bufOut' contains a NUL terminated buffer. + * If not NULL, '*sizeOut' contains the size of the buffer + * (excluding the NUL terminator) + * FALSE on failure + * + * Side effects: + * '*bufOut' contains the allocated, NUL terminated buffer. + * + *----------------------------------------------------------------------------- + */ + +Bool +CodeSetOld_Utf8FormDToUtf8FormC(char const *bufIn, // IN + size_t sizeIn, // IN + char **bufOut, // OUT + size_t *sizeOut) // OUT +{ +#if defined(__APPLE__) + DynBuf db; + Bool ok; + DynBuf_Init(&db); + ok = CodeSetOld_Utf8Normalize(bufIn, sizeIn, TRUE, &db); + return CodeSetOldDynBufFinalize(ok, &db, bufOut, sizeOut); +#else + NOT_IMPLEMENTED(); +#endif +} + + +/* + *----------------------------------------------------------------------------- + * + * CodeSetOld_Utf8FormCToUtf8FormD -- + * + * Convert the content of a buffer (that uses the UTF-8 encoding) + * which is in normal form C (precomposed) into another buffer + * (that uses the UTF-8 encoding) and is normalized as + * decomposed (Normalization Form D). + * + * Results: + * TRUE on success: '*bufOut' contains a NUL terminated buffer. + * If not NULL, '*sizeOut' contains the size of the buffer + * (excluding the NUL terminator) + * FALSE on failure + * + * Side effects: + * '*bufOut' contains the allocated, NUL terminated buffer. + * + *----------------------------------------------------------------------------- + */ + +Bool +CodeSetOld_Utf8FormCToUtf8FormD(char const *bufIn, // IN + size_t sizeIn, // IN + char **bufOut, // OUT + size_t *sizeOut) // OUT +{ +#if defined(__APPLE__) + DynBuf db; + Bool ok; + DynBuf_Init(&db); + ok = CodeSetOld_Utf8Normalize(bufIn, sizeIn, FALSE, &db); + return CodeSetOldDynBufFinalize(ok, &db, bufOut, sizeOut); +#else + NOT_IMPLEMENTED(); +#endif +} + + +/* + *----------------------------------------------------------------------------- + * + * CodeSetOld_CurrentToUtf16le -- + * + * Convert the content of a buffer (that uses the current encoding) into + * another buffer (that uses the UTF-16LE encoding). + * + * Results: + * TRUE on success: '*bufOut' contains the allocated, NUL terminated buffer. + * If not NULL, '*sizeOut' contains the size of the buffer + * (excluding the NUL terminator) + * FALSE on failure + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +Bool +CodeSetOld_CurrentToUtf16le(char const *bufIn, // IN + size_t sizeIn, // IN + char **bufOut, // OUT + size_t *sizeOut) // OUT +{ + DynBuf db; + Bool ok; + + DynBuf_Init(&db); +#if defined(CURRENT_IS_UTF8) + ok = CodeSetOldUtf8ToUtf16leDb(bufIn, sizeIn, &db); +#elif defined(USE_ICONV) + ok = CodeSetOld_GenericToGenericDb(CodeSetOld_GetCurrentCodeSet(), bufIn, + sizeIn, "UTF-16LE", 0, &db); +#elif defined(_WIN32) + /* XXX We should probably use CP_THREAD_ACP on Windows 2000/XP. */ + ok = CodeSetOldGenericToUtf16leDb(CP_ACP, bufIn, sizeIn, &db); +#else +#error +#endif + return CodeSetOldDynBufFinalize(ok, &db, bufOut, sizeOut); +} + + +/* + *----------------------------------------------------------------------------- + * + * CodeSetOld_Utf16leToCurrent -- + * + * Convert the content of a buffer (that uses the UTF-16 little endian + * encoding) into another buffer (that uses the current encoding) + * + * Results: + * TRUE on success: '*bufOut' contains the allocated, NUL terminated buffer. + * If not NULL, '*sizeOut' contains the size of the buffer + * (excluding the NUL terminator) + * FALSE on failure + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +Bool +CodeSetOld_Utf16leToCurrent(char const *bufIn, // IN + size_t sizeIn, // IN + char **bufOut, // OUT + size_t *sizeOut) // OUT +{ +#if defined(CURRENT_IS_UTF8) + return CodeSetOld_Utf16leToUtf8(bufIn, sizeIn, bufOut, sizeOut); +#elif defined(USE_ICONV) + DynBuf db; + Bool ok; + + DynBuf_Init(&db); + ok = CodeSetOld_GenericToGenericDb("UTF-16LE", bufIn, sizeIn, + CodeSetOld_GetCurrentCodeSet(), 0, &db); + return CodeSetOldDynBufFinalize(ok, &db, bufOut, sizeOut); +#elif defined(_WIN32) + return CodeSetOldUtf16leToCurrent(bufIn, sizeIn, bufOut, sizeOut); +#else +#error +#endif +} + + +/* + *----------------------------------------------------------------------------- + * + * CodeSetOld_Utf16beToCurrent -- + * + * Convert the content of a buffer (that uses the UTF-16 big endian + * encoding) into another buffer (that uses the current encoding) + * + * Results: + * TRUE on success: '*bufOut' contains the allocated, NUL terminated buffer. + * If not NULL, '*sizeOut' contains the size of the buffer + * (excluding the NUL terminator) + * FALSE on failure + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +Bool +CodeSetOld_Utf16beToCurrent(char const *bufIn, // IN + size_t sizeIn, // IN + char **bufOut, // OUT + size_t *sizeOut) // OUT +{ +#if defined(CURRENT_IS_UTF8) + Bool status; + char *temp; + + if ((temp = malloc(sizeIn)) == NULL) { + return FALSE; + } + ASSERT((sizeIn & 1) == 0); + ASSERT((ssize_t) sizeIn >= 0); + swab(bufIn, temp, sizeIn); + status = CodeSetOld_Utf16leToUtf8(temp, sizeIn, bufOut, sizeOut); + free(temp); + return status; +#elif defined(USE_ICONV) + DynBuf db; + Bool ok; + + DynBuf_Init(&db); + ok = CodeSetOld_GenericToGenericDb("UTF-16BE", bufIn, sizeIn, + CodeSetOld_GetCurrentCodeSet(), 0, &db); + return CodeSetOldDynBufFinalize(ok, &db, bufOut, sizeOut); +#elif defined(_WIN32) + char c; + char *bufIn_dup; + int i; + Bool status = FALSE; + + bufIn_dup = NULL; + + /* sizeIn must be even */ + ASSERT((sizeIn & 1) == 0); + + /* Make a non-const copy */ + bufIn_dup = malloc(sizeIn); + if (bufIn_dup == NULL) { + goto error; + } + memcpy(bufIn_dup, bufIn, sizeIn); + + /* Swap pairs of bytes */ + for (i = 0; i < sizeIn; i += 2) { + c = bufIn_dup[i]; + bufIn_dup[i] = bufIn_dup[i + 1]; + bufIn_dup[i + 1] = c; + } + + status = CodeSetOldUtf16leToCurrent(bufIn_dup, sizeIn, bufOut, sizeOut); + + error: + free(bufIn_dup); + return status; +#else +#error +#endif +} + + +/* + *----------------------------------------------------------------------------- + * + * CodeSetOld_Utf16beToUtf8 -- + * + * Convert the content of a buffer (that uses the UTF-16BE encoding) into + * another buffer (that uses the UTF-8 encoding). + * + * Results: + * TRUE on success: '*bufOut' contains the allocated, NUL terminated buffer. + * If not NULL, '*sizeOut' contains the size of the buffer + * (excluding the NUL terminator) + * FALSE on failure + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +Bool +CodeSetOld_Utf16beToUtf8(char const *bufIn, // IN + size_t sizeIn, // IN + char **bufOut, // OUT + size_t *sizeOut) // OUT +{ + DynBuf db; + Bool ok; + + DynBuf_Init(&db); + ok = CodeSetOld_Utf16beToUtf8Db(bufIn, sizeIn, &db); + return CodeSetOldDynBufFinalize(ok, &db, bufOut, sizeOut); +} + + +/* + *----------------------------------------------------------------------------- + * + * CodeSetOld_Utf16beToUtf8Db -- + * + * Append the content of a buffer (that uses the UTF-16BE encoding) to a + * DynBuf (that uses the UTF-8 encoding). + * + * Results: + * TRUE on success + * FALSE on failure + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +Bool +CodeSetOld_Utf16beToUtf8Db(char const *bufIn, // IN + size_t sizeIn, // IN + DynBuf *db) // IN +{ + int i; + char *temp; + Bool ret = FALSE; + if ((temp = malloc(sizeIn)) == NULL) { + return ret; + } + ASSERT((sizeIn & 1) == 0); + ASSERT((ssize_t) sizeIn >= 0); + + for (i = 0; i < sizeIn; i += 2) { + temp[i] = bufIn[i + 1]; + temp[i + 1] = bufIn[i]; + } + + ret = CodeSetOld_Utf16leToUtf8Db(temp, sizeIn, db); + free(temp); + return ret; +} + + +/* + *----------------------------------------------------------------------------- + * + * CodeSet_AsciiToUtf8 -- + * + * Convert ASCII to UTF-8 + * + * Results: + * On success, TRUE and conversion result in bufOut and sizeOut. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +Bool +CodeSetOld_AsciiToUtf8(const char *bufIn, // IN + size_t sizeIn, // IN + unsigned int flags, // IN + char **bufOut, // OUT + size_t *sizeOut) // OUT +{ + DynBuf db; + Bool ok; + + DynBuf_Init(&db); + ok = CodeSetOld_AsciiToUtf8Db(bufIn, sizeIn, flags, &db); + return CodeSetOldDynBufFinalize(ok, &db, bufOut, sizeOut); +} + + +/* + *----------------------------------------------------------------------------- + * + * CodeSet_AsciiToUtf8Db -- + * + * Convert ASCII to UTF-8 + * + * Results: + * On success, TRUE and conversion result appended to db. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +Bool +CodeSetOld_AsciiToUtf8Db(char const *bufIn, // IN + size_t sizeIn, // IN + unsigned int flags, // IN + DynBuf *db) // OUT +{ + size_t oldSize = DynBuf_GetSize(db); + size_t i; + size_t last = 0; + + for (i = 0; i < sizeIn; i++) { + if (UNLIKELY((unsigned char) bufIn[i] >= 0x80)) { + if (flags == 0) { + DynBuf_SetSize(db, oldSize); + return FALSE; + } + DynBuf_Append(db, bufIn + last, i - last); + if ((flags & CSGTG_TRANSLIT) != 0) { + DynBuf_Append(db, "\xef\xbf\xbd", 3); + } + last = i + 1; + } + } + DynBuf_Append(db, bufIn + last, i - last); + + return TRUE; +} + + +/* + *----------------------------------------------------------------------------- + * + * CodeSet_Utf8ToAscii -- + * + * Convert UTF-8 to ASCII + * + * Results: + * On success, TRUE and conversion result in bufOut and sizeOut. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +Bool +CodeSetOld_Utf8ToAscii(const char *bufIn, // IN + size_t sizeIn, // IN + unsigned int flags, // IN + char **bufOut, // OUT + size_t *sizeOut) // OUT +{ + DynBuf db; + Bool ok; + + DynBuf_Init(&db); + ok = CodeSetOld_Utf8ToAsciiDb(bufIn, sizeIn, flags, &db); + return CodeSetOldDynBufFinalize(ok, &db, bufOut, sizeOut); +} + + +/* + *----------------------------------------------------------------------------- + * + * CodeSet_Utf8ToAsciiDb -- + * + * Convert UTF-8 to ASCII + * + * Results: + * On success, TRUE and conversion result appended to db. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +Bool +CodeSetOld_Utf8ToAsciiDb(char const *bufIn, // IN + size_t sizeIn, // IN + unsigned int flags, // IN + DynBuf *db) // OUT +{ + size_t oldSize = DynBuf_GetSize(db); + uint8 *p = (uint8 *) bufIn; + uint8 *end = (uint8 *) bufIn + sizeIn; + uint8 *last = p; + + for (; p < end; p++) { + if (UNLIKELY(*p >= 0x80)) { + int n; + + if (flags == 0) { + DynBuf_SetSize(db, oldSize); + return FALSE; + } + DynBuf_Append(db, last, p - last); + if ((flags & CSGTG_TRANSLIT) != 0) { + DynBuf_Append(db, "\x1a", 1); + } + if ((n = CodeSetOldGetUtf8((char *)p, (char *)end, NULL)) > 0) { + p += n - 1; + } + last = p + 1; + } + } + DynBuf_Append(db, last, p - last); + + return TRUE; +} + + +#if defined(_WIN32) +/* + *----------------------------------------------------------------------------- + * + * GetInvalidCharsFlag -- + * + * The flag MB_ERR_INVALID_CHARS can only be passed to MultiByteToWideChar + * on Win2000 SP4 or later. If it's passed to an NT or 9x system, + * MultiByteToWideChar fails with ERR_INVALID_FLAGS. + * + * Results: + * returns MB_ERR_INVALID_CHARS if this flag is supported under current OS + * returns zero if the flag would case MultiByteToWideChar failure. + * + * Side effects: + * none + * + *----------------------------------------------------------------------------- + */ + +static DWORD +GetInvalidCharsFlag(void) +{ + static volatile Bool bFirstCall = TRUE; + static DWORD retval; + + OSVERSIONINFOEX osvi; + BOOL bOsVersionInfoEx; + + if (!bFirstCall) { // We can return a cached result for subsequent calls + return retval; + } + + /* + * Try calling GetVersionEx using the OSVERSIONINFOEX structure. + */ + + ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX)); + osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); + + if(!(bOsVersionInfoEx = GetVersionEx((OSVERSIONINFO *) &osvi))) { + /* + * If GetVersionEx failed, we are running something earlier than NT4+SP6, + * thus we cannot use MB_ERR_INVALID_CHARS + */ + retval = 0; + bFirstCall = FALSE; + return retval; + } + + if (osvi.dwMajorVersion > 5) { + retval = MB_ERR_INVALID_CHARS; // Vista or later + } else if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion > 0) { + retval = MB_ERR_INVALID_CHARS; // XP, 2003 + } else if (osvi.dwMajorVersion == 5 + && osvi.dwMinorVersion == 0 + && osvi.wServicePackMajor >= 4) { // Win2000 + SP4 + retval = MB_ERR_INVALID_CHARS; + } else { + retval = 0; // Do not use MB_ERR_INVALID_CHARS on this OS. + } + + bFirstCall = FALSE; + return retval; +} +#endif + + +/* + *----------------------------------------------------------------------------- + * + * CodeSetOld_IsEncodingSupported -- + * + * Not really from the old codeset file, but we need a non-ICU way + * of doing this. Asking lib/unicode to cross-reference the + * encoding name with its internal list is functionally equivalent + * to what Unicode_IsEncodingSupported used to do (and still does + * if no ICU support is built-in). + * + * Results: + * TRUE on success + * FALSE on failure + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +Bool +CodeSetOld_IsEncodingSupported(const char *name) // IN +{ + ASSERT(name); + return (STRING_ENCODING_UNKNOWN != Unicode_EncodingNameToEnum(name)); +} + + +/* + *----------------------------------------------------------------------------- + * + * CodeSetOld_Validate -- + * + * Validate a string in the given encoding. + * + * Results: + * TRUE if string is valid, + * FALSE otherwise. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +Bool +CodeSetOld_Validate(const char *buf, // IN: the string + size_t size, // IN: length of string + const char *code) // IN: encoding +{ + DynBuf db; + Bool ok; + + if (size == 0) { + return TRUE; + } + + DynBuf_Init(&db); + ok = CodeSetOld_GenericToGenericDb(code, buf, size, "UTF-8", + CSGTG_NORMAL, &db); + DynBuf_Destroy(&db); + return ok; +} + + +/* + *----------------------------------------------------------------------------- + * + * CodeSetOld_Init -- + * + * No-op. + * + * Results: + * TRUE. + * + * Side effects: + * See above + * + *----------------------------------------------------------------------------- + */ + +Bool +CodeSetOld_Init(UNUSED_PARAM(const char *dataDir)) +{ + return TRUE; +} diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/misc/codesetOld.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/misc/codesetOld.h --- open-vm-tools-2008.01.23-74039/lib/misc/codesetOld.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/misc/codesetOld.h 2008-10-13 08:01:52.000000000 +0100 @@ -0,0 +1,210 @@ +/********************************************************* + * Copyright (C) 1998 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. + * + *********************************************************/ + +/* + * codesetOld.h -- + * + * The old codeset implementation that depends on system libraries. + * Used for fallback if ICU isn't available. + * + */ + +#ifndef __CODESET_OLD_H__ +# define __CODESET_OLD_H__ + +#include "dynbuf.h" +#include "codeset.h" // for CURRENT_IS_UTF8 + + +/* + * These systems use iconv and nl_langinfo. + * See the definition of CURRENT_IS_UTF8. + */ + +#if !defined(CURRENT_IS_UTF8) && !defined(_WIN32) + #define USE_ICONV +#endif + + +/* + * NO_CORE_ICU is currently only used by oddball Tools builds + * (non-Linux, non-Windows, non-Mac, source). It means "don't compile + * our borrowed ICU source". Even if we don't do that, however, it's + * still possible to use the system ICU libraries if USE_ICU is + * defined (currently only for open-source tools builds. + * + * Since codeset.c is the ICU layer over codesetOld.c, if we are NOT + * using either variety of ICU, then we won't be compiling codeset.c, + * and thus need to transparently convert codeset calls to old codeset + * calls. + */ + +#if defined(NO_CORE_ICU) && !defined(USE_ICU) +#define CodeSetOld_GenericToGenericDb CodeSet_GenericToGenericDb +#define CodeSetOld_GenericToGeneric CodeSet_GenericToGeneric +#define CodeSetOld_Utf8ToCurrent CodeSet_Utf8ToCurrent +#define CodeSetOld_CurrentToUtf8 CodeSet_CurrentToUtf8 +#define CodeSetOld_Utf16leToUtf8Db CodeSet_Utf16leToUtf8Db +#define CodeSetOld_Utf16leToUtf8 CodeSet_Utf16leToUtf8 +#define CodeSetOld_Utf8ToUtf16le CodeSet_Utf8ToUtf16le +#define CodeSetOld_CurrentToUtf16le CodeSet_CurrentToUtf16le +#define CodeSetOld_Utf16leToCurrent CodeSet_Utf16leToCurrent +#define CodeSetOld_Utf16beToCurrent CodeSet_Utf16beToCurrent +#define CodeSetOld_Utf8FormDToUtf8FormC CodeSet_Utf8FormDToUtf8FormC +#define CodeSetOld_Utf8FormCToUtf8FormD CodeSet_Utf8FormCToUtf8FormD +#define CodeSetOld_GetCurrentCodeSet CodeSet_GetCurrentCodeSet +#define CodeSetOld_IsEncodingSupported CodeSet_IsEncodingSupported +#define CodeSetOld_Validate CodeSet_Validate +#define CodeSetOld_Init CodeSet_Init +#endif + +Bool +CodeSetOld_GenericToGenericDb(char const *codeIn, // IN + char const *bufIn, // IN + size_t sizeIn, // IN + char const *codeOut, // IN + unsigned int flags, // IN + DynBuf *db); // IN/OUT + +Bool +CodeSetOld_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 +CodeSetOld_Utf8ToCurrent(char const *bufIn, // IN + size_t sizeIn, // IN + char **bufOut, // OUT + size_t *sizeOut); // OUT + +Bool +CodeSetOld_CurrentToUtf8(char const *bufIn, // IN + size_t sizeIn, // IN + char **bufOut, // OUT + size_t *sizeOut); // OUT + +Bool +CodeSetOld_Utf16leToUtf8Db(char const *bufIn, // IN + size_t sizeIn, // IN + DynBuf *db); // IN + +Bool +CodeSetOld_Utf16leToUtf8(char const *bufIn, // IN + size_t sizeIn, // IN + char **bufOut, // OUT + size_t *sizeOut); // OUT + +Bool +CodeSetOld_Utf8ToUtf16le(char const *bufIn, // IN + size_t sizeIn, // IN + char **bufOut, // OUT + size_t *sizeOut); // OUT + +Bool +CodeSetOld_CurrentToUtf16le(char const *bufIn, // IN + size_t sizeIn, // IN + char **bufOut, // OUT + size_t *sizeOut); // OUT + +Bool +CodeSetOld_Utf16leToCurrent(char const *bufIn, // IN + size_t sizeIn, // IN + char **bufOut, // OUT + size_t *sizeOut); // OUT + +Bool +CodeSetOld_Utf16beToCurrent(char const *bufIn, // IN + size_t sizeIn, // IN + char **bufOut, // OUT + size_t *sizeOut); // OUT + +Bool +CodeSetOld_Utf8Normalize(const char *bufIn, // IN + size_t sizeIn, // IN + Bool precomposed, // IN + DynBuf *db); // OUT + +Bool +CodeSetOld_Utf8FormDToUtf8FormC(char const *bufIn, // IN + size_t sizeIn, // IN + char **bufOut, // OUT + size_t *sizeOut); // OUT + +Bool +CodeSetOld_Utf8FormCToUtf8FormD(char const *bufIn, // IN + size_t sizeIn, // IN + char **bufOut, // OUT + size_t *sizeOut); // OUT + +Bool +CodeSetOld_Utf16beToUtf8(char const *bufIn, // IN + size_t sizeIn, // IN + char **bufOut, // OUT + size_t *sizeOut); // OUT + +Bool +CodeSetOld_Utf16beToUtf8Db(char const *bufIn, // IN + size_t sizeIn, // IN + DynBuf *db); // IN + +Bool +CodeSetOld_AsciiToUtf8(const char *bufIn, // IN + size_t sizeIn, // IN + unsigned int flags, // IN + char **bufOut, // OUT + size_t *sizeOut); // OUT + +Bool +CodeSetOld_AsciiToUtf8Db(char const *bufIn, // IN + size_t sizeIn, // IN + unsigned int flags, // IN + DynBuf *db); // OUT + +Bool +CodeSetOld_Utf8ToAscii(const char *bufIn, // IN + size_t sizeIn, // IN + unsigned int flags, // IN + char **bufOut, // OUT + size_t *sizeOut); // OUT + +Bool +CodeSetOld_Utf8ToAsciiDb(char const *bufIn, // IN + size_t sizeIn, // IN + unsigned int flags, // IN + DynBuf *db); // OUT + +const char * +CodeSetOld_GetCurrentCodeSet(void); + +Bool +CodeSetOld_IsEncodingSupported(const char *name); // IN + +Bool +CodeSetOld_Validate(const char *buf, // IN: the string + size_t size, // IN: length of string + const char *code); // IN: encoding + +Bool +CodeSetOld_Init(const char *dataDir); // UNUSED + + +#endif /* __CODESET_OLD_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/misc/dbllnklst.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/misc/dbllnklst.c --- open-vm-tools-2008.01.23-74039/lib/misc/dbllnklst.c 2008-01-28 08:02:51.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/misc/dbllnklst.c 2008-10-13 08:01:52.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -164,7 +164,7 @@ */ Bool -DblLnkLst_IsLinked(DblLnkLst_Links *l) // IN +DblLnkLst_IsLinked(DblLnkLst_Links const *l) // IN { ASSERT(l); diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/misc/dynarray.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/misc/dynarray.c --- open-vm-tools-2008.01.23-74039/lib/misc/dynarray.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/misc/dynarray.c 2008-10-13 08:01:52.000000000 +0100 @@ -0,0 +1,298 @@ +/********************************************************* + * Copyright (C) 2004 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.c -- + * + * Dynamic array of objects -- tonyc + */ + +#include + +#include "vmware.h" +#include "dynarray.h" + + +/* + *----------------------------------------------------------------------------- + * + * DynArray_Init -- + * + * Initialize the dynamic array + * + * Results: + * TRUE on success. FALSE on failure. + * + * Side effects: + * See above + * + *----------------------------------------------------------------------------- + */ + +Bool +DynArray_Init(DynArray *a, // IN/OUT + unsigned int count, // IN + size_t width) // IN +{ + ASSERT(a); + + DynBuf_Init(&a->buf); + a->width = width; + return DynArray_SetCount(a, count); +} + + +/* + *----------------------------------------------------------------------------- + * + * DynArray_Destroy -- + * + * Destroy the array + * + * Results: + * None + * + * Side effects: + * See above + * + *----------------------------------------------------------------------------- + */ + +void +DynArray_Destroy(DynArray *a) // IN/OUT +{ + ASSERT(a); + + DynBuf_Destroy(&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 + * + *----------------------------------------------------------------------------- + */ + +void * +DynArray_AddressOf(const DynArray *a, // IN + unsigned int i) // IN +{ + uint8 *result = NULL; + + ASSERT(a); + + if (i < DynArray_Count(a)) { + result = ((uint8 *)DynBuf_Get(&a->buf)) + (i * a->width); + } + return result; +} + + +/* + *----------------------------------------------------------------------------- + * + * DynArray_Count -- + * + * Returns the number of elements in the array. + * + * Results: + * See above. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +unsigned int +DynArray_Count(const DynArray *a) // IN +{ + ASSERT(a); + + return (unsigned int) (DynBuf_GetSize(&a->buf) / a->width); +} + + +/* + *----------------------------------------------------------------------------- + * + * DynArray_SetCount -- + * + * Sets the number of elements in the array. This may enlarge + * the size of the array. + * + * Results: + * TRUE on success + * FALSE on failure (not enough memory) + * + * Side effects: + * May resize the array + * + *----------------------------------------------------------------------------- + */ + +Bool +DynArray_SetCount(DynArray *a, // IN/OUT + unsigned int c) // IN +{ + size_t needed, allocated; + + ASSERT(a); + + needed = c * a->width; + allocated = DynBuf_GetAllocatedSize(&a->buf); + + if (allocated < needed) { + if (!DynBuf_Enlarge(&a->buf, needed)) { + return FALSE; + } + } + DynBuf_SetSize(&a->buf, needed); + + return TRUE; +} + + +/* + *----------------------------------------------------------------------------- + * + * DynArray_AllocCount -- + * + * Returns the actual size of the array. If you want the effective + * size, use DynArray_Count. Technically, you don't need this API + * unless you're doing trimming (i.e. Don't bother trimming if + * DynArray_AllocCount is within some threshold of DynArray_Count. + * It won't buy you much). + * + * Results: + * See above. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +unsigned int +DynArray_AllocCount(const DynArray *a) // IN +{ + ASSERT(a); + + return (unsigned int) (DynBuf_GetAllocatedSize(&a->buf) / a->width); +} + + +/* + *----------------------------------------------------------------------------- + * + * 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 + * + *----------------------------------------------------------------------------- + */ + +Bool +DynArray_Trim(DynArray *a) // IN/OUT +{ + ASSERT(a); + + return DynBuf_Trim(&a->buf); +} + + +/* + *----------------------------------------------------------------------------- + * + * DynArray_QSort -- + * + * A wrapper for the quicksort function. Sorts the DynArray + * according to the provided comparison function. + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +void +DynArray_QSort(DynArray *a, // IN/OUT + DynArrayCmp compare) // IN +{ + uint8 *arrayBuf; + + ASSERT(a); + ASSERT(compare); + + arrayBuf = DynBuf_Get(&a->buf); + qsort(arrayBuf, DynArray_Count(a), a->width, compare); +} + + +/* + *----------------------------------------------------------------------------- + * + * 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. + * + *----------------------------------------------------------------------------- + */ + +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); +} + diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/misc/dynbuf.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/misc/dynbuf.c --- open-vm-tools-2008.01.23-74039/lib/misc/dynbuf.c 2008-01-28 08:02:51.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/misc/dynbuf.c 2008-10-13 08:01:52.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -272,8 +272,12 @@ #if defined(DYNBUF_DEBUG) b->allocated + 1 #else - /* Double the previously allocated size --hpreg */ - b->allocated * 2 + /* + * Double the previously allocated size if it is less + * than 256KB; otherwise grow it linearly by 256KB + */ + (b->allocated < 256 * 1024 ? b->allocated * 2 + : b->allocated + 256 * 1024) #endif : #if defined(DYNBUF_DEBUG) diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/misc/escape.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/misc/escape.c --- open-vm-tools-2008.01.23-74039/lib/misc/escape.c 2008-01-28 08:02:51.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/misc/escape.c 2008-10-13 08:01:52.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -121,7 +121,7 @@ /* We must escape that byte --hpreg */ escSeq[0] = Dec2Hex[ubyte >> 4]; - escSeq[1] = Dec2Hex[ubyte & 0xF]; + escSeq[1] = Dec2Hex[ubyte & 0xF]; if ( DynBuf_Append(&b, &buf[startUnescaped], index - startUnescaped) == FALSE || DynBuf_Append(&b, escStr, escStrLen) == FALSE @@ -157,6 +157,38 @@ /* *----------------------------------------------------------------------------- * + * Escape_Do -- + * + * Escape a buffer + * + * Results: + * The escaped, allocated, NUL terminated buffer on success. If not NULL, + * '*sizeOut' contains the size of the buffer (excluding the NUL + * terminator) + * NULL on failure (not enough memory) + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +void * +Escape_Do(char escByte, // IN + int const *bytesToEsc, // IN + void const *bufIn, // IN + size_t sizeIn, // IN + size_t *sizeOut) // OUT +{ + const char escStr[] = { escByte, '\0' }; + + return Escape_DoString(escStr, bytesToEsc, bufIn, sizeIn, sizeOut); +} + + +/* + *----------------------------------------------------------------------------- + * * Escape_Undo -- * * Unescape a buffer --hpreg diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/misc/hash.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/misc/hash.c --- open-vm-tools-2008.01.23-74039/lib/misc/hash.c 2008-01-28 08:02:51.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/misc/hash.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,663 +0,0 @@ -/********************************************************* - * Copyright (C) 2004 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 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. - * - *********************************************************/ - -/* - * hash.c -- - * - * An implementation of hashtable with no removals. - * For string keys. - */ - -#include -#include -#include -#include - -#include "vmware.h" -#include "hash.h" -#include "dbllnklst.h" -#include "vm_basic_asm.h" - - -#define HASH_ROTATE 5 - - -/* - * An entry in the hashtable. Provides two client datas - * for ease of use. - */ -typedef struct HashEntry { - DblLnkLst_Links l; - const char *keyStr; - void *clientData; -} HashEntry; - -/* - * The hashtable structure. - */ -struct HashTable { - uint32 numEntries; - uint32 numBits; - int keyType; - HashFreeEntryFn freeEntryFn; - DblLnkLst_Links *buckets; - - size_t numElements; -}; - - -/* - * Local functions - */ - -static HashEntry *HashLookup(HashTable *ht, const char *keyStr, uint32 hash); - - -/* - *----------------------------------------------------------------------------- - * - * HashHash -- - * - * Compute hash value based on key type and hash size. - * - * Results: - * The hash value. - * - * Side effects: - * None. - * - *----------------------------------------------------------------------------- - */ - -static INLINE uint32 -HashHash(HashTable *ht, // IN: hash table - const char *s) // IN: string to hash -{ - uint32 h = 0; - - switch (ht->keyType) { - case HASH_STRING_KEY: { - int c; - while ((c = (unsigned char) *s++)) { - h ^= c; - h = h << HASH_ROTATE | h >> (32 - HASH_ROTATE); - } - } - break; - case HASH_ISTRING_KEY: { - int c; - while ((c = tolower((unsigned char) *s++))) { - h ^= c; - h = h << HASH_ROTATE | h >> (32 - HASH_ROTATE); - } - } - break; - case HASH_INT_KEY: - ASSERT_ON_COMPILE(sizeof s == 4 || sizeof s == 8); - if (sizeof s == 4) { - h = (uint32) (uintptr_t) s; - } else { - h = (uint32) (uintptr_t) s ^ (uint32) ((uint64) (uintptr_t) s >> 32); - } - h *= 48271; // http://www.google.com/search?q=48271+pseudorandom - break; - default: - NOT_REACHED(); - } - - { - int numBits = ht->numBits; - uint32 mask = MASK(numBits); - for (; h > mask; h = (h & mask) ^ (h >> numBits)) { - } - } - - ASSERT(h < ht->numEntries); - return h; -} - -#if defined(N_PLAT_NLM) -static int -strcasecmp(const char *s1, // IN: - const char *s2) // IN: -{ - while (*s1 && tolower(*s1++) == tolower(*s2++)) - ; - - return tolower(*s1) - tolower(*s2); -} - -static int -ffs(uint32 bits) -{ - uint32 i; - - if (bits == 0) { - i = 0; - } else { - i = 1; - - while (bits) { - i++; - bits >>= 1; - } - } - - return i; -} -#endif - -/* - *----------------------------------------------------------------------------- - * - * HashEqual -- - * - * Compare two keys based on key type - * - * Results: - * TRUE if keys are equal. - * - * Side effects: - * None. - * - *----------------------------------------------------------------------------- - */ - -static INLINE Bool -HashEqual(HashTable *ht, // IN: hash table - const char *key1, // IN: key - const char *key2) // IN: key -{ - switch (ht->keyType) { - case HASH_STRING_KEY: - return strcmp(key1, key2) == 0; - - case HASH_ISTRING_KEY: - return strcasecmp(key1, key2) == 0; - - default: - return key1 == key2; - } -} - - -/* - *---------------------------------------------------------------------- - * - * Hash_Alloc -- - * - * Create a hash table. - * - * Results: - * The new hashtable. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -HashTable * -Hash_Alloc(uint32 numEntries, // IN: must be a power of 2 - int keyType, // IN: whether keys are strings - HashFreeEntryFn fn) // IN: free entry function -{ - HashTable *ht; - uint32 i; - - ASSERT(numEntries > 0); - if ((numEntries & (numEntries - 1)) != 0) { - Panic("%s only takes powers of 2 \n", __FUNCTION__); - } - - ht = (HashTable *) malloc(sizeof(HashTable)); - ASSERT_MEM_ALLOC(ht); - - ht->numBits = ffs(numEntries) - 1; - ht->numEntries = numEntries; - ht->keyType = keyType; - ht->freeEntryFn = fn; - ht->buckets = (DblLnkLst_Links *) malloc(ht->numEntries * - sizeof(DblLnkLst_Links)); - ASSERT_MEM_ALLOC(ht->buckets); - - for (i = 0; i < ht->numEntries; i++) { - DblLnkLst_Init(&ht->buckets[i]); - } - - ht->numElements = 0; - - return ht; -} - - -/* - *---------------------------------------------------------------------- - * - * Hash_Free -- - * - * Free the hash table skeleton. - * - * Results: - * None. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -void -Hash_Free(HashTable *ht) // IN/OUT -{ - ASSERT(ht); - - Hash_Clear(ht); - - free(ht->buckets); - free(ht); -} - - -/* - *---------------------------------------------------------------------- - * - * Hash_Clear -- - * - * Clear all entries a hashtable by freeing them. - * - * Results: - * None. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -void -Hash_Clear(HashTable *ht) // IN/OUT -{ - int i; - - ASSERT(ht); - - ht->numElements = 0; - - for (i = 0; i < ht->numEntries; i++) { - DblLnkLst_Links *head; - DblLnkLst_Links *cur; - DblLnkLst_Links *next = NULL; - - head = &ht->buckets[i]; - for (cur = head->next; cur != head; cur = next) { - HashEntry *entry = DblLnkLst_Container(cur, HashEntry, l); - - ASSERT(entry); - if (ht->freeEntryFn) { - ht->freeEntryFn(entry->clientData); - } - next = cur->next; - DblLnkLst_Unlink1(cur); - free(entry); - } - } -} - - -/* - *---------------------------------------------------------------------- - * - * HashLookup -- - * - * Core of the lookup function. - * - * Results: - * A pointer to the found HashEntry or NULL if not found - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static HashEntry * -HashLookup(HashTable *ht, // IN - const char *keyStr, // IN - uint32 hash) // IN -{ - DblLnkLst_Links *cur, *head; - - head = &ht->buckets[hash]; - for (cur = head->next; cur != head; cur = cur->next) { - HashEntry *entry; - - entry = DblLnkLst_Container(cur, HashEntry, l); - ASSERT(entry); - - if (HashEqual(ht, entry->keyStr, keyStr)) { - return entry; - } - } - - return NULL; -} - - -/* - *---------------------------------------------------------------------- - * - * Hash_Lookup -- - * - * Lookup an element in a hashtable. - * - * Results: - * TRUE if the entry was found. (the clientData is set) - * FALSE otherwise - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -Bool -Hash_Lookup(HashTable *ht, // IN - const char *keyStr, // IN - void **clientData) // OUT -{ - HashEntry *entry; - uint32 hash = HashHash(ht, keyStr); - - entry = HashLookup(ht, keyStr, hash); - - if (entry == NULL) { - return FALSE; - } else { - if (clientData) { - *clientData = entry->clientData; - } - - return TRUE; - } -} - - -/* - *---------------------------------------------------------------------- - * - * Hash_Delete -- - * - * Delete an element from the hashtable. - * - * Results: - * TRUE if the entry was found and subsequently removed - * FALSE otherwise - * - * Side effects: - * See above - * - *---------------------------------------------------------------------- - */ - -Bool -Hash_Delete(HashTable *ht, // IN/OUT: the hash table - const char *keyStr) // IN: key for the element to remove -{ - DblLnkLst_Links *head, *cur, *next = NULL; - uint32 hash = HashHash(ht, keyStr); - - head = &ht->buckets[hash]; - for (cur = head->next; cur != head; cur = next) { - HashEntry *entry = DblLnkLst_Container(cur, HashEntry, l); - ASSERT(entry); - - next = cur->next; - if (HashEqual(ht, entry->keyStr, keyStr)) { - if (ht->freeEntryFn) { - ht->freeEntryFn(entry->clientData); - } - DblLnkLst_Unlink1(cur); - free(DblLnkLst_Container(cur, HashEntry, l)); - ht->numElements--; - return TRUE; - } - } - return FALSE; -} - - -/* - *---------------------------------------------------------------------- - * - * Hash_Insert -- - * - * Insert an element into the hashtable. The string key is - * not duplicated & thus cannot be free until there is no - * more need for the hashtable. - * - * Results: - * FALSE if item already exists. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -Bool -Hash_Insert(HashTable *ht, // IN/OUT - const char *keyStr, // IN - void *clientData) // IN -{ - HashEntry *entry; - uint32 hash = HashHash(ht, keyStr); - - if (HashLookup(ht, keyStr, hash) != NULL) { - return FALSE; - } - - entry = (HashEntry *) malloc(sizeof(HashEntry)); - ASSERT_MEM_ALLOC(entry); - entry->keyStr = keyStr; - entry->clientData = clientData; - DblLnkLst_Init(&entry->l); - - DblLnkLst_LinkLast(&ht->buckets[hash], &entry->l); - ht->numElements++; - return TRUE; -} - - -/* - *---------------------------------------------------------------------- - * - * Hash_GetNumElements -- - * - * Get the number of elements in the hash table. - * - * Results: - * The number of elements. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -size_t -Hash_GetNumElements(const HashTable *ht) // IN: -{ - return ht->numElements; -} - - -/* - *---------------------------------------------------------------------- - * - * Hash_ToArray -- - * - * Returns an array of pointers to each clientData structure in the - * hash table. - * - * Results: - * The clientData array plus its size. If the hash table is empty - * 'size' is 0 and 'clientDatas' is NULL. Free with free(). - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -void -Hash_ToArray(const HashTable *ht, // IN - void ***clientDatas, // OUT - size_t *size) // OUT -{ - uint32 i; - size_t j; - - ASSERT(ht); - ASSERT(clientDatas); - ASSERT(size); - - *clientDatas = NULL; - *size = Hash_GetNumElements(ht); - - if (0 == *size) { - return; - } - - /* alloc array */ - *clientDatas = malloc(*size * sizeof(void *)); - ASSERT_MEM_ALLOC(*clientDatas); - - /* fill array */ - for (i = 0, j = 0; i < ht->numEntries; i++) { - DblLnkLst_Links *head; - DblLnkLst_Links *cur; - DblLnkLst_Links *next = NULL; - - head = &ht->buckets[i]; - for (cur = head->next; cur != head; cur = next) { - HashEntry *entry = DblLnkLst_Container(cur, HashEntry, l); - ASSERT(entry); - - (*clientDatas)[j++] = entry->clientData; - next = cur->next; - } - } -} - - -/* - *---------------------------------------------------------------------- - * - * Hash_ForEach -- - * - * Walks the hashtable in an undetermined order, calling the - * callback function for each value until either the callback - * returns a non-zero value or all values have been walked - * - * Results: - * 0 if all callback functions returned 0, otherwise the return - * value of the first non-zero callback. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -int -Hash_ForEach(const HashTable *ht, // IN - HashForEachCallback cb, // IN - void *clientData) // IN -{ - int i; - - ASSERT(ht); - ASSERT(cb); - - for (i = 0; i < ht->numEntries; i++) { - DblLnkLst_Links *head, *cur; - - head = &ht->buckets[i]; - for (cur = head->next; cur != head; cur = cur->next) { - int result; - HashEntry *entry = DblLnkLst_Container(cur, HashEntry, l); - - ASSERT(entry); - result = (*cb)(entry->keyStr, entry->clientData, clientData); - if (result) { - return result; - } - } - } - return 0; -} - -#if 0 -/* - *---------------------------------------------------------------------- - * - * HashPrint -- - * - * Print out the contents of a hashtable. Useful for - * debugging the data structure & the hashing algorithm. - * - * Results: - * None. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -void -HashPrint(HashTable *ht) // IN -{ - int i; - - for (i = 0; i < ht->numEntries; i++) { - DblLnkLst_Links *head, *cur; - - head = &ht->buckets[i]; - if (head->next == head) { - continue; - } - - printf("%4d: \n", i); - - for (cur = head->next; cur != head; cur = cur->next) { - HashEntry *entry; - - entry = DblLnkLst_Container(cur, HashEntry, l); - ASSERT(entry); - - if (ht->keyType == HASH_INT_KEY) { - printf("\t%p\n", entry->keyStr); - } else { - printf("\t%s\n", entry->keyStr); - } - } - } -} -#endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/misc/hashTable.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/misc/hashTable.c --- open-vm-tools-2008.01.23-74039/lib/misc/hashTable.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/misc/hashTable.c 2008-10-13 08:01:52.000000000 +0100 @@ -0,0 +1,922 @@ +/********************************************************* + * Copyright (C) 2004 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. + * + *********************************************************/ + +/* + * hashTable.c -- + * + * An implementation of hashtable with no removals. + * For string keys. + */ + +#include +#include +#include +#include +#ifdef _WIN32 +#include +#endif + +#include "vmware.h" +#include "hashTable.h" +#include "vm_basic_asm.h" +#include "util.h" +#include "str.h" +#include "vm_atomic.h" + + +#define HASH_ROTATE 5 + + +/* + * Pointer to hash table entry + * + * The assumption is that Atomic_ReadPtr() and Atomic_WritePtr() + * are cheap, so can be used with nonatomic hash tables. + * SETENTRYATOMIC() sets a link to point to a new entry + * if the current value is the same as the old entry. + * It returns TRUE on success. + */ + +typedef Atomic_Ptr HashTableLink; + +#define ENTRY(l) ((HashTableEntry *) Atomic_ReadPtr(&(l))) +#define SETENTRY(l, e) Atomic_WritePtr(&(l), e) +#ifdef NO_ATOMIC_HASHTABLE +#define SETENTRYATOMIC(l, old, new) (Atomic_WritePtr(&(l), new), TRUE) +#else +#define SETENTRYATOMIC(l, old, new) \ + (Atomic_ReadIfEqualWritePtr(&(l), old, new) == (old)) +#endif + +/* + * An entry in the hashtable. + */ + +typedef struct HashTableEntry { + HashTableLink next; + const char *keyStr; + Atomic_Ptr clientData; +} HashTableEntry; + +/* + * The hashtable structure. + */ + +struct HashTable { + uint32 numEntries; + uint32 numBits; + int keyType; + Bool atomic; + Bool copyKey; + HashTableFreeEntryFn freeEntryFn; + HashTableLink *buckets; + + size_t numElements; +}; + + +/* + * Local functions + */ + +static HashTableEntry *HashTableLookup(HashTable *ht, const char *keyStr, + uint32 hash); +HashTableEntry *HashTableLookupOrInsert(HashTable *ht, const char *keyStr, + void *clientData); + + +/* + *----------------------------------------------------------------------------- + * + * HashTableComputeHash -- + * + * Compute hash value based on key type and hash size. + * + * Results: + * The hash value. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static INLINE uint32 +HashTableComputeHash(HashTable *ht, // IN: hash table + const char *s) // IN: string to hash +{ + uint32 h = 0; + + switch (ht->keyType) { + case HASH_STRING_KEY: { + int c; + while ((c = (unsigned char) *s++)) { + h ^= c; + h = h << HASH_ROTATE | h >> (32 - HASH_ROTATE); + } + } + break; + case HASH_ISTRING_KEY: { + int c; + while ((c = tolower((unsigned char) *s++))) { + h ^= c; + h = h << HASH_ROTATE | h >> (32 - HASH_ROTATE); + } + } + break; + case HASH_INT_KEY: + ASSERT_ON_COMPILE(sizeof s == 4 || sizeof s == 8); + if (sizeof s == 4) { + h = (uint32) (uintptr_t) s; + } else { + h = (uint32) (uintptr_t) s ^ (uint32) ((uint64) (uintptr_t) s >> 32); + } + h *= 48271; // http://www.google.com/search?q=48271+pseudorandom + break; + default: + NOT_REACHED(); + } + + { + int numBits = ht->numBits; + uint32 mask = MASK(numBits); + for (; h > mask; h = (h & mask) ^ (h >> numBits)) { + } + } + + ASSERT(h < ht->numEntries); + return h; +} + +#if defined(N_PLAT_NLM) +static int +strcasecmp(const char *s1, // IN: + const char *s2) // IN: +{ + while (*s1 && tolower(*s1++) == tolower(*s2++)); + + return tolower(*s1) - tolower(*s2); +} + +static int +ffs(uint32 bits) +{ + uint32 i; + + if (bits == 0) { + i = 0; + } else { + i = 1; + + while ((bits & 0x1) == 0) { + i++; + bits >>= 1; + } + } + + return i; +} +#endif + +/* + *----------------------------------------------------------------------------- + * + * HashTableEqualKeys -- + * + * Compare two keys based on key type + * + * Results: + * TRUE if keys are equal. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static INLINE Bool +HashTableEqualKeys(HashTable *ht, // IN: hash table + const char *key1, // IN: key + const char *key2) // IN: key +{ + switch (ht->keyType) { + case HASH_STRING_KEY: + return Str_Strcmp(key1, key2) == 0; + + case HASH_ISTRING_KEY: + return Str_Strcasecmp(key1, key2) == 0; + + default: + return key1 == key2; + } +} + + +/* + *---------------------------------------------------------------------- + * + * HashTable_Alloc -- + * + * Create a hash table. + * + * Results: + * The new hashtable. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +HashTable * +HashTable_Alloc(uint32 numEntries, // IN: must be a power of 2 + int keyType, // IN: whether keys are strings + HashTableFreeEntryFn fn) // IN: free entry function +{ + HashTable *ht; + + ASSERT(numEntries > 0); + if ((numEntries & (numEntries - 1)) != 0) { + Panic("%s only takes powers of 2 \n", __FUNCTION__); + } +#ifdef NO_ATOMIC_HASHTABLE + ASSERT_NOT_IMPLEMENTED((keyType & HASH_FLAG_ATOMIC) == 0); +#endif + ASSERT((keyType & HASH_FLAG_COPYKEY) == 0 || + ((keyType & HASH_TYPE_MASK) == HASH_STRING_KEY || + (keyType & HASH_TYPE_MASK) == HASH_ISTRING_KEY)); + + ht = Util_SafeMalloc(sizeof *ht); + ASSERT_MEM_ALLOC(ht); + + ht->numBits = ffs(numEntries) - 1; + ht->numEntries = numEntries; + ht->keyType = keyType & HASH_TYPE_MASK; + ht->atomic = (keyType & HASH_FLAG_ATOMIC) != 0; + ht->copyKey = (keyType & HASH_FLAG_COPYKEY) != 0; + ht->freeEntryFn = fn; + ht->buckets = Util_SafeCalloc(ht->numEntries, sizeof *ht->buckets); + ht->numElements = 0; + +#ifndef NO_ATOMIC_HASHTABLE + if (ht->atomic) { + Atomic_Init(); + } +#endif + + return ht; +} + + +/* + *---------------------------------------------------------------------- + * + * HashTable_AllocOnce -- + * + * Create a hash table and store it in the supplied Atomic_Ptr, + * unless it's already been created. + * + * Results: + * The new (or existing) hashtable. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +HashTable * +HashTable_AllocOnce(Atomic_Ptr *var, // IN/OUT: the atomic var + uint32 numEntries, // IN: must be a power of 2 + int keyType, // IN: whether keys are strings + HashTableFreeEntryFn fn) // IN: free entry function +{ + HashTable *ht; + + if ((ht = Atomic_ReadPtr(var)) == NULL) { + HashTable *new = HashTable_Alloc(numEntries, keyType, fn); +#ifdef NO_ATOMIC_HASHTABLE + Atomic_WritePtr(var, new); +#else + Atomic_Init(); + ht = Atomic_ReadIfEqualWritePtr(var, NULL, new); +#endif + if (ht == NULL) { + ht = new; + } else { + new->atomic = FALSE; + HashTable_Free(new); + } + } + ASSERT(ht == Atomic_ReadPtr(var)); + + return ht; +} + + +/* + *---------------------------------------------------------------------- + * + * HashTable_Free -- + * + * Free the hash table skeleton. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +void +HashTable_Free(HashTable *ht) // IN/OUT +{ + ASSERT(ht); + ASSERT(!ht->atomic); + + HashTable_Clear(ht); + + free(ht->buckets); + free(ht); +} + + +/* + *---------------------------------------------------------------------- + * + * HashTable_Clear -- + * + * Clear all entries a hashtable by freeing them. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +void +HashTable_Clear(HashTable *ht) // IN/OUT +{ + int i; + + ASSERT(ht); + ASSERT(!ht->atomic); + + ht->numElements = 0; + + for (i = 0; i < ht->numEntries; i++) { + HashTableEntry *entry; + while ((entry = ENTRY(ht->buckets[i])) != NULL) { + SETENTRY(ht->buckets[i], ENTRY(entry->next)); + if (ht->copyKey) { + free((char *) entry->keyStr); + } + if (ht->freeEntryFn) { + ht->freeEntryFn(Atomic_ReadPtr(&entry->clientData)); + } + free(entry); + } + } +} + + +/* + *---------------------------------------------------------------------- + * + * HashTableLookup -- + * + * Core of the lookup function. + * + * Results: + * A pointer to the found HashTableEntry or NULL if not found + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +static HashTableEntry * +HashTableLookup(HashTable *ht, // IN + const char *keyStr, // IN + uint32 hash) // IN +{ + HashTableEntry *entry; + + for (entry = ENTRY(ht->buckets[hash]); + entry != NULL; + entry = ENTRY(entry->next)) { + if (HashTableEqualKeys(ht, entry->keyStr, keyStr)) { + return entry; + } + } + + return NULL; +} + + +/* + *---------------------------------------------------------------------- + * + * HashTable_Lookup -- + * + * Lookup an element in a hashtable. + * + * Results: + * TRUE if the entry was found. (the clientData is set) + * FALSE otherwise + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +Bool +HashTable_Lookup(HashTable *ht, // IN + const char *keyStr, // IN + void **clientData) // OUT +{ + uint32 hash = HashTableComputeHash(ht, keyStr); + HashTableEntry *entry = HashTableLookup(ht, keyStr, hash); + + if (entry == NULL) { + return FALSE; + } + + if (clientData) { + *clientData = Atomic_ReadPtr(&entry->clientData); + } + return TRUE; +} + + +/* + *---------------------------------------------------------------------- + * + * HashTable_Delete -- + * + * Delete an element from the hashtable. + * + * Results: + * TRUE if the entry was found and subsequently removed + * FALSE otherwise + * + * Side effects: + * See above + * + *---------------------------------------------------------------------- + */ + +Bool +HashTable_Delete(HashTable *ht, // IN/OUT: the hash table + const char *keyStr) // IN: key for the element to remove +{ + uint32 hash = HashTableComputeHash(ht, keyStr); + HashTableLink *linkp; + HashTableEntry *entry; + + ASSERT(!ht->atomic); + + for (linkp = &ht->buckets[hash]; + (entry = ENTRY(*linkp)) != NULL; + linkp = &entry->next) { + if (HashTableEqualKeys(ht, entry->keyStr, keyStr)) { + SETENTRY(*linkp, ENTRY(entry->next)); + ht->numElements--; + if (ht->copyKey) { + free((char *) entry->keyStr); + } + if (ht->freeEntryFn) { + ht->freeEntryFn(Atomic_ReadPtr(&entry->clientData)); + } + free(entry); + return TRUE; + } + } + return FALSE; +} + + +/* + *---------------------------------------------------------------------- + * + * HashTable_Insert -- + * + * Insert an element into the hashtable. + * + * Unless the hash table was created with HASH_FLAG_COPYKEY, + * the string key is not duplicated and thus cannot be freed until + * the entry is deleted or the hash table is cleared or freed. + * + * Results: + * FALSE if item already exists. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +Bool +HashTable_Insert(HashTable *ht, // IN/OUT + const char *keyStr, // IN + void *clientData) // IN +{ + return HashTableLookupOrInsert(ht, keyStr, clientData) == NULL; +} + + +/* + *---------------------------------------------------------------------- + * + * HashTable_LookupOrInsert -- + * + * Look up an a key, return the element if found. + * Otherwise, insert it into the hashtable and return it. + * + * Unless the hash table was created with HASH_FLAG_COPYKEY, + * the string key is not duplicated and thus cannot be freed until + * the entry is deleted or the hash table is cleared or freed. + * + * Results: + * Old element or new one. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +void * +HashTable_LookupOrInsert(HashTable *ht, // IN/OUT + const char *keyStr, // IN + void *clientData) // IN +{ + HashTableEntry *entry = HashTableLookupOrInsert(ht, keyStr, clientData); + + return entry == NULL ? clientData : Atomic_ReadPtr(&entry->clientData); +} + + +/* + *---------------------------------------------------------------------- + * + * HashTable_ReplaceOrInsert -- + * + * Look up an a key. If found, replace the existing clientData + * and return TRUE. + * Otherwise, insert new entry and return FALSE. + * + * Unless the hash table was created with HASH_FLAG_COPYKEY, + * the string key is not duplicated and thus cannot be freed until + * the entry is deleted or the hash table is cleared or freed. + * + * Results: + * TRUE if replaced, FALSE if inserted. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +Bool +HashTable_ReplaceOrInsert(HashTable *ht, // IN/OUT + const char *keyStr, // IN + void *clientData) // IN +{ + HashTableEntry *entry = HashTableLookupOrInsert(ht, keyStr, clientData); + + if (entry == NULL) { + return FALSE; + } + +#ifndef NO_ATOMIC_HASHTABLE + if (ht->atomic && ht->freeEntryFn) { + void *old = Atomic_ReadWritePtr(&entry->clientData, clientData); + ht->freeEntryFn(old); + } else +#endif + { + if (ht->freeEntryFn) { + ht->freeEntryFn(Atomic_ReadPtr(&entry->clientData)); + } + Atomic_WritePtr(&entry->clientData, clientData); + } + return TRUE; +} + + +/* + *---------------------------------------------------------------------- + * + * HashTable_ReplaceIfEqual -- + * + * Look up an a key. If found, replace the existing clientData + * if it is the same as oldClientData and return TRUE. + * Return FALSE otherwise. + * + * Results: + * TRUE if replaced, FALSE otherwise. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +Bool +HashTable_ReplaceIfEqual(HashTable *ht, // IN/OUT + const char *keyStr, // IN + void *oldClientData, // IN + void *newClientData) // IN +{ + uint32 hash = HashTableComputeHash(ht, keyStr); + HashTableEntry *entry = HashTableLookup(ht, keyStr, hash); + Bool retval = FALSE; + + if (entry == NULL) { + return FALSE; + } + +#ifndef NO_ATOMIC_HASHTABLE + if (ht->atomic) { + void *data = Atomic_ReadIfEqualWritePtr(&entry->clientData, + oldClientData, newClientData); + if (data == oldClientData) { + retval = TRUE; + if (ht->freeEntryFn != NULL) { + ht->freeEntryFn(data); + } + } + } else +#endif + if (Atomic_ReadPtr(&entry->clientData) == oldClientData) { + retval = TRUE; + if (ht->freeEntryFn) { + ht->freeEntryFn(Atomic_ReadPtr(&entry->clientData)); + } + Atomic_WritePtr(&entry->clientData, newClientData); + } + + return retval; +} + + +/* + *---------------------------------------------------------------------- + * + * HashTableLookupOrInsert -- + * + * Look up an a key, return the entry if found. + * Otherwise, insert it into the hashtable and return NULL. + * + * Results: + * Old HashTableEntry or NULL. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +HashTableEntry * +HashTableLookupOrInsert(HashTable *ht, // IN/OUT + const char *keyStr, // IN + void *clientData) // IN +{ + uint32 hash = HashTableComputeHash(ht, keyStr); + HashTableEntry *entry = NULL; + HashTableEntry *oldEntry = NULL; + HashTableEntry *head; + +again: + head = ENTRY(ht->buckets[hash]); + + oldEntry = HashTableLookup(ht, keyStr, hash); + if (oldEntry != NULL) { + if(entry != NULL) { + if (ht->copyKey) { + free((char *) entry->keyStr); + } + free(entry); + } + return oldEntry; + } + + if (entry == NULL) { + entry = Util_SafeMalloc(sizeof *entry); + if (ht->copyKey) { + entry->keyStr = Util_SafeStrdup(keyStr); + } else { + entry->keyStr = keyStr; + } + Atomic_WritePtr(&entry->clientData, clientData); + } + SETENTRY(entry->next, head); + if (ht->atomic) { + if (!SETENTRYATOMIC(ht->buckets[hash], head, entry)) { + goto again; + } + } else { + SETENTRY(ht->buckets[hash], entry); + } + + ht->numElements++; + return NULL; +} + + +/* + *---------------------------------------------------------------------- + * + * HashTable_GetNumElements -- + * + * Get the number of elements in the hash table. + * + * Atomic hash tables do not support this function because + * the numElements field is not modified atomically so may be + * incorrect. + * + * Results: + * The number of elements. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +size_t +HashTable_GetNumElements(const HashTable *ht) // IN: +{ + ASSERT(ht); + ASSERT(!ht->atomic); + + return ht->numElements; +} + + +/* + *---------------------------------------------------------------------- + * + * HashTable_ToArray -- + * + * Returns an array of pointers to each clientData structure in the + * hash table. + * + * Results: + * The clientData array plus its size. If the hash table is empty + * 'size' is 0 and 'clientDatas' is NULL. Free with free(). + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +void +HashTable_ToArray(const HashTable *ht, // IN + void ***clientDatas, // OUT + size_t *size) // OUT +{ + uint32 i; + size_t j; + + ASSERT(ht); + ASSERT(clientDatas); + ASSERT(size); + + ASSERT(!ht->atomic); + + *clientDatas = NULL; + *size = HashTable_GetNumElements(ht); + + if (0 == *size) { + return; + } + + /* alloc array */ + *clientDatas = Util_SafeMalloc(*size * sizeof **clientDatas); + + /* fill array */ + for (i = 0, j = 0; i < ht->numEntries; i++) { + HashTableEntry *entry; + for (entry = ENTRY(ht->buckets[i]); + entry != NULL; + entry = ENTRY(entry->next)) { + (*clientDatas)[j++] = Atomic_ReadPtr(&entry->clientData); + } + } +} + + +/* + *---------------------------------------------------------------------- + * + * HashTable_ForEach -- + * + * Walks the hashtable in an undetermined order, calling the + * callback function for each value until either the callback + * returns a non-zero value or all values have been walked + * + * Results: + * 0 if all callback functions returned 0, otherwise the return + * value of the first non-zero callback. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +int +HashTable_ForEach(const HashTable *ht, // IN + HashTableForEachCallback cb, // IN + void *clientData) // IN +{ + int i; + + ASSERT(ht); + ASSERT(cb); + + for (i = 0; i < ht->numEntries; i++) { + HashTableEntry *entry; + for (entry = ENTRY(ht->buckets[i]); + entry != NULL; + entry = ENTRY(entry->next)) { + int result = (*cb)(entry->keyStr, Atomic_ReadPtr(&entry->clientData), + clientData); + if (result) { + return result; + } + } + } + return 0; +} + +#if 0 +/* + *---------------------------------------------------------------------- + * + * HashPrint -- + * + * Print out the contents of a hashtable. Useful for + * debugging the data structure & the hashing algorithm. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +void +HashPrint(HashTable *ht) // IN +{ + int i; + + for (i = 0; i < ht->numEntries; i++) { + HashTableEntry *entry; + + if (ht->buckets[i] == NULL) { + continue; + } + + printf("%4d: \n", i); + + for (entry = ENTRY(ht->buckets[i]); + entry != NULL; + entry = ENTRY(entry->next)) { + if (ht->keyType == HASH_INT_KEY) { + printf("\t%p\n", entry->keyStr); + } else { + printf("\t%s\n", entry->keyStr); + } + } + } +} +#endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/misc/hostinfo_misc.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/misc/hostinfo_misc.c --- open-vm-tools-2008.01.23-74039/lib/misc/hostinfo_misc.c 2008-01-28 08:02:51.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/misc/hostinfo_misc.c 2008-10-13 08:01:52.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/misc/hostname.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/misc/hostname.c --- open-vm-tools-2008.01.23-74039/lib/misc/hostname.c 2008-01-28 08:02:51.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/misc/hostname.c 2008-10-13 08:01:52.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -23,8 +23,6 @@ */ #if defined(_WIN32) -#undef _WIN32_WINNT -#define _WIN32_WINNT 0x0500 #include #include @@ -39,6 +37,10 @@ #include "str.h" #include "log.h" #include "hostinfo.h" +#if defined(_WIN32) // Windows +#include "win32u.h" +#endif +#include "unicode.h" #if defined(_WIN32) // Windows /* @@ -48,15 +50,6 @@ * * Return the fully qualified host name of the host. * - * Note: GetComputerNameExA is broken on multibyte encodings that - * use more than one byte per characters. The function calls - * GetComputerNameExW, then calls WideCharToMultiByte assuming, it - * seems, that the number of characters returned from - * GetComputerNameW is the required buffer size for the multibyte - * conversion. So instead of calling GetComputerNameExA we will call - * the wide version and do the conversion ourselves. - * - * * Results: * The host name on success; must be freed * NULL if unable to determine the name @@ -67,59 +60,24 @@ *---------------------------------------------------------------------- */ -const char * +Unicode Hostinfo_HostName(void) { - HMODULE dllHandle; + Unicode result; + HMODULE dllHandle; struct hostent *myHostEnt; struct hostent *(WINAPI *GetHostByNameFn)(char *hostName); int (WINAPI *GetHostNameFn)(char *hostName, int size); - BOOL (WINAPI *GetComputerNameExWFn)(COMPUTER_NAME_FORMAT nameType, - LPWSTR lpBuffer, - LPDWORD lpnSize); - char hostName[1024] = { '\0' }; - wchar_t wHostName[1024] = { L'\0' }; - DWORD size = sizeof wHostName; - dllHandle = GetModuleHandleA("kernel32"); + char hostName[1024] = { '\0' }; - if (!dllHandle) { - Warning("%s GetModuleHandle on kernel32 failed\n", __FUNCTION__); + result = Win32U_GetComputerNameEx(ComputerNamePhysicalDnsFullyQualified); - return NULL; + if (result != NULL) { + return result; } - GetComputerNameExWFn = (void *) GetProcAddress(dllHandle, - "GetComputerNameExW"); - - if ((NULL != GetComputerNameExWFn) && - ((*GetComputerNameExWFn)(ComputerNamePhysicalDnsFullyQualified, - wHostName, &size) != 0)) { - int bytesConverted; - /* - * The call to WideCharToMultiByte with the following parameters - * might cause the system to drop/change some of the wide chars - * in wHostName if an equivalent cannot be found in the locale. - * However, this is the way GetComputerNameExA calls this - * function, and we are trying to mimic it. - */ - bytesConverted = WideCharToMultiByte(CP_ACP, 0, wHostName, size + 1, - hostName, sizeof hostName, - NULL, NULL); - if (bytesConverted > 0) { - char *dupStr = NULL; - dupStr = strdup(hostName); - ASSERT_MEM_ALLOC(dupStr); - return dupStr; - } else { - DWORD err = GetLastError(); - Warning("%s %s failed: %d\n", __FUNCTION__, "WideCharToMultiByte", - err); - } - } else if (NULL != GetComputerNameExWFn) { - DWORD err = GetLastError(); - Warning("%s %s failed: %d\n", __FUNCTION__, "GetComputerNameExW", err); - } + Warning("%s GetComputerNameEx failed: %d\n", __FUNCTION__, GetLastError()); dllHandle = LoadLibraryA("ws2_32"); @@ -153,7 +111,7 @@ if (!GetHostByNameFn) { Warning("%s Failed to find gethostbyname.\n", __FUNCTION__); FreeLibrary(dllHandle); - return strdup(hostName); + return Unicode_Alloc(hostName, STRING_ENCODING_DEFAULT); } myHostEnt = (*GetHostByNameFn)(hostName); @@ -166,7 +124,7 @@ Str_Strcpy(hostName, myHostEnt->h_name, sizeof hostName); } - return strdup(hostName); + return Unicode_Alloc(hostName, STRING_ENCODING_DEFAULT); } #elif defined(__APPLE__) // MacOS X #define SYS_NMLN _SYS_NAMELEN @@ -194,21 +152,21 @@ *----------------------------------------------------------------------------- */ -const char * +Unicode Hostinfo_HostName(void) { struct utsname un; - char *result = (char *) NULL; + Unicode result = NULL; if ((uname(&un) == 0) && (*un.nodename != '\0')) { /* 'un.nodename' is already fully qualified. */ - result = strdup(un.nodename); + result = Unicode_Alloc(un.nodename, STRING_ENCODING_US_ASCII); } return result; } -#elif defined(linux) // Linux +#elif defined(linux) #include #include #include @@ -230,17 +188,18 @@ *----------------------------------------------------------------------------- */ -const char * +Unicode Hostinfo_HostName(void) { struct utsname un; - char *result = (char *) NULL; + Unicode result = NULL; if ((uname(&un) == 0) && (*un.nodename != '\0')) { + char *p; + int error; struct hostent he; - int error; - char buffer[1024]; + char buffer[1024]; struct hostent *phe = &he; @@ -250,14 +209,14 @@ * 139607 will occur. */ - result = un.nodename; + p = un.nodename; - if ((gethostbyname_r(result, &he, buffer, sizeof buffer, + if ((gethostbyname_r(p, &he, buffer, sizeof buffer, &phe, &error) == 0) && phe) { - result = phe->h_name; + p = phe->h_name; } - result = strdup(result); + result = Unicode_Alloc(p, STRING_ENCODING_US_ASCII); } return result; @@ -283,14 +242,10 @@ *----------------------------------------------------------------------------- */ -const char * +Unicode Hostinfo_HostName(void) { - char string[128]; - - Str_Sprintf(string, sizeof string, "%s unimplemented for OS", - __FUNCTION__); - - return strdup(string); + return Unicode_Alloc("Hostinfo_HostName: unimplemented for OS", + STRING_ENCODING_US_ASCII); } #endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/misc/idLinux.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/misc/idLinux.c --- open-vm-tools-2008.01.23-74039/lib/misc/idLinux.c 2008-01-28 08:02:51.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/misc/idLinux.c 2008-10-13 08:01:52.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -99,7 +99,7 @@ #endif -#if !defined(__APPLE__) && !defined(sun) && !defined(__FreeBSD__) +#if !defined(__APPLE__) /* *---------------------------------------------------------------------------- * @@ -121,6 +121,9 @@ int Id_SetUid(uid_t euid) // IN: new euid { +#if defined(__FreeBSD__) || defined(sun) + return setuid(euid); +#elif defined(linux) if (uid32) { int r = syscall(SYS_setuid32, euid); if (r != -1 || errno != ENOSYS) { @@ -129,6 +132,9 @@ uid32 = 0; } return syscall(SYS_setuid, euid); +#else +# error "Id_SetUid is not implemented for this platform" +#endif } #endif @@ -157,12 +163,8 @@ #if defined(__APPLE__) Warning("XXXMACOS: implement %s\n", __func__); return -1; -#elif defined(sun) - Warning("XXXSolaris: implement %s\n", __FUNCTION__); - return -1; -#elif defined(__FreeBSD__) - Warning("XXXFreeBSD: implement %s\n", __FUNCTION__); - return -1; +#elif defined(sun) || defined(__FreeBSD__) + return setgid(egid); #else if (uid32) { int r = syscall(SYS_setgid32, egid); @@ -198,16 +200,9 @@ uid_t euid, // IN: new effective uid uid_t suid) // IN: new saved uid { -#if defined(__APPLE__) - Warning("XXXMACOS: implement %s\n", __func__); - return -1; -#elif defined(sun) - Warning("XXXSolaris: implement %s\n", __FUNCTION__); - return -1; -#elif defined(__FreeBSD__) - Warning("XXXFreeBSD: implement %s\n", __FUNCTION__); - return -1; -#else +#if (defined(__FreeBSD__) && __FreeBSD_version >= 500043) + return setresuid(uid, euid, suid); +#elif defined(linux) if (uid32) { int r = syscall(SYS_setresuid32, uid, euid, suid); if (r != -1 || errno != ENOSYS) { @@ -216,6 +211,9 @@ uid32 = 0; } return syscall(SYS_setresuid, uid, euid, suid); +#else + Warning("XXX: implement %s\n", __func__); + return -1; #endif } @@ -243,13 +241,9 @@ gid_t egid, // IN: new effective gid gid_t sgid) // IN: new saved gid { -#ifdef sun - Warning("XXXSolaris: implement %s\n", __FUNCTION__); - return -1; -#elif defined(__FreeBSD__) - Warning("XXXFreeBSD: implement %s\n", __FUNCTION__); - return -1; -#else +#if (defined(__FreeBSD__) && __FreeBSD_version >= 500043) + return setresgid(gid, egid, sgid); +#elif defined(linux) if (uid32) { int r = syscall(SYS_setresgid32, gid, egid, sgid); if (r != -1 || errno != ENOSYS) { @@ -258,6 +252,9 @@ uid32 = 0; } return syscall(SYS_setresgid, gid, egid, sgid); +#else + Warning("XXX: implement %s\n", __func__); + return -1; #endif } #endif @@ -289,12 +286,8 @@ #if defined(__APPLE__) Warning("XXXMACOS: implement %s\n", __func__); return -1; -#elif defined(sun) - Warning("XXXSolaris: implement %s\n", __FUNCTION__); - return -1; -#elif defined(__FreeBSD__) - Warning("XXXFreeBSD: implement %s\n", __FUNCTION__); - return -1; +#elif defined(sun) || defined(__FreeBSD__) + return setreuid(uid, euid); #else if (uid32) { int r = syscall(SYS_setreuid32, uid, euid); @@ -308,7 +301,7 @@ } -#if !defined(__APPLE__) && !defined(sun) && !defined(__FreeBSD__) +#if !defined(__APPLE__) /* *---------------------------------------------------------------------------- * @@ -332,6 +325,9 @@ Id_SetREGid(gid_t gid, // IN: new gid gid_t egid) // IN: new effective gid { +#if defined(sun) || defined(__FreeBSD__) + return setregid(gid, egid); +#else if (uid32) { int r = syscall(SYS_setregid32, gid, egid); if (r != -1 || errno != ENOSYS) { @@ -340,6 +336,7 @@ uid32 = 0; } return syscall(SYS_setregid, gid, egid); +#endif } #endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/misc/iovector.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/misc/iovector.c --- open-vm-tools-2008.01.23-74039/lib/misc/iovector.c 2008-01-28 08:02:51.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/misc/iovector.c 2008-10-13 08:01:52.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/misc/machineID.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/misc/machineID.c --- open-vm-tools-2008.01.23-74039/lib/misc/machineID.c 2008-01-28 08:02:51.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/misc/machineID.c 2008-10-13 08:01:52.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/misc/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/misc/Makefile.am --- open-vm-tools-2008.01.23-74039/lib/misc/Makefile.am 2008-01-28 08:02:49.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/misc/Makefile.am 2008-10-13 08:01:48.000000000 +0100 @@ -18,26 +18,33 @@ noinst_LIBRARIES = libMisc.a libMisc_a_SOURCES = +libMisc_a_SOURCES += atomic.c libMisc_a_SOURCES += base64.c -libMisc_a_SOURCES += codeset.c +libMisc_a_SOURCES += codesetOld.c libMisc_a_SOURCES += dbllnklst.c +libMisc_a_SOURCES += dynarray.c libMisc_a_SOURCES += dynbuf.c libMisc_a_SOURCES += escape.c -libMisc_a_SOURCES += hash.c +libMisc_a_SOURCES += hashTable.c libMisc_a_SOURCES += hostinfo_misc.c libMisc_a_SOURCES += hostname.c libMisc_a_SOURCES += idLinux.c libMisc_a_SOURCES += iovector.c libMisc_a_SOURCES += machineID.c libMisc_a_SOURCES += miscSolaris.c +libMisc_a_SOURCES += posixDlopen.c +libMisc_a_SOURCES += posixPosix.c libMisc_a_SOURCES += random.c libMisc_a_SOURCES += timeutil.c libMisc_a_SOURCES += util_misc.c libMisc_a_SOURCES += vmstdio.c +libMisc_a_SOURCES += strutil.c + +if HAVE_ICU +libMisc_a_SOURCES += codeset.c +endif -AM_CFLAGS = -AM_CFLAGS += @COMMON_CFLAGS@ -AM_CFLAGS += @LIB_MISC_CFLAGS@ +AM_CFLAGS = @LIB_MISC_CPPFLAGS@ SUBDIRS = SUBDIRS += shared diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/misc/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/misc/Makefile.in --- open-vm-tools-2008.01.23-74039/lib/misc/Makefile.in 2008-01-28 08:03:04.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/misc/Makefile.in 2008-10-13 08:02:14.000000000 +0100 @@ -49,10 +49,14 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ +@HAVE_ICU_TRUE@am__append_1 = codeset.c subdir = lib/misc DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +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)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -61,15 +65,23 @@ ARFLAGS = cru libMisc_a_AR = $(AR) $(ARFLAGS) libMisc_a_LIBADD = -am_libMisc_a_OBJECTS = base64.$(OBJEXT) codeset.$(OBJEXT) \ - dbllnklst.$(OBJEXT) dynbuf.$(OBJEXT) escape.$(OBJEXT) \ - hash.$(OBJEXT) hostinfo_misc.$(OBJEXT) hostname.$(OBJEXT) \ - idLinux.$(OBJEXT) iovector.$(OBJEXT) machineID.$(OBJEXT) \ - miscSolaris.$(OBJEXT) random.$(OBJEXT) timeutil.$(OBJEXT) \ - util_misc.$(OBJEXT) vmstdio.$(OBJEXT) +am__libMisc_a_SOURCES_DIST = atomic.c base64.c codesetOld.c \ + dbllnklst.c dynarray.c dynbuf.c escape.c hashTable.c \ + hostinfo_misc.c hostname.c idLinux.c iovector.c machineID.c \ + miscSolaris.c posixDlopen.c posixPosix.c random.c timeutil.c \ + util_misc.c vmstdio.c strutil.c codeset.c +@HAVE_ICU_TRUE@am__objects_1 = codeset.$(OBJEXT) +am_libMisc_a_OBJECTS = atomic.$(OBJEXT) base64.$(OBJEXT) \ + codesetOld.$(OBJEXT) dbllnklst.$(OBJEXT) dynarray.$(OBJEXT) \ + dynbuf.$(OBJEXT) escape.$(OBJEXT) hashTable.$(OBJEXT) \ + hostinfo_misc.$(OBJEXT) hostname.$(OBJEXT) idLinux.$(OBJEXT) \ + iovector.$(OBJEXT) machineID.$(OBJEXT) miscSolaris.$(OBJEXT) \ + posixDlopen.$(OBJEXT) posixPosix.$(OBJEXT) random.$(OBJEXT) \ + timeutil.$(OBJEXT) util_misc.$(OBJEXT) vmstdio.$(OBJEXT) \ + strutil.$(OBJEXT) $(am__objects_1) libMisc_a_OBJECTS = $(am_libMisc_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp +depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -81,7 +93,7 @@ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libMisc_a_SOURCES) -DIST_SOURCES = $(libMisc_a_SOURCES) +DIST_SOURCES = $(am__libMisc_a_SOURCES_DIST) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ @@ -105,8 +117,6 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -COMMON_CFLAGS = @COMMON_CFLAGS@ -COMMON_PROG_CFLAGS = @COMMON_PROG_CFLAGS@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -117,45 +127,57 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ -ECHO = @ECHO@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GREP = @GREP@ -GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_AUTH_CFLAGS = @LIB_AUTH_CFLAGS@ -LIB_FILE_CFLAGS = @LIB_FILE_CFLAGS@ -LIB_HGFS_SERVER_CFLAGS = @LIB_HGFS_SERVER_CFLAGS@ -LIB_IMPERSONATE_CFLAGS = @LIB_IMPERSONATE_CFLAGS@ -LIB_MISC_CFLAGS = @LIB_MISC_CFLAGS@ -LIB_PROC_MGR_CFLAGS = @LIB_PROC_MGR_CFLAGS@ -LIB_STRING_CFLAGS = @LIB_STRING_CFLAGS@ -LIB_USER_CFLAGS = @LIB_USER_CFLAGS@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -163,27 +185,35 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ VERSION = @VERSION@ -VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -214,6 +244,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -229,11 +260,12 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LIBRARIES = libMisc.a -libMisc_a_SOURCES = base64.c codeset.c dbllnklst.c dynbuf.c escape.c \ - hash.c hostinfo_misc.c hostname.c idLinux.c iovector.c \ - machineID.c miscSolaris.c random.c timeutil.c util_misc.c \ - vmstdio.c -AM_CFLAGS = @COMMON_CFLAGS@ @LIB_MISC_CFLAGS@ +libMisc_a_SOURCES = atomic.c base64.c codesetOld.c dbllnklst.c \ + dynarray.c dynbuf.c escape.c hashTable.c hostinfo_misc.c \ + hostname.c idLinux.c iovector.c machineID.c miscSolaris.c \ + posixDlopen.c posixPosix.c random.c timeutil.c util_misc.c \ + vmstdio.c strutil.c $(am__append_1) +AM_CFLAGS = @LIB_MISC_CPPFLAGS@ SUBDIRS = shared all: all-recursive @@ -282,19 +314,25 @@ distclean-compile: -rm -f *.tab.c +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atomic.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base64.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/codeset.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/codesetOld.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbllnklst.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dynarray.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dynbuf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/escape.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hash.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hashTable.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hostinfo_misc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hostname.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/idLinux.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iovector.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/machineID.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/miscSolaris.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/posixDlopen.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/posixPosix.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/random.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strutil.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timeutil.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util_misc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vmstdio.Po@am__quote@ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/misc/miscSolaris.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/misc/miscSolaris.c --- open-vm-tools-2008.01.23-74039/lib/misc/miscSolaris.c 2008-01-28 08:02:51.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/misc/miscSolaris.c 2008-10-13 08:01:52.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/misc/posixDlopen.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/misc/posixDlopen.c --- open-vm-tools-2008.01.23-74039/lib/misc/posixDlopen.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/misc/posixDlopen.c 2008-10-13 08:01:52.000000000 +0100 @@ -0,0 +1,66 @@ +/********************************************************* + * Copyright (C) 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. + * + *********************************************************/ + +#define UNICODE_BUILDING_POSIX_WRAPPERS +#include +#include +#include + +#if defined(__APPLE__) || defined(linux) +#include +#endif + +#include "vmware.h" +#include "posixInt.h" + + +#if defined(__APPLE__) || defined(linux) +/* + *---------------------------------------------------------------------- + * + * FileIO_Dlopen -- + * + * POSIX dlopen() + * + * Results: + * NULL Error + * !NULL Success + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +void * +Posix_Dlopen(ConstUnicode pathName, // IN: + int flag) // IN: +{ + char *path; + void *ret; + + if (!PosixConvertToCurrent(pathName, &path)) { + return NULL; + } + + ret = dlopen(path, flag); + + free(path); + return ret; +} +#endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/misc/posixInt.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/misc/posixInt.h --- open-vm-tools-2008.01.23-74039/lib/misc/posixInt.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/misc/posixInt.h 2008-10-13 08:01:52.000000000 +0100 @@ -0,0 +1,245 @@ +/********************************************************* + * Copyright (C) 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. + * + *********************************************************/ + +/* + * posixInt.h -- + * + * Internal definitions for the Posix wrapper module. + */ + +#ifndef _POSIXINT_H_ +#define _POSIXINT_H_ + +#define INCLUDE_ALLOW_USERLEVEL +#include "includeCheck.h" + +#include "posix.h" +#include "unicode.h" +#ifndef N_PLAT_NLM +#include "hashTable.h" +#include "vm_atomic.h" +#include "util.h" +#include "str.h" +#endif + + +#ifndef _WIN32 // { + +/* + *---------------------------------------------------------------------- + * + * PosixConvertToCurrent -- + * + * Utility function to convert a Unicode string + * to the current encoding. + * + * Results: + * TRUE on success. + * Conversion result in *out or NULL on failure. + * errno is untouched on success, set to UNICODE_CONVERSION_ERRNO + * on failure. + * + * Side effects: + * As described. + * + *---------------------------------------------------------------------- + */ + +static INLINE Bool +PosixConvertToCurrent(ConstUnicode in, // IN: string to convert + char **out) // OUT: conversion result +{ + int e = errno; + char *p = Unicode_GetAllocBytes(in, STRING_ENCODING_DEFAULT); + Bool success = p != NULL || in == NULL; + + if (!success) { + e = UNICODE_CONVERSION_ERRNO; + } + *out = p; + errno = e; + return success; +} + + +/* + *---------------------------------------------------------------------- + * + * PosixConvertToCurrentList -- + * + * Utility function to convert a list of Unicode strings + * to the current encoding. + * Return NULL if list is NULL. + * + * Results: + * TRUE on success. + * Conversion result in *out or NULL on failure. + * errno is untouched on success, set to UNICODE_CONVERSION_ERRNO + * on failure. + * + * Side effects: + * As described. + * + *---------------------------------------------------------------------- + */ + +static INLINE Bool +PosixConvertToCurrentList(Unicode const *in, // IN: list to convert + char ***out) // OUT: conversion result +{ + int e = errno; + char **p; + Bool success; + + if (in == NULL) { + p = NULL; + success = TRUE; + } else { + p = Unicode_GetAllocList(in, -1, STRING_ENCODING_DEFAULT); + success = p != NULL; + } + + if (!success) { + e = UNICODE_CONVERSION_ERRNO; + } + *out = p; + errno = e; + return success; +} + +#endif // } + + +#ifndef N_PLAT_NLM // { + +/* + * Hash table for Posix_Getenv + */ + +typedef struct PosixEnvEntry { + Atomic_Ptr value; + Atomic_Ptr lastValue; +} PosixEnvEntry; + +static INLINE void +PosixEnvFree(void *v) +{ + // never called + NOT_REACHED(); +} + + +/* + *----------------------------------------------------------------------------- + * + * PosixGetenvHash -- + * + * Save away Unicode result for Posix_Getenv() to make + * it persistent. + * + * Results: + * The value. + * + * Side effects: + * The passed-in value string may be saved in a hash table, + * or it may be freed. + * + *----------------------------------------------------------------------------- + */ + +static INLINE_SINGLE_CALLER Unicode +PosixGetenvHash(ConstUnicode name, // IN + Unicode value) // IN/OUT: may be freed +{ + static Atomic_Ptr htPtr; + HashTable *ht; + Unicode oldValue; + PosixEnvEntry *e; + + /* + * Don't need to save NULL. + */ + + if (value == NULL) { + return value; + } + + ht = HashTable_AllocOnce(&htPtr, 128, + HASH_FLAG_ATOMIC | HASH_FLAG_COPYKEY | + HASH_STRING_KEY, + PosixEnvFree); + + /* + * We have to allow any number of concurrent getenv()'s. + * So if the saved value is the same, don't change it, + * and if it must change, all the threads together must + * establish a single new value. + * + * On the other hand, we don't have to support concurrent + * getenv() and setenv(). + */ + + for (;;) { + /* + * If not in hash table, then insert and return. + */ + + if (!HashTable_Lookup(ht, name, (void **) &e)) { + e = Util_SafeMalloc(sizeof *e); + Atomic_WritePtr(&e->value, value); + Atomic_WritePtr(&e->lastValue, NULL); + if (!HashTable_Insert(ht, name, e)) { + free(e); + continue; + } + break; + } + + /* + * If old value is the same, then use it. + */ + + oldValue = Atomic_ReadPtr(&e->value); + if (Str_Strcmp(oldValue, value) == 0) { + Unicode_Free(value); + value = oldValue; + break; + } + + /* + * If value has changed, use new value, but don't free old + * value yet because somebody else may be going through this + * same code and still using it. Because we don't need + * to care about concurrent setenv(), a single lastValue + * slot is sufficient. + */ + + if (Atomic_ReadIfEqualWritePtr(&e->value, oldValue, value) == oldValue) { + oldValue = Atomic_ReadWritePtr(&e->lastValue, oldValue); + Unicode_Free(oldValue); + break; + } + } + + return value; +} + +#endif // } + + +#endif // ifndef _POSIXINT_H_ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/misc/posixPosix.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/misc/posixPosix.c --- open-vm-tools-2008.01.23-74039/lib/misc/posixPosix.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/misc/posixPosix.c 2008-10-13 08:01:52.000000000 +0100 @@ -0,0 +1,3084 @@ +/********************************************************* + * Copyright (C) 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. + * + *********************************************************/ + +#if !defined(_POSIX_PTHREAD_SEMANTICS) && defined(sun) +#define _POSIX_PTHREAD_SEMANTICS 1 // Needed to get POSIX-correct getpw*_r() on Solaris +#endif + +#define UNICODE_BUILDING_POSIX_WRAPPERS +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "su.h" +#include +#include +#include +#if !defined(N_PLAT_NLM) +#include +#include +#endif + +#if defined(__APPLE__) +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#elif defined(__FreeBSD__) +#include +#include +#elif !defined(N_PLAT_NLM) +#include +#include +#if !defined(sun) +#include +#else +#include +#include +#endif +#endif + +#if !defined(__FreeBSD__) || __FreeBSD_release >= 503001 +#define VM_SYSTEM_HAS_GETPWNAM_R 1 +#define VM_SYSTEM_HAS_GETPWUID_R 1 +#define VM_SYSTEM_HAS_GETGRNAM_R 1 +#endif + +# if defined(__FreeBSD__) && __FreeBSD_version >= 503000 +# include // PATH_MAX +# else +# include // PATH_MAX +# endif + +#include "vmware.h" +#include "posixInt.h" +#if defined(sun) +#include "hashTable.h" // For setenv emulation +#endif + +#if !defined(N_PLAT_NLM) +static struct passwd *GetpwInternal(struct passwd *pw); +static int GetpwInternal_r(struct passwd *pw, char *buf, size_t size, + struct passwd **ppw); +#endif + + +/* + *---------------------------------------------------------------------- + * + * Posix_Open -- + * + * Open a file using POSIX open. + * + * Results: + * -1 error + * >= 0 success (file descriptor) + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +int +Posix_Open(ConstUnicode pathName, // IN: + int flags, // IN: + ...) // IN: +{ + char *path; + mode_t mode = 0; + int fd; + + if (!PosixConvertToCurrent(pathName, &path)) { + return -1; + } + + if ((flags & O_CREAT) != 0) { + va_list a; + + /* + * The FreeBSD tools compiler + * (toolchain/lin32/gcc-4.1.2-5/bin/i686-freebsd5.0-gcc) + * wants us to use va_arg(a, int) instead of va_arg(a, mode_t), + * so oblige. -- edward + */ + + va_start(a, flags); + ASSERT_ON_COMPILE(sizeof (int) >= sizeof(mode_t)); + mode = va_arg(a, int); + va_end(a); + } + + fd = open(path, flags, mode); + + free(path); + return fd; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Creat -- + * + * Create a file via POSIX creat() + * + * Results: + * -1 Error + * >= 0 File descriptor (success) + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +int +Posix_Creat(ConstUnicode pathName, // IN: + mode_t mode) // IN: +{ + return Posix_Open(pathName, O_CREAT | O_WRONLY | O_TRUNC, mode); +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Fopen -- + * + * Open a file via POSIX fopen() + * + * Results: + * A file pointer, or NULL on error. + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +FILE * +Posix_Fopen(ConstUnicode pathName, // IN: + const char *mode) // IN: +{ + char *path; + FILE *stream; + + ASSERT(mode); + + if (!PosixConvertToCurrent(pathName, &path)) { + return NULL; + } + + stream = fopen(path, mode); + + free(path); + return stream; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Stat -- + * + * POSIX stat() + * + * Results: + * -1 Error + * 0 Success + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +int +Posix_Stat(ConstUnicode pathName, // IN: + struct stat *statbuf) // IN: +{ + char *path; + int ret; + + if (!PosixConvertToCurrent(pathName, &path)) { + return -1; + } + + ret = stat(path, statbuf); + + free(path); + return ret; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Chmod -- + * + * POSIX chmod() + * + * Results: + * -1 Error + * 0 Success + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +int +Posix_Chmod(ConstUnicode pathName, // IN: + mode_t mode) // IN: +{ + char *path; + int ret; + + if (!PosixConvertToCurrent(pathName, &path)) { + return -1; + } + + ret = chmod(path, mode); + + free(path); + return ret; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Rename -- + * + * POSIX rename(). + * + * Results: + * -1 Error + * 0 Success + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +int +Posix_Rename(ConstUnicode fromPathName, // IN: + ConstUnicode toPathName) // IN: +{ + char *toPath; + char *fromPath; + int result; + + if (!PosixConvertToCurrent(fromPathName, &fromPath)) { + return -1; + } + if (!PosixConvertToCurrent(toPathName, &toPath)) { + free(fromPath); + return -1; + } + + result = rename(fromPath, toPath); + + free(toPath); + free(fromPath); + return result; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Unlink -- + * + * POSIX unlink(). + * + * Results: + * -1 Error + * 0 Success + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +int +Posix_Unlink(ConstUnicode pathName) // IN: +{ + char *path; + int ret; + + if (!PosixConvertToCurrent(pathName, &path)) { + return -1; + } + + ret = unlink(path); + + free(path); + return ret; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Rmdir -- + * + * POSIX rmdir(). + * + * Results: + * -1 Error + * 0 Success + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +int +Posix_Rmdir(ConstUnicode pathName) // IN: +{ + char *path; + int ret; + + if (!PosixConvertToCurrent(pathName, &path)) { + return -1; + } + + ret = rmdir(path); + + free(path); + return ret; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Freopen -- + * + * Open a file via POSIX freopen() + * + * Results: + * -1 Error + * >= 0 File descriptor (success) + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +FILE * +Posix_Freopen(ConstUnicode pathName, // IN: + const char *mode, // IN: + FILE *input_stream) // IN: +{ + char *path; + FILE *stream; + + ASSERT(mode); + + if (!PosixConvertToCurrent(pathName, &path)) { + return NULL; + } + + stream = freopen(path, mode, input_stream); + + free(path); + return stream; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Access -- + * + * POSIX access(). + * + * Results: + * -1 Error + * 0 Success + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +int +Posix_Access(ConstUnicode pathName, // IN: + int mode) // IN: +{ + char *path; + int ret; + + if (!PosixConvertToCurrent(pathName, &path)) { + return -1; + } + + ret = access(path, mode); + + free(path); + return ret; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Utime -- + * + * POSIX utime(). + * + * Results: + * -1 Error + * 0 Success + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +int +Posix_Utime(ConstUnicode pathName, // IN: + const struct utimbuf *times) // IN: +{ + char *path; + int ret; + + if (!PosixConvertToCurrent(pathName, &path)) { + return -1; + } + + ret = utime(path, times); + + free(path); + return ret; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Perror -- + * + * POSIX perror() + * + * Results: + * Appends error message corresponding to errno to the passed in string, + * and puts the result on stderr. + * + * Side effects: + * Message printed to stderr. + * + *---------------------------------------------------------------------- + */ + +void +Posix_Perror(ConstUnicode str) // IN: +{ + char *tmpstr = Unicode_GetAllocBytes(str, STRING_ENCODING_DEFAULT); + + // ignore conversion error silently + perror(tmpstr); + + free(tmpstr); +} + + +#if !defined(N_PLAT_NLM) // { +/* + *---------------------------------------------------------------------- + * + * Posix_Pathconf -- + * + * POSIX pathconf() + * + * Results: + * Returns the limit, -1 if limit doesn't exist or on error + * + * Side effects: + * errno is set on error. + * + *---------------------------------------------------------------------- + */ + +long +Posix_Pathconf(ConstUnicode pathName, // IN: + int name) // IN: +{ + char *path; + long ret; + + if (!PosixConvertToCurrent(pathName, &path)) { + return -1; + } + + ret = pathconf(path, name); + + free(path); + return ret; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Popen -- + * + * Open a file using POSIX popen(). + * + * Results: + * -1 error + * >= 0 success (file descriptor) + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +FILE * +Posix_Popen(ConstUnicode pathName, // IN: + const char *mode) // IN: +{ + char *path; + FILE *stream; + + ASSERT(mode); + + if (!PosixConvertToCurrent(pathName, &path)) { + return NULL; + } + + stream = popen(path, mode); + + free(path); + return stream; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Mknod -- + * + * POSIX mknod(). + * + * Results: + * -1 Error + * 0 Success + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +int +Posix_Mknod(ConstUnicode pathName, // IN: + mode_t mode, // IN: + dev_t dev) // IN: +{ + char *path; + int ret; + + if (!PosixConvertToCurrent(pathName, &path)) { + return -1; + } + + ret = mknod(path, mode, dev); + + free(path); + return ret; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Chown -- + * + * POSIX chown(). + * + * Results: + * -1 Error + * 0 Success + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +int +Posix_Chown(ConstUnicode pathName, // IN: + uid_t owner, // IN: + gid_t group) // IN: +{ + char *path; + int ret; + + if (!PosixConvertToCurrent(pathName, &path)) { + return -1; + } + + ret = chown(path, owner, group); + + free(path); + return ret; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Lchown -- + * + * POSIX lchown(). + * + * Results: + * -1 Error + * 0 Success + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +int +Posix_Lchown(ConstUnicode pathName, // IN: + uid_t owner, // IN: + gid_t group) // IN: +{ + char *path; + int ret; + + if (!PosixConvertToCurrent(pathName, &path)) { + return -1; + } + + ret = lchown(path, owner, group); + + free(path); + return ret; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Link -- + * + * POSIX link(). + * + * Results: + * -1 Error + * 0 Success + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +int +Posix_Link(ConstUnicode pathName1, // IN: + ConstUnicode pathName2) // IN: +{ + char *path1; + char *path2; + int ret; + + if (!PosixConvertToCurrent(pathName1, &path1)) { + return -1; + } + if (!PosixConvertToCurrent(pathName2, &path2)) { + free(path1); + return -1; + } + + ret = link(path1, path2); + + free(path1); + free(path2); + return ret; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Symlink -- + * + * POSIX symlink(). + * + * Results: + * -1 Error + * 0 Success + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +int +Posix_Symlink(ConstUnicode pathName1, // IN: + ConstUnicode pathName2) // IN: +{ + char *path1; + char *path2; + int ret; + + if (!PosixConvertToCurrent(pathName1, &path1)) { + return -1; + } + if (!PosixConvertToCurrent(pathName2, &path2)) { + free(path1); + return -1; + } + + ret = symlink(path1, path2); + + free(path1); + free(path2); + return ret; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Mkfifo -- + * + * POSIX mkfifo(). + * + * Results: + * -1 Error + * 0 Success + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +int +Posix_Mkfifo(ConstUnicode pathName, // IN: + mode_t mode) // IN: +{ + char *path; + int ret; + + if (!PosixConvertToCurrent(pathName, &path)) { + return -1; + } + + ret = mkfifo(path, mode); + + free(path); + return ret; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Truncate -- + * + * POSIX truncate(). + * + * Results: + * -1 Error + * 0 Success + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +int +Posix_Truncate(ConstUnicode pathName, // IN: + off_t length) // IN: +{ + char *path; + int ret; + + if (!PosixConvertToCurrent(pathName, &path)) { + return -1; + } + + ret = truncate(path, length); + + free(path); + return ret; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Utimes -- + * + * POSIX utimes(). + * + * Results: + * -1 Error + * 0 Success + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +int +Posix_Utimes(ConstUnicode pathName, // IN: + const struct timeval *times) // IN: +{ + char *path; + int ret; + + if (!PosixConvertToCurrent(pathName, &path)) { + return -1; + } + + ret = utimes(path, times); + + free(path); + return ret; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Execl -- + * + * POSIX execl(). + * + * Results: + * -1 Error + * 0 Success + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +int +Posix_Execl(ConstUnicode pathName, // IN: + ConstUnicode arg0, ...) // IN: +{ + int ret = -1; + char *path; + va_list vl; + char **argv = NULL; + int i, count = 0; + + if (!PosixConvertToCurrent(pathName, &path)) { + goto exit; + } + + if (arg0) { + count = 1; + va_start(vl, arg0); + while (va_arg(vl, char *)) { + count ++; + } + va_end(vl); + } + + argv = (char **) malloc(sizeof(char *) * (count + 1)); + if (argv == NULL) { + errno = ENOMEM; + goto exit; + } + if (argv) { + errno = 0; + if (count > 0) { + PosixConvertToCurrent(arg0, &argv[0]); + va_start(vl, arg0); + for (i = 1; i < count; i++) { + PosixConvertToCurrent(va_arg(vl, char *), &argv[i]); + } + va_end(vl); + } + argv[count] = NULL; + if (errno != 0) { + goto exit; + } + } + + ret = execv(path, argv); + +exit: + if (argv) { + Util_FreeStringList(argv, count + 1); + } + free(path); + return ret; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Execlp -- + * + * POSIX execlp(). + * + * Results: + * -1 Error + * 0 Success + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +int +Posix_Execlp(ConstUnicode fileName, // IN: + ConstUnicode arg0, ...) // IN: +{ + int ret = -1; + char *file; + va_list vl; + char **argv = NULL; + int i, count = 0; + + if (!PosixConvertToCurrent(fileName, &file)) { + goto exit; + } + + if (arg0) { + count = 1; + va_start(vl, arg0); + while (va_arg(vl, char *)) { + count ++; + } + va_end(vl); + } + + argv = (char **) malloc(sizeof(char *) * (count + 1)); + if (argv == NULL) { + errno = ENOMEM; + goto exit; + } + if (argv) { + errno = 0; + if (count > 0) { + PosixConvertToCurrent(arg0, &argv[0]); + va_start(vl, arg0); + for (i = 1; i < count; i++) { + PosixConvertToCurrent(va_arg(vl, char *), &argv[i]); + } + va_end(vl); + } + argv[count] = NULL; + if (errno != 0) { + goto exit; + } + } + + ret = execvp(file, argv); + +exit: + if (argv) { + Util_FreeStringList(argv, count + 1); + } + free(file); + return ret; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Execv -- + * + * POSIX execv(). + * + * Results: + * -1 Error + * 0 Success + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +int +Posix_Execv(ConstUnicode pathName, // IN: + Unicode const argVal[]) // IN: +{ + int ret = -1; + char *path; + char **argv = NULL; + + if (!PosixConvertToCurrent(pathName, &path)) { + goto exit; + } + if (!PosixConvertToCurrentList(argVal, &argv)) { + goto exit; + } + + ret = execv(path, argv); + +exit: + if (argv) { + Util_FreeStringList(argv, -1); + } + free(path); + return ret; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Execve -- + * + * POSIX execve(). + * + * Results: + * -1 Error + * 0 Success + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +int +Posix_Execve(ConstUnicode pathName, // IN: + Unicode const argVal[], // IN: + Unicode const envPtr[]) // IN: +{ + int ret = -1; + char *path; + char **argv = NULL; + char **envp = NULL; + + if (!PosixConvertToCurrent(pathName, &path)) { + goto exit; + } + if (!PosixConvertToCurrentList(argVal, &argv)) { + goto exit; + } + if (!PosixConvertToCurrentList(envPtr, &envp)) { + goto exit; + } + + ret = execve(path, argv, envp); + +exit: + if (argv) { + Util_FreeStringList(argv, -1); + } + if (envp) { + Util_FreeStringList(envp, -1); + } + free(path); + return ret; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Execvp -- + * + * POSIX execvp(). + * + * Results: + * -1 Error + * 0 Success + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +int +Posix_Execvp(ConstUnicode fileName, // IN: + Unicode const argVal[]) // IN: +{ + int ret = -1; + char *file; + char **argv = NULL; + + if (!PosixConvertToCurrent(fileName, &file)) { + goto exit; + } + if (!PosixConvertToCurrentList(argVal, &argv)) { + goto exit; + } + + ret = execvp(file, argv); + +exit: + if (argv) { + Util_FreeStringList(argv, -1); + } + free(file); + return ret; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_System -- + * + * POSIX system() + * + * Results: + * Returns the status of command, or -1 on failure. + * + * Side effects: + * errno is set on error. + * + *---------------------------------------------------------------------- + */ + +int +Posix_System(ConstUnicode command) // IN: +{ + char *tmpcommand; + int ret; + + if (!PosixConvertToCurrent(command, &tmpcommand)) { + return -1; + } + + ret = system(tmpcommand); + + free(tmpcommand); + return ret; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Mkdir -- + * + * POSIX mkdir(). + * + * Results: + * -1 Error + * 0 Success + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +int +Posix_Mkdir(ConstUnicode pathName, // IN: + mode_t mode) // IN: +{ + char *path; + int ret; + + if (!PosixConvertToCurrent(pathName, &path)) { + return -1; + } + + ret = mkdir(path, mode); + + free(path); + return ret; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Chdir -- + * + * POSIX chdir(). + * + * Results: + * -1 Error + * 0 Success + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +int +Posix_Chdir(ConstUnicode pathName) // IN: +{ + char *path; + int ret; + + if (!PosixConvertToCurrent(pathName, &path)) { + return -1; + } + + ret = chdir(path); + + free(path); + return ret; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_RealPath -- + * + * POSIX realpath(). + * + * Results: + * NULL Error + * !NULL Success (result must be freed by the caller) + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +Unicode +Posix_RealPath(ConstUnicode pathName) // IN: +{ + char *path; + char rpath[PATH_MAX]; + char *p; + + if (!PosixConvertToCurrent(pathName, &path)) { + return NULL; + } + + p = realpath(path, rpath); + + free(path); + return p == NULL ? NULL : Unicode_Alloc(rpath, STRING_ENCODING_DEFAULT); +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_ReadLink -- + * + * POSIX readlink(). + * + * Results: + * NULL Error + * !NULL Success (result must be freed by the caller) + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +Unicode +Posix_ReadLink(ConstUnicode pathName) // IN: +{ + char *path; + ssize_t bytes; + Unicode result = NULL; + char link[PATH_MAX]; + + if (!PosixConvertToCurrent(pathName, &path)) { + return NULL; + } + + bytes = readlink(path, link, sizeof link); + ASSERT_NOT_IMPLEMENTED(bytes < (ssize_t) sizeof link); + + free(path); + + if (bytes != -1) { + /* add the missing NUL character to path */ + link[bytes] = '\0'; + result = Unicode_Alloc(link, STRING_ENCODING_DEFAULT); + } + + return result; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Lstat -- + * + * POSIX lstat() + * + * Results: + * -1 Error + * 0 Success + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +int +Posix_Lstat(ConstUnicode pathName, // IN: + struct stat *statbuf) // IN: +{ + char *path; + int ret; + + if (!PosixConvertToCurrent(pathName, &path)) { + return -1; + } + + ret = lstat(path, statbuf); + + free(path); + return ret; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_OpenDir -- + * + * POSIX opendir() + * + * Results: + * -1 Error + * 0 Success + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +DIR * +Posix_OpenDir(ConstUnicode pathName) // IN: +{ + char *path; + DIR *ret; + + if (!PosixConvertToCurrent(pathName, &path)) { + return NULL; + } + + ret = opendir(path); + + free(path); + return ret; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Getenv -- + * + * POSIX getenv(). + * + * Results: + * NULL The name was not found or an error occurred + * !NULL The value associated with the name in UTF8. This does not + * need to be freed. + * + * Side effects: + * None + * + *---------------------------------------------------------------------- + */ + +Unicode +Posix_Getenv(ConstUnicode name) // IN: +{ + char *rawName; + char *rawValue; + + if (!PosixConvertToCurrent(name, &rawName)) { + return NULL; + } + rawValue = getenv(rawName); + free(rawName); + + if (rawValue == NULL) { + return NULL; + } + + return PosixGetenvHash(name, Unicode_Alloc(rawValue, + STRING_ENCODING_DEFAULT)); +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Putenv -- + * + * POSIX putenv(). This wrapper will only assert the string is ASCII. + * putenv() should not be used. + * + * Results: + * -1 Error + * 0 Success + * + * Side effects: + * Environment may be changed. + * + *---------------------------------------------------------------------- + */ + +int +Posix_Putenv(Unicode name) // IN: +{ + ASSERT(Unicode_IsBufferValid(name, -1, STRING_ENCODING_US_ASCII)); + return putenv(name); +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Getpwnam -- + * + * POSIX getpwnam() + * + * Results: + * Pointer to updated passwd struct on NULL on error. + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +struct passwd * +Posix_Getpwnam(ConstUnicode name) // IN: +{ + struct passwd *pw; + char *tmpname; + + if (!PosixConvertToCurrent(name, &tmpname)) { + return NULL; + } + pw = getpwnam(tmpname); + free(tmpname); + + return GetpwInternal(pw); +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Getpwuid -- + * + * POSIX getpwuid() + * + * Results: + * Pointer to updated passwd struct on NULL on error. + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +struct passwd * +Posix_Getpwuid(uid_t uid) // IN: +{ + struct passwd *pw; + + pw = getpwuid(uid); + return GetpwInternal(pw); +} + + +/* + *---------------------------------------------------------------------- + * + * GetpwInternal -- + * + * Helper function for Posix_Getpwnam, Posix_Getpwuid and Posix_Getpwent + * + * Results: + * Pointer to updated passwd struct on NULL on error. + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +static struct passwd * +GetpwInternal(struct passwd *pw) // IN: +{ + int ret; + static struct passwd spw = {0}; + + if (!pw) { + return NULL; + } + + /* Free static structure string pointers before reuse. */ + free(spw.pw_passwd); + spw.pw_passwd = NULL; + free(spw.pw_dir); + spw.pw_dir = NULL; + free(spw.pw_name); + spw.pw_name = NULL; + free(spw.pw_gecos); + spw.pw_gecos = NULL; + free(spw.pw_shell); + spw.pw_shell = NULL; +#if defined(__FreeBSD__) + free(spw.pw_class); + spw.pw_class = NULL; +#endif + + /* Fill out structure with new values. */ + spw.pw_uid = pw->pw_uid; + spw.pw_gid = pw->pw_gid; +#if defined(__FreeBSD__) + spw.pw_change = pw->pw_change; + spw.pw_expire = pw->pw_expire; + spw.pw_fields = pw->pw_fields; +#endif + +#if !defined(sun) + ret = ENOMEM; +#else + ret = EIO; +#endif + if (pw->pw_passwd && + (spw.pw_passwd = Unicode_Alloc(pw->pw_passwd, STRING_ENCODING_DEFAULT)) == NULL) { + goto exit; + } + if (pw->pw_dir && + (spw.pw_dir = Unicode_Alloc(pw->pw_dir, STRING_ENCODING_DEFAULT)) == NULL) { + goto exit; + } + if (pw->pw_name && + (spw.pw_name = Unicode_Alloc(pw->pw_name, STRING_ENCODING_DEFAULT)) == NULL) { + goto exit; + } + if (pw->pw_gecos && + (spw.pw_gecos = Unicode_Alloc(pw->pw_gecos, STRING_ENCODING_DEFAULT)) == NULL) { + goto exit; + } + if (pw->pw_shell && + (spw.pw_shell = Unicode_Alloc(pw->pw_shell, STRING_ENCODING_DEFAULT)) == NULL) { + goto exit; + } +#if defined(__FreeBSD__) + if (pw->pw_class && + (spw.pw_class = Unicode_Alloc(pw->pw_class, STRING_ENCODING_DEFAULT)) == NULL) { + goto exit; + } +#endif + ret = 0; + +exit: + if (ret != 0) { + errno = ret; + return NULL; + } + return &spw; +} + + +#if !defined(sun) // { + +/* + *---------------------------------------------------------------------- + * + * Posix_Statfs -- + * + * POSIX statfs() + * + * Results: + * -1 Error + * 0 Success + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +int +Posix_Statfs(ConstUnicode pathName, // IN: + struct statfs *statfsbuf) // IN: +{ + char *path; + int ret; + + if (!PosixConvertToCurrent(pathName, &path)) { + return -1; + } + + ret = statfs(path, statfsbuf); + + free(path); + return ret; +} +#endif // } !defined(sun) + + +/* + *---------------------------------------------------------------------- + * + * Posix_Setenv -- + * + * POSIX setenv(). + * + * Results: + * -1 Error + * 0 Success + * + * Side effects: + * Environment may be changed. + * + *---------------------------------------------------------------------- + */ + +int +Posix_Setenv(ConstUnicode name, // IN: + ConstUnicode value, // IN: + int overWrite) // IN: +{ + int ret = -1; + char *rawName = NULL; + char *rawValue = NULL; + + if (!PosixConvertToCurrent(name, &rawName)) { + goto exit; + } + if (!PosixConvertToCurrent(value, &rawValue)) { + goto exit; + } + +#if defined(sun) + if (overWrite || !getenv(rawName)) { + static HashTable *trackEnv = NULL; // Tracks values to avoid leaks. + char *keyStr; + char *fullStr; + int fslen; + int rawNameLen; + int rawValueLen; + + if (!trackEnv) { + trackEnv = HashTable_Alloc(16, HASH_STRING_KEY, free); + } + /* + * In order to keep memory management and hash table manipulation simple, each env + * var is stored as a memory block containing the NUL-terminated environment + * variable name, followed immediately in memory by the full argument to putenv + * ('varname=value'). + */ + + rawNameLen = strlen(rawName) + 1; + rawValueLen = strlen(rawValue) + 1; + fslen = rawNameLen + rawValueLen + 1; // 1 is for '=' sign + keyStr = malloc(rawNameLen + fslen); + fullStr = keyStr + rawNameLen; + /* + * Use memcpy because Str_Snprintf() doesn't play well with non-UTF8 strings. + */ + memcpy(keyStr, rawName, rawNameLen); + memcpy(fullStr, rawName, rawNameLen); + fullStr[rawNameLen - 1] = '='; + memcpy(fullStr + rawNameLen, rawValue, rawValueLen); + + ret = putenv(fullStr); + HashTable_Insert(trackEnv, keyStr, keyStr); // Any old value will be freed + } else { + ret = 0; + } +#else + ret = setenv(rawName, rawValue, overWrite); +#endif + +exit: + free(rawName); + free(rawValue); + return ret; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Unsetenv -- + * + * POSIX unsetenv(). + * + * Results: + * None. + * + * Side effects: + * Environment may be changed. + * + *---------------------------------------------------------------------- + */ + +void +Posix_Unsetenv(ConstUnicode name) // IN: +{ + char *rawName; + + if (!PosixConvertToCurrent(name, &rawName)) { + return; + } + +#if defined(sun) + putenv(rawName); +#else + unsetenv(rawName); +#endif + free(rawName); +} + + +/*---------------------------------------------------------------------- + * Posix_Getpwent -- + * + * POSIX getpwent() + * + * Results: + * Pointer to updated passwd struct or NULL on error. + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +struct passwd * +Posix_Getpwent(void) +{ + struct passwd *pw; + + pw = getpwent(); + return GetpwInternal(pw); +} + +#if !defined(VM_SYSTEM_HAS_GETPWNAM_R) || \ + !defined(VM_SYSTEM_HAS_GETPWUID_R) || \ + !defined(VM_SYSTEM_HAS_GETGRNAM_R) // { +/* + *----------------------------------------------------------------------------- + * + * CopyFieldIntoBuf -- + * + * Copies a field in a passwd/group structure into the supplied buffer, and sets + * that pointer into dest. Used as a helper function for the EmulateGet* routines. + * + * Results: + * TRUE on success, FALSE on failure. + * + * Side effects: + * Updates *buf and *bufLen to allocate space for the copied field. + * + *----------------------------------------------------------------------------- + */ + +static Bool +CopyFieldIntoBuf(const char *src, + char **dest, + char **buf, + size_t *bufLen) +{ + if (src) { + size_t needLen = strlen(src) + 1; + + if (*bufLen < needLen) { + return FALSE; + } + + *dest = *buf; + memcpy(*dest, src, needLen); + *buf += needLen; + *bufLen -= needLen; + } else { + *dest = NULL; + } + + return TRUE; +} + + +#endif // } + + +#if !defined(VM_SYSTEM_HAS_GETPWNAM_R) || !defined(VM_SYSTEM_HAS_GETPWUID_R) // { +/* + *----------------------------------------------------------------------------- + * + * PasswdCopy -- + * + * Copies a password structure as part of emulating the getpw*_r routines. + * + * Results: + * 'new' if successful, NULL otherwise. + * + * Side effects: + * Modifies 'buf' + * + *----------------------------------------------------------------------------- + */ + +static struct passwd * +PasswdCopy(struct passwd *orig, // IN + struct passwd *new, // IN/OUT + char *buf, // IN + size_t bufLen) // IN +{ + if (!orig) { + return NULL; + } + + *new = *orig; + + if (!CopyFieldIntoBuf(orig->pw_name, &new->pw_name, &buf, &bufLen)) { + return NULL; + } + if (!CopyFieldIntoBuf(orig->pw_passwd, &new->pw_passwd, &buf, &bufLen)) { + return NULL; + } + if (!CopyFieldIntoBuf(orig->pw_gecos, &new->pw_gecos, &buf, &bufLen)) { + return NULL; + } + if (!CopyFieldIntoBuf(orig->pw_dir, &new->pw_dir, &buf, &bufLen)) { + return NULL; + } + if (!CopyFieldIntoBuf(orig->pw_shell, &new->pw_shell, &buf, &bufLen)) { + return NULL; + } +#ifdef __FreeBSD__ + if (!CopyFieldIntoBuf(orig->pw_class, &new->pw_class, &buf, &bufLen)) { + return NULL; + } +#endif + + return new; +} +#endif // } + + +#ifndef VM_SYSTEM_HAS_GETPWNAM_R // { +/* + *----------------------------------------------------------------------------- + * + * EmulateGetpwnam_r -- + * + * Emulates getpwnam_r() for old/odd systems that don't have it + * + * Results: + * None. + * + * Side effects: + * Data may be stored in 'buf'. + * + *----------------------------------------------------------------------------- + */ + +static int +EmulateGetpwnam_r(const char *name, // IN + struct passwd *pwbuf, // IN/OUT + char *buf, // IN + size_t buflen, // IN + struct passwd **pwbufp) // IN/OUT +{ + static Atomic_uint32 mutex = {0}; + struct passwd *pw; + int savedErrno; + + ASSERT(pwbuf); + ASSERT(name); + ASSERT(buf); + ASSERT(pwbufp); + + /* + * XXX Use YIELD() here when it works on FreeBSD. + */ + while (Atomic_ReadWrite(&mutex, 1)); // Spinlock. + + pw = getpwnam(name); + savedErrno = errno; + *pwbufp = PasswdCopy(pw, pwbuf, buf, buflen); + + Atomic_Write(&mutex, 0); + + if (pw) { + return 0; + } else if (savedErrno) { + return savedErrno; + } else { + return ENOENT; + } +} +#endif + + +#ifndef VM_SYSTEM_HAS_GETPWUID_R +/* + *----------------------------------------------------------------------------- + * + * EmulateGetpwuid_r -- + * + * Emulates getpwuid_r() for old/odd systems that don't have it + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static int +EmulateGetpwuid_r(uid_t uid, // IN + struct passwd *pwbuf, // IN/OUT + char *buf, // IN + size_t buflen, // IN + struct passwd **pwbufp) // IN/OUT +{ + static Atomic_uint32 mutex = {0}; + struct passwd *pw; + int savedErrno; + + ASSERT(pwbuf); + ASSERT(buf); + ASSERT(pwbufp); + + /* + * XXX Use YIELD() here when it works on FreeBSD. + */ + while (Atomic_ReadWrite(&mutex, 1)); // Spinlock + + pw = getpwuid(uid); + savedErrno = errno; + *pwbufp = PasswdCopy(pw, pwbuf, buf, buflen); + + Atomic_Write(&mutex, 0); + + if (pw) { + return 0; + } else if (savedErrno) { + return savedErrno; + } else { + return ENOENT; + } +} +#endif // } + + +#ifndef VM_SYSTEM_HAS_GETGRNAM_R // { +/* + *----------------------------------------------------------------------------- + * + * GroupCopy -- + * + * Copies a password structure as part of emulating the getgr*_r routines. + * + * Results: + * 'new' if successful, NULL otherwise. + * + * Side effects: + * Modifies 'buf' + * + *----------------------------------------------------------------------------- + */ + +static struct group * +GroupCopy(struct group *orig, // IN + struct group *new, // IN/OUT + char *buf, // IN + size_t bufLen) // IN +{ + if (!orig) { + return NULL; + } + + *new = *orig; + + if (!CopyFieldIntoBuf(orig->gr_name, &new->gr_name, &buf, &bufLen)) { + return NULL; + } + if (!CopyFieldIntoBuf(orig->gr_passwd, &new->gr_passwd, &buf, &bufLen)) { + return NULL; + } + + if (orig->gr_mem) { + int i; + uintptr_t alignLen; + char **newGrMem; + + /* + * Before putting the gr_mem 'char **' array into 'buf', aligns the buffer to a + * pointer-size boundary. + */ + alignLen = ((((uintptr_t) buf) + (sizeof(void *) - 1)) & ~(sizeof(void *) - 1)); + alignLen -= ((uintptr_t) buf); + + if (bufLen < alignLen) { + return NULL; + } + buf += alignLen; + bufLen -= alignLen; + + /* + * Count the number of items in the gr_mem array, and then copy them all. + */ + for (i = 0; orig->gr_mem[i]; i++); + i++; // need space for a terminating NULL + + if (bufLen < (i * sizeof(void *))) { + return NULL; + } + newGrMem = (char **)buf; + buf += i * sizeof(void *); + bufLen -= i * sizeof(void *); + + for (i = 0; orig->gr_mem[i]; i++, newGrMem++) { + size_t flen; + + flen = strlen(orig->gr_mem[i]) + 1; + if (bufLen < flen) { + return NULL; + } + + *newGrMem = buf; + memcpy(*newGrMem, orig->gr_mem[i], flen); + buf += flen; + bufLen -= flen; + } + *newGrMem = NULL; + } + + return new; +} +#endif // } + + +#ifndef VM_SYSTEM_HAS_GETGRNAM_R // { +/* + *----------------------------------------------------------------------------- + * + * EmulateGetgrnam_r -- + * + * Emulates getgrnam_r() for old/odd systems that don't have it + * + * Results: + * None. + * + * Side effects: + * Data may be stored in 'buf'. + * + *----------------------------------------------------------------------------- + */ + +static int +EmulateGetgrnam_r(const char *name, // IN + struct group *grbuf, // IN/OUT + char *buf, // IN + size_t buflen, // IN + struct group **grbufp) // IN/OUT +{ + static Atomic_uint32 mutex = {0}; + struct group *gr; + int savedErrno; + + ASSERT(grbuf); + ASSERT(name); + ASSERT(buf); + ASSERT(grbufp); + + /* + * XXX Use YIELD() here once it is available on FreeBSD + */ + while (Atomic_ReadWrite(&mutex, 1)); // Spinlock + + gr = getgrnam(name); + savedErrno = errno; + *grbufp = GroupCopy(gr, grbuf, buf, buflen); + + Atomic_Write(&mutex, 0); + + if (gr) { + return 0; + } else if (savedErrno) { + return savedErrno; + } else { + return ENOENT; + } +} +#endif // } + + +/* + *---------------------------------------------------------------------- + * + * Posix_Getpwnam_r -- + * + * POSIX getpwnam_r() + * + * Results: + * Returns 0 with success and pointer to updated passwd struct + * or returns error code. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +int +Posix_Getpwnam_r(ConstUnicode name, // IN: + struct passwd *pw, // IN: + char *buf, // IN: + size_t size, // IN: + struct passwd **ppw) // OUT: +{ + int ret; + char *tmpname; + + if (!PosixConvertToCurrent(name, &tmpname)) { + /* + * Act like nonexistent user, almost. + * While getpwnam_r() returns 0 on nonexistent user, + * we will return the errno instead. + */ + + *ppw = NULL; + return errno; + } + +#if defined(VM_SYSTEM_HAS_GETPWNAM_R) + ret = getpwnam_r(tmpname, pw, buf, size, ppw); +#else + ret = EmulateGetpwnam_r(tmpname, pw, buf, size, ppw); +#endif + + free(tmpname); + + // ret is errno on failure, *ppw is NULL if no matching entry found. + if (ret != 0 || *ppw == NULL) { + return ret; + } + + return GetpwInternal_r(pw, buf, size, ppw); +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Getpwuid_r -- + * + * POSIX getpwuid_r() + * + * Results: + * Returns 0 with success and pointer to updated passwd struct + * or returns error code. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +int +Posix_Getpwuid_r(uid_t uid, // IN: + struct passwd *pw, // IN: + char *buf, // IN: + size_t size, // IN: + struct passwd **ppw) // OUT: +{ + int ret; + +#if defined(VM_SYSTEM_HAS_GETPWNAM_R) + ret = getpwuid_r(uid, pw, buf, size, ppw); +#else + ret = EmulateGetpwuid_r(uid, pw, buf, size, ppw); +#endif + if (ret != 0 || *ppw == NULL) { + // ret is errno on failure, *ppw is NULL if no matching entry found. + return ret; + } + + return GetpwInternal_r(pw, buf, size, ppw); +} + + +/* + *---------------------------------------------------------------------- + * + * GetpwInternal_r -- + * + * Helper function for Posix_Getpwnam_r and Posix_Getpwuid_r + * + * Results: + * Returns 0 with success and pointer to updated passwd struct + * or returns error code. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +static int +GetpwInternal_r(struct passwd *pw, // IN: + char *buf, // IN: + size_t size, // IN: + struct passwd **ppw) // OUT: +{ + int ret; + char *pwname = NULL; + char *passwd = NULL; + char *gecos = NULL; + char *dir = NULL; + char *shell = NULL; + size_t n; + + /* + * Maybe getpwnam_r didn't use supplied struct, but we don't care. + * We just fix up the one it gives us. + */ + + pw = *ppw; + + /* + * Convert strings to UTF-8 + */ + + ret = ENOMEM; + if (pw->pw_name && + (pwname = Unicode_Alloc(pw->pw_name, STRING_ENCODING_DEFAULT)) == NULL) { + goto exit; + } + if (pw->pw_passwd && + (passwd = Unicode_Alloc(pw->pw_passwd, STRING_ENCODING_DEFAULT)) == NULL) { + goto exit; + } + if (pw->pw_gecos && + (gecos = Unicode_Alloc(pw->pw_gecos, STRING_ENCODING_DEFAULT)) == NULL) { + goto exit; + } + if (pw->pw_dir && + (dir = Unicode_Alloc(pw->pw_dir, STRING_ENCODING_DEFAULT)) == NULL) { + goto exit; + } + if (pw->pw_shell && + (shell = Unicode_Alloc(pw->pw_shell, STRING_ENCODING_DEFAULT)) == NULL) { + goto exit; + } + + /* + * Put UTF-8 strings into the structure. + */ + + ret = ERANGE; + n = 0; + + if (pwname) { + size_t len = strlen(pwname) + 1; + if (n + len > size || n + len < n) { + goto exit; + } + pw->pw_name = memcpy(buf + n, pwname, len); + n += len; + } + + if (passwd != NULL) { + size_t len = strlen(passwd) + 1; + if (n + len > size || n + len < n) { + goto exit; + } + pw->pw_passwd = memcpy(buf + n, passwd, len); + n += len; + } + + if (gecos) { + size_t len = strlen(gecos) + 1; + if (n + len > size || n + len < n) { + goto exit; + } + pw->pw_gecos = memcpy(buf + n, gecos, len); + n += len; + } + + if (dir) { + size_t len = strlen(dir) + 1; + if (n + len > size || n + len < n) { + goto exit; + } + pw->pw_dir = memcpy(buf + n, dir, len); + n += len; + } + + if (shell) { + size_t len = strlen(shell) + 1; + if (n + len > size || n + len < n) { + goto exit; + } + pw->pw_shell = memcpy(buf + n, shell, len); + n += len; + } + ret = 0; + +exit: + free(passwd); + free(dir); + free(pwname); + free(gecos); + free(shell); + return ret; +} + + +#if !defined(sun) // { +/* + *---------------------------------------------------------------------- + * + * Posix_GetGroupList -- + * + * POSIX getgrouplist() + * + * Results: + * Returns number of groups found, or -1 if *ngroups is + * smaller than number of groups found. Also returns + * the list of groups. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +int +Posix_GetGroupList(ConstUnicode user, // IN: + gid_t group, // IN: + gid_t *groups, // OUT: + int *ngroups) // IN/OUT: +{ + char *tmpuser; + int ret; + + if (!PosixConvertToCurrent(user, &tmpuser)) { + /* + * Act like nonexistent user. + * The supplied gid is always returned, so there's exactly + * one group. + * While the man page doesn't say, the return value is + * the same as *ngroups in the success case. + * + * Should we always return -1 instead? + * + * -- edward + */ + + int n = *ngroups; + + *ngroups = 1; + if (n < 1) { + return -1; + } + ASSERT(groups != NULL); + *groups = group; + return 1; + } + + ret = getgrouplist(tmpuser, group, groups, ngroups); + + free(tmpuser); + return ret; +} + + +#endif // } + +/* + *---------------------------------------------------------------------- + * Posix_Getgrnam -- + * + * POSIX getgrnam() + * + * Results: + * Pointer to updated group struct on NULL on error. + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +struct group * +Posix_Getgrnam(ConstUnicode name) // IN: +{ + struct group *gr; + char *tmpname; + int ret; + static struct group sgr = {0}; + + if (!PosixConvertToCurrent(name, &tmpname)) { + return NULL; + } + gr = getgrnam(tmpname); + free(tmpname); + + if (!gr) { + return NULL; + } + + /* Free static structure string pointers before reuse. */ + free(sgr.gr_name); + sgr.gr_name = NULL; + free(sgr.gr_passwd); + sgr.gr_passwd = NULL; + if (sgr.gr_mem != NULL) { + Unicode_FreeList(sgr.gr_mem, -1); + sgr.gr_mem = NULL; + } + + /* Fill out structure with new values. */ + sgr.gr_gid = gr->gr_gid; + + ret = ENOMEM; + if (gr->gr_passwd && + (sgr.gr_passwd = Unicode_Alloc(gr->gr_passwd, STRING_ENCODING_DEFAULT)) == NULL) { + goto exit; + } + if (gr->gr_name && + (sgr.gr_name = Unicode_Alloc(gr->gr_name, STRING_ENCODING_DEFAULT)) == NULL) { + goto exit; + } + if (gr->gr_mem) { + sgr.gr_mem = Unicode_AllocList(gr->gr_mem, -1, STRING_ENCODING_DEFAULT); + } + + ret = 0; + + exit: + if (ret != 0) { + errno = ret; + return NULL; + } + return &sgr; + +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Getgrnam_r -- + * + * POSIX getgrnam_r() + * + * Results: + * Returns 0 with success and pointer to updated group struct + * or returns error code. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +int +Posix_Getgrnam_r(ConstUnicode name, // IN: + struct group *gr, // IN: + char *buf, // IN: + size_t size, // IN: + struct group **pgr) // OUT: +{ + int ret, i; + char *tmpname; + char *grname = NULL; + char *grpasswd = NULL; + char **grmem = NULL; + size_t n; + + if (!PosixConvertToCurrent(name, &tmpname)) { + /* + * Act like nonexistent group, almost. + * While getgrnam_r() returns 0 on nonexistent group, + * we will return the errno instead. + */ + + *pgr = NULL; + return errno; + } + +#if defined(VM_SYSTEM_HAS_GETGRNAM_R) + ret = getgrnam_r(tmpname, gr, buf, size, pgr); +#else + ret = EmulateGetgrnam_r(tmpname, gr, buf, size, pgr); +#endif + free(tmpname); + + // ret is errno on failure, *pgr is NULL if no matching entry found. + if (ret != 0 || *pgr == NULL) { + return ret; + } + + /* + * Maybe getgrnam_r didn't use supplied struct, but we don't care. + * We just fix up the one it gives us. + */ + + gr = *pgr; + + /* + * Convert strings to UTF-8 + */ + + ret = ENOMEM; + if (gr->gr_name && + (grname = Unicode_Alloc(gr->gr_name, STRING_ENCODING_DEFAULT)) == NULL) { + goto exit; + } + if (gr->gr_passwd && + (grpasswd = Unicode_Alloc(gr->gr_passwd, STRING_ENCODING_DEFAULT)) == NULL) { + goto exit; + } + if (gr->gr_mem) { + grmem = Unicode_AllocList(gr->gr_mem, -1, STRING_ENCODING_DEFAULT); + } + + /* + * Put UTF-8 strings into the structure. + */ + + ret = ERANGE; + n = 0; + + if (grname) { + size_t len = strlen(grname) + 1; + if (n + len > size) { + goto exit; + } + gr->gr_name = memcpy(buf + n, grname, len); + n += len; + } + + if (grpasswd != NULL) { + size_t len = strlen(grpasswd) + 1; + if (n + len > size) { + goto exit; + } + gr->gr_passwd = memcpy(buf + n, grpasswd, len); + n += len; + } + + if (grmem) { + for (i = 0; grmem[i]; i++) { + size_t len = strlen(grmem[i]) + 1; + if (n + len > size) { + goto exit; + } + gr->gr_mem[i] = memcpy(buf + n, grmem[i], len); + n += len; + } + } + + ret = 0; + + exit: + free(grpasswd); + free(grname); + if (grmem) { + Unicode_FreeList(grmem, -1); + } + return ret; +} + + +#if !defined(sun) // { + +#if !defined(__APPLE__) && !defined(__FreeBSD__) // { +/* + *---------------------------------------------------------------------- + * + * Posix_Mount -- + * + * POSIX mount() + * + * Results: + * -1 Error + * 0 Success + * + * Side effects: + * errno is set on error. On success, filesystem is mounted. + * + *---------------------------------------------------------------------- + */ + +int +Posix_Mount(ConstUnicode source, // IN: + ConstUnicode target, // IN: + const char *filesystemtype, // IN: + unsigned long mountflags, // IN: + const void *data) // IN: +{ + int ret = -1; + char *tmpsource = NULL; + char *tmptarget = NULL; + + if (!PosixConvertToCurrent(source, &tmpsource)) { + goto exit; + } + if (!PosixConvertToCurrent(target, &tmptarget)) { + goto exit; + } + + ret = mount(tmpsource, tmptarget, filesystemtype, mountflags, data); + +exit: + free(tmpsource); + free(tmptarget); + return ret; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Umount -- + * + * POSIX umount() + * + * Results: + * -1 Error + * 0 Success + * + * Side effects: + * errno is set on error. On success, filesystem is unmounted. + * + *---------------------------------------------------------------------- + */ + +int +Posix_Umount(ConstUnicode target) // IN: +{ + char *tmptarget; + int ret; + + if (!PosixConvertToCurrent(target, &tmptarget)) { + return -1; + } + + ret = umount(tmptarget); + + free(tmptarget); + return ret; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Setmntent -- + * + * Open a file via POSIX setmntent() + * + * Results: + * NULL Error + * !NULL File stream + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +FILE * +Posix_Setmntent(ConstUnicode pathName, // IN: + const char *mode) // IN: +{ + char *path; + FILE *stream; + + ASSERT(mode != NULL); + + if (!PosixConvertToCurrent(pathName, &path)) { + return NULL; + } + + stream = setmntent(path, mode); + + free(path); + return stream; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Getmntent -- + * + * POSIX getmntent() + * + * Results: + * Pointer to updated mntent struct or NULL on error. + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +struct mntent * +Posix_Getmntent(FILE *fp) // IN: +{ + int ret; + struct mntent *m; + static struct mntent sm = {0}; + + m = getmntent(fp); + if (!m) { + return NULL; + } + + /* Free static structure string pointers before reuse. */ + free(sm.mnt_fsname); + sm.mnt_fsname = NULL; + free(sm.mnt_dir); + sm.mnt_dir = NULL; + free(sm.mnt_type); + sm.mnt_type = NULL; + free(sm.mnt_opts); + sm.mnt_opts = NULL; + + /* Fill out structure with new values. */ + sm.mnt_freq = m->mnt_freq; + sm.mnt_passno = m->mnt_passno; + + ret = ENOMEM; + if (m->mnt_fsname && + (sm.mnt_fsname = Unicode_Alloc(m->mnt_fsname, STRING_ENCODING_DEFAULT)) == NULL) { + goto exit; + } + if (m->mnt_dir && + (sm.mnt_dir = Unicode_Alloc(m->mnt_dir, STRING_ENCODING_DEFAULT)) == NULL) { + goto exit; + } + if (m->mnt_type && + (sm.mnt_type = Unicode_Alloc(m->mnt_type, STRING_ENCODING_DEFAULT)) == NULL) { + goto exit; + } + if (m->mnt_opts && + (sm.mnt_opts = Unicode_Alloc(m->mnt_opts, STRING_ENCODING_DEFAULT)) == NULL) { + goto exit; + } + ret = 0; + +exit: + if (ret != 0) { + errno = ret; + return NULL; + } + return &sm; +} + + +/* + *---------------------------------------------------------------------- + * + * Posix_Getmntent_r -- + * + * POSIX getmntent_r() + * + * Results: + * Pointer to updated mntent struct or NULL on error. + * + * Side effects: + * errno is set on error + * + *---------------------------------------------------------------------- + */ + +struct mntent * +Posix_Getmntent_r(FILE *fp, // IN: + struct mntent *m, // IN: + char *buf, // IN: + int size) // IN: +{ + int ret; + char *fsname = NULL; + char *dir = NULL; + char *type = NULL; + char *opts = NULL; + size_t n; + + if (!getmntent_r(fp, m, buf, size)) { + return NULL; + } + + /* + * Convert strings to UTF-8 + */ + + ret = ENOMEM; + if (m->mnt_fsname && + (fsname = Unicode_Alloc(m->mnt_fsname, STRING_ENCODING_DEFAULT)) == NULL) { + goto exit; + } + if (m->mnt_dir && + (dir = Unicode_Alloc(m->mnt_dir, STRING_ENCODING_DEFAULT)) == NULL) { + goto exit; + } + if (m->mnt_type && + (type = Unicode_Alloc(m->mnt_type, STRING_ENCODING_DEFAULT)) == NULL) { + goto exit; + } + if (m->mnt_opts && + (opts = Unicode_Alloc(m->mnt_opts, STRING_ENCODING_DEFAULT)) == NULL) { + goto exit; + } + + /* + * Put UTF-8 strings into the structure. + */ + + ret = ERANGE; + n = 0; + + if (fsname) { + int len = strlen(fsname) + 1; + if (n + len > size || n + len < n) { + goto exit; + } + m->mnt_fsname = memcpy(buf + n, fsname, len); + n += len; + } + + if (dir != NULL) { + int len = strlen(dir) + 1; + if (n + len > size || n + len < n) { + goto exit; + } + m->mnt_dir = memcpy(buf + n, dir, len); + n += len; + } + + if (type) { + int len = strlen(type) + 1; + if (n + len > size || n + len < n) { + goto exit; + } + m->mnt_type = memcpy(buf + n, type, len); + n += len; + } + + if (opts) { + size_t len = strlen(opts) + 1; + if (n + len > size || n + len < n) { + goto exit; + } + m->mnt_opts = memcpy(buf + n, opts, len); + n += len; + } + ret = 0; + +exit: + + free(fsname); + free(dir); + free(type); + free(opts); + + if (ret != 0) { + errno = ret; + return NULL; + } + return m; +} + + +/* + *---------------------------------------------------------------------------- + * + * Posix_Printf -- + * + * Wrapper around printf. [w]printf can only print characters from + * the local character set. So instead we use ConsoleWriteW which can + * print characters from the entire Unicode character set. + * + * Returns: + * Returns the number of characters printed out. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +int +Posix_Printf(ConstUnicode format, + ...) +{ + va_list args; + Unicode output; + char *outCurr; + int numChars; + + va_start(args, format); + output = Str_Vasprintf(NULL, format, args); + va_end(args); + + if (!PosixConvertToCurrent(output, &outCurr)) { + return -1; + } + numChars = printf("%s", outCurr); + + free(output); + free(outCurr); + return numChars; +} + + +/* + *---------------------------------------------------------------------------- + * + * Posix_Fprintf -- + * + * Wrapper around fprintf. + * + * Returns: + * Returns the number of bytes characters printed out. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +int +Posix_Fprintf(FILE *stream, + ConstUnicode format, + ...) +{ + va_list args; + Unicode output; + char *outCurr; + int nOutput; + + va_start(args, format); + output = Str_Vasprintf(NULL, format, args); + va_end(args); + + if (!PosixConvertToCurrent(output, &outCurr)) { + return -1; + } + nOutput = fprintf(stream, "%s", outCurr); + + free(output); + free(outCurr); + return nOutput; +} + + +#endif // } !defined(__APPLE__) && !defined(__FreeBSD) + + +#else // } !defined(sun) { +/* + *---------------------------------------------------------------------- + * + * Posix_Getmntent -- + * + * POSIX getmntent() for Solaris + * + * Results: + * -1 EOF + * 0 Success + * >0 Error + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +int +Posix_Getmntent(FILE *fp, // IN: + struct mnttab *mp) // IN: +{ + int ret; + static struct mnttab m = {0}; + + ret = getmntent(fp, mp); + if (ret == 0) { + free(m.mnt_special); + free(m.mnt_mountp); + free(m.mnt_fstype); + free(m.mnt_mntopts); + free(m.mnt_time); + m.mnt_special = Unicode_Alloc(mp->mnt_special, STRING_ENCODING_DEFAULT); + m.mnt_mountp = Unicode_Alloc(mp->mnt_mountp, STRING_ENCODING_DEFAULT); + m.mnt_fstype = Unicode_Alloc(mp->mnt_fstype, STRING_ENCODING_DEFAULT); + m.mnt_mntopts = Unicode_Alloc(mp->mnt_mntopts, STRING_ENCODING_DEFAULT); + m.mnt_time = Unicode_Alloc(mp->mnt_time, STRING_ENCODING_DEFAULT); + mp->mnt_special = m.mnt_special; + mp->mnt_mountp = m.mnt_mountp; + mp->mnt_fstype = m.mnt_fstype; + mp->mnt_mntopts = m.mnt_mntopts; + mp->mnt_time = m.mnt_time; + } + + return ret; +} + +#endif // } !defined(sun) +#endif // } !defined(N_PLAT_NLM) diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/misc/random.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/misc/random.c --- open-vm-tools-2008.01.23-74039/lib/misc/random.c 2008-01-28 08:02:51.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/misc/random.c 2008-10-13 08:01:52.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/misc/shared/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/misc/shared/Makefile.am --- open-vm-tools-2008.01.23-74039/lib/misc/shared/Makefile.am 2008-01-28 08:02:49.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/misc/shared/Makefile.am 2008-10-13 08:01:48.000000000 +0100 @@ -18,23 +18,29 @@ noinst_LTLIBRARIES = libMisc.la libMisc_la_SOURCES = +libMisc_la_SOURCES += ../atomic.c libMisc_la_SOURCES += ../base64.c -libMisc_la_SOURCES += ../codeset.c +libMisc_la_SOURCES += ../codesetOld.c libMisc_la_SOURCES += ../dbllnklst.c +libMisc_la_SOURCES += ../dynarray.c libMisc_la_SOURCES += ../dynbuf.c libMisc_la_SOURCES += ../escape.c -libMisc_la_SOURCES += ../hash.c +libMisc_la_SOURCES += ../hashTable.c libMisc_la_SOURCES += ../hostinfo_misc.c libMisc_la_SOURCES += ../hostname.c libMisc_la_SOURCES += ../idLinux.c libMisc_la_SOURCES += ../iovector.c libMisc_la_SOURCES += ../machineID.c libMisc_la_SOURCES += ../miscSolaris.c +libMisc_la_SOURCES += ../posixDlopen.c +libMisc_la_SOURCES += ../posixPosix.c libMisc_la_SOURCES += ../random.c libMisc_la_SOURCES += ../timeutil.c libMisc_la_SOURCES += ../util_misc.c libMisc_la_SOURCES += ../vmstdio.c -AM_CFLAGS = -AM_CFLAGS += @COMMON_CFLAGS@ -AM_CFLAGS += @LIB_MISC_CFLAGS@ +if HAVE_ICU +libMisc_la_SOURCES += ../codeset.c +endif + +AM_CFLAGS = @LIB_MISC_CPPFLAGS@ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/misc/shared/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/misc/shared/Makefile.in --- open-vm-tools-2008.01.23-74039/lib/misc/shared/Makefile.in 2008-01-28 08:03:04.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/misc/shared/Makefile.in 2008-10-13 08:02:14.000000000 +0100 @@ -49,23 +49,35 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ +@HAVE_ICU_TRUE@am__append_1 = ../codeset.c subdir = lib/misc/shared DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +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)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) libMisc_la_LIBADD = -am_libMisc_la_OBJECTS = base64.lo codeset.lo dbllnklst.lo dynbuf.lo \ - escape.lo hash.lo hostinfo_misc.lo hostname.lo idLinux.lo \ - iovector.lo machineID.lo miscSolaris.lo random.lo timeutil.lo \ - util_misc.lo vmstdio.lo +am__libMisc_la_SOURCES_DIST = ../atomic.c ../base64.c ../codesetOld.c \ + ../dbllnklst.c ../dynarray.c ../dynbuf.c ../escape.c \ + ../hashTable.c ../hostinfo_misc.c ../hostname.c ../idLinux.c \ + ../iovector.c ../machineID.c ../miscSolaris.c ../posixDlopen.c \ + ../posixPosix.c ../random.c ../timeutil.c ../util_misc.c \ + ../vmstdio.c ../codeset.c +@HAVE_ICU_TRUE@am__objects_1 = codeset.lo +am_libMisc_la_OBJECTS = atomic.lo base64.lo codesetOld.lo dbllnklst.lo \ + dynarray.lo dynbuf.lo escape.lo hashTable.lo hostinfo_misc.lo \ + hostname.lo idLinux.lo iovector.lo machineID.lo miscSolaris.lo \ + posixDlopen.lo posixPosix.lo random.lo timeutil.lo \ + util_misc.lo vmstdio.lo $(am__objects_1) libMisc_la_OBJECTS = $(am_libMisc_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp +depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -77,7 +89,7 @@ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libMisc_la_SOURCES) -DIST_SOURCES = $(libMisc_la_SOURCES) +DIST_SOURCES = $(am__libMisc_la_SOURCES_DIST) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -91,8 +103,6 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -COMMON_CFLAGS = @COMMON_CFLAGS@ -COMMON_PROG_CFLAGS = @COMMON_PROG_CFLAGS@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -103,45 +113,57 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ -ECHO = @ECHO@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GREP = @GREP@ -GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_AUTH_CFLAGS = @LIB_AUTH_CFLAGS@ -LIB_FILE_CFLAGS = @LIB_FILE_CFLAGS@ -LIB_HGFS_SERVER_CFLAGS = @LIB_HGFS_SERVER_CFLAGS@ -LIB_IMPERSONATE_CFLAGS = @LIB_IMPERSONATE_CFLAGS@ -LIB_MISC_CFLAGS = @LIB_MISC_CFLAGS@ -LIB_PROC_MGR_CFLAGS = @LIB_PROC_MGR_CFLAGS@ -LIB_STRING_CFLAGS = @LIB_STRING_CFLAGS@ -LIB_USER_CFLAGS = @LIB_USER_CFLAGS@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -149,27 +171,35 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ VERSION = @VERSION@ -VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -200,6 +230,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -215,12 +246,13 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libMisc.la -libMisc_la_SOURCES = ../base64.c ../codeset.c ../dbllnklst.c \ - ../dynbuf.c ../escape.c ../hash.c ../hostinfo_misc.c \ - ../hostname.c ../idLinux.c ../iovector.c ../machineID.c \ - ../miscSolaris.c ../random.c ../timeutil.c ../util_misc.c \ - ../vmstdio.c -AM_CFLAGS = @COMMON_CFLAGS@ @LIB_MISC_CFLAGS@ +libMisc_la_SOURCES = ../atomic.c ../base64.c ../codesetOld.c \ + ../dbllnklst.c ../dynarray.c ../dynbuf.c ../escape.c \ + ../hashTable.c ../hostinfo_misc.c ../hostname.c ../idLinux.c \ + ../iovector.c ../machineID.c ../miscSolaris.c ../posixDlopen.c \ + ../posixPosix.c ../random.c ../timeutil.c ../util_misc.c \ + ../vmstdio.c $(am__append_1) +AM_CFLAGS = @LIB_MISC_CPPFLAGS@ all: all-am .SUFFIXES: @@ -272,18 +304,23 @@ distclean-compile: -rm -f *.tab.c +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/atomic.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/base64.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/codeset.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/codesetOld.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbllnklst.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dynarray.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dynbuf.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/escape.Plo@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hash.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hashTable.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hostinfo_misc.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hostname.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/idLinux.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iovector.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/machineID.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/miscSolaris.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/posixDlopen.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/posixPosix.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/random.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timeutil.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util_misc.Plo@am__quote@ @@ -310,6 +347,13 @@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< +atomic.lo: ../atomic.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT atomic.lo -MD -MP -MF $(DEPDIR)/atomic.Tpo -c -o atomic.lo `test -f '../atomic.c' || echo '$(srcdir)/'`../atomic.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/atomic.Tpo $(DEPDIR)/atomic.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../atomic.c' object='atomic.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o atomic.lo `test -f '../atomic.c' || echo '$(srcdir)/'`../atomic.c + base64.lo: ../base64.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT base64.lo -MD -MP -MF $(DEPDIR)/base64.Tpo -c -o base64.lo `test -f '../base64.c' || echo '$(srcdir)/'`../base64.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/base64.Tpo $(DEPDIR)/base64.Plo @@ -317,12 +361,12 @@ @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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o base64.lo `test -f '../base64.c' || echo '$(srcdir)/'`../base64.c -codeset.lo: ../codeset.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT codeset.lo -MD -MP -MF $(DEPDIR)/codeset.Tpo -c -o codeset.lo `test -f '../codeset.c' || echo '$(srcdir)/'`../codeset.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/codeset.Tpo $(DEPDIR)/codeset.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../codeset.c' object='codeset.lo' libtool=yes @AMDEPBACKSLASH@ +codesetOld.lo: ../codesetOld.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT codesetOld.lo -MD -MP -MF $(DEPDIR)/codesetOld.Tpo -c -o codesetOld.lo `test -f '../codesetOld.c' || echo '$(srcdir)/'`../codesetOld.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/codesetOld.Tpo $(DEPDIR)/codesetOld.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../codesetOld.c' object='codesetOld.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o codeset.lo `test -f '../codeset.c' || echo '$(srcdir)/'`../codeset.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o codesetOld.lo `test -f '../codesetOld.c' || echo '$(srcdir)/'`../codesetOld.c dbllnklst.lo: ../dbllnklst.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dbllnklst.lo -MD -MP -MF $(DEPDIR)/dbllnklst.Tpo -c -o dbllnklst.lo `test -f '../dbllnklst.c' || echo '$(srcdir)/'`../dbllnklst.c @@ -331,6 +375,13 @@ @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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dbllnklst.lo `test -f '../dbllnklst.c' || echo '$(srcdir)/'`../dbllnklst.c +dynarray.lo: ../dynarray.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dynarray.lo -MD -MP -MF $(DEPDIR)/dynarray.Tpo -c -o dynarray.lo `test -f '../dynarray.c' || echo '$(srcdir)/'`../dynarray.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/dynarray.Tpo $(DEPDIR)/dynarray.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../dynarray.c' object='dynarray.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dynarray.lo `test -f '../dynarray.c' || echo '$(srcdir)/'`../dynarray.c + dynbuf.lo: ../dynbuf.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dynbuf.lo -MD -MP -MF $(DEPDIR)/dynbuf.Tpo -c -o dynbuf.lo `test -f '../dynbuf.c' || echo '$(srcdir)/'`../dynbuf.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/dynbuf.Tpo $(DEPDIR)/dynbuf.Plo @@ -345,12 +396,12 @@ @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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o escape.lo `test -f '../escape.c' || echo '$(srcdir)/'`../escape.c -hash.lo: ../hash.c -@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT hash.lo -MD -MP -MF $(DEPDIR)/hash.Tpo -c -o hash.lo `test -f '../hash.c' || echo '$(srcdir)/'`../hash.c -@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/hash.Tpo $(DEPDIR)/hash.Plo -@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../hash.c' object='hash.lo' libtool=yes @AMDEPBACKSLASH@ +hashTable.lo: ../hashTable.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT hashTable.lo -MD -MP -MF $(DEPDIR)/hashTable.Tpo -c -o hashTable.lo `test -f '../hashTable.c' || echo '$(srcdir)/'`../hashTable.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/hashTable.Tpo $(DEPDIR)/hashTable.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../hashTable.c' object='hashTable.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o hash.lo `test -f '../hash.c' || echo '$(srcdir)/'`../hash.c +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o hashTable.lo `test -f '../hashTable.c' || echo '$(srcdir)/'`../hashTable.c hostinfo_misc.lo: ../hostinfo_misc.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT hostinfo_misc.lo -MD -MP -MF $(DEPDIR)/hostinfo_misc.Tpo -c -o hostinfo_misc.lo `test -f '../hostinfo_misc.c' || echo '$(srcdir)/'`../hostinfo_misc.c @@ -394,6 +445,20 @@ @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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o miscSolaris.lo `test -f '../miscSolaris.c' || echo '$(srcdir)/'`../miscSolaris.c +posixDlopen.lo: ../posixDlopen.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT posixDlopen.lo -MD -MP -MF $(DEPDIR)/posixDlopen.Tpo -c -o posixDlopen.lo `test -f '../posixDlopen.c' || echo '$(srcdir)/'`../posixDlopen.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/posixDlopen.Tpo $(DEPDIR)/posixDlopen.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../posixDlopen.c' object='posixDlopen.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o posixDlopen.lo `test -f '../posixDlopen.c' || echo '$(srcdir)/'`../posixDlopen.c + +posixPosix.lo: ../posixPosix.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT posixPosix.lo -MD -MP -MF $(DEPDIR)/posixPosix.Tpo -c -o posixPosix.lo `test -f '../posixPosix.c' || echo '$(srcdir)/'`../posixPosix.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/posixPosix.Tpo $(DEPDIR)/posixPosix.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../posixPosix.c' object='posixPosix.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o posixPosix.lo `test -f '../posixPosix.c' || echo '$(srcdir)/'`../posixPosix.c + random.lo: ../random.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT random.lo -MD -MP -MF $(DEPDIR)/random.Tpo -c -o random.lo `test -f '../random.c' || echo '$(srcdir)/'`../random.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/random.Tpo $(DEPDIR)/random.Plo @@ -422,6 +487,13 @@ @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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o vmstdio.lo `test -f '../vmstdio.c' || echo '$(srcdir)/'`../vmstdio.c +codeset.lo: ../codeset.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT codeset.lo -MD -MP -MF $(DEPDIR)/codeset.Tpo -c -o codeset.lo `test -f '../codeset.c' || echo '$(srcdir)/'`../codeset.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/codeset.Tpo $(DEPDIR)/codeset.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../codeset.c' object='codeset.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o codeset.lo `test -f '../codeset.c' || echo '$(srcdir)/'`../codeset.c + mostlyclean-libtool: -rm -f *.lo diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/misc/strutil.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/misc/strutil.c --- open-vm-tools-2008.01.23-74039/lib/misc/strutil.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/misc/strutil.c 2008-10-13 08:01:52.000000000 +0100 @@ -0,0 +1,832 @@ +/********************************************************* + * Copyright (C) 1998 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. + * + *********************************************************/ + +/* + * strutil.c -- + * + * String utility functions. + */ + +#include +#include +#include +#include +#if !defined(_WIN32) && !defined(N_PLAT_NLM) +#include /* For strncasecmp */ +#endif +#include "vmware.h" +#include "strutil.h" +#include "str.h" + + + +/* + *----------------------------------------------------------------------------- + * + * StrUtil_GetNextToken -- + * + * Get the next token from a string after a given index w/o modifying the + * original string. + * + * Results: + * An allocated, NUL-terminated string containing the token. 'index' is + * updated to point after the returned token + * NULL if no tokens are left + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +char * +StrUtil_GetNextToken(unsigned int *index, // IN/OUT: Index to start at + const char *str, // IN : String to parse + const char *delimiters) // IN : Chars separating tokens +{ + unsigned int startIndex; + unsigned int length; + char *token; + + ASSERT(index); + ASSERT(str); + ASSERT(delimiters); + ASSERT(*index <= strlen(str)); + +#define NOT_DELIMITER (Str_Strchr(delimiters, str[*index]) == NULL) + + /* Skip leading delimiters. */ + for (; ; (*index)++) { + if (str[*index] == '\0') { + return NULL; + } + + if (NOT_DELIMITER) { + break; + } + } + startIndex = *index; + + /* + * Walk the string until we reach the end of it, or we find a + * delimiter. + */ + for ((*index)++; str[*index] != '\0' && NOT_DELIMITER; (*index)++) { + } + +#undef NOT_DELIMITER + + length = *index - startIndex; + ASSERT(length); + token = (char *)malloc(length + 1 /* NUL */); + ASSERT_MEM_ALLOC(token); + memcpy(token, str + startIndex, length); + token[length] = '\0'; + + return token; +} + + +/* + *----------------------------------------------------------------------------- + * + * StrUtil_GetNextIntToken -- + * + * Acts like StrUtil_GetNextToken except it returns an int32. + * + * Results: + * TRUE if a valid int was parsed and 'out' contains the parsed int. + * FALSE otherwise. Contents of 'out' are undefined. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +Bool +StrUtil_GetNextIntToken(int32 *out, // OUT : parsed int + unsigned int *index, // IN/OUT: Index to start at + const char *str, // IN : String to parse + const char *delimiters) // IN : Chars separating tokens +{ + char *resultStr; + Bool valid = FALSE; + + ASSERT(out); + ASSERT(index); + ASSERT(str); + ASSERT(delimiters); + + resultStr = StrUtil_GetNextToken(index, str, delimiters); + if (resultStr == NULL) { + return FALSE; + } + + valid = StrUtil_StrToInt(out, resultStr); + free(resultStr); + + return valid; +} + + +/* + *----------------------------------------------------------------------------- + * + * StrUtil_GetNextUintToken -- + * + * Acts like StrUtil_GetNextIntToken except it returns an uint32. + * + * Results: + * TRUE if a valid int was parsed and 'out' contains the parsed int. + * FALSE otherwise. Contents of 'out' are undefined. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +Bool +StrUtil_GetNextUintToken(uint32 *out, // OUT : parsed int + unsigned int *index, // IN/OUT: Index to start at + const char *str, // IN : String to parse + const char *delimiters) // IN : Chars separating tokens +{ + char *resultStr; + Bool valid = FALSE; + + ASSERT(out); + ASSERT(index); + ASSERT(str); + ASSERT(delimiters); + + resultStr = StrUtil_GetNextToken(index, str, delimiters); + if (resultStr == NULL) { + return FALSE; + } + + valid = StrUtil_StrToUint(out, resultStr); + free(resultStr); + + return valid; +} + + +/* + *----------------------------------------------------------------------------- + * + * StrUtil_GetNextInt64Token -- + * + * Acts like StrUtil_GetNextToken except it returns an int64. + * + * Results: + * TRUE on a successful retrieval. FALSE otherwise. + * Token is stored in 'out', which is left undefined in the FALSE case. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +Bool +StrUtil_GetNextInt64Token(int64 *out, // OUT: The output value + unsigned int *index, // IN/OUT: Index to start at + const char *str, // IN : String to parse + const char *delimiters) // IN : Chars separating tokens +{ + char *resultStr; + Bool result; + + ASSERT(out); + ASSERT(index); + ASSERT(str); + ASSERT(delimiters); + + resultStr = StrUtil_GetNextToken(index, str, delimiters); + result = resultStr ? StrUtil_StrToInt64(out, resultStr) : FALSE; + free(resultStr); + + return result; +} + + +/* + *----------------------------------------------------------------------------- + * + * StrUtil_DecimalStrToUint -- + * + * Convert a string into an integer. + * + * Results: + * TRUE if the conversion was successful, and 'out' contains the converted + * result, and 'str' is updated to point to new place after last processed + * digit. + * FALSE otherwise. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +Bool +StrUtil_DecimalStrToUint(unsigned int *out, // OUT + const char **str) // IN/OUT : String to parse +{ + unsigned long val; + char *ptr; + + ASSERT(out); + ASSERT(str); + + errno = 0; + val = strtoul(*str, &ptr, 10); + if (ptr == *str || errno == ERANGE || val != (unsigned int)val) { + return FALSE; + } + *str = ptr; + *out = (unsigned int)val; + return TRUE; +} + + +/* + *----------------------------------------------------------------------------- + * + * StrUtil_StrToInt -- + * + * Convert a string into an integer. + * + * Results: + * TRUE if the conversion was successful and 'out' contains the converted + * result. + * FALSE otherwise. 'out' is undefined. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +Bool +StrUtil_StrToInt(int32 *out, // OUT + const char *str) // IN : String to parse +{ + char *ptr; + long val; + + ASSERT(out); + ASSERT(str); + + errno = 0; + + val = strtol(str, &ptr, 0); + *out = (int32)val; + /* + * Input must be complete, no overflow, and value read must fit into 32 bits - + * both signed and unsigned values are accepted. + */ + return *ptr == '\0' && errno != ERANGE && (val == (int32)val || val == (uint32)val); +} + + +/* + *----------------------------------------------------------------------------- + * + * StrUtil_StrToUint -- + * + * Convert a string into unsigned integer. + * + * Results: + * TRUE if the conversion succeeded and 'out' contains the result. + * FALSE otherwise. 'out' is undefined. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +Bool +StrUtil_StrToUint(uint32 *out, // OUT + const char *str) // IN : String to parse +{ + char *ptr; + unsigned long val; + + ASSERT(out); + ASSERT(str); + + errno = 0; + + val = strtoul(str, &ptr, 0); + *out = (uint32)val; + /* + * Input must be complete, no overflow, and value read must fit into 32 bits - + * both signed and unsigned values are accepted. + */ + return *ptr == '\0' && errno != ERANGE && (val == (uint32)val || val == (int32)val); +} + + +/* + *----------------------------------------------------------------------------- + * + * StrUtil_StrToInt64 -- + * + * Convert a string into a 64bit integer. + * + * Results: + * TRUE if conversion was successful, FALSE otherwise. + * Value is stored in 'out', which is left undefined in the FALSE case. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +Bool +StrUtil_StrToInt64(int64 *out, // OUT: The output value + const char *str) // IN : String to parse +{ + char *ptr; + + ASSERT(out); + ASSERT(str); + + errno = 0; + +#if defined(_WIN32) + *out = _strtoi64(str, &ptr, 0); +#elif defined(__FreeBSD__) + *out = strtoq(str, &ptr, 0); +#elif defined(N_PLAT_NLM) + /* Works for small values of str... */ + *out = (int64)strtol(str, &ptr, 0); +#else + *out = strtoll(str, &ptr, 0); +#endif + + return ptr[0] == '\0' && errno != ERANGE; +} + + +/* + *----------------------------------------------------------------------------- + * + * StrUtil_StrToSizet -- + * + * Convert a string into an unsigned integer that is either 32-bits or + * 64-bits long, depending on the underlying architecture. + * + * Results: + * TRUE if conversion was successful, FALSE otherwise. + * Value is stored in 'out', which is left undefined in the FALSE case. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +Bool +StrUtil_StrToSizet(size_t *out, // OUT: The output value + const char *str) // IN : String to parse +{ + char *ptr; + + ASSERT(out); + ASSERT(str); + + errno = 0; +#if defined VM_X86_64 + ASSERT_ON_COMPILE(sizeof *out == sizeof(uint64)); +# if defined(_WIN32) + *out = _strtoui64(str, &ptr, 0); +# elif defined(__FreeBSD__) + *out = strtouq(str, &ptr, 0); +# elif defined(N_PLAT_NLM) + /* Works for small values of str... */ + *out = strtoul(str, &ptr, 0); +# else + *out = strtoull(str, &ptr, 0); +# endif +#else + ASSERT_ON_COMPILE(sizeof *out == sizeof(uint32)); + *out = strtoul(str, &ptr, 0); +#endif + + return *ptr == '\0' && errno != ERANGE; +} + + +/* + *----------------------------------------------------------------------------- + * + * StrUtil_FormatSizeInBytes -- + * + * Format a size (in bytes) to a string in a user-friendly way. + * + * Example: 160041885696 -> "149.1 GB" + * + * Results: + * The allocated, NUL-terminated string (not localized). + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +char * +StrUtil_FormatSizeInBytesUnlocalized(uint64 size) // IN +{ + /* + * XXX TODO, BUG 199661: + * This is a direct copy of Msg_FormatSizeInBytes without localization. + * These two functions should ideally share the basic functionality, and just + * differ in the string localization + */ + char const *fmt; + double sizeInSelectedUnit; + unsigned int precision; + char *sizeFormat; + char *sizeString; + char *result; + static const double epsilon = 0.01; + double delta; + + if (size >= CONST64U(1) << 40 /* 1 TB */) { + fmt = "%s TB"; + sizeInSelectedUnit = (double)size / (CONST64U(1) << 40); + precision = 1; + } else if (size >= CONST64U(1) << 30 /* 1 GB */) { + fmt = "%s GB"; + sizeInSelectedUnit = (double)size / (CONST64U(1) << 30); + precision = 1; + } else if (size >= CONST64U(1) << 20 /* 1 MB */) { + fmt = "%s MB"; + sizeInSelectedUnit = (double)size / (CONST64U(1) << 20); + precision = 1; + } else if (size >= CONST64U(1) << 10 /* 1 KB */) { + fmt = "%s KB"; + sizeInSelectedUnit = (double)size / (CONST64U(1) << 10); + precision = 1; + } else if (size >= CONST64U(2) /* 2 bytes */) { + fmt = "%s bytes"; + sizeInSelectedUnit = (double)size; + precision = 0; // No fractional byte. + } else if (size >= CONST64U(1) /* 1 byte */) { + fmt = "%s byte"; + sizeInSelectedUnit = (double)size; + precision = 0; // No fractional byte. + } else { + ASSERT(size == CONST64U(0) /* 0 bytes */); + fmt = "%s bytes"; + sizeInSelectedUnit = (double)size; + precision = 0; // No fractional byte. + } + + /* + * We cast to uint32 instead of uint64 here because of a problem with the + * NetWare Tools build. However, it's safe to cast to uint32 since we have + * already reduced the range of sizeInSelectedUnit above. + */ + // If it would display with .0, round it off and display the integer value. + delta = (uint32)(sizeInSelectedUnit + 0.5) - sizeInSelectedUnit; + if (delta < 0) { + delta = -delta; + } + if (delta <= epsilon) { + precision = 0; + sizeInSelectedUnit = (double)(uint32)(sizeInSelectedUnit + 0.5); + } + + sizeFormat = Str_Asprintf(NULL, "%%.%uf", precision); + sizeString = Str_Asprintf(NULL, sizeFormat, sizeInSelectedUnit); + result = Str_Asprintf(NULL, fmt, sizeString); + free(sizeFormat); + free(sizeString); + + return result; +} + + +/* + *---------------------------------------------------------------------- + * + * StrUtil_GetLongestLineLength -- + * + * Given a buffer with one or more lines + * this function computes the length of the + * longest line in a buffer. Input buffer is an array of + * arbitrary bytes (including NUL character), line separator + * is '\n', and is counted in line length. Like: + * "", 0 => 0 + * "\n", 1 => 1 + * "X", 1 => 1 + * "XX\n", 3 => 3 + * "X\nY", 3 => 2 + * "\n\n", 2 => 1 + * + * Results: + * Returns the length of the longest line in the 'buf'. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +size_t +StrUtil_GetLongestLineLength(const char *buf, //IN + size_t bufLength) //IN +{ + size_t longest = 0; + + while (bufLength) { + const char* next; + size_t len; + + next = memchr(buf, '\n', bufLength); + if (next) { + next++; + len = next - buf; + } else { + len = bufLength; + } + if (len > longest) { + longest = len; + } + bufLength -= len; + buf = next; + } + return longest; +} + + +/* + *---------------------------------------------------------------------- + * + * StrUtil_StartsWith -- + * + * Determines if a string starts with another string. + * + * Results: + * TRUE if 's' starts with 'prefix', FALSE otherwise. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +Bool +StrUtil_StartsWith(const char *s, // IN + const char *prefix) // IN +{ + ASSERT(s != NULL); + ASSERT(prefix != NULL); + return Str_Strncmp(s, prefix, strlen(prefix)) == 0; +} + + +/* + *---------------------------------------------------------------------- + * + * StrUtil_CaselessStartsWith -- + * + * A case-insensitive version of StrUtil_StartsWith. + * + * Results: + * TRUE if 's' starts with 'prefix', FALSE otherwise. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +Bool +StrUtil_CaselessStartsWith(const char *s, // IN + const char *prefix) // IN +{ + ASSERT(s != NULL); + ASSERT(prefix != NULL); + return Str_Strncasecmp(s, prefix, strlen(prefix)) == 0; +} + + +/* + *----------------------------------------------------------------------------- + * + * StrUtil_EndsWith -- + * + * Detects if a string ends with another string. + * + * Results: + * TRUE if string 'suffix' is found at the end of string 's', FALSE otherwise. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +Bool +StrUtil_EndsWith(const char *s, // IN + const char *suffix) // IN +{ + size_t slen; + size_t suffixlen; + + ASSERT(s); + ASSERT(suffix); + + slen = strlen(s); + suffixlen = strlen(suffix); + + if (suffixlen > slen) { + return FALSE; + } + + return strcmp(s + slen - suffixlen, suffix) == 0; +} + + +/* + *----------------------------------------------------------------------------- + * + * StrUtil_VDynBufPrintf -- + * + * This is a vprintf() variant which appends directly into a + * dynbuf. The dynbuf is not NUL-terminated: The printf() result + * is written immediately after the last byte in the DynBuf. + * + * This function does not use any temporary buffer. The printf() + * result can be arbitrarily large. This function automatically + * grows the DynBuf as necessary. + * + * Results: + * TRUE on success, FALSE on memory allocation failure. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +Bool +StrUtil_VDynBufPrintf(DynBuf *b, // IN/OUT + const char *fmt, // IN + va_list args) // IN +{ + /* + * Arbitrary lower-limit on buffer size allocation, to avoid doing + * many tiny enlarge operations. + */ + const size_t minAllocSize = 128; + + while (1) { + int i; + size_t size = DynBuf_GetSize(b); + size_t allocSize = DynBuf_GetAllocatedSize(b); + + /* Make sure the buffer isn't still unallocated */ + if (allocSize < minAllocSize) { + Bool success = DynBuf_Enlarge(b, minAllocSize); + if (!success) { + return FALSE; + } + continue; + } + + /* + * Is there any allocated-but-not-occupied space? If so, + * try the printf. If there was no space to begin with, or + * Str_Vsnprintf() ran out of space, this will fail. + * + * Note that we don't need to copy the argument list, it's + * okay to iterate over the same va_list multiple times. + * Str_Vsnprintf() already does a va_copy on platforms that + * need it. + */ + + if (allocSize - size > 0) { + i = Str_Vsnprintf((char*)DynBuf_Get(b) + size, allocSize - size, fmt, args); + } else { + i = -1; + } + + if (i >= 0) { + /* + * Success. Enlarge the buffer. + * + * The ASSERT here is to verify that printf() isn't lying + * about the length of the string it wrote. This actually + * happens, believe it or not. See bug 253674. + */ + + ASSERT(i + size == allocSize || ((char*)DynBuf_Get(b))[i + size] == '\0'); + DynBuf_SetSize(b, size + i); + break; + + } else { + /* + * Failure. We must grow the buffer first. Note that this is + * just a minimum size- dynbuf will probably decide to double + * the actual reallocated buffer size. + */ + + Bool success = DynBuf_Enlarge(b, size + minAllocSize); + if (!success) { + return FALSE; + } + } + } + + return TRUE; +} + + +/* + *----------------------------------------------------------------------------- + * + * StrUtil_DynBufPrintf -- + * + * A StrUtil_VDynBufPrintf() wrapper which takes a variadic argument list. + * + * Results: + * TRUE on success, FALSE on memory allocation failure. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +Bool +StrUtil_DynBufPrintf(DynBuf *b, // IN/OUT + const char *fmt, // IN + ...) // IN +{ + va_list args; + Bool success; + + va_start(args, fmt); + success = StrUtil_VDynBufPrintf(b, fmt, args); + va_end(args); + + return success; +} + + +/* + *----------------------------------------------------------------------------- + * + * StrUtil_SafeDynBufPrintf -- + * + * A 'safe' variant of StrUtil_SafeDynBufPrintf(), which catches + * memory allocation failures and panics. + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +void +StrUtil_SafeDynBufPrintf(DynBuf *b, // IN/OUT + const char *fmt, // IN + ...) // IN +{ + va_list args; + Bool success; + + va_start(args, fmt); + success = StrUtil_VDynBufPrintf(b, fmt, args); + va_end(args); + + ASSERT_MEM_ALLOC(success); +} diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/misc/timeutil.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/misc/timeutil.c --- open-vm-tools-2008.01.23-74039/lib/misc/timeutil.c 2008-01-28 08:02:51.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/misc/timeutil.c 2008-10-13 08:01:52.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -27,11 +27,13 @@ #if defined(N_PLAT_NLM) # include +# include #elif defined(_WIN32) # include #else # include #endif +#include #include "vmware.h" /* For HARD_EXPIRE --hpreg */ @@ -40,6 +42,10 @@ #include "timeutil.h" #include "str.h" #include "util.h" +#ifdef _WIN32 +#include "win32u.h" +#endif + /* * NT time of the Unix epoch: @@ -53,6 +59,352 @@ */ #define UNIX_S32_MAX (UNIX_EPOCH + (uint64)0x80000000 * 10000000) +/* + * Days in month defines. The month is 1 - 12. + * Notice that there are 28 days in february. It will updated for leap year + * as necessary by the function using this defines. + */ +#define DAYS_IN_MONTH { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 } + + +/* + * Local Definitions + */ + +static void TimeUtilInit(TimeUtil_Date *d); +static Bool TimeUtilLoadDate(TimeUtil_Date *d, const char *date); +static Bool TimeUtilIsLeapYear(unsigned int year); +static Bool TimeUtilIsValidDate(unsigned int year, unsigned int month, unsigned int day); + + +/* + * Function to guess Windows TZ Index by using time offset in + * a lookup table + */ +static int TimeUtilFindIndexByUTCOffset(int utcToStdOffsetMins); + +#if defined(_WIN32) +/* + * Function to find Windows TZ Index by scanning registry + */ +static int Win32TimeUtilLookupZoneIndex(const char* targetName); +#endif + + +/* + * Local substitution for localtime_r() for those platforms + * that don't have one. + */ +#ifdef SOL9 +#include +static mutex_t LT_MUTEX = DEFAULTMUTEX; +static struct tm* localtime_r(time_t* secs, struct tm* tp) +{ + if (!secs || !tp) { + return NULL; + } + mutex_lock(<_MUTEX); + memcpy(tp, localtime(secs), sizeof *tp); + mutex_unlock(<_MUTEX); + return tp; +} +#endif + + +/* + *---------------------------------------------------------------------- + * + * TimeUtil_MakeTime -- + * + * Converts a TimeUtil_Date to a time_t. + * + * Results: + * A time_t. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +time_t +TimeUtil_MakeTime(const TimeUtil_Date *d) // IN +{ + struct tm t; + + ASSERT(d != NULL); + + memset(&t, 0, sizeof t); + + t.tm_mday = d->day; + t.tm_mon = d->month - 1; + t.tm_year = d->year - 1900; + + t.tm_sec = d->second; + t.tm_min = d->minute; + t.tm_hour = d->hour; + t.tm_isdst = -1; /* Unknown. */ + + return mktime(&t); +} + + +/* + *---------------------------------------------------------------------- + * + * TimeUtil_StringToDate -- + * + * Initialize the date object with value from the string argument, + * while the time will be left unmodified. + * The string 'date' needs to be in the format of 'YYYYMMDD' or + * 'YYYY/MM/DD' or 'YYYY-MM-DD'. + * Unsuccesful initialization will leave the 'd' argument unmodified. + * + * Results: + * TRUE or FALSE. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +Bool +TimeUtil_StringToDate(TimeUtil_Date *d, // IN/OUT + char const *date) // IN +{ + /* + * Reduce the string to a known and handled format: YYYYMMDD. + * Then, passed to internal function TimeUtilLoadDate. + */ + if (strlen(date) == 8) { + /* 'YYYYMMDD' */ + return TimeUtilLoadDate(d, date); + } else if (strlen(date) == 10) { + /* 'YYYY/MM/DD' */ + char temp[16] = { 0 }; + + if (!(((date[4] != '/') || (date[7] != '/')) || + ((date[4] != '-') || (date[7] != '-')))) { + return FALSE; + } + + Str_Strcpy(temp, date, sizeof(temp)); + temp[4] = date[5]; + temp[5] = date[6]; + temp[6] = date[8]; + temp[7] = date[9]; + temp[8] = '\0'; + + return TimeUtilLoadDate(d, temp); + } else { + return FALSE; + } +} + + +/* + *---------------------------------------------------------------------- + * + * TimeUtil_DeltaDays -- + * + * Calculate the number of days between the two date arguments. + * This function ignores the time. It will be as if the time + * is midnight (00:00:00). + * + * Results: + * number of days: + * - 0 (if 'left' and 'right' are of the same date (ignoring the time). + * - negative, if 'left' is of a later date than 'right' + * - positive, if 'right' is of a later date than 'left' + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +int +TimeUtil_DeltaDays(TimeUtil_Date const *left, // IN + TimeUtil_Date const *right) // IN +{ + TimeUtil_Date temp1; + TimeUtil_Date temp2; + TimeUtil_Date temp; + + int days = 0; + Bool inverted = FALSE; + + ASSERT(left); + ASSERT(right); + ASSERT(TimeUtilIsValidDate(left->year, left->month, left->day)); + ASSERT(TimeUtilIsValidDate(right->year, right->month, right->day)); + + TimeUtilInit(&temp1); + TimeUtilInit(&temp2); + TimeUtilInit(&temp); + + temp1.year = left->year; + temp1.month = left->month; + temp1.day = left->day; + temp2.year = right->year; + temp2.month = right->month; + temp2.day = right->day; + + if (!TimeUtil_DateLowerThan(&temp1, &temp2) && + !TimeUtil_DateLowerThan(&temp2, &temp1)) { + return 0; + } else if (TimeUtil_DateLowerThan(&temp1, &temp2)) { + inverted = FALSE; + } else if (TimeUtil_DateLowerThan(&temp2, &temp1)) { + inverted = TRUE; + temp = temp1; + temp1 = temp2; + temp2 = temp; + } + + days = 1; + TimeUtil_DaysAdd(&temp1, 1); + while (TimeUtil_DateLowerThan(&temp1, &temp2)) { + days++; + TimeUtil_DaysAdd(&temp1, 1); + } + + if (inverted) { + return -days; + } else { + return days; + } +} + + +/* + *---------------------------------------------------------------------- + * + * TimeUtil_DaysSubtract -- + * + * Subtracts 'nr' days from 'd'. + * + * Simple algorithm - which can be improved as necessary: + * - get rough days estimation, also guarantee that the estimation is + * lower than the actual result. + * - 'add' a day-by-day to arrive at actual result. + * 'd' will be unchanged if the function failed. + * + * TODO: + * This function can be combined with DaysAdd(), where it + * accepts integer (positive for addition, negative for subtraction). + * But, that cannot be done without changing the DaysAdd function + * signature. + * When this utility get rewritten, this can be updated. + * + * Results: + * TRUE or FALSE. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +Bool +TimeUtil_DaysSubtract(TimeUtil_Date *d, // IN/OUT + unsigned int nr) // IN +{ + TimeUtil_Date temp; + int subYear = 0; + int subMonth = 0; + int subDay = 0; + + TimeUtil_Date estRes; + int estYear = 0; + int estMonth = 0; + int estDay = 0; + + unsigned int dayCount = nr; + + ASSERT(d); + + TimeUtilInit(&temp); + TimeUtilInit(&estRes); + + /* + * Use lower bound for the following conversion: + * 365 (instead of 366) days in a year + * 30 (instead of 31) days in a month. + * + * To account for February having fewer than 30 days, we will + * intentionally subtract an additional 2 days for each year + * and an additional 3 days. + */ + dayCount = dayCount + 3 + 2 * (dayCount / 365); + + subYear = dayCount / 365; + dayCount = dayCount % 365; + subMonth = dayCount / 30; + subDay = dayCount % 30; + + estDay = d->day - subDay; + while (estDay <= 0) { + estDay = estDay + 30; + subMonth++; + } + estMonth = d->month - subMonth; + while (estMonth <= 0) { + estMonth = estMonth + 12; + subYear++; + } + estYear = d->year - subYear; + if (estYear <= 0) { + return FALSE; + } + + /* + * making sure on the valid range, without checking + * for leap year, etc. + */ + if ((estDay > 28) && (estMonth == 2)) { + estDay = 28; + } + + estRes.year = estYear; + estRes.month = estMonth; + estRes.day = estDay; + + /* + * we also copy the time from the original argument in making + * sure that it does not play role in the comparison. + */ + estRes.hour = d->hour; + estRes.minute = d->minute; + estRes.second = d->second; + + /* + * At this point, we should have an estimated result which + * guaranteed to be lower than the actual result. Otherwise, + * infinite loop will happen. + */ + ASSERT(TimeUtil_DateLowerThan(&estRes, d)); + + /* + * Perform the actual precise adjustment + * Done by moving up (moving forward) the estimated a day at a time + * until they are the correct one (i.e. estDate + arg #day = arg date) + */ + temp = estRes; + TimeUtil_DaysAdd(&temp, nr); + while (TimeUtil_DateLowerThan(&temp, d)) { + TimeUtil_DaysAdd(&temp, 1); + TimeUtil_DaysAdd(&estRes, 1); + } + + d->year = estRes.year; + d->month = estRes.month; + d->day = estRes.day; + + return TRUE; +} + /* *---------------------------------------------------------------------- @@ -75,18 +427,14 @@ TimeUtil_DaysAdd(TimeUtil_Date *d, // IN/OUT unsigned int nr) // IN { - static unsigned int monthdays[13] = { 0, - 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; + static unsigned int monthdays[13] = DAYS_IN_MONTH; unsigned int i; /* * Initialize the table */ - if ( (d->year % 4) == 0 - && ( (d->year % 100) != 0 - || (d->year % 400) == 0)) { - /* Leap year */ + if (TimeUtilIsLeapYear(d->year)) { monthdays[2] = 29; } else { monthdays[2] = 28; @@ -109,10 +457,7 @@ * Update the table */ - if ( (d->year % 4) == 0 - && ( (d->year % 100) != 0 - || (d->year % 400) == 0)) { - /* Leap year */ + if (TimeUtilIsLeapYear(d->year)) { monthdays[2] = 29; } else { monthdays[2] = 28; @@ -436,8 +781,8 @@ { #ifdef _WIN32 SYSTEMTIME systemTime = { 0 }; - TCHAR dateStr[100]; - TCHAR timeStr[100]; + char dateStr[100] = ""; + char timeStr[100] = ""; if (!showDate && !showTime) { return NULL; @@ -447,11 +792,11 @@ return NULL; } - GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, - &systemTime, NULL, dateStr, ARRAYSIZE(dateStr)); + Win32U_GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, + &systemTime, NULL, dateStr, ARRAYSIZE(dateStr)); - GetTimeFormat(LOCALE_USER_DEFAULT, 0, &systemTime, NULL, - timeStr, ARRAYSIZE(timeStr)); + Win32U_GetTimeFormat(LOCALE_USER_DEFAULT, 0, &systemTime, NULL, + timeStr, ARRAYSIZE(timeStr)); if (showDate && showTime) { return Str_Asprintf(NULL, "%s %s", dateStr, timeStr); @@ -623,3 +968,514 @@ return TRUE; } #endif // _WIN32 + + +/* + *---------------------------------------------------------------------- + * + * TimeUtil_GetLocalWindowsTimeZoneIndex -- + * + * Gets Windows TZ index for local time zone. + * + * Results: + * -1 if there is any error, else the Windows Time Zone ID of the + * current timezone (non-negative value). + * + * Side effects: + * On non-Win32 platforms, calls localtime_r() which sets globals + * variables (e.g. 'timezone' and 'tzname' for Linux) + * + *---------------------------------------------------------------------- + */ +int +TimeUtil_GetLocalWindowsTimeZoneIndex(void) +{ + int utcStdOffMins = 0; + int winTimeZoneIndex = (-1); + +#if defined(_WIN32) + + TIME_ZONE_INFORMATION tz; + char name[256] = { 0 }; + size_t nameLen = 0, nc = 0; + if (GetTimeZoneInformation(&tz) == TIME_ZONE_ID_INVALID) { + return (-1); + } + + /* 'Bias' = diff between UTC and local standard time */ + utcStdOffMins = 0-tz.Bias; // already in minutes + + /* Get TZ name */ + nameLen = wcslen(tz.StandardName); + if (wcstombs(name, tz.StandardName, 255) <= 0) { + return (-1); + } + + /* Convert name to Windows TZ index */ + winTimeZoneIndex = Win32TimeUtilLookupZoneIndex(name); + +#else // NOT _WIN32 + + /* + * Use localtime_r() to get offset between our local + * time and UTC. This varies by platform. Also, the structure + * fields are named "*gmt*" but the man pages claim offsets are + * to UTC, not GMT. + */ + + time_t now = time(NULL); + struct tm tim; + localtime_r(&now, &tim); + + #if defined SOL9 || defined SOL10 || defined N_PLAT_NLM + /* + * Offset is to standard (no need for DST adjustment). + * Negative is east of prime meridian. + */ + utcStdOffMins = 0 - timezone/60; + #else + /* + * FreeBSD, Apple, Linux only: + * Offset is to local (need to adjust for DST). + * Negative is west of prime meridian. + */ + utcStdOffMins = tim.tm_gmtoff/60; + if (tim.tm_isdst) { + utcStdOffMins -= 60; + } + #endif + + /* can't figure this out directly for non-Win32 */ + winTimeZoneIndex = (-1); + +#endif + + /* If we don't have it yet, look up windowsCode. */ + if (winTimeZoneIndex < 0) { + winTimeZoneIndex = TimeUtilFindIndexByUTCOffset(utcStdOffMins); + } + + return winTimeZoneIndex; +} + + +/* + *********************************************************************** + * + * Local Functions + * + *********************************************************************** + */ + +/* + *---------------------------------------------------------------------- + * + * TimeUtilInit -- + * + * Initialize everything to zero + * + * Results: + * None + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +static void +TimeUtilInit(TimeUtil_Date *d) +{ + ASSERT(d); + + d->year = 0; + d->month = 0; + d->day = 0; + d->hour = 0; + d->minute = 0; + d->second = 0; + + return; +} + + +/* + *---------------------------------------------------------------------- + * + * TimeUtilIsValidDate -- + * + * Check whether the args represent a valid date. + * + * Results: + * TRUE or FALSE. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +static Bool +TimeUtilIsValidDate(unsigned int year, // IN + unsigned int month, // IN + unsigned int day) // IN +{ + static unsigned int monthdays[13] = DAYS_IN_MONTH; + + /* + * Initialize the table + */ + if (TimeUtilIsLeapYear(year)) { + monthdays[2] = 29; + } else { + monthdays[2] = 28; + } + + if ((year >= 1) && + (month >= 1) && (month <= 12) && + (day >= 1) && (day <= monthdays[month])) { + return TRUE; + } + + return FALSE; +} + + +/* + *---------------------------------------------------------------------- + * + * TimeUtilIsLeapYear -- + * + * Check whether the argument represents a leap year. + * + * Results: + * TRUE or FALSE. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +static Bool +TimeUtilIsLeapYear(unsigned int year) // IN +{ + if ((year % 4) == 0 && + ((year % 100) != 0 || + (year % 400) == 0)) { + return TRUE; + } + + return FALSE; +} + + +/* + *---------------------------------------------------------------------- + * + * TimeUtilLoadDate -- + * + * Initialize the date object with value from the string argument, + * while the time will be left unmodified. + * The string 'date' needs to be in the format of 'YYYYMMDD'. + * Unsuccesful initialization will leave the 'd' argument unmodified. + * + * Results: + * TRUE or FALSE. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +static Bool +TimeUtilLoadDate(TimeUtil_Date *d, // IN/OUT + const char *date) // IN +{ + char temp[16] = { 0 }; + int i = 0; + char *end = NULL; + + int32 year = 0; + int32 month = 0; + int32 day = 0; + + ASSERT(d); + ASSERT(date); + + if (strlen(date) != 8) { + return FALSE; + } + for (i = 0; i < strlen(date); i++) { + if (isdigit((int) date[i]) == 0) { + return FALSE; + } + } + + temp[0] = date[0]; + temp[1] = date[1]; + temp[2] = date[2]; + temp[3] = date[3]; + temp[4] = '\0'; + year = strtol(temp, &end, 10); + if (*end != '\0') { + return FALSE; + } + + temp[0] = date[4]; + temp[1] = date[5]; + temp[2] = '\0'; + month = strtol(temp, &end, 10); + if (*end != '\0') { + return FALSE; + } + + temp[0] = date[6]; + temp[1] = date[7]; + temp[2] = '\0'; + day = strtol(temp, &end, 10); + if (*end != '\0') { + return FALSE; + } + + if (!TimeUtilIsValidDate((unsigned int) year, (unsigned int) month, (unsigned int) day)) { + return FALSE; + } + + d->year = (unsigned int) year; + d->month = (unsigned int) month; + d->day = (unsigned int) day; + + return TRUE; +} + + +/* + *---------------------------------------------------------------------- + * + * TimeUtilFindIndexByUTCOffset -- + * + * Private function. Scans a table for a given UTC-to-Standard + * offset and returns the Windows TZ Index of the first match + * found. + * + * Parameters: + * utcStdOffMins Offset to look for (in minutes) + * <0 is west of PM, >0 is east of PM. + * + * Results: + * Returns Windows TZ Index (>=0) if found, else -1. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ +static int TimeUtilFindIndexByUTCOffset(int utcStdOffMins) +{ + static struct _tzinfo { + int winTzIndex; + int utcStdOffMins; + } TABLE[] = { + { 0, /* "Dateline Standard Time",*/ -720 }, // -12 + { 1, /* "Samoa Standard Time",*/ -660 }, // -11 + { 2, /* "Hawaiian Standard Time",*/ -600 }, // -10 + { 3, /* "Alaskan Standard Time",*/ -540 }, // -9 + { 4, /* "Pacific Standard Time",*/ -480 }, // -8 + { 10, /* "Mountain Standard Time",*/ -420 }, // -7 + { 13, /* "Mexico Standard Time 2",*/ -420 }, // -7 + { 15, /* "U.S. Mountain Standard Time",*/ -420 }, // -7 + { 20, /* "Central Standard Time",*/ -360 }, // -6 + { 25, /* "Canada Central Standard Time",*/ -360 }, // -6 + { 30, /* "Mexico Standard Time",*/ -360 }, // -6 + { 33, /* "Central America Standard Time",*/ -360 }, // -6 + { 35, /* "Eastern Standard Time",*/ -300 }, // -5 + { 40, /* "U.S. Eastern Standard Time",*/ -300 }, // -5 + { 45, /* "S.A. Pacific Standard Time",*/ -300 }, // -5 + { 50, /* "Atlantic Standard Time",*/ -240 }, // -4 + { 55, /* "S.A. Western Standard Time",*/ -240 }, // -4 + { 56, /* "Pacific S.A. Standard Time",*/ -240 }, // -4 + { 60, /* "Newfoundland Standard Time",*/ -210 }, // -3.5 + { 65, /* "E. South America Standard Time",*/-180 }, // -3 + { 70, /* "S.A. Eastern Standard Time",*/ -180 }, // -3 + { 73, /* "Greenland Standard Time",*/ -180 }, // -3 + { 75, /* "Mid-Atlantic Standard Time",*/ -120 }, // -2 + { 80, /* "Azores Standard Time",*/ -60 }, // -1 + { 83, /* "Cape Verde Standard Time",*/ -60 }, // -1 + { 85, /* "GMT Standard Time",*/ 0 }, // 0 + { 90, /* "Greenwich Standard Time",*/ 0 }, // 0 + { 95, /* "Central Europe Standard Time",*/ 60 }, // +1 + { 100, /* "Central European Standard Time",*/ 60 }, // +1 + { 105, /* "Romance Standard Time",*/ 60 }, // +1 + { 110, /* "W. Europe Standard Time",*/ 60 }, // +1 + { 113, /* "W. Central Africa Standard Time",*/ 60 }, // +1 + { 115, /* "E. Europe Standard Time",*/ 120 }, // +2 + { 120, /* "Egypt Standard Time",*/ 120 }, // +2 + { 125, /* "FLE Standard Time",*/ 120 }, // +2 + { 130, /* "GTB Standard Time",*/ 120 }, // +2 + { 135, /* "Israel Standard Time",*/ 120 }, // +2 + { 140, /* "South Africa Standard Time",*/ 120 }, // +2 + { 145, /* "Russian Standard Time",*/ 180 }, // +3 + { 150, /* "Arab Standard Time",*/ 180 }, // +3 + { 155, /* "E. Africa Standard Time",*/ 180 }, // +3 + { 158, /* "Arabic Standard Time",*/ 180 }, // +3 + { 160, /* "Iran Standard Time",*/ 210 }, // +3.5 + { 165, /* "Arabian Standard Time",*/ 240 }, // +4 + { 170, /* "Caucasus Standard Time",*/ 240 }, // +4 + { 175, /* "Afghanistan Standard Time",*/ 270 }, // +4.5 + { 180, /* "Ekaterinburg Standard Time",*/ 300 }, // +5 + { 185, /* "West Asia Standard Time",*/ 300 }, // +5 + { 190, /* "India Standard Time",*/ 330 }, // +5.5 + { 193, /* "Nepal Standard Time",*/ 345 }, // +5.75 + { 195, /* "Central Asia Standard Time",*/ 360 }, // +6 + { 200, /* "Sri Lanka Standard Time",*/ 360 }, // +6 + { 201, /* "N. Central Asia Standard Time",*/ 360 }, // +6 + { 203, /* "Myanmar Standard Time",*/ 390 }, // +6.5 + { 205, /* "S.E. Asia Standard Time",*/ 420 }, // +7 + { 207, /* "North Asia Standard Time",*/ 420 }, // +7 + { 210, /* "China Standard Time",*/ 480 }, // +8 + { 215, /* "Singapore Standard Time",*/ 480 }, // +8 + { 220, /* "Taipei Standard Time",*/ 480 }, // +8 + { 225, /* "W. Australia Standard Time",*/ 480 }, // +8 + { 227, /* "North Asia East Standard Time",*/ 480 }, // +8 + { 230, /* "Korea Standard Time",*/ 540 }, // +9 + { 235, /* "Tokyo Standard Time",*/ 540 }, // +9 + { 240, /* "Yakutsk Standard Time",*/ 540 }, // +9 + { 245, /* "A.U.S. Central Standard Time",*/ 570 }, // +9.5 + { 250, /* "Cen. Australia Standard Time",*/ 570 }, // +9.5 + { 255, /* "A.U.S. Eastern Standard Time",*/ 600 }, // +10 + { 260, /* "E. Australia Standard Time",*/ 600 }, // +10 + { 265, /* "Tasmania Standard Time",*/ 600 }, // +10 + { 270, /* "Vladivostok Standard Time",*/ 600 }, // +10 + { 275, /* "West Pacific Standard Time",*/ 600 }, // +10 + { 280, /* "Central Pacific Standard Time",*/ 660 }, // +11 + { 285, /* "Fiji Islands Standard Time",*/ 720 }, // +12 + { 290, /* "New Zealand Standard Time",*/ 720 }, // +12 + { 300, /* "Tonga Standard Time",*/ 780 }};// +13 + + int tableSize = sizeof(TABLE) / sizeof(TABLE[0]); + int look; + int tzIndex = (-1); + + /* XXX Finds the first match, not necessariy the right match! */ + for (look = 0; look < tableSize && tzIndex < 0; look++) { + if (TABLE[look].utcStdOffMins == utcStdOffMins) { + tzIndex = TABLE[look].winTzIndex; + } + } + + return tzIndex; +} + + +#ifdef _WIN32 +/* + *---------------------------------------------------------------------- + * + * Win32TimeUtilLookupZoneIndex -- + * + * Private function. Gets current Std time zone name using Windows + * API, then scans the registry to find the information about that zone, + * and extracts the TZ Index. + * + * Parameters: + * targetName Standard-time zone name to look for. + * + * Results: + * Returns Windows TZ Index (>=0) if found. + * Returns -1 if not found or if any error was encountered. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ +static int Win32TimeUtilLookupZoneIndex(const char* targetName) +{ + int timeZoneIndex = (-1); + HKEY parentKey, childKey; + char childKeyName[255]; + int keyIndex, childKeyLen=255; + DWORD rv; + + /* Open parent key containing timezone child keys */ + if (Win32U_RegOpenKeyEx(HKEY_LOCAL_MACHINE, + "SOFTWARE\\" + "Microsoft\\" + "Windows NT\\" + "CurrentVersion\\" + "Time Zones", + 0, + KEY_READ, + &parentKey) != ERROR_SUCCESS) { + /* Failed to open registry */ + return (-1); + } + + /* Scan child keys, stopping if name is found */ + keyIndex = 0; + while ( + timeZoneIndex < 0 && + Win32U_RegEnumKeyEx(parentKey, + keyIndex, + childKeyName, + &childKeyLen, + 0,0,0,0) == ERROR_SUCCESS) { + + char* std; + DWORD stdSize; + + /* Open child key */ + rv = Win32U_RegOpenKeyEx(parentKey, childKeyName, 0, KEY_READ, &childKey); + if (rv != ERROR_SUCCESS) { + continue; + } + + /* Get size of "Std" value */ + if (Win32U_RegQueryValueEx(childKey, + "Std", 0, 0, + NULL, &stdSize) == ERROR_SUCCESS) { + + /* Get value of "Std" */ + std = (char*) calloc(stdSize+1, sizeof(char)); + if (std != NULL) { + if (Win32U_RegQueryValueEx(childKey, + "Std", 0, 0, + (LPBYTE) std, &stdSize) == ERROR_SUCCESS) { + + /* Make sure there is at least one EOS */ + std[stdSize] = '\0'; + + /* Is this the name we want? */ + if (!strcmp(std, targetName)) { + + /* yes: look up value of "Index" */ + DWORD val = 0; + DWORD valSize = sizeof(val); + if (Win32U_RegQueryValueEx(childKey, + "Index", 0, 0, + (LPBYTE) &val, + &valSize) == ERROR_SUCCESS) { + timeZoneIndex = val; + } + } + } + free(std); + } + } + + /* close this child key */ + RegCloseKey(childKey); + + /* reset for next child key */ + childKeyLen = 255; + keyIndex++; + } + + /* Close registry parent key */ + RegCloseKey(parentKey); + + return timeZoneIndex; +} +#endif // _WIN32 diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/misc/util_misc.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/misc/util_misc.c --- open-vm-tools-2008.01.23-74039/lib/misc/util_misc.c 2008-01-28 08:02:51.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/misc/util_misc.c 2008-10-13 08:01:52.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -26,7 +26,6 @@ #include // also includes windows.h #include #include -#include "win32util.h" #endif #include "vm_ctype.h" @@ -40,17 +39,39 @@ #include #include +#if !defined(_WIN32) && !defined(N_PLAT_NLM) +# if defined(linux) +# include // for SYS_gettid +# endif +# include +# include +#endif + +#if defined(__APPLE__) || defined(__FreeBSD__) +#include +#endif + #include "vmware.h" #include "msg.h" #include "util.h" #include "str.h" -#include "file.h" /* For HARD_EXPIRE --hpreg */ #include "vm_version.h" #include "su.h" #include "escape.h" -#include "hostType.h" +#include "posix.h" +#if defined(_WIN32) +#include "win32u.h" +#include "win32util.h" +#endif +/* + * ESX with userworld VMX + */ +#if defined(VMX86_SERVER) +#include "hostType.h" +#include "user_layout.h" +#endif /* *----------------------------------------------------------------------------- @@ -73,12 +94,7 @@ { char *canonicalPath = NULL; #if defined(__linux__) || defined(__APPLE__) - char longpath[PATH_MAX]; - - if (realpath(path, longpath) == NULL) { - return NULL; - } - canonicalPath = strdup(longpath); + canonicalPath = Posix_RealPath(path); #elif defined(_WIN32) char driveSpec[4]; Bool remoteDrive = FALSE; @@ -108,7 +124,7 @@ if (remoteDrive) { canonicalPath = strdup(path); } else { - canonicalPath = W32Util_GetLongPathName(path); + canonicalPath = W32Util_RobustGetLongPath(path); } #else @@ -122,13 +138,98 @@ /* *----------------------------------------------------------------------------- * - * Util_GetLowerCaseCanonicalPath -- + * Util_GetCanonicalPathForHash -- * * Utility function to both get the canonical version of the input path - * and lower case it at the same time. + * and produce a unique case-insensitive version of the path suitable + * for use as a seed to hash functions. + * + * Results: + * Canonicalized UTF-8 pathname suitable for use in hashing. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +char * +Util_GetCanonicalPathForHash(const char *path) // IN: UTF-8 +{ + char *ret = NULL; + char *cpath = Util_GetCanonicalPath(path); + + if (cpath != NULL) { + ret = Unicode_FoldCase(cpath); + free(cpath); + } + + return ret; +} + + +/* + *----------------------------------------------------------------------------- + * + * UtilGetLegacyEncodedString -- + * + * Takes a UTF-8 string, and allocates a new string in legacy encoding. + * This is necessary to maintain compatibility with older versions of + * the product, which may have stored strings (paths) in legacy + * encoding. Hence, the use of WideCharToMultiByte(). + * + * Results: + * An allocated string in legacy encoding (MBCS when applicable). + * NULL on failure. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static char* +UtilGetLegacyEncodedString(const char *path) // IN: UTF-8 +{ + char *ret = NULL; + char *cpath = Util_GetCanonicalPath(path); + + if (cpath != NULL) { + char *apath = NULL; + int retlen; + WCHAR *wcpath = Unicode_GetAllocUTF16(cpath); + + /* First get the length of multibyte string */ + int alen = WideCharToMultiByte(CP_ACP, WC_COMPOSITECHECK, wcpath, -1, + NULL, 0, NULL, NULL); + if (alen > 0) { + /* Now get the converted string */ + ret = Util_SafeMalloc(alen); + retlen = WideCharToMultiByte(CP_ACP, WC_COMPOSITECHECK, wcpath, -1, + ret, alen, NULL, NULL); + if (retlen != alen) { + free(ret); + ret = NULL; + } + } + free(cpath); + free(wcpath); + } + + return ret; +} + + +/* + *----------------------------------------------------------------------------- + * + * Util_CompatGetCanonicalPath -- + * + * Canonicalizes a path name (compatibility version). * * Results: - * A lower case freshly allocated canonicalized path name. + * A freshly allocated canonicalized path name in legacy encoding + * (MBCS when applicable). * * Side effects: * None. @@ -137,12 +238,16 @@ */ char* -Util_GetLowerCaseCanonicalPath(const char* path) // IN +Util_CompatGetCanonicalPath(const char *path) // IN: UTF-8 { - char *ret = Util_GetCanonicalPath(path); - if (ret != NULL) { - ret = _strlwr(ret); + char *cpath = Util_GetCanonicalPath(path); + char *ret = NULL; + + if (cpath != NULL) { + ret = UtilGetLegacyEncodedString(cpath); + free(cpath); } + return ret; } #endif @@ -286,3 +391,105 @@ } } } + + +#ifndef N_PLAT_NLM +#if defined(linux) +/* + *----------------------------------------------------------------------------- + * + * gettid -- + * + * Retrieve unique thread identification suitable for kill or setpriority. + * Do not call this function directly, use Util_GetCurrentThreadId() instead. + * + * Results: + * Unique thread identification on success. + * (pid_t)-1 on error, errno set (when kernel does not support this call) + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static INLINE +pid_t gettid(void) +{ +#if defined(SYS_gettid) + return (pid_t)syscall(SYS_gettid); +#else + return -1; +#endif +} +#endif + + +/* + *----------------------------------------------------------------------------- + * + * Util_GetCurrentThreadId -- + * + * Retrieves a unique thread identification suitable to identify a thread + * to kill it or change its scheduling priority. + * + * Results: + * Unique thread identification on success. + * ASSERTs on failure (should not happen). + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +Util_ThreadID +Util_GetCurrentThreadId(void) +{ +#if defined(linux) + /* + * It is possible that two threads can enter gettid() path simultaneously, + * both eventually clearing useTid to zero. It does not matter - only + * problem which can happen is that useTid will be set to zero twice. + * And it has no impact on useTid value... + */ + + static int useTid = 1; + pid_t tid; + + // ESX with userworld VMX +#if defined(VMX86_SERVER) + if (HostType_OSIsVMK()) { + return User_GetTid(); + } +#endif + + if (useTid) { + tid = gettid(); + if (tid != (pid_t)-1) { + return tid; + } + ASSERT(errno == ENOSYS); + useTid = 0; + } + tid = getpid(); + ASSERT(tid != (pid_t)-1); + return tid; +#elif defined(sun) + pid_t tid; + + tid = getpid(); + ASSERT(tid != (pid_t)-1); + return tid; +#elif defined(__APPLE__) || defined(__FreeBSD__) + ASSERT_ON_COMPILE(sizeof(Util_ThreadID) == sizeof(pthread_t)); + return pthread_self(); +#elif defined(_WIN32) + return GetCurrentThreadId(); +#else +#error "Unknown platform" +#endif +} + +#endif // N_PLAT_NLM + diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/misc/vmstdio.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/misc/vmstdio.c --- open-vm-tools-2008.01.23-74039/lib/misc/vmstdio.c 2008-01-28 08:02:51.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/misc/vmstdio.c 2008-10-13 08:01:52.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -40,63 +40,100 @@ * The fgets() API is poorly designed: it doesn't return how many bytes * were written to the buffer. Hence this function --hpreg * + * In addition, this function recognizes three variants of end-of-line + * markers regardless of the platform: \n, \r\n and \r. The exception + * is that on Windows, \r\n is recognized only if the file is opened + * in text mode. In binary mode, the \r and \n are interpreted as two + * separate end-of-line markers. + * + * As input, *count is the size of bufIn. + * * Results: - * Like fgets(). On success, '*count' is the number of bytes written to the - * buffer (excluding the NUL terminator) + * It returns bufIn on success and NULL on error. The line terminator + * and NUL terminator are not stored in bufIn. On success, '*count' is + * the number of bytes written to the buffer. * * Side effects: - * None + * If the line read is terminated by a standalone '\r' (legacy Mac), the + * next character is pushed back using ungetc. Thus, that character may + * be lost if the caller performs any write operation on the stream + * (including fseek, fflush, etc.) subsequently without an intervening + * read operation. * *----------------------------------------------------------------------------- */ static void * SuperFgets(FILE *stream, // IN - void *bufIn, // OUT - size_t *count) // IN/OUT + size_t *count, // IN/OUT + void *bufIn) // OUT { - char *buf; - - /* - * To compute how many bytes were written to the buffer, we fill our buffer - * with non-NUL bytes prior to calling fgets(). Consequently, after calling - * fgets(), the only NUL bytes that are in the buffer are: - * . those that were read from the stream - * . the one added by fgets() after all the other bytes that were read - * from the stream - * So all we need to do is locate the last NUL byte in the buffer. - * - * Note that this may not work if your implementation of fgets() does funny - * things (which is unlikely) like writing to buffer positions beyond the - * terminating NUL byte --hpreg - */ + char *buf = (char *)bufIn; + size_t size = 0; ASSERT(stream); - buf = (char *)bufIn; ASSERT(buf); ASSERT(count); ASSERT(*count); - memset(buf, '\0' - 1, *count); - /* - * In the end of stream case, glibc's fgets() returns NULL but does not set - * errno --hpreg + * Keep reading until a line terminator is found or *count is reached. + * The line terminator itself is not written into the buffer. + * Clear errno so that we can distinguish between end-of-file and error. */ + errno = 0; - if (fgets(buf, (int) *count, stream) == NULL) { - if (errno) { - return NULL; + + for (size = 0; size < *count; size++) { + int c; + + c = getc(stream); + + if (c == EOF) { + if (errno) { + /* getc returned an error. */ + return NULL; + } else { + /* Found an end-of-file line terminator. */ + break; + } + } + + if (c == '\n') { + /* Found a Unix line terminator */ + break; + } + + if (c == '\r') { + +#ifndef _WIN32 + /* + * Look ahead to see if it is a \r\n line terminator. + * On Windows platform, getc() returns one '\n' for a \r\n two-byte + * sequence (for files opened in text mode), so we can skip the + * look-ahead. + */ + + c = getc(stream); + if (c != EOF && c != '\n') { + /* Found a legacy Mac line terminator */ + + if (ungetc(c, stream) == EOF) { + return NULL; + } + } + + /* Forget that we peeked. */ + clearerr(stream); +#endif + + break; } - /* End of stream and no byte was written --hpreg */ - *count = 0; - return NULL; + buf[size] = c; } - do { - (*count)--; - } while (buf[*count] != '\0'); + *count = size; return buf; } @@ -111,11 +148,17 @@ * * A line is defined as an arbitrary long sequence of arbitrary bytes, that * ends with the first occurrence of one of these line terminators: - * . \r\n (the ANSI way) + * . \r\n (the ANSI way, in text mode) * . \n (the UNIX way) + * . \r (the Legacy Mac (pre-OS X) way) * . end-of-stream * - * If maxBufLength is non-zero at most maxBufLength bytes will be allocated. + * Note that on Windows, getc() returns one '\n' for a \r\n two-byte + * sequence only if the file is opened in text mode. Therefore \r\r\n + * will be interpreted as two newlines in text mode ('\r' followed by + * '\r\n'), but three newlines in binary mode ('\r', '\r', '\n'). + * + * If maxBufLength is non-zero at most maxBufLength bytes will be allocated. * * Results: * StdIO_Success on success: '*buf' is an allocated, NUL terminated buffer @@ -127,7 +170,11 @@ * StdIO_Error on failure: errno is set accordingly * * Side effects: - * None + * If the line read is terminated by a standalone '\r' (legacy Mac), the + * next character is pushed back using ungetc. Thus, that character may + * be lost if the caller performs any write operation on the stream + * (including fseek, fflush, etc.) subsequently without an intervening + * read operation. * *----------------------------------------------------------------------------- */ @@ -148,6 +195,7 @@ for (;;) { char *data; size_t size; + size_t max; size_t nr; /* @@ -169,64 +217,39 @@ goto error; } - nr = DynBuf_GetAllocatedSize(&b) - size; - /* - * XXX SuperFgets() is such a hack that I may replace it soon with a more - * reliable fgetc() loop --hpreg - */ - if (SuperFgets(stream, data + size, &nr) == NULL) { - if (errno) { - goto error; - } - - /* End of stream: there is no next chunk of line --hpreg */ - ASSERT(nr == 0); - - if (size) { - /* Found an end-of-stream line terminator --hpreg */ - break; - } + max = DynBuf_GetAllocatedSize(&b); + nr = max - size; - DynBuf_Destroy(&b); - - return StdIO_EOF; + if (SuperFgets(stream, &nr, data + size) == NULL) { + goto error; } - /* - * fgets() wrote at least 1 stream byte, and NUL terminated the dynamic - * buffer --hpreg - */ - ASSERT(nr); + size += nr; + DynBuf_SetSize(&b, size); + + if (size < max) { + /* SuperFgets() found end-of-line */ - if (data[size - 1] == '\n') { - /* Found a Unix or ANSI line terminator --hpreg */ - size--; - -/* Win32 takes care of this in fgets() --hpreg */ -#if !defined(_WIN32) - if (size && data[size - 1] == '\r') { - /* Found an ANSI line terminator --hpreg */ - size--; + if (size == 0 && feof(stream)) { + /* Reached end-of-file before reading anything */ + DynBuf_Destroy(&b); + return StdIO_EOF; } -#endif - /* Remove the line terminator from the dynamic buffer --hpreg */ - DynBuf_SetSize(&b, size); break; } /* * No line terminator found yet, we need a larger buffer to do the next - * fgets() --hpreg + * SuperFgets() --hpreg */ - DynBuf_SetSize(&b, size); + } /* There is a line in the buffer --hpreg */ - if ( /* NUL terminator --hpreg */ - DynBuf_Append(&b, "", 1) == FALSE - || DynBuf_Trim(&b) == FALSE) { + /* NUL terminator --hpreg */ + if (DynBuf_Append(&b, "", 1) == FALSE) { errno = ENOMEM; goto error; } diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/netUtil/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/netUtil/Makefile.am --- open-vm-tools-2008.01.23-74039/lib/netUtil/Makefile.am 2008-01-28 08:02:49.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/netUtil/Makefile.am 2008-10-13 08:01:47.000000000 +0100 @@ -19,6 +19,5 @@ libNetUtil_a_SOURCES = libNetUtil_a_SOURCES += netUtilLinux.c +AM_CFLAGS = -I$(top_builddir)/include -AM_CFLAGS = -AM_CFLAGS += @COMMON_CFLAGS@ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/netUtil/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/netUtil/Makefile.in --- open-vm-tools-2008.01.23-74039/lib/netUtil/Makefile.in 2008-01-28 08:03:04.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/netUtil/Makefile.in 2008-10-13 08:02:14.000000000 +0100 @@ -52,7 +52,10 @@ subdir = lib/netUtil DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +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)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -64,7 +67,7 @@ am_libNetUtil_a_OBJECTS = netUtilLinux.$(OBJEXT) libNetUtil_a_OBJECTS = $(am_libNetUtil_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp +depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -90,8 +93,6 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -COMMON_CFLAGS = @COMMON_CFLAGS@ -COMMON_PROG_CFLAGS = @COMMON_PROG_CFLAGS@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -102,45 +103,57 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ -ECHO = @ECHO@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GREP = @GREP@ -GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_AUTH_CFLAGS = @LIB_AUTH_CFLAGS@ -LIB_FILE_CFLAGS = @LIB_FILE_CFLAGS@ -LIB_HGFS_SERVER_CFLAGS = @LIB_HGFS_SERVER_CFLAGS@ -LIB_IMPERSONATE_CFLAGS = @LIB_IMPERSONATE_CFLAGS@ -LIB_MISC_CFLAGS = @LIB_MISC_CFLAGS@ -LIB_PROC_MGR_CFLAGS = @LIB_PROC_MGR_CFLAGS@ -LIB_STRING_CFLAGS = @LIB_STRING_CFLAGS@ -LIB_USER_CFLAGS = @LIB_USER_CFLAGS@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -148,27 +161,35 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ VERSION = @VERSION@ -VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -199,6 +220,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -215,7 +237,7 @@ top_srcdir = @top_srcdir@ noinst_LIBRARIES = libNetUtil.a libNetUtil_a_SOURCES = netUtilLinux.c -AM_CFLAGS = @COMMON_CFLAGS@ +AM_CFLAGS = -I$(top_builddir)/include all: all-am .SUFFIXES: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/netUtil/netUtilLinux.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/netUtil/netUtilLinux.c --- open-vm-tools-2008.01.23-74039/lib/netUtil/netUtilLinux.c 2008-01-28 08:02:50.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/netUtil/netUtilLinux.c 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -31,7 +31,7 @@ #endif -#if !defined(__linux__) && !defined(__FreeBSD__) && !defined(sun) +#if !defined(__linux__) && !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__) # error This file should not be compiled #endif @@ -58,7 +58,7 @@ #include #include -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__APPLE__) #include "ifaddrs.h" #endif @@ -94,7 +94,7 @@ *---------------------------------------------------------------------- */ -#ifndef __FreeBSD__ /* { */ +#if !defined(__FreeBSD__) && !defined(__APPLE__) /* { */ char * NetUtil_GetPrimaryIP(void) { @@ -168,7 +168,7 @@ return NULL; } -#else /* } FreeBSD { */ +#else /* } FreeBSD || APPLE { */ char * NetUtil_GetPrimaryIP(void) @@ -243,7 +243,7 @@ /* *---------------------------------------------------------------------- * - * NetUtil_GetPrimaryNicEntry -- + * NetUtil_GetPrimaryNic -- * * Get the primary Nic entry for this machine. Primary Nic is the * first interface that comes up when you do a ifconfig. @@ -259,11 +259,11 @@ *---------------------------------------------------------------------- */ -NicEntry * -NetUtil_GetPrimaryNicEntry(void) +GuestNic * +NetUtil_GetPrimaryNic(void) { - NicEntry *nicEntry = NULL; - VmIpAddressEntry *ipAddressEntry; + GuestNic *nicEntry = NULL; + VmIpAddress *ip; char *ipstr; ipstr = NetUtil_GetPrimaryIP(); @@ -272,18 +272,12 @@ } nicEntry = Util_SafeCalloc(1, sizeof *nicEntry); - DblLnkLst_Init(&nicEntry->ipAddressList); - ipAddressEntry = Util_SafeCalloc(1, sizeof *ipAddressEntry); - DblLnkLst_Init(&ipAddressEntry->links); - DblLnkLst_LinkLast(&nicEntry->ipAddressList, &ipAddressEntry->links); + ip = Util_SafeCalloc(1, sizeof *ip); - /* - * Now, record these values in nicEntry. - */ - Str_Strcpy(ipAddressEntry->ipEntryProto.ipAddress, - ipstr, - sizeof ipAddressEntry->ipEntryProto.ipAddress); + nicEntry->ips.ips_len = 1; + nicEntry->ips.ips_val = ip; + Str_Strcpy(ip->ipAddress, ipstr, sizeof ip->ipAddress); free(ipstr); abort: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/panic/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/panic/Makefile.am --- open-vm-tools-2008.01.23-74039/lib/panic/Makefile.am 2008-01-28 08:02:50.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/panic/Makefile.am 2008-10-13 08:01:48.000000000 +0100 @@ -19,6 +19,3 @@ libPanic_a_SOURCES = libPanic_a_SOURCES += panic.c - -AM_CFLAGS = -AM_CFLAGS += @COMMON_CFLAGS@ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/panic/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/panic/Makefile.in --- open-vm-tools-2008.01.23-74039/lib/panic/Makefile.in 2008-01-28 08:03:04.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/panic/Makefile.in 2008-10-13 08:02:14.000000000 +0100 @@ -52,7 +52,10 @@ subdir = lib/panic DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +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)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -64,7 +67,7 @@ am_libPanic_a_OBJECTS = panic.$(OBJEXT) libPanic_a_OBJECTS = $(am_libPanic_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp +depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -90,8 +93,6 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -COMMON_CFLAGS = @COMMON_CFLAGS@ -COMMON_PROG_CFLAGS = @COMMON_PROG_CFLAGS@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -102,45 +103,57 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ -ECHO = @ECHO@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GREP = @GREP@ -GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_AUTH_CFLAGS = @LIB_AUTH_CFLAGS@ -LIB_FILE_CFLAGS = @LIB_FILE_CFLAGS@ -LIB_HGFS_SERVER_CFLAGS = @LIB_HGFS_SERVER_CFLAGS@ -LIB_IMPERSONATE_CFLAGS = @LIB_IMPERSONATE_CFLAGS@ -LIB_MISC_CFLAGS = @LIB_MISC_CFLAGS@ -LIB_PROC_MGR_CFLAGS = @LIB_PROC_MGR_CFLAGS@ -LIB_STRING_CFLAGS = @LIB_STRING_CFLAGS@ -LIB_USER_CFLAGS = @LIB_USER_CFLAGS@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -148,27 +161,35 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ VERSION = @VERSION@ -VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -199,6 +220,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -215,7 +237,6 @@ top_srcdir = @top_srcdir@ noinst_LIBRARIES = libPanic.a libPanic_a_SOURCES = panic.c -AM_CFLAGS = @COMMON_CFLAGS@ all: all-am .SUFFIXES: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/panic/panic.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/panic/panic.c --- open-vm-tools-2008.01.23-74039/lib/panic/panic.c 2008-01-28 08:02:51.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/panic/panic.c 2008-10-13 08:01:52.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -42,10 +42,12 @@ #include "str.h" #include "config.h" #include "util.h" -#ifdef _WIN32 +#if defined(_WIN32) || !defined(VMX86_TOOLS) #include "coreDump.h" #endif - +#ifdef _WIN32 +#include "win32u.h" +#endif typedef enum { PanicBreakLevel_Never, @@ -219,6 +221,31 @@ /* *----------------------------------------------------------------------------- * + * 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. @@ -329,7 +356,7 @@ { typedef BOOL (*pfnIsDebuggerPresent)(void); - HMODULE kernelLibrary = LoadLibrary("kernel32.dll"); + HMODULE kernelLibrary = Win32U_LoadLibrary("kernel32.dll"); if (kernelLibrary != NULL) { pfnIsDebuggerPresent IsDebuggerPresentFn = (pfnIsDebuggerPresent) GetProcAddress(kernelLibrary, "IsDebuggerPresent"); @@ -421,6 +448,8 @@ * 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. * @@ -449,7 +478,7 @@ fputs(buf, stderr); #ifdef _WIN32 - OutputDebugString(buf); + Win32U_OutputDebugString(buf); #endif /* @@ -468,7 +497,7 @@ case 0: break; case 1: - Log(buf); + Log("%s", buf); Log("Panic loop\n"); default: fprintf(stderr, "Panic loop\n"); @@ -481,7 +510,7 @@ * the log file on exit. */ - Log(buf); + Log("%s", buf); Util_Backtrace(0); Log_SetAlwaysKeep(TRUE); @@ -490,13 +519,9 @@ * to double panic. */ -#ifdef _WIN32 Panic_DumpGuiResources(); - /* - * XXX: Posix app coredumps have to wait until the coredump code makes - * it out of lib/left/sigPosix and into lib/user/panic. - */ +#if defined(_WIN32) || !defined(VMX86_TOOLS) if (Panic_GetCoreDumpOnPanic()) { CoreDump_CoreDump(); } @@ -520,17 +545,12 @@ } -#ifdef _WIN32 /* *----------------------------------------------------------------------------- * * Panic_DumpGuiResources -- * - * Dumps Win32 userlevel resources used by the current process. - * Dynamically loads user32!GetGuiResources because it's only - * implemented on Windows 2000 and later, while this module is - * linked by tools and possibly other things that need legacy - * Windows support. + * Dumps userlevel resources used by the current process. * * Results: * void @@ -544,7 +564,8 @@ void Panic_DumpGuiResources(void) { - HANDLE hUser = GetModuleHandle("user32.dll"); +#ifdef _WIN32 + HANDLE hUser = Win32U_GetModuleHandle("user32.dll"); if (hUser) { typedef DWORD (WINAPI *fnGetGuiResources)(HANDLE, DWORD); fnGetGuiResources pGetGuiResources = @@ -555,5 +576,5 @@ pGetGuiResources(GetCurrentProcess(), GR_USEROBJECTS)); } } -} #endif +} diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/panicDefault/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/panicDefault/Makefile.am --- open-vm-tools-2008.01.23-74039/lib/panicDefault/Makefile.am 2008-01-28 08:02:50.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/panicDefault/Makefile.am 2008-10-13 08:01:48.000000000 +0100 @@ -19,6 +19,3 @@ libPanicDefault_a_SOURCES = libPanicDefault_a_SOURCES += panic.c - -AM_CFLAGS = -AM_CFLAGS += @COMMON_CFLAGS@ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/panicDefault/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/panicDefault/Makefile.in --- open-vm-tools-2008.01.23-74039/lib/panicDefault/Makefile.in 2008-01-28 08:03:04.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/panicDefault/Makefile.in 2008-10-13 08:02:14.000000000 +0100 @@ -52,7 +52,10 @@ subdir = lib/panicDefault DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +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)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -64,7 +67,7 @@ am_libPanicDefault_a_OBJECTS = panic.$(OBJEXT) libPanicDefault_a_OBJECTS = $(am_libPanicDefault_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp +depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -90,8 +93,6 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -COMMON_CFLAGS = @COMMON_CFLAGS@ -COMMON_PROG_CFLAGS = @COMMON_PROG_CFLAGS@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -102,45 +103,57 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ -ECHO = @ECHO@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GREP = @GREP@ -GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_AUTH_CFLAGS = @LIB_AUTH_CFLAGS@ -LIB_FILE_CFLAGS = @LIB_FILE_CFLAGS@ -LIB_HGFS_SERVER_CFLAGS = @LIB_HGFS_SERVER_CFLAGS@ -LIB_IMPERSONATE_CFLAGS = @LIB_IMPERSONATE_CFLAGS@ -LIB_MISC_CFLAGS = @LIB_MISC_CFLAGS@ -LIB_PROC_MGR_CFLAGS = @LIB_PROC_MGR_CFLAGS@ -LIB_STRING_CFLAGS = @LIB_STRING_CFLAGS@ -LIB_USER_CFLAGS = @LIB_USER_CFLAGS@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -148,27 +161,35 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ VERSION = @VERSION@ -VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -199,6 +220,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -215,7 +237,6 @@ top_srcdir = @top_srcdir@ noinst_LIBRARIES = libPanicDefault.a libPanicDefault_a_SOURCES = panic.c -AM_CFLAGS = @COMMON_CFLAGS@ all: all-am .SUFFIXES: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/panicDefault/panic.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/panicDefault/panic.c --- open-vm-tools-2008.01.23-74039/lib/panicDefault/panic.c 2008-01-28 08:02:51.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/panicDefault/panic.c 2008-10-13 08:01:52.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/printer/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/printer/Makefile.am --- open-vm-tools-2008.01.23-74039/lib/printer/Makefile.am 2008-01-28 08:02:50.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/printer/Makefile.am 2008-10-13 08:01:48.000000000 +0100 @@ -19,6 +19,3 @@ libPrinter_a_SOURCES = libPrinter_a_SOURCES += printer.c - -AM_CFLAGS = -AM_CFLAGS += @COMMON_CFLAGS@ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/printer/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/printer/Makefile.in --- open-vm-tools-2008.01.23-74039/lib/printer/Makefile.in 2008-01-28 08:03:04.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/printer/Makefile.in 2008-10-13 08:02:14.000000000 +0100 @@ -52,7 +52,10 @@ subdir = lib/printer DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +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)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -64,7 +67,7 @@ am_libPrinter_a_OBJECTS = printer.$(OBJEXT) libPrinter_a_OBJECTS = $(am_libPrinter_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp +depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -90,8 +93,6 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -COMMON_CFLAGS = @COMMON_CFLAGS@ -COMMON_PROG_CFLAGS = @COMMON_PROG_CFLAGS@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -102,45 +103,57 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ -ECHO = @ECHO@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GREP = @GREP@ -GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_AUTH_CFLAGS = @LIB_AUTH_CFLAGS@ -LIB_FILE_CFLAGS = @LIB_FILE_CFLAGS@ -LIB_HGFS_SERVER_CFLAGS = @LIB_HGFS_SERVER_CFLAGS@ -LIB_IMPERSONATE_CFLAGS = @LIB_IMPERSONATE_CFLAGS@ -LIB_MISC_CFLAGS = @LIB_MISC_CFLAGS@ -LIB_PROC_MGR_CFLAGS = @LIB_PROC_MGR_CFLAGS@ -LIB_STRING_CFLAGS = @LIB_STRING_CFLAGS@ -LIB_USER_CFLAGS = @LIB_USER_CFLAGS@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -148,27 +161,35 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ VERSION = @VERSION@ -VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -199,6 +220,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -215,7 +237,6 @@ top_srcdir = @top_srcdir@ noinst_LIBRARIES = libPrinter.a libPrinter_a_SOURCES = printer.c -AM_CFLAGS = @COMMON_CFLAGS@ all: all-am .SUFFIXES: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/printer/printer.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/printer/printer.c --- open-vm-tools-2008.01.23-74039/lib/printer/printer.c 2008-01-28 08:02:51.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/printer/printer.c 2008-10-13 08:01:52.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -39,6 +39,9 @@ #include "vmware.h" #include "err.h" #include "printer.h" +#ifdef _WIN32 +#include "win32u.h" +#endif #define LOGLEVEL_MODULE printer #include "loglevel_user.h" @@ -272,14 +275,14 @@ /* * Try to load the necessary library. */ - winspoolDll = LoadLibrary("Winspool.drv"); + winspoolDll = Win32U_LoadLibrary("Winspool.drv"); if (!winspoolDll) { error = Err_Errno(); Log("Printer_Init: Failed to load Winspool.drv %d: %s\n", error, Err_Errno2String(error)); Log("Printer_Init: Trying to load Winspool as Winspool.dll...\n"); - winspoolDll = LoadLibrary("Winspool"); + winspoolDll = Win32U_LoadLibrary("Winspool"); if (!winspoolDll) { error = Err_Errno(); Log("Printer_Init: Failed to load Winspool.dll %d: %s\n", diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/procMgr/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/procMgr/Makefile.am --- open-vm-tools-2008.01.23-74039/lib/procMgr/Makefile.am 2008-01-28 08:02:49.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/procMgr/Makefile.am 2008-10-13 08:01:47.000000000 +0100 @@ -20,6 +20,4 @@ libProcMgr_a_SOURCES = libProcMgr_a_SOURCES += procMgrPosix.c -AM_CFLAGS = -AM_CFLAGS += @COMMON_CFLAGS@ -AM_CFLAGS += @LIB_PROC_MGR_CFLAGS@ +AM_CFLAGS = @LIB_PROC_MGR_CPPFLAGS@ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/procMgr/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/procMgr/Makefile.in --- open-vm-tools-2008.01.23-74039/lib/procMgr/Makefile.in 2008-01-28 08:03:04.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/procMgr/Makefile.in 2008-10-13 08:02:14.000000000 +0100 @@ -52,7 +52,10 @@ subdir = lib/procMgr DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +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)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -64,7 +67,7 @@ am_libProcMgr_a_OBJECTS = procMgrPosix.$(OBJEXT) libProcMgr_a_OBJECTS = $(am_libProcMgr_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp +depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -90,8 +93,6 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -COMMON_CFLAGS = @COMMON_CFLAGS@ -COMMON_PROG_CFLAGS = @COMMON_PROG_CFLAGS@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -102,45 +103,57 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ -ECHO = @ECHO@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GREP = @GREP@ -GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_AUTH_CFLAGS = @LIB_AUTH_CFLAGS@ -LIB_FILE_CFLAGS = @LIB_FILE_CFLAGS@ -LIB_HGFS_SERVER_CFLAGS = @LIB_HGFS_SERVER_CFLAGS@ -LIB_IMPERSONATE_CFLAGS = @LIB_IMPERSONATE_CFLAGS@ -LIB_MISC_CFLAGS = @LIB_MISC_CFLAGS@ -LIB_PROC_MGR_CFLAGS = @LIB_PROC_MGR_CFLAGS@ -LIB_STRING_CFLAGS = @LIB_STRING_CFLAGS@ -LIB_USER_CFLAGS = @LIB_USER_CFLAGS@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -148,27 +161,35 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ VERSION = @VERSION@ -VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -199,6 +220,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -215,7 +237,7 @@ top_srcdir = @top_srcdir@ noinst_LIBRARIES = libProcMgr.a libProcMgr_a_SOURCES = procMgrPosix.c -AM_CFLAGS = @COMMON_CFLAGS@ @LIB_PROC_MGR_CFLAGS@ +AM_CFLAGS = @LIB_PROC_MGR_CPPFLAGS@ all: all-am .SUFFIXES: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/procMgr/procMgrPosix.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/procMgr/procMgrPosix.c --- open-vm-tools-2008.01.23-74039/lib/procMgr/procMgrPosix.c 2008-01-28 08:02:50.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/procMgr/procMgrPosix.c 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -31,7 +31,7 @@ // pull in setresuid()/setresgid() if possible #define _GNU_SOURCE #include -#if !defined(__FreeBSD__) && !defined(sun) +#if !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__) #include #include #include @@ -67,15 +67,8 @@ #include "dynbuf.h" #include "su.h" #include "str.h" - - -/* - * The IPC messages sent from the child process to the parent. These - * are 1 byte so that we are guaranteed they are written over the pipe - * in one go. - */ -#define ASYNCEXEC_SUCCESS_IPC "1" -#define ASYNCEXEC_FAILURE_IPC "0" +#include "fileIO.h" +#include "codeset.h" /* @@ -97,41 +90,60 @@ * Keeps track of the posix async proc info. */ struct ProcMgr_AsyncProc { - pid_t waiterPid; // pid of the waiter process - int fd; // fd to write to when the child is done + pid_t waiterPid; // pid of the waiter process + pid_t resultPid; // pid of the process created for the client + FileIODescriptor fd; // fd to write to when the child is done Bool validExitCode; int exitCode; }; -static Bool ProcMgrExecSync(char const *cmd, - Bool *validExitCode, - int *exitCode); +static pid_t ProcMgrStartProcess(char const *cmd); +static Bool ProcMgrWaitForProcCompletion(pid_t pid, + Bool *validExitCode, + int *exitCode); + +static Bool ProcMgrKill(pid_t pid, + int sig, + int timeout); #if defined(linux) && !defined(GLIBC_VERSION_23) /* - * Implements the system calls (they are not wrapped by glibc til 2.3.2) + * 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 -_syscall3(int, setresuid, - uid_t, ruid, - uid_t, euid, - uid_t, suid); - -static -_syscall3(int, setresgid, - gid_t, rgid, - gid_t, egid, - gid_t, sgid); + +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_ListProcesses -- * * List all the processes that the calling client has privilege to - * enumerate. + * enumerate. The strings in the returned structure should be all + * UTF-8 encoded, although we do not enforce it right now. * * Results: * @@ -146,7 +158,7 @@ ProcMgr_ListProcesses(void) { ProcMgr_ProcList *procList = NULL; -#if !defined(__FreeBSD__) && !defined(sun) +#if !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__) Bool failed = FALSE; DynBuf dbProcId; DynBuf dbProcCmd; @@ -283,12 +295,65 @@ numRead = read(cmdFd, cmdLineTemp, sizeof cmdLineTemp - sizeof(char)); close(cmdFd); - if (1 > numRead) { - continue; - } - for (replaceLoop = 0 ; replaceLoop < (numRead - 1) ; replaceLoop++) { - if ('\0' == cmdLineTemp[replaceLoop]) { - cmdLineTemp[replaceLoop] = ' '; + if (numRead > 0) { + for (replaceLoop = 0 ; replaceLoop < (numRead - 1) ; replaceLoop++) { + if ('\0' == cmdLineTemp[replaceLoop]) { + 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 = read(cmdFd, cmdLineTemp, sizeof(cmdLineTemp) - sizeof(char)); + close(cmdFd); + + if (numRead < 0) { + cmdLineTemp[0] = '\0'; + } else { + cmdLineTemp[numRead] = '\0'; + } + } + 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 = NULL; + char* copyItr = NULL; + + /* 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'; } } @@ -301,7 +366,11 @@ * bytes from /proc/#/cmdline -- we left just enough space to add * NUL termination at the end. */ - cmdLineTemp[numRead] = '\0'; + if (numRead < 0) { + cmdLineTemp[0] = '\0'; + } else { + cmdLineTemp[numRead] = '\0'; + } /* * Get the inode information for this process. This gives us @@ -441,7 +510,7 @@ ProcMgr_FreeProcList(procList); procList = NULL; } -#endif // !defined(__FreeBSD__) && !defined(sun) +#endif // !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__) return procList; } @@ -488,113 +557,126 @@ /* *---------------------------------------------------------------------- * - * ProcMgrWaiter -- + * ProcMgr_ExecSync -- * - * The waiter process for ProcMgr_ExecAsync which runs in the - * child process. Execs the cmd & writes an IPC msg to the given - * fd when its done. + * Synchronously execute a command. The command is UTF-8 encoded. * * Results: - * - * TRUE: cmd was successful (exit code 0) - * FALSE: cmd failed or an error occurred (detail is displayed) + * TRUE on success (the program had an exit code of 0) + * FALSE on failure or if an error occurred (detail is displayed) * * Side effects: - * - * Side effects + * Lots, depending on the program. * *---------------------------------------------------------------------- */ -static void -ProcMgrWaiter(const char *cmd, // IN - int writeFd, // IN - Bool *validExitCode, - int *exitCode) +Bool +ProcMgr_ExecSync(char const *cmd, // IN: UTF-8 command line + ProcMgr_ProcArgs *userArgs) // IN: Unused { - const char *doneMsg; - Bool status; - - status = ProcMgrExecSync(cmd, validExitCode, exitCode); + pid_t pid; - doneMsg = status ? ASYNCEXEC_SUCCESS_IPC : ASYNCEXEC_FAILURE_IPC; - - /* send IPC back to caller */ - Debug("Writing '%s' to fd %x\n", doneMsg, writeFd); - if (write(writeFd, doneMsg, strlen(doneMsg) + 1) == -1) { - Warning("Waiter unable to write back to parent\n"); - return; - } - if (write(writeFd, exitCode, sizeof(*exitCode)) == -1) { - Warning("Waiter unable to write back to parent\n"); - return; + Debug("Executing sync command: %s\n", cmd); + + pid = ProcMgrStartProcess(cmd); + + if (pid == -1) { + return FALSE; } - - return; + + return ProcMgrWaitForProcCompletion(pid, NULL, NULL); } /* *---------------------------------------------------------------------- * - * ProcMgr_ExecSync -- + * ProcMgrStartProcess -- * - * Synchronously execute a cmd + * Fork and execute a command using the shell. This function returns + * immediately after the fork() in the parent process. * * Results: - * - * TRUE on success (the program had an exit code of 0) - * FALSE on failure or if an error occurred (detail is displayed) + * The pid of the forked process, or -1 on an error. * * Side effects: - * * Lots, depending on the program * *---------------------------------------------------------------------- */ -Bool -ProcMgr_ExecSync(char const *cmd, // IN: Command line - ProcMgr_ProcArgs *userArgs) // IN: Unused -{ - Debug("Executing sync command: %s\n", cmd); - - return ProcMgrExecSync(cmd, NULL, NULL); -} - -static Bool -ProcMgrExecSync(char const *cmd, - Bool *validExitCode, - int *exitCode) +static pid_t +ProcMgrStartProcess(char const *cmd) // IN: UTF-8 encoded cmd { - Bool retVal; pid_t pid; - int childStatus; + char *cmdCurrent = NULL; - if (NULL != validExitCode) { - *validExitCode = FALSE; + if (cmd == NULL) { + ASSERT(FALSE); + return -1; + } + + if (!CodeSet_Utf8ToCurrent(cmd, strlen(cmd), &cmdCurrent, NULL)) { + Warning("Could not convert from UTF-8 to current\n"); + return -1; } pid = fork(); - + if (pid == -1) { Warning("Unable to fork: %s.\n\n", strerror(errno)); - return FALSE; } else if (pid == 0) { + /* * Child */ - - execl("/bin/sh", "sh", "-c", cmd, (char *)NULL); - + + execl("/bin/sh", "sh", "-c", cmdCurrent, (char *)NULL); + /* Failure */ Panic("Unable to execute the \"%s\" shell command: %s.\n\n", - cmd, strerror(errno)); + cmdCurrent, strerror(errno)); } /* * Parent */ + + free(cmdCurrent); + 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; @@ -611,8 +693,8 @@ continue; } - Warning("Unable to wait for the \"%s\" shell command to terminate: " - "%s.\n\n", cmd, strerror(errno)); + Warning("Unable to wait for the process %"FMTPID" to terminate: " + "%s.\n\n", pid, strerror(errno)); return FALSE; } @@ -624,7 +706,7 @@ retVal = (WIFEXITED(childStatus) && WEXITSTATUS(childStatus) == 0); - Debug("Done executing command: %s (%s)\n", cmd, + Debug("Done waiting for process: %"FMTPID" (%s)\n", pid, retVal ? "success" : "failure"); return retVal; @@ -639,41 +721,48 @@ * 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: Command line +ProcMgr_ExecAsync(char const *cmd, // IN: UTF-8 command line ProcMgr_ProcArgs *userArgs) // IN: Unused { - ProcMgr_AsyncProc *asyncProc; + ProcMgr_AsyncProc *asyncProc = NULL; pid_t pid; int fds[2]; Bool validExitCode; int exitCode; + pid_t resultPid; + FileIODescriptor readFd; + FileIODescriptor writeFd; Debug("Executing async command: %s\n", cmd); - + if (pipe(fds) == -1) { - ASSERT(FALSE); + Warning("Unable to create the pipe to launch command: %s.\n", cmd); + return NULL; } + readFd = FileIO_CreateFDPosix(fds[0], O_RDONLY); + writeFd = FileIO_CreateFDPosix(fds[1], O_WRONLY); + pid = fork(); if (pid == -1) { Warning("Unable to fork: %s.\n\n", strerror(errno)); - return NULL; + goto abort; } else if (pid == 0) { struct sigaction olds[ARRAYSIZE(cSignals)]; int i, maxfd; + Bool status = TRUE; + pid_t childPid = -1; /* * Child @@ -689,7 +778,7 @@ */ maxfd = sysconf(_SC_OPEN_MAX); for (i = STDERR_FILENO + 1; i < maxfd; i++) { - if (i != fds[0] && i != fds[1]) { + if (i != readFd.posix && i != writeFd.posix) { close(i); } } @@ -700,17 +789,82 @@ #else 0 #endif - ) == 0) - { - return FALSE; + ) == 0) { + status = FALSE; + } + + FileIO_Close(&readFd); + + /* + * Only run the program if we have not already experienced a failure. + */ + if (status) { + childPid = ProcMgrStartProcess(cmd); + status = childPid != -1; + } + + /* + * Send the child's pid back immediately, so that the caller can + * report the result pid back synchronously. + */ + if (FileIO_Write(&writeFd, &childPid, sizeof childPid, NULL) != + FILEIO_SUCCESS) { + 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.posix); + if (FileIO_Write(&writeFd, &status, sizeof status, NULL) != + FILEIO_SUCCESS) { + 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(fds[0]); - ProcMgrWaiter(cmd, fds[1], &validExitCode, &exitCode); - close(fds[1]); + if (FileIO_Write(&writeFd, &exitCode, sizeof exitCode , NULL) != + FILEIO_SUCCESS) { + 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); + } + + FileIO_Close(&writeFd); - if (Signal_ResetGroupHandler(cSignals, olds, ARRAYSIZE(cSignals)) == 0) { - return FALSE; + if (status && + Signal_ResetGroupHandler(cSignals, olds, ARRAYSIZE(cSignals)) == 0) { + /* + * We are too close to give up now. + */ } if (!validExitCode) { @@ -724,15 +878,51 @@ * Parent */ - close(fds[1]); + FileIO_Close(&writeFd); - asyncProc = malloc(sizeof(ProcMgr_AsyncProc)); - ASSERT_NOT_IMPLEMENTED(asyncProc); - asyncProc->fd = fds[0]; + /* + * Read the pid of the child's child from the pipe. + */ + if (FileIO_Read(&readFd, &resultPid, sizeof resultPid , NULL) != + FILEIO_SUCCESS) { + 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; + FileIO_Invalidate(&readFd); asyncProc->waiterPid = pid; asyncProc->validExitCode = FALSE; asyncProc->exitCode = -1; + asyncProc->resultPid = resultPid; + abort: + if (FileIO_IsValid(&readFd)) { + FileIO_Close(&readFd); + } + if (FileIO_IsValid(&writeFd)) { + FileIO_Close(&writeFd); + } + return asyncProc; } @@ -744,12 +934,10 @@ * Check to see if a pid is active * * Results: - * * TRUE if the process exists; FALSE otherwise * * Side effects: - * - * Side effects + * None. * *---------------------------------------------------------------------- */ @@ -757,26 +945,7 @@ static Bool ProcMgr_IsProcessRunning(pid_t pid) { - /* - * if its not linux, assume its gone - */ -#if !defined(__FreeBSD__) && !defined(sun) - char procname[256]; - int ret; - struct stat st; - - snprintf(procname, sizeof(procname), "/proc/%"FMTPID, pid); - - /* - * will fail if its gone or we don't have permission; both are - * FALSE cases - */ - ret = stat(procname, &st); - if (0 == ret) { - return TRUE; - } -#endif - return FALSE; + return ((kill(pid, 0) == -1) && (errno == ESRCH)); } @@ -788,12 +957,10 @@ * 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: - * - * Side effects + * Depends on the program being killed. * *---------------------------------------------------------------------- */ @@ -853,11 +1020,9 @@ * Terminate the process of procId. * * Results: - * - * None. + * Bool. * * Side effects: - * * Lots, depending on the program * *---------------------------------------------------------------------- @@ -885,12 +1050,10 @@ * nicely & then whipping out the SIGKILL axe. * * Results: - * * None. * * Side effects: - * - * None + * Depends on the program being killed. * *---------------------------------------------------------------------- */ @@ -898,11 +1061,13 @@ void ProcMgr_Kill(ProcMgr_AsyncProc *asyncProc) // IN { - ASSERT(asyncProc); - - close(asyncProc->fd); + if ((asyncProc == NULL) || (asyncProc->waiterPid == -1)) { + ASSERT(FALSE); + return; + } ProcMgr_KillByPid(asyncProc->waiterPid); + asyncProc->waiterPid = -1; } @@ -912,15 +1077,14 @@ * ProcMgr_GetAsyncStatus -- * * Get the return status of an async process. + * Must only be called once for any async process. * * Results: - * * TRUE if the status was retrieved. * FALSE if it couldn't be retrieved. * * Side effects: - * - * None. + * Does a waitpid() on the child to prevent zombification. * *---------------------------------------------------------------------- */ @@ -929,70 +1093,37 @@ ProcMgr_GetAsyncStatus(ProcMgr_AsyncProc *asyncProc, // IN Bool *status) // OUT { - char buf[8]; - int bytesRead; - int bytesTotal; - char *helper; Bool retVal = FALSE; - + ASSERT(status); - - ASSERT(strlen(ASYNCEXEC_SUCCESS_IPC) == strlen(ASYNCEXEC_FAILURE_IPC)); - bytesTotal = strlen(ASYNCEXEC_SUCCESS_IPC) + 1 + sizeof(int); + ASSERT(asyncProc); + ASSERT(asyncProc->waiterPid != -1); - // Prevent buffer overflows. - ASSERT(bytesTotal <= sizeof(buf)); + if (FileIO_Read(&(asyncProc->fd), status, sizeof *status, NULL) != + FILEIO_SUCCESS) { + Warning("Error reading async process status.\n"); + goto end; + } - bytesRead = 0; - while (bytesRead < bytesTotal) { - int currentBytesRead; - - currentBytesRead = read(asyncProc->fd, buf + bytesRead, - sizeof(buf) - bytesRead); - if (currentBytesRead <= 0) { - Warning("Error reading async process status (bytes read=%d)" - "Bytes read: %d\n", - currentBytesRead, bytesRead); - goto end; - } - bytesRead += currentBytesRead; - } - - /* - * Coverity doesn't like it when we assume that buf is NUL-terminated. - * This is a safe assumption for us because we control both ends of the - * pipe. But let's humor Coverity and not make such assumptions. - * This means we can't use strlen() to calculcate helper, and we can't - * use strcmp() to compare buf to macros. - */ - if (memcmp(buf, ASYNCEXEC_SUCCESS_IPC, - sizeof ASYNCEXEC_SUCCESS_IPC) == 0) { - *status = TRUE; - helper = buf + sizeof ASYNCEXEC_SUCCESS_IPC; - } else if (memcmp(buf, ASYNCEXEC_FAILURE_IPC, - sizeof ASYNCEXEC_FAILURE_IPC) == 0) { - *status = FALSE; - helper = buf + sizeof ASYNCEXEC_FAILURE_IPC; - } else { - *status = FALSE; - Warning("Error reading async process status ('%s')\n", buf); + if (FileIO_Read(&(asyncProc->fd), &(asyncProc->exitCode), + sizeof asyncProc->exitCode, NULL) != + FILEIO_SUCCESS) { + Warning("Error reading async process status.\n"); goto end; } - memcpy(&asyncProc->exitCode, helper, sizeof(asyncProc->exitCode)); asyncProc->validExitCode = TRUE; - Debug("Child w/ fd %x exited (msg='%s') with status=%d\n", asyncProc->fd, - buf, *status); + Debug("Child w/ fd %x exited with status=%d\n", + asyncProc->fd.posix, *status); retVal = TRUE; end: - close(asyncProc->fd); - /* Read the pid so the processes don't become zombied */ Debug("Waiting on pid %"FMTPID" to de-zombify it\n", asyncProc->waiterPid); waitpid(asyncProc->waiterPid, NULL, 0); + asyncProc->waiterPid = -1; return retVal; } @@ -1006,34 +1137,13 @@ * Checks whether an async process is still running. * * Results: - * * TRUE iff the process is still running. * * Side effects: - * - * None. + * None. * *---------------------------------------------------------------------- */ - -#if 0 -Bool -ProcMgr_IsAsyncProcRunning(ProcMgr_AsyncProc *asyncProc) // IN -{ - static char buf[1024]; - int numBytesRead; - - ASSERT(asyncProc); - - numBytesRead = read(asyncProc->fd, buf, sizeof buf); - if (numBytesRead <= 0) { - return TRUE; - } - - return FALSE; -} - -#else Bool ProcMgr_IsAsyncProcRunning(ProcMgr_AsyncProc *asyncProc) // IN @@ -1042,6 +1152,7 @@ fd_set readFds; struct timeval tv; int status; + Selectable fd; ASSERT(asyncProc); @@ -1051,9 +1162,10 @@ * 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(asyncProc->fd, &readFds); - maxFd = asyncProc->fd; + FD_SET(fd, &readFds); + maxFd = fd; tv.tv_sec = 0; tv.tv_usec = 0; @@ -1068,7 +1180,6 @@ } } -#endif /* *---------------------------------------------------------------------- @@ -1078,11 +1189,9 @@ * Get the selectable fd for an async proc struct. * * Results: - * * The fd casted to a void *. * * Side effects: - * * None. * *---------------------------------------------------------------------- @@ -1093,7 +1202,7 @@ { ASSERT(asyncProc); - return asyncProc->fd; + return asyncProc->fd.posix; } @@ -1118,7 +1227,7 @@ { ASSERT(asyncProc); - return asyncProc->waiterPid; + return asyncProc->resultPid; } @@ -1133,8 +1242,7 @@ * 0 if successful, -1 if not. * * Side effects: - * - * None. + * See ProcMgr_GetAsyncStatus(). * *---------------------------------------------------------------------- */ @@ -1170,13 +1278,18 @@ * * ProcMgr_Free -- * - * Discard the state of an async process. + * 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. * *---------------------------------------------------------------------- @@ -1185,6 +1298,24 @@ 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) && FileIO_IsValid(&(asyncProc->fd))) { + FileIO_Close(&(asyncProc->fd)); + } + free(asyncProc); } @@ -1198,6 +1329,8 @@ * 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. * @@ -1212,8 +1345,8 @@ */ Bool -ProcMgr_ImpersonateUserStart(const char *user, // IN - AuthToken token) // IN +ProcMgr_ImpersonateUserStart(const char *user, // IN: UTF-8 encoded user name + AuthToken token) // IN { char buffer[BUFSIZ]; struct passwd pw; @@ -1222,7 +1355,7 @@ int error; int ret; - if ((error = getpwuid_r(0, &pw, buffer, sizeof(buffer), &ppw)) != 0 || + if ((error = getpwuid_r(0, &pw, buffer, sizeof buffer, &ppw)) != 0 || !ppw) { /* * getpwuid_r() and getpwnam_r() can return a 0 (success) but not @@ -1237,7 +1370,7 @@ root_gid = ppw->pw_gid; - if ((error = getpwnam_r(user, &pw, buffer, sizeof(buffer), &ppw)) != 0 || + if ((error = getpwnam_r(user, &pw, buffer, sizeof buffer, &ppw)) != 0 || !ppw) { if (error == 0) { error = ENOENT; @@ -1257,7 +1390,7 @@ goto failure; } // now user - ret = setresuid(ppw->pw_gid, ppw->pw_gid, 0); + ret = setresuid(ppw->pw_uid, ppw->pw_uid, 0); if (ret < 0) { Warning("Failed to setresuid() for user %s\n", user); goto failure; @@ -1304,7 +1437,7 @@ int error; int ret; - if ((error = getpwuid_r(0, &pw, buffer, sizeof(buffer), &ppw)) != 0 || + if ((error = getpwuid_r(0, &pw, buffer, sizeof buffer, &ppw)) != 0 || !ppw) { if (error == 0) { error = ENOENT; @@ -1313,7 +1446,7 @@ } // first change back user - ret = setresuid(ppw->pw_gid, ppw->pw_gid, 0); + ret = setresuid(ppw->pw_uid, ppw->pw_uid, 0); if (ret < 0) { Warning("Failed to setresuid() for root\n"); return FALSE; diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/raster/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/raster/Makefile.am --- open-vm-tools-2008.01.23-74039/lib/raster/Makefile.am 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/raster/Makefile.am 2008-10-13 08:01:48.000000000 +0100 @@ -0,0 +1,21 @@ +################################################################################ +### Copyright 2008 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_LIBRARIES = libRaster.a + +libRaster_a_SOURCES = +libRaster_a_SOURCES += rasterConv.c diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/raster/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/raster/Makefile.in --- open-vm-tools-2008.01.23-74039/lib/raster/Makefile.in 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/raster/Makefile.in 2008-10-13 08:02:14.000000000 +0100 @@ -0,0 +1,494 @@ +# 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 2008 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/raster +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)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) +ARFLAGS = cru +libRaster_a_AR = $(AR) $(ARFLAGS) +libRaster_a_LIBADD = +am_libRaster_a_OBJECTS = rasterConv.$(OBJEXT) +libRaster_a_OBJECTS = $(am_libRaster_a_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 = $(libRaster_a_SOURCES) +DIST_SOURCES = $(libRaster_a_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_XLIBS = @COMMON_XLIBS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ +DNET_LIBS = @DNET_LIBS@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ +GTK_LIBS = @GTK_LIBS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ +HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ +MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ +RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ +VERSION = @VERSION@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +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@ +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@ +lt_ECHO = @lt_ECHO@ +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_LIBRARIES = libRaster.a +libRaster_a_SOURCES = rasterConv.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/raster/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu lib/raster/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-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) +libRaster.a: $(libRaster_a_OBJECTS) $(libRaster_a_DEPENDENCIES) + -rm -f libRaster.a + $(libRaster_a_AR) libRaster.a $(libRaster_a_OBJECTS) $(libRaster_a_LIBADD) + $(RANLIB) libRaster.a + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rasterConv.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 $(LIBRARIES) +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-noinstLIBRARIES \ + 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-noinstLIBRARIES 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: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/raster/rasterConv.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/raster/rasterConv.c --- open-vm-tools-2008.01.23-74039/lib/raster/rasterConv.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/raster/rasterConv.c 2008-10-13 08:01:52.000000000 +0100 @@ -0,0 +1,1501 @@ +/********************************************************* + * Copyright (C) 1998 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. + * + *********************************************************/ + +/* + * rasterConv.c -- + * + * Pixel conversion routines + */ + +#include +#include +#include + +#include "vmware.h" +#include "rasterConv.h" + +#define CONVERT_LONG_TO_SHORT(pix, redMask, greenMask, blueMask, \ + redShift, greenShift, blueShift) \ + (((redMask) & ((pix) >> (redShift))) | \ + ((greenMask) & ((pix) >> (greenShift))) | \ + ((blueMask) & ((pix) >> (blueShift)))) + +#define CONVERT_SHORT_TO_LONG(pix, redMask, greenMask, blueMask, \ + redShift1, redShift2, \ + greenShift1, greenShift2, \ + blueShift1, blueShift2) \ + ((REDMASK_32 & \ + (((((pix) & (redMask)) >> (redShift1)) | \ + (((pix) & (redMask)) >> (redShift2))) << 16)) | \ + (GREENMASK_32 & \ + (((((pix) & (greenMask)) >> (greenShift1)) | \ + (((pix) & (greenMask)) >> (greenShift2))) << 8)) | \ + (BLUEMASK_32 & \ + ((((pix) & (blueMask)) << (blueShift1)) | \ + (((pix) & (blueMask)) >> (blueShift2))))) + +#define CONVERT_LONG_TO_8BGR(pix, redMask, greenMask, blueMask, \ + redShift, greenShift, blueShift) \ + (((redMask) & ((pix) >> (redShift))) | \ + ((greenMask) & ((pix) >> (greenShift))) | \ + ((blueMask) & ((pix) << (blueShift)))) + + +static const uint8 byte_masks_8bgr[9][3] = { + /*0*/ {0,0,0}, + /*1*/ {0,0,0}, + /*2*/ {0,0,0}, + /*3*/ {REDMASK_BGR111, GREENMASK_BGR111, BLUEMASK_BGR111}, + /*4*/ {0,0,0}, + /*5*/ {0,0,0}, + /*6*/ {REDMASK_RGB222, GREENMASK_RGB222, BLUEMASK_RGB222}, + /*7*/ {0,0,0}, + /*8*/ {REDMASK_BGR233, GREENMASK_BGR233, BLUEMASK_BGR233} +}; + +#define REDMASK_8BPP(depth) (byte_masks_8bgr[depth][0]) +#define GREENMASK_8BPP(depth) (byte_masks_8bgr[depth][1]) +#define BLUEMASK_8BPP(depth) (byte_masks_8bgr[depth][2]) + + +/* + * Local functions + */ + +static void RasterConvert15to16(uint8 *tof, uint32 line_increment, + uint8 *src, uint32 src_increment, + uint32 src_x, uint32 src_y, + uint32 x, uint32 y, uint32 w, uint32 h); +static void RasterConvertShortTo24(uint8 *tof, uint32 line_increment, + uint8 *src, uint32 src_increment, + uint32 src_x, uint32 src_y, + uint32 x, uint32 y, uint32 w, uint32 h, + uint32 redMask, uint32 greenMask, + uint32 blueMask, + uint32 redShift1, uint32 redShift2, + uint32 greenShift1, uint32 greenShift2, + uint32 blueShift1, uint32 blueShift2); +static void RasterConvertShortTo32(uint8 *tof, uint32 line_increment, + uint8 *src, uint32 src_increment, + uint32 src_x, uint32 src_y, + uint32 x, uint32 y, uint32 w, uint32 h, + uint32 redMask, uint32 greenMask, + uint32 blueMask, + uint32 redShift1, uint32 redShift2, + uint32 greenShift1, uint32 greenShift2, + uint32 blueShift1, uint32 blueShift2); +static void RasterConvert16to15(uint8 *tof, uint32 line_increment, + uint8 *src, uint32 src_increment, + uint32 src_x, uint32 src_y, + uint32 x, uint32 y, uint32 w, uint32 h); +static void RasterConvert24toShort(uint8 *tof, uint32 line_increment, + uint8 *src, uint32 src_increment, + uint32 src_x, uint32 src_y, + uint32 x, uint32 y, uint32 w, uint32 h, + uint32 redMask, uint32 greenMask, + uint32 blueMask, + uint32 redShift, uint32 greenShift, + uint32 blueShift); +static void RasterConvert24to32(uint8 *tof, uint32 line_increment, + uint8 *src, uint32 src_increment, + uint32 src_x, uint32 src_y, + uint32 x, uint32 y, uint32 w, uint32 h); +static void RasterConvert32toShort(uint8 *tof, uint32 line_increment, + uint8 *src, uint32 src_increment, + uint32 src_x, uint32 src_y, + uint32 x, uint32 y, uint32 w, uint32 h, + uint32 redMask, uint32 greenMask, + uint32 blueMask, + uint32 redShift, uint32 greenShift, + uint32 blueShift); +static void RasterConvert32to24(uint8 *tof, uint32 line_increment, + uint8 *src, uint32 src_increment, + uint32 src_x, uint32 src_y, + uint32 x, uint32 y, uint32 w, uint32 h); +static void RasterConvertIndextoShort(uint8 *tof, uint32 line_increment, + uint8 *src, uint32 src_increment, + uint32 *pixels, + uint32 src_x, uint32 src_y, + uint32 x, uint32 y, uint32 w, uint32 h, + uint32 redMask, uint32 greenMask, + uint32 blueMask, + uint32 redShift, uint32 greenShift, + uint32 blueShift); +static void RasterConvertIndexto24(uint8 *tof, uint32 line_increment, + uint8 *src, uint32 src_increment, + uint32 *pixels, + uint32 src_x, uint32 src_y, + uint32 x, uint32 y, uint32 w, uint32 h); +static void RasterConvertIndexto32(uint8 *tof, uint32 line_increment, + uint8 *src, uint32 src_increment, + uint32 *pixels, + uint32 src_x, uint32 src_y, + uint32 x, uint32 y, uint32 w, uint32 h); + +static void RasterConvert32to8(uint8 *tof, uint32 line_increment, + uint8 *src, uint32 src_increment, + uint32 src_x, uint32 src_y, + uint32 x, uint32 y, uint32 w, uint32 h, + uint32 redMask, uint32 greenMask, uint32 blueMask, + uint32 redShift, uint32 greenShift, uint32 blueShift); +static void RasterConvert24to8(uint8 *tof, uint32 line_increment, + uint8 *src, uint32 src_increment, + uint32 src_x, uint32 src_y, + uint32 x, uint32 y, uint32 w, uint32 h, + uint32 redMask, uint32 greenMask, uint32 blueMask, + uint32 redShift, uint32 greenShift, uint32 blueShift); +static void RasterConvert16to8(uint8 *tof, uint32 line_increment, + uint8 *src, uint32 src_increment, + uint32 src_x, uint32 src_y, + uint32 x, uint32 y, uint32 w, uint32 h, + uint32 redMask, uint32 greenMask, uint32 blueMask, + int redShift, int greenShift, int blueShift); +static void RasterConvertIndexto8(uint8 *tof, uint32 line_increment, + uint8 *src, uint32 src_increment, uint32 *pixels, + uint32 src_x, uint32 src_y, + uint32 x, uint32 y, uint32 w, uint32 h, + uint32 redMask, uint32 greenMask, uint32 blueMask, + uint32 redShift, uint32 greenShift, uint32 blueShift); +static int RasterGetShiftFromMask(uint32 start, uint32 mask); +static INLINE uint32 RasterShiftPixel(uint32 pixel, int shift); + + +/* + *---------------------------------------------------------------------- + * + * Raster_IsModeReasonable -- + * + * Determine if a mode is something that Raster_Convert* + * can deal with. + * + * Results: + * TRUE if we like the mode. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +Bool +Raster_IsModeReasonable(uint32 depth, uint32 bpp, Bool pseudocolor) +{ + return (pseudocolor && bpp == 8) || (!pseudocolor && + ((bpp == 16 && (depth == 15 || + depth == 16)) || + (bpp == 24 && depth == 24) || + (bpp == 32 && depth == 24))); +} + + +/* + *---------------------------------------------------------------------- + * + * Raster_GetBPPDepth -- + * + * Converts separate depth and bpp values into one "bppdepth." + * See comment above Raster_ConvertPixels(). + * + * Results: + * The bppdepth. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +int +Raster_GetBPPDepth(uint32 depth, uint32 bpp) +{ + if (depth == 24 && bpp == 32) { + return 32; + } else { + return depth; + } +} + + +/* + *---------------------------------------------------------------------- + * + * Raster_ConvertPixels -- + * + * Convert pixels from one depth to another, while copying from + * source to destination. + * + * bppdepth is a unique number specifying the bpp/color-depth, + * like so: + * + * bpp depth bppdepth + * ----------------------- + * 8 3 3 + * 8 6 6 + * 8 8 8 + * 16 15 15 + * 16 16 16 + * 24 24 24 + * 32 24 32 * This is the only one that differs from depth + * + * Results: + * None + * + * Side effects: + * None + * + *---------------------------------------------------------------------- + */ + +void +Raster_ConvertPixels(uint8 *tof, int32 line_increment, int bppdepth, + uint8 *src, int32 src_increment, int src_bppdepth, + Bool pseudoColor, uint32 *pixels, + uint32 src_x, uint32 src_y, + uint32 x, uint32 y, uint32 w, uint32 h) +{ + int redShift,greenShift, blueShift; + + if (pseudoColor) { + if (src_bppdepth > 8) { + Warning("Raster convert pixels invalid depth for pseudo color %d\n", + src_bppdepth); + NOT_IMPLEMENTED(); + return; + } + + switch (bppdepth) { + case 3: case 6: case 8: + redShift = RasterGetShiftFromMask(24, REDMASK_8BPP(bppdepth)); + greenShift = RasterGetShiftFromMask(16, GREENMASK_8BPP(bppdepth)); + blueShift = RasterGetShiftFromMask(8, BLUEMASK_8BPP(bppdepth)); + ASSERT(redShift >= 0 && greenShift >= 0 && blueShift >= 0); + + RasterConvertIndexto8(tof, line_increment, src, src_increment, + pixels, src_x, src_y, x, y, w, h, + REDMASK_8BPP(bppdepth), + GREENMASK_8BPP(bppdepth), + BLUEMASK_8BPP(bppdepth), + redShift, greenShift, blueShift); + break; + + case 15: + RasterConvertIndextoShort(tof, line_increment, src, src_increment, + pixels, src_x, src_y, x, y, w, h, + REDMASK_15, GREENMASK_15, BLUEMASK_15, + 9, 6, 3); + break; + + case 16: + RasterConvertIndextoShort(tof, line_increment, src, src_increment, + pixels, src_x, src_y, x, y, w, h, + REDMASK_16, GREENMASK_16, BLUEMASK_16, + 8, 5, 3); + break; + + case 24: + RasterConvertIndexto24(tof, line_increment, src, src_increment, + pixels, src_x, src_y, x, y, w, h); + break; + + case 32: + RasterConvertIndexto32(tof, line_increment, src, src_increment, + pixels, src_x, src_y, x, y, w, h); + break; + + default: + Warning("Raster convert pixels invalid depth %d\n", bppdepth); + NOT_IMPLEMENTED(); + break; + } + return; + } + + switch (src_bppdepth) { + case 15: + switch (bppdepth) { + case 3: case 6: case 8: + redShift = RasterGetShiftFromMask(15, REDMASK_8BPP(bppdepth)); + greenShift = RasterGetShiftFromMask(10, GREENMASK_8BPP(bppdepth)); + blueShift = RasterGetShiftFromMask(5, BLUEMASK_8BPP(bppdepth)); + + RasterConvert16to8(tof, line_increment, src, src_increment, + src_x, src_y, x, y, w, h, + REDMASK_8BPP(bppdepth), + GREENMASK_8BPP(bppdepth), + BLUEMASK_8BPP(bppdepth), + redShift, greenShift, blueShift); + break; + + case 15: + Warning("Raster convert called when no conversion needed\n"); + NOT_IMPLEMENTED(); + break; + + case 16: + RasterConvert15to16(tof, line_increment, src, src_increment, + src_x, src_y, x, y, w, h); + break; + + case 24: + RasterConvertShortTo24(tof, line_increment, src, src_increment, + src_x, src_y, x, y, w, h, + REDMASK_15, GREENMASK_15, BLUEMASK_15, + 7, 12, 2, 7, 3, 2); + break; + + case 32: + RasterConvertShortTo32(tof, line_increment, src, src_increment, + src_x, src_y, x, y, w, h, + REDMASK_15, GREENMASK_15, BLUEMASK_15, + 7, 12, 2, 7, 3, 2); + break; + + default: + Warning("Raster convert pixels invalid depth %d\n", bppdepth); + NOT_IMPLEMENTED(); + break; + } + break; + + case 16: + switch (bppdepth) { + case 3: case 6: case 8: + redShift = RasterGetShiftFromMask(16, REDMASK_8BPP(bppdepth)); + greenShift = RasterGetShiftFromMask(11, GREENMASK_8BPP(bppdepth)); + blueShift = RasterGetShiftFromMask(5, BLUEMASK_8BPP(bppdepth)); + + RasterConvert16to8(tof, line_increment, src, src_increment, + src_x, src_y, x, y, w, h, + REDMASK_8BPP(bppdepth), + GREENMASK_8BPP(bppdepth), + BLUEMASK_8BPP(bppdepth), + redShift, greenShift, blueShift); + break; + + case 15: + RasterConvert16to15(tof, line_increment, src, src_increment, + src_x, src_y, x, y, w, h); + break; + + case 16: + Warning("Raster convert called when no conversion needed\n"); + NOT_IMPLEMENTED(); + break; + + case 24: + RasterConvertShortTo24(tof, line_increment, src, src_increment, + src_x, src_y, x, y, w, h, + REDMASK_16, GREENMASK_16, BLUEMASK_16, + 8, 13, 3, 9, 3, 2); + break; + + case 32: + RasterConvertShortTo32(tof, line_increment, src, src_increment, + src_x, src_y, x, y, w, h, + REDMASK_16, GREENMASK_16, BLUEMASK_16, + 8, 13, 3, 9, 3, 2); + break; + + default: + Warning("Raster convert pixels invalid depth %d\n", bppdepth); + NOT_IMPLEMENTED(); + break; + } + break; + + case 24: + switch (bppdepth) { + case 3: case 6: case 8: + redShift = RasterGetShiftFromMask(8, REDMASK_8BPP(bppdepth)); + greenShift = RasterGetShiftFromMask(8, GREENMASK_8BPP(bppdepth)); + blueShift = RasterGetShiftFromMask(8, BLUEMASK_8BPP(bppdepth)); + ASSERT(redShift >= 0 && greenShift >= 0 && blueShift >= 0); + + RasterConvert24to8(tof, line_increment, src, src_increment, + src_x, src_y, x, y, w, h, + REDMASK_8BPP(bppdepth), + GREENMASK_8BPP(bppdepth), + BLUEMASK_8BPP(bppdepth), + redShift, greenShift, blueShift); + break; + + case 15: + RasterConvert24toShort(tof, line_increment, src, src_increment, + src_x, src_y, x, y, w, h, + REDMASK_15, GREENMASK_15, BLUEMASK_15, + 7, 2, 3); + break; + + case 16: + RasterConvert24toShort(tof, line_increment, src, src_increment, + src_x, src_y, x, y, w, h, + REDMASK_16, GREENMASK_16, BLUEMASK_16, + 8, 3, 3); + break; + + case 24: + Warning("Raster convert called when no conversion needed\n"); + NOT_IMPLEMENTED(); + break; + + case 32: + RasterConvert24to32(tof, line_increment, src, src_increment, + src_x, src_y, x, y, w, h); + break; + + default: + Warning("Raster convert pixels invalid depth %d\n", bppdepth); + NOT_IMPLEMENTED(); + break; + } + break; + + case 32: + switch (bppdepth) { + case 3: case 6: case 8: + redShift = RasterGetShiftFromMask(24, REDMASK_8BPP(bppdepth)); + greenShift = RasterGetShiftFromMask(16, GREENMASK_8BPP(bppdepth)); + blueShift = RasterGetShiftFromMask(8, BLUEMASK_8BPP(bppdepth)); + ASSERT(redShift >= 0 && greenShift >= 0 && blueShift >= 0); + + RasterConvert32to8(tof, line_increment, src, src_increment, + src_x, src_y, x, y, w, h, + REDMASK_8BPP(bppdepth), + GREENMASK_8BPP(bppdepth), + BLUEMASK_8BPP(bppdepth), + redShift, greenShift, blueShift); + break; + + case 15: + RasterConvert32toShort(tof, line_increment, src, src_increment, + src_x, src_y, x, y, w, h, + REDMASK_15, GREENMASK_15, BLUEMASK_15, + 9, 6, 3); + break; + + case 16: + RasterConvert32toShort(tof, line_increment, src, src_increment, + src_x, src_y, x, y, w, h, + REDMASK_16, GREENMASK_16, BLUEMASK_16, + 8, 5, 3); + break; + + case 24: + RasterConvert32to24(tof, line_increment, src, src_increment, + src_x, src_y, x, y, w, h); + break; + + case 32: + Warning("Raster convert called when no conversion needed\n"); + NOT_IMPLEMENTED(); + break; + + default: + Warning("Raster convert pixels invalid depth %d\n", bppdepth); + NOT_IMPLEMENTED(); + break; + } + break; + + default: + Warning("Raster convert pixels invalid source depth %d\n", src_bppdepth); + NOT_IMPLEMENTED_BUG(10982); + break; + } +} + + +/* + *---------------------------------------------------------------------- + * + * Raster_ConvertOnePixel -- + * + * Convert the given pixel from its current depth to the specified + * depth. + * + * Results: + * The converted pixel + * + * Side effects: + * None + * + *---------------------------------------------------------------------- + */ + +uint32 +Raster_ConvertOnePixel(uint32 pix, int src_bppdepth, int bppdepth, + Bool pseudoColor, uint32 *pixels) +{ + if (pseudoColor) { + if (src_bppdepth != 8) { + Warning("Raster convert pixels invalid depth for pseudo color %d\n", + src_bppdepth); + NOT_IMPLEMENTED(); + return 0; + } + pix = pixels[pix]; + src_bppdepth = 32; + } + + switch (src_bppdepth) { + case 15: + switch (bppdepth) { + case 3: case 6: case 8: + return CONVERT_LONG_TO_8BGR(pix, REDMASK_8BPP(bppdepth), + GREENMASK_8BPP(bppdepth), + BLUEMASK_8BPP(bppdepth), 12, 4, 3); + + case 15: + return pix; + + case 16: + return ((pix & (REDMASK_15 | GREENMASK_15)) << 1) | + ((pix & GREEN_HIBIT_15) >> GREEN_HILOSHIFT_15) | + (pix & BLUEMASK_16); + + case 24: + case 32: + return CONVERT_SHORT_TO_LONG(pix, REDMASK_15, GREENMASK_15, + BLUEMASK_15, 7, 12, 2, 7, 3, 2); + + default: + Warning("Raster convert one pixel invalid depth %d\n", bppdepth); + NOT_IMPLEMENTED(); + return 0; + } + + case 16: + switch (bppdepth) { + case 3: case 6: case 8: + return CONVERT_LONG_TO_8BGR(pix, REDMASK_8BPP(bppdepth), + GREENMASK_8BPP(bppdepth), + BLUEMASK_8BPP(bppdepth), 13, 5, 3); + + case 15: + return ((pix >> 1) & (REDMASK_15 | GREENMASK_15)) | + (pix & BLUEMASK_15); + + case 16: + return pix; + + case 24: + case 32: + return CONVERT_SHORT_TO_LONG(pix, REDMASK_16, GREENMASK_16, + BLUEMASK_16, 8, 13, 3, 9, 3, 2); + + default: + Warning("Raster convert one pixel invalid depth %d\n", bppdepth); + NOT_IMPLEMENTED(); + return 0; + } + + case 24: + case 32: + switch (bppdepth) { + case 3: case 6: case 8: + return CONVERT_LONG_TO_8BGR(pix, REDMASK_8BPP(bppdepth), + GREENMASK_8BPP(bppdepth), + BLUEMASK_8BPP(bppdepth), 21, 10, 0); + + case 15: + return CONVERT_LONG_TO_SHORT(pix, REDMASK_15, GREENMASK_15, + BLUEMASK_15, 9, 6, 3); + + case 16: + return CONVERT_LONG_TO_SHORT(pix, REDMASK_16, GREENMASK_16, + BLUEMASK_16, 8, 5, 3); + + case 24: + case 32: + return pix; + + default: + Warning("Raster convert one pixel invalid depth %d\n", bppdepth); + NOT_IMPLEMENTED(); + return 0; + } + + default: + Warning("Raster convert one pixel invalid source depth %d\n", + src_bppdepth); + NOT_IMPLEMENTED(); + return 0; + } + + return pix; +} + + +/* + *---------------------------------------------------------------------- + * + * Raster_ConversionParameters -- + * + * Get component masks that the conversion routines use for the + * supported depths + * + * Results: + * Returns FALSE if depth not supported + * + * Side effects: + * None + * + *---------------------------------------------------------------------- + */ + +Bool +Raster_ConversionParameters(int bppdepth, uint32 *redMask, + uint32 *greenMask, uint32 *blueMask) +{ + switch (bppdepth) { + case 15: + *redMask = REDMASK_15; + *greenMask = GREENMASK_15; + *blueMask = BLUEMASK_15; + break; + + case 16: + *redMask = REDMASK_16; + *greenMask = GREENMASK_16; + *blueMask = BLUEMASK_16; + break; + + case 24: + *redMask = REDMASK_24; + *greenMask = GREENMASK_24; + *blueMask = BLUEMASK_24; + break; + + case 32: + *redMask = REDMASK_32; + *greenMask = GREENMASK_32; + *blueMask = BLUEMASK_32; + break; + + default: + return FALSE; + } + + return TRUE; +} + + +/* + *---------------------------------------------------------------------- + * + * RasterConvert15to16 -- + * + * Convert pixels from depth 15 to depth 16, while copying from + * source to destination. + * + * Results: + * None + * + * Side effects: + * None + * + *---------------------------------------------------------------------- + */ + +static void +RasterConvert15to16(uint8 *tof, uint32 line_increment, + uint8 *src, uint32 src_increment, + uint32 src_x, uint32 src_y, + uint32 x, uint32 y, uint32 w, uint32 h) +{ + uint16 *srcptr, *dstptr; + int i, j; + + src_increment >>= 1; + srcptr = (uint16 *)src; + srcptr += (src_y * src_increment) + src_x; + + line_increment >>= 1; + dstptr = (uint16 *)tof; + dstptr += (y * line_increment) + x; + + for (i=0; i> GREEN_HILOSHIFT_15) | + (pix & BLUEMASK_16); + } + srcptr += src_increment; + dstptr += line_increment; + } +} + + +/* + *---------------------------------------------------------------------- + * + * RasterConvertShortTo24 -- + * + * Convert pixels from depth 15 or 16 to depth 24, while copying + * from source to destination. + * + * Results: + * None + * + * Side effects: + * None + * + *---------------------------------------------------------------------- + */ + +static void +RasterConvertShortTo24(uint8 *tof, uint32 line_increment, + uint8 *src, uint32 src_increment, + uint32 src_x, uint32 src_y, + uint32 x, uint32 y, uint32 w, uint32 h, + uint32 redMask, uint32 greenMask, uint32 blueMask, + uint32 redShift1, uint32 redShift2, + uint32 greenShift1, uint32 greenShift2, + uint32 blueShift1, uint32 blueShift2) +{ + uint16 *srcptr; + uint8 *dstptr; + int i, j, k; + + src_increment >>= 1; + srcptr = (uint16 *)src; + srcptr += (src_y * src_increment) + src_x; + + dstptr = tof; + dstptr += (y * line_increment) + (x * 3); + + for (i=0; i> blueShift2); + dstptr[k++] = ((pix & greenMask) >> greenShift1) | + ((pix & greenMask) >> greenShift2); + dstptr[k++] = ((pix & redMask) >> redShift1) | + ((pix & redMask) >> redShift2); + } + srcptr += src_increment; + dstptr += line_increment; + } +} + + +/* + *---------------------------------------------------------------------- + * + * RasterConvertShortTo32 -- + * + * Convert pixels from depth 15 or 16 to depth 32, while copying + * from source to destination. + * + * Results: + * None + * + * Side effects: + * None + * + *---------------------------------------------------------------------- + */ + +static void +RasterConvertShortTo32(uint8 *tof, uint32 line_increment, + uint8 *src, uint32 src_increment, + uint32 src_x, uint32 src_y, + uint32 x, uint32 y, uint32 w, uint32 h, + uint32 redMask, uint32 greenMask, uint32 blueMask, + uint32 redShift1, uint32 redShift2, + uint32 greenShift1, uint32 greenShift2, + uint32 blueShift1, uint32 blueShift2) +{ + uint16 *srcptr; + uint32 *dstptr; + int i, j; + + src_increment >>= 1; + srcptr = (uint16 *)src; + srcptr += (src_y * src_increment) + src_x; + + line_increment >>= 2; + dstptr = (uint32 *)tof; + dstptr += (y * line_increment) + x; + + for (i=0; i> redShift1) | + ((pix & redMask) >> redShift2)) << 16)) | + (GREENMASK_32 & + ((((pix & greenMask) >> greenShift1) | + ((pix & greenMask) >> greenShift2)) << 8)) | + (BLUEMASK_32 & + (((pix & blueMask) << blueShift1) | + ((pix & blueMask) >> blueShift2))); + } + srcptr += src_increment; + dstptr += line_increment; + } +} + + +/* + *---------------------------------------------------------------------- + * + * RasterConvert16to15 -- + * + * Convert pixels from depth 16 to depth 15, while copying from + * source to destination. + * + * Results: + * None + * + * Side effects: + * None + * + *---------------------------------------------------------------------- + */ + +static void +RasterConvert16to15(uint8 *tof, uint32 line_increment, + uint8 *src, uint32 src_increment, + uint32 src_x, uint32 src_y, + uint32 x, uint32 y, uint32 w, uint32 h) +{ + uint16 *srcptr, *dstptr; + int i, j; + + src_increment >>= 1; + srcptr = (uint16 *)src; + srcptr += (src_y * src_increment) + src_x; + + line_increment >>= 1; + dstptr = (uint16 *)tof; + dstptr += (y * line_increment) + x; + + for (i=0; i> 1) & (REDMASK_15 | GREENMASK_15)) | + (pix & BLUEMASK_15); + } + srcptr += src_increment; + dstptr += line_increment; + } +} + + +/* + *---------------------------------------------------------------------- + * + * RasterConvert24toShort -- + * + * Convert pixels from depth 24 to depth 15 or 16, while copying + * from source to destination. + * + * Results: + * None + * + * Side effects: + * None + * + *---------------------------------------------------------------------- + */ + +static void +RasterConvert24toShort(uint8 *tof, uint32 line_increment, + uint8 *src, uint32 src_increment, + uint32 src_x, uint32 src_y, + uint32 x, uint32 y, uint32 w, uint32 h, + uint32 redMask, uint32 greenMask, uint32 blueMask, + uint32 redShift, uint32 greenShift, uint32 blueShift) +{ + uint8 *srcptr; + uint16 *dstptr; + int i, j, k; + + srcptr = src; + srcptr += (src_y * src_increment) + (src_x * 3); + + line_increment >>= 1; + dstptr = (uint16 *)tof; + dstptr += (y * line_increment) + x; + + for (i=0; i> blueShift) & blueMask); + } + srcptr += src_increment; + dstptr += line_increment; + } +} + + +/* + *---------------------------------------------------------------------- + * + * RasterConvert24to32 -- + * + * Convert pixels from depth 24 to depth 32, while copying + * from source to destination. + * + * Results: + * None + * + * Side effects: + * None + * + *---------------------------------------------------------------------- + */ + +static void +RasterConvert24to32(uint8 *tof, uint32 line_increment, + uint8 *src, uint32 src_increment, + uint32 src_x, uint32 src_y, + uint32 x, uint32 y, uint32 w, uint32 h) +{ + uint8 *srcptr; + uint32 *dstptr; + int i, j, k; + + srcptr = src; + srcptr += (src_y * src_increment) + (src_x * 3); + + line_increment >>= 2; + dstptr = (uint32 *)tof; + dstptr += (y * line_increment) + x; + + for (i=0; i>= 2; + srcptr = (uint32 *)src; + srcptr += (src_y * src_increment) + src_x; + + line_increment >>= 1; + dstptr = (uint16 *)tof; + dstptr += (y * line_increment) + x; + + for (i=0; i> redShift)) | + (greenMask & (pix >> greenShift)) | + (blueMask & (pix >> blueShift)); + } + srcptr += src_increment; + dstptr += line_increment; + } +} + + +/* + *---------------------------------------------------------------------- + * + * RasterConvert32to24 -- + * + * Convert pixels from depth 32 to depth 24, while copying + * from source to destination. + * + * Results: + * None + * + * Side effects: + * None + * + *---------------------------------------------------------------------- + */ + +static void +RasterConvert32to24(uint8 *tof, uint32 line_increment, + uint8 *src, uint32 src_increment, + uint32 src_x, uint32 src_y, + uint32 x, uint32 y, uint32 w, uint32 h) +{ + uint32 *srcptr; + uint8 *dstptr; + int i, j, k; + + src_increment >>= 2; + srcptr = (uint32 *)src; + srcptr += (src_y * src_increment) + src_x; + + dstptr = tof; + dstptr += (y * line_increment) + (x * 3); + + for (i=0; i> 8; + dstptr[k++] = (pix & REDMASK_32) >> 16; + } + srcptr += src_increment; + dstptr += line_increment; + } +} + + +/* + *---------------------------------------------------------------------- + * + * RasterConvertIndexto8 -- + * + * Convert pixels from pseudo color values to depth 8 true color while + * copying from source to destination. + * BGR233: redShift: 21 greenShift: 10 blueShift: 0 + * + * Results: + * None + * + * Side effects: + * None + * + *---------------------------------------------------------------------- + */ + +static void +RasterConvertIndexto8(uint8 *tof, uint32 line_increment, + uint8 *src, uint32 src_increment, uint32 *pixels, + uint32 src_x, uint32 src_y, + uint32 x, uint32 y, uint32 w, uint32 h, + uint32 redMask, uint32 greenMask, uint32 blueMask, + uint32 redShift, uint32 greenShift, uint32 blueShift) +{ + uint8 *srcptr; + uint8 *dstptr; + int i, j; + + srcptr = src; + srcptr += (src_y * src_increment) + src_x; + + dstptr = (uint8 *)tof; + dstptr += (y * line_increment) + x; + + for (i=0; i> redShift)) | + (greenMask & (pix >> greenShift)) | + (blueMask & (pix >> blueShift)); + } + srcptr += src_increment; + dstptr += line_increment; + } +} + + +/* + *---------------------------------------------------------------------- + * + * RasterConvertIndextoShort -- + * + * Convert pixels from pseudo color values to depth 15 or 16, while + * copying from source to destination. + * + * Results: + * None + * + * Side effects: + * None + * + *---------------------------------------------------------------------- + */ + +static void +RasterConvertIndextoShort(uint8 *tof, uint32 line_increment, + uint8 *src, uint32 src_increment, uint32 *pixels, + uint32 src_x, uint32 src_y, + uint32 x, uint32 y, uint32 w, uint32 h, + uint32 redMask, uint32 greenMask, uint32 blueMask, + uint32 redShift, uint32 greenShift, uint32 blueShift) +{ + uint8 *srcptr; + uint16 *dstptr; + int i, j; + + srcptr = src; + srcptr += (src_y * src_increment) + src_x; + + line_increment >>= 1; + dstptr = (uint16 *)tof; + dstptr += (y * line_increment) + x; + + for (i=0; i> redShift)) | + (greenMask & (pix >> greenShift)) | + (blueMask & (pix >> blueShift)); + } + srcptr += src_increment; + dstptr += line_increment; + } +} + + +/* + *---------------------------------------------------------------------- + * + * RasterConvertIndexto24 -- + * + * Convert pixels from pseudo color values to depth 24, while copying + * from source to destination. + * + * Results: + * None + * + * Side effects: + * None + * + *---------------------------------------------------------------------- + */ + +static void +RasterConvertIndexto24(uint8 *tof, uint32 line_increment, + uint8 *src, uint32 src_increment, uint32 *pixels, + uint32 src_x, uint32 src_y, + uint32 x, uint32 y, uint32 w, uint32 h) +{ + uint8 *srcptr; + uint8 *dstptr; + int i, j, k; + + srcptr = src; + srcptr += (src_y * src_increment) + src_x; + + dstptr = tof; + dstptr += (y * line_increment) + (x * 3); + + for (i=0; i> 8; + dstptr[k++] = (pix & REDMASK_32) >> 16; + } + srcptr += src_increment; + dstptr += line_increment; + } +} + + +/* + *---------------------------------------------------------------------- + * + * RasterConvertIndexto32 -- + * + * Convert pixels from pseudo color values to depth 32, while copying + * from source to destination. + * + * Results: + * None + * + * Side effects: + * None + * + *---------------------------------------------------------------------- + */ + +static void +RasterConvertIndexto32(uint8 *tof, uint32 line_increment, + uint8 *src, uint32 src_increment, uint32 *pixels, + uint32 src_x, uint32 src_y, + uint32 x, uint32 y, uint32 w, uint32 h) +{ + uint8 *srcptr; + uint32 *dstptr; + int i, j; + + srcptr = src; + srcptr += (src_y * src_increment) + src_x; + + line_increment >>= 2; + dstptr = (uint32 *)tof; + dstptr += (y * line_increment) + x; + + for (i=0; i>= 2; + srcptr = (uint32 *)src; + srcptr += (src_y * src_increment) + src_x; + + dstptr = (uint8 *)tof; + dstptr += (y * line_increment) + x; + + for (i=0; i> redShift)) | + (greenMask & (pix >> greenShift)) | + (blueMask & (pix >> blueShift)); + } + srcptr += src_increment; + dstptr += line_increment; + } +} + + +/* + *---------------------------------------------------------------------- + * + * RasterConvert24to8 -- + * + * Convert pixels from depth 24 to depth 8, while copying + * from source to destination. + * BGR233: redShift: 5 greenShift: 2 blueShift: 0 + * + * Results: + * None + * + * Side effects: + * None + * + *---------------------------------------------------------------------- + */ + +static void +RasterConvert24to8(uint8 *tof, uint32 line_increment, + uint8 *src, uint32 src_increment, + uint32 src_x, uint32 src_y, + uint32 x, uint32 y, uint32 w, uint32 h, + uint32 redMask, uint32 greenMask, uint32 blueMask, + uint32 redShift, uint32 greenShift, uint32 blueShift) +{ + uint8 *srcptr; + uint8 *dstptr; + int i, j, k; + + srcptr = src; + srcptr += (src_y * src_increment) + (src_x * 3); + + dstptr = (uint8 *)tof; + dstptr += (y * line_increment) + x; + + for (i=0; i> redShift) & redMask) | + ((green >> greenShift) & greenMask) | + ((blue >> blueShift) & blueMask); + } + srcptr += src_increment; + dstptr += line_increment; + } +} + + +/* + *---------------------------------------------------------------------- + * + * RasterConvert16to8 -- + * + * Convert pixels from depth 16/15 to depth 8 BGR, while copying from + * source to destination. + * For BGR233 and depth 16: redShift:13 greenShift:5 + * blueShift:3 Shift left + * For BGR233 and depth 15: redShift:12 greenShift:4 + * blueShift:3 Shift left + * + * Results: + * None + * + * Side effects: + * None + * + *---------------------------------------------------------------------- + */ + +static void +RasterConvert16to8(uint8 *tof, uint32 line_increment, + uint8 *src, uint32 src_increment, + uint32 src_x, uint32 src_y, + uint32 x, uint32 y, uint32 w, uint32 h, + uint32 redMask, uint32 greenMask, uint32 blueMask, + int redShift, int greenShift, int blueShift) +{ + uint16 *srcptr; + uint8 *dstptr; + int i, j; + + src_increment >>= 1; + srcptr = (uint16 *)src; + srcptr += (src_y * src_increment) + src_x; + + dstptr = (uint8 *)tof; + dstptr += (y * line_increment) + x; + + for (i=0; i> 1; + num++; + } + + return (int)start - (int)num; +} + + +/* + *---------------------------------------------------------------------- + * + * RasterShiftPixel -- + * + * Shift the pixel. If the shift is negative, shift to left, + * other, shift to right. + * + * Results: + * The shifted data + * + * Side effects: + * None + * + *---------------------------------------------------------------------- + */ + +uint32 +RasterShiftPixel(uint32 pixel, int shift) +{ + if (shift < 0) { + return pixel << -shift; + } else { + return pixel >> shift; + } +} diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/region/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/region/Makefile.am --- open-vm-tools-2008.01.23-74039/lib/region/Makefile.am 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/region/Makefile.am 2008-10-13 08:01:48.000000000 +0100 @@ -0,0 +1,21 @@ +################################################################################ +### Copyright 2008 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_LIBRARIES = libRegion.a + +libRegion_a_SOURCES = +libRegion_a_SOURCES += region.c diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/region/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/region/Makefile.in --- open-vm-tools-2008.01.23-74039/lib/region/Makefile.in 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/region/Makefile.in 2008-10-13 08:02:14.000000000 +0100 @@ -0,0 +1,494 @@ +# 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 2008 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/region +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)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) +ARFLAGS = cru +libRegion_a_AR = $(AR) $(ARFLAGS) +libRegion_a_LIBADD = +am_libRegion_a_OBJECTS = region.$(OBJEXT) +libRegion_a_OBJECTS = $(am_libRegion_a_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 = $(libRegion_a_SOURCES) +DIST_SOURCES = $(libRegion_a_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_XLIBS = @COMMON_XLIBS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ +DNET_LIBS = @DNET_LIBS@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ +GTK_LIBS = @GTK_LIBS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ +HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ +MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ +RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ +VERSION = @VERSION@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +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@ +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@ +lt_ECHO = @lt_ECHO@ +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_LIBRARIES = libRegion.a +libRegion_a_SOURCES = region.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/region/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu lib/region/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-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) +libRegion.a: $(libRegion_a_OBJECTS) $(libRegion_a_DEPENDENCIES) + -rm -f libRegion.a + $(libRegion_a_AR) libRegion.a $(libRegion_a_OBJECTS) $(libRegion_a_LIBADD) + $(RANLIB) libRegion.a + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/region.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 $(LIBRARIES) +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-noinstLIBRARIES \ + 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-noinstLIBRARIES 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: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/region/region.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/region/region.c --- open-vm-tools-2008.01.23-74039/lib/region/region.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/region/region.c 2008-10-13 08:01:52.000000000 +0100 @@ -0,0 +1,3085 @@ +/* ********************************************************** + * Copyright (C) 2002 VMware, Inc. + * All Rights Reserved + * **********************************************************/ + +/* $XFree86: xc/programs/Xserver/mi/miregion.c,v 1.8 2001/12/14 20:00:26 dawes Exp $ */ +/*********************************************************** + +Copyright 1987, 1988, 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +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 +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + + +Copyright 1987, 1988, 1989 by +Digital Equipment Corporation, Maynard, Massachusetts. + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Digital not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +DIGITAL BE LIABLE FOR 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. + +******************************************************************/ +/* $Xorg: miregion.c,v 1.4 2001/02/09 02:05:21 xorgcvs Exp $ */ + +/* The panoramix components contained the following notice */ +/***************************************************************** + +Copyright (c) 1991, 1997 Digital Equipment Corporation, Maynard, Massachusetts. + +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. + +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 +DIGITAL EQUIPMENT CORPORATION BE LIABLE FOR ANY CLAIM, DAMAGES, INCLUDING, +BUT NOT LIMITED TO CONSEQUENTIAL OR INCIDENTAL DAMAGES, OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of Digital Equipment Corporation +shall not be used in advertising or otherwise to promote the sale, use or other +dealings in this Software without prior written authorization from Digital +Equipment Corporation. + +******************************************************************/ + +/* + * miregion.c -- + * + * This is a slightly modified copy of miregion.c from the XFree86 4.3.0 + * distribution: See http://www.xfree86.org, and the file + * xc/programs/Xserver/mi/miregion.c. + * + * ChangeLog: + * + * 07/10/2003 rrdharan - removed X11 dependencies + * - added prototype declarations for + * miSetExtents and miFindMaxBands to prevent + * compilation warnings + * - #define assert ASSERT + * - added FILECODE and comments + * 09/01/2003 rrdharan - added initial support for accelerated + * operations: all rectangles now have a + * RectInfo struct associated with them that + * contains metadata for the rectangle. See the + * explanation of extensions below. + * 08/02/2005 akan - fixed conflicting definition of MINSHORT + * and MAXSHORT with winnt.h + * 04/03/2007 shelleygong - use int instead of short for data + * inside the region * + */ + +#include +#include + +#include "region.h" + +void miSetExtents(RegionPtr pReg); +int miFindMaxBand(RegionPtr prgn); + +#define good(reg) ASSERT(miValidRegion(reg)) + +/* + * The functions in this file implement the Region abstraction used extensively + * throughout the X11 sample server. A Region is simply a set of disjoint + * (non-overlapping) rectangles, plus an "extent" rectangle which is the + * smallest single rectangle that contains all the non-overlapping rectangles. + * + * A Region is implemented as a "y-x-banded" array of rectangles. This array + * imposes two degrees of order. First, all rectangles are sorted by top side + * y coordinate first (y1), and then by left side x coordinate (x1). + * + * Furthermore, the rectangles are grouped into "bands". Each rectangle in a + * band has the same top y coordinate (y1), and each has the same bottom y + * coordinate (y2). Thus all rectangles in a band differ only in their left + * and right side (x1 and x2). Bands are implicit in the array of rectangles: + * there is no separate list of band start pointers. + * + * The y-x band representation does not minimize rectangles. In particular, + * if a rectangle vertically crosses a band (the rectangle has scanlines in + * the y1 to y2 area spanned by the band), then the rectangle may be broken + * down into two or more smaller rectangles stacked one atop the other. + * + * ----------- ----------- + * | | | | band 0 + * | | -------- ----------- -------- + * | | | | in y-x banded | | | | band 1 + * | | | | form is | | | | + * ----------- | | ----------- -------- + * | | | | band 2 + * -------- -------- + * + * An added constraint on the rectangles is that they must cover as much + * horizontal area as possible: no two rectangles within a band are allowed + * to touch. + * + * Whenever possible, bands will be merged together to cover a greater vertical + * distance (and thus reduce the number of rectangles). Two bands can be merged + * only if the bottom of one touches the top of the other and they have + * rectangles in the same places (of the same width, of course). + * + * Adam de Boor wrote most of the original region code. Joel McCormack + * substantially modified or rewrote most of the core arithmetic routines, + * and added miRegionValidate in order to support several speed improvements + * to miValidateTree. Bob Scheifler changed the representation to be more + * compact when empty or a single rectangle, and did a bunch of gratuitous + * reformatting. + */ + +/* + * Accelerated Operation Support (09/03/03, rrdharan): + * + * We've extended the region code to support regions consisting of a mix + * of update rectangles and "accelerated" operations (e.g. Fill). The + * way it works is pretty straightforward, and the behavior should be + * identical to the original region code when only update rectangles are + * involved. + * + * Each rectangle now has a RectInfo structure member; this structure + * indicates the type of the rectangle and carries any relevant metadata, + * e.g. for a Fill, the rop and color. For each region operator, e.g. + * miUnion, miIntersect, we treat the two source operands as layers, + * where the first operand is the bottom layer and the second is the top. + * Operations in the top layer stencil out the bottom layer. Note that we + * still maintain the fundamental banding property of the regions. + * + * For clarification, consider the example below, where region 1 (the + * bottom layer) consists of two updates and region 2 (the top layer) + * consists of two fills. The union of the two regions results in a new + * region where the fill operations have been stencilled into the + * previous update rectangles, producing a new list of updates and fills. + * The chief advantage of this approach is that it provides + * order-independence; i.e. after any region operation has completed, + * we can scan out the contents of the region and mapp the rectangles + * onto their corresponding drawing operations in any order and still end + * up with the correct result. + * + * Note that because we still enforce the banding rules, we pass up + * opportunities for further optimization, (see comments on this in the + * original documentation above). + * + * Region 1 (bottom): Region 2 (top): + * + * ----------------------- ----------------------- + * |------------ | | | + * ||U | | | | + * || | | | -------------- | + * |------------ | | |F | | + * | | | | | | + * | | (union) | | | | + * | -------------| | -------------- | + * | |U || | | + * | | || | ------ | + * | | || | |F | | + * | -------------| | ------ | + * ----------------------- ----------------------- + * + * + * = New Region: + * + * ----------------------- + * |------------ | + * ||U | | + * ||---------------- | + * ||U |F | | + * |----------------- | + * | |F | | + * | -------------- | + * | -------------| + * | |U || + * | |-----------|| + * | |U |F ||| + * | -------------| + * ----------------------- + * + */ + +/* true iff two Boxes overlap */ +#define EXTENTCHECK RECT_EXTENTCHECK + +/* true iff (x,y) is in Box */ +#define INBOX(r,x,y) \ + ( ((r)->x2 > x) && \ + ((r)->x1 <= x) && \ + ((r)->y2 > y) && \ + ((r)->y1 <= y) ) + +/* true iff Box r1 contains Box r2 */ +#define SUBSUMES(r1,r2) \ + ( ((r1)->x1 <= (r2)->x1) && \ + ((r1)->x2 >= (r2)->x2) && \ + ((r1)->y1 <= (r2)->y1) && \ + ((r1)->y2 >= (r2)->y2) ) + +#define min(a, b) (((a) < (b)) ? (a) : (b)) +#define max(a, b) (((a) > (b)) ? (a) : (b)) + +#define xallocData(n) (RegDataPtr)malloc(REGION_SZOF(n)) +#define xfreeData(reg) if ((reg)->data && (reg)->data->size) \ + free((reg)->data) + +#define RECTALLOC_BAIL(pReg,n,bail) \ +if (!(pReg)->data || (((pReg)->data->numRects + (n)) > (pReg)->data->size)) \ + if (!miRectAlloc(pReg, n)) { goto bail; } + +#define RECTALLOC(pReg,n) \ +if (!(pReg)->data || (((pReg)->data->numRects + (n)) > (pReg)->data->size)) \ + if (!miRectAlloc(pReg, n)) { return FALSE; } + +#define ADDRECT(pNextRect,nx1,ny1,nx2,ny2,inf) \ +{ \ + pNextRect->x1 = nx1; \ + pNextRect->y1 = ny1; \ + pNextRect->x2 = nx2; \ + pNextRect->y2 = ny2; \ + pNextRect->info = inf; \ + pNextRect++; \ +} + +#define NEWRECT(pReg,pNextRect,nx1,ny1,nx2,ny2,inf) \ +{ \ + if (!(pReg)->data || ((pReg)->data->numRects == (pReg)->data->size))\ + { \ + if (!miRectAlloc(pReg, 1)) \ + return FALSE; \ + pNextRect = REGION_TOP(pReg); \ + } \ + ADDRECT(pNextRect,nx1,ny1,nx2,ny2,inf); \ + pReg->data->numRects++; \ + ASSERT(pReg->data->numRects<=pReg->data->size); \ +} + + +#define DOWNSIZE(reg,numRects) \ +if (((numRects) < ((reg)->data->size >> 1)) && ((reg)->data->size > 50)) \ +{ \ + RegDataPtr NewData; \ + NewData = (RegDataPtr)xrealloc((reg)->data, REGION_SZOF(numRects)); \ + if (NewData) \ + { \ + NewData->size = (numRects); \ + (reg)->data = NewData; \ + } \ +} + +BoxRec miEmptyBox = {0, 0, 0, 0}; +RegDataRec miEmptyData = {0, 0}; + +RegDataRec miBrokenData = {0, 0}; +RegionRec miBrokenRegion = { { 0, 0, 0, 0 }, &miBrokenData }; + + +int +miPrintRegion(RegionPtr rgn) +{ + int num, size; + register int i; + BoxPtr rects; + + num = REGION_NUM_RECTS(rgn); + size = REGION_SIZE(rgn); + rects = REGION_RECTS(rgn); + Warning("num: %d size: %d\n", num, size); + Warning("extents: %d %d %d %d\n", + rgn->extents.x1, rgn->extents.y1, rgn->extents.x2, rgn->extents.y2); + for (i = 0; i < num; i++) { + Warning("%4d %4d %4d %4d", + rects[i].x1, rects[i].y1, rects[i].x2, rects[i].y2); + switch(rects[i].info.type) { + case UpdateRect: + Warning(" UpdateRect "); + break; + case ROPFillRect: + Warning(" ROPFillRect 0x%08x", rects[i].info.ROPFill.color); + break; + case Present3dRect: + Warning(" Present3DRect 0x%x src(%d, %d)", + rects[i].info.Present3d.sid, + rects[i].info.Present3d.srcx, rects[i].info.Present3d.srcy); + break; + default: + Warning(" UNKNOWN!"); + break; + } + Warning("\n"); + } + Warning("\n"); + return(num); +} + + +/* + *---------------------------------------------------------------------------- + * + * miRectInfosEqual -- + * + * Takes pointers to two RectInfo structures and compares them for + * equality based on their type and data: e.g. updates are always equal, + * fills are equal only if the rop and color match. + * + * Results: + * TRUE if the two RectInfo structures match, FALSE otherwise. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +static INLINE Bool +miRectInfosEqual(RectInfo *info1, + RectInfo *info2) +{ + if (info1->type != info2->type) { + return FALSE; + } + + switch (info1->type) { + case UpdateRect: + return TRUE; + case ROPFillRect: + return (info1->ROPFill.rop == info2->ROPFill.rop && + info1->ROPFill.color == info2->ROPFill.color); + case Present3dRect: + return (info1->Present3d.sid == info2->Present3d.sid && + info1->Present3d.srcx == info2->Present3d.srcx && + info1->Present3d.srcy == info2->Present3d.srcy); + default: + NOT_IMPLEMENTED(); + } +} + + +/* + *---------------------------------------------------------------------------- + * + * miRectInfosVertAdjacent -- + * + * Takes pointers to two RectInfo structures of type Present3dRect and + * decides whether they're vertically mergeable (same sid, same srcx, + * srcy adjacent). + * + * Results: + * TRUE if the two RectInfo structures are adjacent, FALSE otherwise. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +static INLINE Bool +miRectInfosVertAdjacent(RectInfo *info1, + int y1, + RectInfo *info2, + int y2) +{ + if (info1->type == Present3dRect && info2->type == Present3dRect) { + return (info1->Present3d.sid == info2->Present3d.sid && + info1->Present3d.srcx == info2->Present3d.srcx && + info1->Present3d.srcy - y1 == info2->Present3d.srcy - y2); + } else { + return miRectInfosEqual(info1, info2); + } +} + + +/* + *---------------------------------------------------------------------------- + * + * miRectInfosHorzAdjacent -- + * + * Takes pointers to two RectInfo structures of type Present3dRect + * and decides whether they're horizontally mergeable (same sid, + * same srcy, srcx adjacent). + * + * Results: + * TRUE if the two RectInfo structures are adjacent, FALSE otherwise. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +static INLINE Bool +miRectInfosHorzAdjacent(RectInfo *info1, + int x1, + RectInfo *info2, + int x2) +{ + if (info1->type == Present3dRect && info2->type == Present3dRect) { + return (info1->Present3d.sid == info2->Present3d.sid && + info1->Present3d.srcx - x1 == info2->Present3d.srcx - x2 && + info1->Present3d.srcy == info2->Present3d.srcy); + } else { + return miRectInfosEqual(info1, info2); + } +} + + +/* + *---------------------------------------------------------------------------- + * + * miRectInfoAdjustForSplit -- + * + * Adjusts the type-specific data in the RectInfo to be correct + * for a split that moves the upper left corner of the associated + * rectangle from (oldX, oldY) to (newX, newY). + * + * Results: + * None. + * + * Side effects: + * Fiddles with *info as described above. + * + *---------------------------------------------------------------------------- + */ + +static INLINE void +miRectInfoAdjustForSplit(RectInfo *info, + int oldX, + int oldY, + int newX, + int newY) +{ + ASSERT(newX >= oldX); + ASSERT(newY >= oldY); + + if (info->type == Present3dRect) { + info->Present3d.srcx += newX - oldX; + info->Present3d.srcy += newY - oldY; + } +} + + +Bool +miRegionsEqual(RegionPtr reg1, + RegionPtr reg2) +{ + int i; + BoxPtr rects1, rects2; + + if (reg1->extents.x1 != reg2->extents.x1) return FALSE; + if (reg1->extents.x2 != reg2->extents.x2) return FALSE; + if (reg1->extents.y1 != reg2->extents.y1) return FALSE; + if (reg1->extents.y2 != reg2->extents.y2) return FALSE; + if (REGION_NUM_RECTS(reg1) != REGION_NUM_RECTS(reg2)) return FALSE; + + rects1 = REGION_RECTS(reg1); + rects2 = REGION_RECTS(reg2); + for (i = 0; i != REGION_NUM_RECTS(reg1); i++) { + if (rects1[i].x1 != rects2[i].x1) return FALSE; + if (rects1[i].x2 != rects2[i].x2) return FALSE; + if (rects1[i].y1 != rects2[i].y1) return FALSE; + if (rects1[i].y2 != rects2[i].y2) return FALSE; + if (!miRectInfosEqual(&rects1[i].info, &rects2[i].info)) return FALSE; + } + return TRUE; +} + + +Bool +miValidRegion(RegionPtr reg) +{ + register int i, numRects; + + if ((reg->extents.x1 > reg->extents.x2) || + (reg->extents.y1 > reg->extents.y2)) + return FALSE; + numRects = REGION_NUM_RECTS(reg); + if (!numRects) + return ((reg->extents.x1 == reg->extents.x2) && + (reg->extents.y1 == reg->extents.y2) && + (reg->data->size || (reg->data == &miEmptyData))); + else if (numRects == 1) + return (RECTINFO_ISVALID((reg->extents.info)) && !reg->data); + else + { + register BoxPtr pboxP, pboxN; + BoxRec box; + + pboxP = REGION_RECTS(reg); + box = *pboxP; + box.y2 = pboxP[numRects-1].y2; + pboxN = pboxP + 1; + for (i = numRects; --i > 0; pboxP++, pboxN++) + { + if (!RECTINFO_ISVALID(pboxP->info)) { + return FALSE; + } + if ((pboxN->x1 >= pboxN->x2) || + (pboxN->y1 >= pboxN->y2)) + return FALSE; + if (pboxN->x1 < box.x1) + box.x1 = pboxN->x1; + if (pboxN->x2 > box.x2) + box.x2 = pboxN->x2; + if ((pboxN->y1 < pboxP->y1) || + ((pboxN->y1 == pboxP->y1) && + ((pboxN->x1 < pboxP->x2) || (pboxN->y2 != pboxP->y2)))) + return FALSE; + } + return ((box.x1 == reg->extents.x1) && + (box.x2 == reg->extents.x2) && + (box.y1 == reg->extents.y1) && + (box.y2 == reg->extents.y2)); + } +} + + +/***************************************************************** + * RegionCreate(rect, size) + * This routine does a simple malloc to make a structure of + * REGION of "size" number of rectangles. + *****************************************************************/ + +RegionPtr +miRegionCreate(rect, size) + BoxPtr rect; + int size; +{ + register RegionPtr pReg; + + pReg = (RegionPtr)xalloc(sizeof(RegionRec)); + if (!pReg) + return &miBrokenRegion; + if (rect) + { + pReg->extents = *rect; + pReg->data = (RegDataPtr)NULL; + } + else + { + pReg->extents = miEmptyBox; + if ((size > 1) && (pReg->data = xallocData(size))) + { + pReg->data->size = size; + pReg->data->numRects = 0; + } + else + pReg->data = &miEmptyData; + } + return(pReg); +} + +/***************************************************************** + * RegionInit(pReg, rect, size) + * Outer region rect is statically allocated. + *****************************************************************/ + +void +miRegionInit(pReg, rect, size) + RegionPtr pReg; + BoxPtr rect; + int size; +{ + if (rect) + { + pReg->extents = *rect; + pReg->data = (RegDataPtr)NULL; + } + else + { + pReg->extents = miEmptyBox; + if ((size > 1) && (pReg->data = xallocData(size))) + { + pReg->data->size = size; + pReg->data->numRects = 0; + } + else + pReg->data = &miEmptyData; + } +} + +void +miRegionDestroy(pReg) + RegionPtr pReg; +{ + good(pReg); + xfreeData(pReg); + if (pReg != &miBrokenRegion) + xfree(pReg); +} + +void +miRegionUninit(pReg) + RegionPtr pReg; +{ + good(pReg); + xfreeData(pReg); +} + +Bool +miRegionBreak (pReg) + RegionPtr pReg; +{ + xfreeData (pReg); + pReg->extents = miEmptyBox; + pReg->data = &miBrokenData; + return FALSE; +} + +Bool +miRectAlloc( + register RegionPtr pRgn, + int n) +{ + RegDataPtr data; + + if (!pRgn->data) + { + n++; + pRgn->data = xallocData(n); + if (!pRgn->data) + return miRegionBreak (pRgn); + pRgn->data->numRects = 1; + *REGION_BOXPTR(pRgn) = pRgn->extents; + } + else if (!pRgn->data->size) + { + pRgn->data = xallocData(n); + if (!pRgn->data) + return miRegionBreak (pRgn); + pRgn->data->numRects = 0; + } + else + { + if (n == 1) + { + n = pRgn->data->numRects; + if (n > 500) /* XXX pick numbers out of a hat */ + n = 250; + } + n += pRgn->data->numRects; + data = (RegDataPtr)xrealloc(pRgn->data, REGION_SZOF(n)); + if (!data) + return miRegionBreak (pRgn); + pRgn->data = data; + } + pRgn->data->size = n; + return TRUE; +} + +Bool +miRegionCopy(dst, src) + register RegionPtr dst; + register RegionPtr src; +{ + good(dst); + good(src); + if (dst == src) + return TRUE; + dst->extents = src->extents; + if (!src->data || !src->data->size) + { + xfreeData(dst); + dst->data = src->data; + return TRUE; + } + if (!dst->data || (dst->data->size < src->data->numRects)) + { + xfreeData(dst); + dst->data = xallocData(src->data->numRects); + if (!dst->data) + return miRegionBreak (dst); + dst->data->size = src->data->numRects; + } + dst->data->numRects = src->data->numRects; + memmove((char *)REGION_BOXPTR(dst),(char *)REGION_BOXPTR(src), + dst->data->numRects * sizeof(BoxRec)); + return TRUE; +} + + +/*====================================================================== + * Generic Region Operator + *====================================================================*/ + +/*- + *----------------------------------------------------------------------- + * miCoalesce -- + * Attempt to merge the boxes in the current band with those in the + * previous one. We are guaranteed that the current band extends to + * the end of the rects array. Used only by miRegionOp. + * + * Results: + * The new index for the previous band. + * + * Side Effects: + * If coalescing takes place: + * - rectangles in the previous band will have their y2 fields + * altered. + * - pReg->data->numRects will be decreased. + * + *----------------------------------------------------------------------- + */ +INLINE static int +miCoalesce ( + register RegionPtr pReg, /* Region to coalesce */ + int prevStart, /* Index of start of previous band */ + int curStart) /* Index of start of current band */ +{ + register BoxPtr pPrevBox; /* Current box in previous band */ + register BoxPtr pCurBox; /* Current box in current band */ + register int numRects; /* Number rectangles in both bands */ + register int y2; /* Bottom of current band */ + /* + * Figure out how many rectangles are in the band. + */ + numRects = curStart - prevStart; + ASSERT(numRects == pReg->data->numRects - curStart); + + if (!numRects) return curStart; + + /* + * The bands may only be coalesced if the bottom of the previous + * matches the top scanline of the current. + */ + pPrevBox = REGION_BOX(pReg, prevStart); + pCurBox = REGION_BOX(pReg, curStart); + if (pPrevBox->y2 != pCurBox->y1) return curStart; + + /* + * Make sure the bands have boxes in the same places. This + * assumes that boxes have been added in such a way that they + * cover the most area possible. I.e. two boxes in a band must + * have some horizontal space between them. + */ + y2 = pCurBox->y2; + + do { + if ((pPrevBox->x1 != pCurBox->x1) || (pPrevBox->x2 != pCurBox->x2)) { + return (curStart); + } + + if (!(miRectInfosVertAdjacent(&pPrevBox->info, pPrevBox->y1, + &pCurBox->info, pCurBox->y1))) { + return (curStart); + } + + pPrevBox++; + pCurBox++; + numRects--; + } while (numRects); + + /* + * The bands may be merged, so set the bottom y of each box + * in the previous band to the bottom y of the current band. + */ + numRects = curStart - prevStart; + pReg->data->numRects -= numRects; + do { + pPrevBox--; + pPrevBox->y2 = y2; + numRects--; + } while (numRects); + return prevStart; +} + + +/* Quicky macro to avoid trivial reject procedure calls to miCoalesce */ + +#define Coalesce(newReg, prevBand, curBand) \ + if (curBand - prevBand == newReg->data->numRects - curBand) { \ + prevBand = miCoalesce(newReg, prevBand, curBand); \ + } else { \ + prevBand = curBand; \ + } + +/*- + *----------------------------------------------------------------------- + * miAppendNonO -- + * Handle a non-overlapping band for the union and subtract operations. + * Just adds the (top/bottom-clipped) rectangles into the region. + * Doesn't have to check for subsumption or anything. + * + * Results: + * None. + * + * Side Effects: + * pReg->data->numRects is incremented and the rectangles overwritten + * with the rectangles we're passed. + * + *----------------------------------------------------------------------- + */ + +INLINE static Bool +miAppendNonO ( + register RegionPtr pReg, + register BoxPtr r, + BoxPtr rEnd, + register int y1, + register int y2) +{ + register BoxPtr pNextRect; + register int newRects; + + newRects = rEnd - r; + + ASSERT(y1 < y2); + ASSERT(newRects != 0); + + /* Make sure we have enough space for all rectangles to be added */ + RECTALLOC(pReg, newRects); + pNextRect = REGION_TOP(pReg); + pReg->data->numRects += newRects; + do { + RectInfo info = r->info; + ASSERT(r->x1 < r->x2); + miRectInfoAdjustForSplit(&info, 0, r->y1, 0, y1); + ADDRECT(pNextRect, r->x1, y1, r->x2, y2, info); + r++; + } while (r != rEnd); + + return TRUE; +} + +#define FindBand(r, rBandEnd, rEnd, ry1) \ +{ \ + ry1 = r->y1; \ + rBandEnd = r+1; \ + while ((rBandEnd != rEnd) && (rBandEnd->y1 == ry1)) { \ + rBandEnd++; \ + } \ +} + +#define AppendRegions(newReg, r, rEnd) \ +{ \ + int newRects; \ + if ((newRects = rEnd - r)) { \ + RECTALLOC(newReg, newRects); \ + memmove((char *)REGION_TOP(newReg),(char *)r, \ + newRects * sizeof(BoxRec)); \ + newReg->data->numRects += newRects; \ + } \ +} + +/*- + *----------------------------------------------------------------------- + * miRegionOp -- + * Apply an operation to two regions. Called by miUnion, miInverse, + * miSubtract, miIntersect.... Both regions MUST have at least one + * rectangle, and cannot be the same object. + * + * Results: + * TRUE if successful. + * + * Side Effects: + * The new region is overwritten. + * pOverlap set to TRUE if overlapFunc ever returns TRUE. + * + * Notes: + * The idea behind this function is to view the two regions as sets. + * Together they cover a rectangle of area that this function divides + * into horizontal bands where points are covered only by one region + * or by both. For the first case, miAppendNonO is called with + * each the band and the band's upper and lower extents. For the + * second, the overlapFunc is called to process the entire band. It + * is responsible for clipping the rectangles in the band, though + * this function provides the boundaries. + * At the end of each band, the new region is coalesced, if possible, + * to reduce the number of rectangles in the region. + * + *----------------------------------------------------------------------- + */ + +typedef Bool (*OverlapProcPtr)( + RegionPtr pReg, + BoxPtr r1, + BoxPtr r1End, + BoxPtr r2, + BoxPtr r2End, + int y1, + int y2, + Bool *pOverlap); + +static Bool miIntersectO(RegionPtr pReg, BoxPtr r1, BoxPtr r1End, BoxPtr r2, + BoxPtr r2End, int y1, int y2, Bool *pOverlap); +static Bool miUnionO(RegionPtr pReg, BoxPtr r1, BoxPtr r1End, BoxPtr r2, + BoxPtr r2End, int y1, int y2, Bool *pOverlap); +static Bool miSubtractO(RegionPtr pReg, BoxPtr r1, BoxPtr r1End, BoxPtr r2, + BoxPtr r2End, int y1, int y2, Bool *pOverlap); + +static Bool +miRegionOp( + RegionPtr newReg, /* Place to store result */ + RegionPtr reg1, /* First region in operation */ + RegionPtr reg2, /* 2d region in operation */ + OverlapProcPtr overlapFunc, /* Function to call for over- + * lapping bands */ + Bool appendNon1, /* Append non-overlapping bands */ + /* in region 1 ? */ + Bool appendNon2, /* Append non-overlapping bands */ + /* in region 2 ? */ + Bool *pOverlap) +{ + register BoxPtr r1; /* Pointer into first region */ + register BoxPtr r2; /* Pointer into 2d region */ + BoxPtr r1End; /* End of 1st region */ + BoxPtr r2End; /* End of 2d region */ + int ybot; /* Bottom of intersection */ + int ytop; /* Top of intersection */ + RegDataPtr oldData; /* Old data for newReg */ + int prevBand; /* Index of start of + * previous band in newReg */ + int curBand; /* Index of start of current + * band in newReg */ + register BoxPtr r1BandEnd; /* End of current band in r1 */ + register BoxPtr r2BandEnd; /* End of current band in r2 */ + int top; /* Top of non-overlapping band */ + int bot; /* Bottom of non-overlapping band*/ + register int r1y1; /* Temps for r1->y1 and r2->y1 */ + register int r2y1; + int newSize; + int numRects; + + /* + * Break any region computed from a broken region + */ + if (REGION_NAR (reg1) || REGION_NAR(reg2)) + return miRegionBreak (newReg); + + /* + * Initialization: + * set r1, r2, r1End and r2End appropriately, save the rectangles + * of the destination region until the end in case it's one of + * the two source regions, then mark the "new" region empty, allocating + * another array of rectangles for it to use. + */ + + r1 = REGION_RECTS(reg1); + newSize = REGION_NUM_RECTS(reg1); + r1End = r1 + newSize; + numRects = REGION_NUM_RECTS(reg2); + r2 = REGION_RECTS(reg2); + r2End = r2 + numRects; + ASSERT(r1 != r1End); + ASSERT(r2 != r2End); + + oldData = (RegDataPtr)NULL; + if (((newReg == reg1) && (newSize > 1)) || + ((newReg == reg2) && (numRects > 1))) + { + oldData = newReg->data; + newReg->data = &miEmptyData; + } + /* guess at new size */ + if (numRects > newSize) + newSize = numRects; + newSize <<= 1; + if (!newReg->data) + newReg->data = &miEmptyData; + else if (newReg->data->size) + newReg->data->numRects = 0; + if (newSize > newReg->data->size) + if (!miRectAlloc(newReg, newSize)) + return FALSE; + + /* + * Initialize ybot. + * In the upcoming loop, ybot and ytop serve different functions depending + * on whether the band being handled is an overlapping or non-overlapping + * band. + * In the case of a non-overlapping band (only one of the regions + * has points in the band), ybot is the bottom of the most recent + * intersection and thus clips the top of the rectangles in that band. + * ytop is the top of the next intersection between the two regions and + * serves to clip the bottom of the rectangles in the current band. + * For an overlapping band (where the two regions intersect), ytop clips + * the top of the rectangles of both regions and ybot clips the bottoms. + */ + + ybot = min(r1->y1, r2->y1); + + /* + * prevBand serves to mark the start of the previous band so rectangles + * can be coalesced into larger rectangles. qv. miCoalesce, above. + * In the beginning, there is no previous band, so prevBand == curBand + * (curBand is set later on, of course, but the first band will always + * start at index 0). prevBand and curBand must be indices because of + * the possible expansion, and resultant moving, of the new region's + * array of rectangles. + */ + prevBand = 0; + + do { + /* + * This algorithm proceeds one source-band (as opposed to a + * destination band, which is determined by where the two regions + * intersect) at a time. r1BandEnd and r2BandEnd serve to mark the + * rectangle after the last one in the current band for their + * respective regions. + */ + ASSERT(r1 != r1End); + ASSERT(r2 != r2End); + + FindBand(r1, r1BandEnd, r1End, r1y1); + FindBand(r2, r2BandEnd, r2End, r2y1); + + /* + * First handle the band that doesn't intersect, if any. + * + * Note that attention is restricted to one band in the + * non-intersecting region at once, so if a region has n + * bands between the current position and the next place it overlaps + * the other, this entire loop will be passed through n times. + */ + if (r1y1 < r2y1) { + if (appendNon1) { + top = max(r1y1, ybot); + bot = min(r1->y2, r2y1); + if (top != bot) { + curBand = newReg->data->numRects; + miAppendNonO(newReg, r1, r1BandEnd, top, bot); + Coalesce(newReg, prevBand, curBand); + } + } + ytop = r2y1; + } else if (r2y1 < r1y1) { + if (appendNon2) { + top = max(r2y1, ybot); + bot = min(r2->y2, r1y1); + if (top != bot) { + curBand = newReg->data->numRects; + miAppendNonO(newReg, r2, r2BandEnd, top, bot); + Coalesce(newReg, prevBand, curBand); + } + } + ytop = r1y1; + } else { + ytop = r1y1; + } + + /* + * Now see if we've hit an intersecting band. The two bands only + * intersect if ybot > ytop + */ + ybot = min(r1->y2, r2->y2); + if (ybot > ytop) { + curBand = newReg->data->numRects; + (* overlapFunc)(newReg, r1, r1BandEnd, r2, r2BandEnd, ytop, ybot, + pOverlap); + Coalesce(newReg, prevBand, curBand); + } + + /* + * If we've finished with a band (y2 == ybot) we skip forward + * in the region to the next band. + */ + if (r1->y2 == ybot) r1 = r1BandEnd; + if (r2->y2 == ybot) r2 = r2BandEnd; + + } while (r1 != r1End && r2 != r2End); + + /* + * Deal with whichever region (if any) still has rectangles left. + * + * We only need to worry about banding and coalescing for the very first + * band left. After that, we can just group all remaining boxes, + * regardless of how many bands, into one final append to the list. + */ + + if ((r1 != r1End) && appendNon1) { + /* Do first nonOverlap1Func call, which may be able to coalesce */ + FindBand(r1, r1BandEnd, r1End, r1y1); + curBand = newReg->data->numRects; + miAppendNonO(newReg, r1, r1BandEnd, max(r1y1, ybot), r1->y2); + Coalesce(newReg, prevBand, curBand); + /* Just append the rest of the boxes */ + AppendRegions(newReg, r1BandEnd, r1End); + + } else if ((r2 != r2End) && appendNon2) { + /* Do first nonOverlap2Func call, which may be able to coalesce */ + FindBand(r2, r2BandEnd, r2End, r2y1); + curBand = newReg->data->numRects; + miAppendNonO(newReg, r2, r2BandEnd, max(r2y1, ybot), r2->y2); + Coalesce(newReg, prevBand, curBand); + /* Append rest of boxes */ + AppendRegions(newReg, r2BandEnd, r2End); + } + + if (oldData) + xfree(oldData); + + if (!(numRects = newReg->data->numRects)) + { + xfreeData(newReg); + newReg->data = &miEmptyData; + } + else if (numRects == 1) + { + newReg->extents = *REGION_BOXPTR(newReg); + xfreeData(newReg); + newReg->data = (RegDataPtr)NULL; + } + else + { + DOWNSIZE(newReg, numRects); + } + + return TRUE; +} + +/*- + *----------------------------------------------------------------------- + * miSetExtents -- + * Reset the extents of a region to what they should be. Called by + * miSubtract and miIntersect as they can't figure it out along the + * way or do so easily, as miUnion can. + * + * Results: + * None. + * + * Side Effects: + * The region's 'extents' structure is overwritten. + * + *----------------------------------------------------------------------- + */ +void +miSetExtents (pReg) + register RegionPtr pReg; +{ + register BoxPtr pBox, pBoxEnd; + + if (!pReg->data) + return; + if (!pReg->data->size) + { + pReg->extents.x2 = pReg->extents.x1; + pReg->extents.y2 = pReg->extents.y1; + return; + } + + pBox = REGION_BOXPTR(pReg); + pBoxEnd = REGION_END(pReg); + + /* + * Since pBox is the first rectangle in the region, it must have the + * smallest y1 and since pBoxEnd is the last rectangle in the region, + * it must have the largest y2, because of banding. Initialize x1 and + * x2 from pBox and pBoxEnd, resp., as good things to initialize them + * to... + */ + pReg->extents.x1 = pBox->x1; + pReg->extents.y1 = pBox->y1; + pReg->extents.x2 = pBoxEnd->x2; + pReg->extents.y2 = pBoxEnd->y2; + + ASSERT(pReg->extents.y1 < pReg->extents.y2); + while (pBox <= pBoxEnd) { + if (pBox->x1 < pReg->extents.x1) + pReg->extents.x1 = pBox->x1; + if (pBox->x2 > pReg->extents.x2) + pReg->extents.x2 = pBox->x2; + pBox++; + }; + + ASSERT(pReg->extents.x1 < pReg->extents.x2); +} + +/*====================================================================== + * Region Intersection + *====================================================================*/ +/*- + *----------------------------------------------------------------------- + * miIntersectO -- + * Handle an overlapping band for miIntersect. + * + * Results: + * TRUE if successful. + * + * Side Effects: + * Rectangles may be added to the region. + * + *----------------------------------------------------------------------- + */ +/*ARGSUSED*/ +static Bool +miIntersectO ( + register RegionPtr pReg, + register BoxPtr r1, + BoxPtr r1End, + register BoxPtr r2, + BoxPtr r2End, + int y1, + int y2, + Bool *pOverlap) +{ + register int x1; + register int x2; + register BoxPtr pNextRect; + + pNextRect = REGION_TOP(pReg); + + ASSERT(y1 < y2); + ASSERT(r1 != r1End && r2 != r2End); + + do { + x1 = max(r1->x1, r2->x1); + x2 = min(r1->x2, r2->x2); + + /* + * If there's any overlap between the two rectangles, add that overlap + * to the new region, using r2's RectInfo for the new rectangle. + */ + if (x1 < x2) { + RectInfo info = r2->info; + + miRectInfoAdjustForSplit(&info, r2->x1, r2->y1, x1, y1); + NEWRECT(pReg, pNextRect, x1, y1, x2, y2, info); + } + + /* + * Advance the pointer(s) with the leftmost right side, since the next + * rectangle on that list may still overlap the other region's + * current rectangle. + */ + if (r1->x2 == x2) { + r1++; + } + if (r2->x2 == x2) { + r2++; + } + } while ((r1 != r1End) && (r2 != r2End)); + + return TRUE; +} + + +Bool +miIntersect(newReg, reg1, reg2) + register RegionPtr newReg; /* destination Region */ + register RegionPtr reg1; + register RegionPtr reg2; /* source regions */ +{ + good(reg1); + good(reg2); + good(newReg); + /* check for trivial reject */ + if (REGION_NIL(reg1) || REGION_NIL(reg2) || + !EXTENTCHECK(®1->extents, ®2->extents)) + { + /* Covers about 20% of all cases */ + xfreeData(newReg); + newReg->extents.x2 = newReg->extents.x1; + newReg->extents.y2 = newReg->extents.y1; + if (REGION_NAR(reg1) || REGION_NAR(reg2)) + { + newReg->data = &miBrokenData; + return FALSE; + } + else + newReg->data = &miEmptyData; + } + else if (!reg1->data && !reg2->data) + { + /* Covers about 80% of cases that aren't trivially rejected */ + newReg->extents.x1 = max(reg1->extents.x1, reg2->extents.x1); + newReg->extents.y1 = max(reg1->extents.y1, reg2->extents.y1); + newReg->extents.x2 = min(reg1->extents.x2, reg2->extents.x2); + newReg->extents.y2 = min(reg1->extents.y2, reg2->extents.y2); + newReg->extents.info = reg2->extents.info; + miRectInfoAdjustForSplit(&newReg->extents.info, + reg2->extents.x1, reg2->extents.y1, + newReg->extents.x1, newReg->extents.y1); + xfreeData(newReg); + newReg->data = (RegDataPtr)NULL; + } + else if (!reg2->data && SUBSUMES(®2->extents, ®1->extents)) + { + int i; + Bool res; + + /* + * Result is reg1 with reg2's info copied into all rectangles. + */ + if ((res = miRegionCopy(newReg, reg1))) + { + newReg->extents.info = reg2->extents.info; + miRectInfoAdjustForSplit(&newReg->extents.info, + reg2->extents.x1, reg2->extents.y1, + newReg->extents.x1, newReg->extents.y1); + for (i = 0; i < newReg->data->numRects; i++) + { + BoxPtr box = REGION_BOX(newReg, i); + box->info = reg2->extents.info; + miRectInfoAdjustForSplit(&box->info, + reg2->extents.x1, reg2->extents.y1, + box->x1, box->y1); + } + } + return res; + } + else if (!reg1->data && SUBSUMES(®1->extents, ®2->extents)) + { + return miRegionCopy(newReg, reg2); + } + else if (reg1 == reg2) + { + return miRegionCopy(newReg, reg1); + } + else + { + /* General purpose intersection */ + Bool overlap; /* result ignored */ + if (!miRegionOp(newReg, reg1, reg2, miIntersectO, FALSE, FALSE, + &overlap)) + return FALSE; + miSetExtents(newReg); + } + + good(newReg); + return(TRUE); +} + +#define MERGERECT(r) \ +{ \ + if (r->x1 <= x2) { \ + /* Merge with current rectangle */ \ + if (r->x1 < x2) *pOverlap = TRUE; \ + if (x2 < r->x2) x2 = r->x2; \ + } else { \ + /* Add current rectangle, start new one */ \ + NEWRECT(pReg, pNextRect, x1, y1, x2, y2); \ + x1 = r->x1; \ + x2 = r->x2; \ + } \ + r++; \ +} + +/*====================================================================== + * Region Union + *====================================================================*/ + +/*- + *----------------------------------------------------------------------- + * miUnionO -- + * Handle an overlapping band for the union operation. Picks the + * left-most rectangle each time and merges it into the region. + * + * Results: + * TRUE if successful. + * + * Side Effects: + * pReg is overwritten. + * pOverlap is set to TRUE if any boxes overlap. + * + *----------------------------------------------------------------------- + */ +static Bool +miUnionO ( + register RegionPtr pReg, + register BoxPtr r1, + BoxPtr r1End, + register BoxPtr r2, + BoxPtr r2End, + int y1, + int y2, + Bool *pOverlap) +{ + register BoxPtr pNextRect; + + RegionRec subReg; + RegionRec tmpReg; + BoxPtr pNextRectTmp; + int x1, x2; + RectInfo info; + + ASSERT (y1 < y2); + ASSERT(r1 != r1End && r2 != r2End); + + miRegionInit(&subReg, NULL, r1End - r1); + miRegionInit(&tmpReg, NULL, r1End - r1); + + pNextRectTmp = REGION_BOXPTR((&tmpReg)); + + /* + * XXX We compute the union as (reg 1 - reg 2) + (reg 2). Is there a + * better way? + */ + miSubtractO(&subReg, r1, r1End, r2, r2End, y1, y2, pOverlap); + + r1 = REGION_BOXPTR(&subReg); + r1End = REGION_TOP(&subReg); + + /* + * Add the new rectangles in the correct order into a temporary list + */ + while (r1 != r1End || r2 != r2End) { + if (r1 != r1End && (r2 == r2End || (r1->x1 < r2->x1))) { + info = r1->info; + if (y1 > r1->y1) { + miRectInfoAdjustForSplit(&info, + r1->x1, r1->y1, + r1->x1, y1); + } + NEWRECT((&tmpReg), pNextRectTmp, r1->x1, y1, r1->x2, y2, info); + r1++; + } else { + info = r2->info; + if (y1 > r2->y1) { + miRectInfoAdjustForSplit(&info, + r2->x1, r2->y1, + r2->x1, y1); + } + NEWRECT((&tmpReg), pNextRectTmp, r2->x1, y1, r2->x2, y2, info); + r2++; + } + } + + /* + * Copy the rectangles into the destination region, merging where possible + */ + for (pNextRectTmp = REGION_BOXPTR(&tmpReg), + x1 = pNextRectTmp->x1, x2 = pNextRectTmp->x2, info = pNextRectTmp->info, + pNextRect = REGION_TOP(pReg); + pNextRectTmp != REGION_TOP(&tmpReg); + pNextRectTmp++) { + + if (pNextRectTmp->x1 > x2 || + !miRectInfosHorzAdjacent(&pNextRectTmp->info, pNextRectTmp->x1, + &info, x1)) { + NEWRECT(pReg, pNextRect, x1, y1, x2, y2, info); + x1 = pNextRectTmp->x1; + x2 = pNextRectTmp->x2; + info = pNextRectTmp->info; + } else { + x2 = pNextRectTmp->x2; + } + } + + NEWRECT(pReg, pNextRect, x1, y1, x2, y2, info); + + xfreeData(&subReg); + xfreeData(&tmpReg); + + return TRUE; +} + +Bool +miUnion(newReg, reg1, reg2) + RegionPtr newReg; /* destination Region */ + register RegionPtr reg1; + register RegionPtr reg2; /* source regions */ +{ + Bool overlap; /* result ignored */ + + /* Return TRUE if some overlap between reg1, reg2 */ + good(reg1); + good(reg2); + good(newReg); + /* checks all the simple cases */ + + /* + * Region 1 and 2 are the same + */ + if (reg1 == reg2) + { + return miRegionCopy(newReg, reg1); + } + + /* + * Region 1 is empty + */ + if (miIsRegionVoid(reg1)) + { + if (REGION_NAR(reg1)) + return miRegionBreak (newReg); + if (newReg != reg2) + return miRegionCopy(newReg, reg2); + return TRUE; + } + + /* + * Region 2 is empty + */ + if (miIsRegionVoid(reg2)) + { + if (REGION_NAR(reg2)) + return miRegionBreak (newReg); + if (newReg != reg1) + return miRegionCopy(newReg, reg1); + return TRUE; + } + + /* + * Region 1 completely subsumes region 2 + * + * We still need to do the complete union calculation, because reg 2 + * may have accelerated operations that need to be stencilled onto reg 1 + */ + + /* + if (!reg1->data && SUBSUMES(®1->extents, ®2->extents)) + { + if (newReg != reg1) + return miRegionCopy(newReg, reg1); + return TRUE; + } + */ + + /* + * Region 2 completely subsumes region 1 + */ + if (!reg2->data && SUBSUMES(®2->extents, ®1->extents)) + { + if (newReg != reg2) + return miRegionCopy(newReg, reg2); + return TRUE; + } + + if (!miRegionOp(newReg, reg1, reg2, miUnionO, TRUE, TRUE, &overlap)) + return FALSE; + + /* + * This previously failed when we called REGION_NIL on reg1 and reg2; + * a region could be !REGION_NIL but have an extent, say 0, 0, 0, 0, + * which would then overwrite newReg with an invalid extent. + * + * Using miIsRegionVoid() instead of testing REGION_NIL fixes that + * bug. + */ + newReg->extents.x1 = min(reg1->extents.x1, reg2->extents.x1); + newReg->extents.y1 = min(reg1->extents.y1, reg2->extents.y1); + newReg->extents.x2 = max(reg1->extents.x2, reg2->extents.x2); + newReg->extents.y2 = max(reg1->extents.y2, reg2->extents.y2); + good(newReg); + return TRUE; +} + + +/*====================================================================== + * Batch Rectangle Union + *====================================================================*/ + +/*- + *----------------------------------------------------------------------- + * miRegionAppend -- + * + * "Append" the rgn rectangles onto the end of dstrgn, maintaining + * knowledge of YX-banding when it's easy. Otherwise, dstrgn just + * becomes a non-y-x-banded random collection of rectangles, and not + * yet a true region. After a sequence of appends, the caller must + * call miRegionValidate to ensure that a valid region is constructed. + * + * Results: + * TRUE if successful. + * + * Side Effects: + * dstrgn is modified if rgn has rectangles. + * + */ +Bool +miRegionAppend(dstrgn, rgn) + register RegionPtr dstrgn; + register RegionPtr rgn; +{ + int numRects, dnumRects, size; + BoxPtr new, old; + Bool prepend; + + if (REGION_NAR(rgn)) + return miRegionBreak (dstrgn); + + if (!rgn->data && (dstrgn->data == &miEmptyData)) + { + dstrgn->extents = rgn->extents; + dstrgn->data = (RegDataPtr)NULL; + return TRUE; + } + + numRects = REGION_NUM_RECTS(rgn); + if (!numRects) + return TRUE; + prepend = FALSE; + size = numRects; + dnumRects = REGION_NUM_RECTS(dstrgn); + if (!dnumRects && (size < 200)) + size = 200; /* XXX pick numbers out of a hat */ + RECTALLOC(dstrgn, size); + old = REGION_RECTS(rgn); + if (!dnumRects) + dstrgn->extents = rgn->extents; + else if (dstrgn->extents.x2 > dstrgn->extents.x1) + { + register BoxPtr first, last; + + first = old; + last = REGION_BOXPTR(dstrgn) + (dnumRects - 1); + if ((first->y1 > last->y2) || + ((first->y1 == last->y1) && (first->y2 == last->y2) && + (first->x1 > last->x2))) + { + if (rgn->extents.x1 < dstrgn->extents.x1) + dstrgn->extents.x1 = rgn->extents.x1; + if (rgn->extents.x2 > dstrgn->extents.x2) + dstrgn->extents.x2 = rgn->extents.x2; + dstrgn->extents.y2 = rgn->extents.y2; + } + else + { + first = REGION_BOXPTR(dstrgn); + last = old + (numRects - 1); + if ((first->y1 > last->y2) || + ((first->y1 == last->y1) && (first->y2 == last->y2) && + (first->x1 > last->x2))) + { + prepend = TRUE; + if (rgn->extents.x1 < dstrgn->extents.x1) + dstrgn->extents.x1 = rgn->extents.x1; + if (rgn->extents.x2 > dstrgn->extents.x2) + dstrgn->extents.x2 = rgn->extents.x2; + dstrgn->extents.y1 = rgn->extents.y1; + } + else + dstrgn->extents.x2 = dstrgn->extents.x1; + } + } + if (prepend) + { + new = REGION_BOX(dstrgn, numRects); + if (dnumRects == 1) + *new = *REGION_BOXPTR(dstrgn); + else + memmove((char *)new,(char *)REGION_BOXPTR(dstrgn), + dnumRects * sizeof(BoxRec)); + new = REGION_BOXPTR(dstrgn); + } + else + new = REGION_BOXPTR(dstrgn) + dnumRects; + if (numRects == 1) + *new = *old; + else + memmove((char *)new, (char *)old, numRects * sizeof(BoxRec)); + dstrgn->data->numRects += numRects; + return TRUE; +} + + +#define ExchangeRects(a, b) \ +{ \ + BoxRec t; \ + t = rects[a]; \ + rects[a] = rects[b]; \ + rects[b] = t; \ +} + +static void +QuickSortRects( + register BoxRec rects[], + register int numRects) +{ + register int y1; + register int x1; + register int i, j; + register BoxPtr r; + + /* Always called with numRects > 1 */ + + do + { + if (numRects == 2) + { + if (rects[0].y1 > rects[1].y1 || + (rects[0].y1 == rects[1].y1 && rects[0].x1 > rects[1].x1)) + ExchangeRects(0, 1); + return; + } + + /* Choose partition element, stick in location 0 */ + ExchangeRects(0, numRects >> 1); + y1 = rects[0].y1; + x1 = rects[0].x1; + + /* Partition array */ + i = 0; + j = numRects; + do + { + r = &(rects[i]); + do + { + r++; + i++; + } while (i != numRects && + (r->y1 < y1 || (r->y1 == y1 && r->x1 < x1))); + r = &(rects[j]); + do + { + r--; + j--; + } while (y1 < r->y1 || (y1 == r->y1 && x1 < r->x1)); + if (i < j) + ExchangeRects(i, j); + } while (i < j); + + /* Move partition element back to middle */ + ExchangeRects(0, j); + + /* Recurse */ + if (numRects-j-1 > 1) + QuickSortRects(&rects[j+1], numRects-j-1); + numRects = j; + } while (numRects > 1); +} + +/*- + *----------------------------------------------------------------------- + * miRegionValidate -- + * + * Take a ``region'' which is a non-y-x-banded random collection of + * rectangles, and compute a nice region which is the union of all the + * rectangles. + * + * Results: + * TRUE if successful. + * + * Side Effects: + * The passed-in ``region'' may be modified. + * pOverlap set to TRUE if any retangles overlapped, else FALSE; + * + * Strategy: + * Step 1. Sort the rectangles into ascending order with primary key y1 + * and secondary key x1. + * + * Step 2. Split the rectangles into the minimum number of proper y-x + * banded regions. This may require horizontally merging + * rectangles, and vertically coalescing bands. With any luck, + * this step in an identity tranformation (ala the Box widget), + * or a coalescing into 1 box (ala Menus). + * + * Step 3. Merge the separate regions down to a single region by calling + * miUnion. Maximize the work each miUnion call does by using + * a binary merge. + * + *----------------------------------------------------------------------- + */ + +Bool +miRegionValidate(badreg, pOverlap) + RegionPtr badreg; + Bool *pOverlap; +{ + /* Descriptor for regions under construction in Step 2. */ + typedef struct { + RegionRec reg; + int prevBand; + int curBand; + } RegionInfo; + + int numRects; /* Original numRects for badreg */ + RegionInfo *ri; /* Array of current regions */ + int numRI; /* Number of entries used in ri */ + int sizeRI; /* Number of entries available in ri */ + int i; /* Index into rects */ + register int j; /* Index into ri */ + register RegionInfo *rit; /* &ri[j] */ + register RegionPtr reg; /* ri[j].reg */ + register BoxPtr box; /* Current box in rects */ + register BoxPtr riBox; /* Last box in ri[j].reg */ + register RegionPtr hreg; /* ri[j_half].reg */ + Bool ret = TRUE; + + *pOverlap = FALSE; + if (!badreg->data) + { + good(badreg); + return TRUE; + } + numRects = badreg->data->numRects; + if (!numRects) + { + if (REGION_NAR(badreg)) + return FALSE; + good(badreg); + return TRUE; + } + if (badreg->extents.x1 < badreg->extents.x2) + { + if ((numRects) == 1) + { + xfreeData(badreg); + badreg->data = (RegDataPtr) NULL; + } + else + { + DOWNSIZE(badreg, numRects); + } + good(badreg); + return TRUE; + } + + /* Step 1: Sort the rects array into ascending (y1, x1) order */ + QuickSortRects(REGION_BOXPTR(badreg), numRects); + + /* Step 2: Scatter the sorted array into the minimum number of regions */ + + /* Set up the first region to be the first rectangle in badreg */ + /* Note that step 2 code will never overflow the ri[0].reg rects array */ + ri = (RegionInfo *) xalloc(4 * sizeof(RegionInfo)); + if (!ri) + return miRegionBreak (badreg); + sizeRI = 4; + numRI = 1; + ri[0].prevBand = 0; + ri[0].curBand = 0; + ri[0].reg = *badreg; + box = REGION_BOXPTR(&ri[0].reg); + ri[0].reg.extents = *box; + ri[0].reg.data->numRects = 1; + + /* Now scatter rectangles into the minimum set of valid regions. If the + next rectangle to be added to a region would force an existing rectangle + in the region to be split up in order to maintain y-x banding, just + forget it. Try the next region. If it doesn't fit cleanly into any + region, make a new one. */ + + for (i = numRects; --i > 0;) + { + box++; + /* Look for a region to append box to */ + for (j = numRI, rit = ri; --j >= 0; rit++) + { + reg = &rit->reg; + riBox = REGION_END(reg); + + if (box->y1 == riBox->y1 && box->y2 == riBox->y2) + { + /* box is in same band as riBox. Merge or append it */ + if (box->x1 <= riBox->x2) + { + /* Merge it with riBox */ + if (box->x1 < riBox->x2) *pOverlap = TRUE; + if (box->x2 > riBox->x2) riBox->x2 = box->x2; + } + else + { + RECTALLOC_BAIL(reg, 1, bail); + *REGION_TOP(reg) = *box; + reg->data->numRects++; + } + goto NextRect; /* So sue me */ + } + else if (box->y1 >= riBox->y2) + { + /* Put box into new band */ + if (reg->extents.x2 < riBox->x2) reg->extents.x2 = riBox->x2; + if (reg->extents.x1 > box->x1) reg->extents.x1 = box->x1; + Coalesce(reg, rit->prevBand, rit->curBand); + rit->curBand = reg->data->numRects; + RECTALLOC_BAIL(reg, 1, bail); + *REGION_TOP(reg) = *box; + reg->data->numRects++; + goto NextRect; + } + /* Well, this region was inappropriate. Try the next one. */ + } /* for j */ + + /* Uh-oh. No regions were appropriate. Create a new one. */ + if (sizeRI == numRI) + { + /* Oops, allocate space for new region information */ + sizeRI <<= 1; + rit = (RegionInfo *) xrealloc(ri, sizeRI * sizeof(RegionInfo)); + if (!rit) + goto bail; + ri = rit; + rit = &ri[numRI]; + } + numRI++; + rit->prevBand = 0; + rit->curBand = 0; + rit->reg.extents = *box; + rit->reg.data = (RegDataPtr)NULL; + if (!miRectAlloc(&rit->reg, (i+numRI) / numRI)) /* MUST force allocation */ + goto bail; +NextRect: ; + } /* for i */ + + /* Make a final pass over each region in order to Coalesce and set + extents.x2 and extents.y2 */ + + for (j = numRI, rit = ri; --j >= 0; rit++) + { + reg = &rit->reg; + riBox = REGION_END(reg); + reg->extents.y2 = riBox->y2; + if (reg->extents.x2 < riBox->x2) reg->extents.x2 = riBox->x2; + Coalesce(reg, rit->prevBand, rit->curBand); + if (reg->data->numRects == 1) /* keep unions happy below */ + { + xfreeData(reg); + reg->data = (RegDataPtr)NULL; + } + } + + /* Step 3: Union all regions into a single region */ + while (numRI > 1) + { + int half = numRI/2; + for (j = numRI & 1; j < (half + (numRI & 1)); j++) + { + reg = &ri[j].reg; + hreg = &ri[j+half].reg; + if (!miRegionOp(reg, reg, hreg, miUnionO, TRUE, TRUE, pOverlap)) + ret = FALSE; + if (hreg->extents.x1 < reg->extents.x1) + reg->extents.x1 = hreg->extents.x1; + if (hreg->extents.y1 < reg->extents.y1) + reg->extents.y1 = hreg->extents.y1; + if (hreg->extents.x2 > reg->extents.x2) + reg->extents.x2 = hreg->extents.x2; + if (hreg->extents.y2 > reg->extents.y2) + reg->extents.y2 = hreg->extents.y2; + xfreeData(hreg); + } + numRI -= half; + } + *badreg = ri[0].reg; + xfree(ri); + good(badreg); + return ret; +bail: + for (i = 0; i < numRI; i++) + xfreeData(&ri[i].reg); + xfree (ri); + return miRegionBreak (badreg); +} + +RegionPtr +miRectsToRegionByBoundary( + int nrects, + register xRectangle *prect, + int ctype, + int minValue, + int maxValue) +{ + register RegionPtr pRgn; + register RegDataPtr pData; + register BoxPtr pBox; + register int i; + int x1, y1, x2, y2; + + pRgn = miRegionCreate(NullBox, 0); + if (REGION_NAR (pRgn)) + return pRgn; + if (!nrects) + return pRgn; + if (nrects == 1) + { + x1 = prect->x < minValue ? minValue : prect->x; + y1 = prect->y < minValue ? minValue : prect->y; + if ((x2 = x1 + (int) prect->width) > maxValue) + x2 = maxValue; + if ((y2 = y1 + (int) prect->height) > maxValue) + y2 = maxValue; + if (x1 != x2 && y1 != y2) + { + pRgn->extents.x1 = x1; + pRgn->extents.y1 = y1; + pRgn->extents.x2 = x2; + pRgn->extents.y2 = y2; + pRgn->data = (RegDataPtr)NULL; + } + return pRgn; + } + pData = xallocData(nrects); + if (!pData) + { + miRegionBreak (pRgn); + return pRgn; + } + pBox = (BoxPtr) (pData + 1); + for (i = nrects; --i >= 0; prect++) + { + x1 = prect->x < minValue ? minValue : prect->x; + y1 = prect->y < minValue ? minValue : prect->y; + if ((x2 = x1 + (int) prect->width) > maxValue) + x2 = maxValue; + if ((y2 = y1 + (int) prect->height) > maxValue) + y2 = maxValue; + if (x1 != x2 && y1 != y2) + { + pBox->x1 = x1; + pBox->y1 = y1; + pBox->x2 = x2; + pBox->y2 = y2; + pBox->info.type = UpdateRect; + pBox++; + } + } + if (pBox != (BoxPtr) (pData + 1)) + { + pData->size = nrects; + pData->numRects = pBox - (BoxPtr) (pData + 1); + pRgn->data = pData; + if (ctype != CT_YXBANDED) + { + Bool overlap; /* result ignored */ + pRgn->extents.x1 = pRgn->extents.x2 = 0; + miRegionValidate(pRgn, &overlap); + } + else + miSetExtents(pRgn); + good(pRgn); + } + else + { + xfree (pData); + } + return pRgn; +} + +/* + * Construct the region from rects using the default values + * R_MINSHORT and R_MAXSHORT for boundary check + */ +RegionPtr +miRectsToRegion( + int nrects, + register xRectangle *prect, + int ctype) +{ + return miRectsToRegionByBoundary(nrects, prect, ctype, + R_MINSHORT, R_MAXSHORT); +} + +/*====================================================================== + * Region Subtraction + *====================================================================*/ + + +/*- + *----------------------------------------------------------------------- + * miSubtractO -- + * Overlapping band subtraction. x1 is the left-most point not yet + * checked. + * + * Results: + * TRUE if successful. + * + * Side Effects: + * pReg may have rectangles added to it. + * + *----------------------------------------------------------------------- + */ +/*ARGSUSED*/ +static Bool +miSubtractO ( + register RegionPtr pReg, + register BoxPtr r1, + BoxPtr r1End, + register BoxPtr r2, + BoxPtr r2End, + register int y1, + int y2, + Bool *pOverlap) +{ + register BoxPtr pNextRect; + register int x1; + + x1 = r1->x1; + + ASSERT(y1x2 <= x1) + { + /* + * Subtrahend entirely to left of minuend: go to next subtrahend. + */ + r2++; + } + else if (r2->x1 <= x1) + { + /* + * Subtrahend preceeds minuend: nuke left edge of minuend. + */ + x1 = r2->x2; + if (x1 >= r1->x2) + { + /* + * Minuend completely covered: advance to next minuend and + * reset left fence to edge of new minuend. + */ + r1++; + if (r1 != r1End) + x1 = r1->x1; + } + else + { + /* + * Subtrahend now used up since it doesn't extend beyond + * minuend + */ + r2++; + } + } + else if (r2->x1 < r1->x2) + { + /* + * Left part of subtrahend covers part of minuend: add uncovered + * part of minuend to region and skip to next subtrahend. + */ + RectInfo info = r1->info; + ASSERT(x1 < r2->x1); + miRectInfoAdjustForSplit(&info, r1->x1, r1->y1, x1, y1); + NEWRECT(pReg, pNextRect, x1, y1, r2->x1, y2, info); + + x1 = r2->x2; + if (x1 >= r1->x2) + { + /* + * Minuend used up: advance to new... + */ + r1++; + if (r1 != r1End) + x1 = r1->x1; + } + else + { + /* + * Subtrahend used up + */ + r2++; + } + } + else + { + /* + * Minuend used up: add any remaining piece before advancing. + */ + if (r1->x2 > x1) { + RectInfo info = r1->info; + + miRectInfoAdjustForSplit(&info, r1->x1, r1->y1, x1, y1); + NEWRECT(pReg, pNextRect, x1, y1, r1->x2, y2, info); + } + r1++; + if (r1 != r1End) + x1 = r1->x1; + } + } while ((r1 != r1End) && (r2 != r2End)); + + + /* + * Add remaining minuend rectangles to region. + */ + while (r1 != r1End) + { + RectInfo info = r1->info; + + ASSERT(x1x2); + miRectInfoAdjustForSplit(&info, r1->x1, r1->y1, x1, y1); + NEWRECT(pReg, pNextRect, x1, y1, r1->x2, y2, info); + r1++; + if (r1 != r1End) + x1 = r1->x1; + } + return TRUE; +} + +/*- + *----------------------------------------------------------------------- + * miSubtract -- + * Subtract regS from regM and leave the result in regD. + * S stands for subtrahend, M for minuend and D for difference. + * + * Results: + * TRUE if successful. + * + * Side Effects: + * regD is overwritten. + * + *----------------------------------------------------------------------- + */ +Bool +miSubtract(regD, regM, regS) + register RegionPtr regD; + register RegionPtr regM; + register RegionPtr regS; +{ + Bool overlap; /* result ignored */ + + good(regM); + good(regS); + good(regD); + /* check for trivial rejects */ + if (REGION_NIL(regM) || REGION_NIL(regS) || + !EXTENTCHECK(®M->extents, ®S->extents)) + { + if (REGION_NAR (regS)) + return miRegionBreak (regD); + return miRegionCopy(regD, regM); + } + else if (regM == regS) + { + xfreeData(regD); + regD->extents.x2 = regD->extents.x1; + regD->extents.y2 = regD->extents.y1; + regD->data = &miEmptyData; + return TRUE; + } + + /* Add those rectangles in region 1 that aren't in region 2, + do yucky subtraction for overlaps, and + just throw away rectangles in region 2 that aren't in region 1 */ + if (!miRegionOp(regD, regM, regS, miSubtractO, TRUE, FALSE, &overlap)) + return FALSE; + + /* + * Can't alter RegD's extents before we call miRegionOp because + * it might be one of the source regions and miRegionOp depends + * on the extents of those regions being unaltered. Besides, this + * way there's no checking against rectangles that will be nuked + * due to coalescing, so we have to examine fewer rectangles. + */ + miSetExtents(regD); + good(regD); + return TRUE; +} + +/*====================================================================== + * Region Inversion + *====================================================================*/ + +/*- + *----------------------------------------------------------------------- + * miInverse -- + * Take a region and a box and return a region that is everything + * in the box but not in the region. The careful reader will note + * that this is the same as subtracting the region from the box... + * + * Results: + * TRUE. + * + * Side Effects: + * newReg is overwritten. + * + *----------------------------------------------------------------------- + */ +Bool +miInverse(newReg, reg1, invRect) + RegionPtr newReg; /* Destination region */ + RegionPtr reg1; /* Region to invert */ + BoxPtr invRect; /* Bounding box for inversion */ +{ + RegionRec invReg; /* Quick and dirty region made from the + * bounding box */ + Bool overlap; /* result ignored */ + + good(reg1); + good(newReg); + /* check for trivial rejects */ + if (REGION_NIL(reg1) || !EXTENTCHECK(invRect, ®1->extents)) + { + if (REGION_NAR(reg1)) + return miRegionBreak (newReg); + newReg->extents = *invRect; + xfreeData(newReg); + newReg->data = (RegDataPtr)NULL; + return TRUE; + } + + /* Add those rectangles in region 1 that aren't in region 2, + do yucky subtraction for overlaps, and + just throw away rectangles in region 2 that aren't in region 1 */ + invReg.extents = *invRect; + invReg.data = (RegDataPtr)NULL; + if (!miRegionOp(newReg, &invReg, reg1, miSubtractO, TRUE, FALSE, &overlap)) + return FALSE; + + /* + * Can't alter newReg's extents before we call miRegionOp because + * it might be one of the source regions and miRegionOp depends + * on the extents of those regions being unaltered. Besides, this + * way there's no checking against rectangles that will be nuked + * due to coalescing, so we have to examine fewer rectangles. + */ + miSetExtents(newReg); + good(newReg); + return TRUE; +} + +/* + * RectIn(region, rect) + * This routine takes a pointer to a region and a pointer to a box + * and determines if the box is outside/inside/partly inside the region. + * + * The idea is to travel through the list of rectangles trying to cover the + * passed box with them. Anytime a piece of the rectangle isn't covered + * by a band of rectangles, partOut is set TRUE. Any time a rectangle in + * the region covers part of the box, partIn is set TRUE. The process ends + * when either the box has been completely covered (we reached a band that + * doesn't overlap the box, partIn is TRUE and partOut is false), the + * box has been partially covered (partIn == partOut == TRUE -- because of + * the banding, the first time this is true we know the box is only + * partially in the region) or is outside the region (we reached a band + * that doesn't overlap the box at all and partIn is false) + */ + +int +miRectIn(region, prect) + register RegionPtr region; + register BoxPtr prect; +{ + register int x; + register int y; + register BoxPtr pbox; + register BoxPtr pboxEnd; + int partIn, partOut; + int numRects; + + good(region); + numRects = REGION_NUM_RECTS(region); + /* useful optimization */ + if (!numRects || !EXTENTCHECK(®ion->extents, prect)) + return(rgnOUT); + + if (numRects == 1) + { + /* We know that it must be rgnIN or rgnPART */ + if (SUBSUMES(®ion->extents, prect)) + return(rgnIN); + else + return(rgnPART); + } + + partOut = FALSE; + partIn = FALSE; + + /* (x,y) starts at upper left of rect, moving to the right and down */ + x = prect->x1; + y = prect->y1; + + /* can stop when both partOut and partIn are TRUE, or we reach prect->y2 */ + for (pbox = REGION_BOXPTR(region), pboxEnd = pbox + numRects; + pbox != pboxEnd; + pbox++) + { + + if (pbox->y2 <= y) + continue; /* getting up to speed or skipping remainder of band */ + + if (pbox->y1 > y) + { + partOut = TRUE; /* missed part of rectangle above */ + if (partIn || (pbox->y1 >= prect->y2)) + break; + y = pbox->y1; /* x guaranteed to be == prect->x1 */ + } + + if (pbox->x2 <= x) + continue; /* not far enough over yet */ + + if (pbox->x1 > x) + { + partOut = TRUE; /* missed part of rectangle to left */ + if (partIn) + break; + } + + if (pbox->x1 < prect->x2) + { + partIn = TRUE; /* definitely overlap */ + if (partOut) + break; + } + + if (pbox->x2 >= prect->x2) + { + y = pbox->y2; /* finished with this band */ + if (y >= prect->y2) + break; + x = prect->x1; /* reset x out to left again */ + } + else + { + /* + * Because boxes in a band are maximal width, if the first box + * to overlap the rectangle doesn't completely cover it in that + * band, the rectangle must be partially out, since some of it + * will be uncovered in that band. partIn will have been set true + * by now... + */ + partOut = TRUE; + break; + } + } + + return(partIn ? ((y < prect->y2) ? rgnPART : rgnIN) : rgnOUT); +} + +/* TranslateRegion(pReg, x, y) + translates in place +*/ + +/* + * XXX: This function is not written as cleanly as it could be (it + * uses the same rectangle clipping code twice and uses bitwise + * operators to detect the different region translation cases). + */ + +void +miTranslateRegionByBoundary( + register RegionPtr pReg, + register int x, + register int y, + int minValue, + int maxValue) +{ + int x1, x2, y1, y2; + register int nbox; + register BoxPtr pbox; + + good(pReg); + pReg->extents.x1 = x1 = pReg->extents.x1 + x; + pReg->extents.y1 = y1 = pReg->extents.y1 + y; + pReg->extents.x2 = x2 = pReg->extents.x2 + x; + pReg->extents.y2 = y2 = pReg->extents.y2 + y; + if (((x1 - minValue)|(y1 - minValue)|(maxValue - x2)|(maxValue - y2)) >= 0) + { + if (pReg->data && (nbox = pReg->data->numRects)) + { + for (pbox = REGION_BOXPTR(pReg); nbox--; pbox++) + { + pbox->x1 += x; + pbox->y1 += y; + pbox->x2 += x; + pbox->y2 += y; + } + } + return; + } + if (((x2 - minValue)|(y2 - minValue)|(maxValue - x1)|(maxValue - y1)) <= 0) + { + pReg->extents.x2 = pReg->extents.x1; + pReg->extents.y2 = pReg->extents.y1; + xfreeData(pReg); + pReg->data = &miEmptyData; + return; + } + if (x1 < minValue) + pReg->extents.x1 = minValue; + else if (x2 > maxValue) + pReg->extents.x2 = maxValue; + if (y1 < minValue) + pReg->extents.y1 = minValue; + else if (y2 > maxValue) + pReg->extents.y2 = maxValue; + if (pReg->data && (nbox = pReg->data->numRects)) + { + register BoxPtr pboxout; + + for (pboxout = pbox = REGION_BOXPTR(pReg); nbox--; pbox++) + { + pboxout->x1 = x1 = pbox->x1 + x; + pboxout->y1 = y1 = pbox->y1 + y; + pboxout->x2 = x2 = pbox->x2 + x; + pboxout->y2 = y2 = pbox->y2 + y; + if (((x2 - minValue)|(y2 - minValue)| + (maxValue - x1)|(maxValue - y1)) <= 0) + { + pReg->data->numRects--; + continue; + } + if (x1 < minValue) + pboxout->x1 = minValue; + else if (x2 > maxValue) + pboxout->x2 = maxValue; + if (y1 < minValue) + pboxout->y1 = minValue; + else if (y2 > maxValue) + pboxout->y2 = maxValue; + pboxout++; + } + if (pboxout != pbox) + { + if (pReg->data->numRects == 1) + { + pReg->extents = *REGION_BOXPTR(pReg); + xfreeData(pReg); + pReg->data = (RegDataPtr)NULL; + } + else + miSetExtents(pReg); + } + } +} + +/* + * Translate the region and use the default values which are + * R_MINSHORT, R_MAXSHORT for boundary check + */ + +void +miTranslateRegion( + register RegionPtr pReg, + register int x, + register int y) +{ + miTranslateRegionByBoundary(pReg, x, y, R_MINSHORT, R_MAXSHORT); +} + + +Bool +miRegionDataCopy( + register RegionPtr dst, + register RegionPtr src) +{ + good(dst); + good(src); + if (dst->data) + return TRUE; + if (dst == src) + return TRUE; + if (!src->data || !src->data->size) + { + xfreeData(dst); + dst->data = (RegDataPtr)NULL; + return TRUE; + } + if (!dst->data || (dst->data->size < src->data->numRects)) + { + xfreeData(dst); + dst->data = xallocData(src->data->numRects); + if (!dst->data) + return miRegionBreak (dst); + } + dst->data->size = src->data->size; + dst->data->numRects = src->data->numRects; + return TRUE; +} + +void +miRegionReset(pReg, pBox) + RegionPtr pReg; + BoxPtr pBox; +{ + good(pReg); + ASSERT(pBox->x1<=pBox->x2); + ASSERT(pBox->y1<=pBox->y2); + pReg->extents = *pBox; + xfreeData(pReg); + pReg->data = (RegDataPtr)NULL; +} + +Bool +miPointInRegion(pReg, x, y, box) + register RegionPtr pReg; + register int x, y; + BoxPtr box; /* "return" value */ +{ + register BoxPtr pbox, pboxEnd; + int numRects; + + good(pReg); + numRects = REGION_NUM_RECTS(pReg); + if (!numRects || !INBOX(&pReg->extents, x, y)) + return(FALSE); + if (numRects == 1) + { + *box = pReg->extents; + return(TRUE); + } + for (pbox = REGION_BOXPTR(pReg), pboxEnd = pbox + numRects; + pbox != pboxEnd; + pbox++) + { + if (y >= pbox->y2) + continue; /* not there yet */ + if ((y < pbox->y1) || (x < pbox->x1)) + break; /* missed it */ + if (x >= pbox->x2) + continue; /* not there yet */ + *box = *pbox; + return(TRUE); + } + return(FALSE); +} + +Bool +miRegionNotEmpty(pReg) + RegionPtr pReg; +{ + good(pReg); + return(!REGION_NIL(pReg)); +} + +Bool +miRegionBroken(RegionPtr pReg) +{ + good(pReg); + return (REGION_NAR(pReg)); +} + +void +miRegionEmpty(pReg) + RegionPtr pReg; +{ + good(pReg); + xfreeData(pReg); + pReg->extents.x2 = pReg->extents.x1; + pReg->extents.y2 = pReg->extents.y1; + pReg->data = &miEmptyData; +} + +BoxPtr +miRegionExtents(pReg) + RegionPtr pReg; +{ + good(pReg); + return(&pReg->extents); +} + +#define ExchangeSpans(a, b) \ +{ \ + DDXPointRec tpt; \ + register int tw; \ + \ + tpt = spans[a]; spans[a] = spans[b]; spans[b] = tpt; \ + tw = widths[a]; widths[a] = widths[b]; widths[b] = tw; \ +} + +/* ||| I should apply the merge sort code to rectangle sorting above, and see + if mapping time can be improved. But right now I've been at work 12 hours, + so forget it. +*/ + +static void QuickSortSpans( + register DDXPointRec spans[], + register int widths[], + register int numSpans) +{ + register int y; + register int i, j, m; + register DDXPointPtr r; + + /* Always called with numSpans > 1 */ + /* Sorts only by y, doesn't bother to sort by x */ + + do + { + if (numSpans < 9) + { + /* Do insertion sort */ + register int yprev; + + yprev = spans[0].y; + i = 1; + do + { /* while i != numSpans */ + y = spans[i].y; + if (yprev > y) + { + /* spans[i] is out of order. Move into proper location. */ + DDXPointRec tpt; + int tw, k; + + for (j = 0; y >= spans[j].y; j++) {} + tpt = spans[i]; + tw = widths[i]; + for (k = i; k != j; k--) + { + spans[k] = spans[k-1]; + widths[k] = widths[k-1]; + } + spans[j] = tpt; + widths[j] = tw; + y = spans[i].y; + } /* if out of order */ + yprev = y; + i++; + } while (i != numSpans); + return; + } + + /* Choose partition element, stick in location 0 */ + m = numSpans / 2; + if (spans[m].y > spans[0].y) ExchangeSpans(m, 0); + if (spans[m].y > spans[numSpans-1].y) ExchangeSpans(m, numSpans-1); + if (spans[m].y > spans[0].y) ExchangeSpans(m, 0); + y = spans[0].y; + + /* Partition array */ + i = 0; + j = numSpans; + do + { + r = &(spans[i]); + do + { + r++; + i++; + } while (i != numSpans && r->y < y); + r = &(spans[j]); + do + { + r--; + j--; + } while (y < r->y); + if (i < j) + ExchangeSpans(i, j); + } while (i < j); + + /* Move partition element back to middle */ + ExchangeSpans(0, j); + + /* Recurse */ + if (numSpans-j-1 > 1) + QuickSortSpans(&spans[j+1], &widths[j+1], numSpans-j-1); + numSpans = j; + } while (numSpans > 1); +} + +#define NextBand() \ +{ \ + clipy1 = pboxBandStart->y1; \ + clipy2 = pboxBandStart->y2; \ + pboxBandEnd = pboxBandStart + 1; \ + while (pboxBandEnd != pboxLast && pboxBandEnd->y1 == clipy1) { \ + pboxBandEnd++; \ + } \ + for (; ppt != pptLast && ppt->y < clipy1; ppt++, pwidth++) {} \ +} + +/* + Clip a list of scanlines to a region. The caller has allocated the + space. FSorted is non-zero if the scanline origins are in ascending + order. + returns the number of new, clipped scanlines. +*/ + +int +miClipSpans( + RegionPtr prgnDst, + register DDXPointPtr ppt, + register int *pwidth, + int nspans, + register DDXPointPtr pptNew, + int *pwidthNew, + int fSorted) +{ + register DDXPointPtr pptLast; + int *pwidthNewStart; /* the vengeance of Xerox! */ + register int y, x1, x2; + register int numRects; + + good(prgnDst); + pptLast = ppt + nspans; + pwidthNewStart = pwidthNew; + + if (!prgnDst->data) + { + /* Do special fast code with clip boundaries in registers(?) */ + /* It doesn't pay much to make use of fSorted in this case, + so we lump everything together. */ + + register int clipx1, clipx2, clipy1, clipy2; + + clipx1 = prgnDst->extents.x1; + clipy1 = prgnDst->extents.y1; + clipx2 = prgnDst->extents.x2; + clipy2 = prgnDst->extents.y2; + + for (; ppt != pptLast; ppt++, pwidth++) + { + y = ppt->y; + x1 = ppt->x; + if (clipy1 <= y && y < clipy2) + { + x2 = x1 + *pwidth; + if (x1 < clipx1) x1 = clipx1; + if (x2 > clipx2) x2 = clipx2; + if (x1 < x2) + { + /* part of span in clip rectangle */ + pptNew->x = x1; + pptNew->y = y; + *pwidthNew = x2 - x1; + pptNew++; + pwidthNew++; + } + } + } /* end for */ + + } + else if ((numRects = prgnDst->data->numRects)) + { + /* Have to clip against many boxes */ + BoxPtr pboxBandStart, pboxBandEnd; + register BoxPtr pbox; + register BoxPtr pboxLast; + register int clipy1, clipy2; + + /* In this case, taking advantage of sorted spans gains more than + the sorting costs. */ + if ((! fSorted) && (nspans > 1)) + QuickSortSpans(ppt, pwidth, nspans); + + pboxBandStart = REGION_BOXPTR(prgnDst); + pboxLast = pboxBandStart + numRects; + + NextBand(); + + for (; ppt != pptLast; ) + { + y = ppt->y; + if (y < clipy2) + { + /* span is in the current band */ + pbox = pboxBandStart; + x1 = ppt->x; + x2 = x1 + *pwidth; + do + { /* For each box in band */ + register int newx1, newx2; + + newx1 = x1; + newx2 = x2; + if (newx1 < pbox->x1) newx1 = pbox->x1; + if (newx2 > pbox->x2) newx2 = pbox->x2; + if (newx1 < newx2) + { + /* Part of span in clip rectangle */ + pptNew->x = newx1; + pptNew->y = y; + *pwidthNew = newx2 - newx1; + pptNew++; + pwidthNew++; + } + pbox++; + } while (pbox != pboxBandEnd); + ppt++; + pwidth++; + } + else + { + /* Move to next band, adjust ppt as needed */ + pboxBandStart = pboxBandEnd; + if (pboxBandStart == pboxLast) + break; /* We're completely done */ + NextBand(); + } + } + } + return (pwidthNew - pwidthNewStart); +} + +/* find the band in a region with the most rectangles */ +int +miFindMaxBand(prgn) + RegionPtr prgn; +{ + register int nbox; + register BoxPtr pbox; + register int nThisBand; + register int nMaxBand = 0; + int yThisBand; + + good(prgn); + nbox = REGION_NUM_RECTS(prgn); + pbox = REGION_RECTS(prgn); + + while(nbox > 0) + { + yThisBand = pbox->y1; + nThisBand = 0; + while((nbox > 0) && (pbox->y1 == yThisBand)) + { + nbox--; + pbox++; + nThisBand++; + } + if (nThisBand > nMaxBand) + nMaxBand = nThisBand; + } + return (nMaxBand); +} + + +/* + *---------------------------------------------------------------------------- + * + * miApplyRect -- + * + * This is a simple helper function for use with the common case of + * (newreg = oldreg (op) newrect) where (op) is one of miUnion, + * miSubtract, miIntersect. + * + * Results: + * TRUE on success, FALSE otherwise. + * + * Side effects: + * Modifies newReg. + * + *---------------------------------------------------------------------------- + */ + +Bool +miApplyRect(RegionPtr newReg, RegionPtr reg, BoxPtr rect, + Bool (*op) (RegionPtr, RegionPtr, RegionPtr)) +{ + RegionRec topReg; + + good(reg); + + ASSERT(RECTINFO_ISVALID(rect->info)); + + if (rect->x2 <= rect->x1 || rect->y2 <= rect->y1) { + rect->x2 = rect->x1 = rect->y2 = rect->y1 = 0; + topReg.data = &miEmptyData; + } else { + topReg.data = NULL; + } + + topReg.extents = *rect; + + return (op)(newReg, reg, &topReg); +} + + +/* + *---------------------------------------------------------------------------- + * + * miRegionArea -- + * + * Returns the total actual area covered by all the rectangles in the + * region. Note that this is not the same as the area of the bounding + * box, obviously. + * + * XXX *could* calculate this iteratively and try to keep it up to date. + * + *---------------------------------------------------------------------------- + */ + +int +miRegionArea(RegionPtr reg) +{ + int i, area = 0; + + for (i = 0; i < REGION_NUM_RECTS(reg); i++) { + BoxPtr rect = ®ION_RECTS(reg)[i]; + ASSERT(rect); + area += (rect->x2 - rect->x1) * (rect->y2 - rect->y1); + } + + return area; +} + + +/* + *---------------------------------------------------------------------------- + * + * miRegionMatch -- + * + * Sets newReg to be a region containing all rects in reg for which + * match(rect) returns TRUE. + * + * Results: + * Returns TRUE if there were any matches. + * + * Side effects: + * Modifies newReg. + * + *---------------------------------------------------------------------------- + */ + +Bool +miRegionMatch(RegionPtr newReg, RegionPtr reg, + miRegionMatchFunc match, uintptr_t userData) +{ + int i; + Bool ret = FALSE; + RegionRec tmp; + + /* + * Use a tmp region in case newReg and reg point to the same region. + */ + miRegionInit(&tmp, NullBox, 0); + + for (i = 0; i < REGION_NUM_RECTS(reg); i++) { + BoxPtr rect = REGION_RECTS(reg) + i; + if (match(rect, userData)) { + miApplyRect(&tmp, &tmp, rect, miUnion); + ret = TRUE; + } + } + + miRegionCopy(newReg, &tmp); + + miRegionUninit(&tmp); + + return ret; +} + + +/* + *----------------------------------------------------------------------------- + * + * miIsRegionVoid -- + * + * Checks if the region passes the REGION_NIL test. If it doesn't + * pass, checks if the region's extents rectangle has 0 size. + * + * Results: + * TRUE if the region is void, FALSE otherwise. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +Bool +miIsRegionVoid(RegionPtr reg) // IN +{ + return REGION_NIL(reg) + || ( reg->data == NULL + && reg->extents.x1 == reg->extents.x2 + && reg->extents.y1 == reg->extents.y2); +} diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/resolution/libvmwarectrl.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/resolution/libvmwarectrl.c --- open-vm-tools-2008.01.23-74039/lib/resolution/libvmwarectrl.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/resolution/libvmwarectrl.c 2008-10-13 08:01:50.000000000 +0100 @@ -0,0 +1,275 @@ +/* + * Copyright 2006 by VMware, Inc. + * + * 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name of the copyright holder(s) + * and author(s) shall not be used in advertising or otherwise to promote + * the sale, use or other dealings in this Software without prior written + * authorization from the copyright holder(s) and author(s). + */ + +/* + * libvmwarectrl.c -- + * + * The VMWARE_CTRL client library. + */ + + +#define NEED_EVENTS +#define NEED_REPLIES +#include +#include "libvmwarectrl.h" +#include "vmwarectrlproto.h" +#include +#include + + +/* + * Static data and functions. + */ + +static XExtensionInfo _vmwarectrl_info_data; +static XExtensionInfo *vmwarectrl_info = &_vmwarectrl_info_data; +static char *vmwarectrl_extension_name = VMWARE_CTRL_PROTOCOL_NAME; + +#define VMwareCtrlCheckExtension(dpy, i, val) \ + XextCheckExtension(dpy, i, vmwarectrl_extension_name, val) + +static int close_display(Display *dpy, XExtCodes *codes); + +static /* const */ XExtensionHooks vmwarectrl_extension_hooks = { + NULL, /* create_gc */ + NULL, /* copy_gc */ + NULL, /* flush_gc */ + NULL, /* free_gc */ + NULL, /* create_font */ + NULL, /* free_font */ + close_display, /* close_display */ + NULL, /* wire_to_event */ + NULL, /* event_to_wire */ + NULL, /* error */ + NULL, /* error_string */ +}; + +static XEXT_GENERATE_CLOSE_DISPLAY (close_display, vmwarectrl_info) + +static XEXT_GENERATE_FIND_DISPLAY (find_display, vmwarectrl_info, + vmwarectrl_extension_name, + &vmwarectrl_extension_hooks, + 0, NULL) + +/* + *---------------------------------------------------------------------------- + * + * VMwareCtrl_QueryExtension -- + * + * Standard QueryExtension implementation. Not very interesting for + * VMWARE_CTRL as it doesn't define any events or errors. + * + * Results: + * True if information is successfully retrieved. False otherwise. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +Bool +VMwareCtrl_QueryExtension(Display *dpy, // IN: + int *event_basep, // OUT: + int *error_basep) // OUT: +{ + XExtDisplayInfo *info = find_display(dpy); + + if (XextHasExtension(info)) { + *event_basep = info->codes->first_event; + *error_basep = info->codes->first_error; + return True; + } else { + return False; + } +} + + +/* + *---------------------------------------------------------------------------- + * + * VMwareCtrl_QueryVersion -- + * + * Send the QueryVersion command to the driver and return the results. + * + * Results: + * True if information is successfully retrieved. False otherwise. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +Bool +VMwareCtrl_QueryVersion(Display *dpy, // IN: + int *majorVersion, // OUT: + int *minorVersion) // OUT: +{ + xVMwareCtrlQueryVersionReply rep; + xVMwareCtrlQueryVersionReq *req; + XExtDisplayInfo *info = find_display(dpy); + Bool ret = False; + + VMwareCtrlCheckExtension(dpy, info, False); + LockDisplay(dpy); + + GetReq(VMwareCtrlQueryVersion, req); + req->reqType = info->codes->major_opcode; + req->VMwareCtrlReqType = X_VMwareCtrlQueryVersion; + + if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) { + goto exit; + } + *majorVersion = rep.majorVersion; + *minorVersion = rep.minorVersion; + + ret = True; + +exit: + UnlockDisplay(dpy); + SyncHandle(); + + return ret; +} + + +/* + *---------------------------------------------------------------------------- + * + * VMwareCtrl_SetRes -- + * + * Send the SetRes command to the driver. + * + * Results: + * True if the resolution was set. False otherwise. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +Bool +VMwareCtrl_SetRes(Display *dpy, // IN: + int screen, // IN: + int x, // IN: + int y) // IN: +{ + xVMwareCtrlSetResReply rep; + xVMwareCtrlSetResReq *req; + XExtDisplayInfo *info = find_display(dpy); + Bool ret = False; + + VMwareCtrlCheckExtension(dpy, info, False); + LockDisplay(dpy); + + GetReq(VMwareCtrlSetRes, req); + req->reqType = info->codes->major_opcode; + req->VMwareCtrlReqType = X_VMwareCtrlSetRes; + req->screen = screen; + req->x = x; + req->y = y; + + if (!_XReply(dpy, (xReply *)&rep, + (SIZEOF(xVMwareCtrlSetResReply) - SIZEOF(xReply)) >> 2, + xFalse)) { + goto exit; + } + + ret = True; + +exit: + UnlockDisplay(dpy); + SyncHandle(); + + return ret; +} + + +/* + *---------------------------------------------------------------------------- + * + * VMwareCtrl_SetTopology -- + * + * Send the SetTopology command to the driver. + * + * Solaris 10 uses a different Xinerama standard than expected here. As a + * result, topology set is not supported and this function is excluded from + * Solaris builds. + * + * Results: + * True if the resolution and xinerama topology were set. False otherwise. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +#ifndef NO_MULTIMON +Bool +VMwareCtrl_SetTopology(Display *dpy, // IN: + int screen, // IN: + xXineramaScreenInfo extents[], // IN: + int number) // IN: +{ + xVMwareCtrlSetTopologyReply rep; + xVMwareCtrlSetTopologyReq *req; + XExtDisplayInfo *info = find_display(dpy); + Bool ret = False; + long len; + + VMwareCtrlCheckExtension(dpy, info, False); + LockDisplay(dpy); + + GetReq(VMwareCtrlSetTopology, req); + req->reqType = info->codes->major_opcode; + req->VMwareCtrlReqType = X_VMwareCtrlSetTopology; + req->screen = screen; + req->number = number; + + len = ((long) number) << 1; + SetReqLen(req, len, len); + len <<= 2; + _XSend(dpy, (char *)extents, len); + + if (!_XReply(dpy, (xReply *)&rep, + (SIZEOF(xVMwareCtrlSetTopologyReply) - SIZEOF(xReply)) >> 2, + xFalse)) { + goto exit; + } + + ret = True; + +exit: + UnlockDisplay(dpy); + SyncHandle(); + + return ret; +} +#endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/resolution/libvmwarectrl.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/resolution/libvmwarectrl.h --- open-vm-tools-2008.01.23-74039/lib/resolution/libvmwarectrl.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/resolution/libvmwarectrl.h 2008-10-13 08:01:50.000000000 +0100 @@ -0,0 +1,51 @@ +/* + * Copyright 2006 by VMware, Inc. + * + * 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name of the copyright holder(s) + * and author(s) shall not be used in advertising or otherwise to promote + * the sale, use or other dealings in this Software without prior written + * authorization from the copyright holder(s) and author(s). + */ + +/* + * libvmwarectrl.c -- + * + * The VMWARE_CTRL client library. + */ + + +#ifndef _LIB_VMWARE_CTRL_H_ +#define _LIB_VMWARE_CTRL_H_ + +#include +#include +#ifndef NO_MULTIMON +#include +#endif + +Bool VMwareCtrl_QueryExtension(Display *dpy, int *event_basep, int *error_basep); +Bool VMwareCtrl_QueryVersion(Display *dpy, int *majorVersion, int *minorVersion); +Bool VMwareCtrl_SetRes(Display *dpy, int screen, int x, int y); +#ifndef NO_MULTIMON +Bool VMwareCtrl_SetTopology(Display *dpy, int screen, xXineramaScreenInfo[], int number); +#endif + +#endif /* _LIB_VMWARE_CTRL_H_ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/resolution/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/resolution/Makefile.am --- open-vm-tools-2008.01.23-74039/lib/resolution/Makefile.am 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/resolution/Makefile.am 2008-10-13 08:01:48.000000000 +0100 @@ -0,0 +1,27 @@ +################################################################################ +### Copyright 2007 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_LIBRARIES = libResolution.a + +AM_CPPFLAGS = +AM_CPPFLAGS += -DRESOLUTION_X11 +AM_CPPFLAGS += @GTK_CPPFLAGS@ + +libResolution_a_SOURCES = +libResolution_a_SOURCES += resolution.c +libResolution_a_SOURCES += resolutionX11.c +libResolution_a_SOURCES += libvmwarectrl.c diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/resolution/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/resolution/Makefile.in --- open-vm-tools-2008.01.23-74039/lib/resolution/Makefile.in 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/resolution/Makefile.in 2008-10-13 08:02:15.000000000 +0100 @@ -0,0 +1,498 @@ +# 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 2007 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/resolution +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)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) +ARFLAGS = cru +libResolution_a_AR = $(AR) $(ARFLAGS) +libResolution_a_LIBADD = +am_libResolution_a_OBJECTS = resolution.$(OBJEXT) \ + resolutionX11.$(OBJEXT) libvmwarectrl.$(OBJEXT) +libResolution_a_OBJECTS = $(am_libResolution_a_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 = $(libResolution_a_SOURCES) +DIST_SOURCES = $(libResolution_a_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_XLIBS = @COMMON_XLIBS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ +DNET_LIBS = @DNET_LIBS@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ +GTK_LIBS = @GTK_LIBS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ +HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ +MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ +RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ +VERSION = @VERSION@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +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@ +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@ +lt_ECHO = @lt_ECHO@ +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_LIBRARIES = libResolution.a +AM_CPPFLAGS = -DRESOLUTION_X11 @GTK_CPPFLAGS@ +libResolution_a_SOURCES = resolution.c resolutionX11.c libvmwarectrl.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/resolution/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu lib/resolution/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-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) +libResolution.a: $(libResolution_a_OBJECTS) $(libResolution_a_DEPENDENCIES) + -rm -f libResolution.a + $(libResolution_a_AR) libResolution.a $(libResolution_a_OBJECTS) $(libResolution_a_LIBADD) + $(RANLIB) libResolution.a + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvmwarectrl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/resolution.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/resolutionX11.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 $(LIBRARIES) +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-noinstLIBRARIES \ + 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-noinstLIBRARIES 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: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/resolution/resolution.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/resolution/resolution.c --- open-vm-tools-2008.01.23-74039/lib/resolution/resolution.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/resolution/resolution.c 2008-10-13 08:01:50.000000000 +0100 @@ -0,0 +1,481 @@ +/********************************************************* + * Copyright (C) 2005 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. + * + *********************************************************/ + +/* + * resolution.c -- + * + * Set of functions to handle guest screen resizing for + * vmware-{user,guestd}. + */ + +#include +#include +#include + +#include "vmware.h" +#include "vm_app.h" +#include "debug.h" +#include "rpcout.h" +#include "str.h" +#include "strutil.h" + +#include "resolutionInt.h" +#include "resolution.h" + + +/* + * Internal global variables + */ + + +/* + * Describes current state of the library. + */ +ResolutionInfoType resolutionInfo = { .initialized = FALSE }; + + +/* + * Local function prototypes + */ + +static Bool ResolutionResolutionSetCB(RpcInData *data); +static Bool ResolutionDisplayTopologySetCB(RpcInData *data); + + +/* + * Global function definitions + */ + + +/* + *----------------------------------------------------------------------------- + * + * Resolution_Init -- + * + * Initialize the guest resolution library. + * + * Results: + * TRUE on success, FALSE on failure (bad arguments?). + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +Bool +Resolution_Init(const char *tcloChannel, + // IN: TCLO channel name; used during capability registration + // to tell the VMX whether Resolution_Set is being handled + // by VMwareService/guestd or VMwareUser/vmware-user. + InitHandle handle) + // IN: Back-end specific handle, if needed. E.g., in the X11 + // case, this refers to the X11 display handle. +{ + // Shorter-named convenience alias. I expect this to be optimized out. + ResolutionInfoType *resInfo = &resolutionInfo; + + ASSERT(resInfo->initialized == FALSE); + ASSERT((strcmp(tcloChannel, TOOLS_DAEMON_NAME) == 0) || + (strcmp(tcloChannel, TOOLS_DND_NAME)) == 0); + + /* + * Blank out the resolutionInfo field, then copy user's arguments. + */ + memset(resInfo, 0, sizeof *resInfo); + + strncpy(resInfo->tcloChannel, tcloChannel, sizeof resInfo->tcloChannel); + resInfo->tcloChannel[sizeof resInfo->tcloChannel - 1] = '\0'; + + if (!ResolutionBackendInit(handle)) { + return FALSE; + } + + resInfo->initialized = TRUE; + + return TRUE; +} + + +/* + *----------------------------------------------------------------------------- + * + * Resolution_Cleanup -- + * + * Shutdown the library, free resources, etc. + * + * Results: + * None. + * + * Side effects: + * Resolution_* calls will fail until user next calls Resolution_Init(). + * + *----------------------------------------------------------------------------- + */ + +void +Resolution_Cleanup(void) +{ + // Shorter-named convenience alias. I expect this to be optimized out. + ResolutionInfoType *resInfo = &resolutionInfo; + + if (!resInfo->initialized) { + return; + } + + Resolution_UnregisterCaps(); + Resolution_CleanupBackdoor(); + ResolutionBackendCleanup(); + + ASSERT(!resInfo->cbResolutionRegistered); + ASSERT(!resInfo->cbTopologyRegistered); + ASSERT(!resInfo->rpcIn); +} + + +/*----------------------------------------------------------------------------- + * + * Resolution_InitBackdoor -- + * + * Register RpcIn callbacks for supported/available RpcIn commands. + * + * Results: + * None. + * + * Side effects: + * Resolution_Set & DisplayTopology_Set callbacks may be registered. + * + *----------------------------------------------------------------------------- + */ + +void +Resolution_InitBackdoor(RpcIn *rpcIn) +{ + // Shorter-named convenience alias. I expect this to be optimized out. + ResolutionInfoType *resInfo = &resolutionInfo; + + ASSERT(resInfo->initialized); + ASSERT(rpcIn); + + resInfo->rpcIn = rpcIn; + + if (resInfo->canSetResolution) { + RpcIn_RegisterCallbackEx(resInfo->rpcIn, "Resolution_Set", + ResolutionResolutionSetCB, NULL); + resInfo->cbResolutionRegistered = TRUE; + } + + if (resInfo->canSetTopology) { + RpcIn_RegisterCallbackEx(resInfo->rpcIn, "DisplayTopology_Set", + ResolutionDisplayTopologySetCB, NULL); + resInfo->cbTopologyRegistered = TRUE; + } +} + + +/* + *----------------------------------------------------------------------------- + * + * Resolution_CleanupBackdoor -- + * + * Unregisters RpcIn callbacks. + * + * Results: + * None. + * + * Side effects: + * Resolution callbacks are removed. + * + *----------------------------------------------------------------------------- + */ + +void +Resolution_CleanupBackdoor(void) +{ + // Shorter-named convenience alias. I expect this to be optimized out. + ResolutionInfoType *resInfo = &resolutionInfo; + + if (!resInfo->initialized || !resInfo->rpcIn) { + return; + } + + if (resInfo->cbResolutionRegistered) { + RpcIn_UnregisterCallback(resInfo->rpcIn, "Resolution_Set"); + resInfo->cbResolutionRegistered = FALSE; + } + + if (resInfo->cbTopologyRegistered) { + RpcIn_UnregisterCallback(resInfo->rpcIn, "DisplayTopology_Set"); + resInfo->cbTopologyRegistered = FALSE; + } + + resInfo->rpcIn = FALSE; +} + + +/* + *----------------------------------------------------------------------------- + * + * Resolution_RegisterCaps -- + * + * Register the "Resolution_Set" capability. Sometimes this needs to + * be done separately from the TCLO callback registration, so we + * provide it separately here. + * + * Results: + * TRUE on success + * FALSE on failure + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +Bool +Resolution_RegisterCaps(void) +{ + // Shorter-named convenience alias. I expect this to be optimized out. + ResolutionInfoType *resInfo = &resolutionInfo; + + if (!resInfo->initialized) { + return FALSE; + } + + if (resInfo->canSetResolution) { + if (!RpcOut_sendOne(NULL, NULL, "tools.capability.resolution_set 1")) { + Debug("%s: Unable to register resolution set capability\n", + __FUNCTION__); + return FALSE; + } + + if (!RpcOut_sendOne(NULL, NULL, "tools.capability.resolution_server %s 1", + resInfo->tcloChannel)) { + Debug("%s: Unable to register resolution server capability\n", + __FUNCTION__); + + /* + * Note that we do not return false so that we stay backwards + * compatible with old vmx code (Workstation 6/ESX 3.5) that doesn't + * handle resolution_server. + */ + } + } + + if (resInfo->canSetTopology) { + if (!RpcOut_sendOne(NULL, NULL, "tools.capability.display_topology_set 2")) { + Debug("%s: Unable to register topology set capability\n", + __FUNCTION__); + } + + if (!RpcOut_sendOne(NULL, NULL, "tools.capability.display_global_offset 1")) { + Debug("%s: Unable to register topology global offset capability\n", + __FUNCTION__); + /* + * Ignore failures - host may not support these RPCs. + */ + } + } + + return TRUE; +} + + + + +/* + *----------------------------------------------------------------------------- + * + * Resolution_UnregisterCaps -- + * + * Unregister the "Resolution_Set" and "DisplayTopology_Set" capabilities. + * + * Results: + * TRUE on success + * FALSE on failure + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +Bool +Resolution_UnregisterCaps(void) +{ + // Shorter-named convenience alias. I expect this to be optimized out. + ResolutionInfoType *resInfo = &resolutionInfo; + + /* + * RpcIn doesn't have an unregister facility, so all we need to do + * here is unregister the capability. + */ + + if (!RpcOut_sendOne(NULL, NULL, "tools.capability.resolution_set 0")) { + Debug("%s: Unable to unregister ResolutionSet capability\n", + __FUNCTION__); + return FALSE; + } + + if (!RpcOut_sendOne(NULL, NULL, "tools.capability.resolution_server %s 0", + resInfo->tcloChannel)) { + Debug("%s: Unable to unregister resolution server capability\n", + __FUNCTION__); + + /* + * Don't return false here so that an older vmx (Workstation 6/ESX 3.5) + * that that supports resolution_set and not resolution_server will + * still work. + */ + } + + if (!RpcOut_sendOne(NULL, NULL, "tools.capability.display_topology_set 0") || + !RpcOut_sendOne(NULL, NULL, "tools.capability.display_global_offset 0")) { + Debug("%s: Unable to unregister TopologySet capability\n", + __FUNCTION__); + /* + * Ignore failures - host may not support these RPCs. + */ + } + + return TRUE; +} + + +/* + * Local function definitions + */ + + +/* + *----------------------------------------------------------------------------- + * + * ResolutionResolutionSetCB -- + * + * Handler for TCLO 'Resolution_Set'. + * + * Results: + * TRUE if we can reply, FALSE otherwise. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static Bool +ResolutionResolutionSetCB(RpcInData *data) // IN/OUT: +{ + uint32 width = 0 ; + uint32 height = 0; + unsigned int index = 0; + Bool retval = FALSE; + + /* parse the width and height */ + if (!StrUtil_GetNextUintToken(&width, &index, data->args, " ")) { + goto invalid_arguments; + } + if (!StrUtil_GetNextUintToken(&height, &index, data->args, "")) { + goto invalid_arguments; + } + + retval = ResolutionSetResolution(width, height); + +invalid_arguments: + return RPCIN_SETRETVALS(data, retval ? "" : "Invalid arguments", retval); +} + + +/* + *----------------------------------------------------------------------------- + * + * ResolutionDisplayTopologySetCB -- + * + * Handler for TCLO 'DisplayTopology_Set'. + * + * Routine unmarshals RPC arguments and passes over to back-end + * TopologySet(). + * + * Results: + * TRUE if we can reply, FALSE otherwise. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static Bool +ResolutionDisplayTopologySetCB(RpcInData *data) // IN/OUT: +{ + DisplayTopologyInfo *displays = NULL; + unsigned int count, i; + Bool success = FALSE; + const char *p; + + /* + * The argument string will look something like: + * [ , ] * count. + * + * e.g. + * 3 , 0 0 640 480 , 640 0 800 600 , 0 480 640 480 + */ + + if (sscanf(data->args, "%u", &count) != 1) { + return RPCIN_SETRETVALS(data, + "Invalid arguments. Expected \"count\"", + FALSE); + } + + + + displays = malloc(sizeof *displays * count); + if (!displays) { + RPCIN_SETRETVALS(data, + "Failed to alloc buffer for display info", + FALSE); + goto out; + } + + for (p = data->args, i = 0; i < count; i++) { + p = strchr(p, ','); + if (!p) { + RPCIN_SETRETVALS(data, + "Expected comma separated display list", + FALSE); + goto out; + } + p++; /* Skip past the , */ + + if (sscanf(p, " %d %d %d %d ", &displays[i].x, + &displays[i].y, &displays[i].width, &displays[i].height) != 4) { + RPCIN_SETRETVALS(data, + "Expected x, y, w, h in display entry", + FALSE); + goto out; + } + } + + success = ResolutionSetTopology(count, displays); + + RPCIN_SETRETVALS(data, success ? "" : "ResolutionSetTopology failed", success); + +out: + free(displays); + return success; +} diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/resolution/resolutionInt.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/resolution/resolutionInt.h --- open-vm-tools-2008.01.23-74039/lib/resolution/resolutionInt.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/resolution/resolutionInt.h 2008-10-13 08:01:50.000000000 +0100 @@ -0,0 +1,92 @@ +/********************************************************* + * Copyright (C) 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. + * + *********************************************************/ + +/* + * resolutionInt.h -- + * + * Internal header file for lib/resolution. + */ + +#ifndef _LIB_RESOLUTIONINT_H_ +#define _LIB_RESOLUTIONINT_H_ + +#define INCLUDE_ALLOW_USERLEVEL +#define INCLUDE_ALLOW_DISTRIBUTE +#include "includeCheck.h" + +#include "resolution.h" +#include "vm_app.h" + + +/* + * Data types + */ + + +/* + * Describes internal state of the resolution library. I.e., tracks whether + * a capability is supported, enabled, etc. + */ +typedef struct { + Bool initialized; // TRUE if successfully initialized. + Bool canSetResolution; // TRUE if back-end supports Resolution_Set. + Bool canSetTopology; // TRUE if back-end supports DisplayTopology_Set. + Bool cbResolutionRegistered; // TRUE if Resolution_Set CB registered. + Bool cbTopologyRegistered; // TRUE if DisplayTopology_Set CB registered. + RpcIn *rpcIn; // Points to RpcIn channel. + + char tcloChannel[MAX(sizeof TOOLS_DAEMON_NAME, + sizeof TOOLS_DND_NAME)]; + // Names the TCLO channel which the library will + // use for registering capabilities. +} ResolutionInfoType; + + +/* + * Describes the size and offset of a display. An array of these + * structures describes the entire topology of the guest desktop + * + * NB: Cribbed from Win32 resolution code. Refactor this. + */ +typedef struct { + int x; + int y; + int width; + int height; +} DisplayTopologyInfo; + + +/* + * Global variables + */ + +extern ResolutionInfoType resolutionInfo; + + +/* + * Global functions + */ + +/* Defined per back-end. */ +Bool ResolutionBackendInit(InitHandle handle); +void ResolutionBackendCleanup(void); +Bool ResolutionSetResolution(uint32 width, uint32 height); +Bool ResolutionSetTopology(unsigned int ndisplays, DisplayTopologyInfo displays[]); + + +#endif // ifndef _LIB_RESOLUTIONINT_H_ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/resolution/resolutionX11.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/resolution/resolutionX11.c --- open-vm-tools-2008.01.23-74039/lib/resolution/resolutionX11.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/resolution/resolutionX11.c 2008-10-13 08:01:50.000000000 +0100 @@ -0,0 +1,512 @@ +/********************************************************* + * Copyright (C) 2005 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. + * + *********************************************************/ + +/* + * resolutionX11.c -- + * + * X11 backend for lib/resolution. + */ + +#include +#include +#include + +#include +#include +#ifndef NO_MULTIMON +#include +#endif +#include +#undef Bool + +#include "vmware.h" + +#include "resolution.h" +#include "resolutionInt.h" + +#include "debug.h" +#include "fileIO.h" +#include "libvmwarectrl.h" +#include "str.h" +#include "strutil.h" + +#define VMWAREDRV_PATH_64 "/usr/X11R6/lib64/modules/drivers/vmware_drv.o" +#define VMWAREDRV_PATH "/usr/X11R6/lib/modules/drivers/vmware_drv.o" +#define VERSION_STRING "VMware Guest X Server" + + +/* + * Describes the state of the X11 back-end of lib/resolution. + */ +typedef struct { + Display *display; // X11 connection / display context + Window rootWindow; // points to display's root window + Bool canUseVMwareCtrl; + // TRUE if VMwareCtrl extension available + Bool canUseVMwareCtrlTopologySet; + // TRUE if VMwareCtrl extension supports topology set +} ResolutionInfoX11Type; + + +/* + * Global variables + */ + +ResolutionInfoX11Type resolutionInfoX11; + + +/* + * Local function prototypes + */ + +static Bool ResolutionCanSet(void); +static Bool TopologyCanSet(void); +static Bool SelectResolution(uint32 width, uint32 height); + + +/* + * Global function definitions + */ + + +/* + *----------------------------------------------------------------------------- + * + * ResolutionBackendInit -- + * + * X11 back-end initializer. Records caller's X11 display, then determines + * which capabilities are available. + * + * Results: + * TRUE on success, FALSE on failure. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +Bool +ResolutionBackendInit(InitHandle handle) // IN: User's X11 display. +{ + ResolutionInfoX11Type *resInfoX = &resolutionInfoX11; + ResolutionInfoType *resInfo = &resolutionInfo; + int dummy1; + int dummy2; + + memset(resInfoX, 0, sizeof *resInfoX); + + resInfoX->display = handle; + + if (resInfoX->display == NULL) { + Warning("%s: Called with invalid X display!\n", __func__); + return FALSE; + } + + resInfoX->display = handle; + resInfoX->rootWindow = DefaultRootWindow(resInfoX->display); + resInfoX->canUseVMwareCtrl = VMwareCtrl_QueryVersion(resInfoX->display, &dummy1, + &dummy2); + resInfoX->canUseVMwareCtrlTopologySet = FALSE; + + resInfo->canSetResolution = ResolutionCanSet(); + resInfo->canSetTopology = TopologyCanSet(); + + return TRUE; +} + + +/* + *----------------------------------------------------------------------------- + * + * ResolutionBackendCleanup -- + * + * Frees (no) resources associated with the X11 Resolution_Set back-end. + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +void +ResolutionBackendCleanup(void) +{ + return; +} + + +/*----------------------------------------------------------------------------- + * + * ResolutionSetResolution -- + * + * Given a width and height, define a custom resolution (if VMwareCtrl is + * available), then issue a change resolution request via XRandR. + * + * This is called as a result of the Resolution_Set request from the vmx. + * + * Results: + * TRUE if we are able to set to the exact size requested, FALSE otherwise. + * + * Side effects: + * The screen resolution will change. + * + *----------------------------------------------------------------------------- + */ + +Bool +ResolutionSetResolution(uint32 width, // IN + uint32 height) // IN +{ + ResolutionInfoX11Type *resInfoX = &resolutionInfoX11; + ASSERT(resolutionInfo.canSetResolution); + + if (resInfoX->canUseVMwareCtrl) { + /* + * If so, use the VMWARE_CTRL extension to provide a custom resolution + * which we'll find as an exact match from XRRConfigSizes() (unless + * the resolution is too large). + * + * As such, we don't care if this succeeds or fails, we'll make a best + * effort attempt to change resolution anyway. + */ + VMwareCtrl_SetRes(resInfoX->display, DefaultScreen(resInfoX->display), + width, height); + } + + return SelectResolution(width, height); +} + + +/* + *----------------------------------------------------------------------------- + * + * ResolutionSetTopology -- + * + * Employs the Xinerama extension to declare a new display topology. + * + * Solaris 10 uses a different Xinerama standard than expected here. As a + * result, topology set is not supported and this function is excluded from + * Solaris builds. + * + * XXX With Solaris 10 shipping X.org, perhaps we should revisit this + * decision. + * + * Results: + * TRUE if operation succeeded, FALSE otherwise. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +Bool +ResolutionSetTopology(unsigned int ndisplays, + // IN: number of elements in topology + DisplayTopologyInfo *topology) + // IN: array of display geometries +{ +#ifdef NO_MULTIMON + return FALSE; +#else + ResolutionInfoX11Type *resInfoX = &resolutionInfoX11; + Bool success = FALSE; + unsigned int i; + xXineramaScreenInfo *displays = NULL; + short maxX = 0; + short maxY = 0; + int minX = 0; + int minY = 0; + + ASSERT(resolutionInfo.canSetTopology); + + /* + * Allocate xXineramaScreenInfo array & translate from DisplayTopologyInfo. + * Iterate over displays looking for minimum, maximum dimensions. + * Warn if min isn't at (0,0). + * Transform to (0,0). + * Call out to VMwareCtrl_SetTopology. + * Set new jumbotron resolution. + */ + + displays = malloc(sizeof *displays * ndisplays); + if (!displays) { + goto out; + } + + for (i = 0; i < ndisplays; i++) { + displays[i].x_org = topology[i].x; + displays[i].y_org = topology[i].y; + displays[i].width = topology[i].width; + displays[i].height = topology[i].height; + + maxX = MAX(maxX, displays[i].x_org + displays[i].width); + maxY = MAX(maxY, displays[i].y_org + displays[i].height); + minX = MIN(minX, displays[i].x_org); + minY = MIN(minY, displays[i].y_org); + } + + if (minX != 0 || minY != 0) { + Warning("The bounding box of the display topology does not have an " + "origin of (0,0)\n"); + } + + /* + * Transform the topology so that the bounding box has an origin of (0,0). Since the + * host is already supposed to pass a normalized topology, this should not have any + * effect. + */ + for (i = 0; i < ndisplays; i++) { + displays[i].x_org -= minX; + displays[i].y_org -= minY; + } + + if (!VMwareCtrl_SetTopology(resInfoX->display, DefaultScreen(resInfoX->display), displays, + ndisplays)) { + Debug("Failed to set topology in the driver.\n"); + goto out; + } + + if (!SelectResolution(maxX - minX, maxY - minY)) { + Debug("Failed to set new resolution.\n"); + goto out; + } + + success = TRUE; + +out: + free(displays); + return success; +#endif +} + + +/* + * Local function definitions + */ + + +/*----------------------------------------------------------------------------- + * + * ResolutionCanSet -- + * + * Is the VMware SVGA driver a high enough version to support resolution + * changing? We check by searching the driver binary for a known version + * string. + * + * Results: + * TRUE if the driver version is high enough, FALSE otherwise. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static Bool +ResolutionCanSet(void) +{ + ResolutionInfoX11Type *resInfoX = &resolutionInfoX11; + FileIODescriptor fd; + FileIOResult res; + int64 filePos = 0; + Bool keepSearching = TRUE; + Bool found = FALSE; + char buf[sizeof VERSION_STRING + 10]; // size of VERSION_STRING plus some extra for the version number + const char versionString[] = VERSION_STRING; + size_t bytesRead; + int32 major, minor, level; + unsigned int tokPos; + + /* See if the randr X module is loaded */ + if (!XRRQueryVersion(resInfoX->display, &major, &minor) ) { + return FALSE; + } + + /* See if the VMWARE_CTRL extension is supported */ + if (resInfoX->canUseVMwareCtrl) { + return TRUE; + } + + /* + * XXX: This check does not work with XOrg 6.9/7.0 for two reasons: Both + * versions now use .so for the driver extension and 7.0 moves the drivers + * to a completely different directory. As long as we ship a driver for + * 6.9/7.0, we can instead just use the VMWARE_CTRL check. + */ + buf[sizeof buf - 1] = '\0'; + FileIO_Invalidate(&fd); + res = FileIO_Open(&fd, VMWAREDRV_PATH_64, FILEIO_ACCESS_READ, FILEIO_OPEN); + if (res != FILEIO_SUCCESS) { + res = FileIO_Open(&fd, VMWAREDRV_PATH, FILEIO_ACCESS_READ, FILEIO_OPEN); + } + if (res == FILEIO_SUCCESS) { + /* + * One of the opens succeeded, so start searching thru the file. + */ + while (keepSearching) { + res = FileIO_Read(&fd, buf, sizeof buf - 1, &bytesRead); + if (res != FILEIO_SUCCESS || bytesRead < sizeof buf -1 ) { + keepSearching = FALSE; + } else { + if (Str_Strncmp(versionString, buf, sizeof versionString - 1) == 0) { + keepSearching = FALSE; + found = TRUE; + } + } + filePos = FileIO_Seek(&fd, filePos+1, FILEIO_SEEK_BEGIN); + if (filePos == -1) { + keepSearching = FALSE; + } + } + FileIO_Close(&fd); + if (found) { + /* + * We NUL-terminated buf earlier, but Coverity really wants it to + * be NUL-terminated after the call to FileIO_Read (because + * FileIO_Read doesn't NUL-terminate). So we'll do it again. + */ + buf[sizeof buf - 1] = '\0'; + + /* + * Try and parse the major, minor and level versions + */ + tokPos = sizeof versionString - 1; + if (!StrUtil_GetNextIntToken(&major, &tokPos, buf, ".- ")) { + return FALSE; + } + if (!StrUtil_GetNextIntToken(&minor, &tokPos, buf, ".- ")) { + return FALSE; + } + if (!StrUtil_GetNextIntToken(&level, &tokPos, buf, ".- ")) { + return FALSE; + } + + return ((major > 10) || (major == 10 && minor >= 11)); + } + } + return FALSE; +} + + +/* + *----------------------------------------------------------------------------- + * + * TopologyCanSet -- + * + * Tests whether or not we can change display topology. + * + * Results: + * TRUE if we're able to reset topology, otherwise FALSE. + * + * Side effects: + * resInfoX->canUseVMwareCtrlTopologySet will be set to TRUE on success. + * + *----------------------------------------------------------------------------- + */ + +static Bool +TopologyCanSet(void) +{ + ResolutionInfoX11Type *resInfoX = &resolutionInfoX11; +#ifdef NO_MULTIMON + resInfoX->canUseVMwareCtrlTopologySet = FALSE; +#else + int major; + int minor; + + if (resInfoX->canUseVMwareCtrl && XineramaQueryVersion(resInfoX->display, &major, + &minor)) { + /* + * We need both a new enough VMWARE_CTRL and Xinerama for this to work. + */ + resInfoX->canUseVMwareCtrlTopologySet = (major > 0) || (major == 0 && minor >= 2); + } else { + resInfoX->canUseVMwareCtrlTopologySet = FALSE; + } +#endif + + return resInfoX->canUseVMwareCtrlTopologySet; +} + + +/*----------------------------------------------------------------------------- + * + * SelectResolution -- + * + * Given a width and height, find the biggest resolution that will "fit". + * This is called as a result of the resolution set request from the vmx. + * + * Results: + * TRUE if we are able to set to the exact size requested, FALSE otherwise. + * + * Side effects: + * The screen resolution of will change. + * + *----------------------------------------------------------------------------- + */ + +Bool +SelectResolution(uint32 width, // IN + uint32 height) // IN +{ + ResolutionInfoX11Type *resInfoX = &resolutionInfoX11; + XRRScreenConfiguration* xrrConfig; + XRRScreenSize *xrrSizes; + Rotation xrrCurRotation; + uint32 xrrNumSizes; + uint32 i; + uint32 bestFitIndex = 0; + uint64 bestFitSize = 0; + uint64 potentialSize; + + xrrConfig = XRRGetScreenInfo(resInfoX->display, resInfoX->rootWindow); + xrrSizes = XRRConfigSizes(xrrConfig, &xrrNumSizes); + XRRConfigCurrentConfiguration(xrrConfig, &xrrCurRotation); + + /* + * Iterate thru the list finding the best fit that is still <= in both width + * and height. + */ + for (i = 0; i < xrrNumSizes; i++) { + potentialSize = xrrSizes[i].width * xrrSizes[i].height; + if (xrrSizes[i].width <= width && xrrSizes[i].height <= height && + potentialSize > bestFitSize ) { + bestFitSize = potentialSize; + bestFitIndex = i; + } + } + + if (bestFitSize > 0) { + Debug("Setting guest resolution to: %dx%d (requested: %d, %d)\n", + xrrSizes[bestFitIndex].width, xrrSizes[bestFitIndex].height, width, height); + XRRSetScreenConfig(resInfoX->display, xrrConfig, resInfoX->rootWindow, + bestFitIndex, xrrCurRotation, GDK_CURRENT_TIME); + } else { + Debug("Can't find a suitable guest resolution, ignoring request for %dx%d\n", + width, height); + } + + XRRFreeScreenConfigInfo(xrrConfig); + return xrrSizes[bestFitIndex].width == width && + xrrSizes[bestFitIndex].height == height; +} diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/resolution/vmwarectrl.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/resolution/vmwarectrl.h --- open-vm-tools-2008.01.23-74039/lib/resolution/vmwarectrl.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/resolution/vmwarectrl.h 2008-10-13 08:01:50.000000000 +0100 @@ -0,0 +1,48 @@ +/* + * Copyright 2006 by VMware, Inc. + * + * 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name of the copyright holder(s) + * and author(s) shall not be used in advertising or otherwise to promote + * the sale, use or other dealings in this Software without prior written + * authorization from the copyright holder(s) and author(s). + */ + +/* + * vmwarectrl.h -- + * + * The definitions used by the VMWARE_CTRL protocol extension that + * allows X clients to communicate with the driver. + */ + + +#ifndef _VMWARE_CTRL_H_ +#define _VMWARE_CTRL_H_ + +#define VMWARE_CTRL_PROTOCOL_NAME "VMWARE_CTRL" + +#define VMWARE_CTRL_MAJOR_VERSION 0 +#define VMWARE_CTRL_MINOR_VERSION 2 + +#define X_VMwareCtrlQueryVersion 0 +#define X_VMwareCtrlSetRes 1 +#define X_VMwareCtrlSetTopology 2 + +#endif /* _VMWARE_CTRL_H_ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/resolution/vmwarectrlproto.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/resolution/vmwarectrlproto.h --- open-vm-tools-2008.01.23-74039/lib/resolution/vmwarectrlproto.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/resolution/vmwarectrlproto.h 2008-10-13 08:01:50.000000000 +0100 @@ -0,0 +1,122 @@ +/* + * Copyright 2006 by VMware, Inc. + * + * 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name of the copyright holder(s) + * and author(s) shall not be used in advertising or otherwise to promote + * the sale, use or other dealings in this Software without prior written + * authorization from the copyright holder(s) and author(s). + */ + +/* + * vmwarectrlproto.h -- + * + * The description of the VMWARE_CTRL protocol extension that + * allows X clients to communicate with the driver. + */ + +#ifndef _VMWARE_CTRL_PROTO_H_ +#define _VMWARE_CTRL_PROTO_H_ + + +#include +#include "vmwarectrl.h" + + +/* + * Requests and Replies + */ + +/* Version 0.1 definitions. */ + +typedef struct { + CARD8 reqType; /* always X_VMwareCtrlReqCode */ + CARD8 VMwareCtrlReqType; /* always X_VMwareCtrlQueryVersion */ + CARD16 length B16; + CARD32 majorVersion B32; + CARD32 minorVersion B32; +} xVMwareCtrlQueryVersionReq; +#define sz_xVMwareCtrlQueryVersionReq 12 + +typedef struct { + BYTE type; /* X_Reply */ + BYTE pad1; + CARD16 sequenceNumber B16; + CARD32 length B32; + CARD32 majorVersion B32; + CARD32 minorVersion B32; + CARD32 pad2 B32; + CARD32 pad3 B32; + CARD32 pad4 B32; + CARD32 pad5 B32; +} xVMwareCtrlQueryVersionReply; +#define sz_xVMwareCtrlQueryVersionReply 32 + +typedef struct { + CARD8 reqType; /* always X_VMwareCtrlReqCode */ + CARD8 VMwareCtrlReqType; /* always X_VMwareCtrlSetRes */ + CARD16 length B16; + CARD32 screen B32; + CARD32 x B32; + CARD32 y B32; +} xVMwareCtrlSetResReq; +#define sz_xVMwareCtrlSetResReq 16 + +typedef struct { + BYTE type; /* X_Reply */ + BYTE pad1; + CARD16 sequenceNumber B16; + CARD32 length B32; + CARD32 screen B32; + CARD32 x B32; + CARD32 y B32; + CARD32 pad2 B32; + CARD32 pad3 B32; + CARD32 pad4 B32; +} xVMwareCtrlSetResReply; +#define sz_xVMwareCtrlSetResReply 32 + +/* Version 0.2 definitions. */ + +typedef struct { + CARD8 reqType; /* always X_VMwareCtrlReqCode */ + CARD8 VMwareCtrlReqType; /* always X_VMwareCtrlSetTopology */ + CARD16 length B16; + CARD32 screen B32; + CARD32 number B32; + CARD32 pad1 B32; +} xVMwareCtrlSetTopologyReq; +#define sz_xVMwareCtrlSetTopologyReq 16 + +typedef struct { + BYTE type; /* X_Reply */ + BYTE pad1; + CARD16 sequenceNumber B16; + CARD32 length B32; + CARD32 screen B32; + CARD32 pad2 B32; + CARD32 pad3 B32; + CARD32 pad4 B32; + CARD32 pad5 B32; + CARD32 pad6 B32; +} xVMwareCtrlSetTopologyReply; +#define sz_xVMwareCtrlSetTopologyReply 32 + +#endif /* _VMWARE_CTRL_PROTO_H_ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/rpcIn/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/rpcIn/Makefile.am --- open-vm-tools-2008.01.23-74039/lib/rpcIn/Makefile.am 2008-01-28 08:02:49.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/rpcIn/Makefile.am 2008-10-13 08:01:48.000000000 +0100 @@ -19,6 +19,3 @@ libRpcIn_a_SOURCES = libRpcIn_a_SOURCES += rpcin.c - -AM_CFLAGS = -AM_CFLAGS += @COMMON_CFLAGS@ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/rpcIn/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/rpcIn/Makefile.in --- open-vm-tools-2008.01.23-74039/lib/rpcIn/Makefile.in 2008-01-28 08:03:04.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/rpcIn/Makefile.in 2008-10-13 08:02:15.000000000 +0100 @@ -52,7 +52,10 @@ subdir = lib/rpcIn DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +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)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -64,7 +67,7 @@ am_libRpcIn_a_OBJECTS = rpcin.$(OBJEXT) libRpcIn_a_OBJECTS = $(am_libRpcIn_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp +depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -90,8 +93,6 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -COMMON_CFLAGS = @COMMON_CFLAGS@ -COMMON_PROG_CFLAGS = @COMMON_PROG_CFLAGS@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -102,45 +103,57 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ -ECHO = @ECHO@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GREP = @GREP@ -GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_AUTH_CFLAGS = @LIB_AUTH_CFLAGS@ -LIB_FILE_CFLAGS = @LIB_FILE_CFLAGS@ -LIB_HGFS_SERVER_CFLAGS = @LIB_HGFS_SERVER_CFLAGS@ -LIB_IMPERSONATE_CFLAGS = @LIB_IMPERSONATE_CFLAGS@ -LIB_MISC_CFLAGS = @LIB_MISC_CFLAGS@ -LIB_PROC_MGR_CFLAGS = @LIB_PROC_MGR_CFLAGS@ -LIB_STRING_CFLAGS = @LIB_STRING_CFLAGS@ -LIB_USER_CFLAGS = @LIB_USER_CFLAGS@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -148,27 +161,35 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ VERSION = @VERSION@ -VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -199,6 +220,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -215,7 +237,6 @@ top_srcdir = @top_srcdir@ noinst_LIBRARIES = libRpcIn.a libRpcIn_a_SOURCES = rpcin.c -AM_CFLAGS = @COMMON_CFLAGS@ all: all-am .SUFFIXES: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/rpcIn/rpcin.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/rpcIn/rpcin.c --- open-vm-tools-2008.01.23-74039/lib/rpcIn/rpcin.c 2008-01-28 08:02:50.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/rpcIn/rpcin.c 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -48,9 +48,19 @@ #include "vmware.h" #include "message.h" -#include "eventManager.h" #include "rpcin.h" -#include "dbllnklst.h" + +#if defined(VMTOOLS_USE_GLIB) + +#define RPCIN_SCHED_EVENT(in, src) do { \ + (in)->nextEvent = src; \ + g_source_set_callback((in)->nextEvent, RpcInLoop, (in), NULL); \ + g_source_attach((in)->nextEvent, g_main_loop_get_context((in)->mainLoop)); \ +} while (0) + +#else /* VMTOOLS_USE_GLIB */ + +#include "eventManager.h" /* Which event queue should RPC events be added to? */ static DblLnkLst_Links *gTimerEventQueue; @@ -59,24 +69,43 @@ * The RpcIn object */ +typedef enum { + RPCIN_CB_OLD, + RPCIN_CB_NEW +} RpcInCallbackType; + + /* The list of TCLO command callbacks we support */ typedef struct RpcInCallbackList { const char *name; size_t length; /* Length of name so we don't have to strlen a lot */ - RpcIn_Callback function; + RpcInCallbackType type; + union { + RpcIn_CallbackOld oldCb; + RpcIn_Callback newCb; + } callback; struct RpcInCallbackList *next; void *clientData; } RpcInCallbackList; +#endif /* VMTOOLS_USE_GLIB */ + struct RpcIn { +#if defined(VMTOOLS_USE_GLIB) + GSource *nextEvent; + GMainLoop *mainLoop; + RpcIn_Callback dispatch; + gpointer clientData; +#else RpcInCallbackList *callbacks; + Event *nextEvent; +#endif Message_Channel *channel; unsigned int delay; /* The delay of the previous iteration of RpcInLoop */ unsigned int maxDelay; /* The maximum delay to schedule in RpcInLoop */ RpcIn_ErrorFunc *errorFunc; void *errorData; - Event *nextEvent; /* * State of the result associated to the last TCLO request we received @@ -93,6 +122,15 @@ }; +/* + * The following functions are only needed in the non-glib version of the + * library. The glib version of the library only deals with the transport + * aspects of the code - RPC dispatching and other RPC-layer concerns are + * handled by the rpcChannel abstraction library, or by the application. + */ + +#if !defined(VMTOOLS_USE_GLIB) + /* *----------------------------------------------------------------------------- * @@ -110,14 +148,9 @@ */ static Bool -RpcInPingCallback(char const **result, // OUT - size_t *resultLen, // OUT - const char *name, // IN - const char *args, // IN - size_t argsSize, // IN - void *clientData) // IN +RpcInPingCallback(RpcInData *data) // IN { - return RpcIn_SetRetVals(result, resultLen, "", TRUE); + return RPCIN_SETRETVALS(data, "", TRUE); } @@ -151,6 +184,237 @@ /* *----------------------------------------------------------------------------- * + * RpcInLookupCallback -- + * + * Lookup a callback struct in our list. + * + * Results: + * The callback if found + * NULL if not found + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +RpcInCallbackList * +RpcInLookupCallback(RpcIn *in, // IN + const char *name) // IN +{ + RpcInCallbackList *p; + + ASSERT(in); + ASSERT(name); + + for (p = in->callbacks; p; p = p->next) { + if (strcmp(name, p->name) == 0) { + return p; + } + } + + return NULL; +} + + +/* + *----------------------------------------------------------------------------- + * + * RpcIn_RegisterCallback -- + * + * Register an old-style callback to happen when a TCLO message is + * received. When a TCLO message beginning with 'name' is + * sent, the callback will be called with: the cmd name, the args + * (starting with the char directly after the cmd name; that's why + * it's helpful to add a space to the name if arguments are expected), + * and a pointer to the result. + * + * Results: + * None + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +void +RpcIn_RegisterCallback(RpcIn *in, // IN + const char *name, // IN + RpcIn_CallbackOld cb, // IN + void *clientData) // IN +{ + RpcInCallbackList *p; + + Debug("Registering callback '%s'\n", name); + + ASSERT(in); + ASSERT(name); + ASSERT(cb); + ASSERT(RpcInLookupCallback(in, name) == NULL); // not there yet + + p = (RpcInCallbackList *) malloc(sizeof(RpcInCallbackList)); + ASSERT_NOT_IMPLEMENTED(p); + + p->length = strlen(name); + p->name = strdup(name); + p->type = RPCIN_CB_OLD; + p->callback.oldCb = cb; + p->clientData = clientData; + + p->next = in->callbacks; + + in->callbacks = p; +} + + +/* + *----------------------------------------------------------------------------- + * + * RpcIn_RegisterCallbackEx -- + * + * Register a callback to happen when a TCLO message is + * received. When a TCLO message beginning with 'name' is + * sent, the callback will be called with an instance of + * "RpcInData" with the information from the request. + * + * Results: + * None + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ +void +RpcIn_RegisterCallbackEx(RpcIn *in, // IN + const char *name, // IN + RpcIn_Callback cb, // IN + void *clientData) // IN +{ + RpcInCallbackList *p; + + Debug("Registering callback '%s'\n", name); + + ASSERT(in); + ASSERT(name); + ASSERT(cb); + ASSERT(RpcInLookupCallback(in, name) == NULL); // not there yet + + p = (RpcInCallbackList *) malloc(sizeof(RpcInCallbackList)); + ASSERT_NOT_IMPLEMENTED(p); + + p->length = strlen(name); + p->name = strdup(name); + p->type = RPCIN_CB_NEW; + p->callback.newCb = cb; + p->clientData = clientData; + + p->next = in->callbacks; + + in->callbacks = p; +} + + +/* + *----------------------------------------------------------------------------- + * + * RpcIn_UnregisterCallback -- + * + * Unregisters an RpcIn callback by name. + * + * Results: + * None + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +void +RpcIn_UnregisterCallback(RpcIn *in, // IN + const char *name) // IN +{ + RpcInCallbackList *cur, *prev; + + ASSERT(in); + ASSERT(name); + + Debug("Unregistering callback '%s'\n", name); + + for (cur = in->callbacks, prev = NULL; cur && strcmp(cur->name, name); + prev = cur, cur = cur->next); + + /* + * If we called UnregisterCallback on a name that doesn't exist, we + * have a problem. + */ + ASSERT(cur != NULL); + + if (prev == NULL) { + in->callbacks = cur->next; + } else { + prev->next = cur->next; + } + free((void *)cur->name); + free(cur); +} + + +#else /* VMTOOLS_USE_GLIB */ + + +/* + *----------------------------------------------------------------------------- + * + * RpcIn_Construct -- + * + * Constructor for the RpcIn object. Ties the RpcIn loop to the given + * glib main loop, and uses the given callback to dispatch incoming + * RPC messages. + * + * The dispatch callback receives data in a slightly different way than + * the regular RPC callbacks. Basically, the raw data from the backdoor + * is provided in the "args" field of the RpcInData struct, and "name" + * is NULL. So the dispatch function is responsible for parsing the RPC + * message, and preparing the RpcInData instance for proper use by the + * final consumer. + * + * Results: + * New RpcIn object. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +RpcIn * +RpcIn_Construct(GMainLoop *mainLoop, // IN + RpcIn_Callback dispatch, // IN + gpointer clientData) // IN +{ + RpcIn *result; + + ASSERT(mainLoop != NULL); + ASSERT(dispatch != NULL); + + result = calloc(1, sizeof *result); + if (result != NULL) { + result->mainLoop = mainLoop; + result->clientData = clientData; + result->dispatch = dispatch; + } + return result; +} + +#endif /* VMTOOLS_USE_GLIB */ + + +/* + *----------------------------------------------------------------------------- + * * RpcIn_Destruct -- * * Destructor for the RpcIn object. @@ -173,6 +437,7 @@ ASSERT(in->nextEvent == NULL); ASSERT(in->mustSend == FALSE); +#if !defined(VMTOOLS_USE_GLIB) while (in->callbacks) { RpcInCallbackList *p; @@ -183,6 +448,8 @@ } gTimerEventQueue = NULL; +#endif + free(in); } @@ -256,8 +523,11 @@ if (in->nextEvent) { /* The loop is started. Stop it */ +#if defined(VMTOOLS_USE_GLIB) + g_source_destroy(in->nextEvent); +#else EventManager_Remove(in->nextEvent); - +#endif in->nextEvent = NULL; } @@ -289,47 +559,13 @@ /* *----------------------------------------------------------------------------- * - * RpcInLookupCallback -- - * - * Lookup a callback struct in our list. - * - * Results: - * The callback if found - * NULL if not found - * - * Side effects: - * None - * - *----------------------------------------------------------------------------- - */ - -RpcInCallbackList * -RpcInLookupCallback(RpcIn *in, // IN - const char *name) // IN -{ - RpcInCallbackList *p; - - ASSERT(in); - ASSERT(name); - - for (p = in->callbacks; p; p = p->next) { - if (strcmp(name, p->name) == 0) { - return p; - } - } - - return NULL; -} - - -/* - *----------------------------------------------------------------------------- - * * RpcInLoop -- * * The background loop that receives RPC from VMware * * Result + * Always FALSE for the glib implementation (to force unregistration of the + * timer; this function will re-schedule the callback). * TRUE on success * FALSE on failure (never happens in this implementation) * @@ -340,7 +576,11 @@ *----------------------------------------------------------------------------- */ +#if defined(VMTOOLS_USE_GLIB) +static gboolean +#else static Bool +#endif RpcInLoop(void *clientData) // IN { RpcIn *in; @@ -353,6 +593,9 @@ /* The event has fired: it is no longer valid */ ASSERT(in->nextEvent); +#if defined(VMTOOLS_USE_GLIB) + g_source_unref(in->nextEvent); +#endif in->nextEvent = NULL; /* This is very important: this is the only way to signal the existence @@ -374,25 +617,50 @@ unsigned int status; char const *statusStr; unsigned int statusLen; - char const *result; + char *result; size_t resultLen; - char *cmd; - unsigned int index = 0; - RpcInCallbackList *cb = NULL; + Bool freeResult = FALSE; /* * Execute the RPC */ +#if defined(VMTOOLS_USE_GLIB) + RpcInData data = { NULL, reply, repLen, NULL, 0, FALSE, NULL, in->clientData }; + + status = in->dispatch(&data); + result = data.result; + resultLen = data.resultLen; + freeResult = data.freeResult; +#else + char *cmd; + unsigned int index = 0; + RpcInCallbackList *cb = NULL; + cmd = StrUtil_GetNextToken(&index, reply, " "); if (cmd != NULL) { cb = RpcInLookupCallback(in, cmd); free(cmd); if (cb) { result = NULL; - status = cb->function(&result, &resultLen, cb->name, - reply + cb->length, repLen - cb->length, - cb->clientData); + if (cb->type == RPCIN_CB_OLD) { + status = cb->callback.oldCb((char const **) &result, &resultLen, cb->name, + reply + cb->length, repLen - cb->length, + cb->clientData); + } else { + RpcInData data = { cb->name, + reply + cb->length, + repLen - cb->length, + NULL, + 0, + FALSE, + NULL, + cb->clientData }; + status = cb->callback.newCb(&data); + result = data.result; + resultLen = data.resultLen; + freeResult = data.freeResult; + } ASSERT(result); } else { @@ -405,6 +673,7 @@ result = "Bad command"; resultLen = strlen(result); } +#endif if (status) { statusStr = "OK "; @@ -422,6 +691,10 @@ memcpy(in->last_result, statusStr, statusLen); memcpy(in->last_result + statusLen, result, resultLen); in->last_resultLen = statusLen + resultLen; + + if (freeResult) { + free(result); + } #if 0 /* Costly in non-debug cases --hpreg */ if (strlen(reply) <= 128) { @@ -467,13 +740,21 @@ ASSERT(in->mustSend == FALSE); in->mustSend = TRUE; +#if defined(VMTOOLS_USE_GLIB) + RPCIN_SCHED_EVENT(in, g_timeout_source_new(in->delay * 10)); +#else in->nextEvent = EventManager_Add(gTimerEventQueue, in->delay, RpcInLoop, in); +#endif if (in->nextEvent == NULL) { errmsg = "RpcIn: Unable to run the loop"; goto error; } +#if defined(VMTOOLS_USE_GLIB) + return FALSE; +#else return TRUE; +#endif error: RpcIn_stop(in); @@ -481,7 +762,11 @@ /* Call the error routine */ (*in->errorFunc)(in->errorData, errmsg); +#if defined(VMTOOLS_USE_GLIB) + return FALSE; +#else return TRUE; +#endif } @@ -502,6 +787,13 @@ *----------------------------------------------------------------------------- */ +#if defined(VMTOOLS_USE_GLIB) +Bool +RpcIn_start(RpcIn *in, // IN + unsigned int delay, // IN + RpcIn_ErrorFunc *errorFunc, // IN + void *errorData) // IN +#else Bool RpcIn_start(RpcIn *in, // IN unsigned int delay, // IN @@ -509,6 +801,7 @@ void *resetClientData, // IN RpcIn_ErrorFunc *errorFunc, // IN void *errorData) // IN +#endif { ASSERT(in); @@ -531,18 +824,24 @@ in->mustSend = TRUE; ASSERT(in->nextEvent == NULL); +#if defined(VMTOOLS_USE_GLIB) + RPCIN_SCHED_EVENT(in, g_timeout_source_new(in->delay * 10)); +#else in->nextEvent = EventManager_Add(gTimerEventQueue, 0, RpcInLoop, in); if (in->nextEvent == NULL) { Debug("RpcIn_start: couldn't start the loop\n"); goto error; } +#endif +#if !defined(VMTOOLS_USE_GLIB) /* Register the 'reset' handler */ if (resetCallback) { - RpcIn_RegisterCallback(in, "reset", resetCallback, resetClientData); + RpcIn_RegisterCallbackEx(in, "reset", resetCallback, resetClientData); } - RpcIn_RegisterCallback(in, "ping", RpcInPingCallback, NULL); + RpcIn_RegisterCallbackEx(in, "ping", RpcInPingCallback, NULL); +#endif return TRUE; @@ -597,7 +896,11 @@ in->mustSend = TRUE; ASSERT(in->nextEvent == NULL); +#if defined(VMTOOLS_USE_GLIB) + RPCIN_SCHED_EVENT(in, g_idle_source_new()); +#else in->nextEvent = EventManager_Add(gTimerEventQueue, 0, RpcInLoop, in); +#endif if (in->nextEvent == NULL) { Debug("RpcIn_restart: couldn't start the loop\n"); return FALSE; @@ -610,102 +913,6 @@ /* *----------------------------------------------------------------------------- * - * RpcIn_RegisterCallback -- - * - * Register a callback to happen when a TCLO message is - * received. When a TCLO message beginning with 'name' is - * sent, the callback will be called with: the cmd name, the args - * (starting with the char directly after the cmd name; that's why - * it's helpful to add a space to the name if arguments are expected), - * and a pointer to the result. - * - * Results: - * None - * - * Side effects: - * None - * - *----------------------------------------------------------------------------- - */ - -void -RpcIn_RegisterCallback(RpcIn *in, // IN - const char *name, // IN - RpcIn_Callback callback, // IN - void *clientData) // IN -{ - RpcInCallbackList *p; - - Debug("Registering callback '%s'\n", name); - - ASSERT(in); - ASSERT(name); - ASSERT(callback); - ASSERT(RpcInLookupCallback(in, name) == NULL); // not there yet - - p = (RpcInCallbackList *) malloc(sizeof(RpcInCallbackList)); - ASSERT_NOT_IMPLEMENTED(p); - - p->length = strlen(name); - p->name = strdup(name); - p->function = callback; - p->clientData = clientData; - - p->next = in->callbacks; - - in->callbacks = p; -} - - -/* - *----------------------------------------------------------------------------- - * - * RpcIn_UnregisterCallback -- - * - * Unregisters an RpcIn callback by name. - * - * Results: - * None - * - * Side effects: - * None - * - *----------------------------------------------------------------------------- - */ - -void -RpcIn_UnregisterCallback(RpcIn *in, // IN - const char *name) // IN -{ - RpcInCallbackList *cur, *prev; - - ASSERT(in); - ASSERT(name); - - Debug("Unregistering callback '%s'\n", name); - - for (cur = in->callbacks, prev = NULL; cur && strcmp(cur->name, name); - prev = cur, cur = cur->next); - - /* - * If we called UnregisterCallback on a name that doesn't exist, we - * have a problem. - */ - ASSERT(cur != NULL); - - if (prev == NULL) { - in->callbacks = cur->next; - } else { - prev->next = cur->next; - } - free((void *)cur->name); - free(cur); -} - - -/* - *----------------------------------------------------------------------------- - * * RpcIn_SetRetVals -- * * Utility method to set the return values of a tclo command. @@ -738,4 +945,3 @@ return retVal; } - diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/rpcOut/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/rpcOut/Makefile.am --- open-vm-tools-2008.01.23-74039/lib/rpcOut/Makefile.am 2008-01-28 08:02:49.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/rpcOut/Makefile.am 2008-10-13 08:01:48.000000000 +0100 @@ -20,8 +20,5 @@ libRpcOut_a_SOURCES = libRpcOut_a_SOURCES += rpcout.c -AM_CFLAGS = -AM_CFLAGS += @COMMON_CFLAGS@ - SUBDIRS = SUBDIRS += shared diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/rpcOut/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/rpcOut/Makefile.in --- open-vm-tools-2008.01.23-74039/lib/rpcOut/Makefile.in 2008-01-28 08:03:05.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/rpcOut/Makefile.in 2008-10-13 08:02:15.000000000 +0100 @@ -52,7 +52,10 @@ subdir = lib/rpcOut DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +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)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -64,7 +67,7 @@ am_libRpcOut_a_OBJECTS = rpcout.$(OBJEXT) libRpcOut_a_OBJECTS = $(am_libRpcOut_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp +depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -100,8 +103,6 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -COMMON_CFLAGS = @COMMON_CFLAGS@ -COMMON_PROG_CFLAGS = @COMMON_PROG_CFLAGS@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -112,45 +113,57 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ -ECHO = @ECHO@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GREP = @GREP@ -GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_AUTH_CFLAGS = @LIB_AUTH_CFLAGS@ -LIB_FILE_CFLAGS = @LIB_FILE_CFLAGS@ -LIB_HGFS_SERVER_CFLAGS = @LIB_HGFS_SERVER_CFLAGS@ -LIB_IMPERSONATE_CFLAGS = @LIB_IMPERSONATE_CFLAGS@ -LIB_MISC_CFLAGS = @LIB_MISC_CFLAGS@ -LIB_PROC_MGR_CFLAGS = @LIB_PROC_MGR_CFLAGS@ -LIB_STRING_CFLAGS = @LIB_STRING_CFLAGS@ -LIB_USER_CFLAGS = @LIB_USER_CFLAGS@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -158,27 +171,35 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ VERSION = @VERSION@ -VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -209,6 +230,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -225,7 +247,6 @@ top_srcdir = @top_srcdir@ noinst_LIBRARIES = libRpcOut.a libRpcOut_a_SOURCES = rpcout.c -AM_CFLAGS = @COMMON_CFLAGS@ SUBDIRS = shared all: all-recursive diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/rpcOut/rpcout.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/rpcOut/rpcout.c --- open-vm-tools-2008.01.23-74039/lib/rpcOut/rpcout.c 2008-01-28 08:02:50.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/rpcOut/rpcout.c 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -293,10 +293,13 @@ } /* - * If the command doesn't contain a space, add one to the - * end to maintain compatibility with old VMXs. + * If the command doesn't contain a space, add one to the end to maintain + * compatibility with old VMXs. * - * XXX Do we still need to bother with this? + * 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; @@ -346,7 +349,8 @@ * 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. + * 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 diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/rpcOut/shared/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/rpcOut/shared/Makefile.am --- open-vm-tools-2008.01.23-74039/lib/rpcOut/shared/Makefile.am 2008-01-28 08:02:49.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/rpcOut/shared/Makefile.am 2008-10-13 08:01:48.000000000 +0100 @@ -19,6 +19,3 @@ libRpcOut_la_SOURCES = libRpcOut_la_SOURCES += ../rpcout.c - -AM_CFLAGS = -AM_CFLAGS += @COMMON_CFLAGS@ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/rpcOut/shared/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/rpcOut/shared/Makefile.in --- open-vm-tools-2008.01.23-74039/lib/rpcOut/shared/Makefile.in 2008-01-28 08:03:05.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/rpcOut/shared/Makefile.in 2008-10-13 08:02:15.000000000 +0100 @@ -52,7 +52,10 @@ subdir = lib/rpcOut/shared DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +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)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -62,7 +65,7 @@ am_libRpcOut_la_OBJECTS = rpcout.lo libRpcOut_la_OBJECTS = $(am_libRpcOut_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp +depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -88,8 +91,6 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -COMMON_CFLAGS = @COMMON_CFLAGS@ -COMMON_PROG_CFLAGS = @COMMON_PROG_CFLAGS@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -100,45 +101,57 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ -ECHO = @ECHO@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GREP = @GREP@ -GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_AUTH_CFLAGS = @LIB_AUTH_CFLAGS@ -LIB_FILE_CFLAGS = @LIB_FILE_CFLAGS@ -LIB_HGFS_SERVER_CFLAGS = @LIB_HGFS_SERVER_CFLAGS@ -LIB_IMPERSONATE_CFLAGS = @LIB_IMPERSONATE_CFLAGS@ -LIB_MISC_CFLAGS = @LIB_MISC_CFLAGS@ -LIB_PROC_MGR_CFLAGS = @LIB_PROC_MGR_CFLAGS@ -LIB_STRING_CFLAGS = @LIB_STRING_CFLAGS@ -LIB_USER_CFLAGS = @LIB_USER_CFLAGS@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -146,27 +159,35 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ VERSION = @VERSION@ -VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -197,6 +218,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -213,7 +235,6 @@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libRpcOut.la libRpcOut_la_SOURCES = ../rpcout.c -AM_CFLAGS = @COMMON_CFLAGS@ all: all-am .SUFFIXES: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/rpcVmx/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/rpcVmx/Makefile.am --- open-vm-tools-2008.01.23-74039/lib/rpcVmx/Makefile.am 2008-01-28 08:02:49.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/rpcVmx/Makefile.am 2008-10-13 08:01:48.000000000 +0100 @@ -19,6 +19,3 @@ libRpcVmx_a_SOURCES = libRpcVmx_a_SOURCES += rpcvmx.c - -AM_CFLAGS = -AM_CFLAGS += @COMMON_CFLAGS@ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/rpcVmx/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/rpcVmx/Makefile.in --- open-vm-tools-2008.01.23-74039/lib/rpcVmx/Makefile.in 2008-01-28 08:03:05.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/rpcVmx/Makefile.in 2008-10-13 08:02:15.000000000 +0100 @@ -52,7 +52,10 @@ subdir = lib/rpcVmx DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +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)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -64,7 +67,7 @@ am_libRpcVmx_a_OBJECTS = rpcvmx.$(OBJEXT) libRpcVmx_a_OBJECTS = $(am_libRpcVmx_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp +depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -90,8 +93,6 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -COMMON_CFLAGS = @COMMON_CFLAGS@ -COMMON_PROG_CFLAGS = @COMMON_PROG_CFLAGS@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -102,45 +103,57 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ -ECHO = @ECHO@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GREP = @GREP@ -GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_AUTH_CFLAGS = @LIB_AUTH_CFLAGS@ -LIB_FILE_CFLAGS = @LIB_FILE_CFLAGS@ -LIB_HGFS_SERVER_CFLAGS = @LIB_HGFS_SERVER_CFLAGS@ -LIB_IMPERSONATE_CFLAGS = @LIB_IMPERSONATE_CFLAGS@ -LIB_MISC_CFLAGS = @LIB_MISC_CFLAGS@ -LIB_PROC_MGR_CFLAGS = @LIB_PROC_MGR_CFLAGS@ -LIB_STRING_CFLAGS = @LIB_STRING_CFLAGS@ -LIB_USER_CFLAGS = @LIB_USER_CFLAGS@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -148,27 +161,35 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ VERSION = @VERSION@ -VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -199,6 +220,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -215,7 +237,6 @@ top_srcdir = @top_srcdir@ noinst_LIBRARIES = libRpcVmx.a libRpcVmx_a_SOURCES = rpcvmx.c -AM_CFLAGS = @COMMON_CFLAGS@ all: all-am .SUFFIXES: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/rpcVmx/rpcvmx.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/rpcVmx/rpcvmx.c --- open-vm-tools-2008.01.23-74039/lib/rpcVmx/rpcvmx.c 2008-01-28 08:02:50.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/rpcVmx/rpcvmx.c 2008-10-13 08:01:50.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/SLPv2Parser/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/SLPv2Parser/Makefile.am --- open-vm-tools-2008.01.23-74039/lib/SLPv2Parser/Makefile.am 2008-01-28 08:02:50.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/SLPv2Parser/Makefile.am 2008-10-13 08:01:48.000000000 +0100 @@ -21,6 +21,3 @@ libSLPv2Parser_a_SOURCES += SLPv2MsgParser.c libSLPv2Parser_a_SOURCES += SLPv2Match.c libSLPv2Parser_a_SOURCES += SLPv2MsgAssembler.c - -AM_CFLAGS = -AM_CFLAGS += @COMMON_CFLAGS@ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/SLPv2Parser/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/SLPv2Parser/Makefile.in --- open-vm-tools-2008.01.23-74039/lib/SLPv2Parser/Makefile.in 2008-01-28 08:03:02.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/SLPv2Parser/Makefile.in 2008-10-13 08:02:12.000000000 +0100 @@ -52,7 +52,10 @@ subdir = lib/SLPv2Parser DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +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)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -65,7 +68,7 @@ SLPv2Match.$(OBJEXT) SLPv2MsgAssembler.$(OBJEXT) libSLPv2Parser_a_OBJECTS = $(am_libSLPv2Parser_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp +depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -91,8 +94,6 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -COMMON_CFLAGS = @COMMON_CFLAGS@ -COMMON_PROG_CFLAGS = @COMMON_PROG_CFLAGS@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -103,45 +104,57 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ -ECHO = @ECHO@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GREP = @GREP@ -GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_AUTH_CFLAGS = @LIB_AUTH_CFLAGS@ -LIB_FILE_CFLAGS = @LIB_FILE_CFLAGS@ -LIB_HGFS_SERVER_CFLAGS = @LIB_HGFS_SERVER_CFLAGS@ -LIB_IMPERSONATE_CFLAGS = @LIB_IMPERSONATE_CFLAGS@ -LIB_MISC_CFLAGS = @LIB_MISC_CFLAGS@ -LIB_PROC_MGR_CFLAGS = @LIB_PROC_MGR_CFLAGS@ -LIB_STRING_CFLAGS = @LIB_STRING_CFLAGS@ -LIB_USER_CFLAGS = @LIB_USER_CFLAGS@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -149,27 +162,35 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ VERSION = @VERSION@ -VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -200,6 +221,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -217,7 +239,6 @@ noinst_LIBRARIES = libSLPv2Parser.a libSLPv2Parser_a_SOURCES = SLPv2MsgParser.c SLPv2Match.c \ SLPv2MsgAssembler.c -AM_CFLAGS = @COMMON_CFLAGS@ all: all-am .SUFFIXES: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/SLPv2Parser/SLPv2Match.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/SLPv2Parser/SLPv2Match.c --- open-vm-tools-2008.01.23-74039/lib/SLPv2Parser/SLPv2Match.c 2008-01-28 08:02:51.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/SLPv2Parser/SLPv2Match.c 2008-10-13 08:01:52.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -21,6 +21,7 @@ #ifdef WIN32 #include #else +#include #include #endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/SLPv2Parser/SLPv2MsgAssembler.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/SLPv2Parser/SLPv2MsgAssembler.c --- open-vm-tools-2008.01.23-74039/lib/SLPv2Parser/SLPv2MsgAssembler.c 2008-01-28 08:02:51.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/SLPv2Parser/SLPv2MsgAssembler.c 2008-10-13 08:01:52.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -23,6 +23,7 @@ #ifdef WIN32 #include #else +#include #include #endif #include @@ -101,8 +102,8 @@ urlEntry.reserved = 0; urlEntry.lifetime = Portable_htons(lifetime); - urlEntry.length = (uint16) Portable_htons((uint16) strlen(url)); - + urlEntry.length = Portable_htons(strlen(url)); + if (! DynBuf_Append(b, &urlEntry, sizeof urlEntry)) { goto abort; } @@ -180,17 +181,17 @@ return FALSE; } - languageTagLen = (uint16) strlen(languageTag); + languageTagLen = strlen(languageTag); languageTagLenBE = Portable_htons(languageTagLen); - prListLen = (uint16) strlen(prList); + prListLen = strlen(prList); prListLenBE = Portable_htons(prListLen); - serviceTypeLen = (uint16) strlen(serviceType); + serviceTypeLen = strlen(serviceType); serviceTypeLenBE = Portable_htons(serviceTypeLen); - scopeListLen = (uint16) strlen(scopeList); + scopeListLen = strlen(scopeList); scopeListLenBE = Portable_htons(scopeListLen); - predicateLen = (uint16) strlen(predicate); + predicateLen = strlen(predicate); predicateLenBE = Portable_htons(predicateLen); - spiLen = (uint16) strlen(spi); + spiLen = strlen(spi); spiLenBE = Portable_htons(spiLen); len = sizeof (struct SLPv2_Header) @@ -246,7 +247,7 @@ ASSERT(DynBuf_GetSize(&b) == len); DynBuf_Trim(&b); if (NULL != packetSize) { - *packetSize = (int) DynBuf_GetSize(&b); + *packetSize = DynBuf_GetSize(&b); } if (NULL != packet) { *packet = DynBuf_Detach(&b); @@ -301,7 +302,7 @@ return FALSE; } - languageTagLen = (uint16) strlen(languageTag); + languageTagLen = strlen(languageTag); /* * Compute the total length of all strings pointed to by "urls". @@ -310,7 +311,7 @@ urlTotalLength = urlEntryCount * 2; for (i = 0; i < urlEntryCount; i++) { ASSERT(NULL != urls[i]); - urlTotalLength += (int) strlen(urls[i]); + urlTotalLength += strlen(urls[i]); } } else { /* @@ -348,7 +349,7 @@ */ urlEntryCount = Portable_ntohs(urlEntryCount); for (i = 0 ; i < urlEntryCount ; i++) { - urlStringLength = (uint16) Portable_htons((uint16) strlen(urls[i])); + urlStringLength = Portable_htons(strlen(urls[i])); if (! DynBuf_Append(&b, &urlStringLength, sizeof urlStringLength)) { goto abort; } @@ -361,7 +362,7 @@ ASSERT(DynBuf_GetSize(&b) == len); DynBuf_Trim(&b); if (NULL != packetSize) { - *packetSize = (uint16) DynBuf_GetSize(&b); + *packetSize = DynBuf_GetSize(&b); } if (NULL != packet) { *packet = DynBuf_Detach(&b); @@ -439,17 +440,17 @@ return FALSE; } - languageTagLen = (uint16) strlen(languageTag); + languageTagLen = strlen(languageTag); languageTagLenBE = Portable_htons(languageTagLen); - prListLen = (uint16) strlen(prList); + prListLen = strlen(prList); prListLenBE = Portable_htons(prListLen); - urlLen = (uint16) strlen(url); + urlLen = strlen(url); urlLenBE = Portable_htons(urlLen); - scopeListLen = (uint16) strlen(scopeList); + scopeListLen = strlen(scopeList); scopeListLenBE = Portable_htons(scopeListLen); - tagListLen = (uint16) strlen(tagList); + tagListLen = strlen(tagList); tagListLenBE = Portable_htons(tagListLen); - spiLen = (uint16) strlen(spi); + spiLen = strlen(spi); spiLenBE = Portable_htons(spiLen); len = sizeof (struct SLPv2_Header) @@ -505,7 +506,7 @@ ASSERT(DynBuf_GetSize(&b) == len); DynBuf_Trim(&b); if (NULL != packetSize) { - *packetSize = (int) DynBuf_GetSize(&b); + *packetSize = DynBuf_GetSize(&b); } if (NULL != packet) { *packet = DynBuf_Detach(&b); @@ -562,9 +563,9 @@ } errorCodeBE = Portable_htons(errorCode); - languageTagLen = (uint16) strlen(languageTag); + languageTagLen = strlen(languageTag); languageTagLenBE = Portable_htons(languageTagLen); - attributeListLen = (uint16) strlen(attributeList); + attributeListLen = strlen(attributeList); attributeListLenBE = Portable_htons(attributeListLen); len = sizeof (struct SLPv2_Header) @@ -595,7 +596,7 @@ ASSERT(DynBuf_GetSize(&b) == len); DynBuf_Trim(&b); if (NULL != packetSize) { - *packetSize = (int) DynBuf_GetSize(&b); + *packetSize = DynBuf_GetSize(&b); } if (NULL != packet) { *packet = DynBuf_Detach(&b); diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/SLPv2Parser/SLPv2MsgParser.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/SLPv2Parser/SLPv2MsgParser.c --- open-vm-tools-2008.01.23-74039/lib/SLPv2Parser/SLPv2MsgParser.c 2008-01-28 08:02:51.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/SLPv2Parser/SLPv2MsgParser.c 2008-10-13 08:01:52.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -20,6 +20,7 @@ #ifdef WIN32 #include #else +#include #include #endif #include diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/socketMgr/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/socketMgr/Makefile.am --- open-vm-tools-2008.01.23-74039/lib/socketMgr/Makefile.am 2008-01-28 08:02:49.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/socketMgr/Makefile.am 2008-10-13 08:01:48.000000000 +0100 @@ -19,6 +19,3 @@ libSocketMgr_a_SOURCES = libSocketMgr_a_SOURCES += socketMgr.c - -AM_CFLAGS = -AM_CFLAGS += @COMMON_CFLAGS@ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/socketMgr/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/socketMgr/Makefile.in --- open-vm-tools-2008.01.23-74039/lib/socketMgr/Makefile.in 2008-01-28 08:03:05.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/socketMgr/Makefile.in 2008-10-13 08:02:15.000000000 +0100 @@ -52,7 +52,10 @@ subdir = lib/socketMgr DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +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)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -64,7 +67,7 @@ am_libSocketMgr_a_OBJECTS = socketMgr.$(OBJEXT) libSocketMgr_a_OBJECTS = $(am_libSocketMgr_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp +depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -90,8 +93,6 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -COMMON_CFLAGS = @COMMON_CFLAGS@ -COMMON_PROG_CFLAGS = @COMMON_PROG_CFLAGS@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -102,45 +103,57 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ -ECHO = @ECHO@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GREP = @GREP@ -GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_AUTH_CFLAGS = @LIB_AUTH_CFLAGS@ -LIB_FILE_CFLAGS = @LIB_FILE_CFLAGS@ -LIB_HGFS_SERVER_CFLAGS = @LIB_HGFS_SERVER_CFLAGS@ -LIB_IMPERSONATE_CFLAGS = @LIB_IMPERSONATE_CFLAGS@ -LIB_MISC_CFLAGS = @LIB_MISC_CFLAGS@ -LIB_PROC_MGR_CFLAGS = @LIB_PROC_MGR_CFLAGS@ -LIB_STRING_CFLAGS = @LIB_STRING_CFLAGS@ -LIB_USER_CFLAGS = @LIB_USER_CFLAGS@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -148,27 +161,35 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ VERSION = @VERSION@ -VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -199,6 +220,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -215,7 +237,6 @@ top_srcdir = @top_srcdir@ noinst_LIBRARIES = libSocketMgr.a libSocketMgr_a_SOURCES = socketMgr.c -AM_CFLAGS = @COMMON_CFLAGS@ all: all-am .SUFFIXES: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/socketMgr/socketMgr.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/socketMgr/socketMgr.c --- open-vm-tools-2008.01.23-74039/lib/socketMgr/socketMgr.c 2008-01-28 08:02:50.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/socketMgr/socketMgr.c 2008-10-13 08:01:51.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/string/bsd_output_int.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/string/bsd_output_int.h --- open-vm-tools-2008.01.23-74039/lib/string/bsd_output_int.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/string/bsd_output_int.h 2008-10-13 08:01:52.000000000 +0100 @@ -0,0 +1,105 @@ +/* ********************************************************** + * 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. + * 4. Neither the name of the University nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission. + * + * 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_ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/string/bsd_output_shared.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/string/bsd_output_shared.c --- open-vm-tools-2008.01.23-74039/lib/string/bsd_output_shared.c 2008-01-28 08:02:51.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/string/bsd_output_shared.c 2008-10-13 08:01:52.000000000 +0100 @@ -74,8 +74,8 @@ * return an ASCII character string representation of this number - * just digits, no sign, decimal point, or exponent symbol. * - * If 'mode' is 2, then 'prec' limits the number of digits after the - * decimal point, if 'mode' is 3, then total digits. + * 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'. * @@ -111,7 +111,58 @@ str = strdup(ecvt(d, prec, &dec, sign)); } 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; + str = strdup(fcvt(round(d), 1, &dec, sign)); + if (str == NULL) { + goto exit; + } + l = strlen(str); + ASSERT(l > 0); + l--; + ASSERT(str[l] == '0'); + str[l] = '\0'; + } else +#endif + str = strdup(fcvt(d, prec, &dec, sign)); + +#ifdef _WIN32 + /* + * When the value is not zero but rounds to zero at prec digits, + * the Windows fcvt() sometimes return 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 == '\0' && dec < 0 && dec < -prec) { + dec = -prec; + } +#endif } if (!str) { diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/string/bsd_vsnprintf.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/string/bsd_vsnprintf.c --- open-vm-tools-2008.01.23-74039/lib/string/bsd_vsnprintf.c 2008-01-28 08:02:51.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/string/bsd_vsnprintf.c 2008-10-13 08:01:52.000000000 +0100 @@ -69,43 +69,29 @@ #include "vmware.h" #include "bsd_output_int.h" -#include "msgfmt.h" +#include "codeset.h" +#include "convertutf.h" -typedef struct StrBuf { - Bool alloc; - Bool error; - char *buf; - size_t size; - size_t index; -} StrBuf; - -static int __sprint(StrBuf *sbuf, struct __suio *); -static char *__ujtoa(uintmax_t, char *, int, int, const char *, int, char, - const char *); static char *__ultoa(u_long, char *, int, int, const char *, int, char, const char *); -static char *__wcsconv(wchar_t *, int); static void __find_arguments(const char *, va_list, union arg **); static void __grow_type_table(int, enum typeid **, int *); -/* - * Pretend to have wcsrtombs() and wcrtomb(). - * Don't use typedef for mbstate_t because it's actually defined - * in VS2003/VC7/include/wchar.h, but the functions don't exist. - * I don't know why, nor do I care. -- edward - */ +char blanks[PADSIZE] = + {' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' '}; +char zeroes[PADSIZE] = + {'0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0'}; -#ifdef _WIN32 -#define mbstate_t int -#define wcsrtombs(dest, srcp, n, state) wcstombs(dest, *(srcp), n) -#define wcrtomb(dest, wc, state) wctomb(dest, wc) -#endif +const char xdigs_lower[17] = "0123456789abcdef?"; +const char xdigs_upper[17] = "0123456789ABCDEF?"; + +static Bool isLenientConversion = TRUE; -static int -__sfvwrite(StrBuf *sbuf, struct __suio *uio) +int +BSDFmt_SFVWrite(BSDFmt_StrBuf *sbuf, BSDFmt_UIO *uio) { int i; - struct __siov *siov; + BSDFmt_IOV *siov; /* * If asprintf(), then grow the buffer as necessary. @@ -153,8 +139,8 @@ * Flush out all the vectors defined by the given uio, * then reset it so that it can be reused. */ -static int -__sprint(StrBuf *sbuf, struct __suio *uio) +int +BSDFmt_SPrint(BSDFmt_StrBuf *sbuf, BSDFmt_UIO *uio) { int err; @@ -162,20 +148,13 @@ uio->uio_iovcnt = 0; return (0); } - err = __sfvwrite(sbuf, uio); + err = BSDFmt_SFVWrite(sbuf, uio); uio->uio_resid = 0; uio->uio_iovcnt = 0; return err; } /* - * 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') - -/* * 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 @@ -258,9 +237,9 @@ } /* Identical to __ultoa, but for intmax_t. */ -static char * -__ujtoa(uintmax_t val, char *endp, int base, int octzero, const char *xdigs, - int needgrp, char thousep, const char *grp) +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; @@ -330,116 +309,96 @@ } /* - * Convert a wide character string argument for the %ls format to a multibyte - * string representation. If not -1, prec specifies the maximum number of - * bytes to output, and also means that we can't assume that the wide char. - * string ends is null-terminated. + * 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. */ -static char * -__wcsconv(wchar_t *wcsarg, int prec) +char * +BSDFmt_WCharToUTF8(wchar_t *wcsarg, int prec) { - static const mbstate_t initial; - mbstate_t mbs; - char buf[MB_LEN_MAX]; - wchar_t *p; - char *convbuf; - size_t clen, nbytes; - - /* Allocate space for the maximum number of bytes we could output. */ - if (prec < 0) { - p = wcsarg; - mbs = initial; - nbytes = wcsrtombs(NULL, (const wchar_t **)&p, 0, &mbs); - if (nbytes == (size_t)-1) - return (NULL); - } else { + 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) + { /* - * Optimisation: if the output precision is small enough, - * just allocate enough memory for the maximum instead of - * scanning the string. + * Pad by 4, because we need to NUL-terminate. */ - if (prec < 128) - nbytes = prec; - else { - nbytes = 0; - p = wcsarg; - mbs = initial; - for (;;) { - clen = wcrtomb(buf, *p++, &mbs); - if (clen == 0 || clen == (size_t)-1 || - nbytes + clen > prec) - break; - nbytes += clen; - } + 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 ((convbuf = malloc(nbytes + 1)) == NULL) - return (NULL); - /* Fill the output buffer. */ - p = wcsarg; - mbs = initial; - nbytes = wcsrtombs(convbuf, (const wchar_t **)&p, nbytes, &mbs); - if (nbytes == (size_t)-1) { - free(convbuf); - return (NULL); + 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(); + } } - convbuf[nbytes] = '\0'; - return (convbuf); -} - -#ifndef NO_FLOATING_POINT - -static int exponent(char *, int, int); - -#endif /* !NO_FLOATING_POINT */ - -/* - * 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 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) - -#define NIOV 8 - -/* - * 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 char blanks[PADSIZE] = - {' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' '}; -static char zeroes[PADSIZE] = - {'0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0'}; + /* + * Success, NUL-terminate. (The API updated targStart for us). + */ + ASSERT(targStart <= targEnd); + targSize = targStart - targ; + memset(targ + targSize, 0, 4); -static const char xdigs_lower[17] = "0123456789abcdef?"; -static const char xdigs_upper[17] = "0123456789ABCDEF?"; + exit: + return targ; +} int @@ -449,7 +408,7 @@ int ch; /* character from fmt */ int n, n2; /* handy integer (short term usage) */ char *cp; /* handy char pointer (short term usage) */ - struct __siov *iovp; /* for PRINT macro */ + BSDFmt_IOV *iovp; /* for PRINT macro */ int flags; /* flags as above */ int ret; /* return value accumulator */ int width; /* width from format (%8d), or 0 */ @@ -498,9 +457,9 @@ int size; /* size of converted field or string */ int prsize; /* max size of printed field */ const char *xdigs; /* digits for %[xX] conversion */ - struct __suio uio; /* output information: summary */ - struct __siov iov[NIOV];/* ... and individual io vectors */ - char buf[BUF]; /* buffer with space for digits of uintmax_t */ + 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]; @@ -508,8 +467,8 @@ #ifndef _WIN32 va_list orgap; /* original argument pointer */ #endif - char *convbuf; /* wide to multibyte conversion result */ - StrBuf sbuf; + char *convbuf = NULL; /* wide to multibyte conversion result */ + BSDFmt_StrBuf sbuf; /* * BEWARE, these `goto error' on error, and PAD uses `n'. @@ -519,8 +478,8 @@ iovp->iov_len = (len) * sizeof (char); \ uio.uio_resid += (len) * sizeof (char); \ iovp++; \ - if (++uio.uio_iovcnt >= NIOV) { \ - if (__sprint(&sbuf, &uio)) \ + if (++uio.uio_iovcnt >= BSDFMT_NIOV) { \ + if (BSDFmt_SPrint(&sbuf, &uio)) \ goto error; \ iovp = iov; \ } \ @@ -543,7 +502,7 @@ PAD((len) - (n2 > 0 ? n2 : 0), (with)); \ } while(0) #define FLUSH() { \ - if (uio.uio_resid && __sprint(&sbuf, &uio)) \ + if (uio.uio_resid && BSDFmt_SPrint(&sbuf, &uio)) \ goto error; \ uio.uio_iovcnt = 0; \ iovp = iov; \ @@ -745,6 +704,17 @@ flags |= GROUPING; thousands_sep = *(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++) == '*') { @@ -904,6 +874,11 @@ if (expt == 9999) expt = INT_MAX; } + /* Our dtoa / ldtoa call strdup(), which can fail. PR319844 */ + if (dtoaresult == NULL) { + sbuf.error = TRUE; + goto error; + } if (signflag) sign = '-'; if (expt == INT_MAX) { /* inf or nan */ @@ -937,7 +912,7 @@ } } if (expchar) { - expsize = exponent(expstr, expt - 1, expchar); + expsize = BSDFmt_Exponent(expstr, expt - 1, expchar); size = expsize + prec; if (prec > 1 || flags & ALT) ++size; @@ -1019,7 +994,7 @@ * PR 103201 * VisualC sscanf doesn't grok '0x', so prefix zeroes. */ -// ox[1] = 'x'; +// ox[1] = 'x'; goto nosign; case 'S': flags |= LONGINT; @@ -1028,20 +1003,26 @@ if (flags & LONGINT) { wchar_t *wcp; - if (convbuf != NULL) + /* Argument is wchar_t * */ + if (convbuf != NULL) { free(convbuf); + convbuf = NULL; + } if ((wcp = GETARG(wchar_t *)) == NULL) cp = "(null)"; else { - convbuf = __wcsconv(wcp, prec); + convbuf = BSDFmt_WCharToUTF8(wcp, prec); if (convbuf == NULL) { sbuf.error = TRUE; goto error; } cp = convbuf; } - } else if ((cp = GETARG(char *)) == NULL) + } else if ((cp = GETARG(char *)) == NULL) { + /* Argument is char * */ cp = "(null)"; + } + if (prec >= 0) { /* * can't use strlen; can only look for the @@ -1056,6 +1037,7 @@ size = prec; } else size = prec; + size = CodeSet_Utf8FindCodePointBoundary(cp, size); } else size = strlen(cp); sign = '\0'; @@ -1106,14 +1088,14 @@ * printf("%#.0o", 0) should print 0.'' * -- Defect Report #151 */ - cp = buf + BUF; + 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); + cp = BSDFmt_UJToA(ujval, cp, base, + flags & ALT, xdigs, + flags & GROUPING, thousands_sep, + grouping); } else { if (ulval != 0 || prec != 0 || (flags & ALT && base == 8)) @@ -1122,8 +1104,8 @@ flags & GROUPING, thousands_sep, grouping); } - size = buf + BUF - cp; - if (size > BUF) /* should never happen */ + size = buf + INT_CONV_BUF - cp; + if (size > INT_CONV_BUF) /* should never happen */ abort(); break; default: /* "%?" prints ?, unless ? is NUL */ @@ -1267,8 +1249,10 @@ if (dtoaresult != NULL) freedtoa(dtoaresult); #endif - if (convbuf != NULL) + if (convbuf != NULL) { free(convbuf); + convbuf = NULL; + } if (sbuf.error) { ret = EOF; } @@ -1678,863 +1662,10 @@ } -int -Str_MsgFmtSnprintfWork(char **outbuf, size_t bufSize, const char *fmt0, - const MsgFmt_Arg *args, int numArgs) -{ - char *fmt; /* format string */ - int ch; /* character from fmt */ - int n; /* handy integer (short term usage) */ - char *cp; /* handy char pointer (short term usage) */ - struct __siov *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 */ - 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 */ - 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 - 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 */ - struct __suio uio; /* output information: summary */ - struct __siov iov[NIOV];/* ... and individual io vectors */ - char buf[BUF]; /* buffer with space for digits of uintmax_t */ - char ox[2]; /* space for 0x; ox[1] is either x, X, or \0 */ - int nextarg; /* 1-based argument index */ - const MsgFmt_Arg *a; - char *convbuf; /* wide to multibyte conversion result */ - StrBuf sbuf; - - /* - * 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 >= NIOV) { \ - if (__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 { \ - int 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; \ - } - -#define FETCHARG(a, i) do { \ - int ii = (i) - 1; \ - if (ii >= numArgs) { \ - sbuf.error = TRUE; \ - goto error; \ - } \ - (a) = args + ii; \ -} while (FALSE) - - /* - * Get * arguments, including the form *nn$. - */ -#define GETASTER(val) do { \ - int n2 = 0; \ - char *cp = fmt; \ - const MsgFmt_Arg *a; \ - while (is_digit(*cp)) { \ - n2 = 10 * n2 + to_digit(*cp); \ - cp++; \ - } \ - if (*cp == '$') { \ - FETCHARG(a, n2); \ - fmt = cp + 1; \ - } else { \ - FETCHARG(a, nextarg++); \ - } \ - if (a->type != MSGFMT_ARG_INT32) { \ - sbuf.error = TRUE; \ - goto error; \ - } \ - val = a->v.signed32; \ -} while (FALSE) - - xdigs = xdigs_lower; - thousands_sep = '\0'; - grouping = NULL; - convbuf = NULL; -#ifndef NO_FLOATING_POINT - dtoaresult = NULL; - decimal_point = localeconv()->decimal_point; -#endif - - fmt = (char *)fmt0; - nextarg = 1; - 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 #ifndef NO_FLOATING_POINT - expchar = 0; - expsize = 0; - lead = 0; - ndig = 0; - nseps = 0; - nrepeats = 0; -#endif - 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 = *(localeconv()->thousands_sep); - grouping = localeconv()->grouping; - 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; - 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': - FETCHARG(a, nextarg++); - if (a->type != MSGFMT_ARG_INT32) { - sbuf.error = TRUE; - goto error; - } - if (flags & LONGINT) { - static const mbstate_t initial; - mbstate_t mbs; - size_t mbseqlen; - - mbs = initial; - // XXX must deal with mismatch between wchar_t size - mbseqlen = wcrtomb(cp = buf, (wchar_t)a->v.signed32, &mbs); - if (mbseqlen == (size_t)-1) { - sbuf.error = TRUE; - goto error; - } - size = (int)mbseqlen; - } else { - *(cp = buf) = a->v.signed32; - size = 1; - } - sign = '\0'; - break; - case 'D': - flags |= LONGINT; - /*FALLTHROUGH*/ - case 'd': - case 'i': - FETCHARG(a, nextarg++); - if ((flags & (INTMAXT|LLONGINT)) != 0) { - if (a->type == MSGFMT_ARG_INT64) { - ujval = a->v.signed64; - } else { - sbuf.error = TRUE; - goto error; - } - } else if ((flags & (SIZET|PTRDIFFT|LONGINT)) != 0) { - if (a->type == MSGFMT_ARG_INT64) { - ujval = a->v.signed64; - } else if (a->type == MSGFMT_ARG_INT32) { - ujval = (intmax_t) a->v.signed32; - } else { - sbuf.error = TRUE; - goto error; - } - } else if ((flags & SHORTINT) != 0) { - if (a->type == MSGFMT_ARG_INT32) { - ujval = (intmax_t) (short) a->v.signed32; - } else { - sbuf.error = TRUE; - goto error; - } - } else if ((flags & CHARINT) != 0) { - if (a->type == MSGFMT_ARG_INT32) { - ujval = (intmax_t) (signed char) a->v.signed32; - } else { - sbuf.error = TRUE; - goto error; - } - } else { - if (a->type == MSGFMT_ARG_INT32) { - ujval = (intmax_t) a->v.signed32; - } else { - sbuf.error = TRUE; - goto error; - } - } - if ((intmax_t)ujval < 0) { - ujval = -ujval; - 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 (flags & LLONGINT) { - sbuf.error = TRUE; - goto error; - } - if (prec < 0) - prec = DEFPREC; - if (dtoaresult != NULL) - freedtoa(dtoaresult); - FETCHARG(a, nextarg++); - if (a->type != MSGFMT_ARG_FLOAT64) { - sbuf.error = TRUE; - goto error; - } - fparg.dbl = a->v.float64; - dtoaresult = cp = - dtoa(fparg.dbl, expchar ? 2 : 3, prec, - &expt, &signflag, &dtoaend); - if (expt == 9999) - expt = INT_MAX; - if (signflag) - sign = '-'; - if (expt == INT_MAX) { /* inf or nan */ - if (*cp == 'N') { - cp = (ch >= 'a') ? "nan" : "NAN"; - sign = '\0'; - } else - cp = (ch >= 'a') ? "inf" : "INF"; - size = 3; - break; - } - flags |= FPT; - 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 = 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': - sbuf.error = TRUE; - goto error; - case 'O': - flags |= LONGINT; - /*FALLTHROUGH*/ - case 'o': - base = 8; - goto get_unsigned; - 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 - */ - FETCHARG(a, nextarg++); - if (a->type == MSGFMT_ARG_PTR32) { - ujval = a->v.unsigned32; - } else if (a->type == MSGFMT_ARG_PTR64) { - ujval = a->v.unsigned64; - } else { - sbuf.error = TRUE; - goto error; - } - 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': - FETCHARG(a, nextarg++); - if (flags & LONGINT) { - wchar_t *wcp; - - ASSERT_ON_COMPILE(sizeof (wchar_t) == 2 || sizeof (wchar_t) == 4); - if (sizeof (wchar_t) == 2 ? - a->type != MSGFMT_ARG_STRING16 : - a->type != MSGFMT_ARG_STRING32) { - sbuf.error = TRUE; - goto error; - } - if (convbuf != NULL) - free(convbuf); - if ((wcp = (wchar_t *) a->v.s.ptr) == NULL) - cp = "(null)"; - else { - convbuf = __wcsconv(wcp, prec); - if (convbuf == NULL) { - sbuf.error = TRUE; - goto error; - } - cp = convbuf; - } - } else if ((cp = a->v.string8) == NULL) - 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 = p - cp; - if (size > prec) - size = prec; - } else - size = prec; - } else - size = strlen(cp); - sign = '\0'; - break; - case 'U': - flags |= LONGINT; - /*FALLTHROUGH*/ - case 'u': - base = 10; - goto get_unsigned; - case 'X': - xdigs = xdigs_upper; - goto hex; - case 'x': - xdigs = xdigs_lower; - hex: - base = 16; - if (flags & ALT) - ox[1] = ch; - flags &= ~GROUPING; - - get_unsigned: - FETCHARG(a, nextarg++); - if ((flags & (INTMAXT|LLONGINT)) != 0) { - if (a->type == MSGFMT_ARG_INT64) { - ujval = a->v.unsigned64; - } else { - sbuf.error = TRUE; - goto error; - } - } else if ((flags & (SIZET|PTRDIFFT|LONGINT)) != 0) { - if (a->type == MSGFMT_ARG_INT64) { - ujval = a->v.unsigned64; - } else if (a->type == MSGFMT_ARG_INT32) { - ujval = (uintmax_t) a->v.unsigned32; - } else { - sbuf.error = TRUE; - goto error; - } - } else if ((flags & SHORTINT) != 0) { - if (a->type == MSGFMT_ARG_INT32) { - ujval = (intmax_t) (unsigned short) a->v.unsigned32; - } else { - sbuf.error = TRUE; - goto error; - } - } else if ((flags & CHARINT) != 0) { - if (a->type == MSGFMT_ARG_INT32) { - ujval = (intmax_t) (unsigned char) a->v.unsigned32; - } else { - sbuf.error = TRUE; - goto error; - } - } else { - if (a->type == MSGFMT_ARG_INT32) { - ujval = (intmax_t) a->v.unsigned32; - } else { - sbuf.error = TRUE; - goto error; - } - } - if (ujval == 0) /* squash 0x/X if zero */ - ox[1] = '\0'; - - /* 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 + BUF; - if (ujval != 0 || prec != 0 || - (flags & ALT && base == 8)) - cp = __ujtoa(ujval, cp, base, - flags & ALT, xdigs, - flags & GROUPING, thousands_sep, - grouping); - size = buf + BUF - cp; - if (size > 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) - 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); - } else { /* %[eE] or sufficiently long %[gG] */ - if (prec > 1 || flags & ALT) { - buf[0] = *cp++; - buf[1] = *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] = '\0'; - } - -error: -#ifndef NO_FLOATING_POINT - if (dtoaresult != NULL) - freedtoa(dtoaresult); -#endif - if (convbuf != NULL) - free(convbuf); - if (sbuf.error) { - ret = EOF; - } - - // 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 FETCHARG -#undef GETASTER -} - - -#ifndef NO_FLOATING_POINT - -static int -exponent(char *p0, int exp, int fmtch) +int +BSDFmt_Exponent(char *p0, int exp, int fmtch) { char *p, *t; char expbuf[MAXEXPDIG]; diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/string/bsd_vsnwprintf.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/string/bsd_vsnwprintf.c --- open-vm-tools-2008.01.23-74039/lib/string/bsd_vsnwprintf.c 2008-01-28 08:02:51.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/string/bsd_vsnwprintf.c 2008-10-13 08:01:52.000000000 +0100 @@ -63,36 +63,33 @@ #include "vmware.h" #include "bsd_output_int.h" #include "msgfmt.h" +#include "convertutf.h" typedef struct StrBuf { Bool alloc; Bool error; - void *buf; + wchar_t *buf; size_t size; size_t index; } StrBuf; -static int __sfvwrite(StrBuf *sbuf, struct __suio *uio); -static int __sprint(StrBuf *sbuf, struct __suio *uio); +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 *__mbsconv(char *, int); +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 *); -#ifdef _WIN32 -#define mbstate_t int -#define mbsrtowcs(dest, srcp, n, state) mbstowcs(dest, *(srcp), n) -#define mbrtowc(dest, wc, size, state) mbtowc(dest, wc, size) -#endif +static Bool isLenientConversion = TRUE; static int -__sfvwrite(StrBuf *sbuf, struct __suio *uio) +__sfvwrite(StrBuf *sbuf, BSDFmt_UIO *uio) { int i; - struct __siov *siov; + BSDFmt_IOV *siov; /* * If aswprintf(), then grow the buffer as necessary. @@ -101,10 +98,10 @@ if (sbuf->alloc) { size_t n = sbuf->index + uio->uio_resid + 1; // +1 for \0 if (n > sbuf->size) { - char *p; + wchar_t *p; ASSERT(sbuf->size > 0); n = ROUNDUP(n, sbuf->size); - if ((p = realloc(sbuf->buf, n)) == NULL) { + if ((p = realloc(sbuf->buf, n * sizeof(wchar_t))) == NULL) { sbuf->error = TRUE; return 1; } @@ -128,8 +125,8 @@ numToWrite = siov->iov_len; } - memcpy(((char *)sbuf->buf) + sbuf->index, siov->iov_base, - numToWrite * sizeof (char)); + memcpy(sbuf->buf + sbuf->index, siov->iov_base, + numToWrite * sizeof(wchar_t)); sbuf->index += numToWrite; } @@ -141,7 +138,7 @@ * then reset it so that it can be reused. */ static int -__sprint(StrBuf *sbuf, struct __suio *uio) +__sprint(StrBuf *sbuf, BSDFmt_UIO *uio) { int err; @@ -156,13 +153,6 @@ } /* - * 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') - -/* * 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 @@ -316,106 +306,120 @@ return (cp); } + /* - * Convert a multibyte character string argument for the %s format to a wide - * string representation. ``prec'' specifies the maximum number of bytes - * to output. If ``prec'' is greater than or equal to zero, we can't assume - * that the multibyte char. string ends in a null character. + * 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. */ -static wchar_t * -__mbsconv(char *mbsarg, int prec) +wchar_t * +BSDFmt_UTF8ToWChar(const char *arg, // IN + int prec) // IN { - static const mbstate_t initial; - mbstate_t mbs; - wchar_t buf[MB_LEN_MAX]; - const char *p; - wchar_t *convbuf; - size_t clen, nbytes; - - if (mbsarg == NULL) - return (NULL); - - /* Allocate space for the maximum number of bytes we could output. */ - if (prec < 0) { - p = mbsarg; - mbs = initial; - nbytes = mbsrtowcs(NULL, (const char **)&p, 0, &mbs); - if (nbytes == (size_t)-1) - return (NULL); - } else { + 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) { /* - * Optimisation: if the output precision is small enough, - * just allocate enough memory for the maximum instead of - * scanning the string. + * Pad by 1 because we need to NUL-terminate. */ - if (prec < 128) - nbytes = prec; - else { - nbytes = 0; - p = mbsarg; - mbs = initial; - for (;;) { - clen = mbrtowc(buf, p, MB_LEN_MAX, &mbs); - if (clen == 0 || clen == (size_t)-1 || - clen == (size_t)-2 || - (nbytes + sizeof(wchar_t)) > prec) - break; - nbytes += sizeof(wchar_t); - p += clen; + 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(); } } - if ((convbuf = malloc(nbytes + sizeof(wchar_t))) == NULL) - return (NULL); - /* Fill the output buffer. */ - p = mbsarg; - mbs = initial; - nbytes = mbsrtowcs(convbuf, (const char **)&p, nbytes, &mbs); - if (nbytes == (size_t)-1) { - free(convbuf); - return (NULL); - } - convbuf[nbytes] = '\0'; - return (convbuf); + /* + * 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 */ -/* - * 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 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 NIOV 8 - int bsd_vsnwprintf(wchar_t **outBuf, size_t bufSize, const wchar_t *fmt0, va_list ap) @@ -424,7 +428,7 @@ wchar_t ch; /* character from fmt */ int n, n2; /* handy integer (short term usage) */ wchar_t *cp; /* handy char pointer (short term usage) */ - struct __siov *iovp; /* for PRINT macro */ + BSDFmt_IOV *iovp; /* for PRINT macro */ int flags; /* flags as above */ int ret; /* return value accumulator */ int width; /* width from format (%8d), or 0 */ @@ -447,7 +451,6 @@ * 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 */ - int isErr = 0; char *decimal_point; /* locale specific decimal point */ int signflag; /* true if float is negative */ union { /* floating point arguments %[aAeEfFgG] */ @@ -473,15 +476,14 @@ int size; /* size of converted field or string */ int prsize; /* max size of printed field */ const char *xdigs; /* digits for [xX] conversion */ - struct __suio uio; /* output information: summary */ - struct __siov iov[NIOV]; /* ... and individual io vectors */ - wchar_t buf[BUF]; /* buffer with space for digits of uintmax_t */ + 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 */ - int bufIdx = 0; /* current location in outBuf */ #ifndef _WIN32 va_list orgap; #endif @@ -510,10 +512,10 @@ */ #define PRINT(ptr, len) { \ iovp->iov_base = (ptr); \ - iovp->iov_len = (len)*sizeof(wchar_t); \ - uio.uio_resid += (len)*sizeof(wchar_t); \ + iovp->iov_len = len; \ + uio.uio_resid += len; \ iovp++; \ - if (++uio.uio_iovcnt >= NIOV) { \ + if (++uio.uio_iovcnt >= BSDFMT_NIOV) { \ if (__sprint(&sbuf, &uio)) \ goto error; \ iovp = iov; \ @@ -741,6 +743,17 @@ 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++) == '*') { @@ -890,7 +903,7 @@ expt = INT_MAX; } ndig = dtoaend - dtoaresult; - cp = convbuf = __mbsconv(dtoaresult, -1); + cp = convbuf = BSDFmt_UTF8ToWChar(dtoaresult, -1); freedtoa(dtoaresult); if (signflag) sign = '-'; @@ -1006,26 +1019,28 @@ * PR 103201 * VisualC sscanf doesn't grok '0x', so prefix zeroes. */ -// ox[1] = 'x'; +// 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) + if (convbuf!= NULL) free(convbuf); if ((mbp = GETARG(char *)) == NULL) cp = L"(null)"; else { - convbuf = __mbsconv(mbp, prec); + convbuf = BSDFmt_UTF8ToWChar(mbp, prec); if (convbuf == NULL) { - isErr = 1; + sbuf.error = TRUE; goto error; } cp = convbuf; @@ -1096,7 +1111,7 @@ * printf("%#.0o", 0) should print 0.'' * -- Defect Report #151 */ - cp = buf + BUF; + cp = buf + INT_CONV_BUF; if (flags & INTMAX_SIZE) { if (ujval != 0 || prec != 0 || (flags & ALT && base == 8)) @@ -1112,8 +1127,8 @@ flags & GROUPING, thousands_sep, grouping); } - size = buf + BUF - cp; - if (size > BUF) /* should never happen */ + size = buf + INT_CONV_BUF - cp; + if (size > INT_CONV_BUF) /* should never happen */ abort(); break; default: /* "%?" prints ?, unless ? is NUL */ @@ -1236,20 +1251,32 @@ /* 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 (bufSize > 0) - outBuf[bufIdx == bufSize ? bufIdx - 1 : bufIdx] = '\0'; - if (isErr || (bufIdx == bufSize)) - ret = -1; - else - ret = bufIdx; + if (sbuf.error) + ret = EOF; if ((argtable != NULL) && (argtable != statargtable)) free (argtable); return (ret); diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/string/convertutf.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/string/convertutf.c --- open-vm-tools-2008.01.23-74039/lib/string/convertutf.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/string/convertutf.c 2008-10-13 08:01:52.000000000 +0100 @@ -0,0 +1,542 @@ +/* ********************************************************** + * 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. + + --------------------------------------------------------------------- */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/string/convertutf.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/string/convertutf.h --- open-vm-tools-2008.01.23-74039/lib/string/convertutf.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/string/convertutf.h 2008-10-13 08:01:52.000000000 +0100 @@ -0,0 +1,152 @@ +/* ********************************************************** + * 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. +------------------------------------------------------------------------ */ + +typedef unsigned long UTF32; /* at least 32 bits */ +typedef unsigned short UTF16; /* at least 16 bits */ +typedef unsigned char 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 + +/* --------------------------------------------------------------------- */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/string/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/string/Makefile.am --- open-vm-tools-2008.01.23-74039/lib/string/Makefile.am 2008-01-28 08:02:50.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/string/Makefile.am 2008-10-13 08:01:48.000000000 +0100 @@ -21,11 +21,10 @@ libString_a_SOURCES += bsd_output_shared.c libString_a_SOURCES += bsd_vsnprintf.c libString_a_SOURCES += bsd_vsnwprintf.c +libString_a_SOURCES += convertutf.c libString_a_SOURCES += str.c -AM_CFLAGS = -AM_CFLAGS += @COMMON_CFLAGS@ -AM_CFLAGS += @LIB_STRING_CFLAGS@ +AM_CFLAGS = @LIB_STRING_CPPFLAGS@ SUBDIRS = SUBDIRS += shared diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/string/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/string/Makefile.in --- open-vm-tools-2008.01.23-74039/lib/string/Makefile.in 2008-01-28 08:03:05.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/string/Makefile.in 2008-10-13 08:02:15.000000000 +0100 @@ -52,7 +52,10 @@ subdir = lib/string DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +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)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -62,10 +65,11 @@ libString_a_AR = $(AR) $(ARFLAGS) libString_a_LIBADD = am_libString_a_OBJECTS = bsd_output_shared.$(OBJEXT) \ - bsd_vsnprintf.$(OBJEXT) bsd_vsnwprintf.$(OBJEXT) str.$(OBJEXT) + bsd_vsnprintf.$(OBJEXT) bsd_vsnwprintf.$(OBJEXT) \ + convertutf.$(OBJEXT) str.$(OBJEXT) libString_a_OBJECTS = $(am_libString_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp +depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -101,8 +105,6 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -COMMON_CFLAGS = @COMMON_CFLAGS@ -COMMON_PROG_CFLAGS = @COMMON_PROG_CFLAGS@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -113,45 +115,57 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ -ECHO = @ECHO@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GREP = @GREP@ -GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_AUTH_CFLAGS = @LIB_AUTH_CFLAGS@ -LIB_FILE_CFLAGS = @LIB_FILE_CFLAGS@ -LIB_HGFS_SERVER_CFLAGS = @LIB_HGFS_SERVER_CFLAGS@ -LIB_IMPERSONATE_CFLAGS = @LIB_IMPERSONATE_CFLAGS@ -LIB_MISC_CFLAGS = @LIB_MISC_CFLAGS@ -LIB_PROC_MGR_CFLAGS = @LIB_PROC_MGR_CFLAGS@ -LIB_STRING_CFLAGS = @LIB_STRING_CFLAGS@ -LIB_USER_CFLAGS = @LIB_USER_CFLAGS@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -159,27 +173,35 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ VERSION = @VERSION@ -VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -210,6 +232,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -226,8 +249,8 @@ top_srcdir = @top_srcdir@ noinst_LIBRARIES = libString.a libString_a_SOURCES = bsd_output_shared.c bsd_vsnprintf.c \ - bsd_vsnwprintf.c str.c -AM_CFLAGS = @COMMON_CFLAGS@ @LIB_STRING_CFLAGS@ + bsd_vsnwprintf.c convertutf.c str.c +AM_CFLAGS = @LIB_STRING_CPPFLAGS@ SUBDIRS = shared all: all-recursive @@ -279,6 +302,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsd_output_shared.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsd_vsnprintf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bsd_vsnwprintf.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/convertutf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/str.Po@am__quote@ .c.o: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/string/shared/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/string/shared/Makefile.am --- open-vm-tools-2008.01.23-74039/lib/string/shared/Makefile.am 2008-01-28 08:02:50.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/string/shared/Makefile.am 2008-10-13 08:01:48.000000000 +0100 @@ -21,8 +21,7 @@ libString_la_SOURCES += ../bsd_output_shared.c libString_la_SOURCES += ../bsd_vsnprintf.c libString_la_SOURCES += ../bsd_vsnwprintf.c +libString_la_SOURCES += ../convertutf.c libString_la_SOURCES += ../str.c -AM_CFLAGS = -AM_CFLAGS += @COMMON_CFLAGS@ -AM_CFLAGS += @LIB_STRING_CFLAGS@ +AM_CFLAGS = @LIB_STRING_CPPFLAGS@ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/string/shared/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/string/shared/Makefile.in --- open-vm-tools-2008.01.23-74039/lib/string/shared/Makefile.in 2008-01-28 08:03:05.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/string/shared/Makefile.in 2008-10-13 08:02:15.000000000 +0100 @@ -52,7 +52,10 @@ subdir = lib/string/shared DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +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)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -60,10 +63,10 @@ LTLIBRARIES = $(noinst_LTLIBRARIES) libString_la_LIBADD = am_libString_la_OBJECTS = bsd_output_shared.lo bsd_vsnprintf.lo \ - bsd_vsnwprintf.lo str.lo + bsd_vsnwprintf.lo convertutf.lo str.lo libString_la_OBJECTS = $(am_libString_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp +depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -89,8 +92,6 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -COMMON_CFLAGS = @COMMON_CFLAGS@ -COMMON_PROG_CFLAGS = @COMMON_PROG_CFLAGS@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -101,45 +102,57 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ -ECHO = @ECHO@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GREP = @GREP@ -GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_AUTH_CFLAGS = @LIB_AUTH_CFLAGS@ -LIB_FILE_CFLAGS = @LIB_FILE_CFLAGS@ -LIB_HGFS_SERVER_CFLAGS = @LIB_HGFS_SERVER_CFLAGS@ -LIB_IMPERSONATE_CFLAGS = @LIB_IMPERSONATE_CFLAGS@ -LIB_MISC_CFLAGS = @LIB_MISC_CFLAGS@ -LIB_PROC_MGR_CFLAGS = @LIB_PROC_MGR_CFLAGS@ -LIB_STRING_CFLAGS = @LIB_STRING_CFLAGS@ -LIB_USER_CFLAGS = @LIB_USER_CFLAGS@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -147,27 +160,35 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ VERSION = @VERSION@ -VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -198,6 +219,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -214,8 +236,8 @@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libString.la libString_la_SOURCES = ../bsd_output_shared.c ../bsd_vsnprintf.c \ - ../bsd_vsnwprintf.c ../str.c -AM_CFLAGS = @COMMON_CFLAGS@ @LIB_STRING_CFLAGS@ + ../bsd_vsnwprintf.c ../convertutf.c ../str.c +AM_CFLAGS = @LIB_STRING_CPPFLAGS@ all: all-am .SUFFIXES: @@ -270,6 +292,7 @@ @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: @@ -314,6 +337,13 @@ @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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o bsd_vsnwprintf.lo `test -f '../bsd_vsnwprintf.c' || echo '$(srcdir)/'`../bsd_vsnwprintf.c +convertutf.lo: ../convertutf.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT convertutf.lo -MD -MP -MF $(DEPDIR)/convertutf.Tpo -c -o convertutf.lo `test -f '../convertutf.c' || echo '$(srcdir)/'`../convertutf.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/convertutf.Tpo $(DEPDIR)/convertutf.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../convertutf.c' object='convertutf.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o convertutf.lo `test -f '../convertutf.c' || echo '$(srcdir)/'`../convertutf.c + str.lo: ../str.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT str.lo -MD -MP -MF $(DEPDIR)/str.Tpo -c -o str.lo `test -f '../str.c' || echo '$(srcdir)/'`../str.c @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/str.Tpo $(DEPDIR)/str.Plo diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/string/str.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/string/str.c --- open-vm-tools-2008.01.23-74039/lib/string/str.c 2008-01-28 08:02:51.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/string/str.c 2008-10-13 08:01:52.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -35,6 +35,7 @@ #ifdef HAS_BSD_PRINTF #include "bsd_output.h" #endif +#include "codeset.h" #if defined _WIN32 && !defined HAS_BSD_PRINTF #define vsnprintf _vsnprintf @@ -42,7 +43,24 @@ #ifndef _WIN32 extern int vasprintf(char **ptr, const char *f, va_list arg); -#endif +/* + * 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_VERSION_22. 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(GLIBC_VERSION_22) || \ + (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 #ifdef N_PLAT_NLM extern int vsnprintf(char *buf, size_t len, const char *f, va_list arg); @@ -52,7 +70,7 @@ /* *---------------------------------------------------------------------- * - * Str_Sprintf + * Str_Sprintf -- * * sprintf wrapper that fails on overflow * @@ -98,7 +116,8 @@ * terminate character), -1 on overflow (insufficient space for * null terminate is considered overflow) * - * NB: on overflow the buffer WILL be null terminated + * NB: on overflow the buffer WILL be null terminated at the last + * UTF-8 code point boundary within the buffer's bounds. * * Side effects: * None @@ -114,6 +133,9 @@ { int retval; + ASSERT(str != NULL); + ASSERT(format != NULL); + #ifndef HAS_BSD_PRINTF retval = vsnprintf(str, size, format, ap); #elif defined __linux__ @@ -139,11 +161,11 @@ * those cases. */ -#if defined _WIN32 && !defined HAS_BSD_PRINTF if ((retval < 0 || retval >= size) && size > 0) { - str[size - 1] = '\0'; + /* Find UTF-8 code point boundary and place NUL termination there */ + int trunc = CodeSet_Utf8FindCodePointBoundary(str, size - 1); + str[trunc] = '\0'; } -#endif if (retval >= size) { return -1; } @@ -181,6 +203,9 @@ 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); @@ -191,7 +216,7 @@ /* *---------------------------------------------------------------------- * - * Str_Strcpy-- + * Str_Strcpy -- * * Wrapper for strcpy that checks for buffer overruns. * @@ -212,10 +237,13 @@ uint32 *stack = (uint32 *)&buf; size_t len; + ASSERT(buf != NULL); + ASSERT(src != NULL); + len = strlen(src); - if (len >= maxSize) { + if (len >= maxSize) { Panic("%s:%d Buffer too small 0x%x\n", __FILE__, __LINE__, stack[-1]); - ASSERT_BUG(5686, FALSE); + ASSERT_BUG(5686, FALSE); } return memcpy(buf, src, len + 1); } @@ -246,7 +274,8 @@ size_t subLen; const char *end; - ASSERT(src != NULL && sub != NULL); + ASSERT(src != NULL); + ASSERT(sub != NULL); if ((subLen = strlen(sub)) == 0) { return (char *) src; @@ -292,6 +321,9 @@ size_t bufLen; size_t srcLen; + ASSERT(buf != NULL); + ASSERT(src != NULL); + bufLen = strlen(buf); srcLen = strlen(src); @@ -331,17 +363,22 @@ const char *src, // IN: String to append size_t n) // IN: Max chars of src to append { - uint32 *stack = (uint32 *)&buf; - size_t bufLen = strlen(buf); + uint32 *stack; + size_t bufLen; + + ASSERT(buf != NULL); + ASSERT(src != NULL); + + stack = (uint32 *)&buf; + bufLen = strlen(buf); /* * 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 both the glibc and the Win32 version of strncat null- - * terminate the final resulting string, even if they reach the - * length limit n. This means that if it happens that + * 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 null terminator that * is outside of the buffer. Therefore, we make sure this does not * happen by adding the == case to the Panic test. @@ -384,7 +421,7 @@ { va_list arguments; char *result; - + va_start(arguments, format); result = Str_Vasprintf(length, format, arguments); va_end(arguments); @@ -396,7 +433,39 @@ /* *----------------------------------------------------------------------------- * - * Str_Vasprintf -- + * 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 + 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; +} + + +/* + *----------------------------------------------------------------------------- + * + * StrVasprintf_Internal -- * * Allocate and format a string, using the GNU libc way to specify the * format (i.e. optionally allow the use of positional parameters) @@ -404,8 +473,10 @@ * Results: * * The allocated string on success (if 'length' is not NULL, *length - * is set to the length of the allocated string) - * NULL on failure + * is set to the length of the allocated string). + * + * ASSERTs or returns NULL on failure, depending on the value of + * 'assertOnFailure'. * * Side effects: * None @@ -413,16 +484,16 @@ *----------------------------------------------------------------------------- */ -char * -Str_Vasprintf(size_t *length, // OUT - const char *format, // IN - va_list arguments) // IN +static char * +StrVasprintf_Internal(size_t *length, // OUT + const char *format, // IN + va_list arguments, // IN + Bool assertOnFailure) // IN { - char *buf; + char *buf = NULL; int ret; #ifdef HAS_BSD_PRINTF - buf = NULL; #ifdef __linux__ { va_list aq; @@ -443,10 +514,7 @@ * 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; - - bufSize = strlen(format); - buf = NULL; + size_t bufSize = strlen(format); do { /* @@ -458,10 +526,10 @@ bufSize *= 2; newBuf = realloc(buf, bufSize); - if (!newBuf) { free(buf); - return NULL; + buf = NULL; + goto exit; } buf = newBuf; @@ -470,15 +538,72 @@ #endif if (ret < 0) { - return NULL; + buf = NULL; + goto exit; } if (length != NULL) { *length = ret; } + + exit: + if (assertOnFailure) { + ASSERT_NOT_IMPLEMENTED(buf); + } return buf; } +/* + *----------------------------------------------------------------------------- + * + * Str_Vasprintf -- + * + * See StrVasprintf_Internal. + * + * Results: + * See StrVasprintf_Internal. + * Returns NULL on failure. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +char * +Str_Vasprintf(size_t *length, // OUT + const char *format, // IN + va_list arguments) // IN +{ + return StrVasprintf_Internal(length, format, arguments, FALSE); +} + + +/* + *----------------------------------------------------------------------------- + * + * Str_SafeVasprintf -- + * + * See StrVasprintf_Internal. + * + * Results: + * See StrVasprintf_Internal. + * Calls ASSERT_NOT_IMPLEMENTED on failure. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +char * +Str_SafeVasprintf(size_t *length, // OUT + const char *format, // IN + va_list arguments) // IN +{ + return StrVasprintf_Internal(length, format, arguments, TRUE); +} + #if defined(_WIN32) || defined(GLIBC_VERSION_22) /* @@ -499,7 +624,7 @@ int Str_Swprintf(wchar_t *buf, // OUT - size_t maxSize, // IN + size_t maxSize, // IN: Size of buf, in wide-characters. const wchar_t *fmt, // IN ...) // IN { @@ -540,7 +665,7 @@ int Str_Vsnwprintf(wchar_t *str, // OUT - size_t size, // IN + size_t size, // IN: Size of str, in wide-characters. const wchar_t *format, // IN va_list ap) // IN { @@ -558,6 +683,26 @@ va_end(aq); #endif + /* + * Linux glibc 2.0.x returns -1 and null 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 null 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; } @@ -585,7 +730,7 @@ int Str_Snwprintf(wchar_t *str, // OUT - size_t size, // IN + size_t size, // IN: Size of str, in wide-characters. const wchar_t *format, // IN ...) // IN { @@ -602,7 +747,7 @@ /* *---------------------------------------------------------------------- * - * Str_Wcscpy-- + * Str_Wcscpy -- * * Wrapper for wcscpy that checks for buffer overruns. * @@ -618,7 +763,7 @@ wchar_t * Str_Wcscpy(wchar_t *buf, // OUT const wchar_t *src, // IN - size_t maxSize) // IN + size_t maxSize) // IN: Size of buf, in wide-characters. { uint32 *stack = (uint32 *)&buf; size_t len; @@ -651,7 +796,7 @@ wchar_t * Str_Wcscat(wchar_t *buf, // IN-OUT const wchar_t *src, // IN - size_t maxSize) // IN + size_t maxSize) // IN: Size of buf, in wide-characters. { uint32 *stack = (uint32 *)&buf; size_t bufLen; @@ -692,7 +837,7 @@ wchar_t * Str_Wcsncat(wchar_t *buf, // IN-OUT - size_t bufSize, // IN: Size of buf + 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 { @@ -704,9 +849,8 @@ * if possible. * * The reason the test with bufLen and n is >= rather than just > - * is that both the glibc and the Win32 version of wcsncat null - * terminate the final resulting string, even if they reach the - * length limit n. This means that if it happens that + * 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 null terminator that * is outside of the buffer. Therefore, we make sure this does not * happen by adding the == case to the Panic test. @@ -727,48 +871,92 @@ /* - *----------------------------------------------------------------------------- + *---------------------------------------------------------------------- * - * Str_Aswprintf -- + * Str_Mbscpy -- * - * Same as Str_Vaswprintf(), but parameters are passed inline + * Wrapper for _mbscpy that checks for buffer overruns. * * Results: - * Same as Str_Vaswprintf() + * Same as strcpy. * * Side effects: - * Same as Str_Vaswprintf() + * None. * - *----------------------------------------------------------------------------- + *---------------------------------------------------------------------- */ -wchar_t * -Str_Aswprintf(size_t *length, // OUT - const wchar_t *format, // IN - ...) // IN +unsigned char * +Str_Mbscpy(char *buf, // OUT + const char *src, // IN + size_t maxSize) // IN { - va_list arguments; - wchar_t *result; - - va_start(arguments, format); - result = Str_Vaswprintf(length, format, arguments); - va_end(arguments); + uint32 *stack = (uint32 *)&buf; + size_t len; - return result; + len = strlen((const char *) src); + if (len >= maxSize) { + Panic("%s:%d Buffer too small 0x%x\n", __FILE__, __LINE__, stack[-1]); + } + 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 +{ + uint32 *stack = (uint32 *)&buf; + size_t bufLen; + size_t srcLen; + + bufLen = strlen((const char *) buf); + srcLen = strlen((const char *) src); + + /* The first comparison checks for numeric overflow */ + if (bufLen + srcLen < srcLen || bufLen + srcLen >= maxSize) { + Panic("%s:%d Buffer too small 0x%x\n", __FILE__, __LINE__, stack[-1]); + } + + memcpy(buf + bufLen, src, srcLen + 1); + + return (unsigned char *)buf; } /* *----------------------------------------------------------------------------- * - * Str_Vaswprintf -- + * StrVaswprintf_Internal -- * * 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) - * NULL on failure + * is set to the length of the allocated string, in wchat_ts) + * + * ASSERTs or returns NULL on failure, depending on the value of + * 'assertOnFailure'. * * Side effects: * None @@ -776,17 +964,17 @@ *----------------------------------------------------------------------------- */ -wchar_t * -Str_Vaswprintf(size_t *length, // OUT - const wchar_t *format, // IN - va_list arguments) // IN +static wchar_t * +StrVaswprintf_Internal(size_t *length, // OUT + const wchar_t *format, // IN + va_list arguments, // IN + Bool assertOnFailure) // IN { size_t bufSize; - wchar_t *buf; + wchar_t *buf = NULL; int retval; bufSize = wcslen(format); - buf = NULL; do { /* @@ -798,10 +986,10 @@ bufSize *= 2; newBuf = realloc(buf, bufSize*sizeof(wchar_t)); - if (!newBuf) { free(buf); - return NULL; + buf = NULL; + goto exit; } buf = newBuf; @@ -816,9 +1004,130 @@ /* * Try to trim the buffer here to save memory? */ + + exit: + if (assertOnFailure) { + ASSERT_NOT_IMPLEMENTED(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 + 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 StrVaswprintf_Internal. + * + * Results: + * See StrVaswprintf_Internal. + * Returns NULL on failure. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +wchar_t * +Str_Vaswprintf(size_t *length, // OUT + const wchar_t *format, // IN + va_list arguments) // IN +{ + return StrVaswprintf_Internal(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 + 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 StrVaswprintf_Internal. + * + * Results: + * See StrVaswprintf_Internal. + * Calls ASSERT_NOT_IMPLEMENTED on failure. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +wchar_t * +Str_SafeVaswprintf(size_t *length, // OUT + const wchar_t *format, // IN + va_list arguments) // IN +{ + return StrVaswprintf_Internal(length, format, arguments, TRUE); +} + #endif // defined(_WIN32) || defined(GLIBC_VERSION_22) #ifndef _WIN32 @@ -826,7 +1135,7 @@ /* *----------------------------------------------------------------------------- * - * _Str_ToLower -- + * Str_ToLower -- * * Convert a string to lowercase, in-place. Hand-rolled, for non-WIN32. * @@ -842,7 +1151,7 @@ */ char * -_Str_ToLower(char *string) // IN +Str_ToLower(char *string) // IN { char *c = string; @@ -858,7 +1167,7 @@ /* *----------------------------------------------------------------------------- * - * _Str_ToUpper -- + * Str_ToUpper -- * * Convert a string to uppercase, in-place. Hand-rolled, for non-WIN32. * @@ -874,7 +1183,7 @@ */ char * -_Str_ToUpper(char *string) // IN +Str_ToUpper(char *string) // IN { char *c = string; @@ -891,12 +1200,11 @@ #if 0 /* - * Win32 tests. Compares our bsd_vs*printf code output to the Windows - * C-library code output, where possible. Not all functionality can be - * compared. (See bsd_output.h for more details). + * Unit tests. Compares our bsd_vs*printf code output to C-library + * code output, where possible. */ -Bool bCompare; +static Bool bCompare; #define FAIL(s) \ do { \ @@ -904,7 +1212,7 @@ exit(1); \ } while (0); -void +static void PrintAndCheck(char *fmt, ...) { char buf1[1024], buf2[1024]; @@ -919,13 +1227,21 @@ } va_start(args, fmt); +#ifdef _WIN32 count = _vsnprintf(buf2, 1024, fmt, args); +#else + count = vsnprintf(buf2, 1024, fmt, args); +#endif 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"); } @@ -934,7 +1250,7 @@ va_end(args); } -void +static void PrintAndCheckW(wchar_t *fmt, ...) { wchar_t buf1[1024], buf2[1024]; @@ -949,54 +1265,57 @@ } va_start(args, fmt); +#ifdef _WIN32 count = _vsnwprintf(buf2, 1024, fmt, args); +#else + count = vswprintf(buf2, 1024, fmt, args); +#endif 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"); } - wprintf(buf1); +#ifndef _WIN32 + printf("%S", buf1); +#endif // _WIN32 va_end(args); } -int -main(int argc, // IN - char *argv[]) // IN +void +Str_UnitTests(void) { - static const char *tests[] = { - "hello" - }; - - static const wchar_t *testsw[] = { - L"hello" - }; - - static int bufsize = 1024; - char buf[1024]; wchar_t bufw[1024]; int count; int32 num1 = 0xDEADBEEF; int32 num2 = 0x927F82CD; - int64 num3 = 0xCAFEBABE42439021i64; + 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, ""); + count = Str_Snprintf(buf, 1, empty); if (0 != count) { FAIL("Failed empty string test"); } - count = Str_Snwprintf(bufw, 1, L""); + count = Str_Snwprintf(bufw, 1, wempty); if (0 != count) { FAIL("Failed empty string test (W)"); @@ -1006,32 +1325,42 @@ count = Str_Snprintf(buf, 2, "ba"); if (-1 != count) { - FAIL("Failed overflow test - count"); + FAIL("Failed borderline overflow test - count"); } if (buf[1]) { - FAIL("Failed overflow test - NULL term (W)"); + 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 overflow test - count"); + FAIL("Failed egregious overflow test - count"); } if (buf[1]) { - FAIL("Failed overflow test - NULL term (W)"); + FAIL("Failed egregious overflow test - NULL term"); } count = Str_Snwprintf(bufw, 2, L"baabaa"); if (-1 != count) { - FAIL("Failed overflow test - count"); + FAIL("Failed egregious overflow test - count (W)"); } if (bufw[1]) { - FAIL("Failed overflow test - NULL term (W)"); + FAIL("Failed egregious overflow test - NULL term (W)"); } /* test 'n' argument */ @@ -1088,12 +1417,19 @@ 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; @@ -1101,19 +1437,23 @@ 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); - - return 0; +#endif } -#endif +#endif // 0 diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/strUtil/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/strUtil/Makefile.am --- open-vm-tools-2008.01.23-74039/lib/strUtil/Makefile.am 2008-01-28 08:02:50.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/strUtil/Makefile.am 1970-01-01 01:00:00.000000000 +0100 @@ -1,24 +0,0 @@ -################################################################################ -### Copyright 2007 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_LIBRARIES = libStrUtil.a - -libStrUtil_a_SOURCES = -libStrUtil_a_SOURCES += strutil.c - -AM_CFLAGS = -AM_CFLAGS += @COMMON_CFLAGS@ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/strUtil/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/strUtil/Makefile.in --- open-vm-tools-2008.01.23-74039/lib/strUtil/Makefile.in 2008-01-28 08:03:05.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/strUtil/Makefile.in 1970-01-01 01:00:00.000000000 +0100 @@ -1,473 +0,0 @@ -# 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 2007 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/strUtil -DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_CLEAN_FILES = -LIBRARIES = $(noinst_LIBRARIES) -ARFLAGS = cru -libStrUtil_a_AR = $(AR) $(ARFLAGS) -libStrUtil_a_LIBADD = -am_libStrUtil_a_OBJECTS = strutil.$(OBJEXT) -libStrUtil_a_OBJECTS = $(am_libStrUtil_a_OBJECTS) -DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/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 = $(libStrUtil_a_SOURCES) -DIST_SOURCES = $(libStrUtil_a_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_CFLAGS = @COMMON_CFLAGS@ -COMMON_PROG_CFLAGS = @COMMON_PROG_CFLAGS@ -COMMON_XLIBS = @COMMON_XLIBS@ -CPP = @CPP@ -CPPFLAGS = @CPPFLAGS@ -CXX = @CXX@ -CXXCPP = @CXXCPP@ -CXXDEPMODE = @CXXDEPMODE@ -CXXFLAGS = @CXXFLAGS@ -CYGPATH_W = @CYGPATH_W@ -DEFS = @DEFS@ -DEPDIR = @DEPDIR@ -DNET_CFLAGS = @DNET_CFLAGS@ -DNET_CONFIG = @DNET_CONFIG@ -DNET_LIBS = @DNET_LIBS@ -ECHO = @ECHO@ -ECHO_C = @ECHO_C@ -ECHO_N = @ECHO_N@ -ECHO_T = @ECHO_T@ -EGREP = @EGREP@ -EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ -GREP = @GREP@ -GTK_CFLAGS = @GTK_CFLAGS@ -GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ -HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ -INSTALL = @INSTALL@ -INSTALL_DATA = @INSTALL_DATA@ -INSTALL_PROGRAM = @INSTALL_PROGRAM@ -INSTALL_SCRIPT = @INSTALL_SCRIPT@ -INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ -LDFLAGS = @LDFLAGS@ -LIBOBJS = @LIBOBJS@ -LIBS = @LIBS@ -LIBTOOL = @LIBTOOL@ -LIB_AUTH_CFLAGS = @LIB_AUTH_CFLAGS@ -LIB_FILE_CFLAGS = @LIB_FILE_CFLAGS@ -LIB_HGFS_SERVER_CFLAGS = @LIB_HGFS_SERVER_CFLAGS@ -LIB_IMPERSONATE_CFLAGS = @LIB_IMPERSONATE_CFLAGS@ -LIB_MISC_CFLAGS = @LIB_MISC_CFLAGS@ -LIB_PROC_MGR_CFLAGS = @LIB_PROC_MGR_CFLAGS@ -LIB_STRING_CFLAGS = @LIB_STRING_CFLAGS@ -LIB_USER_CFLAGS = @LIB_USER_CFLAGS@ -LN_S = @LN_S@ -LTLIBOBJS = @LTLIBOBJS@ -MAKEINFO = @MAKEINFO@ -MKDIR_P = @MKDIR_P@ -MODULES = @MODULES@ -MODULES_OS = @MODULES_OS@ -OBJEXT = @OBJEXT@ -PACKAGE = @PACKAGE@ -PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ -PACKAGE_NAME = @PACKAGE_NAME@ -PACKAGE_STRING = @PACKAGE_STRING@ -PACKAGE_TARNAME = @PACKAGE_TARNAME@ -PACKAGE_VERSION = @PACKAGE_VERSION@ -PATH_SEPARATOR = @PATH_SEPARATOR@ -RANLIB = @RANLIB@ -SED = @SED@ -SET_MAKE = @SET_MAKE@ -SHELL = @SHELL@ -STRIP = @STRIP@ -VERSION = @VERSION@ -VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ -XMKMF = @XMKMF@ -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_CC = @ac_ct_CC@ -ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ -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@ -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_LIBRARIES = libStrUtil.a -libStrUtil_a_SOURCES = strutil.c -AM_CFLAGS = @COMMON_CFLAGS@ -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/strUtil/Makefile'; \ - cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu lib/strUtil/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-noinstLIBRARIES: - -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) -libStrUtil.a: $(libStrUtil_a_OBJECTS) $(libStrUtil_a_DEPENDENCIES) - -rm -f libStrUtil.a - $(libStrUtil_a_AR) libStrUtil.a $(libStrUtil_a_OBJECTS) $(libStrUtil_a_LIBADD) - $(RANLIB) libStrUtil.a - -mostlyclean-compile: - -rm -f *.$(OBJEXT) - -distclean-compile: - -rm -f *.tab.c - -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strutil.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 $(LIBRARIES) -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-noinstLIBRARIES \ - 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-noinstLIBRARIES 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: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/strUtil/strutil.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/strUtil/strutil.c --- open-vm-tools-2008.01.23-74039/lib/strUtil/strutil.c 2008-01-28 08:02:51.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/strUtil/strutil.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,530 +0,0 @@ -/********************************************************* - * Copyright (C) 1998 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 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. - * - *********************************************************/ - -/* - * strutil.c -- - * - * String utility functions. - */ - -#include -#include -#include -#include -#if !defined(_WIN32) && !defined(N_PLAT_NLM) -#include /* For strncasecmp */ -#endif -#include "vmware.h" -#include "strutil.h" -#include "str.h" - - - -/* - *----------------------------------------------------------------------------- - * - * StrUtil_GetNextToken -- - * - * Get the next token from a string after a given index w/o modifying the - * original string. - * - * Results: - * An allocated, NUL-terminated string containing the token. 'index' is - * updated to point after the returned token - * NULL if no tokens are left - * - * Side effects: - * None - * - *----------------------------------------------------------------------------- - */ - -char * -StrUtil_GetNextToken(unsigned int *index, // IN/OUT: Index to start at - const char *str, // IN : String to parse - const char *delimiters) // IN : Chars separating tokens -{ - unsigned int startIndex; - unsigned int length; - char *token; - - ASSERT(index); - ASSERT(str); - ASSERT(delimiters); - ASSERT(*index <= strlen(str)); - -#define NOT_DELIMITER (Str_Strchr(delimiters, str[*index]) == NULL) - - /* Skip leading delimiters. */ - for (; ; (*index)++) { - if (str[*index] == '\0') { - return NULL; - } - - if (NOT_DELIMITER) { - break; - } - } - startIndex = *index; - - /* - * Walk the string until we reach the end of it, or we find a - * delimiter. - */ - for ((*index)++; str[*index] != '\0' && NOT_DELIMITER; (*index)++) { - } - -#undef NOT_DELIMITER - - length = *index - startIndex; - ASSERT(length); - token = (char *)malloc(length + 1 /* NUL */); - ASSERT_MEM_ALLOC(token); - memcpy(token, str + startIndex, length); - token[length] = '\0'; - - return token; -} - - -/* - *----------------------------------------------------------------------------- - * - * StrUtil_GetNextIntToken -- - * - * Acts like StrUtil_GetNextToken except it returns an int32. - * - * Results: - * TRUE if a valid int was parsed and 'out' contains the parsed int. - * FALSE otherwise. Contents of 'out' are undefined. - * - * Side effects: - * None - * - *----------------------------------------------------------------------------- - */ - -Bool -StrUtil_GetNextIntToken(int32 *out, // OUT : parsed int - unsigned int *index, // IN/OUT: Index to start at - const char *str, // IN : String to parse - const char *delimiters) // IN : Chars separating tokens -{ - char *resultStr; - Bool valid = FALSE; - - ASSERT(out); - ASSERT(index); - ASSERT(str); - ASSERT(delimiters); - - resultStr = StrUtil_GetNextToken(index, str, delimiters); - if (resultStr == NULL) { - return FALSE; - } - - valid = StrUtil_StrToInt(out, resultStr); - free(resultStr); - - return valid; -} - - -/* - *----------------------------------------------------------------------------- - * - * StrUtil_GetNextUintToken -- - * - * Acts like StrUtil_GetNextIntToken except it returns an uint32. - * - * Results: - * TRUE if a valid int was parsed and 'out' contains the parsed int. - * FALSE otherwise. Contents of 'out' are undefined. - * - * Side effects: - * None - * - *----------------------------------------------------------------------------- - */ - -Bool -StrUtil_GetNextUintToken(uint32 *out, // OUT : parsed int - unsigned int *index, // IN/OUT: Index to start at - const char *str, // IN : String to parse - const char *delimiters) // IN : Chars separating tokens -{ - char *resultStr; - Bool valid = FALSE; - - ASSERT(out); - ASSERT(index); - ASSERT(str); - ASSERT(delimiters); - - resultStr = StrUtil_GetNextToken(index, str, delimiters); - if (resultStr == NULL) { - return FALSE; - } - - valid = StrUtil_StrToUint(out, resultStr); - free(resultStr); - - return valid; -} - - -/* - *----------------------------------------------------------------------------- - * - * StrUtil_GetNextInt64Token -- - * - * Acts like StrUtil_GetNextToken except it returns an int64. - * - * Results: - * TRUE on a successful retrieval. FALSE otherwise. - * Token is stored in 'out', which is left undefined in the FALSE case. - * - * Side effects: - * None - * - *----------------------------------------------------------------------------- - */ - -Bool -StrUtil_GetNextInt64Token(int64 *out, // OUT: The output value - unsigned int *index, // IN/OUT: Index to start at - const char *str, // IN : String to parse - const char *delimiters) // IN : Chars separating tokens -{ - char *resultStr; - Bool result; - - ASSERT(out); - ASSERT(index); - ASSERT(str); - ASSERT(delimiters); - - resultStr = StrUtil_GetNextToken(index, str, delimiters); - result = resultStr ? StrUtil_StrToInt64(out, resultStr) : FALSE; - free(resultStr); - - return result; -} - - -/* - *----------------------------------------------------------------------------- - * - * StrUtil_StrToInt -- - * - * Convert a string into an integer. - * - * Results: - * TRUE if the conversion was successful and 'out' contains the converted - * result. - * FALSE otherwise. 'out' is undefined. - * - * Side effects: - * None - * - *----------------------------------------------------------------------------- - */ - -Bool -StrUtil_StrToInt(int32 *out, // OUT - const char *str) // IN : String to parse -{ - char *ptr; - - ASSERT(out); - ASSERT(str); - - errno = 0; - - *out = (int32)strtol(str, &ptr, 0); - - return ptr[0] == '\0' && errno != ERANGE; -} - - -/* - *----------------------------------------------------------------------------- - * - * StrUtil_StrToUint -- - * - * Convert a string into unsigned integer. - * - * Results: - * TRUE if the conversion succeeded and 'out' contains the result. - * FALSE otherwise. 'out' is undefined. - * - * Side effects: - * None - * - *----------------------------------------------------------------------------- - */ - -Bool -StrUtil_StrToUint(uint32 *out, // OUT - const char *str) // IN : String to parse -{ - char *ptr; - - ASSERT(out); - ASSERT(str); - - errno = 0; - - *out = (uint32)strtoul(str, &ptr, 0); - - return *ptr == '\0' && errno != ERANGE; -} - - -/* - *----------------------------------------------------------------------------- - * - * StrUtil_StrToInt64 -- - * - * Convert a string into a 64bit integer. - * - * Results: - * TRUE if conversion was successful, FALSE otherwise. - * Value is stored in 'out', which is left undefined in the FALSE case. - * - * Side effects: - * None - * - *----------------------------------------------------------------------------- - */ - -Bool -StrUtil_StrToInt64(int64 *out, // OUT: The output value - const char *str) // IN : String to parse -{ - char *ptr; - - ASSERT(out); - ASSERT(str); - - errno = 0; - -#if defined(_WIN32) - *out= _strtoi64(str, &ptr, 0); -#elif defined(__FreeBSD__) - *out= strtoq(str, &ptr, 0); -#elif defined(N_PLAT_NLM) - /* Works for small values of str... */ - *out= (int64)strtol(str, &ptr, 0); -#else - *out= strtoll(str, &ptr, 0); -#endif - - return ptr[0] == '\0' && errno != ERANGE; -} - - -/* - *----------------------------------------------------------------------------- - * - * StrUtil_FormatSizeInBytes -- - * - * Format a size (in bytes) to a string in a user-friendly way. - * - * Example: 160041885696 -> "149.1 GB" - * - * Results: - * The allocated, NUL-terminated string (not localized). - * - * Side effects: - * None - * - *----------------------------------------------------------------------------- - */ - -char * -StrUtil_FormatSizeInBytesUnlocalized(uint64 size) // IN -{ - /* - * XXX TODO, BUG 199661: - * This is a direct copy of Msg_FormatSizeInBytes without localization. - * These two functions should ideally share the basic functionality, and just - * differ in the string localization - */ - char const *fmt; - double sizeInSelectedUnit; - unsigned int precision; - char *sizeFormat; - char *sizeString; - char *result; - static const double epsilon = 0.01; - double delta; - - if (size >= CONST64U(1) << 40 /* 1 TB */) { - fmt = "%s TB"; - sizeInSelectedUnit = (double)size / (CONST64U(1) << 40); - precision = 1; - } else if (size >= CONST64U(1) << 30 /* 1 GB */) { - fmt = "%s GB"; - sizeInSelectedUnit = (double)size / (CONST64U(1) << 30); - precision = 1; - } else if (size >= CONST64U(1) << 20 /* 1 MB */) { - fmt = "%s MB"; - sizeInSelectedUnit = (double)size / (CONST64U(1) << 20); - precision = 1; - } else if (size >= CONST64U(1) << 10 /* 1 KB */) { - fmt = "%s KB"; - sizeInSelectedUnit = (double)size / (CONST64U(1) << 10); - precision = 1; - } else if (size >= CONST64U(2) /* 2 bytes */) { - fmt = "%s bytes"; - sizeInSelectedUnit = (double)size; - precision = 0; // No fractional byte. - } else if (size >= CONST64U(1) /* 1 byte */) { - fmt = "%s byte"; - sizeInSelectedUnit = (double)size; - precision = 0; // No fractional byte. - } else { - ASSERT(size == CONST64U(0) /* 0 bytes */); - fmt = "%s bytes"; - sizeInSelectedUnit = (double)size; - precision = 0; // No fractional byte. - } - - /* - * We cast to uint32 instead of uint64 here because of a problem with the - * NetWare Tools build. However, it's safe to cast to uint32 since we have - * already reduced the range of sizeInSelectedUnit above. - */ - // If it would display with .0, round it off and display the integer value. - delta = (uint32)(sizeInSelectedUnit + 0.5) - sizeInSelectedUnit; - if (delta < 0) { - delta = -delta; - } - if (delta <= epsilon) { - precision = 0; - sizeInSelectedUnit = (double)(uint32)(sizeInSelectedUnit + 0.5); - } - - sizeFormat = Str_Asprintf(NULL, "%%.%uf", precision); - sizeString = Str_Asprintf(NULL, sizeFormat, sizeInSelectedUnit); - result = Str_Asprintf(NULL, fmt, sizeString); - free(sizeFormat); - free(sizeString); - - return result; -} - - -/* - *---------------------------------------------------------------------- - * - * StrUtil_GetLongestLineLength -- - * - * Given a buffer with one or more lines - * this function computes the length of the - * longest line in a buffer. - * - * Results: - * Returns the length of the longest line in the 'buf'. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -size_t -StrUtil_GetLongestLineLength(const char *buf, //IN - size_t bufLength) //IN -{ - size_t longest = 0; - - while (bufLength) { - const char* next; - size_t len; - - next = memchr(buf, '\n', bufLength); - if (next) { - next++; - len = next - buf + 1; - } else { - len = bufLength; - } - if (len > longest) { - longest = len; - } - bufLength -= len; - buf = next; - } - return longest; -} - - -/* - *---------------------------------------------------------------------- - * - * StrUtil_StartsWith -- - * - * Determines if a string starts with another string. - * - * Results: - * TRUE if 's' starts with 'prefix', FALSE otherwise. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -Bool -StrUtil_StartsWith(const char *s, // IN - const char *prefix) // IN -{ - ASSERT(s != NULL); - ASSERT(prefix != NULL); - return Str_Strncmp(s, prefix, strlen(prefix)) == 0; -} - - -#ifndef N_PLAT_NLM -/* - *---------------------------------------------------------------------- - * - * StrUtil_CaselessStartsWith -- - * - * A case-insensitive version of StrUtil_StartsWith. - * - * Results: - * TRUE if 's' starts with 'prefix', FALSE otherwise. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -Bool -StrUtil_CaselessStartsWith(const char *s, // IN - const char *prefix) // IN -{ - ASSERT(s != NULL); - ASSERT(prefix != NULL); - return Str_Strncasecmp(s, prefix, strlen(prefix)) == 0; -} -#endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/stubs/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/stubs/Makefile.am --- open-vm-tools-2008.01.23-74039/lib/stubs/Makefile.am 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/stubs/Makefile.am 2008-10-13 08:01:48.000000000 +0100 @@ -0,0 +1,29 @@ +################################################################################ +### Copyright 2008 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_LIBRARIES = libStubs.a + +libStubs_a_SOURCES = +libStubs_a_SOURCES += stub-config.c +libStubs_a_SOURCES += stub-log.c +libStubs_a_SOURCES += stub-warning.c +libStubs_a_SOURCES += stub-user-msg.c +libStubs_a_SOURCES += stub-user-panic.c + +SUBDIRS = +SUBDIRS += shared + diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/stubs/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/stubs/Makefile.in --- open-vm-tools-2008.01.23-74039/lib/stubs/Makefile.in 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/stubs/Makefile.in 2008-10-13 08:02:15.000000000 +0100 @@ -0,0 +1,616 @@ +# 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 2008 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/stubs +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)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) +ARFLAGS = cru +libStubs_a_AR = $(AR) $(ARFLAGS) +libStubs_a_LIBADD = +am_libStubs_a_OBJECTS = stub-config.$(OBJEXT) stub-log.$(OBJEXT) \ + stub-warning.$(OBJEXT) stub-user-msg.$(OBJEXT) \ + stub-user-panic.$(OBJEXT) +libStubs_a_OBJECTS = $(am_libStubs_a_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 = $(libStubs_a_SOURCES) +DIST_SOURCES = $(libStubs_a_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 = $(SUBDIRS) +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_XLIBS = @COMMON_XLIBS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ +DNET_LIBS = @DNET_LIBS@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ +GTK_LIBS = @GTK_LIBS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ +HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ +MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ +RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ +VERSION = @VERSION@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +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@ +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@ +lt_ECHO = @lt_ECHO@ +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_LIBRARIES = libStubs.a +libStubs_a_SOURCES = stub-config.c stub-log.c stub-warning.c \ + stub-user-msg.c stub-user-panic.c +SUBDIRS = shared +all: all-recursive + +.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/stubs/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu lib/stubs/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-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) +libStubs.a: $(libStubs_a_OBJECTS) $(libStubs_a_DEPENDENCIES) + -rm -f libStubs.a + $(libStubs_a_AR) libStubs.a $(libStubs_a_OBJECTS) $(libStubs_a_LIBADD) + $(RANLIB) libStubs.a + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stub-config.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stub-log.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stub-user-msg.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stub-user-panic.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stub-warning.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 + +# 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 $(LIBRARIES) +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 clean-noinstLIBRARIES \ + mostlyclean-am + +distclean: distclean-recursive + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile 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 -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-compile 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 \ + clean-noinstLIBRARIES ctags ctags-recursive 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 \ + installdirs-am maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile 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: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/stubs/shared/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/stubs/shared/Makefile.am --- open-vm-tools-2008.01.23-74039/lib/stubs/shared/Makefile.am 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/stubs/shared/Makefile.am 2008-10-13 08:01:48.000000000 +0100 @@ -0,0 +1,26 @@ +################################################################################ +### Copyright 2008 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 = libStubs.la + +libStubs_la_SOURCES = +libStubs_la_SOURCES += ../stub-config.c +libStubs_la_SOURCES += ../stub-log.c +libStubs_la_SOURCES += ../stub-warning.c +libStubs_la_SOURCES += ../stub-user-msg.c +libStubs_la_SOURCES += ../stub-user-panic.c + diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/stubs/shared/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/stubs/shared/Makefile.in --- open-vm-tools-2008.01.23-74039/lib/stubs/shared/Makefile.in 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/stubs/shared/Makefile.in 2008-10-13 08:02:15.000000000 +0100 @@ -0,0 +1,537 @@ +# 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 2008 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/stubs/shared +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)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +LTLIBRARIES = $(noinst_LTLIBRARIES) +libStubs_la_LIBADD = +am_libStubs_la_OBJECTS = stub-config.lo stub-log.lo stub-warning.lo \ + stub-user-msg.lo stub-user-panic.lo +libStubs_la_OBJECTS = $(am_libStubs_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 = $(libStubs_la_SOURCES) +DIST_SOURCES = $(libStubs_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_XLIBS = @COMMON_XLIBS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ +DNET_LIBS = @DNET_LIBS@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ +GTK_LIBS = @GTK_LIBS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ +HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ +MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ +RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ +VERSION = @VERSION@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +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@ +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@ +lt_ECHO = @lt_ECHO@ +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 = libStubs.la +libStubs_la_SOURCES = ../stub-config.c ../stub-log.c ../stub-warning.c \ + ../stub-user-msg.c ../stub-user-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/stubs/shared/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu lib/stubs/shared/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 +libStubs.la: $(libStubs_la_OBJECTS) $(libStubs_la_DEPENDENCIES) + $(LINK) $(libStubs_la_OBJECTS) $(libStubs_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stub-config.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stub-log.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stub-user-msg.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stub-user-panic.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stub-warning.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 $@ $< + +stub-config.lo: ../stub-config.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT stub-config.lo -MD -MP -MF $(DEPDIR)/stub-config.Tpo -c -o stub-config.lo `test -f '../stub-config.c' || echo '$(srcdir)/'`../stub-config.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/stub-config.Tpo $(DEPDIR)/stub-config.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../stub-config.c' object='stub-config.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o stub-config.lo `test -f '../stub-config.c' || echo '$(srcdir)/'`../stub-config.c + +stub-log.lo: ../stub-log.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT stub-log.lo -MD -MP -MF $(DEPDIR)/stub-log.Tpo -c -o stub-log.lo `test -f '../stub-log.c' || echo '$(srcdir)/'`../stub-log.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/stub-log.Tpo $(DEPDIR)/stub-log.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../stub-log.c' object='stub-log.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o stub-log.lo `test -f '../stub-log.c' || echo '$(srcdir)/'`../stub-log.c + +stub-warning.lo: ../stub-warning.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT stub-warning.lo -MD -MP -MF $(DEPDIR)/stub-warning.Tpo -c -o stub-warning.lo `test -f '../stub-warning.c' || echo '$(srcdir)/'`../stub-warning.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/stub-warning.Tpo $(DEPDIR)/stub-warning.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../stub-warning.c' object='stub-warning.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o stub-warning.lo `test -f '../stub-warning.c' || echo '$(srcdir)/'`../stub-warning.c + +stub-user-msg.lo: ../stub-user-msg.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT stub-user-msg.lo -MD -MP -MF $(DEPDIR)/stub-user-msg.Tpo -c -o stub-user-msg.lo `test -f '../stub-user-msg.c' || echo '$(srcdir)/'`../stub-user-msg.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/stub-user-msg.Tpo $(DEPDIR)/stub-user-msg.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../stub-user-msg.c' object='stub-user-msg.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o stub-user-msg.lo `test -f '../stub-user-msg.c' || echo '$(srcdir)/'`../stub-user-msg.c + +stub-user-panic.lo: ../stub-user-panic.c +@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT stub-user-panic.lo -MD -MP -MF $(DEPDIR)/stub-user-panic.Tpo -c -o stub-user-panic.lo `test -f '../stub-user-panic.c' || echo '$(srcdir)/'`../stub-user-panic.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/stub-user-panic.Tpo $(DEPDIR)/stub-user-panic.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../stub-user-panic.c' object='stub-user-panic.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) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o stub-user-panic.lo `test -f '../stub-user-panic.c' || echo '$(srcdir)/'`../stub-user-panic.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: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/stubs/stub-config.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/stubs/stub-config.c --- open-vm-tools-2008.01.23-74039/lib/stubs/stub-config.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/stubs/stub-config.c 2008-10-13 08:01:52.000000000 +0100 @@ -0,0 +1,79 @@ +/********************************************************* + * Copyright (C) 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. + * + *********************************************************/ + +/* + * stub-config.c -- + * + * Stubs for lib/config. + * + */ + +#include "vm_assert.h" +#include "config.h" +#include "preference.h" + + +Bool +Config_GetBool(Bool defaultValue, + const char *fmt, + ...) +{ + return defaultValue; +} + + +int32 +Config_GetLong(int32 defaultValue, + const char *fmt, + ...) +{ + return defaultValue; +} + + +char * +Config_GetString(const char *defaultValue, + const char *fmt, ...) +{ + return (char *) defaultValue; +} + + +Bool +Preference_GetBool(Bool defaultValue, + const char *name) +{ + return defaultValue; +} + + +char * +Preference_GetString(const char *defaultValue, + const char *name) +{ + return (char *) defaultValue; +} + + +char * +Preference_GetPathName(const char *defaultValue, + const char *fmt) +{ + return (char *) defaultValue; +} + diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/stubs/stub-log.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/stubs/stub-log.c --- open-vm-tools-2008.01.23-74039/lib/stubs/stub-log.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/stubs/stub-log.c 2008-10-13 08:01:52.000000000 +0100 @@ -0,0 +1,72 @@ +/********************************************************* + * Copyright (C) 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. + * + *********************************************************/ + +/* + * stub-log.c -- + * + * Stub for lib/log. + * + */ + +#include +#include "str.h" + + +/* + * XXX: the check is a hack to work around stupid libraries, like + * bora/lib/install, that provide implementations for only some of + * the functions of the real library, but not all. + */ +#if !defined(NO_LOG_STUB) +void +Log(const char *fmt, + ...) +{ + char *str; + va_list args; + + va_start(args, fmt); + str = Str_Vasprintf(NULL, fmt, args); + if (str != NULL) { + fputs(str, stderr); + } + va_end(args); +} +#endif + + +void +Log_DisableThrottling(void) +{ + +} + + +const char * +Log_GetFileName(void) +{ + return NULL; +} + + +void +Log_SetAlwaysKeep(Bool alwaysKeep) +{ + +} + diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/stubs/stub-user-msg.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/stubs/stub-user-msg.c --- open-vm-tools-2008.01.23-74039/lib/stubs/stub-user-msg.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/stubs/stub-user-msg.c 2008-10-13 08:01:52.000000000 +0100 @@ -0,0 +1,78 @@ +/********************************************************* + * Copyright (C) 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. + * + *********************************************************/ + +/* + * stub-user-msg.c -- + * + * Stubs for Msg_* functions in lib/user. + * + */ + +#include "vm_assert.h" +#include "msg.h" +#include "str.h" + + +void +Msg_Append(const char *fmt, + ...) +{ + static char buf[1000]; + + va_list args; + va_start(args, fmt); + Str_Vsnprintf(buf, sizeof buf, fmt, args); + va_end(args); + + Warning("Msg_Append: %s\n", buf); +} + + +void +Msg_Post(MsgSeverity severity, + const char *idFmt, ...) +{ + NOT_IMPLEMENTED(); +} + + +unsigned int +Msg_Question(Msg_String const *buttons, + int defaultAnswer, + char const *fmt, + ...) +{ + static char buf[1000]; + + va_list args; + va_start(args, fmt); + Str_Vsnprintf(buf, sizeof buf, fmt, args); + va_end(args); + + Warning("Msg_Question: %s\n", buf); + + return (unsigned int) defaultAnswer; +} + + +void +Msg_Reset(Bool log) +{ + NOT_IMPLEMENTED(); +} + diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/stubs/stub-user-panic.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/stubs/stub-user-panic.c --- open-vm-tools-2008.01.23-74039/lib/stubs/stub-user-panic.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/stubs/stub-user-panic.c 2008-10-13 08:01:52.000000000 +0100 @@ -0,0 +1,48 @@ +/********************************************************* + * Copyright (C) 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. + * + *********************************************************/ + +/* + * stub-user-panic.c -- + * + * Stubs for Panic_* functions in lib/user. + * + */ + +#include +#include + +#include "vmware.h" +#include "panic.h" +#include "str.h" + + +void +Panic_PostPanicMsg(const char *fmt, ...) +{ + char *str; + va_list args; + + va_start(args, fmt); + str = Str_Vasprintf(NULL, fmt, args); + va_end(args); + + if (str != NULL) { + fputs(str, stderr); + } +} + diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/stubs/stub-warning.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/stubs/stub-warning.c --- open-vm-tools-2008.01.23-74039/lib/stubs/stub-warning.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/stubs/stub-warning.c 2008-10-13 08:01:52.000000000 +0100 @@ -0,0 +1,44 @@ +/********************************************************* + * Copyright (C) 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. + * + *********************************************************/ + +/* + * stub-warning.c -- + * + * Stub for Warning(). + * + */ + +#include +#include "str.h" + + +void +Warning(const char *fmt, ...) +{ + char *str; + va_list args; + + va_start(args, fmt); + str = Str_Vasprintf(NULL, fmt, args); + va_end(args); + + if (str != NULL) { + fputs(str, stderr); + } +} + diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/sync/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/sync/Makefile.am --- open-vm-tools-2008.01.23-74039/lib/sync/Makefile.am 2008-01-28 08:02:50.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/sync/Makefile.am 2008-10-13 08:01:48.000000000 +0100 @@ -21,8 +21,5 @@ libSync_a_SOURCES += syncMutex.c libSync_a_SOURCES += syncWaitQPosix.c -AM_CFLAGS = -AM_CFLAGS += @COMMON_CFLAGS@ - SUBDIRS = SUBDIRS += shared diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/sync/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/sync/Makefile.in --- open-vm-tools-2008.01.23-74039/lib/sync/Makefile.in 2008-01-28 08:03:05.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/sync/Makefile.in 2008-10-13 08:02:15.000000000 +0100 @@ -52,7 +52,10 @@ subdir = lib/sync DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +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)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -64,7 +67,7 @@ am_libSync_a_OBJECTS = syncMutex.$(OBJEXT) syncWaitQPosix.$(OBJEXT) libSync_a_OBJECTS = $(am_libSync_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp +depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -100,8 +103,6 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -COMMON_CFLAGS = @COMMON_CFLAGS@ -COMMON_PROG_CFLAGS = @COMMON_PROG_CFLAGS@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -112,45 +113,57 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ -ECHO = @ECHO@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GREP = @GREP@ -GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_AUTH_CFLAGS = @LIB_AUTH_CFLAGS@ -LIB_FILE_CFLAGS = @LIB_FILE_CFLAGS@ -LIB_HGFS_SERVER_CFLAGS = @LIB_HGFS_SERVER_CFLAGS@ -LIB_IMPERSONATE_CFLAGS = @LIB_IMPERSONATE_CFLAGS@ -LIB_MISC_CFLAGS = @LIB_MISC_CFLAGS@ -LIB_PROC_MGR_CFLAGS = @LIB_PROC_MGR_CFLAGS@ -LIB_STRING_CFLAGS = @LIB_STRING_CFLAGS@ -LIB_USER_CFLAGS = @LIB_USER_CFLAGS@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -158,27 +171,35 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ VERSION = @VERSION@ -VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -209,6 +230,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -225,7 +247,6 @@ top_srcdir = @top_srcdir@ noinst_LIBRARIES = libSync.a libSync_a_SOURCES = syncMutex.c syncWaitQPosix.c -AM_CFLAGS = @COMMON_CFLAGS@ SUBDIRS = shared all: all-recursive diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/sync/shared/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/sync/shared/Makefile.am --- open-vm-tools-2008.01.23-74039/lib/sync/shared/Makefile.am 2008-01-28 08:02:50.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/sync/shared/Makefile.am 2008-10-13 08:01:48.000000000 +0100 @@ -20,6 +20,3 @@ libSync_la_SOURCES = libSync_la_SOURCES += ../syncMutex.c libSync_la_SOURCES += ../syncWaitQPosix.c - -AM_CFLAGS = -AM_CFLAGS += @COMMON_CFLAGS@ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/sync/shared/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/sync/shared/Makefile.in --- open-vm-tools-2008.01.23-74039/lib/sync/shared/Makefile.in 2008-01-28 08:03:05.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/sync/shared/Makefile.in 2008-10-13 08:02:15.000000000 +0100 @@ -52,7 +52,10 @@ subdir = lib/sync/shared DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +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)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -62,7 +65,7 @@ am_libSync_la_OBJECTS = syncMutex.lo syncWaitQPosix.lo libSync_la_OBJECTS = $(am_libSync_la_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp +depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -88,8 +91,6 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -COMMON_CFLAGS = @COMMON_CFLAGS@ -COMMON_PROG_CFLAGS = @COMMON_PROG_CFLAGS@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -100,45 +101,57 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ -ECHO = @ECHO@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GREP = @GREP@ -GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_AUTH_CFLAGS = @LIB_AUTH_CFLAGS@ -LIB_FILE_CFLAGS = @LIB_FILE_CFLAGS@ -LIB_HGFS_SERVER_CFLAGS = @LIB_HGFS_SERVER_CFLAGS@ -LIB_IMPERSONATE_CFLAGS = @LIB_IMPERSONATE_CFLAGS@ -LIB_MISC_CFLAGS = @LIB_MISC_CFLAGS@ -LIB_PROC_MGR_CFLAGS = @LIB_PROC_MGR_CFLAGS@ -LIB_STRING_CFLAGS = @LIB_STRING_CFLAGS@ -LIB_USER_CFLAGS = @LIB_USER_CFLAGS@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -146,27 +159,35 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ VERSION = @VERSION@ -VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -197,6 +218,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -213,7 +235,6 @@ top_srcdir = @top_srcdir@ noinst_LTLIBRARIES = libSync.la libSync_la_SOURCES = ../syncMutex.c ../syncWaitQPosix.c -AM_CFLAGS = @COMMON_CFLAGS@ all: all-am .SUFFIXES: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/sync/syncMutex.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/sync/syncMutex.c --- open-vm-tools-2008.01.23-74039/lib/sync/syncMutex.c 2008-01-28 08:02:51.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/sync/syncMutex.c 2008-10-13 08:01:52.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -120,12 +120,12 @@ WaitOnLocalSemaphore(that->semaphoreHandle); #else #if defined(VMX86_DEVEL) -#define RETRY_TIMEOUT_MS -1 // Infinite time out to catch bug #23716 (devel) +#define RETRY_TIMEOUT_MS (-1) // Infinite time out to catch bug #23716 (devel) #else #define RETRY_TIMEOUT_MS 5000 // Workaround for bug #23716 #endif - int handle; + PollDevHandle handle; ASSERT(that); @@ -263,3 +263,31 @@ return lck; } + + +#if !defined(N_PLAT_NLM) +/* + *----------------------------------------------------------------------------- + * + * SyncMutex_Trylock -- + * + * Tries to lock the mutex. Returns without blocking. + * + * Results: + * TRUE if the mutex was locked, FALSE otherwise. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +Bool +SyncMutex_Trylock(SyncMutex *that) +{ + ASSERT(that); + + return Atomic_ReadIfEqualWrite(&that->unlocked, TRUE, FALSE); +} +#endif + diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/sync/syncWaitQPosix.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/sync/syncWaitQPosix.c --- open-vm-tools-2008.01.23-74039/lib/sync/syncWaitQPosix.c 2008-01-28 08:02:51.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/sync/syncWaitQPosix.c 2008-10-13 08:01:52.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #ifdef __APPLE__ @@ -33,7 +34,9 @@ #include "vm_assert.h" #include "str.h" +#include "util.h" #include "syncWaitQ.h" +#include "posix.h" /* @@ -106,8 +109,6 @@ * */ -#define WAITQ_MAX_NAME (WAITQ_MAX_PATH + 40) - typedef union { uint32 fd[2]; uint64 i64; @@ -116,8 +117,7 @@ static INLINE Bool SyncWaitQWakeUpNamed(SyncWaitQ *that); static INLINE Bool SyncWaitQWakeUpAnon(SyncWaitQ *that); -static INLINE void SyncWaitQMakeName(const char *path, uint64 seq, - char name[], size_t nameSize); +static INLINE char *SyncWaitQMakeName(const char *path, uint64 seq); #if __APPLE__ @@ -307,11 +307,11 @@ char const *path) // IN/OPT { ASSERT(that); - ASSERT(!path || path[0] ); + ASSERT(!path || path[0]); memset(that, 0, sizeof(SyncWaitQ)); - if( !path ) { + if (!path) { /* * Anonymous */ @@ -335,13 +335,13 @@ } Atomic_Write64(&that->rwHandles, rwHandles.i64); - + that->pathName = NULL; } else { /* * Named */ - strncpy(that->path, path, sizeof that->path); + that->pathName = Util_SafeStrdup(path); } that->initialized = TRUE; @@ -371,7 +371,7 @@ return; } - if (!that->path[0]) { + if (that->pathName == NULL) { /* * Anonymous */ @@ -395,11 +395,14 @@ * Named */ uint64 seq; - char name[WAITQ_MAX_NAME]; - + char *name; + seq = Atomic_Read64(&that->seq); - SyncWaitQMakeName(that->path, seq, name, sizeof name); - unlink(name); + name = SyncWaitQMakeName(that->pathName, seq); + Posix_Unlink(name); + free(name); + free(that->pathName); + that->pathName = NULL; } that->initialized = FALSE; @@ -422,12 +425,12 @@ *----------------------------------------------------------------------------- */ -int +PollDevHandle SyncWaitQ_Add(SyncWaitQ *that) // IN { uint64 seq; int ret = -1; - char name[WAITQ_MAX_NAME]; + char *name = NULL; ASSERT(that); ASSERT(that->initialized); @@ -445,7 +448,7 @@ * has changed, we manufacture our own fd, so any error is harmless. */ - if (!that->path[0]) { + if (that->pathName == NULL) { /* * Anonymous */ @@ -479,7 +482,7 @@ * Named */ - SyncWaitQMakeName(that->path, seq, name, sizeof name); + name = SyncWaitQMakeName(that->pathName, seq); /* * Create fifo object with the generated name @@ -493,7 +496,7 @@ * directory. -- Ticho. */ - ret = mkfifo(name, S_IRUSR | S_IWUSR); + ret = Posix_Mkfifo(name, S_IRUSR | S_IWUSR); if (ret >= 0 || errno == EEXIST) { /* * We open in non-blocking mode so that we won't block if nobody @@ -510,7 +513,7 @@ * -- Ticho. */ - ret = open(name, O_RDONLY | O_NONBLOCK); + ret = Posix_Open(name, O_RDONLY | O_NONBLOCK); if (ret < 0) { SyncWaitQPanicOnFdLimit(errno); } @@ -527,13 +530,14 @@ if (ret >= 0) { close(ret); - if (that->path[0]) { - unlink(name); + if (that->pathName != NULL) { + Posix_Unlink(name); } } if (pipe(fd) < 0) { SyncWaitQPanicOnFdLimit(errno); + free(name); return -1; } @@ -541,6 +545,7 @@ fcntl(fd[1], F_SETFL, O_WRONLY | O_NONBLOCK) < 0 ) { close(fd[0]); close(fd[1]); + free(name); return -1; } @@ -558,6 +563,7 @@ close(fd[1]); } else { if (ret < 0) { + free(name); return -1; } @@ -589,6 +595,8 @@ Atomic_Write(&that->waiters, TRUE); } + free(name); + return ret; } @@ -612,8 +620,8 @@ */ Bool -SyncWaitQ_Remove(SyncWaitQ *that, // Unused - int handle) // IN +SyncWaitQ_Remove(SyncWaitQ *that, // Unused + PollDevHandle handle) // IN { ASSERT(that); if (!that->initialized) { @@ -669,9 +677,8 @@ * Slow path --hpreg */ - return that->path[0] ? - SyncWaitQWakeUpNamed(that) : - SyncWaitQWakeUpAnon(that); + return (that->pathName == NULL) ? SyncWaitQWakeUpAnon(that) : + SyncWaitQWakeUpNamed(that); } @@ -692,7 +699,7 @@ *---------------------------------------------------------------------------- */ -Bool +static Bool SyncWaitQWakeUpAnon(SyncWaitQ *that) // IN { HandlesAsI64 rwHandles, wakeupHandles; @@ -759,18 +766,18 @@ *---------------------------------------------------------------------------- */ -Bool +static Bool SyncWaitQWakeUpNamed(SyncWaitQ *that) // IN { uint64 seq; - char name[WAITQ_MAX_NAME]; + char *name; int wakeupHandle = -1; int ret; int error; // The following statement is the demarcation line for wakeup seq = Atomic_FetchAndInc64(&that->seq); - SyncWaitQMakeName(that->path, seq, name, sizeof name); + name = SyncWaitQMakeName(that->pathName, seq); /* * We open in non-blocking mode so that we won't block if there is @@ -779,9 +786,11 @@ * system call. */ - wakeupHandle = open(name, O_WRONLY | O_NONBLOCK); + wakeupHandle = Posix_Open(name, O_WRONLY | O_NONBLOCK); error = errno; - unlink(name); + Posix_Unlink(name); + free(name); + if (wakeupHandle < 0) { SyncWaitQPanicOnFdLimit(error); @@ -830,11 +839,9 @@ *---------------------------------------------------------------------- */ -void +static char * SyncWaitQMakeName(const char *path, // IN - uint64 seq, // IN - char name[], // OUT - size_t nameSize) // OUT + uint64 seq) // IN { - Str_Snprintf(name, nameSize, "%s.%"FMT64"x", path, seq); + return Str_SafeAsprintf(NULL, "%s.%"FMT64"x", path, seq); } diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/syncDriver/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/syncDriver/Makefile.am --- open-vm-tools-2008.01.23-74039/lib/syncDriver/Makefile.am 2008-01-28 08:02:49.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/syncDriver/Makefile.am 2008-10-13 08:01:48.000000000 +0100 @@ -19,6 +19,3 @@ libSyncDriver_a_SOURCES = libSyncDriver_a_SOURCES += syncDriverPosix.c - -AM_CFLAGS = -AM_CFLAGS += @COMMON_CFLAGS@ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/syncDriver/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/syncDriver/Makefile.in --- open-vm-tools-2008.01.23-74039/lib/syncDriver/Makefile.in 2008-01-28 08:03:05.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/syncDriver/Makefile.in 2008-10-13 08:02:15.000000000 +0100 @@ -52,7 +52,10 @@ subdir = lib/syncDriver DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +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)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -64,7 +67,7 @@ am_libSyncDriver_a_OBJECTS = syncDriverPosix.$(OBJEXT) libSyncDriver_a_OBJECTS = $(am_libSyncDriver_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp +depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -90,8 +93,6 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -COMMON_CFLAGS = @COMMON_CFLAGS@ -COMMON_PROG_CFLAGS = @COMMON_PROG_CFLAGS@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -102,45 +103,57 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ -ECHO = @ECHO@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GREP = @GREP@ -GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_AUTH_CFLAGS = @LIB_AUTH_CFLAGS@ -LIB_FILE_CFLAGS = @LIB_FILE_CFLAGS@ -LIB_HGFS_SERVER_CFLAGS = @LIB_HGFS_SERVER_CFLAGS@ -LIB_IMPERSONATE_CFLAGS = @LIB_IMPERSONATE_CFLAGS@ -LIB_MISC_CFLAGS = @LIB_MISC_CFLAGS@ -LIB_PROC_MGR_CFLAGS = @LIB_PROC_MGR_CFLAGS@ -LIB_STRING_CFLAGS = @LIB_STRING_CFLAGS@ -LIB_USER_CFLAGS = @LIB_USER_CFLAGS@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -148,27 +161,35 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ VERSION = @VERSION@ -VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -199,6 +220,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -215,7 +237,6 @@ top_srcdir = @top_srcdir@ noinst_LIBRARIES = libSyncDriver.a libSyncDriver_a_SOURCES = syncDriverPosix.c -AM_CFLAGS = @COMMON_CFLAGS@ all: all-am .SUFFIXES: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/syncDriver/syncDriverPosix.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/syncDriver/syncDriverPosix.c --- open-vm-tools-2008.01.23-74039/lib/syncDriver/syncDriverPosix.c 2008-01-28 08:02:50.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/syncDriver/syncDriverPosix.c 2008-10-13 08:01:51.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -175,14 +175,12 @@ file = open(SYNC_PROC_PATH, O_RDONLY); if (file == -1) { - SyncDriverDebug("can't open driver proc node"); return FALSE; } ret = ioctl(file, SYNC_IOC_QUERY, &active); if (ret == -1) { active = 0; - SyncDriverDebug("SYNC_IOC_QUERY ioctl failed"); } close(file); diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/system/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/system/Makefile.am --- open-vm-tools-2008.01.23-74039/lib/system/Makefile.am 2008-01-28 08:02:49.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/system/Makefile.am 2008-10-13 08:01:48.000000000 +0100 @@ -18,6 +18,3 @@ noinst_LIBRARIES = libSystem.a libSystem_a_SOURCES = systemLinux.c - -AM_CFLAGS = -AM_CFLAGS += @COMMON_CFLAGS@ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/system/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/system/Makefile.in --- open-vm-tools-2008.01.23-74039/lib/system/Makefile.in 2008-01-28 08:03:05.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/system/Makefile.in 2008-10-13 08:02:15.000000000 +0100 @@ -52,7 +52,10 @@ subdir = lib/system DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +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)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -64,7 +67,7 @@ am_libSystem_a_OBJECTS = systemLinux.$(OBJEXT) libSystem_a_OBJECTS = $(am_libSystem_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp +depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -90,8 +93,6 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -COMMON_CFLAGS = @COMMON_CFLAGS@ -COMMON_PROG_CFLAGS = @COMMON_PROG_CFLAGS@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -102,45 +103,57 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ -ECHO = @ECHO@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GREP = @GREP@ -GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_AUTH_CFLAGS = @LIB_AUTH_CFLAGS@ -LIB_FILE_CFLAGS = @LIB_FILE_CFLAGS@ -LIB_HGFS_SERVER_CFLAGS = @LIB_HGFS_SERVER_CFLAGS@ -LIB_IMPERSONATE_CFLAGS = @LIB_IMPERSONATE_CFLAGS@ -LIB_MISC_CFLAGS = @LIB_MISC_CFLAGS@ -LIB_PROC_MGR_CFLAGS = @LIB_PROC_MGR_CFLAGS@ -LIB_STRING_CFLAGS = @LIB_STRING_CFLAGS@ -LIB_USER_CFLAGS = @LIB_USER_CFLAGS@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -148,27 +161,35 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ VERSION = @VERSION@ -VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -199,6 +220,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -215,7 +237,6 @@ top_srcdir = @top_srcdir@ noinst_LIBRARIES = libSystem.a libSystem_a_SOURCES = systemLinux.c -AM_CFLAGS = @COMMON_CFLAGS@ all: all-am .SUFFIXES: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/system/systemLinux.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/system/systemLinux.c --- open-vm-tools-2008.01.23-74039/lib/system/systemLinux.c 2008-01-28 08:02:50.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/system/systemLinux.c 2008-10-13 08:01:51.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -26,12 +26,7 @@ * */ -#ifndef VMX86_DEVEL - -#endif - - -#if !defined(__linux__) && !defined(__FreeBSD__) && !defined(sun) +#if !defined(__linux__) && !defined(__FreeBSD__) && !defined(sun) && !defined(__APPLE__) # error This file should not be compiled #endif @@ -41,10 +36,15 @@ #include #include #include +#include +#include #include #include #include #include +#if !defined(__APPLE__) +#include +#endif #ifdef sun # include #endif @@ -65,6 +65,11 @@ #include "vm_assert.h" #include "system.h" #include "debug.h" +#include "posix.h" +#include "unicode.h" +#include "dynbuf.h" +#include "hashTable.h" +#include "strutil.h" #define MAX_IFACES 4 #define LOOPBACK "lo" @@ -72,6 +77,52 @@ #define INET_ADDRSTRLEN 16 #endif +/* + * The interval between two ticks (in usecs) can only be altered by 10%, + * and the default value is 10000. So the values 900000L and 1000000L + * divided by USER_HZ, which is 100. + */ +#ifdef __linux__ +# define USER_HZ 100 /* from asm/param.h */ +# define TICK_INCR_NOMINAL (1000000L / USER_HZ) /* nominal tick increment */ +# define TICK_INCR_MAX (1100000L / USER_HZ) /* maximum tick increment */ +# define TICK_INCR_MIN (900000L / USER_HZ) /* minimum tick increment */ +#endif + + +/* + * Data types + */ + +/* + * DynBuf container used by SNEForEachCallback. + * + * The SNE prefix is short for "System Native Environ". + */ + +typedef struct { + DynBuf *nativeEnvironStrings; // FOO=BARBAZ=BOOM + DynBuf *nativeEnvironOffsets; // off_ts relative to nativeEnvironStrings->data +} SNEBufs; + + +/* + * Local function prototypes + */ + + +/* + * "System Native Environ" (SNE) helpers. + */ +static HashTable *SNEBuildHash(const char **nativeEnviron); +static const char **SNEHashToEnviron(HashTable *environTable); +static int SNEForEachCallback(const char *key, void *value, void *clientData); + + +/* + * Global functions + */ + /* * System_Uptime -- @@ -93,6 +144,7 @@ * Side effects: * None * + *---------------------------------------------------------------------- */ uint64 @@ -135,11 +187,9 @@ * the guest OS. * * Results: - * * TRUE/FALSE: success/failure * * Side effects: - * * None. * *---------------------------------------------------------------------- @@ -168,18 +218,216 @@ /* *---------------------------------------------------------------------- * + * System_EnableTimeSlew -- + * + * Slew the clock so that the time difference is covered within + * the timeSyncPeriod. timeSyncPeriod is the interval of the time + * sync loop and we intend to catch up delta us. + * + * timeSyncPeriod is ignored on FreeBSD and Solaris. + * + * Results: + * TRUE/FALSE: success/failure + * + * Side effects: + * This changes the tick frequency and hence needs to be reset + * after the time sync is achieved. + * + *---------------------------------------------------------------------- + */ + +Bool +System_EnableTimeSlew(int64 delta, // IN: Time difference in us + uint32 timeSyncPeriod) // IN: Time interval in 100th of a second +{ +#if defined(__FreeBSD__) || defined(sun) + + struct timeval tx; + struct timeval oldTx; + int error; + + tx.tv_sec = delta / 1000000L; + tx.tv_usec = delta % 1000000L; + + error = adjtime(&tx, &oldTx); + if (error) { + Log("%s: adjtime failed\n", __FUNCTION__); + return FALSE; + } + Log("%s: time slew start.\n", __FUNCTION__); + return TRUE; + +#elif defined(__linux__) /* For Linux. */ + + struct timex tx; + int error; + uint64 tick; + uint64 timeSyncPeriodUS = timeSyncPeriod * 10000L; + + ASSERT(timeSyncPeriod); + + /* + * Set the tick so that delta time is corrected in timeSyncPeriod period. + * tick is the number of microseconds added per clock tick. We adjust this + * so that we get the desired delta + the timeSyncPeriod in timeSyncPeriod + * interval. + */ + tx.modes = ADJ_TICK; + tick = (timeSyncPeriodUS + delta) / ((timeSyncPeriod / 100) * USER_HZ); + if (tick > TICK_INCR_MAX) { + tick = TICK_INCR_MAX; + } else if (tick < TICK_INCR_MIN) { + tick = TICK_INCR_MIN; + } + tx.tick = tick; + + error = adjtimex(&tx); + if (error == -1) { + Log("%s: adjtimex failed: %d %s\n", __FUNCTION__, error, strerror(errno)); + return FALSE; + } + Log("%s: time slew start: %ld\n", __FUNCTION__, tx.tick); + return TRUE; + +#else /* Apple */ + + return FALSE; + +#endif +} + + +/* + *---------------------------------------------------------------------- + * + * System_DisableTimeSlew -- + * + * Disable time slewing, setting the tick frequency to default. + * + * Results: + * TRUE/FALSE: success/failure + * + * Side effects: + * If failed to disable the tick frequency, system time will + * not reflect the actual time - will be behind. + * + *---------------------------------------------------------------------- + */ + +Bool +System_DisableTimeSlew(void) +{ +#if defined(__FreeBSD__) || defined(sun) + + struct timeval tx = {0}; + int error; + + error = adjtime(&tx, NULL); + if (error) { + Log("%s: adjtime failed\n", __FUNCTION__); + return FALSE; + } + return TRUE; + +#elif defined(__linux__) /* For Linux. */ + + struct timex tx; + int error; + + tx.modes = ADJ_TICK; + tx.tick = TICK_INCR_NOMINAL; + + error = adjtimex(&tx); + if (error == -1) { + Log("%s: adjtimex failed: %d %s\n", __FUNCTION__, error, + strerror(errno)); + return FALSE; + } + Log("%s: time slew end - %d\n", __FUNCTION__, error); + return TRUE; + +#else /* Apple */ + return TRUE; + +#endif +} + + +/* + *---------------------------------------------------------------------- + * + * System_IsTimeSlewEnabled -- + * + * Returns TRUE if time slewing has been enabled. + * + * Results: + * TRUE/FALSE: enabled/disabled + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +Bool +System_IsTimeSlewEnabled(void) +{ +#if defined(__FreeBSD__) || defined(sun) + + struct timeval oldTx; + int error; + + /* + * Solaris needs first argument non-NULL and zero + * to get the old timeval value. + */ +#if defined(sun) + struct timeval tx = {0}; + error = adjtime(&tx, &oldTx); +#else + error = adjtime(NULL, &oldTx); +#endif + if (error) { + Log("%s: adjtime failed: %s.\n", __FUNCTION__, strerror(errno)); + return FALSE; + } + return ((oldTx.tv_sec || oldTx.tv_usec) ? TRUE : FALSE); + +#elif defined(__linux__) /* For Linux. */ + + struct timex tx = {0}; + int error; + + error = adjtimex(&tx); + if (error == -1) { + Log("%s: adjtimex failed: %d %s\n", __FUNCTION__, error, + strerror(errno)); + return FALSE; + } + return ((tx.tick == TICK_INCR_NOMINAL) ? FALSE : TRUE); + +#else /* Apple */ + + return FALSE; + +#endif +} + + +/* + *---------------------------------------------------------------------- + * * System_AddToCurrentTime -- * * Adjust the current system time by adding the given number of * seconds & milliseconds. * * Results: - * * TRUE/FALSE: success/failure * * Side effects: - * - * None. + * This function disables any time slewing to correctly set the guest + * time. * *---------------------------------------------------------------------- */ @@ -189,14 +437,18 @@ int64 deltaUsecs) // IN { struct timeval tv; + int64 newTime; int64 secs; int64 usecs; - int64 newTime; if (!System_GetCurrentTime(&secs, &usecs)) { return FALSE; } + if (System_IsTimeSlewEnabled()) { + System_DisableTimeSlew(); + } + newTime = (secs + deltaSecs) * 1000000L + (usecs + deltaUsecs); ASSERT(newTime > 0); @@ -226,6 +478,82 @@ /* + *----------------------------------------------------------------------------- + * + * System_GetTimeAsString -- + * + * Returns the current time as a formatted string, useful for prepending + * to debugging output. + * + * For example: "Oct 05 18:03:24.948: " + * + * Results: + * On success, allocates and returns a string containing the formatted + * time. + * On failure, returns NULL. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +Unicode +System_GetTimeAsString(void) +{ + struct timeval tv; + time_t sec; + int msec; + size_t charsWritten; + size_t bufSize = 8; // Multiplied by 2 for the initial allocation. + char *buf = NULL; + Unicode dateTime = NULL; + Unicode output = NULL; + + if (gettimeofday(&tv, NULL)) { + goto out; + } + sec = tv.tv_sec; + msec = tv.tv_usec / 1000; + + /* + * Loop repeatedly trying to format the time into a buffer, doubling the + * buffer with each failure. This should be safe as the manpage for + * strftime(3) seems to suggest that it only fails if the buffer isn't large + * enough. + * + * The resultant string is encoded according to the current locale. + */ + do { + char *newBuf; + bufSize *= 2; + + newBuf = realloc(buf, bufSize); + if (newBuf == NULL) { + goto out; + } + buf = newBuf; + charsWritten = strftime(buf, bufSize, "%b %d %H:%M:%S", localtime(&sec)); + } while (charsWritten == 0); + + /* + * Append the milliseconds field, but only after converting the date/time + * string from encoding specified in the current locale to an opaque type. + */ + dateTime = Unicode_Alloc(buf, STRING_ENCODING_DEFAULT); + if (dateTime == NULL) { + goto out; + } + output = Unicode_Format("%s.%03d: ", dateTime, msec); + + out: + free(buf); + Unicode_Free(dateTime); + return output; +} + + +/* *---------------------------------------------------------------------- * * System_IsACPI -- @@ -233,12 +561,10 @@ * Is this an ACPI system? * * Results: - * * TRUE if this is an ACPI system. * FALSE if this is not an ACPI system. * * Side effects: - * * None. * *---------------------------------------------------------------------- @@ -283,19 +609,47 @@ cmd = "shutdown -h now"; #endif } - system(cmd); + if (system(cmd) == -1) { + fprintf(stderr, "Unable to execute %s command: \"%s\"\n", + reboot ? "reboot" : "shutdown", cmd); + } } +/* + *----------------------------------------------------------------------------- + * + * System_IsUserAdmin -- + * + * On Windows this functions checks if the calling user has membership in + * the Administrators group (for NT platforms). On POSIX machines, we simply + * check if the user's effective UID is root. + * + * Return value: + * TRUE if the user has an effective UID of root. + * FALSE if not. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +Bool +System_IsUserAdmin(void) +{ + return geteuid() == 0; +} + /* *---------------------------------------------------------------------- * * System_GetEnv -- - * + * Read environment variables. * * Results: - * A copy of the string + * A copy of the environment variable encoded in UTF-8. * * Side effects: * None. @@ -305,14 +659,14 @@ char * System_GetEnv(Bool global, // IN - char *valueName) // IN + char *valueName) // IN: UTF-8 { char *result; #if defined(sun) result = NULL; #else - result = getenv(valueName); + result = Posix_Getenv(valueName); #endif if (NULL != result) { @@ -344,13 +698,634 @@ int System_SetEnv(Bool global, // IN - char *valueName, // IN - char *value) // IN + char *valueName, // IN: UTF-8 + char *value) // IN: UTF-8 { #if defined(sun) return(-1); #else - return(setenv(valueName, value, 1)); + return Posix_Setenv(valueName, value, 1); #endif } // System_SetEnv + +/* + *---------------------------------------------------------------------- + * + * System_UnsetEnv -- + * + * Unset environment variable. + * + * Results: + * 0 if success, -1 otherwise. + * + * Side effects: + * Unsets the environment variable. + * + *---------------------------------------------------------------------- + */ + +int +System_UnsetEnv(const char *valueName) // IN: UTF-8 +{ +#if defined(sun) + return(-1); +#else + Posix_Unsetenv(valueName); + return 0; +#endif +} // System_UnsetEnv + + +/* + *---------------------------------------------------------------------- + * + * System_SetLDPath -- + * + * Set LD_LIBRARY_PATH. If native is TRUE, use VMWARE_LD_LIBRARY_PATH + * as the value (and ignore the path argument, which should be set to + * NULL in this case). If native is FALSE, use the passed in path (and + * if that path is NULL, unsetenv the value). + * + * Results: + * The previous value of the environment variable. The caller is + * responsible for calling free() on this pointer. + * + * Side effects: + * Manipulates the value of LD_LIBRARY_PATH variable. + * + *---------------------------------------------------------------------- + */ + +char * +System_SetLDPath(const char *path, // IN: UTF-8 + const Bool native) // IN: If TRUE, ignore path and use VMware value +{ + char *vmldpath = NULL; + char *tmppath = NULL; + char *oldpath; + + ASSERT(!native || path == NULL); + + /* + * Get the original LD_LIBRARY_PATH, so the installed applications + * don't try to use our versions of the libraries. + * + * From bora/apps/lib/lui/browser.cc::ResetEnvVars(): + * + * For each variable we care about, there are three possible states: + * 1) The variable was not considered for saving. + * This is indicated by VMWARE_'s first character not being + * set to either "1" or "0". + * We should not manipulate . + * 2) The variable was considered but was not set. + * VMWARE_ is set to "0". + * We should unset . + * 3) The variable was considered and was set. + * VMWARE_ is set to "1" + "". + * We should set back to the saved value. + * + * XXX: There are other variables that may need resetting (for a list, check + * bora/apps/lib/lui/browser.cc or the wrapper scripts), but that would + * require some more refactoring of this code (not using system(3), for + * example). + */ + oldpath = System_GetEnv(TRUE, "LD_LIBRARY_PATH"); + if (native == TRUE) { + char *p = NULL; + vmldpath = tmppath = System_GetEnv(TRUE, "VMWARE_LD_LIBRARY_PATH"); + if (vmldpath && strlen(vmldpath) && vmldpath[0] == '1') { + vmldpath++; + } else { + vmldpath = p = Util_SafeStrdup(""); + } + if (System_SetEnv(TRUE, "LD_LIBRARY_PATH", vmldpath) == -1) { + Debug("%s: failed to set LD_LIBRARY_PATH\n", __FUNCTION__); + } + free(tmppath); + free(p); + } else if (path) { + /* + * Set LD_LIBRARY_PATH to the specified value. + */ + System_SetEnv(TRUE, "LD_LIBRARY_PATH", (char *) path); + } else { + System_UnsetEnv("LD_LIBRARY_PATH"); + } + return oldpath; +} // System_SetLDPath + + +/* + *----------------------------------------------------------------------------- + * + * System_WritePidfile -- + * + * Write a PID into a pidfile. + * + * Originally from the POSIX guestd as GuestdWritePidfile. + * + * Return value: + * TRUE on success + * FALSE on failure (detail is displayed on stderr) + * + * Side effects: + * This function is not thread-safe. May display error messages on + * stderr. + * + *----------------------------------------------------------------------------- + */ + +static Bool +System_WritePidfile(char const *fileName, // IN: Path where we'll write pid + pid_t pid) // IN: C'mon, really? +{ + FILE *pidFile; + Bool success = FALSE; + + pidFile = fopen(fileName, "w+"); + if (pidFile == NULL) { + fprintf(stderr, "Unable to open the \"%s\" PID file: %s.\n\n", fileName, + strerror(errno)); + + return FALSE; + } + + if (fprintf(pidFile, "%"FMTPID"\n", pid) < 0) { + fprintf(stderr, "Unable to write the \"%s\" PID file: %s.\n\n", fileName, + strerror(errno)); + } else { + success = TRUE; + } + + if (fclose(pidFile)) { + fprintf(stderr, "Unable to close the \"%s\" PID file: %s.\n\n", fileName, + strerror(errno)); + + return FALSE; + } + + return success; +} + + +/* + *----------------------------------------------------------------------------- + * + * System_Daemon -- + * + * Analog to daemon(3), but optionally guarantees child's PID is written + * to a pidfile before the parent exits. + * + * Originally from the short-lived Mac OS guestd, as Mac OS X does not + * provide daemon(3). Additionally, the "optionally guaranteed pidfile" + * concept is another motivation for this function. + * + * Results: + * TRUE on success. + * FALSE on any failure (e.g., fork, setsid, WritePidfile, etc.) + * + * Side effects: + * Parent will exit if fork() succeeds. + * Caller is expected to be able to catch SIGPIPE. + * + *----------------------------------------------------------------------------- + */ + +Bool +System_Daemon(Bool nochdir, + // IN: If TRUE, will -not- chdir("/"). + Bool noclose, + // IN: If TRUE, will -not- redirect stdin, stdout, and stderr + // to /dev/null. + const char *pidFile) + // IN: If non-NULL, will write the child's PID to this file. +{ + int fds[2]; + pid_t child; + char buf; + + if (pipe(fds) == -1) { + fprintf(stderr, "pipe failed: %s\n", strerror(errno)); + return FALSE; + } + + child = fork(); + if (child == -1) { + fprintf(stderr, "fork failed: %s\n", strerror(errno)); + return FALSE; + } + + if (child) { /* Parent */ + ssize_t actual; + + /* Close unused write end of the pipe. */ + close(fds[1]); + + /* + * Wait for the child to finish its critical initialization before the + * parent exits. + */ + do { + actual = read(fds[0], &buf, sizeof buf); + } while (actual == -1 && errno == EINTR); + + if (actual == -1) { + fprintf(stderr, "read from pipe failed: %s\n", strerror(errno)); + _exit(EXIT_FAILURE); + } + + _exit(EXIT_SUCCESS); + } else { /* Child */ + /* Close unused read end of the pipe. */ + close(fds[0]); + + /* + * The parent's caller might want to kill the child as soon as the + * parent exits, so better guarantee that by that time the child's PID + * has been written to the PID file. + * + * Note that because the parent knows the child's PID, the parent + * could do this if needed. But because the parent cannot do the + * setsid() below, the child might as well do both things here. + */ + if (pidFile) { + if (!System_WritePidfile(pidFile, getpid())) { + goto kidfail; + } + } + + /* + * The parent's caller might want to destroy the session as soon as + * the parent exits, so better guarantee that by that time the child + * has created its own new session. + */ + if (setsid() == -1) { + fprintf(stderr, "setsid failed: %s\n", strerror(errno)); + goto kidfail; + } + + /* + * The child has finished its critical initialization. Notify the + * parent that it can exit. + * + * We are writing the first byte to the pipe. This cannot possibly + * block (otherwise communication over a pipe would be impossible). + * Consequently it cannot be interrupted by a signal either. + * + * See pipe(7) for more information. + * + * The caller registered a signal handler for SIGPIPE, right?! We + * won't treat EPIPE as an error, because we'd like to carry on with + * our own life, even if our parent -did- abandon us. ;_; + */ + if (write(fds[1], &buf, sizeof buf) == -1) { + fprintf(stderr, "write failed: %s\n", strerror(errno)); + close(fds[1]); + return FALSE; + } + close(fds[1]); + + if (!nochdir && (chdir("/") == -1)) { + fprintf(stderr, "chdir failed: %s\n", strerror(errno)); + return FALSE; + } + + if (!noclose) { + /* + * The child has finished its initialization, and does not need to + * output anything to stderr anymore. Re-assign all standard file + * file descriptors. + */ + int nullFd; + + nullFd = open("/dev/null", O_RDWR); + if (nullFd == -1) { + fprintf(stderr, "open of /dev/null failed: %s\n", + strerror(errno)); + return FALSE; + } + + if ((dup2(nullFd, STDIN_FILENO) == -1) || + (dup2(nullFd, STDOUT_FILENO) == -1) || + (dup2(nullFd, STDERR_FILENO) == -1)) { + fprintf(stderr, "dup2 failed: %s\n", strerror(errno)); + close(nullFd); + return FALSE; + } + } + } + + return TRUE; + +kidfail: + close(fds[1]); + return FALSE; +} + + +/* + *----------------------------------------------------------------------------- + * + * System_GetNativeEnviron -- + * + * Returns a copy of the native / unwrapped environment. + * + * VMware's compatibility library wrappers override certain environment + * variables to make use of shipped libraries. This creates the + * "compatibility environment". Overridden variables are saved into + * corresponding VMWARE_-prefixed variables. This routine recreates the + * "native environment" by restoring VMWARE_-prefixed variable values to + * their native equivalents. + * + * Every value created by the wrapper begins with a 1 or 0 to indicate + * whether the value was set in the native environment. Based on this: + * VMWARE_FOO="1foo" -> FOO="foo" + * VMWARE_FOO="1" -> FOO="" + * VMWARE_FOO="0" -> FOO is unset in the native environment + * + * Variables without the VMWARE_ prefix are just copied over to the new + * environment. Note, of course, that VMWARE_-prefixed variables take + * precedence. (I.e., when we encounter a VMWARE_ prefix, we'll + * unconditionally record the value. For all other variables, we'll + * copy only if that variable had not already been set.) + * + * Results: + * An array of strings representing the native environment. (I.e., + * use it as you would environ(7).) NB: Memory allocation failures + * are considered fatal. + * + * Side effects: + * This routine allocates memory. It's up to the caller to free it by + * passing the returned value to System_FreeNativeEnviron. + * + * This routine assumes that keys will show up in environ only once each. + * + *----------------------------------------------------------------------------- + */ + +const char ** +System_GetNativeEnviron(const char **compatEnviron) + // IN: original "compatibility" environment +{ + HashTable *environTable; + const char **nativeEnviron; + + environTable = SNEBuildHash(compatEnviron); + nativeEnviron = SNEHashToEnviron(environTable); + + HashTable_Free(environTable); + + return nativeEnviron; +} + + +/* + *----------------------------------------------------------------------------- + * + * System_FreeNativeEnviron -- + * + * Frees memory allocated by System_GetNativeEnviron. + * + * Results: + * Frees memory. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +void +System_FreeNativeEnviron(const char **nativeEnviron) + // IN: environment returned by System_GetNativeEnviron +{ + /* + * nativeEnviron is an array of strings, and all of the strings are located in a + * single contiguous buffer. This makes freeing both array and buffer easy. + */ + char *stringBuf = (char *)*nativeEnviron; + + free(stringBuf); + free(nativeEnviron); +} + + +/* + * Local functions + */ + + +/* + *----------------------------------------------------------------------------- + * + * SNEBuildHash -- + * + * Compile hash table of environment variables. See System_GetNativeEnviron + * for rules on precedence. + * + * Results: + * Pointer to populated hash table. This cannot fail, as any memory failures + * within the HashTable and StrUtil libraries are considered fatal. + * + * Side effects: + * Caller is responsible for freeing returned table with HashTable_Free. + * + *----------------------------------------------------------------------------- + */ + +static HashTable * +SNEBuildHash(const char **compatEnviron) + // IN: original "compatibility" environment +{ + HashTable *environTable; + const char **p; + + /* + * Number of buckets picked arbitrarily. We're more interested in having an + * associative array than raw table performance. + */ + environTable = HashTable_Alloc(64, HASH_STRING_KEY | HASH_FLAG_COPYKEY, free); + + for (p = compatEnviron; p && *p; p++) { + const size_t prefixLength = sizeof "VMWARE_" - 1; + char *key; + char *value; + unsigned int index; + + index = 0; + key = StrUtil_GetNextToken(&index, *p, "="); + if (!key) { + /* XXX Must empty environment variables still contain a '=' delimiter? */ + Debug("%s: Encountered environment entry without '='.\n", __func__); + continue; + } + + /* + * Copy the value beginning after the '=' delimiter (even if it's empty). + */ + ++index; + value = Util_SafeStrdup(&(*p)[index]); + + if (StrUtil_StartsWith(key, "VMWARE_") && + key[prefixLength] != '\0' && + (value[0] == '0' || value[0] == '1')) { + /* + * Okay, this appears to be one of the wrapper's variables, so let's + * figure out the original environment variable name (by just indexing + * past the prefix) and value (by indexing past the "was this variable + * in the native environment?" marker). + */ + char *realKey = &key[prefixLength]; + char *realValue = (value[0] == '0') ? NULL : Util_SafeStrdup(&value[1]); + HashTable_ReplaceOrInsert(environTable, realKey, realValue); + } else { + HashTable_LookupOrInsert(environTable, key, value); + } + + /* + * The hash table makes a copy of our key, and it takes ownership of inserted + * values (via our passed freeing function). So that means we're responsible + * for freeing 'key', but -not- 'value'. + */ + free(key); + } + + return environTable; +} + + +/* + *----------------------------------------------------------------------------- + * + * SNEHashToEnviron -- + * + * Builds up an array of strings representing a new environment based on + * the caller's hash table. + * + * Results: + * Pointer to the new environment. As memory allocation failures are + * considered fatal, this routine will not return NULL. + * + * Side effects: + * This is expected to be returned to System_GetNativeEnviron's caller, + * and s/he is to free it via System_FreeNativeEnviron. + * + *----------------------------------------------------------------------------- + */ + +static const char ** +SNEHashToEnviron(HashTable *environTable) // IN: +{ + DynBuf nativeEnvironOffsets; + DynBuf nativeEnvironStrings; + + SNEBufs anonBufs = { + .nativeEnvironStrings = &nativeEnvironStrings, + .nativeEnvironOffsets = &nativeEnvironOffsets, + }; + + const char **nativeEnviron; + off_t *offsetIter; + char *stringsBase; + + unsigned int numStrings; + unsigned int i; + + DynBuf_Init(&nativeEnvironStrings); + DynBuf_Init(&nativeEnvironOffsets); + + /* + * Write out strings and string offsets to the dynbufs. + */ + HashTable_ForEach(environTable, SNEForEachCallback, &anonBufs); + ASSERT_MEM_ALLOC(DynBuf_Trim(&nativeEnvironStrings)); + + /* + * Allocate final buffer to contain the string array. Include extra entry + * for terminator. + */ + numStrings = DynBuf_GetSize(&nativeEnvironOffsets) / sizeof *offsetIter; + nativeEnviron = Util_SafeCalloc(1 + numStrings, sizeof *nativeEnviron); + + stringsBase = DynBuf_Get(&nativeEnvironStrings); + offsetIter = DynBuf_Get(&nativeEnvironOffsets); + + for (i = 0; i < numStrings; i++, offsetIter++) { + nativeEnviron[i] = stringsBase + *offsetIter; + } + nativeEnviron[i] = NULL; + + /* + * Cleanup. + * + * Note the subtle difference in how these are handled: + * - The offsets are used only to build the array of strings, which is why that + * dynbuf is destroyed. + * - The buffer containing all of the environment strings, however, is persistent + * and is actually returned to the caller (indirectly via nativeEnviron). As + * such it's only detached from the DynBuf. + */ + DynBuf_Destroy(&nativeEnvironOffsets); + DynBuf_Detach(&nativeEnvironStrings); + + return nativeEnviron; +} + + +/* + *----------------------------------------------------------------------------- + * + * SNEForEachCallback -- + * + * Given a key (environment variable name) and value, appends a string of + * "key=value" to the nativeEnvironStrings DynBuf. Also appends a pointer + * to the new string to the nativeEnviron DynBuf. + * + * Results: + * Always zero. Memory allocation failures are considered fatal. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static int +SNEForEachCallback(const char *key, // IN: environment variable + void *value, // IN: environment value + void *clientData) // IN/OUT: DynBuf container (SNEBufs) +{ + DynBuf *nativeEnvironStrings = ((SNEBufs *)clientData)->nativeEnvironStrings; + DynBuf *nativeEnvironOffsets = ((SNEBufs *)clientData)->nativeEnvironOffsets; + size_t itemSize; + char *itemBuf; + off_t itemOffset; + + /* + * A NULL value indicates that this variable is not to be set. + */ + if (value == NULL) { + return 0; + } + + /* Determine the length of the new string inc. '=' delimiter and NUL. */ + itemSize = strlen(key) + strlen(value) + sizeof "="; + itemBuf = Util_SafeMalloc(itemSize); + + /* Create new "key=value" string. */ + snprintf(itemBuf, itemSize, "%s=%s", key, (char *)value); + + ASSERT_MEM_ALLOC(DynBuf_AppendString(nativeEnvironStrings, itemBuf)); + + /* + * Get the relative offset of our newly added string (relative to the DynBuf's base + * address), and then append that to nativeEnvironOffsets. + */ + itemOffset = DynBuf_GetSize(nativeEnvironStrings) - itemSize; + ASSERT_MEM_ALLOC(DynBuf_Append(nativeEnvironOffsets, &itemOffset, sizeof itemOffset)); + + free(itemBuf); + + return 0; +} diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/toolsLogger/logger.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/toolsLogger/logger.c --- open-vm-tools-2008.01.23-74039/lib/toolsLogger/logger.c 2008-01-28 08:02:50.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/toolsLogger/logger.c 2008-10-13 08:01:51.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/toolsLogger/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/toolsLogger/Makefile.am --- open-vm-tools-2008.01.23-74039/lib/toolsLogger/Makefile.am 2008-01-28 08:02:49.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/toolsLogger/Makefile.am 2008-10-13 08:01:48.000000000 +0100 @@ -19,6 +19,3 @@ libToolsLogger_a_SOURCES = libToolsLogger_a_SOURCES += logger.c - -AM_CFLAGS = -AM_CFLAGS += @COMMON_CFLAGS@ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/toolsLogger/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/toolsLogger/Makefile.in --- open-vm-tools-2008.01.23-74039/lib/toolsLogger/Makefile.in 2008-01-28 08:03:05.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/toolsLogger/Makefile.in 2008-10-13 08:02:16.000000000 +0100 @@ -52,7 +52,10 @@ subdir = lib/toolsLogger DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +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)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -64,7 +67,7 @@ am_libToolsLogger_a_OBJECTS = logger.$(OBJEXT) libToolsLogger_a_OBJECTS = $(am_libToolsLogger_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp +depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -90,8 +93,6 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -COMMON_CFLAGS = @COMMON_CFLAGS@ -COMMON_PROG_CFLAGS = @COMMON_PROG_CFLAGS@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -102,45 +103,57 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ -ECHO = @ECHO@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GREP = @GREP@ -GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_AUTH_CFLAGS = @LIB_AUTH_CFLAGS@ -LIB_FILE_CFLAGS = @LIB_FILE_CFLAGS@ -LIB_HGFS_SERVER_CFLAGS = @LIB_HGFS_SERVER_CFLAGS@ -LIB_IMPERSONATE_CFLAGS = @LIB_IMPERSONATE_CFLAGS@ -LIB_MISC_CFLAGS = @LIB_MISC_CFLAGS@ -LIB_PROC_MGR_CFLAGS = @LIB_PROC_MGR_CFLAGS@ -LIB_STRING_CFLAGS = @LIB_STRING_CFLAGS@ -LIB_USER_CFLAGS = @LIB_USER_CFLAGS@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -148,27 +161,35 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ VERSION = @VERSION@ -VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -199,6 +220,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -215,7 +237,6 @@ top_srcdir = @top_srcdir@ noinst_LIBRARIES = libToolsLogger.a libToolsLogger_a_SOURCES = logger.c -AM_CFLAGS = @COMMON_CFLAGS@ all: all-am .SUFFIXES: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/toolsLogger/toolsLoggerInt.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/toolsLogger/toolsLoggerInt.h --- open-vm-tools-2008.01.23-74039/lib/toolsLogger/toolsLoggerInt.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/toolsLogger/toolsLoggerInt.h 2008-10-13 08:01:51.000000000 +0100 @@ -0,0 +1,53 @@ +/********************************************************* + * Copyright (C) 2006 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. + * + *********************************************************/ + +/* + * toolsLoggerInt.h -- + * + * All-purpose logging facility. This header file contains + * declarations that are intended just to be seen internally. + * + */ + + +#ifndef __TOOLSLOGGERINT_H__ +# define __TOOLSLOGGERINT_H__ + + +/* + * Log sinks + */ +typedef enum { + TOOLSLOG_SINK_FILE, + TOOLSLOG_SINK_CONSOLE, + TOOLSLOG_SINK_SYSLOG, + TOOLSLOG_SINK_HOST, + TOOLSLOG_SINK_STDERR, + + TOOLSLOG_SINK_LAST /* Must be the last one */ +} ToolsLogSink; + + +/* + * Tools log file name + */ +#define CONFNAME_LOGFILE "log.file" +#define CONFVAL_LOGFILE_DEFAULT "vmware-tools.log" + + +#endif /* __TOOLSLOGGERINT_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/unicode/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/unicode/Makefile.am --- open-vm-tools-2008.01.23-74039/lib/unicode/Makefile.am 2008-01-28 08:02:50.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/unicode/Makefile.am 2008-10-13 08:01:48.000000000 +0100 @@ -17,12 +17,15 @@ noinst_LIBRARIES = libUnicode.a -libUnicode_a_SOURCES = +libUnicode_a_SOURCES = libUnicode_a_SOURCES += unicodeCommon.c libUnicode_a_SOURCES += unicodeSimpleBase.c +libUnicode_a_SOURCES += unicodeSimpleCaseFolding.c libUnicode_a_SOURCES += unicodeSimpleTypes.c libUnicode_a_SOURCES += unicodeSimpleOperations.c +libUnicode_a_SOURCES += unicodeSimpleTransforms.c libUnicode_a_SOURCES += unicodeStatic.c -AM_CFLAGS = -AM_CFLAGS += @COMMON_CFLAGS@ +if HAVE_ICU +libUnicode_a_SOURCES += unicodeICU.c +endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/unicode/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/unicode/Makefile.in --- open-vm-tools-2008.01.23-74039/lib/unicode/Makefile.in 2008-01-28 08:03:05.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/unicode/Makefile.in 2008-10-13 08:02:16.000000000 +0100 @@ -49,10 +49,14 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ +@HAVE_ICU_TRUE@am__append_1 = unicodeICU.c subdir = lib/unicode DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +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)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -61,12 +65,19 @@ ARFLAGS = cru libUnicode_a_AR = $(AR) $(ARFLAGS) libUnicode_a_LIBADD = +am__libUnicode_a_SOURCES_DIST = unicodeCommon.c unicodeSimpleBase.c \ + unicodeSimpleCaseFolding.c unicodeSimpleTypes.c \ + unicodeSimpleOperations.c unicodeSimpleTransforms.c \ + unicodeStatic.c unicodeICU.c +@HAVE_ICU_TRUE@am__objects_1 = unicodeICU.$(OBJEXT) am_libUnicode_a_OBJECTS = unicodeCommon.$(OBJEXT) \ - unicodeSimpleBase.$(OBJEXT) unicodeSimpleTypes.$(OBJEXT) \ - unicodeSimpleOperations.$(OBJEXT) unicodeStatic.$(OBJEXT) + unicodeSimpleBase.$(OBJEXT) unicodeSimpleCaseFolding.$(OBJEXT) \ + unicodeSimpleTypes.$(OBJEXT) unicodeSimpleOperations.$(OBJEXT) \ + unicodeSimpleTransforms.$(OBJEXT) unicodeStatic.$(OBJEXT) \ + $(am__objects_1) libUnicode_a_OBJECTS = $(am_libUnicode_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp +depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -78,7 +89,7 @@ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(libUnicode_a_SOURCES) -DIST_SOURCES = $(libUnicode_a_SOURCES) +DIST_SOURCES = $(am__libUnicode_a_SOURCES_DIST) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -92,8 +103,6 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -COMMON_CFLAGS = @COMMON_CFLAGS@ -COMMON_PROG_CFLAGS = @COMMON_PROG_CFLAGS@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -104,45 +113,57 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ -ECHO = @ECHO@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GREP = @GREP@ -GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_AUTH_CFLAGS = @LIB_AUTH_CFLAGS@ -LIB_FILE_CFLAGS = @LIB_FILE_CFLAGS@ -LIB_HGFS_SERVER_CFLAGS = @LIB_HGFS_SERVER_CFLAGS@ -LIB_IMPERSONATE_CFLAGS = @LIB_IMPERSONATE_CFLAGS@ -LIB_MISC_CFLAGS = @LIB_MISC_CFLAGS@ -LIB_PROC_MGR_CFLAGS = @LIB_PROC_MGR_CFLAGS@ -LIB_STRING_CFLAGS = @LIB_STRING_CFLAGS@ -LIB_USER_CFLAGS = @LIB_USER_CFLAGS@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -150,27 +171,35 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ VERSION = @VERSION@ -VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -201,6 +230,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -217,8 +247,9 @@ top_srcdir = @top_srcdir@ noinst_LIBRARIES = libUnicode.a libUnicode_a_SOURCES = unicodeCommon.c unicodeSimpleBase.c \ - unicodeSimpleTypes.c unicodeSimpleOperations.c unicodeStatic.c -AM_CFLAGS = @COMMON_CFLAGS@ + unicodeSimpleCaseFolding.c unicodeSimpleTypes.c \ + unicodeSimpleOperations.c unicodeSimpleTransforms.c \ + unicodeStatic.c $(am__append_1) all: all-am .SUFFIXES: @@ -267,8 +298,11 @@ -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unicodeCommon.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unicodeICU.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unicodeSimpleBase.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unicodeSimpleCaseFolding.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unicodeSimpleOperations.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unicodeSimpleTransforms.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unicodeSimpleTypes.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unicodeStatic.Po@am__quote@ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/unicode/unicodeCommon.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/unicode/unicodeCommon.c --- open-vm-tools-2008.01.23-74039/lib/unicode/unicodeCommon.c 2008-01-28 08:02:51.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/unicode/unicodeCommon.c 2008-10-13 08:01:52.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -55,17 +55,10 @@ }; -static char * UnicodeEscapeBuffer(const void *buffer, - ssize_t lengthInBytes, - StringEncoding encoding); -static Bool UnicodeSanityCheck(const void *buffer, - ssize_t lengthInBytes, - StringEncoding encoding); - /* *----------------------------------------------------------------------------- * - * UnicodeEscapeBuffer -- + * Unicode_EscapeBuffer -- * * Escape non-printable bytes of the buffer with \xAB, where 0xAB * is the non-printable byte value. @@ -81,34 +74,14 @@ */ char * -UnicodeEscapeBuffer(const void *buffer, // IN - ssize_t lengthInBytes, // IN - StringEncoding encoding) // IN +Unicode_EscapeBuffer(const void *buffer, // IN + ssize_t lengthInBytes, // IN + StringEncoding encoding) // IN { + encoding = Unicode_ResolveEncoding(encoding); + if (lengthInBytes == -1) { - switch (encoding) { - case STRING_ENCODING_UTF16: - case STRING_ENCODING_UTF16_LE: - case STRING_ENCODING_UTF16_BE: - lengthInBytes = Unicode_UTF16Strlen((const utf16_t *)buffer) * 2; - break; - case STRING_ENCODING_UTF32: - case STRING_ENCODING_UTF32_LE: - case STRING_ENCODING_UTF32_BE: - { - const uint32 *utf32 = (const uint32 *)buffer; - ssize_t numCodeUnits; - - for (numCodeUnits = 0; utf32[numCodeUnits]; numCodeUnits++) { - // Count the number of code units until we hit NUL. - } - - lengthInBytes = numCodeUnits * 4; - } - default: - lengthInBytes = strlen((const char *)buffer); - break; - } + lengthInBytes = Unicode_LengthInBytes(buffer, encoding); } /* @@ -144,19 +117,29 @@ ssize_t lengthInBytes, // IN StringEncoding encoding) // IN { + ASSERT(Unicode_IsEncodingValid(encoding)); + /* * Sanity check US-ASCII here, so we can fast-path its conversion * to Unicode later. */ + if (encoding == STRING_ENCODING_US_ASCII) { const uint8 *asciiBytes = (const uint8 *)buffer; - Bool nulTerminated = (lengthInBytes == -1); - ssize_t i; - for (i = 0; nulTerminated ? asciiBytes[i] : i < lengthInBytes; i++) { - if (asciiBytes[i] >= 0x80) { - return FALSE; - } + if (lengthInBytes == -1) { + for (; *asciiBytes != '\0'; asciiBytes++) { + if (*asciiBytes >= 0x80) { + return FALSE; + } + } + } else { + ssize_t i; + for (i = 0; i < lengthInBytes; i++) { + if (asciiBytes[i] >= 0x80) { + return FALSE; + } + } } } @@ -224,6 +207,60 @@ /* *----------------------------------------------------------------------------- * + * Unicode_LengthInBytes -- + * + * Compute the length in bytes of a string in a given encoding. + * + * Results: + * The number of bytes. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +ssize_t +Unicode_LengthInBytes(const void *buffer, // IN + StringEncoding encoding) // IN +{ + ssize_t len; + + encoding = Unicode_ResolveEncoding(encoding); + + switch (encoding) { + case STRING_ENCODING_UTF32_LE: + case STRING_ENCODING_UTF32_BE: + case STRING_ENCODING_UTF32_XE: + { + const int32 *p; + for (p = buffer; *p != 0; p++) { + } + len = (const char *) p - (const char *) buffer; + break; + } + case STRING_ENCODING_UTF16_LE: + case STRING_ENCODING_UTF16_BE: + case STRING_ENCODING_UTF16_XE: + { + const utf16_t *p; + for (p = buffer; *p != 0; p++) { + } + len = (const char *) p - (const char *) buffer; + break; + } + default: + // XXX assume 8-bit encoding with no embedded null + len = strlen(buffer); + } + + return len; +} + + +/* + *----------------------------------------------------------------------------- + * * Unicode_UTF16Strlen -- * * Gets the number of code units in NUL-terminated UTF-16 array. @@ -253,6 +290,43 @@ /* *----------------------------------------------------------------------------- * + * Unicode_UTF16Strdup -- + * + * Duplicates a UTF-16 string. + * + * Results: + * Returns an allocated copy of the input UTF-16 string. The caller + * is responsible for freeing it. + * + * Panics on failure. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +utf16_t * +Unicode_UTF16Strdup(const utf16_t *utf16) // IN: May be NULL. +{ + ssize_t numBytes; + utf16_t *copy; + + // Follow Util_SafeStrdup semantics. + if (utf16 == NULL) { + return NULL; + } + + numBytes = (Unicode_UTF16Strlen(utf16) + 1 /* NUL */) * sizeof *copy; + copy = Util_SafeMalloc(numBytes); + memcpy(copy, utf16, numBytes); + return copy; +} + + +/* + *----------------------------------------------------------------------------- + * * Unicode_AllocWithLength -- * * Allocates a new Unicode string given a buffer with both length @@ -262,17 +336,21 @@ * Otherwise, buffer must be of the specified length, but does * not need to be NUL-terminated. * + * If buffer is NULL, then NULL is returned. + * In this case, lengthInBytes must be 0 or -1, consistent with + * an empty string. + * * Note that regardless of the encoding of the buffer passed to this * function, the returned string can hold any Unicode characters. * * If the buffer contains an invalid sequence of the specified * encoding or memory could not be allocated, logs the buffer, - * ASSERTs and returns NULL (for non-debug builds). + * and panics. * * Results: * An allocated Unicode string containing the decoded characters - * in buffer, or NULL on failure. Caller must pass the string to - * Unicode_Free to free. + * in buffer, or NULL if input is NULL. + * Caller must pass the string to Unicode_Free to free. * * Side effects: * None @@ -285,56 +363,51 @@ ssize_t lengthInBytes, // IN StringEncoding encoding) // IN { - Unicode result = NULL; char *escapedBuffer; + Unicode result; ASSERT(lengthInBytes >= 0 || lengthInBytes == -1); - if (lengthInBytes < 0 && lengthInBytes != -1) { + if (buffer == NULL) { + ASSERT(lengthInBytes <= 0); return NULL; } - if (UnicodeSanityCheck(buffer, lengthInBytes, encoding)) { - result = UnicodeAllocInternal(buffer, lengthInBytes, encoding); + encoding = Unicode_ResolveEncoding(encoding); + if (lengthInBytes == -1) { + lengthInBytes = Unicode_LengthInBytes(buffer, encoding); } - if (result) { - // Success! We've allocated the Unicode string and can return. + result = UnicodeAllocInternal(buffer, lengthInBytes, encoding, FALSE); + if (result != NULL) { return result; } - // Failure. Log the buffer, ASSERT, and return (in non-debug builds). - escapedBuffer = UnicodeEscapeBuffer(buffer, - lengthInBytes, - encoding); + /* + * Log and panic on failure. + */ - Log("%s: Error: Couldn't convert invalid buffer [%s] from %s to Unicode.\n", + escapedBuffer = Unicode_EscapeBuffer(buffer, lengthInBytes, encoding); + Log("%s: Error: Couldn't convert invalid buffer [%s] " + "from %s to Unicode.\n", __FUNCTION__, escapedBuffer ? escapedBuffer : "(couldn't escape bytes)", Unicode_EncodingEnumToName(encoding)); - free(escapedBuffer); - - /* - * Invalid input bytes are fatal in debug builds. If you need - * to sanity check an input array for validity, call - * Unicode_IsBufferValid() before allocating this string. - */ - ASSERT(FALSE); - - return NULL; + PANIC(); } /* *----------------------------------------------------------------------------- * - * Unicode_IsBufferValid -- + * Unicode_CanGetBytesWithEncoding -- * - * Tests if the given buffer is valid in the specified encoding. + * Tests if the given Unicode string can be converted + * losslessly to the specified encoding. * * Results: - * TRUE if the buffer is valid, FALSE if it's not. + * TRUE if the string can be converted, FALSE if it cannot. * * Side effects: * None @@ -343,22 +416,17 @@ */ Bool -Unicode_IsBufferValid(const void *buffer, // IN - ssize_t lengthInBytes, // IN - StringEncoding encoding) // IN +Unicode_CanGetBytesWithEncoding(ConstUnicode ustr, // IN + StringEncoding encoding) // IN { - Unicode result; + void *tmp; - if (!UnicodeSanityCheck(buffer, lengthInBytes, encoding)) { - return FALSE; + if (ustr == NULL) { + return TRUE; } - - result = UnicodeAllocInternal(buffer, lengthInBytes, encoding); - - if (!result) { + if ((tmp = UnicodeGetAllocBytesInternal(ustr, encoding, -1, NULL)) == NULL) { return FALSE; - } else { - Unicode_Free(result); - return TRUE; } + free(tmp); + return TRUE; } diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/unicode/unicodeICU.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/unicode/unicodeICU.c --- open-vm-tools-2008.01.23-74039/lib/unicode/unicodeICU.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/unicode/unicodeICU.c 2008-10-13 08:01:53.000000000 +0100 @@ -0,0 +1,493 @@ +/********************************************************* + * Copyright (C) 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. + * + *********************************************************/ + +/* + * unicodeICU.c -- + * + * Unicode functionality that depends on the third-party ICU + * library. + */ + +#include +#include +#include +#include +#include + +#include "util.h" +#include "unicodeBase.h" +#include "unicodeICU.h" + + +/* + *----------------------------------------------------------------------------- + * + * Unicode_CompareWithLocale -- + * + * Compares two strings for equivalence under the collation rules + * of the specified locale. + * + * The caller can specify ignoring differences in accents, case, + * or punctuation. + * + * Results: + * -1 if str1 < str2, 0 if str1 == str2, 1 if str1 > str2. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +int +Unicode_CompareWithLocale(ConstUnicode str1, // IN + ConstUnicode str2, // IN + const char *locale, // IN + UnicodeCompareOption compareOption) // IN +{ + UCollationResult compareResult; + UColAttributeValue comparisonStrength; + UErrorCode status = U_ZERO_ERROR; + int result; + UCollator *coll; + UCharIterator str1Iter; + UCharIterator str2Iter; + + uiter_setUTF8(&str1Iter, (const char *)str1, -1); + uiter_setUTF8(&str2Iter, (const char *)str2, -1); + + switch (compareOption) { + case UNICODE_COMPARE_DEFAULT: + comparisonStrength = UCOL_DEFAULT; + break; + case UNICODE_COMPARE_IGNORE_ACCENTS: + comparisonStrength = UCOL_PRIMARY; + break; + case UNICODE_COMPARE_IGNORE_CASE: + comparisonStrength = UCOL_SECONDARY; + break; + case UNICODE_COMPARE_IGNORE_PUNCTUATION: + comparisonStrength = UCOL_TERTIARY; + break; + default: + NOT_IMPLEMENTED(); + } + + coll = ucol_open(locale, &status); + + ASSERT(U_SUCCESS(status)); + ASSERT(coll); + + if (U_FAILURE(status) || !coll) { + return -1; + } + + // Normalize all strings to NFD before comparing. + ucol_setAttribute(coll, UCOL_NORMALIZATION_MODE, UCOL_ON, &status); + ucol_setAttribute(coll, UCOL_STRENGTH, comparisonStrength, &status); + + ASSERT(U_SUCCESS(status)); + + compareResult = ucol_strcollIter(coll, &str1Iter, &str2Iter, &status); + + ucol_close(coll); + + if (U_FAILURE(status)) { + // We'll probably only get here if the input wasn't UTF-8. + ASSERT(U_SUCCESS(status)); + return -1; + } + + switch (compareResult) { + case UCOL_LESS: + result = -1; + break; + case UCOL_EQUAL: + result = 0; + break; + case UCOL_GREATER: + result = 1; + break; + default: + NOT_IMPLEMENTED(); + } + + return result; +} + + +/* + *----------------------------------------------------------------------------- + * + * Unicode_Normalize -- + * + * Creates a Unicode string by normalizing the input string + * into a Unicode normal form. + * + * Normalization Form C ("precomposed") ensures that accented + * characters use as few Unicode code points as possible. This + * form is often used on Windows and Linux hosts. + * + * Example: small letter e with acute -> U+00E9 + * + * Normalization Form D ("decomposed") ensures that accented + * characters (e with accent acute) use separate Unicode code + * points for the base letter and accents. This form is used on + * Mac OS hosts. + * + * Example: small letter e with acute -> U+0065 U+0301 + * + * Results: + * The allocated Unicode string, or NULL on failure. + * Caller must free with Unicode_Free(). + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +Unicode +Unicode_Normalize(ConstUnicode str, // IN + UnicodeNormalizationForm form) // IN +{ + UNormalizationMode mode; + UChar *uchars; + Unicode result; + int32_t normalizedLen; + UErrorCode status = U_ZERO_ERROR; + UCharIterator strIter; + UBool neededToNormalize = FALSE; + + uiter_setUTF8(&strIter, (const char *)str, -1); + + switch (form) { + case UNICODE_NORMAL_FORM_C: + mode = UNORM_NFC; + break; + case UNICODE_NORMAL_FORM_D: + mode = UNORM_NFD; + break; + default: + NOT_REACHED(); + } + + normalizedLen = unorm_next(&strIter, + NULL, + 0, + mode, + 0, + TRUE, + &neededToNormalize, + &status); + + if (U_FAILURE(status) && status != U_BUFFER_OVERFLOW_ERROR) { + // We expect U_BUFFER_OVERFLOW_ERROR here. Anything else is a problem. + ASSERT(U_SUCCESS(status)); + return NULL; + } + + uchars = Util_SafeMalloc(sizeof *uchars * normalizedLen); + + // Reset back to the beginning of the UTF-8 input. + (*strIter.move)(&strIter, 0, UITER_START); + + status = U_ZERO_ERROR; + normalizedLen = unorm_next(&strIter, + uchars, + normalizedLen, + mode, + 0, + TRUE, + &neededToNormalize, + &status); + + if (U_FAILURE(status)) { + ASSERT(U_SUCCESS(status)); + return NULL; + } + + result = Unicode_AllocWithLength(uchars, + normalizedLen * 2, + STRING_ENCODING_UTF16); + free(uchars); + + return result; +} + + +/* + *----------------------------------------------------------------------------- + * + * Unicode_ToLower -- + * + * Creates a Unicode string by lower-casing the input string using + * the rules of the specified locale. + * + * The resulting string may not be the same length as the input + * string. + * + * Pass NULL for the locale to use the process's default locale. + * + * Results: + * The allocated Unicode string, or NULL on failure. + * Caller must free with Unicode_Free(). + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +Unicode +Unicode_ToLower(ConstUnicode str, // IN + const char *locale) // IN +{ + UCaseMap *caseMap; + UErrorCode status = U_ZERO_ERROR; + char *utf8Dest; + const char *utf8Src = (const char *)str; + int32_t utf8SrcLen = strlen(utf8Src); + int32_t destCapacity = utf8SrcLen + 1; + int32_t destLen; + Unicode result = NULL; + + /* + * XXX TODO: This and the two following functions are substantially + * identical. Refactor them! (Note that ucasemap_utf8ToTitle + * takes a non-const UCaseMap, so we can't just use pointers to + * functions unless we cast.) + */ + + // Most lower-case operations don't change the length of the string. + utf8Dest = (char *)Util_SafeMalloc(destCapacity); + + caseMap = ucasemap_open(locale, 0, &status); + if (U_FAILURE(status)) { + goto out; + } + + destLen = ucasemap_utf8ToLower(caseMap, + utf8Dest, + destCapacity, + utf8Src, + utf8SrcLen, + &status); + + if (status != U_BUFFER_OVERFLOW_ERROR) { + goto out; + } + + // If we need a bigger buffer, then reallocate and retry. + destCapacity = destLen + 1; + utf8Dest = (char *)Util_SafeRealloc(utf8Dest, destCapacity); + + status = U_ZERO_ERROR; + destLen = ucasemap_utf8ToLower(caseMap, + utf8Dest, + destCapacity, + utf8Src, + utf8SrcLen, + &status); + + out: + ucasemap_close(caseMap); + + if (U_SUCCESS(status) && status != U_STRING_NOT_TERMINATED_WARNING) { + result = (Unicode)utf8Dest; + } else { + ASSERT(U_SUCCESS(status)); + ASSERT(status != U_STRING_NOT_TERMINATED_WARNING); + } + + return result; +} + + +/* + *----------------------------------------------------------------------------- + * + * Unicode_ToUpper -- + * + * Creates a Unicode string by upper-casing the input string using + * the rules of the specified locale. + * + * The resulting string may not be the same length as the input + * string. + * + * Pass NULL for the locale to use the process's default locale. + * + * Results: + * The allocated Unicode string, or NULL on failure. + * Caller must free with Unicode_Free(). + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +Unicode +Unicode_ToUpper(ConstUnicode str, // IN + const char *locale) // IN +{ + UCaseMap *caseMap; + UErrorCode status = U_ZERO_ERROR; + char *utf8Dest; + const char *utf8Src = (const char *)str; + int32_t utf8SrcLen = strlen(utf8Src); + int32_t destCapacity = utf8SrcLen + 1; + int32_t destLen; + Unicode result = NULL; + + // Most upper-case operations don't change the length of the string. + utf8Dest = (char *)Util_SafeMalloc(destCapacity); + + caseMap = ucasemap_open(locale, 0, &status); + if (U_FAILURE(status)) { + goto out; + } + + destLen = ucasemap_utf8ToUpper(caseMap, + utf8Dest, + destCapacity, + utf8Src, + utf8SrcLen, + &status); + + if (status != U_BUFFER_OVERFLOW_ERROR) { + goto out; + } + + // If we need a bigger buffer, then reallocate and retry. + destCapacity = destLen + 1; + utf8Dest = (char *)Util_SafeRealloc(utf8Dest, destCapacity); + + status = U_ZERO_ERROR; + destLen = ucasemap_utf8ToUpper(caseMap, + utf8Dest, + destCapacity, + utf8Src, + utf8SrcLen, + &status); + + out: + ucasemap_close(caseMap); + + if (U_SUCCESS(status) && status != U_STRING_NOT_TERMINATED_WARNING) { + result = (Unicode)utf8Dest; + } else { + ASSERT(U_SUCCESS(status)); + ASSERT(status != U_STRING_NOT_TERMINATED_WARNING); + } + + return result; +} + +/* + * "ucasemap_utf8ToTitle" is not in version 3.6 of the ICU library, + * which appears to be the default on many systems... + * + * XXX Currently HAVE_ICU_38 is only set by the open-source tools + * build (based on what it detects on the current system) because that + * is the only entity currently capable of compiling with USE_ICU. + */ + +#ifdef HAVE_ICU_38 + +/* + *----------------------------------------------------------------------------- + * + * Unicode_ToTitle -- + * + * Creates a Unicode string by title-casing the input string using + * the rules of the specified locale. + * + * The resulting string may not be the same length as the input + * string. + * + * Pass NULL for the locale to use the process's default locale. + * + * Results: + * The allocated Unicode string, or NULL on failure. + * Caller must free with Unicode_Free(). + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +Unicode +Unicode_ToTitle(ConstUnicode str, // IN + const char *locale) // IN +{ + UCaseMap *caseMap; + UErrorCode status = U_ZERO_ERROR; + char *utf8Dest; + const char *utf8Src = (const char *)str; + int32_t utf8SrcLen = strlen(utf8Src); + int32_t destCapacity = utf8SrcLen + 1; + int32_t destLen; + Unicode result = NULL; + + // Most title-case operations don't change the length of the string. + utf8Dest = (char *)Util_SafeMalloc(destCapacity); + + caseMap = ucasemap_open(locale, 0, &status); + if (U_FAILURE(status)) { + goto out; + } + + destLen = ucasemap_utf8ToTitle(caseMap, + utf8Dest, + destCapacity, + utf8Src, + utf8SrcLen, + &status); + + if (status != U_BUFFER_OVERFLOW_ERROR) { + goto out; + } + + // If we need a bigger buffer, then reallocate and retry. + destCapacity = destLen + 1; + utf8Dest = (char *)Util_SafeRealloc(utf8Dest, destCapacity); + + status = U_ZERO_ERROR; + destLen = ucasemap_utf8ToTitle(caseMap, + utf8Dest, + destCapacity, + utf8Src, + utf8SrcLen, + &status); + + out: + ucasemap_close(caseMap); + + if (U_SUCCESS(status) && status != U_STRING_NOT_TERMINATED_WARNING) { + result = (Unicode)utf8Dest; + } else { + ASSERT(U_SUCCESS(status)); + ASSERT(status != U_STRING_NOT_TERMINATED_WARNING); + } + + return result; +} + +#endif // HAVE_ICU_38 diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/unicode/unicodeInt.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/unicode/unicodeInt.h --- open-vm-tools-2008.01.23-74039/lib/unicode/unicodeInt.h 2008-01-28 08:02:51.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/unicode/unicodeInt.h 2008-10-13 08:01:52.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -34,13 +34,24 @@ Unicode UnicodeAllocInternal(const void *buffer, ssize_t lengthInBytes, - StringEncoding encoding); + StringEncoding encoding, + Bool strict); Unicode UnicodeAllocStatic(const char *asciiBytes, Bool unescape); void UnicodePinIndices(ConstUnicode str, UnicodeIndex *strStart, UnicodeIndex *strLength); +utf16_t UnicodeSimpleCaseFold(utf16_t codeUnit); + +void *UnicodeGetAllocBytesInternal(ConstUnicode src, + StringEncoding encoding, + ssize_t lengthInBytes, + size_t *retLength); + +Bool UnicodeSanityCheck(const void *buffer, + ssize_t lengthInBytes, + StringEncoding encoding); #ifdef __cplusplus } diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/unicode/unicodeSimpleBase.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/unicode/unicodeSimpleBase.c --- open-vm-tools-2008.01.23-74039/lib/unicode/unicodeSimpleBase.c 2008-01-28 08:02:51.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/unicode/unicodeSimpleBase.c 2008-10-13 08:01:52.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -23,17 +23,7 @@ * containing NUL-terminated UTF-8 bytes as the typedef for * Unicode. * - * This implementation is a short-term shim to start work on the - * Unicode development project, and to introduce people to the - * lib/unicode interface without requiring them to change all - * layers of calling code. - * - * It does not generically handle all encodings; if an encoding - * that is not US-ASCII, UTF-8, UTF-16, or UTF-16 LE is passed to - * any function, then the process-default encoding is used instead. - * - * Basic Unicode string creation, encoding conversion, and - * access to cached UTF-8 and UTF-16 representations. + * Basic Unicode string creation and encoding conversion. * * The thread-safety of ConstUnicode functions is the same as * that for standard const char * functions: multiple threads can @@ -44,29 +34,23 @@ * ConstUnicode function on the same string. */ -#include "vmware.h" +#include +#include "vmware.h" #include "util.h" #include "codeset.h" -#include "hash.h" #include "str.h" -#include "syncMutex.h" #include "unicodeBase.h" #include "unicodeInt.h" -// Initial number of buckets for the UTF-16 hash table. -static const uint32 UNICODE_UTF16_STRING_TABLE_BUCKETS = 4096; - /* * Padding for initial and final bytes used by an encoding. The value * comes from ICU's UCNV_GET_MAX_BYTES_FOR_STRING macro and accounts * for leading and trailing bytes and NUL. */ -static const size_t UNICODE_UTF16_CODE_UNITS_PADDING = 10; -static HashTable *UnicodeUTF16StringTable; -static Atomic_Ptr UnicodeUTF16StringTableLockStorage; +static const size_t UNICODE_UTF16_CODE_UNITS_PADDING = 10; /* @@ -81,11 +65,15 @@ * Otherwise, buffer must be of the specified length, but does * not need to be NUL-terminated. * - * Note that regardless of the encoding of the buffer passed to this - * function, the returned string can hold any Unicode characters. + * Return NULL on memory allocation failure. + * + * Return NULL if strict is true and the buffer contains an invalid + * sequence in the specified encoding. * - * If the buffer contains an invalid sequence of the specified - * encoding or memory could not be allocated, returns NULL. + * If strict is false, then an invalid sequence is replaced by + * a substitution character, which is either the Unicode + * substitution character (U+FFFD or \xef\xbf\xbd in UTF-8) + * or subchar1 (ASCII SUB or control-z, value 0x1a). * * Results: * An allocated Unicode string containing the decoded characters @@ -101,42 +89,30 @@ Unicode UnicodeAllocInternal(const void *buffer, // IN ssize_t lengthInBytes, // IN - StringEncoding encoding) // IN + StringEncoding encoding, // IN + Bool strict) // IN { char *utf8Result = NULL; + ASSERT(buffer != NULL); + ASSERT(lengthInBytes >= 0); + ASSERT(Unicode_IsEncodingValid(encoding)); + + if (!strict) { + CodeSet_GenericToGeneric(Unicode_EncodingEnumToName(encoding), + buffer, lengthInBytes, + "UTF-8", CSGTG_TRANSLIT, &utf8Result, NULL); + return utf8Result; + } + switch (encoding) { case STRING_ENCODING_US_ASCII: - /* - * Fall through and treat as a special case of UTF-8. - * Unicode_AllocWithLength() has already ensured we've gotten - * only 7-bit bytes in 'buffer'. - */ case STRING_ENCODING_UTF8: - { - char *utf16Str; - const char *utf8Str = (const char *)buffer; - - if (lengthInBytes == -1) { - lengthInBytes = strlen(utf8Str); - } - - // Ensure the input is valid UTF-8. - if (CodeSet_Utf8ToUtf16le(utf8Str, - lengthInBytes, - &utf16Str, - NULL)) { - free(utf16Str); - utf8Result = Util_SafeStrndup(utf8Str, lengthInBytes); - } - break; + if (Unicode_IsBufferValid(buffer, lengthInBytes, encoding)) { + utf8Result = Util_SafeStrndup(buffer, lengthInBytes); } - case STRING_ENCODING_UTF16: + break; case STRING_ENCODING_UTF16_LE: - if (lengthInBytes == -1) { - lengthInBytes = Unicode_UTF16Strlen((const utf16_t *)buffer) * 2; - } - // utf8Result will be left NULL on failure. CodeSet_Utf16leToUtf8((const char *)buffer, lengthInBytes, @@ -144,24 +120,9 @@ NULL); break; default: - /* - * XXX TODO: This is not correct. We don't yet have a - * cross-platform library that can convert from an arbitrary - * encoding to UTF-8, so this is a stopgap measure to get us - * going in the meantime. - */ - if (lengthInBytes == -1) { - /* - * TODO: This doesn't work for UTF-16 BE, UTF-32, and other - * encodings with embedded NULs. - */ - lengthInBytes = strlen((const char *)buffer); - } - - CodeSet_CurrentToUtf8((const char *)buffer, - lengthInBytes, - &utf8Result, - NULL); + CodeSet_GenericToGeneric(Unicode_EncodingEnumToName(encoding), + buffer, lengthInBytes, + "UTF-8", 0, &utf8Result, NULL); break; } @@ -172,6 +133,59 @@ /* *----------------------------------------------------------------------------- * + * Unicode_IsBufferValid -- + * + * Tests if the given buffer is valid in the specified encoding. + * + * If lengthInBytes is -1, then buffer must be NUL-terminated. + * Otherwise, buffer must be of the specified length, but does + * not need to be NUL-terminated. + * + * This function should not be used for heuristic determination of + * encodings. Since the test looks for bit patterns in the buffer + * that are invalid in the specified encoding, negative results + * guarantee the buffer is not in the specified encoding, but positive + * results are inconclusive. Source buffers containing pure ASCII + * will pass all 8-bit encodings, and all source buffers will pass + * a windows-1252 test since win-1252 maps all 256 8-bit combinations. + * + * Results: + * TRUE if the buffer is valid, FALSE if it's not. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +Bool +Unicode_IsBufferValid(const void *buffer, // IN + ssize_t lengthInBytes, // IN + StringEncoding encoding) // IN +{ + if (buffer == NULL) { + ASSERT(lengthInBytes <= 0); + return TRUE; + } + + encoding = Unicode_ResolveEncoding(encoding); + + if (encoding == STRING_ENCODING_US_ASCII) { + return UnicodeSanityCheck(buffer, lengthInBytes, encoding); + } + + if (lengthInBytes == -1) { + lengthInBytes = Unicode_LengthInBytes(buffer, encoding); + } + + return CodeSet_Validate(buffer, lengthInBytes, + Unicode_EncodingEnumToName(encoding)); +} + + +/* + *----------------------------------------------------------------------------- + * * Unicode_Duplicate -- * * Allocates and returns a copy of the passed-in Unicode string. @@ -207,7 +221,7 @@ * None * * Side effects: - * Deletes the cached UTF-16 representation of the string if it's set. + * None * *----------------------------------------------------------------------------- */ @@ -215,125 +229,178 @@ void Unicode_Free(Unicode str) // IN { - char *utf8String = (char *)str; - SyncMutex *lck; + free(str); +} + + +/* + *----------------------------------------------------------------------------- + * + * Unicode_AllocList -- + * + * Allocates a list (actually a vector) of Unicode strings from a list + * (vector) of strings of specified encoding. + * 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 individual strings must be freed with Unicode_Free, + * or the entire list can be free with Unicode_FreeList. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +Unicode * +Unicode_AllocList(char **srcList, // IN: list of strings + ssize_t length, // IN: list + StringEncoding encoding) // IN: +{ + Unicode *dstList = NULL; + ssize_t i; + + ASSERT(srcList != NULL); - lck = SyncMutex_CreateSingleton(&UnicodeUTF16StringTableLockStorage); - SyncMutex_Lock(lck); + encoding = Unicode_ResolveEncoding(encoding); - if (UnicodeUTF16StringTable) { - Hash_Delete(UnicodeUTF16StringTable, utf8String); + if (length < 0) { + length = 0; + while (srcList[length] != NULL) { + length++; + } + + /* Include the sentinel element. */ + length++; } - SyncMutex_Unlock(lck); + dstList = Util_SafeMalloc(length * sizeof *dstList); + + for (i = 0; i < length; i++) { + dstList[i] = Unicode_Alloc(srcList[i], encoding); + } - free(utf8String); + return dstList; } /* *----------------------------------------------------------------------------- * - * Unicode_GetUTF8 -- + * Unicode_FreeList -- * - * Returns the contents of the string encoded as a NUL-terminated UTF-8 - * byte array. + * Free a list (actually a vector) of Unicode strings. + * The list (vector) itself is also freed. * - * Results: - * A NUL-terminated UTF-8 string; lifetime is valid until the next - * non-const Unicode function is called on the string. Caller should - * strdup if storing the return value long-term. + * The list either has a specified length or is + * argv-style NULL terminated (if length is negative). * - * Caller does not need to free; the memory is managed inside the - * Unicode object. + * Results: + * None * * Side effects: - * None + * errno or Windows last error is preserved. * *----------------------------------------------------------------------------- */ -const char * -Unicode_GetUTF8(ConstUnicode str) // IN +void +Unicode_FreeList(Unicode *list, // IN: the list to free + ssize_t length) // IN: the length { - return (const char *)str; + Util_FreeStringList(list, length); } /* *----------------------------------------------------------------------------- * - * Unicode_GetUTF16 -- + * Unicode_GetAllocList -- * - * Returns the contents of the string encoded as a NUL-terminated - * UTF-16 array in host byte order. + * Allocates a list (actually a vector) of NUL terminated buffers from a + * list (vector) of strings of specified encoding. + * The input list has a specified length or can be an argv-style + * NULL-terminated list (if length is negative). * * Results: - * A NUL-terminated UTF-16 string in host byte order; lifetime is - * valid until the next non-const Unicode function is called on - * the string. Caller should duplicate if storing the return value - * long-term. - * - * Caller does not need to free; the memory is managed inside the - * Unicode object. + * An allocated list (vector) of NUL terminated buffers, + * or NULL on conversion failure. + * The caller is responsible to free the memory allocated by + * this routine. * * Side effects: - * Creates UnicodeUTF16StringTable if it doesn't yet exist. - * If the string hasn't yet been converted to UTF-16, converts - * the string to UTF-16 and stores the result in - * UnicodeUTF16StringTable. + * None * *----------------------------------------------------------------------------- */ -const utf16_t * -Unicode_GetUTF16(ConstUnicode str) // IN +Unicode * +Unicode_GetAllocList(Unicode const srcList[], // IN: list of strings + ssize_t length, // IN: list + StringEncoding encoding) // IN: { - const char *utf8Str = (const char *)str; - utf16_t *utf16Str = NULL; - SyncMutex *lck; + Unicode *dstList = NULL; + ssize_t i; - lck = SyncMutex_CreateSingleton(&UnicodeUTF16StringTableLockStorage); - SyncMutex_Lock(lck); + ASSERT(srcList != NULL); - if (!UnicodeUTF16StringTable) { - /* - * We use HASH_INT_KEY so we can hash on the pointer value - * rather than the contents of the string. (This lets us simply - * delete the hashtable entry in Unicode_Free() without affecting - * other strings with the same content). - * - * If we want to consolidate all UTF-16 representations of - * identical strings that might have different pointer values, - * we can use a struct rather than storing utf16Str in the hash - * directly, and reference count the UTF-16 representations, - * freeing when the last reference is gone. - */ - UnicodeUTF16StringTable = Hash_Alloc(UNICODE_UTF16_STRING_TABLE_BUCKETS, - HASH_INT_KEY, - (HashFreeEntryFn)free); + encoding = Unicode_ResolveEncoding(encoding); + + if (length < 0) { + length = 0; + while (srcList[length] != NULL) { + length++; + } + + /* Include the sentinel element. */ + length++; } - /* - * TODO: In the current implementation (where Unicode is char *), - * we have no way of ensuring the caller doesn't manipulate the - * bytes in the input value after creating it. - * - * Until we make the type opaque, we must recreate the UTF-16 cache - * each time it's asked for. - */ - Hash_Delete(UnicodeUTF16StringTable, utf8Str); + dstList = Util_SafeMalloc(length * sizeof *dstList); - if (CodeSet_Utf8ToUtf16le(utf8Str, - strlen(utf8Str), - (char **)&utf16Str, - NULL)) { - Hash_Insert(UnicodeUTF16StringTable, utf8Str, utf16Str); + for (i = 0; i < length; i++) { + dstList[i] = Unicode_GetAllocBytes(srcList[i], encoding); + if (dstList[i] == NULL && srcList[i] != NULL) { + while (--i >= 0) { + free(dstList[i]); + } + free(dstList); + return NULL; + } } - SyncMutex_Unlock(lck); + return dstList; +} - return utf16Str; + +/* + *----------------------------------------------------------------------------- + * + * Unicode_GetUTF8 -- + * + * Returns the contents of the string encoded as a NUL-terminated UTF-8 + * byte array. + * + * Results: + * A NUL-terminated UTF-8 string; lifetime is valid until the next + * non-const Unicode function is called on the string. Caller should + * strdup if storing the return value long-term. + * + * Caller does not need to free; the memory is managed inside the + * Unicode object. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +const char * +Unicode_GetUTF8(ConstUnicode str) // IN +{ + return (const char *)str; } @@ -385,48 +452,89 @@ Unicode_BytesRequired(ConstUnicode str, // IN StringEncoding encoding) // IN { - const utf16_t *utf16; - size_t maxUTF16CodeUnitSize; + const uint8 *utf8 = (const uint8 *)str; + + // Number of bytes needed for a code point [U+0000, U+FFFF]. + size_t basicCodePointSize; + + // Number of bytes needed for a code point [U+10000, U+10FFFF]. + size_t supplementaryCodePointSize; + + size_t result = 0; + + encoding = Unicode_ResolveEncoding(encoding); switch (encoding) { + case STRING_ENCODING_UTF8: + return strlen((const char *)utf8) + 1; case STRING_ENCODING_US_ASCII: case STRING_ENCODING_ISO_8859_1: case STRING_ENCODING_WINDOWS_1252: // TODO: Lots more encodings can be added here. - maxUTF16CodeUnitSize = 1; + basicCodePointSize = supplementaryCodePointSize = 1; break; - case STRING_ENCODING_UTF8: - /* - * One UTF-16 code unit takes 3 bytes of UTF-8. Unicode code - * points > U+FFFF are encoded in two UTF-16 code units, and 4 - * bytes of UTF-8. 2*3 = 6 > 4, which gives us more than enough - * space to encode such a code point. - */ - maxUTF16CodeUnitSize = 3; - break; - case STRING_ENCODING_UTF16: case STRING_ENCODING_UTF16_LE: case STRING_ENCODING_UTF16_BE: - maxUTF16CodeUnitSize = 2; + case STRING_ENCODING_UTF16_XE: + basicCodePointSize = 2; + supplementaryCodePointSize = 4; break; - case STRING_ENCODING_UTF32: case STRING_ENCODING_UTF32_LE: case STRING_ENCODING_UTF32_BE: - maxUTF16CodeUnitSize = 4; + case STRING_ENCODING_UTF32_XE: + basicCodePointSize = 4; + supplementaryCodePointSize = 4; break; default: /* - * Assume the worst: ISO-2022-JP takes up to 7 bytes per UTF-16 - * code unit. + * Assume the worst: ISO-2022-JP takes up to 7 bytes per code point. */ - maxUTF16CodeUnitSize = 7; + basicCodePointSize = 7; + supplementaryCodePointSize = 7; break; } - // Accounts for leading and trailing bytes and NUL. - utf16 = Unicode_GetUTF16(str); - return (Unicode_UTF16Strlen(utf16) + UNICODE_UTF16_CODE_UNITS_PADDING) * - maxUTF16CodeUnitSize; + /* + * Do a simple check of how many bytes are needed to convert the + * UTF-8 to the target encoding. This doesn't do UTF-8 validity + * checking, but will not overrun the end of the buffer. + */ + while (*utf8) { + size_t utf8NumBytesRemaining; + + // Advance one code point forward in the UTF-8 input. + if (*utf8 <= 0x7F) { + utf8NumBytesRemaining = 1; + result += basicCodePointSize; + } else if (*utf8 & 0xC0) { + utf8NumBytesRemaining = 2; + result += basicCodePointSize; + } else if (*utf8 & 0xE0) { + utf8NumBytesRemaining = 3; + result += basicCodePointSize; + } else if (*utf8 & 0xF0) { + utf8NumBytesRemaining = 4; + result += supplementaryCodePointSize; + } else { + // Invalid input; nothing we can do. + break; + } + + while (*utf8 && utf8NumBytesRemaining) { + utf8NumBytesRemaining--; + utf8++; + } + + if (utf8NumBytesRemaining > 0) { + // Invalid input; nothing we can do. + break; + } + } + + // Add enough for NUL expressed in the target encoding. + result += UNICODE_UTF16_CODE_UNITS_PADDING * basicCodePointSize; + + return result; } @@ -440,13 +548,13 @@ * maxLengthInBytes bytes in total to the buffer. * * Results: - * Returns -1 if the Unicode string requires more than - * maxLengthInBytes bytes to be encoded in the specified - * encoding, including NUL termination. (Call - * Unicode_BytesRequired(str, encoding) to get the correct length.) - * - * Otherwise, returns the number of bytes written to buffer, not - * including the NUL termination. + * FALSE on conversion failure or if the Unicode string requires + * more than maxLengthInBytes bytes to be encoded in the specified + * encoding, including NUL termination. (Call + * Unicode_BytesRequired(str, encoding) to get the correct + * length.). Returns TRUE if no truncation was required. In + * either case, if retLength is not NULL, *retLength contains the + * number of bytes actually written to the buffer upon return. * * Side effects: * None @@ -454,62 +562,260 @@ *----------------------------------------------------------------------------- */ -ssize_t -Unicode_CopyBytes(ConstUnicode str, // IN - void *buffer, // OUT +Bool +Unicode_CopyBytes(void *destBuffer, // OUT + ConstUnicode srcBuffer, // IN size_t maxLengthInBytes, // IN + size_t *retLength, // OUT StringEncoding encoding) // IN { - const char *utf8Str = (const char *)str; - ssize_t ret = -1; + const char *utf8Str = (const char *)srcBuffer; + Bool success = FALSE; + size_t copyBytes = 0; + + encoding = Unicode_ResolveEncoding(encoding); switch (encoding) { case STRING_ENCODING_US_ASCII: + if (!UnicodeSanityCheck(utf8Str, -1, encoding)) { + break; + } + // fall through case STRING_ENCODING_UTF8: - Str_Strcpy((char *) buffer, utf8Str, maxLengthInBytes); - ret = strlen((const char *)buffer); + { + size_t len = strlen(utf8Str); + copyBytes = MIN(len, maxLengthInBytes - 1); + memcpy(destBuffer, utf8Str, copyBytes); + + /* + * If we truncated, force a null termination in a UTF-8 safe + * manner. + */ + if (copyBytes >= len) { + success = TRUE; + } else { + if (encoding == STRING_ENCODING_UTF8) { + copyBytes = + CodeSet_Utf8FindCodePointBoundary(destBuffer, copyBytes); + } + } + + ((char*)destBuffer)[copyBytes] = '\0'; + } break; - case STRING_ENCODING_UTF16: case STRING_ENCODING_UTF16_LE: { - size_t bytesNeeded; - const utf16_t *utf16; - UnicodeIndex length; - - utf16 = Unicode_GetUTF16(str); - length = Unicode_UTF16Strlen(utf16); - // Add 1 for NUL. - bytesNeeded = (length + 1) * 2; - - if (bytesNeeded <= maxLengthInBytes) { - memcpy(buffer, utf16, bytesNeeded); - ret = bytesNeeded; + char *utf16Buf; + size_t utf16BufLen; + + if (!CodeSet_Utf8ToUtf16le(utf8Str, + strlen(utf8Str), + &utf16Buf, + &utf16BufLen)) { + // input should be valid UTF-8, no conversion error possible + ASSERT_MEM_ALLOC(FALSE); + break; + } + copyBytes = MIN(utf16BufLen, maxLengthInBytes - 2); + memcpy(destBuffer, utf16Buf, copyBytes); + copyBytes = CodeSet_Utf16FindCodePointBoundary(destBuffer, copyBytes); + ((utf16_t*)destBuffer)[copyBytes / 2] = 0; + free(utf16Buf); + + if (copyBytes >= utf16BufLen) { + success = TRUE; } + break; } default: { - // XXX TODO: This is not correct; it's just a stopgap measure. char *currentBuf; size_t currentBufSize; - if (CodeSet_Utf8ToCurrent(utf8Str, - strlen(utf8Str), - ¤tBuf, - ¤tBufSize)) { - if (currentBufSize < maxLengthInBytes) { - // TODO: NUL is not necessarily 1 byte in all encodings. - memcpy(buffer, currentBuf, currentBufSize + 1); - ret = currentBufSize; - free(currentBuf); - } - } else { - // XXX: What to do here? + if (!CodeSet_GenericToGeneric("UTF-8", utf8Str, strlen(utf8Str), + Unicode_EncodingEnumToName(encoding), + CSGTG_NORMAL, + ¤tBuf, ¤tBufSize)) { + // XXX can't distinguish error cause + break; + } + copyBytes = MIN(currentBufSize, maxLengthInBytes - 1); + memcpy(destBuffer, currentBuf, copyBytes); + free(currentBuf); + + /* + * XXX this isn't quite correct, we still need to truncate on + * a code point boundary, based on the current encoding type, + * rather than just null terminate blindly. + */ + + ((char*)destBuffer)[copyBytes] = 0; + + if (copyBytes >= currentBufSize) { + success = TRUE; } } + break; } - return ret; + if (retLength) { + *retLength = copyBytes; + } + return success; +} + + +/* + *----------------------------------------------------------------------------- + * + * Unicode_GetAllocBytes -- + * + * Allocates and returns a NUL terminated buffer into which the contents + * of the unicode string are extracted using the specified encoding. + * + * NOTE: The length of the NUL can depend on the encoding. + * UTF-16 NUL is "\0\0"; UTF-32 NUL is "\0\0\0\0". + * + * NULL is returned for NULL argument. + * + * Results: + * NULL if argument is NULL. + * Otherwise, pointer to the dynamically allocated memory + * or NULL on conversion failure. + * The caller is responsible to free the memory allocated + * by this routine. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +void * +Unicode_GetAllocBytes(ConstUnicode str, // IN: + StringEncoding encoding) // IN: +{ + if (str == NULL) { + return NULL; + } + + return UnicodeGetAllocBytesInternal(str, encoding, -1, NULL); +} + + +/* + *----------------------------------------------------------------------------- + * + * Unicode_GetAllocBytesWithLength -- + * + * Allocates and returns a buffer into which the contents of the unicode + * string of the specified length are extracted using the specified + * encoding. + * + * NOTE: The buffer returned is always NUL terminated. The length of + * the NUL can depend on the encoding. UTF-16 NUL is "\0\0"; + * UTF-32 NUL is "\0\0\0\0". + * + * NULL is returned for NULL argument. + * + * Results: + * NULL if argument is NULL. + * Otherwise, pointer to the dynamically allocated memory + * or NULL on conversion failure. + * The caller is responsible to free the memory allocated + * by this routine. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +void * +Unicode_GetAllocBytesWithLength(ConstUnicode str, // IN: + StringEncoding encoding, // IN: + ssize_t lengthInBytes) // IN: +{ + if (str == NULL) { + return NULL; + } + ASSERT(lengthInBytes >= 0); + + return UnicodeGetAllocBytesInternal(str, encoding, lengthInBytes, NULL); +} + + +/* + *----------------------------------------------------------------------------- + * + * UnicodeGetAllocBytesInternal -- + * + * Encodes the Unicode string using the specified encoding into + * an allocated, null-terminated buffer. + * + * Results: + * The converted string in an allocated buffer, + * or NULL on conversion failure. + * + * The length of the result (in bytes, without termination) + * in retLength. + * + * Side effects: + * Panic on memory allocation failure. + * + *----------------------------------------------------------------------------- + */ + +void * +UnicodeGetAllocBytesInternal(ConstUnicode ustr, // IN + StringEncoding encoding, // IN + ssize_t lengthInBytes, // IN + size_t *retLength) // OUT: optional +{ + const char *utf8Str = ustr; + char *result = NULL; + + ASSERT(ustr != NULL); + + encoding = Unicode_ResolveEncoding(encoding); + + if (lengthInBytes == -1) { + lengthInBytes = Unicode_LengthInBytes(ustr, STRING_ENCODING_UTF8); + } + + switch (encoding) { + case STRING_ENCODING_US_ASCII: + if (!UnicodeSanityCheck(utf8Str, lengthInBytes, encoding)) { + break; + } + // fall through + case STRING_ENCODING_UTF8: + result = Util_SafeMalloc(lengthInBytes + 1); + memcpy(result, utf8Str, lengthInBytes + 1); + if (retLength != NULL) { + *retLength = lengthInBytes; + } + break; + + case STRING_ENCODING_UTF16_LE: + if (!CodeSet_Utf8ToUtf16le(utf8Str, lengthInBytes, &result, retLength)) { + // input should be valid UTF-8, no conversion error possible + ASSERT_MEM_ALLOC(FALSE); + } + break; + + default: + if (!CodeSet_GenericToGeneric("UTF-8", utf8Str, lengthInBytes, + Unicode_EncodingEnumToName(encoding), + CSGTG_NORMAL, + &result, retLength)) { + // XXX can't distinguish error cause + ASSERT(result == NULL); + } + } + + return result; } @@ -537,6 +843,115 @@ UnicodeAllocStatic(const char *asciiBytes, // IN Bool unescape) // IN { - // XXX TODO: Implement unescaping as per u_unescape() in ICU's ustring.c. - return (Unicode)Util_SafeStrdup(asciiBytes); + utf16_t *utf16; + // Explicitly use int8 so we don't depend on whether char is signed. + const int8 *byte = (const int8 *)asciiBytes; + size_t utf16Offset = 0; + Unicode result; + + ASSERT(asciiBytes); + + if (!unescape) { + DEBUG_ONLY( + while (*byte > 0) { + byte++; + } + // All input must be 7-bit US-ASCII. + ASSERT(*byte == 0); + ); + return Util_SafeStrdup(asciiBytes); + } + + utf16 = Util_SafeMalloc(sizeof *utf16 * (strlen(asciiBytes) + 1)); + + while (TRUE) { + size_t hexDigitsRemaining; + uint32 escapedCodePoint = 0; + Bool foundEscapedCodePoint = FALSE; + + if (*byte == '\0') { + utf16[utf16Offset] = 0; + break; + } + + // Only US-ASCII bytes are allowed as input. + ASSERT_NOT_IMPLEMENTED(*byte > 0); + + if (*byte != '\\') { + utf16[utf16Offset++] = *byte; + byte++; + continue; + } + + // Handle the backslash. + byte++; + + if (*byte == '\0') { + // We'll fall out at the top of the loop. + continue; + } + + ASSERT_NOT_IMPLEMENTED(*byte > 0); + + switch (*byte) { + case 'u': + /* + * \\uABCD must have exactly four hexadecimal digits after + * the escape, denoting the Unicode code point U+ABCD. + */ + foundEscapedCodePoint = TRUE; + hexDigitsRemaining = 4; + break; + case 'U': + /* + * \\U0010CDEF must have exactly eight hexadecimal digits + * after the escape, denoting the Unicode code point U+10CDEF. + */ + foundEscapedCodePoint = TRUE; + hexDigitsRemaining = 8; + break; + default: + // Unsupported escape; treat the next byte literally. + hexDigitsRemaining = 0; + utf16[utf16Offset++] = *byte; + break; + } + + byte++; + + while (hexDigitsRemaining) { + uint8 hexValue; + + if (*byte >= '0' && *byte <= '9') { + hexValue = *byte - '0'; + } else if (*byte >= 'A' && *byte <= 'F') { + hexValue = *byte - 'A' + 0xA; + } else if (*byte >= 'a' && *byte <= 'f') { + hexValue = *byte - 'a' + 0xA; + } else { + NOT_IMPLEMENTED(); + } + + escapedCodePoint = (escapedCodePoint << 4) | hexValue; + + byte++; + hexDigitsRemaining--; + } + + if (foundEscapedCodePoint) { + ASSERT_NOT_IMPLEMENTED(escapedCodePoint <= 0x10FFFF); + + if (U16_LENGTH(escapedCodePoint) == 1) { + utf16[utf16Offset++] = (utf16_t)escapedCodePoint; + } else { + utf16[utf16Offset++] = U16_LEAD(escapedCodePoint); + utf16[utf16Offset++] = U16_TRAIL(escapedCodePoint); + } + } + } + + result = Unicode_AllocWithUTF16(utf16); + free(utf16); + + return result; } diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/unicode/unicodeSimpleCaseFolding.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/unicode/unicodeSimpleCaseFolding.c --- open-vm-tools-2008.01.23-74039/lib/unicode/unicodeSimpleCaseFolding.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/unicode/unicodeSimpleCaseFolding.c 2008-10-13 08:01:53.000000000 +0100 @@ -0,0 +1,603 @@ +/* ********************************************************** + * Copyright 2007 VMware, Inc. All rights reserved. + * **********************************************************/ + +/* + * unicodeSimpleCaseFolding.c -- + * + * Simple case folding tables generated from Unicode 5.0.0's + * CaseFolding-5.0.0.txt data file. Data file obtained from: + * + * http://unicode.org/Public/UNIDATA/CaseFolding.txt + * + * Table generated using extract_fold.c from + * bora/vmcore/frobos/clib/fd32/unicode/extract_fold.c. + * + * Copyright of CaseFolding.txt: + * + * Copyright (C) 1991-2007 Unicode, Inc. All rights + * reserved. Distributed under the Terms of Use in + * http://www.unicode.org/copyright.html. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of the Unicode data files and any associated + * documentation (the "Data Files") or Unicode software and any + * associated documentation (the "Software") to deal in the Data + * Files or Software without restriction, including without + * limitation the rights to use, copy, modify, merge, publish, + * distribute, and/or sell copies of the Data Files or Software, + * and to permit persons to whom the Data Files or Software are + * furnished to do so, provided that (a) the above copyright + * notice(s) and this permission notice appear with all copies of + * the Data Files or Software, (b) both the above copyright + * notice(s) and this permission notice appear in associated + * documentation, and (c) there is clear notice in each modified + * Data File or in the Software as well as in the documentation + * associated with the Data File(s) or Software that the data or + * software has been modified. + * + * THE DATA FILES AND SOFTWARE ARE 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 THE DATA FILES OR SOFTWARE. + */ + +#include "vmware.h" +#include "unicodeTypes.h" + +static const utf16_t page_00[256] = +{ + 0x0000, 0x0001, 0x0002, 0x0003, 0x0004, 0x0005, 0x0006, 0x0007, + 0x0008, 0x0009, 0x000A, 0x000B, 0x000C, 0x000D, 0x000E, 0x000F, + 0x0010, 0x0011, 0x0012, 0x0013, 0x0014, 0x0015, 0x0016, 0x0017, + 0x0018, 0x0019, 0x001A, 0x001B, 0x001C, 0x001D, 0x001E, 0x001F, + 0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, + 0x0028, 0x0029, 0x002A, 0x002B, 0x002C, 0x002D, 0x002E, 0x002F, + 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, + 0x0038, 0x0039, 0x003A, 0x003B, 0x003C, 0x003D, 0x003E, 0x003F, + 0x0040, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, + 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, + 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, + 0x0078, 0x0079, 0x007A, 0x005B, 0x005C, 0x005D, 0x005E, 0x005F, + 0x0060, 0x0061, 0x0062, 0x0063, 0x0064, 0x0065, 0x0066, 0x0067, + 0x0068, 0x0069, 0x006A, 0x006B, 0x006C, 0x006D, 0x006E, 0x006F, + 0x0070, 0x0071, 0x0072, 0x0073, 0x0074, 0x0075, 0x0076, 0x0077, + 0x0078, 0x0079, 0x007A, 0x007B, 0x007C, 0x007D, 0x007E, 0x007F, + 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087, + 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F, + 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097, + 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F, + 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7, + 0x00A8, 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF, + 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x03BC, 0x00B6, 0x00B7, + 0x00B8, 0x00B9, 0x00BA, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF, + 0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7, + 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF, + 0x00F0, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00D7, + 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x00FE, 0x00DF, + 0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7, + 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF, + 0x00F0, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F7, + 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x00FE, 0x00FF +}; + +static const utf16_t page_01[256] = +{ + 0x0101, 0x0101, 0x0103, 0x0103, 0x0105, 0x0105, 0x0107, 0x0107, + 0x0109, 0x0109, 0x010B, 0x010B, 0x010D, 0x010D, 0x010F, 0x010F, + 0x0111, 0x0111, 0x0113, 0x0113, 0x0115, 0x0115, 0x0117, 0x0117, + 0x0119, 0x0119, 0x011B, 0x011B, 0x011D, 0x011D, 0x011F, 0x011F, + 0x0121, 0x0121, 0x0123, 0x0123, 0x0125, 0x0125, 0x0127, 0x0127, + 0x0129, 0x0129, 0x012B, 0x012B, 0x012D, 0x012D, 0x012F, 0x012F, + 0x0130, 0x0131, 0x0133, 0x0133, 0x0135, 0x0135, 0x0137, 0x0137, + 0x0138, 0x013A, 0x013A, 0x013C, 0x013C, 0x013E, 0x013E, 0x0140, + 0x0140, 0x0142, 0x0142, 0x0144, 0x0144, 0x0146, 0x0146, 0x0148, + 0x0148, 0x0149, 0x014B, 0x014B, 0x014D, 0x014D, 0x014F, 0x014F, + 0x0151, 0x0151, 0x0153, 0x0153, 0x0155, 0x0155, 0x0157, 0x0157, + 0x0159, 0x0159, 0x015B, 0x015B, 0x015D, 0x015D, 0x015F, 0x015F, + 0x0161, 0x0161, 0x0163, 0x0163, 0x0165, 0x0165, 0x0167, 0x0167, + 0x0169, 0x0169, 0x016B, 0x016B, 0x016D, 0x016D, 0x016F, 0x016F, + 0x0171, 0x0171, 0x0173, 0x0173, 0x0175, 0x0175, 0x0177, 0x0177, + 0x00FF, 0x017A, 0x017A, 0x017C, 0x017C, 0x017E, 0x017E, 0x0073, + 0x0180, 0x0253, 0x0183, 0x0183, 0x0185, 0x0185, 0x0254, 0x0188, + 0x0188, 0x0256, 0x0257, 0x018C, 0x018C, 0x018D, 0x01DD, 0x0259, + 0x025B, 0x0192, 0x0192, 0x0260, 0x0263, 0x0195, 0x0269, 0x0268, + 0x0199, 0x0199, 0x019A, 0x019B, 0x026F, 0x0272, 0x019E, 0x0275, + 0x01A1, 0x01A1, 0x01A3, 0x01A3, 0x01A5, 0x01A5, 0x0280, 0x01A8, + 0x01A8, 0x0283, 0x01AA, 0x01AB, 0x01AD, 0x01AD, 0x0288, 0x01B0, + 0x01B0, 0x028A, 0x028B, 0x01B4, 0x01B4, 0x01B6, 0x01B6, 0x0292, + 0x01B9, 0x01B9, 0x01BA, 0x01BB, 0x01BD, 0x01BD, 0x01BE, 0x01BF, + 0x01C0, 0x01C1, 0x01C2, 0x01C3, 0x01C6, 0x01C6, 0x01C6, 0x01C9, + 0x01C9, 0x01C9, 0x01CC, 0x01CC, 0x01CC, 0x01CE, 0x01CE, 0x01D0, + 0x01D0, 0x01D2, 0x01D2, 0x01D4, 0x01D4, 0x01D6, 0x01D6, 0x01D8, + 0x01D8, 0x01DA, 0x01DA, 0x01DC, 0x01DC, 0x01DD, 0x01DF, 0x01DF, + 0x01E1, 0x01E1, 0x01E3, 0x01E3, 0x01E5, 0x01E5, 0x01E7, 0x01E7, + 0x01E9, 0x01E9, 0x01EB, 0x01EB, 0x01ED, 0x01ED, 0x01EF, 0x01EF, + 0x01F0, 0x01F3, 0x01F3, 0x01F3, 0x01F5, 0x01F5, 0x0195, 0x01BF, + 0x01F9, 0x01F9, 0x01FB, 0x01FB, 0x01FD, 0x01FD, 0x01FF, 0x01FF +}; + +static const utf16_t page_02[256] = +{ + 0x0201, 0x0201, 0x0203, 0x0203, 0x0205, 0x0205, 0x0207, 0x0207, + 0x0209, 0x0209, 0x020B, 0x020B, 0x020D, 0x020D, 0x020F, 0x020F, + 0x0211, 0x0211, 0x0213, 0x0213, 0x0215, 0x0215, 0x0217, 0x0217, + 0x0219, 0x0219, 0x021B, 0x021B, 0x021D, 0x021D, 0x021F, 0x021F, + 0x019E, 0x0221, 0x0223, 0x0223, 0x0225, 0x0225, 0x0227, 0x0227, + 0x0229, 0x0229, 0x022B, 0x022B, 0x022D, 0x022D, 0x022F, 0x022F, + 0x0231, 0x0231, 0x0233, 0x0233, 0x0234, 0x0235, 0x0236, 0x0237, + 0x0238, 0x0239, 0x2C65, 0x023C, 0x023C, 0x019A, 0x2C66, 0x023F, + 0x0240, 0x0242, 0x0242, 0x0180, 0x0289, 0x028C, 0x0247, 0x0247, + 0x0249, 0x0249, 0x024B, 0x024B, 0x024D, 0x024D, 0x024F, 0x024F, + 0x0250, 0x0251, 0x0252, 0x0253, 0x0254, 0x0255, 0x0256, 0x0257, + 0x0258, 0x0259, 0x025A, 0x025B, 0x025C, 0x025D, 0x025E, 0x025F, + 0x0260, 0x0261, 0x0262, 0x0263, 0x0264, 0x0265, 0x0266, 0x0267, + 0x0268, 0x0269, 0x026A, 0x026B, 0x026C, 0x026D, 0x026E, 0x026F, + 0x0270, 0x0271, 0x0272, 0x0273, 0x0274, 0x0275, 0x0276, 0x0277, + 0x0278, 0x0279, 0x027A, 0x027B, 0x027C, 0x027D, 0x027E, 0x027F, + 0x0280, 0x0281, 0x0282, 0x0283, 0x0284, 0x0285, 0x0286, 0x0287, + 0x0288, 0x0289, 0x028A, 0x028B, 0x028C, 0x028D, 0x028E, 0x028F, + 0x0290, 0x0291, 0x0292, 0x0293, 0x0294, 0x0295, 0x0296, 0x0297, + 0x0298, 0x0299, 0x029A, 0x029B, 0x029C, 0x029D, 0x029E, 0x029F, + 0x02A0, 0x02A1, 0x02A2, 0x02A3, 0x02A4, 0x02A5, 0x02A6, 0x02A7, + 0x02A8, 0x02A9, 0x02AA, 0x02AB, 0x02AC, 0x02AD, 0x02AE, 0x02AF, + 0x02B0, 0x02B1, 0x02B2, 0x02B3, 0x02B4, 0x02B5, 0x02B6, 0x02B7, + 0x02B8, 0x02B9, 0x02BA, 0x02BB, 0x02BC, 0x02BD, 0x02BE, 0x02BF, + 0x02C0, 0x02C1, 0x02C2, 0x02C3, 0x02C4, 0x02C5, 0x02C6, 0x02C7, + 0x02C8, 0x02C9, 0x02CA, 0x02CB, 0x02CC, 0x02CD, 0x02CE, 0x02CF, + 0x02D0, 0x02D1, 0x02D2, 0x02D3, 0x02D4, 0x02D5, 0x02D6, 0x02D7, + 0x02D8, 0x02D9, 0x02DA, 0x02DB, 0x02DC, 0x02DD, 0x02DE, 0x02DF, + 0x02E0, 0x02E1, 0x02E2, 0x02E3, 0x02E4, 0x02E5, 0x02E6, 0x02E7, + 0x02E8, 0x02E9, 0x02EA, 0x02EB, 0x02EC, 0x02ED, 0x02EE, 0x02EF, + 0x02F0, 0x02F1, 0x02F2, 0x02F3, 0x02F4, 0x02F5, 0x02F6, 0x02F7, + 0x02F8, 0x02F9, 0x02FA, 0x02FB, 0x02FC, 0x02FD, 0x02FE, 0x02FF +}; + +static const utf16_t page_03[256] = +{ + 0x0300, 0x0301, 0x0302, 0x0303, 0x0304, 0x0305, 0x0306, 0x0307, + 0x0308, 0x0309, 0x030A, 0x030B, 0x030C, 0x030D, 0x030E, 0x030F, + 0x0310, 0x0311, 0x0312, 0x0313, 0x0314, 0x0315, 0x0316, 0x0317, + 0x0318, 0x0319, 0x031A, 0x031B, 0x031C, 0x031D, 0x031E, 0x031F, + 0x0320, 0x0321, 0x0322, 0x0323, 0x0324, 0x0325, 0x0326, 0x0327, + 0x0328, 0x0329, 0x032A, 0x032B, 0x032C, 0x032D, 0x032E, 0x032F, + 0x0330, 0x0331, 0x0332, 0x0333, 0x0334, 0x0335, 0x0336, 0x0337, + 0x0338, 0x0339, 0x033A, 0x033B, 0x033C, 0x033D, 0x033E, 0x033F, + 0x0340, 0x0341, 0x0342, 0x0343, 0x0344, 0x03B9, 0x0346, 0x0347, + 0x0348, 0x0349, 0x034A, 0x034B, 0x034C, 0x034D, 0x034E, 0x034F, + 0x0350, 0x0351, 0x0352, 0x0353, 0x0354, 0x0355, 0x0356, 0x0357, + 0x0358, 0x0359, 0x035A, 0x035B, 0x035C, 0x035D, 0x035E, 0x035F, + 0x0360, 0x0361, 0x0362, 0x0363, 0x0364, 0x0365, 0x0366, 0x0367, + 0x0368, 0x0369, 0x036A, 0x036B, 0x036C, 0x036D, 0x036E, 0x036F, + 0x0370, 0x0371, 0x0372, 0x0373, 0x0374, 0x0375, 0x0376, 0x0377, + 0x0378, 0x0379, 0x037A, 0x037B, 0x037C, 0x037D, 0x037E, 0x037F, + 0x0380, 0x0381, 0x0382, 0x0383, 0x0384, 0x0385, 0x03AC, 0x0387, + 0x03AD, 0x03AE, 0x03AF, 0x038B, 0x03CC, 0x038D, 0x03CD, 0x03CE, + 0x0390, 0x03B1, 0x03B2, 0x03B3, 0x03B4, 0x03B5, 0x03B6, 0x03B7, + 0x03B8, 0x03B9, 0x03BA, 0x03BB, 0x03BC, 0x03BD, 0x03BE, 0x03BF, + 0x03C0, 0x03C1, 0x03A2, 0x03C3, 0x03C4, 0x03C5, 0x03C6, 0x03C7, + 0x03C8, 0x03C9, 0x03CA, 0x03CB, 0x03AC, 0x03AD, 0x03AE, 0x03AF, + 0x03B0, 0x03B1, 0x03B2, 0x03B3, 0x03B4, 0x03B5, 0x03B6, 0x03B7, + 0x03B8, 0x03B9, 0x03BA, 0x03BB, 0x03BC, 0x03BD, 0x03BE, 0x03BF, + 0x03C0, 0x03C1, 0x03C3, 0x03C3, 0x03C4, 0x03C5, 0x03C6, 0x03C7, + 0x03C8, 0x03C9, 0x03CA, 0x03CB, 0x03CC, 0x03CD, 0x03CE, 0x03CF, + 0x03B2, 0x03B8, 0x03D2, 0x03D3, 0x03D4, 0x03C6, 0x03C0, 0x03D7, + 0x03D9, 0x03D9, 0x03DB, 0x03DB, 0x03DD, 0x03DD, 0x03DF, 0x03DF, + 0x03E1, 0x03E1, 0x03E3, 0x03E3, 0x03E5, 0x03E5, 0x03E7, 0x03E7, + 0x03E9, 0x03E9, 0x03EB, 0x03EB, 0x03ED, 0x03ED, 0x03EF, 0x03EF, + 0x03BA, 0x03C1, 0x03F2, 0x03F3, 0x03B8, 0x03B5, 0x03F6, 0x03F8, + 0x03F8, 0x03F2, 0x03FB, 0x03FB, 0x03FC, 0x037B, 0x037C, 0x037D +}; + +static const utf16_t page_04[256] = +{ + 0x0450, 0x0451, 0x0452, 0x0453, 0x0454, 0x0455, 0x0456, 0x0457, + 0x0458, 0x0459, 0x045A, 0x045B, 0x045C, 0x045D, 0x045E, 0x045F, + 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437, + 0x0438, 0x0439, 0x043A, 0x043B, 0x043C, 0x043D, 0x043E, 0x043F, + 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447, + 0x0448, 0x0449, 0x044A, 0x044B, 0x044C, 0x044D, 0x044E, 0x044F, + 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437, + 0x0438, 0x0439, 0x043A, 0x043B, 0x043C, 0x043D, 0x043E, 0x043F, + 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447, + 0x0448, 0x0449, 0x044A, 0x044B, 0x044C, 0x044D, 0x044E, 0x044F, + 0x0450, 0x0451, 0x0452, 0x0453, 0x0454, 0x0455, 0x0456, 0x0457, + 0x0458, 0x0459, 0x045A, 0x045B, 0x045C, 0x045D, 0x045E, 0x045F, + 0x0461, 0x0461, 0x0463, 0x0463, 0x0465, 0x0465, 0x0467, 0x0467, + 0x0469, 0x0469, 0x046B, 0x046B, 0x046D, 0x046D, 0x046F, 0x046F, + 0x0471, 0x0471, 0x0473, 0x0473, 0x0475, 0x0475, 0x0477, 0x0477, + 0x0479, 0x0479, 0x047B, 0x047B, 0x047D, 0x047D, 0x047F, 0x047F, + 0x0481, 0x0481, 0x0482, 0x0483, 0x0484, 0x0485, 0x0486, 0x0487, + 0x0488, 0x0489, 0x048B, 0x048B, 0x048D, 0x048D, 0x048F, 0x048F, + 0x0491, 0x0491, 0x0493, 0x0493, 0x0495, 0x0495, 0x0497, 0x0497, + 0x0499, 0x0499, 0x049B, 0x049B, 0x049D, 0x049D, 0x049F, 0x049F, + 0x04A1, 0x04A1, 0x04A3, 0x04A3, 0x04A5, 0x04A5, 0x04A7, 0x04A7, + 0x04A9, 0x04A9, 0x04AB, 0x04AB, 0x04AD, 0x04AD, 0x04AF, 0x04AF, + 0x04B1, 0x04B1, 0x04B3, 0x04B3, 0x04B5, 0x04B5, 0x04B7, 0x04B7, + 0x04B9, 0x04B9, 0x04BB, 0x04BB, 0x04BD, 0x04BD, 0x04BF, 0x04BF, + 0x04CF, 0x04C2, 0x04C2, 0x04C4, 0x04C4, 0x04C6, 0x04C6, 0x04C8, + 0x04C8, 0x04CA, 0x04CA, 0x04CC, 0x04CC, 0x04CE, 0x04CE, 0x04CF, + 0x04D1, 0x04D1, 0x04D3, 0x04D3, 0x04D5, 0x04D5, 0x04D7, 0x04D7, + 0x04D9, 0x04D9, 0x04DB, 0x04DB, 0x04DD, 0x04DD, 0x04DF, 0x04DF, + 0x04E1, 0x04E1, 0x04E3, 0x04E3, 0x04E5, 0x04E5, 0x04E7, 0x04E7, + 0x04E9, 0x04E9, 0x04EB, 0x04EB, 0x04ED, 0x04ED, 0x04EF, 0x04EF, + 0x04F1, 0x04F1, 0x04F3, 0x04F3, 0x04F5, 0x04F5, 0x04F7, 0x04F7, + 0x04F9, 0x04F9, 0x04FB, 0x04FB, 0x04FD, 0x04FD, 0x04FF, 0x04FF +}; + +static const utf16_t page_05[256] = +{ + 0x0501, 0x0501, 0x0503, 0x0503, 0x0505, 0x0505, 0x0507, 0x0507, + 0x0509, 0x0509, 0x050B, 0x050B, 0x050D, 0x050D, 0x050F, 0x050F, + 0x0511, 0x0511, 0x0513, 0x0513, 0x0514, 0x0515, 0x0516, 0x0517, + 0x0518, 0x0519, 0x051A, 0x051B, 0x051C, 0x051D, 0x051E, 0x051F, + 0x0520, 0x0521, 0x0522, 0x0523, 0x0524, 0x0525, 0x0526, 0x0527, + 0x0528, 0x0529, 0x052A, 0x052B, 0x052C, 0x052D, 0x052E, 0x052F, + 0x0530, 0x0561, 0x0562, 0x0563, 0x0564, 0x0565, 0x0566, 0x0567, + 0x0568, 0x0569, 0x056A, 0x056B, 0x056C, 0x056D, 0x056E, 0x056F, + 0x0570, 0x0571, 0x0572, 0x0573, 0x0574, 0x0575, 0x0576, 0x0577, + 0x0578, 0x0579, 0x057A, 0x057B, 0x057C, 0x057D, 0x057E, 0x057F, + 0x0580, 0x0581, 0x0582, 0x0583, 0x0584, 0x0585, 0x0586, 0x0557, + 0x0558, 0x0559, 0x055A, 0x055B, 0x055C, 0x055D, 0x055E, 0x055F, + 0x0560, 0x0561, 0x0562, 0x0563, 0x0564, 0x0565, 0x0566, 0x0567, + 0x0568, 0x0569, 0x056A, 0x056B, 0x056C, 0x056D, 0x056E, 0x056F, + 0x0570, 0x0571, 0x0572, 0x0573, 0x0574, 0x0575, 0x0576, 0x0577, + 0x0578, 0x0579, 0x057A, 0x057B, 0x057C, 0x057D, 0x057E, 0x057F, + 0x0580, 0x0581, 0x0582, 0x0583, 0x0584, 0x0585, 0x0586, 0x0587, + 0x0588, 0x0589, 0x058A, 0x058B, 0x058C, 0x058D, 0x058E, 0x058F, + 0x0590, 0x0591, 0x0592, 0x0593, 0x0594, 0x0595, 0x0596, 0x0597, + 0x0598, 0x0599, 0x059A, 0x059B, 0x059C, 0x059D, 0x059E, 0x059F, + 0x05A0, 0x05A1, 0x05A2, 0x05A3, 0x05A4, 0x05A5, 0x05A6, 0x05A7, + 0x05A8, 0x05A9, 0x05AA, 0x05AB, 0x05AC, 0x05AD, 0x05AE, 0x05AF, + 0x05B0, 0x05B1, 0x05B2, 0x05B3, 0x05B4, 0x05B5, 0x05B6, 0x05B7, + 0x05B8, 0x05B9, 0x05BA, 0x05BB, 0x05BC, 0x05BD, 0x05BE, 0x05BF, + 0x05C0, 0x05C1, 0x05C2, 0x05C3, 0x05C4, 0x05C5, 0x05C6, 0x05C7, + 0x05C8, 0x05C9, 0x05CA, 0x05CB, 0x05CC, 0x05CD, 0x05CE, 0x05CF, + 0x05D0, 0x05D1, 0x05D2, 0x05D3, 0x05D4, 0x05D5, 0x05D6, 0x05D7, + 0x05D8, 0x05D9, 0x05DA, 0x05DB, 0x05DC, 0x05DD, 0x05DE, 0x05DF, + 0x05E0, 0x05E1, 0x05E2, 0x05E3, 0x05E4, 0x05E5, 0x05E6, 0x05E7, + 0x05E8, 0x05E9, 0x05EA, 0x05EB, 0x05EC, 0x05ED, 0x05EE, 0x05EF, + 0x05F0, 0x05F1, 0x05F2, 0x05F3, 0x05F4, 0x05F5, 0x05F6, 0x05F7, + 0x05F8, 0x05F9, 0x05FA, 0x05FB, 0x05FC, 0x05FD, 0x05FE, 0x05FF +}; + +static const utf16_t page_10[256] = +{ + 0x1000, 0x1001, 0x1002, 0x1003, 0x1004, 0x1005, 0x1006, 0x1007, + 0x1008, 0x1009, 0x100A, 0x100B, 0x100C, 0x100D, 0x100E, 0x100F, + 0x1010, 0x1011, 0x1012, 0x1013, 0x1014, 0x1015, 0x1016, 0x1017, + 0x1018, 0x1019, 0x101A, 0x101B, 0x101C, 0x101D, 0x101E, 0x101F, + 0x1020, 0x1021, 0x1022, 0x1023, 0x1024, 0x1025, 0x1026, 0x1027, + 0x1028, 0x1029, 0x102A, 0x102B, 0x102C, 0x102D, 0x102E, 0x102F, + 0x1030, 0x1031, 0x1032, 0x1033, 0x1034, 0x1035, 0x1036, 0x1037, + 0x1038, 0x1039, 0x103A, 0x103B, 0x103C, 0x103D, 0x103E, 0x103F, + 0x1040, 0x1041, 0x1042, 0x1043, 0x1044, 0x1045, 0x1046, 0x1047, + 0x1048, 0x1049, 0x104A, 0x104B, 0x104C, 0x104D, 0x104E, 0x104F, + 0x1050, 0x1051, 0x1052, 0x1053, 0x1054, 0x1055, 0x1056, 0x1057, + 0x1058, 0x1059, 0x105A, 0x105B, 0x105C, 0x105D, 0x105E, 0x105F, + 0x1060, 0x1061, 0x1062, 0x1063, 0x1064, 0x1065, 0x1066, 0x1067, + 0x1068, 0x1069, 0x106A, 0x106B, 0x106C, 0x106D, 0x106E, 0x106F, + 0x1070, 0x1071, 0x1072, 0x1073, 0x1074, 0x1075, 0x1076, 0x1077, + 0x1078, 0x1079, 0x107A, 0x107B, 0x107C, 0x107D, 0x107E, 0x107F, + 0x1080, 0x1081, 0x1082, 0x1083, 0x1084, 0x1085, 0x1086, 0x1087, + 0x1088, 0x1089, 0x108A, 0x108B, 0x108C, 0x108D, 0x108E, 0x108F, + 0x1090, 0x1091, 0x1092, 0x1093, 0x1094, 0x1095, 0x1096, 0x1097, + 0x1098, 0x1099, 0x109A, 0x109B, 0x109C, 0x109D, 0x109E, 0x109F, + 0x2D00, 0x2D01, 0x2D02, 0x2D03, 0x2D04, 0x2D05, 0x2D06, 0x2D07, + 0x2D08, 0x2D09, 0x2D0A, 0x2D0B, 0x2D0C, 0x2D0D, 0x2D0E, 0x2D0F, + 0x2D10, 0x2D11, 0x2D12, 0x2D13, 0x2D14, 0x2D15, 0x2D16, 0x2D17, + 0x2D18, 0x2D19, 0x2D1A, 0x2D1B, 0x2D1C, 0x2D1D, 0x2D1E, 0x2D1F, + 0x2D20, 0x2D21, 0x2D22, 0x2D23, 0x2D24, 0x2D25, 0x10C6, 0x10C7, + 0x10C8, 0x10C9, 0x10CA, 0x10CB, 0x10CC, 0x10CD, 0x10CE, 0x10CF, + 0x10D0, 0x10D1, 0x10D2, 0x10D3, 0x10D4, 0x10D5, 0x10D6, 0x10D7, + 0x10D8, 0x10D9, 0x10DA, 0x10DB, 0x10DC, 0x10DD, 0x10DE, 0x10DF, + 0x10E0, 0x10E1, 0x10E2, 0x10E3, 0x10E4, 0x10E5, 0x10E6, 0x10E7, + 0x10E8, 0x10E9, 0x10EA, 0x10EB, 0x10EC, 0x10ED, 0x10EE, 0x10EF, + 0x10F0, 0x10F1, 0x10F2, 0x10F3, 0x10F4, 0x10F5, 0x10F6, 0x10F7, + 0x10F8, 0x10F9, 0x10FA, 0x10FB, 0x10FC, 0x10FD, 0x10FE, 0x10FF +}; + +static const utf16_t page_1E[256] = +{ + 0x1E01, 0x1E01, 0x1E03, 0x1E03, 0x1E05, 0x1E05, 0x1E07, 0x1E07, + 0x1E09, 0x1E09, 0x1E0B, 0x1E0B, 0x1E0D, 0x1E0D, 0x1E0F, 0x1E0F, + 0x1E11, 0x1E11, 0x1E13, 0x1E13, 0x1E15, 0x1E15, 0x1E17, 0x1E17, + 0x1E19, 0x1E19, 0x1E1B, 0x1E1B, 0x1E1D, 0x1E1D, 0x1E1F, 0x1E1F, + 0x1E21, 0x1E21, 0x1E23, 0x1E23, 0x1E25, 0x1E25, 0x1E27, 0x1E27, + 0x1E29, 0x1E29, 0x1E2B, 0x1E2B, 0x1E2D, 0x1E2D, 0x1E2F, 0x1E2F, + 0x1E31, 0x1E31, 0x1E33, 0x1E33, 0x1E35, 0x1E35, 0x1E37, 0x1E37, + 0x1E39, 0x1E39, 0x1E3B, 0x1E3B, 0x1E3D, 0x1E3D, 0x1E3F, 0x1E3F, + 0x1E41, 0x1E41, 0x1E43, 0x1E43, 0x1E45, 0x1E45, 0x1E47, 0x1E47, + 0x1E49, 0x1E49, 0x1E4B, 0x1E4B, 0x1E4D, 0x1E4D, 0x1E4F, 0x1E4F, + 0x1E51, 0x1E51, 0x1E53, 0x1E53, 0x1E55, 0x1E55, 0x1E57, 0x1E57, + 0x1E59, 0x1E59, 0x1E5B, 0x1E5B, 0x1E5D, 0x1E5D, 0x1E5F, 0x1E5F, + 0x1E61, 0x1E61, 0x1E63, 0x1E63, 0x1E65, 0x1E65, 0x1E67, 0x1E67, + 0x1E69, 0x1E69, 0x1E6B, 0x1E6B, 0x1E6D, 0x1E6D, 0x1E6F, 0x1E6F, + 0x1E71, 0x1E71, 0x1E73, 0x1E73, 0x1E75, 0x1E75, 0x1E77, 0x1E77, + 0x1E79, 0x1E79, 0x1E7B, 0x1E7B, 0x1E7D, 0x1E7D, 0x1E7F, 0x1E7F, + 0x1E81, 0x1E81, 0x1E83, 0x1E83, 0x1E85, 0x1E85, 0x1E87, 0x1E87, + 0x1E89, 0x1E89, 0x1E8B, 0x1E8B, 0x1E8D, 0x1E8D, 0x1E8F, 0x1E8F, + 0x1E91, 0x1E91, 0x1E93, 0x1E93, 0x1E95, 0x1E95, 0x1E96, 0x1E97, + 0x1E98, 0x1E99, 0x1E9A, 0x1E61, 0x1E9C, 0x1E9D, 0x1E9E, 0x1E9F, + 0x1EA1, 0x1EA1, 0x1EA3, 0x1EA3, 0x1EA5, 0x1EA5, 0x1EA7, 0x1EA7, + 0x1EA9, 0x1EA9, 0x1EAB, 0x1EAB, 0x1EAD, 0x1EAD, 0x1EAF, 0x1EAF, + 0x1EB1, 0x1EB1, 0x1EB3, 0x1EB3, 0x1EB5, 0x1EB5, 0x1EB7, 0x1EB7, + 0x1EB9, 0x1EB9, 0x1EBB, 0x1EBB, 0x1EBD, 0x1EBD, 0x1EBF, 0x1EBF, + 0x1EC1, 0x1EC1, 0x1EC3, 0x1EC3, 0x1EC5, 0x1EC5, 0x1EC7, 0x1EC7, + 0x1EC9, 0x1EC9, 0x1ECB, 0x1ECB, 0x1ECD, 0x1ECD, 0x1ECF, 0x1ECF, + 0x1ED1, 0x1ED1, 0x1ED3, 0x1ED3, 0x1ED5, 0x1ED5, 0x1ED7, 0x1ED7, + 0x1ED9, 0x1ED9, 0x1EDB, 0x1EDB, 0x1EDD, 0x1EDD, 0x1EDF, 0x1EDF, + 0x1EE1, 0x1EE1, 0x1EE3, 0x1EE3, 0x1EE5, 0x1EE5, 0x1EE7, 0x1EE7, + 0x1EE9, 0x1EE9, 0x1EEB, 0x1EEB, 0x1EED, 0x1EED, 0x1EEF, 0x1EEF, + 0x1EF1, 0x1EF1, 0x1EF3, 0x1EF3, 0x1EF5, 0x1EF5, 0x1EF7, 0x1EF7, + 0x1EF9, 0x1EF9, 0x1EFA, 0x1EFB, 0x1EFC, 0x1EFD, 0x1EFE, 0x1EFF +}; + +static const utf16_t page_1F[256] = +{ + 0x1F00, 0x1F01, 0x1F02, 0x1F03, 0x1F04, 0x1F05, 0x1F06, 0x1F07, + 0x1F00, 0x1F01, 0x1F02, 0x1F03, 0x1F04, 0x1F05, 0x1F06, 0x1F07, + 0x1F10, 0x1F11, 0x1F12, 0x1F13, 0x1F14, 0x1F15, 0x1F16, 0x1F17, + 0x1F10, 0x1F11, 0x1F12, 0x1F13, 0x1F14, 0x1F15, 0x1F1E, 0x1F1F, + 0x1F20, 0x1F21, 0x1F22, 0x1F23, 0x1F24, 0x1F25, 0x1F26, 0x1F27, + 0x1F20, 0x1F21, 0x1F22, 0x1F23, 0x1F24, 0x1F25, 0x1F26, 0x1F27, + 0x1F30, 0x1F31, 0x1F32, 0x1F33, 0x1F34, 0x1F35, 0x1F36, 0x1F37, + 0x1F30, 0x1F31, 0x1F32, 0x1F33, 0x1F34, 0x1F35, 0x1F36, 0x1F37, + 0x1F40, 0x1F41, 0x1F42, 0x1F43, 0x1F44, 0x1F45, 0x1F46, 0x1F47, + 0x1F40, 0x1F41, 0x1F42, 0x1F43, 0x1F44, 0x1F45, 0x1F4E, 0x1F4F, + 0x1F50, 0x1F51, 0x1F52, 0x1F53, 0x1F54, 0x1F55, 0x1F56, 0x1F57, + 0x1F58, 0x1F51, 0x1F5A, 0x1F53, 0x1F5C, 0x1F55, 0x1F5E, 0x1F57, + 0x1F60, 0x1F61, 0x1F62, 0x1F63, 0x1F64, 0x1F65, 0x1F66, 0x1F67, + 0x1F60, 0x1F61, 0x1F62, 0x1F63, 0x1F64, 0x1F65, 0x1F66, 0x1F67, + 0x1F70, 0x1F71, 0x1F72, 0x1F73, 0x1F74, 0x1F75, 0x1F76, 0x1F77, + 0x1F78, 0x1F79, 0x1F7A, 0x1F7B, 0x1F7C, 0x1F7D, 0x1F7E, 0x1F7F, + 0x1F80, 0x1F81, 0x1F82, 0x1F83, 0x1F84, 0x1F85, 0x1F86, 0x1F87, + 0x1F80, 0x1F81, 0x1F82, 0x1F83, 0x1F84, 0x1F85, 0x1F86, 0x1F87, + 0x1F90, 0x1F91, 0x1F92, 0x1F93, 0x1F94, 0x1F95, 0x1F96, 0x1F97, + 0x1F90, 0x1F91, 0x1F92, 0x1F93, 0x1F94, 0x1F95, 0x1F96, 0x1F97, + 0x1FA0, 0x1FA1, 0x1FA2, 0x1FA3, 0x1FA4, 0x1FA5, 0x1FA6, 0x1FA7, + 0x1FA0, 0x1FA1, 0x1FA2, 0x1FA3, 0x1FA4, 0x1FA5, 0x1FA6, 0x1FA7, + 0x1FB0, 0x1FB1, 0x1FB2, 0x1FB3, 0x1FB4, 0x1FB5, 0x1FB6, 0x1FB7, + 0x1FB0, 0x1FB1, 0x1F70, 0x1F71, 0x1FB3, 0x1FBD, 0x03B9, 0x1FBF, + 0x1FC0, 0x1FC1, 0x1FC2, 0x1FC3, 0x1FC4, 0x1FC5, 0x1FC6, 0x1FC7, + 0x1F72, 0x1F73, 0x1F74, 0x1F75, 0x1FC3, 0x1FCD, 0x1FCE, 0x1FCF, + 0x1FD0, 0x1FD1, 0x1FD2, 0x1FD3, 0x1FD4, 0x1FD5, 0x1FD6, 0x1FD7, + 0x1FD0, 0x1FD1, 0x1F76, 0x1F77, 0x1FDC, 0x1FDD, 0x1FDE, 0x1FDF, + 0x1FE0, 0x1FE1, 0x1FE2, 0x1FE3, 0x1FE4, 0x1FE5, 0x1FE6, 0x1FE7, + 0x1FE0, 0x1FE1, 0x1F7A, 0x1F7B, 0x1FE5, 0x1FED, 0x1FEE, 0x1FEF, + 0x1FF0, 0x1FF1, 0x1FF2, 0x1FF3, 0x1FF4, 0x1FF5, 0x1FF6, 0x1FF7, + 0x1F78, 0x1F79, 0x1F7C, 0x1F7D, 0x1FF3, 0x1FFD, 0x1FFE, 0x1FFF +}; + +static const utf16_t page_21[256] = +{ + 0x2100, 0x2101, 0x2102, 0x2103, 0x2104, 0x2105, 0x2106, 0x2107, + 0x2108, 0x2109, 0x210A, 0x210B, 0x210C, 0x210D, 0x210E, 0x210F, + 0x2110, 0x2111, 0x2112, 0x2113, 0x2114, 0x2115, 0x2116, 0x2117, + 0x2118, 0x2119, 0x211A, 0x211B, 0x211C, 0x211D, 0x211E, 0x211F, + 0x2120, 0x2121, 0x2122, 0x2123, 0x2124, 0x2125, 0x03C9, 0x2127, + 0x2128, 0x2129, 0x006B, 0x00E5, 0x212C, 0x212D, 0x212E, 0x212F, + 0x2130, 0x2131, 0x214E, 0x2133, 0x2134, 0x2135, 0x2136, 0x2137, + 0x2138, 0x2139, 0x213A, 0x213B, 0x213C, 0x213D, 0x213E, 0x213F, + 0x2140, 0x2141, 0x2142, 0x2143, 0x2144, 0x2145, 0x2146, 0x2147, + 0x2148, 0x2149, 0x214A, 0x214B, 0x214C, 0x214D, 0x214E, 0x214F, + 0x2150, 0x2151, 0x2152, 0x2153, 0x2154, 0x2155, 0x2156, 0x2157, + 0x2158, 0x2159, 0x215A, 0x215B, 0x215C, 0x215D, 0x215E, 0x215F, + 0x2170, 0x2171, 0x2172, 0x2173, 0x2174, 0x2175, 0x2176, 0x2177, + 0x2178, 0x2179, 0x217A, 0x217B, 0x217C, 0x217D, 0x217E, 0x217F, + 0x2170, 0x2171, 0x2172, 0x2173, 0x2174, 0x2175, 0x2176, 0x2177, + 0x2178, 0x2179, 0x217A, 0x217B, 0x217C, 0x217D, 0x217E, 0x217F, + 0x2180, 0x2181, 0x2182, 0x2184, 0x2184, 0x2185, 0x2186, 0x2187, + 0x2188, 0x2189, 0x218A, 0x218B, 0x218C, 0x218D, 0x218E, 0x218F, + 0x2190, 0x2191, 0x2192, 0x2193, 0x2194, 0x2195, 0x2196, 0x2197, + 0x2198, 0x2199, 0x219A, 0x219B, 0x219C, 0x219D, 0x219E, 0x219F, + 0x21A0, 0x21A1, 0x21A2, 0x21A3, 0x21A4, 0x21A5, 0x21A6, 0x21A7, + 0x21A8, 0x21A9, 0x21AA, 0x21AB, 0x21AC, 0x21AD, 0x21AE, 0x21AF, + 0x21B0, 0x21B1, 0x21B2, 0x21B3, 0x21B4, 0x21B5, 0x21B6, 0x21B7, + 0x21B8, 0x21B9, 0x21BA, 0x21BB, 0x21BC, 0x21BD, 0x21BE, 0x21BF, + 0x21C0, 0x21C1, 0x21C2, 0x21C3, 0x21C4, 0x21C5, 0x21C6, 0x21C7, + 0x21C8, 0x21C9, 0x21CA, 0x21CB, 0x21CC, 0x21CD, 0x21CE, 0x21CF, + 0x21D0, 0x21D1, 0x21D2, 0x21D3, 0x21D4, 0x21D5, 0x21D6, 0x21D7, + 0x21D8, 0x21D9, 0x21DA, 0x21DB, 0x21DC, 0x21DD, 0x21DE, 0x21DF, + 0x21E0, 0x21E1, 0x21E2, 0x21E3, 0x21E4, 0x21E5, 0x21E6, 0x21E7, + 0x21E8, 0x21E9, 0x21EA, 0x21EB, 0x21EC, 0x21ED, 0x21EE, 0x21EF, + 0x21F0, 0x21F1, 0x21F2, 0x21F3, 0x21F4, 0x21F5, 0x21F6, 0x21F7, + 0x21F8, 0x21F9, 0x21FA, 0x21FB, 0x21FC, 0x21FD, 0x21FE, 0x21FF +}; + +static const utf16_t page_24[256] = +{ + 0x2400, 0x2401, 0x2402, 0x2403, 0x2404, 0x2405, 0x2406, 0x2407, + 0x2408, 0x2409, 0x240A, 0x240B, 0x240C, 0x240D, 0x240E, 0x240F, + 0x2410, 0x2411, 0x2412, 0x2413, 0x2414, 0x2415, 0x2416, 0x2417, + 0x2418, 0x2419, 0x241A, 0x241B, 0x241C, 0x241D, 0x241E, 0x241F, + 0x2420, 0x2421, 0x2422, 0x2423, 0x2424, 0x2425, 0x2426, 0x2427, + 0x2428, 0x2429, 0x242A, 0x242B, 0x242C, 0x242D, 0x242E, 0x242F, + 0x2430, 0x2431, 0x2432, 0x2433, 0x2434, 0x2435, 0x2436, 0x2437, + 0x2438, 0x2439, 0x243A, 0x243B, 0x243C, 0x243D, 0x243E, 0x243F, + 0x2440, 0x2441, 0x2442, 0x2443, 0x2444, 0x2445, 0x2446, 0x2447, + 0x2448, 0x2449, 0x244A, 0x244B, 0x244C, 0x244D, 0x244E, 0x244F, + 0x2450, 0x2451, 0x2452, 0x2453, 0x2454, 0x2455, 0x2456, 0x2457, + 0x2458, 0x2459, 0x245A, 0x245B, 0x245C, 0x245D, 0x245E, 0x245F, + 0x2460, 0x2461, 0x2462, 0x2463, 0x2464, 0x2465, 0x2466, 0x2467, + 0x2468, 0x2469, 0x246A, 0x246B, 0x246C, 0x246D, 0x246E, 0x246F, + 0x2470, 0x2471, 0x2472, 0x2473, 0x2474, 0x2475, 0x2476, 0x2477, + 0x2478, 0x2479, 0x247A, 0x247B, 0x247C, 0x247D, 0x247E, 0x247F, + 0x2480, 0x2481, 0x2482, 0x2483, 0x2484, 0x2485, 0x2486, 0x2487, + 0x2488, 0x2489, 0x248A, 0x248B, 0x248C, 0x248D, 0x248E, 0x248F, + 0x2490, 0x2491, 0x2492, 0x2493, 0x2494, 0x2495, 0x2496, 0x2497, + 0x2498, 0x2499, 0x249A, 0x249B, 0x249C, 0x249D, 0x249E, 0x249F, + 0x24A0, 0x24A1, 0x24A2, 0x24A3, 0x24A4, 0x24A5, 0x24A6, 0x24A7, + 0x24A8, 0x24A9, 0x24AA, 0x24AB, 0x24AC, 0x24AD, 0x24AE, 0x24AF, + 0x24B0, 0x24B1, 0x24B2, 0x24B3, 0x24B4, 0x24B5, 0x24D0, 0x24D1, + 0x24D2, 0x24D3, 0x24D4, 0x24D5, 0x24D6, 0x24D7, 0x24D8, 0x24D9, + 0x24DA, 0x24DB, 0x24DC, 0x24DD, 0x24DE, 0x24DF, 0x24E0, 0x24E1, + 0x24E2, 0x24E3, 0x24E4, 0x24E5, 0x24E6, 0x24E7, 0x24E8, 0x24E9, + 0x24D0, 0x24D1, 0x24D2, 0x24D3, 0x24D4, 0x24D5, 0x24D6, 0x24D7, + 0x24D8, 0x24D9, 0x24DA, 0x24DB, 0x24DC, 0x24DD, 0x24DE, 0x24DF, + 0x24E0, 0x24E1, 0x24E2, 0x24E3, 0x24E4, 0x24E5, 0x24E6, 0x24E7, + 0x24E8, 0x24E9, 0x24EA, 0x24EB, 0x24EC, 0x24ED, 0x24EE, 0x24EF, + 0x24F0, 0x24F1, 0x24F2, 0x24F3, 0x24F4, 0x24F5, 0x24F6, 0x24F7, + 0x24F8, 0x24F9, 0x24FA, 0x24FB, 0x24FC, 0x24FD, 0x24FE, 0x24FF +}; + +static const utf16_t page_2C[256] = +{ + 0x2C30, 0x2C31, 0x2C32, 0x2C33, 0x2C34, 0x2C35, 0x2C36, 0x2C37, + 0x2C38, 0x2C39, 0x2C3A, 0x2C3B, 0x2C3C, 0x2C3D, 0x2C3E, 0x2C3F, + 0x2C40, 0x2C41, 0x2C42, 0x2C43, 0x2C44, 0x2C45, 0x2C46, 0x2C47, + 0x2C48, 0x2C49, 0x2C4A, 0x2C4B, 0x2C4C, 0x2C4D, 0x2C4E, 0x2C4F, + 0x2C50, 0x2C51, 0x2C52, 0x2C53, 0x2C54, 0x2C55, 0x2C56, 0x2C57, + 0x2C58, 0x2C59, 0x2C5A, 0x2C5B, 0x2C5C, 0x2C5D, 0x2C5E, 0x2C2F, + 0x2C30, 0x2C31, 0x2C32, 0x2C33, 0x2C34, 0x2C35, 0x2C36, 0x2C37, + 0x2C38, 0x2C39, 0x2C3A, 0x2C3B, 0x2C3C, 0x2C3D, 0x2C3E, 0x2C3F, + 0x2C40, 0x2C41, 0x2C42, 0x2C43, 0x2C44, 0x2C45, 0x2C46, 0x2C47, + 0x2C48, 0x2C49, 0x2C4A, 0x2C4B, 0x2C4C, 0x2C4D, 0x2C4E, 0x2C4F, + 0x2C50, 0x2C51, 0x2C52, 0x2C53, 0x2C54, 0x2C55, 0x2C56, 0x2C57, + 0x2C58, 0x2C59, 0x2C5A, 0x2C5B, 0x2C5C, 0x2C5D, 0x2C5E, 0x2C5F, + 0x2C61, 0x2C61, 0x026B, 0x1D7D, 0x027D, 0x2C65, 0x2C66, 0x2C68, + 0x2C68, 0x2C6A, 0x2C6A, 0x2C6C, 0x2C6C, 0x2C6D, 0x2C6E, 0x2C6F, + 0x2C70, 0x2C71, 0x2C72, 0x2C73, 0x2C74, 0x2C76, 0x2C76, 0x2C77, + 0x2C78, 0x2C79, 0x2C7A, 0x2C7B, 0x2C7C, 0x2C7D, 0x2C7E, 0x2C7F, + 0x2C81, 0x2C81, 0x2C83, 0x2C83, 0x2C85, 0x2C85, 0x2C87, 0x2C87, + 0x2C89, 0x2C89, 0x2C8B, 0x2C8B, 0x2C8D, 0x2C8D, 0x2C8F, 0x2C8F, + 0x2C91, 0x2C91, 0x2C93, 0x2C93, 0x2C95, 0x2C95, 0x2C97, 0x2C97, + 0x2C99, 0x2C99, 0x2C9B, 0x2C9B, 0x2C9D, 0x2C9D, 0x2C9F, 0x2C9F, + 0x2CA1, 0x2CA1, 0x2CA3, 0x2CA3, 0x2CA5, 0x2CA5, 0x2CA7, 0x2CA7, + 0x2CA9, 0x2CA9, 0x2CAB, 0x2CAB, 0x2CAD, 0x2CAD, 0x2CAF, 0x2CAF, + 0x2CB1, 0x2CB1, 0x2CB3, 0x2CB3, 0x2CB5, 0x2CB5, 0x2CB7, 0x2CB7, + 0x2CB9, 0x2CB9, 0x2CBB, 0x2CBB, 0x2CBD, 0x2CBD, 0x2CBF, 0x2CBF, + 0x2CC1, 0x2CC1, 0x2CC3, 0x2CC3, 0x2CC5, 0x2CC5, 0x2CC7, 0x2CC7, + 0x2CC9, 0x2CC9, 0x2CCB, 0x2CCB, 0x2CCD, 0x2CCD, 0x2CCF, 0x2CCF, + 0x2CD1, 0x2CD1, 0x2CD3, 0x2CD3, 0x2CD5, 0x2CD5, 0x2CD7, 0x2CD7, + 0x2CD9, 0x2CD9, 0x2CDB, 0x2CDB, 0x2CDD, 0x2CDD, 0x2CDF, 0x2CDF, + 0x2CE1, 0x2CE1, 0x2CE3, 0x2CE3, 0x2CE4, 0x2CE5, 0x2CE6, 0x2CE7, + 0x2CE8, 0x2CE9, 0x2CEA, 0x2CEB, 0x2CEC, 0x2CED, 0x2CEE, 0x2CEF, + 0x2CF0, 0x2CF1, 0x2CF2, 0x2CF3, 0x2CF4, 0x2CF5, 0x2CF6, 0x2CF7, + 0x2CF8, 0x2CF9, 0x2CFA, 0x2CFB, 0x2CFC, 0x2CFD, 0x2CFE, 0x2CFF +}; + +static const utf16_t page_FF[256] = +{ + 0xFF00, 0xFF01, 0xFF02, 0xFF03, 0xFF04, 0xFF05, 0xFF06, 0xFF07, + 0xFF08, 0xFF09, 0xFF0A, 0xFF0B, 0xFF0C, 0xFF0D, 0xFF0E, 0xFF0F, + 0xFF10, 0xFF11, 0xFF12, 0xFF13, 0xFF14, 0xFF15, 0xFF16, 0xFF17, + 0xFF18, 0xFF19, 0xFF1A, 0xFF1B, 0xFF1C, 0xFF1D, 0xFF1E, 0xFF1F, + 0xFF20, 0xFF41, 0xFF42, 0xFF43, 0xFF44, 0xFF45, 0xFF46, 0xFF47, + 0xFF48, 0xFF49, 0xFF4A, 0xFF4B, 0xFF4C, 0xFF4D, 0xFF4E, 0xFF4F, + 0xFF50, 0xFF51, 0xFF52, 0xFF53, 0xFF54, 0xFF55, 0xFF56, 0xFF57, + 0xFF58, 0xFF59, 0xFF5A, 0xFF3B, 0xFF3C, 0xFF3D, 0xFF3E, 0xFF3F, + 0xFF40, 0xFF41, 0xFF42, 0xFF43, 0xFF44, 0xFF45, 0xFF46, 0xFF47, + 0xFF48, 0xFF49, 0xFF4A, 0xFF4B, 0xFF4C, 0xFF4D, 0xFF4E, 0xFF4F, + 0xFF50, 0xFF51, 0xFF52, 0xFF53, 0xFF54, 0xFF55, 0xFF56, 0xFF57, + 0xFF58, 0xFF59, 0xFF5A, 0xFF5B, 0xFF5C, 0xFF5D, 0xFF5E, 0xFF5F, + 0xFF60, 0xFF61, 0xFF62, 0xFF63, 0xFF64, 0xFF65, 0xFF66, 0xFF67, + 0xFF68, 0xFF69, 0xFF6A, 0xFF6B, 0xFF6C, 0xFF6D, 0xFF6E, 0xFF6F, + 0xFF70, 0xFF71, 0xFF72, 0xFF73, 0xFF74, 0xFF75, 0xFF76, 0xFF77, + 0xFF78, 0xFF79, 0xFF7A, 0xFF7B, 0xFF7C, 0xFF7D, 0xFF7E, 0xFF7F, + 0xFF80, 0xFF81, 0xFF82, 0xFF83, 0xFF84, 0xFF85, 0xFF86, 0xFF87, + 0xFF88, 0xFF89, 0xFF8A, 0xFF8B, 0xFF8C, 0xFF8D, 0xFF8E, 0xFF8F, + 0xFF90, 0xFF91, 0xFF92, 0xFF93, 0xFF94, 0xFF95, 0xFF96, 0xFF97, + 0xFF98, 0xFF99, 0xFF9A, 0xFF9B, 0xFF9C, 0xFF9D, 0xFF9E, 0xFF9F, + 0xFFA0, 0xFFA1, 0xFFA2, 0xFFA3, 0xFFA4, 0xFFA5, 0xFFA6, 0xFFA7, + 0xFFA8, 0xFFA9, 0xFFAA, 0xFFAB, 0xFFAC, 0xFFAD, 0xFFAE, 0xFFAF, + 0xFFB0, 0xFFB1, 0xFFB2, 0xFFB3, 0xFFB4, 0xFFB5, 0xFFB6, 0xFFB7, + 0xFFB8, 0xFFB9, 0xFFBA, 0xFFBB, 0xFFBC, 0xFFBD, 0xFFBE, 0xFFBF, + 0xFFC0, 0xFFC1, 0xFFC2, 0xFFC3, 0xFFC4, 0xFFC5, 0xFFC6, 0xFFC7, + 0xFFC8, 0xFFC9, 0xFFCA, 0xFFCB, 0xFFCC, 0xFFCD, 0xFFCE, 0xFFCF, + 0xFFD0, 0xFFD1, 0xFFD2, 0xFFD3, 0xFFD4, 0xFFD5, 0xFFD6, 0xFFD7, + 0xFFD8, 0xFFD9, 0xFFDA, 0xFFDB, 0xFFDC, 0xFFDD, 0xFFDE, 0xFFDF, + 0xFFE0, 0xFFE1, 0xFFE2, 0xFFE3, 0xFFE4, 0xFFE5, 0xFFE6, 0xFFE7, + 0xFFE8, 0xFFE9, 0xFFEA, 0xFFEB, 0xFFEC, 0xFFED, 0xFFEE, 0xFFEF, + 0xFFF0, 0xFFF1, 0xFFF2, 0xFFF3, 0xFFF4, 0xFFF5, 0xFFF6, 0xFFF7, + 0xFFF8, 0xFFF9, 0xFFFA, 0xFFFB, 0xFFFC, 0xFFFD, 0xFFFE, 0xFFFF +}; + +static const utf16_t *pages[256] = +{ + page_00, page_01, page_02, page_03, page_04, page_05, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + page_10, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, page_1E, page_1F, + NULL, page_21, NULL, NULL, page_24, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, page_2C, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, page_FF +}; + + +/* + *----------------------------------------------------------------------------- + * + * UnicodeSimpleCaseFold -- + * + * Performs simple Unicode case folding on the input UTF-16 code + * unit for case-insensitive, locale-agnostic matching of strings. + * + * Case folding means the code unit is upper-cased, then lower-cased. + * + * "Simple" means: + * + * 1) Only code points between U+0000 and U+FFFF are handled. + * (Case-sensitive Deseret characters between U+10400 and + * U+10427 are not handled.) + * + * 2) Code units that would normally grow in length when folded + * (German sharp S U+00DF: 'straBe' -> 'STRASSE' -> 'strasse') + * are ignored. + * + * Case folding does not handle normalization, so decomposed + * (A followed by ACCENT ACUTE) characters do not match precomposed + * (A WITH ACCENT ACCUTE) character. + * + * Results: + * The case-folded code unit. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +utf16_t +UnicodeSimpleCaseFold(utf16_t codeUnit) // IN +{ + const utf16_t *page = pages[codeUnit >> 8]; + + if (!page) { + return codeUnit; + } + + return page[codeUnit & 0xFF]; +} diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/unicode/unicodeSimpleOperations.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/unicode/unicodeSimpleOperations.c --- open-vm-tools-2008.01.23-74039/lib/unicode/unicodeSimpleOperations.c 2008-01-28 08:02:51.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/unicode/unicodeSimpleOperations.c 2008-10-13 08:01:52.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -29,7 +29,7 @@ #include "unicodeBase.h" #include "unicodeInt.h" #include "unicodeOperations.h" -#include "unicodeSimpleUTF16.h" +#include "codeset.h" /* @@ -78,8 +78,8 @@ int result = -1; Unicode substr1 = NULL; Unicode substr2 = NULL; - const utf16_t *substr1UTF16; - const utf16_t *substr2UTF16; + utf16_t *substr1UTF16 = NULL; + utf16_t *substr2UTF16 = NULL; UnicodeIndex i = 0; UnicodeIndex utf16Index; utf16_t codeUnit1; @@ -106,26 +106,41 @@ } /* - * XXX TODO: Need to case-fold the strings if ignoreCase is set. * XXX TODO: Need to normalize the incoming strings to NFC or NFD. */ - substr1UTF16 = Unicode_GetUTF16(substr1); + substr1UTF16 = Unicode_GetAllocUTF16(substr1); if (!substr1UTF16) { goto out; } - substr2UTF16 = Unicode_GetUTF16(substr2); + substr2UTF16 = Unicode_GetAllocUTF16(substr2); if (!substr2UTF16) { goto out; } /* * TODO: This is the naive string search algorithm, which is + * O(n * m). We can do better with KMP or Boyer-Moore if this + * proves to be a bottleneck. */ while (TRUE) { codeUnit1 = *(substr1UTF16 + i); codeUnit2 = *(substr2UTF16 + i); + /* + * TODO: Simple case folding doesn't handle the situation where + * more than one code unit is needed to store the result of the + * case folding. + * + * This means that German "straBe" (where B = sharp S, U+00DF) + * will not match "STRASSE", even though the two strings are the + * same. + */ + if (ignoreCase) { + codeUnit1 = UnicodeSimpleCaseFold(codeUnit1); + codeUnit2 = UnicodeSimpleCaseFold(codeUnit2); + } + if (codeUnit1 != codeUnit2) { break; } @@ -176,13 +191,11 @@ } out: - if (substr1) { - Unicode_Free(substr1); - } + free(substr1UTF16); + free(substr2UTF16); - if (substr2) { - Unicode_Free(substr2); - } + Unicode_Free(substr1); + Unicode_Free(substr2); return result; } @@ -455,3 +468,83 @@ return (Unicode)result; } + + +/* + *----------------------------------------------------------------------------- + * + * Unicode_Join -- + * + * Allocates and returns a new string containing the 'first' followed by + * all the unicode strings specified as optional arguments (which must + * be of type ConstUnicode). Appending ceases when a NULL pointer is + * detected. + * + * Results: + * The newly-allocated string. Caller must free with Unicode_Free. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +Unicode +Unicode_Join(ConstUnicode first, // IN: + ...) // IN +{ + va_list args; + Unicode result; + ConstUnicode cur; + + if (first == NULL) { + return NULL; + } + + result = Unicode_Duplicate(first); + + va_start(args, first); + + while ((cur = va_arg(args, ConstUnicode)) != NULL) { + Unicode temp; + + temp = Unicode_Append(result, cur); + Unicode_Free(result); + result = temp; + } + + va_end(args); + + return result; +} + + +/* + *----------------------------------------------------------------------------- + * + * Unicode_Format -- + * + * Format a Unicode string (roughly equivalent to Str_Asprintf()). + * + * Results: + * The formatted string. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +Unicode +Unicode_Format(const char *fmt, // IN: the format + ...) // IN: the arguments +{ + va_list args; + char *p; + + va_start(args, fmt); + p = Str_Vasprintf(NULL, fmt, args); + va_end(args); + + return p; +} diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/unicode/unicodeSimpleTransforms.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/unicode/unicodeSimpleTransforms.c --- open-vm-tools-2008.01.23-74039/lib/unicode/unicodeSimpleTransforms.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/unicode/unicodeSimpleTransforms.c 2008-10-13 08:01:53.000000000 +0100 @@ -0,0 +1,462 @@ +/********************************************************* + * Copyright (C) 2007 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. + * + *********************************************************/ + +/* + * unicodeSimpleTransforms.c -- + * + * Simple UTF-8 implementation of unicodeTransforms.h interface. + */ + +#include "vmware.h" + +#include "unicodeBase.h" +#include "unicodeInt.h" +#include "unicodeTransforms.h" + +static INLINE Bool UnicodeSimpleIsWhiteSpace(utf16_t codeUnit); + +/* + * Tables generated from bora/lib/unicode/makeWhitespacePages.c, + * running against ICU 3.8 (which implements Unicode 5.0.0). + * + * The table wspg_XY denotes the whitespace characters in the Unicode + * range U+XY00 to U+XYFF (where XY is the hexadecimal upper byte of + * the 16-bit Unicode code point value). + */ + +static const Bool wspg_00[256] = +{ + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + /* + * TODO: U+00A0 (no-break space) is not treated as whitespace by + * ICU's UnicodeString::trim(). Do we want to do the same? + */ + TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, +}; + +static const Bool wspg_16[256] = +{ + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, +}; + +static const Bool wspg_18[256] = +{ + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, +}; + +static const Bool wspg_20[256] = +{ + TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, + TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, +}; + +static const Bool wspg_30[256] = +{ + TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, + FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, +}; + +static const Bool *whitespacePages[256] = +{ + wspg_00, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, wspg_16, NULL, + wspg_18, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + wspg_20, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + wspg_30, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, + NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, +}; + +typedef enum { + UNICODE_TRIMLEFT = 0x1, + UNICODE_TRIMRIGHT = 0x2, + UNICODE_TRIMBOTH = (UNICODE_TRIMLEFT | UNICODE_TRIMRIGHT), +} UnicodeTrimSide; + + +/* + *----------------------------------------------------------------------------- + * + * UnicodeSimpleIsWhiteSpace -- + * + * Checks if the UTF-16 code unit represents white space. + * + * Results: + * TRUE if the code unit represents white space, FALSE otherwise. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static INLINE Bool +UnicodeSimpleIsWhiteSpace(utf16_t codeUnit) // IN +{ + const Bool *page = whitespacePages[codeUnit >> 8]; + + if (!page) { + return FALSE; + } + + return page[codeUnit & 0xFF]; +} + + +/* + *----------------------------------------------------------------------------- + * + * Unicode_FoldCase -- + * + * Creates a Unicode string with standardized case by performing + * simple case folding (upper-case, then lower-case) on the + * input string. + * + * Results: + * The allocated Unicode string. Caller must free with Unicode_Free(). + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +Unicode +Unicode_FoldCase(ConstUnicode str) // IN +{ + Unicode folded; + utf16_t *utf16; + utf16_t *utf16Current; + + ASSERT(str); + + utf16 = Unicode_GetAllocBytes(str, STRING_ENCODING_UTF16); + + utf16Current = utf16; + while (*utf16Current) { + *utf16Current = UnicodeSimpleCaseFold(*utf16Current); + utf16Current++; + } + + folded = Unicode_AllocWithUTF16(utf16); + free(utf16); + + return folded; +} + + +/* + *----------------------------------------------------------------------------- + * + * UnicodeTrimInternal -- + * + * Creates a Unicode string by trimming whitespace from the beginning + * and/or end of the input string, depending on the input parameter "side". + * + * Results: + * The allocated Unicode string. Caller must free with Unicode_Free(). + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static Unicode +UnicodeTrimInternal(ConstUnicode str, // IN + UnicodeTrimSide side) // IN +{ + Unicode trimmed; + utf16_t *utf16; + utf16_t *utf16Start; + utf16_t *utf16End; + + ASSERT(str); + + utf16 = Unicode_GetAllocBytes(str, STRING_ENCODING_UTF16); + utf16Start = utf16; + utf16End = utf16 + Unicode_UTF16Strlen(utf16); + + if (side & UNICODE_TRIMLEFT) { + while (utf16Start != utf16End && UnicodeSimpleIsWhiteSpace(*utf16Start)) { + utf16Start++; + } + } + + if (side & UNICODE_TRIMRIGHT) { + while (utf16End != utf16Start && UnicodeSimpleIsWhiteSpace(*(utf16End - 1))) { + utf16End--; + } + } + + *utf16End = 0; + + trimmed = Unicode_AllocWithUTF16(utf16Start); + free(utf16); + + return trimmed; +} + + +/* + *----------------------------------------------------------------------------- + * + * Unicode_Trim -- + * + * Creates a Unicode string by trimming whitespace from the beginning + * and end of the input string. + * + * Results: + * The allocated Unicode string. Caller must free with Unicode_Free(). + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +Unicode +Unicode_Trim(ConstUnicode str) // IN +{ + return UnicodeTrimInternal(str, UNICODE_TRIMBOTH); +} + + +/* + *----------------------------------------------------------------------------- + * + * Unicode_TrimLeft -- + * + * Creates a Unicode string by trimming whitespace from the beginning of the + * input string. + * + * Results: + * The allocated Unicode string. Caller must free with Unicode_Free(). + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +Unicode +Unicode_TrimLeft(ConstUnicode str) // IN +{ + return UnicodeTrimInternal(str, UNICODE_TRIMLEFT); +} + + +/* + *----------------------------------------------------------------------------- + * + * Unicode_TrimRight -- + * + * Creates a Unicode string by trimming whitespace from the end of the + * input string. + * + * Results: + * The allocated Unicode string. Caller must free with Unicode_Free(). + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +Unicode +Unicode_TrimRight(ConstUnicode str) // IN +{ + return UnicodeTrimInternal(str, UNICODE_TRIMRIGHT); +} diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/unicode/unicodeSimpleTypes.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/unicode/unicodeSimpleTypes.c --- open-vm-tools-2008.01.23-74039/lib/unicode/unicodeSimpleTypes.c 2008-01-28 08:02:51.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/unicode/unicodeSimpleTypes.c 2008-10-13 08:01:52.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -28,98 +28,2154 @@ #include "unicodeBase.h" #include "unicodeInt.h" +#include "codeset.h" #include "vm_assert.h" #include "util.h" +#include "hashTable.h" static char *UnicodeNormalizeEncodingName(const char *encoding); /* - * Table generated from selected encodings supported by ICU: + * Cross reference of IANA character set names, windows code pages + * and ICU encodings * - * http://source.icu-project.org/repos/icu/icu/trunk/source/data/mappings/convrtrs.txt + * See: http://www.iana.org/assignments/character-sets + * http://msdn2.microsoft.com/en-us/library/ms776446(VS.85).aspx + * http://demo.icu-project.org/icu-bin/convexp * - * If you update this, you must keep the StringEncoding enum in - * lib/public/unicodeTypes.h in sync! + * If you add new StringEncodings to this table, you must keep the + * StringEncoding enum in lib/public/unicodeTypes.h in sync! */ -static const char *SIMPLE_ENCODING_LIST[STRING_ENCODING_MAX_SPECIFIED] = { + +#define MAXCHARSETNAMES 20 +#define MIBUNDEF (-1) +#define WINUNDEF (-1) +#define SUPPORTED TRUE +#define UNSUPPORTED FALSE + +static struct xRef { + int MIBenum; // Assigned by IANA + int winACP; // Windows code page from GetACP() + StringEncoding encoding; // ICU encoding enum + Bool isSupported; // VMware supported encoding + int preferredMime; // Index of preferred MIME name + char *names[MAXCHARSETNAMES]; // Encoding name and aliases +} xRef[] = { + /* + * Source: ECMA registry + */ + { 3, 20127, STRING_ENCODING_US_ASCII, SUPPORTED, 4, + { "ANSI_X3.4-1968", "iso-ir-6", "ANSI_X3.4-1986", "ISO_646.irv:1991", + "ASCII", "ISO646-US", "US-ASCII", "us", "IBM367", "cp367", "csASCII", + "646", "ascii7", NULL } + }, + /* + * Source: ECMA registry + */ + { 4, 28591, STRING_ENCODING_ISO_8859_1, SUPPORTED, 3, + { "ISO_8859-1:1987", "iso-ir-100", "ISO_8859-1", "ISO-8859-1", "latin1", + "l1", "IBM819", "CP819", "csISOLatin1", "8859_1", "819", NULL } + }, + /* + * Source: ECMA registry + */ + { 5, 28592, STRING_ENCODING_ISO_8859_2, SUPPORTED, 3, + { "ISO_8859-2:1987", "iso-ir-101", "ISO_8859-2", "ISO-8859-2", "latin2", + "l2", "csISOLatin2", "ibm-912_P100-1995", "ibm-912", "8859_2", "cp912", + "912", NULL } + }, + /* + * Source: ECMA registry + */ + { 6, 28593, STRING_ENCODING_ISO_8859_3, SUPPORTED, 3, + { "ISO_8859-3:1988", "iso-ir-109", "ISO_8859-3", "ISO-8859-3", "latin3", + "l3", "csISOLatin3", "ibm-913_P100-2000", "ibm-913", "8859_3", "cp913", + "913", NULL } + }, + /* + * Source: ECMA registry + */ + { 7, 28594, STRING_ENCODING_ISO_8859_4, SUPPORTED, 3, + { "ISO_8859-4:1988", "iso-ir-110", "ISO_8859-4", "ISO-8859-4", "latin4", + "l4", "csISOLatin4", "ibm-914_P100-1995", "ibm-914", "8859_4", "cp914", + "914", NULL } + }, + /* + * Source: ECMA registry + */ + { 8, 28595, STRING_ENCODING_ISO_8859_5, SUPPORTED, 3, + { "ISO_8859-5:1988", "iso-ir-144", "ISO_8859-5", "ISO-8859-5", "cyrillic", + "csISOLatinCyrillic", "ibm-915_P100-1995", "ibm-915", "8859_5", "cp915", + "915", NULL } + }, + /* + * Source: ECMA registry + */ + { 9, 28596, STRING_ENCODING_ISO_8859_6, SUPPORTED, 3, + { "ISO_8859-6:1987", "iso-ir-127", "ISO_8859-6", "ISO-8859-6", "ECMA-114", + "ASMO-708", "arabic", "csISOLatinArabic", "ibm-1089_P100-1995", + "ibm-1089", "8859_6", "cp1089", "1089", NULL } + }, + /* + * Source: Windows duplicate of ISO-8859-6 + */ + { 9, 708, STRING_ENCODING_ISO_8859_6, SUPPORTED, 0, + { "ASMO-708", NULL } + }, + /* + * Source: ECMA registry + */ + { 10, 28597, STRING_ENCODING_ISO_8859_7, SUPPORTED, 3, + { "ISO_8859-7:1987", "iso-ir-126", "ISO_8859-7", "ISO-8859-7", "ELOT_928", + "ECMA-118", "greek", "greek8", "csISOLatinGreek", "ibm-9005_X110-2007", + "ibm-9005", "sun_eu_greek", NULL } + }, + /* + * Source: ECMA registry + */ + { 11, 28598, STRING_ENCODING_ISO_8859_8, SUPPORTED, 3, + { "ISO_8859-8:1988", "iso-ir-138", "ISO_8859-8", "ISO-8859-8", "hebrew", + "csISOLatinHebrew", "ibm-5012_P100-1999", "ibm-5012", "8859_8", NULL } + }, + /* + * Source: ECMA registry + */ + { 12, 28599, STRING_ENCODING_ISO_8859_9, SUPPORTED, 3, + { "ISO_8859-9:1989", "iso-ir-148", "ISO_8859-9", "ISO-8859-9", "latin5", + "l5", "csISOLatin5", "ibm-920_P100-1995", "ibm-920", "8859_9", "cp920", + "920", "ECMA-128", NULL } + }, + /* + * Source: ECMA registry + */ + { 13, WINUNDEF, STRING_ENCODING_ISO_8859_10, SUPPORTED, 0, + { "ISO-8859-10", "iso-ir-157", "l6", "ISO_8859-10:1992", "csISOLatin6", + "latin6", NULL } + }, + /* + * Source: ECMA registry and ISO 6937-2:1983 + */ + { 14, WINUNDEF, STRING_ENCODING_ISO_6937_2_ADD, UNSUPPORTED, 0, + { "ISO_6937-2-add", "iso-ir-142", "csISOTextComm", NULL } + }, + /* + * Source: JIS X 0201-1976. One byte only, this is equivalent to + * JIS/Roman (similar to ASCII) plus eight-bit half-width + * Katakana + */ + { 15, WINUNDEF, STRING_ENCODING_JIS_X0201, UNSUPPORTED, 0, + { "JIS_X0201", "X0201", "csHalfWidthKatakana", NULL } + }, + /* + * Source: JIS X 0202-1991. Uses ISO 2022 escape sequences to + * shift code sets as documented in JIS X 0202-1991. + */ + { 16, WINUNDEF, STRING_ENCODING_JIS_ENCODING, UNSUPPORTED, 0, + { "JIS_Encoding", "csJISEncoding", NULL } + }, + /* + * Source: This charset is an extension of csHalfWidthKatakana by + * adding graphic characters in JIS X 0208. The CCS's are + * JIS X0201:1997 and JIS X0208:1997. The + * complete definition is shown in Appendix 1 of JIS + * X0208:1997. + * This charset can be used for the top-level media type "text". + */ + { 17, 932, STRING_ENCODING_SHIFT_JIS, SUPPORTED, 0, + { "Shift_JIS", "MS_Kanji", "csShiftJIS", "ibm-943_P15A-2003", "ibm-943", + "x-sjis", "x-ms-cp932", "cp932", "cp943c", "IBM-943C", "ms932", "pck", + "sjis", "ibm-943_VSUB_VPUA", NULL } + }, + /* + * Source: Standardized by OSF, UNIX International, and UNIX Systems + * Laboratories Pacific. Uses ISO 2022 rules to select + * code set 0: US-ASCII (a single 7-bit byte set) + * code set 1: JIS X0208-1990 (a double 8-bit byte set) + * restricted to A0-FF in both bytes + * code set 2: Half Width Katakana (a single 7-bit byte set) + * requiring SS2 as the character prefix + * code set 3: JIS X0212-1990 (a double 7-bit byte set) + * restricted to A0-FF in both bytes + * requiring SS3 as the character prefix + */ + { 18, 20932, STRING_ENCODING_EUC_JP, UNSUPPORTED, 2, + { "Extended_UNIX_Code_Packed_Format_for_Japanese", "csEUCPkdFmtJapanese", + "EUC-JP", NULL } + }, + /* + * Windows duplicate of EUC-JP + */ + { 18, 51932, STRING_ENCODING_EUC_JP, UNSUPPORTED, 2, + { "Extended_UNIX_Code_Packed_Format_for_Japanese", "csEUCPkdFmtJapanese", + "EUC-JP", NULL } + }, + /* + * Source: Used in Japan. Each character is 2 octets. + * code set 0: US-ASCII (a single 7-bit byte set) + * 1st byte = 00 + * 2nd byte = 20-7E + * code set 1: JIS X0208-1990 (a double 7-bit byte set) + * restricted to A0-FF in both bytes + * code set 2: Half Width Katakana (a single 7-bit byte set) + * 1st byte = 00 + * 2nd byte = A0-FF + * code set 3: JIS X0212-1990 (a double 7-bit byte set) + * restricted to A0-FF in + * the first byte + * and 21-7E in the second byte + */ + { 19, WINUNDEF, STRING_ENCODING_EXTENDED_UNIX_CODE_FIXED_WIDTH_FOR_JAPANESE, + UNSUPPORTED, 0, + { "Extended_UNIX_Code_Fixed_Width_for_Japanese", "csEUCFixWidJapanese", + NULL } + }, + /* + * Source: ECMA registry + */ + { 20, WINUNDEF, STRING_ENCODING_BS_4730, UNSUPPORTED, 0, + { "BS_4730", "iso-ir-4", "ISO646-GB", "gb", "uk", "csISO4UnitedKingdom", + NULL } + }, + /* + * Source: ECMA registry + */ + { 21, WINUNDEF, STRING_ENCODING_SEN_850200_C, UNSUPPORTED, 0, + { "SEN_850200_C", "iso-ir-11", "ISO646-SE2", "se2", + "csISO11SwedishForNames", NULL } + }, + /* + * Source: ECMA registry + */ + { 22, WINUNDEF, STRING_ENCODING_IT, UNSUPPORTED, 0, + { "IT", "iso-ir-15", "ISO646-IT", "csISO15Italian", NULL } + }, + /* + * Source: ECMA registry + */ + { 23, WINUNDEF, STRING_ENCODING_ES, UNSUPPORTED, 0, + { "ES", "iso-ir-17", "ISO646-ES", "csISO17Spanish", NULL } + }, + /* + * Source: ECMA registry + */ + { 24, WINUNDEF, STRING_ENCODING_DIN_66003, UNSUPPORTED, 0, + { "DIN_66003", "iso-ir-21", "de", "ISO646-DE", "csISO21German", NULL } + }, + /* + * Source: ECMA registry + */ + { 25, WINUNDEF, STRING_ENCODING_NS_4551_1, UNSUPPORTED, 0, + { "NS_4551-1", "iso-ir-60", "ISO646-NO", "no", "csISO60DanishNorwegian", + "csISO60Norwegian1", NULL } + }, + /* + * Source: ECMA registry + */ + { 26, WINUNDEF, STRING_ENCODING_NF_Z_62_010, UNSUPPORTED, 0, + { "NF_Z_62-010", "iso-ir-69", "ISO646-FR", "fr", "csISO69French", NULL } + }, + /* + * Source: Universal Transfer Format (1), this is the multibyte + * encoding, that subsets ASCII-7. It does not have byte + * ordering issues. + */ + { 27, WINUNDEF, STRING_ENCODING_ISO_10646_UTF_1, UNSUPPORTED, 0, + { "ISO-10646-UTF-1", "csISO10646UTF1", NULL } + }, + /* + * Source: ECMA registry + */ + { 28, WINUNDEF, STRING_ENCODING_ISO_646_BASIC_1983, UNSUPPORTED, 0, + { "ISO_646.basic:1983", "ref", "csISO646basic1983", NULL } + }, + { 29, WINUNDEF, STRING_ENCODING_INVARIANT, UNSUPPORTED, 0, + { "INVARIANT", "csINVARIANT", NULL } + }, + /* + * Source: ECMA registry + */ + { 30, WINUNDEF, STRING_ENCODING_ISO_646_IRV_1983, SUPPORTED, 0, + { "ISO_646.irv:1983", "iso-ir-2", "irv", "csISO2IntlRefVersion", NULL } + }, + /* + * Source: ECMA registry + */ + { 31, WINUNDEF, STRING_ENCODING_NATS_SEFI, UNSUPPORTED, 0, + { "NATS-SEFI", "iso-ir-8-1", "csNATSSEFI", NULL } + }, + /* + * Source: ECMA registry + */ + { 32, WINUNDEF, STRING_ENCODING_NATS_SEFI_ADD, UNSUPPORTED, 0, + { "NATS-SEFI-ADD", "iso-ir-8-2", "csNATSSEFIADD", NULL } + }, + /* + * Source: ECMA registry + */ + { 33, WINUNDEF, STRING_ENCODING_NATS_DANO, UNSUPPORTED, 0, + { "NATS-DANO", "iso-ir-9-1", "csNATSDANO", NULL } + }, + /* + * Source: ECMA registry + */ + { 34, WINUNDEF, STRING_ENCODING_NATS_DANO_ADD, UNSUPPORTED, 0, + { "NATS-DANO-ADD", "iso-ir-9-2", "csNATSDANOADD", NULL } + }, + /* + * Source: ECMA registry + */ + { 35, WINUNDEF, STRING_ENCODING_SEN_850200_B, UNSUPPORTED, 0, + { "SEN_850200_B", "iso-ir-10", "FI", "ISO646-FI", "ISO646-SE", "se", + "csISO10Swedish", NULL } + }, + /* + * Source: ECMA registry + */ + { 36, 949, STRING_ENCODING_KS_C_5601_1987, SUPPORTED, 0, + { "KS_C_5601-1987", "iso-ir-149", "KS_C_5601-1989", "KSC_5601", "korean", + "csKSC56011987", "ibm-1363_P11B-1998", "ibm-1363", "cp1363", "5601", + "ksc", "ibm-1363_VSUB_VPUA", NULL } + }, + /* + * Source: RFC-1557 (see also KS_C_5601-1987) + */ + { 37, 50225, STRING_ENCODING_ISO_2022_KR, UNSUPPORTED, 0, + { "ISO-2022-KR", "csISO2022KR", NULL } + }, + /* + * Source: RFC-1557 (see also KS_C_5861-1992) + */ + { 38, 51949, STRING_ENCODING_EUC_KR, UNSUPPORTED, 0, + { "EUC-KR", "csEUCKR", NULL } + }, + /* + * Source: RFC-1468 (see also RFC-2237) + */ + { 39, 50220, STRING_ENCODING_ISO_2022_JP, UNSUPPORTED, 0, + { "ISO-2022-JP", "csISO2022JP", NULL } + }, + /* + * Source: VMware + */ + { MIBUNDEF, WINUNDEF, STRING_ENCODING_ISO_2022_JP_1, UNSUPPORTED, 0, + { "ISO-2022-JP-1", NULL } + }, + /* + * Source: RFC-1554 + */ + { 40, WINUNDEF, STRING_ENCODING_ISO_2022_JP_2, UNSUPPORTED, 0, + { "ISO-2022-JP-2", "csISO2022JP2", NULL } + }, + /* + * Source: ECMA registry + */ + { 41, WINUNDEF, STRING_ENCODING_JIS_C6220_1969_JP, UNSUPPORTED, 0, + { "JIS_C6220-1969-jp", "JIS_C6220-1969", "iso-ir-13", "katakana", + "x0201-7", "csISO13JISC6220jp", NULL } + }, + /* + * Source: ECMA registry + */ + { 42, WINUNDEF, STRING_ENCODING_JIS_C6220_1969_RO, UNSUPPORTED, 0, + { "JIS_C6220-1969-ro", "iso-ir-14", "jp", "ISO646-JP", + "csISO14JISC6220ro", NULL } + }, + /* + * Source: ECMA registry + */ + { 43, WINUNDEF, STRING_ENCODING_PT, UNSUPPORTED, 0, + { "PT", "iso-ir-16", "ISO646-PT", "csISO16Portuguese", NULL } + }, + /* + * Source: ECMA registry + */ + { 44, WINUNDEF, STRING_ENCODING_GREEK7_OLD, UNSUPPORTED, 0, + { "greek7-old", "iso-ir-18", "csISO18Greek7Old", NULL } + }, + /* + * Source: ECMA registry + */ + { 45, WINUNDEF, STRING_ENCODING_LATIN_GREEK, UNSUPPORTED, 0, + { "latin-greek", "iso-ir-19", "csISO19LatinGreek", NULL } + }, + /* + * Source: ECMA registry + */ + { 46, WINUNDEF, STRING_ENCODING_NF_Z_62_010__1973_, UNSUPPORTED, 0, + { "NF_Z_62-010_(1973)", "iso-ir-25", "ISO646-FR1", "csISO25French", NULL } + }, + /* + * Source: ECMA registry + */ + { 47, WINUNDEF, STRING_ENCODING_LATIN_GREEK_1, UNSUPPORTED, 0, + { "Latin-greek-1", "iso-ir-27", "csISO27LatinGreek1", NULL } + }, + /* + * Source: ECMA registry + */ + { 48, WINUNDEF, STRING_ENCODING_ISO_5427, UNSUPPORTED, 0, + { "ISO_5427", "iso-ir-37", "csISO5427Cyrillic", NULL } + }, + /* + * Source: ECMA registry + */ + { 49, WINUNDEF, STRING_ENCODING_JIS_C6226_1978, UNSUPPORTED, 0, + { "JIS_C6226-1978", "iso-ir-42", "csISO42JISC62261978", NULL } + }, + /* + * Source: ECMA registry + */ + { 50, WINUNDEF, STRING_ENCODING_BS_VIEWDATA, UNSUPPORTED, 0, + { "BS_viewdata", "iso-ir-47", "csISO47BSViewdata", NULL } + }, + /* + * Source: ECMA registry + */ + { 51, WINUNDEF, STRING_ENCODING_INIS, UNSUPPORTED, 0, + { "INIS", "iso-ir-49", "csISO49INIS", NULL } + }, + /* + * Source: ECMA registry + */ + { 52, WINUNDEF, STRING_ENCODING_INIS_8, UNSUPPORTED, 0, + { "INIS-8", "iso-ir-50", "csISO50INIS8", NULL } + }, + /* + * Source: ECMA registry + */ + { 53, WINUNDEF, STRING_ENCODING_INIS_CYRILLIC, UNSUPPORTED, 0, + { "INIS-cyrillic", "iso-ir-51", "csISO51INISCyrillic", NULL } + }, + /* + * Source: ECMA registry + */ + { 54, WINUNDEF, STRING_ENCODING_ISO_5427_1981, UNSUPPORTED, 0, + { "ISO_5427:1981", "iso-ir-54", "ISO5427Cyrillic1981", NULL } + }, + /* + * Source: ECMA registry + */ + { 55, WINUNDEF, STRING_ENCODING_ISO_5428_1980, UNSUPPORTED, 0, + { "ISO_5428:1980", "iso-ir-55", "csISO5428Greek", NULL } + }, + /* + * Source: ECMA registry + */ + { 56, WINUNDEF, STRING_ENCODING_GB_1988_80, UNSUPPORTED, 0, + { "GB_1988-80", "iso-ir-57", "cn", "ISO646-CN", "csISO57GB1988", NULL } + }, + /* + * Source: ECMA registry + */ + { 57, 20936, STRING_ENCODING_GB_2312_80, UNSUPPORTED, 0, + { "GB_2312-80", "iso-ir-58", "chinese", "csISO58GB231280", NULL } + }, + /* + * Source: ECMA registry + */ + { 58, WINUNDEF, STRING_ENCODING_NS_4551_2, UNSUPPORTED, 0, + { "NS_4551-2", "ISO646-NO2", "iso-ir-61", "no2", "csISO61Norwegian2", NULL } + }, + /* + * Source: ECMA registry + */ + { 59, WINUNDEF, STRING_ENCODING_VIDEOTEX_SUPPL, UNSUPPORTED, 0, + { "videotex-suppl", "iso-ir-70", "csISO70VideotexSupp1", NULL } + }, + /* + * Source: ECMA registry + */ + { 60, WINUNDEF, STRING_ENCODING_PT2, UNSUPPORTED, 0, + { "PT2", "iso-ir-84", "ISO646-PT2", "csISO84Portuguese2", NULL } + }, + /* + * Source: ECMA registry + */ + { 61, WINUNDEF, STRING_ENCODING_ES2, UNSUPPORTED, 0, + { "ES2", "iso-ir-85", "ISO646-ES2", "csISO85Spanish2", NULL } + }, + /* + * Source: ECMA registry + */ + { 62, WINUNDEF, STRING_ENCODING_MSZ_7795_3, UNSUPPORTED, 0, + { "MSZ_7795.3", "iso-ir-86", "ISO646-HU", "hu", "csISO86Hungarian", NULL } + }, + /* + * Source: ECMA registry + */ + { 63, WINUNDEF, STRING_ENCODING_JIS_C6226_1983, UNSUPPORTED, 0, + { "JIS_C6226-1983", "iso-ir-87", "x0208", "JIS_X0208-1983", + "csISO87JISX0208", NULL } + }, + /* + * Source: ECMA registry + */ + { 64, WINUNDEF, STRING_ENCODING_GREEK7, UNSUPPORTED, 0, + { "greek7", "iso-ir-88", "csISO88Greek7", NULL } + }, + /* + * Source: ECMA registry + */ + { 65, WINUNDEF, STRING_ENCODING_ASMO_449, UNSUPPORTED, 0, + { "ASMO_449", "ISO_9036", "arabic7", "iso-ir-89", "csISO89ASMO449", NULL } + }, + /* + * Source: ECMA registry + */ + { 66, WINUNDEF, STRING_ENCODING_ISO_IR_90, UNSUPPORTED, 0, + { "iso-ir-90", "csISO90", NULL } + }, + /* + * Source: ECMA registry + */ + { 67, WINUNDEF, STRING_ENCODING_JIS_C6229_1984_A, UNSUPPORTED, 0, + { "JIS_C6229-1984-a", "iso-ir-91", "jp-ocr-a", "csISO91JISC62291984a", + NULL } + }, + /* + * Source: ECMA registry + */ + { 68, WINUNDEF, STRING_ENCODING_JIS_C6229_1984_B, UNSUPPORTED, 0, + { "JIS_C6229-1984-b", "iso-ir-92", "ISO646-JP-OCR-B", "jp-ocr-b", + "csISO92JISC62991984b", NULL } + }, + /* + * Source: ECMA registry + */ + { 69, WINUNDEF, STRING_ENCODING_JIS_C6229_1984_B_ADD, UNSUPPORTED, 0, + { "JIS_C6229-1984-b-add", "iso-ir-93", "jp-ocr-b-add", + "csISO93JIS62291984badd", NULL } + }, + /* + * Source: ECMA registry + */ + { 70, WINUNDEF, STRING_ENCODING_JIS_C6229_1984_HAND, UNSUPPORTED, 0, + { "JIS_C6229-1984-hand", "iso-ir-94", "jp-ocr-hand", + "csISO94JIS62291984hand", NULL } + }, + /* + * Source: ECMA registry + */ + { 71, WINUNDEF, STRING_ENCODING_JIS_C6229_1984_HAND_ADD, UNSUPPORTED, 0, + { "JIS_C6229-1984-hand-add", "iso-ir-95", "jp-ocr-hand-add", + "csISO95JIS62291984handadd", NULL } + }, + /* + * Source: ECMA registry + */ + { 72, WINUNDEF, STRING_ENCODING_JIS_C6229_1984_KANA, UNSUPPORTED, 0, + { "JIS_C6229-1984-kana", "iso-ir-96", "csISO96JISC62291984kana", NULL } + }, + /* + * Source: ECMA registry + */ + { 73, WINUNDEF, STRING_ENCODING_ISO_2033_1983, UNSUPPORTED, 0, + { "ISO_2033-1983", "iso-ir-98", "e13b", "csISO2033", NULL } + }, + /* + * Source: ECMA registry + */ + { 74, WINUNDEF, STRING_ENCODING_ANSI_X3_110_1983, UNSUPPORTED, 0, + { "ANSI_X3.110-1983", "iso-ir-99", "CSA_T500-1983", "NAPLPS", + "csISO99NAPLPS", NULL } + }, + /* + * Source: ECMA registry + */ + { 75, WINUNDEF, STRING_ENCODING_T_61_7BIT, UNSUPPORTED, 0, + { "T.61-7bit", "iso-ir-102", "csISO102T617bit", NULL } + }, + /* + * Source: ECMA registry + */ + { 76, 20261, STRING_ENCODING_T_61_8BIT, UNSUPPORTED, 0, + { "T.61-8bit", "T.61", "iso-ir-103", "csISO103T618bit", NULL } + }, + /* + * Source: ISO registry (formerly ECMA registry) + * http://www.itscj.ipsj.jp/ISO-IR/111.pdf + */ + { 77, WINUNDEF, STRING_ENCODING_ECMA_CYRILLIC, UNSUPPORTED, 0, + { "ECMA-cyrillic", "iso-ir-111", "KOI8-E", "csISO111ECMACyrillic", NULL } + }, + /* + * Source: ECMA registry + */ + { 78, WINUNDEF, STRING_ENCODING_CSA_Z243_4_1985_1, UNSUPPORTED, 0, + { "CSA_Z243.4-1985-1", "iso-ir-121", "ISO646-CA", "csa7-1", "ca", + "csISO121Canadian1", NULL } + }, + /* + * Source: ECMA registry + */ + { 79, WINUNDEF, STRING_ENCODING_CSA_Z243_4_1985_2, UNSUPPORTED, 0, + { "CSA_Z243.4-1985-2", "iso-ir-122", "ISO646-CA2", "csa7-2", + "csISO122Canadian2", NULL } + }, + /* + * Source: ECMA registry + */ + { 80, WINUNDEF, STRING_ENCODING_CSA_Z243_4_1985_GR, UNSUPPORTED, 0, + { "CSA_Z243.4-1985-gr", "iso-ir-123", "csISO123CSAZ24341985gr", NULL } + }, + /* + * Source: RFC1556 + */ + { 81, WINUNDEF, STRING_ENCODING_ISO_8859_6_E, SUPPORTED, 2, + { "ISO_8859-6-E", "csISO88596E", "ISO-8859-6-E", NULL } + }, + /* + * Source: RFC1556 + */ + { 82, WINUNDEF, STRING_ENCODING_ISO_8859_6_I, SUPPORTED, 2, + { "ISO_8859-6-I", "csISO88596I", "ISO-8859-6-I", NULL } + }, + /* + * Source: ECMA registry + */ + { 83, WINUNDEF, STRING_ENCODING_T_101_G2, UNSUPPORTED, 0, + { "T.101-G2", "iso-ir-128", "csISO128T101G2", NULL } + }, + /* + * Source: RFC1556 + */ + { 84, WINUNDEF, STRING_ENCODING_ISO_8859_8_E, SUPPORTED, 2, + { "ISO_8859-8-E", "csISO88598E", "ISO-8859-8-E", NULL } + }, + /* + * Source: RFC1556 + */ + { 85, WINUNDEF, STRING_ENCODING_ISO_8859_8_I, SUPPORTED, 2, + { "ISO_8859-8-I", "csISO88598I", "ISO-8859-8-I", NULL } + }, + /* + * Source: ECMA registry + */ + { 86, WINUNDEF, STRING_ENCODING_CSN_369103, UNSUPPORTED, 0, + { "CSN_369103", "iso-ir-139", "csISO139CSN369103", NULL } + }, + /* + * Source: ECMA registry + */ + { 87, WINUNDEF, STRING_ENCODING_JUS_I_B1_002, UNSUPPORTED, 0, + { "JUS_I.B1.002", "iso-ir-141", "ISO646-YU", "js", "yu", + "csISO141JUSIB1002", NULL } + }, + /* + * Source: ECMA registry + */ + { 88, WINUNDEF, STRING_ENCODING_IEC_P27_1, UNSUPPORTED, 0, + { "IEC_P27-1", "iso-ir-143", "csISO143IECP271", NULL } + }, + /* + * Source: ECMA registry + */ + { 89, WINUNDEF, STRING_ENCODING_JUS_I_B1_003_SERB, UNSUPPORTED, 0, + { "JUS_I.B1.003-serb", "iso-ir-146", "serbian", "csISO146Serbian", NULL } + }, + /* + * Source: ECMA registry + */ + { 90, WINUNDEF, STRING_ENCODING_JUS_I_B1_003_MAC, UNSUPPORTED, 0, + { "JUS_I.B1.003-mac", "macedonian", "iso-ir-147", "csISO147Macedonian", + NULL } + }, + /* + * Source: ECMA registry + */ + { 91, WINUNDEF, STRING_ENCODING_GREEK_CCITT, UNSUPPORTED, 0, + { "greek-ccitt", "iso-ir-150", "csISO150", "csISO150GreekCCITT", NULL } + }, + /* + * Source: ECMA registry + */ + { 92, WINUNDEF, STRING_ENCODING_NC_NC00_10_81, UNSUPPORTED, 0, + { "NC_NC00-10:81", "cuba", "iso-ir-151", "ISO646-CU", "csISO151Cuba", + NULL } + }, + /* + * Source: ECMA registry + */ + { 93, WINUNDEF, STRING_ENCODING_ISO_6937_2_25, UNSUPPORTED, 0, + { "ISO_6937-2-25", "iso-ir-152", "csISO6937Add", NULL } + }, + /* + * Source: ECMA registry + */ + { 94, WINUNDEF, STRING_ENCODING_GOST_19768_74, UNSUPPORTED, 0, + { "GOST_19768-74", "ST_SEV_358-88", "iso-ir-153", "csISO153GOST1976874", + NULL } + }, + /* + * Source: ECMA registry + */ + { 95, WINUNDEF, STRING_ENCODING_ISO_8859_SUPP, UNSUPPORTED, 0, + { "ISO_8859-supp", "iso-ir-154", "latin1-2-5", "csISO8859Supp", NULL } + }, + /* + * Source: ECMA registry + */ + { 96, WINUNDEF, STRING_ENCODING_ISO_10367_BOX, UNSUPPORTED, 0, + { "ISO_10367-box", "iso-ir-155", "csISO10367Box", NULL } + }, + /* + * Source: ECMA registry + */ + { 97, WINUNDEF, STRING_ENCODING_LATIN_LAP, UNSUPPORTED, 0, + { "latin-lap", "lap", "iso-ir-158", "csISO158Lap", NULL } + }, + /* + * Source: ECMA registry + */ + { 98, WINUNDEF, STRING_ENCODING_JIS_X0212_1990, UNSUPPORTED, 0, + { "JIS_X0212-1990", "x0212", "iso-ir-159", "csISO159JISX02121990", NULL } + }, + /* + * Source: Danish Standard, DS 2089, February 1974 + */ + { 99, WINUNDEF, STRING_ENCODING_DS_2089, UNSUPPORTED, 0, + { "DS_2089", "DS2089", "ISO646-DK", "dk", "csISO646Danish", NULL } + }, + { 100, WINUNDEF, STRING_ENCODING_US_DK, UNSUPPORTED, 0, + { "us-dk", "csUSDK", NULL } + }, + { 101, WINUNDEF, STRING_ENCODING_DK_US, UNSUPPORTED, 0, + { "dk-us", "csDKUS", NULL } + }, + { 102, WINUNDEF, STRING_ENCODING_KSC5636, UNSUPPORTED, 0, + { "KSC5636", "ISO646-KR", "csKSC5636", NULL } + }, + /* + * Source: RFC 1642 + */ + { 103, WINUNDEF, STRING_ENCODING_UNICODE_1_1_UTF_7, UNSUPPORTED, 0, + { "UNICODE-1-1-UTF-7", "csUnicode11UTF7", NULL } + }, + /* + * Source: RFC-1922 + */ + { 104, 50227, STRING_ENCODING_ISO_2022_CN, UNSUPPORTED, 0, + { "ISO-2022-CN", NULL } + }, + /* + * Source: RFC-1922 + */ + { 105, WINUNDEF, STRING_ENCODING_ISO_2022_CN_EXT, UNSUPPORTED, 0, + { "ISO-2022-CN-EXT", NULL } + }, + /* + * Source: RFC 3629 + */ + { 106, 65001, STRING_ENCODING_UTF8, SUPPORTED, 0, + { "UTF-8", "ibm-1208", "ibm-1209", "ibm-5304", "ibm-5305", "ibm-13496", + "ibm-13497", "ibm-17592", "ibm-17593", "cp1208", NULL } + }, + /* + * Source: ISO See + * (http://www.iana.org/assignments/charset-reg/ISO-8859-13)[Tumasonis] + */ + { 109, 28603, STRING_ENCODING_ISO_8859_13, SUPPORTED, 0, + { "ISO-8859-13", "ibm-921_P100-1995", "ibm-921", "8859_13", "cp921", + "921", NULL } + }, + /* + * Source: ISO See + * (http://www.iana.org/assignments/charset-reg/ISO-8859-14) [Simonsen] + */ + { 110, WINUNDEF, STRING_ENCODING_ISO_8859_14, SUPPORTED, 0, + { "ISO-8859-14", "iso-ir-199", "ISO_8859-14:1998", "ISO_8859-14", + "latin8", "iso-celtic", "l8", NULL } + }, + /* + * Source: ISO + * Please see: + */ + { 111, 28605, STRING_ENCODING_ISO_8859_15, SUPPORTED, 0, + { "ISO-8859-15", "ISO_8859-15", "Latin-9", "ibm-923_P100-1998", "ibm-923", + "l9", "8859_15", "latin0", "csisolatin0", "csisolatin9", "cp923", "923", + "iso8859_15_fdis", NULL } + }, + /* + * Windows duplicate of ISO-8859-15 + * windows-874: ANSI/OEM Thai (same as 28605, ISO 8859-15) + */ + { 111, 874, STRING_ENCODING_ISO_8859_15, SUPPORTED, 0, + { "ISO-8859-15", "ISO_8859-15", "Latin-9", NULL } + }, + /* + * Source: ISO + */ + { 112, WINUNDEF, STRING_ENCODING_ISO_8859_16, UNSUPPORTED, 0, + { "ISO-8859-16", "iso-ir-226", "ISO_8859-16:2001", "ISO_8859-16", + "latin10", "l10", NULL } + }, + /* + * Source: Chinese IT Standardization Technical Committee + * Please see: + */ + { 113, 936, STRING_ENCODING_GBK, SUPPORTED, 0, + { "GBK", "CP936", "MS936", "windows-936", "windows-936-2000", NULL } + }, + /* + * Source: Chinese IT Standardization Technical Committee + * Please see: + */ + { 114, 54936, STRING_ENCODING_GB_18030, UNSUPPORTED, 0, + { "GB18030", NULL } + }, + /* + * Source: Fujitsu-Siemens standard mainframe EBCDIC encoding + * Please see: + * + */ + { 115, WINUNDEF, STRING_ENCODING_OSD_EBCDIC_DF04_15, UNSUPPORTED, 0, + { "OSD_EBCDIC_DF04_15", NULL } + }, + /* + * Source: Fujitsu-Siemens standard mainframe EBCDIC encoding + * Please see: + * + */ + { 116, WINUNDEF, STRING_ENCODING_OSD_EBCDIC_DF03_IRV, UNSUPPORTED, 0, + { "OSD_EBCDIC_DF03_IRV", NULL } + }, + /* + * Source: Fujitsu-Siemens standard mainframe EBCDIC encoding + * Please see: + * + */ + { 117, WINUNDEF, STRING_ENCODING_OSD_EBCDIC_DF04_1, UNSUPPORTED, 0, + { "OSD_EBCDIC_DF04_1", NULL } + }, + /* + * Source: See + * [Thibault] + */ + { 118, WINUNDEF, STRING_ENCODING_ISO_11548_1, UNSUPPORTED, 0, + { "ISO-11548-1", "ISO_11548-1", "ISO_TR_11548-1", "csISO115481", NULL } + }, + /* + * Source: See + * [Veremeev, Kikkarin] + */ + { 119, WINUNDEF, STRING_ENCODING_KZ_1048, UNSUPPORTED, 0, + { "KZ-1048", "STRK1048-2002", "RK1048", "csKZ1048", NULL } + }, + /* + * Source: the 2-octet Basic Multilingual Plane, aka Unicode + * this needs to specify network byte order: the standard + * does not specify (it is a 16-bit integer space) + */ + { 1000, WINUNDEF, STRING_ENCODING_ISO_10646_UCS_2, SUPPORTED, 0, + { "ISO-10646-UCS-2", "csUnicode", "ibm-1204", "ibm-1205", "unicode", + "ucs-2", NULL } + }, + /* + * Source: the full code space. (same comment about byte order, + * these are 31-bit numbers. + */ + { 1001, WINUNDEF, STRING_ENCODING_ISO_10646_UCS_4, SUPPORTED, 0, + { "ISO-10646-UCS-4", "csUCS4", "ibm-1236", "ibm-1237", "ucs-4", NULL } + }, + /* + * Source: ASCII subset of Unicode. Basic Latin = collection 1 + * See ISO 10646, Appendix A + */ + { 1002, WINUNDEF, STRING_ENCODING_ISO_10646_UCS_BASIC, UNSUPPORTED, 0, + { "ISO-10646-UCS-Basic", "csUnicodeASCII", NULL } + }, + /* + * Source: ISO Latin-1 subset of Unicode. Basic Latin and Latin-1 + * Supplement = collections 1 and 2. See ISO 10646, + * Appendix A. See RFC 1815. + */ + { 1003, WINUNDEF, STRING_ENCODING_ISO_10646_UNICODE_LATIN1, UNSUPPORTED, 0, + { "ISO-10646-Unicode-Latin1", "csUnicodeLatin1", "ISO-10646", NULL } + }, + /* + * Source: ISO 10646 Japanese, see RFC 1815. + */ + { MIBUNDEF, WINUNDEF, STRING_ENCODING_ISO_10646_J_1, UNSUPPORTED, 0, + { "ISO-10646-J-1", NULL } + }, + /* + * Source: IBM Latin-2, -3, -5, Extended Presentation Set, GCSGID: 1261 + */ + { 1005, WINUNDEF, STRING_ENCODING_ISO_UNICODE_IBM_1261, UNSUPPORTED, 0, + { "ISO-Unicode-IBM-1261", "csUnicodeIBM1261", NULL } + }, + /* + * Source: IBM Latin-4 Extended Presentation Set, GCSGID: 1268 + */ + { 1006, WINUNDEF, STRING_ENCODING_ISO_UNICODE_IBM_1268, UNSUPPORTED, 0, + { "ISO-Unicode-IBM-1268", "csUnicodeIBM1268", NULL } + }, + /* + * Source: IBM Cyrillic Greek Extended Presentation Set, GCSGID: 1276 + */ + { 1007, WINUNDEF, STRING_ENCODING_ISO_UNICODE_IBM_1276, UNSUPPORTED, 0, + { "ISO-Unicode-IBM-1276", "csUnicodeIBM1276", NULL } + }, + /* + * Source: IBM Arabic Presentation Set, GCSGID: 1264 + */ + { 1008, WINUNDEF, STRING_ENCODING_ISO_UNICODE_IBM_1264, UNSUPPORTED, 0, + { "ISO-Unicode-IBM-1264", "csUnicodeIBM1264", NULL } + }, + /* + * Source: IBM Hebrew Presentation Set, GCSGID: 1265 + */ + { 1009, WINUNDEF, STRING_ENCODING_ISO_UNICODE_IBM_1265, UNSUPPORTED, 0, + { "ISO-Unicode-IBM-1265", "csUnicodeIBM1265", NULL } + }, + /* + * Source: RFC 1641 + */ + { 1010, WINUNDEF, STRING_ENCODING_UNICODE_1_1, UNSUPPORTED, 0, + { "UNICODE-1-1", "csUnicode11", NULL } + }, + /* + * Source: SCSU See (http://www.iana.org/assignments/charset-reg/SCSU) + * [Scherer] + */ + { 1011, WINUNDEF, STRING_ENCODING_SCSU, SUPPORTED, 0, + { "SCSU", NULL } + }, + /* + * Source: RFC 2152 + */ + { 1012, 65000, STRING_ENCODING_UTF_7, SUPPORTED, 0, + { "UTF-7", NULL } + }, + /* + * Source: RFC 2781 + */ + { 1013, 1201, STRING_ENCODING_UTF16_BE, SUPPORTED, 0, + { "UTF-16BE", "x-utf-16be", "ibm-1200", "ibm-1201", "ibm-13488", + "ibm-13489", "ibm-17584", "ibm-17585", "ibm-21680", "ibm-21681", + "ibm-25776", "ibm-25777", "ibm-29872", "ibm-29873", "ibm-61955", + "ibm-61956", "cp1200", "cp1201", "UTF16_BigEndian", NULL } + }, + /* + * Source: RFC 2781 + */ + { 1014, 1200, STRING_ENCODING_UTF16_LE, SUPPORTED, 0, + { "UTF-16LE", "x-utf-16le", "ibm-1202", "ibm-1203", "ibm-13490", + "ibm-13491", "ibm-17586", "ibm-17587", "ibm-21682", "ibm-21683", + "ibm-25778", "ibm-25779", "ibm-29874", "ibm-29875", + "UTF16_LittleEndian", NULL } + }, + /* + * Source: RFC 2781 + */ + { 1015, WINUNDEF, STRING_ENCODING_UTF16_XE, SUPPORTED, 0, + { "UTF-16", NULL } + }, + /* + * Source: + */ + { 1016, WINUNDEF, STRING_ENCODING_CESU_8, SUPPORTED, 0, + { "CESU-8", "csCESU-8", "ibm-9400", NULL } + }, + /* + * Source: + */ + { 1017, WINUNDEF, STRING_ENCODING_UTF32_XE, SUPPORTED, 0, + { "UTF-32", NULL } + }, + /* + * Source: + */ + { 1018, 12001, STRING_ENCODING_UTF32_BE, SUPPORTED, 0, + { "UTF-32BE", "UTF32_BigEndian", "ibm-1232", "ibm-1233", "ibm-9424", + NULL } + }, + /* + * Source: + */ + { 1019, 12000, STRING_ENCODING_UTF32_LE, SUPPORTED, 0, + { "UTF-32LE", "UTF32_LittleEndian", "ibm-1234", "ibm-1235", NULL } + }, + /* + * Source: http://www.unicode.org/notes/tn6/ + */ + { 1020, WINUNDEF, STRING_ENCODING_BOCU_1, SUPPORTED, 0, + { "BOCU-1", "csBOCU-1", "ibm-1214", "ibm-1215", NULL } + }, + /* + * Source: Extended ISO 8859-1 Latin-1 for Windows 3.0. + * PCL Symbol Set id: 9U + */ + { 2000, WINUNDEF, STRING_ENCODING_ISO_8859_1_WINDOWS_3_0_LATIN_1, + UNSUPPORTED, 0, + { "ISO-8859-1-Windows-3.0-Latin-1", "csWindows30Latin1", NULL } + }, + /* + * Source: Extended ISO 8859-1 Latin-1 for Windows 3.1. + * PCL Symbol Set id: 19U + */ + { 2001, WINUNDEF, STRING_ENCODING_ISO_8859_1_WINDOWS_3_1_LATIN_1, + UNSUPPORTED, 0, + { "ISO-8859-1-Windows-3.1-Latin-1", "csWindows31Latin1", NULL } + }, + /* + * Source: Extended ISO 8859-2. Latin-2 for Windows 3.1. + * PCL Symbol Set id: 9E + */ + { 2002, WINUNDEF, STRING_ENCODING_ISO_8859_2_WINDOWS_LATIN_2, + UNSUPPORTED, 0, + { "ISO-8859-2-Windows-Latin-2", "csWindows31Latin2", NULL } + }, + /* + * Source: Extended ISO 8859-9. Latin-5 for Windows 3.1 + * PCL Symbol Set id: 5T + */ + { 2003, WINUNDEF, STRING_ENCODING_ISO_8859_9_WINDOWS_LATIN_5, + UNSUPPORTED, 0, + { "ISO-8859-9-Windows-Latin-5", "csWindows31Latin5", NULL } + }, + /* + * Source: LaserJet IIP Printer User's Manual, + * HP part no 33471-90901, Hewlet-Packard, June 1989. + */ + { 2004, WINUNDEF, STRING_ENCODING_HP_ROMAN8, UNSUPPORTED, 0, + { "hp-roman8", "roman8", "r8", "csHPRoman8", NULL } + }, + /* + * Source: PostScript Language Reference Manual + * PCL Symbol Set id: 10J + */ + { 2005, WINUNDEF, STRING_ENCODING_ADOBE_STANDARD_ENCODING, + UNSUPPORTED, 0, + { "Adobe-Standard-Encoding", "csAdobeStandardEncoding", NULL } + }, + /* + * Source: Ventura US. ASCII plus characters typically used in + * publishing, like pilcrow, copyright, registered, trade mark, + * section, dagger, and double dagger in the range A0 (hex) + * to FF (hex). + * PCL Symbol Set id: 14J + */ + { 2006, WINUNDEF, STRING_ENCODING_VENTURA_US, UNSUPPORTED, 0, + { "Ventura-US", "csVenturaUS", NULL } + }, + /* + * Source: Ventura International. ASCII plus coded characters similar + * to Roman8. + * PCL Symbol Set id: 13J + */ + { 2007, WINUNDEF, STRING_ENCODING_VENTURA_INTERNATIONAL, UNSUPPORTED, 0, + { "Ventura-International", "csVenturaInternational", NULL } + }, + /* + * Source: VAX/VMS User's Manual, + * Order Number: AI-Y517A-TE, April 1986. + */ + { 2008, WINUNDEF, STRING_ENCODING_DEC_MCS, UNSUPPORTED, 0, + { "DEC-MCS", "dec", "csDECMCS", NULL } + }, + /* + * Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 + */ + { 2009, 850, STRING_ENCODING_IBM850, UNSUPPORTED, 0, + { "IBM850", "cp850", "850", "csPC850Multilingual", NULL } + }, + /* + * Source: PC Danish Norwegian + * 8-bit PC set for Danish Norwegian + * PCL Symbol Set id: 11U + */ + { 2012, WINUNDEF, STRING_ENCODING_PC8_DANISH_NORWEGIAN, UNSUPPORTED, 0, + { "PC8-Danish-Norwegian", "csPC8DanishNorwegian", NULL } + }, + /* + * Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 + */ + { 2013, 862, STRING_ENCODING_IBM862, UNSUPPORTED, 0, + { "IBM862", "cp862", "862", "csPC862LatinHebrew", NULL } + }, + /* + * Source: PC Latin Turkish. PCL Symbol Set id: 9T + */ + { 2014, WINUNDEF, STRING_ENCODING_PC8_TURKISH, UNSUPPORTED, 0, + { "PC8-Turkish", "csPC8Turkish", NULL } + }, + /* + * Source: Presentation Set, CPGID: 259 + */ + { 2015, WINUNDEF, STRING_ENCODING_IBM_SYMBOLS, UNSUPPORTED, 0, + { "IBM-Symbols", "csIBMSymbols", NULL } + }, + /* + * Source: Presentation Set, CPGID: 838 + */ + { 2016, 20838, STRING_ENCODING_IBM_THAI, UNSUPPORTED, 0, + { "IBM-Thai", "csIBMThai", NULL } + }, + /* + * Source: PCL 5 Comparison Guide, Hewlett-Packard, + * HP part number 5961-0510, October 1992 + * PCL Symbol Set id: 1U + */ + { 2017, WINUNDEF, STRING_ENCODING_HP_LEGAL, UNSUPPORTED, 0, + { "HP-Legal", "csHPLegal", NULL } + }, + /* + * Source: PCL 5 Comparison Guide, Hewlett-Packard, + * HP part number 5961-0510, October 1992 + * PCL Symbol Set id: 15U + */ + { 2018, WINUNDEF, STRING_ENCODING_HP_PI_FONT, UNSUPPORTED, 0, + { "HP-Pi-font", "csHPPiFont", NULL } + }, + /* + * Source: PCL 5 Comparison Guide, Hewlett-Packard, + * HP part number 5961-0510, October 1992 + * PCL Symbol Set id: 8M + */ + { 2019, WINUNDEF, STRING_ENCODING_HP_MATH8, UNSUPPORTED, 0, + { "HP-Math8", "csHPMath8", NULL } + }, + /* + * Source: PostScript Language Reference Manual + * PCL Symbol Set id: 5M + */ + { 2020, WINUNDEF, STRING_ENCODING_ADOBE_SYMBOL_ENCODING, UNSUPPORTED, 0, + { "Adobe-Symbol-Encoding", "csHPPSMath", NULL } + }, + /* + * Source: PCL 5 Comparison Guide, Hewlett-Packard, + * HP part number 5961-0510, October 1992 + * PCL Symbol Set id: 7J + */ + { 2021, WINUNDEF, STRING_ENCODING_HP_DESKTOP, UNSUPPORTED, 0, + { "HP-DeskTop", "csHPDesktop", NULL } + }, + /* + * Source: PCL 5 Comparison Guide, Hewlett-Packard, + * HP part number 5961-0510, October 1992 + * PCL Symbol Set id: 6M + */ + { 2022, WINUNDEF, STRING_ENCODING_VENTURA_MATH, UNSUPPORTED, 0, + { "Ventura-Math", "csVenturaMath", NULL } + }, + /* + * Source: PCL 5 Comparison Guide, Hewlett-Packard, + * HP part number 5961-0510, October 1992 + * PCL Symbol Set id: 6J + */ + { 2023, WINUNDEF, STRING_ENCODING_MICROSOFT_PUBLISHING, UNSUPPORTED, 0, + { "Microsoft-Publishing", "csMicrosoftPublishing", NULL } + }, + /* + * Source: Windows Japanese. A further extension of Shift_JIS + * to include NEC special characters (Row 13), NEC + * selection of IBM extensions (Rows 89 to 92), and IBM + * extensions (Rows 115 to 119). The CCS's are + * JIS X0201:1997, JIS X0208:1997, and these extensions. + * This charset can be used for the top-level media type "text", + * but it is of limited or specialized use (see RFC2278). + * PCL Symbol Set id: 19K + */ + { 2024, WINUNDEF, STRING_ENCODING_WINDOWS_31J, SUPPORTED, 0, + { "Windows-31J", "csWindows31J", NULL } + }, + /* + * Source: Chinese for People's Republic of China (PRC) mixed one byte, + * two byte set: + * 20-7E = one byte ASCII + * A1-FE = two byte PRC Kanji + * See GB 2312-80 + * PCL Symbol Set Id: 18C + */ + { 2025, WINUNDEF, STRING_ENCODING_GB_2312, UNSUPPORTED, 0, + { "GB2312", "csGB2312", NULL } + }, + /* + * Source: Chinese for Taiwan Multi-byte set. + * PCL Symbol Set Id: 18T + */ + { 2026, 950, STRING_ENCODING_BIG_5, SUPPORTED, 0, + { "Big5", "csBig5", "windows-950", "x-big5", NULL } + }, + /* + * Source: The Unicode Standard ver1.0, ISBN 0-201-56788-1, Oct 1991 + */ + { 2027, WINUNDEF, STRING_ENCODING_MACINTOSH, UNSUPPORTED, 0, + { "macintosh", "mac", "csMacintosh", NULL } + }, + /* + * Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 + */ + { 2028, 37, STRING_ENCODING_IBM037, UNSUPPORTED, 0, + { "IBM037", "cp037", "ebcdic-cp-us", "ebcdic-cp-ca", "ebcdic-cp-wt", + "ebcdic-cp-nl", "csIBM037", NULL } + }, + /* + * Source: IBM 3174 Character Set Ref, GA27-3831-02, March 1990 + */ + { 2029, WINUNDEF, STRING_ENCODING_IBM038, UNSUPPORTED, 0, + { "IBM038", "EBCDIC-INT", "cp038", "csIBM038", NULL } + }, + /* + * Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 + */ + { 2030, 20273, STRING_ENCODING_IBM273, UNSUPPORTED, 0, + { "IBM273", "CP273", "csIBM273", NULL } + }, + /* + * Source: IBM 3174 Character Set Ref, GA27-3831-02, March 1990 + */ + { 2031, WINUNDEF, STRING_ENCODING_IBM274, UNSUPPORTED, 0, + { "IBM274", "EBCDIC-BE", "CP274", "csIBM274", NULL } + }, + /* + * Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 + */ + { 2032, WINUNDEF, STRING_ENCODING_IBM275, UNSUPPORTED, 0, + { "IBM275", "EBCDIC-BR", "cp275", "csIBM275", NULL } + }, + /* + * Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 + */ + { 2033, 20277, STRING_ENCODING_IBM277, UNSUPPORTED, 0, + { "IBM277", "EBCDIC-CP-DK", "EBCDIC-CP-NO", "csIBM277", NULL } + }, + /* + * Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 + */ + { 2034, 20278, STRING_ENCODING_IBM278, UNSUPPORTED, 0, + { "IBM278", "CP278", "ebcdic-cp-fi", "ebcdic-cp-se", "csIBM278", NULL } + }, + /* + * Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 + */ + { 2035, 20280, STRING_ENCODING_IBM280, UNSUPPORTED, 0, + { "IBM280", "CP280", "ebcdic-cp-it", "csIBM280", NULL } + }, + /* + * Source: IBM 3174 Character Set Ref, GA27-3831-02, March 1990 + */ + { 2036, WINUNDEF, STRING_ENCODING_IBM281, UNSUPPORTED, 0, + { "IBM281", "EBCDIC-JP-E", "cp281", "csIBM281", NULL } + }, + /* + * Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 + */ + { 2037, 20284, STRING_ENCODING_IBM284, UNSUPPORTED, 0, + { "IBM284", "CP284", "ebcdic-cp-es", "csIBM284", NULL } + }, + /* + * Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 + */ + { 2038, 20285, STRING_ENCODING_IBM285, UNSUPPORTED, 0, + { "IBM285", "CP285", "ebcdic-cp-gb", "csIBM285", NULL } + }, + /* + * Source: IBM 3174 Character Set Ref, GA27-3831-02, March 1990 + */ + { 2039, 20290, STRING_ENCODING_IBM290, UNSUPPORTED, 0, + { "IBM290", "cp290", "EBCDIC-JP-kana", "csIBM290", NULL } + }, + /* + * Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 + */ + { 2040, 20297, STRING_ENCODING_IBM297, UNSUPPORTED, 0, + { "IBM297", "cp297", "ebcdic-cp-fr", "csIBM297", NULL } + }, + /* + * Source: IBM NLS RM Vol2 SE09-8002-01, March 1990, + * IBM NLS RM p 11-11 + */ + { 2041, 20420, STRING_ENCODING_IBM420, UNSUPPORTED, 0, + { "IBM420", "cp420", "ebcdic-cp-ar1", "csIBM420", NULL } + }, + /* + * Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 + */ + { 2042, 20423, STRING_ENCODING_IBM423, UNSUPPORTED, 0, + { "IBM423", "cp423", "ebcdic-cp-gr", "csIBM423", NULL } + }, + /* + * Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 + */ + { 2043, 20424, STRING_ENCODING_IBM424, UNSUPPORTED, 0, + { "IBM424", "cp424", "ebcdic-cp-he", "csIBM424", NULL } + }, + /* + * Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 + */ + { 2011, 437, STRING_ENCODING_IBM437, UNSUPPORTED, 0, + { "IBM437", "cp437", "437", "csPC8CodePage437", NULL } + }, + /* + * Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 + */ + { 2044, 500, STRING_ENCODING_IBM500, UNSUPPORTED, 0, + { "IBM500", "CP500", "ebcdic-cp-be", "ebcdic-cp-ch", "csIBM500", NULL } + }, + /* + * Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 + */ + { 2045, WINUNDEF, STRING_ENCODING_IBM851, UNSUPPORTED, 0, + { "IBM851", "cp851", "851", "csIBM851", NULL } + }, + /* + * Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 + */ + { 2010, 852, STRING_ENCODING_IBM852, UNSUPPORTED, 0, + { "IBM852", "cp852", "852", "csPCp852", NULL } + }, + /* + * Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 + */ + { 2046, 855, STRING_ENCODING_IBM855, UNSUPPORTED, 0, + { "IBM855", "cp855", "855", "csIBM855", NULL } + }, + /* + * Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 + */ + { 2047, 857, STRING_ENCODING_IBM857, UNSUPPORTED, 0, + { "IBM857", "cp857", "857", "csIBM857", NULL } + }, + /* + * Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 + */ + { 2048, 860, STRING_ENCODING_IBM860, UNSUPPORTED, 0, + { "IBM860", "cp860", "860", "csIBM860", NULL } + }, + /* + * Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 + */ + { 2049, 861, STRING_ENCODING_IBM861, UNSUPPORTED, 0, + { "IBM861", "cp861", "861", "cp-is", "csIBM861", NULL } + }, + /* + * Source: IBM Keyboard layouts and code pages, PN 07G4586 June 1991 + */ + { 2050, 863, STRING_ENCODING_IBM863, UNSUPPORTED, 0, + { "IBM863", "cp863", "863", "csIBM863", NULL } + }, + /* + * Source: IBM Keyboard layouts and code pages, PN 07G4586 June 1991 + */ + { 2051, 864, STRING_ENCODING_IBM864, UNSUPPORTED, 0, + { "IBM864", "cp864", "csIBM864", NULL } + }, + /* + * Source: IBM DOS 3.3 Ref (Abridged), 94X9575 (Feb 1987) + */ + { 2052, 865, STRING_ENCODING_IBM865, UNSUPPORTED, 0, + { "IBM865", "cp865", "865", "csIBM865", NULL } + }, + /* + * Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 + */ + { 2053, WINUNDEF, STRING_ENCODING_IBM868, UNSUPPORTED, 0, + { "IBM868", "CP868", "cp-ar", "csIBM868", NULL } + }, + /* + * Source: IBM Keyboard layouts and code pages, PN 07G4586 June 1991 + */ + { 2054, 869, STRING_ENCODING_IBM869, UNSUPPORTED, 0, + { "IBM869", "cp869", "869", "cp-gr", "csIBM869", NULL } + }, + /* + * Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 + */ + { 2055, 870, STRING_ENCODING_IBM870, UNSUPPORTED, 0, + { "IBM870", "CP870", "ebcdic-cp-roece", "ebcdic-cp-yu", "csIBM870", NULL } + }, + /* + * Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 + */ + { 2056, 20871, STRING_ENCODING_IBM871, UNSUPPORTED, 0, + { "IBM871", "CP871", "ebcdic-cp-is", "csIBM871", NULL } + }, + /* + * Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 + */ + { 2057, 20880, STRING_ENCODING_IBM880, UNSUPPORTED, 0, + { "IBM880", "cp880", "EBCDIC-Cyrillic", "csIBM880", NULL } + }, + /* + * Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 + */ + { 2058, WINUNDEF, STRING_ENCODING_IBM891, UNSUPPORTED, 0, + { "IBM891", "cp891", "csIBM891", NULL } + }, + /* + * Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 + */ + { 2059, WINUNDEF, STRING_ENCODING_IBM903, UNSUPPORTED, 0, + { "IBM903", "cp903", "csIBM903", NULL } + }, + /* + * Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 + */ + { 2060, WINUNDEF, STRING_ENCODING_IBM904, UNSUPPORTED, 0, + { "IBM904", "cp904", "904", "csIBBM904", NULL } + }, + /* + * Source: IBM 3174 Character Set Ref, GA27-3831-02, March 1990 + */ + { 2061, 20905, STRING_ENCODING_IBM905, UNSUPPORTED, 0, + { "IBM905", "CP905", "ebcdic-cp-tr", "csIBM905", NULL } + }, + /* + * Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 + */ + { 2062, WINUNDEF, STRING_ENCODING_IBM918, UNSUPPORTED, 0, + { "IBM918", "CP918", "ebcdic-cp-ar2", "csIBM918", NULL } + }, + /* + * Source: IBM NLS RM Vol2 SE09-8002-01, March 1990 + */ + { 2063, 1026, STRING_ENCODING_IBM1026, UNSUPPORTED, 0, + { "IBM1026", "CP1026", "csIBM1026", NULL } + }, + /* + * Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 + */ + { 2064, WINUNDEF, STRING_ENCODING_EBCDIC_AT_DE, UNSUPPORTED, 0, + { "EBCDIC-AT-DE", "csIBMEBCDICATDE", NULL } + }, + /* + * Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 + */ + { 2065, WINUNDEF, STRING_ENCODING_EBCDIC_AT_DE_A, UNSUPPORTED, 0, + { "EBCDIC-AT-DE-A", "csEBCDICATDEA", NULL } + }, + /* + * Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 + */ + { 2066, WINUNDEF, STRING_ENCODING_EBCDIC_CA_FR, UNSUPPORTED, 0, + { "EBCDIC-CA-FR", "csEBCDICCAFR", NULL } + }, + /* + * Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 + */ + { 2067, WINUNDEF, STRING_ENCODING_EBCDIC_DK_NO, UNSUPPORTED, 0, + { "EBCDIC-DK-NO", "csEBCDICDKNO", NULL } + }, + /* + * Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 + */ + { 2068, WINUNDEF, STRING_ENCODING_EBCDIC_DK_NO_A, UNSUPPORTED, 0, + { "EBCDIC-DK-NO-A", "csEBCDICDKNOA", NULL } + }, + /* + * Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 + */ + { 2069, WINUNDEF, STRING_ENCODING_EBCDIC_FI_SE, UNSUPPORTED, 0, + { "EBCDIC-FI-SE", "csEBCDICFISE", NULL } + }, + /* + * Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 + */ + { 2070, WINUNDEF, STRING_ENCODING_EBCDIC_FI_SE_A, UNSUPPORTED, 0, + { "EBCDIC-FI-SE-A", "csEBCDICFISEA", NULL } + }, + /* + * Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 + */ + { 2071, WINUNDEF, STRING_ENCODING_EBCDIC_FR, UNSUPPORTED, 0, + { "EBCDIC-FR", "csEBCDICFR", NULL } + }, + /* + * Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 + */ + { 2072, WINUNDEF, STRING_ENCODING_EBCDIC_IT, UNSUPPORTED, 0, + { "EBCDIC-IT", "csEBCDICIT", NULL } + }, + /* + * Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 + */ + { 2073, WINUNDEF, STRING_ENCODING_EBCDIC_PT, UNSUPPORTED, 0, + { "EBCDIC-PT", "csEBCDICPT", NULL } + }, + /* + * Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 + */ + { 2074, WINUNDEF, STRING_ENCODING_EBCDIC_ES, UNSUPPORTED, 0, + { "EBCDIC-ES", "csEBCDICES", NULL } + }, + /* + * Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 + */ + { 2075, WINUNDEF, STRING_ENCODING_EBCDIC_ES_A, UNSUPPORTED, 0, + { "EBCDIC-ES-A", "csEBCDICESA", NULL } + }, + /* + * Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 + */ + { 2076, WINUNDEF, STRING_ENCODING_EBCDIC_ES_S, UNSUPPORTED, 0, + { "EBCDIC-ES-S", "csEBCDICESS", NULL } + }, + /* + * Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 + */ + { 2077, WINUNDEF, STRING_ENCODING_EBCDIC_UK, UNSUPPORTED, 0, + { "EBCDIC-UK", "csEBCDICUK", NULL } + }, + /* + * Source: IBM 3270 Char Set Ref Ch 10, GA27-2837-9, April 1987 + */ + { 2078, WINUNDEF, STRING_ENCODING_EBCDIC_US, UNSUPPORTED, 0, + { "EBCDIC-US", "csEBCDICUS", NULL } + }, + { 2079, WINUNDEF, STRING_ENCODING_UNKNOWN_8BIT, UNSUPPORTED, 0, + { "UNKNOWN-8BIT", "csUnknown8BiT", NULL } + }, + /* + * Source: RFC 1345, also known as "mnemonic+ascii+38" + */ + { 2080, WINUNDEF, STRING_ENCODING_MNEMONIC, UNSUPPORTED, 0, + { "MNEMONIC", "csMnemonic", NULL } + }, + /* + * Source: RFC 1345, also known as "mnemonic+ascii+8200" + */ + { 2081, WINUNDEF, STRING_ENCODING_MNEM, UNSUPPORTED, 0, + { "MNEM", "csMnem", NULL } + }, + /* + * Source: RFC 1456 + */ + { 2082, WINUNDEF, STRING_ENCODING_VISCII, UNSUPPORTED, 0, + { "VISCII", "csVISCII", NULL } + }, + /* + * Source: RFC 1456 + */ + { 2083, WINUNDEF, STRING_ENCODING_VIQR, UNSUPPORTED, 0, + { "VIQR", "csVIQR", NULL } + }, + /* + * Source: RFC 1489, based on GOST-19768-74, ISO-6937/8, + * INIS-Cyrillic, ISO-5427. + */ + { 2084, 20866, STRING_ENCODING_KOI8_R, UNSUPPORTED, 0, + { "KOI8-R", "csKOI8R", NULL } + }, + /* + * Source: RFC 1842, RFC 1843 [RFC1842, RFC1843] + */ + { 2085, 52936, STRING_ENCODING_HZ_GB_2312, SUPPORTED, 0, + { "HZ-GB-2312", "HZ", NULL } + }, + /* + * Source: IBM NLDG Volume 2 (SE09-8002-03) August 1994 + */ + { 2086, 866, STRING_ENCODING_IBM866, UNSUPPORTED, 0, + { "IBM866", "cp866", "866", "csIBM866", NULL } + }, + /* + * Source: HP PCL 5 Comparison Guide (P/N 5021-0329) pp B-13, 1996 + */ + { 2087, 775, STRING_ENCODING_IBM775, UNSUPPORTED, 0, + { "IBM775", "cp775", "csPC775Baltic", NULL } + }, + /* + * Source: RFC 2319 + */ + { 2088, 21866, STRING_ENCODING_KOI8_U, UNSUPPORTED, 0, + { "KOI8-U", NULL } + }, + /* + * Source: IBM See (http://www.iana.org/assignments/charset-reg/IBM00858) + * [Mahdi] + */ + { 2089, 858, STRING_ENCODING_IBM00858, UNSUPPORTED, 0, + { "IBM00858", "CCSID00858", "CP00858", "PC-Multilingual-850+euro", NULL } + }, + /* + * Source: IBM See (http://www.iana.org/assignments/charset-reg/IBM00924) + * [Mahdi] + */ + { 2090, 20924, STRING_ENCODING_IBM00924, UNSUPPORTED, 0, + { "IBM00924", "CCSID00924", "CP00924", "ebcdic-Latin9--euro", NULL } + }, + /* + * Source: IBM See (http://www.iana.org/assignments/charset-reg/IBM01140) + * [Mahdi] + */ + { 2091, 1140, STRING_ENCODING_IBM01140, UNSUPPORTED, 0, + { "IBM01140", "CCSID01140", "CP01140", "ebcdic-us-37+euro", NULL } + }, + /* + * Source: IBM See (http://www.iana.org/assignments/charset-reg/IBM01141) + * [Mahdi] + */ + { 2092, 1141, STRING_ENCODING_IBM01141, UNSUPPORTED, 0, + { "IBM01141", "CCSID01141", "CP01141", "ebcdic-de-273+euro", NULL } + }, + /* + * Source: IBM See (http://www.iana.org/assignments/charset-reg/IBM01142) + * [Mahdi] + */ + { 2093, 1142, STRING_ENCODING_IBM01142, UNSUPPORTED, 0, + { "IBM01142", "CCSID01142", "CP01142", "ebcdic-dk-277+euro", + "ebcdic-no-277+euro", NULL } + }, + /* + * Source: IBM See (http://www.iana.org/assignments/charset-reg/IBM01143) + * [Mahdi] + */ + { 2094, 1143, STRING_ENCODING_IBM01143, UNSUPPORTED, 0, + { "IBM01143", "CCSID01143", "CP01143", "ebcdic-fi-278+euro", + "ebcdic-se-278+euro", NULL } + }, + /* + * Source: IBM See (http://www.iana.org/assignments/charset-reg/IBM01144) + * [Mahdi] + */ + { 2095, 1144, STRING_ENCODING_IBM01144, UNSUPPORTED, 0, + { "IBM01144", "CCSID01144", "CP01144", "ebcdic-it-280+euro", NULL } + }, + /* + * Source: IBM See (http://www.iana.org/assignments/charset-reg/IBM01145) + * [Mahdi] + */ + { 2096, 1145, STRING_ENCODING_IBM01145, UNSUPPORTED, 0, + { "IBM01145", "CCSID01145", "CP01145", "ebcdic-es-284+euro", NULL } + }, + /* + * Source: IBM See (http://www.iana.org/assignments/charset-reg/IBM01146) + * [Mahdi] + */ + { 2097, 1146, STRING_ENCODING_IBM01146, UNSUPPORTED, 0, + { "IBM01146", "CCSID01146", "CP01146", "ebcdic-gb-285+euro", NULL } + }, + /* + * Source: IBM See (http://www.iana.org/assignments/charset-reg/IBM01147) + * [Mahdi] + */ + { 2098, 1147, STRING_ENCODING_IBM01147, UNSUPPORTED, 0, + { "IBM01147", "CCSID01147", "CP01147", "ebcdic-fr-297+euro", NULL } + }, + /* + * Source: IBM See (http://www.iana.org/assignments/charset-reg/IBM01148) + * [Mahdi] + */ + { 2099, 1148, STRING_ENCODING_IBM01148, UNSUPPORTED, 0, + { "IBM01148", "CCSID01148", "CP01148", "ebcdic-international-500+euro", + NULL } + }, + /* + * Source: IBM See (http://www.iana.org/assignments/charset-reg/IBM01149) + * [Mahdi] + */ + { 2100, 1149, STRING_ENCODING_IBM01149, UNSUPPORTED, 0, + { "IBM01149", "CCSID01149", "CP01149", "ebcdic-is-871+euro", NULL } + }, + /* + * Source: See (http://www.iana.org/assignments/charset-reg/Big5-HKSCS) + */ + { 2101, WINUNDEF, STRING_ENCODING_BIG_5_HK, UNSUPPORTED, 0, + { "Big5-HKSCS", NULL } + }, + /* + * Source: IBM1047 (EBCDIC Latin 1/Open Systems) + * http://www-1.ibm.com/servers/eserver/iseries/software/globalization/ + * pdf/cp01047z.pdf + */ + { 2102, 1047, STRING_ENCODING_IBM1047, UNSUPPORTED, 0, + { "IBM1047", "IBM-1047", NULL } + }, + /* + * Source: See (http://www.iana.org/assignments/charset-reg/PTCP154) + */ + { 2103, WINUNDEF, STRING_ENCODING_PTCP154, UNSUPPORTED, 0, + { "PTCP154", "csPTCP154", "PT154", "CP154", "Cyrillic-Asian", NULL } + }, + /* + * Source: See (http://www.amiga.ultranet.ru/Amiga-1251.html) + */ + { 2104, WINUNDEF, STRING_ENCODING_AMIGA_1251, UNSUPPORTED, 0, + { "Amiga-1251", "Ami1251", "Amiga1251", "Ami-1251", NULL } + }, + /* + * Source: See + * Aliases: None + */ + { 2105, WINUNDEF, STRING_ENCODING_KOI7_SWITCHED, UNSUPPORTED, 0, + { "KOI7-switched", NULL } + }, + /* + * Source: See + * [Thibault] + */ + { 2106, WINUNDEF, STRING_ENCODING_BRF, UNSUPPORTED, 0, + { "BRF", "csBRF", NULL } + }, + /* + * Source: See + * [Kalyanasundaram] + */ + { 2107, WINUNDEF, STRING_ENCODING_TSCII, UNSUPPORTED, 0, + { "TSCII", "csTSCII", NULL } + }, + /* + * Source: Microsoft + * (http://www.iana.org/assignments/charset-reg/windows-1250) [Lazhintseva] + */ + { 2250, 1250, STRING_ENCODING_WINDOWS_1250, SUPPORTED, 0, + { "windows-1250", "ibm-5346_P100-1998", "ibm-5346", "cp1250", NULL } + }, + /* + * Source: Microsoft + * (http://www.iana.org/assignments/charset-reg/windows-1251) [Lazhintseva] + */ + { 2251, 1251, STRING_ENCODING_WINDOWS_1251, SUPPORTED, 0, + { "windows-1251", "ibm-5347_P100-1998", "ibm-5347", "cp1251", "ANSI1251", + NULL } + }, + /* + * Source: Microsoft + * (http://www.iana.org/assignments/charset-reg/windows-1252) [Wendt] + */ + { 2252, 1252, STRING_ENCODING_WINDOWS_1252, SUPPORTED, 0, + { "windows-1252", "ibm-5348_P100-1997", "ibm-5348", "cp1252", NULL } + }, + /* + * Source: Microsoft + * (http://www.iana.org/assignments/charset-reg/windows-1253) [Lazhintseva] + */ + { 2253, 1253, STRING_ENCODING_WINDOWS_1253, SUPPORTED, 0, + { "windows-1253", "ibm-5349_P100-1998", "ibm-5349", "cp1253", NULL } + }, + /* + * Source: Microsoft + * (http://www.iana.org/assignments/charset-reg/windows-1254) [Lazhintseva] + */ + { 2254, 1254, STRING_ENCODING_WINDOWS_1254, SUPPORTED, 0, + { "windows-1254", "ibm-5350_P100-1998", "ibm-5350", "cp1254", NULL } + }, + /* + * Source: Microsoft + * (http://www.iana.org/assignments/charset-reg/windows-1255) [Lazhintseva] + */ + { 2255, 1255, STRING_ENCODING_WINDOWS_1255, SUPPORTED, 0, + { "windows-1255", "ibm-9447_P100-2002", "ibm-9447", "cp1255", NULL } + }, /* - * Byte string encodings that support all characters in Unicode. + * Source: Microsoft + * (http://www.iana.org/assignments/charset-reg/windows-1256) [Lazhintseva] */ - "UTF-8", // STRING_ENCODING_UTF8 - "UTF-16", // STRING_ENCODING_UTF16 - "UTF-16LE", // STRING_ENCODING_UTF16_LE - "UTF-16BE", // STRING_ENCODING_UTF16_BE - - "UTF-32", // STRING_ENCODING_UTF32 - "UTF-32LE", // STRING_ENCODING_UTF32_LE - "UTF-32BE", // STRING_ENCODING_UTF32_BE - + { 2256, 1256, STRING_ENCODING_WINDOWS_1256, SUPPORTED, 0, + { "windows-1256", "ibm-9448_X100-2005", "ibm-9448", "cp1256", NULL } + }, /* - * Legacy byte string encodings that only support a subset of Unicode. + * Source: Microsoft + * (http://www.iana.org/assignments/charset-reg/windows-1257) [Lazhintseva] */ - + { 2257, 1257, STRING_ENCODING_WINDOWS_1257, SUPPORTED, 0, + { "windows-1257", "ibm-9449_P100-2002", "ibm-9449", "cp1257", NULL } + }, /* - * Latin encodings + * Source: Microsoft + * (http://www.iana.org/assignments/charset-reg/windows-1258) [Lazhintseva] */ - "US-ASCII", // STRING_ENCODING_US_ASCII - "ISO-8859-1", // STRING_ENCODING_ISO_8859_1 - "ISO-8859-2", // STRING_ENCODING_ISO_8859_2 - "ISO-8859-3", // STRING_ENCODING_ISO_8859_3 - "ISO-8859-4", // STRING_ENCODING_ISO_8859_4 - "ISO-8859-5", // STRING_ENCODING_ISO_8859_5 - "ISO-8859-6", // STRING_ENCODING_ISO_8859_6 - "ISO-8859-7", // STRING_ENCODING_ISO_8859_7 - "ISO-8859-8", // STRING_ENCODING_ISO_8859_8 - "ISO-8859-9", // STRING_ENCODING_ISO_8859_9 - "ISO-8859-10", // STRING_ENCODING_ISO_8859_10 - "ISO-8859-11", // STRING_ENCODING_ISO_8859_11 - // Oddly, there is no ISO-8859-12. - "ISO-8859-13", // STRING_ENCODING_ISO_8859_13 - "ISO-8859-14", // STRING_ENCODING_ISO_8859_14 - "ISO-8859-15", // STRING_ENCODING_ISO_8859_15 - + { 2258, 1258, STRING_ENCODING_WINDOWS_1258, SUPPORTED, 0, + { "windows-1258", "ibm-5354_P100-1998", "ibm-5354", "cp1258", NULL } + }, /* - * Chinese encodings + * Source: Thai Industrial Standards Institute (TISI) + * [Tantsetthi] */ - "GB18030", // STRING_ENCODING_GB_18030 - "Big5", // STRING_ENCODING_BIG_5 - "Big5-HKSCS", // STRING_ENCODING_BIG_5_HK - "GBK", // STRING_ENCODING_GBK - "GB2312", // STRING_ENCODING_GB_2312 - "ISO-2022-CN", // STRING_ENCODING_ISO_2022_CN - + { 2259, WINUNDEF, STRING_ENCODING_TIS_620, SUPPORTED, 0, + { "TIS-620", "windows-874-2000", "MS874", NULL } + }, /* - * Japanese encodings + * Windows specific entries for which there is no corresponding IANA mapping */ - "Shift_JIS", // STRING_ENCODING_SHIFT_JIS - "EUC-JP", // STRING_ENCODING_EUC_JP - "ISO-2022-JP", // STRING_ENCODING_ISO_2022_JP - "ISO-2022-JP-1", // STRING_ENCODING_ISO_2022_JP_1 - "ISO-2022-JP-2", // STRING_ENCODING_ISO_2022_JP_2 - + /* - * Korean encodings + * Windows-709: Arabic (ASMO-449+, BCON V4) */ - "EUC-KR", // STRING_ENCODING_EUC_KR - "ISO-2022-KR", // STRING_ENCODING_ISO_2022_KR - + { MIBUNDEF, 709, STRING_ENCODING_WINDOWS_709, UNSUPPORTED, 0, + { "Windows-709", "ASMO-449+", "BCON_V4", NULL } + }, + /* + * Windows-710: Arabic - Transparent Arabic + */ + { MIBUNDEF, 710, STRING_ENCODING_WINDOWS_710, UNSUPPORTED, 0, + { "Windows-710", NULL } + }, + /* + * DOS-720: Arabic (Transparent ASMO); Arabic (DOS) + */ + { MIBUNDEF, 720, STRING_ENCODING_WINDOWS_720, UNSUPPORTED, 0, + { "Windows-720", "DOS-720", "DOS_720", NULL } + }, + /* + * ibm737: OEM Greek (formerly 437G); Greek (DOS) + */ + { MIBUNDEF, 737, STRING_ENCODING_WINDOWS_737, UNSUPPORTED, 0, + { "Windows-737", "IBM737", NULL } + }, + /* + * cp875: IBM EBCDIC Greek Modern + */ + { MIBUNDEF, 875, STRING_ENCODING_WINDOWS_875, UNSUPPORTED, 0, + { "Windows-875", "cp875", NULL } + }, + /* + * Johab: Korean (Johab) + */ + { MIBUNDEF, 1361, STRING_ENCODING_WINDOWS_1361, UNSUPPORTED, 0, + { "Windows-1361", "Johab", NULL } + }, + /* + * macintosh: MAC Roman; Western European (Mac) + * using the encoding names "mac" and "macintosh" + * is probably a bad idea here + */ + { MIBUNDEF, 10000, STRING_ENCODING_WINDOWS_10000, UNSUPPORTED, 0, + { "Windows-10000", NULL } + }, + /* + * x-mac-japanese: Japanese (Mac) + */ + { MIBUNDEF, 10001, STRING_ENCODING_WINDOWS_10001, UNSUPPORTED, 0, + { "Windows-10001", "x-mac-japanese", NULL } + }, + /* + * x-mac-chinesetrad: MAC Traditional Chinese (Big5); + * Chinese Traditional (Mac) + */ + { MIBUNDEF, 10002, STRING_ENCODING_WINDOWS_10002, UNSUPPORTED, 0, + { "Windows-10002", "x-mac-chinesetrad", NULL } + }, + /* + * x-mac-korean: Korean (Mac) + */ + { MIBUNDEF, 10003, STRING_ENCODING_WINDOWS_10003, UNSUPPORTED, 0, + { "Windows-10003", "x-mac-korean", NULL } + }, + /* + * x-mac-arabic: Arabic (Mac) + */ + { MIBUNDEF, 10004, STRING_ENCODING_WINDOWS_10004, UNSUPPORTED, 0, + { "Windows-10004", "x-mac-arabic", NULL } + }, + /* + * x-mac-hebrew: Hebrew (Mac) + */ + { MIBUNDEF, 10005, STRING_ENCODING_WINDOWS_10005, UNSUPPORTED, 0, + { "Windows-10005", "x-mac-hebrew", NULL } + }, + /* + * x-mac-greek: Greek (Mac) + */ + { MIBUNDEF, 10006, STRING_ENCODING_WINDOWS_10006, UNSUPPORTED, 0, + { "Windows-10006", "x-mac-greek", NULL } + }, + /* + * x-mac-cyrillic: Cyrillic (Mac) + */ + { MIBUNDEF, 10007, STRING_ENCODING_WINDOWS_10007, UNSUPPORTED, 0, + { "Windows-10007", "x-mac-cyrillic", NULL } + }, + /* + * x-mac-chinesesimp: MAC Simplified Chinese (GB 2312); + * Chinese Simplified (Mac) + */ + { MIBUNDEF, 10008, STRING_ENCODING_WINDOWS_10008, UNSUPPORTED, 0, + { "Windows-10008", "x-mac-chinesesimp", NULL } + }, + /* + * x-mac-romanian: Romanian (Mac) + */ + { MIBUNDEF, 10010, STRING_ENCODING_WINDOWS_10010, UNSUPPORTED, 0, + { "Windows-10010", "x-mac-romanian", NULL } + }, + /* + * x-mac-ukrainian: Ukrainian (Mac) + */ + { MIBUNDEF, 10017, STRING_ENCODING_WINDOWS_10017, UNSUPPORTED, 0, + { "Windows-10017", "x-mac-ukrainian", NULL } + }, + /* + * x-mac-thai: Thai (Mac) + */ + { MIBUNDEF, 10021, STRING_ENCODING_WINDOWS_10021, UNSUPPORTED, 0, + { "Windows-10021", "x-mac-thai", NULL } + }, + /* + * x-mac-ce: MAC Latin 2; Central European (Mac) + */ + { MIBUNDEF, 10029, STRING_ENCODING_WINDOWS_10029, UNSUPPORTED, 0, + { "Windows-10029", "x-mac-ce", NULL } + }, + /* + * x-mac-icelandic: Icelandic (Mac) + */ + { MIBUNDEF, 10079, STRING_ENCODING_WINDOWS_10079, UNSUPPORTED, 0, + { "Windows-10079", "x-mac-icelandic", NULL } + }, + /* + * x-mac-turkish: Turkish (Mac) + */ + { MIBUNDEF, 10081, STRING_ENCODING_WINDOWS_10081, UNSUPPORTED, 0, + { "Windows-10081", "x-mac-turkish", NULL } + }, + /* + * x-mac-croatian: Croatian (Mac) + */ + { MIBUNDEF, 10082, STRING_ENCODING_WINDOWS_10082, UNSUPPORTED, 0, + { "Windows-10082", "x-mac-croatian", NULL } + }, + /* + * x-Chinese_CNS: CNS Taiwan; Chinese Traditional (CNS) + */ + { MIBUNDEF, 20000, STRING_ENCODING_WINDOWS_20000, UNSUPPORTED, 0, + { "Windows-20000", "x-Chinese_CNS", NULL } + }, + /* + * x-cp20001: TCA Taiwan + */ + { MIBUNDEF, 20001, STRING_ENCODING_WINDOWS_20001, UNSUPPORTED, 0, + { "Windows-20001", "x-cp20001", NULL } + }, + /* + * x_Chinese-Eten: Eten Taiwan; Chinese Traditional (Eten) + */ + { MIBUNDEF, 20002, STRING_ENCODING_WINDOWS_20002, UNSUPPORTED, 0, + { "Windows-20002", "x_Chinese-Eten", NULL } + }, + /* + * x-cp20003: IBM5550 Taiwan + */ + { MIBUNDEF, 20003, STRING_ENCODING_WINDOWS_20003, UNSUPPORTED, 0, + { "Windows-20003", "x-cp20003", NULL } + }, + /* + * x-cp20004: TeleText Taiwan + */ + { MIBUNDEF, 20004, STRING_ENCODING_WINDOWS_20004, UNSUPPORTED, 0, + { "Windows-20004", "x-cp20004", NULL } + }, + /* + * x-cp20005: Wang Taiwan + */ + { MIBUNDEF, 20005, STRING_ENCODING_WINDOWS_20005, UNSUPPORTED, 0, + { "Windows-20005", "x-cp20005", NULL } + }, + /* + * x-IA5: IA5 (IRV International Alphabet No. 5, 7-bit); + * Western European (IA5) + */ + { MIBUNDEF, 20105, STRING_ENCODING_WINDOWS_20105, UNSUPPORTED, 0, + { "Windows-20105", "x-IA5", NULL } + }, /* - * Windows encodings + * x-IA5-German: IA5 German (7-bit) */ - "windows-1250", // STRING_ENCODING_WINDOWS_1250 - "windows-1251", // STRING_ENCODING_WINDOWS_1251 - "windows-1252", // STRING_ENCODING_WINDOWS_1252 - "windows-1253", // STRING_ENCODING_WINDOWS_1253 - "windows-1254", // STRING_ENCODING_WINDOWS_1254 - "windows-1255", // STRING_ENCODING_WINDOWS_1255 - "windows-1256", // STRING_ENCODING_WINDOWS_1256 - "windows-1257", // STRING_ENCODING_WINDOWS_1257 - "windows-1258", // STRING_ENCODING_WINDOWS_1258 + { MIBUNDEF, 20106, STRING_ENCODING_WINDOWS_20106, UNSUPPORTED, 0, + { "Windows-20106", "x-IA5-German", NULL } + }, + /* + * x-IA5-Swedish: IA5 Swedish (7-bit) + */ + { MIBUNDEF, 20107, STRING_ENCODING_WINDOWS_20107, UNSUPPORTED, 0, + { "Windows-20107", "x-IA5-Swedish", NULL } + }, + /* + * x-IA5-Norwegian: IA5 Norwegian (7-bit) + */ + { MIBUNDEF, 20108, STRING_ENCODING_WINDOWS_20108, UNSUPPORTED, 0, + { "Windows-20108", "x-IA5-Norwegian", NULL } + }, + /* + * x-cp20269: ISO 6937 Non-Spacing Accent + */ + { MIBUNDEF, 20269, STRING_ENCODING_WINDOWS_20269, UNSUPPORTED, 0, + { "Windows-20269", "x-cp20269", NULL } + }, + /* + * x-EBCDIC-KoreanExtended: IBM EBCDIC Korean Extended + */ + { MIBUNDEF, 20833, STRING_ENCODING_WINDOWS_20833, UNSUPPORTED, 0, + { "Windows-20833", "x-EBCDIC-KoreanExtended", NULL } + }, + /* + * x-cp20949: Korean Wansung + */ + { MIBUNDEF, 20949, STRING_ENCODING_WINDOWS_20949, UNSUPPORTED, 0, + { "Windows-20949", "x-cp20949", NULL } + }, + /* + * cp1025: IBM EBCDIC Cyrillic Serbian-Bulgarian + */ + { MIBUNDEF, 21025, STRING_ENCODING_WINDOWS_21025, UNSUPPORTED, 0, + { "Windows-21025", "cp1025", NULL } + }, + /* + * Windows-21027: (deprecated) + */ + { MIBUNDEF, 21027, STRING_ENCODING_WINDOWS_21027, UNSUPPORTED, 0, + { "Windows-21027", NULL } + }, + /* + * x-Europa: Europa 3 + */ + { MIBUNDEF, 29001, STRING_ENCODING_WINDOWS_29001, UNSUPPORTED, 0, + { "Windows-29001", "x-Europa", NULL } + }, + /* + * iso-8859-8-i: ISO 8859-8 Hebrew; Hebrew (ISO-Logical) + */ + { MIBUNDEF, 38598, STRING_ENCODING_WINDOWS_38598, UNSUPPORTED, 0, + { "Windows-38598", "iso-8859-8-i", NULL } + }, + /* + * csISO2022JP: ISO 2022 Japanese with halfwidth Katakana; + * Japanese (JIS-Allow 1 byte Kana) + */ + { MIBUNDEF, 50221, STRING_ENCODING_WINDOWS_50221, UNSUPPORTED, 0, + { "Windows-50221", "csISO2022JP", NULL } + }, + /* + * iso-2022-jp: ISO 2022 Japanese JIS X 0201-1989; + * Japanese (JIS-Allow 1 byte Kana - SO/SI) + */ + { MIBUNDEF, 50222, STRING_ENCODING_WINDOWS_50222, UNSUPPORTED, 0, + { "Windows-50222", "iso-2022-jp", NULL } + }, + /* + * Windows-50229: ISO 2022 Traditional Chinese + */ + { MIBUNDEF, 50229, STRING_ENCODING_WINDOWS_50229, UNSUPPORTED, 0, + { "Windows-50229", NULL } + }, + /* + * Windows-50930: EBCDIC Japanese (Katakana) Extended + */ + { MIBUNDEF, 50930, STRING_ENCODING_WINDOWS_50930, UNSUPPORTED, 0, + { "Windows-50930", NULL } + }, + /* + * Windows-50931: EBCDIC US-Canada and Japanese + */ + { MIBUNDEF, 50931, STRING_ENCODING_WINDOWS_50931, UNSUPPORTED, 0, + { "Windows-50931", NULL } + }, + /* + * Windows-50933: EBCDIC Korean Extended and Korean + */ + { MIBUNDEF, 50933, STRING_ENCODING_WINDOWS_50933, UNSUPPORTED, 0, + { "Windows-50933", NULL } + }, + /* + * Windows-50935: EBCDIC Simplified Chinese Extended and Simplified Chinese + */ + { MIBUNDEF, 50935, STRING_ENCODING_WINDOWS_50935, UNSUPPORTED, 0, + { "Windows-50935", NULL } + }, + /* + * Windows-50936: EBCDIC Simplified Chinese + */ + { MIBUNDEF, 50936, STRING_ENCODING_WINDOWS_50936, UNSUPPORTED, 0, + { "Windows-50936", NULL } + }, + /* + * Windows-50937: EBCDIC US-Canada and Traditional Chinese + */ + { MIBUNDEF, 50937, STRING_ENCODING_WINDOWS_50937, UNSUPPORTED, 0, + { "Windows-50937", NULL } + }, + /* + * Windows-50939: EBCDIC Japanese (Latin) Extended and Japanese + */ + { MIBUNDEF, 50939, STRING_ENCODING_WINDOWS_50939, UNSUPPORTED, 0, + { "Windows-50939", NULL } + }, + /* + * EUC-CN: EUC Simplified Chinese; Chinese Simplified (EUC) + */ + { MIBUNDEF, 51936, STRING_ENCODING_WINDOWS_51936, UNSUPPORTED, 0, + { "Windows-51936", "EUC-CN", NULL } + }, + /* + * Windows-51950: EUC Traditional Chinese + */ + { MIBUNDEF, 51950, STRING_ENCODING_WINDOWS_51950, UNSUPPORTED, 0, + { "Windows-51950", NULL } + }, + /* + * x-iscii-de: ISCII Devanagari + */ + { MIBUNDEF, 57002, STRING_ENCODING_WINDOWS_57002, SUPPORTED, 0, + { "Windows-57002", "x-iscii-de", "iscii-dev", "ibm-4902", NULL } + }, + /* + * x-iscii-be: ISCII Bengali + */ + { MIBUNDEF, 57003, STRING_ENCODING_WINDOWS_57003, SUPPORTED, 0, + { "Windows-57003", "x-iscii-be", "iscii-bng", NULL } + }, + /* + * x-iscii-ta: ISCII Tamil + */ + { MIBUNDEF, 57004, STRING_ENCODING_WINDOWS_57004, SUPPORTED, 0, + { "Windows-57004", "x-iscii-ta", "iscii-tml", NULL } + }, + /* + * x-iscii-te: ISCII Telugu + */ + { MIBUNDEF, 57005, STRING_ENCODING_WINDOWS_57005, SUPPORTED, 0, + { "Windows-57005", "x-iscii-te", "iscii-tlg", NULL } + }, + /* + * x-iscii-as: ISCII Assamese + */ + { MIBUNDEF, 57006, STRING_ENCODING_WINDOWS_57006, SUPPORTED, 0, + { "Windows-57006", "x-iscii-as", NULL } + }, + /* + * x-iscii-or: ISCII Oriya + */ + { MIBUNDEF, 57007, STRING_ENCODING_WINDOWS_57007, SUPPORTED, 0, + { "Windows-57007", "x-iscii-or", "iscii-ori", NULL } + }, + /* + * x-iscii-ka: ISCII Kannada + */ + { MIBUNDEF, 57008, STRING_ENCODING_WINDOWS_57008, SUPPORTED, 0, + { "Windows-57008", "x-iscii-ka", "iscii-knd", NULL } + }, + /* + * x-iscii-ma: ISCII Malayalam + */ + { MIBUNDEF, 57009, STRING_ENCODING_WINDOWS_57009, SUPPORTED, 0, + { "Windows-57009", "x-iscii-ma", "iscii-mlm", NULL } + }, + /* + * x-iscii-gu: ISCII Gujarati + */ + { MIBUNDEF, 57010, STRING_ENCODING_WINDOWS_57010, SUPPORTED, 0, + { "Windows-57010", "x-iscii-gu", "x-iscii-guj", NULL } + }, + /* + * x-iscii-pa: ISCII Punjabi + */ + { MIBUNDEF, 57011, STRING_ENCODING_WINDOWS_57011, SUPPORTED, 0, + { "Windows-57011", "x-iscii-pa", "iscii-gur", NULL } + }, }; /* + * Thread-safe hash table to speed up encoding name -> IANA table + * index lookups. + */ +static HashTable *encCache = NULL; + + +/* *----------------------------------------------------------------------------- * * UnicodeNormalizeEncodingName -- @@ -164,6 +2220,93 @@ /* *----------------------------------------------------------------------------- * + * UnicodeIANALookup -- + * + * Lookup an encoding name in the IANA cross reference table. + * + * Results: + * The index of the encoding within the table + * -1 if the encoding is not found + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static int +UnicodeIANALookup(const char *encodingName) // IN +{ + char *name; + char *candidate = NULL; + const char *p; + int i; + int j; + int acp; + void *idx; + + if (encCache && HashTable_Lookup(encCache, encodingName, (void **) &idx)) { + return (int)(uintptr_t)idx; + } + + name = UnicodeNormalizeEncodingName(encodingName); + + /* + * check for Windows-xxxx encoding names generated from GetACP() + * code page numbers, see: CodeSetOld_GetCurrentCodeSet() + */ + if (!strncmp(encodingName, "windows-", strlen("windows-"))) { + p = encodingName + strlen("windows-"); + acp = 0; + while (*p && isdigit((int)*p)) { + acp *= 10; + acp += *p - '0'; + p++; + } + if (!*p) { + for (i = 0; i < ARRAYSIZE(xRef); i++) { + if (xRef[i].winACP == acp) { + goto done; + } + } + } + } + + for (i = 0; i < ARRAYSIZE(xRef); i++) { + for (j = 0; (p = xRef[i].names[j]) != NULL; j++) { + candidate = UnicodeNormalizeEncodingName(p); + if (!strcmp(name, candidate)) { + goto done; + } + free(candidate); + } + } + free(name); + + /* + * Did not find a matching name. Don't validate encoding names + * here, unrecognized encoding will be caught when converting + * from name to enum. + */ + Log("%s: Did not find an IANA match for encoding \"%s\"\n", + __FUNCTION__, encodingName); + return -1; + +done: + free(name); + free(candidate); + + if (encCache) { + HashTable_Insert(encCache, encodingName, (void *)(uintptr_t)i); + } + + return i; +} + + +/* + *----------------------------------------------------------------------------- + * * Unicode_EncodingEnumToName -- * * Converts a StringEncoding enum value to the equivalent @@ -183,36 +2326,24 @@ const char * Unicode_EncodingEnumToName(StringEncoding encoding) // IN { - // STRING_ENCODING_UNKNOWN shouldn't be hit at runtime. - ASSERT(encoding != STRING_ENCODING_UNKNOWN); + int i; - switch (encoding) { - case STRING_ENCODING_UNKNOWN: - /* - * We will only get here in non-debug builds. Fall through to - * the process-default encoding name. - */ - case STRING_ENCODING_DEFAULT: - /* - * XXX TODO: Need CodeSetGetCurrentCodeSet() from lib/misc/codeset.c, - * and need to extend with Win32 implementation. - */ - return "UTF-8"; - break; - default: - ASSERT(encoding >= STRING_ENCODING_FIRST); - ASSERT(encoding < STRING_ENCODING_MAX_SPECIFIED); - - if ( encoding < STRING_ENCODING_FIRST - || encoding >= STRING_ENCODING_MAX_SPECIFIED) { - const char *defaultEncoding = "UTF-8"; - Log("%s: Unknown encoding %d, returning default (%s).", - __FUNCTION__, encoding, defaultEncoding); - return defaultEncoding; - } + encoding = Unicode_ResolveEncoding(encoding); - return SIMPLE_ENCODING_LIST[encoding]; + /* + * Look for a match in the xRef table. If found, return the + * preferred MIME name. Whether ICU supports this encoding or + * not isn't material here. + */ + + for (i = 0; i < ARRAYSIZE(xRef); i++) { + if (encoding == xRef[i].encoding) { + return xRef[i].names[xRef[i].preferredMime]; + } } + + Log("%s: Unknown encoding %d.\n", __FUNCTION__, encoding); + NOT_REACHED(); } @@ -226,7 +2357,7 @@ * * Results: * The StringEncoding enum value corresponding to the name, or - * STRING_ENCODING_UNKNOWN if the encoding name wasn't found. + * STRING_ENCODING_UNKNOWN if the encoding name is not supported. * * Side effects: * None @@ -237,39 +2368,216 @@ StringEncoding Unicode_EncodingNameToEnum(const char *encodingName) // IN { - StringEncoding result = STRING_ENCODING_UNKNOWN; - char *normalizedEncodingName; - size_t encoding; - - normalizedEncodingName = UnicodeNormalizeEncodingName(encodingName); - - for (encoding = STRING_ENCODING_FIRST; - encoding < STRING_ENCODING_MAX_SPECIFIED; - encoding++) { - char *normalizedEncodingListEntry; - - ASSERT(SIMPLE_ENCODING_LIST[encoding]); - - /* - * TODO: We can optimize this by pulling this code out into - * a once-on-startup initialization, where we generate and - * cache the normalized encoding name list upon first use. - */ - normalizedEncodingListEntry = - UnicodeNormalizeEncodingName(SIMPLE_ENCODING_LIST[encoding]); + int idx; + + idx = UnicodeIANALookup(encodingName); + if (idx < 0) { + return STRING_ENCODING_UNKNOWN; + } + return xRef[idx].isSupported ? xRef[idx].encoding : STRING_ENCODING_UNKNOWN; +} + + +/* + *----------------------------------------------------------------------------- + * + * UnicodeGetCurrentEncodingInternal -- + * + * Calls CodeSet_GetCurrentCodeSet() and returns the corresponding + * encoding. + * + * Results: + * The current encoding. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +StringEncoding +UnicodeGetCurrentEncodingInternal(void) +{ + StringEncoding encoding = + Unicode_EncodingNameToEnum(CodeSet_GetCurrentCodeSet()); + + ASSERT(Unicode_IsEncodingValid(encoding)); + return encoding; +} + + +/* + *----------------------------------------------------------------------------- + * + * Unicode_IsEncodingValid -- + * + * Checks whether we support the given encoding. + * + * Results: + * TRUE if supported, FALSE otherwise. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +Bool +Unicode_IsEncodingValid(StringEncoding encoding) // IN +{ + return encoding >= STRING_ENCODING_FIRST && + encoding < STRING_ENCODING_MAX_SPECIFIED; +} + + +/* + *----------------------------------------------------------------------------- + * + * Unicode_InitEx -- + * + * Convert argv and environment from default encoding into unicode + * and initialize the cache of the native code set name used to + * resolve STRING_ENCODING_DEFAULT. + * + * Results: + * returns on success + * errors are terminal + * + * Side effects: + * Calling CodeSet_GetCurrentCodeSet() initializes the cache of the + * native code set name. The cached name is used to resolve references + * to STRING_ENCODING_DEFAULT in unicode functions. + * + *----------------------------------------------------------------------------- + */ + +void +Unicode_InitEx(int argc, // IN + char ***argv, // IN/OUT + char ***envp, // IN/OUT + const char *icuDataDir) // IN +{ +#if !defined(__APPLE__) && !defined(VMX86_SERVER) + char **list; + StringEncoding encoding; +#endif + + /* + * Always init the codeset module first. + */ - if (0 == strcmp(normalizedEncodingName, normalizedEncodingListEntry)) { - result = (StringEncoding)encoding; + if (!CodeSet_Init(icuDataDir)) { + Panic("Failed to initialize codeset.\n"); + goto bail; + } + + encCache = HashTable_Alloc(128, HASH_ISTRING_KEY | HASH_FLAG_ATOMIC | + HASH_FLAG_COPYKEY, free); + if (encCache == NULL) { + Panic("HashTable_Alloc failed.\n"); + goto bail; + } + + // UTF-8 native encoding for these two +#if !defined(__APPLE__) && !defined(VMX86_SERVER) + + encoding = Unicode_EncodingNameToEnum(CodeSet_GetCurrentCodeSet()); + if (!Unicode_IsEncodingValid(encoding)) { + Panic("Unsupported local character encoding \"%s\".\n", + Unicode_EncodingEnumToName(STRING_ENCODING_DEFAULT)); + goto bail; + } + + if (argv) { + list = Unicode_AllocList(*argv, argc + 1, STRING_ENCODING_DEFAULT); + if (!list) { + Panic("Unicode_AllocList1 failed.\n"); + goto bail; + } + *argv = list; + } + + if (envp) { + list = Unicode_AllocList(*envp, -1, STRING_ENCODING_DEFAULT); + if (!list) { + Panic("Unicode_AllocList2 failed.\n"); + goto bail; } + *envp = list; + } +#endif // !__APPLE__ && !VMX86_SERVER + + return; + +bail: + exit(1); +} + +void +Unicode_Init(int argc, // IN + char ***argv, // IN/OUT + char ***envp) // IN/OUT +{ + Unicode_InitEx(argc, argv, envp, NULL); +} + +#if defined(_WIN32) +void +Unicode_InitW(int argc, // IN + utf16_t **wargv, // IN + utf16_t **wenvp, // IN + char ***argv, // OUT + char ***envp) // OUT +{ + char **list; + StringEncoding encoding; + + /* + * Always init the codeset module first. + */ + + if (!CodeSet_Init(NULL)) { + Panic("Failed to initialize codeset.\n"); + goto bail; + } - free(normalizedEncodingListEntry); + encCache = HashTable_Alloc(128, HASH_ISTRING_KEY | HASH_FLAG_ATOMIC | + HASH_FLAG_COPYKEY, free); + if (encCache == NULL) { + Panic("HashTable_Alloc failed.\n"); + goto bail; + } + + encoding = Unicode_EncodingNameToEnum(CodeSet_GetCurrentCodeSet()); + if (!Unicode_IsEncodingValid(encoding)) { + Panic("Unsupported character encoding \"%s\".\n", + Unicode_EncodingEnumToName(encoding)); + goto bail; + } + + encoding = STRING_ENCODING_UTF16; - if (result != STRING_ENCODING_UNKNOWN) { - break; + if (wargv) { + list = Unicode_AllocList((char **)wargv, argc + 1, STRING_ENCODING_UTF16); + if (!list) { + Panic("Unicode_AllocList1 failed.\n"); + goto bail; } + *argv = list; } - free(normalizedEncodingName); + if (wenvp) { + list = Unicode_AllocList((char **)wenvp, -1, STRING_ENCODING_UTF16); + if (!list) { + Panic("Unicode_AllocList2 failed.\n"); + goto bail; + } + *envp = list; + } - return result; + return; + +bail: + exit(1); } +#endif // _WIN32 diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/unicode/unicodeSimpleUTF16.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/unicode/unicodeSimpleUTF16.h --- open-vm-tools-2008.01.23-74039/lib/unicode/unicodeSimpleUTF16.h 2008-01-28 08:02:51.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/unicode/unicodeSimpleUTF16.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,197 +0,0 @@ -/********************************************************* - * Copyright (C) 2007 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 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. - * - *********************************************************/ - -/* - * unicodeSimpleUTF16.h -- - * - * UTF-16 handling macros. Based on utf16.h from ICU 1.8.1. - */ - -#ifndef _UNICODE_SIMPLE_UTF16_H -#define _UNICODE_SIMPLE_UTF16_H - -#include "unicodeTypes.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 // _UNICODE_SIMPLE_UTF16_H diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/unicode/unicodeStatic.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/unicode/unicodeStatic.c --- open-vm-tools-2008.01.23-74039/lib/unicode/unicodeStatic.c 2008-01-28 08:02:51.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/unicode/unicodeStatic.c 2008-10-13 08:01:53.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -22,15 +22,11 @@ * Manages memory for static ConstUnicode literal strings * created like: * - * ConstUnicode foo = U("foo"); - * - * and - * * ConstUnicode c = U_UNESCAPE("Copyright \\u00A9 VMware, Inc."); * - * Uses two HashTables to hold static ConstUnicode strings, - * protected by a single mutex. Static ConstUnicode strings are - * keyed off the ASCII bytes passed to the static macros. + * Uses two HashTables to hold static ConstUnicode strings. Static + * ConstUnicode strings are keyed off the ASCII bytes passed to the + * static macros. * * Unescaped strings are kept separate from escaped strings so * users can expect a literal "\\" to stay as-is by default. @@ -48,50 +44,38 @@ */ #include "vmware.h" -#include "hash.h" -#include "syncMutex.h" +#include "hashTable.h" +#include "vm_atomic.h" +#include "hashTable.h" #include "unicodeBase.h" #include "unicodeInt.h" #include "util.h" -static HashTable *UnicodeStaticStringTable = NULL; -static HashTable *UnicodeStaticUnescapedStringTable = NULL; - -static void UnicodeStaticCreateTableIfNeeded(HashTable **table); +/* These are Implicitly initialized to NULL */ +static Atomic_Ptr UnicodeStringTable; +static Atomic_Ptr UnicodeUnescapedStringTable; /* *----------------------------------------------------------------------------- * - * UnicodeStaticCreateTableIfNeeded -- + * UnicodeHashFree -- * - * Helper function to create a static 7-bit ASCII -> Unicode - * string table if needed. + * Called by the hash table functions when a value must be replaced. * * Results: - * None + * The argument, a unicode, is freed. * * Side effects: - * If *table is NULL, allocates a HashTable to use ASCII string keys - * and stores the result in *table. + * None. * *----------------------------------------------------------------------------- */ -void -UnicodeStaticCreateTableIfNeeded(HashTable **table) // OUT +static void +UnicodeHashFree(void *v) // IN: { - if (!*table) { - /* - * We don't supply a free function, since these strings are - * never freed. - * - * We use HASH_STRING_KEY to use the 7-bit ASCII strings passed - * to Unicode_GetStatic() as the lookup key into the hash, to - * avoid creating the same string multiple times. - */ - *table = Hash_Alloc(4096, HASH_STRING_KEY, NULL); - } + Unicode_Free((Unicode) v); } @@ -100,7 +84,7 @@ * * Unicode_GetStatic -- * - * Helper function for U() and U_UNESCAPE() macros. + * Helper function for the U_UNESCAPE() macro. * * Given a NUL-terminated ASCII string, returns a ConstUnicode * string containing the string's contents. @@ -114,8 +98,8 @@ * caller does not need to free. * * Side effects: - * Creates UnicodeStaticStringTable and UnicodeStaticUnescapedStringTable - * if they don't yet exist. + * Creates the UnicodeStringTable and UnicodeUnescapedStringTable hash + * tables if it don't yet exist. * Creates and inserts a Unicode string into the appropriate static * string table if the key 'asciiBytes' is not found in the table. * @@ -126,32 +110,40 @@ Unicode_GetStatic(const char *asciiBytes, // IN Bool unescape) // IN { - static Atomic_Ptr lckStorage; - SyncMutex *lck; Unicode result = NULL; HashTable *stringTable; - lck = SyncMutex_CreateSingleton(&lckStorage); - SyncMutex_Lock(lck); - - UnicodeStaticCreateTableIfNeeded(&UnicodeStaticUnescapedStringTable); - UnicodeStaticCreateTableIfNeeded(&UnicodeStaticStringTable); - if (unescape) { - stringTable = UnicodeStaticUnescapedStringTable; + stringTable = HashTable_AllocOnce(&UnicodeUnescapedStringTable, 4096, + HASH_FLAG_ATOMIC | HASH_STRING_KEY, + UnicodeHashFree); } else { - stringTable = UnicodeStaticStringTable; + stringTable = HashTable_AllocOnce(&UnicodeStringTable, 4096, + HASH_FLAG_ATOMIC | HASH_STRING_KEY, + UnicodeHashFree); } - if (!Hash_Lookup(stringTable, asciiBytes, (void **)&result)) { - result = UnicodeAllocStatic(asciiBytes, unescape); - - if (result) { - Hash_Insert(stringTable, asciiBytes, result); + /* + * Attempt a lookup for the key value; if it is found things are easy and + * fine. Otherwise HashTable_LookupOrInsert is used to attempt to enter + * the data in a racey manner. Should multiple threads attempt to enter + * the same key concurrently one thread will get the entered data and the + * other threads will detect that their entries were rejected; they + * discard their copies of the data and use the entered data (values + * will be stable). + */ + + if (!HashTable_Lookup(stringTable, asciiBytes, (void **) &result)) { + Unicode newData = UnicodeAllocStatic(asciiBytes, unescape); + + if (newData) { + result = HashTable_LookupOrInsert(stringTable, asciiBytes, newData); + + if (result != newData) { + Unicode_Free(newData); + } } } - SyncMutex_Unlock(lck); - return result; } diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/unity/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/unity/Makefile.am --- open-vm-tools-2008.01.23-74039/lib/unity/Makefile.am 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/unity/Makefile.am 2008-10-13 08:01:48.000000000 +0100 @@ -0,0 +1,28 @@ +################################################################################ +### Copyright 2008 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_LIBRARIES = libUnity.a + +libUnity_a_SOURCES = +libUnity_a_SOURCES += unity.c +libUnity_a_SOURCES += unityPlatformX11.c +libUnity_a_SOURCES += unityPlatformX11Settings.c +libUnity_a_SOURCES += unityPlatformX11Window.c + +AM_CFLAGS = @GTK_CPPFLAGS@ +AM_CFLAGS += @LIB_FILE_CPPFLAGS@ +AM_CFLAGS += @URIPARSER_CPPFLAGS@ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/unity/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/unity/Makefile.in --- open-vm-tools-2008.01.23-74039/lib/unity/Makefile.in 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/unity/Makefile.in 2008-10-13 08:02:16.000000000 +0100 @@ -0,0 +1,501 @@ +# 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 2008 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/unity +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)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) +ARFLAGS = cru +libUnity_a_AR = $(AR) $(ARFLAGS) +libUnity_a_LIBADD = +am_libUnity_a_OBJECTS = unity.$(OBJEXT) unityPlatformX11.$(OBJEXT) \ + unityPlatformX11Settings.$(OBJEXT) \ + unityPlatformX11Window.$(OBJEXT) +libUnity_a_OBJECTS = $(am_libUnity_a_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 = $(libUnity_a_SOURCES) +DIST_SOURCES = $(libUnity_a_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_XLIBS = @COMMON_XLIBS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ +DNET_LIBS = @DNET_LIBS@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ +GTK_LIBS = @GTK_LIBS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ +HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ +MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ +RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ +VERSION = @VERSION@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +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@ +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@ +lt_ECHO = @lt_ECHO@ +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_LIBRARIES = libUnity.a +libUnity_a_SOURCES = unity.c unityPlatformX11.c \ + unityPlatformX11Settings.c unityPlatformX11Window.c +AM_CFLAGS = @GTK_CPPFLAGS@ @LIB_FILE_CPPFLAGS@ @URIPARSER_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/unity/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu lib/unity/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-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) +libUnity.a: $(libUnity_a_OBJECTS) $(libUnity_a_DEPENDENCIES) + -rm -f libUnity.a + $(libUnity_a_AR) libUnity.a $(libUnity_a_OBJECTS) $(libUnity_a_LIBADD) + $(RANLIB) libUnity.a + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unity.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unityPlatformX11.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unityPlatformX11Settings.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unityPlatformX11Window.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 $(LIBRARIES) +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-noinstLIBRARIES \ + 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-noinstLIBRARIES 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: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/unity/unity.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/unity/unity.c --- open-vm-tools-2008.01.23-74039/lib/unity/unity.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/unity/unity.c 2008-10-13 08:01:51.000000000 +0100 @@ -0,0 +1,1967 @@ +/********************************************************* + * Copyright (C) 2007 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. + * + *********************************************************/ + +/* + * Unity.c -- + * + * Unity window manager intergration tools service. + * + * RPC Usage: + * unity.get.update [incremental] + * + * The tools service response to requests for windows events via the + * "unity.get.update" RPC from the host. Upon receiving the RPC, the + * service will crawl the window manager, taking note of the positions, + * window regions, etc for every window in the system. The service + * will reply describing the current state. + * + * If the intial request included the "incremental" argument, a list + * of all the changes to the windowing system since the last + * unity.get.update request will be sent (e.g. if a window moves + * or has been destroyed). + * + * If the "incremental" argument is not present, the entire state + * of the windowing system is returned. + * + * The reply to the RPC is a double null terminated list of null + * terminated strings. Each string in the list has one of the following + * formats: + * + * add + * A window with the specified integer windowid has just been + * created. + * + * remove + * The window with integer windowid has been removed. Get rid of it. + * + * move + * The window with specified integer windowid has moved or resized + * such that its top left corner rests at x1,y1 and its bottom right + * at x2,y2. + * + * region + * The window with specified windowid has a not-rectangular window + * region (e.g. the curved corner windows in Windows XP). Immediately, + * after this messages are numrects messages with the following format: + * + * rect + * Defines a rectangle in the coordinate system of the window + * for this region (not the coordinate system of the desktop!!) + * + * The actual window region is the union of all the rectangles in the + * list. A value of 0 for numrects indicates that the window region + * should be ignored (i.e. the window region is identical to the + * bounds of the window). + * + * title + * A window with the specified integer windowid has just changed its + * title. + * + * zorder <num windows> <window id 1> <window id 2> ... <window id n> + * Z order of windows from top to bottom(or front to rear) + * + * attr <windowid> <attr> <enabled> + * The window with specified windowid has an attribute enabled/disabled. + * + * type <windowid> <type> + * The window with specified windowid is of a certain type + * + * icon <windowid> <icontype> + * The window with specified windowid has changed an icon of the specified + * type. + * + * desktop <windowid> <desktopid> + * The window with specified windowid has been moved to a different desktop. + * + * activedesktop <desktopid> + * The desktop with specified desktopid has become active. + * + * The guest is also capable of pushing incremental updates to the VMX. + * When we enter Unity (upon getting "unity.enter" command from the VMX), + * start a separate Unity window update thread. This thread will gather + * window updates from the guest, and send them to the VMX (if there are + * any updates to be sent). + * The incremental updates will be sent using 'tools.unity.push.update' command. + * + */ + +#include "vmware.h" +#include "rpcin.h" +#include "rpcout.h" +#include "debug.h" +#include "util.h" +#include "strutil.h" +#include "region.h" +#include "unityWindowTracker.h" +#include "unityCommon.h" +#include "unity.h" +#include "unityPlatform.h" +#include "unityDebug.h" +#include "dynxdr.h" +#include "guestrpc/unityActive.h" +#include "guestCaps.h" +#include "appUtil.h" +#include <stdio.h> + +/* + * Singleton object for tracking the state of the service. + */ +typedef struct UnityState { + UnityWindowTracker tracker; + Bool forceEnable; + Bool isEnabled; + UnityVirtualDesktopArray virtDesktopArray; // Virtual desktop configuration + + UnityPlatform *up; // Platform-specific state +} UnityState; + +static UnityState unity; + +static GuestCapabilities unityCaps[] = { + UNITY_CAP_STATUS_UNITY_ACTIVE +}; + + +/* + * Helper Functions + */ + +static Bool UnityUpdateState(void); +static void UnityUpdateCallbackFn(void *param, UnityUpdate *update); +static Bool UnityTcloGetUpdate(char const **result, size_t *resultLen, const char *name, + const char *args, size_t argsSize, void *clientData); +static Bool UnityTcloEnter(char const **result, size_t *resultLen, const char *name, + const char *args, size_t argsSize, void *clientData); +static Bool UnityTcloExit(char const **result, size_t *resultLen, const char *name, + const char *args, size_t argsSize, void *clientData); +static Bool UnityTcloGetWindowPath(char const **result, size_t *resultLen, + const char *name, const char *args, + size_t argsSize, void *clientData); +static Bool UnityTcloWindowCommand(char const **result, + size_t *resultLen, + const char *name, + const char *args, + size_t argsSize, + void *clientData); +static Bool UnityTcloGetWindowContents(char const **result, + size_t *resultLen, + const char *name, + const char *args, + size_t argsSize, + void *clientData); +static Bool UnityTcloGetIconData(char const **result, + size_t *resultLen, + const char *name, + const char *args, + size_t argsSize, + void *clientData); +static Bool UnityTcloSetDesktopWorkArea(char const **result, + size_t *resultLen, + const char *name, + const char *args, + size_t argsSize, + void *clientData); +static Bool UnityTcloSetTopWindowGroup(char const **result, + size_t *resultLen, + const char *name, + const char *args, + size_t argsSize, + void *clientData); +static Bool UnityTcloShowTaskbar(char const **result, + size_t *resultLen, + const char *name, + const char *args, + size_t argsSize, + void *clientData); +static Bool UnityTcloMoveResizeWindow(char const **result, + size_t *resultLen, + const char *name, + const char *args, + size_t argsSize, + void *clientData); +static Bool UnityTcloSetDesktopConfig(char const **result, + size_t *resultLen, + const char *name, + const char *args, + size_t argsSize, + void *clientData); +static Bool UnityTcloSetDesktopActive(char const **result, + size_t *resultLen, + const char *name, + const char *args, + size_t argsSize, + void *clientData); +static Bool UnityTcloSetWindowDesktop(char const **result, + size_t *resultLen, + const char *name, + const char *args, + size_t argsSize, + void *clientData); + + +/* + * Dispatch table for Unity window commands. All commands performing actions on + * guest unity windows go here. + */ + +typedef struct { + const char *name; + Bool (*exec)(UnityPlatform *up, UnityWindowId window); +} UnityCommandElem; + +static UnityCommandElem unityCommandTable[] = { + { UNITY_RPC_WINDOW_RESTORE, UnityPlatformRestoreWindow }, + { UNITY_RPC_WINDOW_CLOSE, UnityPlatformCloseWindow }, + { UNITY_RPC_WINDOW_SHOW, UnityPlatformShowWindow }, + { UNITY_RPC_WINDOW_HIDE, UnityPlatformHideWindow }, + { UNITY_RPC_WINDOW_MINIMIZE, UnityPlatformMinimizeWindow }, + { UNITY_RPC_WINDOW_MAXIMIZE, UnityPlatformMaximizeWindow }, + { UNITY_RPC_WINDOW_UNMAXIMIZE, UnityPlatformUnmaximizeWindow }, + /* Add more commands and handlers above this. */ + { NULL, NULL } +}; + +/* + * XXX: + * According to Adar: + * "UnityTcloGetUpdate cannot return the contents of a DynBuf. This will leak + * the DynBuf's memory, since nobody at a lower level will ever free it. It's + * a crappy interface, but we make due by using a static buffer to hold the + * results." + * + * We ideally would not use a static buffer because the maximum size of the + * update is unknown. To work around this, make the DynBuf returned in + * UnityTcloGetUpdate file-global and recycle it across update requests. + */ + +static DynBuf gTcloUpdate; + + +/* + *---------------------------------------------------------------------------- + * + * Unity_IsSupported -- + * + * Determine whether this guest supports unity. + * + * Results: + * TRUE if the guest supports Unity (i.e. if the guest is WinXP) or + * if the option to always enable unity was specified in the tools + * configuration file + * FALSE otherwise + * + * Side effects: + * None + * + *---------------------------------------------------------------------------- + */ + +Bool +Unity_IsSupported(void) +{ + return UnityPlatformIsSupported() || unity.forceEnable; +} + + +/* + *----------------------------------------------------------------------------- + * + * Unity_Init -- + * + * One time initialization stuff. + * + * + * Results: + * None. + * + * Side effects: + * May register with the tools poll loop. + * + *----------------------------------------------------------------------------- + */ + +void +Unity_Init(GuestApp_Dict *conf, // IN + int* blockedWnd) // IN +{ + Debug("Unity_Init\n"); + + /* + * Initialize the UnityWindowTracker object. The uwt does all the actual work + * of computing differences between two states of the windowing system. The + * callbacks we register here will fire when we request an update via + * UnityWindowTracker_RequestUpdates. See bora/lib/unityWindowTracker for more + * information. + */ + UnityWindowTracker_Init(&unity.tracker, UnityUpdateCallbackFn); + + /* + * Initialize the host-specific portion of the unity service. + */ + unity.up = UnityPlatformInit(&unity.tracker, blockedWnd); + + /* + * Init our global dynbuf used to send results back. + */ + DynBuf_Init(&gTcloUpdate); + + /* + * If debugging has been enabled, initialize the debug module. On Windows, + * this will pop up a small HUD window which shows an echo of the current + * state of the windowing system. + */ + if (GuestApp_GetDictEntryBool(conf, "unity.debug")) { + UnityDebug_Init(&unity.tracker); + } + + /* + * Check if the user specified the option to always enable unity regardless + * of the guest OS type. + */ + + unity.forceEnable = GuestApp_GetDictEntryBool(conf, "unity.forceEnable"); + unity.isEnabled = FALSE; + + unity.virtDesktopArray.desktopCount = 0; +} + + +/* + *----------------------------------------------------------------------------- + * + * Unity_Cleanup -- + * + * Exit Unity and do final cleanup. + * + * Results: + * None. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +void +Unity_Cleanup(void) +{ + UnityPlatform *up; + + Debug("%s\n", __FUNCTION__); + + /* + * Exit Unity. + */ + + Unity_Exit(); + + /* + * Do one-time final platform-specific cleanup. + */ + + up = unity.up; + unity.up = NULL; + UnityPlatformCleanup(up); + + UnityWindowTracker_Cleanup(&unity.tracker); + DynBuf_Destroy(&gTcloUpdate); +} + + +/* + *----------------------------------------------------------------------------- + * + * Unity_InitBackdoor -- + * + * One time initialization stuff for the backdoor. + * + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +void +Unity_InitBackdoor(struct RpcIn *rpcIn) // IN +{ + /* + * Only register the callback if the guest is capable of supporting Unity. + * This way, if the VMX/UI sends us a Unity request on a non-supported platform + * (for whatever reason), we will reply with 'command not supported'. + */ + + if (Unity_IsSupported()) { + RpcIn_RegisterCallback(rpcIn, UNITY_RPC_ENTER, UnityTcloEnter, NULL); + RpcIn_RegisterCallback(rpcIn, UNITY_RPC_GET_UPDATE_FULL, UnityTcloGetUpdate, NULL); + RpcIn_RegisterCallback(rpcIn, UNITY_RPC_GET_UPDATE_INCREMENTAL, + UnityTcloGetUpdate, NULL); + RpcIn_RegisterCallback(rpcIn, UNITY_RPC_GET_WINDOW_PATH, + UnityTcloGetWindowPath, NULL); + RpcIn_RegisterCallback(rpcIn, UNITY_RPC_WINDOW_RESTORE, + UnityTcloWindowCommand, NULL); + RpcIn_RegisterCallback(rpcIn, UNITY_RPC_WINDOW_SETTOP, + UnityTcloSetTopWindowGroup, NULL); + RpcIn_RegisterCallback(rpcIn, UNITY_RPC_WINDOW_CLOSE, + UnityTcloWindowCommand, NULL); + RpcIn_RegisterCallback(rpcIn, UNITY_RPC_GET_WINDOW_CONTENTS, + UnityTcloGetWindowContents, NULL); + RpcIn_RegisterCallback(rpcIn, UNITY_RPC_GET_ICON_DATA, + UnityTcloGetIconData, NULL); + RpcIn_RegisterCallback(rpcIn, UNITY_RPC_DESKTOP_WORK_AREA_SET, + UnityTcloSetDesktopWorkArea, NULL); + RpcIn_RegisterCallback(rpcIn, UNITY_RPC_SHOW_TASKBAR, UnityTcloShowTaskbar, NULL); + RpcIn_RegisterCallback(rpcIn, UNITY_RPC_EXIT, UnityTcloExit, NULL); + RpcIn_RegisterCallback(rpcIn, UNITY_RPC_WINDOW_MOVE_RESIZE, + UnityTcloMoveResizeWindow, NULL); + RpcIn_RegisterCallback(rpcIn, UNITY_RPC_WINDOW_SHOW, + UnityTcloWindowCommand, NULL); + RpcIn_RegisterCallback(rpcIn, UNITY_RPC_WINDOW_HIDE, + UnityTcloWindowCommand, NULL); + RpcIn_RegisterCallback(rpcIn, UNITY_RPC_WINDOW_MINIMIZE, + UnityTcloWindowCommand, NULL); + RpcIn_RegisterCallback(rpcIn, UNITY_RPC_WINDOW_MAXIMIZE, + UnityTcloWindowCommand, NULL); + RpcIn_RegisterCallback(rpcIn, UNITY_RPC_WINDOW_UNMAXIMIZE, + UnityTcloWindowCommand, NULL); + RpcIn_RegisterCallback(rpcIn, UNITY_RPC_DESKTOP_CONFIG_SET, + UnityTcloSetDesktopConfig, NULL); + RpcIn_RegisterCallback(rpcIn, UNITY_RPC_DESKTOP_ACTIVE_SET, + UnityTcloSetDesktopActive, NULL); + RpcIn_RegisterCallback(rpcIn, UNITY_RPC_WINDOW_DESKTOP_SET, + UnityTcloSetWindowDesktop, NULL); + } +} + + +/* + *----------------------------------------------------------------------------- + * + * Unity_SetActiveDnDDetWnd -- + * + * Right now we have 2 Unity DnD full screen detection window, one for version + * 2 or older, another for version 3 or newer. This function is to set active + * one according to host DnD version. + * + * XXX Both full-screent window is still bottom-most and is showed all time + * during Unity mode. Another change is needed to change it to only show the + * window during guest->host DnD. Also the window should not be bottom-most, + * but dynamicly change z-order during DnD. + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +void +Unity_SetActiveDnDDetWnd(UnityDnD *state) +{ + UnityPlatformSetActiveDnDDetWnd(unity.up, state); +} + + +/* + *----------------------------------------------------------------------------- + * + * Unity_Exit -- + * + * Called everytime we exit Unity. This function can be called when we are + * not in Unity mode. Right now it is called every time a 'reset' TCLO command + * is sent to the guest. Therefore, there's no guarantee that we were in the + * Unity mode when this function is called. + * + * Try to do the following: + * Restore system settings if needed. + * Kills all unity helper threads if any are running. + * Hide the unity dnd detection window. + * + * Results: + * None. + * + * Side effects: + * Restores system settings since we are exiting Unity. + * Kills all unity helper threads if any. + * Hides the unity dnd detection window if needed. + * + *----------------------------------------------------------------------------- + */ + +void +Unity_Exit(void) +{ + if (unity.isEnabled) { + /* Hide full-screen detection window for Unity DnD. */ + UnityPlatformUpdateDnDDetWnd(unity.up, FALSE); + + /* Kill Unity helper threads. */ + UnityPlatformKillHelperThreads(unity.up); + + /* Restore previously saved user settings. */ + UnityPlatformRestoreSystemSettings(unity.up); + + unity.isEnabled = FALSE; + } +} + + +/* + *----------------------------------------------------------------------------- + * + * Unity_RegisterCaps -- + * + * Called by the application (VMwareUser) to allow the unity subsystem to + * register its capabilities. + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +void +Unity_RegisterCaps(void) +{ + /* + * Send Unity capability. + */ + + if (!RpcOut_sendOne(NULL, NULL, UNITY_RPC_UNITY_CAP" %d", + Unity_IsSupported() ? 1 : 0)) { + Debug("%s: could not set unity capability\n", __FUNCTION__); + } + + /* + * Register guest platform specific capabilities. + */ + + UnityPlatformRegisterCaps(unity.up); + AppUtil_SendGuestCaps(unityCaps, ARRAYSIZE(unityCaps), TRUE); +} + + +/* + *----------------------------------------------------------------------------- + * + * Unity_UnregisterCaps -- + * + * Called by the application (VMwareUser) to allow the unity subsystem to + * unregister its capabilities. + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +void +Unity_UnregisterCaps(void) +{ + /* + * Unregister guest platform specific capabilities. + */ + + UnityPlatformUnregisterCaps(unity.up); + + /* + * Unregister the unity capability. + */ + + if (!RpcOut_sendOne(NULL, NULL, UNITY_RPC_UNITY_CAP" 0")) { + Debug("Failed to unregister Unity capability\n"); + } + AppUtil_SendGuestCaps(unityCaps, ARRAYSIZE(unityCaps), FALSE); +} + + +/* + *---------------------------------------------------------------------------- + * + * UnityTcloEnter -- + * + * RPC handler for 'unity.enter'. Save and disable certain user + * settings. Start Unity updates thread and any other platform + * specific threads (like a thread that listens for + * the desktop switch event on Windows). Note that we first set + * the UI settings, and then start the threads. This way the UI + * settings take effect before we start sending Unity updates, + * so that we never send things like task bar (see bug 166085). + * + * Results: + * TRUE if helper threads were started. + * FALSE otherwise. + * + * Side effects: + * Certain UI system settings will be disabled. + * Unity update thread will be started. + * Any other platform specific helper threads will be started as well. + * + *---------------------------------------------------------------------------- + */ + +static Bool +UnityTcloEnter(char const **result, // OUT + size_t *resultLen, // OUT + const char *name, // IN + const char *args, // IN + size_t argsSize, // ignored + void *clientData) // ignored +{ + Debug("%s\n", __FUNCTION__); + + if (!unity.isEnabled) { + /* Save and disable certain user settings here. */ + UnityPlatformSaveSystemSettings(unity.up); + + /* Start Unity helper threads. */ + if (!UnityPlatformStartHelperThreads(unity.up)) { + + /* + * If we couldn't start one or more helper threads, + * we cannot enter Unity. Kill all running helper + * threads and restore ui settings. + */ + + UnityPlatformKillHelperThreads(unity.up); + UnityPlatformRestoreSystemSettings(unity.up); + return RpcIn_SetRetVals(result, resultLen, + "Could not start unity helper threads", FALSE); + } + + /* + * Show full-screen detection window for Unity DnD. It is a bottom-most (but + * still in front of desktop) transparent detection window for guest->host DnD + * as drop target. We need this window because: + * 1. All active windows except desktop will be shown on host desktop and can + * accept DnD signal. This full-screen detection window will block any DnD signal + * (even mouse signal) to the desktop, which will fix bug 164880. + * 2. With this full-screen but bottommost detection window, every time when user + * drag something out from active window, the dragEnter will always be immediately + * catched for Unity DnD. + */ + UnityPlatformUpdateDnDDetWnd(unity.up, TRUE); + unity.isEnabled = TRUE; + } + + UnityUpdateState(); + + return RpcIn_SetRetVals(result, resultLen, "", TRUE); +} + + +/* + *---------------------------------------------------------------------------- + * + * UnityTcloExit -- + * + * RPC handler for 'unity.exit'. + * + * Results: + * Always TRUE. + * + * Side effects: + * Same as side effects of Unity_Exit(). + * + *---------------------------------------------------------------------------- + */ + +static Bool +UnityTcloExit(char const **result, // OUT + size_t *resultLen, // OUT + const char *name, // IN + const char *args, // IN + size_t argsSize, // ignored + void *clientData) // ignored +{ + Debug("UnityTcloExit.\n"); + + Unity_Exit(); + + UnityUpdateState(); + return RpcIn_SetRetVals(result, resultLen, "", TRUE); +} + + +/* + *---------------------------------------------------------------------------- + * + * UnityTcloGetWindowInfo -- + * + * RPC handler for 'unity.get.window.info'. Get required window info + * and send it back to the VMX. + * + * Results: + * TRUE if everything is successful. + * FALSE otherwise. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +static Bool +UnityTcloGetWindowPath(char const **result, // OUT + size_t *resultLen, // OUT + const char *name, // IN + const char *args, // IN + size_t argsSize, // ignored + void *clientData) // ignored + +{ + UnityWindowId window; + DynBuf *buf = &gTcloUpdate; + unsigned int index = 0; + Bool ret = TRUE; + + Debug("UnityTcloGetWindowPath name:%s args:'%s'\n", name, args); + + /* Parse the command & window id.*/ + + if (!StrUtil_GetNextIntToken(&window, &index, args, " ")) { + Debug("UnityTcloGetWindowInfo: Invalid RPC arguments.\n"); + return RpcIn_SetRetVals(result, resultLen, + "Invalid arguments. Expected \"windowId\"", + FALSE); + } + + Debug("UnityTcloGetWindowInfo: window %d\n", window); + + /* + * Please note that the UnityPlatformGetWindowPath implementations assume that the + * dynbuf passed in does not contain any existing data that needs to be appended to, + * so this code should continue to accomodate that assumption. + */ + DynBuf_SetSize(buf, 0); + if (!UnityPlatformGetWindowPath(unity.up, window, buf)) { + Debug("UnityTcloGetWindowInfo: Could not get window path.\n"); + return RpcIn_SetRetVals(result, resultLen, + "Could not get window path", + FALSE); + } + + /* + * Write the final result into the result out parameters and return! + */ + *result = (char *)DynBuf_Get(buf); + *resultLen = DynBuf_GetSize(buf); + + return ret; +} + + +/* + *---------------------------------------------------------------------------- + * + * UnityTcloWindowCommand -- + * + * RPC handler for 'unity.window.*' (excluding 'unity.window.settop') + * + * Results: + * TRUE if everything is successful. + * FALSE otherwise. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +static Bool +UnityTcloWindowCommand(char const **result, // OUT + size_t *resultLen, // OUT + const char *name, // IN + const char *args, // IN + size_t argsSize, // ignored + void *clientData) // ignored +{ + UnityWindowId window; + unsigned int index = 0; + unsigned int i; + + Debug("UnityTcloWindowCommand: name:%s args:'%s'\n", name, args); + + /* Parse the command & window id.*/ + + if (!StrUtil_GetNextIntToken(&window, &index, args, " ")) { + Debug("UnityTcloWindowCommand: Invalid RPC arguments.\n"); + return RpcIn_SetRetVals(result, resultLen, + "Invalid arguments. Expected \"windowId\"", + FALSE); + + } + + Debug("UnityTcloWindowCommand: %s window %d\n", name, window); + + for (i = 0; unityCommandTable[i].name != NULL; i++) { + if (strcmp(unityCommandTable[i].name, name) == 0) { + if (!unityCommandTable[i].exec(unity.up, window)) { + Debug("Unity window command failed.\n"); + return RpcIn_SetRetVals(result, resultLen, + "Could not execute window command", + FALSE); + } else { + return RpcIn_SetRetVals(result, resultLen, "", TRUE); + } + } + } + + return RpcIn_SetRetVals(result, resultLen, "Bad command", FALSE); +} + + +/* + *---------------------------------------------------------------------------- + * + * UnityTcloSetDesktopWorkArea -- + * + * RPC handler for 'unity.desktop.work_area.set'. + * + * Results: + * TRUE if everything is successful. + * FALSE otherwise. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +static Bool +UnityTcloSetDesktopWorkArea(char const **result, // IN + size_t *resultLen, // IN + const char *name, // IN + const char *args, // IN + size_t argsSize, // IN + void *clientData) // IN +{ + Bool success = FALSE; + unsigned int count; + unsigned int i; + UnityRect *workAreas = NULL; + + /* + * The argument string will look something like: + * <count> [ , <x> <y> <w> <h> ] * count. + * + * e.g. + * 3 , 0 0 640 480 , 640 0 800 600 , 0 480 640 480 + */ + + if (sscanf(args, "%u", &count) != 1) { + return RpcIn_SetRetVals(result, resultLen, + "Invalid arguments. Expected \"count\"", + FALSE); + } + + workAreas = (UnityRect *)malloc(sizeof *workAreas * count); + if (!workAreas) { + RpcIn_SetRetVals(result, resultLen, + "Failed to alloc buffer for work areas", + FALSE); + goto out; + } + + for (i = 0; i < count; i++) { + args = strchr(args, ','); + if (!args) { + RpcIn_SetRetVals(result, resultLen, + "Expected comma separated display list", + FALSE); + goto out; + } + args++; /* Skip past the , */ + + if (sscanf(args, " %d %d %d %d ", + &workAreas[i].x, &workAreas[i].y, + &workAreas[i].width, &workAreas[i].height) != 4) { + RpcIn_SetRetVals(result, resultLen, + "Expected x, y, w, h in display entry", + FALSE); + goto out; + } + } + + if (!UnityPlatformSetDesktopWorkAreas(unity.up, workAreas, count)) { + RpcIn_SetRetVals(result, resultLen, + "UnityPlatformSetDesktopWorkAreas failed", + FALSE); + goto out; + } + + success = RpcIn_SetRetVals(result, resultLen, "", TRUE); + +out: + free(workAreas); + return success; +} + + +/* + *---------------------------------------------------------------------------- + * + * UnityTcloSetTopWindowGroup -- + * + * RPC handler for 'unity.window.settop'. + * + * Results: + * TRUE if everything is successful. + * FALSE otherwise. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +static Bool +UnityTcloSetTopWindowGroup(char const **result, // OUT + size_t *resultLen, // OUT + const char *name, // IN + const char *args, // IN + size_t argsSize, // ignored + void *clientData) // ignored +{ + UnityWindowId window; + unsigned int index = 0; + unsigned int windowCount = 0; + UnityWindowId windows[UNITY_MAX_SETTOP_WINDOW_COUNT]; + + Debug("%s: name:%s args:'%s'\n", __FUNCTION__, name, args); + + /* Parse the command & window ids.*/ + + while (StrUtil_GetNextUintToken(&window, &index, args, " ")) { + windows[windowCount] = window; + windowCount++; + if (windowCount == UNITY_MAX_SETTOP_WINDOW_COUNT) { + Debug("%s: Too many windows.\n", __FUNCTION__); + return RpcIn_SetRetVals(result, resultLen, + "Invalid arguments. Too many windows", + FALSE); + } + } + + if (windowCount == 0) { + Debug("%s: Invalid RPC arguments.\n", __FUNCTION__); + return RpcIn_SetRetVals(result, resultLen, + "Invalid arguments. Expected at least one windowId", + FALSE); + } + + if (!UnityPlatformSetTopWindowGroup(unity.up, windows, windowCount)) { + return RpcIn_SetRetVals(result, resultLen, + "Could not execute window command", + FALSE); + } + + return RpcIn_SetRetVals(result, resultLen, "", TRUE); +} + + +/* + *---------------------------------------------------------------------------- + * + * UnityTcloGetUpdate -- + * + * RPC handler for 'unity.get.update'. Ask the unity window tracker + * to give us an update (either incremental or non-incremental based + * on whether the 'incremental' arg is present) and send the result + * back to the VMX. + * + * Results: + * None. + * + * Side effects: + * Clearly. + * + *---------------------------------------------------------------------------- + */ + +static Bool +UnityTcloGetUpdate(char const **result, // OUT + size_t *resultLen, // OUT + const char *name, // IN + const char *args, // IN + size_t argsSize, // ignored + void *clientData) // ignored +{ + DynBuf *buf = &gTcloUpdate; + uint32 flags = 0; + + // Debug("UnityTcloGetUpdate name:%s args:'%s'", name, args); + + /* + * Specify incremental or non-incremetal updates based on whether or + * not the client set the "incremental" arg. + */ + if (strstr(name, "incremental")) { + flags |= UNITY_UPDATE_INCREMENTAL; + } + + DynBuf_SetSize(buf, 0); + + UnityGetUpdateCommon(flags, buf); + + /* + * Write the final result into the result out parameters. + */ + *result = (char *)DynBuf_Get(buf); + *resultLen = DynBuf_GetSize(buf); + + /* + * Give the debugger a crack to do something interesting at this point + */ + UnityDebug_OnUpdate(); + + return TRUE; +} + + +/* + *---------------------------------------------------------------------------- + * + * UnityGetUpdateCommon -- + * + * Get the unity window update and append it to the specified output buffer. + * This function can be called from two different threads: either from + * the main thread that is trying to execute a TCLO command (unity.get.update) + * or from the unity update thread that is gathering periodic updates and + * pushes them to the VMX as needed (by calling 'tools.unity.push.update RPC). + * Since this function can be called from two different threads, protect + * the global unity singleton with locks. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +void +UnityGetUpdateCommon(int flags, // IN: unity update flags + DynBuf *buf) // IN/OUT: unity update buffer +{ + + ASSERT(buf); + + UnityPlatformLock(unity.up); + + /* + * Ask the guest to crawl the windowing system and push updates + * into the unity window tracker. If the guest backend isn't able to get + * notification of destroyed windows, UnityPlatformUpdateWindowState will + * return TRUE, which is are signal to set the UNITY_UPDATE_REMOVE_UNTOUCHED + * flag. This make the unity window tracker generate remove events for + * windows that it hasn't seen an update for since the last update + * request. + */ + if (UnityPlatformUpdateWindowState(unity.up, &unity.tracker)) { + flags |= UNITY_UPDATE_REMOVE_UNTOUCHED; + } + + /* + * Generate the update string. We'll accumulate updates in the DynBuf + * buf via the callbacks registered in Unity_Init(). Each update will + * append a null terminated string to buf. + */ + UnityWindowTracker_RequestUpdates(&unity.tracker, flags, buf); + + UnityPlatformUnlock(unity.up); + + /* + * Write the final '\0' to the DynBuf to signal that we're all out of + * updates. + */ + DynBuf_AppendString(buf, ""); + + return; +} + + +/* + *---------------------------------------------------------------------------- + * + * UnityUpdateCallbackFn -- + * + * Callback from the unity window tracker indicating something's + * changed. + * + * Write the update string into our dynbuf accumlating the update + * and return. + * + * Results: + * None. + * + * Side effects: + * Clearly. + * + *---------------------------------------------------------------------------- + */ + +void +UnityUpdateCallbackFn(void *param, // IN: dynbuf + UnityUpdate *update) // IN +{ + DynBuf *buf = (DynBuf *)param; + char data[1024]; + int i, n, count = 0; + RegionPtr region; + char *titleUtf8 = NULL; + + switch (update->type) { + + case UNITY_UPDATE_ADD_WINDOW: + Str_Sprintf(data, sizeof data, "add %u", update->u.addWindow.id); + DynBuf_AppendString(buf, data); + break; + + case UNITY_UPDATE_MOVE_WINDOW: + Str_Sprintf(data, sizeof data, "move %u %d %d %d %d", + update->u.moveWindow.id, + update->u.moveWindow.rect.x1, + update->u.moveWindow.rect.y1, + update->u.moveWindow.rect.x2, + update->u.moveWindow.rect.y2); + DynBuf_AppendString(buf, data); + break; + + case UNITY_UPDATE_REMOVE_WINDOW: + Str_Sprintf(data, sizeof data, "remove %u", update->u.removeWindow.id); + DynBuf_AppendString(buf, data); + break; + + case UNITY_UPDATE_CHANGE_WINDOW_REGION: + /* + * A null region indicates that the region should be deleted. + * Make sure we write "region <id> 0" for the reply. + */ + region = update->u.changeWindowRegion.region; + if (region) { + count = REGION_NUM_RECTS(region); + } + Str_Sprintf(data, sizeof data, "region %u %d", + update->u.changeWindowRegion.id, count); + DynBuf_AppendString(buf, data); + + for (i = 0; i < count; i++) { + BoxPtr p = REGION_RECTS(region) + i; + Str_Sprintf(data, sizeof data, "rect %d %d %d %d", + p->x1, p->y1, p->x2, p->y2); + DynBuf_AppendString(buf, data); + } + break; + + case UNITY_UPDATE_CHANGE_WINDOW_TITLE: + titleUtf8 = DynBuf_Get(&update->u.changeWindowTitle.titleUtf8); + + if (titleUtf8 && + (DynBuf_GetSize(&update->u.changeWindowTitle.titleUtf8) == + strlen(titleUtf8) + 1)) { + Str_Sprintf(data, sizeof data, "title %u ", + update->u.changeWindowTitle.id); + Str_Strncat(data, sizeof data, titleUtf8, sizeof data - strlen(data) - 1); + data[sizeof data - 1] = '\0'; + } else { + Str_Sprintf(data, sizeof data, "title %u", + update->u.changeWindowTitle.id); + } + DynBuf_AppendString(buf, data); + break; + + case UNITY_UPDATE_CHANGE_ZORDER: + n = Str_Snprintf(data, sizeof data, "zorder %d", update->u.zorder.count); + DynBuf_Append(buf, data, n); + for (i = 0; i < update->u.zorder.count; i++) { + n = Str_Snprintf(data, sizeof data, " %d", update->u.zorder.ids[i]); + DynBuf_Append(buf, data, n); + } + DynBuf_AppendString(buf, ""); // for appending NULL + break; + + case UNITY_UPDATE_CHANGE_WINDOW_STATE: + Str_Sprintf(data, sizeof data, "state %u %u", + update->u.changeWindowState.id, + update->u.changeWindowState.state); + DynBuf_AppendString(buf, data); + break; + + case UNITY_UPDATE_CHANGE_WINDOW_ATTRIBUTE: + Str_Sprintf(data, sizeof data, "attr %u %u %u", + update->u.changeWindowAttribute.id, + update->u.changeWindowAttribute.attr, + update->u.changeWindowAttribute.value); + DynBuf_AppendString(buf, data); + break; + + case UNITY_UPDATE_CHANGE_WINDOW_TYPE: + Str_Sprintf(data, sizeof data, "type %u %d", + update->u.changeWindowType.id, + update->u.changeWindowType.winType); + DynBuf_AppendString(buf, data); + break; + + case UNITY_UPDATE_CHANGE_WINDOW_ICON: + Str_Sprintf(data, sizeof data, "icon %u %u", + update->u.changeWindowIcon.id, + update->u.changeWindowIcon.iconType); + DynBuf_AppendString(buf, data); + break; + + case UNITY_UPDATE_CHANGE_WINDOW_DESKTOP: + Str_Sprintf(data, sizeof data, "desktop %u %d", + update->u.changeWindowDesktop.id, + update->u.changeWindowDesktop.desktopId); + DynBuf_AppendString(buf, data); + break; + + case UNITY_UPDATE_CHANGE_ACTIVE_DESKTOP: + Str_Sprintf(data, sizeof data, "activedesktop %d", + update->u.changeActiveDesktop.desktopId); + DynBuf_AppendString(buf, data); + break; + + default: + NOT_IMPLEMENTED(); + } +} + + +/* + *----------------------------------------------------------------------------- + * + * UnityUpdateThreadInit -- + * + * Initialize the state for the update thread. + * + * Return value: + * TRUE if all needed data was initialized. + * FALSE otherwise + * + * Side effects: + * RpcOut channel might be open. + * Memory for the update buffer might be allocated. + * + *----------------------------------------------------------------------------- + */ + +Bool +UnityUpdateThreadInit(UnityUpdateThreadData *updateData) // IN +{ + ASSERT(updateData); + + updateData->flags = UNITY_UPDATE_INCREMENTAL; + updateData->rpcOut = NULL; + updateData->cmdSize = 0; + + DynBuf_Init(&updateData->updates); + DynBuf_AppendString(&updateData->updates, UNITY_RPC_PUSH_UPDATE_CMD " "); + + /* Exclude the null. */ + updateData->cmdSize = DynBuf_GetSize(&updateData->updates) - 1; + + updateData->rpcOut = RpcOut_Construct(); + if (updateData->rpcOut == NULL) { + goto error; + } + + if (!RpcOut_start(updateData->rpcOut)) { + RpcOut_Destruct(updateData->rpcOut); + goto error; + } + + return TRUE; + +error: + DynBuf_Destroy(&updateData->updates); + + return FALSE; +} + + +/* + *----------------------------------------------------------------------------- + * + * UnityUpdateThreadCleanup -- + * + * Cleanup the unity update thread state. + * + * Return value: + * None. + * + * Side effects: + * RpcOut channel will be closed. + * Memory will be freed. + * + *----------------------------------------------------------------------------- + */ + +void +UnityUpdateThreadCleanup(UnityUpdateThreadData *updateData) // IN +{ + ASSERT(updateData); + + if (updateData->rpcOut) { + RpcOut_stop(updateData->rpcOut); + RpcOut_Destruct(updateData->rpcOut); + updateData->rpcOut = NULL; + + DynBuf_Destroy(&updateData->updates); // Avoid double-free by guarding this as well + } +} + + +/* + *----------------------------------------------------------------------------- + * + * UnitySendUpdates -- + * + * Gather and send a round of unity updates. The caller is responsible + * for gathering updates into updateData->updates buffer prior to the + * function call. This function should only be called if there's data + * in the update buffer to avoid sending empty update string to the VMX. + * + * Return value: + * TRUE if the update was sent, + * FALSE if something went wrong (an invalid RPC channel, for example). + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +Bool +UnitySendUpdates(UnityUpdateThreadData *updateData) // IN +{ + char const *myReply; + size_t myRepLen; + Bool retry = FALSE; + + ASSERT(updateData); + ASSERT(updateData->rpcOut); + + /* Send 'tools.unity.push.update <updates>' to the VMX. */ + +retry_send: + if (!RpcOut_send(updateData->rpcOut, + (char *)DynBuf_Get(&updateData->updates), + DynBuf_GetSize(&updateData->updates), + &myReply, &myRepLen)) { + + /* + * We could not send the RPC. If we haven't tried to reopen + * the channel, try to reopen and resend. If we already + * tried to resend, then it's time to give up. I hope that + * trying to resend once is enough. + */ + + if (!retry) { + retry = TRUE; + Debug("%s: could not send rpc. Reopening channel.\n", __FUNCTION__); + RpcOut_stop(updateData->rpcOut); + if (!RpcOut_start(updateData->rpcOut)) { + Debug("%s: could not reopen rpc channel. Exiting...\n", __FUNCTION__); + return FALSE; + } + goto retry_send; + + } else { + Debug("%s: could not resend rpc. Giving up and exiting...\n", __FUNCTION__); + return FALSE; + } + } + + return TRUE; +} + + +/* + *---------------------------------------------------------------------------- + * + * UnityTcloGetWindowContents -- + * + * RPC handler for 'unity.get.window.contents'. Suck the bits off the + * window and return a .png image over the backdoor. + * + * Results: + * TRUE if everything is successful. + * FALSE otherwise. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +static Bool +UnityTcloGetWindowContents(char const **result, // OUT + size_t *resultLen, // OUT + const char *name, // IN + const char *args, // IN + size_t argsSize, // ignored + void *clientData) // ignored +{ + unsigned int window; + unsigned int index = 0; + DynBuf *imageData = &gTcloUpdate; + + Debug("UnityTcloGetWindowContents: name:%s args:'%s'\n", name, args); + + /* + * Parse the command & window id. + */ + if (!StrUtil_GetNextIntToken(&window, &index, args, " ")) { + Debug("UnityTcloGetWindowContents: Invalid RPC arguments.\n"); + return RpcIn_SetRetVals(result, resultLen, + "failed: arguments. Expected \"windowId\"", + FALSE); + + } + Debug("UnityTcloGetWindowContents: window %d\n", window); + + /* + * Read the contents of the window, compress it as a .png and + * send the .png back to the vmx as the RPC result. + */ + DynBuf_SetSize(imageData, 0); + if (!UnityPlatformGetWindowContents(unity.up, window, imageData)) { + return RpcIn_SetRetVals(result, resultLen, + "failed: Could not read window contents", + FALSE); + } + + *result = (char *)DynBuf_Get(imageData); + *resultLen = DynBuf_GetSize(imageData); + + return TRUE; +} + + +/* + *---------------------------------------------------------------------------- + * + * UnityTcloGetIconData -- + * + * RPC handler for 'unity.get.icon.data'. Suck the bits off the + * window and return a .png image over the backdoor. + * + * Results: + * TRUE if everything is successful. + * FALSE otherwise. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +static Bool +UnityTcloGetIconData(char const **result, // OUT + size_t *resultLen, // OUT + const char *name, // IN + const char *args, // IN + size_t argsSize, // ignored + void *clientData) // ignored +{ + UnityWindowId window; + UnityIconType iconType; + UnityIconSize iconSize; + unsigned int dataOffset, dataLength; + uint32 fullLength; + size_t retLength; + DynBuf *results = &gTcloUpdate, imageData; + char data[1024]; + + Debug("UnityTcloGetIconData: name:%s args:'%s'\n", name, args); + + /* + * Parse the arguments. + */ + if ((sscanf(args, "%u %u %u %u %u", + &window, + &iconType, + &iconSize, + &dataOffset, + &dataLength) != 5) + || (dataLength > UNITY_MAX_ICON_DATA_CHUNK)) { + Debug("UnityTcloGetIconData: Invalid RPC arguments.\n"); + return RpcIn_SetRetVals(result, resultLen, + "failed: arguments missing", + FALSE); + } + + Debug("%s: window %u iconType %u" \ + " iconSize %u dataOffset %u dataLength %u\n", + __FUNCTION__, + window, iconType, iconSize, dataOffset, dataLength); + + /* + * Retrieve part/all of the icon in PNG format. + */ + DynBuf_Init(&imageData); + if (!UnityPlatformGetIconData(unity.up, window, iconType, iconSize, + dataOffset, dataLength, &imageData, &fullLength)) { + return RpcIn_SetRetVals(result, resultLen, + "failed: Could not read icon data properly", + FALSE); + } + + + DynBuf_SetSize(results, 0); + retLength = DynBuf_GetSize(&imageData); + retLength = MIN(retLength, UNITY_MAX_ICON_DATA_CHUNK); + DynBuf_Append(results, data, Str_Snprintf(data, sizeof data, "%u %" FMTSZ "u ", + fullLength, retLength)); + DynBuf_Append(results, DynBuf_Get(&imageData), retLength); + + /* + * Guarantee that the results have a trailing \0 in case anything does a strlen... + */ + DynBuf_AppendString(results, ""); + *result = (char *)DynBuf_Get(results); + *resultLen = DynBuf_GetSize(results); + DynBuf_Destroy(&imageData); + + return TRUE; +} + + +/* + *---------------------------------------------------------------------------- + * + * UnityTcloShowTaskbar -- + * + * RPC handler for 'unity.show.taskbar'. + * + * Results: + * TRUE if everything is successful. + * FALSE otherwise. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +static Bool +UnityTcloShowTaskbar(char const **result, // OUT + size_t *resultLen, // OUT + const char *name, // IN + const char *args, // IN + size_t argsSize, // IN: Size of args + void *clientData) // ignored +{ + uint32 command = 0; + unsigned int index = 0; + + Debug("%s: name:%s args:'%s'\n", __FUNCTION__, name, args); + + if (!StrUtil_GetNextUintToken(&command, &index, args, " ")) { + Debug("%s: Invalid RPC arguments.\n", __FUNCTION__); + return RpcIn_SetRetVals(result, resultLen, + "Invalid arguments.", + FALSE); + } + + Debug("%s: command %d\n", __FUNCTION__, command); + + UnityPlatformShowTaskbar(unity.up, (command == 0) ? FALSE : TRUE); + + return RpcIn_SetRetVals(result, resultLen, "", TRUE); +} + + +/* + *---------------------------------------------------------------------------- + * + * UnityTcloMoveResizeWindow -- + * + * RPC handler for 'unity.window.move_resize'. + * + * Results: + * TRUE if everything is successful. + * FALSE otherwise. + * If successful adds null terminated strings for each output coordinates. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +static Bool +UnityTcloMoveResizeWindow(char const **result, // OUT + size_t *resultLen, // OUT + const char *name, // IN + const char *args, // IN + size_t argsSize, // IN: Size of args + void *clientData) // ignored +{ + DynBuf *buf = &gTcloUpdate; + UnityWindowId window; + UnityRect moveResizeRect = {0}; + char temp[1024]; + + Debug("%s: name:%s args:'%s'\n", __FUNCTION__, name, args); + + if (sscanf(args, "%u %d %d %d %d", + &window, + &moveResizeRect.x, + &moveResizeRect.y, + &moveResizeRect.width, + &moveResizeRect.height) != 5) { + Debug("%s: Invalid RPC arguments.\n", __FUNCTION__); + return RpcIn_SetRetVals(result, resultLen, + "Invalid arguments.", + FALSE); + } + + if (!UnityPlatformMoveResizeWindow(unity.up, window, &moveResizeRect)) { + Debug("%s: Could not read window coordinates.\n", __FUNCTION__); + return RpcIn_SetRetVals(result, resultLen, + "Could not read window coordinates", + FALSE); + } + + /* + * Send back the new (post move/resize operation) window coordinates. + */ + + DynBuf_SetSize(buf, 0); + Str_Sprintf(temp, sizeof temp, "%d %d %d %d", moveResizeRect.x, + moveResizeRect.y, moveResizeRect.width, moveResizeRect.height); + DynBuf_AppendString(buf, temp); + + /* + * Write the final result into the result out parameters and return! + */ + + *result = (char *)DynBuf_Get(buf); + *resultLen = DynBuf_GetSize(buf); + + return TRUE; +} + + +/* + *---------------------------------------------------------------------------- + * + * UnityTcloSetDesktopConfig -- + * + * RPC handler for 'unity.set.desktop.config'. The RPC takes the form of: + * {1,1} {1,2} {2,1} {2,2} 1 + * for a 2 x 2 virtual desktop where the upper right {1,2} is the currently + * active desktop. + * + * Results: + * TRUE if everything is successful. + * FALSE otherwise. + * + * Side effects: + * Might change virtual desktop configuration in the guest. + * + *---------------------------------------------------------------------------- + */ + +static Bool +UnityTcloSetDesktopConfig(char const **result, // OUT + size_t *resultLen, // OUT + const char *name, // IN + const char *args, // IN + size_t argsSize, // IN + void *clientData) // IN: ignored +{ + unsigned int index = 0; + char *desktopStr = NULL; + char *errorMsg; + uint32 initialDesktopIndex = 0; + + Debug("%s: name:%s args:'%s'\n", __FUNCTION__, name, args); + + if (argsSize == 0) { + errorMsg = "Invalid arguments: desktop config is expected"; + goto error; + } + + unity.virtDesktopArray.desktopCount = 0; + /* Read the virtual desktop configuration. */ + while ((desktopStr = StrUtil_GetNextToken(&index, args, " ")) != NULL) { + UnityVirtualDesktop desktop; + uint32 desktopCount = unity.virtDesktopArray.desktopCount; + + if (sscanf(desktopStr, "{%d,%d}", &desktop.x, &desktop.y) == 2) { + if (desktopCount >= MAX_VIRT_DESK - 1) { + errorMsg = "Invalid arguments: too many desktops"; + goto error; + } + unity.virtDesktopArray.desktops[desktopCount] = desktop; + unity.virtDesktopArray.desktopCount++; + } else if (sscanf(desktopStr, "%u", &initialDesktopIndex) == 1) { + if (initialDesktopIndex >= unity.virtDesktopArray.desktopCount) { + errorMsg = "Invalid arguments: current desktop is out of bounds"; + goto error; + } + /* All done with arguments at this point - stop processing */ + free(desktopStr); + break; + } else { + errorMsg = "Invalid arguments: invalid desktop config"; + goto error; + } + free(desktopStr); + desktopStr = NULL; + } + + /* + * Call the platform specific function to set the desktop configuration. + */ + + if (!UnityPlatformSetDesktopConfig(unity.up, &unity.virtDesktopArray)) { + errorMsg = "Could not set desktop configuration"; + goto error; + } + + if (!UnityPlatformSetInitialDesktop(unity.up, initialDesktopIndex)) { + errorMsg = "Could not set initial desktop"; + goto error; + } + + return RpcIn_SetRetVals(result, resultLen, + "", + TRUE); +error: + free(desktopStr); + unity.virtDesktopArray.desktopCount = 0; + Debug("%s: %s\n", __FUNCTION__, errorMsg); + + return RpcIn_SetRetVals(result, resultLen, + errorMsg, + FALSE); +} + + +/* + *---------------------------------------------------------------------------- + * + * UnityTcloSetDesktopActive -- + * + * RPC handler for 'unity.set.desktop.active'. + * + * Results: + * TRUE if everything is successful. + * FALSE otherwise. + * + * Side effects: + * Might change the active virtual desktop in the guest. + * + *---------------------------------------------------------------------------- + */ + +static Bool +UnityTcloSetDesktopActive(char const **result, // OUT + size_t *resultLen, // OUT + const char *name, // IN + const char *args, // IN + size_t argsSize, // IN + void *clientData) // IN: ignored +{ + UnityDesktopId desktopId = 0; + char *errorMsg; + + Debug("%s: name:%s args:'%s'\n", __FUNCTION__, name, args); + + if (unity.isEnabled == FALSE) { + errorMsg = "Unity not enabled - cannot change active desktop"; + goto error; + } + + if (sscanf(args, " %d", &desktopId) != 1) { + errorMsg = "Invalid arguments: expected \"desktopId\""; + goto error; + } + + if (desktopId >= unity.virtDesktopArray.desktopCount) { + errorMsg = "Desktop does not exist in the guest"; + goto error; + } + + /* + * Call the platform specific function to set the desktop active. + */ + + if (!UnityPlatformSetDesktopActive(unity.up, desktopId)) { + errorMsg = "Could not set active desktop"; + goto error; + } + + /* + * Update the uwt with the new active desktop info. + */ + + UnityWindowTracker_ChangeActiveDesktop(&unity.tracker, desktopId); + + return RpcIn_SetRetVals(result, resultLen, + "", + TRUE); +error: + Debug("%s: %s\n", __FUNCTION__, errorMsg); + return RpcIn_SetRetVals(result, resultLen, + errorMsg, + FALSE); +} + + +/* + *---------------------------------------------------------------------------- + * + * UnityTcloSetWindowDesktop -- + * + * RPC handler for 'unity.set.window.desktop'. + * + * Results: + * TRUE if everything is successful. + * FALSE otherwise. + * + * Side effects: + * Might change the active virtual desktop in the guest. + * + *---------------------------------------------------------------------------- + */ + +static Bool +UnityTcloSetWindowDesktop(char const **result, // OUT + size_t *resultLen, // OUT + const char *name, // IN + const char *args, // IN + size_t argsSize, // IN + void *clientData) // IN: ignored +{ + UnityWindowId windowId; + uint32 desktopId = 0; + char *errorMsg; + + Debug("%s: name:%s args:'%s'\n", __FUNCTION__, name, args); + + if (unity.isEnabled == FALSE) { + errorMsg = "Unity not enabled - cannot set window desktop"; + goto error; + } + + if (sscanf(args, " %u %d", &windowId, &desktopId) != 2) { + errorMsg = "Invalid arguments: expected \"windowId desktopId\""; + goto error; + } + + if (desktopId >= unity.virtDesktopArray.desktopCount) { + errorMsg = "The desktop does not exist in the guest"; + goto error; + } + + /* + * Call the platform specific function to move the window to the + * specified desktop. + */ + + if (!UnityPlatformSetWindowDesktop(unity.up, windowId, desktopId)) { + errorMsg = "Could not move the window to the desktop"; + goto error; + } + + UnityWindowTracker_ChangeWindowDesktop(&unity.tracker, windowId, desktopId); + + return RpcIn_SetRetVals(result, resultLen, + "", + TRUE); +error: + Debug("%s: %s\n", __FUNCTION__, errorMsg); + return RpcIn_SetRetVals(result, resultLen, + errorMsg, + FALSE); +} + + +/* + *---------------------------------------------------------------------------- + * + * UnityUpdateState -- + * + * Communicate unity state changes to vmx. + * + * Results: + * TRUE if everything is successful. + * FALSE otherwise. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +static Bool +UnityUpdateState(void) +{ + Bool ret = TRUE; + XDR xdrs; + UnityActiveProto message; + char *val; + + if (DynXdr_Create(&xdrs) == NULL) { + return FALSE; + } + + val = Str_Asprintf(NULL, "%s ", UNITY_RPC_UNITY_ACTIVE); + if (!val || !DynXdr_AppendRaw(&xdrs, val, strlen(val))) { + Debug("%s: Failed to create state string.\n", __FUNCTION__); + ret = FALSE; + goto out; + } + memset(&message, 0, sizeof message); + message.ver = UNITY_ACTIVE_V1; + message.UnityActiveProto_u.unityActive = unity.isEnabled; + if (!xdr_UnityActiveProto(&xdrs, &message)) { + Debug("%s: Failed to append message content.\n", __FUNCTION__); + ret = FALSE; + goto out; + } + + if (!RpcOut_SendOneRaw(DynXdr_Get(&xdrs), xdr_getpos(&xdrs), NULL, NULL)) { + Debug("%s: Failed to send Unity state RPC.\n", __FUNCTION__); + ret = FALSE; + } else { + Debug("%s: success\n", __FUNCTION__); + } +out: + free(val); + DynXdr_Destroy(&xdrs, TRUE); + return ret; +} diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/unity/unityDebug.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/unity/unityDebug.h --- open-vm-tools-2008.01.23-74039/lib/unity/unityDebug.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/unity/unityDebug.h 2008-10-13 08:01:51.000000000 +0100 @@ -0,0 +1,41 @@ +/********************************************************* + * Copyright (C) 2007 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. + * + *********************************************************/ + +/* + * unityDebug.h -- + * + * Debugging functions for unity window manager intergration. + * On in VMX86_DEVEL builds only. + */ + +#ifndef _UNITY_DEBUG_H_ +#define _UNITY_DEBUG_H_ + +#include "unityWindowTracker.h" + +#if defined(VMX86_DEVEL) +void UnityDebug_Init(UnityWindowTracker *tracker); +void UnityDebug_OnUpdate(void); +#else +# define UnityDebug_Init(tracker) +# define UnityDebug_OnUpdate() +#endif + + +#endif + diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/unity/unityPlatform.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/unity/unityPlatform.h --- open-vm-tools-2008.01.23-74039/lib/unity/unityPlatform.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/unity/unityPlatform.h 2008-10-13 08:01:51.000000000 +0100 @@ -0,0 +1,128 @@ +/********************************************************* + * Copyright (C) 2007 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. + * + *********************************************************/ + +/* + * unityPlatform.h -- + * + * Implementation specific functionality + */ + +#ifndef _UNITY_PLATFORM_H_ +#define _UNITY_PLATFORM_H_ + +#include "unityWindowTracker.h" +#include "unity.h" + +/* + * This data structure is used when gathering and sending + * unity updates. + */ + +typedef struct { + DynBuf updates; + size_t cmdSize; + RpcOut *rpcOut; + uint32 flags; +} UnityUpdateThreadData; + +typedef struct { + int x; + int y; + int width; + int height; +} UnityRect; + +typedef struct _UnityPlatform UnityPlatform; + +/* + * Implemented by unityPlatform[Win32|X11|Cocoa (ha!)].c + */ + +Bool UnityPlatformIsSupported(void); +UnityPlatform *UnityPlatformInit(UnityWindowTracker *tracker, + int* blockedWnd); +void UnityPlatformCleanup(UnityPlatform *up); +void UnityPlatformRegisterCaps(UnityPlatform *up); +void UnityPlatformUnregisterCaps(UnityPlatform *up); +Bool UnityPlatformUpdateWindowState(UnityPlatform *up, + UnityWindowTracker *tracker); +void UnityPlatformSaveSystemSettings(UnityPlatform *up); +void UnityPlatformRestoreSystemSettings(UnityPlatform *up); +Bool UnityPlatformGetWindowPath(UnityPlatform *up, + UnityWindowId window, + DynBuf *buf); +Bool UnityPlatformGetNativeWindowPath(UnityPlatform *up, + UnityWindowId window, + DynBuf *buf); +Bool UnityPlatformGetBinaryInfo(UnityPlatform *up, + const char *pathUtf8, + DynBuf *buf); +Bool UnityPlatformRestoreWindow(UnityPlatform *up, + UnityWindowId window); +Bool UnityPlatformSetTopWindowGroup(UnityPlatform *up, + UnityWindowId *windows, + unsigned int windowCount); +Bool UnityPlatformCloseWindow(UnityPlatform *up, UnityWindowId window); +Bool UnityPlatformShowWindow(UnityPlatform *up, UnityWindowId window); +Bool UnityPlatformHideWindow(UnityPlatform *up, UnityWindowId window); +Bool UnityPlatformMinimizeWindow(UnityPlatform *up, UnityWindowId window); +Bool UnityPlatformMaximizeWindow(UnityPlatform *up, UnityWindowId window); +Bool UnityPlatformUnmaximizeWindow(UnityPlatform *up, UnityWindowId window); +Bool UnityPlatformGetWindowContents(UnityPlatform *up, + UnityWindowId window, + DynBuf *imageData); +Bool UnityPlatformMoveResizeWindow(UnityPlatform *up, + UnityWindowId window, + UnityRect *moveResizeRect); +void UnityPlatformShowTaskbar(UnityPlatform *up, Bool showTaskbar); +Bool UnityPlatformGetIconData(UnityPlatform *up, + UnityWindowId window, + UnityIconType iconType, + UnityIconSize iconSize, + uint32 dataOffset, + uint32 dataLength, + DynBuf *imageData, + uint32 *fullLength); +Bool UnityPlatformSetDesktopWorkAreas(UnityPlatform *up, + UnityRect workAreas[], + uint32 numWorkAreas); +Bool UnityPlatformSetDesktopConfig(UnityPlatform *up, + const UnityVirtualDesktopArray *desktops); +Bool UnityPlatformSetInitialDesktop(UnityPlatform *up, + UnityDesktopId desktopId); +Bool UnityPlatformSetDesktopActive(UnityPlatform *up, + UnityDesktopId desktopId); +Bool UnityPlatformSetWindowDesktop(UnityPlatform *up, + UnityWindowId windowId, + UnityDesktopId desktopId); +Bool UnityPlatformIsUnityRunning(UnityPlatform *up); +Bool UnityPlatformStartHelperThreads(UnityPlatform *up); +void UnityPlatformKillHelperThreads(UnityPlatform *up); +void UnityPlatformUnlock(UnityPlatform *up); +void UnityPlatformLock(UnityPlatform *up); +void UnityPlatformUpdateDnDDetWnd(UnityPlatform *up, + Bool show); +void UnityPlatformSetActiveDnDDetWnd(UnityPlatform *up, UnityDnD *detWnd); + +/* Functions implemented in unity.c for use by the platform-specific code. */ +void UnityGetUpdateCommon(int flags, DynBuf *buf); +Bool UnityUpdateThreadInit(UnityUpdateThreadData *updateData); +void UnityUpdateThreadCleanup(UnityUpdateThreadData *updateData); +Bool UnitySendUpdates(UnityUpdateThreadData *updateData); + +#endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/unity/unityPlatformX11.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/unity/unityPlatformX11.c --- open-vm-tools-2008.01.23-74039/lib/unity/unityPlatformX11.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/unity/unityPlatformX11.c 2008-10-13 08:01:51.000000000 +0100 @@ -0,0 +1,2971 @@ +/********************************************************* + * Copyright (C) 2007-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. + * + *********************************************************/ + +/* + * unityPlatformX11.c -- + * + * Implementation of Unity for guest operating systems that use the X11 windowing + * system. This file holds the basic things such as initialization/destruction of the + * UnityPlatform object, overall event handling, and handling of some Unity + * RPCs that are not window-centric. + */ + +#include "unityX11.h" +#include "appUtil.h" +#include "region.h" +#include <sys/time.h> + +#include <X11/extensions/Xinerama.h> +#include <X11/extensions/XTest.h> + +typedef struct { + Window realWindowID; + XEvent xevent; +} UnityTemporaryEvent; + +static UnitySpecialWindow *USWindowCreate(UnityPlatform *up, + UnitySpecialEventHandler evHandler, + Window *windows, + int windowCount); +static void USWindowUpdate(UnityPlatform *up, + UnitySpecialWindow *usw, + Window *windows, + int windowCount); +static UnitySpecialWindow *USWindowLookup(UnityPlatform *up, Window window); +static void USWindowDestroy(UnityPlatform *up, UnitySpecialWindow *usw); + +static gboolean UnityPlatformHandleEvents(gboolean errorOccurred, + gboolean inputAvailable, + gpointer data); +static void UnityPlatformProcessXEvent(UnityPlatform *up, + const XEvent *xevent, + Window realEventWindow); +static Window UnityPlatformGetRealEventWindow(UnityPlatform *up, const XEvent *xevent); +static void USRootWindowsProcessEvent(UnityPlatform *up, + UnitySpecialWindow *usw, + const XEvent *xevent, + Window window); +static int UnityPlatformXErrorHandler(Display *dpy, XErrorEvent *xev); +static UnitySpecialWindow *UnityPlatformMakeRootWindowsObject(UnityPlatform *up); + +#ifdef GTK2 +static gboolean UnityPlatformHandleEventsGlib(GIOChannel *source, + GIOCondition condition, + gpointer data); +#else +static void UnityPlatformHandleEventsGdk(gpointer data, + gint source, + GdkInputCondition condition); +#endif + +static void UnityPlatformSendClientMessageFull(Display *d, + Window destWindow, + Window w, + Atom messageType, + int format, + int numItems, + const void *data); +static void UnityPlatformStackDnDDetWnd(UnityPlatform *up); +static void UnityPlatformDnDSendClientMessage(UnityPlatform *up, + Window destWindow, + Window w, + Atom messageType, + int format, + int numItems, + const void *data); + +static const GuestCapabilities platformUnityCaps[] = { + UNITY_CAP_WORK_AREA, + UNITY_CAP_START_MENU, + UNITY_CAP_MULTI_MON, + UNITY_CAP_VIRTUAL_DESK +}; + +/* + * Has to be global for UnityPlatformXErrorHandler + */ +static int unityX11ErrorCount = 0; + +/* + *---------------------------------------------------------------------------- + * + * UnityPlatformIsSupported -- + * + * Determine whether this guest supports unity. + * + * Results: + * TRUE if the guest supports Unity + * FALSE otherwise + * + * Side effects: + * None + * + *---------------------------------------------------------------------------- + */ + +Bool +UnityPlatformIsSupported(void) +{ + return TRUE; +} + + +/* + *---------------------------------------------------------------------------- + * + * UnityPlatformInit -- + * + * Initialize the UnityPlatform object that represents the platform-specific state. + * + * Results: + * Pointer to newly allocated UnityPlatform data. + * + * Side effects: + * No. + * + *---------------------------------------------------------------------------- + */ + +UnityPlatform * +UnityPlatformInit(UnityWindowTracker *tracker, // IN + int *blockedWnd) // UNUSED +{ + UnityPlatform *up; + char *displayName; + + Debug("UnityPlatformInit: Running\n"); + + up = Util_SafeCalloc(1, sizeof *up); + up->tracker = tracker; + + up->savedScreenSaverTimeout = -1; + + if (!UnityUpdateThreadInit(&up->updateData)) { + free(up); + return NULL; + } + + /* + * Because GDK filters events heavily, and we need to do a lot of low-level X work, we + * just open another connection to the same display. + */ + displayName = gdk_get_display(); + up->display = XOpenDisplay(displayName); + if (!up->display) { + free(up); + return NULL; // We couldn't connect to the display for some strange reason + } + XSetErrorHandler(UnityPlatformXErrorHandler); + XSynchronize(up->display, TRUE); // So error counting works properly... + + /* + * Certain applications, like gnome-session during logout, may grab the X + * server before displaying a modal window. With the server grabbed, we're + * unable to correctly track and display windows. + * + * The following snippet attempts to work around this by using the XTest + * extension's ability to make ourselves impervious to X server grabs. + */ + { + int dummy1; + int dummy2; + int major; + int minor; + + if ((XTestQueryExtension(up->display, &dummy1, &dummy2, + &major, &minor) == True) && + ((major > 2) || (major == 2 && minor >= 2))) { + if (XTestGrabControl(up->display, True) != 1) { + Debug("XTestGrabControl failed.\n"); + } + } else { + Debug("XTest extension not available.\n"); + } + } + + /* + * Set up a callback in the glib main loop to listen for incoming X events on the + * unity display connection. + */ +#ifdef GTK2 + { + GIOChannel *unityDisplayChannel; + unityDisplayChannel = g_io_channel_unix_new(ConnectionNumber(up->display)); + up->unityDisplayWatchID = g_io_add_watch(unityDisplayChannel, + G_IO_IN | G_IO_ERR | G_IO_HUP | G_IO_NVAL, + UnityPlatformHandleEventsGlib, + up); + g_io_channel_unref(unityDisplayChannel); + } +#else + up->unityDisplayWatchID = gdk_input_add(ConnectionNumber(up->display), + GDK_INPUT_READ | GDK_INPUT_EXCEPTION, + UnityPlatformHandleEventsGdk, + up); +#endif + + up->allWindows = HashTable_Alloc(128, HASH_INT_KEY, NULL); + up->specialWindows = HashTable_Alloc(32, HASH_INT_KEY, NULL); + up->desktopWindow = NULL; + up->desktopInfo.initialDesktop = UNITY_X11_INITIALDESKTOP_UNSET; + + /* + * Find the values of all the atoms + */ +# define INIT_ATOM(x) up->atoms.x = XInternAtom(up->display, #x, False) + + INIT_ATOM(_NET_WM_WINDOW_TYPE); + INIT_ATOM(_NET_WM_WINDOW_TYPE_DESKTOP); + INIT_ATOM(_NET_WM_WINDOW_TYPE_DOCK); + INIT_ATOM(_NET_WM_WINDOW_TYPE_TOOLBAR); + INIT_ATOM(_NET_WM_WINDOW_TYPE_TOOLTIP); + INIT_ATOM(_NET_WM_WINDOW_TYPE_DROPDOWN_MENU); + INIT_ATOM(_NET_WM_WINDOW_TYPE_POPUP_MENU); + INIT_ATOM(_NET_WM_WINDOW_TYPE_MENU); + INIT_ATOM(_NET_WM_WINDOW_TYPE_UTILITY); + INIT_ATOM(_NET_WM_WINDOW_TYPE_SPLASH); + INIT_ATOM(_NET_WM_WINDOW_TYPE_DIALOG); + INIT_ATOM(_NET_WM_WINDOW_TYPE_NORMAL); + INIT_ATOM(_NET_WM_WINDOW_TYPE_DND); + INIT_ATOM(_NET_WM_STATE); + INIT_ATOM(_NET_WM_STATE_HIDDEN); + INIT_ATOM(_NET_WM_STATE_MODAL); + INIT_ATOM(_NET_WM_STATE_STICKY); + INIT_ATOM(_NET_WM_STATE_MAXIMIZED_HORZ); + INIT_ATOM(_NET_WM_STATE_MAXIMIZED_VERT); + INIT_ATOM(_NET_WM_STATE_MINIMIZED); + INIT_ATOM(_NET_WM_STATE_SHADED); + INIT_ATOM(_NET_WM_STATE_SKIP_TASKBAR); + INIT_ATOM(_NET_WM_STATE_SKIP_PAGER); + INIT_ATOM(_NET_WM_STATE_FULLSCREEN); + INIT_ATOM(_NET_WM_STATE_ABOVE); + INIT_ATOM(_NET_WM_STATE_BELOW); + INIT_ATOM(_NET_WM_STATE_DEMANDS_ATTENTION); + INIT_ATOM(_NET_WM_USER_TIME); + INIT_ATOM(_NET_WM_USER_TIME_WINDOW); + INIT_ATOM(_NET_ACTIVE_WINDOW); + INIT_ATOM(_NET_RESTACK_WINDOW); + INIT_ATOM(_NET_WM_ICON); + INIT_ATOM(_NET_WM_PID); + INIT_ATOM(_NET_WM_STRUT); + INIT_ATOM(_NET_WM_STRUT_PARTIAL); + INIT_ATOM(_NET_MOVERESIZE_WINDOW); + INIT_ATOM(_NET_CLOSE_WINDOW); + INIT_ATOM(_NET_WM_ALLOWED_ACTIONS); + INIT_ATOM(_NET_WM_ACTION_MOVE); + INIT_ATOM(_NET_WM_ACTION_RESIZE); + INIT_ATOM(_NET_WM_ACTION_MINIMIZE); + INIT_ATOM(_NET_WM_ACTION_SHADE); + INIT_ATOM(_NET_WM_ACTION_STICK); + INIT_ATOM(_NET_WM_ACTION_MAXIMIZE_HORZ); + INIT_ATOM(_NET_WM_ACTION_MAXIMIZE_VERT); + INIT_ATOM(_NET_WM_ACTION_FULLSCREEN); + INIT_ATOM(_NET_WM_ACTION_CHANGE_DESKTOP); + INIT_ATOM(_NET_WM_ACTION_CLOSE); + INIT_ATOM(_NET_NUMBER_OF_DESKTOPS); + INIT_ATOM(_NET_WM_DESKTOP); + INIT_ATOM(_NET_CURRENT_DESKTOP); + INIT_ATOM(_NET_DESKTOP_LAYOUT); + INIT_ATOM(_NET_SUPPORTED); + INIT_ATOM(_NET_FRAME_EXTENTS); + INIT_ATOM(WM_CLASS); + INIT_ATOM(WM_DELETE_WINDOW); + INIT_ATOM(WM_ICON); + INIT_ATOM(WM_NAME); + INIT_ATOM(WM_PROTOCOLS); + INIT_ATOM(WM_STATE); + INIT_ATOM(WM_TRANSIENT_FOR); + +# undef INIT_ATOM + +#if defined(VM_HAVE_X11_SHAPE_EXT) + if (!XShapeQueryExtension(up->display, &up->shapeEventBase, &up->shapeErrorBase)) { + up->shapeEventBase = 0; + } +#endif + + return up; +} + + +/* + *---------------------------------------------------------------------------- + * + * UnityPlatformCleanup -- + * + * One-time platform-specific cleanup code. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +void +UnityPlatformCleanup(UnityPlatform *up) // IN +{ + if (!up) { + return; + } + + if (up->specialWindows) { + HashTable_Free(up->specialWindows); + up->specialWindows = NULL; + } + if (up->allWindows) { + HashTable_Free(up->allWindows); + up->allWindows = NULL; + } + + if (up->unityDisplayWatchID) { +#ifdef GTK2 + g_source_remove(up->unityDisplayWatchID); +#else + gdk_input_remove(up->unityDisplayWatchID); +#endif + up->unityDisplayWatchID = 0; + } + + if (up->display) { + XCloseDisplay(up->display); + up->display = NULL; + } + + UnityUpdateThreadCleanup(&up->updateData); + + free(up->desktopInfo.guestDesktopToUnity); + up->desktopInfo.guestDesktopToUnity = NULL; + free(up->desktopInfo.unityDesktopToGuest); + up->desktopInfo.unityDesktopToGuest = NULL; + up->desktopWindow = NULL; + + free(up); +} + + +/* + *---------------------------------------------------------------------------- + * + * UnityPlatformRegisterCaps -- + * + * Register guest platform specific capabilities with the VMX. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +void +UnityPlatformRegisterCaps(UnityPlatform *up) // IN +{ + ASSERT(up); + + if (!RpcOut_sendOne(NULL, NULL, UNITY_RPC_SHOW_TASKBAR_CAP " %d", + Unity_IsSupported() ? 1 : 0)) { + Debug("Could not set unity show taskbar cap\n"); + } + + AppUtil_SendGuestCaps(platformUnityCaps, ARRAYSIZE(platformUnityCaps), TRUE); +} + + +/* + *---------------------------------------------------------------------------- + * + * UnityPlatformUnregisterCaps -- + * + * Unregister guest platform specific capabilities with the VMX. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +void +UnityPlatformUnregisterCaps(UnityPlatform *up) // IN +{ + /* + * This function may potentially be called during UnityPlatform destruction. + */ + if (!up) { + return; + } + + AppUtil_SendGuestCaps(platformUnityCaps, ARRAYSIZE(platformUnityCaps), FALSE); + + if (!RpcOut_sendOne(NULL, NULL, UNITY_RPC_SHOW_TASKBAR_CAP " 0")) { + Debug("Failed to unregister Unity taskbar capability\n"); + } +} + + +/***************************************************************************** + * Unity main loop and event handling * + *****************************************************************************/ + + +/* + *----------------------------------------------------------------------------- + * + * USWindowCreate -- + * + * Creates a new UnitySpecialWindow. Ownership of the 'windows' memory is taken over + * by the newly created object, but that memory MUST be malloc'd... + * + * Results: + * New UnitySpecialWindow object. + * + * Side effects: + * Allocates memory. + * + *----------------------------------------------------------------------------- + */ + +static UnitySpecialWindow * +USWindowCreate(UnityPlatform *up, // IN + UnitySpecialEventHandler evHandler, // IN + Window *windows, // IN + int windowCount) // IN +{ + UnitySpecialWindow *usw; + + ASSERT(up); + + usw = Util_SafeCalloc(1, sizeof *usw); + usw->evHandler = evHandler; + USWindowUpdate(up, usw, windows, windowCount); + + return usw; +} + + +/* + *----------------------------------------------------------------------------- + * + * USWindowUpdate -- + * + * Updates this USWindow with a new list of X windows. Ownership of the 'windows' + * memory is taken over by this USWindow object. That memory MUST be malloc'd... + * + * Results: + * None. + * + * Side effects: + * Old window list may be destroyed and freed. + * + *----------------------------------------------------------------------------- + */ + +static void +USWindowUpdate(UnityPlatform *up, // IN + UnitySpecialWindow *usw, // IN + Window *windows, // IN + int windowCount) // IN +{ + int i; + + ASSERT(up); + ASSERT(usw); + + for (i = 0; i < usw->numWindows; i++) { + XSelectInput(up->display, usw->windows[i], 0); + HashTable_Delete(up->specialWindows, GUINT_TO_POINTER(usw->windows[i])); + } + + free(usw->windows); + usw->windows = windows; + usw->numWindows = windowCount; + + for (i = 0; i < windowCount; i++) { + HashTable_Insert(up->specialWindows, GUINT_TO_POINTER(windows[i]), usw); + } +} + + +/* + *----------------------------------------------------------------------------- + * + * USWindowLookup -- + * + * Looks up a special window + * + * Results: + * UnitySpecialWindow object + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static UnitySpecialWindow * +USWindowLookup(UnityPlatform *up, // IN + Window window) // IN +{ + UnitySpecialWindow *retval = NULL; + + HashTable_Lookup(up->specialWindows, GUINT_TO_POINTER(window), (void **)&retval); + + return retval; +} + + +/* + *----------------------------------------------------------------------------- + * + * USWindowDestroy -- + * + * Destroys a UnitySpecialWindow + * + * Results: + * None. + * + * Side effects: + * Memory is freed. + * + *----------------------------------------------------------------------------- + */ + +static void +USWindowDestroy(UnityPlatform *up, // IN + UnitySpecialWindow *usw) // IN +{ + int i; + + ASSERT(up); + ASSERT(usw); + + for (i = 0; i < usw->numWindows; i++) { + HashTable_Delete(up->specialWindows, GUINT_TO_POINTER(usw->windows[i])); + + if (usw->windowsAreOwned) { + XDestroyWindow(up->display, usw->windows[i]); + } else { + /* + * For now, assume we don't have any special windows that get extension events + * and need a call like XScreenSaverSelectInput... + */ + XSelectInput(up->display, usw->windows[i], 0); + } + } + free(usw->windows); + + free(usw); +} + + +/* + *----------------------------------------------------------------------------- + * + * UnityPlatformMakeRootWindowsObject -- + * + * Creates a UnitySpecialWindow to handle the root windows. + * + * Results: + * UnitySpecialWindow + * + * Side effects: + * Selects for events on the root windows. + * + *----------------------------------------------------------------------------- + */ + +static UnitySpecialWindow * +UnityPlatformMakeRootWindowsObject(UnityPlatform *up) // IN +{ + static const long eventMask = + StructureNotifyMask + | PropertyChangeMask + | SubstructureNotifyMask + | FocusChangeMask; + int i; + int numRootWindows; + Window *rootWindows; + + ASSERT(up); + + numRootWindows = ScreenCount(up->display); + ASSERT(numRootWindows > 0); + + rootWindows = Util_SafeCalloc(numRootWindows, sizeof rootWindows[0]); + for (i = 0; i < numRootWindows; i++) { + rootWindows[i] = RootWindow(up->display, i); + } + + for (i = 0; i < numRootWindows; i++) { + XSelectInput(up->display, rootWindows[i], eventMask); + } + + return USWindowCreate(up, USRootWindowsProcessEvent, rootWindows, numRootWindows); +} + + +/* + *----------------------------------------------------------------------------- + * + * UnityPlatformGetErrorCount -- + * + * Retrieves the current count of X11 errors received by Unity. + * + * Results: + * Current error count. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +int +UnityPlatformGetErrorCount(UnityPlatform *up) // IN +{ + return unityX11ErrorCount; +} + + +/* + *----------------------------------------------------------------------------- + * + * UnityPlatformResetErrorCount -- + * + * Resets the Unity X11 error count to zero. + * + * Results: + * None. + * + * Side effects: + * Error count reset. + * + *----------------------------------------------------------------------------- + */ + +void +UnityPlatformResetErrorCount(UnityPlatform *up) // IN +{ + unityX11ErrorCount = 0; +} + + +/* + *----------------------------------------------------------------------------- + * + * UnityPlatformXErrorHandler -- + * + * Handler for all X event errors. + * + * Results: + * 1. + * + * Side effects: + * Updates our X11 error counter. + * + *----------------------------------------------------------------------------- + */ + +static int +UnityPlatformXErrorHandler(Display *dpy, // IN + XErrorEvent *xev) // IN +{ + char buf[1024]; + XGetErrorText(dpy, xev->error_code, buf, sizeof buf); + Debug("> VMwareUserXErrorHandler: error %s on resource %#lx for request %d\n", + buf, xev->resourceid, xev->request_code); + + unityX11ErrorCount++; + + return 1; +} + + +/* + *----------------------------------------------------------------------------- + * + * UnityPlatformGetServerTime -- + * + * Returns an educated guess at the X server's current timestamp + * + * Results: + * X server timestamp + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +Time +UnityPlatformGetServerTime(UnityPlatform *up) // IN +{ + Time retval; + struct timeval tv; + + gettimeofday(&tv, NULL); + retval = up->eventTimeDiff + (tv.tv_sec * 1000) + (tv.tv_usec / 1000); + + Debug("UserTime is guessed at %lu\n", retval); + + return retval; +} + + +/* + *----------------------------------------------------------------------------- + * + * ComparePointers -- + * + * Compares two pointers to see whether they're equal. + * + * Results: + * -1, 0, or 1 (same meaning as strcmp return values) + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static INLINE int +ComparePointers(const void *p1, // IN + const void *p2) // IN +{ + /* + * Helper function for UnityPlatformKillHelperThreads + */ + const void * const *ptr1 = p1; + const void * const *ptr2 = p2; + ptrdiff_t diff = (*ptr2 - *ptr1); + + if (diff < 0) { + return -1; + } else if (diff > 0) { + return 1; + } + + return 0; +} + + +/* + *---------------------------------------------------------------------------- + * + * UnityPlatformKillHelperThreads -- + * + * Tears down the Unity "running" state. + * + * Results: + * None. + * + * Side effects: + * Restores system settings. + * + *---------------------------------------------------------------------------- + */ + +void +UnityPlatformKillHelperThreads(UnityPlatform *up) // IN +{ + UnityPlatformWindow **upwList; + UnitySpecialWindow **uswList; + size_t i; + size_t numWindows; + + if (!up || !up->isRunning) { + return; + } + + up->desktopInfo.numDesktops = 0; // Zero means host has not set virtual desktop config + UnityX11RestoreSystemSettings(up); + + HashTable_ToArray(up->allWindows, + (void ***)&upwList, + &numWindows); + qsort(upwList, numWindows, sizeof *upwList, ComparePointers); + for (i = 0; i < numWindows; i++) { + if (i < (numWindows - 1) && upwList[i] == upwList[i + 1]) { + continue; + } + + UPWindow_Unref(up, upwList[i]); + } + free(upwList); + + up->workAreas = NULL; + up->rootWindows = NULL; + HashTable_ToArray(up->specialWindows, + (void ***)&uswList, + &numWindows); + qsort(uswList, numWindows, sizeof *uswList, ComparePointers); + for (i = 0; i < numWindows; i++) { + if (i < (numWindows - 1) && uswList[i] == uswList[i + 1]) { + continue; + } + + USWindowDestroy(up, uswList[i]); + } + free(uswList); + + XSync(up->display, TRUE); + up->desktopInfo.initialDesktop = UNITY_X11_INITIALDESKTOP_UNSET; + up->isRunning = FALSE; + + Debug("Leaving unity mode\n"); +} + + +/* + *----------------------------------------------------------------------------- + * + * UnityX11GetWMProtocols -- + * + * Updates the list of protocols supported by the window manager. + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static void +UnityX11GetWMProtocols(UnityPlatform *up) // IN +{ + Atom propertyType; + int propertyFormat; + unsigned long itemsReturned; + unsigned long bytesRemaining; + Atom *valueReturned = NULL; + + ASSERT(up); + + memset(up->wmProtocols, 0, sizeof up->wmProtocols); + if (XGetWindowProperty(up->display, up->rootWindows->windows[0], + up->atoms._NET_SUPPORTED, 0, + 1024, False, AnyPropertyType, + &propertyType, &propertyFormat, &itemsReturned, + &bytesRemaining, (unsigned char **)&valueReturned) + != Success) { + return; + } + + if ((propertyType == XA_ATOM || propertyType == XA_CARDINAL) + && propertyFormat == 32) { + int i; + + for (i = 0; i < itemsReturned; i++) { + if (valueReturned[i] == up->atoms._NET_MOVERESIZE_WINDOW) { + up->wmProtocols[UNITY_X11_WM__NET_MOVERESIZE_WINDOW] = TRUE; + } else if (valueReturned[i] == up->atoms._NET_CLOSE_WINDOW) { + up->wmProtocols[UNITY_X11_WM__NET_CLOSE_WINDOW] = TRUE; + } else if (valueReturned[i] == up->atoms._NET_RESTACK_WINDOW) { + up->wmProtocols[UNITY_X11_WM__NET_RESTACK_WINDOW] = TRUE; + } else if (valueReturned[i] == up->atoms._NET_ACTIVE_WINDOW) { + up->wmProtocols[UNITY_X11_WM__NET_ACTIVE_WINDOW] = TRUE; + } else if (valueReturned[i] == up->atoms._NET_WM_ACTION_MINIMIZE) { + up->wmProtocols[UNITY_X11_WM__NET_WM_ACTION_MINIMIZE] = TRUE; + } else if (valueReturned[i] == up->atoms._NET_WM_ACTION_CLOSE) { + up->wmProtocols[UNITY_X11_WM__NET_WM_ACTION_CLOSE] = TRUE; + } else if (valueReturned[i] == up->atoms._NET_WM_ACTION_SHADE) { + up->wmProtocols[UNITY_X11_WM__NET_WM_ACTION_SHADE] = TRUE; + } else if (valueReturned[i] == up->atoms._NET_WM_ACTION_STICK) { + up->wmProtocols[UNITY_X11_WM__NET_WM_ACTION_STICK] = TRUE; + } else if (valueReturned[i] == up->atoms._NET_WM_ACTION_FULLSCREEN) { + up->wmProtocols[UNITY_X11_WM__NET_WM_ACTION_FULLSCREEN] = TRUE; + } else if (valueReturned[i] == up->atoms._NET_WM_ACTION_MAXIMIZE_HORZ) { + up->wmProtocols[UNITY_X11_WM__NET_WM_ACTION_MAXIMIZE_HORZ] = TRUE; + } else if (valueReturned[i] == up->atoms._NET_WM_ACTION_MAXIMIZE_VERT) { + up->wmProtocols[UNITY_X11_WM__NET_WM_ACTION_MAXIMIZE_VERT] = TRUE; + } else if (valueReturned[i] == up->atoms._NET_FRAME_EXTENTS) { + up->wmProtocols[UNITY_X11_WM__NET_FRAME_EXTENTS] = TRUE; + } else if (valueReturned[i] == up->atoms._NET_WM_STRUT_PARTIAL) { + up->wmProtocols[UNITY_X11_WM__NET_WM_STRUT_PARTIAL] = TRUE; + } else if (valueReturned[i] == up->atoms._NET_WM_STATE_HIDDEN) { + up->wmProtocols[UNITY_X11_WM__NET_WM_STATE_HIDDEN] = TRUE; + } else if (valueReturned[i] == up->atoms._NET_WM_STATE_MINIMIZED) { + up->wmProtocols[UNITY_X11_WM__NET_WM_STATE_MINIMIZED] = TRUE; + } + } + } + + XFree(valueReturned); +} + + +/* + *---------------------------------------------------------------------------- + * + * UnityPlatformStartHelperThreads -- + * + * Start Unity running. + * + * Results: + * TRUE if successful + * FALSE otherwise + * + * Side effects: + * Saves and changes system settings. + * Starts watching for windowing system events. + * + *---------------------------------------------------------------------------- + */ + +Bool +UnityPlatformStartHelperThreads(UnityPlatform *up) // IN +{ + ASSERT(up); + + XSync(up->display, TRUE); + up->rootWindows = UnityPlatformMakeRootWindowsObject(up); + up->isRunning = TRUE; + up->eventTimeDiff = 0; + + UnityX11SaveSystemSettings(up); + + UnityX11GetWMProtocols(up); + + if (up->desktopInfo.numDesktops) { + UnityDesktopId activeDesktop; + + UnityPlatformSyncDesktopConfig(up); + + if (up->desktopInfo.initialDesktop != UNITY_X11_INITIALDESKTOP_UNSET) { + Debug("%s: Setting activeDesktop to initialDesktop (%u).\n", __func__, + up->desktopInfo.initialDesktop); + activeDesktop = up->desktopInfo.initialDesktop; + } else { + activeDesktop = UnityWindowTracker_GetActiveDesktop(up->tracker); + } + if (UnityPlatformSetDesktopActive(up, activeDesktop)) {; + /* + * XXX Rather than setting this directly here, should we instead wait for a + * PropertyNotify event from the window manager to one of the root windows? + * Doing so may be safer in that it confirms that our request was honored by + * the window manager. + */ + UnityWindowTracker_ChangeActiveDesktop(up->tracker, activeDesktop); + } + } + + if (up->needWorkAreas) { + /* + * UNEXPECTED: The host called SetDesktopWorkArea before entering Unity mode, so we + * need to go back and apply the remembered work area info. + */ + + UnityPlatformSetDesktopWorkAreas(up, up->needWorkAreas, up->needNumWorkAreas); + free(up->needWorkAreas); + up->needWorkAreas = NULL; + } + + return TRUE; +} + + +/* + *---------------------------------------------------------------------------- + * + * UnityPlatformIsUnityRunning -- + * + * Check to see if we are still in the unity mode. + * + * Results: + * TRUE if we are in Unity mode + * FALSE otherwise. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +Bool +UnityPlatformIsUnityRunning(UnityPlatform *up) // IN +{ + ASSERT(up); + + return up->isRunning; +} + + +/* + *---------------------------------------------------------------------------- + * + * UnityPlatformLock -- + * + * Does nothing - our implementation is not threaded. + * + * Results: + * None. + * + * Side effects: + * None (really). + * + *---------------------------------------------------------------------------- + */ + +void +UnityPlatformLock(UnityPlatform *up) // IN +{ +} + + +/* + *---------------------------------------------------------------------------- + * + * UnityPlatformUnlock -- + * + * Does nothing - our implementation is not threaded. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +void +UnityPlatformUnlock(UnityPlatform *up) // IN +{ +} + + +/* + *---------------------------------------------------------------------------- + * + * UnityPlatformUpdateZOrder -- + * + * Push the Z-Order of all windows into the window tracker. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +static void +UnityPlatformUpdateZOrder(UnityPlatform *up) // IN +{ + UnityWindowId *elements; + size_t numElements; + UnityPlatformWindow *curWindow; + + ASSERT(up); + if (!up->stackingChanged) { + return; + } + + elements = alloca(UNITY_MAX_WINDOWS * sizeof elements[0]); + for (numElements = 0, curWindow = up->topWindow; + curWindow; curWindow = curWindow->lowerWindow) { + if (curWindow->isRelevant) { + elements[numElements++] = curWindow->toplevelWindow; + } + } + + UnityWindowTracker_SetZOrder(up->tracker, + elements, + numElements); + up->stackingChanged = FALSE; +} + + +/* + *---------------------------------------------------------------------------- + * + * UnityPlatformUpdateWindowState -- + * + * Walk through /all/ the windows on the guest, pushing everything we know about + * them into the unity window tracker. + * + * Results: + * TRUE indicating we need help from the common code to generate + * remove window events (see unity.c) + * + * Side effects: + * None + * + *---------------------------------------------------------------------------- + */ + +Bool +UnityPlatformUpdateWindowState(UnityPlatform *up, // IN + UnityWindowTracker *tracker) // IN +{ + int curRoot; + Window lowerWindow = None; + + if (!up || !up->rootWindows) { + Debug("BUG: UpdateWindowState was called before we are fully in Unity mode...\n"); + return FALSE; + } + + for (curRoot = 0; curRoot < up->rootWindows->numWindows; curRoot++) { + int i; + Window dummyWin; + Window *children; + unsigned int numChildren; + + XQueryTree(up->display, up->rootWindows->windows[curRoot], + &dummyWin, &dummyWin, &children, &numChildren); + + for (i = 0; i < numChildren; i++) { + UnityPlatformWindow *upw; + + if (!HashTable_Lookup(up->allWindows, + GUINT_TO_POINTER(children[i]), + (void **)&upw)) { + upw = UPWindow_Create(up, children[i]); + if (!upw) { + continue; // Window may have disappeared since the XQueryTree + } + UPWindow_CheckRelevance(up, upw, NULL); + UPWindow_Restack(up, upw, lowerWindow); + } + + lowerWindow = upw->toplevelWindow; + } + + XFree(children); + } + + UnityPlatformUpdateZOrder(up); + /* + * up is not populated with the window layout structure when + * UnityPlatformUpdateDnDDetWnd is intially called. + */ + UnityPlatformStackDnDDetWnd(up); + + if (up->needTaskbarSetting) { + up->needTaskbarSetting = FALSE; + /* + * This is called in this seemingly random spot to make sure that the taskbar + * visibility is properly set once we have a full picture of the windowing system + * state. Although the routine is called prior to this by SaveSystemSettings(), the + * up->allWindows hash table is not complete until this point, which occurs at a + * random time of the host's choosing. + */ + UnityPlatformSetTaskbarVisible(up, up->currentSettings[UNITY_UI_TASKBAR_VISIBLE]); + } + + return FALSE; +} + + +/* + *----------------------------------------------------------------------------- + * + * UnityPlatformSendPendingUpdates -- + * + * Pushes any pending window tracker updates out to the host. + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +void +UnityPlatformSendPendingUpdates(UnityPlatform *up, // IN + int flags) // IN +{ + + DynBuf_SetSize(&up->updateData.updates, up->updateData.cmdSize); + UnityWindowTracker_RequestUpdates(up->tracker, + flags, + &up->updateData.updates); + DynBuf_AppendString(&up->updateData.updates, ""); + if (DynBuf_GetSize(&up->updateData.updates) > (up->updateData.cmdSize + 1)) { + UnityPlatformDumpUpdate(up); + if (!UnitySendUpdates(&up->updateData)) { + Debug("UPDATE TRANSMISSION FAILED! --------------------\n"); + } + } +} + + +#ifdef GTK2 + + +/* + *----------------------------------------------------------------------------- + * + * UnityPlatformHandleEventsGlib -- + * + * Lets the UnityPlatform object know that new events are available to process. + * This implementation is used in Gtk+ 2.0 and greater. + * + * Results: + * TRUE if we should continue to process events from the display, FALSE otherwise. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static gboolean +UnityPlatformHandleEventsGlib(GIOChannel *source, // IN + GIOCondition condition, // IN + gpointer data) // IN +{ + gboolean errorOccurred = FALSE; + gboolean inputAvailable = FALSE; + + if (condition & (G_IO_ERR | G_IO_HUP | G_IO_NVAL)) { + errorOccurred = TRUE; + } else if (condition & G_IO_IN) { + inputAvailable = TRUE; + } + + return UnityPlatformHandleEvents(errorOccurred, inputAvailable, data); +} +#else + + +/* + *----------------------------------------------------------------------------- + * + * UnityX11SignalEventsGdk -- + * + * Lets the UnityX11 object know that new events are available to process. + * This skeleton is used with Gtk+ 1.x. + * + * Results: + * None. + * + * Side effects: + * Signals the update thread. + * + *----------------------------------------------------------------------------- + */ + +static void +UnityPlatformHandleEventsGdk(gpointer data, // IN + gint source, // IN + GdkInputCondition condition) // IN +{ + gboolean errorOccurred = FALSE; + gboolean inputAvailable = FALSE; + + if (condition & GDK_INPUT_EXCEPTION) { + Debug("UnityPlatformHandleEventsGdk - errorOccurred\n"); + errorOccurred = TRUE; + } else if (condition & GDK_INPUT_READ) { + inputAvailable = TRUE; + } + + if (!UnityPlatformHandleEvents(errorOccurred, inputAvailable, data)) { + UnityPlatform *up = (UnityPlatform *) data; + + gdk_input_remove(up->unityDisplayWatchID); + up->unityDisplayWatchID = -1; + } +} +#endif + + +/* + *----------------------------------------------------------------------------- + * + * UnityPlatformHandleEvents -- + * + * Handle incoming events + * + * Results: + * TRUE if the main loop should continue watching for events from the display. + * + * Side effects: + * Events read from the X display and processed. + * + *----------------------------------------------------------------------------- + */ + +static gboolean +UnityPlatformHandleEvents(gboolean errorOccurred, // IN + gboolean inputAvailable, // IN + gpointer data) // IN +{ + UnityPlatform *up = (UnityPlatform *) data; + GList *incomingEvents = NULL; + Bool restackDetWnd = FALSE; + + ASSERT(up); + + if (errorOccurred) { + /* + * XXX We should force an exit from unity mode here - our X connection just died. + */ + return FALSE; + } else if (!inputAvailable) { + Panic("Unity event handler was invoked with no input and no error\n"); + } + + Debug("Starting unity event handling\n"); + while (XEventsQueued(up->display, QueuedAfterFlush)) { + /* + * This outer loop is here to make sure we really process all available events + * before returning. + */ + + while (XEventsQueued(up->display, QueuedAlready)) { + UnityTemporaryEvent *ev; + + ev = Util_SafeCalloc(1, sizeof *ev); + XNextEvent(up->display, &ev->xevent); + ev->realWindowID = UnityPlatformGetRealEventWindow(up, &ev->xevent); + + /* + * Restack dnd detection window when either + * 1. the desktop window may overlap detection window, or + * 2. a window is inserted directly above the desktop (and therefore + * below the DND window). + */ + if (up->desktopWindow && + ev->xevent.type == ConfigureNotify && + (up->desktopWindow->toplevelWindow == ev->realWindowID || + up->desktopWindow->toplevelWindow == ev->xevent.xconfigure.above)) { + restackDetWnd = TRUE; + } + + if (ev->xevent.type == DestroyNotify) { + /* + * Unfortunately, X's event-driven model has an inherent race condition for + * parties that are observing events on windows that are controlled by other + * applications. Basically, if we're processing an event on a window, that + * window may have already been destroyed, and there doesn't seem to really + * be a way to detect this. We just have to try to cut down the probability + * of those as much as possible, by discarding any events on a window if + * they're immediately followed by a DestroyNotify on the same window... + */ + GList *curItem; + GList *nextItem = NULL; + + for (curItem = incomingEvents; curItem; curItem = nextItem) { + UnityTemporaryEvent *otherEvent = curItem->data; + nextItem = curItem->next; + + if (otherEvent->realWindowID == ev->realWindowID) { + free(curItem->data); + incomingEvents = g_list_remove_link(incomingEvents, curItem); + } + } + } + + incomingEvents = g_list_append(incomingEvents, ev); + } + + while (incomingEvents) { + GList *nextItem; + UnityTemporaryEvent *tempEvent = incomingEvents->data; + + UnityPlatformProcessXEvent(up, &tempEvent->xevent, tempEvent->realWindowID); + + nextItem = incomingEvents->next; + free(incomingEvents->data); + g_list_free_1(incomingEvents); + incomingEvents = nextItem; + } + + if (restackDetWnd) { + UnityPlatformStackDnDDetWnd(up); + } + UnityPlatformUpdateZOrder(up); + UnityPlatformSendPendingUpdates(up, UNITY_UPDATE_INCREMENTAL); + } + + return TRUE; +} + + +/* + *----------------------------------------------------------------------------- + * + * UnityPlatformGetEventString -- + * + * Allows stringifying events for debugging purposes + * + * Results: + * A stringified version of the event name. It's a static value - do not free this. + * + * Side effects: + * None. + *----------------------------------------------------------------------------- + */ + +const char * +UnityPlatformGetEventString(UnityPlatform *up, // IN + int type) // IN +{ +#if defined(VM_HAVE_X11_SHAPE_EXT) + if (up->shapeEventBase + && type == (up->shapeEventBase + ShapeNotify)) { + return "ShapeNotify"; + } +#endif + + switch (type) { + case KeyPress: return "KeyPress"; + case KeyRelease: return "KeyRelease"; + case ButtonPress: return "ButtonPress"; + case ButtonRelease: return "ButtonRelease"; + case MotionNotify: return "MotionNotify"; + case EnterNotify: return "EnterNotify"; + case LeaveNotify: return "LeaveNotify"; + case FocusIn: return "FocusIn"; + case FocusOut: return "FocusOut"; + case KeymapNotify: return "KeymapNotify"; + case Expose: return "Expose"; + case GraphicsExpose: return "GraphicsExpose"; + case NoExpose: return "NoExpose"; + case VisibilityNotify: return "VisibilityNotify"; + case CreateNotify: return "CreateNotify"; + case DestroyNotify: return "DestroyNotify"; + case UnmapNotify: return "UnmapNotify"; + case MapNotify: return "MapNotify"; + case MapRequest: return "MapRequest"; + case ReparentNotify: return "ReparentNotify"; + case ConfigureNotify: return "ConfigureNotify"; + case ConfigureRequest: return "ConfigureRequest"; + case GravityNotify: return "GravityNotify"; + case ResizeRequest: return "ResizeRequest"; + case CirculateNotify: return "CirculateNotify"; + case CirculateRequest: return "CirculateRequest"; + case PropertyNotify: return "PropertyNotify"; + case SelectionClear: return "SelectionClear"; + case SelectionRequest: return "SelectionRequest"; + case SelectionNotify: return "SelectionNotify"; + case ColormapNotify: return "ColormapNotify"; + case ClientMessage: return "ClientMessage"; + case MappingNotify: return "MappingNotify"; + default: return "<Unknown>"; + } +} + + +/* + *----------------------------------------------------------------------------- + * + * UnityPlatformGetRealEventWindow -- + * + * For debugging purposes, retrieves the window that the event happened on (as + * opposed to the window the event was sent to) + * + * Results: + * The window that the event actually happened on. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static Window +UnityPlatformGetRealEventWindow(UnityPlatform *up, // IN + const XEvent *xevent) // IN +{ +#if defined(VM_HAVE_X11_SHAPE_EXT) + if (up->shapeEventBase + && xevent->type == (up->shapeEventBase + ShapeNotify)) { + XShapeEvent *sev = (XShapeEvent *) xevent; + + return sev->window; + } +#endif + + switch (xevent->type) { + case CreateNotify: + return xevent->xcreatewindow.window; + + case DestroyNotify: + return xevent->xdestroywindow.window; + + case MapNotify: + return xevent->xmap.window; + + case UnmapNotify: + return xevent->xunmap.window; + + case ReparentNotify: + return xevent->xreparent.window; + + case ConfigureNotify: + return xevent->xconfigure.window; + + case CirculateNotify: + return xevent->xcirculate.window; + + case PropertyNotify: + return xevent->xproperty.window; + + case FocusIn: + case FocusOut: + return xevent->xfocus.window; + + default: + return xevent->xany.window; + + } +} + + +/* + *----------------------------------------------------------------------------- + * + * UnityPlatformUpdateEventTimeDiff -- + * + * Updates our idea of the difference between X server time and our local time. + * + * Results: + * None. + * + * Side effects: + * Updated event time diff. + * + *----------------------------------------------------------------------------- + */ + +static void +UnityPlatformUpdateEventTimeDiff(UnityPlatform *up, // IN + const XEvent *xevent) // IN +{ + Time serverTime; + Time localTime; + struct timeval localTv; + + switch (xevent->type) { + case KeyPress: + case KeyRelease: + serverTime = xevent->xkey.time; + break; + case ButtonPress: + case ButtonRelease: + serverTime = xevent->xbutton.time; + break; + case MotionNotify: + serverTime = xevent->xmotion.time; + break; + case EnterNotify: + case LeaveNotify: + serverTime = xevent->xcrossing.time; + break; + case PropertyNotify: + serverTime = xevent->xproperty.time; + break; + case SelectionClear: + serverTime = xevent->xselectionclear.time; + break; + case SelectionRequest: + serverTime = xevent->xselectionrequest.time; + break; + case SelectionNotify: + serverTime = xevent->xselection.time; + break; + + default: + return; + } + + gettimeofday(&localTv, NULL); + localTime = (localTv.tv_sec * 1000) + (localTv.tv_usec / 1000); // Convert to ms + up->eventTimeDiff = serverTime - localTime; +} + + +/* + *----------------------------------------------------------------------------- + * + * UnityPlatformProcessXEvent -- + * + * Processes an incoming X event. + * + * Results: + * None. + * + * Side effects: + * May create or destroy UnityPlatformWindow objects. + * + *----------------------------------------------------------------------------- + */ + +static void +UnityPlatformProcessXEvent(UnityPlatform *up, // IN + const XEvent *xevent, // IN + Window realEventWindow) // IN +{ + UnityPlatformWindow *upw = NULL; + const char *eventName; + + ASSERT(up); + ASSERT(xevent); + + UnityPlatformUpdateEventTimeDiff(up, xevent); + + eventName = UnityPlatformGetEventString(up, xevent->type); + upw = UPWindow_Lookup(up, realEventWindow); + if (!upw) { + UnitySpecialWindow *usw = USWindowLookup(up, realEventWindow); + if (usw) { + if (usw->evHandler) { + usw->evHandler(up, usw, xevent, realEventWindow); + } + + return; + } else if (xevent->type == CreateNotify) { + /* + * It may be a new window that we don't know about yet. Let's create an object + * to track it. + */ + upw = UPWindow_Create(up, realEventWindow); + if (upw) { + UPWindow_CheckRelevance(up, upw, NULL); + } else { + Debug("UnityX11ThreadProcessEvent BOMBED:" + " %s on window %#lx (reported to %#lx)\n", + eventName, realEventWindow, xevent->xany.window); + } + } else { + /* + * If we use them on non-CreateNotify events, the above lines of code wind up + * trying to create objects for crazy windows that don't exist... + */ + Debug("Ignoring %s event on unknown window %#lx (reported to %#lx)\n", + eventName, realEventWindow, xevent->xany.window); + } + } + + if (upw) { + UPWindow_ProcessEvent(up, upw, realEventWindow, xevent); + } +} + + +/* + *----------------------------------------------------------------------------- + * + * UnityPlatformIsRootWindow -- + * + * Checks whether a given window ID is the root window. Necessary because each + * screen has a separate root window, which makes checking a little more complicated + * than ==. + * + * Results: + * TRUE if the given window is a root window, FALSE otherwise. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +Bool +UnityPlatformIsRootWindow(UnityPlatform *up, // IN + Window window) // IN +{ + ASSERT(up); + + return (USWindowLookup(up, window) == up->rootWindows); +} + + +/* + *----------------------------------------------------------------------------- + * + * UnityX11SetCurrentDesktop -- + * + * Sets the active virtual desktop. + * + * Results: + * None. + * + * Side effects: + * Changes the virtual desktop. + * + *----------------------------------------------------------------------------- + */ + +void +UnityX11SetCurrentDesktop(UnityPlatform *up, // IN + uint32 currentDesktop) // IN: guest-side desktop ID +{ + Atom data[5] = {0,0,0,0,0}; + + ASSERT(up); + ASSERT(up->rootWindows->windows); + + up->desktopInfo.currentDesktop = currentDesktop; + data[0] = currentDesktop; + data[1] = UnityPlatformGetServerTime(up); + UnityPlatformSendClientMessage(up, + up->rootWindows->windows[0], + up->rootWindows->windows[0], + up->atoms._NET_CURRENT_DESKTOP, + 32, 5, data); +} + + +/* + *----------------------------------------------------------------------------- + * + * UnityX11GetCurrentDesktop -- + * + * Gets the active virtual desktop. + * + * Results: + * The active virtual desktop. If it cannot be retrieved for any reason, a + * reasonable default of '0' will be returned. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +uint32 +UnityX11GetCurrentDesktop(UnityPlatform *up) // IN +{ + Atom propertyType; + int propertyFormat; + unsigned long itemsReturned; + unsigned long bytesRemaining; + Atom *valueReturned; + uint32 currentDesktop; + + ASSERT(up); + ASSERT(up->rootWindows); + + if (XGetWindowProperty(up->display, up->rootWindows->windows[0], + up->atoms._NET_CURRENT_DESKTOP, 0, + 1024, False, AnyPropertyType, + &propertyType, &propertyFormat, &itemsReturned, + &bytesRemaining, (unsigned char **)&valueReturned) + == Success + && propertyType == XA_CARDINAL + && propertyFormat == 32) { + ASSERT(itemsReturned == 1); + + currentDesktop = valueReturned[0]; + } else { + currentDesktop = 0; + } + XFree(valueReturned); + + return currentDesktop; +} + + +/* + *----------------------------------------------------------------------------- + * + * USRootWindowsUpdateCurrentDesktop -- + * + * Looks at the root window to figure out the current desktop + * + * Results: + * None. + * + * Side effects: + * Updates UnityWindowTracker. + * + *----------------------------------------------------------------------------- + */ + +static void +USRootWindowsUpdateCurrentDesktop(UnityPlatform *up, // IN + UnitySpecialWindow *usw, // IN + Window window) // IN +{ + uint32 currentDesktop; + UnityDesktopId unityDesktop; + + /* + * XXX right now this is going to break if there are multiple screens in the guest, + * since each one can have an independant 'current' desktop... + */ + + ASSERT(up); + currentDesktop = UnityX11GetCurrentDesktop(up); + + if (currentDesktop >= up->desktopInfo.numDesktops) { + Warning("Active desktop is out of range for some strange reason\n"); + currentDesktop = 0; + } + + unityDesktop = up->desktopInfo.guestDesktopToUnity[currentDesktop]; + Debug("%s: currentDesktop %u, unityDesktop %u\n", __func__, currentDesktop, unityDesktop); + UnityWindowTracker_ChangeActiveDesktop(up->tracker, unityDesktop); +} + + +/* + *----------------------------------------------------------------------------- + * + * USRootWindowsProcessEvent -- + * + * Processes an event that occurred on one of the root windows. + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static void +USRootWindowsProcessEvent(UnityPlatform *up, // IN + UnitySpecialWindow *usw, // IN + const XEvent *xevent, // IN + Window window) // IN +{ + + /* + * XXX Do we need to handle situations where the root window changes size? Any other + * properties? + */ + switch (xevent->type) { + case PropertyNotify: + if (xevent->xproperty.atom == up->atoms._NET_CURRENT_DESKTOP) { + USRootWindowsUpdateCurrentDesktop(up, usw, window); + } else if (xevent->xproperty.atom == up->atoms._NET_NUMBER_OF_DESKTOPS) { + size_t numDesktops; + + numDesktops = UnityPlatformGetNumVirtualDesktops(up); + if (numDesktops != up->desktopInfo.numDesktops) { + UnityPlatformSyncDesktopConfig(up); + } + } else if (xevent->xproperty.atom == up->atoms._NET_DESKTOP_LAYOUT) { + Atom layoutData[4]; + + UnityPlatformGetVirtualDesktopLayout(up, layoutData); + if (memcmp(layoutData, up->desktopInfo.layoutData, sizeof layoutData) != 0) { + UnityPlatformSyncDesktopConfig(up); + } + } + break; + } +} + + +/* + *----------------------------------------------------------------------------- + * + * UnityPlatformWMProtocolSupported -- + * + * Returns whether the window manager supports a particular protocol. + * + * Results: + * TRUE if the protocol is supported, FALSE otherwise. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +Bool +UnityPlatformWMProtocolSupported(UnityPlatform *up, // IN + UnityX11WMProtocol proto) // IN +{ + ASSERT(up); + ASSERT(proto < UNITY_X11_MAX_WM_PROTOCOLS); + + return up->wmProtocols[proto]; +} + + +/* + *----------------------------------------------------------------------------- + * + * UnityPlatformDumpUpdate -- + * + * Prints a Unity update via debug output... + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +void +UnityPlatformDumpUpdate(UnityPlatform *up) // IN +{ + int i, len; + char *buf; + + return; + + len = up->updateData.updates.size; + buf = alloca(len + 1); + memcpy(buf, up->updateData.updates.data, len); + buf[len] = '\0'; + for (i = 0 ; i < len; i++) { + if (buf[i] == '\0') { + buf[i] = '!'; + } + } + + Debug("Sending update: %s\n", buf); +} + + +/* + *---------------------------------------------------------------------------- + * + * UnityPlatformSendClientMessageFull -- + * + * Sends an XSendEvent. + * + * Results: + * + * Side effects: + * + *---------------------------------------------------------------------------- + */ + + +static void +UnityPlatformSendClientMessageFull(Display *d, // IN + Window destWindow, // IN: Window to send msg to + Window w, // IN: What the msg's "To:" + // header should be, so to speak. + Atom messageType, // IN + int format, // IN + int numItems, // IN + const void *data) // IN +{ + XClientMessageEvent ev; + int i; + + memset(&ev, 0, sizeof ev); + ev.type = ClientMessage; + ev.window = w; + ev.message_type = messageType; + ev.format = format; + switch (format) { + case 8: + ASSERT(numItems <= ARRAYSIZE(ev.data.b)); + for (i = 0; i < numItems; i++) { + const char *datab = data; + ev.data.b[i] = datab[i]; + } + break; + case 16: + ASSERT(numItems <= ARRAYSIZE(ev.data.s)); + for (i = 0; i < numItems; i++) { + const short *datas = data; + ev.data.s[i] = datas[i]; + } + break; + case 32: + ASSERT(numItems <= ARRAYSIZE(ev.data.l)); + for (i = 0; i < numItems; i++) { + const Atom *datal = data; + ev.data.l[i] = datal[i]; + } + break; + } + if (! XSendEvent(d, destWindow, False, + PropertyChangeMask|SubstructureRedirectMask|SubstructureNotifyMask, (XEvent *)&ev)) { + Debug("XSendEvent failed\n"); + } +} + +/* + *----------------------------------------------------------------------------- + * + * UnityPlatformSendClientMessage -- + * + * Sends an XClientMessageEvent (such as one of the _NET_WM messages) + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +void +UnityPlatformSendClientMessage(UnityPlatform *up, // IN + Window destWindow, // IN: Window to actually send msg to + Window w, // IN: What the msg's "To:" header + // should be, so to speak. + Atom messageType, // IN + int format, // IN + int numItems, // IN + const void *data) // IN +{ + UnityPlatformSendClientMessageFull(up->display, destWindow, w, messageType, + format, numItems, data); +} + + +/***************************************************************************** + * Misc Unity RPCs that need to be handled * + *****************************************************************************/ + + +/* + *---------------------------------------------------------------------------- + * + * UnityPlatformSetTopWindowGroup -- + * + * Set the group of windows on top of all others. + * + * Results: + * TRUE if success, + * FALSE otherwise. + * + * Side effects: + * None + * + *---------------------------------------------------------------------------- + */ + +Bool +UnityPlatformSetTopWindowGroup(UnityPlatform *up, // IN: Platform data + UnityWindowId *windows, // IN: array of window ids + unsigned int windowCount) // IN: # of windows in the array +{ + UnityPlatformWindow *upw; + UnityPlatformWindow *prevupw = NULL; + Atom data[5] = {0,0,0,0,0}; + XWindowChanges winch; + int i; + + ASSERT(up); + ASSERT(windows); + ASSERT(windowCount); + + /* + * Restack everything top to bottom. + */ + data[0] = 2; // Magic source indicator to give full control + winch.stack_mode = data[2] = Above; // First window will go at the top of everything + for (i = 0; i < windowCount; i++) { + unsigned int valueMask = CWStackMode; + Window curWindow; + + upw = UPWindow_Lookup(up, windows[i]); + if (!upw) { + continue; + } + + curWindow = upw->clientWindow ? upw->clientWindow : upw->toplevelWindow; + UPWindow_SetUserTime(up, upw); + + if (i == 0) { + if (UnityPlatformWMProtocolSupported(up, UNITY_X11_WM__NET_ACTIVE_WINDOW)) { + uint32 activeData[5] = {0,0,0,0,0}; + Window focusWindow; + int revertState; + + XGetInputFocus(up->display, &focusWindow, &revertState); + activeData[0] = 2; // Source indicator + activeData[1] = UnityPlatformGetServerTime(up); + activeData[2] = focusWindow; + UnityPlatformSendClientMessage(up, up->rootWindows->windows[0], + curWindow, up->atoms._NET_ACTIVE_WINDOW, + 32, 5, data); + } else { + XSetInputFocus(up->display, curWindow, RevertToParent, + UnityPlatformGetServerTime(up)); + } + } + + if (prevupw) { + valueMask |= CWSibling; + if (prevupw->clientWindow) { + winch.sibling = data[1] = prevupw->clientWindow; + } else { + winch.sibling = data[1] = prevupw->toplevelWindow; + } + } else { + winch.sibling = data[1] = None; + } + + if (UnityPlatformWMProtocolSupported(up, UNITY_X11_WM__NET_RESTACK_WINDOW)) { + UnityPlatformSendClientMessage(up, up->rootWindows->windows[0], + curWindow, + up->atoms._NET_RESTACK_WINDOW, + 32, 5, data); + } else { + XReconfigureWMWindow(up->display, + curWindow, + 0, valueMask, &winch); + } + + prevupw = upw; + data[2] = Below; // We want all other windows stacked below the new top window + winch.stack_mode = Below; + } + + return TRUE; +} + + +/* + *----------------------------------------------------------------------------- + * + * UnityPlatformDnDSendClientMessage -- + * + * XXX This is a hack because UnityPlatformSendClientMessage doesn't work + * for dnd windows. + * Sends an XClientMessageEvent (such as one of the _NET_WM messages) + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static void +UnityPlatformDnDSendClientMessage(UnityPlatform *up, // IN + Window destWindow, // IN: Window to send msg to + Window w, // IN: What the msg's "To:" + // header should be, so to speak. + Atom messageType, // IN + int format, // IN + int numItems, // IN + const void *data) // IN +{ + UnityPlatformSendClientMessageFull(GDK_DISPLAY(), destWindow, w, + messageType, format, numItems, data); +} + + +/* + *---------------------------------------------------------------------------- + * + * UnityPlatformStackDnDDetWnd -- + * + * Updates the stacking order of the dnd detection window. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +static void +UnityPlatformStackDnDDetWnd(UnityPlatform *up) +{ + static const Atom onDesktop[] = { 0xFFFFFFFF, 0, 0, 0, 0 }; + + if (!up->desktopWindow) { + Debug("Desktop Window not cached. Tracker isn't populated.\n"); + return; + } + + /* Show the window on every desktop. */ + UnityPlatformDnDSendClientMessage(up, + up->rootWindows->windows[0], + GDK_WINDOW_XWINDOW(up->dnd.detWnd->window), + up->atoms._NET_WM_DESKTOP, + 32, 5, onDesktop); + + if (up->desktopWindow) { + XWindowChanges ch; + XSetWindowAttributes sa; + Window desktop = up->desktopWindow->toplevelWindow; + + /* Prevent the window manager from managing our detection window. */ + sa.override_redirect = True; + XChangeWindowAttributes(GDK_DISPLAY(), + GDK_WINDOW_XWINDOW(up->dnd.detWnd->window), + CWOverrideRedirect, &sa); + + /* Resize and restack the detection window. */ + ch.x = 0; + ch.y = 0; + ch.width = 65535; + ch.height = 65535; + ch.sibling = desktop; + ch.stack_mode = Above; + + XConfigureWindow(GDK_DISPLAY(), GDK_WINDOW_XWINDOW(up->dnd.detWnd->window), + CWX|CWY|CWWidth|CWHeight|CWStackMode | CWSibling, &ch); + + Debug("Restacking dnd detection window.\n"); + } else { + /* + * Attempt to rely on window manager if we cannot find a window to stack + * above. + */ + Atom position[] = { _NET_WM_STATE_ADD, + up->atoms._NET_WM_STATE_STICKY, + up->atoms._NET_WM_STATE_BELOW, 0, 0 }; + + Debug("Unable to locate desktop window to restack detection window above.\n"); + UnityPlatformDnDSendClientMessage(up, + up->rootWindows->windows[0], + GDK_WINDOW_XWINDOW(up->dnd.detWnd->window), + up->atoms._NET_WM_STATE, + 32, 5, position); + XMoveResizeWindow(GDK_DISPLAY(), + GDK_WINDOW_XWINDOW(up->dnd.detWnd->window), + 0, 0, 65535, 65535); + } +} + + +/* + *------------------------------------------------------------------------------ + * + * UnityPlatformUpdateDnDDetWnd -- + * + * Shows/hides a full-screen drag detection wnd for unity guest->host DnD. + * + * Results: + * None. + * + * Side effects: + * None. + * + *------------------------------------------------------------------------------ + */ + +void +UnityPlatformUpdateDnDDetWnd(UnityPlatform *up, // IN + Bool show) // IN +{ + + if (!up || !up->dnd.setMode || !up->dnd.detWnd) { + /* + * This function may potentially be called during UnityPlatform destruction. + */ + return; + } + + if (show) { + gtk_widget_show(up->dnd.detWnd); + UnityPlatformStackDnDDetWnd(up); + Debug("Showing dnd detection window.\n"); + } else { + gtk_widget_hide(up->dnd.detWnd); + Debug("Hiding dnd detection window.\n"); + } + + up->dnd.setMode(show); +} + + +/* + *------------------------------------------------------------------------------ + * + * UnityPlatformSetActiveDnDDetWnd -- + * + * Set current full-screen drag detection wnd. The caller retains ownership + * of the data. The caller is responsible for updating the active dnd det + * wnd. + * + * Results: + * None. + * + * Side effects: + * None. + * + *------------------------------------------------------------------------------ + */ + +void +UnityPlatformSetActiveDnDDetWnd(UnityPlatform *up, // IN + UnityDnD *data) // IN +{ + up->dnd = *data; +} + + +/* + *------------------------------------------------------------------------------ + * + * UnityPlatformSetDesktopWorkAreas -- + * + * Sets the work areas for all screens. + * + * Results: + * None. + * + * Side effects: + * None. + * + *------------------------------------------------------------------------------ + */ + +Bool +UnityPlatformSetDesktopWorkAreas(UnityPlatform *up, // IN + UnityRect workAreas[], // IN + uint32 numWorkAreas) // IN +{ + int i; + XineramaScreenInfo *screenInfo = NULL; + int numScreens; + RegionPtr bigDaddyRegion; + RegionPtr screenRegion; + RegionPtr workAreasRegion; + xRectangle *screenRects; + xRectangle *workAreaRects; + uint32 rootX; + uint32 rootY; + uint32 rootWidth; + uint32 rootHeight; + uint32 dummy; + Window winDummy; + BoxRec screenSize; + XID (*strutInfos)[12]; + int numStrutInfos; + + /* + * XXX TODO: rework this so that we create a Region with workAreas, and then figure + * out what struts we need to set to get that effect... That will also deal with the + * other bugs this code has. + */ + + if (!up->rootWindows) { + /* + * We're not in Unity mode yet. Save the info until we are. + */ + + up->needWorkAreas = Util_SafeMalloc(numWorkAreas * sizeof *up->needWorkAreas); + memcpy(up->needWorkAreas, workAreas, numWorkAreas * sizeof *up->needWorkAreas); + up->needNumWorkAreas = numWorkAreas; + return TRUE; + } + + if (!UnityPlatformWMProtocolSupported(up, UNITY_X11_WM__NET_WM_STRUT_PARTIAL)) { + Debug("Window manager does not support _NET_WM_STRUT_PARTIAL - not setting desktop work area.\n"); + return FALSE; + } + + ASSERT(up); + ASSERT(up->rootWindows); + + if (!XGetGeometry(up->display, up->rootWindows->windows[0], &winDummy, + &rootX, &rootY, &rootWidth, &rootHeight, + &dummy, &dummy)) { + return FALSE; + } + screenSize.x1 = rootX; + screenSize.y1 = rootY; + screenSize.x2 = rootX + rootWidth; + screenSize.y2 = rootY + rootHeight; + + if (XineramaQueryExtension(up->display, &i, &i)) { + screenInfo = XineramaQueryScreens(up->display, &numScreens); + } + if (!screenInfo) { + if (numWorkAreas > 1) { + Debug("Xinerama extension not present, or XineramaQueryScreens failed," + " but multiple work areas were requested.\n"); + return FALSE; + } + + screenInfo = Util_SafeCalloc(1, sizeof *screenInfo); + numScreens = 1; + + screenInfo->x_org = rootX; + screenInfo->y_org = rootY; + screenInfo->width = rootWidth; + screenInfo->height = rootHeight; + } + + screenRects = alloca(numScreens * sizeof *screenRects); + for (i = 0; i < numScreens; i++) { + screenRects[i].x = screenInfo[i].x_org; + screenRects[i].y = screenInfo[i].y_org; + screenRects[i].width = screenInfo[i].width; + screenRects[i].height = screenInfo[i].height; + screenRects[i].info.type = UpdateRect; + } + screenRegion = miRectsToRegion(numScreens, screenRects, 0); + + workAreaRects = alloca(numWorkAreas * sizeof *workAreaRects); + for (i = 0; i < numWorkAreas; i++) { + workAreaRects[i].x = workAreas[i].x; + workAreaRects[i].y = workAreas[i].y; + workAreaRects[i].width = workAreas[i].width; + workAreaRects[i].height = workAreas[i].height; + workAreaRects[i].info.type = UpdateRect; + } + workAreasRegion = miRectsToRegion(numWorkAreas, workAreaRects, 0); + + bigDaddyRegion = miRegionCreate(NULL, 0); + miSubtract(bigDaddyRegion, screenRegion, workAreasRegion); + miRegionDestroy(workAreasRegion); + miRegionDestroy(screenRegion); + + /* + * In order to deal with all the odd possibilities for workarea setups, we make a + * Region that includes all the space taken up by the struts, and then turn each of + * that region's rectangles into a separate strut. It's less efficient than packing + * the information into as few _NET_WM_STRUT_PARTIAL properties as possible, but it's + * simpler. + */ + strutInfos = alloca(REGION_NUM_RECTS(bigDaddyRegion) * sizeof *strutInfos); + memset(strutInfos, 0, REGION_NUM_RECTS(bigDaddyRegion) * sizeof *strutInfos); + numStrutInfos = 0; + for (i = 0; i < REGION_NUM_RECTS(bigDaddyRegion); i++) { + BoxPtr p = REGION_RECTS(bigDaddyRegion) + i; + int leftDiff; + int rightDiff; + int topDiff; + int bottomDiff; + + /* + * Because EWMH struts are currently assumed to be locked to an edge of the screen, + * this code hopes that finding the closest edge will work well enough. + * + * XXX This may produce results that are not 100% correct from a technical + * perspective, and fall apart in pathological cases, but it'll work well enough in + * typical usage, and is better than just ignoring multimon use cases. + */ + leftDiff = p->x1 - screenSize.x1; + topDiff = p->y1 - screenSize.y1; + rightDiff = screenSize.x2 - p->x2; + bottomDiff = screenSize.y2 - p->y2; + + if (topDiff <= leftDiff && topDiff <= rightDiff && topDiff <= bottomDiff) { + /* + * It's closest to the top side of the screen. + */ + strutInfos[numStrutInfos][2] = p->y2 - screenSize.y1; + strutInfos[numStrutInfos][8] = p->x1; + strutInfos[numStrutInfos][9] = p->x2; + } else if (bottomDiff <= leftDiff && bottomDiff <= rightDiff && bottomDiff <= topDiff) { + /* + * It's closest to the bottom side. + */ + strutInfos[numStrutInfos][3] = screenSize.y2 - p->y1; + strutInfos[numStrutInfos][10] = p->x1; + strutInfos[numStrutInfos][11] = p->x2; + } else if (leftDiff <= rightDiff && leftDiff <= topDiff && leftDiff <= bottomDiff) { + /* + * It's closest to the left side. + */ + strutInfos[numStrutInfos][0] = p->x2 - screenSize.x1; + strutInfos[numStrutInfos][4] = p->y1; + strutInfos[numStrutInfos][5] = p->y2; + } else { + /* + * Assume it's along the right hand side. + */ + strutInfos[numStrutInfos][1] = screenSize.x2 - p->x1; + strutInfos[numStrutInfos][6] = p->y1; + strutInfos[numStrutInfos][7] = p->y2; + } + + numStrutInfos++; + } + + /* + * The first step is making sure we have enough windows in existence to list the + * _NET_WM_STRUT_PARTIAL properties for each screen. + */ + if (!up->workAreas + || up->workAreas->numWindows != numStrutInfos) { + Window *newWinList; + + newWinList = Util_SafeCalloc(numStrutInfos, sizeof *newWinList); + if (up->workAreas) { + memcpy(newWinList, up->workAreas->windows, + MIN(numStrutInfos, up->workAreas->numWindows) * sizeof *newWinList); + } + + /* + * Destroy unneeded windows + */ + for (i = numStrutInfos; i < (up->workAreas ? up->workAreas->numWindows : 0); i++) { + XDestroyWindow(up->display, up->workAreas->windows[i]); + } + + /* + * Create additional windows as needed. + */ + for (i = up->workAreas ? up->workAreas->numWindows : 0; i < numStrutInfos; i++) { + static const char strutWindowName[] = "vmware-user workarea struts"; + Atom allDesktops = -1; + newWinList[i] = XCreateWindow(up->display, up->rootWindows->windows[0], + -50, -50, 1, 1, 0, CopyFromParent, InputOnly, + CopyFromParent, 0, NULL); + XChangeProperty(up->display, newWinList[i], up->atoms._NET_WM_WINDOW_TYPE, + XA_ATOM, 32, PropModeReplace, + (unsigned char *)&up->atoms._NET_WM_WINDOW_TYPE_DOCK, 1); + XChangeProperty(up->display, newWinList[i], up->atoms._NET_WM_DESKTOP, + XA_CARDINAL, 32, PropModeReplace, + (unsigned char *)&allDesktops, 1); + XStoreName(up->display, newWinList[i], strutWindowName); + XMapWindow(up->display, newWinList[i]); + } + + if (up->workAreas) { + USWindowUpdate(up, up->workAreas, newWinList, numStrutInfos); + } else { + up->workAreas = USWindowCreate(up, NULL, newWinList, numStrutInfos); + up->workAreas->windowsAreOwned = TRUE; + } + } + + /* + * Now actually set the _NET_WM_STRUT_PARTIAL property on our special 'struts' + * windows. + */ + for (i = 0; i < numStrutInfos; i++) { + Window strutWindow; + + strutWindow = up->workAreas->windows[i]; + + XChangeProperty(up->display, strutWindow, up->atoms._NET_WM_STRUT_PARTIAL, XA_CARDINAL, + 32, PropModeReplace, (unsigned char *)strutInfos[i], ARRAYSIZE(strutInfos[i])); + } + + free(screenInfo); + + return TRUE; +} + + +/* + *----------------------------------------------------------------------------- + * + * UnityPlatformGetNumVirtualDesktops -- + * + * Retrieves the number of virtual desktops currently set in the guest. + * + * Results: + * Number of desktops. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +size_t +UnityPlatformGetNumVirtualDesktops(UnityPlatform *up) // IN +{ + Atom propertyType; + int propertyFormat; + unsigned long itemsReturned; + unsigned long bytesRemaining; + Atom *valueReturned; + size_t retval; + + ASSERT(up); + if (XGetWindowProperty(up->display, up->rootWindows->windows[0], + up->atoms._NET_NUMBER_OF_DESKTOPS, 0, + 1024, False, AnyPropertyType, + &propertyType, &propertyFormat, &itemsReturned, + &bytesRemaining, (unsigned char **)&valueReturned) + == Success + && propertyType == XA_CARDINAL + && propertyFormat == 32) { + ASSERT(itemsReturned == 1); + + retval = valueReturned[0]; + } else { + retval = 1; + } + XFree(valueReturned); + + return retval; +} + + +/* + *----------------------------------------------------------------------------- + * + * UnityPlatformGetVirtualDesktopLayout -- + * + * Retrieves the guest's current virtual desktop layout info, and stores it in + * 'layoutData' (an array of 4 Atoms). + * + * Results: + * Desktop layout stored in 'layoutData' + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +void +UnityPlatformGetVirtualDesktopLayout(UnityPlatform *up, // IN + Atom *layoutData) // OUT +{ + Atom propertyType; + int propertyFormat; + unsigned long itemsReturned; + unsigned long bytesRemaining; + Atom *valueReturned; + + ASSERT(up); + + layoutData[3] = _NET_WM_TOPLEFT; + if (XGetWindowProperty(up->display, up->rootWindows->windows[0], + up->atoms._NET_DESKTOP_LAYOUT, 0, + 1024, False, AnyPropertyType, + &propertyType, &propertyFormat, &itemsReturned, + &bytesRemaining, (unsigned char **)&valueReturned) + == Success + && propertyType == XA_CARDINAL + && propertyFormat == 32) { + ASSERT(itemsReturned == 3 || itemsReturned == 4); + + memcpy(layoutData, + valueReturned, + itemsReturned * sizeof *valueReturned); + } else { + layoutData[0] = _NET_WM_ORIENTATION_HORZ; + layoutData[1] = 0; + layoutData[2] = 1; + } + XFree(valueReturned); +} + + +/* + *----------------------------------------------------------------------------- + * + * UnityPlatformSyncDesktopConfig -- + * + * This routine takes the virtual desktop configuration stored in UnityPlatform and + * makes sure that the guest's actual virtual desktop configuration matches. This is + * done in three situations: + * 1. Updating the guest's virtual desktop config to match the host's, right after + * the host's virtual desktop config has changed. + * 2. Forcing the guest's virtual desktop config back to the host's, right after + * the user uses the guest's pager to alter the guest virtual desktop config. + * 3. Restoring the guest's virtual desktop configuration when exiting Unity mode. + * + * Results: + * None. + * + * Side effects: + * Guest windows may jump to different virtual desktops if desktops are removed. + * + *----------------------------------------------------------------------------- + */ + +void +UnityPlatformSyncDesktopConfig(UnityPlatform *up) // IN +{ + Atom data[5] = {0, 0, 0, 0, 0}; + + ASSERT(up); + + if (!up->rootWindows || !up->display) { + return; // This function might be called while not in Unity mode + } + + data[0] = up->desktopInfo.numDesktops; + UnityPlatformSendClientMessage(up, + up->rootWindows->windows[0], + up->rootWindows->windows[0], + up->atoms._NET_NUMBER_OF_DESKTOPS, + 32, 5, + data); + XChangeProperty(up->display, up->rootWindows->windows[0], + up->atoms._NET_DESKTOP_LAYOUT, XA_CARDINAL, + 32, PropModeReplace, (unsigned char *)up->desktopInfo.layoutData, 4); +} + + +/* + *------------------------------------------------------------------------------ + * + * UnityPlatformSetDesktopConfig -- + * + * Set the virtual desktop configuration as specified by the host. + * + * Results: + * Returns TRUE if successful, and FALSE otherwise. + * + * Side effects: + * None. + * + *------------------------------------------------------------------------------ + */ + +Bool +UnityPlatformSetDesktopConfig(UnityPlatform *up, // IN + const UnityVirtualDesktopArray *desktopConfig) // IN +{ + int i; + int x; + int y; + UnityVirtualDesktop minDesktop; + UnityVirtualDesktop maxDesktop; + UnityVirtualDesktop desktopSpread; + int unityDesktopLayout[MAX_VIRT_DESK][MAX_VIRT_DESK]; + int guestDesktopLayout[MAX_VIRT_DESK][MAX_VIRT_DESK]; + + ASSERT(up); + ASSERT(desktopConfig); + ASSERT(desktopConfig->desktopCount >= 1); + + /* + * This long section of code mainly exists to verify that the host's virtual desktop + * setup can be represented on our end, and to figure out how best to do it. We could + * do this simply, if we didn't have to deal with the possibility of having 5 virtual + * desktops in a 3x2 layout, which is a very real possibility on Linux hosts... + */ + memset(unityDesktopLayout, 0xFF, sizeof unityDesktopLayout); // Set all entries to -1 + minDesktop = desktopConfig->desktops[0]; + maxDesktop = minDesktop; + for (i = 1; i < desktopConfig->desktopCount; i++) { + if (desktopConfig->desktops[i].x < minDesktop.x) { + minDesktop.x = desktopConfig->desktops[i].x; + } + if (desktopConfig->desktops[i].y < minDesktop.y) { + minDesktop.y = desktopConfig->desktops[i].y; + } + if (desktopConfig->desktops[i].x > maxDesktop.x) { + maxDesktop.x = desktopConfig->desktops[i].x; + } + if (desktopConfig->desktops[i].y > maxDesktop.y) { + maxDesktop.y = desktopConfig->desktops[i].y; + } + } + desktopSpread.x = maxDesktop.x - minDesktop.x; + desktopSpread.y = maxDesktop.y - minDesktop.y; + + for (i = 0; i < desktopConfig->desktopCount; i++) { + int32 localX = desktopConfig->desktops[i].x - minDesktop.x; + int32 localY = desktopConfig->desktops[i].y - minDesktop.y; + + if (localY >= MAX_VIRT_DESK || localX >= MAX_VIRT_DESK) { + Warning("Unity virtual desktop layout has holes that are too big to handle\n"); + return FALSE; + } + + unityDesktopLayout[localX][localY] = i; + } + + for (x = 0; x < desktopSpread.x; x++) { + for (y = 0; y < desktopSpread.y; y++) { + if (unityDesktopLayout[x][y] < 0) { + Warning("Unity virtual desktop layout has holes that we can't handle.\n"); + return FALSE; + } + } + } + + /* + * Check along the left edge to make sure that there aren't any gaps between virtual + * desktops. + */ + for (x = desktopSpread.x, y = 0; y <= desktopSpread.y; y++) { + if (unityDesktopLayout[x][y] < 0) { + break; + } + } + for (; y <= desktopSpread.y; y++) { + if (unityDesktopLayout[x][y] >= 0) { + Warning("Unity virtual desktop layout has holes along the right edge.\n"); + return FALSE; + } + } + + /* + * Check along the bottom edge to make sure that there aren't any gaps between virtual + * desktops. + */ + for (y = desktopSpread.y, x = 0; x <= desktopSpread.x; x++) { + if (unityDesktopLayout[x][y] < 0) { + break; + } + } + for (; x <= desktopSpread.x; x++) { + if (unityDesktopLayout[x][y] >= 0) { + Warning("Unity virtual desktop layout has holes along the bottom edge.\n"); + return FALSE; + } + } + + /* + * Now we know we have a workable virtual desktop layout - let's figure out how to + * communicate it to the window manager & pager. + */ + up->desktopInfo.layoutData[0] = _NET_WM_ORIENTATION_HORZ; // Orientation + up->desktopInfo.layoutData[1] = (desktopSpread.x + 1); // # of columns + up->desktopInfo.layoutData[2] = (desktopSpread.y + 1); // # of rows + up->desktopInfo.layoutData[3] = _NET_WM_TOPLEFT; // Starting corner + + if (((desktopSpread.x + 1) * (desktopSpread.y + 1)) >= desktopConfig->desktopCount + && desktopSpread.x > 0 + && desktopSpread.y > 1 + && unityDesktopLayout[desktopSpread.x][desktopSpread.y - 1] < 0) { + /* + * We know there is are least two holes at the end of the layout, /and/ the holes + * go up the right side, so therefore we need to use vertical orientation for the + * EWMH layout. + */ + up->desktopInfo.layoutData[0] = _NET_WM_ORIENTATION_VERT; + } + + /* + * Figure out what the guest-side desktop IDs will be, based on our chosen + * orientation. + */ + i = 0; + memset(guestDesktopLayout, 0xFF, sizeof guestDesktopLayout); // Set all entries to -1 + if (up->desktopInfo.layoutData[0] == _NET_WM_ORIENTATION_VERT) { + for (y = 0; y <= desktopSpread.y; y++) { + for (x = 0; x <= desktopSpread.x; x++) { + if (unityDesktopLayout[x][y] >= 0) { + guestDesktopLayout[x][y] = i++; + } + } + } + } else { + for (x = 0; x <= desktopSpread.x; x++) { + for (y = 0; y <= desktopSpread.y; y++) { + if (unityDesktopLayout[x][y] >= 0) { + guestDesktopLayout[x][y] = i++; + } + } + } + } + + up->desktopInfo.numDesktops = desktopConfig->desktopCount; + + /* + * Build tables to translate between guest-side and Unity-side desktop IDs. + */ + up->desktopInfo.guestDesktopToUnity = + Util_SafeRealloc(up->desktopInfo.guestDesktopToUnity, + up->desktopInfo.numDesktops + * sizeof up->desktopInfo.guestDesktopToUnity[0]); + up->desktopInfo.unityDesktopToGuest = + Util_SafeRealloc(up->desktopInfo.unityDesktopToGuest, + up->desktopInfo.numDesktops + * sizeof up->desktopInfo.unityDesktopToGuest[0]); + for (i = 0; i < up->desktopInfo.numDesktops; i++) { + int guestNum; + UnityVirtualDesktop curDesk = desktopConfig->desktops[i]; + + guestNum = guestDesktopLayout[curDesk.x - minDesktop.x][curDesk.y - minDesktop.y]; + up->desktopInfo.guestDesktopToUnity[guestNum] = i; + up->desktopInfo.unityDesktopToGuest[i] = guestNum; + } + + /* + * Make the configuration actually take effect. + */ + UnityPlatformSyncDesktopConfig(up); + + return TRUE; +} + + +/* + *------------------------------------------------------------------------------ + * + * UnityPlatformSetInitialDesktop -- + * + * Set a desktop specified by the desktop id as the initial state. + * + * Results: + * Returns TRUE if successful, and FALSE otherwise. + * + * Side effects: + * Some windows might be hidden and some shown. + * + *------------------------------------------------------------------------------ + */ + +Bool +UnityPlatformSetInitialDesktop(UnityPlatform *up, // IN + UnityDesktopId desktopId) // IN +{ + ASSERT(up); + up->desktopInfo.initialDesktop = desktopId; + return UnityPlatformSetDesktopActive(up, desktopId); +} + + +/* + *------------------------------------------------------------------------------ + * + * UnityPlatformSetDesktopActive -- + * + * Switch to the specified virtual desktop. The desktopId is an index + * into the desktop configuration array. + * + * Results: + * Returns TRUE if successful, and FALSE otherwise. + * + * Side effects: + * None. + * + *------------------------------------------------------------------------------ + */ + +Bool +UnityPlatformSetDesktopActive(UnityPlatform *up, // IN + UnityDesktopId desktopId) // IN +{ + ASSERT(up); + + if (desktopId >= up->desktopInfo.numDesktops) { + return FALSE; + } + + if (!up->rootWindows) { + /* + * We may not be into Unity mode yet, but we pretend it succeeded, and then do the + * switch later for real. + */ + return TRUE; + } + + UnityX11SetCurrentDesktop(up, up->desktopInfo.unityDesktopToGuest[desktopId]); + + return TRUE; +} diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/unity/unityPlatformX11Settings.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/unity/unityPlatformX11Settings.c --- open-vm-tools-2008.01.23-74039/lib/unity/unityPlatformX11Settings.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/unity/unityPlatformX11Settings.c 2008-10-13 08:01:51.000000000 +0100 @@ -0,0 +1,990 @@ +/********************************************************* + * Copyright (C) 2007-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. + * + *********************************************************/ + +/* + * unityPlatformX11Settings.c -- + * + * Handles saving and restoring various system settings that are needed for Unity to + * work well. + */ + +#include "unityX11.h" + +#if !defined(VM_HAVE_X11_SS_EXT) && !defined(USING_AUTOCONF) +#error "We're not building with the X11 ScreenSaver extension." +#endif + + +/* + *----------------------------------------------------------------------------- + * + * GetScreensaverActive -- + * + * Finds out whether the screensaver is currently enabled. + * + * Results: + * TRUE if successful, FALSE otherwise + * + * Side effects: + * Stores the current setting in *currentSetting + * + *----------------------------------------------------------------------------- + */ + +static Bool +GetScreensaverActive(UnityPlatform *up, // IN + Bool *currentSetting) // OUT +{ + int timeout; + int dummy; + + ASSERT(up); + ASSERT(currentSetting); + + *currentSetting = FALSE; + +#if defined(VM_HAVE_X11_SS_EXT) + { + int eventBase; + int errorBase; + if (XScreenSaverQueryExtension(up->display, &eventBase, &errorBase)) { + XScreenSaverInfo saverInfo; + + if (!XScreenSaverQueryInfo(up->display, + DefaultRootWindow(up->display), + &saverInfo)) { + return FALSE; + } + + *currentSetting = (saverInfo.state != ScreenSaverDisabled); + } + } +#endif + + timeout = -1; + XGetScreenSaver(up->display, &timeout, &dummy, &dummy, &dummy); + + if(timeout == -1) { + return FALSE; + } + + *currentSetting = *currentSetting || (timeout ? TRUE : FALSE); + return TRUE; +} + + +/* + *----------------------------------------------------------------------------- + * + * SetScreensaverActive -- + * + * Enables/disables the screensaver. + * + * Results: + * TRUE if successful, FALSE otherwise + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static Bool +SetScreensaverActive(UnityPlatform *up, // IN + Bool currentSetting) // IN +{ + int timeout = -1; // If XGetScreenSaver fails, use the default + int interval = 0; + int preferBlanking = DefaultBlanking; + int allowExposures = DefaultExposures; + char *xdgScreensaverPath; + + ASSERT(up); + + /* + * There are currently three ways to enable/disable the screensaver (in order of + * current preference): + * + * 1. The xdg-screensaver script that knows how to talk to the screensavers of most + * current desktops. + * 2. XScreenSaverSuspend, via the X screensaver extension. + * 3. XSetScreenSaver. + * + * Only the first one actually works on most systems, but the other two are there to + * catch corner cases on odd systems. + */ + + xdgScreensaverPath = g_find_program_in_path("xdg-screensaver"); + if (up->rootWindows && xdgScreensaverPath) { + char rootWindowID[64]; + char *argv[] = {xdgScreensaverPath, + currentSetting ? "resume" : "suspend", + rootWindowID, + NULL}; + + g_snprintf(rootWindowID, sizeof rootWindowID, "%#lx", up->rootWindows->windows[0]); + + g_spawn_sync("/", argv, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL); + } + g_free(xdgScreensaverPath); + +#if defined(VM_HAVE_X11_SS_EXT) + { + int eventBase; + int errorBase; + + if (!XScreenSaverQueryExtension(up->display, &eventBase, &errorBase)) { + return FALSE; + } + /* + * XScreenSaverSuspend is only available as of version 1.1 of the screensaver + * extension + */ +# if (ScreenSaverMajorVersion > 1 \ + || (ScreenSaverMajorVersion == 1 && ScreenSaverMinorVersion >= 1)) + { + int majorVersion; + int minorVersion; + + if (XScreenSaverQueryVersion(up->display, &majorVersion, &minorVersion) + && (majorVersion > 1 || (majorVersion == 1 && minorVersion >= 1))) { + + XScreenSaverSuspend(up->display, !currentSetting); + up->currentSettings[UNITY_UI_SCREENSAVER] = currentSetting; + } + } +# endif + + /* + * XXX TODO: On systems that don't have XScreenSaverSuspend, we could always monitor + * ScreenSaverNotify events, and send a ForceScreenSaver request (with value of Reset) + * whenever the screensaver comes on. + */ + } +#endif + + XGetScreenSaver(up->display, &timeout, &interval, &preferBlanking, &allowExposures); + + if (!currentSetting) { + up->savedScreenSaverTimeout = timeout; // Save the old timeout. + timeout = 0; // Disables the screensaver. + } else { + timeout = up->savedScreenSaverTimeout; + up->savedScreenSaverTimeout = -1; + } + + XSetScreenSaver(up->display, timeout, interval, preferBlanking, allowExposures); + + if (!currentSetting) { + /* + * Disable the screen saver if it's already active. + */ + XForceScreenSaver(up->display, ScreenSaverReset); + } + + return TRUE; +} + + +#ifdef VM_UNIMPLEMENTED_UNITY_SETTINGS + + +/* + *----------------------------------------------------------------------------- + * + * GetDropShadowActive -- + * + * Finds out whether drop shadows are currently enabled. + * + * Results: + * TRUE if successful, FALSE otherwise + * + * Side effects: + * Stores the current setting in *currentSetting + * + *----------------------------------------------------------------------------- + */ + +static Bool +GetDropShadowActive(UnityPlatform *up, // IN + Bool *currentSetting) // OUT +{ + ASSERT(up); + ASSERT(currentSetting); + + NOT_IMPLEMENTED(); + + return FALSE; +} + + +/* + *----------------------------------------------------------------------------- + * + * SetDropShadowActive -- + * + * Enables/disables drop shadows. + * + * Results: + * TRUE if successful, FALSE otherwise + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static Bool +SetDropShadowActive(UnityPlatform *up, // IN + Bool currentSetting) // IN +{ + ASSERT(up); + + up->currentSettings[UNITY_UI_DROP_SHADOW] = currentSetting; + + NOT_IMPLEMENTED(); + + return FALSE; +} + + +/* + *----------------------------------------------------------------------------- + * + * GetMenuAnimationActive -- + * + * Finds out whether menu animation is currently enabled. + * + * Results: + * TRUE if successful, FALSE otherwise + * + * Side effects: + * Stores the current setting in *currentSetting + * + *----------------------------------------------------------------------------- + */ + +static Bool +GetMenuAnimationActive(UnityPlatform *up, // IN + Bool *currentSetting) // OUT +{ + ASSERT(up); + ASSERT(currentSetting); + + NOT_IMPLEMENTED(); + + return FALSE; +} + + +/* + *----------------------------------------------------------------------------- + * + * SetMenuAnimationActive -- + * + * Enables/disables the screensaver. + * + * Results: + * TRUE if successful, FALSE otherwise + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static Bool +SetMenuAnimationActive(UnityPlatform *up, // IN + Bool currentSetting) // IN +{ + ASSERT(up); + + up->currentSettings[UNITY_UI_MENU_ANIMATION] = currentSetting; + + NOT_IMPLEMENTED(); + + return FALSE; +} + + +/* + *----------------------------------------------------------------------------- + * + * GetTooltipAnimationActive -- + * + * Finds out whether the screensaver is currently enabled. + * + * Results: + * TRUE if successful, FALSE otherwise + * + * Side effects: + * Stores the current setting in *currentSetting + * + *----------------------------------------------------------------------------- + */ + +static Bool +GetTooltipAnimationActive(UnityPlatform *up, // IN + Bool *currentSetting) // OUT +{ + ASSERT(up); + ASSERT(currentSetting); + + NOT_IMPLEMENTED(); + + return FALSE; +} + + +/* + *----------------------------------------------------------------------------- + * + * SetTooltipAnimationActive -- + * + * Enables/disables the screensaver. + * + * Results: + * TRUE if successful, FALSE otherwise + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static Bool +SetTooltipAnimationActive(UnityPlatform *up, // IN + Bool currentSetting) // IN +{ + ASSERT(up); + + up->currentSettings[UNITY_UI_TOOLTIP_ANIMATION] = currentSetting; + + NOT_IMPLEMENTED(); + + return FALSE; +} + + +/* + *----------------------------------------------------------------------------- + * + * GetWindowAnimationActive -- + * + * Finds out whether the screensaver is currently enabled. + * + * Results: + * TRUE if successful, FALSE otherwise + * + * Side effects: + * Stores the current setting in *currentSetting + * + *----------------------------------------------------------------------------- + */ + +static Bool +GetWindowAnimationActive(UnityPlatform *up, // IN + Bool *currentSetting) // OUT +{ + ASSERT(up); + ASSERT(currentSetting); + + NOT_IMPLEMENTED(); + + return FALSE; +} + + +/* + *----------------------------------------------------------------------------- + * + * SetWindowAnimationActive -- + * + * Enables/disables the screensaver. + * + * Results: + * TRUE if successful, FALSE otherwise + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static Bool +SetWindowAnimationActive(UnityPlatform *up, // IN + Bool currentSetting) // IN +{ + ASSERT(up); + + up->currentSettings[UNITY_UI_WINDOW_ANIMATION] = currentSetting; + + NOT_IMPLEMENTED(); + + return FALSE; +} + + +/* + *----------------------------------------------------------------------------- + * + * GetFullWindowDragActive -- + * + * Finds out whether the screensaver is currently enabled. + * + * Results: + * TRUE if successful, FALSE otherwise + * + * Side effects: + * Stores the current setting in *currentSetting + * + *----------------------------------------------------------------------------- + */ + +static Bool +GetFullWindowDragActive(UnityPlatform *up, // IN + Bool *currentSetting) // OUT +{ + ASSERT(up); + ASSERT(currentSetting); + + NOT_IMPLEMENTED(); + + return FALSE; +} + + +/* + *----------------------------------------------------------------------------- + * + * SetFullWindowDragActive -- + * + * Enables/disables the screensaver. + * + * Results: + * TRUE if successful, FALSE otherwise + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static Bool +SetFullWindowDragActive(UnityPlatform *up, // IN + Bool currentSetting) // IN +{ + ASSERT(up); + + up->currentSettings[UNITY_UI_FULL_WINDOW_DRAG] = currentSetting; + + NOT_IMPLEMENTED(); + + return FALSE; +} + + +#endif + + +/* + *----------------------------------------------------------------------------- + * + * GetTaskbarVisible -- + * + * Shows or hides the taskbar as appropriate. + * + * Results: + * TRUE if successful, FALSE otherwise. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static Bool +GetTaskbarVisible(UnityPlatform *up, // IN + Bool *currentSetting) // OUT +{ + UnityPlatformWindow **allWindows; + size_t i; + size_t numWindows; + + ASSERT(up); + ASSERT(currentSetting); + + numWindows = 0; + HashTable_ToArray(up->allWindows, + (void ***)&allWindows, + &numWindows); + + if (!numWindows) { + Debug("Couldn't find any listed windows for taskbar visibility detection.\n"); + return FALSE; // We haven't yet populated the window list for some reason + } + + /* + * Hunt through all the windows for ones that are of type DOCK. + */ + *currentSetting = FALSE; + for (i = 0; i < numWindows; i++) { + if (UNITY_WINDOW_TYPE_DOCK == allWindows[i]->windowType + && allWindows[i]->isViewable) { + *currentSetting = TRUE; + break; + } + } + + free(allWindows); + + return TRUE; +} + + +/* + *----------------------------------------------------------------------------- + * + * UnityPlatformSetTaskbarVisible -- + * + * Shows or hides the taskbar as appropriate. + * + * Results: + * TRUE if successful, FALSE otherwise. + * + * Side effects: + * Shows or hides task bar. + * + *----------------------------------------------------------------------------- + */ + +Bool +UnityPlatformSetTaskbarVisible(UnityPlatform *up, // IN + Bool currentSetting) // IN +{ + UnityPlatformWindow **allWindows; + size_t i; + size_t numWindows; + + ASSERT(up); + + up->needTaskbarSetting = FALSE; + + up->currentSettings[UNITY_UI_TASKBAR_VISIBLE] = currentSetting; + + numWindows = 0; + HashTable_ToArray(up->allWindows, + (void ***) &allWindows, + &numWindows); + + /* + * Hunt through all the windows for ones that are of type DOCK. + */ + for (i = 0; i < numWindows; i++) { + if (UNITY_WINDOW_TYPE_DOCK == allWindows[i]->windowType) { + Window dockWindow; + + dockWindow = allWindows[i]->clientWindow; + if (!dockWindow) { + dockWindow = allWindows[i]->toplevelWindow; + } + + if (currentSetting) { + XMapWindow(up->display, dockWindow); + } else { + XWithdrawWindow(up->display, dockWindow, 0); + } + + UPWindow_CheckRelevance(up, allWindows[i], NULL); + } + } + + free(allWindows); + + if (!numWindows) { + /* + * We need to repeat this call later. + */ + up->needTaskbarSetting = TRUE; + } + + return TRUE; +} + + +/* + *----------------------------------------------------------------------------- + * + * SaveVirtualDesktopSettings -- + * + * Saves the current virtual desktop configuration so it can be restored later on. + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +void +SaveVirtualDesktopSettings(UnityPlatform *up) // IN +{ + ASSERT(up); + + up->desktopInfo.savedNumDesktops = UnityPlatformGetNumVirtualDesktops(up); + UnityPlatformGetVirtualDesktopLayout(up, up->desktopInfo.savedLayoutData); + up->desktopInfo.savedCurrentDesktop = UnityX11GetCurrentDesktop(up); +} + + +/* + *----------------------------------------------------------------------------- + * + * RestoreVirtualDesktopSettings -- + * + * Restores the saved virtual desktop configuration. + * + * Results: + * None. + * + * Side effects: + * Guest's virtual desktop config may be changed. + * + *----------------------------------------------------------------------------- + */ + +void +RestoreVirtualDesktopSettings(UnityPlatform *up) // IN +{ + size_t tempDesktops; + ASSERT(up); + + memcpy(up->desktopInfo.layoutData, + up->desktopInfo.savedLayoutData, + sizeof up->desktopInfo.layoutData); + tempDesktops = up->desktopInfo.numDesktops; + up->desktopInfo.numDesktops = up->desktopInfo.savedNumDesktops; + UnityPlatformSyncDesktopConfig(up); + + /* + * ...because numDesktops also refers to the size of the guestDesktopToUnity and + * unityDesktopToGuest arrays. + */ + up->desktopInfo.numDesktops = tempDesktops; + + UnityX11SetCurrentDesktop(up, up->desktopInfo.savedCurrentDesktop); +} + + +/* + *----------------------------------------------------------------------------- + * + * UnityPlatformSaveSystemSettings -- + * + * Stub to make unity.c happy. This function is called at a very inconvenient time + * for the X11 port, so I just call its UnityX11 equivalent at the appropriate point + * in StartHelperThreads instead. + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +void +UnityPlatformSaveSystemSettings(UnityPlatform *up) // IN +{ +} + + +/* + *---------------------------------------------------------------------------- + * + * UnityX11SaveSystemSettings -- + * + * Save and disable certain system settings here: + * a. If a screen saver is enabled, disable it + * b. If animation for menus or tooltips is enabled, disable it + * c. If menu shading is enabled, disable it + * d. If full window drag is disabled, enable it + * e. If window animation is enabled, disable it + * f. Hide the task bar. + * + * Right now on X11, only the screensaver and task bar make any sense. + * + * Remember all the settings changed above in a bit mask, + * so we can restore them later when the user exits + * the Unity mode. + * + * Note, that the system ui changes made here will not + * persist after the system reboot. + * + * Results: + * None. + * + * Side effects: + * A bunch of system ui settings might be changed. + * + *---------------------------------------------------------------------------- + */ + +void +UnityX11SaveSystemSettings(UnityPlatform *up) // IN +{ + ASSERT(up); + + /* + * We only want to remember current settings if we do not have saved settings already. + * One of the reasons why we might have saved settings already is because we are + * re-entering unity without cleanly exiting it first (if the VM was suspended). In + * this case, theoretically, all the right settings are set already and + * up->originalSettings contains the original user settings that we do not want to + * overwrite. + */ + if (!up->haveOriginalSettings) { + Bool *originalSettings = up->originalSettings; + + memset(up->originalSettings, 0, sizeof up->originalSettings); + + if (!GetScreensaverActive(up, &originalSettings[UNITY_UI_SCREENSAVER])) { + originalSettings[UNITY_UI_SCREENSAVER] = TRUE; + } + +#ifdef VM_UNIMPLEMENTED_UNITY_SETTINGS + if (!GetDropShadowActive(up, &originalSettings[UNITY_UI_DROP_SHADOW])) { + originalSettings[UNITY_UI_DROP_SHADOW] = TRUE; + } + + if (!GetMenuAnimationActive(up, &originalSettings[UNITY_UI_MENU_ANIMATION])) { + originalSettings[UNITY_UI_MENU_ANIMATION] = TRUE; + } + + if (!GetTooltipAnimationActive(up, + &originalSettings[UNITY_UI_TOOLTIP_ANIMATION])) { + originalSettings[UNITY_UI_TOOLTIP_ANIMATION] = TRUE; + } + + if (!GetWindowAnimationActive(up, &originalSettings[UNITY_UI_WINDOW_ANIMATION])) { + originalSettings[UNITY_UI_WINDOW_ANIMATION] = TRUE; + } + + if (!GetFullWindowDragActive(up, &originalSettings[UNITY_UI_FULL_WINDOW_DRAG])) { + originalSettings[UNITY_UI_FULL_WINDOW_DRAG] = TRUE; + } +#endif + + if (!GetTaskbarVisible(up, &originalSettings[UNITY_UI_TASKBAR_VISIBLE])) { + originalSettings[UNITY_UI_TASKBAR_VISIBLE] = TRUE; + } + + SaveVirtualDesktopSettings(up); + + up->haveOriginalSettings = TRUE; + + memcpy(up->currentSettings, originalSettings, sizeof up->currentSettings); + } + + SetScreensaverActive(up, FALSE); +#ifdef VM_UNIMPLEMENTED_UNITY_SETTINGS + SetDropShadowActive(up, FALSE); + SetMenuAnimationActive(up, FALSE); + SetTooltipAnimationActive(up, FALSE); + SetWindowAnimationActive(up, FALSE); + SetFullWindowDragActive(up, FALSE); +#endif + + { + char *reply = NULL; + size_t replyLen; + Bool shouldBeVisible = FALSE; + + if (!RpcOut_sendOne(&reply, &replyLen, UNITY_RPC_VMX_SHOW_TASKBAR)) { + Debug("%s: could not get the VMX show taskbar setting, assuming FALSE\n", + __FUNCTION__); + } else { + uint32 value = 0; + + if (StrUtil_StrToUint(&value, reply)) { + shouldBeVisible = (value == 0) ? FALSE : TRUE; + } + } + + Debug("TASKBAR SHOULD BE VISIBLE: %d\n", shouldBeVisible); + + UnityPlatformSetTaskbarVisible(up, shouldBeVisible); + + free(reply); + } +} + + +/* + *----------------------------------------------------------------------------- + * + * UnityPlatformRestoreSystemSettings -- + * + * Stub to make unity.c happy. This function is called at a very inconvenient time + * for the X11 port, so I just call its UnityX11 equivalent at the appropriate point + * in KillHelperThreads instead. + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +void +UnityPlatformRestoreSystemSettings(UnityPlatform *up) // IN +{ +} + + +/* + *---------------------------------------------------------------------------- + * + * UnityX11RestoreSystemSettings -- + * + * Restore system ui settings to what they used to be + * before we entered unity mode. + * + * This includes: + * a. Enable screen saver if it was disabled + * b. Enable menu and tool tip animation if it was disabled + * c. Enable menu shading is enabled if it was disabled + * d. Disable full window drag is disabled if it was enabled + * e. Enable window animation if it was disabled + * f. Show the task bar if it was hidden + * + * Results: + * None. + * + * Side effects: + * A bunch of system ui settings might be changed. + * + *---------------------------------------------------------------------------- + */ + +void +UnityX11RestoreSystemSettings(UnityPlatform *up) // IN +{ + ASSERT(up); + + Debug("UnityPlatformRestoreSystemSettings\n"); + if (up->currentSettings[UNITY_UI_SCREENSAVER] + != up->originalSettings[UNITY_UI_SCREENSAVER]) { + SetScreensaverActive(up, up->originalSettings[UNITY_UI_SCREENSAVER]); + Debug("%s: Restored screen saver\n", __FUNCTION__); + } + +#ifdef VM_UNIMPLEMENTED_UNITY_SETTINGS + if (up->currentSettings[UNITY_UI_DROP_SHADOW] + != up->originalSettings[UNITY_UI_DROP_SHADOW]) { + SetDropShadowActive(up, up->originalSettings[UNITY_UI_DROP_SHADOW]); + Debug("%s: Restored drop shadows\n", __FUNCTION__); + } + + if (up->currentSettings[UNITY_UI_MENU_ANIMATION] + != up->originalSettings[UNITY_UI_MENU_ANIMATION]) { + SetMenuAnimationActive(up, up->originalSettings[UNITY_UI_MENU_ANIMATION]); + Debug("%s: Restored menu animation\n", __FUNCTION__); + } + + if (up->currentSettings[UNITY_UI_TOOLTIP_ANIMATION] + != up->originalSettings[UNITY_UI_TOOLTIP_ANIMATION]) { + SetTooltipAnimationActive(up, up->originalSettings[UNITY_UI_TOOLTIP_ANIMATION]); + Debug("%s: Restored tool tip animation\n", __FUNCTION__); + } + + if (up->currentSettings[UNITY_UI_WINDOW_ANIMATION] + != up->originalSettings[UNITY_UI_WINDOW_ANIMATION]) { + SetWindowAnimationActive(up, up->originalSettings[UNITY_UI_WINDOW_ANIMATION]); + Debug("%s: Restored window animation\n", __FUNCTION__); + } + + if (up->currentSettings[UNITY_UI_FULL_WINDOW_DRAG] + != up->originalSettings[UNITY_UI_FULL_WINDOW_DRAG]) { + SetFullWindowDragActive(up, up->originalSettings[UNITY_UI_FULL_WINDOW_DRAG]); + Debug("%s: Restored outline drag.\n", __FUNCTION__); + } +#endif + + if (up->currentSettings[UNITY_UI_TASKBAR_VISIBLE] + != up->originalSettings[UNITY_UI_TASKBAR_VISIBLE]) { + UnityPlatformSetTaskbarVisible(up, up->originalSettings[UNITY_UI_TASKBAR_VISIBLE]); + Debug("%s: Restored taskbar visibility.\n", __FUNCTION__); + } + + RestoreVirtualDesktopSettings(up); + + /* + * The user's settings have been restored, which means the originalSettings info will + * not be relevant next time we go into SaveSystemSettings(). + */ + up->haveOriginalSettings = FALSE; +} + + +/* + *---------------------------------------------------------------------------- + * + * UnityPlatformShowTaskbar -- + * + * Show/hide the taskbar while in Unity mode. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +void +UnityPlatformShowTaskbar(UnityPlatform *up, // IN + Bool showTaskbar) // IN +{ + ASSERT(up); + + /* + * If we are in Unity mode, we need to hide/show the taskbar. + * If the user asked to show the taskbar and the taskbar was previously hidden, + * we need to show the taskbar and readjust the work area. + * Other cases (when the taskbar is already shown and user wants to show it, + * for example), should theoretically never happen, but if they do, we just + * ignore them because there's not much we can do. + */ + + if (UnityPlatformIsUnityRunning(up)) { + Debug("Host asked us to show the taskbar %d\n", showTaskbar); + UnityPlatformSetTaskbarVisible(up, showTaskbar); + } else { + Debug("%s: We are not in Unity mode, ignore the show taskbar command\n", + __FUNCTION__); + } + + UnityPlatformSendPendingUpdates(up, UNITY_UPDATE_INCREMENTAL); +} diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/unity/unityPlatformX11Window.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/unity/unityPlatformX11Window.c --- open-vm-tools-2008.01.23-74039/lib/unity/unityPlatformX11Window.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/unity/unityPlatformX11Window.c 2008-10-13 08:01:51.000000000 +0100 @@ -0,0 +1,3864 @@ +/********************************************************* + * Copyright (C) 2007-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. + * + *********************************************************/ + +/* + * unityPlatformX11Window.c -- + * + * Implementation of Unity for guest operating systems that use the X11 windowing + * system. This file implements per-window operations (move, minimize, etc.) + */ + +#include "unityX11.h" +#include "base64.h" +#include "region.h" +#include "imageUtil.h" +#include <time.h> +#include <sys/types.h> +#include <unistd.h> +#include <stdio.h> +#include <stdlib.h> +#include <limits.h> + +#include "Uri.h" +#include "appUtil.h" + +/* + * Utility routines + */ +static Bool UnityPlatformFindWindows(UnityPlatform *up, + Window currentWindow, + Window *toplevelWindow, + Window *clientWindow, + Window *rootWindow); +static Bool UPWindowPushFullUpdate(UnityPlatform *up, UnityPlatformWindow *upw); +static void UPWindowSetRelevance(UnityPlatform *up, + UnityPlatformWindow *upw, + Bool isRelevant); +static void UPWindowUpdateActions(UnityPlatform *up, UnityPlatformWindow *upw); +static void UPWindowUpdateDesktop(UnityPlatform *up, UnityPlatformWindow *upw); +static void UPWindowUpdateIcon(UnityPlatform *up, UnityPlatformWindow *upw); +static void UPWindowUpdateProtocols(UnityPlatform *up, UnityPlatformWindow *upw); +#if defined(VM_HAVE_X11_SHAPE_EXT) +static void UPWindowUpdateShape(UnityPlatform *up, UnityPlatformWindow *upw); +#endif +static void UPWindowUpdateState(UnityPlatform *up, + UnityPlatformWindow *upw, + const XPropertyEvent *xevent); +static void UPWindowUpdateTitle(UnityPlatform *up, UnityPlatformWindow *upw); +static void UPWindowUpdateType(UnityPlatform *up, UnityPlatformWindow *upw); +static void UPWindowProcessConfigureEvent(UnityPlatform *up, + UnityPlatformWindow *upw, + const XEvent *xevent); +static void UPWindowProcessPropertyEvent(UnityPlatform *up, + UnityPlatformWindow *upw, + const XEvent *xevent); +static void UPWindowProcessShapeEvent(UnityPlatform *up, + UnityPlatformWindow *upw, + const XEvent *xevent); +static Bool UPWindowGetDesktop(UnityPlatform *up, + UnityPlatformWindow *upw, + int *guestDesktop); +static void UPWindowSetWindows(UnityPlatform *up, + UnityPlatformWindow *upw, + Window toplevelWindow, + Window clientWindow); + + +#ifdef VMX86_DEVEL +/* + *----------------------------------------------------------------------------- + * + * CompareStackingOrder -- + * + * Very crudely compares the stacking orders of "relevant" windows as kept + * by the X server and ourselves. (By relevant, we mean only windows which + * are relayed to the window tracker.) + * + * If there's a mismatch, Debug() statements are generated showing which + * indices do not match and the corresponding window IDs. If there is a match, + * then the current stacking order is displayed. (The latter is useless on + * its own, but it's a handy bit of data to refer to when a mismatch is + * discovered.) + * + * Results: + * Additional noise is sent to the Tools log via Debug(). + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static void +CompareStackingOrder(UnityPlatform *up, // IN + Window rootWindow, // IN + const char *callerName) // IN +{ + Window *relevantUChildren = NULL; + Window *relevantXChildren = NULL; + Window *trackerChildren = NULL; + unsigned int i; + unsigned int numXRelevant; // relevant windows from the X server + unsigned int numURelevant; // relevant windows according to Unity + unsigned int nWindows; // Generic limit referring to all of *children variables + // after we determine that they are all the same + // size. Likely that it will be optimized out. + GList *unityList = NULL; + + /* + * First query the X server for a list of its top-level windows sorted + * from bottom to top stacking order. + */ + { + Window dummyroot; + Window dummyparent; + Window *children = NULL; + unsigned int nchildren; + + XQueryTree(up->display, rootWindow, &dummyroot, &dummyparent, &children, + &nchildren); + + /* + * Now, filter out all of the relevant top-level windows into a local buffer + * from the stack. + */ + relevantXChildren = g_new(Window, nchildren); + + for (i = 0, numXRelevant = 0; i < nchildren; i++) { + UnityPlatformWindow *tmpupw; + tmpupw = UPWindow_Lookup(up, children[i]); + if (tmpupw && tmpupw->isRelevant) { + relevantXChildren[numXRelevant++] = children[i]; + } + } + + XFree(children); + } + + /* + * Do the same as above but for the windows known to Unity. These lists should + * -usually- match, but may get out of sync when a window disappears, for example. + * However, it's also -usually- only a matter of time before subsequent events show + * up and bring them back into sync. + * + * Note that this list is created by -prepending- windows. This is done because + * while we store windows in top-bottom stacking order, the X server maintains + * windows in bottom-top stacking order. For ease of comparison, I'm reversing + * our order in order to match the X server. + */ + { + UnityPlatformWindow *myupw; + for (myupw = up->topWindow, numURelevant = 0; + myupw; + myupw = myupw->lowerWindow) { + if (myupw->isRelevant) { + unityList = g_list_prepend(unityList, (gpointer)myupw->toplevelWindow); + ++numURelevant; + } + } + } + + /* + * The following check ensures that all three window collections are the same + * size. With that in mind, for the sake of readability I'll use a variable, + * nWindows, to refer to this common size through the remainer of the function. + */ + if (numURelevant != numXRelevant || + numURelevant != up->tracker->count) { + Debug("%s: mismatch (count): server %u, unity %u, uwt %u\n", __func__, + numXRelevant, numURelevant, up->tracker->count); + goto out; + } + + nWindows = numURelevant; + + /* + * We're now sure that all sets of windows to be compared are the same size. + * Go ahead and allocate and populate new arrays for window set comparisons. + */ + + relevantUChildren = g_new(Window, nWindows); + trackerChildren = g_new(Window, nWindows); + + /* + * Convert the now sorted (see above re: g_list_prepend) Unity window list to + * an array for easy comparison with * the X server's array. + */ + { + GList *listIter; + for (listIter = unityList, i = 0; + listIter; + listIter = listIter->next, i++) { + relevantUChildren[i] = (Window)listIter->data; + } + } + + /* + * Once again, UWT stores windows in top-bottom stacking order, but we're + * comparing an array in bottom-top stacking order. This loop just copies + * and reverses the UWT's zorder array. + */ + for (i = 0; i < nWindows; i++) { + trackerChildren[i] = up->tracker->zorder[(nWindows - 1) - i]; + } + + { + size_t childrenSize = nWindows * sizeof *relevantUChildren; + + if (memcmp(relevantXChildren, relevantUChildren, childrenSize) || + memcmp(relevantXChildren, trackerChildren, childrenSize)) { + Debug("%s: mismatch!\n", callerName); + Debug("%s: %8s %10s %10s %10s\n", callerName, "index", "X Server", + "Unity", "UWT"); + + for (i = 0; i < nWindows; i++) { + if (relevantXChildren[i] != relevantUChildren[i] || + relevantXChildren[i] != trackerChildren[i]) { + Debug("%s: [%6u] %#10lx %#10lx %#10lx\n", callerName, i, + relevantXChildren[i], relevantUChildren[i], + trackerChildren[i]); + } + } + } else { + Debug("%s: match (%u windows).\n", callerName, nWindows); + for (i = 0; i < nWindows; i++) { + Debug("%s: [%u] %#lx\n", callerName, i, relevantXChildren[i]); + } + } + } + +out: + g_free(relevantXChildren); + g_free(relevantUChildren); + g_free(trackerChildren); + g_list_free(unityList); +} +#endif + + +/* + *----------------------------------------------------------------------------- + * + * UnityPlatformFindClientWindow -- + * + * In X, the immediate children of the root window are almost always window manager + * windows that hold the app's windows. Sometimes we want to find the actual app's + * window to operate on, usually identfied by the WM_STATE property. Given a random + * window ID, this function figures out which is which. + * + * Results: + * TRUE if successful, FALSE otherwise. + * + *----------------------------------------------------------------------------- + */ + +static Bool +UnityPlatformFindWindows(UnityPlatform *up, // IN + Window currentWindow, // IN + Window *toplevelWindow, // OUT + Window *clientWindow, // OUT + Window *rootWindow) // OUT +{ + Bool retval = FALSE; + + Window rootWin; + Window parentWin; + Window *children = NULL; + unsigned int numChildren; + + Atom propertyType; + int propertyFormat; + unsigned long itemsReturned; + unsigned long bytesRemaining; + unsigned char *valueReturned = NULL; + + ASSERT(up); + ASSERT(toplevelWindow); + ASSERT(clientWindow); + ASSERT(rootWindow); + + /* Check for the WM_STATE property on the window */ + UnityPlatformResetErrorCount(up); + XGetWindowProperty(up->display, (Window)currentWindow, up->atoms.WM_STATE, 0, + 1024, False, AnyPropertyType, + &propertyType, &propertyFormat, &itemsReturned, + &bytesRemaining, &valueReturned); + XFree(valueReturned); + if (UnityPlatformGetErrorCount(up)) { + Debug("Retrieving WM_STATE failed\n"); + return FALSE; + } + + XQueryTree(up->display, currentWindow, &rootWin, &parentWin, + &children, &numChildren); + if (UnityPlatformGetErrorCount(up)) { + Debug("XQueryTree failed\n"); + return FALSE; + } + + if (propertyType != None) { + /* + * If WM_STATE exists on this window, we were given a client window + */ + *clientWindow = currentWindow; + *rootWindow = rootWin; + + XFree(children); + children = NULL; + + /* + * This loop ensures that parentWin is the direct child of the root. + * + * XXX this will break for any window managers that use subwindows to implement + * virtual desktops. + */ + while (parentWin != rootWin) { + currentWindow = parentWin; + + XQueryTree(up->display, currentWindow, &rootWin, + &parentWin, &children, &numChildren); + XFree(children); + children = NULL; + } + *toplevelWindow = currentWindow; + + retval = TRUE; + } else if (parentWin == rootWin) { + int i; + GQueue *windowQueue; + + /* + * Do a breadth-first search down the window tree to find the child that has the + * WM_STATE property. + */ + ASSERT(UnityPlatformIsRootWindow(up, rootWin)); + + *toplevelWindow = currentWindow; + *rootWindow = rootWin; + *clientWindow = None; + + windowQueue = g_queue_new(); + + while (numChildren || !g_queue_is_empty(windowQueue)) { + Window childWindow; + + for (i = 0; i < numChildren; i++) { + g_queue_push_tail(windowQueue, GUINT_TO_POINTER(children[i])); + } + XFree(children); + children = NULL; + + childWindow = GPOINTER_TO_UINT(g_queue_pop_head(windowQueue)); + + propertyType = None; + valueReturned = NULL; + itemsReturned = 0; + XGetWindowProperty(up->display, childWindow, up->atoms.WM_STATE, 0, + 1024, False, AnyPropertyType, + &propertyType, &propertyFormat, &itemsReturned, + &bytesRemaining, &valueReturned); + XFree(valueReturned); + + if (UnityPlatformGetErrorCount(up)) { + g_queue_free(windowQueue); + Debug("Getting WM_STATE on a child failed\n"); + return FALSE; + } + + if (itemsReturned) { + *clientWindow = childWindow; + break; + } + + XQueryTree(up->display, childWindow, &rootWin, + &parentWin, &children, &numChildren); + if (UnityPlatformGetErrorCount(up)) { + g_queue_free(windowQueue); + Debug("XQueryTree failed\n"); + return FALSE; + } + } + + g_queue_free(windowQueue); + + retval = TRUE; + } /* else, retval is FALSE */ + + XFree(children); + + if (retval && (*toplevelWindow == *rootWindow || *clientWindow == *rootWindow)) { + Panic("Creating a UnityPlatformWindow of a root window is a big error\n"); + } + + return retval; +} + + +/* + *----------------------------------------------------------------------------- + * + * UPWindowSetWindows -- + * + * Updates the X11 windows that a UnityPlatformWindow represents. Used mainly if a + * window is created or reparented. + * + * Results: + * None. + * + * Side effects: + * Updates internal Unity state. + * + *----------------------------------------------------------------------------- + */ + +static void +UPWindowSetWindows(UnityPlatform *up, // IN + UnityPlatformWindow *upw, // IN + Window toplevelWindow, // IN + Window clientWindow) // IN +{ + UnityPlatformWindow *scratchUpw; + Bool wasRelevant; + + ASSERT(up); + ASSERT(upw); + + wasRelevant = upw->isRelevant; + + UPWindowSetRelevance(up, upw, FALSE); + if (upw->toplevelWindow) { + XSelectInput(up->display, upw->toplevelWindow, 0); + HashTable_Delete(up->allWindows, GUINT_TO_POINTER(upw->toplevelWindow)); + } + if (upw->clientWindow) { + XSelectInput(up->display, upw->clientWindow, 0); + HashTable_Delete(up->allWindows, GUINT_TO_POINTER(upw->clientWindow)); + } + + /* + * Okay, now we may have two UnityPlatformWindows running around, one each for + * the top-level and client windows in response to their CreateNotify events, + * and this routine wishes to unify both in a single UPW. + * + * XXX The current course of action is this: + * 1. If either our operand top-level or client windows belong to + * any other UnityPlatformWindows, said UPWs will be dereferenced. + * 2. We'll then assign the operand windows to the current UPW. + */ + scratchUpw = UPWindow_Lookup(up, toplevelWindow); + if (scratchUpw && scratchUpw != upw) { + UPWindow_Unref(up, scratchUpw); + } + scratchUpw = UPWindow_Lookup(up, clientWindow); + if (scratchUpw && scratchUpw != upw) { + UPWindow_Unref(up, scratchUpw); + } + + upw->toplevelWindow = toplevelWindow; + upw->clientWindow = clientWindow; + + /* + * Start listening to events on this window. We want these even if the window is of no + * interest to us, because the specified events may make the window interesting to us. + */ + if (clientWindow) { + XSelectInput(up->display, clientWindow, PropertyChangeMask | StructureNotifyMask); + } + + XSelectInput(up->display, + toplevelWindow, + FocusChangeMask | PropertyChangeMask | StructureNotifyMask); + +#if defined(VM_HAVE_X11_SHAPE_EXT) + if (up->shapeEventBase) { + XShapeSelectInput(up->display, toplevelWindow, ShapeNotifyMask); + } +#endif + + HashTable_Insert(up->allWindows, GUINT_TO_POINTER(upw->toplevelWindow), upw); + if (upw->clientWindow) { + HashTable_Insert(up->allWindows, GUINT_TO_POINTER(upw->clientWindow), upw); + } + UPWindowSetRelevance(up, upw, wasRelevant); +} + + +/* + *----------------------------------------------------------------------------- + * + * UPWindow_Create -- + * + * Creates a UnityPlatformWindow for the specified UnityWindowId. The resulting + * object will have a reference count of 1 that is owned by the caller. + * + * Results: + * The newly created UnityPlatformWindow. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +UnityPlatformWindow * +UPWindow_Create(UnityPlatform *up, // IN + Window window) // IN +{ + UnityPlatformWindow *upw; + Window toplevelWindow; + Window clientWindow; + Window rootWindow; + + ASSERT(up); + ASSERT(window != None); + + if (!UnityPlatformFindWindows(up, window, + &toplevelWindow, &clientWindow, &rootWindow)) { + Debug("FindWindows failed on %#lx\n", window); + return NULL; + } + + if (HashTable_Lookup(up->allWindows, + GUINT_TO_POINTER(toplevelWindow), + (void **)&upw)) { + Debug("Lookup of window %#lx returned %#lx\n", + toplevelWindow, upw->toplevelWindow); + abort(); + } + + if (HashTable_Lookup(up->allWindows, + GUINT_TO_POINTER(clientWindow), + (void **)&upw)) { + Debug("Lookup of clientWindow %#lx returned existing toplevel %#lx\n", + clientWindow, upw->toplevelWindow); + return NULL; + } + + upw = Util_SafeCalloc(1, sizeof *upw); + upw->refs = 1; + + Debug("Creating new window for %#lx/%#lx/%#lx\n", + toplevelWindow, clientWindow, rootWindow); + upw->rootWindow = rootWindow; + for (upw->screenNumber = 0; + upw->screenNumber < up->rootWindows->numWindows + && up->rootWindows->windows[upw->screenNumber] != rootWindow; + upw->screenNumber++); + ASSERT (upw->screenNumber < up->rootWindows->numWindows); + + DynBuf_Init(&upw->iconPng.data); + DynBuf_SetSize(&upw->iconPng.data, 0); + + UPWindowSetWindows(up, upw, toplevelWindow, clientWindow); + + /* + * Put newly created windows on the top of the stack by default. + */ + upw->higherWindow = NULL; + upw->lowerWindow = up->topWindow; + if (upw->lowerWindow) { + upw->lowerWindow->higherWindow = upw; + } + up->topWindow = upw; + + return upw; +} + + +/* + *----------------------------------------------------------------------------- + * + * UPWindow_Ref -- + * + * Increases the reference count on the UnityPlatformWindow object by one. + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +void +UPWindow_Ref(UnityPlatform *up, // IN + UnityPlatformWindow *upw) // IN +{ + upw->refs++; +} + + +/* + *----------------------------------------------------------------------------- + * + * UPWindow_Unref -- + * + * Decreases the reference count on the UnityPlatformWindow object by one. + * + * Results: + * None. + * + * Side effects: + * May destroy the object if no references remain. + * + *----------------------------------------------------------------------------- + */ + +void +UPWindow_Unref(UnityPlatform *up, // IN + UnityPlatformWindow *upw) // IN +{ + upw->refs--; + + if (upw->refs <= 0) { // Window needs destroying + UPWindowSetRelevance(up, upw, FALSE); + + /* + * Filter out windows that have been already destroyed on the X11 side, but which + * still may have had refcounts active. + */ + if (upw->windowType != UNITY_WINDOW_TYPE_NONE) { + XSelectInput(up->display, upw->toplevelWindow, 0); + +#if defined(VM_HAVE_X11_SHAPE_EXT) + if (up->shapeEventBase) { + XShapeSelectInput(up->display, upw->toplevelWindow, 0); + } +#endif + + if (upw->clientWindow) { + XSelectInput(up->display, upw->clientWindow, 0); + } + } + + HashTable_Delete(up->allWindows, GUINT_TO_POINTER(upw->toplevelWindow)); + if (upw->clientWindow) { + HashTable_Delete(up->allWindows, GUINT_TO_POINTER(upw->clientWindow)); + } + + DynBuf_Destroy(&upw->iconPng.data); + + if (upw->higherWindow) { + upw->higherWindow->lowerWindow = upw->lowerWindow; + } + if (upw->lowerWindow) { + upw->lowerWindow->higherWindow = upw->higherWindow; + } + if (upw == up->topWindow) { + up->topWindow = upw->lowerWindow; + } + + free(upw); + } +} + + +/* + *----------------------------------------------------------------------------- + * + * UPWindow_Lookup -- + * + * Retrieves the UnityPlatformWindow object associated with a given Window ID + * + * Results: + * The UnityPlatformWindow object, or NULL if it was not found + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +UnityPlatformWindow * +UPWindow_Lookup(UnityPlatform *up, // IN + Window window) // IN +{ + UnityPlatformWindow *retval = NULL; + + HashTable_Lookup(up->allWindows, GUINT_TO_POINTER(window), (void **)&retval); + + return retval; +} + +#if 0 // Very useful if ever debugging the window stacking code, but slow otherwise. +/* + *----------------------------------------------------------------------------- + * + * UPWindowCheckStack -- + * + * Sanity check on the linked list of windows for Z-ordering. + * + * Results: + * None. + * + * Side effects: + * May ASSERT() if things are broken. + * + *----------------------------------------------------------------------------- + */ + +static void +UPWindowCheckStack(UnityPlatform *up) +{ + UnityPlatformWindow **upwList; + size_t numWindows; + size_t i; + UnityPlatformWindow *curWindow; + + HashTable_ToArray(up->allWindows, + (void ***)&upwList, + &numWindows); + for (i = 0; i < numWindows; i++) { + for (curWindow = up->topWindow; + curWindow; + curWindow = curWindow->lowerWindow) { + if (curWindow == upwList[i]) { + break; + } + } + + if (curWindow != upwList[i]) { + Debug("%s: Wanted %p. Complete window stack is: ", __FUNCTION__, upwList[i]); + for (curWindow = up->topWindow; + curWindow; + curWindow = curWindow->lowerWindow) { + if (curWindow == upwList[i]) { + Debug("%p ->", curWindow); + } else { + Debug("[%p] ->", curWindow); + } + } + Debug("NULL\n"); + + Debug("%s: Window stack downwards from %p: ", __FUNCTION__, upwList[i]); + for (curWindow = upwList[i]; + curWindow; + curWindow = curWindow->lowerWindow) { + if (curWindow == upwList[i]) { + Debug("[%p] ->", curWindow); + } else { + Debug("%p ->", curWindow); + } + } + Debug("NULL\n"); + + Debug("%s: Window stack upwards from %p: ", __FUNCTION__, upwList[i]); + for (curWindow = upwList[i]; + curWindow; + curWindow = curWindow->higherWindow) { + if (curWindow == upwList[i]) { + Debug("[%p] <-", curWindow); + } else { + Debug("%p <-", curWindow); + } + } + Debug("NULL\n"); + } + + ASSERT(curWindow == upwList[i]); + } + for (curWindow = up->topWindow; + curWindow; + curWindow = curWindow->lowerWindow) { + for (i = 0; i < numWindows; i++) { + if (curWindow == upwList[i]) { + break; + } + } + ASSERT(i < numWindows); + } + + free(upwList); +} + + +/* + *----------------------------------------------------------------------------- + * + * UPWindowCheckCycle -- + * + * Checks to make sure there are no loops in the window stack. + * + * Results: + * None. + * + * Side effects: + * May ASSERT(). + * + *----------------------------------------------------------------------------- + */ + +static void +UPWindowCheckCycle(UnityPlatform *up) +{ + UnityPlatformWindow *upw; + UnityPlatformWindow *curWindow; + + for (upw = up->topWindow; upw; upw = upw->lowerWindow) { + for (curWindow = upw->lowerWindow; curWindow; curWindow = curWindow->lowerWindow) { + ASSERT(curWindow != upw); + } + } + + for (upw = up->topWindow; upw->lowerWindow; upw = upw->lowerWindow) { + /* Find lowest window */ + } + + for (; upw; upw = upw->higherWindow) { + for (curWindow = upw->higherWindow; curWindow; curWindow = curWindow->higherWindow) { + ASSERT(curWindow != upw); + } + } +} +#endif + + +/* + *----------------------------------------------------------------------------- + * + * UPWindow_Restack -- + * + * Changes the Z order list of the specified window so it is + * immediately above another window. + * + * Results: + * None. + * + * Side effects: + * Updates UnityWindowTracker with the latest ZOrder. + * + *----------------------------------------------------------------------------- + */ + +void +UPWindow_Restack(UnityPlatform *up, // IN + UnityPlatformWindow *upw, // IN + Window above) // IN - None indicates stack at bottom +{ + UnityPlatformWindow *newLowerWindow = NULL; + + ASSERT(up); + ASSERT(upw); + + if (above != None) { + newLowerWindow = UPWindow_Lookup(up, above); + + if (!newLowerWindow) { + if (upw != up->topWindow) { + Debug("%s: Couldn't find the window to stack above [%#lx].\n", + __func__, above); + return; + } else { + return; + } + } + } + ASSERT(newLowerWindow != upw); + + if (newLowerWindow != upw->lowerWindow) { + /* + * Stacking order has changed. Move this window to the right place in the stack. + * + * 1. Remove 'upw' from the old location in the linked list. + * 2. Find the 'upw' that it is now above. + * 3. Insert it into the right location in the list. + */ + + ASSERT(upw->higherWindow != upw); + ASSERT(upw->lowerWindow != upw); + if (upw->higherWindow) { + upw->higherWindow->lowerWindow = upw->lowerWindow; + } else { + up->topWindow = upw->lowerWindow; + } + + ASSERT(upw->higherWindow != upw); + ASSERT(upw->lowerWindow != upw); + if (upw->lowerWindow) { + upw->lowerWindow->higherWindow = upw->higherWindow; + } + upw->higherWindow = NULL; + upw->lowerWindow = NULL; + + ASSERT(upw->higherWindow != upw); + ASSERT(upw->lowerWindow != upw); + upw->lowerWindow = newLowerWindow; + if (newLowerWindow) { + upw->higherWindow = newLowerWindow->higherWindow; + upw->lowerWindow->higherWindow = upw; + ASSERT(newLowerWindow != upw); + } else { + /* + * This window is meant to go to the bottom of the stack. + */ + upw->lowerWindow = NULL; + upw->higherWindow = up->topWindow; + + while (upw->higherWindow && upw->higherWindow->lowerWindow) { + upw->higherWindow = upw->higherWindow->lowerWindow; + } + ASSERT(newLowerWindow != upw); + } + + ASSERT(newLowerWindow != upw); + ASSERT(upw->higherWindow != upw); + ASSERT(upw->lowerWindow != upw); + if (upw->higherWindow) { + ASSERT(upw->higherWindow->lowerWindow == newLowerWindow); + upw->higherWindow->lowerWindow = upw; + } else { + up->topWindow = upw; + } + + ASSERT(upw->higherWindow != upw); + ASSERT(upw->lowerWindow != upw); + if (upw->isRelevant) { + up->stackingChanged = TRUE; + Debug("Stacking order has changed\n"); + } + } +} + + +/* + *----------------------------------------------------------------------------- + * + * UPWindowSetRelevance -- + * + * Changes the "relevance" of a particular window. Normally, the decision of whether + * to do this should be made only by CheckRelevance(). + * + * Results: + * None. + * + * Side effects: + * May add or remove the window in UnityWindowTracker. + * + *----------------------------------------------------------------------------- + */ + +static void +UPWindowSetRelevance(UnityPlatform *up, // IN + UnityPlatformWindow *upw, // IN + Bool isRelevant) // IN +{ + if ((isRelevant && upw->isRelevant) || (!isRelevant && !upw->isRelevant)) { + return; + } + + upw->isRelevant = isRelevant; + if (isRelevant) { + Debug("Adding window %#lx to tracker\n", upw->toplevelWindow); + UnityWindowTracker_AddWindowWithData(up->tracker, upw->toplevelWindow, upw); + UPWindowPushFullUpdate(up, upw); + } else { + Debug("Removing window %#lx from tracker\n", upw->toplevelWindow); + UnityWindowTracker_RemoveWindow(up->tracker, upw->toplevelWindow); + } + + up->stackingChanged = TRUE; +} + + +/* + *----------------------------------------------------------------------------- + * + * UPWindow_CheckRelevance -- + * + * Looks at the current state of a window to figure out whether we want to relay it + * through UnityWindowTracker. + * + * Results: + * None. + * + * Side effects: + * Updates various cached metadata in UnityPlatformWindow, such as windowType and + * isOverrideRedirect. + * + *----------------------------------------------------------------------------- + */ + +void +UPWindow_CheckRelevance(UnityPlatform *up, // IN + UnityPlatformWindow *upw, // IN + const XEvent *motivator) // IN - optional +{ + XWindowAttributes winAttr; + int shouldBeRelevant = -1; + Bool regetDesktop = FALSE; + + if (motivator) { + /* + * We have an event that may have modified the relevance of this window. See what + * we need to do. + */ + switch (motivator->type) { + case PropertyNotify: + { + XPropertyEvent *event = (XPropertyEvent *)motivator; + if (upw->waitingForWmState && + event->atom == up->atoms.WM_STATE && + event->state == PropertyNewValue) { + Window toplevelWindow = 0; + Window clientWindow = 0; + Window rootWindow = 0; + Bool success; + + regetDesktop = TRUE; + Debug("%s: PropertyNotify: New WM_STATE on %#lx (current upw: %#lx::%#lx)\n", + __func__, event->window, upw->toplevelWindow, upw->clientWindow); + success = UnityPlatformFindWindows(up, event->window, + &toplevelWindow, &clientWindow, + &rootWindow); + if (success) { + UPWindowSetWindows(up, upw, toplevelWindow, clientWindow); + upw->waitingForWmState = FALSE; + Debug("%s: PropertyNotify: new upw: %#lx::%#lx\n", + __func__, upw->toplevelWindow, upw->clientWindow); + } else { + Debug("%s: PropertyNotify: FindWindows failed again!\n", __func__); + return; + } + } else if (event->atom == up->atoms._NET_WM_DESKTOP) { + regetDesktop = TRUE; + } else if (event->atom != up->atoms._NET_WM_WINDOW_TYPE) { + return; + } + } + break; + + case ConfigureNotify: + if ((motivator->xconfigure.override_redirect ? TRUE : FALSE) + == upw->isOverrideRedirect) { + return; + } + break; + + case UnmapNotify: + /* + * XXX should we ignore UnmapNotify events if they come from non-override + * redirect windows? + */ + + /* + * If a window is override redirect (e.g. tooltips), then we may need to show + * & hide it based on map & unmap, because we won't get WM_STATE updates to + * help us do minimize/restore. + */ + break; + + case MapNotify: + regetDesktop = TRUE; + break; + + case ReparentNotify: + { + Window toplevelWindow = 0; + Window clientWindow = 0; + Window rootWindow = 0; + const XReparentEvent *reparent = &motivator->xreparent; + Bool success; + + regetDesktop = TRUE; + Debug("%s: ReparentNotify: %#lx reparented to %#lx (current upw: %#lx::%#lx)\n", + __func__, reparent->window, reparent->parent, + upw->toplevelWindow, upw->clientWindow); + success = UnityPlatformFindWindows(up, reparent->window, + &toplevelWindow, &clientWindow, + &rootWindow); + if (success) { + UPWindowSetWindows(up, upw, toplevelWindow, clientWindow); + } else { + Debug("%s: ReparentNotify: UnityPlatformFindWindows failed." + " Waiting for WM_STATE.\n", __func__); + upw->waitingForWmState = TRUE; + return; + } + } + break; + + case DestroyNotify: + shouldBeRelevant = FALSE; + break; + + default: + return; + } + } else { + regetDesktop = TRUE; + } + + if (shouldBeRelevant == -1) { + Bool onCurrentDesktop = TRUE; + Bool isInvisible = FALSE; + Bool ignoreThisWindow = FALSE; + + UnityPlatformResetErrorCount(up); + + XGetWindowAttributes(up->display, upw->toplevelWindow, &winAttr); + if (UnityPlatformGetErrorCount(up)) { + shouldBeRelevant = FALSE; + goto out; + } + + if (regetDesktop) { + if (!UPWindowGetDesktop(up, upw, &upw->desktopNumber)) { + upw->desktopNumber = -1; + } + } + if (upw->desktopNumber < up->desktopInfo.numDesktops + && upw->desktopNumber >= 0 + && up->desktopInfo.guestDesktopToUnity[upw->desktopNumber] != + UnityWindowTracker_GetActiveDesktop(up->tracker)) { + onCurrentDesktop = FALSE; + } + upw->isViewable = (winAttr.map_state == IsViewable); + if (!upw->wasViewable) { + if (upw->isViewable) { + upw->wasViewable = upw->isViewable; + } else { + /* + * Check if it's in iconic state (i.e. minimized), which means it was viewable + * previously as far as we're concerned. + */ + + Atom propertyType; + int propertyFormat; + unsigned long itemsReturned = 0; + unsigned long bytesRemaining; + Atom *valueReturned = NULL; + Window mainWindow = upw->clientWindow ? upw->clientWindow : upw->toplevelWindow; + + if (XGetWindowProperty(up->display, mainWindow, up->atoms.WM_STATE, 0, + 1024, False, AnyPropertyType, + &propertyType, &propertyFormat, &itemsReturned, + &bytesRemaining, (unsigned char **) &valueReturned) + == Success + && itemsReturned > 0 + && propertyType == up->atoms.WM_STATE + && propertyFormat == 32 + && valueReturned[0] == IconicState) { + upw->wasViewable = TRUE; + Debug("Found window %#lx/%#lx initially in iconic state\n", + upw->toplevelWindow, upw->clientWindow); + } else { + upw->wasViewable = FALSE; + } + + XFree(valueReturned); + } + } + upw->isOverrideRedirect = winAttr.override_redirect ? TRUE : FALSE; + + if (winAttr.class == InputOnly) { + isInvisible = TRUE; + } else if (!upw->isViewable + && (!upw->wasViewable + || upw->isOverrideRedirect) + && onCurrentDesktop) { + isInvisible = TRUE; + } else if (winAttr.width <= 1 && winAttr.height <= 1) { + isInvisible = TRUE; + } else if ((winAttr.x + winAttr.width) < 0 + || (winAttr.y + winAttr.height) < 0) { + isInvisible = TRUE; + } + + if (!isInvisible) { + char *wmname = NULL; + + /* + ************************************** + * This section should hold all the ugly app-specific filtering that might be + * needed for UnityX11. + */ + + if (XFetchName(up->display, + upw->clientWindow ? upw->clientWindow : upw->toplevelWindow, + &wmname) != 0) { + if (!strcmp(wmname, "gksu") + && winAttr.override_redirect) { + ignoreThisWindow = TRUE; + } + + XFree(wmname); + } + + /* + * End app-specific filtering. + ******************************************* + */ + } + + if (isInvisible) { + shouldBeRelevant = FALSE; + } else if (ignoreThisWindow) { + shouldBeRelevant = FALSE; + } else { + Atom netWmWindowType = up->atoms._NET_WM_WINDOW_TYPE_NORMAL; + Atom netWmPropertyType; + int netWmPropertyFormat = 0; + unsigned long itemsReturned, bytesRemaining; + unsigned char *valueReturned = NULL; + Window mainWindow; + + mainWindow = upw->clientWindow ? upw->clientWindow : upw->toplevelWindow; + XGetWindowProperty(up->display, mainWindow, + up->atoms._NET_WM_WINDOW_TYPE, 0, + 1024, False, AnyPropertyType, + &netWmPropertyType, &netWmPropertyFormat, &itemsReturned, + &bytesRemaining, &valueReturned); + + if (UnityPlatformGetErrorCount(up)) { + Debug("Error retrieving window type property\n"); + shouldBeRelevant = FALSE; + goto out; + } + + if (netWmPropertyType == XA_ATOM && itemsReturned && !bytesRemaining) { + netWmWindowType = *((Atom *) valueReturned); + } + XFree(valueReturned); + + shouldBeRelevant = TRUE; + if (netWmWindowType == up->atoms._NET_WM_WINDOW_TYPE_DESKTOP) { + shouldBeRelevant = FALSE; + upw->windowType = UNITY_WINDOW_TYPE_DESKTOP; + up->desktopWindow = upw; + } else if (netWmWindowType == up->atoms._NET_WM_WINDOW_TYPE_DND) { + shouldBeRelevant = FALSE; + } else if (netWmWindowType == up->atoms._NET_WM_WINDOW_TYPE_DOCK) { + shouldBeRelevant = up->currentSettings[UNITY_UI_TASKBAR_VISIBLE]; + upw->windowType = UNITY_WINDOW_TYPE_DOCK; + } else if (netWmWindowType == up->atoms._NET_WM_WINDOW_TYPE_UTILITY) { + upw->windowType = UNITY_WINDOW_TYPE_PANEL; + } else if (netWmWindowType == up->atoms._NET_WM_WINDOW_TYPE_DIALOG) { + upw->windowType = UNITY_WINDOW_TYPE_DIALOG; + } else if (netWmWindowType == up->atoms._NET_WM_WINDOW_TYPE_MENU + || netWmWindowType == up->atoms._NET_WM_WINDOW_TYPE_POPUP_MENU + || netWmWindowType == up->atoms._NET_WM_WINDOW_TYPE_DROPDOWN_MENU) { + upw->windowType = UNITY_WINDOW_TYPE_MENU; + } else if (netWmWindowType == up->atoms._NET_WM_WINDOW_TYPE_SPLASH) { + upw->windowType = UNITY_WINDOW_TYPE_SPLASH; + } else if (netWmWindowType == up->atoms._NET_WM_WINDOW_TYPE_TOOLBAR) { + upw->windowType = UNITY_WINDOW_TYPE_TOOLBAR; + } else if (netWmWindowType == up->atoms._NET_WM_WINDOW_TYPE_TOOLTIP + || upw->isOverrideRedirect) { + upw->windowType = UNITY_WINDOW_TYPE_TOOLTIP; + } else { + upw->windowType = UNITY_WINDOW_TYPE_NORMAL; + } + } + } + + out: + ASSERT(shouldBeRelevant >= 0); + + if (shouldBeRelevant) { + Debug("Relevance for (%p) %#lx/%#lx/%#lx is %d (window type %d)\n", + upw, upw->toplevelWindow, upw->clientWindow, upw->rootWindow, + shouldBeRelevant, upw->windowType); + } + + UPWindowSetRelevance(up, upw, shouldBeRelevant ? TRUE : FALSE); +} + + +/* + *----------------------------------------------------------------------------- + * + * UPWindow_SetUserTime -- + * + * Updates the _NET_WM_USER_TIME property on a window so the window manager + * will let us restack the window. + * + * Results: + * None. + * + * Side effects: + * Updated timestamp. + * + *----------------------------------------------------------------------------- + */ + +void +UPWindow_SetUserTime(UnityPlatform *up, // IN + UnityPlatformWindow *upw) // IN +{ + Atom dummy; + Window focusWindow; + Atom propertyType; + int propertyFormat; + unsigned long itemsReturned, bytesRemaining; + unsigned char *valueReturned = NULL; + + focusWindow = upw->clientWindow ? upw->clientWindow : upw->toplevelWindow; + + XGetWindowProperty(up->display, focusWindow, up->atoms._NET_WM_USER_TIME_WINDOW, 0, + 1024, False, XA_WINDOW, &propertyType, &propertyFormat, + &itemsReturned, &bytesRemaining, &valueReturned); + if (valueReturned) { + focusWindow = *(Window *)valueReturned; + XFree(valueReturned); + } + + dummy = UnityPlatformGetServerTime(up); + XChangeProperty(up->display, focusWindow, + up->atoms._NET_WM_USER_TIME, XA_CARDINAL, + 32, PropModeReplace, (unsigned char *)&dummy, 1); +} + + +/* + *----------------------------------------------------------------------------- + * + * UPWindowGetActualWindowAndPosition -- + * + * Figures out the right arguments to call XMoveResizeWindow with when + * moving/resizing a window. + * + * Results: + * None. + * + * Side effects: + * Puts the window and coordinates to use in 'actualWindow' and 'actualRect'. + * + *----------------------------------------------------------------------------- + */ + +static void +UPWindowGetActualWindowAndPosition(UnityPlatform *up, // IN + const UnityPlatformWindow *upw, // IN + const UnityRect *orig, // IN + const XWindowAttributes *origTop, // IN + Window *actualWindow, // IN/OUT + UnityRect *actualRect) // IN/OUT +{ + XWindowAttributes clientWinAttr; + Atom propertyType; + int propertyFormat = 0; + unsigned long itemsReturned = 0; + unsigned long bytesRemaining; + unsigned char *valueReturned = NULL; + int frameSizeTop; + int frameSizeBottom; + int frameSizeLeft; + int frameSizeRight; + + ASSERT(up); + ASSERT(upw); + ASSERT(orig); + ASSERT(actualWindow); + ASSERT(actualRect); + + *actualRect = *orig; + if (!upw->clientWindow) { + *actualWindow = upw->toplevelWindow; + return; + } + + *actualWindow = upw->clientWindow; + + /* + * We need to figure out how to adjust the 'orig' rect (which is in toplevelWindow + * coordinates) and turn it into clientWindow coordinates. Because window managers + * ignore requests to modify their frame windows (toplevelWindow), we have to request + * the change on the clientWindow instead. + */ + if (UnityPlatformWMProtocolSupported(up, UNITY_X11_WM__NET_FRAME_EXTENTS) + && XGetWindowProperty(up->display, upw->clientWindow, up->atoms._NET_FRAME_EXTENTS, 0, + 1024, False, XA_CARDINAL, + &propertyType, &propertyFormat, &itemsReturned, + &bytesRemaining, &valueReturned) == Success + && propertyFormat == 32 + && itemsReturned >= 4) { + Atom *atomValue = (Atom *)valueReturned; + + frameSizeLeft = atomValue[0]; + frameSizeRight = atomValue[1]; + frameSizeTop = atomValue[2]; + frameSizeBottom = atomValue[3]; + } else { + /* + * Query the current clientWindow and calculate how to adjust the frame coords to + * client coords. + */ + clientWinAttr.x = clientWinAttr.y = 0; + clientWinAttr.width = origTop->width; + clientWinAttr.height = origTop->height; + + XGetWindowAttributes(up->display, upw->clientWindow, &clientWinAttr); + + frameSizeLeft = clientWinAttr.x; + frameSizeRight = origTop->width - (clientWinAttr.x + clientWinAttr.width); + frameSizeTop = clientWinAttr.y; + frameSizeBottom = origTop->height - (clientWinAttr.y + clientWinAttr.height); + } + + /* + * It turns out that with metacity, we don't have to adjust x/y for the frame size, + * only the width & height. XXX we should see how other window managers behave. + */ +#if 0 + actualRect->x += frameSizeLeft; + actualRect->y += frameSizeTop; +#endif + + actualRect->width -= frameSizeLeft + frameSizeRight; + actualRect->height -= frameSizeTop + frameSizeBottom; + + XFree(valueReturned); +} + + +/* + *---------------------------------------------------------------------------- + * + * UnityPlatformMoveResizeWindow -- + * + * Moves and/or resizes the given window to the specified location. Does not + * attempt to move and/or resize window if (a) the destination rectangle does not + * intersect with the virtual screen rectangle (b) window is minimized. + * + * If the input width & height match the current width & height, then this + * function will end up just moving the window. Similarly if the input + * x & y coordinates match the current coordinates, then it will end up just + * resizing the window. + * + * Results: + * Even if the move/resize operaion is not execuated or it fails, window's + * current coordinates are always sent back. + * + * Function does not return FALSE if the attempt to move and/or resize fails. + * This is because the host will be comparing input and output parameters to + * decide whether the window really moved and/or resized. + * + * In a very rare case, when attempt to get window's current coordinates fail, + * returns FALSE. + * + * Side effects: + * None + * + *---------------------------------------------------------------------------- + */ + +Bool +UnityPlatformMoveResizeWindow(UnityPlatform *up, // IN + UnityWindowId window, // IN: Window handle + UnityRect *moveResizeRect) // IN/OUT: Desired coordinates, + // before and after + // the operation. +{ + UnityPlatformWindow *upw; + Bool retval = FALSE; + XWindowAttributes winAttr; + UnityRect desiredRect; + + ASSERT(moveResizeRect); + + upw = UPWindow_Lookup(up, window); + if (!upw) { + return FALSE; + } + + desiredRect = *moveResizeRect; + + if (upw->lastConfigureEvent) { + free(upw->lastConfigureEvent); + upw->lastConfigureEvent = NULL; + } + + UnityPlatformResetErrorCount(up); + XGetWindowAttributes(up->display, upw->toplevelWindow, &winAttr); + if (UnityPlatformGetErrorCount(up)) { + return FALSE; + } + + if (winAttr.x == moveResizeRect->x + && winAttr.y == moveResizeRect->y + && winAttr.width == moveResizeRect->width + && winAttr.height == moveResizeRect->height) { + return TRUE; + } + + /* + * _NET_MOVERESIZE_WINDOW is preferable in general (because it saves us extra X + * calls), but it is broken in metacity and there's no way to detect whether it works + * or not. + */ +#if defined(VM_CAN_TRUST__NET_MOVERESIZE_WINDOW) + if (UnityPlatformWMProtocolSupported(up, UNITY_X11_WM__NET_MOVERESIZE_WINDOW) + && upw->clientWindow) { + Atom data[5] = {0, 0, 0, 0, 0}; + + /* + * The first datum in the EWMH _NET_MOVERESIZE_WINDOW message contains a bunch of + * bits to signify what information is in the request and where the request came + * from. The (0xF << 8) bits (lower nibble of the upper byte) signify that the request contains x, y, width, and + * height data. The (2 << 12) bits (higher nibble of the upper byte) signifies that the request was made by the + * pager/taskbar. StaticGravity is 10 in the lower byte. + */ + data[0] = (0xF << 8) | (2 << 12) | StaticGravity; + + data[1] = moveResizeRect->x; + data[2] = moveResizeRect->y; + data[3] = moveResizeRect->width; + data[4] = moveResizeRect->height; + UnityPlatformSendClientMessage(up, upw->rootWindow, upw->clientWindow, + up->atoms._NET_MOVERESIZE_WINDOW, + 32, 5, data); + Debug("MoveResizeWindow implemented using _NET_MOVERESIZE_WINDOW\n"); + } else +#endif + { + if (up->desktopInfo.currentDesktop == upw->desktopNumber) { + UnityRect actualRect; + Window actualWindow; + + UPWindowGetActualWindowAndPosition(up, upw, moveResizeRect, &winAttr, &actualWindow, &actualRect); + + XMoveResizeWindow(up->display, actualWindow, + actualRect.x, actualRect.y, + actualRect.width, actualRect.height); + Debug("MoveResizeWindow implemented using XMoveResizeWindow (requested (%d, %d) +(%d, %d) on %#lx\n", + actualRect.x, actualRect.y, actualRect.width, actualRect.height, + actualWindow); + } else { + Debug("Trying to move window %#lx that is on desktop %d instead of the current desktop %u\n", + upw->toplevelWindow, upw->desktopNumber, up->desktopInfo.currentDesktop); + return FALSE; + } + } + + /* + * Protect against the window being destroyed while we're waiting for results of the + * resize. + */ + UPWindow_Ref(up, upw); + + /* + * Because the window manager may take a non-trivial amount of time to process the + * move/resize request, we have to spin here until a ConfigureNotify event is + * generated on the window. + */ + while (!upw->lastConfigureEvent) { + Debug("Running main loop iteration\n"); + UnityPlatformProcessMainLoop(); // Process events, do other Unity stuff, etc. + } + + if (upw->lastConfigureEvent && upw->lastConfigureEvent->window == upw->toplevelWindow) { + moveResizeRect->x = upw->lastConfigureEvent->x; + moveResizeRect->y = upw->lastConfigureEvent->y; + moveResizeRect->width = upw->lastConfigureEvent->width; + moveResizeRect->height = upw->lastConfigureEvent->height; + + retval = TRUE; + } else { + /* + * There are cases where we only get a ConfigureNotify on the clientWindow because + * no actual change happened, in which case we just verify that we have the right + * toplevelWindow position and size. + */ + Debug("Didn't get lastConfigureEvent on the toplevel window - requerying\n"); + + XGetWindowAttributes(up->display, upw->toplevelWindow, &winAttr); + moveResizeRect->x = winAttr.x; + moveResizeRect->y = winAttr.y; + moveResizeRect->width = winAttr.width; + moveResizeRect->height = winAttr.height; + + retval = TRUE; + } + + Debug("MoveResizeWindow(%#lx/%#lx): original (%d,%d)+(%d,%d), desired (%d,%d)+(%d,%d), actual (%d,%d)+(%d,%d) = %d\n", + upw->toplevelWindow, upw->clientWindow, + winAttr.x, winAttr.y, winAttr.width, winAttr.height, + desiredRect.x, desiredRect.y, desiredRect.width, desiredRect.height, + moveResizeRect->x, moveResizeRect->y, + moveResizeRect->width, moveResizeRect->height, + retval); + + UPWindow_Unref(up, upw); + + return retval; +} + + +/* + *---------------------------------------------------------------------------- + * + * UnityPlatformCloseWindow -- + * + * Close the window. Send WM_DELETE message to the specified window. + * Just because the message was posted successfully, doesn't mean the + * window will be closed (this is up to the underlying application/user + * actions). + * + * Results: + * TRUE if we were successful in posting the close message to the window. + * FALSE otherwise. + * + * Side effects: + * The window might be closed (and, potentially, an application exits) + * + *---------------------------------------------------------------------------- + */ + +Bool +UnityPlatformCloseWindow(UnityPlatform *up, // IN: Platform data + UnityWindowId window) // IN: window handle +{ + UnityPlatformWindow *upw; + + ASSERT(up); + + upw = UPWindow_Lookup(up, window); + + Debug("Closing window %#x\n", window); + + if (!upw) { + return FALSE; + } + + if (upw->clientWindow && + UnityPlatformWMProtocolSupported(up, UNITY_X11_WM__NET_CLOSE_WINDOW)) { + Atom data[] = {0, + 2, // Bit to indicate that the pager requested it + 0, + 0, + 0}; + data[0] = UnityPlatformGetServerTime(up); + UnityPlatformSendClientMessage(up, upw->rootWindow, upw->clientWindow, + up->atoms._NET_CLOSE_WINDOW, 32, 5, + data); + } else if (UPWindow_ProtocolSupported(up, upw, UNITY_X11_WIN_WM_DELETE_WINDOW)){ + Atom data[1]; + Window destWin = upw->clientWindow ? upw->clientWindow : upw->toplevelWindow; + + data[0] = up->atoms.WM_DELETE_WINDOW; + + UnityPlatformSendClientMessage(up, destWin, destWin, + up->atoms.WM_DELETE_WINDOW, 32, 1, + data); + } else { + XDestroyWindow(up->display, upw->toplevelWindow); + XFlush(up->display); + } + + return TRUE; +} + + +/* + *----------------------------------------------------------------------------- + * + * UnityPlatformArgvToWindowPaths -- + * + * Encodes the string array 'argv' into two window paths, one uniquely + * representing a window and another its owning application. + * + * Results: + * TRUE on success, FALSE on failure. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static Bool +UnityPlatformArgvToWindowPaths(UnityPlatform *up, // IN + UnityPlatformWindow *upw, // IN + char **inArgv, // IN + int argc, // IN + char *cwd, // IN + gchar **windowUri, // OUT + gchar **execUri) // OUT +{ + int numQueryArgs; + int i; + int err; + char *ctmp = NULL; + char **argv; + char *windowQueryString = NULL; + char *execQueryString = NULL; + char *uriString = NULL; + Bool retval = FALSE; + + ASSERT(argc); + ASSERT(windowUri); + ASSERT(execUri); + + argv = inArgv; + +#ifdef GTK2 + while (argc && AppUtil_AppIsSkippable(argv[0])) { + argv++; + argc--; + } + + if (!argc) { + Debug("%s: all args determined skippable.\n", __func__); + return FALSE; + } + + if (argv[0][0] != '/') { + if ((ctmp = AppUtil_CanonicalizeAppName(argv[0], cwd))) { + char **newArgv; + newArgv = alloca(argc * sizeof argv[0]); + memcpy(newArgv, argv, argc * sizeof argv[0]); + argv = newArgv; + i = strlen(ctmp) + 1; + argv[0] = alloca(i); + memcpy(argv[0], ctmp, i); + g_free(ctmp); + } else { + Debug("%s: Program %s not found\n", __FUNCTION__, argv[0]); + return FALSE; + } + } +#endif + + /* + * If the program in question takes any arguments, they will be appended as URI + * query parameters. (I.e., we're adding only arguments from argv[1] and beyond.) + */ + numQueryArgs = argc - 1; + + if (numQueryArgs > 0) { + UriQueryListA *queryList; + int j; + + /* + * First build query string containing only program arguments. + */ + queryList = alloca(numQueryArgs * sizeof *queryList); + for (i = 1, j = 0; i < argc; i++, j++) { + queryList[j].key = "argv[]"; + queryList[j].value = argv[i]; + queryList[j].next = &queryList[j + 1]; + } + + /* + * Terminate queryList. + */ + queryList[numQueryArgs - 1].next = NULL; + + if (uriComposeQueryMallocA(&execQueryString, queryList)) { + Debug("uriComposeQueryMallocA failed\n"); + return FALSE; + } + } + + /* + * Now, if we are to identify a specific window, go ahead and tack on its + * XID in a second buffer. Please see UnityPlatformGetWindowPath for more + * an explanation about keeping the XID separate. + */ + if (upw) { + Window xid = upw->clientWindow ? upw->clientWindow : upw->toplevelWindow; + /* + * The XID is used to allow GHI to retrieve icons for more apps... + */ + windowQueryString = execQueryString ? + g_strdup_printf("%s&WindowXID=%lu", execQueryString, xid) : + g_strdup_printf("WindowXID=%lu", xid); + } + + uriString = alloca(10 + 3 * strlen(argv[0])); // This formula comes from URI.h + err = uriUnixFilenameToUriStringA(argv[0], uriString); + if (err) { + Debug("uriUnixFilenameToUriStringA failed\n"); + goto out; + } + + /* + * We could use uriparser to construct the whole URI with querystring for us, but + * there doesn't seem to be any advantage to that right now, and it'd involve more + * steps. + */ + + *windowUri = windowQueryString ? + g_strdup_printf("%s?%s", uriString, windowQueryString) : + g_strdup(uriString); + + *execUri = execQueryString ? + g_strdup_printf("%s?%s", uriString, execQueryString) : + g_strdup(uriString); + + retval = TRUE; + +out: + g_free(windowQueryString); + g_free(execQueryString); + + return retval; +} + + +/* + *----------------------------------------------------------------------------- + * + * UnityPlatformReadProcessPath -- + * + * Reads the cmdline of a process and stuffs it with and without window ID + * into supplied gchar ** arguments in URI-encoded form. + * + * Results: + * TRUE if successful, FALSE otherwise. + * + * Side effects: + * Values of windowUri and execUri may point to strings. + * + *----------------------------------------------------------------------------- + */ + +static Bool +UnityPlatformReadProcessPath(UnityPlatform *up, // IN + UnityPlatformWindow *upw, // IN + pid_t pid, // IN + gchar **windowUri, // OUT + gchar **execUri) // OUT +{ +#if defined(linux) + FILE *fh; + char cbuf[256]; + char cwdbuf[PATH_MAX]; + int i; + + Str_Snprintf(cbuf, sizeof cbuf, "/proc/%d/cwd", pid); + i = readlink(cbuf, cwdbuf, sizeof cwdbuf); + if (i <= 0) { + return FALSE; + } + cwdbuf[i] = '\0'; + + Str_Snprintf(cbuf, sizeof cbuf, "/proc/%d/cmdline", pid); + + fh = fopen(cbuf, "r"); + if (fh) { + size_t nitems; + char *argv[2048]; + int argc, i; + + nitems = fread(cbuf, 1, sizeof cbuf, fh); + fclose(fh); + + if (!nitems) { + return FALSE; + } + + for (argc = i = 0; i < nitems; i++) { + if (i == 0 || cbuf[i - 1] == '\0') { + argv[argc++] = &cbuf[i]; + } + } + argv[argc] = NULL; + + return UnityPlatformArgvToWindowPaths(up, upw, argv, argc, cwdbuf, + windowUri, execUri); + } +#endif + + return FALSE; +} + + +/* + *----------------------------------------------------------------------------- + * + * UnityX11GetWindowPaths -- + * + * Internal routine used to retrieve the window path for the purpose of getting its + * icons and for the unity.get.window.path operation. + * + * Results: + * TRUE on success, FALSE on failure. + * + * Side effects: + * Allocates memory to be returned to caller via g_free. + * + *----------------------------------------------------------------------------- + */ + +static Bool +UnityX11GetWindowPaths(UnityPlatform *up, // IN + UnityPlatformWindow *upw, // IN + gchar **windowUri, // OUT + gchar **execUri) // OUT +{ + + Atom propertyType; + int propertyFormat; + unsigned long itemsReturned = 0; + unsigned long bytesRemaining; + unsigned char *valueReturned = NULL; + char **argv = NULL; + int argc; + XClassHint classHint = {NULL, NULL}; + int ret; + Window checkWindow; + Bool retval = FALSE; + + checkWindow = upw->clientWindow ? upw->clientWindow : upw->toplevelWindow; + + UnityPlatformResetErrorCount(up); + ret = XGetWindowProperty(up->display, checkWindow, up->atoms._NET_WM_PID, 0, + 1024, False, AnyPropertyType, + &propertyType, &propertyFormat, &itemsReturned, + &bytesRemaining, &valueReturned); + if (UnityPlatformGetErrorCount(up) || ret != Success) { + return FALSE; + } + + if (propertyType == XA_CARDINAL && itemsReturned >= 1) { + pid_t windowPid = 0; + + switch (propertyFormat) { + case 16: + windowPid = * (CARD16 *)valueReturned; + break; + case 32: + windowPid = *(XID *)valueReturned; + break; + default: + Debug("Unknown propertyFormat %d while retrieving _NET_WM_PID\n", + propertyFormat); + break; + } + + if (windowPid) { + retval = UnityPlatformReadProcessPath(up, upw, windowPid, windowUri, + execUri); + } + } + XFree(valueReturned); + + if (!retval && XGetCommand(up->display, checkWindow, &argv, &argc)) { + retval = UnityPlatformArgvToWindowPaths(up, upw, argv, argc, NULL, + windowUri, execUri); + XFreeStringList(argv); + } + + if (!retval && XGetClassHint(up->display, checkWindow, &classHint)) { + /* + * Last-ditch - try finding the WM_CLASS on $PATH. + */ + + char *fakeArgv[2] = {NULL, NULL}; + + if (classHint.res_name && *classHint.res_name) { + fakeArgv[0] = classHint.res_name; + } else if (classHint.res_class && *classHint.res_class) { + fakeArgv[0] = classHint.res_class; + } + + if (fakeArgv[0] && *(fakeArgv[0])) { + retval = UnityPlatformArgvToWindowPaths(up, upw, fakeArgv, 1, NULL, + windowUri, execUri); + } + + XFree(classHint.res_name); + XFree(classHint.res_class); + } + + Debug("UnityX11GetWindowPath(%#lx) returning %s\n", upw->toplevelWindow, + retval ? "TRUE" : "FALSE"); + + return retval; +} + + +/* + *---------------------------------------------------------------------------- + * + * UnityPlatformGetWindowPath -- + * + * Get the information needed to re-launch a window and retrieve further + * information on it. + * + * 'buf' will hold two URI strings, one which uniquely identifies an X11 + * window (windowUri) and one which uniquely identifies the window's owning + * executable (execUri). + * + * windowUri is handy for getting icons and other data associated with a + * specific window, whereas execUri is handy for uniquely identifying + * applications for GHI. (The host uses our returned strings to uniquely + * identify applications, and we don't want it to consider the window ID + * for that purpose, as it causes the host to believe that two windows + * from the same application are really associated with separate + * applications.) + * + * I.e., <windowUri><nul><execUri><nul> + * + * This RPC is overloaded with two URIs in order to maintain backwards + * compatibility with older VMXs / host UIs expecting to pass the first + * (and, to them, only known) URI to GHIGetBinaryInfo. + * + * Results: + * TRUE if everything went ok, FALSE otherwise. + * + * Side effects: + * None + * + *---------------------------------------------------------------------------- + */ + +Bool +UnityPlatformGetWindowPath(UnityPlatform *up, // IN: Platform data + UnityWindowId window, // IN: window handle + DynBuf *buf) // IN/OUT: full path to the binary +{ + UnityPlatformWindow *upw; + Bool retval = FALSE; + gchar *windowUri; + gchar *execUri; + + ASSERT(up); + + upw = UPWindow_Lookup(up, window); + + if (!upw) { + Debug("GetWindowPath FAILED!\n"); + return FALSE; + } + + retval = UnityX11GetWindowPaths(up, upw, &windowUri, &execUri); + + if (!retval) { + Debug("GetWindowPath didn't know how to identify the window...\n"); + } else { + Debug("GetWindowPath window %#x results in: \n" + " windowUri = %s\n" + " execUri = %s\n", + window, windowUri, execUri); + + DynBuf_AppendString(buf, windowUri); + DynBuf_AppendString(buf, execUri); + + g_free(windowUri); + g_free(execUri); + retval = TRUE; + } + + return retval; +} + + +/* + *------------------------------------------------------------------------------ + * + * UnityPlatformGetWindowContents -- + * + * Read the correct bits off the window regardless of whether it's minimized + * or obscured. Return the result as a PNG in the imageData DynBuf. + * + * Results: + * Returns TRUE in case success and FALSE otherwise. + * + * Side effects: + * None. + * + *------------------------------------------------------------------------------ + */ + +Bool +UnityPlatformGetWindowContents(UnityPlatform *up, // IN + UnityWindowId window, // IN + DynBuf *imageData) // IN +{ + UnityPlatformWindow *upw; + Pixmap pixmap = 0; + XWindowAttributes attrs; + XImage *ximage = NULL; + GC xgc = 0; + XGCValues gcvalues; + Bool result = FALSE; + ImageInfo vmimage = { 0 }; + + ASSERT(up); + ASSERT(imageData); + + upw = UPWindow_Lookup(up, window); + + if (!upw) { + return FALSE; + } + + UnityPlatformResetErrorCount(up); + if (!XGetWindowAttributes(up->display, upw->toplevelWindow, &attrs) + || UnityPlatformGetErrorCount(up)) { + return FALSE; + } + pixmap = XCreatePixmap(up->display, upw->toplevelWindow, + attrs.width, attrs.height, attrs.depth); + if (UnityPlatformGetErrorCount(up)) { + return FALSE; + } + + gcvalues.background = gcvalues.foreground = 0; + gcvalues.subwindow_mode = IncludeInferiors; + gcvalues.fill_style = FillSolid; + XFillRectangle(up->display, pixmap, xgc, 0, 0, attrs.width, attrs.height); + xgc = XCreateGC(up->display, pixmap, + GCFillStyle | + GCBackground | + GCForeground | + GCSubwindowMode, + &gcvalues); + if (UnityPlatformGetErrorCount(up)) { + goto out; + } + + XCopyArea(up->display, upw->toplevelWindow, pixmap, xgc, 0, 0, + attrs.width, attrs.height, 0, 0); + if (UnityPlatformGetErrorCount(up)) { + goto out; + } + + ximage = XGetImage(up->display, pixmap, 0, 0, + attrs.width, attrs.height, ~0, XYPixmap); + + if (!ximage || UnityPlatformGetErrorCount(up)) { + goto out; + } + + vmimage.width = ximage->width; + vmimage.height = ximage->height; + vmimage.depth = ximage->depth; + vmimage.bpp = ximage->bitmap_unit; + vmimage.redMask = ximage->red_mask; + vmimage.greenMask = ximage->green_mask; + vmimage.blueMask = ximage->blue_mask; + vmimage.bytesPerLine = ximage->bytes_per_line; + vmimage.data = ximage->data; + + if (ImageUtil_ConstructPNGBuffer(&vmimage, imageData)) { + result = TRUE; + } + + out: + if (ximage) { + XDestroyImage(ximage); + } + + if (xgc) { + XFreeGC(up->display, xgc); + } + + if (pixmap) { + XFreePixmap(up->display, pixmap); + } + + return result; +} + + +/* + *------------------------------------------------------------------------------ + * + * UnityPlatformGetIconData -- + * + * Read part or all of a particular icon on a window. Return the result as a PNG in + * the imageData DynBuf, and also return the full length of the PNG in fullLength. + * + * Results: + * Returns TRUE if successful, and FALSE otherwise. + * + * Side effects: + * None. + * + *------------------------------------------------------------------------------ + */ + +Bool +UnityPlatformGetIconData(UnityPlatform *up, // IN + UnityWindowId window, // IN + UnityIconType iconType, // IN + UnityIconSize iconSize, // IN + uint32 dataOffset, // IN + uint32 dataLength, // IN + DynBuf *imageData, // OUT + uint32 *fullLength) // OUT +{ + UnityPlatformWindow *upw; + + ASSERT(up); + ASSERT(fullLength); + ASSERT(imageData); + + upw = UPWindow_Lookup(up, window); + + if (!upw || !upw->clientWindow || iconType != UNITY_ICON_TYPE_MAIN) { + return FALSE; + } + + Debug("GetIconData %#lx\n", (Window)window); + + if (!DynBuf_GetSize(&upw->iconPng.data) + || (upw->iconPng.size != iconSize) + || (upw->iconPng.type != iconType)) { + GPtrArray *pixbufs; + Bool gotIcons = FALSE; + + pixbufs = AppUtil_CollectIconArray(NULL, upw->clientWindow); + + if (pixbufs && pixbufs->len) { + GdkPixbuf *pixbuf; + gchar *pngData; + gsize pngDataSize; + + pixbuf = g_ptr_array_index(pixbufs, 0); + + if (gdk_pixbuf_save_to_buffer(pixbuf, &pngData, &pngDataSize, + "png", NULL, NULL)) { + DynBuf_Attach(&upw->iconPng.data, pngDataSize, pngData); + gotIcons = TRUE; + } else { + DynBuf_SetSize(&upw->iconPng.data, 0); + } + + upw->iconPng.size = iconSize; + upw->iconPng.type = iconType; + } + + AppUtil_FreeIconArray(pixbufs); + + if (!gotIcons) { + return FALSE; + } + } + + *fullLength = DynBuf_GetSize(&upw->iconPng.data); + if (dataOffset >= *fullLength) { + DynBuf_SetSize(imageData, 0); + } else { + uint32 realLength; + + if ((dataOffset + dataLength) > *fullLength) { + realLength = *fullLength - dataOffset; + } else { + realLength = dataLength; + } + DynBuf_Enlarge(imageData, realLength); + DynBuf_SetSize(imageData, realLength); + + memcpy(imageData->data, + ((const char *)DynBuf_Get(&upw->iconPng.data)) + dataOffset, + realLength); + } + + return TRUE; +} + + +/* + *---------------------------------------------------------------------------- + * + * UnityPlatformRestoreWindow -- + * + * Tell the window to restore from the minimized state to its original + * size. + * + * Results: + * TRUE always + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +Bool +UnityPlatformRestoreWindow(UnityPlatform *up, // IN + UnityWindowId window) // IN +{ + UnityPlatformWindow *upw; + + ASSERT(up); + + upw = UPWindow_Lookup(up, window); + + if (!upw || !upw->clientWindow) { + Debug("Restoring FAILED!\n"); + return FALSE; + } + + Debug("UnityPlatformRestoreWindow(%#lx)\n", upw->toplevelWindow); + if (upw->isMinimized) { + Atom data[5] = {0, 0, 0, 0, 0}; + + Debug("Restoring window %#x\n", window); + + upw->isMinimized = FALSE; + upw->wantInputFocus = TRUE; + + /* + * Unfortunately the _NET_WM_STATE messages only work for windows that are already + * mapped, i.e. not iconified or withdrawn. + */ + if (!upw->isHidden) { + XMapRaised(up->display, upw->clientWindow); + } + + data[0] = _NET_WM_STATE_REMOVE; + data[1] = up->atoms._NET_WM_STATE_HIDDEN; + data[2] = up->atoms._NET_WM_STATE_MINIMIZED; + data[3] = 2; // Message is from the pager/taskbar + UnityPlatformSendClientMessage(up, upw->rootWindow, upw->clientWindow, + up->atoms._NET_WM_STATE, 32, 4, data); + } else { + Debug("Window %#x is already restored\n", window); + } + + return TRUE; +} + + +/* + *----------------------------------------------------------------------------- + * + * UPWindowProcessPropertyEvent -- + * + * Processes an notification that a property has changed on an X11 window. + * + * N.B. The UPWindowPushFullUpdate method creates a fake 'xevent' based on all the + * properties are set initially on a window, so before passing 'xevent' down the + * call chain, or using any additional fields from it, make sure that + * UPWindowPushFullUpdate fills in those fields properly. + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static void +UPWindowProcessPropertyEvent(UnityPlatform *up, // IN + UnityPlatformWindow *upw, // IN + const XEvent *xevent) // IN +{ + Atom eventAtom; + + ASSERT(up); + ASSERT(upw); + ASSERT(xevent); + + eventAtom = xevent->xproperty.atom; + if (eventAtom == up->atoms._NET_WM_STATE || + eventAtom == up->atoms.WM_STATE) { + UPWindowUpdateState(up, upw, &xevent->xproperty); + if (eventAtom == up->atoms.WM_STATE) { + UPWindowUpdateIcon(up, upw); + } + } else if (eventAtom == up->atoms.WM_NAME) { + UPWindowUpdateTitle(up, upw); + } else if (eventAtom == up->atoms.WM_PROTOCOLS) { + UPWindowUpdateProtocols(up, upw); + } else if (eventAtom == up->atoms._NET_WM_ALLOWED_ACTIONS) { + UPWindowUpdateActions(up, upw); + } else if (eventAtom == up->atoms._NET_WM_WINDOW_TYPE) { + UPWindowUpdateType(up, upw); + } else if (eventAtom == up->atoms._NET_WM_ICON + || eventAtom == up->atoms.WM_ICON) { + UPWindowUpdateIcon(up, upw); + } else if (eventAtom == up->atoms._NET_WM_DESKTOP) { + UPWindowUpdateDesktop(up, upw); + } +} + + +/* + *----------------------------------------------------------------------------- + * + * UPWindowProcessConfigureEvent -- + * + * Processes an notification that the window configuration has changed. + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static void +UPWindowProcessConfigureEvent(UnityPlatform *up, // IN + UnityPlatformWindow *upw, // IN + const XEvent *xevent) // IN +{ + if (xevent->xconfigure.window == upw->toplevelWindow) { + const int border_width = xevent->xconfigure.border_width; + const int x = xevent->xconfigure.x; + const int y = xevent->xconfigure.y; + + /* + * Used for implementing the move_resize operation. + */ + if (!upw->lastConfigureEvent) { + upw->lastConfigureEvent = Util_SafeMalloc(sizeof *upw->lastConfigureEvent); + } + *upw->lastConfigureEvent = xevent->xconfigure; + + Debug("Moving window %#lx/%#lx to (%d, %d) +(%d, %d)\n", + upw->toplevelWindow, upw->clientWindow, + x - border_width, + y - border_width, + xevent->xconfigure.width + border_width, + xevent->xconfigure.height + border_width); + + UnityWindowTracker_MoveWindow(up->tracker, upw->toplevelWindow, + x - border_width, + y - border_width, + x + xevent->xconfigure.width + border_width, + y + xevent->xconfigure.height + border_width); + + if ((xevent->xconfigure.above != None && !upw->lowerWindow) + || (xevent->xconfigure.above == None && upw->lowerWindow) + || (upw->lowerWindow && xevent->xconfigure.above + != upw->lowerWindow->toplevelWindow)) { + Debug("Marking window %#lx/%#lx for restacking\n", + upw->toplevelWindow, upw->clientWindow); + UPWindow_Restack(up, upw, xevent->xconfigure.above); + } + } else { + if (!upw->lastConfigureEvent) { + upw->lastConfigureEvent = Util_SafeMalloc(sizeof *upw->lastConfigureEvent); + *upw->lastConfigureEvent = xevent->xconfigure; + } + Debug("ProcessConfigureEvent skipped event on window %#lx (upw was %#lx/%#lx)\n", + xevent->xconfigure.window, upw->toplevelWindow, upw->clientWindow); + } + +#ifdef VMX86_DEVEL + CompareStackingOrder(up, upw->rootWindow, __func__); +#endif +} + + +#if defined(VM_HAVE_X11_SHAPE_EXT) + + +/* + *----------------------------------------------------------------------------- + * + * UPWindowUpdateShape -- + * + * Updates the window shape. + * + * Results: + * None. + * + * Side effects: + * Notification to the window tracker + * + *----------------------------------------------------------------------------- + */ + +static void +UPWindowUpdateShape(UnityPlatform *up, // IN + UnityPlatformWindow *upw) // IN +{ + RegionPtr clipRegion = NULL; + RegionPtr boundingRegion = NULL; + RegionPtr region = NULL; + XRectangle *rects = NULL; + int rectCount; + int rectOrdering; + + /* + * Retrieve the X11 'clipping shape' (the window shape including its border) and turn + * it into a region. + */ + UnityPlatformResetErrorCount(up); + rects = XShapeGetRectangles(up->display, upw->toplevelWindow, ShapeClip, + &rectCount, &rectOrdering); + if (!UnityPlatformGetErrorCount(up) && rects && rectCount) { + xRectangle *vmRects; + int i; + + vmRects = alloca(rectCount * (sizeof *vmRects)); + memset(vmRects, 0, rectCount * (sizeof *vmRects)); + for (i = 0; i < rectCount; i++) { + ASSERT(rects[i].width); + ASSERT(rects[i].height); + vmRects[i].x = rects[i].x; + vmRects[i].y = rects[i].y; + vmRects[i].width = rects[i].width; + vmRects[i].height = rects[i].height; + vmRects[i].info.type = UpdateRect; + } + + clipRegion = miRectsToRegion(rectCount, vmRects, 0); + } + XFree(rects); rects = NULL; + rectCount = 0; + + UnityPlatformResetErrorCount(up); + + /* + * Retrieve the X11 'clipping shape' (the window shape of the window without its + * border) and turn it into a region. + */ + rects = XShapeGetRectangles(up->display, upw->toplevelWindow, ShapeBounding, + &rectCount, &rectOrdering); + if (!UnityPlatformGetErrorCount(up) + && rects && rectCount) { + xRectangle *vmRects; + int i; + + vmRects = alloca(rectCount * (sizeof *vmRects)); + memset(vmRects, 0, rectCount * (sizeof *vmRects)); + for (i = 0; i < rectCount; i++) { + ASSERT(rects[i].width); + ASSERT(rects[i].height); + vmRects[i].x = rects[i].x; + vmRects[i].y = rects[i].y; + vmRects[i].width = rects[i].width; + vmRects[i].height = rects[i].height; + vmRects[i].info.type = UpdateRect; + } + + boundingRegion = miRectsToRegion(rectCount, vmRects, 0); + } + XFree(rects); + + if (boundingRegion && clipRegion) { + region = miRegionCreate(NULL, 2); + miIntersect(region, clipRegion, boundingRegion); + } else if (clipRegion) { + region = clipRegion; clipRegion = NULL; + } else if (boundingRegion) { + region = boundingRegion; boundingRegion = NULL; + } + + UnityWindowTracker_ChangeWindowRegion(up->tracker, upw->toplevelWindow, region); + if (clipRegion) { + miRegionDestroy(clipRegion); + } + if (boundingRegion) { + miRegionDestroy(boundingRegion); + } + if (region) { + miRegionDestroy(region); + } +} + + +/* + *----------------------------------------------------------------------------- + * + * UPWindowProcessShapeEvent -- + * + * Processes an notification that the non-rectangular window shape has changed. + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static void +UPWindowProcessShapeEvent(UnityPlatform *up, // IN + UnityPlatformWindow *upw, // IN + const XEvent *xevent) // IN +{ + XShapeEvent *sev; + + ASSERT(up); + ASSERT(upw); + ASSERT(xevent->type == (up->shapeEventBase + ShapeNotify)); + + sev = (XShapeEvent *)xevent; + ASSERT (sev->window == upw->toplevelWindow || + sev->window == upw->clientWindow); + + if (sev->shaped) { + UPWindowUpdateShape(up, upw); + } else { + UnityWindowTracker_ChangeWindowRegion(up->tracker, upw->toplevelWindow, NULL); + } +} +#endif + + +/* + *----------------------------------------------------------------------------- + * + * UnityPlatformWindowProcessEvent -- + * + * Handle an event on a typical window. + * + * Results: + * None. + * + * Side effects: + * Many. + * + *----------------------------------------------------------------------------- + */ + +void +UPWindow_ProcessEvent(UnityPlatform *up, // IN + UnityPlatformWindow *upw, // IN + Window realEventWindow, // IN + const XEvent *xevent) // IN +{ + Bool eventHandled = TRUE; + + ASSERT(up); + ASSERT(upw); + ASSERT(xevent); + + UPWindow_CheckRelevance(up, upw, xevent); + + switch (xevent->type) { + case KeyPress: + case KeyRelease: + case ButtonPress: + case ButtonRelease: + case MotionNotify: + case EnterNotify: + case LeaveNotify: + case KeymapNotify: + case Expose: + case GraphicsExpose: + case NoExpose: + case MapRequest: + case ResizeRequest: + case CirculateRequest: + case SelectionClear: + case SelectionRequest: + case SelectionNotify: + case ColormapNotify: + case ClientMessage: + case GravityNotify: + case VisibilityNotify: + case MappingNotify: + case ReparentNotify: + case ConfigureRequest: + break; // No extra processing on these for now + + case CreateNotify: + /* Do nothing. The UPWindow has already been created. */ + break; + + case FocusIn: + if (upw->isRelevant) { + UnityWindowInfo *info; + info = UnityWindowTracker_LookupWindow(up->tracker, upw->toplevelWindow); + + UnityWindowTracker_ChangeWindowState(up->tracker, + upw->toplevelWindow, + info->state | UNITY_WINDOW_STATE_IN_FOCUS); + } + break; + + case FocusOut: + if (upw->isRelevant) { + UnityWindowInfo *info; + info = UnityWindowTracker_LookupWindow(up->tracker, upw->toplevelWindow); + + UnityWindowTracker_ChangeWindowState(up->tracker, + upw->toplevelWindow, + (info->state + & ~UNITY_WINDOW_STATE_IN_FOCUS)); + } + break; + + case DestroyNotify: + Debug("Destroying window (%p) %#lx/%#lx\n", + upw, upw->toplevelWindow, upw->clientWindow); + + /* + * Release the UnityPlatform object's reference to this UnityPlatformWindow, + */ + upw->windowType = UNITY_WINDOW_TYPE_NONE; + UPWindow_Unref(up, upw); +#ifdef VMX86_DEVEL + CompareStackingOrder(up, upw->rootWindow, __func__); +#endif + break; + + case UnmapNotify: + upw->wantInputFocus = FALSE; + upw->isViewable = FALSE; + break; + + case MapNotify: + /* + * This is here because we want to set input focus as part of RestoreWindow, but + * can't call XSetInputFocus until the window has actually been shown. + */ + if (upw->wantInputFocus && upw->clientWindow) { + XSetInputFocus(up->display, upw->clientWindow, RevertToParent, + UnityPlatformGetServerTime(up)); + upw->wantInputFocus = FALSE; + } + + upw->isViewable = TRUE; + break; + + case CirculateNotify: + if (upw->isRelevant) { + UPWindow_Restack(up, upw, + (up->topWindow && xevent->xcirculate.place == PlaceOnTop) + ? up->topWindow->toplevelWindow : None); + } + break; + + case PropertyNotify: + UPWindowProcessPropertyEvent(up, upw, xevent); + break; + + case ConfigureNotify: + UPWindowProcessConfigureEvent(up, upw, xevent); + break; + + default: + eventHandled = FALSE; // Unknown "regular" event + break; + } + + if (!eventHandled) { // Handle extension events here +#if defined(VM_HAVE_X11_SHAPE_EXT) + if (up->shapeEventBase && + xevent->type == (up->shapeEventBase + ShapeNotify)) { + UPWindowProcessShapeEvent(up, upw, xevent); + eventHandled = TRUE; + } +#endif + + ASSERT(eventHandled); + } +} + + +/* + *----------------------------------------------------------------------------- + * + * UPWindowUpdateTitle -- + * + * Tells the window tracker about the window's latest title + * + * Results: + * None. + * + * Side effects: + * Notification to the window tracker + * + *----------------------------------------------------------------------------- + */ + +static void +UPWindowUpdateTitle(UnityPlatform *up, // IN + UnityPlatformWindow *upw) // IN +{ + Atom propertyType; + int propertyFormat; + unsigned long itemsReturned; + unsigned long bytesRemaining; + unsigned char *valueReturned = NULL; + DynBuf titleBuf; + + if (!upw->clientWindow) { + return; + } + + if (XGetWindowProperty(up->display, upw->clientWindow, up->atoms.WM_NAME, 0, + 1024, False, AnyPropertyType, + &propertyType, &propertyFormat, &itemsReturned, + &bytesRemaining, &valueReturned) + != Success) { + /* + * Some random error occurred - perhaps the window disappeared + */ + return; + } + + if (propertyType != XA_STRING || propertyFormat != 8) { + return; + } + + DynBuf_Init(&titleBuf); + DynBuf_Append(&titleBuf, valueReturned, itemsReturned); + if (!itemsReturned || valueReturned[itemsReturned-1] != '\0') { + DynBuf_AppendString(&titleBuf, ""); + } + XFree(valueReturned); + Debug("Set title of window %#lx to %s\n", + upw->clientWindow, (char *)DynBuf_Get(&titleBuf)); + UnityWindowTracker_SetWindowTitle(up->tracker, (UnityWindowId) upw->toplevelWindow, + &titleBuf); + DynBuf_Destroy(&titleBuf); +} + + +/* + *----------------------------------------------------------------------------- + * + * UPWindowUpdateType -- + * + * Tells the window tracker about the window's latest type + * + * Results: + * None. + * + * Side effects: + * Notification to the window tracker + * + *----------------------------------------------------------------------------- + */ + +static void +UPWindowUpdateType(UnityPlatform *up, // IN + UnityPlatformWindow *upw) // IN +{ + ASSERT(up); + ASSERT(upw); + + /* + * upw->windowType was previously updated by the CheckRelevance method. + */ + UnityWindowTracker_ChangeWindowType(up->tracker, + upw->toplevelWindow, + upw->windowType); +} + + +/* + *----------------------------------------------------------------------------- + * + * UPWindowUpdateProtocols -- + * + * Updates the list of protocols supported by the window. + * + * Results: + * None. + * + * Side effects: + * Notification to the window tracker + * + *----------------------------------------------------------------------------- + */ + +static void +UPWindowUpdateProtocols(UnityPlatform *up, // IN + UnityPlatformWindow *upw) // IN +{ + Atom propertyType; + int propertyFormat; + unsigned long itemsReturned; + unsigned long bytesRemaining; + Atom *valueReturned = NULL; + int i; + + if (!upw->clientWindow) { + return; + } + + if (XGetWindowProperty(up->display, upw->clientWindow, up->atoms.WM_STATE, 0, + 1024, False, AnyPropertyType, + &propertyType, &propertyFormat, &itemsReturned, + &bytesRemaining, (unsigned char **) &valueReturned) + != Success) { + /* + * Some random error occurred - perhaps the window disappeared. + */ + return; + } + + if (propertyType != up->atoms.WM_STATE + || propertyFormat != 32) { + itemsReturned = 0; + } + + memset(upw->windowProtocols, 0, sizeof upw->windowProtocols); + for (i = 0; i < itemsReturned; i++) { + UnityX11WinProtocol proto; + + if (valueReturned[i] == up->atoms.WM_DELETE_WINDOW) { + proto = UNITY_X11_WIN_WM_DELETE_WINDOW; + } else { + continue; + } + + upw->windowProtocols[proto] = TRUE; + } + XFree(valueReturned); +} + + +/* + *----------------------------------------------------------------------------- + * + * UPWindowUpdateActions -- + * + * Updates the window attributes based on a new _NET_WM_ALLOWED_ACTIONS attribute. + * + * Results: + * None. + * + * Side effects: + * Notification to the window tracker + * + *----------------------------------------------------------------------------- + */ + +static void +UPWindowUpdateActions(UnityPlatform *up, // IN + UnityPlatformWindow *upw) // IN +{ + Atom propertyType; + int propertyFormat; + unsigned long itemsReturned = 0; + unsigned long bytesRemaining; + Atom *valueReturned = NULL; + int i; + Bool curAttrValues[UNITY_MAX_ATTRIBUTES]; + Bool attrsAreSet[UNITY_MAX_ATTRIBUTES]; + Bool haveHorizMax; + Bool haveVertMax; + + if (!upw->clientWindow) { + return; + } + + memset(curAttrValues, 0, sizeof curAttrValues); + memset(attrsAreSet, 0, sizeof attrsAreSet); + haveHorizMax = haveVertMax = FALSE; + + /* + * List of attributes that we know how to process from the ALLOWED_ACTIONS list. If we + * don't find these in the ALLOWED_ACTIONS list, and they are supported by the window + * manager, then we report that they're FALSE (set by the first memset above). + */ + attrsAreSet[UNITY_WINDOW_ATTR_MINIMIZABLE] = + UnityPlatformWMProtocolSupported(up, UNITY_X11_WM__NET_WM_ACTION_MINIMIZE); + attrsAreSet[UNITY_WINDOW_ATTR_MAXIMIZABLE] = + UnityPlatformWMProtocolSupported(up, UNITY_X11_WM__NET_WM_ACTION_MAXIMIZE_HORZ) && + UnityPlatformWMProtocolSupported(up, UNITY_X11_WM__NET_WM_ACTION_MAXIMIZE_VERT); + attrsAreSet[UNITY_WINDOW_ATTR_CLOSABLE] = + UnityPlatformWMProtocolSupported(up, UNITY_X11_WM__NET_WM_ACTION_CLOSE); + attrsAreSet[UNITY_WINDOW_ATTR_FULLSCREENABLE] = + UnityPlatformWMProtocolSupported(up, UNITY_X11_WM__NET_WM_ACTION_FULLSCREEN); + attrsAreSet[UNITY_WINDOW_ATTR_SHADEABLE] = + UnityPlatformWMProtocolSupported(up, UNITY_X11_WM__NET_WM_ACTION_SHADE); + attrsAreSet[UNITY_WINDOW_ATTR_STICKABLE] = + UnityPlatformWMProtocolSupported(up, UNITY_X11_WM__NET_WM_ACTION_STICK); + + if (XGetWindowProperty(up->display, upw->clientWindow, + up->atoms._NET_WM_ALLOWED_ACTIONS, 0, + 1024, False, XA_ATOM, + &propertyType, &propertyFormat, &itemsReturned, + &bytesRemaining, (unsigned char **) &valueReturned) + == Success + && propertyFormat == 32) { + for (i = 0; i < itemsReturned; i++) { + UnityWindowAttribute attr; + Bool attrValue = TRUE; + + if (valueReturned[i] == up->atoms._NET_WM_ACTION_MINIMIZE) { + attr = UNITY_WINDOW_ATTR_MINIMIZABLE; + } else if (valueReturned[i] == up->atoms._NET_WM_ACTION_MAXIMIZE_HORZ) { + haveHorizMax = TRUE; + continue; + } else if (valueReturned[i] == up->atoms._NET_WM_ACTION_MAXIMIZE_VERT) { + haveVertMax = TRUE; + continue; + } else if (valueReturned[i] == up->atoms._NET_WM_ACTION_CLOSE) { + attr = UNITY_WINDOW_ATTR_CLOSABLE; + } else if (valueReturned[i] == up->atoms._NET_WM_ACTION_FULLSCREEN) { + attr = UNITY_WINDOW_ATTR_FULLSCREENABLE; + } else if (valueReturned[i] == up->atoms._NET_WM_ACTION_SHADE) { + attr = UNITY_WINDOW_ATTR_SHADEABLE; + } else if (valueReturned[i] == up->atoms._NET_WM_ACTION_STICK) { + attr = UNITY_WINDOW_ATTR_STICKABLE; + } else { + continue; + } + + curAttrValues[attr] = attrValue; + attrsAreSet[attr] = TRUE; + } + XFree(valueReturned); + } else { + curAttrValues[UNITY_WINDOW_ATTR_MINIMIZABLE] = TRUE; + attrsAreSet[UNITY_WINDOW_ATTR_MINIMIZABLE] = TRUE; + } + + curAttrValues[UNITY_WINDOW_ATTR_MAXIMIZABLE] = (haveHorizMax && haveVertMax); + attrsAreSet[UNITY_WINDOW_ATTR_MAXIMIZABLE] = TRUE; + + for (i = 0; i < UNITY_MAX_ATTRIBUTES; i++) { + if (attrsAreSet[i]) { + UnityWindowTracker_ChangeWindowAttribute(up->tracker, upw->toplevelWindow, + i, curAttrValues[i]); + } + } +} + + +/* + *----------------------------------------------------------------------------- + * + * UPWindowGetDesktop -- + * + * Retrieve's the current X11 virtual desktop of a window. + * + * Results: + * Virtual desktop number + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static Bool +UPWindowGetDesktop(UnityPlatform *up, // IN + UnityPlatformWindow *upw, // IN + int *guestDesktop) // IN/OUT +{ + Atom propertyType; + int propertyFormat; + unsigned long itemsReturned = 0; + unsigned long bytesRemaining; + Atom *valueReturned = NULL; + Bool retval = FALSE; + + if (!upw->clientWindow) { + return FALSE; + } + + if (XGetWindowProperty(up->display, upw->clientWindow, + up->atoms._NET_WM_DESKTOP, 0, + 1024, False, AnyPropertyType, + &propertyType, &propertyFormat, &itemsReturned, + &bytesRemaining, (unsigned char **) &valueReturned) + == Success + && propertyType == XA_CARDINAL + && propertyFormat == 32 + && itemsReturned) { + + *guestDesktop = *valueReturned; + retval = TRUE; + } + + XFree(valueReturned); + + return retval; +} + + +/* + *----------------------------------------------------------------------------- + * + * UPWindowUpdateDesktop -- + * + * Updates the window's virtual desktop based on a new _NET_WM_DESKTOP attribute. + * + * Results: + * None. + * + * Side effects: + * Notification to the window tracker. + * + *----------------------------------------------------------------------------- + */ + +static void +UPWindowUpdateDesktop(UnityPlatform *up, // IN + UnityPlatformWindow *upw) // IN +{ + int guestDesktop = -1; + + if (!upw->clientWindow) { + return; + } + + if (!UPWindowGetDesktop(up, upw, &guestDesktop)) { + Debug("Window %#lx has a clientWindow, but its " + "virtual desktop could not be retrieved\n", + upw->clientWindow); + return; + } + + if (guestDesktop < ((int)up->desktopInfo.numDesktops)) { + UnityDesktopId desktopId = -1; + Bool isSticky; + + isSticky = (guestDesktop < 0); + if (!isSticky) { + desktopId = up->desktopInfo.guestDesktopToUnity[guestDesktop]; + } + + Debug("Window %#lx is now on desktop %d\n", upw->toplevelWindow, desktopId); + UnityWindowTracker_ChangeWindowDesktop(up->tracker, + upw->toplevelWindow, + desktopId); + + UnityWindowTracker_ChangeWindowAttribute(up->tracker, + upw->toplevelWindow, + UNITY_WINDOW_ATTR_STICKY, + isSticky); + } else { + Debug("Guest's virtual desktop config may not match host's (yet?)" + " (window is on desktop %d, guest is supposed to have %"FMTSZ"u desktops)\n", + guestDesktop, up->desktopInfo.numDesktops); + } +} + + +/* + *----------------------------------------------------------------------------- + * + * UPWindowUpdateIcon -- + * + * Updates the window's virtual desktop based on a new _NET_WM_DESKTOP attribute. + * + * Results: + * None. + * + * Side effects: + * Notification to the window tracker. + * + *----------------------------------------------------------------------------- + */ + +static void +UPWindowUpdateIcon(UnityPlatform *up, // IN + UnityPlatformWindow *upw) // IN +{ + UnityWindowTracker_NotifyIconChanged(up->tracker, upw->toplevelWindow, + UNITY_ICON_TYPE_MAIN); + + if (DynBuf_GetSize(&upw->iconPng.data)) { + DynBuf_SetSize(&upw->iconPng.data, 0); + } +} + + +/* + *----------------------------------------------------------------------------- + * + * UPWindowIsNowWithdrawn -- + * + * In response to an update to a window's WM_STATE property, properties, test + * whether or not the window has been withdrawn. + * + * Results: + * TRUE if we believe the window was withdrawn, FALSE otherwise. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static Bool +UPWindowIsNowWithdrawn(UnityPlatform *up, // IN + UnityPlatformWindow *upw, // IN + const XPropertyEvent *xevent) // IN +{ + Window mainWindow; + Bool isWithdrawn = FALSE; + + Atom actual_type; + int actual_format; + unsigned long nitems; + unsigned long bytes_remaining; + unsigned char *properties = NULL; + + mainWindow = upw->clientWindow ? upw->clientWindow : upw->toplevelWindow; + + /* + * Per ICCCM §4.1.3.1, WM_STATE.state will either be set to WithdrawnState + * or WM_STATE removed from a window when it is withdrawn. + */ + if (xevent->state == PropertyDelete) { + return TRUE; + } + + if (XGetWindowProperty(up->display, mainWindow, up->atoms.WM_STATE, + 0, // offset + 1, // length (in 32-bit chunks) + False, // delete + AnyPropertyType, // requested property type + &actual_type, // returned type + &actual_format, // returned format + &nitems, // # of items returned + &bytes_remaining, // # of bytes remaining + &properties) == Success) { + uint32 *state = (uint32 *)properties; + + if (actual_type == None || + (nitems > 0 && *state == WithdrawnState)) { + isWithdrawn = TRUE; + } + + XFree(properties); + } + + return isWithdrawn; +} + + +/* + *----------------------------------------------------------------------------- + * + * UPWindowUpdateState -- + * + * Tells the window tracker about the window's changes to the _NET_WM_STATE and + * WM_STATE properties. + * + * Results: + * None. + * + * Side effects: + * Notification to the window tracker + * + *----------------------------------------------------------------------------- + */ + +static void +UPWindowUpdateState(UnityPlatform *up, // IN + UnityPlatformWindow *upw, // IN + const XPropertyEvent *xevent) // IN +{ + Atom propertyType; + int propertyFormat; + unsigned long itemsReturned; + unsigned long bytesRemaining; + Atom *valueReturned = NULL; + int i; + Bool curAttrValues[UNITY_MAX_ATTRIBUTES]; + Bool attrsAreSet[UNITY_MAX_ATTRIBUTES]; + Bool isMinimized = FALSE; + Bool haveHorizMax = FALSE; + Bool haveVertMax = FALSE; + Bool doSkipTaskbar = FALSE; + Bool doSkipPager = FALSE; + Window mainWindow; + + mainWindow = upw->clientWindow ? upw->clientWindow : upw->toplevelWindow; + + /* + * If a change to WM_STATE indicates this window was withdrawn/unmapped, simply + * invalidate it from the window tracker and return. + */ + if (xevent->atom == up->atoms.WM_STATE && + UPWindowIsNowWithdrawn(up, upw, xevent)) { + UPWindowSetRelevance(up, upw, FALSE); + return; + } + + memset(curAttrValues, 0, sizeof curAttrValues); + memset(attrsAreSet, 0, sizeof attrsAreSet); + + curAttrValues[UNITY_WINDOW_ATTR_VISIBLE] = TRUE; + attrsAreSet[UNITY_WINDOW_ATTR_VISIBLE] = + attrsAreSet[UNITY_WINDOW_ATTR_MAXIMIZED] = + attrsAreSet[UNITY_WINDOW_ATTR_STICKY] = + attrsAreSet[UNITY_WINDOW_ATTR_ALWAYS_ABOVE] = + attrsAreSet[UNITY_WINDOW_ATTR_ALWAYS_BELOW] = + attrsAreSet[UNITY_WINDOW_ATTR_MODAL] = + attrsAreSet[UNITY_WINDOW_ATTR_SHADED] = + attrsAreSet[UNITY_WINDOW_ATTR_FULLSCREENED] = + attrsAreSet[UNITY_WINDOW_ATTR_ATTN_WANTED] = TRUE; + + if (!UnityPlatformWMProtocolSupported(up, UNITY_X11_WM__NET_WM_STATE_HIDDEN)) { + if (XGetWindowProperty(up->display, mainWindow, up->atoms.WM_STATE, 0, + 1024, False, AnyPropertyType, + &propertyType, &propertyFormat, &itemsReturned, + &bytesRemaining, (unsigned char **) &valueReturned) + != Success) { + /* + * Some random error occurred - perhaps the window disappeared + */ + return; + } + + if (propertyType == up->atoms.WM_STATE + && propertyFormat == 32 + && itemsReturned + && valueReturned[0] == IconicState) { + isMinimized = TRUE; + } + XFree(valueReturned); + } + + if (XGetWindowProperty(up->display, mainWindow, up->atoms._NET_WM_STATE, 0, + 1024, False, AnyPropertyType, + &propertyType, &propertyFormat, &itemsReturned, + &bytesRemaining, (unsigned char **) &valueReturned) + != Success) { + /* + * Some random error occurred - perhaps the window disappeared + */ + return; + } + + if (propertyType != XA_ATOM + || propertyFormat != 32) { + itemsReturned = 0; + } + + for (i = 0; i < itemsReturned; i++) { + UnityWindowAttribute attr; + Bool attrValue = TRUE; + + if (valueReturned[i] == up->atoms._NET_WM_STATE_MINIMIZED + || valueReturned[i] == up->atoms._NET_WM_STATE_HIDDEN) { + /* + * Unfortunately, the HIDDEN attribute is used by some WM's to mean + * "minimized" when they should really be separate. + */ + + uint32 cDesk = -1; + uint32 gDesk; + + /* + * Only push minimize state for windows on the same desktop. + */ + if (UPWindowGetDesktop(up, upw, &gDesk)) { + cDesk = UnityX11GetCurrentDesktop(up); + if (cDesk == gDesk) { + isMinimized = TRUE; + } + } else { + Debug("%s: Unable to get window desktop\n", __FUNCTION__); + } + continue; + } else if (valueReturned[i] == up->atoms._NET_WM_STATE_MAXIMIZED_HORZ) { + haveHorizMax = TRUE; + continue; + } else if (valueReturned[i] == up->atoms._NET_WM_STATE_MAXIMIZED_VERT) { + haveVertMax = TRUE; + continue; + } else if (valueReturned[i] == up->atoms._NET_WM_STATE_STICKY) { + attr = UNITY_WINDOW_ATTR_STICKY; + } else if (valueReturned[i] == up->atoms._NET_WM_STATE_ABOVE) { + attr = UNITY_WINDOW_ATTR_ALWAYS_ABOVE; + } else if (valueReturned[i] == up->atoms._NET_WM_STATE_BELOW) { + attr = UNITY_WINDOW_ATTR_ALWAYS_BELOW; + } else if (valueReturned[i] == up->atoms._NET_WM_STATE_MODAL) { + attr = UNITY_WINDOW_ATTR_MODAL; + } else if (valueReturned[i] == up->atoms._NET_WM_STATE_SHADED) { + attr = UNITY_WINDOW_ATTR_SHADED; + } else if (valueReturned[i] == up->atoms._NET_WM_STATE_FULLSCREEN) { + attr = UNITY_WINDOW_ATTR_FULLSCREENED; + } else if (valueReturned[i] == up->atoms._NET_WM_STATE_DEMANDS_ATTENTION) { + attr = UNITY_WINDOW_ATTR_ATTN_WANTED; + } else if (valueReturned[i] == up->atoms._NET_WM_STATE_SKIP_TASKBAR) { + attr = UNITY_WINDOW_ATTR_TOOLWINDOW; + doSkipTaskbar = TRUE; + } else if (valueReturned[i] == up->atoms._NET_WM_STATE_SKIP_PAGER) { + doSkipPager = TRUE; + continue; + } else { + continue; + } + + curAttrValues[attr] = attrValue; + attrsAreSet[attr] = TRUE; + } + XFree(valueReturned); + + curAttrValues[UNITY_WINDOW_ATTR_MAXIMIZED] = (haveHorizMax && haveVertMax); + attrsAreSet[UNITY_WINDOW_ATTR_MAXIMIZED] = TRUE; + curAttrValues[UNITY_WINDOW_ATTR_APPWINDOW] = (!doSkipPager && !doSkipTaskbar) + && (upw->windowType == UNITY_WINDOW_TYPE_NORMAL); + attrsAreSet[UNITY_WINDOW_ATTR_APPWINDOW] = TRUE; + + if (upw->isRelevant) { + UnityWindowInfo *info; + uint32 newState; + info = UnityWindowTracker_LookupWindow(up->tracker, upw->toplevelWindow); + ASSERT(info); + + newState = info->state; + if (isMinimized) { + if (! (newState & UNITY_WINDOW_STATE_MINIMIZED)) { + Debug("Enabling minimized attribute for window %#lx/%#lx\n", + upw->toplevelWindow, upw->clientWindow); + newState |= UNITY_WINDOW_STATE_MINIMIZED; + } + } else { + if ((newState & UNITY_WINDOW_STATE_MINIMIZED)) { + Debug("Disabling minimized attribute for window %#lx/%#lx\n", + upw->toplevelWindow, upw->clientWindow); + newState &= ~UNITY_WINDOW_STATE_MINIMIZED; + } + } + + if (newState != info->state) { + UnityWindowTracker_ChangeWindowState(up->tracker, + upw->toplevelWindow, + newState); + } + + upw->isMinimized = isMinimized; + upw->isMaximized = (haveHorizMax && haveVertMax); + + for (i = 0; i < UNITY_MAX_ATTRIBUTES; i++) { + if (attrsAreSet[i]) { + UnityWindowTracker_ChangeWindowAttribute(up->tracker, upw->toplevelWindow, + i, curAttrValues[i]); + } + } + } +} + + +/* + *----------------------------------------------------------------------------- + * + * UPWindowPushFullUpdate -- + * + * Pushes a full update for the given window. + * + * Results: + * TRUE if we pushed the updates for this window, FALSE otherwise. + * + * Side effects: + * UnityWindowTracker contains latest info on this window. + * + *----------------------------------------------------------------------------- + */ + +static Bool +UPWindowPushFullUpdate(UnityPlatform *up, // IN + UnityPlatformWindow *upw) // IN +{ + XWindowAttributes winAttr; + Atom *props; + int propCount; + int i; + + XGetWindowAttributes(up->display, upw->toplevelWindow, &winAttr); + + UnityWindowTracker_MoveWindow(up->tracker, (UnityWindowId) upw->toplevelWindow, + winAttr.x - winAttr.border_width, + winAttr.y - winAttr.border_width, + winAttr.x + winAttr.width + winAttr.border_width, + winAttr.y + winAttr.height + winAttr.border_width); + +#if defined(VM_HAVE_X11_SHAPE_EXT) + UPWindowUpdateShape(up, upw); +#endif + + propCount = 0; + UnityPlatformResetErrorCount(up); + props = XListProperties(up->display, + upw->clientWindow ? upw->clientWindow : upw->toplevelWindow, + &propCount); + if (!UnityPlatformGetErrorCount(up)) { + for (i = 0; i < propCount; i++) { + XEvent fakeEvent; + + fakeEvent.xproperty.atom = props[i]; + UPWindowProcessPropertyEvent(up, upw, &fakeEvent); + } + XFree(props); + } + + return TRUE; +} + + +/* + *----------------------------------------------------------------------------- + * + * UPWindow_ProtocolSupported -- + * + * Returns whether a particular window supports a particular protocol. + * + * Results: + * TRUE if supported, FALSE otherwise. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +Bool +UPWindow_ProtocolSupported(const UnityPlatform *up, // IN + const UnityPlatformWindow *upw, // IN + UnityX11WinProtocol proto) // IN +{ + ASSERT(up); + ASSERT(upw); + ASSERT(proto < UNITY_X11_MAX_WIN_PROTOCOLS); + + return upw->windowProtocols[proto]; +} + + +/* + *---------------------------------------------------------------------------- + * + * UnityPlatformShowWindow -- + * + * Makes hidden Window visible. If the Window is already visible, it stays + * visible. Window reappears at its original location. A minimized window + * reappears as minimized. + * + * Results: + * + * FALSE if the Window handle is invalid. + * TRUE otherwise. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +Bool +UnityPlatformShowWindow(UnityPlatform *up, // IN + UnityWindowId window) // IN +{ + UnityPlatformWindow *upw; + + ASSERT(up); + + upw = UPWindow_Lookup(up, window); + + if (!upw || !upw->clientWindow) { + Debug("Hiding FAILED!\n"); + return FALSE; + } + + if (upw->isHidden) { + Atom data[5] = {0, 0, 0, 0, 0}; + + /* + * Unfortunately the _NET_WM_STATE messages only work for windows that are already + * mapped, i.e. not iconified or withdrawn. + */ + if (!upw->isMinimized) { + XMapRaised(up->display, upw->clientWindow); + } + + data[0] = _NET_WM_STATE_REMOVE; + data[1] = up->atoms._NET_WM_STATE_HIDDEN; + data[3] = 2; // Message is from the pager/taskbar + UnityPlatformSendClientMessage(up, upw->rootWindow, upw->clientWindow, + up->atoms._NET_WM_STATE, 32, 4, data); + + upw->wantInputFocus = TRUE; + upw->isHidden = FALSE; + } + + return TRUE; +} + + +/* + *---------------------------------------------------------------------------- + * + * UnityPlatformHideWindow -- + * + * Hides window. If the window is already hidden it stays hidden. Hides + * maximized and minimized windows too. + * + * Results: + * FALSE if the Window handle is invalid. + * TRUE otherwise. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +Bool +UnityPlatformHideWindow(UnityPlatform *up, // IN + UnityWindowId window) // IN +{ + UnityPlatformWindow *upw; + + ASSERT(up); + + upw = UPWindow_Lookup(up, window); + + if (!upw + || !upw->clientWindow) { + Debug("Hiding FAILED!\n"); + return FALSE; + } + + if (!upw->isHidden) { + Atom data[5] = {0, 0, 0, 0, 0}; + + upw->isHidden = TRUE; + + data[0] = _NET_WM_STATE_ADD; + data[1] = up->atoms._NET_WM_STATE_HIDDEN; + data[3] = 2; // Message is from a pager/taskbar/etc. + UnityPlatformSendClientMessage(up, upw->rootWindow, upw->clientWindow, + up->atoms._NET_WM_STATE, 32, 4, data); + } + + return TRUE; +} + + +/* + *---------------------------------------------------------------------------- + * + * UnityPlatformMinimizeWindow -- + * + * Mimimizes window. If the window is already mimimized it stays minimized. + * + * Results: + * FALSE if the Window handle is invalid. + * TRUE otherwise. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +Bool +UnityPlatformMinimizeWindow(UnityPlatform *up, // IN + UnityWindowId window) // IN +{ + UnityPlatformWindow *upw; + + ASSERT(up); + + upw = UPWindow_Lookup(up, window); + + if (!upw + || !upw->clientWindow) { + Debug("Minimizing FAILED!\n"); + return FALSE; + } + + Debug("UnityPlatformMinimizeWindow(%#lx)\n", upw->toplevelWindow); + upw->wantInputFocus = FALSE; + if (!upw->isMinimized) { + Atom data[5] = {0, 0, 0, 0, 0}; + + Debug("Minimizing window %#x\n", window); + upw->isMinimized = TRUE; + data[0] = _NET_WM_STATE_ADD; + if (UnityPlatformWMProtocolSupported(up, UNITY_X11_WM__NET_WM_STATE_MINIMIZED)) { + data[1] = up->atoms._NET_WM_STATE_MINIMIZED; + } else { + data[1] = up->atoms._NET_WM_STATE_HIDDEN; + } + data[3] = 2; // Message is from a pager/taskbar/etc. + UnityPlatformSendClientMessage(up, upw->rootWindow, upw->clientWindow, + up->atoms._NET_WM_STATE, 32, 4, data); + + XIconifyWindow(up->display, upw->clientWindow, 0); + } else { + Debug("Window %#x is already minimized\n", window); + } + + + return TRUE; +} + + +/* + *---------------------------------------------------------------------------- + * + * UnityPlatformMaximizeWindow -- + * + * Maximizes window. If the window is already maximized it will stay so. + * + * Results: + * FALSE if the Window handle is invalid. + * TRUE otherwise. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +Bool +UnityPlatformMaximizeWindow(UnityPlatform *up, // IN + UnityWindowId window) // IN +{ + UnityPlatformWindow *upw; + + ASSERT(up); + + upw = UPWindow_Lookup(up, window); + + if (!upw + || !upw->clientWindow) { + Debug("Maximizing FAILED!\n"); + return FALSE; + } + + if (!upw->isMaximized) { + Atom data[5] = {0, 0, 0, 0, 0}; + + upw->isMaximized = TRUE; + data[0] = _NET_WM_STATE_ADD; + data[1] = up->atoms._NET_WM_STATE_MAXIMIZED_HORZ; + data[2] = up->atoms._NET_WM_STATE_MAXIMIZED_VERT; + data[3] = 2; // Message is from a pager/taskbar/etc. + UnityPlatformSendClientMessage(up, upw->rootWindow, upw->clientWindow, + up->atoms._NET_WM_STATE, 32, 4, data); + } + + return TRUE; +} + + +/* + *---------------------------------------------------------------------------- + * + * UnityPlatformUnmaximizeWindow -- + * + * Unmaximizes window. If the window is already unmaximized, it will stay + * that way. + * + * Results: + * FALSE if the Window handle is invalid. + * TRUE otherwise. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +Bool +UnityPlatformUnmaximizeWindow(UnityPlatform *up, // IN + UnityWindowId window) // IN +{ + UnityPlatformWindow *upw; + + ASSERT(up); + + upw = UPWindow_Lookup(up, window); + + if (!upw + || !upw->clientWindow) { + Debug("Maximizing FAILED!\n"); + return FALSE; + } + + if (upw->isMaximized) { + Atom data[5] = {0, 0, 0, 0, 0}; + + data[0] = _NET_WM_STATE_REMOVE; + data[1] = up->atoms._NET_WM_STATE_MAXIMIZED_HORZ; + data[2] = up->atoms._NET_WM_STATE_MAXIMIZED_VERT; + data[3] = 2; // Message is from a pager/taskbar/etc. + UnityPlatformSendClientMessage(up, upw->rootWindow, upw->clientWindow, + up->atoms._NET_WM_STATE, 32, 4, data); + + upw->isMaximized = FALSE; + } + + return TRUE; +} + + +/* + *------------------------------------------------------------------------------ + * + * UnityPlatformSetWindowDesktop -- + * + * Move the window to the specified desktop. The desktopId is an index + * into the desktop configuration array. + * + * Results: + * Returns TRUE if successful, and FALSE otherwise. + * + * Side effects: + * None. + * + *------------------------------------------------------------------------------ + */ + +Bool +UnityPlatformSetWindowDesktop(UnityPlatform *up, // IN + UnityWindowId windowId, // IN + UnityDesktopId desktopId) // IN +{ + UnityPlatformWindow *upw; + Atom data[5] = {0, 0, 0, 0, 0}; + uint32 guestDesktopId; + + ASSERT(up); + + upw = UPWindow_Lookup(up, windowId); + + if (!upw + || !upw->clientWindow) { + Debug("Desktop change FAILED on %#lx (perhaps it has no clientWindow)!\n", + upw ? upw->toplevelWindow : 0); + return FALSE; + } + + /* + * XXX I wrote this code assuming that UnityWindowTracker on the + * guest side will be updated with the latest settings as they come + * from the host, but that is not currently the case. unity.c needs + * fixing. + */ + + ASSERT(desktopId < up->desktopInfo.numDesktops); + guestDesktopId = up->desktopInfo.unityDesktopToGuest[desktopId]; + + if (!upw->isViewable) { + Atom currentDesktop = guestDesktopId; // Cast for 64-bit correctness. + + /* + * Sending the _NET_WM_DESKTOP client message only works if the + * window is mapped. We should still send that message to + * eliminate race conditions, but if the window is not mapped, we + * also need to set the property on the window so that it shows + * up on the correct desktop when it is re-mapped. + */ + + XChangeProperty(up->display, (Window)upw->clientWindow, up->atoms._NET_WM_DESKTOP, + XA_CARDINAL, 32, PropModeReplace, (unsigned char *)¤tDesktop, 1); + } + + data[0] = guestDesktopId; + data[1] = 2; // Indicates that this was requested by the pager/taskbar/etc. + UnityPlatformSendClientMessage(up, + upw->rootWindow, + upw->clientWindow, + up->atoms._NET_WM_DESKTOP, + 32, 5, data); + + return TRUE; +} diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/unity/unityX11.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/unity/unityX11.h --- open-vm-tools-2008.01.23-74039/lib/unity/unityX11.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/unity/unityX11.h 2008-10-13 08:01:51.000000000 +0100 @@ -0,0 +1,403 @@ +/********************************************************* + * Copyright (C) 2007-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. + * + *********************************************************/ + +/* + * unityX11.h -- + * + * Internal state shared between the various modules that implement Unity for X11. + */ + +#ifndef _UNITY_X11_H_ +#define _UNITY_X11_H_ + +/* + * It's necessary to include glib, gtk+, and Xlib before the rest of the header files, + * and then #undef bool. This is because Xlib has '#define Bool int', while + * vm_basic_types.h has 'typedef char Bool;'. + */ +#include <glib.h> +#include <gdk/gdkx.h> +#include <gtk/gtk.h> +#include <X11/Xlib.h> +#include <X11/Xmd.h> +#include <X11/Xatom.h> +#include <X11/Xutil.h> +#include <X11/extensions/scrnsaver.h> +#if defined(ScreenSaverMajorVersion) && defined(ScreenSaverMinorVersion) +#define VM_HAVE_X11_SS_EXT 1 +#endif +#include <X11/extensions/shape.h> +#if defined(ShapeNumberEvents) +#define VM_HAVE_X11_SHAPE_EXT 1 +#endif +#undef Bool + +#include "vmware.h" +#include "rpcin.h" +#include "rpcout.h" +#include "unity.h" +#include "unityCommon.h" +#include "unityPlatform.h" +#include "debug.h" +#include "str.h" +#include "strutil.h" +#include "util.h" +#include <string.h> +#include <unistd.h> +#include <stdlib.h> + +/* + * These defines are listed in the EWMH spec, but not available in any header file that I + * know of. + */ +#ifndef _NET_WM_ORIENTATION_HORZ +#define _NET_WM_ORIENTATION_HORZ 0 +#define _NET_WM_ORIENTATION_VERT 1 + +#define _NET_WM_TOPLEFT 0 +#define _NET_WM_TOPRIGHT 1 +#define _NET_WM_BOTTOMRIGHT 2 +#define _NET_WM_BOTTOMLEFT 3 + +#define _NET_WM_STATE_REMOVE 0 +#define _NET_WM_STATE_ADD 1 +#endif + +/* + * These describe system settings saved when entering Unity mode, and restored upon + * exiting. + */ +typedef enum { + UNITY_UI_SCREENSAVER, + UNITY_UI_TASKBAR_VISIBLE, +#ifdef VM_UNIMPLEMENTED_UNITY_SETTINGS + UNITY_UI_DROP_SHADOW, + UNITY_UI_MENU_ANIMATION, + UNITY_UI_TOOLTIP_ANIMATION, + UNITY_UI_WINDOW_ANIMATION, + UNITY_UI_FULL_WINDOW_DRAG, +#endif + + UNITY_UI_MAX_SETTINGS +} UnityUISetting; + +typedef enum { + UNITY_X11_WM__NET_MOVERESIZE_WINDOW, + UNITY_X11_WM__NET_CLOSE_WINDOW, + UNITY_X11_WM__NET_RESTACK_WINDOW, + UNITY_X11_WM__NET_ACTIVE_WINDOW, + UNITY_X11_WM__NET_WM_ACTION_MINIMIZE, + UNITY_X11_WM__NET_WM_ACTION_CLOSE, + UNITY_X11_WM__NET_WM_ACTION_SHADE, + UNITY_X11_WM__NET_WM_ACTION_STICK, + UNITY_X11_WM__NET_WM_ACTION_FULLSCREEN, + UNITY_X11_WM__NET_WM_ACTION_MAXIMIZE_HORZ, + UNITY_X11_WM__NET_WM_ACTION_MAXIMIZE_VERT, + UNITY_X11_WM__NET_FRAME_EXTENTS, + UNITY_X11_WM__NET_WM_STRUT_PARTIAL, + UNITY_X11_WM__NET_WM_STATE_HIDDEN, + UNITY_X11_WM__NET_WM_STATE_MINIMIZED, + + UNITY_X11_MAX_WM_PROTOCOLS +} UnityX11WMProtocol; + +typedef enum { + UNITY_X11_WIN_WM_DELETE_WINDOW, + UNITY_X11_MAX_WIN_PROTOCOLS +} UnityX11WinProtocol; + + +/* + * UnitySpecialWindow objects track windows that need special treatment, including root + * windows and windows that we create. + */ +typedef struct UnitySpecialWindow UnitySpecialWindow; +typedef void (*UnitySpecialEventHandler)(UnityPlatform *up, + UnitySpecialWindow *usw, + const XEvent *xevent, + Window realEventWindow); + +struct UnitySpecialWindow { + UnitySpecialEventHandler evHandler; + Window *windows; + size_t numWindows; + Bool windowsAreOwned; +}; + +typedef struct UnityPlatformWindow UnityPlatformWindow; + +/* + * Holds platform-specific data. + */ +struct _UnityPlatform { + Display *display; // X11 display object + long eventTimeDiff; // Diff between X server time and our local time + guint unityDisplayWatchID; // Manages listening to the display from the glib main loop + + struct { // Atoms that we'll find useful + Atom _NET_WM_WINDOW_TYPE, + _NET_WM_WINDOW_TYPE_DESKTOP, + _NET_WM_WINDOW_TYPE_DOCK, + _NET_WM_WINDOW_TYPE_TOOLBAR, + _NET_WM_WINDOW_TYPE_TOOLTIP, + _NET_WM_WINDOW_TYPE_DROPDOWN_MENU, + _NET_WM_WINDOW_TYPE_POPUP_MENU, + _NET_WM_WINDOW_TYPE_MENU, + _NET_WM_WINDOW_TYPE_UTILITY, + _NET_WM_WINDOW_TYPE_SPLASH, + _NET_WM_WINDOW_TYPE_DIALOG, + _NET_WM_WINDOW_TYPE_NORMAL, + _NET_WM_WINDOW_TYPE_DND, + _NET_WM_ALLOWED_ACTIONS, + _NET_WM_ACTION_MOVE, + _NET_WM_ACTION_RESIZE, + _NET_WM_ACTION_MINIMIZE, + _NET_WM_ACTION_SHADE, + _NET_WM_ACTION_STICK, + _NET_WM_ACTION_MAXIMIZE_HORZ, + _NET_WM_ACTION_MAXIMIZE_VERT, + _NET_WM_ACTION_FULLSCREEN, + _NET_WM_ACTION_CHANGE_DESKTOP, + _NET_WM_ACTION_CLOSE, + _NET_WM_STATE, + _NET_WM_STATE_HIDDEN, + _NET_WM_STATE_MODAL, + _NET_WM_STATE_STICKY, + _NET_WM_STATE_MINIMIZED, + _NET_WM_STATE_MAXIMIZED_HORZ, + _NET_WM_STATE_MAXIMIZED_VERT, + _NET_WM_STATE_SHADED, + _NET_WM_STATE_SKIP_TASKBAR, + _NET_WM_STATE_SKIP_PAGER, + _NET_WM_STATE_FULLSCREEN, + _NET_WM_STATE_ABOVE, + _NET_WM_STATE_BELOW, + _NET_WM_STATE_DEMANDS_ATTENTION, + _NET_WM_USER_TIME, + _NET_WM_USER_TIME_WINDOW, + _NET_ACTIVE_WINDOW, + _NET_RESTACK_WINDOW, + _NET_WM_PID, + _NET_WM_ICON, + _NET_MOVERESIZE_WINDOW, + _NET_CLOSE_WINDOW, + _NET_WM_STRUT, + _NET_WM_STRUT_PARTIAL, + _NET_NUMBER_OF_DESKTOPS, + _NET_WM_DESKTOP, + _NET_CURRENT_DESKTOP, + _NET_DESKTOP_LAYOUT, + _NET_SUPPORTED, + _NET_FRAME_EXTENTS, + WM_CLASS, + WM_DELETE_WINDOW, + WM_ICON, + WM_NAME, + WM_PROTOCOLS, + WM_STATE, + WM_TRANSIENT_FOR; + } atoms; + + UnityWindowTracker *tracker; + UnityUpdateThreadData updateData; + + /* + * This tracks all toplevel windows, whether or not they are showing through to the + * window tracker. It also has entries for client windows (which point to the same + * UnityPlatformWindow objects). + */ + HashTable *allWindows; + UnityPlatformWindow *topWindow; // For tracking Z-ordering + + /* + * This tracks "special" windows, including root windows, the DnD detection window, + * and the work area-faking window(s). It's mainly used to make sure these windows + * get proper event handling. + */ + HashTable *specialWindows; + UnitySpecialWindow *rootWindows; + + UnityPlatformWindow *desktopWindow; + UnityDnD dnd; + + UnitySpecialWindow *workAreas; + + UnityRect *needWorkAreas; + int needNumWorkAreas; + + struct { + /* + * Hopefully, most of the time the desktopIDs on host and guest + * will be the same, but we can't count on it, so these two arrays + * translate back and forth between guest and unity desktop IDs. + */ + UnityDesktopId *guestDesktopToUnity; + uint32 *unityDesktopToGuest; + size_t numDesktops; + + Atom layoutData[4]; + + Atom savedLayoutData[4]; + size_t savedNumDesktops; + uint32 savedCurrentDesktop; + uint32 currentDesktop; + /* + * Set by the set.desktop.active RPC to indicate which desktop the host is in + * when we enter Unity. + */ + uint32 initialDesktop; +#define UNITY_X11_INITIALDESKTOP_UNSET MAX_UINT32 + } desktopInfo; + + Bool isRunning; + Bool stackingChanged; + + Bool haveOriginalSettings; + Bool currentSettings[UNITY_UI_MAX_SETTINGS]; + Bool originalSettings[UNITY_UI_MAX_SETTINGS]; + Bool needTaskbarSetting; + + int savedScreenSaverTimeout; + + Bool wmProtocols[UNITY_X11_MAX_WM_PROTOCOLS]; + + int shapeEventBase; + int shapeErrorBase; +}; + +/* + * Holds per-window platform-specific data. + */ + +struct UnityPlatformWindow { + int refs; + + /* + * In X11, we want to watch both the top-level window (normally created by the window + * manager) and the application's window. The UnityWindowId will correspond to the + * former - to save lookups later, we track both of them here, as well as their root + * window. + */ + Window toplevelWindow; + Window clientWindow; + Window rootWindow; + int screenNumber; + int desktopNumber; + UnityPlatformWindow *higherWindow; + UnityPlatformWindow *lowerWindow; + + UnityWindowType windowType; + + struct { + DynBuf data; + UnityIconSize size; + UnityIconType type; + } iconPng; + + XConfigureEvent *lastConfigureEvent; // Used for replying to MoveResizeWindow + Bool windowProtocols[UNITY_X11_MAX_WIN_PROTOCOLS]; + + Bool isRelevant; // Whether the window is relayed through the window tracker + Bool isOverrideRedirect; // Allow detecting changes in this attr + Bool isViewable; + Bool wasViewable; + Bool wantInputFocus; + + /* + * Mini state-machine: + * + * isMaximized, isMinimized, and isHidden can all be set or unset independently + * from the host's perspective. + * + * isMaximized can pretty much be set independently. + * Leaving isHidden requires WM_HINTS to be set correctly. + * Entering isHidden requires XWithdrawWindow. + * If !isHidden, !isMinimized -> isMinimized requires XIconifyWindow() + * If !isHidden, isMinimized -> !isMinimized requires just mapping the window. + */ + Bool isHidden; + Bool isMinimized; + Bool isMaximized; + + /* + * When a client window is reparented by a window manager, a ReparentNotify event + * is generated. We're interested in this event, because it tells us that the + * relationship between this UnityPlatformWindow and its top-level and client + * windows has changed. + * + * Per ICCCM §4.1.3.1, we identify the client window as the window within a + * tree possessing the WM_STATE property. Unfortunately, this property may + * not yet be set when we receive ReparentNotify. If that's the case, this flag + * is raised such that once we do see a WM_STATE change related to one of + * our windows (via a PropertyNotify event), we may act accordingly. + */ + Bool waitingForWmState; +}; + +/* + * Implemented by unityPlatformX11Window.c + */ +void UPWindow_ProcessEvent(UnityPlatform *up, + UnityPlatformWindow *upw, + Window realEventWindow, + const XEvent *xevent); +UnityPlatformWindow *UPWindow_Create(UnityPlatform *up, Window window); +void UPWindow_CheckRelevance(UnityPlatform *up, + UnityPlatformWindow *upw, + const XEvent *motivator); +void UPWindow_Ref(UnityPlatform *up, UnityPlatformWindow *upw); +void UPWindow_Restack(UnityPlatform *up, UnityPlatformWindow *upw, Window above); +void UPWindow_Unref(UnityPlatform *up, UnityPlatformWindow *upw); +Bool UPWindow_ProtocolSupported(const UnityPlatform *up, + const UnityPlatformWindow *upw, + UnityX11WinProtocol proto); +UnityPlatformWindow *UPWindow_Lookup(UnityPlatform *up, Window window); +void UPWindow_SetUserTime(UnityPlatform *up, + UnityPlatformWindow *upw); + +/* + * Implemented by unityPlatformX11.c + */ +Bool UnityPlatformWMProtocolSupported(UnityPlatform *up, UnityX11WMProtocol proto); +Bool UnityPlatformIsRootWindow(UnityPlatform *up, Window window); +void UnityPlatformSendPendingUpdates(UnityPlatform *up, int flags); +uint32 UnityX11GetCurrentDesktop(UnityPlatform *up); +void UnityX11SetCurrentDesktop(UnityPlatform *up, uint32 currentDesktop); +Time UnityPlatformGetServerTime(UnityPlatform *up); + +#if GTK_MAJOR_VERSION >= 2 +# define UnityPlatformProcessMainLoop() g_main_context_iteration(NULL, TRUE) +#else +# define UnityPlatformProcessMainLoop() gtk_main_iteration() +#endif + +int UnityPlatformGetErrorCount(UnityPlatform *up); +void UnityPlatformResetErrorCount(UnityPlatform *up); +void UnityPlatformDumpUpdate(UnityPlatform *up); +Bool UnityPlatformSetTaskbarVisible(UnityPlatform *up, Bool currentSetting); +void UnityPlatformSendClientMessage(UnityPlatform *up, Window destWindow, + Window w, Atom messageType, + int format, int numItems, const void *data); +void UnityPlatformSyncDesktopConfig(UnityPlatform *up); +void UnityX11SaveSystemSettings(UnityPlatform *up); +void UnityX11RestoreSystemSettings(UnityPlatform *up); +size_t UnityPlatformGetNumVirtualDesktops(UnityPlatform *up); +void UnityPlatformGetVirtualDesktopLayout(UnityPlatform *up, Atom *layoutData); +const char *UnityPlatformGetEventString(UnityPlatform *up, int type); + +#endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/unityStub/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/unityStub/Makefile.am --- open-vm-tools-2008.01.23-74039/lib/unityStub/Makefile.am 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/unityStub/Makefile.am 2008-10-13 08:01:48.000000000 +0100 @@ -0,0 +1,24 @@ +################################################################################ +### Copyright 2008 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_LIBRARIES = libUnityStub.a + +libUnityStub_a_SOURCES = +libUnityStub_a_SOURCES += unityStub.c + +AM_CFLAGS = @GTK_CPPFLAGS@ +AM_CFLAGS += @LIB_FILE_CPPFLAGS@ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/unityStub/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/unityStub/Makefile.in --- open-vm-tools-2008.01.23-74039/lib/unityStub/Makefile.in 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/unityStub/Makefile.in 2008-10-13 08:02:16.000000000 +0100 @@ -0,0 +1,495 @@ +# 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 2008 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/unityStub +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)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) +ARFLAGS = cru +libUnityStub_a_AR = $(AR) $(ARFLAGS) +libUnityStub_a_LIBADD = +am_libUnityStub_a_OBJECTS = unityStub.$(OBJEXT) +libUnityStub_a_OBJECTS = $(am_libUnityStub_a_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 = $(libUnityStub_a_SOURCES) +DIST_SOURCES = $(libUnityStub_a_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_XLIBS = @COMMON_XLIBS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ +DNET_LIBS = @DNET_LIBS@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ +GTK_LIBS = @GTK_LIBS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ +HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ +MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ +RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ +VERSION = @VERSION@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +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@ +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@ +lt_ECHO = @lt_ECHO@ +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_LIBRARIES = libUnityStub.a +libUnityStub_a_SOURCES = unityStub.c +AM_CFLAGS = @GTK_CPPFLAGS@ @LIB_FILE_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/unityStub/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu lib/unityStub/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-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) +libUnityStub.a: $(libUnityStub_a_OBJECTS) $(libUnityStub_a_DEPENDENCIES) + -rm -f libUnityStub.a + $(libUnityStub_a_AR) libUnityStub.a $(libUnityStub_a_OBJECTS) $(libUnityStub_a_LIBADD) + $(RANLIB) libUnityStub.a + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unityStub.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 $(LIBRARIES) +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-noinstLIBRARIES \ + 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-noinstLIBRARIES 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: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/unityStub/unityStub.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/unityStub/unityStub.c --- open-vm-tools-2008.01.23-74039/lib/unityStub/unityStub.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/unityStub/unityStub.c 2008-10-13 08:01:51.000000000 +0100 @@ -0,0 +1,87 @@ +/********************************************************* + * Copyright (C) 2006 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. + * + *********************************************************/ + +/* + * UnityStub.c -- + * + * Unity functions. + */ + +#include "rpcin.h" +#include "guestApp.h" +#include "unity.h" + +/* + *----------------------------------------------------------------------------- + * + * Unity_Init -- + * + * One time initialization stuff. + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +void +Unity_Init(GuestApp_Dict *conf, + int* blockingWndList) +{ +} + +void +Unity_InitBackdoor(struct RpcIn *rpcIn) +{ +} + +Bool +Unity_IsSupported(void) +{ + return FALSE; +} + +void +Unity_SetActiveDnDDetWnd(UnityDnD *state) +{ +} + +void +Unity_Exit(void) +{ +} + +void +Unity_Cleanup(void) +{ +} + +void +Unity_RegisterCaps(void) +{ +} + +void +Unity_UnregisterCaps(void) +{ +} + + diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/unityWindowTracker/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/unityWindowTracker/Makefile.am --- open-vm-tools-2008.01.23-74039/lib/unityWindowTracker/Makefile.am 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/unityWindowTracker/Makefile.am 2008-10-13 08:01:48.000000000 +0100 @@ -0,0 +1,21 @@ +################################################################################ +### Copyright 2008 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_LIBRARIES = libUnityWindowTracker.a + +libUnityWindowTracker_a_SOURCES = +libUnityWindowTracker_a_SOURCES += unityWindowTracker.c diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/unityWindowTracker/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/unityWindowTracker/Makefile.in --- open-vm-tools-2008.01.23-74039/lib/unityWindowTracker/Makefile.in 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/unityWindowTracker/Makefile.in 2008-10-13 08:02:16.000000000 +0100 @@ -0,0 +1,495 @@ +# 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 2008 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/unityWindowTracker +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)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) +ARFLAGS = cru +libUnityWindowTracker_a_AR = $(AR) $(ARFLAGS) +libUnityWindowTracker_a_LIBADD = +am_libUnityWindowTracker_a_OBJECTS = unityWindowTracker.$(OBJEXT) +libUnityWindowTracker_a_OBJECTS = \ + $(am_libUnityWindowTracker_a_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 = $(libUnityWindowTracker_a_SOURCES) +DIST_SOURCES = $(libUnityWindowTracker_a_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_XLIBS = @COMMON_XLIBS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ +DNET_LIBS = @DNET_LIBS@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ +GTK_LIBS = @GTK_LIBS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ +HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ +MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ +RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ +VERSION = @VERSION@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +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@ +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@ +lt_ECHO = @lt_ECHO@ +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_LIBRARIES = libUnityWindowTracker.a +libUnityWindowTracker_a_SOURCES = unityWindowTracker.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/unityWindowTracker/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu lib/unityWindowTracker/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-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) +libUnityWindowTracker.a: $(libUnityWindowTracker_a_OBJECTS) $(libUnityWindowTracker_a_DEPENDENCIES) + -rm -f libUnityWindowTracker.a + $(libUnityWindowTracker_a_AR) libUnityWindowTracker.a $(libUnityWindowTracker_a_OBJECTS) $(libUnityWindowTracker_a_LIBADD) + $(RANLIB) libUnityWindowTracker.a + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unityWindowTracker.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 $(LIBRARIES) +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-noinstLIBRARIES \ + 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-noinstLIBRARIES 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: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/unityWindowTracker/unityWindowTracker.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/unityWindowTracker/unityWindowTracker.c --- open-vm-tools-2008.01.23-74039/lib/unityWindowTracker/unityWindowTracker.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/unityWindowTracker/unityWindowTracker.c 2008-10-13 08:01:53.000000000 +0100 @@ -0,0 +1,1414 @@ +/********************************************************* + * Copyright (C) 2007 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. + * + *********************************************************/ + +/* + * unityWindowTracker.h -- + * + * Used to buffer state about a window manager. + */ + +#include "vmware.h" +#include "str.h" +#include "util.h" +#include "log.h" +#include "unityWindowTracker.h" + +#define LOGLEVEL_MODULE uwt +#include "loglevel_user.h" + +/* + * Helper Functions -- + */ + +static void FreeWindowInfo(UnityWindowInfo *info); +static int RemoveUntouchedWindow(const char *key, void *value, + void *clientData); +static int GarbageCollectRemovedWindows(const char *key, void *value, + void *clientData); +static int ResetChangedBits(const char *key, void *value, void *clientData); +static int PushUpdates(const char *key, void *value, void *clientData); +static Bool TitlesEqual(DynBuf *first, DynBuf *second); +static int PushZOrder(UnityWindowTracker *tracker); +static int PushActiveDesktop(UnityWindowTracker *tracker); + + +/* + *---------------------------------------------------------------------------- + * + * UnityWindowTracker_Init -- + * + * Create a new unity window tracker. The client should pass in a + * callbacks object, which will be used to notify them of updates + * in UnityWindowTracker_RequestUpdates. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +void +UnityWindowTracker_Init(UnityWindowTracker *tracker, // IN + UnityUpdateCallback cb) // IN +{ + memset(tracker, 0, sizeof(UnityWindowTracker)); + tracker->cb = cb; + tracker->windows = HashTable_Alloc(128, HASH_INT_KEY, + (HashTableFreeEntryFn)FreeWindowInfo); +} + + +/* + *---------------------------------------------------------------------------- + * + * UnityWindowTracker_Cleanup -- + * + * Destory a unity window tracker. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +void +UnityWindowTracker_Cleanup(UnityWindowTracker *tracker) // IN +{ + HashTable_Free(tracker->windows); + memset(tracker, 0, sizeof(UnityWindowTracker)); +} + + +/* + *----------------------------------------------------------------------------- + * + * UnityWindowTracker_SetDataFreeFunc -- + * + * Sets the function that will be called to free the app data associated with a + * window. + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +void +UnityWindowTracker_SetDataFreeFunc(UnityWindowTracker *tracker, // IN + UnityDataFreeFunc freeFn) // IN +{ + tracker->freeFn = freeFn; +} + + +/* + *---------------------------------------------------------------------------- + * + * UnityWindowTracker_LookupWindow -- + * + * Returns the window with the specified window id, or NULL if no + * such window exists. + * + * Results: + * See above. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +UnityWindowInfo * +UnityWindowTracker_LookupWindow(UnityWindowTracker *tracker, // IN + UnityWindowId id) // IN +{ + UnityWindowInfo *info = NULL; + HashTable_Lookup(tracker->windows, (const char *)(long)id, (void **)&info); + return info; +} + + +/* + *---------------------------------------------------------------------------- + * + * UnityWindowTracker_AddWindow -- + * + * Add a new window to the window tracker + * + * Results: + * A pointer to the UnityWindowInfo for the added window + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +UnityWindowInfo * +UnityWindowTracker_AddWindow(UnityWindowTracker *tracker, // IN + UnityWindowId id) // IN +{ + UnityWindowInfo *info = UnityWindowTracker_LookupWindow(tracker, id); + if (!info) { + info = (UnityWindowInfo *)Util_SafeCalloc(1, sizeof(UnityWindowInfo)); + info->tracker = tracker; + info->id = id; + info->type = UNITY_WINDOW_TYPE_NONE; + info->desktopId = tracker->activeDesktopId; + DynBuf_Init(&info->titleUtf8); + LOG(2, ("Unity adding new window (id:%d)\n", id)); + HashTable_Insert(tracker->windows, (const char *)(long)id, info); + info->changed |= UNITY_CHANGED_ADDED; + info->changed |= UNITY_CHANGED_WINDOW_DESKTOP; + } else { + info->changed &= ~UNITY_CHANGED_REMOVED; + LOG(2, ("Window already exists in UnityAddWindow (id:%d)\n", id)); + } + info->touched = TRUE; + + return info; +} + + +/* + *---------------------------------------------------------------------------- + * + * UnityWindowTracker_AddWindowWithData -- + * + * Add a new window to the window tracker, and sets its application data to the + * specified 'data'. The tracker's DataFreeFunc will be used to free 'data' when it + * needs to be destroyed (see UnityWindowTracker_SetDataFreeFunc). If the window + * already exists and has 'data' set on it, that will be destroyed and replaced with + * the new 'data' pointer. + * + * Results: + * A pointer to the UnityWindowInfo for the added window. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +UnityWindowInfo * +UnityWindowTracker_AddWindowWithData(UnityWindowTracker *tracker, // IN + UnityWindowId id, // IN + void *data) // IN +{ + UnityWindowInfo *info = UnityWindowTracker_AddWindow(tracker, id); + + if (info) { + if (info->data + && tracker->freeFn + && (info->data != data)) { + tracker->freeFn(tracker, info, info->data); + } + + info->data = data; + } + + return info; +} + + +/* + *---------------------------------------------------------------------------- + * + * UnityWindowTracker_MoveWindow -- + * + * Notify the window tracker that the window with the specified id + * has moved. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +void +UnityWindowTracker_MoveWindow(UnityWindowTracker *tracker, // IN + UnityWindowId id, // IN + int x1, // IN + int y1, // IN + int x2, // IN + int y2) // IN +{ + UnityWindowInfo *info = UnityWindowTracker_LookupWindow(tracker, id); + if (info) { + info->touched = TRUE; + if (info->rect.x1 != x1 || info->rect.y1 != y1 + || x2 != info->rect.x2 || y2 != info->rect.y2) { + LOG(2, ("Unity moving window (id:%d pos:%d,%d, %d,%d)\n", id, x1, y1, x2, y2)); + info->rect.x1 = x1; + info->rect.y1 = y1; + info->rect.x2 = x2; + info->rect.y2 = y2; + info->changed |= UNITY_CHANGED_POSITION; + } + } +} + + +/* + *---------------------------------------------------------------------------- + * + * UnityWindowTracker_SetWindowTitle -- + * + * Notify the window tracker that the window with the specified id + * has changed its title. + * + * This function does not take ownership of the DynBuf; caller + * is assumed to free it. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +void +UnityWindowTracker_SetWindowTitle(UnityWindowTracker *tracker, // IN + UnityWindowId id, // IN + DynBuf *titleUtf8) // IN +{ + UnityWindowInfo *info = UnityWindowTracker_LookupWindow(tracker, id); + if (info) { + info->touched = TRUE; + if (!TitlesEqual(&info->titleUtf8, titleUtf8)) { + LOG(2, ("Unity setting window title (id:%d title:%s)\n", id, + (const unsigned char*)DynBuf_Get(titleUtf8))); + info->changed |= UNITY_CHANGED_TITLE; + DynBuf_Destroy(&info->titleUtf8); + DynBuf_Copy(titleUtf8, &info->titleUtf8); + } + } +} + + +/* + *---------------------------------------------------------------------------- + * + * UnityWindowTracker_ChangeWindowRegion -- + * + * Change the window region of the specified window. A NULL region + * means the window region is simply the bounds of the window. + * + * This function does not take ownership of the RegionPtr; caller is + * assumed to free it. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +void +UnityWindowTracker_ChangeWindowRegion(UnityWindowTracker *tracker, // IN + UnityWindowId id, // IN + RegionPtr region) // IN +{ + UnityWindowInfo *info = UnityWindowTracker_LookupWindow(tracker, id); + if (info) { + info->touched = TRUE; + if (region) { + if (!info->region) { + LOG(2, ("Unity adding window region (id:%d)\n", id)); + info->changed |= UNITY_CHANGED_REGION; + info->region = miRegionCreate(&miEmptyBox, 0); + } + if (!miRegionsEqual(info->region, region)) { + LOG(2, ("Unity changing window region (id:%d)\n", id)); + info->changed |= UNITY_CHANGED_REGION; + miRegionCopy(info->region, region); + } + } else { + if (info->region) { + LOG(2, ("Unity removing window region (id:%d)\n", id)); + info->changed |= UNITY_CHANGED_REGION; + miRegionDestroy(info->region); + info->region = NULL; + } + } + } +} + + +/* + *---------------------------------------------------------------------------- + * + * UnityWindowTracker_ChangeWindowState -- + * + * Change window state (minimized or not) of the specified window. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +void +UnityWindowTracker_ChangeWindowState(UnityWindowTracker *tracker, // IN + UnityWindowId id, // IN + uint32 state) // IN +{ + UnityWindowInfo *info = UnityWindowTracker_LookupWindow(tracker, id); + if (info) { + info->touched = TRUE; + if (state != info->state) { + info->changed |= UNITY_CHANGED_WINDOW_STATE; + info->state = state; + LOG(2, ("Unity changing window state (id:%d) to %d\n", id, state)); + } + } +} + + +/* + *---------------------------------------------------------------------------- + * + * UnityWindowTracker_GetWindowState -- + * + * Get window state (minimized or not) of the specified window. + * + * Results: + * TRUE if the window exists in the window tracker. + * FALSE otherwise. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +Bool +UnityWindowTracker_GetWindowState(UnityWindowTracker *tracker, // IN + UnityWindowId id, // IN + uint32 *state) // IN +{ + UnityWindowInfo *info = UnityWindowTracker_LookupWindow(tracker, id); + ASSERT(state); + if (info) { + *state = info->state; + return TRUE; + } + return FALSE; +} + + +/* + *----------------------------------------------------------------------------- + * + * UnityWindowTracker_ChangeWindowAttribute -- + * + * Sets the value of a particular attribute on a particular window. + * + * Results: + * None. + * + * Side effects: + * Marks the window tracker as having updates. + * + *----------------------------------------------------------------------------- + */ + +void +UnityWindowTracker_ChangeWindowAttribute(UnityWindowTracker *tracker, // IN + UnityWindowId id, // IN + UnityWindowAttribute attr, // IN + Bool enabled) // IN +{ + UnityWindowInfo *info; + ASSERT(tracker); + ASSERT(attr < UNITY_MAX_ATTRIBUTES); + + info = UnityWindowTracker_LookupWindow(tracker, id); + if (info) { + info->touched = TRUE; + + /* + * If this is a new attribute (that didn't exist before) or + * if the attribute value has changed, remember the new value + * (enabled or disabled) and mark it as existing and + * changed. + */ + + if (!(info->attributes[attr] & UNITY_INFO_ATTR_EXISTS) || + ((info->attributes[attr] & UNITY_INFO_ATTR_ENABLED) != + (enabled ? UNITY_INFO_ATTR_ENABLED : 0))) { + info->changed |= UNITY_CHANGED_WINDOW_ATTRIBUTES; + info->attributes[attr] = (UNITY_INFO_ATTR_EXISTS | + UNITY_INFO_ATTR_CHANGED | + (enabled ? UNITY_INFO_ATTR_ENABLED : 0)); + LOG(2, ("Unity changing window (id:%d) attribute %d = %s\n", + id, attr, enabled ? "TRUE" : "FALSE")); + } + } +} + + +/* + *----------------------------------------------------------------------------- + * + * UnityWindowTracker_GetWindowAttribute -- + * + * Retrieves the current value of a window attribute. + * + * Results: + * TRUE if the attribute value was retrieved successfully. + * FALSE if the attribute had never been set on the specified window, or if the + * window does not exist. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +Bool +UnityWindowTracker_GetWindowAttribute(UnityWindowTracker *tracker, // IN + UnityWindowId id, // IN + UnityWindowAttribute attr, // IN + Bool *enabled) // IN +{ + Bool retval = FALSE; + UnityWindowInfo *info; + ASSERT(tracker); + ASSERT(attr < UNITY_MAX_ATTRIBUTES); + + info = UnityWindowTracker_LookupWindow(tracker, id); + if (info + && (info->attributes[attr] & UNITY_INFO_ATTR_EXISTS)) { + *enabled = (info->attributes[attr] & UNITY_INFO_ATTR_ENABLED) ? TRUE : FALSE; + retval = TRUE; + } + + return retval; +} + + +/* + *----------------------------------------------------------------------------- + * + * UnityWindowTracker_ChangeWindowType -- + * + * Sets the window type of the specified window. + * + * Results: + * None. + * + * Side effects: + * Marks the window tracker as having updates. + * + *----------------------------------------------------------------------------- + */ + +void +UnityWindowTracker_ChangeWindowType(UnityWindowTracker *tracker, // IN + UnityWindowId id, // IN + UnityWindowType winType) // IN +{ + UnityWindowInfo *info; + ASSERT(tracker); + + info = UnityWindowTracker_LookupWindow(tracker, id); + if (info) { + info->touched = TRUE; + if (winType != info->type) { + info->changed |= UNITY_CHANGED_WINDOW_TYPE; + info->type = winType; + LOG(2, ("Unity changing window (id:%d) type to %d\n", + id, winType)); + } + } +} + + +/* + *----------------------------------------------------------------------------- + * + * UnityWindowTracker_GetWindowType -- + * + * Retrieves the window type of the specified window. + * + * Results: + * TRUE if successful, FALSE if failed. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +Bool +UnityWindowTracker_GetWindowType(UnityWindowTracker *tracker, // IN + UnityWindowId id, // IN + UnityWindowType *winType) // IN +{ + Bool retval = FALSE; + UnityWindowInfo *info; + + ASSERT(tracker); + ASSERT(winType); + + info = UnityWindowTracker_LookupWindow(tracker, id); + if (info) { + *winType = info->type; + retval = TRUE; + } + + return retval; +} + + +/* + *----------------------------------------------------------------------------- + * + * UnityWindowTracker_NotifyIconChanged -- + * + * Marks the window tracker as having a changed icon for a window. + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +void +UnityWindowTracker_NotifyIconChanged(UnityWindowTracker *tracker, // IN + UnityWindowId id, // IN + UnityIconType iconType) // IN +{ + UnityWindowInfo *info; + + ASSERT(tracker); + ASSERT(iconType < UNITY_MAX_ICONS); + + info = UnityWindowTracker_LookupWindow(tracker, id); + if (info) { + LOG(2, ("Unity icon changed on window (id:%d)\n", id)); + info->touched = TRUE; + info->changed |= UNITY_CHANGED_WINDOW_ICONS; + info->icons[iconType] |= UNITY_INFO_ATTR_CHANGED | UNITY_INFO_ATTR_EXISTS; + } +} + + +/* + *----------------------------------------------------------------------------- + * + * UnityWindowTracker_ChangeWindowDesktop -- + * + * Saves the window desktop information if that was changed. + * + * Results: + * None. + * + * Side effects: + * Window desktop information might be updated. + * Window marked as touched. + * + *----------------------------------------------------------------------------- + */ + +void +UnityWindowTracker_ChangeWindowDesktop(UnityWindowTracker *tracker, // IN + UnityWindowId id, // IN + UnityDesktopId desktopId) // IN +{ + UnityWindowInfo *info; + ASSERT(tracker); + + info = UnityWindowTracker_LookupWindow(tracker, id); + if (info) { + info->touched = TRUE; + if (desktopId != info->desktopId) { + info->changed |= UNITY_CHANGED_WINDOW_DESKTOP; + info->desktopId = desktopId; + LOG(2, ("Unity changing window (id:%u) desktop to %d\n", + id, desktopId)); + } + } +} + + +/* + *----------------------------------------------------------------------------- + * + * UnityWindowTracker_GetWindowDesktop -- + * + * Get the window desktop information. + * + * Results: + * TRUE if this window exists in the window tracker, desktopId contains + * window desktop. + * FALSE otherwise, desktopId undefined. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +Bool +UnityWindowTracker_GetWindowDesktop(UnityWindowTracker *tracker, // IN + UnityWindowId id, // IN + UnityDesktopId *desktopId) // OUT +{ + Bool retval = FALSE; + UnityWindowInfo *info; + + ASSERT(tracker); + ASSERT(desktopId); + + info = UnityWindowTracker_LookupWindow(tracker, id); + if (info) { + *desktopId = info->desktopId; + retval = TRUE; + } + + return retval; +} + + +/* + *----------------------------------------------------------------------------- + * + * UnityWindowTracker_ChangeActiveDesktop -- + * + * Saves the active desktop information if that was changed. + * + * Results: + * None. + * + * Side effects: + * Active desktop information might be updated. + * + *----------------------------------------------------------------------------- + */ + +void +UnityWindowTracker_ChangeActiveDesktop(UnityWindowTracker *tracker, // IN + UnityDesktopId desktopId) // IN +{ + if (desktopId != tracker->activeDesktopId) { + tracker->activeDesktopId = desktopId; + tracker->activeDesktopChanged = TRUE; + } +} + + +/* + *----------------------------------------------------------------------------- + * + * UnityWindowTracker_GetActiveDesktop -- + * + * Return the active desktop id. + * + * Results: + * Active desktop id. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +UnityDesktopId +UnityWindowTracker_GetActiveDesktop(UnityWindowTracker *tracker) // IN +{ + return tracker->activeDesktopId; +} + + +/* + *---------------------------------------------------------------------------- + * + * UnityWindowTracker_RemoveWindow -- + * + * Remove the window with the specified id from the tracker. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +void +UnityWindowTracker_RemoveWindow(UnityWindowTracker *tracker, // IN + UnityWindowId id) // IN +{ + UnityWindowInfo *info = UnityWindowTracker_LookupWindow(tracker, id); + if (info) { + LOG(2, ("Unity removing window (id:%d)\n", id)); + info->changed |= UNITY_CHANGED_REMOVED; + info->touched = TRUE; + /* + * Don't remove it yet. We can only do so later... + */ + } +} + + +/* + *---------------------------------------------------------------------------- + * + * UnityWindowTracker_SendUpdate -- + * + * Update the window tracker via a UnityUpdate structure instead + * of a call to AddWindow, MoveWindow, etc. Useful for forwarding + * notifications between unity windows trackers without writing + * a ton of boilerplate. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +void +UnityWindowTracker_SendUpdate(UnityWindowTracker *tracker, // IN + UnityUpdate *update) // IN +{ + switch (update->type) { + case UNITY_UPDATE_ADD_WINDOW: + UnityWindowTracker_AddWindow(tracker, update->u.addWindow.id); + break; + + case UNITY_UPDATE_MOVE_WINDOW: + UnityWindowTracker_MoveWindow(tracker, + update->u.moveWindow.id, + update->u.moveWindow.rect.x1, + update->u.moveWindow.rect.y1, + update->u.moveWindow.rect.x2, + update->u.moveWindow.rect.y2); + break; + + case UNITY_UPDATE_REMOVE_WINDOW: + UnityWindowTracker_RemoveWindow(tracker, + update->u.removeWindow.id); + break; + + case UNITY_UPDATE_CHANGE_WINDOW_REGION: + UnityWindowTracker_ChangeWindowRegion(tracker, + update->u.changeWindowRegion.id, + update->u.changeWindowRegion.region); + break; + + case UNITY_UPDATE_CHANGE_WINDOW_TITLE: + UnityWindowTracker_SetWindowTitle(tracker, + update->u.changeWindowTitle.id, + &update->u.changeWindowTitle.titleUtf8); + break; + + case UNITY_UPDATE_CHANGE_ZORDER: + UnityWindowTracker_SetZOrder(tracker, update->u.zorder.ids, + update->u.zorder.count); + break; + + case UNITY_UPDATE_CHANGE_WINDOW_STATE: + UnityWindowTracker_ChangeWindowState(tracker, + update->u.changeWindowState.id, + update->u.changeWindowState.state); + break; + + case UNITY_UPDATE_CHANGE_WINDOW_ATTRIBUTE: + UnityWindowTracker_ChangeWindowAttribute(tracker, + update->u.changeWindowAttribute.id, + update->u.changeWindowAttribute.attr, + update->u.changeWindowAttribute.value); + break; + + case UNITY_UPDATE_CHANGE_WINDOW_TYPE: + UnityWindowTracker_ChangeWindowType(tracker, + update->u.changeWindowType.id, + update->u.changeWindowType.winType); + break; + + case UNITY_UPDATE_CHANGE_WINDOW_ICON: + UnityWindowTracker_NotifyIconChanged(tracker, + update->u.changeWindowIcon.id, + update->u.changeWindowIcon.iconType); + break; + case UNITY_UPDATE_CHANGE_WINDOW_DESKTOP: + UnityWindowTracker_ChangeWindowDesktop(tracker, + update->u.changeWindowDesktop.id, + update->u.changeWindowDesktop.desktopId); + break; + + case UNITY_UPDATE_CHANGE_ACTIVE_DESKTOP: + UnityWindowTracker_ChangeActiveDesktop(tracker, + update->u.changeActiveDesktop.desktopId); + break; + + default: + NOT_IMPLEMENTED(); + } +} + + +/* + *---------------------------------------------------------------------------- + * + * UnityWindowTracker_SetZOrder -- + * + * Notify the window tracker of the Z-order of all windows. Window ids + * at the front of the list are at the top of the z-order. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +void +UnityWindowTracker_SetZOrder(UnityWindowTracker *tracker, // IN + UnityWindowId zorder[], // IN + int count) // IN +{ + count = MIN(count, ARRAYSIZE(tracker->zorder)); + + if ((count != tracker->count) || + (memcmp(tracker->zorder, zorder, count * sizeof(tracker->zorder[0])) != 0)) { + memcpy(tracker->zorder, zorder, count * sizeof(tracker->zorder[0])); + tracker->count = count; + tracker->zorderChanged = TRUE; + } +} + + +/* + *---------------------------------------------------------------------------- + * + * UnityWindowTracker_SetZPosition -- + * + * Notify the window tracker of the Z-order of one window. + * + * Results: + * None. + * + * Side effects: + * Updates the Z-ordering of the tracker. + * + *---------------------------------------------------------------------------- + */ + +void +UnityWindowTracker_SetZPosition(UnityWindowTracker *tracker, // IN + UnityWindowId id, // IN + uint32 zorder) // IN +{ + int newIndex, oldIndex; + + /* First, figure out where the window will be in the list */ + switch(zorder) { + case UNITY_WINDOW_ORDER_BOTTOM: + newIndex = tracker->count - 1; + break; + case UNITY_WINDOW_ORDER_TOP: + default: + newIndex = zorder; + break; + } + + /* Then, find where the window is the list. If it's not there, it's an error. */ + for (oldIndex = 0; oldIndex < tracker->count; oldIndex++) { + if (id == tracker->zorder[oldIndex]) { + break; + } + } + ASSERT(oldIndex < tracker->count); + + /* Next, make space for the WindowId at its new spot */ + if (newIndex < oldIndex) { + memmove(tracker->zorder + newIndex + 1, tracker->zorder + newIndex, + oldIndex - newIndex); + } else if (newIndex > oldIndex) { + memmove(tracker->zorder + oldIndex, tracker->zorder + oldIndex + 1, + newIndex - oldIndex); + } + + /* Finally, put it in place */ + tracker->zorder[newIndex] = id; + tracker->zorderChanged = TRUE; +} + + +/* + *---------------------------------------------------------------------------- + * + * UnityWindowTracker_RequestUpdates -- + * + * Request a summary of all the updates pushed into the window tracker + * since the last call to UnityWindowTracker_RequestUpdates. + * + * If UNITY_UPDATE_INCREMENTAL is set in flags, callbacks will only + * fire for elements which have changed since the last call to + * UnityWindowTracker_RequestUpdates. Otherwise the entire state of + * the window tracker is sent via the callbacks. + * + * If UNITY_UPDATE_REMOVE_UNTOUCHED is set in flags, windows for + * which there have been no updates since the last + * UnityWindowTracker_RequestUpdates call will be automatically removed. + * Useful if the client has no way of getting remove window notifications. + * + * Results: + * None. + * + * Side effects: + * Lots of callbacks are fired. + * + *---------------------------------------------------------------------------- + */ + +void +UnityWindowTracker_RequestUpdates(UnityWindowTracker *tracker, // IN + uint32 flags, // IN + void *param) // IN +{ + tracker->cbparam = param; + tracker->updateFlags = flags; + + /* + * If necessary, remove windows which didn't receive updates. + */ + if (flags & UNITY_UPDATE_REMOVE_UNTOUCHED) { + HashTable_ForEach(tracker->windows, RemoveUntouchedWindow, tracker); + } + + /* + * Push updates for the windows remaining... + */ + HashTable_ForEach(tracker->windows, PushUpdates, tracker); + + /* Push Z order */ + PushZOrder(tracker); + + /* Push active desktop info */ + PushActiveDesktop(tracker); + + /* + * ...then really delete things which were removed... + */ + while (HashTable_ForEach(tracker->windows, GarbageCollectRemovedWindows, + tracker)) { + continue; + } + + /* + * ...and clear all the changed and touched bits of what's left to get ready + * for the next iteration. + */ + HashTable_ForEach(tracker->windows, ResetChangedBits, NULL); +} + + +/* + *---------------------------------------------------------------------------- + * + * FreeWindowInfo -- + * + * Destroy a window. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +static void +FreeWindowInfo(UnityWindowInfo *info) // IN +{ + if (info) { + UnityWindowTracker *tracker = info->tracker; + + if (tracker->freeFn && info->data) { + tracker->freeFn(tracker, info, info->data); + } + + if (info->region) { + miRegionDestroy(info->region); + } + DynBuf_Destroy(&info->titleUtf8); + free(info); + } +} + + +/* + *---------------------------------------------------------------------------- + * + * RemoveUntouchedWindow -- + * + * If the window specified hasn't been touched (i.e. an update function + * has been called on it), remove it from the window tracker. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +int +RemoveUntouchedWindow(const char *key, // IN: window id + void *value, // IN: UnityWindowInfo + void *clientData) // IN: UnityWindowTracker +{ + UnityWindowTracker *tracker = (UnityWindowTracker *)clientData; + UnityWindowInfo *info = (UnityWindowInfo *)value; + if (!info->touched) { + UnityWindowId id = (UnityWindowId)(long)key; + LOG(2, ("Removing untouched window (id:%d)\n", id)); + UnityWindowTracker_RemoveWindow(tracker, id); + } + return 0; +} + + +/* + *---------------------------------------------------------------------------- + * + * GarbageCollectRemovedWindows -- + * + * Delete all window objects for windows which are marked as + * removed. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +int +GarbageCollectRemovedWindows(const char *key, // IN: window id + void *value, // IN: UnityWindowInfo + void *clientData) // IN: UnityWindowTracker +{ + UnityWindowTracker *tracker = (UnityWindowTracker *)clientData; + UnityWindowInfo *info = (UnityWindowInfo *)value; + if (info->reap) { + LOG(2, ("Destroying window (id:%d)\n", (UnityWindowId)(long)key)); + HashTable_Delete(tracker->windows, key); + return 1; + } + return 0; +} + + +/* + *---------------------------------------------------------------------------- + * + * ResetChangedBits -- + * + * Reset the changed and touched bits for this window. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +int +ResetChangedBits(const char *key, // IN: window id + void *value, // IN: UnityWindowInfo + void *clientData) // IN: UnityWindowTracker +{ + UnityWindowInfo *info = (UnityWindowInfo *)value; + int i; + + if (info->changed & UNITY_CHANGED_WINDOW_ATTRIBUTES) { + for (i = 0; i < UNITY_MAX_ATTRIBUTES; i++) { + info->attributes[i] &= ~UNITY_INFO_ATTR_CHANGED; + } + } + + if (info->changed & UNITY_CHANGED_WINDOW_ICONS) { + for (i = 0; i < UNITY_MAX_ICONS; i++) { + info->icons[i] &= ~UNITY_INFO_ATTR_CHANGED; + } + } + + info->changed = 0; + info->touched = FALSE; + return 0; +} + + +/* + *---------------------------------------------------------------------------- + * + * PushUpdates -- + * + * Fire all callback functions relevant for this window (as determined + * by the changed bits). + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +int +PushUpdates(const char *key, // IN: window id + void *value, // IN: UnityWindowInfo + void *clientData) // IN: UnityWindowTracker +{ + UnityWindowTracker *tracker = (UnityWindowTracker *)clientData; + UnityWindowInfo *info = (UnityWindowInfo *)value; + UnityWindowId id = (UnityWindowId)(long)key; + UnityUpdate update; + Bool incremental = (tracker->updateFlags & UNITY_UPDATE_INCREMENTAL) != 0; + + if (info->changed & UNITY_CHANGED_REMOVED) { + /* + * Now that we've sent the update, mark the window as deleted + * so it will be reaped. + */ + info->reap = TRUE; + update.type = UNITY_UPDATE_REMOVE_WINDOW; + update.u.removeWindow.id = id; + (*tracker->cb)(tracker->cbparam, &update); + } else { + if (!incremental || (info->changed & UNITY_CHANGED_ADDED)) { + update.type = UNITY_UPDATE_ADD_WINDOW; + update.u.addWindow.id = id; + (*tracker->cb)(tracker->cbparam, &update); + } + if (!incremental || (info->changed & UNITY_CHANGED_POSITION)) { + update.type = UNITY_UPDATE_MOVE_WINDOW; + update.u.moveWindow.id = id; + update.u.moveWindow.rect = info->rect; + (*tracker->cb)(tracker->cbparam, &update); + } + if (!incremental || (info->changed & UNITY_CHANGED_REGION)) { + update.type = UNITY_UPDATE_CHANGE_WINDOW_REGION; + update.u.changeWindowRegion.id = id; + update.u.changeWindowRegion.region = info->region; + (*tracker->cb)(tracker->cbparam, &update); + } + if (!incremental || (info->changed & UNITY_CHANGED_TITLE)) { + update.type = UNITY_UPDATE_CHANGE_WINDOW_TITLE; + update.u.changeWindowTitle.id = id; + DynBuf_Init(&update.u.changeWindowTitle.titleUtf8); + DynBuf_Copy(&info->titleUtf8, &update.u.changeWindowTitle.titleUtf8); + (*tracker->cb)(tracker->cbparam, &update); + DynBuf_Destroy(&update.u.changeWindowTitle.titleUtf8); + } + if (!incremental || (info->changed & UNITY_CHANGED_WINDOW_ICONS)) { + UnityIconType i; + + update.type = UNITY_UPDATE_CHANGE_WINDOW_ICON; + update.u.changeWindowIcon.id = id; + for (i = 0; i < UNITY_MAX_ICONS; i++) { + if ((info->icons[i] & UNITY_INFO_ATTR_EXISTS) + && (!incremental + || (info->icons[i] & UNITY_INFO_ATTR_CHANGED))) { + update.u.changeWindowIcon.iconType = i; + (*tracker->cb)(tracker->cbparam, &update); + } + } + } + if (!incremental || (info->changed & UNITY_CHANGED_WINDOW_TYPE)) { + update.type = UNITY_UPDATE_CHANGE_WINDOW_TYPE; + update.u.changeWindowType.id = id; + update.u.changeWindowType.winType = info->type; + (*tracker->cb)(tracker->cbparam, &update); + } + + /* + * Please make sure WINDOW_ATTRIBUTES is checked before WINDOW_STATE, to allow + * vmware-vmx on the host side to only pay attention to WINDOW_ATTRIBUTES if + * desired. + */ + if (!incremental || (info->changed & UNITY_CHANGED_WINDOW_ATTRIBUTES)) { + UnityWindowAttribute i; + + update.type = UNITY_UPDATE_CHANGE_WINDOW_ATTRIBUTE; + update.u.changeWindowAttribute.id = id; + for (i = 0; i < UNITY_MAX_ATTRIBUTES; i++) { + if ((info->attributes[i] & UNITY_INFO_ATTR_EXISTS) + && (!incremental || + (info->attributes[i] & UNITY_INFO_ATTR_CHANGED))) { + update.u.changeWindowAttribute.attr = i; + update.u.changeWindowAttribute.value = + (info->attributes[i] & UNITY_INFO_ATTR_ENABLED) ? TRUE : FALSE; + (*tracker->cb)(tracker->cbparam, &update); + } + } + } + + if (!incremental || (info->changed & UNITY_CHANGED_WINDOW_STATE)) { + update.type = UNITY_UPDATE_CHANGE_WINDOW_STATE; + update.u.changeWindowState.id = id; + update.u.changeWindowState.state = info->state; + (*tracker->cb)(tracker->cbparam, &update); + } + + if (!incremental || (info->changed & UNITY_CHANGED_WINDOW_DESKTOP)) { + update.type = UNITY_UPDATE_CHANGE_WINDOW_DESKTOP; + update.u.changeWindowDesktop.id = id; + update.u.changeWindowDesktop.desktopId = info->desktopId; + (*tracker->cb)(tracker->cbparam, &update); + } + + } + return 0; +} + + +/* + *---------------------------------------------------------------------------- + * + * PushZOrder -- + * + * Fire callback function if Z Order was changed + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +int +PushZOrder(UnityWindowTracker *tracker) // IN: UnityWindowTracker +{ + UnityUpdate update; + Bool incremental = (tracker->updateFlags & UNITY_UPDATE_INCREMENTAL) != 0; + if (!incremental || tracker->zorderChanged) { + update.type = UNITY_UPDATE_CHANGE_ZORDER; + update.u.zorder.count = tracker->count; + memcpy(&update.u.zorder.ids, tracker->zorder, + tracker->count * sizeof(update.u.zorder.ids[0])); + (*tracker->cb)(tracker->cbparam, &update); + + tracker->zorderChanged = FALSE; + } + return 0; +} + + +/* + *---------------------------------------------------------------------------- + * + * PushActiveDesktop -- + * + * Fire callback function if the active desktop was changed. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +int +PushActiveDesktop(UnityWindowTracker *tracker) // IN: UnityWindowTracker +{ + UnityUpdate update; + Bool incremental = (tracker->updateFlags & UNITY_UPDATE_INCREMENTAL) != 0; + if (!incremental || tracker->activeDesktopChanged) { + update.type = UNITY_UPDATE_CHANGE_ACTIVE_DESKTOP; + update.u.changeActiveDesktop.desktopId = tracker->activeDesktopId; + (*tracker->cb)(tracker->cbparam, &update); + + tracker->activeDesktopChanged = FALSE; + } + return 0; +} + + +/* + *---------------------------------------------------------------------------- + * + * TitlesEqual-- + * + * Performs string comparison on the titles held in DynBufs + * + * Results: + * TRUE if first == second + * FALSE if first != second + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +Bool +TitlesEqual(DynBuf *first, // IN: First window title + DynBuf *second) // IN: Second window title +{ + if (DynBuf_GetSize(first) != DynBuf_GetSize(second)) { + return FALSE; + } + return (strncmp((const unsigned char*)DynBuf_Get(first), + (const unsigned char*)DynBuf_Get(second), + DynBuf_GetSize(first)) == 0) ? TRUE : FALSE; +} diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/user/hostinfo.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/user/hostinfo.c --- open-vm-tools-2008.01.23-74039/lib/user/hostinfo.c 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/user/hostinfo.c 2008-10-13 08:01:53.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -157,6 +157,7 @@ *(uint32*)(cpuid.id0.name + 12) = 0; __GET_CPUID(1, (CPUIDRegs*)&cpuid.id1); + __GET_CPUID(0xa, (CPUIDRegs*)&cpuid.ida); __GET_CPUID(0x80000000, (CPUIDRegs*)&cpuid.id80); __GET_CPUID(0x80000001, (CPUIDRegs*)&cpuid.id81); __GET_CPUID(0x80000008, (CPUIDRegs*)&cpuid.id88); diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/user/hostinfoPosix.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/user/hostinfoPosix.c --- open-vm-tools-2008.01.23-74039/lib/user/hostinfoPosix.c 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/user/hostinfoPosix.c 2008-10-13 08:01:53.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -55,6 +55,15 @@ #include <mach/mach.h> #include <mach/mach_time.h> #include <sys/sysctl.h> +#elif defined(__FreeBSD__) +#include <sys/sysctl.h> +#if !defined(RLIMIT_AS) +# if defined(RLIMIT_VMEM) +# define RLIMIT_AS RLIMIT_VMEM +# else +# define RLIMIT_AS RLIMIT_RSS +# endif +#endif #else #if !defined(USING_AUTOCONF) || defined(HAVE_SYS_VFS_H) #include <sys/vfs.h> @@ -75,6 +84,7 @@ #include "str.h" #include "msg.h" #include "log.h" +#include "posix.h" #include "file.h" #include "backdoor_def.h" #include "util.h" @@ -83,10 +93,12 @@ #include "vm_atomic.h" #include "x86cpuid.h" #include "syncMutex.h" +#include "unicode.h" #ifdef VMX86_SERVER #include "uwvmkAPI.h" #include "uwvmk.h" +#include "vmkSyscall.h" #endif #define LGPFX "HOSTINFO:" @@ -103,11 +115,12 @@ * Local functions */ -#if !defined(__APPLE__) +#if !defined(__APPLE__) && !defined(__FreeBSD__) static char *HostinfoGetCpuInfo(int nCpu, char *name); +#if !defined(VMX86_SERVER) static Bool HostinfoGetMemInfo(char *name, unsigned int *value); -static Bool HostinfoGetMemSize(uint64 *total, uint64 *avail); -#endif +#endif // ifndef VMX86_SERVER +#endif // ifndef __APPLE__ /* @@ -246,13 +259,6 @@ mach_timebase_info_data_t *ptr; static Atomic_Ptr atomic; /* Implicitly initialized to NULL. --mbellon */ -#if defined(VMX86_DEBUG) - SyncMutex *lck; - - static Atomic_Ptr lckStorage; - static VmTimeType lastTimeRead; -#endif - /* Insure that the time base values are correct. */ ptr = (mach_timebase_info_data_t *) Atomic_ReadPtr(&atomic); @@ -270,20 +276,7 @@ ptr = (mach_timebase_info_data_t *) Atomic_ReadPtr(&atomic); } -#if defined(VMX86_DEBUG) - /* assert that mach_absolute_time is always increasing */ - lck = SyncMutex_CreateSingleton(&lckStorage); - SyncMutex_Lock(lck); - - raw = mach_absolute_time(); - - ASSERT(raw >= lastTimeRead); - lastTimeRead = raw; - - SyncMutex_Unlock(lck); -#else raw = mach_absolute_time(); -#endif if ((ptr->numer == 1) && (ptr->denom == 1)) { /* The scaling values are unity, save some time/arithmetic */ @@ -293,15 +286,15 @@ return ((double) raw) * (((double) ptr->numer) / ((double) ptr->denom)); } } -#else +#endif /* *----------------------------------------------------------------------------- * - * HostinfoSystemTimerUS -- + * HostinfoRawSystemTimerUS -- * - * Obtain the system timer for non-Mac systems. + * Obtain the raw system timer value. * * Results: * Relative time in microseconds or zero if a failure. @@ -312,9 +305,12 @@ *----------------------------------------------------------------------------- */ -static VmTimeType -HostinfoSystemTimerUS(void) +VmTimeType +Hostinfo_RawSystemTimerUS(void) { +#if defined(__APPLE__) + return HostinfoMacAbsTimeNS() / 1000ULL; +#else #if defined(VMX86_SERVER) if (HostType_OSIsPureVMK()) { uint64 uptime; @@ -322,7 +318,8 @@ status = VMKernel_GetUptimeUS(&uptime); if (status != VMK_OK) { - return 0; + Log("%s: failure!\n", __FUNCTION__); + return 0; // A timer read failure - this is really bad! } return uptime; @@ -332,15 +329,16 @@ /* Read the time from the operating system */ if (gettimeofday(&tval, NULL) != 0) { - Panic("gettimeofday failed!\n"); + Log("%s: failure!\n", __FUNCTION__); + return 0; // A timer read failure - this is really bad! } /* Convert into microseconds */ return (((VmTimeType)tval.tv_sec) * 1000000 + tval.tv_usec); #if defined(VMX86_SERVER) } #endif /* ifdef VMX86_SERVER */ +#endif /* ifdef __APPLE__ */ } -#endif /* @@ -353,6 +351,8 @@ * Don't send a time obtained this way to another process and expect * a relative time measurement to be correct. * + * This timer is documented to never go backwards. + * * Results: * Relative time in microseconds or zero if a failure. * @@ -368,9 +368,6 @@ VmTimeType Hostinfo_SystemTimerUS(void) { -#if defined(__APPLE__) - return HostinfoMacAbsTimeNS() / 1000ULL; -#else SyncMutex *lck; VmTimeType curTime; VmTimeType newTime; @@ -380,16 +377,17 @@ static VmTimeType lastTimeRead; static VmTimeType lastTimeReset; - curTime = HostinfoSystemTimerUS(); - - if (curTime == 0) { - return 0; - } - /* Get and take lock. */ lck = SyncMutex_CreateSingleton(&lckStorage); SyncMutex_Lock(lck); + curTime = Hostinfo_RawSystemTimerUS(); + + if (curTime == 0) { + newTime = 0; + goto exit; + } + /* * Don't let time be negative or go backward. We do this by * tracking a base and moving foward from there. @@ -405,11 +403,11 @@ lastTimeRead = newTime; +exit: /* Release lock. */ SyncMutex_Unlock(lck); return newTime; -#endif } /* @@ -437,45 +435,68 @@ { #if defined(__APPLE__) return HostinfoMacAbsTimeNS() / 1000ULL; -#else -#if defined(VMX86_SERVER) - if (HostType_OSIsPureVMK()) { - uint64 uptime; - VMK_ReturnStatus status; +#elif defined(VMX86_SERVER) + uint64 uptime; + VMK_ReturnStatus status; - status = VMKernel_GetUptimeUS(&uptime); - if (status != VMK_OK) { - return 0; + if (VmkSyscall_Init(FALSE, NULL, 0)) { + status = CosVmnix_GetUptimeUS(&uptime); + if (status == VMK_OK) { + return uptime; } + } - return uptime; - } else { -#endif /* ifdef VMX86_SERVER */ - int res; - double uptime; - FILE *f; + return 0; +#elif defined(__linux__) + int res; + double uptime; + int fd; + char buf[256]; - f = fopen("/proc/uptime", "r"); - if (!f) { + static Atomic_Int fdStorage = { -1 }; + + fd = Atomic_ReadInt(&fdStorage); + + /* Do we need to open the file the first time through? */ + if (UNLIKELY(fd == -1)) { + fd = open("/proc/uptime", O_RDONLY); + + if (fd == -1) { Warning(LGPFX" Failed to open /proc/uptime: %s\n", Msg_ErrString()); return 0; } - res = fscanf(f, "%lf", &uptime); - fclose(f); - if (res != 1) { - Warning(LGPFX" Failed to parse /proc/uptime\n"); - return 0; + /* Try to swap ours in. If we lose the race, close our fd */ + if (Atomic_ReadIfEqualWriteInt(&fdStorage, -1, fd) != -1) { + close(fd); } - return uptime * 1000 * 1000; -#if defined(VMX86_SERVER) + + /* Get the winning fd - either ours or theirs, doesn't matter anymore */ + fd = Atomic_ReadInt(&fdStorage); } -#endif /* ifdef VMX86_SERVER */ + + ASSERT(fd != -1); + + res = pread(fd, buf, sizeof buf - 1, 0); + if (res == -1) { + Warning(LGPFX" Failed to pread /proc/uptime: %s\n", Msg_ErrString()); + return 0; + } + ASSERT(res < sizeof buf); + buf[res] = '\0'; + + if (sscanf(buf, "%lf", &uptime) != 1) { + Warning(LGPFX" Failed to parse /proc/uptime\n"); + return 0; + } + + return uptime * 1000 * 1000; +#else +NOT_IMPLEMENTED(); #endif } - /* *----------------------------------------------------------------------------- * @@ -494,24 +515,24 @@ *----------------------------------------------------------------------------- */ -const char * +Unicode Hostinfo_NameGet(void) { - char *result; + Unicode result; static Atomic_Ptr state; /* Implicitly initialized to NULL. --hpreg */ result = Atomic_ReadPtr(&state); if (UNLIKELY(result == NULL)) { - char *before; + Unicode before; - result = (char *) Hostinfo_HostName(); + result = Hostinfo_HostName(); before = Atomic_ReadIfEqualWritePtr(&state, NULL, result); if (before) { - free((void *) result); + Unicode_Free(result); result = before; } @@ -552,7 +573,7 @@ ASSERT(!HostType_OSIsVMK()); // Don't use /proc/vmware - f = fopen("/proc/vmware/sched/ncpus", "r"); + f = Posix_Fopen("/proc/vmware/sched/ncpus", "r"); if (f != NULL) { while (StdIO_ReadNextLine(f, &line, 0, NULL) == StdIO_Success) { if (strstr(line, str)) { @@ -672,6 +693,25 @@ } return out; +#elif defined(__FreeBSD__) + uint32 out; + size_t outSize = sizeof out; + +#if __FreeBSD__version >= 500019 + if (sysctlbyname("kern.smp.cpus", &out, &outSize, NULL, 0) == -1) { + return -1; + } +#else + if (sysctlbyname("machdep.smp_cpus", &out, &outSize, NULL, 0) == -1) { + if (errno == ENOENT) { + out = 1; + } else { + return -1; + } + } +#endif + + return out; #else static int count = 0; @@ -694,7 +734,7 @@ FILE *f; char *line; - f = fopen("/proc/cpuinfo", "r"); + f = Posix_Fopen("/proc/cpuinfo", "r"); if (f == NULL) { Msg_Post(MSG_ERROR, MSGID(hostlinux.opencpuinfo) @@ -747,18 +787,29 @@ Hostinfo_GetRatedCpuMhz(int32 cpuNumber, // IN uint32 *mHz) // OUT { -#if defined(__APPLE__) +#if defined(__APPLE__) || defined(__FreeBSD__) + +# if defined(__APPLE__) +# define CPUMHZ_SYSCTL_NAME "hw.cpufrequency_max" +# elif __FreeBSD__version >= 50011 +# define CPUMHZ_SYSCTL_NAME "hw.clockrate" +# endif + +# if defined(CPUMHZ_SYSCTL_NAME) uint32 hz; size_t hzSize = sizeof hz; // 'cpuNumber' is ignored: Intel Macs are always perfectly symetric. - if (sysctlbyname("hw.cpufrequency_max", &hz, &hzSize, NULL, 0) == -1) { + if (sysctlbyname(CPUMHZ_SYSCTL_NAME, &hz, &hzSize, NULL, 0) == -1) { return FALSE; } *mHz = hz / 1000000; return TRUE; +# else + return FALSE; +# endif #else float fMhz = 0; char *readVal = HostinfoGetCpuInfo(cpuNumber, "cpu MHz"); @@ -796,13 +847,19 @@ char * Hostinfo_GetCpuDescription(uint32 cpuNumber) // IN { -#if defined(__APPLE__) +#if defined(__APPLE__) || defined(__FreeBSD__) +# if defined(__APPLE__) +# define CPUDESC_SYSCTL_NAME "machdep.cpu.brand_string" +# else +# define CPUDESC_SYSCTL_NAME "hw.model" +# endif + char *desc; size_t descSize; // 'cpuNumber' is ignored: Intel Macs are always perfectly symetric. - if (sysctlbyname("machdep.cpu.brand_string", NULL, &descSize, NULL, 0) + if (sysctlbyname(CPUDESC_SYSCTL_NAME, NULL, &descSize, NULL, 0) == -1) { return NULL; } @@ -812,7 +869,7 @@ return NULL; } - if (sysctlbyname("machdep.cpu.brand_string", desc, &descSize, NULL, 0) + if (sysctlbyname(CPUDESC_SYSCTL_NAME, desc, &descSize, NULL, 0) == -1) { free(desc); return NULL; @@ -823,6 +880,9 @@ #ifdef VMX86_SERVER if (HostType_OSIsVMK()) { char mName[48]; + + // VMKernel treats mName as an in/out parameter so terminate it. + mName[0] = '\0'; if (VMKernel_GetCPUModelName(mName, cpuNumber, sizeof(mName)) == VMK_OK) { mName[sizeof(mName) - 1] = '\0'; return strdup(mName); @@ -836,6 +896,7 @@ #if !defined(__APPLE__) +#if !defined(__FreeBSD__) /* *---------------------------------------------------------------------- * @@ -862,7 +923,7 @@ int cpu = 0; char *value = NULL; - f = fopen("/proc/cpuinfo", "r"); + f = Posix_Fopen("/proc/cpuinfo", "r"); if (f == NULL) { Warning(LGPFX" HostinfoGetCpuInfo: Unable to open /proc/cpuinfo\n"); return NULL; @@ -896,7 +957,7 @@ fclose(f); return value; } - +#endif /* __FreeBSD__ */ /* *---------------------------------------------------------------------- @@ -949,59 +1010,6 @@ /* *---------------------------------------------------------------------- * - * HostinfoGetMemSize -- - * - * Get the memory size and available space from /proc/vmware/mem - * on ESX hosts. Return value is in MB. - * - * Results: - * TRUE on success, FALSE on failure - * - * Side effects: - * None. - * - *---------------------------------------------------------------------- - */ - -static Bool -HostinfoGetMemSize(uint64 *memTotal, // OUT - uint64 *memAvail) // OUT -{ - const char *memInfoFile = "/proc/vmware/mem"; - uint64 total = 0; - uint64 avail = 0; - char buf[MAX_LINE_LEN]; - FILE *fp = NULL; - Bool foundVal = FALSE; - - if ((fp = fopen(memInfoFile, "r")) == NULL) { - Warning(LGPFX" Could not open meminfo file %s\n", memInfoFile); - return FALSE; - } - - while (fgets(buf, MAX_LINE_LEN, fp)) { - if (sscanf(buf, "Machine memory free: %"FMT64"d Mbytes/%"FMT64"d Mbytes", - &avail, &total) == 2) { - foundVal = TRUE; - break; - } - } - if (fp) { - fclose(fp); - } - if (memTotal != NULL) { - *memTotal = total; - } - if (memAvail != NULL) { - *memAvail = avail; - } - return foundVal; -} - - -/* - *---------------------------------------------------------------------- - * * HostinfoGetMemInfo -- * * Get some attribute from /proc/meminfo @@ -1023,7 +1031,7 @@ size_t len; char buffer[4096]; - int fd = open("/proc/meminfo", O_RDONLY); + int fd = Posix_Open("/proc/meminfo", O_RDONLY); if (fd == -1) { Warning(LGPFX" HostinfoGetMemInfo: Unable to open /proc/meminfo\n"); @@ -1051,7 +1059,8 @@ * Retrieve system information on a Linux system. * * Results: - * TRUE on success: '*totalRam' and '*freeRam' are set if not NULL + * TRUE on success: '*totalRam', '*freeRam', '*totalSwap' and '*freeSwap' + * are set if not NULL * FALSE on failure * * Side effects: @@ -1065,8 +1074,10 @@ */ static Bool -HostinfoSysinfo(uint64 *totalRam, // OUT: Total RAM in bytes - uint64 *freeRam) // OUT: Free RAM in bytes +HostinfoSysinfo(uint64 *totalRam, // OUT: Total RAM in bytes + uint64 *freeRam, // OUT: Free RAM in bytes + uint64 *totalSwap, // OUT: Total swap in bytes + uint64 *freeSwap) // OUT: Free swap in bytes { #ifdef HAVE_SYSINFO // Found in linux/include/kernel.h for a 2.5.6 kernel --hpreg @@ -1107,6 +1118,12 @@ if (freeRam) { *freeRam = (uint64)si.freeram * si.mem_unit; } + if (totalSwap) { + *totalSwap = (uint64)si.totalswap * si.mem_unit; + } + if (freeSwap) { + *freeSwap = (uint64)si.freeswap * si.mem_unit; + } return TRUE; #else // ifdef HAVE_SYSINFO @@ -1116,13 +1133,14 @@ #endif // ifndef __APPLE__ +#if defined(__linux__) || defined(__FreeBSD__) || defined(sun) /* *----------------------------------------------------------------------------- * - * Hostinfo_GetMemoryInfoInPages -- + * HostinfoGetLinuxMemoryInfoInPages -- * * Obtain the minimum memory to be maintained, total memory available, and - * free memory available on the host in pages. + * free memory available on the host (Linux or COS) in pages. * * Results: * TRUE on success: '*minSize', '*maxSize' and '*currentSize' are set @@ -1135,61 +1153,14 @@ */ Bool -Hostinfo_GetMemoryInfoInPages(unsigned int *minSize, // OUT - unsigned int *maxSize, // OUT - unsigned int *currentSize) // OUT +HostinfoGetLinuxMemoryInfoInPages(unsigned int *minSize, // OUT + unsigned int *maxSize, // OUT + unsigned int *currentSize) // OUT { -#if defined(__APPLE__) - mach_msg_type_number_t count; - vm_statistics_data_t stat; - kern_return_t error; - - /* - * Largely inspired by - * darwinsource-10.4.5/top-15/libtop.c::libtop_p_vm_sample(). - */ - - count = HOST_VM_INFO_COUNT; - error = host_statistics(mach_host_self(), HOST_VM_INFO, (host_info_t)&stat, - &count); - if (error != KERN_SUCCESS || count != HOST_VM_INFO_COUNT) { - Warning("%s: Unable to retrieve host vm stats.\n", __FUNCTION__); - return FALSE; - } - - // XXX Figure out this value. - *minSize = 128; - - // XXX Hopefully this includes cached memory as well. We should check. - *currentSize = stat.free_count; - - /* - * Includes kernel memory. This is the same amount as reported by the - * "hw.physmem" sysctl, which is itself slightly lower than the amount - * reported by the "hw.memsize" sysctl, which is the physical RAM size. - */ - *maxSize = stat.free_count - + stat.wire_count + stat.active_count + stat.inactive_count; - - return TRUE; -#else uint64 total; uint64 free; unsigned int cached = 0; - if (vmx86_server) { - // This is completely bogus on esx. Needs to use sysinfo. - *minSize = 128; - if (HostinfoGetMemSize(&total, &free)) { - *maxSize = (total *1024 * 1024) / PAGE_SIZE; - *currentSize = (free *1024 * 1024) / PAGE_SIZE; - } else { - *maxSize = (128 *1024 * 1024) / PAGE_SIZE; - *currentSize = (32 *1024 * 1024) / PAGE_SIZE; - } - return TRUE; - } - /* * Note that the free memory provided by linux does not include buffer and * cache memory. Linux tries to use the free memory to cache file. Most of @@ -1206,7 +1177,7 @@ * leave that to be done in serverd/MUI. */ - if (HostinfoSysinfo(&total, &free) == FALSE) { + if (HostinfoSysinfo(&total, &free, NULL, NULL) == FALSE) { return FALSE; } @@ -1230,11 +1201,170 @@ } return TRUE; -#endif // ifdef __APPLE_ } /* + *----------------------------------------------------------------------------- + * + * HostinfoGetSwapInfoInPages -- + * + * Obtain the total swap and free swap on the host (Linux or COS) in pages. + * + * Results: + * TRUE on success: '*totalSwap' and '*freeSwap' are set if not NULL + * FALSE on failure + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +Bool +Hostinfo_GetSwapInfoInPages(unsigned int *totalSwap, // OUT + unsigned int *freeSwap) // OUT +{ + uint64 total; + uint64 free; + + if (HostinfoSysinfo(NULL, NULL, &total, &free) == FALSE) { + return FALSE; + } + + if (totalSwap != NULL) { + *totalSwap = total / PAGE_SIZE; + } + + if (freeSwap != NULL) { + *freeSwap = free / PAGE_SIZE; + } + + return TRUE; +} +#endif + + +/* + *----------------------------------------------------------------------------- + * + * Hostinfo_GetMemoryInfoInPages -- + * + * Obtain the minimum memory to be maintained, total memory available, and + * free memory available on the host in pages. + * + * Results: + * TRUE on success: '*minSize', '*maxSize' and '*currentSize' are set + * FALSE on failure + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +Bool +Hostinfo_GetMemoryInfoInPages(unsigned int *minSize, // OUT + unsigned int *maxSize, // OUT + unsigned int *currentSize) // OUT +{ +#if defined(__APPLE__) + mach_msg_type_number_t count; + vm_statistics_data_t stat; + kern_return_t error; + uint64_t memsize; + size_t memsizeSize = sizeof memsize; + + /* + * Largely inspired by + * darwinsource-10.4.5/top-15/libtop.c::libtop_p_vm_sample(). + */ + + count = HOST_VM_INFO_COUNT; + error = host_statistics(mach_host_self(), HOST_VM_INFO, (host_info_t)&stat, + &count); + if (error != KERN_SUCCESS || count != HOST_VM_INFO_COUNT) { + Warning("%s: Unable to retrieve host vm stats.\n", __FUNCTION__); + return FALSE; + } + + // XXX Figure out this value. + *minSize = 128; + + /* + * XXX Hopefully this includes cached memory as well. We should check. + * No. It returns only completely used pages. + */ + *currentSize = stat.free_count; + + /* + * Adding up the stat values does not sum to 100% of physical memory. + * The correct value is available from sysctl so we do that instead. + */ + if (sysctlbyname("hw.memsize", &memsize, &memsizeSize, NULL, 0) == -1) { + Warning("%s: Unable to retrieve host vm hw.memsize.\n", __FUNCTION__); + return FALSE; + } + + *maxSize = memsize / PAGE_SIZE; + return TRUE; +#elif defined(VMX86_SERVER) + uint64 total; + uint64 free; + VMK_ReturnStatus status; + + if (VmkSyscall_Init(FALSE, NULL, 0)) { + status = CosVmnix_GetMemSize(&total, &free); + if (status == VMK_OK) { + *minSize = 128; + *maxSize = total / PAGE_SIZE; + *currentSize = free / PAGE_SIZE; + + return TRUE; + } + } + + return FALSE; +#else + return HostinfoGetLinuxMemoryInfoInPages(minSize, maxSize, currentSize); +#endif +} + + +#ifdef VMX86_SERVER +/* + *----------------------------------------------------------------------------- + * + * Hostinfo_GetCOSMemoryInfoInPages -- + * + * Obtain the minimum memory to be maintained, total memory available, and + * free memory available on the COS in pages. + * + * Results: + * TRUE on success: '*minSize', '*maxSize' and '*currentSize' are set + * FALSE on failure + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +Bool +Hostinfo_GetCOSMemoryInfoInPages(unsigned int *minSize, // OUT + unsigned int *maxSize, // OUT + unsigned int *currentSize) // OUT +{ + if (HostType_OSIsPureVMK()) { + return FALSE; + } else { + return HostinfoGetLinuxMemoryInfoInPages(minSize, maxSize, currentSize); + } +} +#endif + + +/* *---------------------------------------------------------------------- * * Hostinfo_ResetProcessState -- @@ -1262,6 +1392,18 @@ uid_t euid; #endif + /* + * Disable itimers before resetting the signal handlers. + * Otherwise, the process may still receive timer signals: + * SIGALRM, SIGVTARLM, or SIGPROF. + */ + struct itimerval it; + it.it_value.tv_sec = it.it_value.tv_usec = 0; + it.it_interval.tv_sec = it.it_interval.tv_usec = 0; + setitimer(ITIMER_REAL, &it, NULL); + setitimer(ITIMER_VIRTUAL, &it, NULL); + setitimer(ITIMER_PROF, &it, NULL); + for (s = 1; s <= NSIG; s++) { sa.sa_handler = SIG_DFL; sigfillset(&sa.sa_mask); @@ -1337,7 +1479,7 @@ if (pid == 0) { Hostinfo_ResetProcessState(NULL, 0); - execvp(command, args); + Posix_Execvp(command, args); exit(127); } @@ -1419,22 +1561,32 @@ *----------------------------------------------------------------------------- */ -char * -Hostinfo_GetModulePath(void) +Unicode +Hostinfo_GetModulePath(uint32 priv) { - char buf[FILE_MAXPATH]; + Unicode path; + #if defined(__APPLE__) - uint32_t bufSize = sizeof buf; + uint32_t pathSize = FILE_MAXPATH; +#else + Bool isSuper = FALSE; +#endif - if (_NSGetExecutablePath(buf, &bufSize)) { + if ((priv != HGMP_PRIVILEGE) && (priv != HGMP_NO_PRIVILEGE)) { + Warning("%s: invalid privilege parameter\n", __FUNCTION__); + return NULL; + } + +#if defined(__APPLE__) + path = Util_SafeMalloc(pathSize); + if (_NSGetExecutablePath(path, &pathSize)) { Warning(LGPFX" %s: _NSGetExecutablePath failed.\n", __FUNCTION__); + free(path); return NULL; } -#else - int retval; - Bool isSuper; -#ifdef VMX86_SERVER +#else +#if defined(VMX86_SERVER) if (HostType_OSIsPureVMK()) { return NULL; } @@ -1443,20 +1595,24 @@ // "/proc/self/exe" only exists on Linux 2.2+. ASSERT(Hostinfo_OSVersion(0) >= 2 && Hostinfo_OSVersion(1) >= 2); - /* Readlink does not NULL terminate the string. */ - memset(buf, 0, sizeof buf); - isSuper = IsSuperUser(); - SuperUser(TRUE); - retval = readlink("/proc/self/exe", buf, sizeof buf - 1); - SuperUser(isSuper); - if (retval < 0) { + if (priv == HGMP_PRIVILEGE) { + isSuper = IsSuperUser(); + SuperUser(TRUE); + } + + path = Posix_ReadLink("/proc/self/exe"); + + if (priv == HGMP_PRIVILEGE) { + SuperUser(isSuper); + } + + if (path == NULL) { Warning(LGPFX" %s: readlink failed: %s\n", __FUNCTION__, Err_ErrString()); - return NULL; } #endif - return strdup(buf); + return path; } @@ -1542,27 +1698,31 @@ *----------------------------------------------------------------------------- */ -char * +Unicode Hostinfo_GetUser() { char buffer[BUFSIZ]; struct passwd pw; struct passwd *ppw = &pw; - char const *name = NULL; + Unicode env = NULL; + Unicode name = NULL; - if ((getpwuid_r(getuid(), &pw, buffer, sizeof buffer, &ppw) == 0) && + if ((Posix_Getpwuid_r(getuid(), &pw, buffer, sizeof buffer, &ppw) == 0) && (ppw != NULL)) { - name = pw.pw_name; + if (ppw->pw_name) { + name = Unicode_Duplicate(ppw->pw_name); + } } if (!name) { - name = getenv("USER"); + env = Posix_Getenv("USER"); + if (env) { + name = Unicode_Duplicate(env); + } } - - return name ? strdup(name) : NULL; + return name; } - /* *----------------------------------------------------------------------------- * @@ -1581,7 +1741,7 @@ void Hostinfo_LogMemUsage(void) { - int fd = open("/proc/self/statm", O_RDONLY); + int fd = Posix_Open("/proc/self/statm", O_RDONLY); if (fd != -1) { size_t len; diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/user/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/user/Makefile.am --- open-vm-tools-2008.01.23-74039/lib/user/Makefile.am 2008-01-28 08:02:50.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/user/Makefile.am 2008-10-13 08:01:48.000000000 +0100 @@ -23,6 +23,4 @@ libUser_a_SOURCES += util.c libUser_a_SOURCES += utilPosix.c -AM_CFLAGS = -AM_CFLAGS += @COMMON_CFLAGS@ -AM_CFLAGS += @LIB_USER_CFLAGS@ +AM_CFLAGS = @LIB_USER_CPPFLAGS@ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/user/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/user/Makefile.in --- open-vm-tools-2008.01.23-74039/lib/user/Makefile.in 2008-01-28 08:03:05.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/user/Makefile.in 2008-10-13 08:02:16.000000000 +0100 @@ -52,7 +52,10 @@ subdir = lib/user DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +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)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -65,7 +68,7 @@ util.$(OBJEXT) utilPosix.$(OBJEXT) libUser_a_OBJECTS = $(am_libUser_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp +depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -91,8 +94,6 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -COMMON_CFLAGS = @COMMON_CFLAGS@ -COMMON_PROG_CFLAGS = @COMMON_PROG_CFLAGS@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -103,45 +104,57 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ -ECHO = @ECHO@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GREP = @GREP@ -GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_AUTH_CFLAGS = @LIB_AUTH_CFLAGS@ -LIB_FILE_CFLAGS = @LIB_FILE_CFLAGS@ -LIB_HGFS_SERVER_CFLAGS = @LIB_HGFS_SERVER_CFLAGS@ -LIB_IMPERSONATE_CFLAGS = @LIB_IMPERSONATE_CFLAGS@ -LIB_MISC_CFLAGS = @LIB_MISC_CFLAGS@ -LIB_PROC_MGR_CFLAGS = @LIB_PROC_MGR_CFLAGS@ -LIB_STRING_CFLAGS = @LIB_STRING_CFLAGS@ -LIB_USER_CFLAGS = @LIB_USER_CFLAGS@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -149,27 +162,35 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ VERSION = @VERSION@ -VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -200,6 +221,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -216,7 +238,7 @@ top_srcdir = @top_srcdir@ noinst_LIBRARIES = libUser.a libUser_a_SOURCES = hostinfo.c hostinfoPosix.c util.c utilPosix.c -AM_CFLAGS = @COMMON_CFLAGS@ @LIB_USER_CFLAGS@ +AM_CFLAGS = @LIB_USER_CPPFLAGS@ all: all-am .SUFFIXES: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/user/util.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/user/util.c --- open-vm-tools-2008.01.23-74039/lib/user/util.c 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/user/util.c 2008-10-13 08:01:53.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -24,6 +24,13 @@ #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 <winsock2.h> // also includes windows.h # include <io.h> @@ -31,8 +38,6 @@ # include "coreDump.h" #endif -#include "vm_ctype.h" -#include "safetime.h" #include <fcntl.h> #include <stdlib.h> #include <limits.h> @@ -42,16 +47,13 @@ #include <ctype.h> #if !defined(_WIN32) && !defined(N_PLAT_NLM) -# if defined(linux) -# include <sys/syscall.h> // for SYS_gettid -# endif # include <unistd.h> # include <pwd.h> -extern int vasprintf(char **ptr, const char *f, va_list arg); +# include <dlfcn.h> #endif -#if __APPLE__ -#include <pthread.h> +#if defined(__linux__) && !defined(VMX86_TOOLS) +# include <link.h> #endif #include "vmware.h" @@ -61,18 +63,13 @@ /* 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 "hostType.h" - -/* - * ESX with userworld VMX - */ -#if defined(VMX86_SERVER) -#include "user_layout.h" -#endif +#include "unicode.h" +#include "posix.h" #ifndef O_BINARY #define O_BINARY 0 @@ -116,6 +113,12 @@ }; #endif /* UTIL_BACKTRACE_USE_UNWIND */ +#if !defined(_WIN32) && !defined(N_PLAT_NLM) +static Unicode GetHomeDirectory(ConstUnicode name); +static Unicode GetLoginName(int uid); +#endif +static Bool IsAlphaOrNum(char ch); + /* *---------------------------------------------------------------------- @@ -253,33 +256,6 @@ /* - *---------------------------------------------------------------------- - * - * Util_ShortenPath -- - * - * Check the input path length agains the maxLength parameter. If - * the path is too long, prepend "..." and shorten it to the - * appropriate length. - * - *---------------------------------------------------------------------- - */ - -void -Util_ShortenPath(char *dst, // OUT - const char *src, // IN - int maxLength) // IN -{ - if (strlen(src) >= maxLength - 4) { - Str_Strcpy(dst, "...", maxLength); - Str_Strcat(dst, - src + strlen(src) - maxLength + 4, - maxLength); - } else { - Str_Strcpy(dst, src, maxLength); - } -} - -/* *----------------------------------------------------------------------------- * * Util_LogWrapper -- @@ -397,6 +373,61 @@ } return _URC_NO_REASON; } + +#if !defined(_WIN32) && !defined(N_PLAT_NLM) && !defined(VMX86_TOOLS) +/* + *----------------------------------------------------------------------------- + * + * 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); + void *encl_func_addr; + Dl_info dli; + + + /* + * Stack grows down. So if we are below basePtr, do nothing... + */ + if (cfa >= data->basePtr) { +#ifndef VM_X86_64 +# error You should not build this on 32bit - there is no eh_frame there. +#endif + encl_func_addr = _Unwind_FindEnclosingFunction((void *)_Unwind_GetIP(ctx)); + if ( (dladdr(encl_func_addr, &dli) != 0) || + (dladdr((void *)_Unwind_GetIP(ctx), &dli) != 0 )) { + 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; +} +#endif #endif @@ -455,9 +486,26 @@ data.outFuncData = outFuncData; data.frameNr = 0; _Unwind_Backtrace(UtilBacktraceFromPointerCallback, &data); + +#if !defined(_WIN32) && !defined(N_PLAT_NLM) && !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; + _Unwind_Backtrace(UtilSymbolBacktraceFromPointerCallback, &data); +#endif + #elif !defined(VM_X86_64) uintptr_t *x = basePtr; int i; +#if !defined(_WIN32) && !defined(N_PLAT_NLM) && !defined(VMX86_TOOLS) + Dl_info dli; +#endif for (i = 0; i < 256; i++) { if (x < basePtr || @@ -467,6 +515,30 @@ outFunc(outFuncData, "Backtrace[%d] %#08x eip %#08x \n", i, x[0], x[1]); x = (uintptr_t *) x[0]; } + +#if !defined(_WIN32) && !defined(N_PLAT_NLM) && !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 + */ + 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) != 0 ) { + 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 } @@ -634,34 +706,20 @@ *---------------------------------------------------------------------- */ -static char * -UtilDoTildeSubst(char *user) // IN - name of user +static Unicode +UtilDoTildeSubst(Unicode user) // IN - name of user { - char *dir; - char *str = NULL; + Unicode str = NULL; if (*user == '\0') { - dir = getenv("HOME"); - if (dir == NULL) { + str = Unicode_Duplicate(Posix_Getenv("HOME")); + if (str == NULL) { Log("Could not expand environment variable HOME.\n"); - } else { - str = strdup(dir); - if (str == NULL) { - MSG_POST_NOMEM(); - } } } else { - struct passwd *pwPtr; - pwPtr = getpwnam(user); - if (pwPtr == NULL) { - endpwent(); - Log("Could not get information for user '%s'.\n",user); - } else { - str = strdup(pwPtr->pw_dir); - if (str == NULL) { - MSG_POST_NOMEM(); - } - endpwent(); + str = GetHomeDirectory(user); + if (str == NULL) { + Log("Could not get information for user '%s'.\n", user); } } return str; @@ -670,101 +728,6 @@ #ifndef N_PLAT_NLM -#if defined(linux) -/* - *----------------------------------------------------------------------------- - * - * gettid -- - * - * Retrieve unique thread identification suitable for kill or setpriority. - * Do not call this function directly, use Util_GetCurrentThreadId() instead. - * - * Results: - * Unique thread identification on success. - * (pid_t)-1 on error, errno set (when kernel does not support this call) - * - * Side effects: - * None. - * - *----------------------------------------------------------------------------- - */ - -static INLINE -pid_t gettid(void) -{ -#if defined(SYS_gettid) - return (pid_t)syscall(SYS_gettid); -#else - return -1; -#endif -} -#endif - - -/* - *----------------------------------------------------------------------------- - * - * Util_GetCurrentThreadId -- - * - * Retrieves a unique thread identification suitable to identify a thread - * to kill it or change its scheduling priority. - * - * Results: - * Unique thread identification on success. - * ASSERTs on failure (should not happen). - * - * Side effects: - * None. - * - *----------------------------------------------------------------------------- - */ - -uint32 -Util_GetCurrentThreadId(void) -{ -#if defined(linux) - /* - * It is possible that two threads can enter gettid() path simultaneously, - * both eventually clearing useTid to zero. It does not matter - only - * problem which can happen is that useTid will be set to zero twice. - * And it has no impact on useTid value... - */ - - static int useTid = 1; - pid_t tid; - - // ESX with userworld VMX -#if defined(VMX86_SERVER) - if (HostType_OSIsVMK()) { - return User_GetTid(); - } -#endif - - if (useTid) { - tid = gettid(); - if (tid != (pid_t)-1) { - return tid; - } - ASSERT(errno == ENOSYS); - useTid = 0; - } - tid = getpid(); - ASSERT(tid != (pid_t)-1); - return tid; -#elif __FreeBSD__ || sun - pid_t tid; - - tid = getpid(); - ASSERT(tid != (pid_t)-1); - return tid; -#elif __APPLE__ - ASSERT_ON_COMPILE(sizeof(uint32) == sizeof(pthread_t)); - return (uint32)pthread_self(); -#else - return GetCurrentThreadId(); -#endif -} - /* *---------------------------------------------------------------------- @@ -794,11 +757,11 @@ #define UTIL_MAX_PATH_CHUNKS 100 -char * -Util_ExpandString(const char *fileName) +Unicode +Util_ExpandString(ConstUnicode fileName) // IN file path to expand { - char *copy = NULL; - char *result = NULL; + Unicode copy = NULL; + Unicode result = NULL; int nchunk = 0; char *chunks[UTIL_MAX_PATH_CHUNKS]; int chunkSize[UTIL_MAX_PATH_CHUNKS]; @@ -808,22 +771,24 @@ ASSERT(fileName); - copy = strdup(fileName); - if (copy == NULL) { - Msg_Append(MSGID(util.ExpandStringNoMemForCopy) - "Cannot allocate memory to expand \"%s\".\n", fileName); - goto out; - } + copy = Unicode_Duplicate(fileName); /* * quick exit */ - - if (fileName[0] != '~' && Str_Strchr(fileName, '$') == NULL) { + if (!Unicode_StartsWith(fileName, "~") && + Unicode_Find(fileName, "$") == UNICODE_INDEX_NOT_FOUND) { return copy; } /* + * XXX Because the rest part of code depends pretty heavily from character + * pointer operations we want to leave it as-is and don't want to re-work + * it with using unicode library. However it's acceptable only until our + * Unicode type is utf-8 and until code below works correctly with utf-8. + */ + + /* * Break string into nice chunks for separate expansion. * * The rule for terminating a ~ expansion is historical. -- edward @@ -834,7 +799,7 @@ size_t len; if (*cp == '$') { char *p; - for (p = cp + 1; isalnum(*p & 0xFF) || *p == '_'; p++) { + for (p = cp + 1; IsAlphaOrNum(*p) || *p == '_'; p++) { } len = p - cp; #if !defined(_WIN32) @@ -847,11 +812,11 @@ if (nchunk >= UTIL_MAX_PATH_CHUNKS) { Msg_Append(MSGID(util.expandStringTooManyChunks) "Filename \"%s\" has too many chunks.\n", - fileName); + UTF8(fileName)); goto out; } chunks[nchunk] = cp; - chunkSize[nchunk] = (int) len; + chunkSize[nchunk] = len; freeChunk[nchunk] = FALSE; nchunk++; cp += len; @@ -885,9 +850,11 @@ for (i = 0; i < nchunk; i++) { char save; - char *expand; + Unicode expand = NULL; char buf[100]; - +#if defined(_WIN32) + utf16_t bufW[100]; +#endif cp = chunks[i]; if (*cp != '$' || chunkSize[i] == 1) { @@ -908,26 +875,23 @@ * Others are just getenv(). */ - expand = getenv(cp + 1); + expand = Unicode_Duplicate(Posix_Getenv(cp + 1)); if (expand != NULL) { } else if (strcasecmp(cp + 1, "PID") == 0) { Str_Snprintf(buf, sizeof buf, "%"FMTPID, getpid()); - expand = buf; + expand = Util_SafeStrdup(buf); } else if (strcasecmp(cp + 1, "USER") == 0) { #if !defined(_WIN32) int uid = getuid(); - struct passwd *p = getpwuid(uid); - if (p != NULL) { - expand = p->pw_name; - } + expand = GetLoginName(uid); #else - int n = sizeof buf; - if (GetUserName(buf, &n)) { - expand = buf; + DWORD n = ARRAYSIZE(bufW); + if (GetUserNameW(bufW, &n)) { + expand = Unicode_AllocWithUTF16(bufW); } #endif - else { - expand = "unknown"; + if (expand == NULL) { + expand = Unicode_Duplicate("unknown"); } } else { Warning("Environment variable '%s' not defined in '%s'.\n", @@ -937,7 +901,7 @@ * Strip off the env variable string from the pathname. */ - expand = ""; + expand = Unicode_Duplicate(""); #else // _WIN32 @@ -955,7 +919,7 @@ */ Str_Strcpy(buf, cp, 100); - expand = buf; + expand = Unicode_AllocWithUTF8(buf); #endif } @@ -963,14 +927,14 @@ ASSERT(expand != NULL); ASSERT(!freeChunk[i]); - chunks[i] = strdup(expand); + chunks[i] = expand; if (chunks[i] == NULL) { Msg_Append(MSGID(util.ExpandStringNoMemForChunk) "Cannot allocate memory to expand \"%s\" in \"%s\".\n", - expand, fileName); + expand, UTF8(fileName)); goto out; } - chunkSize[i] = (int) strlen(expand); + chunkSize[i] = strlen(expand); freeChunk[i] = TRUE; } @@ -988,7 +952,7 @@ if (result == NULL) { Msg_Append(MSGID(util.expandStringNoMemForResult) "Cannot allocate memory for the expansion of \"%s\".\n", - fileName); + UTF8(fileName)); goto out; } cp = result; @@ -1046,7 +1010,7 @@ return FALSE; } - if (stat(epath, &statbuf) == 0) { + if (Posix_Stat(epath, &statbuf) == 0) { if (! S_ISDIR(statbuf.st_mode)) { Msg_Append(MSGID(util.msde.notDir) "The path \"%s\" exists, but it is not a directory.\n", @@ -1055,7 +1019,7 @@ return FALSE; } } else { - if (mkdir(epath, mode) != 0) { + if (Posix_Mkdir(epath, mode) != 0) { Msg_Append(MSGID(util.msde.mkdir) "Cannot create directory \"%s\": %s.\n", epath, Msg_ErrString()); @@ -1551,12 +1515,6 @@ return NULL; } File_GetPathName(source, &path, &base); - if (path == NULL || base == NULL) { - Warning("Util_DeriveFileName couldn't get path/base\n"); - free(path); - free(base); - goto end; - } /* If replacing name and extension */ if (name != NULL) { @@ -1624,7 +1582,6 @@ } free(path); free(base); -end: return returnResult; } @@ -1758,5 +1715,171 @@ return stringVector; } - #endif /* !defined(N_PLAT_NLM) */ + +#if defined (__linux__) && !defined(VMX86_TOOLS) +/* + *----------------------------------------------------------------------------- + * + * UtilPrintLoadedObjectsCallback -- + * + * Callback from dl_iterate_phdr to add info for a single + * loaded object to the log. + * + * Results: + * 0: continue iterating/success + * non-zero: stop iterating/error + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static int +UtilPrintLoadedObjectsCallback(struct dl_phdr_info *info, //IN + size_t size, //IN + void *data) //IN +{ + /* Blank name means things like stack, which we don't care about */ + if (strcmp(info->dlpi_name, "")) { + Log("Object %s loaded at %p\n", info->dlpi_name, + (void *)info->dlpi_addr); + } + return 0; +} + + +/* + *---------------------------------------------------------------------- + * + * Util_PrintLoadedObjects -- + * + * Print the list of loaded objects to the log. Useful in + * parsing backtraces with ASLR. + * + * Results: + * + * void + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +void +Util_PrintLoadedObjects(void *addr_inside_exec) +{ + Dl_info dli; + + Log("Printing loaded objects\n"); + if (dladdr(addr_inside_exec, &dli)) { + Log("Object %s loaded at %p\n", dli.dli_fname, + (void *)dli.dli_fbase); + } + dl_iterate_phdr(UtilPrintLoadedObjectsCallback, NULL); + Log("End printing loaded objects\n"); +} +#endif + +#if !defined(_WIN32) && !defined(N_PLAT_NLM) + +/* + *----------------------------------------------------------------------------- + * + * GetHomeDirectory -- + * + * Unicode wrapper for posix getpwnam call for working directory. + * + * Results: + * Returns initial working directory or NULL if it fails. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static Unicode +GetHomeDirectory(ConstUnicode name) // IN: user name +{ + char *tmpname = NULL; + struct passwd *pw; + Unicode ret = NULL; + + tmpname = Unicode_GetAllocBytes(name, STRING_ENCODING_DEFAULT); + + pw = getpwnam(tmpname); + free(tmpname); + + if (!pw || (pw && !pw->pw_dir)) { + endpwent(); + return NULL; + } + ret = Unicode_Alloc(pw->pw_dir, STRING_ENCODING_DEFAULT); + endpwent(); + return ret; +} + + +/* + *----------------------------------------------------------------------------- + * + * GetLoginName -- + * + * Unicode wrapper for posix getpwnam call for working directory. + * + * Results: + * Returns user's login name or NULL if it fails. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static Unicode +GetLoginName(int uid) //IN: user id +{ + struct passwd *pw = NULL; + + pw = getpwuid(uid); + + if (!pw || (pw && !pw->pw_name)) { + return NULL; + } + return Unicode_Alloc(pw->pw_name, STRING_ENCODING_DEFAULT); +} + +#endif + + +/* + *----------------------------------------------------------------------------- + * + * IsAlphaOrNum -- + * + * Checks if character is a numeric digit or a letter of the + * english alphabet. + * + * Results: + * Returns TRUE if character is a digit or a letter, FALSE otherwise. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static Bool +IsAlphaOrNum(char ch) //IN +{ + if ((ch >= '0' && ch <= '9') || + (ch >= 'a' && ch <= 'z') || + (ch >= 'A' && ch <= 'Z')) { + return TRUE; + } else { + return FALSE; + } +} diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/user/utilPosix.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/user/utilPosix.c --- open-vm-tools-2008.01.23-74039/lib/user/utilPosix.c 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/user/utilPosix.c 2008-10-13 08:01:53.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -28,6 +28,8 @@ #include <sys/types.h> #include <sys/stat.h> #include <sys/ioctl.h> +#include <sys/time.h> +#include <sys/resource.h> #include <fcntl.h> #include <unistd.h> #include <errno.h> @@ -52,6 +54,9 @@ #include "hostinfo.h" #include "syncMutex.h" #include "escape.h" +#include "unicodeOperations.h" +#include "err.h" +#include "posix.h" /* For Util_GetProcessName() */ @@ -85,6 +90,109 @@ /* *----------------------------------------------------------------------------- * + * Util_BumpNoFds -- + * + * Bump the number of file descriptor this process can open to 2048. On + * failure sets *cur to the number of fds we can currently open, and sets + * *wanted to what we want. + * + * Results: + * 0 on success, errno from the failing call to setrlimit(2) otherwise. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +int +Util_BumpNoFds(uint32 *cur, // OUT + uint32 *wanted) // OUT +{ + struct rlimit lim; + int err; + + /* + * Check for minimum file descriptor limit. The number 2048 is + * somewhat arbitrary. Trying to do multiple snapshots of a split + * disk can rapidly consume descriptors however, so we ought to + * have a large number. This is only pushing back the problem of + * course. Ideally we'd have a fully scalable solution. + */ + + static const rlim_t fdsDesired = 2048; + + err = getrlimit(RLIMIT_NOFILE, &lim); + ASSERT_NOT_IMPLEMENTED(err >= 0); + + if (cur) { + *cur = lim.rlim_cur; + } + if (wanted) { + *wanted = fdsDesired; + } + + if (lim.rlim_cur != RLIM_INFINITY && lim.rlim_cur < fdsDesired) { + Bool needSuperUser; + + /* + * First attempt to raise limit ourselves. + * If that fails, complain and make user do it. + */ + rlim_t curFdLimit = lim.rlim_cur; + rlim_t maxFdLimit = lim.rlim_max; + + lim.rlim_cur = fdsDesired; + + /* + * rlim_max may need to be increased as well. + */ + + needSuperUser = lim.rlim_max != RLIM_INFINITY && lim.rlim_max < fdsDesired; + + if (needSuperUser) { + lim.rlim_max = fdsDesired; + } else { + err = setrlimit(RLIMIT_NOFILE, &lim) < 0 ? errno : 0; + } + + /* + * Set euid to root for the FD limit increase. Note we don't need root + * unless rlim_max is being increased. Revert to non-root immediately + * after. + */ + + if (err == EPERM || needSuperUser) { + Bool wasSuper = IsSuperUser(); + SuperUser(TRUE); + err = setrlimit(RLIMIT_NOFILE, &lim) < 0 ? errno : 0; + SuperUser(wasSuper); + } + + /* + * If everything else failed, simply try using rlim_max. That might be + * enough.. + */ + + if (err != 0) { + lim.rlim_cur = maxFdLimit; + lim.rlim_max = maxFdLimit; + err = setrlimit(RLIMIT_NOFILE, &lim) < 0 ? errno : 0; + ASSERT_NOT_TESTED(err == 0); + } + + if (err != 0) { + Log("UTIL: Failed to set number of fds at %u, was %u: %s (%d)\n", + (uint32)fdsDesired, (uint32)curFdLimit, Err_Errno2String(err), err); + } + } + return err; +} + + +/* + *----------------------------------------------------------------------------- + * * UtilGetUserName -- * * Retrieve the name associated with a user ID. Thread-safe @@ -125,8 +233,7 @@ return NULL; } - if ( getpwuid_r(uid, &pw, memPool, memPoolSize, &pw_p) != 0 - || pw_p != &pw) { + if (Posix_Getpwuid_r(uid, &pw, memPool, memPoolSize, &pw_p) != 0) { free(memPool); Warning("UtilGetUserName: Unable to retrieve the username associated " "with user ID %u.\n", @@ -134,7 +241,7 @@ return NULL; } - userName = strdup(pw.pw_name); + userName = strdup(pw_p->pw_name); free(memPool); if (userName == NULL) { Warning("UtilGetUserName: Not enough memory.\n"); @@ -168,38 +275,26 @@ */ int -Util_MakeSafeTemp(const char *tag, // IN (OPT) - char **presult) // OUT +Util_MakeSafeTemp(ConstUnicode tag, // IN (OPT): + Unicode *presult) // OUT: { - char *dir = NULL, *fileName = NULL; int fd = -1; + Unicode dir = NULL; + Unicode fileName = NULL; *presult = NULL; if (tag && File_IsFullPath(tag)) { - char *lastSlash; - - dir = Util_SafeStrdup(tag); - lastSlash = Str_Strrchr(dir, DIRSEPC); - ASSERT(lastSlash); - - fileName = Util_SafeStrdup(lastSlash + 1); - *lastSlash = 0; + File_GetPathName(tag, &dir, &fileName); } else { dir = Util_GetSafeTmpDir(TRUE); - - if (!dir) { - goto exit; - } - - fileName = Util_SafeStrdup(tag ? tag : "vmware"); + fileName = Unicode_Duplicate(tag ? tag : "vmware"); } fd = File_MakeTempEx(dir, fileName, presult); - exit: - free(dir); - free(fileName); + Unicode_Free(dir); + Unicode_Free(fileName); return fd; } @@ -231,7 +326,7 @@ Bool result; static const mode_t mode = 0700; - result = (mkdir(dirname, mode) == 0); + result = (Posix_Mkdir(dirname, mode) == 0); if (!result) { int error = errno; @@ -247,7 +342,7 @@ * the current effective user with permissions 'mode'. */ - if (0 == lstat(dirname, &st)) { + 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 @@ -287,15 +382,16 @@ *----------------------------------------------------------------------------- */ -static char * +static Unicode UtilFindExistingSafeTmpDir(uid_t userId, // IN const char * userName, // IN const char * baseTmpDir) // IN { - DIR* dir; - char* pattern; - size_t patlen; - char* tmpDir = NULL; + int i; + int numFiles; + Unicode pattern; + Unicode tmpDir = NULL; + Unicode *fileList = NULL; /* * We always use the pattern PRODUCT-USER-xxxx when creating @@ -303,51 +399,36 @@ * those names and the appropriate permissions. */ - pattern = Str_Asprintf(&patlen, "%s-%s-", - PRODUCT_GENERIC_NAME_LOWER, userName); - if (!pattern) { - Warning("%s: Out of memory error.\n", __FUNCTION__); - goto exit; + pattern = Unicode_Format("%s-%s-", PRODUCT_GENERIC_NAME_LOWER, userName); + if (pattern == NULL) { + return NULL; } - - dir = opendir(baseTmpDir); - - if (dir) { - struct dirent *direntry; - - /* - * If we get any errors during the directory iteration, we - * will just bail out and try to create a new temporary - * directory. - */ - while ((direntry = readdir(dir)) != NULL) { - - if ((direntry->d_type == DT_DIR) && - (strncmp(direntry->d_name, pattern, patlen) == 0)) { - - tmpDir = Str_Asprintf(NULL, "%s"DIRSEPS"%s", - baseTmpDir, - direntry->d_name); - - if (!tmpDir) { - Warning("%s: Out of memory error.\n", __FUNCTION__); - break; - } - - if (UtilAcceptableSafeTmpDir(tmpDir, userId)) { - break; - } - - free(tmpDir); - } - } - - closedir(dir); + + numFiles = File_ListDirectory(baseTmpDir, &fileList); + + if (numFiles == -1) { + Unicode_Free(pattern); + return NULL; } - - free(pattern); - exit: + for (i = 0; i < numFiles; i++) { + if (Unicode_StartsWith(fileList[i], pattern)) { + Unicode path = Unicode_Join(baseTmpDir, DIRSEPS, fileList[i], + NULL); + + if (File_IsDirectory(path) && + UtilAcceptableSafeTmpDir(path, userId)) { + tmpDir = path; + break; + } + + Unicode_Free(path); + } + } + + Unicode_FreeList(fileList, numFiles); + Unicode_Free(pattern); + return tmpDir; } @@ -585,7 +666,7 @@ */ Str_Sprintf(fileName, sizeof fileName, "/proc/%"FMTPID"/" PROCFILE, pid); - fd = open(fileName, O_RDONLY); + fd = Posix_Open(fileName, O_RDONLY); if (fd < 0) { Log("Util_GetProcessName: Error: cannot open %s\n", fileName); return FALSE; diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/vixTools/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/vixTools/Makefile.am --- open-vm-tools-2008.01.23-74039/lib/vixTools/Makefile.am 2008-01-28 08:02:49.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/vixTools/Makefile.am 2008-10-13 08:01:48.000000000 +0100 @@ -19,6 +19,5 @@ libVixTools_a_SOURCES = libVixTools_a_SOURCES += vixTools.c +AM_CFLAGS = -I$(top_builddir)/include -AM_CFLAGS = -AM_CFLAGS += @COMMON_CFLAGS@ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/vixTools/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/vixTools/Makefile.in --- open-vm-tools-2008.01.23-74039/lib/vixTools/Makefile.in 2008-01-28 08:03:05.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/vixTools/Makefile.in 2008-10-13 08:02:16.000000000 +0100 @@ -52,7 +52,10 @@ subdir = lib/vixTools DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +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)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -64,7 +67,7 @@ am_libVixTools_a_OBJECTS = vixTools.$(OBJEXT) libVixTools_a_OBJECTS = $(am_libVixTools_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp +depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -90,8 +93,6 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -COMMON_CFLAGS = @COMMON_CFLAGS@ -COMMON_PROG_CFLAGS = @COMMON_PROG_CFLAGS@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -102,45 +103,57 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ -ECHO = @ECHO@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GREP = @GREP@ -GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_AUTH_CFLAGS = @LIB_AUTH_CFLAGS@ -LIB_FILE_CFLAGS = @LIB_FILE_CFLAGS@ -LIB_HGFS_SERVER_CFLAGS = @LIB_HGFS_SERVER_CFLAGS@ -LIB_IMPERSONATE_CFLAGS = @LIB_IMPERSONATE_CFLAGS@ -LIB_MISC_CFLAGS = @LIB_MISC_CFLAGS@ -LIB_PROC_MGR_CFLAGS = @LIB_PROC_MGR_CFLAGS@ -LIB_STRING_CFLAGS = @LIB_STRING_CFLAGS@ -LIB_USER_CFLAGS = @LIB_USER_CFLAGS@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -148,27 +161,35 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ VERSION = @VERSION@ -VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -199,6 +220,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -215,7 +237,7 @@ top_srcdir = @top_srcdir@ noinst_LIBRARIES = libVixTools.a libVixTools_a_SOURCES = vixTools.c -AM_CFLAGS = @COMMON_CFLAGS@ +AM_CFLAGS = -I$(top_builddir)/include all: all-am .SUFFIXES: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/vixTools/vixTools.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/vixTools/vixTools.c --- open-vm-tools-2008.01.23-74039/lib/vixTools/vixTools.c 2008-01-28 08:02:50.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/vixTools/vixTools.c 2008-10-13 08:01:51.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -29,14 +29,11 @@ #include <fcntl.h> #include <errno.h> -#if !defined(__FreeBSD__) && !defined(sun) -#define IMPLEMENT_SOCKET_MGR 0 -#endif - #ifdef _WIN32 #include <WTypes.h> #include <io.h> #include "wminic.h" +#include "win32u.h" #else #include <unistd.h> #endif @@ -52,33 +49,41 @@ #include "vm_version.h" #include "vm_app.h" #include "message.h" -#include "eventManager.h" -#include "debug.h" + +#if defined(VMTOOLS_USE_GLIB) +# define G_LOG_DOMAIN "vix" +# define Debug g_debug +# define Warning g_warning +# include <glib.h> +#else +# include "debug.h" +# include "eventManager.h" +#endif + #include "util.h" #include "strutil.h" #include "str.h" #include "file.h" -#include "fileUTF8.h" #include "err.h" #include "hostinfo.h" #include "guest_os.h" #include "conf.h" #include "vixCommands.h" #include "base64.h" -#include "guestInfoInt.h" +#include "guestInfo.h" #include "hgfsServer.h" #include "hgfs.h" #include "system.h" #include "codeset.h" +#include "posix.h" +#include "unicode.h" -#ifndef __FreeBSD__ +#if defined(linux) || defined(_WIN32) #include "netutil.h" #endif -/* Stub out impersonation functions for these platforms. */ -#if defined(__FreeBSD__) || defined(sun) || defined(N_PLAT_NLM) -Bool Impersonate_Undo(void) { return FALSE; } -#else +/* Only Windows and Linux use impersonation functions. */ +#if !defined(__FreeBSD__) && !defined(sun) #include "impersonate.h" #endif @@ -87,6 +92,7 @@ #ifdef _WIN32 #include "registryWin32.h" +#include "win32u.h" #endif /* _WIN32 */ #define SECONDS_BETWEEN_POLL_TEST_FINISHED 1 @@ -117,7 +123,10 @@ char *userName; char *password; + void *eventQueue; +#if !defined(VMTOOLS_USE_GLIB) struct Event *timeSyncEvent; +#endif } VixToolsRunProgramState; @@ -126,13 +135,17 @@ */ static Bool thisProcessRunsAsRoot = FALSE; static Bool allowConsoleUserOps = FALSE; -static DblLnkLst_Links *globalEventQueue; // event queue for main event loop -VixToolsReportProgramDoneProcType reportProgramDoneProc = NULL; +static VixToolsReportProgramDoneProcType reportProgramDoneProc = NULL; +static void *reportProgramDoneData = NULL; static VixError VixToolsGetFileInfo(VixCommandRequestHeader *requestMsg, char **result); +#if defined(VMTOOLS_USE_GLIB) +static gboolean VixToolsMonitorAsyncProc(void *clientData); +#else static Bool VixToolsMonitorAsyncProc(void *clientData); +#endif static void VixToolsPrintFileInfo(char *filePathName, char *fileName, @@ -153,8 +166,8 @@ static void VixToolsFreeRunProgramState(VixToolsRunProgramState *asyncState); -static Bool VixToolsImpersonateUser(VixCommandRequestHeader *requestMsg, - void **userToken); +static VixError VixToolsImpersonateUser(VixCommandRequestHeader *requestMsg, + void **userToken); static const char *scriptFileBaseName = "vixScript"; @@ -181,6 +194,7 @@ static VixError VixToolsRunScript(VixCommandRequestHeader *requestMsg, char *requestName, + void *eventQueue, char **result); static VixError VixToolsOpenUrl(VixCommandRequestHeader *requestMsg); @@ -210,6 +224,17 @@ const char *subnetMask); #endif +static VixError VixToolsImpersonateUserImplEx(char const *credentialTypeStr, + int credentialType, + char const *obfuscatedNamePassword, + void **userToken); + +#if defined(_WIN32) || defined(linux) +static VixError VixToolsDoesUsernameMatchCurrentUser(const char *username); +#endif + +static Bool VixToolsPidRefersToThisProcess(ProcMgr_Pid pid); + /* *----------------------------------------------------------------------------- @@ -228,14 +253,14 @@ VixError VixTools_Initialize(Bool thisProcessRunsAsRootParam, // IN - DblLnkLst_Links *globalEventQueueParam, //IN - VixToolsReportProgramDoneProcType reportProgramDoneProcParam) // IN + VixToolsReportProgramDoneProcType reportProgramDoneProcParam, // IN + void *clientData) // IN { VixError err = VIX_OK; thisProcessRunsAsRoot = thisProcessRunsAsRootParam; - globalEventQueue = globalEventQueueParam; reportProgramDoneProc = reportProgramDoneProcParam; + reportProgramDoneData = clientData; return(err); } // VixTools_Initialize @@ -287,9 +312,11 @@ */ void -VixTools_SetRunProgramCallback(VixToolsReportProgramDoneProcType reportProgramDoneProcParam) // IN +VixTools_SetRunProgramCallback(VixToolsReportProgramDoneProcType reportProgramDoneProcParam, // IN + void *clientData) // IN { reportProgramDoneProc = reportProgramDoneProcParam; + reportProgramDoneData = clientData; } // VixTools_SetRunProgramCallback @@ -312,6 +339,7 @@ VixError VixTools_RunProgram(VixCommandRequestHeader *requestMsg, // IN char *requestName, // IN + void *eventQueue, // IN char **result) // OUT { VixError err = VIX_OK; @@ -335,14 +363,23 @@ + runProgramRequest->programNameLength + 1; } - // runProgramRequest->runProgramOptions; - if (thisProcessRunsAsRoot) { - impersonatingVMWareUser = VixToolsImpersonateUser(requestMsg, &userToken); - if (!impersonatingVMWareUser) { +#ifdef _WIN32 + if (runProgramRequest->runProgramOptions & VIX_RUNPROGRAM_RUN_AS_LOCAL_SYSTEM) { + if (!VixToolsUserIsMemberOfAdministratorGroup(requestMsg)) { err = VIX_E_GUEST_USER_PERMISSIONS; + goto abort; + } + userToken = PROCESS_CREATOR_USER_TOKEN; + } +#endif + + if (NULL == userToken) { + err = VixToolsImpersonateUser(requestMsg, &userToken); + if (VIX_OK != err) { goto abort; } + impersonatingVMWareUser = TRUE; } err = VixToolsRunProgramImpl(requestName, @@ -350,6 +387,7 @@ commandLineArgs, runProgramRequest->runProgramOptions, userToken, + eventQueue, &pid); abort: @@ -388,6 +426,7 @@ char *commandLineArgs, // IN int runProgramOptions, // IN void *userToken, // IN + void *eventQueue, // IN int64 *pid) // OUT,OPTIONAL { VixError err = VIX_OK; @@ -398,13 +437,14 @@ char *stopProgramFileName; Bool programExists; Bool programIsExecutable; -#if defined(_WIN32) && !defined(WIN9XCOMPAT) - Bool forcedRoot = FALSE; -#endif #if defined(_WIN32) + Bool forcedRoot = FALSE; ProcMgr_ProcArgs procArgs; STARTUPINFO si; #endif +#if defined(VMTOOLS_USE_GLIB) + GSource *timer; +#endif if (NULL != pid) { *pid = (int64) -1; @@ -438,7 +478,7 @@ * */ - programExists = FileUTF8_Exists(startProgramFileName); + programExists = File_Exists(startProgramFileName); programIsExecutable = (FileIO_Access(startProgramFileName, FILEIO_ACCESS_EXEC) == FILEIO_SUCCESS); @@ -485,13 +525,11 @@ asyncState->requestName = Util_SafeStrdup(requestName); asyncState->runProgramOptions = runProgramOptions; -#if defined(_WIN32) && !defined(WIN9XCOMPAT) +#if defined(_WIN32) if (PROCESS_CREATOR_USER_TOKEN != userToken) { forcedRoot = Impersonate_ForceRoot(); } -#endif -#if defined(_WIN32) memset(&procArgs, 0, sizeof procArgs); memset(&si, 0, sizeof si); procArgs.hToken = (PROCESS_CREATOR_USER_TOKEN == userToken) ? NULL : userToken; @@ -506,7 +544,7 @@ asyncState->procState = ProcMgr_ExecAsync(fullCommandLine, NULL); #endif -#if defined(_WIN32) && !defined(WIN9XCOMPAT) +#if defined(_WIN32) if (forcedRoot) { Impersonate_UnforceRoot(); } @@ -524,7 +562,14 @@ /* * Start a periodic procedure to check the app periodically */ - asyncState->timeSyncEvent = EventManager_Add(globalEventQueue, + asyncState->eventQueue = eventQueue; +#if defined(VMTOOLS_USE_GLIB) + timer = g_timeout_source_new(SECONDS_BETWEEN_POLL_TEST_FINISHED * 1000); + g_source_set_callback(timer, VixToolsMonitorAsyncProc, asyncState, NULL); + g_source_attach(timer, g_main_loop_get_context(eventQueue)); + g_source_unref(timer); +#else + asyncState->timeSyncEvent = EventManager_Add(eventQueue, SECONDS_BETWEEN_POLL_TEST_FINISHED * 100, VixToolsMonitorAsyncProc, asyncState); @@ -532,6 +577,7 @@ err = VIX_E_OUT_OF_MEMORY; goto abort; } +#endif /* * VixToolsMonitorAsyncProc will clean asyncState up when the program finishes. @@ -559,8 +605,8 @@ * completes. * * Return value: - * TRUE on success - * FALSE on failure (detail is displayed) + * TRUE on non-glib implementation. + * FALSE on glib implementation. * * Side effects: * None @@ -568,7 +614,11 @@ *----------------------------------------------------------------------------- */ +#if defined(VMTOOLS_USE_GLIB) +static gboolean +#else static Bool +#endif VixToolsMonitorAsyncProc(void *clientData) // IN { VixError err = VIX_OK; @@ -577,12 +627,17 @@ int exitCode = 0; ProcMgr_Pid pid = -1; int result = -1; +#if defined(VMTOOLS_USE_GLIB) + GSource *timer; +#endif asyncState = (VixToolsRunProgramState *)clientData; ASSERT(asyncState); +#if !defined(VMTOOLS_USE_GLIB) /* The event has fired: it is no longer valid */ asyncState->timeSyncEvent = NULL; +#endif /* * Check if the program has completed. @@ -592,10 +647,17 @@ goto done; } +#if defined(VMTOOLS_USE_GLIB) + timer = g_timeout_source_new(SECONDS_BETWEEN_POLL_TEST_FINISHED * 1000); + g_source_set_callback(timer, VixToolsMonitorAsyncProc, asyncState, NULL); + g_source_attach(timer, g_main_loop_get_context(asyncState->eventQueue)); + g_source_unref(timer); + return FALSE; +#else /* * If it's still running, check back later. */ - asyncState->timeSyncEvent = EventManager_Add(globalEventQueue, + asyncState->timeSyncEvent = EventManager_Add(asyncState->eventQueue, SECONDS_BETWEEN_POLL_TEST_FINISHED * 100, VixToolsMonitorAsyncProc, asyncState); @@ -605,28 +667,41 @@ } return TRUE; +#endif done: + + /* + * We need to always check the exit code, even if there is no need to + * report it. On POSIX systems, ProcMgr_GetExitCode() does things like + * call waitpid() to clean up the child process. + */ + result = ProcMgr_GetExitCode(asyncState->procState, &exitCode); + pid = ProcMgr_GetPid(asyncState->procState); + if (0 != result) { + exitCode = -1; + } + /* * We may just be running to clean up after running a script, with the * results already reported. */ if ((NULL != reportProgramDoneProc) && !(asyncState->runProgramOptions & VIX_RUNPROGRAM_RETURN_IMMEDIATELY)) { - result = ProcMgr_GetExitCode(asyncState->procState, &exitCode); - pid = ProcMgr_GetPid(asyncState->procState); - if (0 != result) { - exitCode = -1; - } (*reportProgramDoneProc)(asyncState->requestName, err, exitCode, - (int64) pid); + (int64) pid, + reportProgramDoneData); } VixToolsFreeRunProgramState(asyncState); +#if defined(VMTOOLS_USE_GLIB) + return FALSE; +#else return TRUE; +#endif } // VixToolsMonitorAsyncProc @@ -674,17 +749,24 @@ *----------------------------------------------------------------------------- */ +#if defined(VMTOOLS_USE_GLIB) +VixError +VixTools_GetToolsPropertiesImpl(GKeyFile *confDictRef, // IN + char **resultBuffer, // OUT + size_t *resultBufferLength) // OUT +#else VixError VixTools_GetToolsPropertiesImpl(GuestApp_Dict **confDictRef, // IN char **resultBuffer, // OUT size_t *resultBufferLength) // OUT +#endif { VixError err = VIX_OK; VixPropertyListImpl propList; char *serializedBuffer = NULL; size_t serializedBufferLength = 0; #if !defined(__FreeBSD__) && !defined(sun) - char guestName[512]; + char *guestName; int osFamily; char *packageList = NULL; const char *powerOffScript = NULL; @@ -695,26 +777,29 @@ char osName[MAX_VALUE_LEN]; Bool foundHostName; char *tempDir = NULL; + int wordSize = 32; + VixPropertyList_Initialize(&propList); /* * Collect some values about the host. + * + * XXX: 512 is the old hardcoded value for the size of the "guestName" + * buffer. Since Win32U_GetComputerName returns a new buffer, we do this + * hack, since the GuestInfo API expects a pre-allocated buffer. */ - foundHostName = GuestInfoGetFqdn(sizeof(guestName), guestName); + guestName = Util_SafeMalloc(512); + foundHostName = GuestInfo_GetFqdn(512, guestName); if (!foundHostName) { + free(guestName); #ifdef _WIN32 - DWORD guestNameSize; - /* * Give it another try to read NetBIOS name. */ - guestNameSize = sizeof guestName / sizeof *guestName; - if (!GetComputerName(guestName, &guestNameSize)) { - guestName[0] = 0; - } + guestName = Win32U_GetComputerName(); #else - guestName[0] = 0; + guestName = Util_SafeStrdup(""); #endif } @@ -725,22 +810,39 @@ #else osFamily = GUEST_OS_FAMILY_LINUX; #endif - if (!(GuestInfoGetOSName(sizeof osNameFull, sizeof osName, osNameFull, osName))) { + if (!(GuestInfo_GetOSName(sizeof osNameFull, sizeof osName, osNameFull, osName))) { osNameFull[0] = 0; osName[0] = 0; } + wordSize = GuestInfo_GetSystemBitness(); + if (wordSize <= 0) { + wordSize = 32; + } /* * TODO: Something with this. */ packageList = ""; +#if defined(VMTOOLS_USE_GLIB) + if (confDictRef != NULL) { + powerOffScript = g_key_file_get_string(confDictRef, "powerops", + CONFNAME_POWEROFFSCRIPT, NULL); + powerOnScript = g_key_file_get_string(confDictRef, "powerops", + CONFNAME_POWERONSCRIPT, NULL); + resumeScript = g_key_file_get_string(confDictRef, "powerops", + CONFNAME_RESUMESCRIPT, NULL); + suspendScript = g_key_file_get_string(confDictRef, "powerops", + CONFNAME_SUSPENDSCRIPT, NULL); + } +#else if ((NULL != confDictRef) && (NULL != *confDictRef)) { powerOffScript = GuestApp_GetDictEntry(*confDictRef, CONFNAME_POWEROFFSCRIPT); powerOnScript = GuestApp_GetDictEntry(*confDictRef, CONFNAME_POWERONSCRIPT); resumeScript = GuestApp_GetDictEntry(*confDictRef, CONFNAME_RESUMESCRIPT); suspendScript = GuestApp_GetDictEntry(*confDictRef, CONFNAME_SUSPENDSCRIPT); } +#endif tempDir = File_GetTmpDir(TRUE); /* @@ -753,6 +855,12 @@ goto abort; } err = VixPropertyList_SetString(&propList, + VIX_PROPERTY_GUEST_OS_VERSION_SHORT, + osName); + if (VIX_OK != err) { + goto abort; + } + err = VixPropertyList_SetString(&propList, VIX_PROPERTY_GUEST_TOOLS_PRODUCT_NAM, PRODUCT_SHORT_NAME); if (VIX_OK != err) { @@ -827,6 +935,12 @@ if (VIX_OK != err) { goto abort; } + err = VixPropertyList_SetInteger(&propList, + VIX_PROPERTY_GUEST_TOOLS_WORD_SIZE, + wordSize); + if (VIX_OK != err) { + goto abort; + } /* * Serialize the property list to buffer then encode it. @@ -846,6 +960,7 @@ abort: VixPropertyList_RemoveAllWithoutHandles(&propList); + free(guestName); free(serializedBuffer); free(tempDir); #else @@ -879,6 +994,7 @@ } // VixTools_GetToolsPropertiesImpl +#if 0 /* *----------------------------------------------------------------------------- * @@ -984,6 +1100,7 @@ return err; } // VixToolsSetProperties +#endif /* @@ -1026,13 +1143,11 @@ goto abort; } - if (thisProcessRunsAsRoot) { - impersonatingVMWareUser = VixToolsImpersonateUser(requestMsg, &userToken); - if (!impersonatingVMWareUser) { - err = VIX_E_GUEST_USER_PERMISSIONS; - goto abort; - } + err = VixToolsImpersonateUser(requestMsg, &userToken); + if (VIX_OK != err) { + goto abort; } + impersonatingVMWareUser = TRUE; if (VIX_PROPERTYTYPE_INTEGER == registryRequest->expectedRegistryKeyType) { errResult = Registry_ReadInteger(registryPathName, &valueInt); @@ -1116,13 +1231,11 @@ } registryData = registryPathName + registryRequest->registryKeyLength + 1; - if (thisProcessRunsAsRoot) { - impersonatingVMWareUser = VixToolsImpersonateUser(requestMsg, &userToken); - if (!impersonatingVMWareUser) { - err = VIX_E_GUEST_USER_PERMISSIONS; - goto abort; - } + err = VixToolsImpersonateUser(requestMsg, &userToken); + if (VIX_OK != err) { + goto abort; } + impersonatingVMWareUser = TRUE; if (VIX_PROPERTYTYPE_INTEGER == registryRequest->expectedRegistryKeyType) { intValue = *((int *) registryData); @@ -1197,32 +1310,50 @@ goto abort; } - if (thisProcessRunsAsRoot) { - impersonatingVMWareUser = VixToolsImpersonateUser(requestMsg, &userToken); - if (!impersonatingVMWareUser) { - err = VIX_E_GUEST_USER_PERMISSIONS; - goto abort; - } + err = VixToolsImpersonateUser(requestMsg, &userToken); + if (VIX_OK != err) { + goto abort; } + impersonatingVMWareUser = TRUE; /////////////////////////////////////////// if (VIX_COMMAND_DELETE_GUEST_FILE == requestMsg->opCode) { /* * if pathName is an invalid symbolic link, we still want to delete it. */ - if (FALSE == FileUTF8_IsSymLink(pathName)) { - if (!(FileUTF8_Exists(pathName))) { + if (FALSE == File_IsSymLink(pathName)) { + if (!(File_Exists(pathName))) { err = VIX_E_FILE_NOT_FOUND; goto abort; } - if (!(FileUTF8_IsFile(pathName))) { + if (!(File_IsFile(pathName))) { err = VIX_E_NOT_A_FILE; goto abort; } } - resultInt = FileUTF8_UnlinkIfExists(pathName); +#ifdef _WIN32 + resultInt = File_UnlinkIfExists(pathName); +#else + /* + * UnlinkIfExists() chases the symlink and tries to delete + * what it points to. We don't want this, and rather than + * fight with bora/lib/file, just do it here ourselves. + */ + { + char *primaryPath = Unicode_GetAllocBytes(pathName, + STRING_ENCODING_DEFAULT); + if (NULL != primaryPath) { + resultInt = (unlink(primaryPath) == -1) ? errno : 0; + resultInt = (resultInt == ENOENT) ? 0 : resultInt; + free(primaryPath); + } else { + resultInt = UNICODE_CONVERSION_ERRNO; + } + } +#endif + if (0 != resultInt) { err = FoundryToolsDaemon_TranslateSystemErr(); } @@ -1235,34 +1366,34 @@ #endif /////////////////////////////////////////// } else if (VIX_COMMAND_DELETE_GUEST_DIRECTORY == requestMsg->opCode) { - resultBool = FileUTF8_Exists(pathName); + resultBool = File_Exists(pathName); if (!resultBool) { err = VIX_E_FILE_NOT_FOUND; goto abort; } - resultBool = FileUTF8_IsDirectory(pathName); + resultBool = File_IsDirectory(pathName); if (!resultBool) { err = VIX_E_NOT_A_DIRECTORY; goto abort; } - success = FileUTF8_DeleteDirectoryTree(pathName); + success = File_DeleteDirectoryTree(pathName); if (!success) { err = FoundryToolsDaemon_TranslateSystemErr(); goto abort; } /////////////////////////////////////////// } else if (VIX_COMMAND_DELETE_GUEST_EMPTY_DIRECTORY == requestMsg->opCode) { - resultBool = FileUTF8_Exists(pathName); + resultBool = File_Exists(pathName); if (!resultBool) { err = VIX_E_FILE_NOT_FOUND; goto abort; } - resultBool = FileUTF8_IsDirectory(pathName); + resultBool = File_IsDirectory(pathName); if (!resultBool) { err = VIX_E_NOT_A_DIRECTORY; goto abort; } - success = FileUTF8_DeleteEmptyDirectory(pathName); + success = File_DeleteEmptyDirectory(pathName); if (!success) { err = FoundryToolsDaemon_TranslateSystemErr(); goto abort; @@ -1323,20 +1454,18 @@ goto abort; } - if (thisProcessRunsAsRoot) { - impersonatingVMWareUser = VixToolsImpersonateUser(requestMsg, &userToken); - if (!impersonatingVMWareUser) { - err = VIX_E_GUEST_USER_PERMISSIONS; - goto abort; - } + err = VixToolsImpersonateUser(requestMsg, &userToken); + if (VIX_OK != err) { + goto abort; } + impersonatingVMWareUser = TRUE; /* * Do the action appropriate for this type of object. */ /////////////////////////////////////////// if (VIX_COMMAND_GUEST_FILE_EXISTS == requestMsg->opCode) { - resultBool = FileUTF8_IsFile(pathName); + resultBool = File_IsFile(pathName); if (resultBool) { resultInt = 1; } else { @@ -1352,7 +1481,7 @@ #endif /////////////////////////////////////////// } else if (VIX_COMMAND_DIRECTORY_EXISTS == requestMsg->opCode) { - resultBool = FileUTF8_IsDirectory(pathName); + resultBool = File_IsDirectory(pathName); if (resultBool) { resultInt = 1; } else { @@ -1406,13 +1535,11 @@ openUrlRequest = (VixMsgOpenUrlRequest *) requestMsg; url = ((char *) openUrlRequest) + sizeof(*openUrlRequest); - if (thisProcessRunsAsRoot) { - impersonatingVMWareUser = VixToolsImpersonateUser(requestMsg, &userToken); - if (!impersonatingVMWareUser) { - err = VIX_E_GUEST_USER_PERMISSIONS; - goto abort; - } + err = VixToolsImpersonateUser(requestMsg, &userToken); + if (VIX_OK != err) { + goto abort; } + impersonatingVMWareUser = TRUE; /* Actually open the URL. */ if (!GuestApp_OpenUrl(url, strcmp(windowState, "maximize") == 0)) { @@ -1449,11 +1576,10 @@ VixError VixToolsCreateTempFile(VixCommandRequestHeader *requestMsg, // IN - char **result) // OUT + char **result) // OUT: UTF-8 { VixError err = VIX_OK; char *filePathName = NULL; - static char resultBuffer[FILE_MAXPATH]; int fd = -1; Bool impersonatingVMWareUser = FALSE; void *userToken = NULL; @@ -1461,13 +1587,11 @@ makeTempFileRequest = (VixMsgCreateTempFileRequest *) requestMsg; - if (thisProcessRunsAsRoot) { - impersonatingVMWareUser = VixToolsImpersonateUser(requestMsg, &userToken); - if (!impersonatingVMWareUser) { - err = VIX_E_GUEST_USER_PERMISSIONS; - goto abort; - } + err = VixToolsImpersonateUser(requestMsg, &userToken); + if (VIX_OK != err) { + goto abort; } + impersonatingVMWareUser = TRUE; err = VixToolsGetTempFile("vmware", userToken, &filePathName, &fd); if (VIX_FAILED(err)) { @@ -1482,8 +1606,7 @@ Debug("Unable to close a file, errno is %d.\n", errno); } - Str_Sprintf(resultBuffer, sizeof(resultBuffer), "%s", filePathName); - *result = resultBuffer; + *result = filePathName; abort: if (impersonatingVMWareUser) { @@ -1491,8 +1614,6 @@ } VixToolsLogoutUser(userToken); - free(filePathName); - return err; } // VixToolsCreateTempFile @@ -1502,7 +1623,8 @@ * * VixToolsReadVariable -- * - * Write an environment variable in the guest. + * Read an environment variable in the guest. The name of the environment + * variable is expected to be in UTF-8. * * Return value: * VixError @@ -1515,11 +1637,10 @@ VixError VixToolsReadVariable(VixCommandRequestHeader *requestMsg, // IN - char **result) // OUT + char **result) // OUT: UTF-8 { VixError err = VIX_OK; char *value = ""; - static char resultBuffer[FILE_MAXPATH]; Bool impersonatingVMWareUser = FALSE; void *userToken = NULL; VixMsgReadVariableRequest *readRequest; @@ -1528,13 +1649,11 @@ readRequest = (VixMsgReadVariableRequest *) requestMsg; valueName = ((char *) readRequest) + sizeof(*readRequest); - if (thisProcessRunsAsRoot) { - impersonatingVMWareUser = VixToolsImpersonateUser(requestMsg, &userToken); - if (!impersonatingVMWareUser) { - err = VIX_E_GUEST_USER_PERMISSIONS; - goto abort; - } + err = VixToolsImpersonateUser(requestMsg, &userToken); + if (VIX_OK != err) { + goto abort; } + impersonatingVMWareUser = TRUE; switch (readRequest->variableType) { case VIX_GUEST_ENVIRONMENT_VARIABLE: @@ -1556,15 +1675,13 @@ break; } // switch (readRequest->variableType) - Str_Sprintf(resultBuffer, sizeof(resultBuffer), "%s", value); - *result = resultBuffer; + *result = value; abort: if (impersonatingVMWareUser) { VixToolsUnimpersonateUser(userToken); } VixToolsLogoutUser(userToken); - free(value); return err; } // VixToolsReadVariable @@ -1575,7 +1692,8 @@ * * VixToolsWriteVariable -- * - * Write an environment variable in the guest. + * Write an environment variable in the guest. The name of the environment + * variable and its value are expected to be in UTF-8. * * Return value: * VixError @@ -1598,16 +1716,16 @@ int result; writeRequest = (VixMsgWriteVariableRequest *) requestMsg; - valueName = ((char *) writeRequest) + sizeof(*writeRequest); - value = valueName + writeRequest->nameLength + 1; + err = VixMsg_ParseWriteVariableRequest(writeRequest, &valueName, &value); + if (VIX_OK != err) { + goto abort; + } - if (thisProcessRunsAsRoot) { - impersonatingVMWareUser = VixToolsImpersonateUser(requestMsg, &userToken); - if (!impersonatingVMWareUser) { - err = VIX_E_GUEST_USER_PERMISSIONS; - goto abort; - } + err = VixToolsImpersonateUser(requestMsg, &userToken); + if (VIX_OK != err) { + goto abort; } + impersonatingVMWareUser = TRUE; switch (writeRequest->variableType) { case VIX_GUEST_ENVIRONMENT_VARIABLE: @@ -1677,7 +1795,6 @@ Bool impersonatingVMWareUser = FALSE; void *userToken = NULL; VixCommandRenameFileRequest *renameRequest; - Bool pathsAreSameFile; renameRequest = (VixCommandRenameFileRequest *) requestMsg; srcFilePathName = ((char *) renameRequest) + sizeof(*renameRequest); @@ -1687,64 +1804,41 @@ goto abort; } - if (thisProcessRunsAsRoot) { - impersonatingVMWareUser = VixToolsImpersonateUser(requestMsg, &userToken); - if (!impersonatingVMWareUser) { - err = VIX_E_GUEST_USER_PERMISSIONS; - goto abort; - } + err = VixToolsImpersonateUser(requestMsg, &userToken); + if (VIX_OK != err) { + goto abort; } + impersonatingVMWareUser = TRUE; /* * Be careful. Renaming a file to itself can cause it to be deleted. * This should be a no-op anyway. - * - * TEMPORARY FIX (waiting for FileUtf8_IsSameFile). - * - * Ideally, we would use a FileUtf8_IsSameFile, but that doesn't exist (yet). - * However, we need to catch the case of symlinks, or on Windows the case - * of a long file name and a truncated 8.3 form of the same name. - * So, we use both a File_IsSameFile test and a strcmp. - * - * The strcmp will catch any identical paths, even if they are utf-8. - * The File_IsSameFile will consider any non-ASCII files different, but - * it will work with symlinks and long/short file names. - * - * So, if you have 2 different strings that are non-ASCII names for - * the same file, then we won't catch it and can delete the file. - * This is a data loss bug, the most severe kind. We need to fix this - * test soon. */ - pathsAreSameFile = FALSE; -#if defined(_WIN32) - if (0 == Str_Strcasecmp(srcFilePathName, destFilePathName)) { -#else - if (0 == strcmp(srcFilePathName, destFilePathName)) { -#endif - pathsAreSameFile = TRUE; - } - - if (!pathsAreSameFile) { #if !defined(sun) && !defined(__FreeBSD__) - pathsAreSameFile = File_IsSameFile(srcFilePathName, destFilePathName); -#endif - } // if (!pathsAreSameFile) - - if (pathsAreSameFile) { + if (File_IsSameFile(srcFilePathName, destFilePathName)) { err = VIX_OK; goto abort; } +#else + /* + * Do something better for Solaris and FreeBSD once we support them. + */ + if (strcmp(srcFilePathName, destFilePathName) == 0) { + err = VIX_OK; + goto abort; + } +#endif /* - * pre-check the dest arg -- FileUTF8_Rename() will return + * pre-check the dest arg -- File_Rename() will return * diff err codes depending on OS, so catch it up front (bug 133165) */ - if (FileUTF8_IsDirectory(destFilePathName)) { + if (File_IsDirectory(destFilePathName)) { err = VIX_E_ALREADY_EXISTS; goto abort; } - success = FileUTF8_Rename(srcFilePathName, destFilePathName); + success = File_Rename(srcFilePathName, destFilePathName); if (!success) { err = FoundryToolsDaemon_TranslateSystemErr(); goto abort; @@ -1792,13 +1886,11 @@ destPtr = resultBuffer; *destPtr = 0; - if (thisProcessRunsAsRoot) { - impersonatingVMWareUser = VixToolsImpersonateUser(requestMsg, &userToken); - if (!impersonatingVMWareUser) { - err = VIX_E_GUEST_USER_PERMISSIONS; - goto abort; - } + err = VixToolsImpersonateUser(requestMsg, &userToken); + if (VIX_OK != err) { + goto abort; } + impersonatingVMWareUser = TRUE; procList = ProcMgr_ListProcesses(); if (NULL == procList) { @@ -1866,15 +1958,30 @@ void *userToken = NULL; VixCommandKillProcessRequest *killProcessRequest; - if (thisProcessRunsAsRoot) { - impersonatingVMWareUser = VixToolsImpersonateUser(requestMsg, &userToken); - if (!impersonatingVMWareUser) { - err = VIX_E_GUEST_USER_PERMISSIONS; - goto abort; - } + err = VixToolsImpersonateUser(requestMsg, &userToken); + if (VIX_OK != err) { + goto abort; } + impersonatingVMWareUser = TRUE; killProcessRequest = (VixCommandKillProcessRequest *) requestMsg; + + /* + * This is here for two reasons: + * 1) If you kill this process, then it cannot report back to + * you that the command succeeded. + * 2) On Linux, you can either always send a signal to youself, + * or it just compares the source and destination real, effective, + * and saved UIDs. Anyway, no matter who guestd is impersonating, + * this will succeed. However, normally a regular user cannot + * kill guestd, and should not be able to because of an implementation + * detail. + */ + if (VixToolsPidRefersToThisProcess(killProcessRequest->pid)) { + err = VIX_E_GUEST_USER_PERMISSIONS; + goto abort; + } + if (!ProcMgr_KillByPid(killProcessRequest->pid)) { err = FoundryToolsDaemon_TranslateSystemErr(); goto abort; @@ -1921,20 +2028,18 @@ goto abort; } - if (thisProcessRunsAsRoot) { - impersonatingVMWareUser = VixToolsImpersonateUser(requestMsg, &userToken); - if (!impersonatingVMWareUser) { - err = VIX_E_GUEST_USER_PERMISSIONS; - goto abort; - } + err = VixToolsImpersonateUser(requestMsg, &userToken); + if (VIX_OK != err) { + goto abort; } + impersonatingVMWareUser = TRUE; - if (FileUTF8_Exists(dirPathName)) { + if (File_Exists(dirPathName)) { err = VIX_E_FILE_ALREADY_EXISTS; goto abort; } - if (!(FileUTF8_CreateDirectoryHierarchy(dirPathName))) { + if (!(File_CreateDirectoryHierarchy(dirPathName))) { err = FoundryToolsDaemon_TranslateSystemErr(); goto abort; } @@ -1985,7 +2090,6 @@ Bool impersonatingVMWareUser = FALSE; size_t formatStringLength; void *userToken = NULL; - char fullPathFileName[FILE_MAXPATH]; VixMsgListDirectoryRequest *listRequest = NULL; VixMsgSimpleFileRequest *legacyListRequest = NULL; Bool truncated = FALSE; @@ -2014,20 +2118,18 @@ goto abort; } - if (thisProcessRunsAsRoot) { - impersonatingVMWareUser = VixToolsImpersonateUser(requestMsg, &userToken); - if (!impersonatingVMWareUser) { - err = VIX_E_GUEST_USER_PERMISSIONS; - goto abort; - } + err = VixToolsImpersonateUser(requestMsg, &userToken); + if (VIX_OK != err) { + goto abort; } + impersonatingVMWareUser = TRUE; - if (!(FileUTF8_IsDirectory(dirPathName))) { + if (!(File_IsDirectory(dirPathName))) { err = VIX_E_NOT_A_DIRECTORY; goto abort; } - numFiles = FileUTF8_ListDirectory(dirPathName, &fileNameList); + numFiles = File_ListDirectory(dirPathName, &fileNameList); if (numFiles < 0) { err = FoundryToolsDaemon_TranslateSystemErr(); goto abort; @@ -2037,7 +2139,9 @@ * Calculate the size of the result buffer and keep track of the * max number of entries we can store. */ - resultBufferSize = 2; // truncation bool + space + resultBufferSize = 3; // truncation bool + space + '\0' + lastGoodResultBufferSize = resultBufferSize; + ASSERT_NOT_IMPLEMENTED(lastGoodResultBufferSize < maxBufferSize); formatStringLength = strlen(fileInfoFormatString); for (fileNum = offset; fileNum < numFiles; fileNum++) { @@ -2061,7 +2165,6 @@ break; } } - numFiles = lastGoodNumFiles; resultBufferSize = lastGoodResultBufferSize; /* @@ -2086,28 +2189,20 @@ } } - for (fileNum = offset; fileNum < numFiles; fileNum++) { + for (fileNum = offset; fileNum < lastGoodNumFiles; fileNum++) { + /* File_ListDirectory never returns "." or ".." */ + char *pathName; + currentFileName = fileNameList[fileNum]; - /* - * Skip . and .., those aren't very useful and can confuse a - * simple client. - */ - if ('.' == currentFileName[0]) { - if (0 == currentFileName[1]) { - continue; - } - if (('.' == currentFileName[1]) && (0 == currentFileName[2])) { - continue; - } - } + pathName = Str_SafeAsprintf(NULL, "%s%s%s", dirPathName, DIRSEPS, + currentFileName); - Str_Sprintf(fullPathFileName, sizeof(fullPathFileName), "%s"DIRSEPS"%s", - dirPathName, currentFileName); + VixToolsPrintFileInfo(pathName, currentFileName, &destPtr, endDestPtr); - VixToolsPrintFileInfo(fullPathFileName, currentFileName, &destPtr, endDestPtr); - } // for (fileNum = 0; fileNum < numFiles; fileNum++) - *destPtr = 0; + free(pathName); + } // for (fileNum = 0; fileNum < lastGoodNumFiles; fileNum++) + *destPtr = '\0'; abort: if (impersonatingVMWareUser) { @@ -2163,16 +2258,14 @@ err = VIX_E_INVALID_ARG; goto abort; } - - if (thisProcessRunsAsRoot) { - impersonatingVMWareUser = VixToolsImpersonateUser(requestMsg, &userToken); - if (!impersonatingVMWareUser) { - err = VIX_E_GUEST_USER_PERMISSIONS; - goto abort; - } + + err = VixToolsImpersonateUser(requestMsg, &userToken); + if (VIX_OK != err) { + goto abort; } + impersonatingVMWareUser = TRUE; - if (!(FileUTF8_Exists(filePathName))) { + if (!(File_Exists(filePathName))) { err = VIX_E_FILE_NOT_FOUND; goto abort; } @@ -2226,21 +2319,21 @@ *----------------------------------------------------------------------------- */ -void +static void VixToolsPrintFileInfo(char *filePathName, // IN char *fileName, // IN char **destPtr, // IN char *endDestPtr) // OUT { int64 fileSize = 0; - int64 modTime = 0; + int64 modTime; int32 fileProperties = 0; modTime = File_GetModTime(filePathName); - if (FileUTF8_IsDirectory(filePathName)) { + if (File_IsDirectory(filePathName)) { fileProperties |= VIX_FILE_ATTRIBUTES_DIRECTORY; } else { - if (FileUTF8_IsSymLink(filePathName)) { + if (File_IsSymLink(filePathName)) { fileProperties |= VIX_FILE_ATTRIBUTES_SYMLINK; } fileSize = File_GetSize(filePathName); @@ -2279,13 +2372,11 @@ Bool impersonatingVMWareUser = FALSE; void *userToken = NULL; - if (thisProcessRunsAsRoot) { - impersonatingVMWareUser = VixToolsImpersonateUser(requestMsg, &userToken); - if (!impersonatingVMWareUser) { - err = VIX_E_GUEST_USER_PERMISSIONS; - goto abort; - } + err = VixToolsImpersonateUser(requestMsg, &userToken); + if (VIX_OK != err) { + goto abort; } + impersonatingVMWareUser = TRUE; abort: if (impersonatingVMWareUser) { @@ -2315,6 +2406,7 @@ VixError VixToolsRunScript(VixCommandRequestHeader *requestMsg, // IN char *requestName, // IN + void *eventQueue, // IN char **result) // OUT { VixError err = VIX_OK; @@ -2335,27 +2427,27 @@ Bool programIsExecutable; int64 pid = (int64) -1; static char resultBuffer[32]; -#if defined(_WIN32) && !defined(WIN9XCOMPAT) - Bool forcedRoot = FALSE; -#endif VixMsgRunScriptRequest *scriptRequest; const char *interpreterFlags = ""; #if defined(_WIN32) + Bool forcedRoot = FALSE; ProcMgr_ProcArgs procArgs; #endif +#if defined(VMTOOLS_USE_GLIB) + GSource *timer; +#endif scriptRequest = (VixMsgRunScriptRequest *) requestMsg; interpreterName = ((char *) scriptRequest) + sizeof(*scriptRequest); propertiesString = interpreterName + scriptRequest->interpreterNameLength + 1; script = propertiesString + scriptRequest->propertiesLength + 1; - if (thisProcessRunsAsRoot) { - impersonatingVMWareUser = VixToolsImpersonateUser(requestMsg, &userToken); - if (!impersonatingVMWareUser) { - err = VIX_E_GUEST_USER_PERMISSIONS; - goto abort; - } + err = VixToolsImpersonateUser(requestMsg, &userToken); + if (VIX_OK != err) { + goto abort; } + impersonatingVMWareUser = TRUE; + if (0 == *interpreterName) { #ifdef _WIN32 @@ -2367,7 +2459,7 @@ } if (*interpreterName) { - programExists = FileUTF8_Exists(interpreterName); + programExists = File_Exists(interpreterName); /* * TODO: replace FileIO_Access with something more UTF8/forward- @@ -2427,26 +2519,25 @@ goto abort; } - fd = open(tempScriptFilePath, - O_CREAT - | O_EXCL + fd = Posix_Open(tempScriptFilePath, // UTF-8 + O_CREAT | O_EXCL #if defined(_WIN32) - | O_BINARY + | O_BINARY #endif #if defined(linux) && defined(GLIBC_VERSION_21) - | O_LARGEFILE + | O_LARGEFILE #endif - | O_RDWR, - 0600); + | O_RDWR, + 0600); if (fd >= 0) { break; } if (errno != EEXIST) { /* - * While persistence is generally a worthwhile trail, if something happens - * to the temp directory while we're using it (e.g., someone deletes it), we - * should not try 4+ billion times. + * While persistence is generally a worthwhile trail, if something + * happens to the temp directory while we're using it (e.g., someone + * deletes it), we should not try 4+ billion times. */ break; } @@ -2518,13 +2609,10 @@ asyncState->requestName = Util_SafeStrdup(requestName); asyncState->runProgramOptions = scriptRequest->scriptOptions; -#if defined(_WIN32) && !defined(WIN9XCOMPAT) +#if defined(_WIN32) if (PROCESS_CREATOR_USER_TOKEN != userToken) { forcedRoot = Impersonate_ForceRoot(); } -#endif - -#if defined(_WIN32) memset(&procArgs, 0, sizeof procArgs); procArgs.hToken = (PROCESS_CREATOR_USER_TOKEN == userToken) ? NULL : userToken; procArgs.bInheritHandles = TRUE; @@ -2533,7 +2621,7 @@ asyncState->procState = ProcMgr_ExecAsync(fullCommandLine, NULL); #endif -#if defined(_WIN32) && !defined(WIN9XCOMPAT) +#if defined(_WIN32) if (forcedRoot) { Impersonate_UnforceRoot(); } @@ -2546,13 +2634,20 @@ pid = (int64) ProcMgr_GetPid(asyncState->procState); + asyncState->eventQueue = eventQueue; +#if defined(VMTOOLS_USE_GLIB) + timer = g_timeout_source_new(SECONDS_BETWEEN_POLL_TEST_FINISHED * 1000); + g_source_set_callback(timer, VixToolsMonitorAsyncProc, asyncState, NULL); + g_source_attach(timer, g_main_loop_get_context(eventQueue)); + g_source_unref(timer); +#else /* * Start a periodic procedure to check the app periodically. * We always run this (regardless of whether the VIX_RUNPROGRAM_RETURN_IMMEDIATELY * flag is set), since we need to clean up the temp file after the script is * done running. */ - asyncState->timeSyncEvent = EventManager_Add(globalEventQueue, + asyncState->timeSyncEvent = EventManager_Add(eventQueue, SECONDS_BETWEEN_POLL_TEST_FINISHED * 100, VixToolsMonitorAsyncProc, asyncState); @@ -2560,6 +2655,7 @@ err = VIX_E_OUT_OF_MEMORY; goto abort; } +#endif /* * VixToolsMonitorAsyncProc will clean asyncState up when the program finishes. @@ -2593,8 +2689,7 @@ * VixToolsImpersonateUser -- * * Return value: - * TRUE on success - * FALSE on failure + * VixError * * Side effects: * None @@ -2602,13 +2697,14 @@ *----------------------------------------------------------------------------- */ -Bool +VixError VixToolsImpersonateUser(VixCommandRequestHeader *requestMsg, // IN void **userToken) // OUT { - Bool success = FALSE; + VixError err = VIX_OK; char *credentialField; VixCommandNamePassword *namePasswordStruct; + int credentialType; credentialField = ((char *) requestMsg) + requestMsg->commonHeader.headerLength @@ -2616,21 +2712,69 @@ namePasswordStruct = (VixCommandNamePassword *) credentialField; credentialField += sizeof(VixCommandNamePassword); + credentialType = requestMsg->userCredentialType; + + err = VixToolsImpersonateUserImplEx(NULL, + credentialType, + credentialField, + userToken); + if ((VIX_OK != err) + && ((VIX_USER_CREDENTIAL_NAME_PASSWORD_OBFUSCATED == credentialType) + || (VIX_USER_CREDENTIAL_NAME_PASSWORD == credentialType))) { + /* + * Windows does not allow you to login with an empty password. Only + * the console allows this login, which means the console does not + * call the simple public LogonUser api. + * + * See the description for ERROR_ACCOUNT_RESTRICTION. + * For example, the error codes are described here: + * http://support.microsoft.com/kb/155012 + */ +#ifdef _WIN32 + if (namePasswordStruct->passwordLength <= 0) { + err = VIX_E_EMPTY_PASSWORD_NOT_ALLOWED_IN_GUEST; + } +#endif + } - success = VixToolsImpersonateUserImpl(NULL, - requestMsg->userCredentialType, - credentialField, - userToken); + return(err); +} // VixToolsImpersonateUser - return(success); -} - /* *----------------------------------------------------------------------------- * * VixToolsImpersonateUserImpl -- * + * Little compatability wrapper for legacy Foundry Tools implementations. + * + * Return value: + * TRUE on success + * FALSE on failure + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +Bool +VixToolsImpersonateUserImpl(char const *credentialTypeStr, // IN + int credentialType, // IN + char const *obfuscatedNamePassword, // IN + void **userToken) // OUT +{ + return(VIX_OK == VixToolsImpersonateUserImplEx(credentialTypeStr, + credentialType, + obfuscatedNamePassword, + userToken)); +} // VixToolsImpersonateUserImpl + + +/* + *----------------------------------------------------------------------------- + * + * VixToolsImpersonateUserImplEx -- * * On Windows: * To retrieve the security context of another user @@ -2643,8 +2787,7 @@ * Run RegEdt32 to load the registry hive of the impersonated user manually. * * Return value: - * TRUE on success - * FALSE on failure + * VIX_OK on success, or an appropriate error code on failure. * * Side effects: * None @@ -2652,13 +2795,13 @@ *----------------------------------------------------------------------------- */ -Bool -VixToolsImpersonateUserImpl(char const *credentialTypeStr, // IN - int credentialType, // IN - char const *obfuscatedNamePassword, // IN - void **userToken) // OUT +VixError +VixToolsImpersonateUserImplEx(char const *credentialTypeStr, // IN + int credentialType, // IN + char const *obfuscatedNamePassword, // IN + void **userToken) // OUT { - Bool success = FALSE; + VixError err = VIX_E_GUEST_USER_PERMISSIONS; if (NULL != userToken) { *userToken = NULL; @@ -2666,26 +2809,21 @@ /////////////////////////////////////////////////////////////////////// #if defined(__FreeBSD__) || defined(sun) - success = FALSE; -/////////////////////////////////////////////////////////////////////// -#elif defined(WIN9XCOMPAT) - /* - * Win9x doesn't have real user model or an API for impersonation. - * If you can do anything, then you can do everything, so there's - * no reason to pretend otherwise. - */ - success = TRUE; + err = VIX_E_NOT_SUPPORTED; /////////////////////////////////////////////////////////////////////// #elif defined(_WIN32) || defined(linux) { + Bool success = FALSE; AuthToken authToken; - Bool singleStepSuccess; char *unobfuscatedUserName = NULL; char *unobfuscatedPassword = NULL; if (NULL != credentialTypeStr) { if (!StrUtil_StrToInt(&credentialType, credentialTypeStr)) { - success = FALSE; + /* + * This is an internal error, since the VMX supplies this string. + */ + err = VIX_E_FAIL; goto abort; } } @@ -2700,7 +2838,7 @@ if (NULL != userToken) { *userToken = PROCESS_CREATOR_USER_TOKEN; } - success = TRUE; + err = VIX_OK; goto abort; } @@ -2714,31 +2852,76 @@ if (NULL != userToken) { *userToken = PROCESS_CREATOR_USER_TOKEN; } - success = TRUE; + err = VIX_OK; goto abort; } /* + * If the VMX asks us to run commands in the context of the current + * user, make sure that the user who requested the command is the + * same as the current user. + * We don't need to make sure the password is valid (in fact we should + * not receive one) because the VMX should have validated the + * password by other means. Currently it sends it to the Tools daemon. + */ + if (VIX_USER_CREDENTIAL_NAMED_INTERACTIVE_USER == credentialType) { + if (!thisProcessRunsAsRoot) { + success = VixMsg_DeObfuscateNamePassword(obfuscatedNamePassword, + &unobfuscatedUserName, + &unobfuscatedPassword); + if (!success || (NULL == unobfuscatedUserName)) { + err = VIX_E_FAIL; + goto abort; + } + + /* + * Make sure that the user who requested the command is the + * current user. + */ + + err = VixToolsDoesUsernameMatchCurrentUser(unobfuscatedUserName); + if (VIX_OK != err) { + goto abort; + } + + if (NULL != userToken) { + *userToken = PROCESS_CREATOR_USER_TOKEN; + } + + goto abort; + } else { + /* + * This should only be sent to vmware-user, not guestd. + * Something is wrong. + */ + ASSERT(0); + err = VIX_E_FAIL; + goto abort; + } + } + + /* * Other credential types, like guest, are all turned into a name/password * by the VMX. If this is something else, then we are talking to a newer * version of the VMX. */ if ((VIX_USER_CREDENTIAL_NAME_PASSWORD != credentialType) && (VIX_USER_CREDENTIAL_NAME_PASSWORD_OBFUSCATED != credentialType)) { - success = FALSE; + err = VIX_E_NOT_SUPPORTED; goto abort; } - singleStepSuccess = VixMsg_DeObfuscateNamePassword(obfuscatedNamePassword, - &unobfuscatedUserName, - &unobfuscatedPassword); - if (!singleStepSuccess) { - success = FALSE; + success = VixMsg_DeObfuscateNamePassword(obfuscatedNamePassword, + &unobfuscatedUserName, + &unobfuscatedPassword); + if (!success) { + err = VIX_E_FAIL; goto abort; } authToken = Auth_AuthenticateUser(unobfuscatedUserName, unobfuscatedPassword); if (NULL == authToken) { + err = VIX_E_GUEST_USER_PERMISSIONS; goto abort; } if (NULL != userToken) { @@ -2754,6 +2937,12 @@ */ success = ProcMgr_ImpersonateUserStart(unobfuscatedUserName, authToken); #endif + if (!success) { + err = VIX_E_GUEST_USER_PERMISSIONS; + goto abort; + } + + err = VIX_OK; abort: free(unobfuscatedUserName); @@ -2761,11 +2950,11 @@ } #else - success = FALSE; + err = VIX_E_NOT_SUPPORTED; #endif // else linux - return success; -} // VixToolsImpersonateUserImpl + return err; +} // VixToolsImpersonateUserImplEx /* @@ -2786,13 +2975,11 @@ VixToolsUnimpersonateUser(void *userToken) { if (PROCESS_CREATOR_USER_TOKEN != userToken) { -#ifdef _WIN32 +#if defined(_WIN32) Impersonate_Undo(); -#else -#ifdef linux +#elif defined(linux) ProcMgr_ImpersonateUserStop(); #endif -#endif } } // VixToolsUnimpersonateUser @@ -2818,7 +3005,7 @@ return; } -#if !defined(__FreeBSD__) && !defined(sun) && !defined(WIN9XCOMPAT) +#if !defined(__FreeBSD__) && !defined(sun) if (NULL != userToken) { AuthToken authToken = (AuthToken) userToken; Auth_CloseToken(authToken); @@ -2850,7 +3037,7 @@ } if (NULL != asyncState->tempScriptFilePath) { - FileUTF8_UnlinkIfExists(asyncState->tempScriptFilePath); + File_UnlinkIfExists(asyncState->tempScriptFilePath); } if (NULL != asyncState->procState) { ProcMgr_Free(asyncState->procState); @@ -2916,11 +3103,11 @@ /* * Don't give up if VixToolsGetUserTmpDir() failed. It might just * have failed to load DLLs, so we might be running on Win 9x. - * Just fall through to use the old fashioned FileUTF8_MakeTemp(). + * Just fall through to use the old fashioned File_MakeTemp(). */ if (VIX_SUCCEEDED(err)) { - fd = FileUTF8_MakeTempEx(tempDirPath, tag, &tempFilePath); + fd = File_MakeTempEx(tempDirPath, tag, &tempFilePath); if (fd < 0) { err = FoundryToolsDaemon_TranslateSystemErr(); goto abort; @@ -2938,7 +3125,7 @@ * dependencies on code that won't run on win9x. */ if (NULL == tempFilePath) { - fd = FileUTF8_MakeTemp(tag, &tempFilePath); + fd = File_MakeTemp(tag, &tempFilePath); if (fd < 0) { err = FoundryToolsDaemon_TranslateSystemErr(); goto abort; @@ -2992,22 +3179,20 @@ Bool impersonatingVMWareUser = FALSE; char *hgfsPacket; size_t hgfsPacketSize = 0; - static char hgfsReplyPacket[HGFS_PACKET_MAX]; + static char hgfsReplyPacket[HGFS_LARGE_PACKET_MAX]; if ((NULL == requestMsg) || (0 == requestMsg->hgfsPacketSize)) { ASSERT(0); err = VIX_E_FAIL; goto abort; } - - if (thisProcessRunsAsRoot) { - impersonatingVMWareUser = VixToolsImpersonateUser((VixCommandRequestHeader *) requestMsg, - &userToken); - if (!impersonatingVMWareUser) { - err = VIX_E_GUEST_USER_PERMISSIONS; - goto abort; - } + + err = VixToolsImpersonateUser((VixCommandRequestHeader *) requestMsg, + &userToken); + if (VIX_OK != err) { + goto abort; } + impersonatingVMWareUser = TRUE; hgfsPacket = ((char *) requestMsg) + sizeof(*requestMsg); hgfsPacketSize = requestMsg->hgfsPacketSize; @@ -3065,8 +3250,8 @@ VixPropertyListImpl propList; char *serializedBuffer = NULL; size_t serializedBufferLength = 0; - NicEntry *nicEntry = NULL; - VmIpAddressEntry *ipAddr; + GuestNic *nicEntry = NULL; + VmIpAddress *ipAddr; ASSERT(NULL != requestMsg); ASSERT(NULL != resultBuffer); @@ -3074,21 +3259,20 @@ VixPropertyList_Initialize(&propList); - nicEntry = NetUtil_GetPrimaryNicEntry(); + nicEntry = NetUtil_GetPrimaryNic(); if (NULL == nicEntry) { err = FoundryToolsDaemon_TranslateSystemErr(); goto abort; } - ipAddr = DblLnkLst_Container(nicEntry->ipAddressList.next, - VmIpAddressEntry, - links); + ipAddr = &nicEntry->ips.ips_val[0]; + /* * Now, record these values in a property list. */ err = VixPropertyList_SetString(&propList, VIX_PROPERTY_VM_IP_ADDRESS, - ipAddr->ipEntryProto.ipAddress); + ipAddr->ipAddress); if (VIX_OK != err) { goto abort; } @@ -3096,14 +3280,14 @@ #if defined(_WIN32) err = VixPropertyList_SetBool(&propList, VIX_PROPERTY_VM_DHCP_ENABLED, - ipAddr->ipEntryProto.dhcpEnabled); + ipAddr->dhcpEnabled); if (VIX_OK != err) { goto abort; } err = VixPropertyList_SetString(&propList, VIX_PROPERTY_VM_SUBNET_MASK, - ipAddr->ipEntryProto.subnetMask); + ipAddr->subnetMask); if (VIX_OK != err) { goto abort; } @@ -3128,7 +3312,7 @@ abort: VixPropertyList_RemoveAllWithoutHandles(&propList); - GuestInfo_FreeDynamicMemoryInNic(nicEntry); + VMX_XDR_FREE(xdr_GuestNic, nicEntry); free(nicEntry); return err; @@ -3172,14 +3356,12 @@ ipAddr[0] = '\0'; subnetMask[0] = '\0'; - - if (thisProcessRunsAsRoot) { - impersonatingVMWareUser = VixToolsImpersonateUser(requestMsg, &userToken); - if (!impersonatingVMWareUser) { - err = VIX_E_GUEST_USER_PERMISSIONS; - goto abort; - } + + err = VixToolsImpersonateUser(requestMsg, &userToken); + if (VIX_OK != err) { + goto abort; } + impersonatingVMWareUser = TRUE; setGuestNetworkingConfigRequest = (VixMsgSetGuestNetworkingConfigRequest *)requestMsg; messageBody = (char *) requestMsg + sizeof(*setGuestNetworkingConfigRequest); @@ -3244,6 +3426,10 @@ ('\0' != subnetMask[0])) { hrErr = VixToolsEnableStaticOnPrimary(ipAddr, subnetMask); } else { + /* + * Setting static ip, both ip and subnet mask are missing + */ + err = VIX_E_MISSING_REQUIRED_PROPERTY; goto abort; } } @@ -3269,6 +3455,153 @@ #endif +#if defined(_WIN32) || defined(linux) +/* + *----------------------------------------------------------------------------- + * + * VixToolsDoesUsernameMatchCurrentUser -- + * + * Check if the provider username matches the current user. + * + * Return value: + * VIX_OK if it does, otherwise an appropriate error code. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static VixError +VixToolsDoesUsernameMatchCurrentUser(const char *username) // IN +{ + VixError err = VIX_E_FAIL; + +#ifdef _WIN32 + char *currentUser = NULL; + DWORD currentUserSize = 0; + + /* + * For Windows, get the name of the owner of this process, then + * compare it to the provided username. + */ + if (!Win32U_GetUserName(currentUser, ¤tUserSize)) { + if (ERROR_INSUFFICIENT_BUFFER != GetLastError()) { + err = FoundryToolsDaemon_TranslateSystemErr(); + goto abort; + } + + currentUser = Util_SafeMalloc(currentUserSize); + + if (!Win32U_GetUserName(currentUser, ¤tUserSize)) { + err = FoundryToolsDaemon_TranslateSystemErr(); + goto abort; + } + } + + if (0 != Unicode_CompareIgnoreCase(username, currentUser)) { + err = VIX_E_INTERACTIVE_SESSION_USER_MISMATCH; + goto abort; + } + + err = VIX_OK; + +abort: + free(currentUser); + +#else /* Below is the POSIX case. */ + uid_t currentUid; + struct passwd pwd; + struct passwd *ppwd = &pwd; + char *buffer = NULL; // a pool of memory for Posix_Getpwnam_r() to use. + size_t bufferSize; + + /* + * For POSIX systems, look up the uid of 'username', and compare + * it to the uid of the owner of this process. This handles systems + * where multiple usernames map to the name user. + */ + + /* + * Get the maximum size buffer needed by getpwuid_r. + * Multiply by 4 to compensate for the conversion to UTF-8 by + * the Posix_Getpwnam_r() wrapper. + */ + bufferSize = (size_t) sysconf(_SC_GETPW_R_SIZE_MAX) * 4; + + buffer = Util_SafeMalloc(bufferSize); + + if (Posix_Getpwnam_r(username, &pwd, buffer, bufferSize, &ppwd) != 0 || + NULL == ppwd) { + /* + * This username should exist, since it should have already + * been validated by guestd. Assume it is a system error. + */ + err = FoundryToolsDaemon_TranslateSystemErr(); + Warning("Unable to get the uid for username %s.\n", username); + goto abort; + } + + /* + * In the Windows version, GetUserNameW() returns the name of the + * user the thread is impersonating (if it is impersonating someone), + * so geteuid() seems to be the moral equivalent. + */ + currentUid = geteuid(); + + if (currentUid != ppwd->pw_uid) { + err = VIX_E_INTERACTIVE_SESSION_USER_MISMATCH; + goto abort; + } + + err = VIX_OK; + + abort: + Util_ZeroFree(buffer, bufferSize); + +#endif + + return err; +} +#endif // #if defined(_WIN32) || defined(linux) + + +/* + *----------------------------------------------------------------------------- + * + * VixToolsPidRefersToThisProcess -- + * + * Determines if the given pid refers to the current process, in + * that if it passed to the appropriate OS-specific process killing + * function, will this process get killed. + * + * Return value: + * TRUE if killing pid kills us, FALSE otherwise. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +Bool +VixToolsPidRefersToThisProcess(ProcMgr_Pid pid) // IN +{ +#ifdef _WIN32 + return (GetCurrentProcessId() == pid); +#else + /* + * POSIX is complicated. Pid could refer to this process directly, + * be 0 which kills all processes in this process's group, be -1 + * which kill everything to which it can send a signal, or be -1 times + * the process group ID of this process. + */ + return ((getpid() == pid) || (0 == pid) || (-1 == pid) || + ((pid < -1) && (getpgrp() == (pid * -1)))); +#endif +} + + /* *----------------------------------------------------------------------------- * @@ -3285,14 +3618,27 @@ *----------------------------------------------------------------------------- */ +#if defined(VMTOOLS_USE_GLIB) +VixError +VixTools_ProcessVixCommand(VixCommandRequestHeader *requestMsg, // IN + char *requestName, // IN + size_t maxResultBufferSize, // IN + GKeyFile *confDictRef, // IN + GMainLoop *eventQueue, // IN + char **resultBuffer, // OUT + size_t *resultLen, // OUT + Bool *deleteResultBufferResult) // OUT +#else VixError VixTools_ProcessVixCommand(VixCommandRequestHeader *requestMsg, // IN char *requestName, // IN size_t maxResultBufferSize, // IN GuestApp_Dict **confDictRef, // IN + DblLnkLst_Links *eventQueue, // IN char **resultBuffer, // OUT size_t *resultLen, // OUT Bool *deleteResultBufferResult) // OUT +#endif { VixError err = VIX_OK; char *resultValue = NULL; @@ -3401,13 +3747,13 @@ //////////////////////////////////// case VIX_COMMAND_RUN_SCRIPT_IN_GUEST: - err = VixToolsRunScript(requestMsg, requestName, &resultValue); + err = VixToolsRunScript(requestMsg, requestName, eventQueue, &resultValue); // resultValue is static. Do not free it. break; //////////////////////////////////// case VIX_COMMAND_RUN_PROGRAM: - err = VixTools_RunProgram(requestMsg, requestName, &resultValue); + err = VixTools_RunProgram(requestMsg, requestName, eventQueue, &resultValue); // resultValue is static. Do not free it. break; @@ -3419,13 +3765,13 @@ //////////////////////////////////// case VIX_COMMAND_CREATE_TEMPORARY_FILE: err = VixToolsCreateTempFile(requestMsg, &resultValue); - // resultValue is static. Do not free it. + deleteResultValue = TRUE; break; /////////////////////////////////// case VIX_COMMAND_READ_VARIABLE: err = VixToolsReadVariable(requestMsg, &resultValue); - // resultValue is static. Do not free it. + deleteResultValue = TRUE; break; /////////////////////////////////// @@ -3489,40 +3835,6 @@ break; #endif -#if IMPLEMENT_SOCKET_MGR - //////////////////////////////////// - case VIX_COMMAND_GUEST_SOCKET_CONNECT: - err = VixToolsSocketConnect(requestMsg, &resultValue); - // resultValue is static. Do not free it. - break; - - //////////////////////////////////// - case VIX_COMMAND_GUEST_SOCKET_LISTEN: - err = VixToolsSocketListen(requestMsg, &resultValue); - // resultValue is static. Do not free it. - break; - - //////////////////////////////////// - case VIX_COMMAND_GUEST_SOCKET_ACCEPT: - err = VixToolsSocketAccept(requestMsg, Util_SafeStrdup(requestName)); - break; - - //////////////////////////////////// - case VIX_COMMAND_GUEST_SOCKET_RECEIVE: - err = VixToolsSocketRecv(requestMsg, Util_SafeStrdup(requestName)); - break; - - //////////////////////////////////// - case VIX_COMMAND_GUEST_SOCKET_SEND: - err = VixToolsSocketSend(requestMsg, Util_SafeStrdup(requestName)); - break; - - //////////////////////////////////// - case VIX_COMMAND_GUEST_SOCKET_CLOSE: - err = VixToolsSocketClose(requestMsg); - break; -#endif // IMPLEMENT_SOCKET_MGR - //////////////////////////////////// default: break; @@ -3641,17 +3953,16 @@ VixToolsEnableDHCPOnPrimary(void) { HRESULT ret; - NicEntry *primaryNic; + GuestNic *primaryNic; - primaryNic = NetUtil_GetPrimaryNicEntry(); + primaryNic = NetUtil_GetPrimaryNic(); if (NULL == primaryNic) { return HRESULT_FROM_WIN32(GetLastError()); } - ret = WMI_EnableDHCP(primaryNic->nicEntryProto.macAddress); - - GuestInfo_FreeDynamicMemoryInNic(primaryNic); - + ret = WMI_EnableDHCP(primaryNic->macAddress); + VMX_XDR_FREE(xdr_GuestNic, primaryNic); + free(primaryNic); return ret; } @@ -3679,8 +3990,8 @@ const char *subnetMask) // IN { HRESULT ret; - NicEntry *primaryNic; - VmIpAddressEntry *primaryIpEntry; + GuestNic *primaryNic; + VmIpAddress *primaryIp; char actualIpAddress[IP_ADDR_SIZE]; char actualSubnetMask[IP_ADDR_SIZE]; @@ -3692,7 +4003,7 @@ actualIpAddress[0] = '\0'; actualSubnetMask[0] = '\0'; - primaryNic = NetUtil_GetPrimaryNicEntry(); + primaryNic = NetUtil_GetPrimaryNic(); if (NULL == primaryNic) { return HRESULT_FROM_WIN32(GetLastError()); } @@ -3700,9 +4011,8 @@ /* * Set IP address if client provides it. */ - primaryIpEntry = DblLnkLst_Container(primaryNic->ipAddressList.next, - VmIpAddressEntry, - links); + + primaryIp = &primaryNic->ips.ips_val[0]; if ('\0' != ipAddr[0]) { Str_Strcpy(actualIpAddress, @@ -3710,7 +4020,7 @@ sizeof actualIpAddress); } else { Str_Strcpy(actualIpAddress, - primaryIpEntry->ipEntryProto.ipAddress, + primaryIp->ipAddress, sizeof actualIpAddress); } @@ -3723,16 +4033,16 @@ sizeof actualSubnetMask); } else { Str_Strcpy(actualSubnetMask, - primaryIpEntry->ipEntryProto.subnetMask, + primaryIp->subnetMask, sizeof actualSubnetMask); } - ret = WMI_EnableStatic(primaryNic->nicEntryProto.macAddress, + ret = WMI_EnableStatic(primaryNic->macAddress, actualIpAddress, actualSubnetMask); - - GuestInfo_FreeDynamicMemoryInNic(primaryNic); + VMX_XDR_FREE(xdr_GuestNic, primaryNic); + free(primaryNic); return ret; } #endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/vmBackupLib/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/vmBackupLib/Makefile.am --- open-vm-tools-2008.01.23-74039/lib/vmBackupLib/Makefile.am 2008-01-28 08:02:49.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/vmBackupLib/Makefile.am 2008-10-13 08:01:48.000000000 +0100 @@ -21,6 +21,3 @@ libVmBackupLib_a_SOURCES += scriptOps.c libVmBackupLib_a_SOURCES += stateMachine.c libVmBackupLib_a_SOURCES += syncDriverOps.c - -AM_CFLAGS = -AM_CFLAGS += @COMMON_CFLAGS@ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/vmBackupLib/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/vmBackupLib/Makefile.in --- open-vm-tools-2008.01.23-74039/lib/vmBackupLib/Makefile.in 2008-01-28 08:03:06.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/vmBackupLib/Makefile.in 2008-10-13 08:02:16.000000000 +0100 @@ -52,7 +52,10 @@ subdir = lib/vmBackupLib DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +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)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -65,7 +68,7 @@ stateMachine.$(OBJEXT) syncDriverOps.$(OBJEXT) libVmBackupLib_a_OBJECTS = $(am_libVmBackupLib_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp +depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -91,8 +94,6 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -COMMON_CFLAGS = @COMMON_CFLAGS@ -COMMON_PROG_CFLAGS = @COMMON_PROG_CFLAGS@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -103,45 +104,57 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ -ECHO = @ECHO@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GREP = @GREP@ -GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_AUTH_CFLAGS = @LIB_AUTH_CFLAGS@ -LIB_FILE_CFLAGS = @LIB_FILE_CFLAGS@ -LIB_HGFS_SERVER_CFLAGS = @LIB_HGFS_SERVER_CFLAGS@ -LIB_IMPERSONATE_CFLAGS = @LIB_IMPERSONATE_CFLAGS@ -LIB_MISC_CFLAGS = @LIB_MISC_CFLAGS@ -LIB_PROC_MGR_CFLAGS = @LIB_PROC_MGR_CFLAGS@ -LIB_STRING_CFLAGS = @LIB_STRING_CFLAGS@ -LIB_USER_CFLAGS = @LIB_USER_CFLAGS@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -149,27 +162,35 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ VERSION = @VERSION@ -VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -200,6 +221,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -216,7 +238,6 @@ top_srcdir = @top_srcdir@ noinst_LIBRARIES = libVmBackupLib.a libVmBackupLib_a_SOURCES = scriptOps.c stateMachine.c syncDriverOps.c -AM_CFLAGS = @COMMON_CFLAGS@ all: all-am .SUFFIXES: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/vmBackupLib/scriptOps.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/vmBackupLib/scriptOps.c --- open-vm-tools-2008.01.23-74039/lib/vmBackupLib/scriptOps.c 2008-01-28 08:02:50.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/vmBackupLib/scriptOps.c 2008-10-13 08:01:51.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -23,24 +23,21 @@ */ #include "vmBackup.h" +#include "vmBackupInt.h" #include <stdlib.h> #include <string.h> #include "vm_basic_defs.h" #include "debug.h" -#include "dynbuf.h" #include "file.h" #include "guestApp.h" #include "procMgr.h" -#include "syncDriver.h" #include "str.h" #include "util.h" +#include "codeset.h" -/* Totally arbitrary limit. */ -#define MAX_SCRIPTS 256 - typedef struct VmBackupScript { char *path; ProcMgr_AsyncProc *proc; @@ -49,9 +46,10 @@ typedef struct VmBackupScriptOp { VmBackupOp callbacks; - VmBackupScript scripts[MAX_SCRIPTS]; - unsigned int current; Bool canceled; + Bool thawFailed; + VmBackupScriptType type; + VmBackupState *state; } VmBackupScriptOp; @@ -66,25 +64,107 @@ * A string with the requested path. * * Side effects: - * None. + * Allocates memory for the path. * *----------------------------------------------------------------------------- */ -static const char * +char * VmBackupGetScriptPath(void) { - static char scriptPath[FILE_MAXPATH] = { '\0' }; + char *scriptPath = NULL; + char *installPath = GuestApp_GetInstallPath(); - if (*scriptPath == '\0') { - const char *installPath; - installPath = GuestApp_GetInstallPath(); - Str_Strcat(scriptPath, installPath, sizeof scriptPath); - Str_Strcat(scriptPath, DIRSEPS, sizeof scriptPath); - Str_Strcat(scriptPath, "backupScripts.d", sizeof scriptPath); + if (installPath == NULL) { + return NULL; } - return (*scriptPath != '\0') ? scriptPath : NULL; + scriptPath = Str_Asprintf(NULL, "%s%s%s", installPath, DIRSEPS, "backupScripts.d"); + free(installPath); + + return scriptPath; +} + + +/* + *----------------------------------------------------------------------------- + * + * VmBackupRunNextScript -- + * + * Runs the next script for the given operation. If thawing (or running + * scripts after a failure), this function will try as much as possible + * to start a script, meaning that if it fails to start a script it will + * try to start the preceding one until one script is run, or it runs out + * of scripts to try. + * + * Results: + * -1: an error occurred. + * 0: no more scripts to run. + * 1: script was started. + * + * Side effects: + * Increments (or decrements) the "current script" index in the backup state. + * + *----------------------------------------------------------------------------- + */ + +static int +VmBackupRunNextScript(VmBackupScriptOp *op) // IN/OUT +{ + const char *scriptOp; + int ret = 0; + ssize_t index; + VmBackupScript *scripts = op->state->scripts; + + switch (op->type) { + case VMBACKUP_SCRIPT_FREEZE: + index = ++op->state->currentScript; + scriptOp = "freeze"; + break; + + case VMBACKUP_SCRIPT_FREEZE_FAIL: + index = --op->state->currentScript; + scriptOp = "freezeFail"; + break; + + case VMBACKUP_SCRIPT_THAW: + index = --op->state->currentScript; + scriptOp = "thaw"; + break; + + default: + NOT_REACHED(); + } + + while (index >= 0 && scripts[index].path != NULL) { + char *cmd; + + cmd = Str_Asprintf(NULL, "\"%s\" %s", scripts[index].path, scriptOp); + if (cmd == NULL) { + index = --op->state->currentScript; + op->thawFailed = TRUE; + } + + if ((scripts[index].proc = ProcMgr_ExecAsync(cmd, NULL)) == NULL) { + if (op->type == VMBACKUP_SCRIPT_FREEZE) { + ret = -1; + break; + } else { + index = --op->state->currentScript; + op->thawFailed = TRUE; + } + } else { + ret = 1; + break; + } + + /* This happens if all thaw/fail scripts failed to start. */ + if (index == -1 && scripts[0].proc == NULL) { + ret = -1; + } + } + + return ret; } @@ -93,10 +173,10 @@ * * VmBackupStringCompare -- * - * Comparison function used to sort the script list. + * Comparison function used to sort the script list in ascending order. * * Result - * The result of strcmp() on the strings. + * The result of strcmp(str1, str2). * * Side effects: * None. @@ -135,47 +215,64 @@ { VmBackupOpStatus ret = VMBACKUP_STATUS_PENDING; VmBackupScriptOp *op = (VmBackupScriptOp *) _op; - VmBackupScript *currScript = &(op->scripts[op->current]); + VmBackupScript *scripts = op->state->scripts; + VmBackupScript *currScript = NULL; + + if (scripts != NULL && op->state->currentScript >= 0) { + currScript = &scripts[op->state->currentScript]; + } if (op->canceled) { ret = VMBACKUP_STATUS_CANCELED; goto exit; - } else if (currScript->proc == NULL) { + } else if (scripts == NULL || currScript == NULL || currScript->proc == NULL) { ret = VMBACKUP_STATUS_FINISHED; goto exit; } if (!ProcMgr_IsAsyncProcRunning(currScript->proc)) { int exitCode; + Bool succeeded; - if (ProcMgr_GetExitCode(currScript->proc, &exitCode) != 0 || - exitCode != 0) { - // XXX: log error. - ret = VMBACKUP_STATUS_ERROR; - goto exit; - } - + succeeded = (ProcMgr_GetExitCode(currScript->proc, &exitCode) == 0 && + exitCode == 0); ProcMgr_Free(currScript->proc); currScript->proc = NULL; /* - * If there's another script to execute, start it. Otherwise, just - * say we're finished. + * If thaw scripts fail, keep running and only notify the failure after + * all others have run. */ - if (op->current < MAX_SCRIPTS - 1 && op->scripts[op->current+1].path != NULL) { - op->current += 1; - currScript = &(op->scripts[op->current]); - currScript->proc = ProcMgr_ExecAsync(currScript->path, NULL); - if (currScript->proc == NULL) { - // XXX : log error - ret = VMBACKUP_STATUS_ERROR; - } - } else { - ret = VMBACKUP_STATUS_FINISHED; + if (!succeeded) { + if (op->type == VMBACKUP_SCRIPT_FREEZE) { + ret = VMBACKUP_STATUS_ERROR; + goto exit; + } else if (op->type == VMBACKUP_SCRIPT_THAW) { + op->thawFailed = TRUE; + } + } + + switch (VmBackupRunNextScript(op)) { + case -1: + ret = VMBACKUP_STATUS_ERROR; + break; + + case 0: + ret = op->thawFailed ? VMBACKUP_STATUS_ERROR : VMBACKUP_STATUS_FINISHED; + break; + + default: + break; } } exit: + if (ret == VMBACKUP_STATUS_ERROR) { + /* Report the script error to the host */ + op->state->SendEvent(VMBACKUP_EVENT_REQUESTOR_ERROR, + VMBACKUP_SCRIPT_ERROR, + "Custom script failed."); + } return ret; } @@ -201,14 +298,20 @@ static void VmBackupScriptOpRelease(VmBackupOp *_op) // IN { - int i; + size_t i; VmBackupScriptOp *op = (VmBackupScriptOp *) _op; - for (i = 0; i < MAX_SCRIPTS && op->scripts[i].path != NULL; i++) { - free(op->scripts[i].path); - if (op->scripts[i].proc != NULL) { - ProcMgr_Free(op->scripts[i].proc); + if (op->type != VMBACKUP_SCRIPT_FREEZE && op->state->scripts != NULL) { + VmBackupScript *scripts = op->state->scripts; + for (i = 0; scripts[i].path != NULL; i++) { + free(scripts[i].path); + if (scripts[i].proc != NULL) { + ProcMgr_Free(scripts[i].proc); + } } + free(op->state->scripts); + op->state->scripts = NULL; + op->state->currentScript = 0; } free(op); @@ -236,17 +339,21 @@ VmBackupScriptOpCancel(VmBackupOp *_op) // IN { VmBackupScriptOp *op = (VmBackupScriptOp *) _op; - VmBackupScript *currScript = &(op->scripts[op->current]); + VmBackupScript *scripts = op->state->scripts; + VmBackupScript *currScript = NULL; ProcMgr_Pid pid; - ASSERT(currScript->proc != NULL); - - pid = ProcMgr_GetPid(currScript->proc); - if (!ProcMgr_KillByPid(pid)) { - // XXX: what to do in this situation? other than log and cry? - } else { - int exitCode; - ProcMgr_GetExitCode(currScript->proc, &exitCode); + if (scripts != NULL) { + currScript = &scripts[op->state->currentScript]; + ASSERT(currScript->proc != NULL); + + pid = ProcMgr_GetPid(currScript->proc); + if (!ProcMgr_KillByPid(pid)) { + // XXX: what to do in this situation? other than log and cry? + } else { + int exitCode; + ProcMgr_GetExitCode(currScript->proc, &exitCode); + } } op->canceled = TRUE; @@ -259,9 +366,14 @@ * VmBackupNewScriptOp -- * * Creates a new state object to monitor the execution of OnFreeze or - * OnThaw scripts. This will identify all the scripts in the given + * OnThaw scripts. This will identify all the scripts in the backup scripts * directory and add them to an execution queue. * + * Note: there is some state created when instantianting the "OnFreeze" + * scripts which is only released after the "OnThaw" scripts are run. So + * the caller has to make sure that thaw (or fail) scripts are run every + * time the freeze scripts are run. + * * Result * A pointer to the operation state, or NULL on failure. * @@ -271,123 +383,106 @@ *----------------------------------------------------------------------------- */ -static VmBackupOp * -VmBackupNewScriptOp(const char *scriptDir, Bool freeze) // IN +VmBackupOp * +VmBackupNewScriptOp(VmBackupScriptType type, // IN + VmBackupState *state) // IN { + Bool fail = FALSE; + char **fileList = NULL; + char *scriptDir = NULL; + int numFiles = 0; + size_t i; VmBackupScriptOp *op = NULL; - op = Util_SafeMalloc(sizeof *op); - memset(op, 0, sizeof *op); + scriptDir = VmBackupGetScriptPath(); + if (scriptDir == NULL) { + goto exit; + } + + op = calloc(1, sizeof *op); + if (op == NULL) { + goto exit; + } + op->state = state; + op->type = type; op->callbacks.queryFn = VmBackupScriptOpQuery; op->callbacks.cancelFn = VmBackupScriptOpCancel; op->callbacks.releaseFn = VmBackupScriptOpRelease; Debug("Trying to run scripts from %s\n", scriptDir); - if (File_IsDirectory(scriptDir)) { - int i, cnt, numFiles; - char **fileList = NULL; + /* + * Load the list of scripts to run when freezing. The same list will be + * used later in case of failure, or when thawing, in reverse order. + * + * This logic won't recurse into directories, so only files directly under + * the script dir will be considered. + */ + if (type == VMBACKUP_SCRIPT_FREEZE && File_IsDirectory(scriptDir)) { + size_t scriptCount = 0; + state->scripts = NULL; + state->currentScript = 0; numFiles = File_ListDirectory(scriptDir, &fileList); - if (numFiles > 1) { - qsort(fileList, (size_t) numFiles, sizeof *fileList, VmBackupStringCompare); - } + if (numFiles > 0) { + VmBackupScript *scripts; - cnt = 0; - for (i = 0; i < numFiles && cnt < MAX_SCRIPTS; i++) { - /* Just run files in the scripts dir. Don't recurse into directories. */ - char script[FILE_MAXPATH + sizeof " freeze"]; - Str_Sprintf(script, sizeof script, "%s%c%s", - scriptDir, DIRSEPC, fileList[i]); - if (File_IsFile(script)) { - char *escaped; - - Debug("adding script for execution: %s\n", fileList[i]); - - escaped = Str_Asprintf(NULL, "\"%s\" %s", - script, (freeze) ? " freeze" : " thaw"); - ASSERT_MEM_ALLOC(escaped); - op->scripts[cnt++].path = escaped; - } else { - Debug("ignoring non-file entry: %s\n", fileList[i]); + scripts = calloc(1, (numFiles + 1) * sizeof *scripts); + if (scripts == NULL) { + fail = TRUE; + goto exit; } - free(fileList[i]); - } - free(fileList); - if (cnt >= MAX_SCRIPTS) { - Debug("Too many scripts to run, ignoring past %d.\n", MAX_SCRIPTS); - } + state->scripts = scripts; + /* + * VmBackupRunNextScript increments the index, so need to make it point + * to "before the first script". + */ + state->currentScript = -1; - /* Start the first script if there are scripts to be executed. */ - if (cnt > 0) { - op->scripts[0].proc = ProcMgr_ExecAsync(op->scripts[0].path, NULL); - if (op->scripts[0].proc == NULL) { - // XXX : log error - VmBackup_Release((VmBackupOp *) op); - op = NULL; + if (numFiles > 1) { + qsort(fileList, (size_t) numFiles, sizeof *fileList, VmBackupStringCompare); } - } - } else { - Debug("Cannot find script directory.\n"); - } - - return (VmBackupOp *) op; -} - - -/* - *----------------------------------------------------------------------------- - * - * VmBackupOnFreezeScripts -- - * - * Run the "on freeze" scripts available in the configuration directory. - * - * Result - * An object that can be used to track the progress of the operation, - * or NULL if an error happened. - * - * Side effects: - * None. - * - *----------------------------------------------------------------------------- - */ -VmBackupOp * -VmBackupOnFreezeScripts(void) -{ - const char *scriptDir; + for (i = 0; i < numFiles; i++) { + char *script; - scriptDir = VmBackupGetScriptPath(); - return (scriptDir != NULL) ? VmBackupNewScriptOp(scriptDir, TRUE) : NULL; -} + script = Str_Asprintf(NULL, "%s%c%s", scriptDir, DIRSEPC, fileList[i]); + if (script == NULL) { + fail = TRUE; + goto exit; + } else if (File_IsFile(script)) { + scripts[scriptCount++].path = script; + } else { + free(script); + } + } + } + } + /* + * If there are any scripts to be executed, start the first one. If we get to + * this point, we won't free the scripts array until VmBackupScriptOpRelease + * is called after thawing (or after the sync provider failed and the "fail" + * scripts are run). + */ + fail = (state->scripts != NULL && VmBackupRunNextScript(op) == -1); -/* - *----------------------------------------------------------------------------- - * - * VmBackupOnThawScripts -- - * - * Run the "on thaw" scripts available in the configuration directory. - * - * Result - * An object that can be used to track the progress of the operation. - * - * Side effects: - * None. - * - *----------------------------------------------------------------------------- - */ - -VmBackupOp * -VmBackupOnThawScripts(void) -{ - const char *scriptDir; +exit: + /* Free the file list. */ + for (i = 0; i < numFiles; i++) { + free(fileList[i]); + } + free(fileList); - scriptDir = VmBackupGetScriptPath(); - return (scriptDir != NULL) ? VmBackupNewScriptOp(scriptDir, FALSE) : NULL; + if (fail && op != NULL) { + VmBackup_Release((VmBackupOp *) op); + op = NULL; + } + free(scriptDir); + return (VmBackupOp *) op; } diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/vmBackupLib/stateMachine.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/vmBackupLib/stateMachine.c --- open-vm-tools-2008.01.23-74039/lib/vmBackupLib/stateMachine.c 2008-01-28 08:02:50.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/vmBackupLib/stateMachine.c 2008-10-13 08:01:51.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -36,8 +36,10 @@ */ #include "vmBackup.h" +#include "vmBackupInt.h" #include "vmbackup_def.h" +#include <errno.h> #include <string.h> #include "vm_basic_defs.h" @@ -45,21 +47,16 @@ #include "debug.h" #include "eventManager.h" -#include "rpcin.h" +#include "posix.h" +#include "file.h" +#include "fileIO.h" +#include "guestApp.h" #include "rpcout.h" #include "str.h" #include "strutil.h" #include "util.h" - -typedef enum { - VMBACKUP_SUCCESS = 0, - VMBACKUP_INVALID_STATE, - VMBACKUP_SCRIPT_ERROR, - VMBACKUP_SYNC_ERROR, - VMBACKUP_REMOTE_ABORT, - VMBACKUP_UNEXPECTED_ERROR -} VmBackupStatus; - +#include "vmstdio.h" +#include "conf.h" #define VMBACKUP_ENQUEUE_EVENT() { \ gBackupState->timerEvent = EventManager_Add(gEventQueue, \ @@ -69,13 +66,12 @@ ASSERT_MEM_ALLOC(gBackupState->timerEvent); \ } -extern VmBackupOp *VmBackupOnFreezeScripts(void); -extern VmBackupOp *VmBackupOnThawScripts(void); - static DblLnkLst_Links *gEventQueue = NULL; static VmBackupState *gBackupState = NULL; static VmBackupSyncProvider *gSyncProvider = NULL; +static Bool gLoggingEnabled = FALSE; +static void DebugOutput(const char *fmt, ...); /* *----------------------------------------------------------------------------- @@ -96,6 +92,7 @@ static Bool VmBackupKeepAliveCallback(void *clientData) // IN { + DebugOutput("*** %s\n", __FUNCTION__); ASSERT(gBackupState != NULL); gBackupState->keepAlive = NULL; gBackupState->SendEvent(VMBACKUP_EVENT_KEEP_ALIVE, 0, ""); @@ -128,6 +125,7 @@ Bool success; ASSERT(gBackupState != NULL); + DebugOutput("*** %s\n", __FUNCTION__); if (gBackupState->keepAlive != NULL) { EventManager_Remove(gBackupState->keepAlive); } @@ -137,7 +135,7 @@ event, code, desc); if (!success) { - Debug("VmBackup: failed to send event to the VMX.\n"); + DebugOutput("VmBackup: failed to send event to the VMX.\n"); } gBackupState->keepAlive = EventManager_Add(gEventQueue, @@ -170,7 +168,7 @@ VmBackupFinalize(void) { ASSERT(gBackupState != NULL); - Debug("*** %s\n", __FUNCTION__); + DebugOutput("*** %s\n", __FUNCTION__); if (gBackupState->currentOp != NULL) { VmBackup_Cancel(gBackupState->currentOp); @@ -196,9 +194,9 @@ /* *----------------------------------------------------------------------------- * - * VmBackupThaw -- + * VmBackupStartScripts -- * - * Starts the execution of the "on thaw" scripts. + * Starts the execution of the scripts for the given action type. * * Result * TRUE, unless starting the scripts fails for some reason. @@ -210,16 +208,36 @@ */ static Bool -VmBackupThaw(void) +VmBackupStartScripts(VmBackupScriptType type, // IN + VmBackupCallback callback) // IN { - Debug("*** %s\n", __FUNCTION__); + const char *opName; + DebugOutput("*** %s\n", __FUNCTION__); + + switch (type) { + case VMBACKUP_SCRIPT_FREEZE: + opName = "VmBackupOnFreeze"; + break; + + case VMBACKUP_SCRIPT_FREEZE_FAIL: + opName = "VmBackupOnFreezeFail"; + break; + + case VMBACKUP_SCRIPT_THAW: + opName = "VmBackupOnThaw"; + break; + + default: + NOT_REACHED(); + } + if (!VmBackup_SetCurrentOp(gBackupState, - VmBackupOnThawScripts(), - NULL, - __FUNCTION__)) { + VmBackupNewScriptOp(type, gBackupState), + callback, + opName)) { gBackupState->SendEvent(VMBACKUP_EVENT_REQUESTOR_ERROR, VMBACKUP_SCRIPT_ERROR, - "Error when starting OnThaw scripts."); + "Error when starting backup scripts."); return FALSE; } @@ -250,15 +268,16 @@ { Bool finalize = FALSE; + DebugOutput("*** %s\n", __FUNCTION__); ASSERT(gBackupState != NULL); - Debug("*** %s\n", __FUNCTION__); gBackupState->timerEvent = NULL; if (gBackupState->currentOp != NULL) { VmBackupOpStatus status; - Debug("VmBackupAsyncCallback: checking %s\n", gBackupState->currentOpName); + DebugOutput("VmBackupAsyncCallback: checking %s\n", + gBackupState->currentOpName); status = VmBackup_QueryStatus(gBackupState->currentOp); switch (status) { @@ -266,25 +285,41 @@ goto exit; case VMBACKUP_STATUS_FINISHED: - Debug("Async request completed\n"); + DebugOutput("Async request completed\n"); VmBackup_Release(gBackupState->currentOp); gBackupState->currentOp = NULL; break; default: { + Bool freeMsg = TRUE; char *errMsg = Str_Asprintf(NULL, "Asynchronous operation failed: %s\n", gBackupState->currentOpName); - ASSERT_MEM_ALLOC(errMsg); + if (errMsg == NULL) { + freeMsg = FALSE; + errMsg = "Asynchronous operation failed."; + } gBackupState->SendEvent(VMBACKUP_EVENT_REQUESTOR_ERROR, VMBACKUP_UNEXPECTED_ERROR, errMsg); - free(errMsg); + if (freeMsg) { + free(errMsg); + } VmBackup_Release(gBackupState->currentOp); gBackupState->currentOp = NULL; - finalize = TRUE; + gBackupState->syncProviderFailed = gBackupState->syncProviderRunning; + + /* + * If we get an error when running the freeze scripts, we want to + * schedule the "fail" scripts to run. + */ + if (!gBackupState->syncProviderRunning && + gBackupState->scripts != NULL) { + gBackupState->callback = NULL; + finalize = !VmBackupStartScripts(VMBACKUP_SCRIPT_FREEZE_FAIL, NULL); + } goto exit; } } @@ -329,9 +364,11 @@ gBackupState->callback == NULL) { gBackupState->syncProviderRunning = FALSE; gBackupState->pollPeriod = 100; - finalize = (gBackupState->syncProviderFailed || - gBackupState->clientAborted || - !VmBackupThaw()); + if (gBackupState->syncProviderFailed || gBackupState->clientAborted) { + finalize = !VmBackupStartScripts(VMBACKUP_SCRIPT_FREEZE_FAIL, NULL); + } else { + finalize = !VmBackupStartScripts(VMBACKUP_SCRIPT_THAW, NULL); + } goto exit; } @@ -373,8 +410,8 @@ static Bool VmBackupEnableSync(VmBackupState *state) { + DebugOutput("*** %s\n", __FUNCTION__); ASSERT(state != NULL); - Debug("*** %s\n", __FUNCTION__); if (!gSyncProvider->start(state, gSyncProvider->clientData)) { state->SendEvent(VMBACKUP_EVENT_REQUESTOR_ERROR, VMBACKUP_SYNC_ERROR, @@ -416,11 +453,12 @@ size_t argsSize, // IN void *clientData) // IN { - Debug("*** %s\n", __FUNCTION__); + DebugOutput("*** %s\n", __FUNCTION__); if (gBackupState != NULL) { - gBackupState->SendEvent(VMBACKUP_EVENT_REQUESTOR_ERROR, - VMBACKUP_INVALID_STATE, - "Another backup operation is in progress."); + return RpcIn_SetRetVals(result, + resultLen, + "Backup operation already in progress.", + FALSE); } gBackupState = Util_SafeMalloc(sizeof *gBackupState); @@ -428,6 +466,7 @@ gBackupState->SendEvent = VmBackupSendEvent; gBackupState->pollPeriod = 100; + gBackupState->loggingEnabled = gLoggingEnabled; if (argsSize > 0) { int generateManifests = 0; @@ -442,18 +481,25 @@ } } - gBackupState->SendEvent(VMBACKUP_EVENT_RESET, VMBACKUP_SUCCESS, ""); + gBackupState->configDir = GuestApp_GetConfPath(); + if (gBackupState->configDir == NULL) { + free(gBackupState); + gBackupState = NULL; + return RpcIn_SetRetVals(result, + resultLen, + "Error getting configuration directory.", + FALSE); + } - if (!VmBackup_SetCurrentOp(gBackupState, - VmBackupOnFreezeScripts(), - VmBackupEnableSync, - "VmBackupOnFreeze")) { + gBackupState->SendEvent(VMBACKUP_EVENT_RESET, VMBACKUP_SUCCESS, ""); - gBackupState->SendEvent(VMBACKUP_EVENT_REQUESTOR_ERROR, - VMBACKUP_SCRIPT_ERROR, - "Error starting OnFreeze scripts."); - VmBackupFinalize(); - return FALSE; + if (!VmBackupStartScripts(VMBACKUP_SCRIPT_FREEZE, VmBackupEnableSync)) { + free(gBackupState); + gBackupState = NULL; + return RpcIn_SetRetVals(result, + resultLen, + "Error initializing backup.", + FALSE); } VMBACKUP_ENQUEUE_EVENT(); @@ -487,8 +533,8 @@ size_t argsSize, // IN void *clientData) // IN { + DebugOutput("*** %s\n", __FUNCTION__); if (gBackupState != NULL) { - Debug("*** %s\n", __FUNCTION__); if (gBackupState->currentOp != NULL) { VmBackup_Cancel(gBackupState->currentOp); @@ -537,8 +583,8 @@ size_t argsSize, // IN void *clientData) // IN { + DebugOutput("*** %s\n", __FUNCTION__); if (gBackupState != NULL) { - Debug("*** %s\n", __FUNCTION__); if (!gSyncProvider->snapshotDone(gBackupState, gSyncProvider->clientData)) { gBackupState->syncProviderFailed = TRUE; gBackupState->SendEvent(VMBACKUP_EVENT_REQUESTOR_ERROR, @@ -574,8 +620,10 @@ Bool VmBackup_Init(RpcIn *rpcin, // IN DblLnkLst_Links *eventQueue, // IN - VmBackupSyncProvider *provider) // IN + VmBackupSyncProvider *provider, // IN + Bool loggingEnabled) // IN { + DebugOutput("*** %s\n", __FUNCTION__); ASSERT(gEventQueue == NULL); ASSERT(eventQueue != NULL); ASSERT(provider != NULL); @@ -584,6 +632,7 @@ ASSERT(provider->snapshotDone != NULL); ASSERT(provider->release != NULL); + gLoggingEnabled = loggingEnabled; RpcIn_RegisterCallback(rpcin, VMBACKUP_PROTOCOL_START, VmBackupStart, @@ -621,6 +670,7 @@ void VmBackup_Shutdown(RpcIn *rpcin) { + DebugOutput("*** %s\n", __FUNCTION__); if (gBackupState != NULL) { VmBackupFinalize(); } @@ -634,3 +684,41 @@ gEventQueue = NULL; } + +/* + *----------------------------------------------------------------------------- + * + * DebugOutput -- + * + * Prints the given message using OutputDebugString in debug builds. + * + * Result + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static void +DebugOutput(const char *fmt, ...) +{ + if (gLoggingEnabled) { + char *str; + va_list args; + + va_start(args, fmt); + str = Str_Vasprintf(NULL, fmt, args); + va_end(args); + if (str != NULL) { +#if defined _WIN32 + OutputDebugString(str); +#else + fprintf(stderr, "%s", str); +#endif + free(str); + } + } +} + diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/vmBackupLib/syncDriverOps.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/vmBackupLib/syncDriverOps.c --- open-vm-tools-2008.01.23-74039/lib/vmBackupLib/syncDriverOps.c 2008-01-28 08:02:50.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/vmBackupLib/syncDriverOps.c 2008-10-13 08:01:51.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/vmBackupLib/vmBackupInt.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/vmBackupLib/vmBackupInt.h --- open-vm-tools-2008.01.23-74039/lib/vmBackupLib/vmBackupInt.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/vmBackupLib/vmBackupInt.h 2008-10-13 08:01:51.000000000 +0100 @@ -0,0 +1,40 @@ +/********************************************************* + * Copyright (C) 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. + * + *********************************************************/ + +/* + * vmBackupInt.h -- + * + * Internal definitions used by the vmbackup code. + */ + +#ifndef _VMBACKUPINT_H_ +#define _VMBACKUPINT_H_ + +typedef enum { + VMBACKUP_SCRIPT_FREEZE, + VMBACKUP_SCRIPT_FREEZE_FAIL, + VMBACKUP_SCRIPT_THAW +} VmBackupScriptType; + + +VmBackupOp * +VmBackupNewScriptOp(VmBackupScriptType freeze, + VmBackupState *state); + +#endif /* _VMBACKUPINT_H_*/ + diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/vmCheck/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/vmCheck/Makefile.am --- open-vm-tools-2008.01.23-74039/lib/vmCheck/Makefile.am 2008-01-28 08:02:49.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/vmCheck/Makefile.am 2008-10-13 08:01:48.000000000 +0100 @@ -19,6 +19,3 @@ libVmCheck_a_SOURCES = libVmCheck_a_SOURCES += vmcheck.c - -AM_CFLAGS = -AM_CFLAGS += @COMMON_CFLAGS@ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/vmCheck/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/vmCheck/Makefile.in --- open-vm-tools-2008.01.23-74039/lib/vmCheck/Makefile.in 2008-01-28 08:03:06.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/vmCheck/Makefile.in 2008-10-13 08:02:16.000000000 +0100 @@ -52,7 +52,10 @@ subdir = lib/vmCheck DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +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)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -64,7 +67,7 @@ am_libVmCheck_a_OBJECTS = vmcheck.$(OBJEXT) libVmCheck_a_OBJECTS = $(am_libVmCheck_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp +depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -90,8 +93,6 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -COMMON_CFLAGS = @COMMON_CFLAGS@ -COMMON_PROG_CFLAGS = @COMMON_PROG_CFLAGS@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -102,45 +103,57 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ -ECHO = @ECHO@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GREP = @GREP@ -GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_AUTH_CFLAGS = @LIB_AUTH_CFLAGS@ -LIB_FILE_CFLAGS = @LIB_FILE_CFLAGS@ -LIB_HGFS_SERVER_CFLAGS = @LIB_HGFS_SERVER_CFLAGS@ -LIB_IMPERSONATE_CFLAGS = @LIB_IMPERSONATE_CFLAGS@ -LIB_MISC_CFLAGS = @LIB_MISC_CFLAGS@ -LIB_PROC_MGR_CFLAGS = @LIB_PROC_MGR_CFLAGS@ -LIB_STRING_CFLAGS = @LIB_STRING_CFLAGS@ -LIB_USER_CFLAGS = @LIB_USER_CFLAGS@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -148,27 +161,35 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ VERSION = @VERSION@ -VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -199,6 +220,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -215,7 +237,6 @@ top_srcdir = @top_srcdir@ noinst_LIBRARIES = libVmCheck.a libVmCheck_a_SOURCES = vmcheck.c -AM_CFLAGS = @COMMON_CFLAGS@ all: all-am .SUFFIXES: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/vmCheck/vmcheck.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/vmCheck/vmcheck.c --- open-vm-tools-2008.01.23-74039/lib/vmCheck/vmcheck.c 2008-01-28 08:02:50.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/vmCheck/vmcheck.c 2008-10-13 08:01:51.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/vmSignal/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/vmSignal/Makefile.am --- open-vm-tools-2008.01.23-74039/lib/vmSignal/Makefile.am 2008-01-28 08:02:49.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/vmSignal/Makefile.am 2008-10-13 08:01:48.000000000 +0100 @@ -19,6 +19,3 @@ libVmSignal_a_SOURCES = libVmSignal_a_SOURCES += vmsignal.c - -AM_CFLAGS = -AM_CFLAGS += @COMMON_CFLAGS@ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/vmSignal/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/vmSignal/Makefile.in --- open-vm-tools-2008.01.23-74039/lib/vmSignal/Makefile.in 2008-01-28 08:03:06.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/vmSignal/Makefile.in 2008-10-13 08:02:16.000000000 +0100 @@ -52,7 +52,10 @@ subdir = lib/vmSignal DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +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)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -64,7 +67,7 @@ am_libVmSignal_a_OBJECTS = vmsignal.$(OBJEXT) libVmSignal_a_OBJECTS = $(am_libVmSignal_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp +depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -90,8 +93,6 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -COMMON_CFLAGS = @COMMON_CFLAGS@ -COMMON_PROG_CFLAGS = @COMMON_PROG_CFLAGS@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -102,45 +103,57 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ -ECHO = @ECHO@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GREP = @GREP@ -GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_AUTH_CFLAGS = @LIB_AUTH_CFLAGS@ -LIB_FILE_CFLAGS = @LIB_FILE_CFLAGS@ -LIB_HGFS_SERVER_CFLAGS = @LIB_HGFS_SERVER_CFLAGS@ -LIB_IMPERSONATE_CFLAGS = @LIB_IMPERSONATE_CFLAGS@ -LIB_MISC_CFLAGS = @LIB_MISC_CFLAGS@ -LIB_PROC_MGR_CFLAGS = @LIB_PROC_MGR_CFLAGS@ -LIB_STRING_CFLAGS = @LIB_STRING_CFLAGS@ -LIB_USER_CFLAGS = @LIB_USER_CFLAGS@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -148,27 +161,35 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ VERSION = @VERSION@ -VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -199,6 +220,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -215,7 +237,6 @@ top_srcdir = @top_srcdir@ noinst_LIBRARIES = libVmSignal.a libVmSignal_a_SOURCES = vmsignal.c -AM_CFLAGS = @COMMON_CFLAGS@ all: all-am .SUFFIXES: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/vmSignal/vmsignal.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/vmSignal/vmsignal.c --- open-vm-tools-2008.01.23-74039/lib/vmSignal/vmsignal.c 2008-01-28 08:02:50.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/vmSignal/vmsignal.c 2008-10-13 08:01:51.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/wiper/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/wiper/Makefile.am --- open-vm-tools-2008.01.23-74039/lib/wiper/Makefile.am 2008-01-28 08:02:50.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/wiper/Makefile.am 2008-10-13 08:01:48.000000000 +0100 @@ -19,6 +19,3 @@ libWiper_a_SOURCES = libWiper_a_SOURCES += wiperPosix.c - -AM_CFLAGS = -AM_CFLAGS += @COMMON_CFLAGS@ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/wiper/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/wiper/Makefile.in --- open-vm-tools-2008.01.23-74039/lib/wiper/Makefile.in 2008-01-28 08:03:06.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/wiper/Makefile.in 2008-10-13 08:02:16.000000000 +0100 @@ -52,7 +52,10 @@ subdir = lib/wiper DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +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)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -64,7 +67,7 @@ am_libWiper_a_OBJECTS = wiperPosix.$(OBJEXT) libWiper_a_OBJECTS = $(am_libWiper_a_OBJECTS) DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp +depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -90,8 +93,6 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -COMMON_CFLAGS = @COMMON_CFLAGS@ -COMMON_PROG_CFLAGS = @COMMON_PROG_CFLAGS@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -102,45 +103,57 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ -ECHO = @ECHO@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GREP = @GREP@ -GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_AUTH_CFLAGS = @LIB_AUTH_CFLAGS@ -LIB_FILE_CFLAGS = @LIB_FILE_CFLAGS@ -LIB_HGFS_SERVER_CFLAGS = @LIB_HGFS_SERVER_CFLAGS@ -LIB_IMPERSONATE_CFLAGS = @LIB_IMPERSONATE_CFLAGS@ -LIB_MISC_CFLAGS = @LIB_MISC_CFLAGS@ -LIB_PROC_MGR_CFLAGS = @LIB_PROC_MGR_CFLAGS@ -LIB_STRING_CFLAGS = @LIB_STRING_CFLAGS@ -LIB_USER_CFLAGS = @LIB_USER_CFLAGS@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -148,27 +161,35 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ VERSION = @VERSION@ -VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -199,6 +220,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -215,7 +237,6 @@ top_srcdir = @top_srcdir@ noinst_LIBRARIES = libWiper.a libWiper_a_SOURCES = wiperPosix.c -AM_CFLAGS = @COMMON_CFLAGS@ all: all-am .SUFFIXES: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/lib/wiper/wiperPosix.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/lib/wiper/wiperPosix.c --- open-vm-tools-2008.01.23-74039/lib/wiper/wiperPosix.c 2008-01-28 08:02:52.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/lib/wiper/wiperPosix.c 2008-10-13 08:01:53.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -36,9 +36,9 @@ # include <sys/ucred.h> # include <sys/mount.h> # include <fstab.h> -# if BSD_VERSION >= 50 +# if defined(__FreeBSD_version) && __FreeBSD_version >= 500000 # include <libgen.h> -# endif /* BSD_VERSION < 50 */ +# endif /* __FreeBSD_version >= 500000 */ #endif #include <unistd.h> @@ -48,6 +48,7 @@ #include "str.h" #include "fileIO.h" #include "mntinfo.h" +#include "posix.h" /* Number of bytes per disk sector */ @@ -209,7 +210,7 @@ * function, as a whole, does not even apply to OS X, so this caveat is * only minor. */ -#if BSD_VERSION < 50 +#if __FreeBSD_version < 500000 /* * Before FreeBSD 5, device nodes had static major/minor numbers. * (FreeBSD 5 included devfs which got rid of this concept.) So @@ -245,7 +246,7 @@ retval = TRUE; } } -#endif /* BSD_VERSION */ +#endif /* __FreeBSD_version */ return retval; } @@ -314,7 +315,7 @@ return; } - if (stat(MNTINFO_NAME(mnt), &s) < 0) { + if (Posix_Stat(MNTINFO_NAME(mnt), &s) < 0) { item->comment = "Unknown device"; return; } @@ -520,7 +521,7 @@ #ifdef sun if (statvfs(p->mountPoint, &statfsbuf) < 0) { #else - if (statfs(p->mountPoint, &statfsbuf) < 0) { + if (Posix_Statfs(p->mountPoint, &statfsbuf) < 0) { #endif return "Unable to statfs() the mount point"; } diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/libguestlib/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/libguestlib/Makefile.am --- open-vm-tools-2008.01.23-74039/libguestlib/Makefile.am 2008-01-28 08:02:54.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/libguestlib/Makefile.am 2008-10-13 08:01:55.000000000 +0100 @@ -17,12 +17,10 @@ lib_LTLIBRARIES = libguestlib.la -AM_CFLAGS = -AM_CFLAGS += @COMMON_CFLAGS@ - libguestlib_la_LIBADD = libguestlib_la_LIBADD += ../lib/rpcOut/shared/libRpcOut.la libguestlib_la_LIBADD += ../lib/string/shared/libString.la +libguestlib_la_LIBADD += ../lib/stubs/shared/libStubs.la # In the absence of the linker options --start-group and --end-group (which can't # be put in LDADD), we need to bring the following libraries out of the alphebetical # order so their symbols are properly resolved. @@ -32,7 +30,6 @@ libguestlib_la_SOURCES = libguestlib_la_SOURCES += vmGuestLib.c libguestlib_la_SOURCES += vmGuestLibPanic.c -libguestlib_la_SOURCES += stubs.c libguestlib_la_LDFLAGS = # We require GCC, so we're fine passing compiler-specific flags. diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/libguestlib/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/libguestlib/Makefile.in --- open-vm-tools-2008.01.23-74039/libguestlib/Makefile.in 2008-01-28 08:03:06.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/libguestlib/Makefile.in 2008-10-13 08:02:16.000000000 +0100 @@ -52,7 +52,10 @@ subdir = libguestlib DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in COPYING ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +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)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -68,15 +71,16 @@ LTLIBRARIES = $(lib_LTLIBRARIES) libguestlib_la_DEPENDENCIES = ../lib/rpcOut/shared/libRpcOut.la \ ../lib/string/shared/libString.la \ + ../lib/stubs/shared/libStubs.la \ ../lib/message/shared/libMessage.la \ ../lib/backdoor/shared/libBackdoor.la -am_libguestlib_la_OBJECTS = vmGuestLib.lo vmGuestLibPanic.lo stubs.lo +am_libguestlib_la_OBJECTS = vmGuestLib.lo vmGuestLibPanic.lo libguestlib_la_OBJECTS = $(am_libguestlib_la_OBJECTS) libguestlib_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(libguestlib_la_LDFLAGS) $(LDFLAGS) -o $@ DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp +depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -102,8 +106,6 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -COMMON_CFLAGS = @COMMON_CFLAGS@ -COMMON_PROG_CFLAGS = @COMMON_PROG_CFLAGS@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -114,45 +116,57 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ -ECHO = @ECHO@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GREP = @GREP@ -GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_AUTH_CFLAGS = @LIB_AUTH_CFLAGS@ -LIB_FILE_CFLAGS = @LIB_FILE_CFLAGS@ -LIB_HGFS_SERVER_CFLAGS = @LIB_HGFS_SERVER_CFLAGS@ -LIB_IMPERSONATE_CFLAGS = @LIB_IMPERSONATE_CFLAGS@ -LIB_MISC_CFLAGS = @LIB_MISC_CFLAGS@ -LIB_PROC_MGR_CFLAGS = @LIB_PROC_MGR_CFLAGS@ -LIB_STRING_CFLAGS = @LIB_STRING_CFLAGS@ -LIB_USER_CFLAGS = @LIB_USER_CFLAGS@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -160,27 +174,35 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ VERSION = @VERSION@ -VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -211,6 +233,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -226,15 +249,15 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ lib_LTLIBRARIES = libguestlib.la -AM_CFLAGS = @COMMON_CFLAGS@ # In the absence of the linker options --start-group and --end-group (which can't # be put in LDADD), we need to bring the following libraries out of the alphebetical # order so their symbols are properly resolved. libguestlib_la_LIBADD = ../lib/rpcOut/shared/libRpcOut.la \ ../lib/string/shared/libString.la \ + ../lib/stubs/shared/libStubs.la \ ../lib/message/shared/libMessage.la \ ../lib/backdoor/shared/libBackdoor.la -libguestlib_la_SOURCES = vmGuestLib.c vmGuestLibPanic.c stubs.c +libguestlib_la_SOURCES = vmGuestLib.c vmGuestLibPanic.c # We require GCC, so we're fine passing compiler-specific flags. # Needed for OS's that don't link shared libraries against libc by default, e.g. FreeBSD libguestlib_la_LDFLAGS = -Wl,-lc @@ -307,7 +330,6 @@ distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stubs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vmGuestLib.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vmGuestLibPanic.Plo@am__quote@ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/libguestlib/stubs.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/libguestlib/stubs.c --- open-vm-tools-2008.01.23-74039/libguestlib/stubs.c 2008-01-28 08:02:54.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/libguestlib/stubs.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,61 +0,0 @@ -/********************************************************* - * Copyright (C) 2005 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 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. - * - *********************************************************/ - -#include <stdlib.h> -#include <stdio.h> - -#include <sys/types.h> -#include <sys/stat.h> - -#include "vmware.h" -#include "str.h" - - -/* - * Stubs for symbols needed by vmGuestLib - */ - -void -Debug(const char *fmt, ...) // IN -{ - // do nothing -} - -void -Log(const char *fmt, ...) // IN -{ - // do nothing -} - - -void -Warning(const char *fmt, ...) // IN -{ - // do nothing -} - - -int64 -File_GetModTime(const char *fileName) // IN -{ - struct stat statBuf; - if (stat(fileName, &statBuf) == -1) { - return -1; - } - return (int64)statBuf.st_mtime; -} diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/libguestlib/vmGuestLib.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/libguestlib/vmGuestLib.c --- open-vm-tools-2008.01.23-74039/libguestlib/vmGuestLib.c 2008-01-28 08:02:54.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/libguestlib/vmGuestLib.c 2008-10-13 08:01:55.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/libguestlib/vmGuestLibInt.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/libguestlib/vmGuestLibInt.h --- open-vm-tools-2008.01.23-74039/libguestlib/vmGuestLibInt.h 2008-01-28 08:02:54.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/libguestlib/vmGuestLibInt.h 2008-10-13 08:01:55.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/libguestlib/vmGuestLibPanic.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/libguestlib/vmGuestLibPanic.c --- open-vm-tools-2008.01.23-74039/libguestlib/vmGuestLibPanic.c 2008-01-28 08:02:54.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/libguestlib/vmGuestLibPanic.c 2008-10-13 08:01:55.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/libguestlib/vmguestlib_version.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/libguestlib/vmguestlib_version.h --- open-vm-tools-2008.01.23-74039/libguestlib/vmguestlib_version.h 2008-01-28 08:02:54.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/libguestlib/vmguestlib_version.h 2008-10-13 08:01:55.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/ltmain.sh /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/ltmain.sh --- open-vm-tools-2008.01.23-74039/ltmain.sh 2007-08-17 01:29:47.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/ltmain.sh 1970-01-01 01:00:00.000000000 +0100 @@ -1,6911 +0,0 @@ -# ltmain.sh - Provide generalized library-building support services. -# NOTE: Changing this file will not affect anything until you rerun configure. -# -# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 -# Free Software Foundation, Inc. -# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -basename="s,^.*/,,g" - -# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh -# is ksh but when the shell is invoked as "sh" and the current value of -# the _XPG environment variable is not equal to 1 (one), the special -# positional parameter $0, within a function call, is the name of the -# function. -progpath="$0" - -# The name of this program: -progname=`echo "$progpath" | $SED $basename` -modename="$progname" - -# Global variables: -EXIT_SUCCESS=0 -EXIT_FAILURE=1 - -PROGRAM=ltmain.sh -PACKAGE=libtool -VERSION=1.5.22 -TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)" - -# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE). -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac -fi - -# Check that we have a working $echo. -if test "X$1" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift -elif test "X$1" = X--fallback-echo; then - # Avoid inline document here, it may be left over - : -elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then - # Yippee, $echo works! - : -else - # Restart under the correct shell, and then maybe $echo will work. - exec $SHELL "$progpath" --no-reexec ${1+"$@"} -fi - -if test "X$1" = X--fallback-echo; then - # used as fallback echo - shift - cat <<EOF -$* -EOF - exit $EXIT_SUCCESS -fi - -default_mode= -help="Try \`$progname --help' for more information." -magic="%%%MAGIC variable%%%" -mkdir="mkdir" -mv="mv -f" -rm="rm -f" - -# 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' -# 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 - SP2NL='tr \040 \012' - NL2SP='tr \015\012 \040\040' - ;; - *) # EBCDIC based system - SP2NL='tr \100 \n' - NL2SP='tr \r\n \100\100' - ;; -esac - -# NLS nuisances. -# Only set LANG and LC_ALL to C if already set. -# These must not be set unconditionally because not all systems understand -# e.g. LANG=C (notably SCO). -# We save the old values to restore during execute mode. -for lt_var in LANG 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 - fi" -done - -# Make sure IFS has a sensible default -lt_nl=' -' -IFS=" $lt_nl" - -if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then - $echo "$modename: not configured to build any kind of library" 1>&2 - $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 - exit $EXIT_FAILURE -fi - -# Global variables. -mode=$default_mode -nonopt= -prev= -prevopt= -run= -show="$echo" -show_help= -execute_dlfiles= -duplicate_deps=no -preserve_args= -lo2o="s/\\.lo\$/.${objext}/" -o2lo="s/\\.${objext}\$/.lo/" -extracted_archives= -extracted_serial=0 - -##################################### -# Shell function definitions: -# This seems to be the best place for them - -# func_mktempdir [string] -# Make a temporary directory that won't clash with other running -# libtool processes, and avoids race conditions if possible. If -# given, STRING is the basename for that directory. -func_mktempdir () -{ - my_template="${TMPDIR-/tmp}/${1-$progname}" - - if test "$run" = ":"; then - # Return a directory name, but don't create it in dry-run mode - my_tmpdir="${my_template}-$$" - else - - # If mktemp works, use that first and foremost - my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` - - if test ! -d "$my_tmpdir"; then - # Failing that, at least try and use $RANDOM to avoid a race - my_tmpdir="${my_template}-${RANDOM-0}$$" - - save_mktempdir_umask=`umask` - umask 0077 - $mkdir "$my_tmpdir" - umask $save_mktempdir_umask - fi - - # If we're not in dry-run mode, bomb out on failure - test -d "$my_tmpdir" || { - $echo "cannot create temporary directory \`$my_tmpdir'" 1>&2 - exit $EXIT_FAILURE - } - fi - - $echo "X$my_tmpdir" | $Xsed -} - - -# func_win32_libid arg -# return the library type of file 'arg' -# -# Need a lot of goo to handle *both* DLLs and import libs -# Has to be a shell function in order to 'eat' the argument -# that is supplied when $file_magic_command is called. -func_win32_libid () -{ - win32_libid_type="unknown" - win32_fileres=`file -L $1 2>/dev/null` - case $win32_fileres in - *ar\ archive\ import\ library*) # definitely import - win32_libid_type="x86 archive import" - ;; - *ar\ archive*) # could be an import, or static - if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \ - $EGREP -e 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then - win32_nmres=`eval $NM -f posix -A $1 | \ - $SED -n -e '1,100{/ I /{s,.*,import,;p;q;};}'` - case $win32_nmres in - import*) win32_libid_type="x86 archive import";; - *) win32_libid_type="x86 archive static";; - esac - fi - ;; - *DLL*) - win32_libid_type="x86 DLL" - ;; - *executable*) # but shell scripts are "executable" too... - case $win32_fileres in - *MS\ Windows\ PE\ Intel*) - win32_libid_type="x86 DLL" - ;; - esac - ;; - esac - $echo $win32_libid_type -} - - -# func_infer_tag arg -# Infer tagged configuration to use if any are available and -# if one wasn't chosen via the "--tag" command line option. -# Only attempt this if the compiler in the base compile -# command doesn't match the default compiler. -# arg is usually of the form 'gcc ...' -func_infer_tag () -{ - if test -n "$available_tags" && test -z "$tagname"; then - CC_quoted= - for arg in $CC; do - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - CC_quoted="$CC_quoted $arg" - done - case $@ in - # Blanks in the command may have been stripped by the calling shell, - # but not from the CC environment variable when configure was run. - " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) ;; - # Blanks at the start of $base_compile will cause this to fail - # if we don't check for them as well. - *) - for z in $available_tags; do - if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then - # Evaluate the configuration. - eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" - CC_quoted= - for arg in $CC; do - # Double-quote args containing other shell metacharacters. - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - CC_quoted="$CC_quoted $arg" - done - case "$@ " in - " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$echo $CC_quoted` "* | "`$echo $CC_quoted` "*) - # The compiler in the base compile command matches - # the one in the tagged configuration. - # Assume this is the tagged configuration we want. - tagname=$z - break - ;; - esac - fi - done - # If $tagname still isn't set, then no tagged configuration - # was found and let the user know that the "--tag" command - # line option must be used. - if test -z "$tagname"; then - $echo "$modename: unable to infer tagged configuration" - $echo "$modename: specify a tag with \`--tag'" 1>&2 - exit $EXIT_FAILURE -# else -# $echo "$modename: using $tagname tagged configuration" - fi - ;; - esac - fi -} - - -# func_extract_an_archive dir oldlib -func_extract_an_archive () -{ - f_ex_an_ar_dir="$1"; shift - f_ex_an_ar_oldlib="$1" - - $show "(cd $f_ex_an_ar_dir && $AR x $f_ex_an_ar_oldlib)" - $run eval "(cd \$f_ex_an_ar_dir && $AR x \$f_ex_an_ar_oldlib)" || exit $? - if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then - : - else - $echo "$modename: ERROR: object name conflicts: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" 1>&2 - exit $EXIT_FAILURE - fi -} - -# func_extract_archives gentop oldlib ... -func_extract_archives () -{ - my_gentop="$1"; shift - my_oldlibs=${1+"$@"} - my_oldobjs="" - my_xlib="" - my_xabs="" - my_xdir="" - my_status="" - - $show "${rm}r $my_gentop" - $run ${rm}r "$my_gentop" - $show "$mkdir $my_gentop" - $run $mkdir "$my_gentop" - my_status=$? - if test "$my_status" -ne 0 && test ! -d "$my_gentop"; then - exit $my_status - fi - - for my_xlib in $my_oldlibs; do - # Extract the objects. - case $my_xlib in - [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; - *) my_xabs=`pwd`"/$my_xlib" ;; - esac - my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'` - my_xlib_u=$my_xlib - while :; do - case " $extracted_archives " in - *" $my_xlib_u "*) - extracted_serial=`expr $extracted_serial + 1` - my_xlib_u=lt$extracted_serial-$my_xlib ;; - *) break ;; - esac - done - extracted_archives="$extracted_archives $my_xlib_u" - my_xdir="$my_gentop/$my_xlib_u" - - $show "${rm}r $my_xdir" - $run ${rm}r "$my_xdir" - $show "$mkdir $my_xdir" - $run $mkdir "$my_xdir" - exit_status=$? - if test "$exit_status" -ne 0 && test ! -d "$my_xdir"; then - exit $exit_status - fi - case $host in - *-darwin*) - $show "Extracting $my_xabs" - # Do not bother doing anything if just a dry run - if test -z "$run"; then - darwin_orig_dir=`pwd` - cd $my_xdir || exit $? - darwin_archive=$my_xabs - darwin_curdir=`pwd` - darwin_base_archive=`$echo "X$darwin_archive" | $Xsed -e 's%^.*/%%'` - darwin_arches=`lipo -info "$darwin_archive" 2>/dev/null | $EGREP Architectures 2>/dev/null` - if test -n "$darwin_arches"; then - darwin_arches=`echo "$darwin_arches" | $SED -e 's/.*are://'` - darwin_arch= - $show "$darwin_base_archive has multiple architectures $darwin_arches" - for darwin_arch in $darwin_arches ; do - mkdir -p "unfat-$$/${darwin_base_archive}-${darwin_arch}" - lipo -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" - cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" - func_extract_an_archive "`pwd`" "${darwin_base_archive}" - cd "$darwin_curdir" - $rm "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" - done # $darwin_arches - ## Okay now we have a bunch of thin objects, gotta fatten them up :) - darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print| xargs basename | sort -u | $NL2SP` - darwin_file= - darwin_files= - for darwin_file in $darwin_filelist; do - darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` - lipo -create -output "$darwin_file" $darwin_files - done # $darwin_filelist - ${rm}r unfat-$$ - cd "$darwin_orig_dir" - else - cd "$darwin_orig_dir" - func_extract_an_archive "$my_xdir" "$my_xabs" - fi # $darwin_arches - fi # $run - ;; - *) - func_extract_an_archive "$my_xdir" "$my_xabs" - ;; - esac - my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` - done - func_extract_archives_result="$my_oldobjs" -} -# End of Shell function definitions -##################################### - -# Darwin sucks -eval std_shrext=\"$shrext_cmds\" - -disable_libs=no - -# Parse our command line options once, thoroughly. -while test "$#" -gt 0 -do - arg="$1" - shift - - case $arg in - -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; - *) optarg= ;; - esac - - # If the previous option needs an argument, assign it. - if test -n "$prev"; then - case $prev in - execute_dlfiles) - execute_dlfiles="$execute_dlfiles $arg" - ;; - tag) - tagname="$arg" - preserve_args="${preserve_args}=$arg" - - # Check whether tagname contains only valid characters - case $tagname in - *[!-_A-Za-z0-9,/]*) - $echo "$progname: invalid tag name: $tagname" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - case $tagname in - CC) - # Don't test for the "default" C tag, as we know, it's there, but - # not specially marked. - ;; - *) - if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$progpath" > /dev/null; then - taglist="$taglist $tagname" - # Evaluate the configuration. - eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^# ### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $progpath`" - else - $echo "$progname: ignoring unknown tag $tagname" 1>&2 - fi - ;; - esac - ;; - *) - eval "$prev=\$arg" - ;; - esac - - prev= - prevopt= - continue - fi - - # Have we seen a non-optional argument yet? - case $arg in - --help) - show_help=yes - ;; - - --version) - $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" - $echo - $echo "Copyright (C) 2005 Free Software Foundation, Inc." - $echo "This is free software; see the source for copying conditions. There is NO" - $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - exit $? - ;; - - --config) - ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $progpath - # Now print the configurations for the tags. - for tagname in $taglist; do - ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$progpath" - done - exit $? - ;; - - --debug) - $echo "$progname: enabling shell trace mode" - set -x - preserve_args="$preserve_args $arg" - ;; - - --dry-run | -n) - run=: - ;; - - --features) - $echo "host: $host" - if test "$build_libtool_libs" = yes; then - $echo "enable shared libraries" - else - $echo "disable shared libraries" - fi - if test "$build_old_libs" = yes; then - $echo "enable static libraries" - else - $echo "disable static libraries" - fi - exit $? - ;; - - --finish) mode="finish" ;; - - --mode) prevopt="--mode" prev=mode ;; - --mode=*) mode="$optarg" ;; - - --preserve-dup-deps) duplicate_deps="yes" ;; - - --quiet | --silent) - show=: - preserve_args="$preserve_args $arg" - ;; - - --tag) - prevopt="--tag" - prev=tag - preserve_args="$preserve_args --tag" - ;; - --tag=*) - set tag "$optarg" ${1+"$@"} - shift - prev=tag - preserve_args="$preserve_args --tag" - ;; - - -dlopen) - prevopt="-dlopen" - prev=execute_dlfiles - ;; - - -*) - $echo "$modename: unrecognized option \`$arg'" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - ;; - - *) - nonopt="$arg" - break - ;; - esac -done - -if test -n "$prevopt"; then - $echo "$modename: option \`$prevopt' requires an argument" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE -fi - -case $disable_libs in -no) - ;; -shared) - build_libtool_libs=no - build_old_libs=yes - ;; -static) - build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` - ;; -esac - -# If this variable is set in any of the actions, the command in it -# will be execed at the end. This prevents here-documents from being -# left over by shells. -exec_cmd= - -if test -z "$show_help"; then - - # Infer the operation mode. - if test -z "$mode"; then - $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2 - $echo "*** Future versions of Libtool will require --mode=MODE be specified." 1>&2 - case $nonopt in - *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*) - mode=link - for arg - do - case $arg in - -c) - mode=compile - break - ;; - esac - done - ;; - *db | *dbx | *strace | *truss) - mode=execute - ;; - *install*|cp|mv) - mode=install - ;; - *rm) - mode=uninstall - ;; - *) - # If we have no mode, but dlfiles were specified, then do execute mode. - test -n "$execute_dlfiles" && mode=execute - - # Just use the default operation mode. - if test -z "$mode"; then - if test -n "$nonopt"; then - $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 - else - $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 - fi - fi - ;; - esac - fi - - # Only execute mode is allowed to have -dlopen flags. - if test -n "$execute_dlfiles" && test "$mode" != execute; then - $echo "$modename: unrecognized option \`-dlopen'" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # Change the help message to a mode-specific one. - generic_help="$help" - help="Try \`$modename --help --mode=$mode' for more information." - - # These modes are in order of execution frequency so that they run quickly. - case $mode in - # libtool compile mode - compile) - modename="$modename: compile" - # Get the compilation command and the source file. - base_compile= - srcfile="$nonopt" # always keep a non-empty value in "srcfile" - suppress_opt=yes - suppress_output= - arg_mode=normal - libobj= - later= - - for arg - do - case $arg_mode in - arg ) - # do not "continue". Instead, add this to base_compile - lastarg="$arg" - arg_mode=normal - ;; - - target ) - libobj="$arg" - arg_mode=normal - continue - ;; - - normal ) - # Accept any command-line options. - case $arg in - -o) - if test -n "$libobj" ; then - $echo "$modename: you cannot specify \`-o' more than once" 1>&2 - exit $EXIT_FAILURE - fi - arg_mode=target - continue - ;; - - -static | -prefer-pic | -prefer-non-pic) - later="$later $arg" - continue - ;; - - -no-suppress) - suppress_opt=no - continue - ;; - - -Xcompiler) - arg_mode=arg # the next one goes into the "base_compile" arg list - continue # The current "srcfile" will either be retained or - ;; # replaced later. I would guess that would be a bug. - - -Wc,*) - args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"` - lastarg= - save_ifs="$IFS"; IFS=',' - for arg in $args; do - IFS="$save_ifs" - - # Double-quote args containing other shell metacharacters. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, so we specify it separately. - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - lastarg="$lastarg $arg" - done - IFS="$save_ifs" - lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"` - - # Add the arguments to base_compile. - base_compile="$base_compile $lastarg" - continue - ;; - - * ) - # Accept the current argument as the source file. - # The previous "srcfile" becomes the current argument. - # - lastarg="$srcfile" - srcfile="$arg" - ;; - esac # case $arg - ;; - esac # case $arg_mode - - # Aesthetically quote the previous argument. - lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` - - case $lastarg in - # Double-quote args containing other shell metacharacters. - # Many Bourne shells cannot handle close brackets correctly - # in scan sets, and some SunOS ksh mistreat backslash-escaping - # in scan sets (worked around with variable expansion), - # and furthermore cannot handle '|' '&' '(' ')' in scan sets - # at all, so we specify them separately. - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - lastarg="\"$lastarg\"" - ;; - esac - - base_compile="$base_compile $lastarg" - done # for arg - - case $arg_mode in - arg) - $echo "$modename: you must specify an argument for -Xcompile" - exit $EXIT_FAILURE - ;; - target) - $echo "$modename: you must specify a target with \`-o'" 1>&2 - exit $EXIT_FAILURE - ;; - *) - # Get the name of the library object. - [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` - ;; - esac - - # Recognize several different file suffixes. - # If the user specifies -o file.o, it is replaced with file.lo - xform='[cCFSifmso]' - case $libobj in - *.ada) xform=ada ;; - *.adb) xform=adb ;; - *.ads) xform=ads ;; - *.asm) xform=asm ;; - *.c++) xform=c++ ;; - *.cc) xform=cc ;; - *.ii) xform=ii ;; - *.class) xform=class ;; - *.cpp) xform=cpp ;; - *.cxx) xform=cxx ;; - *.f90) xform=f90 ;; - *.for) xform=for ;; - *.java) xform=java ;; - *.obj) xform=obj ;; - esac - - libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` - - case $libobj in - *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; - *) - $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - func_infer_tag $base_compile - - for arg in $later; do - case $arg in - -static) - build_old_libs=yes - continue - ;; - - -prefer-pic) - pic_mode=yes - continue - ;; - - -prefer-non-pic) - pic_mode=no - continue - ;; - esac - done - - qlibobj=`$echo "X$libobj" | $Xsed -e "$sed_quote_subst"` - case $qlibobj in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - qlibobj="\"$qlibobj\"" ;; - esac - test "X$libobj" != "X$qlibobj" \ - && $echo "X$libobj" | grep '[]~#^*{};<>?"'"'"' &()|`$[]' \ - && $echo "$modename: libobj name \`$libobj' may not contain shell special characters." - objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` - xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$obj"; then - xdir= - else - xdir=$xdir/ - fi - lobj=${xdir}$objdir/$objname - - if test -z "$base_compile"; then - $echo "$modename: you must specify a compilation command" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # Delete any leftover library objects. - if test "$build_old_libs" = yes; then - removelist="$obj $lobj $libobj ${libobj}T" - else - removelist="$lobj $libobj ${libobj}T" - fi - - $run $rm $removelist - trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 - - # On Cygwin there's no "real" PIC flag so we must build both object types - case $host_os in - cygwin* | mingw* | pw32* | os2*) - pic_mode=default - ;; - esac - if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then - # non-PIC code in shared libraries is not supported - pic_mode=default - fi - - # Calculate the filename of the output object if compiler does - # not support -o with -c - if test "$compiler_c_o" = no; then - output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} - lockfile="$output_obj.lock" - removelist="$removelist $output_obj $lockfile" - trap "$run $rm $removelist; exit $EXIT_FAILURE" 1 2 15 - else - output_obj= - need_locks=no - lockfile= - fi - - # Lock this critical section if it is needed - # We use this script file to make the link, it avoids creating a new file - if test "$need_locks" = yes; then - until $run ln "$progpath" "$lockfile" 2>/dev/null; do - $show "Waiting for $lockfile to be removed" - sleep 2 - done - elif test "$need_locks" = warn; then - if test -f "$lockfile"; then - $echo "\ -*** ERROR, $lockfile exists and contains: -`cat $lockfile 2>/dev/null` - -This indicates that another process is trying to use the same -temporary object file, and libtool could not work around it because -your compiler does not support \`-c' and \`-o' together. If you -repeat this compilation, it may succeed, by chance, but you had better -avoid parallel builds (make -j) in this platform, or get a better -compiler." - - $run $rm $removelist - exit $EXIT_FAILURE - fi - $echo "$srcfile" > "$lockfile" - fi - - if test -n "$fix_srcfile_path"; then - eval srcfile=\"$fix_srcfile_path\" - fi - qsrcfile=`$echo "X$srcfile" | $Xsed -e "$sed_quote_subst"` - case $qsrcfile in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - qsrcfile="\"$qsrcfile\"" ;; - esac - - $run $rm "$libobj" "${libobj}T" - - # Create a libtool object file (analogous to a ".la" file), - # but don't create it if we're doing a dry run. - test -z "$run" && cat > ${libobj}T <<EOF -# $libobj - a libtool object file -# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP -# -# Please DO NOT delete this file! -# It is necessary for linking the library. - -# Name of the PIC object. -EOF - - # 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 - - if test ! -d "${xdir}$objdir"; then - $show "$mkdir ${xdir}$objdir" - $run $mkdir ${xdir}$objdir - exit_status=$? - if test "$exit_status" -ne 0 && test ! -d "${xdir}$objdir"; then - exit $exit_status - fi - fi - - if test -z "$output_obj"; then - # Place PIC objects in $objdir - command="$command -o $lobj" - fi - - $run $rm "$lobj" "$output_obj" - - $show "$command" - if $run eval "$command"; then : - else - test -n "$output_obj" && $run $rm $removelist - exit $EXIT_FAILURE - fi - - 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." - - $run $rm $removelist - exit $EXIT_FAILURE - fi - - # Just move the object if needed, then go on to compile the next one - if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then - $show "$mv $output_obj $lobj" - if $run $mv $output_obj $lobj; then : - else - error=$? - $run $rm $removelist - exit $error - fi - fi - - # Append the name of the PIC object to the libtool object file. - test -z "$run" && cat >> ${libobj}T <<EOF -pic_object='$objdir/$objname' - -EOF - - # Allow error messages only from the first compilation. - if test "$suppress_opt" = yes; then - suppress_output=' >/dev/null 2>&1' - fi - else - # No PIC object so indicate it doesn't exist in the libtool - # object file. - test -z "$run" && cat >> ${libobj}T <<EOF -pic_object=none - -EOF - 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" - else - command="$base_compile $qsrcfile $pic_flag" - fi - if test "$compiler_c_o" = yes; then - command="$command -o $obj" - fi - - # Suppress compiler output if we already did a PIC compilation. - command="$command$suppress_output" - $run $rm "$obj" "$output_obj" - $show "$command" - if $run eval "$command"; then : - else - $run $rm $removelist - exit $EXIT_FAILURE - fi - - 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." - - $run $rm $removelist - exit $EXIT_FAILURE - fi - - # Just move the object if needed - if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then - $show "$mv $output_obj $obj" - if $run $mv $output_obj $obj; then : - else - error=$? - $run $rm $removelist - exit $error - fi - fi - - # Append the name of the non-PIC object the libtool object file. - # Only append if the libtool object file exists. - test -z "$run" && cat >> ${libobj}T <<EOF -# Name of the non-PIC object. -non_pic_object='$objname' - -EOF - else - # Append the name of the non-PIC object the libtool object file. - # Only append if the libtool object file exists. - test -z "$run" && cat >> ${libobj}T <<EOF -# Name of the non-PIC object. -non_pic_object=none - -EOF - fi - - $run $mv "${libobj}T" "${libobj}" - - # Unlock the critical section if it was locked - if test "$need_locks" != no; then - $run $rm "$lockfile" - fi - - exit $EXIT_SUCCESS - ;; - - # libtool link mode - link | relink) - modename="$modename: link" - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) - # 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= - - avoid_version=no - dlfiles= - dlprefiles= - dlself=no - export_dynamic=no - export_symbols= - export_symbols_regex= - generated= - libobjs= - ltlibs= - module=no - no_install=no - objs= - non_pic_objects= - notinst_path= # paths that contain not-installed libtool libraries - 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 - - func_infer_tag $base_compile - - # We need to know -static, to get the right output filenames. - for arg - do - case $arg in - -all-static | -static | -static-libtool-libs) - case $arg in - -all-static) - if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then - $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2 - fi - if test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - prefer_static_libs=yes - ;; - -static) - if test -z "$pic_flag" && test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - prefer_static_libs=built - ;; - -static-libtool-libs) - if test -z "$pic_flag" && test -n "$link_static_flag"; then - dlopen_self=$dlopen_self_static - fi - prefer_static_libs=yes - ;; - esac - build_libtool_libs=no - build_old_libs=yes - break - ;; - esac - done - - # See if our shared archives depend on static archives. - test -n "$old_archive_from_new_cmds" && build_old_libs=yes - - # Go through the arguments, transforming them on the way. - while test "$#" -gt 0; do - arg="$1" - shift - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test - ;; - *) qarg=$arg ;; - esac - libtool_args="$libtool_args $qarg" - - # If the previous option needs an argument, assign it. - if test -n "$prev"; then - case $prev in - output) - compile_command="$compile_command @OUTPUT@" - finalize_command="$finalize_command @OUTPUT@" - ;; - esac - - case $prev in - dlfiles|dlprefiles) - if test "$preload" = no; then - # Add the symbol object into the linking commands. - compile_command="$compile_command @SYMFILE@" - finalize_command="$finalize_command @SYMFILE@" - preload=yes - fi - case $arg in - *.la | *.lo) ;; # We handle these cases below. - force) - if test "$dlself" = no; then - dlself=needless - export_dynamic=yes - fi - prev= - continue - ;; - self) - if test "$prev" = dlprefiles; then - dlself=yes - elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then - dlself=yes - else - dlself=needless - export_dynamic=yes - fi - prev= - continue - ;; - *) - if test "$prev" = dlfiles; then - dlfiles="$dlfiles $arg" - else - dlprefiles="$dlprefiles $arg" - fi - prev= - continue - ;; - esac - ;; - expsyms) - export_symbols="$arg" - if test ! -f "$arg"; then - $echo "$modename: symbol file \`$arg' does not exist" - exit $EXIT_FAILURE - fi - prev= - continue - ;; - expsyms_regex) - export_symbols_regex="$arg" - prev= - continue - ;; - inst_prefix) - inst_prefix_dir="$arg" - prev= - continue - ;; - precious_regex) - precious_files_regex="$arg" - prev= - continue - ;; - release) - release="-$arg" - prev= - continue - ;; - objectlist) - if test -f "$arg"; then - save_arg=$arg - moreargs= - for fil in `cat $save_arg` - do -# moreargs="$moreargs $fil" - arg=$fil - # A libtool-controlled object. - - # Check to see that this really is a libtool object. - if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - pic_object= - non_pic_object= - - # Read the .lo file - # If there is no directory component, then add one. - case $arg in - */* | *\\*) . $arg ;; - *) . ./$arg ;; - esac - - if test -z "$pic_object" || \ - test -z "$non_pic_object" || - test "$pic_object" = none && \ - test "$non_pic_object" = none; then - $echo "$modename: cannot find name of object for \`$arg'" 1>&2 - exit $EXIT_FAILURE - fi - - # Extract subdirectory from the argument. - xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$arg"; then - xdir= - else - xdir="$xdir/" - fi - - if test "$pic_object" != none; then - # Prepend the subdirectory the object is found in. - pic_object="$xdir$pic_object" - - if test "$prev" = dlfiles; then - if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then - dlfiles="$dlfiles $pic_object" - prev= - continue - else - # If libtool objects are unsupported, then we need to preload. - prev=dlprefiles - fi - fi - - # CHECK ME: I think I busted this. -Ossama - if test "$prev" = dlprefiles; then - # Preload the old-style object. - dlprefiles="$dlprefiles $pic_object" - prev= - fi - - # A PIC object. - libobjs="$libobjs $pic_object" - arg="$pic_object" - fi - - # Non-PIC object. - if test "$non_pic_object" != none; then - # Prepend the subdirectory the object is found in. - non_pic_object="$xdir$non_pic_object" - - # A standard non-PIC object - non_pic_objects="$non_pic_objects $non_pic_object" - if test -z "$pic_object" || test "$pic_object" = none ; then - arg="$non_pic_object" - fi - else - # If the PIC object exists, use it instead. - # $xdir was prepended to $pic_object above. - non_pic_object="$pic_object" - non_pic_objects="$non_pic_objects $non_pic_object" - fi - else - # Only an error if not doing a dry-run. - if test -z "$run"; then - $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 - exit $EXIT_FAILURE - else - # Dry-run case. - - # Extract subdirectory from the argument. - xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$arg"; then - xdir= - else - xdir="$xdir/" - fi - - pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` - non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` - libobjs="$libobjs $pic_object" - non_pic_objects="$non_pic_objects $non_pic_object" - fi - fi - done - else - $echo "$modename: link input file \`$save_arg' does not exist" - exit $EXIT_FAILURE - fi - arg=$save_arg - prev= - continue - ;; - rpath | xrpath) - # We need an absolute path. - case $arg in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - $echo "$modename: only absolute run-paths are allowed" 1>&2 - exit $EXIT_FAILURE - ;; - esac - if test "$prev" = rpath; then - case "$rpath " in - *" $arg "*) ;; - *) rpath="$rpath $arg" ;; - esac - else - case "$xrpath " in - *" $arg "*) ;; - *) xrpath="$xrpath $arg" ;; - esac - fi - prev= - continue - ;; - xcompiler) - compiler_flags="$compiler_flags $qarg" - prev= - compile_command="$compile_command $qarg" - finalize_command="$finalize_command $qarg" - continue - ;; - xlinker) - linker_flags="$linker_flags $qarg" - compiler_flags="$compiler_flags $wl$qarg" - prev= - compile_command="$compile_command $wl$qarg" - finalize_command="$finalize_command $wl$qarg" - continue - ;; - xcclinker) - linker_flags="$linker_flags $qarg" - compiler_flags="$compiler_flags $qarg" - prev= - compile_command="$compile_command $qarg" - finalize_command="$finalize_command $qarg" - continue - ;; - shrext) - shrext_cmds="$arg" - prev= - continue - ;; - darwin_framework|darwin_framework_skip) - test "$prev" = "darwin_framework" && compiler_flags="$compiler_flags $arg" - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - prev= - continue - ;; - *) - eval "$prev=\"\$arg\"" - prev= - continue - ;; - esac - fi # test -n "$prev" - - prevarg="$arg" - - case $arg in - -all-static) - if test -n "$link_static_flag"; then - compile_command="$compile_command $link_static_flag" - finalize_command="$finalize_command $link_static_flag" - fi - continue - ;; - - -allow-undefined) - # FIXME: remove this flag sometime in the future. - $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 - continue - ;; - - -avoid-version) - avoid_version=yes - continue - ;; - - -dlopen) - prev=dlfiles - continue - ;; - - -dlpreopen) - prev=dlprefiles - continue - ;; - - -export-dynamic) - export_dynamic=yes - continue - ;; - - -export-symbols | -export-symbols-regex) - if test -n "$export_symbols" || test -n "$export_symbols_regex"; then - $echo "$modename: more than one -exported-symbols argument is not allowed" - exit $EXIT_FAILURE - fi - if test "X$arg" = "X-export-symbols"; then - prev=expsyms - else - prev=expsyms_regex - fi - continue - ;; - - -framework|-arch|-isysroot) - case " $CC " in - *" ${arg} ${1} "* | *" ${arg} ${1} "*) - prev=darwin_framework_skip ;; - *) compiler_flags="$compiler_flags $arg" - prev=darwin_framework ;; - esac - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - continue - ;; - - -inst-prefix-dir) - prev=inst_prefix - continue - ;; - - # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* - # so, if we see these flags be careful not to treat them like -L - -L[A-Z][A-Z]*:*) - case $with_gcc/$host in - no/*-*-irix* | /*-*-irix*) - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - ;; - esac - continue - ;; - - -L*) - dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - absdir=`cd "$dir" && pwd` - if test -z "$absdir"; then - $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2 - absdir="$dir" - notinst_path="$notinst_path $dir" - fi - dir="$absdir" - ;; - esac - case "$deplibs " in - *" -L$dir "*) ;; - *) - deplibs="$deplibs -L$dir" - lib_search_path="$lib_search_path $dir" - ;; - esac - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) - testbindir=`$echo "X$dir" | $Xsed -e 's*/lib$*/bin*'` - case :$dllsearchpath: in - *":$dir:"*) ;; - *) dllsearchpath="$dllsearchpath:$dir";; - esac - case :$dllsearchpath: in - *":$testbindir:"*) ;; - *) dllsearchpath="$dllsearchpath:$testbindir";; - esac - ;; - esac - continue - ;; - - -l*) - if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*) - # These systems don't actually have a C or math library (as such) - continue - ;; - *-*-os2*) - # These systems don't actually have a C library (as such) - test "X$arg" = "X-lc" && continue - ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) - # Do not include libc due to us having libc/libc_r. - test "X$arg" = "X-lc" && continue - ;; - *-*-rhapsody* | *-*-darwin1.[012]) - # Rhapsody C and math libraries are in the System framework - deplibs="$deplibs -framework System" - continue - ;; - *-*-sco3.2v5* | *-*-sco5v6*) - # Causes problems with __ctype - test "X$arg" = "X-lc" && continue - ;; - *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) - # Compiler inserts libc in the correct place for threads to work - test "X$arg" = "X-lc" && continue - ;; - esac - elif test "X$arg" = "X-lc_r"; then - case $host in - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) - # Do not include libc_r directly, use -pthread flag. - continue - ;; - esac - fi - deplibs="$deplibs $arg" - continue - ;; - - # Tru64 UNIX uses -model [arg] to determine the layout of C++ - # classes, name mangling, and exception handling. - -model) - compile_command="$compile_command $arg" - compiler_flags="$compiler_flags $arg" - finalize_command="$finalize_command $arg" - prev=xcompiler - continue - ;; - - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) - compiler_flags="$compiler_flags $arg" - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - continue - ;; - - -module) - module=yes - continue - ;; - - # -64, -mips[0-9] enable 64-bit mode on the SGI compiler - # -r[0-9][0-9]* specifies the processor on the SGI compiler - # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler - # +DA*, +DD* enable 64-bit mode on the HP compiler - # -q* pass through compiler args for the IBM compiler - # -m* pass through architecture-specific compiler args for GCC - # -m*, -t[45]*, -txscale* pass through architecture-specific - # compiler args for GCC - # -pg pass through profiling flag for GCC - # @file GCC response files - -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*|-pg| \ - -t[45]*|-txscale*|@*) - - # Unknown arguments in both finalize_command and compile_command need - # to be aesthetically quoted because they are evaled later. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - compiler_flags="$compiler_flags $arg" - continue - ;; - - -shrext) - prev=shrext - continue - ;; - - -no-fast-install) - fast_install=no - continue - ;; - - -no-install) - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) - # The PATH hackery in wrapper scripts is required on Windows - # in order for the loader to find any dlls it needs. - $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 - $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 - fast_install=no - ;; - *) no_install=yes ;; - esac - continue - ;; - - -no-undefined) - allow_undefined=no - continue - ;; - - -objectlist) - prev=objectlist - continue - ;; - - -o) prev=output ;; - - -precious-files-regex) - prev=precious_regex - continue - ;; - - -release) - prev=release - continue - ;; - - -rpath) - prev=rpath - continue - ;; - - -R) - prev=xrpath - continue - ;; - - -R*) - dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - $echo "$modename: only absolute run-paths are allowed" 1>&2 - exit $EXIT_FAILURE - ;; - esac - case "$xrpath " in - *" $dir "*) ;; - *) xrpath="$xrpath $dir" ;; - esac - continue - ;; - - -static | -static-libtool-libs) - # The effects of -static are defined in a previous loop. - # We used to do the same as -all-static on platforms that - # didn't have a PIC flag, but the assumption that the effects - # would be equivalent was wrong. It would break on at least - # Digital Unix and AIX. - continue - ;; - - -thread-safe) - thread_safe=yes - continue - ;; - - -version-info) - prev=vinfo - continue - ;; - -version-number) - prev=vinfo - vinfo_number=yes - continue - ;; - - -Wc,*) - args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'` - arg= - save_ifs="$IFS"; IFS=',' - for flag in $args; do - IFS="$save_ifs" - case $flag in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - flag="\"$flag\"" - ;; - esac - arg="$arg $wl$flag" - compiler_flags="$compiler_flags $flag" - done - IFS="$save_ifs" - arg=`$echo "X$arg" | $Xsed -e "s/^ //"` - ;; - - -Wl,*) - args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'` - arg= - save_ifs="$IFS"; IFS=',' - for flag in $args; do - IFS="$save_ifs" - case $flag in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - flag="\"$flag\"" - ;; - esac - arg="$arg $wl$flag" - compiler_flags="$compiler_flags $wl$flag" - linker_flags="$linker_flags $flag" - done - IFS="$save_ifs" - arg=`$echo "X$arg" | $Xsed -e "s/^ //"` - ;; - - -Xcompiler) - prev=xcompiler - continue - ;; - - -Xlinker) - prev=xlinker - continue - ;; - - -XCClinker) - prev=xcclinker - continue - ;; - - # Some other compiler flag. - -* | +*) - # Unknown arguments in both finalize_command and compile_command need - # to be aesthetically quoted because they are evaled later. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - ;; - - *.$objext) - # A standard object. - objs="$objs $arg" - ;; - - *.lo) - # A libtool-controlled object. - - # Check to see that this really is a libtool object. - if (${SED} -e '2q' $arg | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - pic_object= - non_pic_object= - - # Read the .lo file - # If there is no directory component, then add one. - case $arg in - */* | *\\*) . $arg ;; - *) . ./$arg ;; - esac - - if test -z "$pic_object" || \ - test -z "$non_pic_object" || - test "$pic_object" = none && \ - test "$non_pic_object" = none; then - $echo "$modename: cannot find name of object for \`$arg'" 1>&2 - exit $EXIT_FAILURE - fi - - # Extract subdirectory from the argument. - xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$arg"; then - xdir= - else - xdir="$xdir/" - fi - - if test "$pic_object" != none; then - # Prepend the subdirectory the object is found in. - pic_object="$xdir$pic_object" - - if test "$prev" = dlfiles; then - if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then - dlfiles="$dlfiles $pic_object" - prev= - continue - else - # If libtool objects are unsupported, then we need to preload. - prev=dlprefiles - fi - fi - - # CHECK ME: I think I busted this. -Ossama - if test "$prev" = dlprefiles; then - # Preload the old-style object. - dlprefiles="$dlprefiles $pic_object" - prev= - fi - - # A PIC object. - libobjs="$libobjs $pic_object" - arg="$pic_object" - fi - - # Non-PIC object. - if test "$non_pic_object" != none; then - # Prepend the subdirectory the object is found in. - non_pic_object="$xdir$non_pic_object" - - # A standard non-PIC object - non_pic_objects="$non_pic_objects $non_pic_object" - if test -z "$pic_object" || test "$pic_object" = none ; then - arg="$non_pic_object" - fi - else - # If the PIC object exists, use it instead. - # $xdir was prepended to $pic_object above. - non_pic_object="$pic_object" - non_pic_objects="$non_pic_objects $non_pic_object" - fi - else - # Only an error if not doing a dry-run. - if test -z "$run"; then - $echo "$modename: \`$arg' is not a valid libtool object" 1>&2 - exit $EXIT_FAILURE - else - # Dry-run case. - - # Extract subdirectory from the argument. - xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` - if test "X$xdir" = "X$arg"; then - xdir= - else - xdir="$xdir/" - fi - - pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"` - non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"` - libobjs="$libobjs $pic_object" - non_pic_objects="$non_pic_objects $non_pic_object" - fi - fi - ;; - - *.$libext) - # An archive. - deplibs="$deplibs $arg" - old_deplibs="$old_deplibs $arg" - continue - ;; - - *.la) - # A libtool-controlled library. - - if test "$prev" = dlfiles; then - # This library was specified with -dlopen. - dlfiles="$dlfiles $arg" - prev= - elif test "$prev" = dlprefiles; then - # The library was specified with -dlpreopen. - dlprefiles="$dlprefiles $arg" - prev= - else - deplibs="$deplibs $arg" - fi - continue - ;; - - # Some other compiler argument. - *) - # Unknown arguments in both finalize_command and compile_command need - # to be aesthetically quoted because they are evaled later. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - ;; - esac # arg - - # Now actually substitute the argument into the commands. - if test -n "$arg"; then - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - fi - done # argument parsing loop - - if test -n "$prev"; then - $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then - eval arg=\"$export_dynamic_flag_spec\" - compile_command="$compile_command $arg" - finalize_command="$finalize_command $arg" - fi - - oldlibs= - # calculate the name of the file, without its directory - outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` - libobjs_save="$libobjs" - - if test -n "$shlibpath_var"; then - # get the directories listed in $shlibpath_var - eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` - else - shlib_search_path= - fi - eval sys_lib_search_path=\"$sys_lib_search_path_spec\" - eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" - - output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` - if test "X$output_objdir" = "X$output"; then - output_objdir="$objdir" - else - output_objdir="$output_objdir/$objdir" - fi - # Create the object directory. - if test ! -d "$output_objdir"; then - $show "$mkdir $output_objdir" - $run $mkdir $output_objdir - exit_status=$? - if test "$exit_status" -ne 0 && test ! -d "$output_objdir"; then - exit $exit_status - fi - fi - - # Determine the type of output - case $output in - "") - $echo "$modename: you must specify an output file" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - ;; - *.$libext) linkmode=oldlib ;; - *.lo | *.$objext) linkmode=obj ;; - *.la) linkmode=lib ;; - *) linkmode=prog ;; # Anything else should be a program. - esac - - case $host in - *cygwin* | *mingw* | *pw32*) - # don't eliminate duplications in $postdeps and $predeps - duplicate_compiler_generated_deps=yes - ;; - *) - duplicate_compiler_generated_deps=$duplicate_deps - ;; - esac - specialdeplibs= - - libs= - # Find all interdependent deplibs by searching for libraries - # that are linked more than once (e.g. -la -lb -la) - for deplib in $deplibs; do - if test "X$duplicate_deps" = "Xyes" ; then - case "$libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - fi - libs="$libs $deplib" - done - - if test "$linkmode" = lib; then - libs="$predeps $libs $compiler_lib_search_path $postdeps" - - # Compute libraries that are listed more than once in $predeps - # $postdeps and mark them as special (i.e., whose duplicates are - # not to be eliminated). - pre_post_deps= - if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then - for pre_post_dep in $predeps $postdeps; do - case "$pre_post_deps " in - *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; - esac - pre_post_deps="$pre_post_deps $pre_post_dep" - done - fi - pre_post_deps= - fi - - deplibs= - newdependency_libs= - newlib_search_path= - need_relink=no # whether we're linking any uninstalled libtool libraries - notinst_deplibs= # not-installed libtool libraries - case $linkmode in - lib) - passes="conv link" - for file in $dlfiles $dlprefiles; do - case $file in - *.la) ;; - *) - $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2 - exit $EXIT_FAILURE - ;; - esac - done - ;; - prog) - compile_deplibs= - finalize_deplibs= - alldeplibs=no - newdlfiles= - newdlprefiles= - passes="conv scan dlopen dlpreopen link" - ;; - *) passes="conv" - ;; - esac - for pass in $passes; do - if test "$linkmode,$pass" = "lib,link" || - test "$linkmode,$pass" = "prog,scan"; then - libs="$deplibs" - deplibs= - fi - if test "$linkmode" = prog; then - case $pass in - dlopen) libs="$dlfiles" ;; - dlpreopen) libs="$dlprefiles" ;; - link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; - esac - fi - if test "$pass" = dlopen; then - # Collect dlpreopened libraries - save_deplibs="$deplibs" - deplibs= - fi - for deplib in $libs; do - lib= - found=no - case $deplib in - -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe) - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - compiler_flags="$compiler_flags $deplib" - fi - continue - ;; - -l*) - if test "$linkmode" != lib && test "$linkmode" != prog; then - $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2 - continue - fi - name=`$echo "X$deplib" | $Xsed -e 's/^-l//'` - for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do - for search_ext in .la $std_shrext .so .a; do - # Search the libtool library - lib="$searchdir/lib${name}${search_ext}" - if test -f "$lib"; then - if test "$search_ext" = ".la"; then - found=yes - else - found=no - fi - break 2 - fi - done - done - if test "$found" != yes; then - # deplib doesn't seem to be a libtool library - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" - fi - continue - else # deplib is a libtool library - # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, - # We need to do some special things here, and not later. - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - case " $predeps $postdeps " in - *" $deplib "*) - if (${SED} -e '2q' $lib | - grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - library_names= - old_library= - case $lib in - */* | *\\*) . $lib ;; - *) . ./$lib ;; - esac - for l in $old_library $library_names; do - ll="$l" - done - if test "X$ll" = "X$old_library" ; then # only static version available - found=no - ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` - test "X$ladir" = "X$lib" && ladir="." - lib=$ladir/$old_library - if test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - deplibs="$deplib $deplibs" - test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" - fi - continue - fi - fi - ;; - *) ;; - esac - fi - fi - ;; # -l - -L*) - case $linkmode in - lib) - deplibs="$deplib $deplibs" - test "$pass" = conv && continue - newdependency_libs="$deplib $newdependency_libs" - newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` - ;; - prog) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - continue - fi - if test "$pass" = scan; then - deplibs="$deplib $deplibs" - else - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - fi - newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'` - ;; - *) - $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2 - ;; - esac # linkmode - continue - ;; # -L - -R*) - if test "$pass" = link; then - dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'` - # Make sure the xrpath contains only unique directories. - case "$xrpath " in - *" $dir "*) ;; - *) xrpath="$xrpath $dir" ;; - esac - fi - deplibs="$deplib $deplibs" - continue - ;; - *.la) lib="$deplib" ;; - *.$libext) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - continue - fi - case $linkmode in - lib) - valid_a_lib=no - case $deplibs_check_method in - match_pattern*) - set dummy $deplibs_check_method - match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` - if eval $echo \"$deplib\" 2>/dev/null \ - | $SED 10q \ - | $EGREP "$match_pattern_regex" > /dev/null; then - valid_a_lib=yes - fi - ;; - pass_all) - valid_a_lib=yes - ;; - esac - if test "$valid_a_lib" != yes; then - $echo - $echo "*** Warning: Trying to link with static lib archive $deplib." - $echo "*** I have the capability to make that library automatically link in when" - $echo "*** you link to this library. But I can only do this if you have a" - $echo "*** shared version of the library, which you do not appear to have" - $echo "*** because the file extensions .$libext of this argument makes me believe" - $echo "*** that it is just a static archive that I should not used here." - else - $echo - $echo "*** Warning: Linking the shared library $output against the" - $echo "*** static library $deplib is not portable!" - deplibs="$deplib $deplibs" - fi - continue - ;; - prog) - if test "$pass" != link; then - deplibs="$deplib $deplibs" - else - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - fi - continue - ;; - esac # linkmode - ;; # *.$libext - *.lo | *.$objext) - if test "$pass" = conv; then - deplibs="$deplib $deplibs" - elif test "$linkmode" = prog; then - if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then - # If there is no dlopen support or we're linking statically, - # we need to preload. - newdlprefiles="$newdlprefiles $deplib" - compile_deplibs="$deplib $compile_deplibs" - finalize_deplibs="$deplib $finalize_deplibs" - else - newdlfiles="$newdlfiles $deplib" - fi - fi - continue - ;; - %DEPLIBS%) - alldeplibs=yes - continue - ;; - esac # case $deplib - if test "$found" = yes || test -f "$lib"; then : - else - $echo "$modename: cannot find the library \`$lib' or unhandled argument \`$deplib'" 1>&2 - exit $EXIT_FAILURE - fi - - # Check to see that this really is a libtool archive. - if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : - else - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - exit $EXIT_FAILURE - fi - - ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'` - test "X$ladir" = "X$lib" && ladir="." - - dlname= - dlopen= - dlpreopen= - libdir= - library_names= - old_library= - # If the library was installed with an old release of libtool, - # it will not redefine variables installed, or shouldnotlink - installed=yes - shouldnotlink=no - avoidtemprpath= - - - # Read the .la file - case $lib in - */* | *\\*) . $lib ;; - *) . ./$lib ;; - esac - - if test "$linkmode,$pass" = "lib,link" || - test "$linkmode,$pass" = "prog,scan" || - { test "$linkmode" != prog && test "$linkmode" != lib; }; then - test -n "$dlopen" && dlfiles="$dlfiles $dlopen" - test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" - fi - - if test "$pass" = conv; then - # Only check for convenience libraries - deplibs="$lib $deplibs" - if test -z "$libdir"; then - if test -z "$old_library"; then - $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 - exit $EXIT_FAILURE - fi - # It is a libtool convenience library, so add in its objects. - convenience="$convenience $ladir/$objdir/$old_library" - old_convenience="$old_convenience $ladir/$objdir/$old_library" - tmp_libs= - for deplib in $dependency_libs; do - deplibs="$deplib $deplibs" - if test "X$duplicate_deps" = "Xyes" ; then - case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - fi - tmp_libs="$tmp_libs $deplib" - done - elif test "$linkmode" != prog && test "$linkmode" != lib; then - $echo "$modename: \`$lib' is not a convenience library" 1>&2 - exit $EXIT_FAILURE - fi - continue - fi # $pass = conv - - - # Get the name of the library we link against. - linklib= - for l in $old_library $library_names; do - linklib="$l" - done - if test -z "$linklib"; then - $echo "$modename: cannot find name of link library for \`$lib'" 1>&2 - exit $EXIT_FAILURE - fi - - # This library was specified with -dlopen. - if test "$pass" = dlopen; then - if test -z "$libdir"; then - $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2 - exit $EXIT_FAILURE - fi - if test -z "$dlname" || - test "$dlopen_support" != yes || - test "$build_libtool_libs" = no; then - # If there is no dlname, no dlopen support or we're linking - # statically, we need to preload. We also need to preload any - # dependent libraries so libltdl's deplib preloader doesn't - # bomb out in the load deplibs phase. - dlprefiles="$dlprefiles $lib $dependency_libs" - else - newdlfiles="$newdlfiles $lib" - fi - continue - fi # $pass = dlopen - - # We need an absolute path. - case $ladir in - [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; - *) - abs_ladir=`cd "$ladir" && pwd` - if test -z "$abs_ladir"; then - $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2 - $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 - abs_ladir="$ladir" - fi - ;; - esac - laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` - - # Find the relevant object directory and library name. - if test "X$installed" = Xyes; then - if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then - $echo "$modename: warning: library \`$lib' was moved." 1>&2 - dir="$ladir" - absdir="$abs_ladir" - libdir="$abs_ladir" - else - dir="$libdir" - absdir="$libdir" - fi - test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes - else - if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then - dir="$ladir" - absdir="$abs_ladir" - # Remove this search path later - notinst_path="$notinst_path $abs_ladir" - else - dir="$ladir/$objdir" - absdir="$abs_ladir/$objdir" - # Remove this search path later - notinst_path="$notinst_path $abs_ladir" - fi - fi # $installed = yes - name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` - - # This library was specified with -dlpreopen. - if test "$pass" = dlpreopen; then - if test -z "$libdir"; then - $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2 - exit $EXIT_FAILURE - fi - # Prefer using a static library (so that no silly _DYNAMIC symbols - # are required to link). - if test -n "$old_library"; then - newdlprefiles="$newdlprefiles $dir/$old_library" - # Otherwise, use the dlname, so that lt_dlopen finds it. - elif test -n "$dlname"; then - newdlprefiles="$newdlprefiles $dir/$dlname" - else - newdlprefiles="$newdlprefiles $dir/$linklib" - fi - fi # $pass = dlpreopen - - if test -z "$libdir"; then - # Link the convenience library - if test "$linkmode" = lib; then - deplibs="$dir/$old_library $deplibs" - elif test "$linkmode,$pass" = "prog,link"; then - compile_deplibs="$dir/$old_library $compile_deplibs" - finalize_deplibs="$dir/$old_library $finalize_deplibs" - else - deplibs="$lib $deplibs" # used for prog,scan pass - fi - continue - fi - - - if test "$linkmode" = prog && test "$pass" != link; then - newlib_search_path="$newlib_search_path $ladir" - deplibs="$lib $deplibs" - - linkalldeplibs=no - if test "$link_all_deplibs" != no || test -z "$library_names" || - test "$build_libtool_libs" = no; then - linkalldeplibs=yes - fi - - tmp_libs= - for deplib in $dependency_libs; do - case $deplib in - -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test - esac - # Need to link against all dependency_libs? - if test "$linkalldeplibs" = yes; then - deplibs="$deplib $deplibs" - else - # Need to hardcode shared library paths - # or/and link against static libraries - newdependency_libs="$deplib $newdependency_libs" - fi - if test "X$duplicate_deps" = "Xyes" ; then - case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - fi - tmp_libs="$tmp_libs $deplib" - done # for deplib - continue - fi # $linkmode = prog... - - if test "$linkmode,$pass" = "prog,link"; then - if test -n "$library_names" && - { { test "$prefer_static_libs" = no || - test "$prefer_static_libs,$installed" = "built,yes"; } || - test -z "$old_library"; }; then - # We need to hardcode the library path - if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then - # Make sure the rpath contains only unique directories. - case "$temp_rpath " in - *" $dir "*) ;; - *" $absdir "*) ;; - *) temp_rpath="$temp_rpath $absdir" ;; - esac - fi - - # Hardcode the library path. - # Skip directories that are in the system default run-time - # search path. - case " $sys_lib_dlsearch_path " in - *" $absdir "*) ;; - *) - case "$compile_rpath " in - *" $absdir "*) ;; - *) compile_rpath="$compile_rpath $absdir" - esac - ;; - esac - case " $sys_lib_dlsearch_path " in - *" $libdir "*) ;; - *) - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" - esac - ;; - esac - fi # $linkmode,$pass = prog,link... - - if test "$alldeplibs" = yes && - { test "$deplibs_check_method" = pass_all || - { test "$build_libtool_libs" = yes && - test -n "$library_names"; }; }; then - # We only need to search for static libraries - continue - fi - fi - - link_static=no # Whether the deplib will be linked statically - use_static_libs=$prefer_static_libs - if test "$use_static_libs" = built && test "$installed" = yes ; then - use_static_libs=no - fi - if test -n "$library_names" && - { test "$use_static_libs" = no || test -z "$old_library"; }; then - if test "$installed" = no; then - notinst_deplibs="$notinst_deplibs $lib" - need_relink=yes - fi - # This is a shared library - - # Warn about portability, can't link against -module's on - # some systems (darwin) - if test "$shouldnotlink" = yes && test "$pass" = link ; then - $echo - if test "$linkmode" = prog; then - $echo "*** Warning: Linking the executable $output against the loadable module" - else - $echo "*** Warning: Linking the shared library $output against the loadable module" - fi - $echo "*** $linklib is not portable!" - fi - if test "$linkmode" = lib && - test "$hardcode_into_libs" = yes; then - # Hardcode the library path. - # Skip directories that are in the system default run-time - # search path. - case " $sys_lib_dlsearch_path " in - *" $absdir "*) ;; - *) - case "$compile_rpath " in - *" $absdir "*) ;; - *) compile_rpath="$compile_rpath $absdir" - esac - ;; - esac - case " $sys_lib_dlsearch_path " in - *" $libdir "*) ;; - *) - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" - esac - ;; - esac - fi - - if test -n "$old_archive_from_expsyms_cmds"; then - # figure out the soname - set dummy $library_names - realname="$2" - shift; shift - libname=`eval \\$echo \"$libname_spec\"` - # use dlname if we got it. it's perfectly good, no? - if test -n "$dlname"; then - soname="$dlname" - elif test -n "$soname_spec"; then - # bleh windows - case $host in - *cygwin* | mingw*) - major=`expr $current - $age` - versuffix="-$major" - ;; - esac - eval soname=\"$soname_spec\" - else - soname="$realname" - fi - - # Make a new name for the extract_expsyms_cmds to use - soroot="$soname" - soname=`$echo $soroot | ${SED} -e 's/^.*\///'` - newlib="libimp-`$echo $soname | ${SED} 's/^lib//;s/\.dll$//'`.a" - - # If the library has no export list, then create one now - if test -f "$output_objdir/$soname-def"; then : - else - $show "extracting exported symbol list from \`$soname'" - save_ifs="$IFS"; IFS='~' - cmds=$extract_expsyms_cmds - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - fi - - # Create $newlib - if test -f "$output_objdir/$newlib"; then :; else - $show "generating import library for \`$soname'" - save_ifs="$IFS"; IFS='~' - cmds=$old_archive_from_expsyms_cmds - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - fi - # make sure the library variables are pointing to the new library - dir=$output_objdir - linklib=$newlib - fi # test -n "$old_archive_from_expsyms_cmds" - - if test "$linkmode" = prog || test "$mode" != relink; then - add_shlibpath= - add_dir= - add= - lib_linked=yes - case $hardcode_action in - immediate | unsupported) - if test "$hardcode_direct" = no; then - add="$dir/$linklib" - case $host in - *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; - *-*-sysv4*uw2*) add_dir="-L$dir" ;; - *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ - *-*-unixware7*) add_dir="-L$dir" ;; - *-*-darwin* ) - # if the lib is a module then we can not link against - # it, someone is ignoring the new warnings I added - if /usr/bin/file -L $add 2> /dev/null | - $EGREP ": [^:]* bundle" >/dev/null ; then - $echo "** Warning, lib $linklib is a module, not a shared library" - if test -z "$old_library" ; then - $echo - $echo "** And there doesn't seem to be a static archive available" - $echo "** The link will probably fail, sorry" - else - add="$dir/$old_library" - fi - fi - esac - elif test "$hardcode_minus_L" = no; then - case $host in - *-*-sunos*) add_shlibpath="$dir" ;; - esac - add_dir="-L$dir" - add="-l$name" - elif test "$hardcode_shlibpath_var" = no; then - add_shlibpath="$dir" - add="-l$name" - else - lib_linked=no - fi - ;; - relink) - if test "$hardcode_direct" = yes; then - add="$dir/$linklib" - elif test "$hardcode_minus_L" = yes; then - add_dir="-L$dir" - # Try looking first in the location we're being installed to. - if test -n "$inst_prefix_dir"; then - case $libdir in - [\\/]*) - add_dir="$add_dir -L$inst_prefix_dir$libdir" - ;; - esac - fi - add="-l$name" - elif test "$hardcode_shlibpath_var" = yes; then - add_shlibpath="$dir" - add="-l$name" - else - lib_linked=no - fi - ;; - *) lib_linked=no ;; - esac - - if test "$lib_linked" != yes; then - $echo "$modename: configuration error: unsupported hardcode properties" - exit $EXIT_FAILURE - fi - - if test -n "$add_shlibpath"; then - case :$compile_shlibpath: in - *":$add_shlibpath:"*) ;; - *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; - esac - fi - if test "$linkmode" = prog; then - test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" - test -n "$add" && compile_deplibs="$add $compile_deplibs" - else - test -n "$add_dir" && deplibs="$add_dir $deplibs" - test -n "$add" && deplibs="$add $deplibs" - if test "$hardcode_direct" != yes && \ - test "$hardcode_minus_L" != yes && \ - test "$hardcode_shlibpath_var" = yes; then - case :$finalize_shlibpath: in - *":$libdir:"*) ;; - *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; - esac - fi - fi - fi - - if test "$linkmode" = prog || test "$mode" = relink; then - add_shlibpath= - add_dir= - add= - # Finalize command for both is simple: just hardcode it. - if test "$hardcode_direct" = yes; then - add="$libdir/$linklib" - elif test "$hardcode_minus_L" = yes; then - add_dir="-L$libdir" - add="-l$name" - elif test "$hardcode_shlibpath_var" = yes; then - case :$finalize_shlibpath: in - *":$libdir:"*) ;; - *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; - esac - add="-l$name" - elif test "$hardcode_automatic" = yes; then - if test -n "$inst_prefix_dir" && - test -f "$inst_prefix_dir$libdir/$linklib" ; then - add="$inst_prefix_dir$libdir/$linklib" - else - add="$libdir/$linklib" - fi - else - # We cannot seem to hardcode it, guess we'll fake it. - add_dir="-L$libdir" - # Try looking first in the location we're being installed to. - if test -n "$inst_prefix_dir"; then - case $libdir in - [\\/]*) - add_dir="$add_dir -L$inst_prefix_dir$libdir" - ;; - esac - fi - add="-l$name" - fi - - if test "$linkmode" = prog; then - test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" - test -n "$add" && finalize_deplibs="$add $finalize_deplibs" - else - test -n "$add_dir" && deplibs="$add_dir $deplibs" - test -n "$add" && deplibs="$add $deplibs" - fi - fi - elif test "$linkmode" = prog; then - # Here we assume that one of hardcode_direct or hardcode_minus_L - # is not unsupported. This is valid on all known static and - # shared platforms. - if test "$hardcode_direct" != unsupported; then - test -n "$old_library" && linklib="$old_library" - compile_deplibs="$dir/$linklib $compile_deplibs" - finalize_deplibs="$dir/$linklib $finalize_deplibs" - else - compile_deplibs="-l$name -L$dir $compile_deplibs" - finalize_deplibs="-l$name -L$dir $finalize_deplibs" - fi - elif test "$build_libtool_libs" = yes; then - # Not a shared library - if test "$deplibs_check_method" != pass_all; then - # We're trying link a shared library against a static one - # but the system doesn't support it. - - # Just print a warning and add the library to dependency_libs so - # that the program can be linked against the static library. - $echo - $echo "*** Warning: This system can not link to static lib archive $lib." - $echo "*** I have the capability to make that library automatically link in when" - $echo "*** you link to this library. But I can only do this if you have a" - $echo "*** shared version of the library, which you do not appear to have." - if test "$module" = yes; then - $echo "*** But as you try to build a module library, libtool will still create " - $echo "*** a static module, that should work as long as the dlopening application" - $echo "*** is linked with the -dlopen flag to resolve symbols at runtime." - if test -z "$global_symbol_pipe"; then - $echo - $echo "*** However, this would only work if libtool was able to extract symbol" - $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" - $echo "*** not find such a program. So, this module is probably useless." - $echo "*** \`nm' from GNU binutils and a full rebuild may help." - fi - if test "$build_old_libs" = no; then - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - fi - else - deplibs="$dir/$old_library $deplibs" - link_static=yes - fi - fi # link shared/static library? - - if test "$linkmode" = lib; then - if test -n "$dependency_libs" && - { test "$hardcode_into_libs" != yes || - test "$build_old_libs" = yes || - test "$link_static" = yes; }; then - # Extract -R from dependency_libs - temp_deplibs= - for libdir in $dependency_libs; do - case $libdir in - -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'` - case " $xrpath " in - *" $temp_xrpath "*) ;; - *) xrpath="$xrpath $temp_xrpath";; - esac;; - *) temp_deplibs="$temp_deplibs $libdir";; - esac - done - dependency_libs="$temp_deplibs" - fi - - newlib_search_path="$newlib_search_path $absdir" - # Link against this library - test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" - # ... and its dependency_libs - tmp_libs= - for deplib in $dependency_libs; do - newdependency_libs="$deplib $newdependency_libs" - if test "X$duplicate_deps" = "Xyes" ; then - case "$tmp_libs " in - *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; - esac - fi - tmp_libs="$tmp_libs $deplib" - done - - if test "$link_all_deplibs" != no; then - # Add the search paths of all dependency libraries - for deplib in $dependency_libs; do - case $deplib in - -L*) path="$deplib" ;; - *.la) - dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'` - test "X$dir" = "X$deplib" && dir="." - # We need an absolute path. - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; - *) - absdir=`cd "$dir" && pwd` - if test -z "$absdir"; then - $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 - absdir="$dir" - fi - ;; - esac - if grep "^installed=no" $deplib > /dev/null; then - path="$absdir/$objdir" - else - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` - if test -z "$libdir"; then - $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 - exit $EXIT_FAILURE - fi - if test "$absdir" != "$libdir"; then - $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2 - fi - path="$absdir" - fi - depdepl= - case $host in - *-*-darwin*) - # we do not want to link against static libs, - # but need to link against shared - eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` - if test -n "$deplibrary_names" ; then - for tmp in $deplibrary_names ; do - depdepl=$tmp - done - if test -f "$path/$depdepl" ; then - depdepl="$path/$depdepl" - fi - # do not add paths which are already there - case " $newlib_search_path " in - *" $path "*) ;; - *) newlib_search_path="$newlib_search_path $path";; - esac - fi - path="" - ;; - *) - path="-L$path" - ;; - esac - ;; - -l*) - case $host in - *-*-darwin*) - # Again, we only want to link against shared libraries - eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"` - for tmp in $newlib_search_path ; do - if test -f "$tmp/lib$tmp_libs.dylib" ; then - eval depdepl="$tmp/lib$tmp_libs.dylib" - break - fi - done - path="" - ;; - *) continue ;; - esac - ;; - *) continue ;; - esac - case " $deplibs " in - *" $path "*) ;; - *) deplibs="$path $deplibs" ;; - esac - case " $deplibs " in - *" $depdepl "*) ;; - *) deplibs="$depdepl $deplibs" ;; - esac - done - fi # link_all_deplibs != no - fi # linkmode = lib - done # for deplib in $libs - dependency_libs="$newdependency_libs" - if test "$pass" = dlpreopen; then - # Link the dlpreopened libraries before other libraries - for deplib in $save_deplibs; do - deplibs="$deplib $deplibs" - done - fi - if test "$pass" != dlopen; then - if test "$pass" != conv; then - # Make sure lib_search_path contains only unique directories. - lib_search_path= - for dir in $newlib_search_path; do - case "$lib_search_path " in - *" $dir "*) ;; - *) lib_search_path="$lib_search_path $dir" ;; - esac - done - newlib_search_path= - fi - - if test "$linkmode,$pass" != "prog,link"; then - vars="deplibs" - else - vars="compile_deplibs finalize_deplibs" - fi - for var in $vars dependency_libs; do - # Add libraries to $var in reverse order - eval tmp_libs=\"\$$var\" - new_libs= - for deplib in $tmp_libs; do - # FIXME: Pedantically, this is the right thing to do, so - # that some nasty dependency loop isn't accidentally - # broken: - #new_libs="$deplib $new_libs" - # Pragmatically, this seems to cause very few problems in - # practice: - case $deplib in - -L*) new_libs="$deplib $new_libs" ;; - -R*) ;; - *) - # And here is the reason: when a library appears more - # than once as an explicit dependence of a library, or - # is implicitly linked in more than once by the - # compiler, it is considered special, and multiple - # occurrences thereof are not removed. Compare this - # with having the same library being listed as a - # dependency of multiple other libraries: in this case, - # we know (pedantically, we assume) the library does not - # need to be listed more than once, so we keep only the - # last copy. This is not always right, but it is rare - # enough that we require users that really mean to play - # such unportable linking tricks to link the library - # using -Wl,-lname, so that libtool does not consider it - # for duplicate removal. - case " $specialdeplibs " in - *" $deplib "*) new_libs="$deplib $new_libs" ;; - *) - case " $new_libs " in - *" $deplib "*) ;; - *) new_libs="$deplib $new_libs" ;; - esac - ;; - esac - ;; - esac - done - tmp_libs= - for deplib in $new_libs; do - case $deplib in - -L*) - case " $tmp_libs " in - *" $deplib "*) ;; - *) tmp_libs="$tmp_libs $deplib" ;; - esac - ;; - *) tmp_libs="$tmp_libs $deplib" ;; - esac - done - eval $var=\"$tmp_libs\" - done # for var - fi - # Last step: remove runtime libs from dependency_libs - # (they stay in deplibs) - tmp_libs= - for i in $dependency_libs ; do - case " $predeps $postdeps $compiler_lib_search_path " in - *" $i "*) - i="" - ;; - esac - if test -n "$i" ; then - tmp_libs="$tmp_libs $i" - fi - done - dependency_libs=$tmp_libs - done # for pass - if test "$linkmode" = prog; then - dlfiles="$newdlfiles" - dlprefiles="$newdlprefiles" - fi - - case $linkmode in - oldlib) - if test -n "$deplibs"; then - $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 - fi - - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 - fi - - if test -n "$rpath"; then - $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 - fi - - if test -n "$xrpath"; then - $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 - fi - - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 - fi - - if test -n "$export_symbols" || test -n "$export_symbols_regex"; then - $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 - fi - - # Now set the variables for building old libraries. - build_libtool_libs=no - oldlibs="$output" - objs="$objs$old_deplibs" - ;; - - lib) - # Make sure we only generate libraries of the form `libNAME.la'. - case $outputname in - lib*) - name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` - eval shared_ext=\"$shrext_cmds\" - eval libname=\"$libname_spec\" - ;; - *) - if test "$module" = no; then - $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - if test "$need_lib_prefix" != no; then - # Add the "lib" prefix for modules if required - name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` - eval shared_ext=\"$shrext_cmds\" - eval libname=\"$libname_spec\" - else - libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` - fi - ;; - esac - - if test -n "$objs"; then - if test "$deplibs_check_method" != pass_all; then - $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1 - exit $EXIT_FAILURE - else - $echo - $echo "*** Warning: Linking the shared library $output against the non-libtool" - $echo "*** objects $objs is not portable!" - libobjs="$libobjs $objs" - fi - fi - - if test "$dlself" != no; then - $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2 - fi - - set dummy $rpath - if test "$#" -gt 2; then - $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 - fi - install_libdir="$2" - - oldlibs= - if test -z "$rpath"; then - if test "$build_libtool_libs" = yes; then - # Building a libtool convenience library. - # Some compilers have problems with a `.al' extension so - # convenience libraries should have the same extension an - # archive normally would. - oldlibs="$output_objdir/$libname.$libext $oldlibs" - build_libtool_libs=convenience - build_old_libs=yes - fi - - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 - fi - else - - # Parse the version information argument. - save_ifs="$IFS"; IFS=':' - set dummy $vinfo 0 0 0 - IFS="$save_ifs" - - if test -n "$8"; then - $echo "$modename: too many parameters to \`-version-info'" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # convert absolute version numbers to libtool ages - # this retains compatibility with .la files and attempts - # to make the code below a bit more comprehensible - - case $vinfo_number in - yes) - number_major="$2" - number_minor="$3" - number_revision="$4" - # - # There are really only two kinds -- those that - # use the current revision as the major version - # and those that subtract age and use age as - # a minor version. But, then there is irix - # which has an extra 1 added just for fun - # - case $version_type in - darwin|linux|osf|windows|none) - current=`expr $number_major + $number_minor` - age="$number_minor" - revision="$number_revision" - ;; - freebsd-aout|freebsd-elf|sunos) - current="$number_major" - revision="$number_minor" - age="0" - ;; - irix|nonstopux) - current=`expr $number_major + $number_minor - 1` - age="$number_minor" - revision="$number_minor" - ;; - esac - ;; - no) - current="$2" - revision="$3" - age="$4" - ;; - esac - - # Check that each of the things are valid numbers. - case $current in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - $echo "$modename: CURRENT \`$current' must be a nonnegative integer" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - case $revision in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - $echo "$modename: REVISION \`$revision' must be a nonnegative integer" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - case $age in - 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; - *) - $echo "$modename: AGE \`$age' must be a nonnegative integer" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - if test "$age" -gt "$current"; then - $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 - $echo "$modename: \`$vinfo' is not valid version information" 1>&2 - exit $EXIT_FAILURE - fi - - # Calculate the version variables. - major= - versuffix= - verstring= - case $version_type in - none) ;; - - darwin) - # Like Linux, but with the current version available in - # verstring for coding it into the library header - major=.`expr $current - $age` - versuffix="$major.$age.$revision" - # Darwin ld doesn't like 0 for these options... - minor_current=`expr $current + 1` - verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" - ;; - - freebsd-aout) - major=".$current" - versuffix=".$current.$revision"; - ;; - - freebsd-elf) - major=".$current" - versuffix=".$current"; - ;; - - irix | nonstopux) - major=`expr $current - $age + 1` - - case $version_type in - nonstopux) verstring_prefix=nonstopux ;; - *) verstring_prefix=sgi ;; - esac - verstring="$verstring_prefix$major.$revision" - - # Add in all the interfaces that we are compatible with. - loop=$revision - while test "$loop" -ne 0; do - iface=`expr $revision - $loop` - loop=`expr $loop - 1` - verstring="$verstring_prefix$major.$iface:$verstring" - done - - # Before this point, $major must not contain `.'. - major=.$major - versuffix="$major.$revision" - ;; - - linux) - major=.`expr $current - $age` - versuffix="$major.$age.$revision" - ;; - - osf) - major=.`expr $current - $age` - versuffix=".$current.$age.$revision" - verstring="$current.$age.$revision" - - # Add in all the interfaces that we are compatible with. - loop=$age - while test "$loop" -ne 0; do - iface=`expr $current - $loop` - loop=`expr $loop - 1` - verstring="$verstring:${iface}.0" - done - - # Make executables depend on our current version. - verstring="$verstring:${current}.0" - ;; - - sunos) - major=".$current" - versuffix=".$current.$revision" - ;; - - windows) - # Use '-' rather than '.', since we only want one - # extension on DOS 8.3 filesystems. - major=`expr $current - $age` - versuffix="-$major" - ;; - - *) - $echo "$modename: unknown library version type \`$version_type'" 1>&2 - $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 - exit $EXIT_FAILURE - ;; - esac - - # Clear the version info if we defaulted, and they specified a release. - if test -z "$vinfo" && test -n "$release"; then - major= - case $version_type in - darwin) - # we can't check for "0.0" in archive_cmds due to quoting - # problems, so we reset it completely - verstring= - ;; - *) - verstring="0.0" - ;; - esac - if test "$need_version" = no; then - versuffix= - else - versuffix=".0.0" - fi - fi - - # Remove version info from name if versioning should be avoided - if test "$avoid_version" = yes && test "$need_version" = no; then - major= - versuffix= - verstring="" - fi - - # Check to see if the archive will have undefined symbols. - if test "$allow_undefined" = yes; then - if test "$allow_undefined_flag" = unsupported; then - $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 - build_libtool_libs=no - build_old_libs=yes - fi - else - # Don't allow undefined symbols. - allow_undefined_flag="$no_undefined_flag" - fi - fi - - if test "$mode" != relink; then - # Remove our outputs, but don't remove object files since they - # may have been created when compiling PIC objects. - removelist= - tempremovelist=`$echo "$output_objdir/*"` - for p in $tempremovelist; do - case $p in - *.$objext) - ;; - $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) - if test "X$precious_files_regex" != "X"; then - if echo $p | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 - then - continue - fi - fi - removelist="$removelist $p" - ;; - *) ;; - esac - done - if test -n "$removelist"; then - $show "${rm}r $removelist" - $run ${rm}r $removelist - fi - fi - - # Now set the variables for building old libraries. - if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then - oldlibs="$oldlibs $output_objdir/$libname.$libext" - - # Transform .lo files to .o files. - oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` - fi - - # Eliminate all temporary directories. -# for path in $notinst_path; do -# lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"` -# deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"` -# dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"` -# done - - if test -n "$xrpath"; then - # If the user specified any rpath flags, then add them. - temp_xrpath= - for libdir in $xrpath; do - temp_xrpath="$temp_xrpath -R$libdir" - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" ;; - esac - done - if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then - dependency_libs="$temp_xrpath $dependency_libs" - fi - fi - - # Make sure dlfiles contains only unique files that won't be dlpreopened - old_dlfiles="$dlfiles" - dlfiles= - for lib in $old_dlfiles; do - case " $dlprefiles $dlfiles " in - *" $lib "*) ;; - *) dlfiles="$dlfiles $lib" ;; - esac - done - - # Make sure dlprefiles contains only unique files - old_dlprefiles="$dlprefiles" - dlprefiles= - for lib in $old_dlprefiles; do - case "$dlprefiles " in - *" $lib "*) ;; - *) dlprefiles="$dlprefiles $lib" ;; - esac - done - - if test "$build_libtool_libs" = yes; then - if test -n "$rpath"; then - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) - # these systems don't actually have a c library (as such)! - ;; - *-*-rhapsody* | *-*-darwin1.[012]) - # Rhapsody C library is in the System framework - deplibs="$deplibs -framework System" - ;; - *-*-netbsd*) - # Don't link with libc until the a.out ld.so is fixed. - ;; - *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) - # Do not include libc due to us having libc/libc_r. - ;; - *-*-sco3.2v5* | *-*-sco5v6*) - # Causes problems with __ctype - ;; - *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) - # Compiler inserts libc in the correct place for threads to work - ;; - *) - # Add libc to deplibs on all other systems if necessary. - if test "$build_libtool_need_lc" = "yes"; then - deplibs="$deplibs -lc" - fi - ;; - esac - fi - - # Transform deplibs into only deplibs that can be linked in shared. - name_save=$name - libname_save=$libname - release_save=$release - versuffix_save=$versuffix - major_save=$major - # I'm not sure if I'm treating the release correctly. I think - # release should show up in the -l (ie -lgmp5) so we don't want to - # add it in twice. Is that correct? - release="" - versuffix="" - major="" - newdeplibs= - droppeddeps=no - case $deplibs_check_method in - pass_all) - # Don't check for shared/static. Everything works. - # This might be a little naive. We might want to check - # whether the library exists or not. But this is on - # osf3 & osf4 and I'm not really sure... Just - # implementing what was already the behavior. - newdeplibs=$deplibs - ;; - test_compile) - # This code stresses the "libraries are programs" paradigm to its - # limits. Maybe even breaks it. We compile a program, linking it - # against the deplibs as a proxy for the library. Then we can check - # whether they linked in statically or dynamically with ldd. - $rm conftest.c - cat > conftest.c <<EOF - int main() { return 0; } -EOF - $rm conftest - if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then - ldd_output=`ldd conftest` - for i in $deplibs; do - name=`expr $i : '-l\(.*\)'` - # If $name is empty we are operating on a -L argument. - if test "$name" != "" && test "$name" != "0"; then - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - case " $predeps $postdeps " in - *" $i "*) - newdeplibs="$newdeplibs $i" - i="" - ;; - esac - fi - if test -n "$i" ; then - libname=`eval \\$echo \"$libname_spec\"` - deplib_matches=`eval \\$echo \"$library_names_spec\"` - set dummy $deplib_matches - deplib_match=$2 - if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then - newdeplibs="$newdeplibs $i" - else - droppeddeps=yes - $echo - $echo "*** Warning: dynamic linker does not accept needed library $i." - $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 I believe you do not have" - $echo "*** because a test_compile did reveal that the linker did not use it for" - $echo "*** its dynamic dependency list that programs get resolved with at runtime." - fi - fi - else - newdeplibs="$newdeplibs $i" - fi - done - else - # Error occurred in the first compile. Let's try to salvage - # the situation: Compile a separate program for each library. - for i in $deplibs; do - name=`expr $i : '-l\(.*\)'` - # If $name is empty we are operating on a -L argument. - if test "$name" != "" && test "$name" != "0"; then - $rm conftest - if $LTCC $LTCFLAGS -o conftest conftest.c $i; then - ldd_output=`ldd conftest` - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - case " $predeps $postdeps " in - *" $i "*) - newdeplibs="$newdeplibs $i" - i="" - ;; - esac - fi - if test -n "$i" ; then - libname=`eval \\$echo \"$libname_spec\"` - deplib_matches=`eval \\$echo \"$library_names_spec\"` - set dummy $deplib_matches - deplib_match=$2 - if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then - newdeplibs="$newdeplibs $i" - else - droppeddeps=yes - $echo - $echo "*** Warning: dynamic linker does not accept needed library $i." - $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 a test_compile did reveal that the linker did not use this one" - $echo "*** as a dynamic dependency that programs can get resolved with at runtime." - fi - fi - else - droppeddeps=yes - $echo - $echo "*** Warning! Library $i is needed by this library but I was not able to" - $echo "*** make it link in! You will probably need to install it or some" - $echo "*** library that it depends on before this library will be fully" - $echo "*** functional. Installing it before continuing would be even better." - fi - else - newdeplibs="$newdeplibs $i" - fi - done - fi - ;; - file_magic*) - set dummy $deplibs_check_method - file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` - for a_deplib in $deplibs; do - name=`expr $a_deplib : '-l\(.*\)'` - # If $name is empty we are operating on a -L argument. - if test "$name" != "" && test "$name" != "0"; then - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - case " $predeps $postdeps " in - *" $a_deplib "*) - newdeplibs="$newdeplibs $a_deplib" - a_deplib="" - ;; - esac - fi - if test -n "$a_deplib" ; then - libname=`eval \\$echo \"$libname_spec\"` - for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do - potential_libs=`ls $i/$libname[.-]* 2>/dev/null` - for potent_lib in $potential_libs; do - # Follow soft links. - if ls -lLd "$potent_lib" 2>/dev/null \ - | grep " -> " >/dev/null; then - continue - fi - # The statement above tries to avoid entering an - # endless loop below, in case of cyclic links. - # We might still enter an endless loop, since a link - # loop can be closed while we follow links, - # but so what? - potlib="$potent_lib" - while test -h "$potlib" 2>/dev/null; do - potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` - case $potliblink in - [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; - *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; - esac - done - if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ - | ${SED} 10q \ - | $EGREP "$file_magic_regex" > /dev/null; then - newdeplibs="$newdeplibs $a_deplib" - a_deplib="" - break 2 - fi - done - done - fi - if test -n "$a_deplib" ; then - droppeddeps=yes - $echo - $echo "*** Warning: linker path does not have real file for library $a_deplib." - $echo "*** I have the capability to make that library automatically link in when" - $echo "*** you link to this library. But I can only do this if you have a" - $echo "*** shared version of the library, which you do not appear to have" - $echo "*** because I did check the linker path looking for a file starting" - if test -z "$potlib" ; then - $echo "*** with $libname but no candidates were found. (...for file magic test)" - else - $echo "*** with $libname and none of the candidates passed a file format test" - $echo "*** using a file magic. Last file checked: $potlib" - fi - fi - else - # Add a -L argument. - newdeplibs="$newdeplibs $a_deplib" - fi - done # Gone through all deplibs. - ;; - match_pattern*) - set dummy $deplibs_check_method - match_pattern_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"` - for a_deplib in $deplibs; do - name=`expr $a_deplib : '-l\(.*\)'` - # If $name is empty we are operating on a -L argument. - if test -n "$name" && test "$name" != "0"; then - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - case " $predeps $postdeps " in - *" $a_deplib "*) - newdeplibs="$newdeplibs $a_deplib" - a_deplib="" - ;; - esac - fi - if test -n "$a_deplib" ; then - libname=`eval \\$echo \"$libname_spec\"` - for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do - potential_libs=`ls $i/$libname[.-]* 2>/dev/null` - for potent_lib in $potential_libs; do - potlib="$potent_lib" # see symlink-check above in file_magic test - if eval $echo \"$potent_lib\" 2>/dev/null \ - | ${SED} 10q \ - | $EGREP "$match_pattern_regex" > /dev/null; then - newdeplibs="$newdeplibs $a_deplib" - a_deplib="" - break 2 - fi - done - done - fi - if test -n "$a_deplib" ; then - droppeddeps=yes - $echo - $echo "*** Warning: linker path does not have real file for library $a_deplib." - $echo "*** I have the capability to make that library automatically link in when" - $echo "*** you link to this library. But I can only do this if you have a" - $echo "*** shared version of the library, which you do not appear to have" - $echo "*** because I did check the linker path looking for a file starting" - if test -z "$potlib" ; then - $echo "*** with $libname but no candidates were found. (...for regex pattern test)" - else - $echo "*** with $libname and none of the candidates passed a file format test" - $echo "*** using a regex pattern. Last file checked: $potlib" - fi - fi - else - # Add a -L argument. - newdeplibs="$newdeplibs $a_deplib" - fi - done # Gone through all deplibs. - ;; - none | unknown | *) - newdeplibs="" - tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ - -e 's/ -[LR][^ ]*//g'` - if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then - for i in $predeps $postdeps ; do - # can't use Xsed below, because $i might contain '/' - tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"` - done - fi - if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \ - | grep . >/dev/null; then - $echo - if test "X$deplibs_check_method" = "Xnone"; then - $echo "*** Warning: inter-library dependencies are not supported in this platform." - else - $echo "*** Warning: inter-library dependencies are not known to be supported." - fi - $echo "*** All declared inter-library dependencies are being dropped." - droppeddeps=yes - fi - ;; - esac - versuffix=$versuffix_save - major=$major_save - release=$release_save - libname=$libname_save - name=$name_save - - case $host in - *-*-rhapsody* | *-*-darwin1.[012]) - # On Rhapsody replace the C library is the System framework - newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's/ -lc / -framework System /'` - ;; - esac - - if test "$droppeddeps" = yes; then - if test "$module" = yes; then - $echo - $echo "*** Warning: libtool could not satisfy all declared inter-library" - $echo "*** dependencies of module $libname. Therefore, libtool will create" - $echo "*** a static module, that should work as long as the dlopening" - $echo "*** application is linked with the -dlopen flag." - if test -z "$global_symbol_pipe"; then - $echo - $echo "*** However, this would only work if libtool was able to extract symbol" - $echo "*** lists from a program, using \`nm' or equivalent, but libtool could" - $echo "*** not find such a program. So, this module is probably useless." - $echo "*** \`nm' from GNU binutils and a full rebuild may help." - fi - if test "$build_old_libs" = no; then - oldlibs="$output_objdir/$libname.$libext" - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - else - $echo "*** The inter-library dependencies that have been dropped here will be" - $echo "*** automatically added whenever a program is linked with this library" - $echo "*** or is declared to -dlopen it." - - if test "$allow_undefined" = no; then - $echo - $echo "*** Since this library must not contain undefined symbols," - $echo "*** because either the platform does not support them or" - $echo "*** it was explicitly requested with -no-undefined," - $echo "*** libtool will only create a static version of it." - if test "$build_old_libs" = no; then - oldlibs="$output_objdir/$libname.$libext" - build_libtool_libs=module - build_old_libs=yes - else - build_libtool_libs=no - fi - fi - fi - fi - # Done checking deplibs! - deplibs=$newdeplibs - fi - - - # move library search paths that coincide with paths to not yet - # installed libraries to the beginning of the library search list - new_libs= - for path in $notinst_path; do - case " $new_libs " in - *" -L$path/$objdir "*) ;; - *) - case " $deplibs " in - *" -L$path/$objdir "*) - new_libs="$new_libs -L$path/$objdir" ;; - esac - ;; - esac - done - for deplib in $deplibs; do - case $deplib in - -L*) - case " $new_libs " in - *" $deplib "*) ;; - *) new_libs="$new_libs $deplib" ;; - esac - ;; - *) new_libs="$new_libs $deplib" ;; - esac - done - deplibs="$new_libs" - - - # All the library-specific variables (install_libdir is set above). - library_names= - old_library= - dlname= - - # Test again, we may have decided not to build it any more - if test "$build_libtool_libs" = yes; then - if test "$hardcode_into_libs" = yes; then - # Hardcode the library paths - hardcode_libdirs= - dep_rpath= - rpath="$finalize_rpath" - test "$mode" != relink && rpath="$compile_rpath$rpath" - for libdir in $rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - dep_rpath="$dep_rpath $flag" - fi - elif test -n "$runpath_var"; then - case "$perm_rpath " in - *" $libdir "*) ;; - *) perm_rpath="$perm_rpath $libdir" ;; - esac - fi - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - if test -n "$hardcode_libdir_flag_spec_ld"; then - eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" - else - eval dep_rpath=\"$hardcode_libdir_flag_spec\" - fi - fi - if test -n "$runpath_var" && test -n "$perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $perm_rpath; do - rpath="$rpath$dir:" - done - eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" - fi - test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" - fi - - shlibpath="$finalize_shlibpath" - test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" - if test -n "$shlibpath"; then - eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" - fi - - # Get the real and link names of the library. - eval shared_ext=\"$shrext_cmds\" - eval library_names=\"$library_names_spec\" - set dummy $library_names - realname="$2" - shift; shift - - if test -n "$soname_spec"; then - eval soname=\"$soname_spec\" - else - soname="$realname" - fi - if test -z "$dlname"; then - dlname=$soname - fi - - lib="$output_objdir/$realname" - linknames= - for link - do - linknames="$linknames $link" - done - - # Use standard objects if they are pic - test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - - # Prepare the list of exported symbols - if test -z "$export_symbols"; then - if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then - $show "generating symbol list for \`$libname.la'" - export_symbols="$output_objdir/$libname.exp" - $run $rm $export_symbols - cmds=$export_symbols_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - if len=`expr "X$cmd" : ".*"` && - test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then - $show "$cmd" - $run eval "$cmd" || exit $? - skipped_export=false - else - # The command line is too long to execute in one step. - $show "using reloadable object file for export list..." - skipped_export=: - # Break out early, otherwise skipped_export may be - # set to false by a later but shorter cmd. - break - fi - done - IFS="$save_ifs" - if test -n "$export_symbols_regex"; then - $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" - $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' - $show "$mv \"${export_symbols}T\" \"$export_symbols\"" - $run eval '$mv "${export_symbols}T" "$export_symbols"' - fi - fi - fi - - if test -n "$export_symbols" && test -n "$include_expsyms"; then - $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' - fi - - tmp_deplibs= - for test_deplib in $deplibs; do - case " $convenience " in - *" $test_deplib "*) ;; - *) - tmp_deplibs="$tmp_deplibs $test_deplib" - ;; - esac - done - deplibs="$tmp_deplibs" - - if test -n "$convenience"; then - if test -n "$whole_archive_flag_spec"; then - save_libobjs=$libobjs - eval libobjs=\"\$libobjs $whole_archive_flag_spec\" - else - gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" - - func_extract_archives $gentop $convenience - libobjs="$libobjs $func_extract_archives_result" - fi - fi - - if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then - eval flag=\"$thread_safe_flag_spec\" - linker_flags="$linker_flags $flag" - fi - - # Make a backup of the uninstalled library when relinking - if test "$mode" = relink; then - $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $? - fi - - # Do each of the archive commands. - if test "$module" = yes && test -n "$module_cmds" ; then - if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then - eval test_cmds=\"$module_expsym_cmds\" - cmds=$module_expsym_cmds - else - eval test_cmds=\"$module_cmds\" - cmds=$module_cmds - fi - else - if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then - eval test_cmds=\"$archive_expsym_cmds\" - cmds=$archive_expsym_cmds - else - eval test_cmds=\"$archive_cmds\" - cmds=$archive_cmds - fi - fi - - if test "X$skipped_export" != "X:" && - len=`expr "X$test_cmds" : ".*" 2>/dev/null` && - test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then - : - else - # The command line is too long to link in one step, link piecewise. - $echo "creating reloadable object files..." - - # Save the value of $output and $libobjs because we want to - # use them later. If we have whole_archive_flag_spec, we - # want to use save_libobjs as it was before - # whole_archive_flag_spec was expanded, because we can't - # assume the linker understands whole_archive_flag_spec. - # This may have to be revisited, in case too many - # convenience libraries get linked in and end up exceeding - # the spec. - if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then - save_libobjs=$libobjs - fi - save_output=$output - output_la=`$echo "X$output" | $Xsed -e "$basename"` - - # Clear the reloadable object creation command queue and - # initialize k to one. - test_cmds= - concat_cmds= - objlist= - delfiles= - last_robj= - k=1 - output=$output_objdir/$output_la-${k}.$objext - # Loop over the list of objects to be linked. - for obj in $save_libobjs - do - eval test_cmds=\"$reload_cmds $objlist $last_robj\" - if test "X$objlist" = X || - { len=`expr "X$test_cmds" : ".*" 2>/dev/null` && - test "$len" -le "$max_cmd_len"; }; then - objlist="$objlist $obj" - else - # The command $test_cmds is almost too long, add a - # command to the queue. - if test "$k" -eq 1 ; then - # The first file doesn't have a previous command to add. - eval concat_cmds=\"$reload_cmds $objlist $last_robj\" - else - # All subsequent reloadable object files will link in - # the last one created. - eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj\" - fi - last_robj=$output_objdir/$output_la-${k}.$objext - k=`expr $k + 1` - output=$output_objdir/$output_la-${k}.$objext - objlist=$obj - len=1 - fi - done - # Handle the remaining objects by creating one last - # reloadable object file. All subsequent reloadable object - # files will link in the last one created. - test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" - - if ${skipped_export-false}; then - $show "generating symbol list for \`$libname.la'" - export_symbols="$output_objdir/$libname.exp" - $run $rm $export_symbols - libobjs=$output - # Append the command to create the export file. - eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\" - fi - - # Set up a command to remove the reloadable object files - # after they are used. - i=0 - while test "$i" -lt "$k" - do - i=`expr $i + 1` - delfiles="$delfiles $output_objdir/$output_la-${i}.$objext" - done - - $echo "creating a temporary reloadable object file: $output" - - # Loop through the commands generated above and execute them. - save_ifs="$IFS"; IFS='~' - for cmd in $concat_cmds; do - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - - libobjs=$output - # Restore the value of output. - output=$save_output - - if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then - eval libobjs=\"\$libobjs $whole_archive_flag_spec\" - fi - # Expand the library linking commands again to reset the - # value of $libobjs for piecewise linking. - - # Do each of the archive commands. - if test "$module" = yes && test -n "$module_cmds" ; then - if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then - cmds=$module_expsym_cmds - else - cmds=$module_cmds - fi - else - if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then - cmds=$archive_expsym_cmds - else - cmds=$archive_cmds - fi - fi - - # Append the command to remove the reloadable object files - # to the just-reset $cmds. - eval cmds=\"\$cmds~\$rm $delfiles\" - fi - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || { - lt_exit=$? - - # Restore the uninstalled library and exit - if test "$mode" = relink; then - $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' - fi - - exit $lt_exit - } - done - IFS="$save_ifs" - - # Restore the uninstalled library and exit - if test "$mode" = relink; then - $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $? - - if test -n "$convenience"; then - if test -z "$whole_archive_flag_spec"; then - $show "${rm}r $gentop" - $run ${rm}r "$gentop" - fi - fi - - exit $EXIT_SUCCESS - fi - - # Create links to the real library. - for linkname in $linknames; do - if test "$realname" != "$linkname"; then - $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" - $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? - fi - done - - # If -module or -export-dynamic was specified, set the dlname. - if test "$module" = yes || test "$export_dynamic" = yes; then - # On all known operating systems, these are identical. - dlname="$soname" - fi - fi - ;; - - obj) - if test -n "$deplibs"; then - $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 - fi - - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 - fi - - if test -n "$rpath"; then - $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 - fi - - if test -n "$xrpath"; then - $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 - fi - - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 - fi - - case $output in - *.lo) - if test -n "$objs$old_deplibs"; then - $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 - exit $EXIT_FAILURE - fi - libobj="$output" - obj=`$echo "X$output" | $Xsed -e "$lo2o"` - ;; - *) - libobj= - obj="$output" - ;; - esac - - # Delete the old objects. - $run $rm $obj $libobj - - # Objects from convenience libraries. This assumes - # single-version convenience libraries. Whenever we create - # different ones for PIC/non-PIC, this we'll have to duplicate - # the extraction. - reload_conv_objs= - gentop= - # reload_cmds runs $LD directly, so let us get rid of - # -Wl from whole_archive_flag_spec and hope we can get by with - # turning comma into space.. - wl= - - if test -n "$convenience"; then - if test -n "$whole_archive_flag_spec"; then - eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" - reload_conv_objs=$reload_objs\ `$echo "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'` - else - gentop="$output_objdir/${obj}x" - generated="$generated $gentop" - - func_extract_archives $gentop $convenience - reload_conv_objs="$reload_objs $func_extract_archives_result" - fi - fi - - # Create the old-style object. - reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test - - output="$obj" - cmds=$reload_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - - # Exit if we aren't doing a library object file. - if test -z "$libobj"; then - if test -n "$gentop"; then - $show "${rm}r $gentop" - $run ${rm}r $gentop - fi - - exit $EXIT_SUCCESS - fi - - if test "$build_libtool_libs" != yes; then - if test -n "$gentop"; then - $show "${rm}r $gentop" - $run ${rm}r $gentop - fi - - # Create an invalid libtool object if no PIC, so that we don't - # accidentally link it into a program. - # $show "echo timestamp > $libobj" - # $run eval "echo timestamp > $libobj" || exit $? - exit $EXIT_SUCCESS - fi - - if test -n "$pic_flag" || test "$pic_mode" != default; then - # Only do commands if we really have different PIC objects. - reload_objs="$libobjs $reload_conv_objs" - output="$libobj" - cmds=$reload_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - fi - - if test -n "$gentop"; then - $show "${rm}r $gentop" - $run ${rm}r $gentop - fi - - exit $EXIT_SUCCESS - ;; - - prog) - case $host in - *cygwin*) output=`$echo $output | ${SED} -e 's,.exe$,,;s,$,.exe,'` ;; - esac - if test -n "$vinfo"; then - $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 - fi - - if test -n "$release"; then - $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 - fi - - if test "$preload" = yes; then - if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown && - test "$dlopen_self_static" = unknown; then - $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." - fi - fi - - case $host in - *-*-rhapsody* | *-*-darwin1.[012]) - # On Rhapsody replace the C library is the System framework - compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's/ -lc / -framework System /'` - finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's/ -lc / -framework System /'` - ;; - esac - - case $host in - *darwin*) - # Don't allow lazy linking, it breaks C++ global constructors - if test "$tagname" = CXX ; then - compile_command="$compile_command ${wl}-bind_at_load" - finalize_command="$finalize_command ${wl}-bind_at_load" - fi - ;; - esac - - - # move library search paths that coincide with paths to not yet - # installed libraries to the beginning of the library search list - new_libs= - for path in $notinst_path; do - case " $new_libs " in - *" -L$path/$objdir "*) ;; - *) - case " $compile_deplibs " in - *" -L$path/$objdir "*) - new_libs="$new_libs -L$path/$objdir" ;; - esac - ;; - esac - done - for deplib in $compile_deplibs; do - case $deplib in - -L*) - case " $new_libs " in - *" $deplib "*) ;; - *) new_libs="$new_libs $deplib" ;; - esac - ;; - *) new_libs="$new_libs $deplib" ;; - esac - done - compile_deplibs="$new_libs" - - - compile_command="$compile_command $compile_deplibs" - finalize_command="$finalize_command $finalize_deplibs" - - if test -n "$rpath$xrpath"; then - # If the user specified any rpath flags, then add them. - for libdir in $rpath $xrpath; do - # This is the magic to use -rpath. - case "$finalize_rpath " in - *" $libdir "*) ;; - *) finalize_rpath="$finalize_rpath $libdir" ;; - esac - done - fi - - # Now hardcode the library paths - rpath= - hardcode_libdirs= - for libdir in $compile_rpath $finalize_rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - rpath="$rpath $flag" - fi - elif test -n "$runpath_var"; then - case "$perm_rpath " in - *" $libdir "*) ;; - *) perm_rpath="$perm_rpath $libdir" ;; - esac - fi - case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) - testbindir=`$echo "X$libdir" | $Xsed -e 's*/lib$*/bin*'` - case :$dllsearchpath: in - *":$libdir:"*) ;; - *) dllsearchpath="$dllsearchpath:$libdir";; - esac - case :$dllsearchpath: in - *":$testbindir:"*) ;; - *) dllsearchpath="$dllsearchpath:$testbindir";; - esac - ;; - esac - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - eval rpath=\" $hardcode_libdir_flag_spec\" - fi - compile_rpath="$rpath" - - rpath= - hardcode_libdirs= - for libdir in $finalize_rpath; do - if test -n "$hardcode_libdir_flag_spec"; then - if test -n "$hardcode_libdir_separator"; then - if test -z "$hardcode_libdirs"; then - hardcode_libdirs="$libdir" - else - # Just accumulate the unique libdirs. - case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in - *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) - ;; - *) - hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" - ;; - esac - fi - else - eval flag=\"$hardcode_libdir_flag_spec\" - rpath="$rpath $flag" - fi - elif test -n "$runpath_var"; then - case "$finalize_perm_rpath " in - *" $libdir "*) ;; - *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; - esac - fi - done - # Substitute the hardcoded libdirs into the rpath. - if test -n "$hardcode_libdir_separator" && - test -n "$hardcode_libdirs"; then - libdir="$hardcode_libdirs" - eval rpath=\" $hardcode_libdir_flag_spec\" - fi - finalize_rpath="$rpath" - - if test -n "$libobjs" && test "$build_old_libs" = yes; then - # Transform all the library objects into standard objects. - compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - fi - - dlsyms= - if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then - if test -n "$NM" && test -n "$global_symbol_pipe"; then - dlsyms="${outputname}S.c" - else - $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 - fi - fi - - if test -n "$dlsyms"; then - case $dlsyms in - "") ;; - *.c) - # Discover the nlist of each of the dlfiles. - nlist="$output_objdir/${outputname}.nm" - - $show "$rm $nlist ${nlist}S ${nlist}T" - $run $rm "$nlist" "${nlist}S" "${nlist}T" - - # Parse the name list into a source file. - $show "creating $output_objdir/$dlsyms" - - test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ -/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ -/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ - -#ifdef __cplusplus -extern \"C\" { -#endif - -/* Prevent the only kind of declaration conflicts we can make. */ -#define lt_preloaded_symbols some_other_symbol - -/* External symbol declarations for the compiler. */\ -" - - if test "$dlself" = yes; then - $show "generating symbol list for \`$output'" - - test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" - - # Add our own program objects to the symbol list. - progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` - for arg in $progfiles; do - $show "extracting global C symbols from \`$arg'" - $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" - done - - if test -n "$exclude_expsyms"; then - $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' - $run eval '$mv "$nlist"T "$nlist"' - fi - - if test -n "$export_symbols_regex"; then - $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' - $run eval '$mv "$nlist"T "$nlist"' - fi - - # Prepare the list of exported symbols - if test -z "$export_symbols"; then - export_symbols="$output_objdir/$outputname.exp" - $run $rm $export_symbols - $run eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' - case $host in - *cygwin* | *mingw* ) - $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' - $run eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' - ;; - esac - else - $run eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' - $run eval 'grep -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' - $run eval 'mv "$nlist"T "$nlist"' - case $host in - *cygwin* | *mingw* ) - $run eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' - $run eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' - ;; - esac - fi - fi - - for arg in $dlprefiles; do - $show "extracting global C symbols from \`$arg'" - name=`$echo "$arg" | ${SED} -e 's%^.*/%%'` - $run eval '$echo ": $name " >> "$nlist"' - $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" - done - - if test -z "$run"; then - # Make sure we have at least an empty file. - test -f "$nlist" || : > "$nlist" - - if test -n "$exclude_expsyms"; then - $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T - $mv "$nlist"T "$nlist" - fi - - # Try sorting and uniquifying the output. - if grep -v "^: " < "$nlist" | - if sort -k 3 </dev/null >/dev/null 2>&1; then - sort -k 3 - else - sort +2 - fi | - uniq > "$nlist"S; then - : - else - grep -v "^: " < "$nlist" > "$nlist"S - fi - - if test -f "$nlist"S; then - eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' - else - $echo '/* NONE */' >> "$output_objdir/$dlsyms" - fi - - $echo >> "$output_objdir/$dlsyms" "\ - -#undef lt_preloaded_symbols - -#if defined (__STDC__) && __STDC__ -# define lt_ptr void * -#else -# define lt_ptr char * -# define const -#endif - -/* The mapping between symbol names and symbols. */ -" - - case $host in - *cygwin* | *mingw* ) - $echo >> "$output_objdir/$dlsyms" "\ -/* DATA imports from DLLs on WIN32 can't be const, because - runtime relocations are performed -- see ld's documentation - on pseudo-relocs */ -struct { -" - ;; - * ) - $echo >> "$output_objdir/$dlsyms" "\ -const struct { -" - ;; - esac - - - $echo >> "$output_objdir/$dlsyms" "\ - const char *name; - lt_ptr address; -} -lt_preloaded_symbols[] = -{\ -" - - eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms" - - $echo >> "$output_objdir/$dlsyms" "\ - {0, (lt_ptr) 0} -}; - -/* This works around a problem in FreeBSD linker */ -#ifdef FREEBSD_WORKAROUND -static const void *lt_preloaded_setup() { - return lt_preloaded_symbols; -} -#endif - -#ifdef __cplusplus -} -#endif\ -" - fi - - pic_flag_for_symtable= - case $host in - # compiling the symbol table file with pic_flag works around - # a FreeBSD bug that causes programs to crash when -lm is - # linked before any other PIC object. But we must not use - # pic_flag when linking with -static. The problem exists in - # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. - *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) - case "$compile_command " in - *" -static "*) ;; - *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";; - esac;; - *-*-hpux*) - case "$compile_command " in - *" -static "*) ;; - *) pic_flag_for_symtable=" $pic_flag";; - esac - esac - - # Now compile the dynamic symbol file. - $show "(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" - $run eval '(cd $output_objdir && $LTCC $LTCFLAGS -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? - - # Clean up the generated files. - $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" - $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" - - # Transform the symbol file into the correct name. - case $host in - *cygwin* | *mingw* ) - if test -f "$output_objdir/${outputname}.def" ; then - compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP` - finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP` - else - compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` - finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` - fi - ;; - * ) - compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` - finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP` - ;; - esac - ;; - *) - $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 - exit $EXIT_FAILURE - ;; - esac - else - # We keep going just in case the user didn't refer to - # lt_preloaded_symbols. The linker will fail if global_symbol_pipe - # really was required. - - # Nullify the symbol file. - compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP` - finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP` - fi - - if test "$need_relink" = no || test "$build_libtool_libs" != yes; then - # Replace the output file specification. - compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$output"'%g' | $NL2SP` - link_command="$compile_command$compile_rpath" - - # We have no uninstalled library dependencies, so finalize right now. - $show "$link_command" - $run eval "$link_command" - exit_status=$? - - # Delete the generated files. - if test -n "$dlsyms"; then - $show "$rm $output_objdir/${outputname}S.${objext}" - $run $rm "$output_objdir/${outputname}S.${objext}" - fi - - exit $exit_status - fi - - if test -n "$shlibpath_var"; then - # We should set the shlibpath_var - rpath= - for dir in $temp_rpath; do - case $dir in - [\\/]* | [A-Za-z]:[\\/]*) - # Absolute path. - rpath="$rpath$dir:" - ;; - *) - # Relative path: add a thisdir entry. - rpath="$rpath\$thisdir/$dir:" - ;; - esac - done - temp_rpath="$rpath" - fi - - if test -n "$compile_shlibpath$finalize_shlibpath"; then - compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" - fi - if test -n "$finalize_shlibpath"; then - finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" - fi - - compile_var= - finalize_var= - if test -n "$runpath_var"; then - if test -n "$perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $perm_rpath; do - rpath="$rpath$dir:" - done - compile_var="$runpath_var=\"$rpath\$$runpath_var\" " - fi - if test -n "$finalize_perm_rpath"; then - # We should set the runpath_var. - rpath= - for dir in $finalize_perm_rpath; do - rpath="$rpath$dir:" - done - finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " - fi - fi - - if test "$no_install" = yes; then - # We don't need to create a wrapper script. - link_command="$compile_var$compile_command$compile_rpath" - # Replace the output file specification. - link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` - # Delete the old output file. - $run $rm $output - # Link the executable and exit - $show "$link_command" - $run eval "$link_command" || exit $? - exit $EXIT_SUCCESS - fi - - if test "$hardcode_action" = relink; then - # Fast installation is not supported - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" - - $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 - $echo "$modename: \`$output' will be relinked during installation" 1>&2 - else - if test "$fast_install" != no; then - link_command="$finalize_var$compile_command$finalize_rpath" - if test "$fast_install" = yes; then - relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $SP2NL | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g' | $NL2SP` - else - # fast_install is set to needless - relink_command= - fi - else - link_command="$compile_var$compile_command$compile_rpath" - relink_command="$finalize_var$finalize_command$finalize_rpath" - fi - fi - - # Replace the output file specification. - link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` - - # Delete the old output files. - $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname - - $show "$link_command" - $run eval "$link_command" || exit $? - - # Now create the wrapper script. - $show "creating $output" - - # Quote the relink command for shipping. - if test -n "$relink_command"; then - # Preserve any variables that may affect compiler behavior - for var in $variables_saved_for_relink; do - if eval test -z \"\${$var+set}\"; then - relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" - elif eval var_value=\$$var; test -z "$var_value"; then - relink_command="$var=; export $var; $relink_command" - else - var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` - relink_command="$var=\"$var_value\"; export $var; $relink_command" - fi - done - relink_command="(cd `pwd`; $relink_command)" - relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP` - fi - - # Quote $echo for shipping. - if test "X$echo" = "X$SHELL $progpath --fallback-echo"; then - case $progpath in - [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; - *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; - esac - qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` - else - qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` - fi - - # Only actually do things if our run command is non-null. - if test -z "$run"; then - # win32 will think the script is a binary if it has - # a .exe suffix, so we strip it off here. - case $output in - *.exe) output=`$echo $output|${SED} 's,.exe$,,'` ;; - esac - # test for cygwin because mv fails w/o .exe extensions - case $host in - *cygwin*) - exeext=.exe - outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;; - *) exeext= ;; - esac - case $host in - *cygwin* | *mingw* ) - output_name=`basename $output` - output_path=`dirname $output` - cwrappersource="$output_path/$objdir/lt-$output_name.c" - cwrapper="$output_path/$output_name.exe" - $rm $cwrappersource $cwrapper - trap "$rm $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 - - cat > $cwrappersource <<EOF - -/* $cwrappersource - temporary wrapper executable for $objdir/$outputname - Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP - - The $output program cannot be directly executed until all the libtool - libraries that it depends on are installed. - - This wrapper executable should never be moved out of the build directory. - If it is, it will not operate correctly. - - Currently, it simply execs the wrapper *script* "/bin/sh $output", - but could eventually absorb all of the scripts functionality and - exec $objdir/$outputname directly. -*/ -EOF - cat >> $cwrappersource<<"EOF" -#include <stdio.h> -#include <stdlib.h> -#include <unistd.h> -#include <malloc.h> -#include <stdarg.h> -#include <assert.h> -#include <string.h> -#include <ctype.h> -#include <sys/stat.h> - -#if defined(PATH_MAX) -# define LT_PATHMAX PATH_MAX -#elif defined(MAXPATHLEN) -# define LT_PATHMAX MAXPATHLEN -#else -# define LT_PATHMAX 1024 -#endif - -#ifndef DIR_SEPARATOR -# define DIR_SEPARATOR '/' -# define PATH_SEPARATOR ':' -#endif - -#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ - defined (__OS2__) -# define HAVE_DOS_BASED_FILE_SYSTEM -# ifndef DIR_SEPARATOR_2 -# define DIR_SEPARATOR_2 '\\' -# endif -# ifndef PATH_SEPARATOR_2 -# define PATH_SEPARATOR_2 ';' -# endif -#endif - -#ifndef DIR_SEPARATOR_2 -# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) -#else /* DIR_SEPARATOR_2 */ -# define IS_DIR_SEPARATOR(ch) \ - (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) -#endif /* DIR_SEPARATOR_2 */ - -#ifndef PATH_SEPARATOR_2 -# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) -#else /* PATH_SEPARATOR_2 */ -# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) -#endif /* PATH_SEPARATOR_2 */ - -#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) -#define XFREE(stale) do { \ - if (stale) { free ((void *) stale); stale = 0; } \ -} while (0) - -/* -DDEBUG is fairly common in CFLAGS. */ -#undef DEBUG -#if defined DEBUGWRAPPER -# define DEBUG(format, ...) fprintf(stderr, format, __VA_ARGS__) -#else -# define DEBUG(format, ...) -#endif - -const char *program_name = NULL; - -void * xmalloc (size_t num); -char * xstrdup (const char *string); -const char * base_name (const char *name); -char * find_executable(const char *wrapper); -int check_executable(const char *path); -char * strendzap(char *str, const char *pat); -void lt_fatal (const char *message, ...); - -int -main (int argc, char *argv[]) -{ - char **newargz; - int i; - - program_name = (char *) xstrdup (base_name (argv[0])); - DEBUG("(main) argv[0] : %s\n",argv[0]); - DEBUG("(main) program_name : %s\n",program_name); - newargz = XMALLOC(char *, argc+2); -EOF - - cat >> $cwrappersource <<EOF - newargz[0] = (char *) xstrdup("$SHELL"); -EOF - - cat >> $cwrappersource <<"EOF" - newargz[1] = find_executable(argv[0]); - if (newargz[1] == NULL) - lt_fatal("Couldn't find %s", argv[0]); - DEBUG("(main) found exe at : %s\n",newargz[1]); - /* we know the script has the same name, without the .exe */ - /* so make sure newargz[1] doesn't end in .exe */ - strendzap(newargz[1],".exe"); - for (i = 1; i < argc; i++) - newargz[i+1] = xstrdup(argv[i]); - newargz[argc+1] = NULL; - - for (i=0; i<argc+1; i++) - { - DEBUG("(main) newargz[%d] : %s\n",i,newargz[i]); - ; - } - -EOF - - case $host_os in - mingw*) - cat >> $cwrappersource <<EOF - execv("$SHELL",(char const **)newargz); -EOF - ;; - *) - cat >> $cwrappersource <<EOF - execv("$SHELL",newargz); -EOF - ;; - esac - - cat >> $cwrappersource <<"EOF" - return 127; -} - -void * -xmalloc (size_t num) -{ - void * p = (void *) malloc (num); - if (!p) - lt_fatal ("Memory exhausted"); - - return p; -} - -char * -xstrdup (const char *string) -{ - return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL -; -} - -const char * -base_name (const char *name) -{ - const char *base; - -#if defined (HAVE_DOS_BASED_FILE_SYSTEM) - /* Skip over the disk name in MSDOS pathnames. */ - if (isalpha ((unsigned char)name[0]) && name[1] == ':') - name += 2; -#endif - - for (base = name; *name; name++) - if (IS_DIR_SEPARATOR (*name)) - base = name + 1; - return base; -} - -int -check_executable(const char * path) -{ - struct stat st; - - DEBUG("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!"); - if ((!path) || (!*path)) - return 0; - - if ((stat (path, &st) >= 0) && - ( - /* MinGW & native WIN32 do not support S_IXOTH or S_IXGRP */ -#if defined (S_IXOTH) - ((st.st_mode & S_IXOTH) == S_IXOTH) || -#endif -#if defined (S_IXGRP) - ((st.st_mode & S_IXGRP) == S_IXGRP) || -#endif - ((st.st_mode & S_IXUSR) == S_IXUSR)) - ) - return 1; - else - return 0; -} - -/* Searches for the full path of the wrapper. Returns - newly allocated full path name if found, NULL otherwise */ -char * -find_executable (const char* wrapper) -{ - int has_slash = 0; - const char* p; - const char* p_next; - /* static buffer for getcwd */ - char tmp[LT_PATHMAX + 1]; - int tmp_len; - char* concat_name; - - DEBUG("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!"); - - if ((wrapper == NULL) || (*wrapper == '\0')) - return NULL; - - /* Absolute path? */ -#if defined (HAVE_DOS_BASED_FILE_SYSTEM) - if (isalpha ((unsigned char)wrapper[0]) && wrapper[1] == ':') - { - concat_name = xstrdup (wrapper); - if (check_executable(concat_name)) - return concat_name; - XFREE(concat_name); - } - else - { -#endif - if (IS_DIR_SEPARATOR (wrapper[0])) - { - concat_name = xstrdup (wrapper); - if (check_executable(concat_name)) - return concat_name; - XFREE(concat_name); - } -#if defined (HAVE_DOS_BASED_FILE_SYSTEM) - } -#endif - - for (p = wrapper; *p; p++) - if (*p == '/') - { - has_slash = 1; - break; - } - if (!has_slash) - { - /* no slashes; search PATH */ - const char* path = getenv ("PATH"); - if (path != NULL) - { - for (p = path; *p; p = p_next) - { - const char* q; - size_t p_len; - for (q = p; *q; q++) - if (IS_PATH_SEPARATOR(*q)) - break; - p_len = q - p; - p_next = (*q == '\0' ? q : q + 1); - if (p_len == 0) - { - /* empty path: current directory */ - if (getcwd (tmp, LT_PATHMAX) == NULL) - lt_fatal ("getcwd failed"); - tmp_len = strlen(tmp); - concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); - memcpy (concat_name, tmp, tmp_len); - concat_name[tmp_len] = '/'; - strcpy (concat_name + tmp_len + 1, wrapper); - } - else - { - concat_name = XMALLOC(char, p_len + 1 + strlen(wrapper) + 1); - memcpy (concat_name, p, p_len); - concat_name[p_len] = '/'; - strcpy (concat_name + p_len + 1, wrapper); - } - if (check_executable(concat_name)) - return concat_name; - XFREE(concat_name); - } - } - /* not found in PATH; assume curdir */ - } - /* Relative path | not found in path: prepend cwd */ - if (getcwd (tmp, LT_PATHMAX) == NULL) - lt_fatal ("getcwd failed"); - tmp_len = strlen(tmp); - concat_name = XMALLOC(char, tmp_len + 1 + strlen(wrapper) + 1); - memcpy (concat_name, tmp, tmp_len); - concat_name[tmp_len] = '/'; - strcpy (concat_name + tmp_len + 1, wrapper); - - if (check_executable(concat_name)) - return concat_name; - XFREE(concat_name); - return NULL; -} - -char * -strendzap(char *str, const char *pat) -{ - size_t len, patlen; - - assert(str != NULL); - assert(pat != NULL); - - len = strlen(str); - patlen = strlen(pat); - - if (patlen <= len) - { - str += len - patlen; - if (strcmp(str, pat) == 0) - *str = '\0'; - } - return str; -} - -static void -lt_error_core (int exit_status, const char * mode, - const char * message, va_list ap) -{ - fprintf (stderr, "%s: %s: ", program_name, mode); - vfprintf (stderr, message, ap); - fprintf (stderr, ".\n"); - - if (exit_status >= 0) - exit (exit_status); -} - -void -lt_fatal (const char *message, ...) -{ - va_list ap; - va_start (ap, message); - lt_error_core (EXIT_FAILURE, "FATAL", message, ap); - va_end (ap); -} -EOF - # we should really use a build-platform specific compiler - # here, but OTOH, the wrappers (shell script and this C one) - # are only useful if you want to execute the "real" binary. - # Since the "real" binary is built for $host, then this - # wrapper might as well be built for $host, too. - $run $LTCC $LTCFLAGS -s -o $cwrapper $cwrappersource - ;; - esac - $rm $output - trap "$rm $output; exit $EXIT_FAILURE" 1 2 15 - - $echo > $output "\ -#! $SHELL - -# $output - temporary wrapper script for $objdir/$outputname -# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP -# -# The $output program cannot be directly executed until all the libtool -# libraries that it depends on are installed. -# -# This wrapper script should never be moved out of the build directory. -# If it is, it will not operate correctly. - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -Xsed='${SED} -e 1s/^X//' -sed_quote_subst='$sed_quote_subst' - -# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE). -if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which - # is contrary to our usage. Disable this feature. - alias -g '\${1+\"\$@\"}'='\"\$@\"' - setopt NO_GLOB_SUBST -else - case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac -fi - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -relink_command=\"$relink_command\" - -# This environment variable determines our operation mode. -if test \"\$libtool_install_magic\" = \"$magic\"; then - # install mode needs the following variable: - notinst_deplibs='$notinst_deplibs' -else - # When we are sourced in execute mode, \$file and \$echo are already set. - if test \"\$libtool_execute_magic\" != \"$magic\"; then - echo=\"$qecho\" - file=\"\$0\" - # Make sure echo works. - if test \"X\$1\" = X--no-reexec; then - # Discard the --no-reexec flag, and continue. - shift - elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then - # Yippee, \$echo works! - : - else - # Restart under the correct shell, and then maybe \$echo will work. - exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} - fi - fi\ -" - $echo >> $output "\ - - # Find the directory that this script lives in. - thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` - test \"x\$thisdir\" = \"x\$file\" && thisdir=. - - # Follow symbolic links until we get to the real thisdir. - file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` - while test -n \"\$file\"; do - destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` - - # If there was a directory component, then change thisdir. - if test \"x\$destdir\" != \"x\$file\"; then - case \"\$destdir\" in - [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; - *) thisdir=\"\$thisdir/\$destdir\" ;; - esac - fi - - file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` - file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` - done - - # Try to get the absolute directory name. - absdir=\`cd \"\$thisdir\" && pwd\` - test -n \"\$absdir\" && thisdir=\"\$absdir\" -" - - if test "$fast_install" = yes; then - $echo >> $output "\ - program=lt-'$outputname'$exeext - progdir=\"\$thisdir/$objdir\" - - if test ! -f \"\$progdir/\$program\" || \\ - { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ - test \"X\$file\" != \"X\$progdir/\$program\"; }; then - - file=\"\$\$-\$program\" - - if test ! -d \"\$progdir\"; then - $mkdir \"\$progdir\" - else - $rm \"\$progdir/\$file\" - fi" - - $echo >> $output "\ - - # relink executable if necessary - if test -n \"\$relink_command\"; then - if relink_command_output=\`eval \$relink_command 2>&1\`; then : - else - $echo \"\$relink_command_output\" >&2 - $rm \"\$progdir/\$file\" - exit $EXIT_FAILURE - fi - fi - - $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || - { $rm \"\$progdir/\$program\"; - $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } - $rm \"\$progdir/\$file\" - fi" - else - $echo >> $output "\ - program='$outputname' - progdir=\"\$thisdir/$objdir\" -" - fi - - $echo >> $output "\ - - if test -f \"\$progdir/\$program\"; then" - - # Export our shlibpath_var if we have one. - if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then - $echo >> $output "\ - # Add our own library path to $shlibpath_var - $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" - - # Some systems cannot cope with colon-terminated $shlibpath_var - # The second colon is a workaround for a bug in BeOS R4 sed - $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` - - export $shlibpath_var -" - fi - - # fixup the dll searchpath if we need to. - if test -n "$dllsearchpath"; then - $echo >> $output "\ - # Add the dll search path components to the executable PATH - PATH=$dllsearchpath:\$PATH -" - fi - - $echo >> $output "\ - if test \"\$libtool_execute_magic\" != \"$magic\"; then - # Run the actual program with our arguments. -" - case $host in - # Backslashes separate directories on plain windows - *-*-mingw | *-*-os2*) - $echo >> $output "\ - exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} -" - ;; - - *) - $echo >> $output "\ - exec \"\$progdir/\$program\" \${1+\"\$@\"} -" - ;; - esac - $echo >> $output "\ - \$echo \"\$0: cannot exec \$program \$*\" - exit $EXIT_FAILURE - fi - else - # The program doesn't exist. - \$echo \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 - \$echo \"This script is just a wrapper for \$program.\" 1>&2 - $echo \"See the $PACKAGE documentation for more information.\" 1>&2 - exit $EXIT_FAILURE - fi -fi\ -" - chmod +x $output - fi - exit $EXIT_SUCCESS - ;; - esac - - # See if we need to build an old-fashioned archive. - for oldlib in $oldlibs; do - - if test "$build_libtool_libs" = convenience; then - oldobjs="$libobjs_save" - addlibs="$convenience" - build_libtool_libs=no - else - if test "$build_libtool_libs" = module; then - oldobjs="$libobjs_save" - build_libtool_libs=no - else - oldobjs="$old_deplibs $non_pic_objects" - fi - addlibs="$old_convenience" - fi - - if test -n "$addlibs"; then - gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" - - func_extract_archives $gentop $addlibs - oldobjs="$oldobjs $func_extract_archives_result" - fi - - # Do each command in the archive commands. - if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then - cmds=$old_archive_from_new_cmds - else - # POSIX demands no paths to be encoded in archives. We have - # to avoid creating archives with duplicate basenames if we - # might have to extract them afterwards, e.g., when creating a - # static archive out of a convenience library, or when linking - # the entirety of a libtool archive into another (currently - # not supported by libtool). - if (for obj in $oldobjs - do - $echo "X$obj" | $Xsed -e 's%^.*/%%' - done | sort | sort -uc >/dev/null 2>&1); then - : - else - $echo "copying selected object files to avoid basename conflicts..." - - if test -z "$gentop"; then - gentop="$output_objdir/${outputname}x" - generated="$generated $gentop" - - $show "${rm}r $gentop" - $run ${rm}r "$gentop" - $show "$mkdir $gentop" - $run $mkdir "$gentop" - exit_status=$? - if test "$exit_status" -ne 0 && test ! -d "$gentop"; then - exit $exit_status - fi - fi - - save_oldobjs=$oldobjs - oldobjs= - counter=1 - for obj in $save_oldobjs - do - objbase=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` - case " $oldobjs " in - " ") oldobjs=$obj ;; - *[\ /]"$objbase "*) - while :; do - # Make sure we don't pick an alternate name that also - # overlaps. - newobj=lt$counter-$objbase - counter=`expr $counter + 1` - case " $oldobjs " in - *[\ /]"$newobj "*) ;; - *) if test ! -f "$gentop/$newobj"; then break; fi ;; - esac - done - $show "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" - $run ln "$obj" "$gentop/$newobj" || - $run cp "$obj" "$gentop/$newobj" - oldobjs="$oldobjs $gentop/$newobj" - ;; - *) oldobjs="$oldobjs $obj" ;; - esac - done - fi - - eval cmds=\"$old_archive_cmds\" - - if len=`expr "X$cmds" : ".*"` && - test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then - cmds=$old_archive_cmds - else - # the command line is too long to link in one step, link in parts - $echo "using piecewise archive linking..." - save_RANLIB=$RANLIB - RANLIB=: - objlist= - concat_cmds= - save_oldobjs=$oldobjs - - # Is there a better way of finding the last object in the list? - for obj in $save_oldobjs - do - last_oldobj=$obj - done - for obj in $save_oldobjs - do - oldobjs="$objlist $obj" - objlist="$objlist $obj" - eval test_cmds=\"$old_archive_cmds\" - if len=`expr "X$test_cmds" : ".*" 2>/dev/null` && - test "$len" -le "$max_cmd_len"; then - : - else - # the above command should be used before it gets too long - oldobjs=$objlist - if test "$obj" = "$last_oldobj" ; then - RANLIB=$save_RANLIB - fi - test -z "$concat_cmds" || concat_cmds=$concat_cmds~ - eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" - objlist= - fi - done - RANLIB=$save_RANLIB - oldobjs=$objlist - if test "X$oldobjs" = "X" ; then - eval cmds=\"\$concat_cmds\" - else - eval cmds=\"\$concat_cmds~\$old_archive_cmds\" - fi - fi - fi - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - eval cmd=\"$cmd\" - IFS="$save_ifs" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - done - - if test -n "$generated"; then - $show "${rm}r$generated" - $run ${rm}r$generated - fi - - # Now create the libtool archive. - case $output in - *.la) - old_library= - test "$build_old_libs" = yes && old_library="$libname.$libext" - $show "creating $output" - - # Preserve any variables that may affect compiler behavior - for var in $variables_saved_for_relink; do - if eval test -z \"\${$var+set}\"; then - relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command" - elif eval var_value=\$$var; test -z "$var_value"; then - relink_command="$var=; export $var; $relink_command" - else - var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"` - relink_command="$var=\"$var_value\"; export $var; $relink_command" - fi - done - # Quote the link command for shipping. - relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" - relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP` - if test "$hardcode_automatic" = yes ; then - relink_command= - fi - - - # Only create the output if not a dry run. - if test -z "$run"; then - for installed in no yes; do - if test "$installed" = yes; then - if test -z "$install_libdir"; then - break - fi - output="$output_objdir/$outputname"i - # Replace all uninstalled libtool libraries with the installed ones - newdependency_libs= - for deplib in $dependency_libs; do - case $deplib in - *.la) - name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'` - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` - if test -z "$libdir"; then - $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2 - exit $EXIT_FAILURE - fi - newdependency_libs="$newdependency_libs $libdir/$name" - ;; - *) newdependency_libs="$newdependency_libs $deplib" ;; - esac - done - dependency_libs="$newdependency_libs" - newdlfiles= - for lib in $dlfiles; do - name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` - if test -z "$libdir"; then - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - exit $EXIT_FAILURE - fi - newdlfiles="$newdlfiles $libdir/$name" - done - dlfiles="$newdlfiles" - newdlprefiles= - for lib in $dlprefiles; do - name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'` - eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` - if test -z "$libdir"; then - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - exit $EXIT_FAILURE - fi - newdlprefiles="$newdlprefiles $libdir/$name" - done - dlprefiles="$newdlprefiles" - else - newdlfiles= - for lib in $dlfiles; do - case $lib in - [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; - *) abs=`pwd`"/$lib" ;; - esac - newdlfiles="$newdlfiles $abs" - done - dlfiles="$newdlfiles" - newdlprefiles= - for lib in $dlprefiles; do - case $lib in - [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; - *) abs=`pwd`"/$lib" ;; - esac - newdlprefiles="$newdlprefiles $abs" - done - dlprefiles="$newdlprefiles" - fi - $rm $output - # place dlname in correct position for cygwin - tdlname=$dlname - case $host,$output,$installed,$module,$dlname in - *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; - esac - $echo > $output "\ -# $outputname - a libtool library file -# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP -# -# Please DO NOT delete this file! -# It is necessary for linking the library. - -# The name that we can dlopen(3). -dlname='$tdlname' - -# Names of this library. -library_names='$library_names' - -# The name of the static archive. -old_library='$old_library' - -# Libraries that this one depends upon. -dependency_libs='$dependency_libs' - -# Version information for $libname. -current=$current -age=$age -revision=$revision - -# Is this an already installed library? -installed=$installed - -# Should we warn about portability when linking against -modules? -shouldnotlink=$module - -# Files to dlopen/dlpreopen -dlopen='$dlfiles' -dlpreopen='$dlprefiles' - -# Directory that this library needs to be installed in: -libdir='$install_libdir'" - if test "$installed" = no && test "$need_relink" = yes; then - $echo >> $output "\ -relink_command=\"$relink_command\"" - fi - done - fi - - # Do a symbolic link so that the libtool archive can be found in - # LD_LIBRARY_PATH before the program is installed. - $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" - $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $? - ;; - esac - exit $EXIT_SUCCESS - ;; - - # libtool install mode - install) - modename="$modename: install" - - # There may be an optional sh(1) argument at the beginning of - # install_prog (especially on Windows NT). - if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || - # Allow the use of GNU shtool's install command. - $echo "X$nonopt" | grep shtool > /dev/null; then - # Aesthetically quote it. - arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - install_prog="$arg " - arg="$1" - shift - else - install_prog= - arg=$nonopt - fi - - # The real first argument should be the name of the installation program. - # Aesthetically quote it. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - install_prog="$install_prog$arg" - - # We need to accept at least all the BSD install flags. - dest= - files= - opts= - prev= - install_type= - isdir=no - stripme= - for arg - do - if test -n "$dest"; then - files="$files $dest" - dest=$arg - continue - fi - - case $arg in - -d) isdir=yes ;; - -f) - case " $install_prog " in - *[\\\ /]cp\ *) ;; - *) prev=$arg ;; - esac - ;; - -g | -m | -o) prev=$arg ;; - -s) - stripme=" -s" - continue - ;; - -*) - ;; - *) - # If the previous option needed an argument, then skip it. - if test -n "$prev"; then - prev= - else - dest=$arg - continue - fi - ;; - esac - - # Aesthetically quote the argument. - arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` - case $arg in - *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") - arg="\"$arg\"" - ;; - esac - install_prog="$install_prog $arg" - done - - if test -z "$install_prog"; then - $echo "$modename: you must specify an install program" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - if test -n "$prev"; then - $echo "$modename: the \`$prev' option requires an argument" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - if test -z "$files"; then - if test -z "$dest"; then - $echo "$modename: no file or destination specified" 1>&2 - else - $echo "$modename: you must specify a destination" 1>&2 - fi - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # Strip any trailing slash from the destination. - dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` - - # Check to see that the destination is a directory. - test -d "$dest" && isdir=yes - if test "$isdir" = yes; then - destdir="$dest" - destname= - else - destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` - test "X$destdir" = "X$dest" && destdir=. - destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` - - # Not a directory, so check to see that there is only one file specified. - set dummy $files - if test "$#" -gt 2; then - $echo "$modename: \`$dest' is not a directory" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - fi - case $destdir in - [\\/]* | [A-Za-z]:[\\/]*) ;; - *) - for file in $files; do - case $file in - *.lo) ;; - *) - $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - ;; - esac - done - ;; - esac - - # This variable tells wrapper scripts just to set variables rather - # than running their programs. - libtool_install_magic="$magic" - - staticlibs= - future_libdirs= - current_libdirs= - for file in $files; do - - # Do each installation. - case $file in - *.$libext) - # Do the static libraries later. - staticlibs="$staticlibs $file" - ;; - - *.la) - # Check to see that this really is a libtool archive. - if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : - else - $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - library_names= - old_library= - relink_command= - # If there is no directory component, then add one. - case $file in - */* | *\\*) . $file ;; - *) . ./$file ;; - esac - - # Add the libdir to current_libdirs if it is the destination. - if test "X$destdir" = "X$libdir"; then - case "$current_libdirs " in - *" $libdir "*) ;; - *) current_libdirs="$current_libdirs $libdir" ;; - esac - else - # Note the libdir as a future libdir. - case "$future_libdirs " in - *" $libdir "*) ;; - *) future_libdirs="$future_libdirs $libdir" ;; - esac - fi - - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/ - test "X$dir" = "X$file/" && dir= - dir="$dir$objdir" - - if test -n "$relink_command"; then - # Determine the prefix the user has applied to our future dir. - inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"` - - # Don't allow the user to place us outside of our expected - # location b/c this prevents finding dependent libraries that - # are installed to the same prefix. - # At present, this check doesn't affect windows .dll's that - # are installed into $libdir/../bin (currently, that works fine) - # but it's something to keep an eye on. - if test "$inst_prefix_dir" = "$destdir"; then - $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2 - exit $EXIT_FAILURE - fi - - if test -n "$inst_prefix_dir"; then - # Stick the inst_prefix_dir data into the link command. - relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%" | $NL2SP` - else - relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%%" | $NL2SP` - fi - - $echo "$modename: warning: relinking \`$file'" 1>&2 - $show "$relink_command" - if $run eval "$relink_command"; then : - else - $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 - exit $EXIT_FAILURE - fi - fi - - # See the names of the shared library. - set dummy $library_names - if test -n "$2"; then - realname="$2" - shift - shift - - srcname="$realname" - test -n "$relink_command" && srcname="$realname"T - - # Install the shared library and build the symlinks. - $show "$install_prog $dir/$srcname $destdir/$realname" - $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $? - if test -n "$stripme" && test -n "$striplib"; then - $show "$striplib $destdir/$realname" - $run eval "$striplib $destdir/$realname" || exit $? - fi - - if test "$#" -gt 0; then - # Delete the old symlinks, and create new ones. - # Try `ln -sf' first, because the `ln' binary might depend on - # the symlink we replace! Solaris /bin/ln does not understand -f, - # so we also need to try rm && ln -s. - for linkname - do - if test "$linkname" != "$realname"; then - $show "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" - $run eval "(cd $destdir && { $LN_S -f $realname $linkname || { $rm $linkname && $LN_S $realname $linkname; }; })" - fi - done - fi - - # Do each command in the postinstall commands. - lib="$destdir/$realname" - cmds=$postinstall_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || { - lt_exit=$? - - # Restore the uninstalled library and exit - if test "$mode" = relink; then - $run eval '(cd $output_objdir && $rm ${realname}T && $mv ${realname}U $realname)' - fi - - exit $lt_exit - } - done - IFS="$save_ifs" - fi - - # Install the pseudo-library for information purposes. - name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - instname="$dir/$name"i - $show "$install_prog $instname $destdir/$name" - $run eval "$install_prog $instname $destdir/$name" || exit $? - - # Maybe install the static library, too. - test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" - ;; - - *.lo) - # Install (i.e. copy) a libtool object. - - # Figure out destination file name, if it wasn't already specified. - if test -n "$destname"; then - destfile="$destdir/$destname" - else - destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - destfile="$destdir/$destfile" - fi - - # Deduce the name of the destination old-style object file. - case $destfile in - *.lo) - staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` - ;; - *.$objext) - staticdest="$destfile" - destfile= - ;; - *) - $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - # Install the libtool object if requested. - if test -n "$destfile"; then - $show "$install_prog $file $destfile" - $run eval "$install_prog $file $destfile" || exit $? - fi - - # Install the old object if enabled. - if test "$build_old_libs" = yes; then - # Deduce the name of the old-style object file. - staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` - - $show "$install_prog $staticobj $staticdest" - $run eval "$install_prog \$staticobj \$staticdest" || exit $? - fi - exit $EXIT_SUCCESS - ;; - - *) - # Figure out destination file name, if it wasn't already specified. - if test -n "$destname"; then - destfile="$destdir/$destname" - else - destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - destfile="$destdir/$destfile" - fi - - # If the file is missing, and there is a .exe on the end, strip it - # because it is most likely a libtool script we actually want to - # install - stripped_ext="" - case $file in - *.exe) - if test ! -f "$file"; then - file=`$echo $file|${SED} 's,.exe$,,'` - stripped_ext=".exe" - fi - ;; - esac - - # Do a test to see if this is really a libtool program. - case $host in - *cygwin*|*mingw*) - wrapper=`$echo $file | ${SED} -e 's,.exe$,,'` - ;; - *) - wrapper=$file - ;; - esac - if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then - notinst_deplibs= - relink_command= - - # Note that it is not necessary on cygwin/mingw to append a dot to - # foo even if both foo and FILE.exe exist: automatic-append-.exe - # behavior happens only for exec(3), not for open(2)! Also, sourcing - # `FILE.' does not work on cygwin managed mounts. - # - # If there is no directory component, then add one. - case $wrapper in - */* | *\\*) . ${wrapper} ;; - *) . ./${wrapper} ;; - esac - - # Check the variables that should have been set. - if test -z "$notinst_deplibs"; then - $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2 - exit $EXIT_FAILURE - fi - - finalize=yes - for lib in $notinst_deplibs; do - # Check to see that each library is installed. - libdir= - if test -f "$lib"; then - # If there is no directory component, then add one. - case $lib in - */* | *\\*) . $lib ;; - *) . ./$lib ;; - esac - fi - libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test - if test -n "$libdir" && test ! -f "$libfile"; then - $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 - finalize=no - fi - done - - relink_command= - # Note that it is not necessary on cygwin/mingw to append a dot to - # foo even if both foo and FILE.exe exist: automatic-append-.exe - # behavior happens only for exec(3), not for open(2)! Also, sourcing - # `FILE.' does not work on cygwin managed mounts. - # - # If there is no directory component, then add one. - case $wrapper in - */* | *\\*) . ${wrapper} ;; - *) . ./${wrapper} ;; - esac - - outputname= - if test "$fast_install" = no && test -n "$relink_command"; then - if test "$finalize" = yes && test -z "$run"; then - tmpdir=`func_mktempdir` - file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'` - outputname="$tmpdir/$file" - # Replace the output file specification. - relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g' | $NL2SP` - - $show "$relink_command" - if $run eval "$relink_command"; then : - else - $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 - ${rm}r "$tmpdir" - continue - fi - file="$outputname" - else - $echo "$modename: warning: cannot relink \`$file'" 1>&2 - fi - else - # Install the binary that we compiled earlier. - file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` - fi - fi - - # remove .exe since cygwin /usr/bin/install will append another - # one anyway - case $install_prog,$host in - */usr/bin/install*,*cygwin*) - case $file:$destfile in - *.exe:*.exe) - # this is ok - ;; - *.exe:*) - destfile=$destfile.exe - ;; - *:*.exe) - destfile=`$echo $destfile | ${SED} -e 's,.exe$,,'` - ;; - esac - ;; - esac - $show "$install_prog$stripme $file $destfile" - $run eval "$install_prog\$stripme \$file \$destfile" || exit $? - test -n "$outputname" && ${rm}r "$tmpdir" - ;; - esac - done - - for file in $staticlibs; do - name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - - # Set up the ranlib parameters. - oldlib="$destdir/$name" - - $show "$install_prog $file $oldlib" - $run eval "$install_prog \$file \$oldlib" || exit $? - - if test -n "$stripme" && test -n "$old_striplib"; then - $show "$old_striplib $oldlib" - $run eval "$old_striplib $oldlib" || exit $? - fi - - # Do each command in the postinstall commands. - cmds=$old_postinstall_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || exit $? - done - IFS="$save_ifs" - done - - if test -n "$future_libdirs"; then - $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 - fi - - if test -n "$current_libdirs"; then - # Maybe just do a dry run. - test -n "$run" && current_libdirs=" -n$current_libdirs" - exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' - else - exit $EXIT_SUCCESS - fi - ;; - - # libtool finish mode - finish) - modename="$modename: finish" - libdirs="$nonopt" - admincmds= - - if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then - for dir - do - libdirs="$libdirs $dir" - done - - for libdir in $libdirs; do - if test -n "$finish_cmds"; then - # Do each command in the finish commands. - cmds=$finish_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" || admincmds="$admincmds - $cmd" - done - IFS="$save_ifs" - fi - if test -n "$finish_eval"; then - # Do the single finish_eval. - eval cmds=\"$finish_eval\" - $run eval "$cmds" || admincmds="$admincmds - $cmds" - fi - done - fi - - # Exit here if they wanted silent mode. - test "$show" = : && exit $EXIT_SUCCESS - - $echo "X----------------------------------------------------------------------" | $Xsed - $echo "Libraries have been installed in:" - for libdir in $libdirs; do - $echo " $libdir" - done - $echo - $echo "If you ever happen to want to link against installed libraries" - $echo "in a given directory, LIBDIR, you must either use libtool, and" - $echo "specify the full pathname of the library, or use the \`-LLIBDIR'" - $echo "flag during linking and do at least one of the following:" - if test -n "$shlibpath_var"; then - $echo " - add LIBDIR to the \`$shlibpath_var' environment variable" - $echo " during execution" - fi - if test -n "$runpath_var"; then - $echo " - add LIBDIR to the \`$runpath_var' environment variable" - $echo " during linking" - fi - if test -n "$hardcode_libdir_flag_spec"; then - libdir=LIBDIR - eval flag=\"$hardcode_libdir_flag_spec\" - - $echo " - use the \`$flag' linker flag" - fi - if test -n "$admincmds"; then - $echo " - have your system administrator run these commands:$admincmds" - fi - if test -f /etc/ld.so.conf; then - $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" - fi - $echo - $echo "See any operating system documentation about shared libraries for" - $echo "more information, such as the ld(1) and ld.so(8) manual pages." - $echo "X----------------------------------------------------------------------" | $Xsed - exit $EXIT_SUCCESS - ;; - - # libtool execute mode - execute) - modename="$modename: execute" - - # The first argument is the command name. - cmd="$nonopt" - if test -z "$cmd"; then - $echo "$modename: you must specify a COMMAND" 1>&2 - $echo "$help" - exit $EXIT_FAILURE - fi - - # Handle -dlopen flags immediately. - for file in $execute_dlfiles; do - if test ! -f "$file"; then - $echo "$modename: \`$file' is not a file" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - dir= - case $file in - *.la) - # Check to see that this really is a libtool archive. - if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : - else - $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - # Read the libtool library. - dlname= - library_names= - - # If there is no directory component, then add one. - case $file in - */* | *\\*) . $file ;; - *) . ./$file ;; - esac - - # Skip this library if it cannot be dlopened. - if test -z "$dlname"; then - # Warn if it was a shared library. - test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" - continue - fi - - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` - test "X$dir" = "X$file" && dir=. - - if test -f "$dir/$objdir/$dlname"; then - dir="$dir/$objdir" - else - $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 - exit $EXIT_FAILURE - fi - ;; - - *.lo) - # Just add the directory containing the .lo file. - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` - test "X$dir" = "X$file" && dir=. - ;; - - *) - $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 - continue - ;; - esac - - # Get the absolute pathname. - absdir=`cd "$dir" && pwd` - test -n "$absdir" && dir="$absdir" - - # Now add the directory to shlibpath_var. - if eval "test -z \"\$$shlibpath_var\""; then - eval "$shlibpath_var=\"\$dir\"" - else - eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" - fi - done - - # This variable tells wrapper scripts just to set shlibpath_var - # rather than running their programs. - libtool_execute_magic="$magic" - - # Check if any of the arguments is a wrapper script. - args= - for file - do - case $file in - -*) ;; - *) - # Do a test to see if this is really a libtool program. - if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - # If there is no directory component, then add one. - case $file in - */* | *\\*) . $file ;; - *) . ./$file ;; - esac - - # Transform arg to wrapped name. - file="$progdir/$program" - fi - ;; - esac - # Quote arguments (to preserve shell metacharacters). - file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` - args="$args \"$file\"" - done - - if test -z "$run"; then - if test -n "$shlibpath_var"; then - # Export the shlibpath_var. - eval "export $shlibpath_var" - fi - - # Restore saved environment variables - for lt_var in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES - do - eval "if test \"\${save_$lt_var+set}\" = set; then - $lt_var=\$save_$lt_var; export $lt_var - 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 - ;; - - # libtool clean and uninstall mode - clean | uninstall) - modename="$modename: $mode" - rm="$nonopt" - files= - rmforce= - exit_status=0 - - # This variable tells wrapper scripts just to set variables rather - # than running their programs. - libtool_install_magic="$magic" - - for arg - do - case $arg in - -f) rm="$rm $arg"; rmforce=yes ;; - -*) rm="$rm $arg" ;; - *) files="$files $arg" ;; - esac - done - - if test -z "$rm"; then - $echo "$modename: you must specify an RM program" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - fi - - rmdirs= - - origobjdir="$objdir" - for file in $files; do - dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` - if test "X$dir" = "X$file"; then - dir=. - objdir="$origobjdir" - else - objdir="$dir/$origobjdir" - fi - name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` - test "$mode" = uninstall && objdir="$dir" - - # Remember objdir for removal later, being careful to avoid duplicates - if test "$mode" = clean; then - case " $rmdirs " in - *" $objdir "*) ;; - *) rmdirs="$rmdirs $objdir" ;; - esac - fi - - # Don't error if the file doesn't exist and rm -f was used. - if (test -L "$file") >/dev/null 2>&1 \ - || (test -h "$file") >/dev/null 2>&1 \ - || test -f "$file"; then - : - elif test -d "$file"; then - exit_status=1 - continue - elif test "$rmforce" = yes; then - continue - fi - - rmfiles="$file" - - case $name in - *.la) - # Possibly a libtool archive, so verify it. - if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - . $dir/$name - - # Delete the libtool libraries and symlinks. - for n in $library_names; do - rmfiles="$rmfiles $objdir/$n" - done - test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" - - case "$mode" in - clean) - case " $library_names " in - # " " in the beginning catches empty $dlname - *" $dlname "*) ;; - *) rmfiles="$rmfiles $objdir/$dlname" ;; - esac - test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" - ;; - uninstall) - if test -n "$library_names"; then - # Do each command in the postuninstall commands. - cmds=$postuninstall_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" - if test "$?" -ne 0 && test "$rmforce" != yes; then - exit_status=1 - fi - done - IFS="$save_ifs" - fi - - if test -n "$old_library"; then - # Do each command in the old_postuninstall commands. - cmds=$old_postuninstall_cmds - save_ifs="$IFS"; IFS='~' - for cmd in $cmds; do - IFS="$save_ifs" - eval cmd=\"$cmd\" - $show "$cmd" - $run eval "$cmd" - if test "$?" -ne 0 && test "$rmforce" != yes; then - exit_status=1 - fi - done - IFS="$save_ifs" - fi - # FIXME: should reinstall the best remaining shared library. - ;; - esac - fi - ;; - - *.lo) - # Possibly a libtool object, so verify it. - if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - - # Read the .lo file - . $dir/$name - - # Add PIC object to the list of files to remove. - if test -n "$pic_object" \ - && test "$pic_object" != none; then - rmfiles="$rmfiles $dir/$pic_object" - fi - - # Add non-PIC object to the list of files to remove. - if test -n "$non_pic_object" \ - && test "$non_pic_object" != none; then - rmfiles="$rmfiles $dir/$non_pic_object" - fi - fi - ;; - - *) - if test "$mode" = clean ; then - noexename=$name - case $file in - *.exe) - file=`$echo $file|${SED} 's,.exe$,,'` - noexename=`$echo $name|${SED} 's,.exe$,,'` - # $file with .exe has already been added to rmfiles, - # add $file without .exe - rmfiles="$rmfiles $file" - ;; - esac - # Do a test to see if this is a libtool program. - if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then - relink_command= - . $dir/$noexename - - # note $name still contains .exe if it was in $file originally - # as does the version of $file that was added into $rmfiles - rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" - if test "$fast_install" = yes && test -n "$relink_command"; then - rmfiles="$rmfiles $objdir/lt-$name" - fi - if test "X$noexename" != "X$name" ; then - rmfiles="$rmfiles $objdir/lt-${noexename}.c" - fi - fi - fi - ;; - esac - $show "$rm $rmfiles" - $run $rm $rmfiles || exit_status=1 - done - objdir="$origobjdir" - - # Try to remove the ${objdir}s in the directories where we deleted files - for dir in $rmdirs; do - if test -d "$dir"; then - $show "rmdir $dir" - $run rmdir $dir >/dev/null 2>&1 - fi - done - - exit $exit_status - ;; - - "") - $echo "$modename: you must specify a MODE" 1>&2 - $echo "$generic_help" 1>&2 - exit $EXIT_FAILURE - ;; - esac - - if test -z "$exec_cmd"; then - $echo "$modename: invalid operation mode \`$mode'" 1>&2 - $echo "$generic_help" 1>&2 - exit $EXIT_FAILURE - fi -fi # test -z "$show_help" - -if test -n "$exec_cmd"; then - eval exec $exec_cmd - exit $EXIT_FAILURE -fi - -# We need to display help for each of the modes. -case $mode in -"") $echo \ -"Usage: $modename [OPTION]... [MODE-ARG]... - -Provide generalized library-building support services. - - --config show all configuration variables - --debug enable verbose shell tracing --n, --dry-run display commands without modifying any files - --features display basic configuration information and exit - --finish same as \`--mode=finish' - --help display this help message and exit - --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] - --quiet same as \`--silent' - --silent don't print informational messages - --tag=TAG use configuration variables from tag TAG - --version print version information - -MODE must be one of the following: - - clean remove files from the build directory - compile compile a source file into a libtool object - execute automatically set library path, then run a program - finish complete the installation of libtool libraries - install install libraries or executables - link create a library or an executable - uninstall remove libraries from an installed directory - -MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for -a more detailed description of MODE. - -Report bugs to <bug-libtool@gnu.org>." - exit $EXIT_SUCCESS - ;; - -clean) - $echo \ -"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE... - -Remove files from the build directory. - -RM is the name of the program to use to delete files associated with each FILE -(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed -to RM. - -If FILE is a libtool library, object or program, all the files associated -with it are deleted. Otherwise, only FILE itself is deleted using RM." - ;; - -compile) - $echo \ -"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE - -Compile a source file into a libtool library object. - -This mode accepts the following additional options: - - -o OUTPUT-FILE set the output file name to OUTPUT-FILE - -prefer-pic try to building PIC objects only - -prefer-non-pic try to building non-PIC objects only - -static always build a \`.o' file suitable for static linking - -COMPILE-COMMAND is a command to be used in creating a \`standard' object file -from the given SOURCEFILE. - -The output file name is determined by removing the directory component from -SOURCEFILE, then substituting the C source code suffix \`.c' with the -library object suffix, \`.lo'." - ;; - -execute) - $echo \ -"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... - -Automatically set library path, then run a program. - -This mode accepts the following additional options: - - -dlopen FILE add the directory containing FILE to the library path - -This mode sets the library path environment variable according to \`-dlopen' -flags. - -If any of the ARGS are libtool executable wrappers, then they are translated -into their corresponding uninstalled binary, and any of their required library -directories are added to the library path. - -Then, COMMAND is executed, with ARGS as arguments." - ;; - -finish) - $echo \ -"Usage: $modename [OPTION]... --mode=finish [LIBDIR]... - -Complete the installation of libtool libraries. - -Each LIBDIR is a directory that contains libtool libraries. - -The commands that this mode executes may require superuser privileges. Use -the \`--dry-run' option if you just want to see what would be executed." - ;; - -install) - $echo \ -"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... - -Install executables or libraries. - -INSTALL-COMMAND is the installation command. The first component should be -either the \`install' or \`cp' program. - -The rest of the components are interpreted as arguments to that command (only -BSD-compatible install options are recognized)." - ;; - -link) - $echo \ -"Usage: $modename [OPTION]... --mode=link LINK-COMMAND... - -Link object files or libraries together to form another library, or to -create an executable program. - -LINK-COMMAND is a command using the C compiler that you would use to create -a program from several object files. - -The following components of LINK-COMMAND are treated specially: - - -all-static do not do any dynamic linking at all - -avoid-version do not add a version suffix if possible - -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime - -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols - -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) - -export-symbols SYMFILE - try to export only the symbols listed in SYMFILE - -export-symbols-regex REGEX - try to export only the symbols matching REGEX - -LLIBDIR search LIBDIR for required installed libraries - -lNAME OUTPUT-FILE requires the installed library libNAME - -module build a library that can dlopened - -no-fast-install disable the fast-install mode - -no-install link a not-installable executable - -no-undefined declare that a library does not refer to external symbols - -o OUTPUT-FILE create OUTPUT-FILE from the specified objects - -objectlist FILE Use a list of object files found in FILE to specify objects - -precious-files-regex REGEX - don't remove output files matching REGEX - -release RELEASE specify package release information - -rpath LIBDIR the created library will eventually be installed in LIBDIR - -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries - -static do not do any dynamic linking of uninstalled libtool libraries - -static-libtool-libs - do not do any dynamic linking of libtool libraries - -version-info CURRENT[:REVISION[:AGE]] - specify library version info [each variable defaults to 0] - -All other options (arguments beginning with \`-') are ignored. - -Every other argument is treated as a filename. Files ending in \`.la' are -treated as uninstalled libtool libraries, other files are standard or library -object files. - -If the OUTPUT-FILE ends in \`.la', then a libtool library is created, -only library objects (\`.lo' files) may be specified, and \`-rpath' is -required, except when creating a convenience library. - -If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created -using \`ar' and \`ranlib', or on Windows using \`lib'. - -If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file -is created, otherwise an executable program is created." - ;; - -uninstall) - $echo \ -"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... - -Remove libraries from an installation directory. - -RM is the name of the program to use to delete files associated with each FILE -(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed -to RM. - -If FILE is a libtool library, all the files associated with it are deleted. -Otherwise, only FILE itself is deleted using RM." - ;; - -*) - $echo "$modename: invalid operation mode \`$mode'" 1>&2 - $echo "$help" 1>&2 - exit $EXIT_FAILURE - ;; -esac - -$echo -$echo "Try \`$modename --help' for more information about other modes." - -exit $? - -# The TAGs below are defined such that we never get into a situation -# in which we disable both kinds of libraries. Given conflicting -# choices, we go for a static library, that is the most portable, -# since we can't tell whether shared libraries were disabled because -# the user asked for that or because the platform doesn't support -# them. This is particularly important on AIX, because we don't -# support having both static and shared libraries enabled at the same -# time on that platform, so we default to a shared-only configuration. -# If a disable-shared tag is given, we'll fallback to a static-only -# configuration. But we'll never go from static-only to shared-only. - -# ### BEGIN LIBTOOL TAG CONFIG: disable-shared -disable_libs=shared -# ### END LIBTOOL TAG CONFIG: disable-shared - -# ### BEGIN LIBTOOL TAG CONFIG: disable-static -disable_libs=static -# ### END LIBTOOL TAG CONFIG: disable-static - -# Local Variables: -# mode:shell-script -# sh-indentation:2 -# End: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/m4/libtool.m4 /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/m4/libtool.m4 --- open-vm-tools-2008.01.23-74039/m4/libtool.m4 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/m4/libtool.m4 2008-10-13 08:02:04.000000000 +0100 @@ -0,0 +1,7252 @@ +# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- +# +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008 Free Software Foundation, Inc. +# Written by Gordon Matzigkeit, 1996 +# +# 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. + +m4_define([_LT_COPYING], [dnl +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, +# 2006, 2007, 2008 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. +]) + +# serial 54 LT_INIT + + +# LT_PREREQ(VERSION) +# ------------------ +# Complain and exit if this libtool version is less that VERSION. +m4_defun([LT_PREREQ], +[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, + [m4_default([$3], + [m4_fatal([Libtool version $1 or higher is required], + 63)])], + [$2])]) + + +# _LT_CHECK_BUILDDIR +# ------------------ +# Complain if the absolute build directory name contains unusual characters +m4_defun([_LT_CHECK_BUILDDIR], +[case `pwd` in + *\ * | *\ *) + AC_MSG_WARN([Libtool does not cope well with whitespace in \`pwd\`]) ;; +esac +]) + + +# LT_INIT([OPTIONS]) +# ------------------ +AC_DEFUN([LT_INIT], +[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT +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 + +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]) +])# LT_INIT + +# Old names: +AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) +AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PROG_LIBTOOL], []) +dnl AC_DEFUN([AM_PROG_LIBTOOL], []) + + +# _LT_CC_BASENAME(CC) +# ------------------- +# Calculate cc_basename. Skip known compiler wrappers and cross-prefix. +m4_defun([_LT_CC_BASENAME], +[for cc_temp in $1""; do + case $cc_temp in + compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; + distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; + \-*) ;; + *) break;; + esac +done +cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` +]) + + +# _LT_FILEUTILS_DEFAULTS +# ---------------------- +# It is okay to use these file commands and assume they have been set +# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. +m4_defun([_LT_FILEUTILS_DEFAULTS], +[: ${CP="cp -f"} +: ${MV="mv -f"} +: ${RM="rm -f"} +])# _LT_FILEUTILS_DEFAULTS + + +# _LT_SETUP +# --------- +m4_defun([_LT_SETUP], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +_LT_DECL([], [host_alias], [0], [The host system])dnl +_LT_DECL([], [host], [0])dnl +_LT_DECL([], [host_os], [0])dnl +dnl +_LT_DECL([], [build_alias], [0], [The build system])dnl +_LT_DECL([], [build], [0])dnl +_LT_DECL([], [build_os], [0])dnl +dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([LT_PATH_LD])dnl +AC_REQUIRE([LT_PATH_NM])dnl +dnl +AC_REQUIRE([AC_PROG_LN_S])dnl +test -z "$LN_S" && LN_S="ln -s" +_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl +dnl +AC_REQUIRE([LT_CMD_MAX_LEN])dnl +AC_REQUIRE([AC_OBJEXT])dnl +_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl +AC_REQUIRE([AC_EXEEXT])dnl +_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl +dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_CHECK_SHELL_FEATURES])dnl +m4_require([_LT_CMD_RELOAD])dnl +m4_require([_LT_CHECK_MAGIC_METHOD])dnl +m4_require([_LT_CMD_OLD_ARCHIVE])dnl +m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl + +_LT_CONFIG_LIBTOOL_INIT([ +# 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 +]) +if test -n "${ZSH_VERSION+set}" ; then + setopt NO_GLOB_SUBST +fi + +_LT_CHECK_OBJDIR + +m4_require([_LT_TAG_COMPILER])dnl +_LT_PROG_ECHO_BACKSLASH + +case $host_os in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +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' + +# 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 + +_LT_CC_BASENAME([$compiler]) + +# 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 + _LT_PATH_MAGIC + fi + ;; +esac + +# Use C for the default configuration in the libtool script +LT_SUPPORTED_TAG([CC]) +_LT_LANG_C_CONFIG +_LT_LANG_DEFAULT_CONFIG +_LT_CONFIG_COMMANDS +])# _LT_SETUP + + +# _LT_PROG_LTMAIN +# --------------- +# Note that this code is called both from `configure', and `config.status' +# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, +# `config.status' has no value for ac_aux_dir unless we are using Automake, +# so we pass a copy along to make sure it has a sensible value anyway. +m4_defun([_LT_PROG_LTMAIN], +[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl +_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) +ltmain="$ac_aux_dir/ltmain.sh" +])# _LT_PROG_LTMAIN + + +## ------------------------------------- ## +## Accumulate code for creating libtool. ## +## ------------------------------------- ## + +# So that we can recreate a full libtool script including additional +# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS +# in macros and then make a single call at the end using the `libtool' +# label. + + +# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) +# ---------------------------------------- +# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL_INIT], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_INIT], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_INIT]) + + +# _LT_CONFIG_LIBTOOL([COMMANDS]) +# ------------------------------ +# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. +m4_define([_LT_CONFIG_LIBTOOL], +[m4_ifval([$1], + [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], + [$1 +])])]) + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) + + +# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) +# ----------------------------------------------------- +m4_defun([_LT_CONFIG_SAVE_COMMANDS], +[_LT_CONFIG_LIBTOOL([$1]) +_LT_CONFIG_LIBTOOL_INIT([$2]) +]) + + +# _LT_FORMAT_COMMENT([COMMENT]) +# ----------------------------- +# Add leading comment marks to the start of each line, and a trailing +# full-stop to the whole comment if one is not present already. +m4_define([_LT_FORMAT_COMMENT], +[m4_ifval([$1], [ +m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], + [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) +)]) + + + +## ------------------------ ## +## FIXME: Eliminate VARNAME ## +## ------------------------ ## + + +# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) +# ------------------------------------------------------------------- +# CONFIGNAME is the name given to the value in the libtool script. +# VARNAME is the (base) name used in the configure script. +# VALUE may be 0, 1 or 2 for a computed quote escaped value based on +# VARNAME. Any other value will be used directly. +m4_define([_LT_DECL], +[lt_if_append_uniq([lt_decl_varnames], [$2], [, ], + [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], + [m4_ifval([$1], [$1], [$2])]) + lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) + m4_ifval([$4], + [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) + lt_dict_add_subkey([lt_decl_dict], [$2], + [tagged?], [m4_ifval([$5], [yes], [no])])]) +]) + + +# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) +# -------------------------------------------------------- +m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) + + +# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_tag_varnames], +[_lt_decl_filter([tagged?], [yes], $@)]) + + +# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) +# --------------------------------------------------------- +m4_define([_lt_decl_filter], +[m4_case([$#], + [0], [m4_fatal([$0: too few arguments: $#])], + [1], [m4_fatal([$0: too few arguments: $#: $1])], + [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], + [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], + [lt_dict_filter([lt_decl_dict], $@)])[]dnl +]) + + +# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) +# -------------------------------------------------- +m4_define([lt_decl_quote_varnames], +[_lt_decl_filter([value], [1], $@)]) + + +# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_dquote_varnames], +[_lt_decl_filter([value], [2], $@)]) + + +# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) +# --------------------------------------------------- +m4_define([lt_decl_varnames_tagged], +[_$0(m4_quote(m4_default([$1], [[, ]])), + m4_quote(m4_if([$2], [], + m4_quote(lt_decl_tag_varnames), + m4_quote(m4_shift($@)))), + m4_split(m4_normalize(m4_quote(_LT_TAGS))))]) +m4_define([_lt_decl_varnames_tagged], [lt_combine([$1], [$2], [_], $3)]) + + +# lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) +# ------------------------------------------------ +m4_define([lt_decl_all_varnames], +[_$0(m4_quote(m4_default([$1], [[, ]])), + m4_if([$2], [], + m4_quote(lt_decl_varnames), + m4_quote(m4_shift($@))))[]dnl +]) +m4_define([_lt_decl_all_varnames], +[lt_join($@, lt_decl_varnames_tagged([$1], + lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl +]) + + +# _LT_CONFIG_STATUS_DECLARE([VARNAME]) +# ------------------------------------ +# Quote a variable value, and forward it to `config.status' so that its +# declaration there will have the same value as in `configure'. VARNAME +# must have a single quote delimited value for this to work. +m4_define([_LT_CONFIG_STATUS_DECLARE], +[$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`']) + + +# _LT_CONFIG_STATUS_DECLARATIONS +# ------------------------------ +# We delimit libtool config variables with single quotes, so when +# we write them to config.status, we have to be sure to quote all +# embedded single quotes properly. In configure, this macro expands +# each variable declared with _LT_DECL (and _LT_TAGDECL) into: +# +# <var>='`$ECHO "X$<var>" | $Xsed -e "$delay_single_quote_subst"`' +m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], +[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), + [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAGS +# ---------------- +# Output comment and list of tags supported by the script +m4_defun([_LT_LIBTOOL_TAGS], +[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl +available_tags="_LT_TAGS"dnl +]) + + +# _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) +# ----------------------------------- +# Extract the dictionary values for VARNAME (optionally with TAG) and +# expand to a commented shell variable setting: +# +# # Some comment about what VAR is for. +# visible_name=$lt_internal_name +m4_define([_LT_LIBTOOL_DECLARE], +[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], + [description])))[]dnl +m4_pushdef([_libtool_name], + m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl +m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), + [0], [_libtool_name=[$]$1], + [1], [_libtool_name=$lt_[]$1], + [2], [_libtool_name=$lt_[]$1], + [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl +m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl +]) + + +# _LT_LIBTOOL_CONFIG_VARS +# ----------------------- +# Produce commented declarations of non-tagged libtool config variables +# suitable for insertion in the LIBTOOL CONFIG section of the `libtool' +# script. Tagged libtool config variables (even for the LIBTOOL CONFIG +# section) are produced by _LT_LIBTOOL_TAG_VARS. +m4_defun([_LT_LIBTOOL_CONFIG_VARS], +[m4_foreach([_lt_var], + m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) + + +# _LT_LIBTOOL_TAG_VARS(TAG) +# ------------------------- +m4_define([_LT_LIBTOOL_TAG_VARS], +[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), + [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) + + +# _LT_TAGVAR(VARNAME, [TAGNAME]) +# ------------------------------ +m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) + + +# _LT_CONFIG_COMMANDS +# ------------------- +# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of +# variables for single and double quote escaping we saved from calls +# to _LT_DECL, we can put quote escaped variables declarations +# into `config.status', and then the shell code to quote escape them in +# for loops in `config.status'. Finally, any additional code accumulated +# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. +m4_defun([_LT_CONFIG_COMMANDS], +[AC_PROVIDE_IFELSE([LT_OUTPUT], + dnl If the libtool generation code has been placed in $CONFIG_LT, + dnl instead of duplicating it all over again into config.status, + dnl then we will have config.status run $CONFIG_LT later, so it + dnl needs to know what name is stored there: + [AC_CONFIG_COMMANDS([libtool], + [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], + dnl If the libtool generation code is destined for config.status, + dnl expand the accumulated commands and init code now: + [AC_CONFIG_COMMANDS([libtool], + [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) +])#_LT_CONFIG_COMMANDS + + +# Initialize. +m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], +[ + +# 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' +_LT_CONFIG_STATUS_DECLARATIONS +LTCC='$LTCC' +LTCFLAGS='$LTCFLAGS' +compiler='$compiler_DEFAULT' + +# Quote evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_quote_varnames); do + case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Double-quote double-evaled strings. +for var in lt_decl_all_varnames([[ \ +]], lt_decl_dquote_varnames); do + case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in + *[[\\\\\\\`\\"\\\$]]*) + eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" + ;; + *) + eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" + ;; + esac +done + +# Fix-up fallback echo if it was mangled by the above quoting rules. +case \$lt_ECHO in +*'\\\[$]0 --fallback-echo"')dnl " + lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\` + ;; +esac + +_LT_OUTPUT_LIBTOOL_INIT +]) + + +# LT_OUTPUT +# --------- +# This macro allows early generation of the libtool script (before +# AC_OUTPUT is called), incase it is used in configure for compilation +# tests. +AC_DEFUN([LT_OUTPUT], +[: ${CONFIG_LT=./config.lt} +AC_MSG_NOTICE([creating $CONFIG_LT]) +cat >"$CONFIG_LT" <<_LTEOF +#! $SHELL +# Generated by $as_me. +# Run this file to recreate a libtool stub with the current configuration. + +lt_cl_silent=false +SHELL=\${CONFIG_SHELL-$SHELL} +_LTEOF + +cat >>"$CONFIG_LT" <<\_LTEOF +AS_SHELL_SANITIZE +_AS_PREPARE + +exec AS_MESSAGE_FD>&1 +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 <bug-libtool@gnu.org>." + +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) 2008 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. +if test "$no_create" != yes; then + 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) +fi +])# LT_OUTPUT + + +# _LT_CONFIG(TAG) +# --------------- +# If TAG is the built-in tag, create an initial libtool script with a +# default configuration from the untagged config vars. Otherwise add code +# to config.status for appending the configuration named by TAG from the +# matching tagged config vars. +m4_defun([_LT_CONFIG], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_LT_CONFIG_SAVE_COMMANDS([ + m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl + m4_if(_LT_TAG, [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 (GNU $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. +# +_LT_COPYING +_LT_LIBTOOL_TAGS + +# ### BEGIN LIBTOOL CONFIG +_LT_LIBTOOL_CONFIG_VARS +_LT_LIBTOOL_TAG_VARS +# ### 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 + + _LT_PROG_LTMAIN + + # 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 '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + _LT_PROG_XSI_SHELLFNS + + sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ + || (rm -f "$cfgfile"; exit 1) + + mv -f "$cfgfile" "$ofile" || + (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") + chmod +x "$ofile" +], +[cat <<_LT_EOF >> "$ofile" + +dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded +dnl in a comment (ie after a #). +# ### BEGIN LIBTOOL TAG CONFIG: $1 +_LT_LIBTOOL_TAG_VARS(_LT_TAG) +# ### END LIBTOOL TAG CONFIG: $1 +_LT_EOF +])dnl /m4_if +], +[m4_if([$1], [], [ + PACKAGE='$PACKAGE' + VERSION='$VERSION' + TIMESTAMP='$TIMESTAMP' + RM='$RM' + ofile='$ofile'], []) +])dnl /_LT_CONFIG_SAVE_COMMANDS +])# _LT_CONFIG + + +# LT_SUPPORTED_TAG(TAG) +# --------------------- +# Trace this macro to discover what tags are supported by the libtool +# --tag option, using: +# autoconf --trace 'LT_SUPPORTED_TAG:$1' +AC_DEFUN([LT_SUPPORTED_TAG], []) + + +# C support is built-in for now +m4_define([_LT_LANG_C_enabled], []) +m4_define([_LT_TAGS], []) + + +# LT_LANG(LANG) +# ------------- +# Enable libtool support for the given language if not already enabled. +AC_DEFUN([LT_LANG], +[AC_BEFORE([$0], [LT_OUTPUT])dnl +m4_case([$1], + [C], [_LT_LANG(C)], + [C++], [_LT_LANG(CXX)], + [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 +])# LT_LANG + + +# _LT_LANG(LANGNAME) +# ------------------ +m4_defun([_LT_LANG], +[m4_ifdef([_LT_LANG_]$1[_enabled], [], + [LT_SUPPORTED_TAG([$1])dnl + m4_append([_LT_TAGS], [$1 ])dnl + m4_define([_LT_LANG_]$1[_enabled], [])dnl + _LT_LANG_$1_CONFIG($1)])dnl +])# _LT_LANG + + +# _LT_LANG_DEFAULT_CONFIG +# ----------------------- +m4_defun([_LT_LANG_DEFAULT_CONFIG], +[AC_PROVIDE_IFELSE([AC_PROG_CXX], + [LT_LANG(CXX)], + [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) + +AC_PROVIDE_IFELSE([AC_PROG_F77], + [LT_LANG(F77)], + [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) + +AC_PROVIDE_IFELSE([AC_PROG_FC], + [LT_LANG(FC)], + [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) + +dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal +dnl pulling things in needlessly. +AC_PROVIDE_IFELSE([AC_PROG_GCJ], + [LT_LANG(GCJ)], + [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], + [LT_LANG(GCJ)], + [AC_PROVIDE_IFELSE([LT_PROG_GCJ], + [LT_LANG(GCJ)], + [m4_ifdef([AC_PROG_GCJ], + [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) + m4_ifdef([A][M_PROG_GCJ], + [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) + m4_ifdef([LT_PROG_GCJ], + [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) + +AC_PROVIDE_IFELSE([LT_PROG_RC], + [LT_LANG(RC)], + [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) +])# _LT_LANG_DEFAULT_CONFIG + +# Obsolete macros: +AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) +AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) +AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) +AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_CXX], []) +dnl AC_DEFUN([AC_LIBTOOL_F77], []) +dnl AC_DEFUN([AC_LIBTOOL_FC], []) +dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) + + +# _LT_TAG_COMPILER +# ---------------- +m4_defun([_LT_TAG_COMPILER], +[AC_REQUIRE([AC_PROG_CC])dnl + +_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl +_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl +_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl +_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl + +# 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 +])# _LT_TAG_COMPILER + + +# _LT_COMPILER_BOILERPLATE +# ------------------------ +# Check for compiler boilerplate output or warnings with +# the simple compiler test code. +m4_defun([_LT_COMPILER_BOILERPLATE], +[m4_require([_LT_DECL_SED])dnl +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* +])# _LT_COMPILER_BOILERPLATE + + +# _LT_LINKER_BOILERPLATE +# ---------------------- +# Check for linker boilerplate output or warnings with +# the simple link test code. +m4_defun([_LT_LINKER_BOILERPLATE], +[m4_require([_LT_DECL_SED])dnl +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* +])# _LT_LINKER_BOILERPLATE + +# _LT_REQUIRED_DARWIN_CHECKS +# ------------------------- +m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ + case $host_os in + rhapsody* | darwin*) + AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) + AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) + _LT_DECL([], [DSYMUTIL], [1], + [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) + _LT_DECL([], [NMEDIT], [1], + [Tool to change global to local symbols on Mac OS X]) + + AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], + [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. + echo "int foo(void){return 1;}" > conftest.c + $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ + -dynamiclib ${wl}-single_module conftest.c + if test -f libconftest.dylib; then + lt_cv_apple_cc_single_mod=yes + rm -rf libconftest.dylib* + fi + rm conftest.c + fi]) + AC_CACHE_CHECK([for -exported_symbols_list linker flag], + [lt_cv_ld_exported_symbols_list], + [lt_cv_ld_exported_symbols_list=no + save_LDFLAGS=$LDFLAGS + echo "_main" > conftest.sym + LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [lt_cv_ld_exported_symbols_list=yes], + [lt_cv_ld_exported_symbols_list=no]) + LDFLAGS="$save_LDFLAGS" + ]) + 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" != ":"; then + _lt_dsymutil='~$DSYMUTIL $lib || :' + else + _lt_dsymutil= + fi + ;; + esac +]) + + +# _LT_DARWIN_LINKER_FEATURES +# -------------------------- +# Checks for linker and compiler features on darwin +m4_defun([_LT_DARWIN_LINKER_FEATURES], +[ + m4_require([_LT_REQUIRED_DARWIN_CHECKS]) + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_automatic, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_TAGVAR(whole_archive_flag_spec, $1)='' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" + if test "$GCC" = "yes"; then + output_verbose_link_cmd=echo + _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" + _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" + _LT_TAGVAR(archive_expsym_cmds, $1)="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}" + _LT_TAGVAR(module_expsym_cmds, $1)="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}" + m4_if([$1], [CXX], +[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then + _LT_TAGVAR(archive_cmds, $1)="\$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}" + _LT_TAGVAR(archive_expsym_cmds, $1)="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 + _LT_TAGVAR(ld_shlibs, $1)=no + fi +]) + +# _LT_SYS_MODULE_PATH_AIX +# ----------------------- +# Links a minimal program and checks the executable +# for the system default hardcoded library path. In most cases, +# this is /usr/lib:/lib, but when the MPI compilers are used +# the location of the communication and MPI libs are included too. +# If we don't find anything, use the default library path according +# to the aix ld manual. +m4_defun([_LT_SYS_MODULE_PATH_AIX], +[m4_require([_LT_DECL_SED])dnl +AC_LINK_IFELSE(AC_LANG_PROGRAM,[ +lt_aix_libpath_sed=' + /Import File Strings/,/^$/ { + /^0/ { + s/^0 *\(.*\)$/\1/ + p + } + }' +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 "$aix_libpath"; then + aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` +fi],[]) +if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi +])# _LT_SYS_MODULE_PATH_AIX + + +# _LT_SHELL_INIT(ARG) +# ------------------- +m4_define([_LT_SHELL_INIT], +[ifdef([AC_DIVERSION_NOTICE], + [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], + [AC_DIVERT_PUSH(NOTICE)]) +$1 +AC_DIVERT_POP +])# _LT_SHELL_INIT + + +# _LT_PROG_ECHO_BACKSLASH +# ----------------------- +# Add some code to the start of the generated configure script which +# will find an echo command which doesn't interpret backslashes. +m4_defun([_LT_PROG_ECHO_BACKSLASH], +[_LT_SHELL_INIT([ +# Check that we are running under the correct shell. +SHELL=${CONFIG_SHELL-/bin/sh} + +case X$lt_ECHO in +X*--fallback-echo) + # Remove one level of quotation (which was required for Make). + ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` + ;; +esac + +ECHO=${lt_ECHO-echo} +if test "X[$]1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X[$]1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then + # Yippee, $ECHO works! + : +else + # Restart under the correct shell. + exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} +fi + +if test "X[$]1" = X--fallback-echo; then + # used as fallback echo + shift + cat <<_LT_EOF +[$]* +_LT_EOF + exit 0 +fi + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +if test -z "$lt_ECHO"; then + if test "X${echo_test_string+set}" != Xset; then + # find a string as large as possible, as long as the shell can cope with it + for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do + # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... + if { echo_test_string=`eval $cmd`; } 2>/dev/null && + { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null + then + break + fi + done + fi + + if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + : + else + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + + lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR + for dir in $PATH /usr/ucb; do + IFS="$lt_save_ifs" + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + ECHO="$dir/echo" + break + fi + done + IFS="$lt_save_ifs" + + if test "X$ECHO" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + ECHO='print -r' + elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running configure again with it. + ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} + else + # Try using printf. + ECHO='printf %s\n' + if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && + echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + # Cool, printf works + : + elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + ECHO="$CONFIG_SHELL [$]0 --fallback-echo" + elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && + test "X$echo_testing_string" = 'X\t' && + echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && + test "X$echo_testing_string" = "X$echo_test_string"; then + ECHO="$CONFIG_SHELL [$]0 --fallback-echo" + else + # maybe with a smaller string... + prev=: + + for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do + if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null + then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "[$]0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} + else + # Oops. We lost completely, so just stick with echo. + ECHO=echo + fi + fi + fi + fi + fi +fi + +# Copy echo and quote the copy suitably for passing to libtool from +# the Makefile, instead of quoting the original, which is used later. +lt_ECHO=$ECHO +if test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then + lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" +fi + +AC_SUBST(lt_ECHO) +]) +_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) +_LT_DECL([], [ECHO], [1], + [An echo program that does not interpret backslashes]) +])# _LT_PROG_ECHO_BACKSLASH + + +# _LT_ENABLE_LOCK +# --------------- +m4_defun([_LT_ENABLE_LOCK], +[AC_REQUIRE([AC_OBJEXT])dnl +AC_ARG_ENABLE([libtool-lock], + [AS_HELP_STRING([--disable-libtool-lock], + [avoid locking (might break parallel builds)])]) +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 AC_TRY_EVAL(ac_compile); 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 __oline__ "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); 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 AC_TRY_EVAL(ac_compile); 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" + AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, + [AC_LANG_PUSH(C) + AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) + AC_LANG_POP]) + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; +sparc*-*solaris*) + # Find out which ABI we are using. + echo 'int i;' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.o` in + *64-bit*) + case $lt_cv_prog_gnu_ld in + yes*) LD="${LD-ld} -m elf64_sparc" ;; + *) + 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" +])# _LT_ENABLE_LOCK + + +# _LT_CMD_OLD_ARCHIVE +# ------------------- +m4_defun([_LT_CMD_OLD_ARCHIVE], +[AC_CHECK_TOOL(AR, ar, false) +test -z "$AR" && AR=ar +test -z "$AR_FLAGS" && AR_FLAGS=cru +_LT_DECL([], [AR], [1], [The archiver]) +_LT_DECL([], [AR_FLAGS], [1]) + +AC_CHECK_TOOL(STRIP, strip, :) +test -z "$STRIP" && STRIP=: +_LT_DECL([], [STRIP], [1], [A symbol stripping program]) + +AC_CHECK_TOOL(RANLIB, ranlib, :) +test -z "$RANLIB" && RANLIB=: +_LT_DECL([], [RANLIB], [1], + [Commands used to install an old-style archive]) + +# 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 \$oldlib" + ;; + *) + old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" + ;; + esac + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" +fi +_LT_DECL([], [old_postinstall_cmds], [2]) +_LT_DECL([], [old_postuninstall_cmds], [2]) +_LT_TAGDECL([], [old_archive_cmds], [2], + [Commands used to build an old-style archive]) +])# _LT_CMD_OLD_ARCHIVE + + +# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------------------- +# Check whether the given compiler option works +AC_DEFUN([_LT_COMPILER_OPTION], +[AC_REQUIRE([AC_OBJEXT])dnl +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:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>conftest.err) + ac_status=$? + cat conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $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 "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then + $2=yes + fi + fi + $RM conftest* +]) + +if test x"[$]$2" = xyes; then + m4_if([$5], , :, [$5]) +else + m4_if([$6], , :, [$6]) +fi +])# _LT_COMPILER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) + + +# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, +# [ACTION-SUCCESS], [ACTION-FAILURE]) +# ---------------------------------------------------- +# Check whether the given linker option works +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 "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp + $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 + if diff conftest.exp conftest.er2 >/dev/null; then + $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 +])# _LT_LINKER_OPTION + +# Old name: +AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) + + +# LT_CMD_MAX_LEN +#--------------- +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*) + # On Win9x/ME, this test blows up -- it succeeds, but takes + # about 5 minutes as the teststring grows exponentially. + # Worse, since 9x/ME are not pre-emptively multitasking, + # you end up with a "frozen" computer, even though with patience + # the test eventually succeeds (with a max line length of 256k). + # Instead, let's just punt: use the minimum linelength reported by + # all of the supported platforms: 8192 (on NT/2K/XP). + lt_cv_sys_max_cmd_len=8192; + ;; + + amigaos*) + # On AmigaOS with pdksh, this test takes hours, literally. + # So we just punt and use a minimum line length of 8192. + lt_cv_sys_max_cmd_len=8192; + ;; + + netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + # This has been around since 386BSD, at least. Likely further. + if test -x /sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` + elif test -x /usr/sbin/sysctl; then + lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` + else + lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs + fi + # And add a safety zone + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` + lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` + ;; + + interix*) + # We know the value 262144 and hardcode it with a safety zone (like BSD) + lt_cv_sys_max_cmd_len=196608 + ;; + + osf*) + # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure + # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not + # nice to cause kernel panics so lets avoid the loop below. + # First set a reasonable default. + lt_cv_sys_max_cmd_len=16384 + # + if test -x /sbin/sysconfig; then + case `/sbin/sysconfig -q proc exec_disable_arg_limit` in + *1*) lt_cv_sys_max_cmd_len=-1 ;; + esac + fi + ;; + sco3.2v5*) + lt_cv_sys_max_cmd_len=102400 + ;; + sysv5* | sco5v6* | sysv4.2uw2*) + kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` + if test -n "$kargmax"; then + lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` + else + lt_cv_sys_max_cmd_len=32768 + fi + ;; + *) + 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"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ + = "XX$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?]) +])# LT_CMD_MAX_LEN + +# Old name: +AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) + + +# _LT_HEADER_DLFCN +# ---------------- +m4_defun([_LT_HEADER_DLFCN], +[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl +])# _LT_HEADER_DLFCN + + +# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, +# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) +# ---------------------------------------------------------------- +m4_defun([_LT_TRY_DLOPEN_SELF], +[m4_require([_LT_HEADER_DLFCN])dnl +if test "$cross_compiling" = yes; then : + [$4] +else + lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 + lt_status=$lt_dlunknown + cat > conftest.$ac_ext <<_LT_EOF +[#line __oline__ "configure" +#include "confdefs.h" + +#if HAVE_DLFCN_H +#include <dlfcn.h> +#endif + +#include <stdio.h> + +#ifdef RTLD_GLOBAL +# define LT_DLGLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LT_DLGLOBAL DL_GLOBAL +# else +# define LT_DLGLOBAL 0 +# endif +#endif + +/* We may have to define LT_DLLAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LT_DLLAZY_OR_NOW +# ifdef RTLD_LAZY +# define LT_DLLAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LT_DLLAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LT_DLLAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LT_DLLAZY_OR_NOW DL_NOW +# else +# define LT_DLLAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif + +void fnord() { int i=42;} +int main () +{ + void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); + int status = $lt_dlunknown; + + if (self) + { + if (dlsym (self,"fnord")) status = $lt_dlno_uscore; + else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; + /* dlclose (self); */ + } + else + puts (dlerror ()); + + exit (status); +}] +_LT_EOF + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then + (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null + lt_status=$? + case x$lt_status in + x$lt_dlno_uscore) $1 ;; + x$lt_dlneed_uscore) $2 ;; + x$lt_dlunknown|x*) $3 ;; + esac + else : + # compilation failed + $3 + fi +fi +rm -fr conftest* +])# _LT_TRY_DLOPEN_SELF + + +# LT_SYS_DLOPEN_SELF +# ------------------ +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*) + 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]) +])# LT_SYS_DLOPEN_SELF + +# Old name: +AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) + + +# _LT_COMPILER_C_O([TAGNAME]) +# --------------------------- +# Check to see if options -c and -o are simultaneously supported by compiler. +# This macro does not hard code the compiler like AC_PROG_CC_C_O. +m4_defun([_LT_COMPILER_C_O], +[AC_REQUIRE([AC_OBJEXT])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_TAG_COMPILER])dnl +AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], + [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], + [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=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:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$lt_compile" 2>out/conftest.err) + ac_status=$? + cat out/conftest.err >&AS_MESSAGE_LOG_FD + echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD + if (exit $ac_status) && test -s out/conftest2.$ac_objext + then + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp + $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 + if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then + _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + fi + fi + chmod u+w . 2>&AS_MESSAGE_LOG_FD + $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* +]) +_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], + [Does compiler simultaneously support -c and -o options?]) +])# _LT_COMPILER_C_O + + +# _LT_COMPILER_FILE_LOCKS([TAGNAME]) +# ---------------------------------- +# Check to see if we can do hard links to lock some files if needed +m4_defun([_LT_COMPILER_FILE_LOCKS], +[m4_require([_LT_ENABLE_LOCK])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +_LT_COMPILER_C_O([$1]) + +hard_links="nottested" +if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + AC_MSG_CHECKING([if we can lock with hard links]) + 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 + AC_MSG_RESULT([$hard_links]) + if test "$hard_links" = no; then + AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) + need_locks=warn + fi +else + need_locks=no +fi +_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) +])# _LT_COMPILER_FILE_LOCKS + + +# _LT_CHECK_OBJDIR +# ---------------- +m4_defun([_LT_CHECK_OBJDIR], +[AC_CACHE_CHECK([for objdir], [lt_cv_objdir], +[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]) +objdir=$lt_cv_objdir +_LT_DECL([], [objdir], [0], + [The name of the directory that contains temporary libtool files])dnl +m4_pattern_allow([LT_OBJDIR])dnl +AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", + [Define to the sub-directory in which libtool stores uninstalled libraries.]) +])# _LT_CHECK_OBJDIR + + +# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) +# -------------------------------------- +# Check hardcoding attributes. +m4_defun([_LT_LINKER_HARDCODE_LIBPATH], +[AC_MSG_CHECKING([how to hardcode library paths into programs]) +_LT_TAGVAR(hardcode_action, $1)= +if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || + test -n "$_LT_TAGVAR(runpath_var, $1)" || + test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then + + # We can hardcode non-existent directories. + if test "$_LT_TAGVAR(hardcode_direct, $1)" != 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, $1)" != no && + test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then + # Linking always hardcodes the temporary library directory. + _LT_TAGVAR(hardcode_action, $1)=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + _LT_TAGVAR(hardcode_action, $1)=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + _LT_TAGVAR(hardcode_action, $1)=unsupported +fi +AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) + +if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || + test "$_LT_TAGVAR(inherit_rpath, $1)" = 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 +_LT_TAGDECL([], [hardcode_action], [0], + [How to hardcode a shared library path into an executable]) +])# _LT_LINKER_HARDCODE_LIBPATH + + +# _LT_CMD_STRIPLIB +# ---------------- +m4_defun([_LT_CMD_STRIPLIB], +[m4_require([_LT_DECL_EGREP]) +striplib= +old_striplib= +AC_MSG_CHECKING([whether stripping libraries is possible]) +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" + AC_MSG_RESULT([yes]) +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" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi + ;; + *) + AC_MSG_RESULT([no]) + ;; + esac +fi +_LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) +_LT_DECL([], [striplib], [1]) +])# _LT_CMD_STRIPLIB + + +# _LT_SYS_DYNAMIC_LINKER([TAG]) +# ----------------------------- +# PORTME Fill in your ld.so characteristics +m4_defun([_LT_SYS_DYNAMIC_LINKER], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_SED])dnl +AC_MSG_CHECKING([dynamic linker characteristics]) +m4_if([$1], + [], [ +if test "$GCC" = yes; then + case $host_os in + darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; + *) lt_awk_arg="/^libraries:/" ;; + esac + lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then + # if the path contains ";" then we assume it to be the separator + # otherwise default to the standard path separator (i.e. ":") - it is + # assumed that no part of a normal pathname contains ";" but that should + # okay in the real world where ";" in dirpaths is itself problematic. + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` + else + lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + # 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; } +}'` + sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` +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 + 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 + 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<name>.so + # instead of lib<name>.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*) + if test "$host_cpu" = m68k; then + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' + else + dynamic_linker=no + fi + ;; + +beos*) + library_names_spec='${libname}${shared_ext}' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + ;; + +bsdi[[45]]*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw* | pw32*) + version_type=windows + shrext_cmds=".dll" + need_version=no + need_lib_prefix=no + + case $GCC,$host_os in + yes,cygwin* | yes,mingw* | yes,pw32*) + library_names_spec='$libname.dll.a' + # DLL is installed to $(libdir)/../bin by postinstall_cmds + postinstall_cmds='base_file=`basename \${file}`~ + dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ + dldir=$destdir/`dirname \$dlpath`~ + test -d \$dldir || mkdir -p \$dldir~ + $install_prog $dir/$dlname \$dldir/$dlname~ + chmod a+x \$dldir/$dlname~ + 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="/usr/lib /lib/w32api /lib /usr/local/lib" + ;; + mingw*) + # MinGW DLLs use traditional 'lib' prefix + soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` + if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then + # It is most probably a Windows format PATH printed by + # mingw gcc, but we are running on Cygwin. Gcc prints its search + # path with ; separators, and with drive letters. We can handle the + # drive letters (cygwin fileutils understands them), so leave them, + # especially as we might pass files found there to a mingw objdump, + # which wouldn't understand a cygwinified path. Ahh. + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` + else + sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` + fi + ;; + pw32*) + # pw32 DLLs use 'pw' prefix rather than 'lib' + library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' + ;; + esac + ;; + + *) + library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' + ;; + esac + dynamic_linker='Win32 ld.exe' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + ;; + +darwin* | rhapsody*) + dynamic_linker="$host_os dyld" + version_type=darwin + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${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`' +m4_if([$1], [],[ + 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 + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +freebsd1*) + dynamic_linker=no + ;; + +freebsd* | dragonfly*) + # DragonFly does not have aout. When/if they implement a new + # versioning mechanism, adjust this. + if test -x /usr/bin/objformat; then + objformat=`/usr/bin/objformat` + else + case $host_os in + freebsd[[123]]*) objformat=aout ;; + *) objformat=elf ;; + esac + fi + version_type=freebsd-$objformat + case $version_type in + freebsd-elf*) + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case $host_os in + freebsd2*) + shlibpath_overrides_runpath=yes + ;; + freebsd3.[[01]]* | freebsdelf3.[[01]]*) + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ + freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + *) # from 4.6 on, and DragonFly + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + hardcode_into_libs=yes + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + version_type=sunos + need_lib_prefix=no + need_version=no + case $host_cpu in + ia64*) + shrext_cmds='.so' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.so" + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + if test "X$HPUX_IA64_MODE" = X32; then + sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" + else + sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" + fi + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + hppa*64*) + shrext_cmds='.sl' + hardcode_into_libs=yes + dynamic_linker="$host_os dld.sl" + shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH + shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" + sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec + ;; + *) + shrext_cmds='.sl' + dynamic_linker="$host_os dld.sl" + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + ;; + esac + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + ;; + +interix[[3-9]]*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + hardcode_into_libs=yes + ;; + +irix5* | irix6* | nonstopux*) + case $host_os in + nonstopux*) version_type=nonstopux ;; + *) + if test "$lt_cv_prog_gnu_ld" = yes; then + version_type=linux + else + version_type=irix + fi ;; + esac + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}${shared_ext}$major' + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' + case $host_os in + irix5* | nonstopux*) + libsuff= shlibsuff= + ;; + *) + case $LD in # libtool.m4 will add one of these switches to LD + *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") + libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") + libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") + libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + hardcode_into_libs=yes + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux*oldld* | linux*aout* | linux*coff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux* | k*bsd*-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' + 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 + save_LDFLAGS=$LDFLAGS + save_libdir=$libdir + eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ + LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" + AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], + [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], + [shlibpath_overrides_runpath=yes])]) + LDFLAGS=$save_LDFLAGS + libdir=$save_libdir + + # 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;/^$/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' + ;; + +netbsd*) + version_type=sunos + need_lib_prefix=no + need_version=no + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + +newsos6) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + ;; + +*nto* | *qnx*) + version_type=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 + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.3*) + version_type=linux + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + case $host_vendor in + sni) + shlibpath_overrides_runpath=no + need_lib_prefix=no + runpath_var=LD_RUN_PATH + ;; + siemens) + need_lib_prefix=no + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + ;; + esac + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' + soname_spec='$libname${shared_ext}.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) + version_type=freebsd-elf + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + soname_spec='${libname}${release}${shared_ext}$major' + shlibpath_var=LD_LIBRARY_PATH + 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 + need_lib_prefix=no + need_version=no + library_name_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 + 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 +AC_MSG_RESULT([$dynamic_linker]) +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 + +_LT_DECL([], [variables_saved_for_relink], [1], + [Variables whose values should be saved in libtool wrapper scripts and + restored at link time]) +_LT_DECL([], [need_lib_prefix], [0], + [Do we need the "lib" prefix for modules?]) +_LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) +_LT_DECL([], [version_type], [0], [Library versioning type]) +_LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) +_LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) +_LT_DECL([], [shlibpath_overrides_runpath], [0], + [Is shlibpath searched before the hard-coded library search path?]) +_LT_DECL([], [libname_spec], [1], [Format of library name prefix]) +_LT_DECL([], [library_names_spec], [1], + [[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]]) +_LT_DECL([], [soname_spec], [1], + [[The coded name of the library, if different from the real name]]) +_LT_DECL([], [postinstall_cmds], [2], + [Command to use after installation of a shared archive]) +_LT_DECL([], [postuninstall_cmds], [2], + [Command to use after uninstallation of a shared archive]) +_LT_DECL([], [finish_cmds], [2], + [Commands used to finish a libtool library installation in a directory]) +_LT_DECL([], [finish_eval], [1], + [[As "finish_cmds", except a single script fragment to be evaled but + not shown]]) +_LT_DECL([], [hardcode_into_libs], [0], + [Whether we should hardcode library paths into libraries]) +_LT_DECL([], [sys_lib_search_path_spec], [2], + [Compile-time system search path for libraries]) +_LT_DECL([], [sys_lib_dlsearch_path_spec], [2], + [Run-time system search path for libraries]) +])# _LT_SYS_DYNAMIC_LINKER + + +# _LT_PATH_TOOL_PREFIX(TOOL) +# -------------------------- +# find a file program which can recognize shared library +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 +])# _LT_PATH_TOOL_PREFIX + +# Old name: +AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) + + +# _LT_PATH_MAGIC +# -------------- +# find a file program which can recognize a shared library +m4_defun([_LT_PATH_MAGIC], +[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) +if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) + else + MAGIC_CMD=: + fi +fi +])# _LT_PATH_MAGIC + + +# LT_PATH_LD +# ---------- +# find the pathname to the GNU or non-GNU linker +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 + +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 </dev/null` in + *GNU* | *'with BFD'*) + test "$with_gnu_ld" != no && break + ;; + *) + test "$with_gnu_ld" != yes && break + ;; + esac + fi + done + IFS="$lt_save_ifs" +else + lt_cv_path_LD="$LD" # Let the user override the test with a path. +fi]) +LD="$lt_cv_path_LD" +if test -n "$LD"; then + AC_MSG_RESULT($LD) +else + AC_MSG_RESULT(no) +fi +test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) +_LT_PATH_LD_GNU +AC_SUBST([LD]) + +_LT_TAGDECL([], [LD], [1], [The linker used to build libraries]) +])# LT_PATH_LD + +# Old names: +AU_ALIAS([AM_PROG_LD], [LT_PATH_LD]) +AU_ALIAS([AC_PROG_LD], [LT_PATH_LD]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_PROG_LD], []) +dnl AC_DEFUN([AC_PROG_LD], []) + + +# _LT_PATH_LD_GNU +#- -------------- +m4_defun([_LT_PATH_LD_GNU], +[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld, +[# I'd rather use --version here, but apparently some GNU lds only accept -v. +case `$LD -v 2>&1 </dev/null` in +*GNU* | *'with BFD'*) + lt_cv_prog_gnu_ld=yes + ;; +*) + lt_cv_prog_gnu_ld=no + ;; +esac]) +with_gnu_ld=$lt_cv_prog_gnu_ld +])# _LT_PATH_LD_GNU + + +# _LT_CMD_RELOAD +# -------------- +# find reload flag for linker +# -- PORTME Some linkers may need a different reload flag. +m4_defun([_LT_CMD_RELOAD], +[AC_CACHE_CHECK([for $LD option to reload object files], + lt_cv_ld_reload_flag, + [lt_cv_ld_reload_flag='-r']) +reload_flag=$lt_cv_ld_reload_flag +case $reload_flag in +"" | " "*) ;; +*) reload_flag=" $reload_flag" ;; +esac +reload_cmds='$LD$reload_flag -o $output$reload_objs' +case $host_os in + darwin*) + if test "$GCC" = yes; then + reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' + else + reload_cmds='$LD$reload_flag -o $output$reload_objs' + fi + ;; +esac +_LT_DECL([], [reload_flag], [1], [How to create reloadable object files])dnl +_LT_DECL([], [reload_cmds], [2])dnl +])# _LT_CMD_RELOAD + + +# _LT_CHECK_MAGIC_METHOD +# ---------------------- +# how to check for library dependencies +# -- PORTME fill in with the dynamic library characteristics +m4_defun([_LT_CHECK_MAGIC_METHOD], +[m4_require([_LT_DECL_EGREP]) +AC_CACHE_CHECK([how to recognize dependent libraries], +lt_cv_deplibs_check_method, +[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. + if ( 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 + lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + lt_cv_file_magic_cmd='$OBJDUMP -f' + fi + ;; + +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 + ;; + +hpux10.20* | hpux11*) + lt_cv_file_magic_cmd=/usr/bin/file + case $host_cpu in + ia64*) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' + lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so + ;; + hppa*64*) + [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] + lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl + ;; + *) + lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' + lt_cv_file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +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 Linux ELF. +linux* | k*bsd*-gnu) + lt_cv_deplibs_check_method=pass_all + ;; + +netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' + else + lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' + fi + ;; + +newos6*) + lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' + lt_cv_file_magic_cmd=/usr/bin/file + lt_cv_file_magic_test_file=/usr/lib/libnls.so + ;; + +*nto* | *qnx*) + lt_cv_deplibs_check_method=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 +]) +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 + +_LT_DECL([], [deplibs_check_method], [1], + [Method to check whether dependent libraries are shared objects]) +_LT_DECL([], [file_magic_cmd], [1], + [Command to use when deplibs_check_method == "file_magic"]) +])# _LT_CHECK_MAGIC_METHOD + + +# LT_PATH_NM +# ---------- +# find the pathname to a BSD- or MS-compatible name lister +AC_DEFUN([LT_PATH_NM], +[AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_OBJEXT])dnl +AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, +[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]) +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. + AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :) + 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:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD) + (eval "$ac_compile" 2>conftest.err) + cat conftest.err >&AS_MESSAGE_LOG_FD + (eval echo "\"\$as_me:__oline__: $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:__oline__: 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*]) +])# LT_PATH_NM + +# Old names: +AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) +AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_PROG_NM], []) +dnl AC_DEFUN([AC_PROG_NM], []) + + +# LT_LIB_M +# -------- +# check for math library +AC_DEFUN([LT_LIB_M], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +LIBM= +case $host in +*-*-beos* | *-*-cygwin* | *-*-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]) +])# LT_LIB_M + +# Old name: +AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_CHECK_LIBM], []) + + +# _LT_COMPILER_NO_RTTI([TAGNAME]) +# ------------------------------- +m4_defun([_LT_COMPILER_NO_RTTI], +[m4_require([_LT_TAG_COMPILER])dnl + +_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + +if test "$GCC" = yes; then + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + + _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, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) +fi +_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], + [Compiler flag to turn off builtin functions]) +])# _LT_COMPILER_NO_RTTI + + +# _LT_CMD_GLOBAL_SYMBOLS +# ---------------------- +m4_defun([_LT_CMD_GLOBAL_SYMBOLS], +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_OBJEXT])dnl +AC_REQUIRE([LT_PATH_NM])dnl +AC_REQUIRE([LT_PATH_LD])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_TAG_COMPILER])dnl + +# Check for command to grab the raw symbol name followed by C symbol from nm. +AC_MSG_CHECKING([command to parse $NM output from $compiler object]) +AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], +[ +# 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*) + 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};"\ +" /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 + + # 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 AC_TRY_EVAL(ac_compile); then + # Now try to grab the symbols. + nlist=conftest.nm + if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && 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 +#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. */ +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_save_LIBS="$LIBS" + lt_save_CFLAGS="$CFLAGS" + LIBS="conftstm.$ac_objext" + CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" + if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then + pipe_works=yes + fi + LIBS="$lt_save_LIBS" + CFLAGS="$lt_save_CFLAGS" + else + echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD + fi + else + echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD + fi + else + echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD + 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 +]) +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 + AC_MSG_RESULT(failed) +else + AC_MSG_RESULT(ok) +fi + +_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], + [Take the output of nm and produce a listing of raw symbols and C names]) +_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], + [Transform the output of nm in a proper C declaration]) +_LT_DECL([global_symbol_to_c_name_address], + [lt_cv_sys_global_symbol_to_c_name_address], [1], + [Transform the output of nm in a C name address pair]) +_LT_DECL([global_symbol_to_c_name_address_lib_prefix], + [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], + [Transform the output of nm in a C name address pair when lib prefix is needed]) +]) # _LT_CMD_GLOBAL_SYMBOLS + + +# _LT_COMPILER_PIC([TAGNAME]) +# --------------------------- +m4_defun([_LT_COMPILER_PIC], +[m4_require([_LT_TAG_COMPILER])dnl +_LT_TAGVAR(lt_prog_compiler_wl, $1)= +_LT_TAGVAR(lt_prog_compiler_pic, $1)= +_LT_TAGVAR(lt_prog_compiler_static, $1)= + +AC_MSG_CHECKING([for $compiler option to produce PIC]) +m4_if([$1], [CXX], [ + # C++ specific cases for pic, static, wl, etc. + if test "$GXX" = yes; then + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + amigaos*) + if test "$host_cpu" = m68k; then + # 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_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + fi + ;; + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + mingw* | cygwin* | os2* | pw32*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + *djgpp*) + # DJGPP does not support shared libraries at all + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + 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_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-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_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + chorus*) + case $cc_basename in + cxch68*) + # Green Hills C++ Compiler + # _LT_TAGVAR(lt_prog_compiler_static, $1)="--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 + ;; + dgux*) + case $cc_basename in + ec++*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + ghcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + freebsd* | dragonfly*) + # FreeBSD uses GNU C++ + ;; + hpux9* | hpux10* | hpux11*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + if test "$host_cpu" != ia64; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + fi + ;; + aCC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='+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_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + # CC pic flag -KPIC is the default. + ;; + *) + ;; + esac + ;; + linux* | k*bsd*-gnu) + case $cc_basename in + KCC*) + # KAI C++ Compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + icpc* | ecpc* ) + # Intel C++ + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-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_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + xlc* | xlC*) + # IBM XL 8.0 on PPC + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C++ 5.9 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + esac + ;; + esac + ;; + lynxos*) + ;; + m88k*) + ;; + mvs*) + case $cc_basename in + cxx*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' + ;; + *) + ;; + esac + ;; + netbsd*) + ;; + *qnx* | *nto*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + osf3* | osf4* | osf5*) + case $cc_basename in + KCC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' + ;; + RCC*) + # Rational C++ 2.4.1 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + cxx*) + # Digital/Compaq C++ + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # Make sure the PIC flag is empty. It appears that all Alpha + # Linux and Compaq Tru64 Unix objects are PIC. + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + *) + ;; + esac + ;; + psos*) + ;; + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + ;; + *) + ;; + esac + ;; + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + lcc*) + # Lucid + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + ;; + *) + ;; + esac + ;; + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + case $cc_basename in + CC*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + esac + ;; + tandem*) + case $cc_basename in + NCC*) + # NonStop-UX NCC 3.20 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + ;; + *) + ;; + esac + ;; + vxworks*) + ;; + *) + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +], +[ + if test "$GCC" = yes; then + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + + case $host_os in + aix*) + # All AIX code is PIC. + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + amigaos*) + if test "$host_cpu" = m68k; then + # 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_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' + fi + ;; + + beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + + mingw* | cygwin* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + # Although the cygwin gcc ignores -fPIC, still need this for old-style + # (--disable-auto-import) libraries + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + + darwin* | rhapsody*) + # PIC is the default on this platform + # Common symbols not allowed in MH_DYLIB files + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' + ;; + + hpux*) + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. + case $host_cpu in + hppa*64*|ia64*) + # +Z the default + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-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_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + enable_shared=no + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic + fi + ;; + + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' + ;; + esac + else + # PORTME Check for flag to pass linker flags through the system compiler. + case $host_os in + aix*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + if test "$host_cpu" = ia64; then + # AIX 5 now supports IA64 processor + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + else + _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' + fi + ;; + + mingw* | cygwin* | pw32* | os2*) + # This hack is so that the source file can tell whether it is being + # built for inclusion in a dll (and should export symbols for example). + m4_if([$1], [GCJ], [], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) + ;; + + hpux9* | hpux10* | hpux11*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-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_TAGVAR(lt_prog_compiler_pic, $1)='+Z' + ;; + esac + # Is there a better lt_prog_compiler_static that works with the bundled CC? + _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' + ;; + + irix5* | irix6* | nonstopux*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # PIC (with -KPIC) is the default. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + linux* | k*bsd*-gnu) + case $cc_basename in + icc* | ecc* | ifort*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' + ;; + pgcc* | pgf77* | pgf90* | pgf95*) + # Portland Group compilers (*not* the Pentium gcc compiler, + # which looks to be a dead project) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + ccc*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All Alpha code is PIC. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + xl*) + # IBM XL C 8.0/Fortran 10.1 on PPC + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' + ;; + *) + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) + # Sun C 5.9 + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + ;; + *Sun\ F*) + # Sun Fortran 8.3 passes all unrecognized flags to the linker + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + _LT_TAGVAR(lt_prog_compiler_wl, $1)='' + ;; + esac + ;; + esac + ;; + + newsos6) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *nto* | *qnx*) + # QNX uses GNU C++, but need to define -shared option too, otherwise + # it will coredump. + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' + ;; + + osf3* | osf4* | osf5*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + # All OSF/1 code is PIC. + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + rdos*) + _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' + ;; + + solaris*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + case $cc_basename in + f77* | f90* | f95*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; + *) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; + esac + ;; + + sunos4*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + sysv4*MP*) + if test -d /usr/nec ;then + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + fi + ;; + + sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + unicos*) + _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + + uts4*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' + _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' + ;; + + *) + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no + ;; + esac + fi +]) +case $host_os in + # For platforms which do not support PIC, -DPIC is meaningless: + *djgpp*) + _LT_TAGVAR(lt_prog_compiler_pic, $1)= + ;; + *) + _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" + ;; +esac +AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) +_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], + [How to pass a linker flag through the compiler]) + +# +# Check to make sure the PIC flag actually works. +# +if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then + _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], + [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], + [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], + [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in + "" | " "*) ;; + *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; + esac], + [_LT_TAGVAR(lt_prog_compiler_pic, $1)= + _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) +fi +_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], + [Additional compiler flags for building library objects]) + +# +# Check to make sure the static flag actually works. +# +wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" +_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], + _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), + $lt_tmp_static_flag, + [], + [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) +_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], + [Compiler flag to prevent dynamic linking]) +])# _LT_COMPILER_PIC + + +# _LT_LINKER_SHLIBS([TAGNAME]) +# ---------------------------- +# See if the linker supports building shared libraries. +m4_defun([_LT_LINKER_SHLIBS], +[AC_REQUIRE([LT_PATH_LD])dnl +AC_REQUIRE([LT_PATH_NM])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_EGREP])dnl +m4_require([_LT_DECL_SED])dnl +m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl +m4_require([_LT_TAG_COMPILER])dnl +AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) +m4_if([$1], [CXX], [ + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + 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 + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + fi + ;; + pw32*) + _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" + ;; + cygwin* | mingw*) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' + ;; + *) + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + ;; + esac + _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] +], [ + runpath_var= + _LT_TAGVAR(allow_undefined_flag, $1)= + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(archive_cmds, $1)= + _LT_TAGVAR(archive_expsym_cmds, $1)= + _LT_TAGVAR(compiler_needs_object, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + _LT_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' + _LT_TAGVAR(hardcode_automatic, $1)=no + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= + _LT_TAGVAR(hardcode_libdir_separator, $1)= + _LT_TAGVAR(hardcode_minus_L, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported + _LT_TAGVAR(inherit_rpath, $1)=no + _LT_TAGVAR(link_all_deplibs, $1)=unknown + _LT_TAGVAR(module_cmds, $1)= + _LT_TAGVAR(module_expsym_cmds, $1)= + _LT_TAGVAR(old_archive_from_new_cmds, $1)= + _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= + _LT_TAGVAR(thread_safe_flag_spec, $1)= + _LT_TAGVAR(whole_archive_flag_spec, $1)= + # include_expsyms should be a list of space-separated symbols to be *always* + # included in the symbol list + _LT_TAGVAR(include_expsyms, $1)= + # 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'. + _LT_TAGVAR(exclude_expsyms, $1)=['_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. +dnl Note also adjust exclude_expsyms for C++ above. + extract_expsyms_cmds= + + case $host_os in + cygwin* | mingw* | pw32*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$GCC" != yes; then + with_gnu_ld=no + fi + ;; + interix*) + # we just hope/assume this is gcc and not c89 (= MSVC++) + with_gnu_ld=yes + ;; + openbsd*) + with_gnu_ld=no + ;; + esac + + _LT_TAGVAR(ld_shlibs, $1)=yes + if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # Set some defaults for GNU ld with shared library support. These + # are reset later if shared libraries are not supported. Putting them + # here allows them to be overridden if necessary. + runpath_var=LD_RUN_PATH + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${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 + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + supports_anon_versioning=no + case `$LD -v 2>&1` in + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 + *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... + *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... + *\ 2.11.*) ;; # other 2.11 versions + *) supports_anon_versioning=yes ;; + esac + + # See if GNU ld supports shared libraries. + case $host_os in + aix[[3-9]]*) + # On AIX/PPC, the GNU linker is very broken + if test "$host_cpu" != ia64; then + _LT_TAGVAR(ld_shlibs, $1)=no + cat <<_LT_EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +_LT_EOF + fi + ;; + + amigaos*) + if test "$host_cpu" = m68k; then + _LT_TAGVAR(archive_cmds, $1)='$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)' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + fi + + # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can't use + # them. + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + beos*) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach <jrb3@best.com> says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + cygwin* | mingw* | pw32*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$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... + _LT_TAGVAR(archive_expsym_cmds, $1)='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 + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + interix[[3-9]]*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${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. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='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) + 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= + tmp_sharedflag='-shared' + case $cc_basename,$host_cpu in + pgcc*) # Portland Group C compiler + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag' + ;; + pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + tmp_addflag=' $pic_flag -Mnomain' ;; + ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 + tmp_addflag=' -i_dynamic' ;; + efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 + tmp_addflag=' -i_dynamic -nofor_main' ;; + ifc* | ifort*) # Intel Fortran compiler + tmp_addflag=' -nofor_main' ;; + xl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) + tmp_sharedflag='-qmkshrobj' + tmp_addflag= ;; + esac + case `$CC -V 2>&1 | sed 5q` in + *Sun\ C*) # Sun C 5.9 + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=yes + tmp_sharedflag='-G' ;; + *Sun\ F*) # Sun Fortran 8.3 + tmp_sharedflag='-G' ;; + esac + _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + + if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='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*) + # IBM XL Fortran 10.1 on PPC cannot create shared libs itself + _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' + _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='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 $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' + fi + ;; + esac + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' + wlarc= + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + fi + ;; + + solaris*) + if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then + _LT_TAGVAR(ld_shlibs, $1)=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 + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) + case `$LD -v 2>&1` in + *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) + _LT_TAGVAR(ld_shlibs, $1)=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 + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + sunos4*) + _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' + wlarc= + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + + if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then + runpath_var= + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= + _LT_TAGVAR(export_dynamic_flag_spec, $1)= + _LT_TAGVAR(whole_archive_flag_spec, $1)= + fi + else + # PORTME fill in a description of your system's linker (not GNU ld) + case $host_os in + aix3*) + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=yes + _LT_TAGVAR(archive_expsym_cmds, $1)='$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. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + _LT_TAGVAR(hardcode_direct, $1)=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 + if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then + _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' + else + _LT_TAGVAR(export_symbols_cmds, $1)='$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. + + _LT_TAGVAR(archive_cmds, $1)='' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='${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 + _LT_TAGVAR(hardcode_direct, $1)=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 + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)= + fi + ;; + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to export. + _LT_TAGVAR(always_export_symbols, $1)=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. + _LT_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an + # empty executable. + _LT_SYS_MODULE_PATH_AIX + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$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. + _LT_SYS_MODULE_PATH_AIX + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${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. + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared libraries. + _LT_TAGVAR(archive_expsym_cmds, $1)="\$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*) + if test "$host_cpu" = m68k; then + _LT_TAGVAR(archive_cmds, $1)='$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)' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + fi + # see comment about different semantics on the GNU ld section + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + bsdi[[45]]*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic + ;; + + cygwin* | mingw* | pw32*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' + _LT_TAGVAR(allow_undefined_flag, $1)=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. + _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' + # FIXME: Should let the user specify the lib program. + _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' + _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + ;; + + darwin* | rhapsody*) + _LT_DARWIN_LINKER_FEATURES($1) + ;; + + dgux*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + freebsd1*) + _LT_TAGVAR(ld_shlibs, $1)=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*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd* | dragonfly*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + hpux9*) + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + _LT_TAGVAR(archive_cmds, $1)='$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 + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_direct, $1)=yes + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + + hpux10*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' + fi + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + fi + ;; + + hpux11*) + if test "$GCC" = yes -a "$with_gnu_ld" = no; then + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + else + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' + ;; + esac + fi + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + + # hardcode_minus_L: Not really in the search PATH, + # but as the default location of the library. + _LT_TAGVAR(hardcode_minus_L, $1)=yes + ;; + esac + fi + ;; + + irix5* | irix6* | nonstopux*) + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${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. + save_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" + AC_LINK_IFELSE(int foo(void) {}, + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' + ) + LDFLAGS="$save_LDFLAGS" + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(inherit_rpath, $1)=yes + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out + else + _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + newsos6) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *nto* | *qnx*) + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + else + case $host_os in + openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + ;; + esac + fi + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + os2*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(archive_cmds, $1)='$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' + _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' + ;; + + osf3*) + if test "$GCC" = yes; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + osf4* | osf5*) # as osf3* with the addition of -msym flag + if test "$GCC" = yes; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + else + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='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 "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' + + # Both c and cxx compiler support -rpath directly + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + fi + _LT_TAGVAR(archive_cmds_need_lc, $1)='no' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + ;; + + solaris*) + _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' + if test "$GCC" = yes; then + wlarc='${wl}' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared ${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='' + _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='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}' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='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 + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=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 + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + fi + ;; + esac + _LT_TAGVAR(link_all_deplibs, $1)=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. + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' + fi + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4) + case $host_vendor in + sni) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? + ;; + siemens) + ## LD is ld it makes a PLAMLIB + ## CC just makes a GrossModule. + _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' + _LT_TAGVAR(hardcode_direct, $1)=no + ;; + motorola) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie + ;; + esac + runpath_var='LD_RUN_PATH' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + sysv4.3*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' + ;; + + sysv4*MP*) + if test -d /usr/nec; then + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + _LT_TAGVAR(ld_shlibs, $1)=yes + fi + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$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. + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + if test "$GCC" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + fi + ;; + + uts4*) + _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + + *) + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + + if test x$host_vendor = xsni; then + case $host in + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' + ;; + esac + fi + fi +]) +AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) +test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + +_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld + +_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl +_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl +_LT_DECL([], [extract_expsyms_cmds], [2], + [The commands to extract the exported symbol list from a shared archive]) + +# +# Do we need to explicitly link libc? +# +case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in +x|xyes) + # Assume -lc should be added + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + + if test "$enable_shared" = yes && test "$GCC" = yes; then + case $_LT_TAGVAR(archive_cmds, $1) 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. + AC_MSG_CHECKING([whether -lc should be explicitly linked in]) + $RM conftest* + echo "$lt_simple_compile_test_code" > conftest.$ac_ext + + if AC_TRY_EVAL(ac_compile) 2>conftest.err; then + soname=conftest + lib=conftest + libobjs=conftest.$ac_objext + deplibs= + wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) + pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) + compiler_flags=-v + linker_flags=-v + verstring= + output_objdir=. + libname=conftest + lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) + _LT_TAGVAR(allow_undefined_flag, $1)= + if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) + then + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + else + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + fi + _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag + else + cat conftest.err 1>&5 + fi + $RM conftest* + AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)]) + ;; + esac + fi + ;; +esac + +_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], + [Whether or not to add -lc for building shared libraries]) +_LT_TAGDECL([allow_libtool_libs_with_static_runtimes], + [enable_shared_with_static_runtimes], [0], + [Whether or not to disallow shared libs when runtime libs are static]) +_LT_TAGDECL([], [export_dynamic_flag_spec], [1], + [Compiler flag to allow reflexive dlopens]) +_LT_TAGDECL([], [whole_archive_flag_spec], [1], + [Compiler flag to generate shared objects directly from archives]) +_LT_TAGDECL([], [compiler_needs_object], [1], + [Whether the compiler copes with passing no objects directly]) +_LT_TAGDECL([], [old_archive_from_new_cmds], [2], + [Create an old-style archive from a shared archive]) +_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], + [Create a temporary old-style archive to link instead of a shared archive]) +_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) +_LT_TAGDECL([], [archive_expsym_cmds], [2]) +_LT_TAGDECL([], [module_cmds], [2], + [Commands used to build a loadable module if different from building + a shared archive.]) +_LT_TAGDECL([], [module_expsym_cmds], [2]) +_LT_TAGDECL([], [with_gnu_ld], [1], + [Whether we are building with GNU ld or not]) +_LT_TAGDECL([], [allow_undefined_flag], [1], + [Flag that allows shared libraries with undefined symbols to be built]) +_LT_TAGDECL([], [no_undefined_flag], [1], + [Flag that enforces no undefined symbols]) +_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], + [Flag to hardcode $libdir into a binary during linking. + This must work even if $libdir does not exist]) +_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1], + [[If ld is used when linking, flag to hardcode $libdir into a binary + during linking. This must work even if $libdir does not exist]]) +_LT_TAGDECL([], [hardcode_libdir_separator], [1], + [Whether we need a single "-rpath" flag with a separated argument]) +_LT_TAGDECL([], [hardcode_direct], [0], + [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes + DIR into the resulting binary]) +_LT_TAGDECL([], [hardcode_direct_absolute], [0], + [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]) +_LT_TAGDECL([], [hardcode_minus_L], [0], + [Set to "yes" if using the -LDIR flag during linking hardcodes DIR + into the resulting binary]) +_LT_TAGDECL([], [hardcode_shlibpath_var], [0], + [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR + into the resulting binary]) +_LT_TAGDECL([], [hardcode_automatic], [0], + [Set to "yes" if building a shared library automatically hardcodes DIR + into the library and all subsequent libraries and executables linked + against it]) +_LT_TAGDECL([], [inherit_rpath], [0], + [Set to yes if linker adds runtime paths of dependent libraries + to runtime path list]) +_LT_TAGDECL([], [link_all_deplibs], [0], + [Whether libtool must link a program against all its dependency libraries]) +_LT_TAGDECL([], [fix_srcfile_path], [1], + [Fix the shell variable $srcfile for the compiler]) +_LT_TAGDECL([], [always_export_symbols], [0], + [Set to "yes" if exported symbols are required]) +_LT_TAGDECL([], [export_symbols_cmds], [2], + [The commands to list exported symbols]) +_LT_TAGDECL([], [exclude_expsyms], [1], + [Symbols that should not be listed in the preloaded symbols]) +_LT_TAGDECL([], [include_expsyms], [1], + [Symbols that must always be exported]) +_LT_TAGDECL([], [prelink_cmds], [2], + [Commands necessary for linking programs (against libraries) with templates]) +_LT_TAGDECL([], [file_list_spec], [1], + [Specify filename containing input files]) +dnl FIXME: Not yet implemented +dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], +dnl [Compiler flag to generate thread safe objects]) +])# _LT_LINKER_SHLIBS + + +# _LT_LANG_C_CONFIG([TAG]) +# ------------------------ +# Ensure that the configuration variables for a C compiler are suitably +# defined. These variables are subsequently used by _LT_CONFIG to write +# the compiler configuration to `libtool'. +m4_defun([_LT_LANG_C_CONFIG], +[m4_require([_LT_DECL_EGREP])dnl +lt_save_CC="$CC" +AC_LANG_PUSH(C) + +# Source file extension for C test sources. +ac_ext=c + +# Object file extension for compiled C test sources. +objext=o +_LT_TAGVAR(objext, $1)=$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);}' + +_LT_TAG_COMPILER +# 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 +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +## 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_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + LT_SYS_DLOPEN_SELF + _LT_CMD_STRIPLIB + + # Report which library types will actually be built + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + 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 + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_CONFIG($1) +fi +AC_LANG_POP +CC="$lt_save_CC" +])# _LT_LANG_C_CONFIG + + +# _LT_PROG_CXX +# ------------ +# Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++ +# compiler, we have our own version here. +m4_defun([_LT_PROG_CXX], +[ +pushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes]) +AC_PROG_CXX +if test -n "$CXX" && ( test "X$CXX" != "Xno" && + ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || + (test "X$CXX" != "Xg++"))) ; then + AC_PROG_CXXCPP +else + _lt_caught_CXX_error=yes +fi +popdef([AC_MSG_ERROR]) +])# _LT_PROG_CXX + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([_LT_PROG_CXX], []) + + +# _LT_LANG_CXX_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for a C++ compiler are suitably +# defined. These variables are subsequently used by _LT_CONFIG to write +# the compiler configuration to `libtool'. +m4_defun([_LT_LANG_CXX_CONFIG], +[AC_REQUIRE([_LT_PROG_CXX])dnl +m4_require([_LT_FILEUTILS_DEFAULTS])dnl +m4_require([_LT_DECL_EGREP])dnl + +AC_LANG_PUSH(C++) +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(compiler_needs_object, $1)=no +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for C++ test sources. +ac_ext=cpp + +# Object file extension for compiled C++ test sources. +objext=o +_LT_TAGVAR(objext, $1)=$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. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC=$CC + lt_save_LD=$LD + lt_save_GCC=$GCC + GCC=$GXX + lt_save_with_gnu_ld=$with_gnu_ld + lt_save_path_LD=$lt_cv_path_LD + if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then + lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx + else + $as_unset lt_cv_prog_gnu_ld + fi + if test -n "${lt_cv_path_LDCXX+set}"; then + lt_cv_path_LD=$lt_cv_path_LDCXX + else + $as_unset lt_cv_path_LD + fi + test -z "${LDCXX+set}" || LD=$LDCXX + CC=${CXX-"c++"} + compiler=$CC + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + + 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_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' + else + _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= + fi + + if test "$GXX" = yes; then + # Set up default GNU C++ configuration + + LT_PATH_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 + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${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 + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + _LT_TAGVAR(whole_archive_flag_spec, $1)= + 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. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + fi + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + + else + GXX=no + with_gnu_ld=no + wlarc= + fi + + # PORTME: fill in a description of your system's C++ link characteristics + AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) + _LT_TAGVAR(ld_shlibs, $1)=yes + case $host_os in + aix3*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=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. + + _LT_TAGVAR(archive_cmds, $1)='' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(file_list_spec, $1)='${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 + _LT_TAGVAR(hardcode_direct, $1)=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 + _LT_TAGVAR(hardcode_minus_L, $1)=yes + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)= + fi + esac + shared_flag='-shared' + if test "$aix_use_runtimelinking" = yes; then + shared_flag="$shared_flag "'${wl}-G' + fi + else + # not using gcc + if test "$host_cpu" = ia64; then + # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release + # chokes on -Wl,-G. The following line is correct: + shared_flag='-G' + else + if test "$aix_use_runtimelinking" = yes; then + shared_flag='${wl}-G' + else + shared_flag='${wl}-bM:SRE' + fi + fi + fi + + # It seems that -bexpall does not export symbols beginning with + # underscore (_), so it is better to generate a list of symbols to + # export. + _LT_TAGVAR(always_export_symbols, $1)=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. + _LT_TAGVAR(allow_undefined_flag, $1)='-berok' + # Determine the default libpath from the value encoded in an empty + # executable. + _LT_SYS_MODULE_PATH_AIX + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" + + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" + else + if test "$host_cpu" = ia64; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' + _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" + _LT_TAGVAR(archive_expsym_cmds, $1)="\$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. + _LT_SYS_MODULE_PATH_AIX + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${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. + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' + # Exported symbols can be pulled into shared objects from archives + _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' + _LT_TAGVAR(archive_cmds_need_lc, $1)=yes + # This is similar to how AIX traditionally builds its shared + # libraries. + _LT_TAGVAR(archive_expsym_cmds, $1)="\$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 + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + # Joseph Beckenbach <jrb3@best.com> says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + else + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + + chorus*) + case $cc_basename in + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + cygwin* | mingw* | pw32*) + # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, + # as there is no search path for DLLs. + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' + _LT_TAGVAR(allow_undefined_flag, $1)=unsupported + _LT_TAGVAR(always_export_symbols, $1)=no + _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes + + if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$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... + _LT_TAGVAR(archive_expsym_cmds, $1)='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 + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + darwin* | rhapsody*) + _LT_DARWIN_LINKER_FEATURES($1) + ;; + + dgux*) + case $cc_basename in + ec++*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + ghcx*) + # Green Hills C++ Compiler + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + freebsd[[12]]*) + # C++ shared libraries reported to be fairly broken before + # switch to ELF + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + freebsd-elf*) + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + ;; + + freebsd* | dragonfly*) + # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF + # conventions + _LT_TAGVAR(ld_shlibs, $1)=yes + ;; + + gnu*) + ;; + + hpux9*) + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=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 + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + _LT_TAGVAR(archive_cmds, $1)='$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; $ECHO "X$list" | $Xsed' + ;; + *) + if test "$GXX" = yes; then + _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + hpux10*|hpux11*) + if test $with_gnu_ld = no; then + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + case $host_cpu in + hppa*64*|ia64*) + ;; + *) + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + ;; + esac + fi + case $host_cpu in + hppa*64*|ia64*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + ;; + *) + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(hardcode_minus_L, $1)=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 + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + aCC*) + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + ;; + *) + if test "$GXX" = yes; then + if test $with_gnu_ld = no; then + case $host_cpu in + hppa*64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + ia64*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + ;; + esac + fi + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + interix[[3-9]]*) + _LT_TAGVAR(hardcode_direct, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${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. + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='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++ + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -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. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' + ;; + *) + if test "$GXX" = yes; then + if test "$with_gnu_ld" = no; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + else + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib' + fi + fi + _LT_TAGVAR(link_all_deplibs, $1)=yes + ;; + esac + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + _LT_TAGVAR(inherit_rpath, $1)=yes + ;; + + linux* | k*bsd*-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. + _LT_TAGVAR(archive_cmds, $1)='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' + _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + + # Archives containing C++ object files must be created using + # "CC -Bstatic", where "CC" is the KAI C++ compiler. + _LT_TAGVAR(old_archive_cmds, $1)='$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."*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$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 + _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + ;; + esac + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' + ;; + pgCC* | pgcpp*) + # Portland Group C++ compiler + case `$CC -V` in + *pgCC\ [[1-5]]* | *pgcpp\ [[1-5]]*) + _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ + rm -rf $tpldir~ + $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ + compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"' + _LT_TAGVAR(old_archive_cmds, $1)='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 | $NL2SP`~ + $RANLIB $oldlib' + _LT_TAGVAR(archive_cmds, $1)='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 | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='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 | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' + ;; + *) # Version 6 will use weak symbols + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$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 + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + ;; + cxx*) + # Compaq C++ + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='$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 + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + ;; + xl*) + # IBM XL 8.0 on PPC, with GNU ld + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' + _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' + if test "x$supports_anon_versioning" = xyes; then + _LT_TAGVAR(archive_expsym_cmds, $1)='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 + _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' + _LT_TAGVAR(compiler_needs_object, $1)=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='echo' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + esac + ;; + esac + ;; + + lynxos*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + m88k*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + mvs*) + case $cc_basename in + cxx*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' + wlarc= + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=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*) + _LT_TAGVAR(ld_shlibs, $1)=yes + ;; + + openbsd2*) + # C++ shared libraries are fairly broken + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + openbsd*) + if test -f /usr/libexec/ld.so; then + _LT_TAGVAR(hardcode_direct, $1)=yes + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_direct_absolute, $1)=yes + _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' + _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + fi + output_verbose_link_cmd=echo + else + _LT_TAGVAR(ld_shlibs, $1)=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. + _LT_TAGVAR(archive_cmds, $1)='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' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Archives containing C++ object files must be created using + # the KAI C++ compiler. + case $host in + osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; + *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; + esac + ;; + RCC*) + # Rational C++ 2.4.1 + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + cxx*) + case $host in + osf3*) + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + ;; + *) + _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='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 "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~ + $RM $lib.exp' + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + # + # There doesn't appear to be a way to prevent this compiler from + # explicitly linking system object files so we need to strip them + # from the output so that they don't get included in the library + # dependencies. + output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' + ;; + *) + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' + case $host in + osf3*) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' + ;; + esac + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=: + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + + else + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + fi + ;; + esac + ;; + + psos*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + sunos4*) + case $cc_basename in + CC*) + # Sun C++ 4.x + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + lcc*) + # Lucid + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + solaris*) + case $cc_basename in + CC*) + # Sun C++ 4.2, 5.x and Centerline C++ + _LT_TAGVAR(archive_cmds_need_lc,$1)=yes + _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' + _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='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' + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' + _LT_TAGVAR(hardcode_shlibpath_var, $1)=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?) + _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' + ;; + esac + _LT_TAGVAR(link_all_deplibs, $1)=yes + + output_verbose_link_cmd='echo' + + # Archives containing C++ object files must be created using + # "CC -xar", where "CC" is the Sun C++ compiler. This is + # necessary to make sure instantiated templates are included + # in the archive. + _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' + ;; + gcx*) + # Green Hills C++ Compiler + _LT_TAGVAR(archive_cmds, $1)='$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. + _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' + ;; + *) + # GNU C++ compiler with Solaris linker + if test "$GXX" = yes && test "$with_gnu_ld" = no; then + _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' + if $CC --version | $GREP -v '^2\.7' > /dev/null; then + _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + else + # g++ 2.7 appears to require `-G' NOT `-shared' on this + # platform. + _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' + _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ + $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' + + # Commands to make compiler produce verbose output that lists + # what "hidden" libraries, object files and flags are used when + # linking a shared library. + output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' + fi + + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' + case $host_os in + solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; + *) + _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' + ;; + esac + fi + ;; + esac + ;; + + sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$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. + _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' + _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' + _LT_TAGVAR(archive_cmds_need_lc, $1)=no + _LT_TAGVAR(hardcode_shlibpath_var, $1)=no + _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' + _LT_TAGVAR(hardcode_libdir_separator, $1)=':' + _LT_TAGVAR(link_all_deplibs, $1)=yes + _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' + runpath_var='LD_RUN_PATH' + + case $cc_basename in + CC*) + _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + ;; + *) + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_expsym_cmds, $1)='$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 + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + ;; + + vxworks*) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + + *) + # FIXME: insert proper C++ library support + _LT_TAGVAR(ld_shlibs, $1)=no + ;; + esac + + AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) + test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no + + _LT_TAGVAR(GCC, $1)="$GXX" + _LT_TAGVAR(LD, $1)="$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... + _LT_SYS_HIDDEN_LIBDEPS($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + CC=$lt_save_CC + 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_LANG_POP +])# _LT_LANG_CXX_CONFIG + + +# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) +# --------------------------------- +# Figure out "hidden" library dependencies from verbose +# compiler output when linking a shared library. +# Parse the compiler output and extract the necessary +# objects, libraries and library flags. +m4_defun([_LT_SYS_HIDDEN_LIBDEPS], +[m4_require([_LT_FILEUTILS_DEFAULTS])dnl +# Dependencies to place before and after the object being linked: +_LT_TAGVAR(predep_objects, $1)= +_LT_TAGVAR(postdep_objects, $1)= +_LT_TAGVAR(predeps, $1)= +_LT_TAGVAR(postdeps, $1)= +_LT_TAGVAR(compiler_lib_search_path, $1)= + +dnl we can't use the lt_simple_compile_test_code here, +dnl because it contains code intended for an executable, +dnl not a library. It's possible we should let each +dnl tag define a new lt_????_link_test_code variable, +dnl but it's only used here... +m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF +int a; +void foo (void) { a = 0; } +_LT_EOF +], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF +class Foo +{ +public: + Foo (void) { a = 0; } +private: + int a; +}; +_LT_EOF +], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF + subroutine foo + implicit none + integer*4 a + a=0 + return + end +_LT_EOF +], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF + subroutine foo + implicit none + integer a + a=0 + return + end +_LT_EOF +], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF +public class foo { + private int a; + public void bar (void) { + a = 0; + } +}; +_LT_EOF +]) +dnl Parse the compiler output and extract the necessary +dnl objects, libraries and library flags. +if AC_TRY_EVAL(ac_compile); 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 $p in + + -L* | -R* | -l*) + # Some compilers place space between "-{L,R}" and the path. + # Remove the space. + if test $p = "-L" || + test $p = "-R"; then + prev=$p + continue + else + prev= + fi + + if test "$pre_test_object_deps_done" = no; then + case $p in + -L* | -R*) + # Internal compiler library paths should come after those + # provided the user. The postdeps already come after the + # user supplied libs so there is no need to process them. + if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then + _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" + else + _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${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 "$_LT_TAGVAR(postdeps, $1)"; then + _LT_TAGVAR(postdeps, $1)="${prev}${p}" + else + _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" + fi + fi + ;; + + *.$objext) + # This assumes that the test object file only shows up + # once in the compiler output. + if test "$p" = "conftest.$objext"; then + pre_test_object_deps_done=yes + continue + fi + + if test "$pre_test_object_deps_done" = no; then + if test -z "$_LT_TAGVAR(predep_objects, $1)"; then + _LT_TAGVAR(predep_objects, $1)="$p" + else + _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" + fi + else + if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then + _LT_TAGVAR(postdep_objects, $1)="$p" + else + _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" + fi + fi + ;; + + *) ;; # Ignore the rest. + + esac + done + + # Clean up. + rm -f a.out a.exe +else + echo "libtool.m4: error: problem compiling $1 test program" +fi + +$RM -f confest.$objext + +# PORTME: override above test on systems where it is broken +m4_if([$1], [CXX], +[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. + _LT_TAGVAR(predep_objects,$1)= + _LT_TAGVAR(postdep_objects,$1)= + _LT_TAGVAR(postdeps,$1)= + ;; + +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 + _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' + fi + ;; + esac + ;; + +solaris*) + case $cc_basename in + CC*) + # 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 + _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' + fi + ;; + esac + ;; +esac +]) + +case " $_LT_TAGVAR(postdeps, $1) " in +*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; +esac + _LT_TAGVAR(compiler_lib_search_dirs, $1)= +if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then + _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` +fi +_LT_TAGDECL([], [compiler_lib_search_dirs], [1], + [The directories searched by this compiler when creating a shared library]) +_LT_TAGDECL([], [predep_objects], [1], + [Dependencies to place before and after the objects being linked to + create a shared library]) +_LT_TAGDECL([], [postdep_objects], [1]) +_LT_TAGDECL([], [predeps], [1]) +_LT_TAGDECL([], [postdeps], [1]) +_LT_TAGDECL([], [compiler_lib_search_path], [1], + [The library search path used internally by the compiler when linking + a shared library]) +])# _LT_SYS_HIDDEN_LIBDEPS + + +# _LT_PROG_F77 +# ------------ +# Since AC_PROG_F77 is broken, in that it returns the empty string +# if there is no fortran compiler, we have our own version here. +m4_defun([_LT_PROG_F77], +[ +pushdef([AC_MSG_ERROR], [_lt_disable_F77=yes]) +AC_PROG_F77 +if test -z "$F77" || test "X$F77" = "Xno"; then + _lt_disable_F77=yes +fi +popdef([AC_MSG_ERROR]) +])# _LT_PROG_F77 + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([_LT_PROG_F77], []) + + +# _LT_LANG_F77_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for a Fortran 77 compiler are +# suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_F77_CONFIG], +[AC_REQUIRE([_LT_PROG_F77])dnl +AC_LANG_PUSH(Fortran 77) + +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for f77 test sources. +ac_ext=f + +# Object file extension for compiled f77 test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the F77 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_disable_F77" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="\ + subroutine t + return + end +" + + # Code to be used in simple link tests + lt_simple_link_test_code="\ + program t + end +" + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC="$CC" + lt_save_GCC=$GCC + CC=${F77-"f77"} + compiler=$CC + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + GCC=$G77 + if test -n "$compiler"; then + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + 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 + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_TAGVAR(GCC, $1)="$G77" + _LT_TAGVAR(LD, $1)="$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... + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + GCC=$lt_save_GCC + CC="$lt_save_CC" +fi # test "$_lt_disable_F77" != yes + +AC_LANG_POP +])# _LT_LANG_F77_CONFIG + + +# _LT_PROG_FC +# ----------- +# Since AC_PROG_FC is broken, in that it returns the empty string +# if there is no fortran compiler, we have our own version here. +m4_defun([_LT_PROG_FC], +[ +pushdef([AC_MSG_ERROR], [_lt_disable_FC=yes]) +AC_PROG_FC +if test -z "$FC" || test "X$FC" = "Xno"; then + _lt_disable_FC=yes +fi +popdef([AC_MSG_ERROR]) +])# _LT_PROG_FC + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([_LT_PROG_FC], []) + + +# _LT_LANG_FC_CONFIG([TAG]) +# ------------------------- +# Ensure that the configuration variables for a Fortran compiler are +# suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_FC_CONFIG], +[AC_REQUIRE([_LT_PROG_FC])dnl +AC_LANG_PUSH(Fortran) + +_LT_TAGVAR(archive_cmds_need_lc, $1)=no +_LT_TAGVAR(allow_undefined_flag, $1)= +_LT_TAGVAR(always_export_symbols, $1)=no +_LT_TAGVAR(archive_expsym_cmds, $1)= +_LT_TAGVAR(export_dynamic_flag_spec, $1)= +_LT_TAGVAR(hardcode_direct, $1)=no +_LT_TAGVAR(hardcode_direct_absolute, $1)=no +_LT_TAGVAR(hardcode_libdir_flag_spec, $1)= +_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= +_LT_TAGVAR(hardcode_libdir_separator, $1)= +_LT_TAGVAR(hardcode_minus_L, $1)=no +_LT_TAGVAR(hardcode_automatic, $1)=no +_LT_TAGVAR(inherit_rpath, $1)=no +_LT_TAGVAR(module_cmds, $1)= +_LT_TAGVAR(module_expsym_cmds, $1)= +_LT_TAGVAR(link_all_deplibs, $1)=unknown +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds +_LT_TAGVAR(no_undefined_flag, $1)= +_LT_TAGVAR(whole_archive_flag_spec, $1)= +_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no + +# Source file extension for fc test sources. +ac_ext=${ac_fc_srcext-f} + +# Object file extension for compiled fc test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# No sense in running all these tests if we already determined that +# the FC 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_disable_FC" != yes; then + # Code to be used in simple compile tests + lt_simple_compile_test_code="\ + subroutine t + return + end +" + + # Code to be used in simple link tests + lt_simple_link_test_code="\ + program t + end +" + + # ltmain only uses $CC for tagged configurations so make sure $CC is set. + _LT_TAG_COMPILER + + # save warnings/boilerplate of simple test code + _LT_COMPILER_BOILERPLATE + _LT_LINKER_BOILERPLATE + + # Allow CC to be a program name with arguments. + lt_save_CC="$CC" + lt_save_GCC=$GCC + CC=${FC-"f95"} + compiler=$CC + GCC=$ac_cv_fc_compiler_gnu + + _LT_TAGVAR(compiler, $1)=$CC + _LT_CC_BASENAME([$compiler]) + + if test -n "$compiler"; then + AC_MSG_CHECKING([if libtool supports shared libraries]) + AC_MSG_RESULT([$can_build_shared]) + + AC_MSG_CHECKING([whether to build shared libraries]) + 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 + AC_MSG_RESULT([$enable_shared]) + + AC_MSG_CHECKING([whether to build static libraries]) + # Make sure either enable_shared or enable_static is yes. + test "$enable_shared" = yes || enable_static=yes + AC_MSG_RESULT([$enable_static]) + + _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" + _LT_TAGVAR(LD, $1)="$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... + _LT_SYS_HIDDEN_LIBDEPS($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_SYS_DYNAMIC_LINKER($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) + fi # test -n "$compiler" + + GCC=$lt_save_GCC + CC="$lt_save_CC" +fi # test "$_lt_disable_FC" != yes + +AC_LANG_POP +])# _LT_LANG_FC_CONFIG + + +# _LT_LANG_GCJ_CONFIG([TAG]) +# -------------------------- +# Ensure that the configuration variables for the GNU Java Compiler compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_GCJ_CONFIG], +[AC_REQUIRE([LT_PROG_GCJ])dnl +AC_LANG_SAVE + +# Source file extension for Java test sources. +ac_ext=java + +# Object file extension for compiled Java test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code="class foo {}" + +# Code to be used in simple link tests +lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +lt_save_GCC=$GCC +GCC=yes +CC=${GCJ-"gcj"} +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_CC_BASENAME([$compiler]) + +# GCJ did not exist at the time GCC didn't implicitly link libc in. +_LT_TAGVAR(archive_cmds_need_lc, $1)=no + +_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds + +## 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_COMPILER_NO_RTTI($1) + _LT_COMPILER_PIC($1) + _LT_COMPILER_C_O($1) + _LT_COMPILER_FILE_LOCKS($1) + _LT_LINKER_SHLIBS($1) + _LT_LINKER_HARDCODE_LIBPATH($1) + + _LT_CONFIG($1) +fi + +AC_LANG_RESTORE + +GCC=$lt_save_GCC +CC="$lt_save_CC" +])# _LT_LANG_GCJ_CONFIG + + +# _LT_LANG_RC_CONFIG([TAG]) +# ------------------------- +# Ensure that the configuration variables for the Windows resource compiler +# are suitably defined. These variables are subsequently used by _LT_CONFIG +# to write the compiler configuration to `libtool'. +m4_defun([_LT_LANG_RC_CONFIG], +[AC_REQUIRE([LT_PROG_RC])dnl +AC_LANG_SAVE + +# Source file extension for RC test sources. +ac_ext=rc + +# Object file extension for compiled RC test sources. +objext=o +_LT_TAGVAR(objext, $1)=$objext + +# Code to be used in simple compile tests +lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' + +# Code to be used in simple link tests +lt_simple_link_test_code="$lt_simple_compile_test_code" + +# ltmain only uses $CC for tagged configurations so make sure $CC is set. +_LT_TAG_COMPILER + +# save warnings/boilerplate of simple test code +_LT_COMPILER_BOILERPLATE +_LT_LINKER_BOILERPLATE + +# Allow CC to be a program name with arguments. +lt_save_CC="$CC" +lt_save_GCC=$GCC +GCC= +CC=${RC-"windres"} +compiler=$CC +_LT_TAGVAR(compiler, $1)=$CC +_LT_CC_BASENAME([$compiler]) +_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes + +if test -n "$compiler"; then + : + _LT_CONFIG($1) +fi + +GCC=$lt_save_GCC +AC_LANG_RESTORE +CC="$lt_save_CC" +])# _LT_LANG_RC_CONFIG + + +# LT_PROG_GCJ +# ----------- +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 +]) + +# Old name: +AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_GCJ], []) + + +# LT_PROG_RC +# ---------- +AC_DEFUN([LT_PROG_RC], +[AC_CHECK_TOOL(RC, windres,) +]) + +# Old name: +AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_RC], []) + + +# _LT_DECL_EGREP +# -------------- +# If we don't have a new enough Autoconf to choose the best grep +# available, choose the one first in the user's PATH. +m4_defun([_LT_DECL_EGREP], +[AC_REQUIRE([AC_PROG_EGREP])dnl +AC_REQUIRE([AC_PROG_FGREP])dnl +test -z "$GREP" && GREP=grep +_LT_DECL([], [GREP], [1], [A grep program that handles long lines]) +_LT_DECL([], [EGREP], [1], [An ERE matcher]) +_LT_DECL([], [FGREP], [1], [A literal string matcher]) +dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too +AC_SUBST([GREP]) +]) + + +# _LT_DECL_SED +# ------------ +# Check for a fully-functional sed program, that truncates +# as few characters as possible. Prefer GNU sed if found. +m4_defun([_LT_DECL_SED], +[AC_PROG_SED +test -z "$SED" && SED=sed +Xsed="$SED -e 1s/^X//" +_LT_DECL([], [SED], [1], [A sed program that does not truncate output]) +_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], + [Sed that helps us avoid accidentally triggering echo(1) options like -n]) +])# _LT_DECL_SED + +m4_ifndef([AC_PROG_SED], [ +############################################################ +# NOTE: This macro has been submitted for inclusion into # +# GNU Autoconf as AC_PROG_SED. When it is available in # +# a released version of Autoconf we should remove this # +# macro and use it instead. # +############################################################ + +m4_defun([AC_PROG_SED], +[AC_MSG_CHECKING([for a sed that does not truncate output]) +AC_CACHE_VAL(lt_cv_path_SED, +[# Loop through the user's path and test for sed and gsed. +# Then use that list of sed's as ones to test for truncation. +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for lt_ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then + lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" + fi + done + done +done +IFS=$as_save_IFS +lt_ac_max=0 +lt_ac_count=0 +# Add /usr/xpg4/bin/sed as it is typically found on Solaris +# along with /bin/sed that truncates output. +for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do + test ! -f $lt_ac_sed && continue + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test $lt_ac_count -gt 10 && break + lt_ac_count=`expr $lt_ac_count + 1` + if test $lt_ac_count -gt $lt_ac_max; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done +]) +SED=$lt_cv_path_SED +AC_SUBST([SED]) +AC_MSG_RESULT([$SED]) +])#AC_PROG_SED +])#m4_ifndef + +# Old name: +AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([LT_AC_PROG_SED], []) + + +# _LT_CHECK_SHELL_FEATURES +# ------------------------ +# Find out whether the shell is Bourne or XSI compatible, +# or has some other useful features. +m4_defun([_LT_CHECK_SHELL_FEATURES], +[AC_MSG_CHECKING([whether the shell understands some XSI constructs]) +# Try some XSI features +xsi_shell=no +( _lt_dummy="a/b/c" + test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ + = c,a/b,, ) >/dev/null 2>&1 \ + && xsi_shell=yes +AC_MSG_RESULT([$xsi_shell]) +_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) + +AC_MSG_CHECKING([whether the shell understands "+="]) +lt_shell_append=no +( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ + >/dev/null 2>&1 \ + && lt_shell_append=yes +AC_MSG_RESULT([$lt_shell_append]) +_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) + +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + lt_unset=unset +else + lt_unset=false +fi +_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl + +# 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 +_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl +_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl +])# _LT_CHECK_SHELL_FEATURES + + +# _LT_PROG_XSI_SHELLFNS +# --------------------- +# Bourne and XSI compatible variants of some useful shell functions. +m4_defun([_LT_PROG_XSI_SHELLFNS], +[case $xsi_shell in + yes) + cat << \_LT_EOF >> "$cfgfile" +# 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 () +{ + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac +} + +# func_basename file +func_basename () +{ + func_basename_result="${1##*/}" +} + +# 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 () +{ + case ${1} in + */*) func_dirname_result="${1%/*}${2}" ;; + * ) func_dirname_result="${3}" ;; + esac + func_basename_result="${1##*/}" +} + +# 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_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}"} +} + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=${1%%=*} + func_opt_split_arg=${1#*=} +} + +# func_lo2o object +func_lo2o () +{ + case ${1} in + *.lo) func_lo2o_result=${1%.lo}.${objext} ;; + *) func_lo2o_result=${1} ;; + esac +} +_LT_EOF + ;; + *) # Bourne compatible functions. + cat << \_LT_EOF >> "$cfgfile" +# 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 () +{ + # Extract subdirectory from the argument. + func_dirname_result=`$ECHO "X${1}" | $Xsed -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 file +func_basename () +{ + func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` +} + +# 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 "X${1}" | $Xsed -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 "X${1}" | $Xsed -e "$basename"` +} + +# 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 "X${3}" \ + | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; + *) func_stripname_result=`$ECHO "X${3}" \ + | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; + esac +} + +# sed scripts: +my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q' +my_sed_long_arg='1s/^-[[^=]]*=//' + +# func_opt_split +func_opt_split () +{ + func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` + func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` +} + +# func_lo2o object +func_lo2o () +{ + func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` +} +_LT_EOF +esac + +case $lt_shell_append in + yes) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$[1]+=\$[2]" +} +_LT_EOF + ;; + *) + cat << \_LT_EOF >> "$cfgfile" + +# func_append var value +# Append VALUE to the end of shell variable VAR. +func_append () +{ + eval "$[1]=\$$[1]\$[2]" +} +_LT_EOF + ;; + esac +]) diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/m4/lt~obsolete.m4 /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/m4/lt~obsolete.m4 --- open-vm-tools-2008.01.23-74039/m4/lt~obsolete.m4 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/m4/lt~obsolete.m4 2008-10-13 08:02:05.000000000 +0100 @@ -0,0 +1,92 @@ +# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- +# +# Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. +# Written by Scott James Remnant, 2004. +# +# 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 + +# These exist entirely to fool aclocal when bootstrapping libtool. +# +# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) +# which have later been changed to m4_define as they aren't part of the +# exported API, or moved to Autoconf or Automake where they belong. +# +# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN +# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us +# using a macro with the same name in our local m4/libtool.m4 it'll +# pull the old libtool.m4 in (it doesn't see our shiny new m4_define +# and doesn't know about Autoconf macros at all.) +# +# So we provide this file, which has a silly filename so it's always +# included after everything else. This provides aclocal with the +# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything +# because those macros already exist, or will be overwritten later. +# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. +# +# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. +# Yes, that means every name once taken will need to remain here until +# we give up compatibility with versions before 1.7, at which point +# we need to keep only those names which we still refer to. + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) + +m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) +m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) +m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) +m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) +m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) +m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) +m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) +m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) +m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) +m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) +m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) +m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) +m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) +m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) +m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) +m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) +m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) +m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) +m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) +m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) +m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) +m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) +m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) +m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) +m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) +m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) +m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) +m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) +m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) +m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) +m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) +m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) +m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) +m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) +m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) +m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) +m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) +m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) +m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) +m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) +m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) +m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) +m4_ifndef([AC_LIBTOOL_RC], [AC_DEFUN([AC_LIBTOOL_RC])]) +m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) +m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) +m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) +m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) +m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) +m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) +m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) +m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) +m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/m4/ltoptions.m4 /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/m4/ltoptions.m4 --- open-vm-tools-2008.01.23-74039/m4/ltoptions.m4 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/m4/ltoptions.m4 2008-10-13 08:02:04.000000000 +0100 @@ -0,0 +1,367 @@ +# Helper functions for option handling. -*- Autoconf -*- +# +# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. +# Written by Gary V. Vaughan, 2004 +# +# 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 ltoptions.m4 + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) + + +# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) +# ------------------------------------------ +m4_define([_LT_MANGLE_OPTION], +[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) + + +# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) +# --------------------------------------- +# Set option OPTION-NAME for macro MACRO-NAME, and if there is a +# matching handler defined, dispatch to it. Other OPTION-NAMEs are +# saved as a flag. +m4_define([_LT_SET_OPTION], +[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl +m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), + _LT_MANGLE_DEFUN([$1], [$2]), + [m4_warning([Unknown $1 option `$2'])])[]dnl +]) + + +# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) +# ------------------------------------------------------------ +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +m4_define([_LT_IF_OPTION], +[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) + + +# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) +# ------------------------------------------------------- +# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME +# are set. +m4_define([_LT_UNLESS_OPTIONS], +[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), + [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), + [m4_define([$0_found])])])[]dnl +m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 +])[]dnl +]) + + +# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) +# ---------------------------------------- +# OPTION-LIST is a space-separated list of Libtool options associated +# with MACRO-NAME. If any OPTION has a matching handler declared with +# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about +# the unknown option and exit. +m4_defun([_LT_SET_OPTIONS], +[# Set options +m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), + [_LT_SET_OPTION([$1], _LT_Option)]) + +m4_if([$1],[LT_INIT],[ + dnl + dnl Simply set some default values (i.e off) if boolean options were not + dnl specified: + _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no + ]) + _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no + ]) + dnl + dnl If no reference was made to various pairs of opposing options, then + dnl we run the default mode handler for the pair. For example, if neither + dnl `shared' nor `disable-shared' was passed, we enable building of shared + dnl archives by default: + _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) + _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) + _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], + [_LT_ENABLE_FAST_INSTALL]) + ]) +])# _LT_SET_OPTIONS + + +## --------------------------------- ## +## Macros to handle LT_INIT options. ## +## --------------------------------- ## + +# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) +# ----------------------------------------- +m4_define([_LT_MANGLE_DEFUN], +[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) + + +# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) +# ----------------------------------------------- +m4_define([LT_OPTION_DEFINE], +[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl +])# LT_OPTION_DEFINE + + +# dlopen +# ------ +LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes +]) + +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.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) + + +# win32-dll +# --------- +# Declare package support for building win32 dll's. +LT_OPTION_DEFINE([LT_INIT], [win32-dll], +[enable_win32_dll=yes + +case $host in +*-*-cygwin* | *-*-mingw* | *-*-pw32*) + AC_CHECK_TOOL(AS, as, false) + AC_CHECK_TOOL(DLLTOOL, dlltool, false) + AC_CHECK_TOOL(OBJDUMP, objdump, false) + ;; +esac + +test -z "$AS" && AS=as +_LT_DECL([], [AS], [0], [Assembler program])dnl + +test -z "$DLLTOOL" && DLLTOOL=dlltool +_LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl + +test -z "$OBJDUMP" && OBJDUMP=objdump +_LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl +])# win32-dll + +AU_DEFUN([AC_LIBTOOL_WIN32_DLL], +[_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.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) + + +# _LT_ENABLE_SHARED([DEFAULT]) +# ---------------------------- +# implement the --enable-shared flag, and supports the `shared' and +# `disable-shared' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_SHARED], +[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([shared], + [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], + [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], + [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], + [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) + + _LT_DECL([build_libtool_libs], [enable_shared], [0], + [Whether or not to build shared libraries]) +])# _LT_ENABLE_SHARED + +LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) + +# Old names: +AC_DEFUN([AC_ENABLE_SHARED], +[_LT_SET_OPTION([LT_INIT], [shared]) +]) + +AC_DEFUN([AC_DISABLE_SHARED], +[_LT_SET_OPTION([LT_INIT], [disable-shared]) +]) + +AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) +AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_ENABLE_SHARED], []) +dnl AC_DEFUN([AM_DISABLE_SHARED], []) + + + +# _LT_ENABLE_STATIC([DEFAULT]) +# ---------------------------- +# implement the --enable-static flag, and support the `static' and +# `disable-static' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_STATIC], +[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([static], + [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], + [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], + [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], + [enable_static=]_LT_ENABLE_STATIC_DEFAULT) + + _LT_DECL([build_old_libs], [enable_static], [0], + [Whether or not to build static libraries]) +])# _LT_ENABLE_STATIC + +LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) + +# Old names: +AC_DEFUN([AC_ENABLE_STATIC], +[_LT_SET_OPTION([LT_INIT], [static]) +]) + +AC_DEFUN([AC_DISABLE_STATIC], +[_LT_SET_OPTION([LT_INIT], [disable-static]) +]) + +AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) +AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AM_ENABLE_STATIC], []) +dnl AC_DEFUN([AM_DISABLE_STATIC], []) + + + +# _LT_ENABLE_FAST_INSTALL([DEFAULT]) +# ---------------------------------- +# implement the --enable-fast-install flag, and support the `fast-install' +# and `disable-fast-install' LT_INIT options. +# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. +m4_define([_LT_ENABLE_FAST_INSTALL], +[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl +AC_ARG_ENABLE([fast-install], + [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], + [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], + [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], + [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) + +_LT_DECL([fast_install], [enable_fast_install], [0], + [Whether or not to optimize for fast installation])dnl +])# _LT_ENABLE_FAST_INSTALL + +LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) +LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) + +# Old names: +AU_DEFUN([AC_ENABLE_FAST_INSTALL], +[_LT_SET_OPTION([LT_INIT], [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.]) +]) + +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.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) +dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) + + +# _LT_WITH_PIC([MODE]) +# -------------------- +# implement the --with-pic flag, and support the `pic-only' and `no-pic' +# LT_INIT options. +# MODE is either `yes' or `no'. If omitted, it defaults to `both'. +m4_define([_LT_WITH_PIC], +[AC_ARG_WITH([pic], + [AS_HELP_STRING([--with-pic], + [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], + [pic_mode="$withval"], + [pic_mode=default]) + +test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) + +_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl +])# _LT_WITH_PIC + +LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) +LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) + +# Old name: +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.]) +]) + +dnl aclocal-1.4 backwards compatibility: +dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) + +## ----------------- ## +## LTDL_INIT Options ## +## ----------------- ## + +m4_define([_LTDL_MODE], []) +LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], + [m4_define([_LTDL_MODE], [nonrecursive])]) +LT_OPTION_DEFINE([LTDL_INIT], [recursive], + [m4_define([_LTDL_MODE], [recursive])]) +LT_OPTION_DEFINE([LTDL_INIT], [subproject], + [m4_define([_LTDL_MODE], [subproject])]) + +m4_define([_LTDL_TYPE], []) +LT_OPTION_DEFINE([LTDL_INIT], [installable], + [m4_define([_LTDL_TYPE], [installable])]) +LT_OPTION_DEFINE([LTDL_INIT], [convenience], + [m4_define([_LTDL_TYPE], [convenience])]) diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/m4/ltsugar.m4 /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/m4/ltsugar.m4 --- open-vm-tools-2008.01.23-74039/m4/ltsugar.m4 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/m4/ltsugar.m4 2008-10-13 08:02:05.000000000 +0100 @@ -0,0 +1,123 @@ +# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- +# +# Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. +# Written by Gary V. Vaughan, 2004 +# +# 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 ltsugar.m4 + +# This is to help aclocal find these macros, as it can't see m4_define. +AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) + + +# lt_join(SEP, ARG1, [ARG2...]) +# ----------------------------- +# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their +# associated separator. +# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier +# versions in m4sugar had bugs. +m4_define([lt_join], +[m4_if([$#], [1], [], + [$#], [2], [[$2]], + [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) +m4_define([_lt_join], +[m4_if([$#$2], [2], [], + [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) + + +# lt_car(LIST) +# lt_cdr(LIST) +# ------------ +# Manipulate m4 lists. +# These macros are necessary as long as will still need to support +# Autoconf-2.59 which quotes differently. +m4_define([lt_car], [[$1]]) +m4_define([lt_cdr], +[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], + [$#], 1, [], + [m4_dquote(m4_shift($@))])]) +m4_define([lt_unquote], $1) + + +# lt_append(MACRO-NAME, STRING, [SEPARATOR]) +# ------------------------------------------ +# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. +# Note that neither SEPARATOR nor STRING are expanded; they are appended +# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). +# No SEPARATOR is output if MACRO-NAME was previously undefined (different +# than defined and empty). +# +# This macro is needed until we can rely on Autoconf 2.62, since earlier +# versions of m4sugar mistakenly expanded SEPARATOR but not STRING. +m4_define([lt_append], +[m4_define([$1], + m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) + + + +# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) +# ---------------------------------------------------------- +# Produce a SEP delimited list of all paired combinations of elements of +# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list +# has the form PREFIXmINFIXSUFFIXn. +m4_define([lt_combine], +[m4_if([$2], [], [], + [m4_if([$4], [], [], + [lt_join(m4_quote(m4_default([$1], [[, ]])), + lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_prefix, [$2], + [m4_foreach(_Lt_suffix, lt_car([m4_shiftn(3, $@)]), + [_Lt_prefix[]$3[]_Lt_suffix ])])))))])])dnl +]) + + +# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) +# ----------------------------------------------------------------------- +# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited +# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. +m4_define([lt_if_append_uniq], +[m4_ifdef([$1], + [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], + [lt_append([$1], [$2], [$3])$4], + [$5])], + [lt_append([$1], [$2], [$3])$4])]) + + +# lt_dict_add(DICT, KEY, VALUE) +# ----------------------------- +m4_define([lt_dict_add], +[m4_define([$1($2)], [$3])]) + + +# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) +# -------------------------------------------- +m4_define([lt_dict_add_subkey], +[m4_define([$1($2:$3)], [$4])]) + + +# lt_dict_fetch(DICT, KEY, [SUBKEY]) +# ---------------------------------- +m4_define([lt_dict_fetch], +[m4_ifval([$3], + m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), + m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) + + +# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) +# ----------------------------------------------------------------- +m4_define([lt_if_dict_fetch], +[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], + [$5], + [$6])]) + + +# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) +# -------------------------------------------------------------- +m4_define([lt_dict_filter], +[m4_if([$5], [], [], + [lt_join(m4_quote(m4_default([$4], [[, ]])), + lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), + [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl +]) diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/m4/ltversion.m4 /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/m4/ltversion.m4 --- open-vm-tools-2008.01.23-74039/m4/ltversion.m4 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/m4/ltversion.m4 2008-10-13 08:02:05.000000000 +0100 @@ -0,0 +1,23 @@ +# ltversion.m4 -- version numbers -*- Autoconf -*- +# +# Copyright (C) 2004 Free Software Foundation, Inc. +# Written by Scott James Remnant, 2004 +# +# 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. + +# Generated from ltversion.in. + +# serial 2599 ltversion.m4 +# This file is part of GNU Libtool + +m4_define([LT_PACKAGE_VERSION], [2.2]) +m4_define([LT_PACKAGE_REVISION], [1.2599]) + +AC_DEFUN([LTVERSION_VERSION], +[macro_version='2.2' +macro_revision='1.2599' +_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) +_LT_DECL(, macro_revision, 0) +]) diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/Makefile.am --- open-vm-tools-2008.01.23-74039/Makefile.am 2008-01-28 08:02:43.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/Makefile.am 2008-10-13 08:01:38.000000000 +0100 @@ -18,10 +18,14 @@ ### Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ +# These flags get passed to aclocal when autoreconf calls it, and tell aclocal +# that all of our macros are in the 'm4' subdirectory. +ACLOCAL_AMFLAGS = -I m4 + # These subdirectories require X, and may be disabled using --without-x X11_SUBDIRS = X11_SUBDIRS += vmware-user -X11_SUBDIRS += toolbox +X11_SUBDIRS += vmware-user-suid-wrapper SUBDIRS = SUBDIRS += lib @@ -36,7 +40,10 @@ SUBDIRS += checkvm SUBDIRS += libguestlib SUBDIRS += xferlogs - -.PHONY: modules -modules: - $(MAKE) -C modules +SUBDIRS += scripts +SUBDIRS += toolbox +if !SOLARIS +if WITH_KERNEL_MODULES +SUBDIRS += modules +endif +endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/Makefile.in --- open-vm-tools-2008.01.23-74039/Makefile.in 2008-01-28 08:03:06.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/Makefile.in 2008-10-13 08:02:17.000000000 +0100 @@ -53,13 +53,18 @@ host_triplet = @host@ @HAVE_X11_TRUE@am__append_1 = $(X11_SUBDIRS) @BUILD_HGFSMOUNTER_TRUE@am__append_2 = hgfsmounter +@SOLARIS_FALSE@@WITH_KERNEL_MODULES_TRUE@am__append_3 = modules subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(top_srcdir)/configure AUTHORS COPYING \ - ChangeLog INSTALL NEWS config.guess config.sub depcomp \ - install-sh ltmain.sh missing + ChangeLog INSTALL NEWS config/compile config/config.guess \ + config/config.sub config/depcomp config/install-sh \ + config/ltmain.sh config/missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +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)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ @@ -79,8 +84,9 @@ distclean-recursive maintainer-clean-recursive ETAGS = etags CTAGS = ctags -DIST_SUBDIRS = lib guestd vmware-user toolbox hgfsclient hgfsmounter \ - checkvm libguestlib xferlogs +DIST_SUBDIRS = lib guestd vmware-user vmware-user-suid-wrapper \ + hgfsclient hgfsmounter checkvm libguestlib xferlogs scripts \ + toolbox modules DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -102,8 +108,6 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -COMMON_CFLAGS = @COMMON_CFLAGS@ -COMMON_PROG_CFLAGS = @COMMON_PROG_CFLAGS@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -114,45 +118,57 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ -ECHO = @ECHO@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GREP = @GREP@ -GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_AUTH_CFLAGS = @LIB_AUTH_CFLAGS@ -LIB_FILE_CFLAGS = @LIB_FILE_CFLAGS@ -LIB_HGFS_SERVER_CFLAGS = @LIB_HGFS_SERVER_CFLAGS@ -LIB_IMPERSONATE_CFLAGS = @LIB_IMPERSONATE_CFLAGS@ -LIB_MISC_CFLAGS = @LIB_MISC_CFLAGS@ -LIB_PROC_MGR_CFLAGS = @LIB_PROC_MGR_CFLAGS@ -LIB_STRING_CFLAGS = @LIB_STRING_CFLAGS@ -LIB_USER_CFLAGS = @LIB_USER_CFLAGS@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -160,27 +176,35 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ VERSION = @VERSION@ -VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -211,6 +235,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -226,10 +251,14 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ +# These flags get passed to aclocal when autoreconf calls it, and tell aclocal +# that all of our macros are in the 'm4' subdirectory. +ACLOCAL_AMFLAGS = -I m4 + # These subdirectories require X, and may be disabled using --without-x -X11_SUBDIRS = vmware-user toolbox +X11_SUBDIRS = vmware-user vmware-user-suid-wrapper SUBDIRS = lib guestd $(am__append_1) hgfsclient $(am__append_2) \ - checkvm libguestlib xferlogs + checkvm libguestlib xferlogs scripts toolbox $(am__append_3) all: all-recursive .SUFFIXES: @@ -655,10 +684,6 @@ mostlyclean-libtool pdf pdf-am ps ps-am tags tags-recursive \ uninstall uninstall-am - -.PHONY: modules -modules: - $(MAKE) -C modules # 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: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/missing /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/missing --- open-vm-tools-2008.01.23-74039/missing 2008-01-28 08:03:02.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/missing 1970-01-01 01:00:00.000000000 +0100 @@ -1,367 +0,0 @@ -#! /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 <pinard@iro.umontreal.ca>, 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 <bug-automake@gnu.org>." - 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: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmblock/block.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmblock/block.c --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmblock/block.c 2008-01-28 08:02:45.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmblock/block.c 2008-10-13 08:01:39.000000000 +0100 @@ -37,7 +37,8 @@ /* os.h includes necessary OS-specific headers. */ #include "os.h" -#ifdef linux +#if defined(vmblock_fuse) +#elif defined(linux) # include "vmblockInt.h" #elif defined(sun) # include "module.h" @@ -350,7 +351,7 @@ */ if (cookie == NULL) { os_read_lock(&blockedFilesLock); - block = GetBlock(filename, NULL); + block = GetBlock(filename, OS_UNKNOWN_BLOCKER); os_read_unlock(&blockedFilesLock); if (!block) { @@ -419,7 +420,7 @@ os_read_lock(&blockedFilesLock); block = GetBlock(filename, blocker); - + os_read_unlock(&blockedFilesLock); return block; diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmblock/compat_freebsd.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmblock/compat_freebsd.h --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmblock/compat_freebsd.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmblock/compat_freebsd.h 2008-10-13 08:01:39.000000000 +0100 @@ -0,0 +1,49 @@ +/********************************************************* + * Copyright (C) 2008 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. + * 3. Neither the name of VMware Inc. nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission of VMware Inc. + * + * 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. + * + *********************************************************/ + +#ifndef __COMPAT_FREEBSD_H__ +#define __COMPAT_FREEBSD_H__ 1 + +#include <sys/param.h> +#include "compat_vop.h" + +/* + * FreeBSD version 8 and above uses the kproc API instead of the kthread API in its + * kernel. + */ +#if __FreeBSD_version > 800001 +#define compat_kthread_create kproc_create +#define compat_kthread_exit kproc_exit +#else +#define compat_kthread_create kthread_create +#define compat_kthread_exit kthread_exit +#endif + +#endif // __COMPAT_FREEBSD_H__ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmblock/compat_vop.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmblock/compat_vop.h --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmblock/compat_vop.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmblock/compat_vop.h 2008-10-13 08:01:39.000000000 +0100 @@ -0,0 +1,64 @@ +/********************************************************* + * Copyright (C) 2008 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. + * 3. Neither the name of VMware Inc. nor the names of its contributors + * may be used to endorse or promote products derived from this software + * without specific prior written permission of VMware Inc. + * + * 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. + * + *********************************************************/ + +#ifndef __COMPAT_VOP_H__ +# define __COMPAT_VOP_H__ 1 + +#if __FreeBSD_version >= 800011 +#define COMPAT_THREAD_VAR(varname, varval) +#define COMPAT_VOP_LOCK(vop, flags, threadvar) VOP_LOCK((vop), (flags)) +#define COMPAT_VOP_UNLOCK(vop, flags, threadvar) VOP_UNLOCK((vop), (flags)) +#define compat_lockstatus(lock, threadvar) lockstatus((lock)) +#define compat_lockmgr(lock, flags, randompointerparam, threadval) lockmgr((lock), (flags), (randompointerparam)) +#define compat_vn_lock(vp, flags, threadval) vn_lock((vp), (flags)) +#else +#define COMPAT_THREAD_VAR(varname, varval) struct thread *varname = varval +#define COMPAT_VOP_LOCK(vop, flags, threadvar) VOP_LOCK((vop), (flags), (threadvar)) +#define COMPAT_VOP_UNLOCK(vop, flags, threadvar) VOP_UNLOCK((vop), (flags), (threadvar)) +#define compat_lockstatus(lock, threadvar) lockstatus((lock), (threadvar)) +#define compat_vn_lock(vp, flags, threadval) vn_lock((vp), (flags), (threadval)) +#define compat_lockmgr(lock, flags, randompointerparam, threadval) lockmgr((lock), (flags), (randompointerparam), (threadval)) +#endif + +/* + * We use defines rather than typedefs here to avoid causing problems for files that + * don't have a vnode_if.h available. + */ +#if __FreeBSD_version >= 700000 +# define compat_vop_lock_t vop_lock1_t +# define compat_vop_lock_args struct vop_lock1_args +# define COMPAT_VOP_LOCK_OP_ELEMENT vop_lock1 +#else +# define compat_vop_lock_t vop_lock_t +# define compat_vop_lock_args struct vop_lock_args +# define COMPAT_VOP_LOCK_OP_ELEMENT vop_lock +#endif + +#endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmblock/dbllnklst.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmblock/dbllnklst.c --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmblock/dbllnklst.c 2008-01-28 08:02:45.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmblock/dbllnklst.c 2008-10-13 08:01:39.000000000 +0100 @@ -176,7 +176,7 @@ */ Bool -DblLnkLst_IsLinked(DblLnkLst_Links *l) // IN +DblLnkLst_IsLinked(DblLnkLst_Links const *l) // IN { ASSERT(l); diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmblock/dbllnklst.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmblock/dbllnklst.h --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmblock/dbllnklst.h 2008-01-28 08:02:45.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmblock/dbllnklst.h 2008-10-13 08:01:39.000000000 +0100 @@ -70,7 +70,7 @@ void DblLnkLst_Link(DblLnkLst_Links *l1, DblLnkLst_Links *l2); void DblLnkLst_Unlink(DblLnkLst_Links *l1, DblLnkLst_Links *l2); void DblLnkLst_Unlink1(DblLnkLst_Links *l); -Bool DblLnkLst_IsLinked(DblLnkLst_Links *l); +Bool DblLnkLst_IsLinked(DblLnkLst_Links const *l); /* Functions specific to anchored lists. --hpreg */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmblock/Makefile /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmblock/Makefile --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmblock/Makefile 2008-01-28 08:02:45.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmblock/Makefile 2008-10-13 08:01:39.000000000 +0100 @@ -37,6 +37,8 @@ HEADERS += vnode_if.h HEADERS += vmblock_k.h HEADERS += os.h +HEADERS += compat_freebsd.h +HEADERS += compat_vop.h CSRCS := block.c CSRCS += dbllnklst.c diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmblock/stubs.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmblock/stubs.c --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmblock/stubs.c 2008-01-28 08:02:45.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmblock/stubs.c 2008-10-13 08:01:39.000000000 +0100 @@ -35,6 +35,8 @@ * Common stubs. */ +#include <stdarg.h> + #include "os.h" /* diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmblock/stubs.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmblock/stubs.h --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmblock/stubs.h 2008-01-28 08:02:45.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmblock/stubs.h 2008-10-13 08:01:39.000000000 +0100 @@ -38,7 +38,7 @@ #ifndef __STUBS_H__ #define __STUBS_H__ -#ifdef linux +#if defined(linux) && !defined(vmblock_fuse) # include "driver-config.h" # include "compat_version.h" #endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmblock/vfsops.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmblock/vfsops.c --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmblock/vfsops.c 2008-01-28 08:02:45.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmblock/vfsops.c 2008-10-13 08:01:39.000000000 +0100 @@ -52,11 +52,13 @@ #include <sys/lock.h> #include <sys/malloc.h> #include <sys/mount.h> +#include <sys/fcntl.h> #include <sys/namei.h> #include <sys/proc.h> #include <sys/vnode.h> #include "vmblock_k.h" +#include "compat_freebsd.h" static MALLOC_DEFINE(M_VMBLOCKFSMNT, "VMBlockFS mount", "VMBlockFS mount structure"); @@ -187,7 +189,7 @@ * Make sure the node alias worked */ if (error) { - VOP_UNLOCK(vp, 0, td); + COMPAT_VOP_UNLOCK(vp, 0, td); vrele(lowerrootvp); free(xmp, M_VMBLOCKFSMNT); /* XXX */ return error; @@ -209,7 +211,7 @@ /* * Unlock the node (either the lower or the alias) */ - VOP_UNLOCK(vp, 0, td); + COMPAT_VOP_UNLOCK(vp, 0, td); /* * If the staging area is a local filesystem, reflect that here, too. (We @@ -217,7 +219,7 @@ */ MNT_ILOCK(mp); mp->mnt_flag |= lowerrootvp->v_mount->mnt_flag & MNT_LOCAL; -#if BSD_VERSION >= 60 +#if __FreeBSD_version >= 600000 mp->mnt_kern_flag |= lowerrootvp->v_mount->mnt_kern_flag & MNTK_MPSAFE; #endif MNT_IUNLOCK(mp); @@ -288,14 +290,14 @@ * transfer will happen atomically. (Er, at least within the scope of * the vnode subsystem.) */ - VOP_LOCK(vp, LK_EXCLUSIVE|LK_RETRY|LK_INTERLOCK, td); + COMPAT_VOP_LOCK(vp, LK_EXCLUSIVE|LK_RETRY|LK_INTERLOCK, td); removed = BlockRemoveAllBlocks(OS_UNKNOWN_BLOCKER); VI_LOCK(vp); vp->v_usecount -= removed; VI_UNLOCK(vp); - VOP_UNLOCK(vp, 0, td); + COMPAT_VOP_UNLOCK(vp, 0, td); if (mntflags & MNT_FORCE) { flags |= FORCECLOSE; @@ -346,7 +348,7 @@ */ vp = MNTTOVMBLOCKMNT(mp)->rootVnode; VREF(vp); - vn_lock(vp, flags | LK_RETRY, td); + compat_vn_lock(vp, flags | LK_RETRY, td); *vpp = vp; return 0; } diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmblock/vm_assert.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmblock/vm_assert.h --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmblock/vm_assert.h 2008-01-28 08:02:45.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmblock/vm_assert.h 2008-10-13 08:01:39.000000000 +0100 @@ -110,8 +110,6 @@ * ASSERT() is special cased because of interaction with Windows DDK. */ -#define IMPLIES(a,b) (!(a) || (b)) - #if defined VMX86_DEBUG || defined ASSERT_ALWAYS_AVAILABLE #undef ASSERT #define ASSERT(cond) \ @@ -255,12 +253,21 @@ /* - * Compile-time assertions + * 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). */ #define ASSERT_ON_COMPILE(e) \ do { \ - typedef char AssertOnCompileType[(e) ? 1 : -1]; \ + enum { AssertOnCompileMisused = ((e) ? 1 : -1) }; \ + typedef char AssertOnCompileFailed[AssertOnCompileMisused]; \ } while (0) diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmblock/vm_basic_defs.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmblock/vm_basic_defs.h --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmblock/vm_basic_defs.h 2008-01-28 08:02:45.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmblock/vm_basic_defs.h 2008-10-13 08:01:39.000000000 +0100 @@ -51,6 +51,10 @@ #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 <stddef.h> /* * We re-define offsetof macro from stddef, make @@ -64,7 +68,8 @@ * Simple macros */ -#if defined __APPLE__ && !defined KERNEL +#if (defined __APPLE__ || defined __FreeBSD__) && \ + (!defined KERNEL && !defined _KERNEL && !defined VMKERNEL && !defined __KERNEL__) # include <stddef.h> #else // XXX the __cplusplus one matches that of VC++, to prevent redefinition warning @@ -120,6 +125,7 @@ #define DWORD_ALIGN(x) ((((x)+3) >> 2) << 2) #define QWORD_ALIGN(x) ((((x)+4) >> 3) << 3) +#define IMPLIES(a,b) (!(a) || (b)) /* * Not everybody (e.g., the monitor) has NULL @@ -325,7 +331,22 @@ #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 // { @@ -336,7 +357,7 @@ * guarantee. Bummer. --Jeremy. */ -#if defined(N_PLAT_NLM) || defined(__FreeBSD__) +#if defined(N_PLAT_NLM) /* We do not have YIELD() as we do not need it yet... */ #elif defined(_WIN32) # define YIELD() Sleep(0) @@ -462,12 +483,23 @@ */ #undef DEBUG_ONLY +#undef SL_DEBUG_ONLY +#undef VMX86_SL_DEBUG #ifdef VMX86_DEBUG -#define vmx86_debug 1 -#define DEBUG_ONLY(x) x +#define vmx86_debug 1 +#define DEBUG_ONLY(x) x +/* + * Be very, very, very careful with SL_DEBUG. Pls ask ganesh or min before + * using it. + */ +#define VMX86_SL_DEBUG +#define vmx86_sl_debug 1 +#define SL_DEBUG_ONLY(x) x #else -#define vmx86_debug 0 +#define vmx86_debug 0 #define DEBUG_ONLY(x) +#define vmx86_sl_debug 0 +#define SL_DEBUG_ONLY(x) #endif #ifdef VMX86_STATS @@ -555,18 +587,32 @@ #endif #endif -#ifdef VMX86_VPROBES -#define vmx86_vprobes 1 -#define VPROBES_ONLY(x) x +#ifdef _WIN32 +#define VMW_INVALID_HANDLE INVALID_HANDLE_VALUE +#else +#define VMW_INVALID_HANDLE (-1) +#endif + +#ifdef _WIN32 +#define fsync(fd) _commit(fd) +#define fileno(f) _fileno(f) #else -#define vmx86_vprobes 0 -#define VPROBES_ONLY(x) #endif +/* + * Debug output macros for Windows drivers (the Eng variant is for + * display/printer drivers only. + */ #ifdef _WIN32 -#define VMW_INVALID_HANDLE INVALID_HANDLE_VALUE +#ifndef USES_OLD_WINDDK +#if defined(VMX86_DEBUG) || defined(ASSERT_ALWAYS_AVAILABLE) +#define WinDrvPrint(arg, ...) DbgPrint(arg, __VA_ARGS__) +#define WinDrvEngPrint(arg, ...) EngDbgPrint(arg, __VA_ARGS__) #else -#define VMW_INVALID_HANDLE -1 +#define WinDrvPrint(arg, ...) +#define WinDrvEngPrint(arg, ...) #endif +#endif +#endif // _WIN32 #endif // ifndef _VM_BASIC_DEFS_H_ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmblock/vm_basic_types.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmblock/vm_basic_types.h --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmblock/vm_basic_types.h 2008-01-28 08:02:45.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmblock/vm_basic_types.h 2008-10-13 08:01:39.000000000 +0100 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998-2007 VMware, Inc. All rights reserved. + * Copyright (C) 1998-2008 VMware, Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -104,10 +104,6 @@ #pragma warning (disable :4305) // truncation from 'const int' to 'short' #pragma warning (disable :4244) // conversion from 'unsigned short' to 'unsigned char' #pragma warning (disable :4267) // truncation of 'size_t' -#if !defined VMX86_DEVEL // XXX until we clean up all the code -- edward -#pragma warning (disable :4133) // incompatible types - from 'struct VM *' to 'int *' -#pragma warning (disable :4047) // differs in levels of indirection -#endif #pragma warning (disable :4146) // unary minus operator applied to unsigned type, result still unsigned #pragma warning (disable :4142) // benign redefinition of type @@ -166,12 +162,16 @@ #include <stdlib.h> #endif +#ifdef __FreeBSD__ +#include <sys/param.h> /* For __FreeBSD_version */ +#endif + #if !defined(USING_AUTOCONF) # if defined(__FreeBSD__) || defined(sun) # ifdef KLD_MODULE # include <sys/types.h> # else -# if (BSD_VERSION >= 50) +# if !defined(VMKERNEL) && (__FreeBSD_version >= 500043) # include <inttypes.h> # include <sys/types.h> # else @@ -266,7 +266,12 @@ || (defined(_POSIX2_VERSION) && _POSIX2_VERSION >= 200112L) /* BSD/Darwin, Linux */ #define FMTSZ "z" - #define FMTPD "t" + + #if defined(VM_X86_64) || defined(__APPLE__) + #define FMTPD "l" + #else + #define FMTPD "" + #endif #else /* Systems with a pre-C99 libc */ #define FMTSZ "Z" @@ -350,8 +355,8 @@ * Type big enough to hold an integer between 0..100 */ typedef uint8 Percent; -#define asPercent(v) ((Percent)(v)) -#define CHOOSE_PERCENT asPercent(-1) +#define AsPercent(v) ((Percent)(v)) +#define CHOOSE_PERCENT AsPercent(101) typedef uintptr_t VA; @@ -383,6 +388,9 @@ typedef User_CartelID User_CartelGroupID; #define INVALID_CARTELGROUP_ID INVALID_CARTEL_ID +typedef uint32 Worldlet_ID; +#define INVALID_WORLDLET_ID ((Worldlet_ID)0) + /* world page number */ typedef uint32 WPN; @@ -393,6 +401,12 @@ #endif /* + * This type should be used for variables that contain sector + * position/quantity. + */ +typedef uint64 SectorType; + +/* * Linear address */ @@ -446,6 +460,7 @@ typedef VA32 UserVA32; typedef VA64 UserVA64; typedef UserVA32 UserVAConst; /* Userspace ptr to data that we may only read. */ +typedef UserVA64 UserVA64Const; /* Used by 64-bit syscalls until conversion is finished. */ #ifdef VMKERNEL typedef UserVA32 UserVA; #else @@ -459,10 +474,10 @@ * for any region other than buserror. */ #define PHYSMEM_MAX_PPN ((PPN)0xffffffff) -#define MAX_PPN ((PPN)0x0fffffff) /* Maximal observable PPN value. */ -#define INVALID_PPN ((PPN)-1) +#define MAX_PPN ((PPN)0x1fffffff) /* Maximal observable PPN value. */ +#define INVALID_PPN ((PPN)0xffffffff) -#define INVALID_BPN ((BPN) 0x3fffffff) /* BPNs don't use the high two bits. */ +#define INVALID_BPN ((BPN) 0x1fffffff) #define INVALID_MPN ((MPN)-1) #define MEMREF_MPN ((MPN)-2) @@ -492,8 +507,9 @@ # define FMTVPN "" #endif - +#ifndef EXTERN #define EXTERN extern +#endif #define CONST const @@ -643,6 +659,12 @@ # define PRINTF_DECL(fmtPos, varPos) #endif +#if defined(__GNUC__) +# define SCANF_DECL(fmtPos, varPos) __attribute__((__format__(__scanf__, fmtPos, varPos))) +#else +# define SCANF_DECL(fmtPos, varPos) +#endif + /* * UNUSED_PARAM should surround the parameter name and type declaration, * e.g. "int MyFunction(int var1, UNUSED_PARAM(int var2))" @@ -689,6 +711,52 @@ #endif /* + *********************************************************************** + * STRUCT_OFFSET_CHECK -- */ /** + * + * \brief Check if the actual offsef of a member in a structure + * is what is expected + * + * + * \param[in] STRUCT Structure the member is a part of. + * \param[in] MEMBER Member to check the offset of. + * \param[in] OFFSET Expected offset of MEMBER in STRUCTURE. + * \param[in] DEBUG_EXTRA Additional bytes to be added to OFFSET to + * compensate for extra info in debug builds. + * + *********************************************************************** + */ +#ifdef VMX86_DEBUG +#define STRUCT_OFFSET_CHECK(STRUCT, MEMBER, OFFSET, DEBUG_EXTRA) \ + ASSERT_ON_COMPILE(vmk_offsetof(STRUCT, MEMBER) == (OFFSET + DEBUG_EXTRA)) +#else +#define STRUCT_OFFSET_CHECK(STRUCT, MEMBER, OFFSET, DEBUG_EXTRA) \ + ASSERT_ON_COMPILE(vmk_offsetof(STRUCT, MEMBER) == OFFSET) +#endif + +/* + *********************************************************************** + * STRUCT_SIZE_CHECK -- */ /** + * + * \brief Check if the actual size of a structure is what is expected + * + * + * \param[in] STRUCT Structure whose size is to be checked. + * \param[in] SIZE Expected size of STRUCT. + * \param[in] DEBUG_EXTRA Additional bytes to be added to SIZE to + * compensate for extra info in debug builds. + * + *********************************************************************** + */ +#ifdef VMX86_DEBUG +#define STRUCT_SIZE_CHECK(STRUCT, SIZE, DEBUG_EXTRA) \ + ASSERT_ON_COMPILE(sizeof(STRUCT) == (SIZE + DEBUG_EXTRA)) +#else +#define STRUCT_SIZE_CHECK(STRUCT, SIZE, DEBUG_EXTRA) \ + ASSERT_ON_COMPILE(sizeof(STRUCT) == SIZE) +#endif + +/* * __func__ is a stringified function name that is part of the C99 standard. The block * below defines __func__ on older systems where the compiler does not support that * macro. @@ -843,4 +911,14 @@ typedef int PollDevHandle; #endif +/* + * Define the utf16_t type. + */ + +#if defined(_WIN32) && defined(_NATIVE_WCHAR_T_DEFINED) +typedef wchar_t utf16_t; +#else +typedef uint16 utf16_t; +#endif + #endif /* _VM_BASIC_TYPES_H_ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmblock/vmblock.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmblock/vmblock.h --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmblock/vmblock.h 2008-01-28 08:02:45.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmblock/vmblock.h 2008-10-13 08:01:39.000000000 +0100 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2006 VMware, Inc. All rights reserved. + * Copyright (C) 2006-2008 VMware, Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -32,6 +32,25 @@ * vmblock.h -- * * User-level interface to the vmblock device. + * + * VMBLOCK_DEVICE should be opened with VMBLOCK_DEVICE_MODE mode. Then + * VMBLOCK_CONTROL should be called to perform blocking operations. + * The links which can be blocked are in the directory VMBLOCK_MOUNT_POINT. + * + * VMBLOCK_CONTROL takes the file descriptor of the VMBLOCK_DEVICE, an + * operation, and the path of the target of the file being operated on (if + * applicable). + * + * The operation should be one of: + * VMBLOCK_ADD_FILEBLOCK + * VMBLOCK_DEL_FILEBLOCK + * VMBLOCK_LIST_FILEBLOCKS + * + * path should be something in /tmp/VMwareDnD/ rather than in + * VMBLOCK_MOUNT_POINT. + * + * VMBLOCK_CONTROL returns 0 on success or returns -1 and sets errno on + * failure. */ #ifndef _VMBLOCK_H_ @@ -48,7 +67,69 @@ #define VMBLOCK_FS_NAME "vmblock" /* Commands for the control half of vmblock driver */ -#if defined(linux) +#if defined(vmblock_fuse) +# include <unistd.h> +# include <limits.h> +# include <string.h> +# include <errno.h> +# include "vm_basic_types.h" +# define VMBLOCK_ADD_FILEBLOCK 'a' +# define VMBLOCK_DEL_FILEBLOCK 'd' +# ifdef VMX86_DEVEL +# define VMBLOCK_LIST_FILEBLOCKS 'l' +# endif /* VMX86_DEVEL */ +/* + * Some of the following names don't actually make much sense on their own. + * They're used for consistency with the other ports. See the file header for + * explanations of what they're used for. + */ +# define VMBLOCK_DEVICE_NAME "dev" +# define VMBLOCK_CONTROL_MOUNTPOINT "blockdir" +# define VMBLOCK_DEVICE "/tmp/vmblock/" VMBLOCK_DEVICE_NAME +# define VMBLOCK_DEVICE_MODE O_WRONLY +# define VMBLOCK_MOUNT_POINT "/tmp/vmblock/" VMBLOCK_CONTROL_MOUNTPOINT +static INLINE ssize_t + VMBLOCK_CONTROL(int fd, char op, const char *path) +{ + /* + * buffer needs room for an operation character and a string with max length + * PATH_MAX - 1. + */ + + char buffer[PATH_MAX]; + size_t pathLength; + + pathLength = strlen(path); + if (pathLength >= PATH_MAX) { + errno = ENAMETOOLONG; + return -1; + } + + buffer[0] = op; + memcpy(buffer + 1, path, pathLength); + + /* + * The lseek is only to prevent the file pointer from overflowing; + * vmblock-fuse ignores the file pointer / offset. Overflowing the file + * pointer causes write to fail: + * http://article.gmane.org/gmane.comp.file-systems.fuse.devel/6648 + * There's also a race condition here where many threads all calling + * VMBLOCK_CONTROL at the same time could have all their seeks executed one + * after the other, followed by all the writes. Again, it's not a problem + * unless the file pointer overflows which is very unlikely with 32 bit + * offsets and practically impossible with 64 bit offsets. + */ + + if (lseek(fd, 0, SEEK_SET) < 0) { + return -1; + } + if (write(fd, buffer, pathLength + 1) < 0) { + return -1; + } + return 0; +} + +#elif defined(linux) # define VMBLOCK_ADD_FILEBLOCK 98 # define VMBLOCK_DEL_FILEBLOCK 99 # ifdef VMX86_DEVEL @@ -57,10 +138,11 @@ # define VMBLOCK_CONTROL_DIRNAME VMBLOCK_FS_NAME # define VMBLOCK_CONTROL_DEVNAME "dev" # define VMBLOCK_CONTROL_MOUNTPOINT "mountPoint" +# define VMBLOCK_CONTROL_PROC_DIRNAME "fs/" VMBLOCK_CONTROL_DIRNAME -# define VMBLOCK_MOUNT_POINT "/proc/fs/" VMBLOCK_CONTROL_DIRNAME \ +# define VMBLOCK_MOUNT_POINT "/proc/" VMBLOCK_CONTROL_PROC_DIRNAME \ "/" VMBLOCK_CONTROL_MOUNTPOINT -# define VMBLOCK_DEVICE "/proc/fs/" VMBLOCK_CONTROL_DIRNAME \ +# define VMBLOCK_DEVICE "/proc/" VMBLOCK_CONTROL_PROC_DIRNAME \ "/" VMBLOCK_CONTROL_DEVNAME # define VMBLOCK_DEVICE_MODE O_WRONLY # define VMBLOCK_CONTROL(fd, op, path) write(fd, path, op) diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmblock/vnops.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmblock/vnops.c --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmblock/vnops.c 2008-01-28 08:02:45.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmblock/vnops.c 2008-10-13 08:01:39.000000000 +0100 @@ -187,6 +187,10 @@ #include <sys/file.h> #include <sys/filedesc.h> #include <sys/kdb.h> +#include "compat_freebsd.h" +#if __FreeBSD_version >= 700000 +#include <sys/priv.h> +#endif #include "vmblock_k.h" #include "vmblock.h" @@ -210,7 +214,7 @@ static vop_inactive_t VMBlockVopInactive; static vop_ioctl_t VMBlockVopIoctl; static vop_islocked_t VMBlockVopIsLocked; -static vop_lock_t VMBlockVopLock; +static compat_vop_lock_t VMBlockVopLock; static vop_lookup_t VMBlockVopLookup; static vop_open_t VMBlockVopOpen; static vop_print_t VMBlockVopPrint; @@ -246,23 +250,23 @@ */ struct vop_vector VMBlockVnodeOps = { - .vop_bypass = VMBlockVopBypass, - .vop_access = VMBlockVopAccess, - .vop_bmap = VOP_EOPNOTSUPP, - .vop_getattr = VMBlockVopGetAttr, - .vop_getwritemount = VMBlockVopGetWriteMount, - .vop_inactive = VMBlockVopInactive, - .vop_ioctl = VMBlockVopIoctl, - .vop_islocked = VMBlockVopIsLocked, - .vop_lock = VMBlockVopLock, - .vop_lookup = VMBlockVopLookup, - .vop_open = VMBlockVopOpen, - .vop_print = VMBlockVopPrint, - .vop_reclaim = VMBlockVopReclaim, - .vop_rename = VMBlockVopRename, - .vop_setattr = VMBlockVopSetAttr, - .vop_strategy = VOP_EOPNOTSUPP, - .vop_unlock = VMBlockVopUnlock, + .vop_bypass = VMBlockVopBypass, + .vop_access = VMBlockVopAccess, + .vop_bmap = VOP_EOPNOTSUPP, + .vop_getattr = VMBlockVopGetAttr, + .vop_getwritemount = VMBlockVopGetWriteMount, + .vop_inactive = VMBlockVopInactive, + .vop_ioctl = VMBlockVopIoctl, + .vop_islocked = VMBlockVopIsLocked, + .COMPAT_VOP_LOCK_OP_ELEMENT = VMBlockVopLock, + .vop_lookup = VMBlockVopLookup, + .vop_open = VMBlockVopOpen, + .vop_print = VMBlockVopPrint, + .vop_reclaim = VMBlockVopReclaim, + .vop_rename = VMBlockVopRename, + .vop_setattr = VMBlockVopSetAttr, + .vop_strategy = VOP_EOPNOTSUPP, + .vop_unlock = VMBlockVopUnlock, }; /* @@ -560,7 +564,7 @@ */ { struct componentname *cnp = ap->a_cnp; - struct thread *td = cnp->cn_thread; + COMPAT_THREAD_VAR(td, cnp->cn_thread); struct vnode *dvp = ap->a_dvp; struct vnode *vp, *ldvp, *lvp; BlockHandle blockCookie; @@ -599,15 +603,15 @@ } if ((blockCookie = BlockLookup(pathname, OS_UNKNOWN_BLOCKER)) != NULL) { - int lkflags = lockstatus(dvp->v_vnlock, td) & LK_TYPE_MASK; + int lkflags = compat_lockstatus(dvp->v_vnlock, td) & LK_TYPE_MASK; lvp = VPTOVMB(dvp)->lowerVnode; vhold(dvp); vhold(lvp); - VOP_UNLOCK(dvp, 0, td); + COMPAT_VOP_UNLOCK(dvp, 0, td); error = BlockWaitOnFile(pathname, blockCookie); - VOP_LOCK(dvp, lkflags, td); + COMPAT_VOP_LOCK(dvp, lkflags, td); vdrop(lvp); vdrop(dvp); if (dvp->v_op != &VMBlockVnodeOps) { @@ -720,7 +724,11 @@ * readdir() of the filesystem root for non-privileged users. */ if ((retval = suser(ap->a_td)) == 0) { +#if __FreeBSD_version >= 700000 + fp = ap->a_fp; +#else fp = ap->a_td->td_proc->p_fd->fd_ofiles[ap->a_fdidx]; +#endif fp->f_ops = &VMBlockFileOps; } } else { @@ -818,7 +826,7 @@ { VMBlockIoctlArgs *ioctlArgs = (VMBlockIoctlArgs *)ap->a_data; VMBlockMount *mp; - struct thread *td = ap->a_td; + COMPAT_THREAD_VAR(td, ap->a_td); struct vnode *vp = ap->a_vp; char *pathbuf = NULL; int ret = 0, pathlen; @@ -833,10 +841,10 @@ * may be invalid. * 2. Make sure the filesystem isn't being unmounted. */ - VOP_LOCK(vp, LK_EXCLUSIVE|LK_RETRY, td); + COMPAT_VOP_LOCK(vp, LK_EXCLUSIVE|LK_RETRY, td); if (vp->v_op != &VMBlockVnodeOps || vp->v_mount->mnt_kern_flag & MNTK_UNMOUNT) { - VOP_UNLOCK(vp, 0, td); + COMPAT_VOP_UNLOCK(vp, 0, td); return EBADF; } @@ -853,7 +861,7 @@ * argument before passing to the lower layer. */ ap->a_data = ioctlArgs->data; - VOP_UNLOCK(vp, 0, td); + COMPAT_VOP_UNLOCK(vp, 0, td); return VMBlockVopBypass((struct vop_generic_args *)ap); } @@ -921,7 +929,7 @@ ret = EOPNOTSUPP; } - VOP_UNLOCK(vp, 0, td); + COMPAT_VOP_UNLOCK(vp, 0, td); if (pathbuf) { uma_zfree(VMBlockPathnameZone, pathbuf); } @@ -1100,18 +1108,18 @@ */ static int -VMBlockVopLock(struct vop_lock_args *ap) +VMBlockVopLock(compat_vop_lock_args *ap) /* -struct vop_lock_args { - struct vnode *vp; // IN: vnode operand - int flags; // IN: lockmgr(9) flags - struct thread *td; // IN: calling thread's context -}; +struct { + struct vnode *a_vp; // IN: vnode operand + int a_flags; // IN: lockmgr(9) flags + struct thread *a_td; // IN: calling thread's context +} *ap; */ { struct vnode *vp = ap->a_vp; int flags = ap->a_flags; - struct thread *td = ap->a_td; + COMPAT_THREAD_VAR(td, ap->a_td); struct VMBlockNode *nn; struct vnode *lvp; int error; @@ -1139,7 +1147,7 @@ * We prevent it from being recycled by holding the vnode here. */ vholdl(lvp); - error = VOP_LOCK(lvp, flags, td); + error = COMPAT_VOP_LOCK(lvp, flags, td); /* * We might have slept to get the lock and someone might have clean @@ -1161,7 +1169,7 @@ panic("Unsupported lock request %d\n", ap->a_flags); } - VOP_UNLOCK(lvp, 0, td); + COMPAT_VOP_UNLOCK(lvp, 0, td); error = vop_stdlock(ap); } vdrop(lvp); @@ -1205,7 +1213,7 @@ { struct vnode *vp = ap->a_vp; int flags = ap->a_flags; - struct thread *td = ap->a_td; + COMPAT_THREAD_VAR(td, ap->a_td); struct VMBlockNode *nn; struct vnode *lvp; int error; @@ -1220,7 +1228,7 @@ } nn = VPTOVMB(vp); if (nn != NULL && (lvp = VMBVPTOLOWERVP(vp)) != NULL) { - error = VOP_UNLOCK(lvp, flags, td); + error = COMPAT_VOP_UNLOCK(lvp, flags, td); } else { error = vop_stdunlock(ap); } @@ -1255,9 +1263,9 @@ */ { struct vnode *vp = ap->a_vp; - struct thread *td = ap->a_td; + COMPAT_THREAD_VAR(td, ap->a_td); - return lockstatus(vp->v_vnlock, td); + return compat_lockstatus(vp->v_vnlock, td); } @@ -1371,7 +1379,7 @@ * to the lower layer's lock.) */ vp->v_vnlock = &vp->v_lock; - lockmgr(vp->v_vnlock, LK_EXCLUSIVE|LK_INTERLOCK, VI_MTX(vp), curthread); + compat_lockmgr(vp->v_vnlock, LK_EXCLUSIVE|LK_INTERLOCK, VI_MTX(vp), curthread); vput(lowervp); /* diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/backdoor_def.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/backdoor_def.h --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/backdoor_def.h 2008-01-28 08:02:47.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/backdoor_def.h 2008-10-13 08:01:44.000000000 +0100 @@ -79,7 +79,7 @@ #define BDOOR_CMD_GETUUID 19 #define BDOOR_CMD_GETMEMSIZE 20 #define BDOOR_CMD_HOSTCOPY 21 /* Devel only */ -/* BDOOR_CMD_GETOS2INTCURSOR, 22, is very old and defunct. Reuse. */ +#define BDOOR_CMD_SERVICE_VM 22 /* prototype only */ #define BDOOR_CMD_GETTIME 23 /* Deprecated. Use GETTIMEFULL. */ #define BDOOR_CMD_STOPCATCHUP 24 #define BDOOR_CMD_PUTCHR 25 /* Devel only */ @@ -109,7 +109,12 @@ #define BDOOR_CMD_CHECKFORCEBIOSSETUP 48 #define BDOOR_CMD_LAZYTIMEREMULATION 49 #define BDOOR_CMD_BIOSBBS 50 -#define BDOOR_CMD_MAX 51 +#define BDOOR_CMD_VASSERT 51 +#define BDOOR_CMD_ISGOSDARWIN 52 +#define BDOOR_CMD_DEBUGEVENT 53 +#define BDOOR_CMD_OSNOTMACOSXSERVER 54 +#define BDOOR_CMD_GETTIMEFULL_WITH_LAG 55 +#define BDOOR_CMD_MAX 56 /* * IMPORTANT NOTE: When modifying the behavior of an existing backdoor command, @@ -123,7 +128,8 @@ #define BDOORHB_PORT 0x5659 #define BDOORHB_CMD_MESSAGE 0 -#define BDOORHB_CMD_MAX 1 +#define BDOORHB_CMD_VASSERT 1 +#define BDOORHB_CMD_MAX 2 /* * There is another backdoor which allows access to certain TSC-related diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/compat_freebsd.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/compat_freebsd.h --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/compat_freebsd.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/compat_freebsd.h 2008-10-13 08:01:44.000000000 +0100 @@ -0,0 +1,37 @@ +/********************************************************* + * Copyright (C) 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 General Public License as published by the + * Free Software Foundation version 2 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 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 + * + *********************************************************/ + +#ifndef __COMPAT_FREEBSD_H__ +#define __COMPAT_FREEBSD_H__ 1 + +#include <sys/param.h> +#include "compat_vop.h" + +/* + * FreeBSD version 8 and above uses the kproc API instead of the kthread API in its + * kernel. + */ +#if __FreeBSD_version > 800001 +#define compat_kthread_create kproc_create +#define compat_kthread_exit kproc_exit +#else +#define compat_kthread_create kthread_create +#define compat_kthread_exit kthread_exit +#endif + +#endif // __COMPAT_FREEBSD_H__ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/compat_vop.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/compat_vop.h --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/compat_vop.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/compat_vop.h 2008-10-13 08:01:44.000000000 +0100 @@ -0,0 +1,52 @@ +/********************************************************* + * Copyright (C) 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 General Public License as published by the + * Free Software Foundation version 2 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 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 + * + *********************************************************/ + +#ifndef __COMPAT_VOP_H__ +# define __COMPAT_VOP_H__ 1 + +#if __FreeBSD_version >= 800011 +#define COMPAT_THREAD_VAR(varname, varval) +#define COMPAT_VOP_LOCK(vop, flags, threadvar) VOP_LOCK((vop), (flags)) +#define COMPAT_VOP_UNLOCK(vop, flags, threadvar) VOP_UNLOCK((vop), (flags)) +#define compat_lockstatus(lock, threadvar) lockstatus((lock)) +#define compat_lockmgr(lock, flags, randompointerparam, threadval) lockmgr((lock), (flags), (randompointerparam)) +#define compat_vn_lock(vp, flags, threadval) vn_lock((vp), (flags)) +#else +#define COMPAT_THREAD_VAR(varname, varval) struct thread *varname = varval +#define COMPAT_VOP_LOCK(vop, flags, threadvar) VOP_LOCK((vop), (flags), (threadvar)) +#define COMPAT_VOP_UNLOCK(vop, flags, threadvar) VOP_UNLOCK((vop), (flags), (threadvar)) +#define compat_lockstatus(lock, threadvar) lockstatus((lock), (threadvar)) +#define compat_vn_lock(vp, flags, threadval) vn_lock((vp), (flags), (threadval)) +#define compat_lockmgr(lock, flags, randompointerparam, threadval) lockmgr((lock), (flags), (randompointerparam), (threadval)) +#endif + +/* + * We use defines rather than typedefs here to avoid causing problems for files that + * don't have a vnode_if.h available. + */ +#if __FreeBSD_version >= 700000 +# define compat_vop_lock_t vop_lock1_t +# define compat_vop_lock_args struct vop_lock1_args +# define COMPAT_VOP_LOCK_OP_ELEMENT vop_lock1 +#else +# define compat_vop_lock_t vop_lock_t +# define compat_vop_lock_args struct vop_lock_args +# define COMPAT_VOP_LOCK_OP_ELEMENT vop_lock +#endif + +#endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/cpNameLinux.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/cpNameLinux.c --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/cpNameLinux.c 2008-01-28 08:02:47.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/cpNameLinux.c 2008-10-13 08:01:44.000000000 +0100 @@ -24,7 +24,7 @@ * */ -#if defined(sun) && defined(SOL10) +#if defined(sun) && !defined(SOL9) #include <memory.h> #endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/dbllnklst.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/dbllnklst.c --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/dbllnklst.c 2008-01-28 08:02:47.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/dbllnklst.c 2008-10-13 08:01:44.000000000 +0100 @@ -164,7 +164,7 @@ */ Bool -DblLnkLst_IsLinked(DblLnkLst_Links *l) // IN +DblLnkLst_IsLinked(DblLnkLst_Links const *l) // IN { ASSERT(l); diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/dbllnklst.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/dbllnklst.h --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/dbllnklst.h 2008-01-28 08:02:47.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/dbllnklst.h 2008-10-13 08:01:44.000000000 +0100 @@ -58,7 +58,7 @@ void DblLnkLst_Link(DblLnkLst_Links *l1, DblLnkLst_Links *l2); void DblLnkLst_Unlink(DblLnkLst_Links *l1, DblLnkLst_Links *l2); void DblLnkLst_Unlink1(DblLnkLst_Links *l); -Bool DblLnkLst_IsLinked(DblLnkLst_Links *l); +Bool DblLnkLst_IsLinked(DblLnkLst_Links const *l); /* Functions specific to anchored lists. --hpreg */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/debug.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/debug.c --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/debug.c 2008-01-28 08:02:47.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/debug.c 2008-10-13 08:01:43.000000000 +0100 @@ -19,13 +19,13 @@ /* * debug.c -- * - * Routine(s) for debugging the FreeBSD Hgfs module. + * Routine(s) for debugging the FreeBSD / Mac OS Hgfs module. */ +#include "vm_basic_types.h" #include "debug.h" - /* * Global functions */ @@ -36,27 +36,40 @@ * * HgfsDebugPrintVattr -- * - * Prints the contents of an attributes structure. + * Prints the contents of an attributes structure. * * Results: - * None. + * None. * * Side effects: - * None. + * None. * *---------------------------------------------------------------------------- */ void -HgfsDebugPrintVattr(const struct vattr *vap) +HgfsDebugPrintVattr(const HgfsVnodeAttr *vap) { DEBUG(VM_DEBUG_STRUCT, " va_type: %d\n", vap->va_type); DEBUG(VM_DEBUG_STRUCT, " va_mode: %o\n", vap->va_mode); - DEBUG(VM_DEBUG_STRUCT, " va_nlink: %hd\n", vap->va_nlink); DEBUG(VM_DEBUG_STRUCT, " va_uid: %u\n", vap->va_uid); DEBUG(VM_DEBUG_STRUCT, " va_gid: %u\n", vap->va_gid); DEBUG(VM_DEBUG_STRUCT, " va_fsid: %u\n", vap->va_fsid); + DEBUG(VM_DEBUG_STRUCT, " va_rdev: %u\n", vap->va_rdev); + DEBUG(VM_DEBUG_STRUCT, " va_filerev: %"FMT64"u\n", vap->va_filerev); + DEBUG(VM_DEBUG_STRUCT, " va_vaflags: %x\n", vap->va_vaflags); + +#if defined(__FreeBSD__) + /* + * The next group of attributes have the same name but different sizes on + * xnu-1228 and FreeBSD 6.2. + */ + DEBUG(VM_DEBUG_STRUCT, " va_flags: %lx\n", vap->va_flags); + DEBUG(VM_DEBUG_STRUCT, " va_gen: %lu\n", vap->va_gen); DEBUG(VM_DEBUG_STRUCT, " va_fileid: %ld\n", vap->va_fileid); + DEBUG(VM_DEBUG_STRUCT, " va_nlink: %hd\n", vap->va_nlink); + + /* These attributes names changed have between xnu-1228 and FreeBSD 6.2. */ DEBUG(VM_DEBUG_STRUCT, " va_size: %ju\n", vap->va_size); DEBUG(VM_DEBUG_STRUCT, " va_blocksize: %ld\n", vap->va_blocksize); /* @@ -73,10 +86,30 @@ (intmax_t)vap->va_birthtime.tv_sec); DEBUG(VM_DEBUG_STRUCT, " va_birthtime.tv_nsec: %ld\n", vap->va_birthtime.tv_nsec); - DEBUG(VM_DEBUG_STRUCT, " va_gen: %lu\n", vap->va_gen); - DEBUG(VM_DEBUG_STRUCT, " va_flags: %lx\n", vap->va_flags); - DEBUG(VM_DEBUG_STRUCT, " va_rdev: %u\n", vap->va_rdev); DEBUG(VM_DEBUG_STRUCT, " va_bytes: %"FMT64"u\n", vap->va_bytes); - DEBUG(VM_DEBUG_STRUCT, " va_filerev: %"FMT64"u\n", vap->va_filerev); - DEBUG(VM_DEBUG_STRUCT, " va_vaflags: %x\n", vap->va_vaflags); + +#elif defined(__APPLE__) + /* + * The next group of attributes have the same name but different sizes on + * xnu-1228 and FreeBSD 6.2. + */ + DEBUG(VM_DEBUG_STRUCT, " va_flags: %x\n", vap->va_flags); + DEBUG(VM_DEBUG_STRUCT, " va_gen: %u\n", vap->va_gen); + DEBUG(VM_DEBUG_STRUCT, " va_fileid: %"FMT64"u\n", vap->va_fileid); + DEBUG(VM_DEBUG_STRUCT, " va_nlink: %"FMT64"u\n", vap->va_nlink); + + /* These attribute names have changed between xnu-1228 and FreeBSD 6.2. */ + DEBUG(VM_DEBUG_STRUCT, " va_size: %ju\n", vap->va_data_size); + DEBUG(VM_DEBUG_STRUCT, " va_iosize: %u\n", vap->va_iosize); + /* + * XXX time_t is __int32_t on 32-bit architectures and __int64_t on 64-bit + * architectures. Would this be better as add'l formats in vm_basic_types.h? + */ + DEBUG(VM_DEBUG_STRUCT, " va_access_time.tv_sec: %jd\n", (intmax_t)vap->va_access_time.tv_sec); + DEBUG(VM_DEBUG_STRUCT, " va_access_time.tv_nsec: %ld\n", vap->va_access_time.tv_nsec); + DEBUG(VM_DEBUG_STRUCT, " va_modify_time.tv_sec: %jd\n", (intmax_t)vap->va_modify_time.tv_sec); + DEBUG(VM_DEBUG_STRUCT, " va_modify_time.tv_nsec: %ld\n", vap->va_modify_time.tv_nsec); + DEBUG(VM_DEBUG_STRUCT, " va_create_time.tv_sec: %jd\n", (intmax_t)vap->va_create_time.tv_sec); + DEBUG(VM_DEBUG_STRUCT, " va_create_time.tv_nsec: %ld\n", vap->va_create_time.tv_nsec); +#endif } diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/debug.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/debug.h --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/debug.h 2008-01-28 08:02:47.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/debug.h 2008-10-13 08:01:44.000000000 +0100 @@ -26,10 +26,20 @@ #define _DEBUG_H_ #include <sys/param.h> -#include <sys/types.h> // for log(9) -#include <sys/systm.h> // for log(9) -#include <sys/vnode.h> // for struct vattr -#include <sys/syslog.h> // for log(9), LOG_* macros + +#if defined(__FreeBSD__) +# include <sys/types.h> // for log(9) +# include <sys/systm.h> // for log(9) +# include <sys/syslog.h> // for log(9), LOG_* macros +#elif defined(__APPLE__) +# include <kern/debug.h> // for panic +#endif + +#include <sys/vnode.h> // for struct vattr + +#if defined(VMX86_DEVEL) +# include <pexpert/pexpert.h> // for kprintf +#endif #include "hgfs_kernel.h" @@ -64,17 +74,25 @@ #define VM_DEBUG_ALL (~0) #if defined(VMX86_DEVEL) -#define VM_DEBUG_LEV (VM_DEBUG_ALWAYS | VM_DEBUG_FAIL) +# define VM_DEBUG_LEV (VM_DEBUG_ALWAYS | VM_DEBUG_FAIL) #endif #ifdef VM_DEBUG_LEV -#define DEBUG(type, fmt, ...) \ - ((type & VM_DEBUG_LEV) ? \ - (log(LOG_NOTICE, "%s:%u: " fmt, \ - __func__, __LINE__, ##__VA_ARGS__)) \ - : 0) +# if defined(__FreeBSD__) +# define DEBUG(type, fmt, ...) \ + ((type & VM_DEBUG_LEV) ? \ + (log(LOG_NOTICE, "%s:%u: " fmt, \ + __func__, __LINE__, ##__VA_ARGS__)) \ + : 0) +# elif defined(__APPLE__) +# define DEBUG(type, fmt, ...) \ + ((type & VM_DEBUG_LEV) ? \ + (kprintf("%s:%u: " fmt, \ + __func__, __LINE__, ##__VA_ARGS__)) \ + : 0) +# endif #else -#define DEBUG(type, ...) +# define DEBUG(type, ...) #endif @@ -82,6 +100,6 @@ * Global functions */ -void HgfsDebugPrintVattr(const struct vattr *vap); +void HgfsDebugPrintVattr(const HgfsVnodeAttr *vap); #endif // _DEBUG_H_ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/fsutil.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/fsutil.c --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/fsutil.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/fsutil.c 2008-10-13 08:01:44.000000000 +0100 @@ -0,0 +1,1104 @@ +/********************************************************* + * Copyright (C) 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 General Public License as published by the + * Free Software Foundation version 2 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 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 + * + *********************************************************/ + +/* + * fsutil.c -- + * + * VFS helper functions that are shared between the FreeBSD and Mac OS + * implementaitons of HGFS. + */ + +#include <sys/types.h> +#include <sys/malloc.h> + +#if defined(__APPLE__) +# include <libkern/libkern.h> // for rindex +#endif + +#include "fsutil.h" +#include "cpName.h" +#include "staticEscape.h" +#include "os.h" + +#if defined(__APPLE__) +char *rindex(const char *ptr, int chr); +#endif + +/* + * OS X sets vnode attributes through the use of a VATTR_RETURN function. + * FreeBSD sets vnode attributes directly in the structure. To enable a shared + * implementation of HgfsAttrToBSD and HgfsSetattrCopy, we define VATTR_RETURN + * for FreeBSD. + */ +#if defined(__FreeBSD__) +#define VATTR_RETURN(vn, attr, val) \ + do { (vn)-> attr = (val); } while (0) +#endif + +/* Local Function Prototypes */ + +/* + *---------------------------------------------------------------------------- + * + * HgfsSubmitRequest -- + * + * Places a request on the queue for submission by the worker thread, + * then waits for the response. + * + * Both submitting request and waiting for reply are in this function + * because the signaling of the request list's condition variable and + * waiting on the request's condition variable must be atomic. + * + * Results: + * Returns zero on success, and an appropriate error code on error. + * Note: EINTR is returned if cv_wait_sig() is interrupted. + * + * Side effects: + * The request list's condition variable is signaled. + * + *---------------------------------------------------------------------------- + */ + +int +HgfsSubmitRequest(HgfsSuperInfo *sip, // IN: Superinfo containing request list, + // condition variable, and mutex + HgfsKReqHandle req) // IN: Request to submit +{ + int ret = 0; + + ASSERT(sip); + ASSERT(req); + + /* + * The process of submitting the request involves putting it on the request + * list, waking up the backdoor req thread if it is waiting for a request, + * then atomically waiting for the reply. + */ + + /* + * Fail the request if a forcible unmount is in progress. + */ + if (HGFS_MP_IS_FORCEUNMOUNT(sip->vfsp)) { + HgfsKReq_ReleaseRequest(sip->reqs, req); + return EIO; + } + + /* Submit the request & wait for a result. */ + ret = HgfsKReq_SubmitRequest(req); + + if (ret == 0) { + /* The reply should now be in HgfsKReq_GetPayload(req). */ + DEBUG(VM_DEBUG_SIG, "awoken because reply received.\n"); + } else { + /* HgfsKReq_SubmitRequest was interrupted, so we'll abandon now. */ + HgfsKReq_ReleaseRequest(sip->reqs, req); + } + + return ret; +} + + +/* + *---------------------------------------------------------------------------- + * + * HgfsGetStatus -- + * + * Gets the status of the reply packet. If the size of the reply packet + * does not lie between the minimum expected size and maximum allowed packet + * size, then EPROTO is returned. + * + * Results: + * Returns zero on success, and an error code on error. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +int +HgfsGetStatus(HgfsKReqHandle req, // IN: Request that contains reply data + uint32_t minSize) // IN: Minimum size expected for the reply +{ + HgfsReply *replyHeader; + size_t repSize = 0; + int ret = 0; + + ASSERT(req); + ASSERT(minSize <= HGFS_PACKET_MAX); /* we want to know if this fails */ + + switch (HgfsKReq_GetState(req)) { + + case HGFS_REQ_ERROR: + DEBUG(VM_DEBUG_FAIL, "received reply with error.\n"); + ret = EPROTO; + break; + + case HGFS_REQ_COMPLETED: + repSize = HgfsKReq_GetPayloadSize(req); + /* + * Server sets the packet size equal to size of HgfsReply when it + * encounters an error. In order to return correct error code, + * we should first check the status and then check if packet size + * lies between minimum expected size and maximum allowed packet size. + */ + + if (repSize >= sizeof *replyHeader) { + replyHeader = (HgfsReply *)HgfsKReq_GetPayload(req); + ret = HgfsStatusToBSD(replyHeader->status); + if (ret) { + break; + } + } + + if (repSize < minSize || repSize > HGFS_PACKET_MAX) { + DEBUG(VM_DEBUG_FAIL, "successfully " + "completed reply is too small/big: !(%d < %" FMTSZ "d < %d).\n", + minSize, repSize, HGFS_PACKET_MAX); + ret = EPROTO; + } + break; + + /* + * If we get here then there is a programming error in this module: + * HGFS_REQ_UNUSED should be for requests in the free list + * HGFS_REQ_SUBMITTED should be for requests only that are awaiting + * a response + * HGFS_REQ_ABANDONED should have returned an error to the client + */ + default: + NOT_REACHED(); + ret = EPROTO; /* avoid compiler warning */ + } + + return ret; +} + + +/* + * XXX: These were taken directly from hgfs/solaris/vnode.c. Should we + * move them to hgfsUtil.c or similar? (And Solaris took them from the Linux + * implementation.) + */ + + +/* + *----------------------------------------------------------------------------- + * + * HgfsEscapeBuffer -- + * + * Escape any characters that are not legal in a linux filename, + * which is just the character "/". We also of course have to + * escape the escape character, which is "%". + * + * sizeBufOut must account for the NUL terminator. + * + * XXX: See the comments in staticEscape.c and staticEscapeW.c to understand + * why this interface sucks. + * + * Results: + * On success, the size (excluding the NUL terminator) of the + * escaped, NUL terminated buffer. + * On failure (bufOut not big enough to hold result), negative value. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +int +HgfsEscapeBuffer(char const *bufIn, // IN: Buffer with unescaped input + uint32 sizeIn, // IN: Size of input buffer (chars) + uint32 sizeBufOut, // IN: Size of output buffer (bytes) + char *bufOut) // OUT: Buffer for escaped output +{ + /* + * This is just a wrapper around the more general escape + * routine; we pass it the correct bitvector and the + * buffer to escape. [bac] + */ + EscBitVector bytesToEsc; + + ASSERT(bufIn); + ASSERT(bufOut); + + /* Set up the bitvector for "/" and "%" */ + EscBitVector_Init(&bytesToEsc); + EscBitVector_Set(&bytesToEsc, (unsigned char)'%'); + EscBitVector_Set(&bytesToEsc, (unsigned char)'/'); + + return StaticEscape_Do('%', + &bytesToEsc, + bufIn, + sizeIn, + sizeBufOut, + bufOut); +} + + +/* + *----------------------------------------------------------------------------- + * + * HgfsUnescapeBuffer -- + * + * Unescape a buffer that was escaped using HgfsEscapeBuffer. + * + * The unescaping is done in place in the input buffer, and + * can not fail. + * + * Results: + * The size (excluding the NUL terminator) of the unescaped, NUL + * terminated buffer. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +int +HgfsUnescapeBuffer(char *bufIn, // IN: Buffer to be unescaped + uint32 sizeIn) // IN: Size of input buffer +{ + /* + * This is just a wrapper around the more general unescape + * routine; we pass it the correct escape characer and the + * buffer to unescape. [bac] + */ + ASSERT(bufIn); + return StaticEscape_Undo('%', bufIn, sizeIn); +} + +/* + * XXX + * These were taken and slightly modified from hgfs/driver/solaris/vnode.c. + * (Which, in turn, took them from hgfs/driver/linux/driver.c.) Should we + * move them into a hgfs/driver/posix/driver.c? + */ + + +/* + *---------------------------------------------------------------------- + * + * HgfsGetOpenMode -- + * + * Based on the flags requested by the process making the open() + * syscall, determine which open mode (access type) to request from + * the server. + * + * Results: + * Returns the correct HgfsOpenMode enumeration to send to the + * server, or -1 on failure. + * + * Side effects: + * None + * + *---------------------------------------------------------------------- + */ + +int +HgfsGetOpenMode(uint32 flags) // IN: Open flags +{ + /* + * Preprocessor wrapper kept for when this function is factored out + * into a common file. + */ +#if defined(_KERNEL) || defined(KERNEL) + /* + * FreeBSD / OS X use different values from those in the linux kernel. These are defined in + * <sys/fcntl.h>. + */ + #undef O_RDONLY + #undef O_WRONLY + #undef O_RDWR + + #define O_RDONLY FREAD + #define O_WRONLY FWRITE + #define O_RDWR (FREAD | FWRITE) +#endif + + uint32 mask = O_RDONLY | O_WRONLY | O_RDWR; + int result = -1; + + DEBUG(VM_DEBUG_LOG, "entered\n"); + + /* + * Mask the flags to only look at the access type. + */ + flags &= mask; + + /* Pick the correct HgfsOpenMode. */ + switch (flags) { + + case O_RDONLY: + DEBUG(VM_DEBUG_COMM, "O_RDONLY\n"); + result = HGFS_OPEN_MODE_READ_ONLY; + break; + + case O_WRONLY: + DEBUG(VM_DEBUG_COMM, "O_WRONLY\n"); + result = HGFS_OPEN_MODE_WRITE_ONLY; + break; + + case O_RDWR: + DEBUG(VM_DEBUG_COMM, "O_RDWR\n"); + result = HGFS_OPEN_MODE_READ_WRITE; + break; + + default: + /* This should never happen. */ + NOT_REACHED(); + DEBUG(VM_DEBUG_LOG, "invalid open flags %o\n", flags); + result = -1; + break; + } + + return result; +} + + +/* + *---------------------------------------------------------------------- + * + * HgfsGetOpenFlags -- + * + * Based on the flags requested by the process making the open() + * syscall, determine which flags to send to the server to open the + * file. + * + * Results: + * Returns the correct HgfsOpenFlags enumeration to send to the + * server, or -1 on failure. + * + * Side effects: + * None + * + *---------------------------------------------------------------------- + */ + +int +HgfsGetOpenFlags(uint32 flags) // IN: Open flags +{ + uint32 mask = O_CREAT | O_TRUNC | O_EXCL; + int result = -1; + + DEBUG(VM_DEBUG_INFO, "entered\n"); + + /* + * Mask the flags to only look at O_CREAT, O_EXCL, and O_TRUNC. + */ + + flags &= mask; + + /* O_EXCL has no meaning if O_CREAT is not set. */ + if (!(flags & O_CREAT)) { + flags &= ~O_EXCL; + } + + /* Pick the right HgfsOpenFlags. */ + switch (flags) { + + case 0: + /* Regular open; fails if file nonexistant. */ + DEBUG(VM_DEBUG_COMM, "0\n"); + result = HGFS_OPEN; + break; + + case O_CREAT: + /* Create file; if it exists already just open it. */ + DEBUG(VM_DEBUG_COMM, "O_CREAT\n"); + result = HGFS_OPEN_CREATE; + break; + + case O_TRUNC: + /* Truncate existing file; fails if nonexistant. */ + DEBUG(VM_DEBUG_COMM, "O_TRUNC\n"); + result = HGFS_OPEN_EMPTY; + break; + + case (O_CREAT | O_EXCL): + /* Create file; fail if it exists already. */ + DEBUG(VM_DEBUG_COMM, "O_CREAT | O_EXCL\n"); + result = HGFS_OPEN_CREATE_SAFE; + break; + + case (O_CREAT | O_TRUNC): + /* Create file; if it exists already, truncate it. */ + DEBUG(VM_DEBUG_COMM, "O_CREAT | O_TRUNC\n"); + result = HGFS_OPEN_CREATE_EMPTY; + break; + + default: + /* + * This can only happen if all three flags are set, which + * conceptually makes no sense because O_EXCL and O_TRUNC are + * mutually exclusive if O_CREAT is set. + * + * However, the open(2) man page doesn't say you can't set all + * three flags, and certain apps (*cough* Nautilus *cough*) do + * so. To be friendly to those apps, we just silenty drop the + * O_TRUNC flag on the assumption that it's safer to honor + * O_EXCL. + */ + DEBUG(VM_DEBUG_INFO, "invalid open flags %o. " + "Ignoring the O_TRUNC flag.\n", flags); + result = HGFS_OPEN_CREATE_SAFE; + break; + } + + return result; +} + + +/* + *---------------------------------------------------------------------------- + * + * HgfsMakeFullName -- + * + * Concatenates the path and filename to construct the full path. This + * handles the special cases of . and .. filenames so the Hgfs server + * doesn't return an error. + * + * Results: + * Returns the length of the full path on success, and a negative value on + * error. The full pathname is placed in outBuf. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +int +HgfsMakeFullName(const char *path, // IN: Path of directory containing file + uint32_t pathLen, // IN: Length of path + const char *file, // IN: Name of file + size_t fileLen, // IN: Length of filename + char *outBuf, // OUT: Location to write full path + ssize_t bufSize) // IN: Size of the out buffer +{ + uint32 pathSeparatorLen; + ASSERT(path); + ASSERT(file); + ASSERT(outBuf); + + + DEBUG(VM_DEBUG_INFO, "HgfsMakeFullName:\n" + " path: \"%.*s\" (%d)\n" + " file: \"%s\" (%zu)\n", + pathLen, path, pathLen, file, fileLen); + + /* + * Here there are three possibilities: + * o file is ".", in which case we just place path in outBuf + * o file is "..", in which case we strip the last component from path and + * put that in outBuf + * o for all other cases, we concatenate path, a path separator, file, and + * a NUL terminator and place it in outBuf + */ + + /* Make sure that the path and a NUL terminator will fit. */ + if (bufSize < pathLen + 1) { + return HGFS_ERR_INVAL; + } + + + /* + * Copy path for this file into the caller's buffer. + * The memset call is important here because it implicitly null terminates + * outBuf so that rindex can be called in the second case below. + */ + memset(outBuf, 0, bufSize); + memcpy(outBuf, path, pathLen); + + /* Handle three cases. */ + if (fileLen == 1 && strncmp(file, ".", 1) == 0) { + /* NUL terminate and return provided length. */ + outBuf[pathLen] = '\0'; + return pathLen; + + } else if (fileLen == 2 && strncmp(file, "..", 2) == 0) { + /* + * Replace the last path separator with a NUL terminator, then return the + * size of the buffer. + */ + char *newEnd = rindex(outBuf, DIRSEPC); + if (!newEnd) { + /* + * We should never get here since we name the root vnode "/" in + * HgfsMount(). + */ + return HGFS_ERR_INVAL; + } + + *newEnd = '\0'; + return ((uintptr_t)newEnd - (uintptr_t)outBuf); + } else { + if (bufSize < pathLen + 1 + fileLen + 1) { + return HGFS_ERR_INVAL; + } + + /* + * If the path consists of just a single path separator, then + * do not add another path separator. This will ensure that + * we have only single path separator at the beginning of the + * filename. + */ + if (pathLen == 1 && *path == DIRSEPC) { + pathSeparatorLen = 0; + } else { + outBuf[pathLen] = DIRSEPC; + pathSeparatorLen = DIRSEPSLEN; + } + /* Now append the filename and NUL terminator. */ + memcpy(outBuf + pathSeparatorLen + pathLen, file, fileLen); + outBuf[pathLen + pathSeparatorLen + fileLen] = '\0'; + + return pathLen + pathSeparatorLen + fileLen; + } +} + + +/* + *---------------------------------------------------------------------------- + * + * HgfsSetattrCopy -- + * + * Sets the Hgfs attributes that need to be modified based on the provided + * Solaris attribute structure. + * + * Results: + * Returns TRUE if changes need to be made, FALSE otherwise. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +Bool +HgfsSetattrCopy(HgfsVnodeAttr *vap, // IN: Attributes to change to + HgfsAttrV2 *hgfsAttrV2, // OUT: Hgfs attributes to fill in + HgfsAttrHint *hints) // OUT: Hgfs attribute hints +{ + Bool ret = FALSE; + + ASSERT(vap); + ASSERT(hgfsAttrV2); + ASSERT(hints); + + memset(hgfsAttrV2, 0, sizeof *hgfsAttrV2); + memset(hints, 0, sizeof *hints); + + /* + * Hgfs supports changing these attributes: + * o mode bits (permissions) + * o uid/gid + * o size + * o access/write times + */ + + if (HGFS_VATTR_MODE_IS_ACTIVE(vap, HGFS_VA_MODE)){ + DEBUG(VM_DEBUG_COMM, "updating permissions.\n"); + hgfsAttrV2->mask |= HGFS_ATTR_VALID_SPECIAL_PERMS | + HGFS_ATTR_VALID_OWNER_PERMS | + HGFS_ATTR_VALID_GROUP_PERMS | + HGFS_ATTR_VALID_OTHER_PERMS; + hgfsAttrV2->specialPerms = (vap->HGFS_VA_MODE & (S_ISUID | S_ISGID | + S_ISVTX)) >> HGFS_ATTR_SPECIAL_PERM_SHIFT; + hgfsAttrV2->ownerPerms = (vap->HGFS_VA_MODE & S_IRWXU) >> + HGFS_ATTR_OWNER_PERM_SHIFT; + hgfsAttrV2->groupPerms = (vap->HGFS_VA_MODE & S_IRWXG) >> + HGFS_ATTR_GROUP_PERM_SHIFT; + hgfsAttrV2->otherPerms = vap->HGFS_VA_MODE & S_IRWXO; + ret = TRUE; + } + + if (HGFS_VATTR_IS_ACTIVE(vap, HGFS_VA_UID)) { + DEBUG(VM_DEBUG_COMM, "updating user id.\n"); + hgfsAttrV2->mask |= HGFS_ATTR_VALID_USERID; + hgfsAttrV2->userId = vap->HGFS_VA_UID; + ret = TRUE; + } + + if (HGFS_VATTR_IS_ACTIVE(vap, HGFS_VA_GID)) { + DEBUG(VM_DEBUG_COMM, "updating group id.\n"); + hgfsAttrV2->mask |= HGFS_ATTR_VALID_GROUPID; + hgfsAttrV2->groupId = vap->HGFS_VA_GID; + ret = TRUE; + } + + if (HGFS_VATTR_IS_ACTIVE(vap, HGFS_VA_ACCESS_TIME_SEC)) { + DEBUG(VM_DEBUG_COMM, "updating access time.\n"); + *hints |= HGFS_ATTR_HINT_SET_ACCESS_TIME; + hgfsAttrV2->mask |= HGFS_ATTR_VALID_ACCESS_TIME; + hgfsAttrV2->accessTime = HGFS_GET_TIME(vap->HGFS_VA_ACCESS_TIME); + ret = TRUE; + } + + if (HGFS_VATTR_IS_ACTIVE(vap, HGFS_VA_MODIFY_TIME_SEC)) { + DEBUG(VM_DEBUG_COMM, "updating write time.\n"); + *hints |= HGFS_ATTR_HINT_SET_WRITE_TIME; + hgfsAttrV2->mask |= HGFS_ATTR_VALID_WRITE_TIME; + hgfsAttrV2->writeTime = HGFS_GET_TIME(vap->HGFS_VA_MODIFY_TIME); + ret = TRUE; + } + + if (HGFS_VATTR_SIZE_IS_ACTIVE(vap, HGFS_VA_DATA_SIZE)) { + DEBUG(VM_DEBUG_COMM, "updating size.\n"); + hgfsAttrV2->mask |= HGFS_ATTR_VALID_SIZE; + hgfsAttrV2->size = vap->HGFS_VA_DATA_SIZE; + ret = TRUE; + } + + return ret; +} + + +/* + *---------------------------------------------------------------------------- + * + * HgfsAttrToBSD -- + * + * Maps Hgfs attributes to Solaris attributes, filling the provided Solaris + * attribute structure appropriately. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +void +HgfsAttrToBSD(struct vnode *vp, // IN: The vnode for this file + const HgfsAttrV2 *hgfsAttrV2, // IN: Hgfs attributes to copy + HgfsVnodeAttr *vap) // OUT: BSD attributes to fill +{ + short mode = 0; + HgfsSuperInfo *sip = HGFS_VP_TO_SIP(vp); + + ASSERT(vp); + ASSERT(hgfsAttrV2); + ASSERT(vap); + + /* XXX Update this function to support all V2 attributes. */ + + DEBUG(VM_DEBUG_ENTRY, "%p -> %p\n", hgfsAttrV2, vap); + + /* + * Initialize all fields to zero. We don't need to do this for OS X + * because the VATTR_RETURN macros take care of it for us. + */ +#if defined(__FreeBSD__) + VATTR_NULL(vap); +#endif + + if ((hgfsAttrV2->mask & HGFS_ATTR_VALID_TYPE)) { + /* Set the file type. */ + switch (hgfsAttrV2->type) { + case HGFS_FILE_TYPE_REGULAR: + HGFS_VATTR_TYPE_RETURN(vap, VREG); + DEBUG(VM_DEBUG_ATTR, " Type: VREG\n"); + break; + + case HGFS_FILE_TYPE_DIRECTORY: + HGFS_VATTR_TYPE_RETURN(vap, VDIR); + DEBUG(VM_DEBUG_ATTR, " Type: VDIR\n"); + break; + + default: + /* + * There are only the above two filetypes. If there is an error + * elsewhere that provides another value, we set the Solaris type to + * none and ASSERT in devel builds. + */ + HGFS_VATTR_TYPE_RETURN(vap, VNON); + DEBUG(VM_DEBUG_FAIL, "invalid HgfsFileType provided.\n"); + } + } else { + HGFS_VATTR_TYPE_RETURN(vap, VNON); + DEBUG(VM_DEBUG_FAIL, "invalid HgfsFileType provided\n"); + } + + if (hgfsAttrV2->mask & HGFS_ATTR_VALID_SPECIAL_PERMS) { + mode |= hgfsAttrV2->specialPerms << HGFS_ATTR_SPECIAL_PERM_SHIFT; + } + + if (hgfsAttrV2->mask & HGFS_ATTR_VALID_OWNER_PERMS) { + mode |= hgfsAttrV2->ownerPerms << HGFS_ATTR_OWNER_PERM_SHIFT; + } + + if (hgfsAttrV2->mask & HGFS_ATTR_VALID_GROUP_PERMS) { + mode |= hgfsAttrV2->groupPerms << HGFS_ATTR_GROUP_PERM_SHIFT; + } + + if (hgfsAttrV2->mask & HGFS_ATTR_VALID_OWNER_PERMS) { + mode |= hgfsAttrV2->otherPerms; + } + + HGFS_VATTR_MODE_RETURN(vap, mode); + + HGFS_VATTR_NLINK_RETURN(vap, 1); /* fake */ + + if (sip->uidSet || (hgfsAttrV2->mask & HGFS_ATTR_VALID_USERID) == 0) { + HGFS_VATTR_UID_RETURN(vap, sip->uid); + } else { + HGFS_VATTR_UID_RETURN(vap, hgfsAttrV2->userId); + } + + if (sip->gidSet || (hgfsAttrV2->mask & HGFS_ATTR_VALID_GROUPID) == 0) { + HGFS_VATTR_GID_RETURN(vap, sip->gid); + } else { + HGFS_VATTR_GID_RETURN(vap, hgfsAttrV2->groupId); + } + + HGFS_VATTR_FSID_RETURN(vap, HGFS_VP_TO_STATFS(vp)->f_fsid.val[0]); + + /* Get the node id calculated for this file in HgfsVnodeGet() */ + HGFS_VATTR_FILEID_RETURN(vap, HGFS_VP_TO_NODEID(vp)); + + HGFS_VATTR_BLOCKSIZE_RETURN(vap, HGFS_BLOCKSIZE); + + if (hgfsAttrV2->mask & HGFS_ATTR_VALID_SIZE) { + HGFS_VATTR_BYTES_RETURN(vap, hgfsAttrV2->size); + HGFS_VATTR_SIZE_RETURN(vap, hgfsAttrV2->size); + } + + /* + * HGFS_SET_TIME does not mark the attribute as supported (unlike + * VATTR_RETURN on OS X) so we have to do it explicitly with calls to + * VATTR_SET_SUPPORTED. For FreeBSD, HGFS_VATTR_*_SET_SUPPORTED is just a NULL + * macro. + */ + + if (hgfsAttrV2->mask & HGFS_ATTR_VALID_ACCESS_TIME) { + HGFS_SET_TIME(vap->HGFS_VA_ACCESS_TIME, hgfsAttrV2->accessTime); + HGFS_VATTR_ACCESS_TIME_SET_SUPPORTED(vap); + } + + if (hgfsAttrV2->mask & HGFS_ATTR_VALID_WRITE_TIME) { + HGFS_SET_TIME(vap->HGFS_VA_MODIFY_TIME, hgfsAttrV2->writeTime); + HGFS_VATTR_MODIFY_TIME_SET_SUPPORTED(vap); + } + + if (hgfsAttrV2->mask & HGFS_ATTR_VALID_CHANGE_TIME) { + /* Since Windows doesn't keep ctime, we may need to use mtime instead. */ + if (HGFS_SET_TIME(vap->HGFS_VA_CREATE_TIME, hgfsAttrV2->attrChangeTime)) { + if (hgfsAttrV2->mask & HGFS_ATTR_VALID_WRITE_TIME) { + vap->HGFS_VA_CREATE_TIME = vap->HGFS_VA_MODIFY_TIME; + HGFS_VATTR_CREATE_TIME_SET_SUPPORTED(vap); + } + } + } + +#if defined(__FreeBSD__) + /* + * This is only set for FreeBSD as there does not seem to be an analogous + * attribute for OS X. + */ + DEBUG(VM_DEBUG_ATTR, " Setting birthtime\n"); + + if (hgfsAttrV2->mask & HGFS_ATTR_VALID_CREATE_TIME) { + HGFS_SET_TIME(vap->va_birthtime, hgfsAttrV2->creationTime); + } + +#endif + + HgfsDebugPrintVattr(vap); +} + + +/* + *----------------------------------------------------------------------------- + * + * HgfsStatusToBSD -- + * + * Convert a cross-platform HGFS status code to its Linux-kernel specific + * counterpart. + * + * Results: + * Zero if the converted status code represents success, negative error + * otherwise. Unknown status codes are converted to the more generic + * "protocol error" status code to maintain forwards compatibility. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +int +HgfsStatusToBSD(HgfsStatus hgfsStatus) // IN: Hgfs status msg to be converted +{ + switch (hgfsStatus) { + case HGFS_STATUS_SUCCESS: + return 0; + + case HGFS_STATUS_NO_SUCH_FILE_OR_DIR: + case HGFS_STATUS_INVALID_NAME: + return ENOENT; + + case HGFS_STATUS_INVALID_HANDLE: + return EBADF; + + case HGFS_STATUS_OPERATION_NOT_PERMITTED: + return EPERM; + + case HGFS_STATUS_FILE_EXISTS: + return EEXIST; + + case HGFS_STATUS_NOT_DIRECTORY: + return ENOTDIR; + + case HGFS_STATUS_DIR_NOT_EMPTY: + return ENOTEMPTY; + + case HGFS_STATUS_PROTOCOL_ERROR: + return EPROTO; + + case HGFS_STATUS_ACCESS_DENIED: + case HGFS_STATUS_SHARING_VIOLATION: + return EACCES; + + case HGFS_STATUS_NO_SPACE: + return ENOSPC; + + case HGFS_STATUS_OPERATION_NOT_SUPPORTED: + return EOPNOTSUPP; + + case HGFS_STATUS_NAME_TOO_LONG: + return ENAMETOOLONG; + + case HGFS_STATUS_GENERIC_ERROR: + return EIO; + + default: + DEBUG(VM_DEBUG_LOG, "VMware hgfs: %s: unknown " + "error: %u\n", __FUNCTION__, hgfsStatus); + return EIO; + } +} + + +/* + *---------------------------------------------------------------------------- + * + * rindex -- + * + * Search a character string for the last instance of chr. This is only + * implemented for OS X because it is not exported by the OS X kernel. + * + * Results: + * Pointer to the last instance of chr in the string. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +#if defined(__APPLE__) +char * +rindex(const char *ptr, // IN: String to search. + int chr) // IN: Char to look for. +{ + char *result = NULL; + + ASSERT(ptr); + + for (; *ptr != '\0'; ptr++) { + if (*ptr == chr) { + result = (char *)ptr; + } + } + + return result; +} +#endif + + +/* + *---------------------------------------------------------------------------- + * + * HgfsAttemptToCreateShare -- + * + * Checks if an attempt to create a new share is made. + * + * Results: + * Returns FALSE if not such attempt is made, TRUE otherwise. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +Bool +HgfsAttemptToCreateShare(const char *path, // IN: Path + int flag) // IN: flag +{ + int ret = FALSE; + ASSERT(path); + + /* + * If the first character is the path seperator and + * and there are no more path seperators present in the + * path, then with the create flag (O_CREAT) set, we believe + * that user has attempted to create new a share. This operation + * is not permitted and hence EPERM error code is returned. + */ + if ((flag & O_CREAT) && path[0] == DIRSEPC && + strchr(path + DIRSEPSLEN, DIRSEPC) == NULL) { + ret = TRUE; + } + return ret; +} + + +/* + *---------------------------------------------------------------------------- + * + * HgfsNameToWireEncoding -- + * 1) Input string is converted into precomposed form. + * 2) Precomposed string is then converted to cross platform string. + * 3) Cross platform string is finally unescaped. + * + * Results: + * Returns the size (excluding the NULL terminator) on success and + * negative error code on failure. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +int +HgfsNameToWireEncoding(const char *bufIn, // IN: Buffer to be normalized + uint32 bufInSize, // IN: Size of input buffer + char *bufOut, // OUT: Normalized string will be stored here + uint32 bufOutSize) // IN: Size of output buffer +{ + char *precomposedBuf = NULL; // allocated from M_TEMP; free when done. + const char *utf8Buf; + int ret = 0; + + if (os_utf8_conversion_needed()) { + /* Allocating precomposed buffer to be equal to Output buffer. */ + precomposedBuf = os_malloc(bufOutSize, M_WAITOK); + if (!precomposedBuf) { + return -ENOMEM; + } + + ret = os_path_to_utf8_precomposed(bufIn, bufInSize, precomposedBuf, bufOutSize); + if (ret < 0) { + DEBUG(VM_DEBUG_FAIL, "os_path_to_utf8_precomposed failed."); + ret = -EINVAL; + goto out; + } + utf8Buf = precomposedBuf; + } else { + utf8Buf = bufIn; + } + + ret = CPName_ConvertTo(utf8Buf, bufOutSize, bufOut); + if (ret < 0) { + DEBUG(VM_DEBUG_FAIL, + "CPName_ConvertTo: Conversion to cross platform name failed.\n"); + ret = -ENAMETOOLONG; + goto out; + } + + ret = HgfsUnescapeBuffer(bufOut, ret); // Cannot fail +out: + if (precomposedBuf != NULL) { + os_free(precomposedBuf, bufOutSize); + } + return ret; +} + + +/* + *---------------------------------------------------------------------------- + * + * HgfsNameFromWireEncoding -- + * 1) Input string is converted into decomposed form. + * 2) Decomposed string is finally escaped. + * + * Results: + * Returns the size (excluding the NULL terminator) on success and + * negative error code on failure. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +int +HgfsNameFromWireEncoding(const char *bufIn, // IN: Buffer to be encoded + uint32 bufInSize, // IN: Size of input buffer + char *bufOut, // OUT: Encoded buffer will be stored here + uint32 bufOutSize) // IN: Size of output buffer +{ + char *decomposedBuf = NULL; //Allocated from M_TEMP; free when done + const char *utf8Buf; + size_t lenOut; + int ret = 0; + + if (os_utf8_conversion_needed()) { + /* + * The decomposed form a string can be a lot bigger than the input + * buffer size. We allocate a buffer equal to the output buffer. + */ + decomposedBuf = os_malloc(bufOutSize, M_WAITOK); + if (!decomposedBuf) { + return -ENOMEM; + } + /* + * Convert the input buffer into decomposed form. Higher layers in + * MacOS X expects the name to be in decomposed form. + */ + ret = os_component_to_utf8_decomposed(bufIn, bufInSize, decomposedBuf, + &lenOut, bufOutSize); + /* + * If the decomposed name didn't fit in the buffer or it contained + * illegal utf8 characters, return back to the caller. + */ + if (ret < 0){ + DEBUG(VM_DEBUG_FAIL, "os_component_to_utf8_decomposed failed.\n"); + ret = -EINVAL; + goto out; + } + utf8Buf = decomposedBuf; + } else { + utf8Buf = bufIn; + } + + /* Escape any illegal characters */ + ret = HgfsEscapeBuffer(utf8Buf, strlen(utf8Buf), bufOutSize, bufOut); +out: + if (decomposedBuf != NULL) { + os_free(decomposedBuf, bufOutSize); + } + return ret; +} diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/fsutil.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/fsutil.h --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/fsutil.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/fsutil.h 2008-10-13 08:01:44.000000000 +0100 @@ -0,0 +1,189 @@ +/********************************************************* + * Copyright (C) 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 General Public License as published by the + * Free Software Foundation version 2 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 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 + * + *********************************************************/ + +/* + * fsutil.h -- + * + * VFS helper functions that are shared between the FreeBSD and Mac OS + * implementations of HGFS. + */ + +#ifndef _HGFS_FSUTIL_H_ +#define _HGFS_FSUTIL_H_ + +#include <sys/param.h> // for everything +#include <sys/vnode.h> // for struct vnode +#include <sys/mount.h> // for struct mount +#include <sys/namei.h> // for name lookup goodness +#include <sys/fcntl.h> // for in-kernel file access flags (FREAD, etc) +#include <sys/stat.h> // for file flag bitmasks (S_IRWXU, etc) +#include <sys/uio.h> // for uiomove + +#include "debug.h" +#include "hgfsUtil.h" +#include "hgfs_kernel.h" +#include "request.h" + +/* + * Macros + */ + +/* Sets the values of request headers properly */ +#define HGFS_INIT_REQUEST_HDR(header, req, _op) \ + do { \ + header->id = HgfsKReq_GetId(req); \ + header->op = _op; \ + } while(0) + +/* Determine if this is the root vnode. */ +#define HGFS_IS_ROOT_VNODE(sip, vp) \ + (sip->rootVnode == vp) + +#define DIRSEPC '/' +#define DIRSEPS "/" +#define DIRSEPSLEN 1 + +#define HGFS_VA_MODE va_mode +#define HGFS_VA_UID va_uid +#define HGFS_VA_GID va_gid +#define HGFS_VA_TYPE va_type +#define HGFS_VA_NLINK va_nlink +#define HGFS_VA_FSID va_fsid +#define HGFS_VA_FILEID va_fileid + +#define HGFS_VATTR_TYPE_RETURN(vap, val) \ + VATTR_RETURN(vap, va_type, val) + +#define HGFS_VATTR_MODE_RETURN(vap, val) \ + VATTR_RETURN(vap, va_mode, val) + +#define HGFS_VATTR_NLINK_RETURN(vap, val) \ + VATTR_RETURN(vap, va_nlink, val) + +#define HGFS_VATTR_UID_RETURN(vap, val) \ + VATTR_RETURN(vap, va_uid, val) + +#define HGFS_VATTR_GID_RETURN(vap, val) \ + VATTR_RETURN(vap, va_gid, val) + +#define HGFS_VATTR_FSID_RETURN(vap, val) \ + VATTR_RETURN(vap, va_fsid, val) + +#define HGFS_VATTR_FILEID_RETURN(vap, val) \ + VATTR_RETURN(vap, va_fileid, val) + +#if defined(__APPLE__) + #define HGFS_VA_DATA_SIZE va_data_size + #define HGFS_VA_DATA_BYTES va_data_size + #define HGFS_VA_ACCESS_TIME_SEC va_access_time + #define HGFS_VA_ACCESS_TIME va_access_time + #define HGFS_VA_MODIFY_TIME_SEC va_modify_time + #define HGFS_VA_MODIFY_TIME va_modify_time + #define HGFS_VA_CREATE_TIME_SEC va_create_time + #define HGFS_VA_CREATE_TIME va_create_time + #define HGFS_VA_BLOCK_SIZE va_iosize + #define HGFS_VATTR_IS_ACTIVE(vap, attr) \ + VATTR_IS_ACTIVE(vap, attr) + #define HGFS_VATTR_MODE_IS_ACTIVE(vap, mode) \ + VATTR_IS_ACTIVE(vap, mode) + #define HGFS_VATTR_SIZE_IS_ACTIVE(vap, size) \ + VATTR_IS_ACTIVE(vap, size) + #define HGFS_VATTR_BLOCKSIZE_RETURN(vap, val) \ + VATTR_RETURN(vap, va_iosize, val) + #define HGFS_VATTR_BYTES_RETURN(vap, val) + #define HGFS_VATTR_SIZE_RETURN(vap, val) \ + VATTR_RETURN(vap, va_data_size, val) + #define HGFS_VATTR_ACCESS_TIME_SET_SUPPORTED(vap) \ + VATTR_SET_SUPPORTED(vap, va_access_time) + #define HGFS_VATTR_MODIFY_TIME_SET_SUPPORTED(vap) \ + VATTR_SET_SUPPORTED(vap, va_modify_time) + #define HGFS_VATTR_CREATE_TIME_SET_SUPPORTED(vap) \ + VATTR_SET_SUPPORTED(vap, va_create_time) + +#elif defined(__FreeBSD__) + #define HGFS_VA_DATA_SIZE va_size + #define HGFS_VA_DATA_BYTES va_bytes + #define HGFS_VA_ACCESS_TIME_SEC va_atime.tv_sec + #define HGFS_VA_ACCESS_TIME va_atime + #define HGFS_VA_MODIFY_TIME_SEC va_mtime.tv_sec + #define HGFS_VA_MODIFY_TIME va_mtime + #define HGFS_VA_CREATE_TIME_SEC va_ctime.tv_sec + #define HGFS_VA_CREATE_TIME va_ctime + #define HGFS_VA_BLOCK_SIZE va_blocksize + #define HGFS_VATTR_IS_ACTIVE(vap, attr) \ + (vap->attr != VNOVAL) + #define HGFS_VATTR_MODE_IS_ACTIVE(vap, mode) \ + (vap->mode != (mode_t)VNOVAL) + #define HGFS_VATTR_SIZE_IS_ACTIVE(vap, size) \ + (vap->size != (u_quad_t)VNOVAL) + #define VATTR_SET_SUPPORTED(vap, time) + #define HGFS_VATTR_BLOCKSIZE_RETURN(vap, val) \ + VATTR_RETURN(vap, va_blocksize, val) + #define HGFS_VATTR_BYTES_RETURN(vap, val) \ + VATTR_RETURN(vap, va_bytes, val) + #define HGFS_VATTR_SIZE_RETURN(vap, val) \ + VATTR_RETURN(vap, va_size, val) + + /* NULL macros */ + #define HGFS_VATTR_ACCESS_TIME_SET_SUPPORTED(vap) + #define HGFS_VATTR_MODIFY_TIME_SET_SUPPORTED(vap) + #define HGFS_VATTR_CREATE_TIME_SET_SUPPORTED(vap) +#endif + +/* + * Types + */ + +/* + * Hgfs permissions are similar to Unix permissions in that they both include + * bits for read vs. write vs. execute permissions. Since permissions of + * owner, groups and others are passed as individual components by Hgfs, + * we need simple bit shift operations for translation between Hgfs and Unix + * permissions. + */ + +#define HGFS_ATTR_SPECIAL_PERM_SHIFT 9 +#define HGFS_ATTR_OWNER_PERM_SHIFT 6 +#define HGFS_ATTR_GROUP_PERM_SHIFT 3 + +/* Solaris times support nsecs, so only use these functions directly */ +#define HGFS_SET_TIME(unixtm, nttime) \ + HgfsConvertFromNtTimeNsec(&unixtm, nttime) +#define HGFS_GET_TIME(unixtm) \ + HgfsConvertTimeSpecToNtTime(&unixtm) + +/* Utility functions */ + +int HgfsSubmitRequest(HgfsSuperInfo *sip, HgfsKReqHandle req); +int HgfsGetStatus(HgfsKReqHandle req, uint32_t minSize); +int HgfsEscapeBuffer(char const *bufIn, uint32 sizeIn, + uint32 sizeBufOut, char *bufOut); +int HgfsUnescapeBuffer(char *bufIn, uint32 sizeIn); +int HgfsGetOpenMode(uint32 flags); +int HgfsGetOpenFlags(uint32 flags); +int HgfsMakeFullName(const char *path, uint32_t pathLen, const char *file, + size_t fileLen, char *outBuf, ssize_t bufSize); +void HgfsAttrToBSD(struct vnode *vp, const HgfsAttrV2 *hgfsAttrV2, HgfsVnodeAttr *vap); +Bool HgfsSetattrCopy(HgfsVnodeAttr *vap, HgfsAttrV2 *hgfsAttrV2, HgfsAttrHint *hints); +int HgfsStatusToBSD(HgfsStatus hgfsStatus); +Bool HgfsAttemptToCreateShare(const char *path, int flag); +int HgfsNameFromWireEncoding(const char *bufIn, uint32 bufInSize, char *bufOut, uint32 bufOutSize); +int HgfsNameToWireEncoding(const char *bufIn, uint32 bufInSize, char *bufOut, uint32 bufOutSize); + + +#endif // _HGFS_FSUTIL_H_ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/guest_msg_def.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/guest_msg_def.h --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/guest_msg_def.h 2008-01-28 08:02:47.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/guest_msg_def.h 2008-10-13 08:01:44.000000000 +0100 @@ -83,5 +83,10 @@ #define GUESTMSG_FLAG_COOKIE 0x80000000 #define GUESTMSG_FLAG_ALL GUESTMSG_FLAG_COOKIE +/* + * Maximum size of incoming message. This is to prevent denial of host service + * attacks from guest applications. + */ +#define GUESTMSG_MAX_IN_SIZE (64 * 1024) #endif /* _GUEST_MSG_DEF_H_ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/hgfsBd.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/hgfsBd.c --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/hgfsBd.c 2008-01-28 08:02:47.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/hgfsBd.c 2008-10-13 08:01:44.000000000 +0100 @@ -42,9 +42,11 @@ /* *----------------------------------------------------------------------------- * - * HgfsBd_GetBuf -- + * HgfsBdGetBufInt -- * - * Get a buffer to send hgfs requests in. + * Allocates a buffer to send a hgfs request in. This can be either a + * HGFS_PACKET_MAX or HGFS_LARGE_PACKET_MAX size buffer depending on the + * external funciton called. * * Results: * Pointer to a buffer that has the correct backdoor command prefix for @@ -52,20 +54,20 @@ * NULL on failure (not enough memory). * * Side effects: - * None + * None. * *----------------------------------------------------------------------------- */ -char * -HgfsBd_GetBuf(void) +static char * +HgfsBdGetBufInt(size_t bufSize) { /* * Allocate a buffer that is large enough for an HGFS packet and the * synchronous HGFS command, write the command, and return a pointer that * points into the buffer, after the command. */ - size_t len = HGFS_PACKET_MAX + HGFS_SYNC_REQREP_CLIENT_CMD_LEN; + size_t len = bufSize + HGFS_SYNC_REQREP_CLIENT_CMD_LEN; char *buf = (char*) calloc(sizeof(char), len); if (!buf) { @@ -82,6 +84,51 @@ /* *----------------------------------------------------------------------------- * + * HgfsBd_GetBuf -- + * + * Get a buffer of size HGFS_PACKET_MAX to send hgfs requests in. + * + * Results: + * See HgfsBdGetBufInt. + * + * Side effects: + * Allocates memory that must be freed with a call to HgfsBd_PutBuf. + * + *----------------------------------------------------------------------------- + */ + +char * +HgfsBd_GetBuf(void) +{ + return HgfsBdGetBufInt(HGFS_PACKET_MAX); +} + +/* + *----------------------------------------------------------------------------- + * + * HgfsBd_GetLargeBuf -- + * + * Get a buffer of size HGFS_LARGE_PACKET_MAX to send hgfs requests in. + * + * Results: + * See HgfsBdGetBufInt. + * + * Side effects: + * Allocates memory that must be freed with a call to HgfsBd_PutBuf. + * + *----------------------------------------------------------------------------- + */ + +char * +HgfsBd_GetLargeBuf(void) +{ + return HgfsBdGetBufInt(HGFS_LARGE_PACKET_MAX); +} + + +/* + *----------------------------------------------------------------------------- + * * HgfsBd_PutBuf -- * * Release a buffer obtained with HgfsBd_GetBuf. @@ -215,7 +262,7 @@ return -1; } - ASSERT(replyLen <= HGFS_PACKET_MAX); + ASSERT(replyLen <= HGFS_LARGE_PACKET_MAX); *packetOut = reply; *packetSize = replyLen; diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/hgfsBd.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/hgfsBd.h --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/hgfsBd.h 2008-01-28 08:02:47.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/hgfsBd.h 2008-10-13 08:01:44.000000000 +0100 @@ -29,6 +29,8 @@ char *HgfsBd_GetBuf(void); +char *HgfsBd_GetLargeBuf(void); + void HgfsBd_PutBuf(char *); RpcOut *HgfsBd_GetChannel(void); diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/hgfsDevLinux.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/hgfsDevLinux.h --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/hgfsDevLinux.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/hgfsDevLinux.h 2008-10-13 08:01:44.000000000 +0100 @@ -0,0 +1,63 @@ +/********************************************************* + * Copyright (C) 1998 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * 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_DEVICE_NAME "dev" // Name of our device under /proc/fs/HGFS_NAME/ +#define HGFS_SUPER_MAGIC 0xbacbacbc // Superblock magic number +#define HGFS_PROTOCOL_VERSION 1 // Incremented when something changes +#define HGFS_DEFAULT_TTL 1 // Default TTL for dentries + +/* + * 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 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 + const char *shareNameHost; // must be ".host" + const char *shareNameDir; // desired share name for mounting +#endif +} HgfsMountInfo; + +#endif //ifndef _HGFS_DEV_H_ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/hgfs.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/hgfs.h --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/hgfs.h 2008-01-28 08:02:47.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/hgfs.h 2008-10-13 08:01:44.000000000 +0100 @@ -39,6 +39,11 @@ #include "includeCheck.h" #include "vm_assert.h" +/* + * Maximum number of pages to transfer to/from the HGFS server for V3 protocol + * operations that support large requests/replies, e.g. reads and writes. + */ +#define HGFS_LARGE_IO_MAX_PAGES 15 /* * Maximum allowed packet size in bytes. All hgfs code should be made @@ -46,6 +51,19 @@ */ #define HGFS_PACKET_MAX 6144 +/* + * The HGFS_LARGE_PACKET_MAX size is used to allow guests to make + * read / write requests of sizes larger than HGFS_PACKET_MAX. The larger size + * can only be used with server operations that are specified to be large packet + * capable in hgfsProto.h. + */ +#define HGFS_LARGE_PACKET_MAX ((4096 * HGFS_LARGE_IO_MAX_PAGES) + 2048) + +/* Maximum number of bytes to read or write to a hgfs server in a single packet. */ +#define HGFS_IO_MAX 4096 + +/* Maximum number of bytes to read or write to a V3 server in a single hgfs packet. */ +#define HGFS_LARGE_IO_MAX (HGFS_LARGE_IO_MAX_PAGES * 4096) /* * Open mode @@ -113,8 +131,8 @@ * error codes travelled from hgfsProto.h to hgfs.h in that same change. Worse, * we GA'ed a product (Server 1.0) this way. * - * XXX: I've reversed the order because otherwise new HGFS clients working - * against WS55-era HGFS servers will think they got HGFS_STATUS_GENERIC_ERROR + * XXX: I've reversed the order because otherwise new HGFS clients working + * against WS55-era HGFS servers will think they got HGFS_STATUS_GENERIC_ERROR * when the server sent them HGFS_STATUS_INVALID_NAME. This was a problem * the Linux client converts HGFS_STATUS_GENERIC_ERROR to -EIO, which causes * HgfsLookup to fail unexpectedly (normally HGFS_STATUS_INVALID_NAME is @@ -136,6 +154,7 @@ HGFS_STATUS_NO_SPACE, HGFS_STATUS_OPERATION_NOT_SUPPORTED, HGFS_STATUS_NAME_TOO_LONG, + HGFS_STATUS_INVALID_PARAMETER, } HgfsStatus; /* @@ -150,9 +169,9 @@ * the command and the space into some buffer that is then sent over the * backdoor. * - * In Host --> Guest RPC traffic, the host endpoint is TCLO and the guest - * endpoint is RpcIn. TCLO is a particularly confusing name choice which dates - * back to when the host was to send raw TCL code to the guest (TCL Out == + * In Host --> Guest RPC traffic, the host endpoint is TCLO and the guest + * endpoint is RpcIn. TCLO is a particularly confusing name choice which dates + * back to when the host was to send raw TCL code to the guest (TCL Out == * TCLO). * * In Guest --> Host RPC traffic, the guest endpoint is RpcOut and the host @@ -161,11 +180,11 @@ /* * When an RPCI listener registers for this command, HGFS requests are expected - * to be synchronously sent from the guest and replies are expected to be + * to be synchronously sent from the guest and replies are expected to be * synchronously returned. - * - * When an RpcIn listener registers for this command, requests are expected to - * be asynchronously sent from the host and synchronously returned from the + * + * When an RpcIn listener registers for this command, requests are expected to + * be asynchronously sent from the host and synchronously returned from the * guest. * * In short, an endpoint sending this command is sending a request whose reply @@ -176,41 +195,6 @@ #define HGFS_SYNC_REQREP_CLIENT_CMD_LEN (sizeof HGFS_SYNC_REQREP_CLIENT_CMD - 1) /* - * When an RPCI listener registers for this command, HGFS requests are expected - * to be synchronously sent from the guest and replies are expected to be - * asynchronously returned. - * - * When an RpcIn listener registers for this command, requests are expected to - * be asynchronously sent from the host and asynchronously returned from the - * guest. - * - * In short, an endpoint sending this command is sending a request whose reply - * should be returned asynchronously. - */ -#define HGFS_ASYNC_REQUEST_CMD "g" -#define HGFS_ASYNC_REQUEST_CLIENT_CMD HGFS_ASYNC_REQUEST_CMD " " -#define HGFS_ASYNC_REQUEST_CLIENT_CMD_LEN (sizeof HGFS_ASYNC_REQUEST_CLIENT_CMD - 1) - -/* - * An endpoint sending this command is sending an asynchronous HGFS reply to a - * request sent by the HGFS_ASYNC_REQUEST command. - */ -#define HGFS_ASYNC_REPLY_CMD "h" -#define HGFS_ASYNC_REPLY_CLIENT_CMD HGFS_ASYNC_REPLY_CMD " " -#define HGFS_ASYNC_REPLY_CLIENT_CMD_LEN (sizeof HGFS_ASYNC_REPLY_CLIENT_CMD - 1) - -/* - * Ensuring that all commands are the same length eases the implementation of - * HGFS client code. - */ -MY_ASSERTS(HGFS_CMD_LENGTHS, - ASSERT_ON_COMPILE(HGFS_SYNC_REQREP_CLIENT_CMD_LEN == - HGFS_ASYNC_REQUEST_CLIENT_CMD_LEN); - ASSERT_ON_COMPILE(HGFS_ASYNC_REQUEST_CLIENT_CMD_LEN == - HGFS_ASYNC_REPLY_CLIENT_CMD_LEN); -) - -/* * This is just for the sake of macro naming. Since we are guaranteed * equal command lengths, defining command length via a generalized macro name * will prevent confusion. diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/hgfs_kernel.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/hgfs_kernel.h --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/hgfs_kernel.h 2008-01-28 08:02:47.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/hgfs_kernel.h 2008-10-13 08:01:44.000000000 +0100 @@ -32,32 +32,23 @@ #define INCLUDE_ALLOW_MODULE #include "includeCheck.h" - /* * System includes */ #include <sys/param.h> // for <everything> #include <sys/vnode.h> // for struct vnode -#include <sys/lock.h> // for struct mtx -#include <sys/mutex.h> // for struct mtx -#include <sys/proc.h> // for struct cv -#include <sys/condvar.h> // for struct cv -#include <sys/malloc.h> // for MALLOC_* -#include <sys/queue.h> // for uma_zone_t -#include <vm/uma.h> // for uma_zone_t - /* * VMware includes */ #include "dbllnklst.h" -#include "hgfs.h" -#include "hgfsProto.h" #include "request.h" #include "state.h" +#include "hgfs.h" +#include "hgfsProto.h" #include "vm_basic_types.h" #include "vm_assert.h" @@ -67,7 +58,7 @@ * Macros */ -#define HGFS_PAYLOAD_MAX(reply) (HGFS_PACKET_MAX - sizeof *reply) +#define HGFS_PAYLOAD_MAX(size) (HGFS_PACKET_MAX - size) #define HGFS_FS_NAME "vmhgfs" #define HGFS_FS_NAME_LONG "VMware Hgfs client" /* @@ -76,23 +67,63 @@ */ #define HGFS_BLOCKSIZE 1024 -/* Maximum amount of data that can be transferred in any one request */ -#define HGFS_IO_MAX 4096 - /* Internal error code(s) */ #define HGFS_ERR (-1) #define HGFS_ERR_NULL_INPUT (-50) #define HGFS_ERR_NODEV (-51) #define HGFS_ERR_INVAL (-52) -/* Getting to sip via any vnode */ -#define HGFS_VP_TO_SIP(vp) ((HgfsSuperInfo*)(vp)->v_mount->mnt_data) +#if defined(__FreeBSD__) +# define HGFS_MP_TO_MNTFLAGS(mp) \ + ((mp)->mnt_flag) +# define HGFS_MP_SET_SIP(mp, sip) \ + ((mp)->mnt_data = (sip)) +# define HGFS_VP_TO_MP(vp) ((vp)->v_mount) +/* Return a pointer to mnt_stat to preserve the interface between OS X and FreeBSD. */ +# define HGFS_MP_TO_STATFS(mp) (&(mp)->mnt_stat) + /* Getting to sip via any vnode */ +# define HGFS_VP_TO_SIP(vp) \ + ((HgfsSuperInfo*)HGFS_VP_TO_MP(vp)->mnt_data) + +# define HGFS_VP_VI_LOCK(vp) \ + (VI_LOCK(vp)) +# define HGFS_VP_VI_UNLOCK(vp) \ + (VI_UNLOCK(vp)) +# define HGFS_VP_ISINUSE(vp, usecount) \ + ((vp)->v_usecount > usecount) +# define HGFS_MP_IS_FORCEUNMOUNT(mp) \ + (mp->mnt_kern_flag & MNTK_UNMOUNTF) +#elif defined(__APPLE__) +# define HGFS_MP_TO_MNTFLAGS(mp) \ + (vfs_flags(mp)) +# define HGFS_MP_SET_SIP(mp, sip) \ + (vfs_setfsprivate(mp, sip)) +# define HGFS_VP_TO_MP(vp) (vnode_mount(vp)) +# define HGFS_MP_TO_STATFS(mp) (vfs_statfs(mp)) +# define HGFS_VP_TO_SIP(vp) \ + ((HgfsSuperInfo*)vfs_fsprivate(HGFS_VP_TO_MP(vp))) + +/* + * No concept of vnode locks are exposed to the OS X VFS layer, so do nothing here for + * VI_LOCK AND VI_UNLOCK. However, make sure to call the lock functions before using + * HGFS_VP_ISINUSE to preserve compatability with FreeBSD. + */ +# define HGFS_VP_VI_LOCK(vp) +# define HGFS_VP_VI_UNLOCK(vp) +# define HGFS_VP_ISINUSE(vp, usecount) \ + (vnode_isinuse(vp, usecount)) +# define HGFS_MP_IS_FORCEUNMOUNT(mp) \ + (vfs_isforce(mp)) +#endif +#define HGFS_VP_TO_STATFS(vp) (HGFS_MP_TO_STATFS(HGFS_VP_TO_MP(vp))) /* * Types */ + + /* We call them *Header in the kernel code for clarity. */ typedef HgfsReply HgfsReplyHeader; typedef HgfsRequest HgfsRequestHeader; @@ -102,6 +133,10 @@ * in HgfsVfsMount() and destroyed in HgfsVfsUnmount(). */ typedef struct HgfsSuperInfo { + Bool uidSet; + uid_t uid; + Bool gidSet; + gid_t gid; /* Request container */ HgfsKReqContainerHandle reqs; /* See request.h. */ /* For filesystem */ @@ -115,10 +150,25 @@ * Global variables */ -/* Defined in vfsops.c. */ -MALLOC_DECLARE(M_HGFS); - -/* Defined in vnops.c. */ -extern struct vop_vector HgfsVnodeOps; +/* + * The vnode attributes between OS X and FreeBSD are very similar but not exactly the + * same. Fields have names have changed. However, only HgfsAttrToBSD and + * HgfsSetattrCopy care about the differences so we mash the types together to enable + * single function signatures. + */ +#if defined(__FreeBSD__) + typedef struct vattr HgfsVnodeAttr; +#elif defined(__APPLE__) + typedef struct vnode_attr HgfsVnodeAttr; +#endif + +#if defined(__FreeBSD__) + /* Defined in vnops.c. */ + extern struct vop_vector HgfsVnodeOps; +#elif defined(__APPLE__) + /* Export vnops.c file operations. */ + extern errno_t (**HgfsVnodeOps)(void *); + extern struct vnodeopv_desc *HgfsVnodeOperationVectorDescList[1]; +#endif #endif // ifndef _HGFSKERNEL_H_ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/hgfsProto.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/hgfsProto.h --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/hgfsProto.h 2008-01-28 08:02:47.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/hgfsProto.h 2008-10-13 08:01:44.000000000 +0100 @@ -66,12 +66,12 @@ HGFS_OP_DELETE_DIR, /* Delete a directory */ HGFS_OP_RENAME, /* Rename a file or directory */ HGFS_OP_QUERY_VOLUME_INFO, /* Query volume information */ - + /* * The following operations are only available in version 2 of the hgfs - * protocol. The corresponding version 1 opcodes above are deprecated. + * protocol. The corresponding version 1 opcodes above are deprecated. */ - + HGFS_OP_OPEN_V2, /* Open file */ HGFS_OP_GETATTR_V2, /* Get file attributes */ HGFS_OP_SETATTR_V2, /* Set file attributes */ @@ -79,14 +79,48 @@ HGFS_OP_CREATE_SYMLINK, /* Create a symlink */ HGFS_OP_SERVER_LOCK_CHANGE, /* Change the oplock on a file */ HGFS_OP_CREATE_DIR_V2, /* Create a directory */ - HGFS_OP_DELETE_FILE_V2, /* Delete a file */ - HGFS_OP_DELETE_DIR_V2, /* Delete a directory */ - HGFS_OP_RENAME_V2, /* Rename a file or directory */ - - HGFS_OP_MAX, /* Dummy op, must be last in enum */ + HGFS_OP_DELETE_FILE_V2, /* Delete a file */ + HGFS_OP_DELETE_DIR_V2, /* Delete a directory */ + HGFS_OP_RENAME_V2, /* Rename a file or directory */ + + /* + * Operations for version 3, deprecating version 2 operations. + */ + + HGFS_OP_OPEN_V3, /* Open file */ + HGFS_OP_READ_V3, /* Read from file */ + HGFS_OP_WRITE_V3, /* Write to file */ + HGFS_OP_CLOSE_V3, /* Close file */ + HGFS_OP_SEARCH_OPEN_V3, /* Start new search */ + HGFS_OP_SEARCH_READ_V3, /* Start new search */ + HGFS_OP_SEARCH_CLOSE_V3, /* End a search */ + HGFS_OP_GETATTR_V3, /* Get file attributes */ + HGFS_OP_SETATTR_V3, /* Set file attributes */ + HGFS_OP_CREATE_DIR_V3, /* Create new directory */ + HGFS_OP_DELETE_FILE_V3, /* Delete a file */ + HGFS_OP_DELETE_DIR_V3, /* Delete a directory */ + HGFS_OP_RENAME_V3, /* Rename a file or directory */ + HGFS_OP_QUERY_VOLUME_INFO_V3, /* Query volume information */ + HGFS_OP_CREATE_SYMLINK_V3, /* Create a symlink */ + HGFS_OP_SERVER_LOCK_CHANGE_V3, /* Change the oplock on a file */ + + HGFS_OP_MAX, /* Dummy op, must be last in enum */ } HgfsOp; +/* HGFS protocol versions. */ +#define HGFS_VERSION_OLD (1 << 0) +#define HGFS_VERSION_3 (1 << 1) + +/* XXX: Needs change when VMCI is supported. */ +#define HGFS_REQ_PAYLOAD_SIZE_V3(hgfsReq) (sizeof *hgfsReq + sizeof(HgfsRequest)) +#define HGFS_REP_PAYLOAD_SIZE_V3(hgfsRep) (sizeof *hgfsRep + sizeof(HgfsReply)) + +/* XXX: Needs change when VMCI is supported. */ +#define HGFS_REQ_GET_PAYLOAD_V3(hgfsReq) ((char *)(hgfsReq) + sizeof(HgfsRequest)) +#define HGFS_REP_GET_PAYLOAD_V3(hgfsRep) ((char *)(hgfsRep) + sizeof(HgfsReply)) + + /* * File types, used in HgfsAttr. We support regular files, * directories, and symlinks. @@ -150,10 +184,10 @@ * * The client can ask the server to acquire opportunistic locking/leasing * from the host FS on its behalf. This is communicated as part of an open request. - * + * * HGFS_LOCK_OPPORTUNISTIC means that the client trusts the server * to decide what kind of locking to request from the host FS. - * All other values tell the server explicitly the type of lock to + * All other values tell the server explicitly the type of lock to * request. * * The server will attempt to acquire the desired lock and will notify the client @@ -189,9 +223,9 @@ /* - * Hints to indicate in a getattr or setattr which attributes + * Hints to indicate in a getattr or setattr which attributes * are valid for the request. - * For setattr only, attributes should be set by host even if + * For setattr only, attributes should be set by host even if * no valid values are specified by the guest. */ @@ -202,7 +236,7 @@ #define HGFS_ATTR_HINT_USE_FILE_DESC (1 << 2) /* - * Hint to determine using a name or a handle to determine + * Hint to determine using a name or a handle to determine * what to delete. */ @@ -211,7 +245,7 @@ #define HGFS_DELETE_HINT_USE_FILE_DESC (1 << 0) /* - * Hint to determine using a name or a handle to determine + * Hint to determine using a name or a handle to determine * what to renames. */ @@ -229,7 +263,7 @@ * units of 100ns since Jan 1, 1601, UTC. */ -/* +/* * Version 1 attributes. Deprecated. * Version 2 should be using HgfsAttrV2. */ @@ -252,14 +286,15 @@ /* Various flags and Windows attributes. */ -typedef uint64 HgfsAttrFlags; +typedef uint64 HgfsAttrFlags; #define HGFS_ATTR_HIDDEN (1 << 0) #define HGFS_ATTR_SYSTEM (1 << 1) #define HGFS_ATTR_ARCHIVE (1 << 2) +#define HGFS_ATTR_HIDDEN_FORCED (1 << 3) -/* +/* * Specifies which open request fields contain * valid values. */ @@ -268,7 +303,7 @@ #define HGFS_OPEN_VALID_NONE 0 #define HGFS_OPEN_VALID_MODE (1 << 0) -#define HGFS_OPEN_VALID_FLAGS (1 << 1) +#define HGFS_OPEN_VALID_FLAGS (1 << 1) #define HGFS_OPEN_VALID_SPECIAL_PERMS (1 << 2) #define HGFS_OPEN_VALID_OWNER_PERMS (1 << 3) #define HGFS_OPEN_VALID_GROUP_PERMS (1 << 4) @@ -281,7 +316,7 @@ #define HGFS_OPEN_VALID_FILE_NAME (1 << 11) -/* +/* * Specifies which attribute fields contain * valid values. */ @@ -301,12 +336,29 @@ #define HGFS_ATTR_VALID_OTHER_PERMS (1 << 9) #define HGFS_ATTR_VALID_FLAGS (1 << 10) #define HGFS_ATTR_VALID_ALLOCATION_SIZE (1 << 11) -#define HGFS_ATTR_VALID_USERID (1 << 12) +#define HGFS_ATTR_VALID_USERID (1 << 12) #define HGFS_ATTR_VALID_GROUPID (1 << 13) #define HGFS_ATTR_VALID_FILEID (1 << 14) - - +#define HGFS_ATTR_VALID_VOLID (1 << 15) /* + * Add our file and volume identifiers. + * NOTE: On Windows hosts, the file identifier is not guaranteed to be valid + * particularly with FAT. A defrag operation could cause it to change. + * Therefore, to not confuse older clients, and non-Windows + * clients we have added a separate flag. + * The Windows client will check for both flags for the + * file ID, and return the information to the guest application. + * However, it will use the ID internally, when it has an open + * handle on the server. + * Non-Windows clients need the file ID to be always guaranteed, + * which is to say, that the ID remains constant over the course of the + * file's lifetime, and will use the HGFS_ATTR_VALID_FILEID flag + * only to determine if the ID is valid. + */ +#define HGFS_ATTR_VALID_NON_STATIC_FILEID (1 << 16) + + +/* * Specifies which create dir request fields contain * valid values. */ @@ -320,12 +372,12 @@ #define HGFS_CREATE_DIR_VALID_OTHER_PERMS (1 << 3) #define HGFS_CREATE_DIR_VALID_FILE_NAME (1 << 4) -/* +/* * Version 2 of HgfsAttr */ -typedef -#include "vmware_pack_begin.h" +typedef +#include "vmware_pack_begin.h" struct HgfsAttrV2 { HgfsAttrValid mask; /* A bit mask to determine valid attribute fields */ HgfsFileType type; /* File type */ @@ -335,23 +387,24 @@ uint64 writeTime; /* Time of last write */ uint64 attrChangeTime; /* Time file attributes were last * changed. Ignored by Windows */ - HgfsPermissions specialPerms; /* Special permissions bits (suid, etc.). + HgfsPermissions specialPerms; /* Special permissions bits (suid, etc.). * Ignored by Windows */ HgfsPermissions ownerPerms; /* Owner permissions bits */ - HgfsPermissions groupPerms; /* Group permissions bits. Ignored by + HgfsPermissions groupPerms; /* Group permissions bits. Ignored by * Windows */ - HgfsPermissions otherPerms; /* Other permissions bits. Ignored by + 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 */ - uint64 reserved1; /* Reserved for future use */ + uint32 volumeId; /* volume identifier, non-zero is valid. */ + uint32 reserved1; /* Reserved for future use */ uint64 reserved2; /* Reserved for future use */ -} -#include "vmware_pack_end.h" -HgfsAttrV2; +} +#include "vmware_pack_end.h" +HgfsAttrV2; /* @@ -382,16 +435,16 @@ * SEARCH_OPEN. * * In the current HGFS server implementation, each request has a minimum packet - * size that must be met for it to be considered valid. This minimum is simply + * size that must be met for it to be considered valid. This minimum is simply * the sizeof the particular request, which includes the solitary byte from the * HgfsFileName struct. For these particular requests, clients add an extra * byte to their payload size, without that byte being present anywhere. * * It isn't clear that this behavior is correct, but the end result is that - * neither end malfunctions, as an extra byte gets sent by the client and is + * neither end malfunctions, as an extra byte gets sent by the client and is * ignored by the server. Unfortunately, it cannot be easily fixed. The * server's minimum packet size can be changed, but the client should continue - * to send an extra byte, otherwise older servers with a slightly longer + * to send an extra byte, otherwise older servers with a slightly longer * minimum packet size may consider the new client's packets to be too short. * * UTF-8 representation @@ -410,11 +463,11 @@ * * Precomposed (normal form C) versus Decomposed (normal form D) * ------------------------------------------------------------- - * Certain Unicode characters can be encoded in more than one way. - * For example, an Á (A acute) can be encoded either precomposed, - * as U+00C1 (LATIN CAPITAL LETTER A WITH ACUTE), or decomposed, + * Certain Unicode characters can be encoded in more than one way. + * For example, an (A acute) can be encoded either precomposed, + * as U+00C1 (LATIN CAPITAL LETTER A WITH ACUTE), or decomposed, * as U+0041 U+0301 (LATIN CAPITAL LETTER A followed by a COMBINING ACUTE ACCENT). - * Precomposed characters are more common in the Windows world, + * Precomposed characters are more common in the Windows world, * whereas decomposed characters are more common on the Mac. * * See UAX 15 (http://unicode.org/reports/tr15/) @@ -431,6 +484,43 @@ /* + * Case-sensitiviy flags are only used when any lookup is + * involved on the server side. + */ + +typedef enum { + HGFS_FILE_NAME_DEFAULT_CASE, + HGFS_FILE_NAME_CASE_SENSITIVE, + HGFS_FILE_NAME_CASE_INSENSITIVE, +} HgfsCaseType; + + +/* + * HgfsFileNameV3 - new header to incorporate case-sensitivity flags along with + * Hgfs file handle. + */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsFileNameV3 { + uint32 length; /* Does NOT include terminating NUL */ + uint32 flags; /* Flags described below. */ + HgfsCaseType caseType; /* Case-sensitivity type. */ + HgfsHandle fid; + char name[1]; +} +#include "vmware_pack_end.h" +HgfsFileNameV3; + + +/* + * HgfsFileNameV3 flags. Case-sensitiviy flags are only used when any lookup is + * involved on the server side. + */ +#define HGFS_FILE_NAME_USE_FILE_DESC (1 << 0) /* Case type ignored if set. */ + + +/* * Request/reply structs. These are the first members of all * operation request and reply messages, respectively. */ @@ -478,26 +568,51 @@ typedef #include "vmware_pack_begin.h" -struct HgfsRequestOpenV2 { - HgfsRequest header; +struct HgfsRequestOpenV2 { + HgfsRequest header; 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 */ + 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 */ HgfsServerLock desiredLock; /* The type of lock desired by the client */ uint64 reserved1; /* Reserved for future use */ uint64 reserved2; /* Reserved for future use */ - HgfsFileName fileName; -} -#include "vmware_pack_end.h" -HgfsRequestOpenV2; + HgfsFileName fileName; +} +#include "vmware_pack_end.h" +HgfsRequestOpenV2; + + +/* Version 3 of HgfsRequestOpen */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestOpenV3 { + 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 */ + HgfsServerLock desiredLock; /* The type of lock desired by the client */ + uint64 reserved1; /* Reserved for future use */ + uint64 reserved2; /* Reserved for future use */ + HgfsFileNameV3 fileName; +} +#include "vmware_pack_end.h" +HgfsRequestOpenV3; /* Deprecated */ @@ -525,6 +640,21 @@ HgfsReplyOpenV2; +/* Version 3 of HgfsReplyOpen */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsReplyOpenV3 { + HgfsHandle file; /* Opaque file ID used by the server */ + HgfsServerLock acquiredLock; /* The type of lock acquired by the server */ + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsReplyOpenV3; + + +/* Deprecated */ + typedef #include "vmware_pack_begin.h" struct HgfsRequestRead { @@ -536,6 +666,7 @@ #include "vmware_pack_end.h" HgfsRequestRead; +/* Deprecated */ typedef #include "vmware_pack_begin.h" @@ -548,6 +679,35 @@ HgfsReplyRead; +/* + * Version 3 of HgfsRequestRead. + * Server must support HGFS_LARGE_PACKET_MAX to implement this op. + */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestReadV3 { + HgfsHandle file; /* Opaque file ID used by the server */ + uint64 offset; + uint32 requiredSize; + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsRequestReadV3; + +typedef +#include "vmware_pack_begin.h" +struct HgfsReplyReadV3 { + uint32 actualSize; + uint64 reserved; /* Reserved for future use */ + char payload[1]; +} +#include "vmware_pack_end.h" +HgfsReplyReadV3; + + +/* Deprecated */ + typedef #include "vmware_pack_begin.h" struct HgfsRequestWrite { @@ -562,6 +722,8 @@ HgfsRequestWrite; +/* Deprecated */ + typedef #include "vmware_pack_begin.h" struct HgfsReplyWrite { @@ -571,6 +733,36 @@ #include "vmware_pack_end.h" HgfsReplyWrite; +/* + * Version 3 of HgfsRequestWrite. + * Server must support HGFS_LARGE_PACKET_MAX to implement this op. + */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestWriteV3 { + HgfsHandle file; /* Opaque file ID used by the server */ + HgfsWriteFlags flags; + uint64 offset; + uint32 requiredSize; + uint64 reserved; /* Reserved for future use */ + char payload[1]; +} +#include "vmware_pack_end.h" +HgfsRequestWriteV3; + + +typedef +#include "vmware_pack_begin.h" +struct HgfsReplyWriteV3 { + uint32 actualSize; + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsReplyWriteV3; + + +/* Deprecated */ typedef #include "vmware_pack_begin.h" @@ -582,6 +774,8 @@ HgfsRequestClose; +/* Deprecated */ + typedef #include "vmware_pack_begin.h" struct HgfsReplyClose { @@ -593,6 +787,27 @@ typedef #include "vmware_pack_begin.h" +struct HgfsRequestCloseV3 { + HgfsHandle file; /* Opaque file ID used by the server */ + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsRequestCloseV3; + + +typedef +#include "vmware_pack_begin.h" +struct HgfsReplyCloseV3 { + uint64 reserved; +} +#include "vmware_pack_end.h" +HgfsReplyCloseV3; + + +/* Deprecated */ + +typedef +#include "vmware_pack_begin.h" struct HgfsRequestSearchOpen { HgfsRequest header; HgfsFileName dirName; @@ -603,6 +818,18 @@ typedef #include "vmware_pack_begin.h" +struct HgfsRequestSearchOpenV3 { + uint64 reserved; /* Reserved for future use */ + HgfsFileNameV3 dirName; +} +#include "vmware_pack_end.h" +HgfsRequestSearchOpenV3; + + +/* Deprecated */ + +typedef +#include "vmware_pack_begin.h" struct HgfsReplySearchOpen { HgfsReply header; HgfsHandle search; /* Opaque search ID used by the server */ @@ -611,6 +838,16 @@ HgfsReplySearchOpen; +typedef +#include "vmware_pack_begin.h" +struct HgfsReplySearchOpenV3 { + HgfsHandle search; /* Opaque search ID used by the server */ + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsReplySearchOpenV3; + + /* Deprecated */ typedef @@ -636,6 +873,17 @@ #include "vmware_pack_end.h" HgfsRequestSearchReadV2; +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestSearchReadV3 { + HgfsHandle search; /* Opaque search ID used by the server */ + uint32 offset; /* The first result is offset 0 */ + uint32 flags; /* Reserved for reading multiple directory entries. */ + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsRequestSearchReadV3; + /* Deprecated */ @@ -655,20 +903,47 @@ typedef #include "vmware_pack_begin.h" -struct HgfsReplySearchReadV2 { - HgfsReply header; +struct HgfsReplySearchReadV2 { + HgfsReply header; HgfsAttrV2 attr; - - /* - * fileName.length = 0 means "no entry at this offset" + + /* + * fileName.length = 0 means "no entry at this offset" * If the file is a symlink (as specified in attr) * this name is the name of the symlink, not the target. - */ - HgfsFileName fileName; -} -#include "vmware_pack_end.h" -HgfsReplySearchReadV2; + */ + HgfsFileName fileName; +} +#include "vmware_pack_end.h" +HgfsReplySearchReadV2; + +/* Directory entry structure. */ + +typedef struct HgfsDirEntry { + uint32 nextEntry; + HgfsAttrV2 attr; + + /* + * fileName.length = 0 means "no entry at this offset" + * If the file is a symlink (as specified in attr) + * this name is the name of the symlink, not the target. + */ + HgfsFileNameV3 fileName; +} HgfsDirEntry; + +typedef +#include "vmware_pack_begin.h" +struct HgfsReplySearchReadV3 { + uint64 count; /* Number of directory entries. */ + uint64 reserved; /* Reserved for future use. */ + char payload[1]; /* Directory entries. */ +} +#include "vmware_pack_end.h" +HgfsReplySearchReadV3; + + +/* Deprecated */ typedef #include "vmware_pack_begin.h" @@ -680,6 +955,8 @@ HgfsRequestSearchClose; +/* Deprecated */ + typedef #include "vmware_pack_begin.h" struct HgfsReplySearchClose { @@ -689,6 +966,25 @@ HgfsReplySearchClose; +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestSearchCloseV3 { + HgfsHandle search; /* Opaque search ID used by the server */ + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsRequestSearchCloseV3; + + +typedef +#include "vmware_pack_begin.h" +struct HgfsReplySearchCloseV3 { + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsReplySearchCloseV3; + + /* Deprecated */ typedef @@ -715,6 +1011,17 @@ HgfsRequestGetattrV2; +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestGetattrV3 { + HgfsAttrHint hints; /* Flags for file handle valid. */ + uint64 reserved; /* Reserved for future use */ + HgfsFileNameV3 fileName; /* Filename used when file handle invalid. */ +} +#include "vmware_pack_end.h" +HgfsRequestGetattrV3; + + /* Deprecated */ typedef @@ -734,10 +1041,10 @@ struct HgfsReplyGetattrV2 { HgfsReply header; HgfsAttrV2 attr; - + /* - * If the file is a symlink, as specified in attr.type, then this is - * the target for the symlink. If the file is not a symlink, this should + * If the file is a symlink, as specified in attr.type, then this is + * the target for the symlink. If the file is not a symlink, this should * be ignored. * * This filename is in "CPNameLite" format. See CPNameLite.c for details. @@ -748,6 +1055,25 @@ HgfsReplyGetattrV2; +typedef +#include "vmware_pack_begin.h" +struct HgfsReplyGetattrV3 { + HgfsAttrV2 attr; + + /* + * If the file is a symlink, as specified in attr.type, then this is + * the target for the symlink. If the file is not a symlink, this should + * be ignored. + * + * This filename is in "CPNameLite" format. See CPNameLite.c for details. + */ + uint64 reserved; /* Reserved for future use */ + HgfsFileNameV3 symlinkTarget; +} +#include "vmware_pack_end.h" +HgfsReplyGetattrV3; + + /* Deprecated */ typedef @@ -777,6 +1103,17 @@ HgfsRequestSetattrV2; +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestSetattrV3 { + HgfsAttrHint hints; + HgfsAttrV2 attr; + uint64 reserved; /* Reserved for future use */ + HgfsFileNameV3 fileName; /* Filename used when file handle invalid. */ +} +#include "vmware_pack_end.h" +HgfsRequestSetattrV3; + /* Deprecated */ typedef @@ -798,6 +1135,27 @@ #include "vmware_pack_end.h" HgfsReplySetattrV2; +typedef +#include "vmware_pack_begin.h" +struct HgfsReplySetattrV3 { + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsReplySetattrV3; + + +/* Deprecated */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestCreateDir { + HgfsRequest header; + HgfsPermissions permissions; + HgfsFileName fileName; +} +#include "vmware_pack_end.h" +HgfsRequestCreateDir; + /* Version 2 of HgfsRequestCreateDir */ @@ -816,17 +1174,32 @@ HgfsRequestCreateDirV2; +/* Version 3 of HgfsRequestCreateDir */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestCreateDirV3 { + HgfsCreateDirValid mask; + HgfsPermissions specialPerms; + HgfsPermissions ownerPerms; + HgfsPermissions groupPerms; + HgfsPermissions otherPerms; + uint64 reserved; /* Reserved for future use */ + HgfsFileNameV3 fileName; +} +#include "vmware_pack_end.h" +HgfsRequestCreateDirV3; + + /* Deprecated */ typedef #include "vmware_pack_begin.h" -struct HgfsRequestCreateDir { - HgfsRequest header; - HgfsPermissions permissions; - HgfsFileName fileName; +struct HgfsReplyCreateDir { + HgfsReply header; } #include "vmware_pack_end.h" -HgfsRequestCreateDir; +HgfsReplyCreateDir; /* Version 2 of HgfsReplyCreateDir */ @@ -840,16 +1213,18 @@ HgfsReplyCreateDirV2; -/* Deprecated */ +/* Version 3 of HgfsReplyCreateDir */ typedef #include "vmware_pack_begin.h" -struct HgfsReplyCreateDir { - HgfsReply header; +struct HgfsReplyCreateDirV3 { + uint64 reserved; /* Reserved for future use */ } #include "vmware_pack_end.h" -HgfsReplyCreateDir; +HgfsReplyCreateDirV3; + +/* Deprecated */ typedef #include "vmware_pack_begin.h" @@ -860,6 +1235,9 @@ #include "vmware_pack_end.h" HgfsRequestDelete; + +/* Version 2 of HgfsRequestDelete */ + typedef #include "vmware_pack_begin.h" struct HgfsRequestDeleteV2 { @@ -871,6 +1249,22 @@ #include "vmware_pack_end.h" HgfsRequestDeleteV2; + +/* Version 3 of HgfsRequestDelete */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestDeleteV3 { + HgfsDeleteHint hints; + uint64 reserved; /* Reserved for future use */ + HgfsFileNameV3 fileName; /* Name used if the file is HGFS_HANDLE_INVALID */ +} +#include "vmware_pack_end.h" +HgfsRequestDeleteV3; + + +/* Deprecated */ + typedef #include "vmware_pack_begin.h" struct HgfsReplyDelete { @@ -889,6 +1283,18 @@ #include "vmware_pack_end.h" HgfsReplyDeleteV2; + +/* Version 2 of HgfsReplyDelete */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsReplyDeleteV3 { + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsReplyDeleteV3; + + /* * The size of the HgfsFileName struct is variable depending on the * length of the name, so you can't use request->newName to get the @@ -942,6 +1348,29 @@ HgfsReplyRenameV2; +/* HgfsRequestRename and HgfsReplyRename for v3. */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestRenameV3 { + HgfsRenameHint hints; + uint64 reserved; /* Reserved for future use */ + HgfsFileNameV3 oldName; + HgfsFileNameV3 newName; +} +#include "vmware_pack_end.h" +HgfsRequestRenameV3; + + +typedef +#include "vmware_pack_begin.h" +struct HgfsReplyRenameV3 { + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsReplyRenameV3; + + typedef #include "vmware_pack_begin.h" struct HgfsRequestQueryVolume { @@ -963,6 +1392,30 @@ HgfsReplyQueryVolume; +/* HgfsRequestQueryVolume and HgfsReplyQueryVolume for v3. */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestQueryVolumeV3 { + uint64 reserved; /* Reserved for future use */ + HgfsFileNameV3 fileName; +} +#include "vmware_pack_end.h" +HgfsRequestQueryVolumeV3; + + +typedef +#include "vmware_pack_begin.h" +struct HgfsReplyQueryVolumeV3 { + uint64 freeBytes; + uint64 totalBytes; + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsReplyQueryVolumeV3; + + + /* New operations for Version 2 */ typedef @@ -1008,4 +1461,28 @@ HgfsReplySymlinkCreate; +/* HgfsRequestSymlinkCreate and HgfsReplySymlinkCreate for v3. */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestSymlinkCreateV3 { + uint64 reserved; /* Reserved for future use */ + HgfsFileNameV3 symlinkName; + + /* This filename is in "CPNameLite" format. See CPNameLite.c for details. */ + HgfsFileNameV3 targetName; +} +#include "vmware_pack_end.h" +HgfsRequestSymlinkCreateV3; + + +typedef +#include "vmware_pack_begin.h" +struct HgfsReplySymlinkCreateV3 { + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsReplySymlinkCreateV3; + + #endif /* _HGFS_PROTO_H_ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/hgfsUtil.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/hgfsUtil.c --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/hgfsUtil.c 2008-01-28 08:02:47.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/hgfsUtil.c 2008-10-13 08:01:44.000000000 +0100 @@ -142,7 +142,7 @@ * * Results: * 0 on success - * nonzero if time is not representable on UNIX + * nonzero if time is not representable on UNIX * * Side effects: * None @@ -156,7 +156,7 @@ { struct timespec tm; int ret; - + ret = HgfsConvertFromNtTimeNsec(&tm, ntTime); *unixTime = tm.tv_sec; return ret; @@ -215,6 +215,8 @@ return HGFS_STATUS_NO_SPACE; case ERROR_NOT_SUPPORTED: return HGFS_STATUS_OPERATION_NOT_SUPPORTED; + case ERROR_INVALID_PARAMETER: + return HGFS_STATUS_INVALID_PARAMETER; case HGFS_INTERNAL_STATUS_ERROR: default: return HGFS_STATUS_GENERIC_ERROR; @@ -253,6 +255,8 @@ return HGFS_STATUS_OPERATION_NOT_SUPPORTED; case ENAMETOOLONG: return HGFS_STATUS_NAME_TOO_LONG; + case EPARAMETERNOTSUPPORTED: + return HGFS_STATUS_INVALID_PARAMETER; case HGFS_INTERNAL_STATUS_ERROR: default: return HGFS_STATUS_GENERIC_ERROR; diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/hgfsUtil.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/hgfsUtil.h --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/hgfsUtil.h 2008-01-28 08:02:47.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/hgfsUtil.h 2008-10-13 08:01:44.000000000 +0100 @@ -19,7 +19,7 @@ /* * hgfsUtil.h -- - * + * * Utility functions and macros used by hgfs. */ @@ -29,15 +29,15 @@ # if defined(__linux__) && defined(__KERNEL__) # include "driver-config.h" -# include <linux/time.h> // for time_t and timespec +# include <linux/time.h> // for time_t and timespec /* Include time.h in userspace code, but not in Solaris kernel code. */ # elif defined(__FreeBSD__) && defined(_KERNEL) /* Do nothing. */ # elif defined(__APPLE__) && defined(KERNEL) # include <sys/time.h> -# else +# else # include <time.h> -# endif +# endif # include "vm_basic_types.h" # if !defined(_STRUCT_TIMESPEC) && \ !defined(_TIMESPEC_DECLARED) && \ @@ -71,15 +71,27 @@ typedef DWORD HgfsInternalStatus; #endif -/* - * Unfortunately, we need a catch-all "generic error" to use with +/* + * Unfortunately, we need a catch-all "generic error" to use with * HgfsInternalStatus, because there are times when cross-platform code needs - * to return its own errors along with errors from platform specific code. + * to return its own errors along with errors from platform specific code. * * Using -1 should be safe because we expect our platforms to use zero as * success and a positive range of numbers as error values. */ -#define HGFS_INTERNAL_STATUS_ERROR -1 +#define HGFS_INTERNAL_STATUS_ERROR (-1) + +#ifndef _WIN32 +/* + * This error code is used to notify the client that some of the parameters passed + * (e.g. file handles) are not supported. Clients are expected to correct + * the parameter (e.g. pass file name instead) and retry. + * + * Note that this error code is artificially made up and in future may conflict + * with an "official" error code when added. + */ +#define EPARAMETERNOTSUPPORTED (MAX_INT32 - 1) +#endif /* * FreeBSD (pre-6.0) does not define EPROTO, so we'll define our own error code. @@ -89,6 +101,7 @@ #endif #define HGFS_NAME_BUFFER_SIZE(request) (HGFS_PACKET_MAX - (sizeof *request - 1)) +#define HGFS_NAME_BUFFER_SIZET(sizet) (HGFS_PACKET_MAX - ((sizet) - 1)) #ifndef _WIN32 /* @@ -114,3 +127,4 @@ HgfsStatus HgfsConvertFromInternalStatus(HgfsInternalStatus status); // IN #endif /* _HGFSUTIL_H_ */ + diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/kernelStubsBSD.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/kernelStubsBSD.c --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/kernelStubsBSD.c 2008-01-28 08:02:47.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/kernelStubsBSD.c 2008-10-13 08:01:44.000000000 +0100 @@ -96,36 +96,6 @@ /* *----------------------------------------------------------------------------- * - * System_Uptime -- - * - * Returns the system's uptime in hundredths of a second. - * - * Results: - * Uptime in hundredths of a second. - * - * Side effects: - * None. - * - *----------------------------------------------------------------------------- - */ - -uint64 -System_Uptime(void) -{ - /* - * From sys/kernel.h: - * tick: µs per tick - * ticks: uptime counter - * - * ticks * tick = uptime in µs, and there are 10000 µs / 1 cs - */ - return ticks * tick / 10000; -} - - -/* - *----------------------------------------------------------------------------- - * * Str_Strcpy -- * * Wrapper around strcpy that panics if the source is too long. diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/kernelStubs.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/kernelStubs.h --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/kernelStubs.h 2008-01-28 08:02:47.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/kernelStubs.h 2008-10-13 08:01:44.000000000 +0100 @@ -21,7 +21,7 @@ * * KernelStubs implements some userspace library functions in terms * of kernel functions to allow library userspace code to be used in a - * kernel. + * kernel. */ #ifndef __KERNELSTUBS_H__ @@ -29,7 +29,7 @@ #ifdef linux # ifndef __KERNEL__ -# error "__KERNEL__ is not defined" +# error "__KERNEL__ is not defined" # endif # include "driver-config.h" // Must be included before any other header files # include "vm_basic_types.h" @@ -57,10 +57,10 @@ #elif defined(__APPLE__) # include "vm_basic_types.h" # ifndef KERNEL -# error "KERNEL is not defined" +# error "KERNEL is not defined" # endif # include <stdarg.h> -# include <string.h> +# include <string.h> #endif /* @@ -71,9 +71,6 @@ # ifdef linux /* if (linux) { */ char *strdup(const char *source); -# elif defined(__APPLE__) /* else if (__APPLE__) { */ -void KernelStubs_Init(void); -void KernelStubs_Cleanup(void); # endif /* Shared between Linux and Apple kernel stubs. */ @@ -130,8 +127,8 @@ /* * Stub functions we provide. */ + void Panic(const char *fmt, ...); -uint64 System_Uptime(void); char *Str_Strcpy(char *buf, const char *src, size_t maxSize); int Str_Vsnprintf(char *str, size_t size, const char *format, diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/Makefile /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/Makefile --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/Makefile 2008-01-28 08:02:47.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/Makefile 2008-10-13 08:01:44.000000000 +0100 @@ -24,6 +24,12 @@ HEADERS += debug.h HEADERS += state.h HEADERS += kernelStubs.h +HEADERS += fsutil.h +HEADERS += vnopscommon.h +HEADERS += os.h +HEADERS += compat_freebsd.h +HEADERS += compat_vop.h +HEADERS += vfsopscommon.h COMMON_SRCS := cpName.c COMMON_SRCS += cpNameLinux.c @@ -41,13 +47,18 @@ COMMON_SRCS += backdoorGcc32.c .endif +COMMON_HGFS_SRCS := debug.c +COMMON_HGFS_SRCS += request.c +COMMON_HGFS_SRCS += worker.c +COMMON_HGFS_SRCS += fsutil.c +COMMON_HGFS_SRCS += vnopscommon.c +COMMON_HGFS_SRCS += state.c +COMMON_HGFS_SRCS += vfsopscommon.c + MODULE_SRCS := vnops.c MODULE_SRCS += vfsops.c -MODULE_SRCS += request.c -MODULE_SRCS += debug.c -MODULE_SRCS += state.c +MODULE_SRCS += os.c MODULE_SRCS += hgfsUtil.c -MODULE_SRCS += worker.c MODULE_SRCS += kernelStubsBSD.c # @@ -55,7 +66,7 @@ # for build targets. C files will be compiled, and headers will just be # tested for presence. # -SRCS = $(MODULE_SRCS) $(COMMON_SRCS) $(HEADERS) +SRCS = $(MODULE_SRCS) $(COMMON_SRCS) $(COMMON_HGFS_SRCS) $(HEADERS) KMOD = vmhgfs PROG = ../$(KMOD).ko diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/os.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/os.c --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/os.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/os.c 2008-10-13 08:01:43.000000000 +0100 @@ -0,0 +1,863 @@ +/********************************************************* + * Copyright (C) 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 General Public License as published by the + * Free Software Foundation version 2 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 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 + * + *********************************************************/ + +/* + * os.c -- + * + * FreeBSD specific implementations of the hgfs memory allocation + * and thread synchronization routines. + */ + +#if !defined(_KERNEL) +# error "This os.c file can only be compiled for the FreeBSD kernel." +#endif + +#include <sys/param.h> +#include <sys/malloc.h> +#include <sys/lock.h> // for struct mtx +#include <sys/kernel.h> +#include <vm/uma.h> // for uma_zone_t +#include <sys/kthread.h> // for kthread_create() + +#include "vm_basic_types.h" +#include "os.h" +#include "debug.h" +#include "compat_freebsd.h" + +/* + * Malloc tag for statistics, debugging, etc. + */ +MALLOC_DEFINE(M_HGFS, HGFS_FS_NAME, HGFS_FS_NAME_LONG); + +/* + * Since FreeBSD provides a zone allocator, just store a pointer to the FreeBSD + * zone allocator. + */ +typedef struct os_zone_struct { + struct uma_zone *umaZone; +} os_zone_struct; + +/* + *---------------------------------------------------------------------------- + * + * os_init -- + * + * Initialize the global memory allocation variables needed by other + * functions in this file. Must be called before any other functions in this + * file. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +int +os_init(void) +{ + /* NOP */ + return 0; +} + + +/* + *---------------------------------------------------------------------------- + * + * os_cleanup -- + * + * Cleanup the global variables that were created in os_init. + * Must be called if os_init was called. Other functions in this + * file cannot be called after os_cleanup is called. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +void +os_cleanup(void) +{ + /* NOP */ +} + + +/* + *---------------------------------------------------------------------------- + * + * os_zone_create -- + * + * Creates a new zone (OS_ZONE_T) from which memory allocations can + * be made. + * + * Results: + * Either an uma zone or NULL (if no memory was available). + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +OS_ZONE_T * +os_zone_create(char *zoneName, // IN + size_t objectSize, // IN + os_zone_ctor ctor, // IN + os_zone_dtor dtor, // IN + os_zone_init init, // IN + os_zone_finit finit, // IN + int align, // IN + uint32 flags) // IN +{ + OS_ZONE_T *zone; + + zone = os_malloc(sizeof *zone, M_WAITOK); + zone->umaZone = uma_zcreate(zoneName, + objectSize, ctor, dtor, init, finit, align, flags); + return zone; +} + + +/* + *---------------------------------------------------------------------------- + * + * os_zone_destroy -- + * + * _destroys a zone created with os_zone_create. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +void +os_zone_destroy(OS_ZONE_T *zone) // IN +{ + ASSERT(zone); + + uma_zdestroy(zone->umaZone); + os_free(zone, sizeof *zone); +} + + +/* + *---------------------------------------------------------------------------- + * + * os_zone_alloc -- + * + * Allocates an object from the specified zone and calls the the zone + * initializer and constructor. + * + * Results: + * Either an allocated and initizalized object or NULL. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +void * +os_zone_alloc(OS_ZONE_T *zone, // IN + int flags) // IN +{ + ASSERT(zone); + ASSERT(zone->umaZone); + + return uma_zalloc(zone->umaZone, flags); +} + + +/* + *---------------------------------------------------------------------------- + * + * os_zone_free -- + * + * Calls the zone destructor and final initialization routine on the + * specified object and then frees the object. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +void +os_zone_free(OS_ZONE_T *zone, // IN + void *mem) // IN +{ + ASSERT(zone); + ASSERT(zone->umaZone); + + uma_zfree(zone->umaZone, mem); +} + + +/* + *---------------------------------------------------------------------------- + * + * os_malloc -- + * + * Malloc some memory in a FreeBSD / OS X kernel independent manner. + * This just calls the internal kernel malloc function. According to the + * FreeBSD commments, if M_WAITOK is passed to the flags, malloc will never + * return NULL. + * + * Results: + * A pointer to allocated memory or NULL. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +void * +os_malloc(size_t size, // IN + int flags) // IN +{ + return malloc(size, M_HGFS, flags); +} + + +/* + *---------------------------------------------------------------------------- + * + * os_free -- + * + * Free some memory in a FreeBSD / OS X kernel independent manner. + * This just calls the internal kernel free function. + * + * Results: + * None. + * + * Side effects: + * The memory (mem) is freed. + * + *---------------------------------------------------------------------------- + */ + +void +os_free(void *mem, // IN + size_t size) // IN +{ + free(mem, M_HGFS); +} + + +/* + *---------------------------------------------------------------------------- + * + * os_mutex_alloc_init -- + * + * Allocate and initialize a FreeBSD mutex in an OS independent way. + * Mtx_name is not used on OS X. + * + * Results: + * A new mtx which has been allocated and is ready for use. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +OS_MUTEX_T * +os_mutex_alloc_init(const char *mtxName) // IN +{ + OS_MUTEX_T *mtx; + mtx = os_malloc(sizeof *mtx, + M_ZERO | M_WAITOK); + mtx_init(mtx, mtxName, NULL, MTX_DEF); + return mtx; +} + + +/* + *---------------------------------------------------------------------------- + * + * os_mutex_free -- + * + * Frees a FreeBSD mutex in an OS independent way. + * + * Results: + * None. + * + * Side effects: + * The mutex (mtx) is destroyed. + * + *---------------------------------------------------------------------------- + */ + +void +os_mutex_free(OS_MUTEX_T *mtx) // IN +{ + mtx_destroy(mtx); + os_free(mtx, sizeof *mtx); +} + + +/* + *---------------------------------------------------------------------------- + * + * os_mutex_lock -- + * + * Lock a FreeBSD mutex in an OS independent way. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +void +os_mutex_lock(OS_MUTEX_T *mtx) // IN +{ + mtx_lock(mtx); +} + + +/* + *---------------------------------------------------------------------------- + * + * os_mutex_unlock -- + * + * Unlock a FreeBSD mutex in an OS independent way. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +void +os_mutex_unlock(OS_MUTEX_T *mtx) // IN +{ + mtx_unlock(mtx); +} + + +/* + *---------------------------------------------------------------------------- + * + * os_rw_lock_alloc_init -- + * + * Allocate and initialize a FreeBSD rwlock in an OS independent way. + * + * Results: + * A new lock which has been allocated and is ready for use. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +OS_RWLOCK_T * +os_rw_lock_alloc_init(const char *lckName) // IN +{ + OS_RWLOCK_T *lck; + lck = os_malloc(sizeof *lck, + M_ZERO | M_WAITOK); + sx_init(lck, lckName); + return lck; +} + + +/* + *---------------------------------------------------------------------------- + * + * os_rw_lock_free -- + * + * Frees a FreeBSD rwlock in an OS independent way. + * + * Results: + * None. + * + * Side effects: + * The rwlock (lck) is destroyed. + * + *---------------------------------------------------------------------------- + */ + +void +os_rw_lock_free(OS_RWLOCK_T *lck) // IN +{ + sx_destroy(lck); + os_free(lck, sizeof *lck); +} + + +/* + *---------------------------------------------------------------------------- + * + * os_rw_lock_lock_shared -- + * + * Lock a FreeBSD rwlock for reads in an OS independent way. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +void +os_rw_lock_lock_shared(OS_RWLOCK_T *lck) // IN +{ + sx_slock(lck); +} + + +/* + *---------------------------------------------------------------------------- + * + * os_rw_lock_lock_exclusive -- + * + * Lock a FreeBSD rwlock for writes in an OS independent way. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +void +os_rw_lock_lock_exclusive(OS_RWLOCK_T *lck) // IN +{ + sx_xlock(lck); +} + + +/* + *---------------------------------------------------------------------------- + * + * os_rw_lock_unlock_shared -- + * + * Unlock FreeBSD rwlock in an OS independent way. Results are + * undefined if the function caller has an exculsive lock on lck. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +void +os_rw_lock_unlock_shared(OS_RWLOCK_T *lck) // IN +{ + sx_sunlock(lck); +} + + +/* + *---------------------------------------------------------------------------- + * + * os_rw_lock_unlock_exclusive -- + * + * Unlock FreeBSD rwlock in an OS independent way. Results are + * undefined if the function caller has an exculsive lock on lck. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +void +os_rw_lock_unlock_exclusive(OS_RWLOCK_T *lck) // IN +{ + sx_xunlock(lck); +} + + +/* + *---------------------------------------------------------------------------- + * + * os_cv_init -- + * + * Initialize a cv under FreeBSD. Under OS X, we are actually passed an + * object address we will use in place of a cv in later functions. Here + * we simply do nothing. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +void +os_cv_init(OS_CV_T *cv, // IN + const char *name) // IN +{ + cv_init(cv, name); +} + + +/* + *---------------------------------------------------------------------------- + * + * os_cv_destroy -- + * + * Destroy a cv under FreeBSD. Under OS X, we are actually passed an + * object address we will use in place of a cv in later functions. Here + * we simply do nothing. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +void +os_cv_destroy(OS_CV_T *cv) // IN +{ + cv_destroy(cv); +} + +/* + *---------------------------------------------------------------------------- + * + * os_cv_signal -- + * + * Signal a thread to wakeup in a FreeBSD/OS X independent way. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +void +os_cv_signal(OS_CV_T *cv) // IN +{ + cv_signal(cv); +} + + +/* + *---------------------------------------------------------------------------- + * + * os_cv_wait -- + * + * Have an XNU or FreeBSD kernel thread wait until the specified condition + * is signaled. This function unlocks the mutex (mtx) before it goes to + * sleep and reacquires it after the thread wakes up. Under FreeBSD it is a + * standard condition variable. os_cv_wait will return immediately if the + * thread was interrupted. It is the callers responsibility to determine + * if a signal was delivered or the dependent condition actually occurred. + * Under FreeBSD, it is illegal to sleep while holding a lock. Callers of + * this function should not hold any locks other than the mutex (mtx) that + * is passed into the function. + * + * Results: + * Zero on success. On FreeBSD errno if interrupted. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +int +os_cv_wait(OS_CV_T *cv, // IN + OS_MUTEX_T *mtx) // IN +{ + return cv_wait_sig(cv, mtx); +} + + +/* + *---------------------------------------------------------------------------- + * + * os_thread_create -- + * + * Create an OS X or FreeBSD kernel thread in an OS independent way. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +int +os_thread_create(void *function, // IN + void *parameter, // IN + const char *threadName, // IN + OS_THREAD_T *newThread) // OUT +{ + return compat_kthread_create(function, parameter, + newThread, 0, 0, threadName); +} + + +/* + *---------------------------------------------------------------------------- + * + * os_thread_join -- + * + * Wait until the specified kernel thread exits and then return. Mtx must + * be held by the calling code and the thread (thread) is not allowed to + * exit while mtx is held. This prevents (thread) from exiting before + * the caller goes to sleep. + * + * Results: + * Zero on success. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +void +os_thread_join(OS_THREAD_T thread, // IN + OS_MUTEX_T *mtx) // IN +{ + ASSERT(mtx); + + msleep(thread, mtx, PDROP, NULL, 0); +} + + +/* + *---------------------------------------------------------------------------- + * + * os_thread_release -- + * + * Release the OS_THREAD_T reference that was acquired in os_thread_create. + * This is a nop on FreeBSD. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +void +os_thread_release(OS_THREAD_T thread) // IN +{ + /* NOP */ +} + + +/* + *---------------------------------------------------------------------------- + * + * Hgfsthreadexit -- + * + * Called when a thread is exiting. ErrorCode is returned as the thread exit code + * under FreeBSD and ignored under OS X. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +void +os_thread_exit(int errorCode) // IN +{ + compat_kthread_exit(errorCode); +} + + +/* + *---------------------------------------------------------------------------- + * + * os_add_atomic -- + * + * Atomically increment an integer at a given location (address) by a given + * value (amount). + * + * Results: + * The value before the addition.. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +int +os_add_atomic(unsigned *address, // IN + int amount) // IN +{ + return atomic_fetchadd_int(address, amount); +} + + +/* + *---------------------------------------------------------------------------- + * + * os_utf8_conversion_needed -- + * + * It returns result depending upon whether a particular operating + * system expects utf8 strings in a format (decomposed utf8) + * different from wire format (precomposed utf8) or not. Since FreeBSD + * does not expect decomposed utf8, we return FALSE. + * + * Results: + * FALSE if conversion is not needed, TRUE if needed. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +Bool +os_utf8_conversion_needed(void) +{ + return FALSE; +} + + +/* + *---------------------------------------------------------------------------- + * + * os_component_to_utf8_decomposed -- + * + * Converts an input component into decomposed form and writes it into + * output buffer. It simply returns OS_ERR for FreeBSD. + * + * Results: + * 0 on success or OS_ERR on failure. Since this function is not + * implemented, it always returns OS_ERR. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +int +os_component_to_utf8_decomposed(char const *bufIn, // IN + uint32 bufSizeIn, // IN + char *bufOut, // OUT + size_t *sizeOut, // OUT + uint32 bufSizeOut) // IN +{ + NOT_IMPLEMENTED(); + return OS_ERR; +} + + +/* + *---------------------------------------------------------------------------- + * + * os_component_to_utf8_precomposed -- + * + * Converts an input component into precomposed form and writes it into + * output buffer. It simply returns OS_ERR for FreeBSD. + * + * Results: + * 0 on success or OS_ERR on failure. Since this function is not + * implemented, it always returns OS_ERR. + * + * Side effects: + * None. + *---------------------------------------------------------------------------- + */ + +int +os_component_to_utf8_precomposed(char const *bufIn, // IN + uint32 bufSizeIn, // IN + char *bufOut, // OUT + size_t *sizeOut, // OUT + uint32 bufSizeOut) // IN +{ + NOT_IMPLEMENTED(); + return OS_ERR; +} + + +/* + *---------------------------------------------------------------------------- + * + * os_path_to_utf8_precomposed -- + * + * Converts an input path into precomposed form and writes it into output + * buffer. It simply returns OS_ERR for FreeBSD. + * + * Results: + * 0 on success or OS_ERR on failure. Since this function is not + * implemented, it always returns OS_ERR. + * + * Side effects: + * None. + *---------------------------------------------------------------------------- + */ + +int +os_path_to_utf8_precomposed(char const *bufIn, // IN + uint32 bufSizeIn, // IN + char *bufOut, // OUT + uint32 bufSizeOut) // IN +{ + NOT_IMPLEMENTED(); + return OS_ERR; +} diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/os.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/os.h --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/os.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/os.h 2008-10-13 08:01:44.000000000 +0100 @@ -0,0 +1,130 @@ +/********************************************************* + * Copyright (C) 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 General Public License as published by the + * Free Software Foundation version 2 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 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 + * + *********************************************************/ + + +/* + * os.h -- + * + * Implementation OS X / FreeBSD independent memory allocation and + * thread synchronization routines. + */ + +#ifndef _OS_H_ +#define _OS_H_ + +#if defined(__FreeBSD__) +# include <sys/param.h> // for <everything> +# include <sys/proc.h> +# include <sys/condvar.h> +# include <sys/lock.h> // for struct mtx +# include <sys/mutex.h> // for struct mtx +# include <sys/sx.h> +#elif defined(__APPLE__) +# include <kern/thread.h> +# include <kern/locks.h> +#endif + +#include <sys/malloc.h> +#include "vm_basic_types.h" + +#if defined(__FreeBSD__) + typedef struct proc *OS_THREAD_T; + typedef struct mtx OS_MUTEX_T; + typedef struct sx OS_RWLOCK_T; + typedef struct cv OS_CV_T; +#elif defined(__APPLE__) + typedef thread_t OS_THREAD_T; + typedef lck_mtx_t OS_MUTEX_T; + typedef lck_rw_t OS_RWLOCK_T; + /* + * In OS X, a kernel thread waits on a 32-bit integer. To avoid collision, + * Apple recommends that threads wait on the address of an object. + */ + typedef void *OS_CV_T; +#endif + +/* OS_ERR is the error code returned by os_* functions on error. */ +#define OS_ERR (-1) + +int os_init(void); +void os_cleanup(void); + +/* + * There does not seem to be a public zone allocator exposed in OS X. We create + * a zone wrapper around the FreeBSD zone allocator so that we can keep the + * FreeBSD zone allocator and support OS X at the same time. + */ + +struct os_zone_struct; +typedef struct os_zone_struct OS_ZONE_T; + +/* + * Provide zone allocator function prototypes with the same signature as + * the ones used in the FreeBSD kernel. This way they can be used both with + * the FreeBSD uma allocator and the custom mac os allocation functions. + */ +typedef int (*os_zone_ctor)(void *mem, int size, void *arg, int flags); +typedef void (*os_zone_dtor)(void *mem, int size, void *arg); +typedef int (*os_zone_init)(void *mem, int size, int flags); +typedef void (*os_zone_finit)(void *mem, int size); + +OS_ZONE_T *os_zone_create(char *zoneName, size_t objectSize, + os_zone_ctor ctor, os_zone_dtor dtor, + os_zone_init init, os_zone_finit finit, + int align, uint32 flags); +void os_zone_destroy(OS_ZONE_T *zone); +void *os_zone_alloc(OS_ZONE_T *zone, int flags); +void os_zone_free(OS_ZONE_T *zone, void *mem); + +void *os_malloc(size_t size, int flags); +void os_free(void *mem, size_t size); + +extern OS_MUTEX_T *os_mutex_alloc_init(const char *mtxName); +extern void os_mutex_free(OS_MUTEX_T *mtx); +extern void os_mutex_lock(OS_MUTEX_T *mtx); +extern void os_mutex_unlock(OS_MUTEX_T *mtx); + +extern OS_RWLOCK_T *os_rw_lock_alloc_init(const char *lckName); +extern void os_rw_lock_free(OS_RWLOCK_T *lck); +extern void os_rw_lock_lock_shared(OS_RWLOCK_T *lck); +extern void os_rw_lock_lock_exclusive(OS_RWLOCK_T *lck); +extern void os_rw_lock_unlock_shared(OS_RWLOCK_T *lck); +extern void os_rw_lock_unlock_exclusive(OS_RWLOCK_T *lck); + +extern void os_cv_init(OS_CV_T *cv, const char *name); +extern void os_cv_destroy(OS_CV_T *cv); +extern void os_cv_signal(OS_CV_T *cv); +extern int os_cv_wait(OS_CV_T *cv, OS_MUTEX_T *mtx); + +extern int os_thread_create(void *function, void *parameter, + const char *threadName, OS_THREAD_T *newThread); +extern void os_thread_join(OS_THREAD_T thread, OS_MUTEX_T *mtx); +extern void os_thread_release(OS_THREAD_T thread); +extern void os_thread_exit(int errorCode); + +extern int os_add_atomic(unsigned int *address, int amount); +extern int os_component_to_utf8_decomposed(const char *bufIn, uint32 bufInSize, char *bufOut, + size_t *sizeOut, uint32 bufOutSize); +extern int os_component_to_utf8_precomposed(const char *bufIn, uint32 bufInSize, char *bufOut, + size_t *sizeOut, uint32 bufOutSize); +extern int os_path_to_utf8_precomposed(const char *bufIn, uint32 bufInSize, char *bufOut, + uint32 bufOutSize); +extern Bool os_utf8_conversion_needed(void); + + +#endif // ifndef _OS_H_ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/request.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/request.c --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/request.c 2008-01-28 08:02:47.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/request.c 2008-10-13 08:01:43.000000000 +0100 @@ -31,7 +31,6 @@ #include "hgfs_kernel.h" #include "requestInt.h" - /* * Macros */ @@ -53,21 +52,20 @@ * See requestInt.h for details. */ -uma_zone_t hgfsKReqZone; DblLnkLst_Links hgfsKReqWorkItemList; -struct mtx hgfsKReqWorkItemLock; -struct cv hgfsKReqWorkItemCv; +OS_MUTEX_T *hgfsKReqWorkItemLock; +OS_ZONE_T *hgfsKReqZone; +OS_CV_T hgfsKReqWorkItemCv; /* * Local functions (prototypes) */ -static int HgfsKReqZCtor(void *mem, int size, void *arg, int flags); -static void HgfsKReqZDtor(void *mem, int size, void *arg); -static int HgfsKReqZInit(void *mem, int size, int flags); -static void HgfsKReqZFini(void *mem, int size); - + static int HgfsKReqZCtor(void *mem, int size, void *arg, int flags); + static void HgfsKReqZDtor(void *mem, int size, void *arg); + static int HgfsKReqZInit(void *mem, int size, int flags); + static void HgfsKReqZFini(void *mem, int size); /* * Global functions (definitions) @@ -84,7 +82,7 @@ * to abstract away the request allocation & support code. * * Results: - * None. + * Zero on success, HGFS_ERR on error. * * Side effects: * hgfsKReqZone is initialized. This routine may sleep. @@ -97,31 +95,40 @@ { int ret = 0; - hgfsKReqZone = uma_zcreate(HGFS_FS_NAME "_zone", - sizeof (struct HgfsKReqObject), - HgfsKReqZCtor, HgfsKReqZDtor, HgfsKReqZInit, - HgfsKReqZFini, UMA_ALIGN_PTR, 0); + hgfsKReqZone = os_zone_create(HGFS_FS_NAME "_zone", + sizeof (struct HgfsKReqObject), + HgfsKReqZCtor, HgfsKReqZDtor, HgfsKReqZInit, + HgfsKReqZFini, 0, 0); - /* uma_zcreate() may sleep, so it should never fail. */ - if (hgfsKReqZone == NULL) { - return ENOMEM; + if (!hgfsKReqZone) { + return HGFS_ERR; } - /* The following routines cannot fail. */ - mtx_init(&hgfsKReqWorkItemLock, HGFS_FS_NAME "_workmtx", NULL, MTX_DEF); - cv_init(&hgfsKReqWorkItemCv, HGFS_FS_NAME "_workcv"); + hgfsKReqWorkItemLock = os_mutex_alloc_init(HGFS_FS_NAME "_workmtx"); + if (!hgfsKReqWorkItemLock) { + os_zone_destroy(hgfsKReqZone); + return HGFS_ERR; + } + + /* + * This is a nop on OS X because we don't actually have a condition variable + * to initialize. + */ + os_cv_init(&hgfsKReqWorkItemCv, HGFS_FS_NAME "_workcv"); DblLnkLst_Init(&hgfsKReqWorkItemList); /* Spawn the worker thread. */ - ret = kthread_create(HgfsKReqWorker, &hgfsKReqWorkerState, - &hgfsKReqWorkerProc, 0, 0, "HgfsKReqWorker"); + ret = os_thread_create(HgfsKReqWorker, &hgfsKReqWorkerState, + "HgfsKReqWorker", &hgfsKReqWorkerThread); if (ret != 0) { - mtx_destroy(&hgfsKReqWorkItemLock); - cv_destroy(&hgfsKReqWorkItemCv); + os_cv_destroy(&hgfsKReqWorkItemCv); + os_zone_destroy(hgfsKReqZone); + os_mutex_free(hgfsKReqWorkItemLock); + return HGFS_ERR; } - return ret; + return 0; } @@ -145,27 +152,26 @@ int HgfsKReq_SysFini(void) { - int ret = 0; - /* Signal the worker thread to exit. */ - mtx_lock(&hgfsKReqWorkItemLock); + os_mutex_lock(hgfsKReqWorkItemLock); hgfsKReqWorkerState.exit = TRUE; - cv_signal(&hgfsKReqWorkItemCv); + os_cv_signal(&hgfsKReqWorkItemCv); /* - * Sleep until the worker thread exits. The PDROP flag indicates that - * hgfsKReqWorkItemLock should not be reacquired upon wakeup. + * Sleep until the worker thread exits. hgfsKReqWorkItemLock is release by + * by os_thread_join. */ - msleep(hgfsKReqWorkerProc, &hgfsKReqWorkItemLock, PDROP, "Hgfs Shutdown", 0); + os_thread_join(hgfsKReqWorkerThread, hgfsKReqWorkItemLock); /* * Destroy resources allocated during _SysInit(). */ - uma_zdestroy(hgfsKReqZone); - cv_destroy(&hgfsKReqWorkItemCv); - mtx_destroy(&hgfsKReqWorkItemLock); + os_thread_release(hgfsKReqWorkerThread); + os_zone_destroy(hgfsKReqZone); + os_cv_destroy(&hgfsKReqWorkItemCv); + os_mutex_free(hgfsKReqWorkItemLock); - return ret; + return 0; } @@ -177,7 +183,7 @@ * Allocate a request container for a single file system mount. * * Results: - * Pointer to a new allocation container. Always succeeds. + * Pointer to a new allocation container or NULL on failure. * * Side effects: * This routine may sleep. @@ -190,11 +196,17 @@ { HgfsKReqContainer *container; - /* Called with M_WAITOK, so this cannot fail. */ - container = malloc(sizeof (struct HgfsKReqContainer), M_HGFS, - M_WAITOK|M_ZERO); + container = os_malloc(sizeof (struct HgfsKReqContainer), M_WAITOK | M_ZERO); + if (!container) { + return NULL; + } + + container->listLock = os_mutex_alloc_init("hgfs_reql_mtx"); + if (!container->listLock) { + os_free(container, sizeof *container); + return NULL; + } - mtx_init(&container->listLock, "hgfs_reql_mtx", NULL, MTX_DEF); DblLnkLst_Init(&container->list); return container; @@ -224,8 +236,8 @@ ASSERT(container); ASSERT(DblLnkLst_IsLinked(&container->list) == FALSE); - mtx_destroy(&container->listLock); - free(container, M_HGFS); + os_mutex_free(container->listLock); + os_free(container, sizeof(*container)); } @@ -234,16 +246,16 @@ * * HgfsKReq_CancelRequests -- * - * Cancels all allocated requests by updating their status (set to - * HGFS_REQ_ERROR) and waking up any waiting clients. Also, if linked, - * removes any items from the work item list. + * Cancels all allocated requests by updating their status (set to + * HGFS_REQ_ERROR) and waking up any waiting clients. Also, if linked, + * removes any items from the work item list. * * Results: - * None. + * None. * * Side effects: - * This file system's entries are removed from the work item list are - * removed. + * This file system's entries are removed from the work item list are + * removed. * *---------------------------------------------------------------------------- */ @@ -251,8 +263,8 @@ void HgfsKReq_CancelRequests(HgfsKReqContainerHandle container) // IN: request container { - DblLnkLst_Links *currNode, *nextNode; - HgfsKReqObject *req; + DblLnkLst_Links *currNode; + DblLnkLst_Links *nextNode; DEBUG(VM_DEBUG_REQUEST, "HgfsCancelAllRequests().\n"); @@ -271,12 +283,13 @@ * 5. Unlock the file system's request list. */ - mtx_lock(&container->listLock); - mtx_lock(&hgfsKReqWorkItemLock); + os_mutex_lock(container->listLock); + os_mutex_lock(hgfsKReqWorkItemLock); DEBUG(VM_DEBUG_REQUEST, "HgfsCancelAllRequests(): traversing pending request list.\n"); DblLnkLst_ForEachSafe(currNode, nextNode, &container->list) { + HgfsKReqObject *req; Bool deref = FALSE; /* Get a pointer to the request represented by currNode. */ @@ -294,20 +307,20 @@ } /* Force this over to the error state & wake up any waiters. */ - mtx_lock(&req->stateLock); + os_mutex_lock(req->stateLock); req->state = HGFS_REQ_ERROR; - cv_signal(&req->stateCv); - mtx_unlock(&req->stateLock); + os_cv_signal(&req->stateCv); + os_mutex_unlock(req->stateLock); if (deref) { - if (atomic_fetchadd_int(&req->refcnt, -1) == 1) { - uma_zfree(hgfsKReqZone, req); + if (os_add_atomic(&req->refcnt, -1) == 1) { + os_zone_free(hgfsKReqZone, req); } } } - mtx_unlock(&hgfsKReqWorkItemLock); - mtx_unlock(&container->listLock); + os_mutex_unlock(hgfsKReqWorkItemLock); + os_mutex_unlock(container->listLock); DEBUG(VM_DEBUG_REQUEST, "HgfsCancelAllRequests() done.\n"); } @@ -337,9 +350,11 @@ ASSERT(container); - mtx_lock(&container->listLock); + os_mutex_lock(container->listLock); result = DblLnkLst_IsLinked(&container->list) ? FALSE : TRUE; - mtx_unlock(&container->listLock); + os_mutex_unlock(container->listLock); + + DEBUG(VM_DEBUG_REQUEST, "Container empty value: %d\n", result); return result; } @@ -350,33 +365,35 @@ * * HgfsKReq_AllocateRequest -- * - * Allocates and initializes a new request structure from the request pool. - * This function blocks until a request is available or it has been - * interrupted by a signal. + * Allocates and initializes a new request structure from the request pool. + * This function blocks until a request is available or it has been + * interrupted by a signal. * * Results: - * Pointer to fresh HgfsKReqObject. + * Pointer to fresh HgfsKReqObject or NULL on failure. * * Side effects: - * Request inserted into caller's requests container. This routine may - * sleep. + * Request inserted into caller's requests container. This routine may + * sleep. * *---------------------------------------------------------------------------- */ HgfsKReqObject * -HgfsKReq_AllocateRequest(HgfsKReqContainerHandle container) // IN: +HgfsKReq_AllocateRequest(HgfsKReqContainerHandle container) // IN { HgfsKReqObject *req; ASSERT(container); - /* Called with M_WAITOK, so this can not fail. */ - req = uma_zalloc(hgfsKReqZone, M_WAITOK); + req = os_zone_alloc(hgfsKReqZone, M_WAITOK); + if (!req) { + return NULL; + } - mtx_lock(&container->listLock); + os_mutex_lock(container->listLock); DblLnkLst_LinkLast(&container->list, &req->fsNode); - mtx_unlock(&container->listLock); + os_mutex_unlock(container->listLock); return req; } @@ -408,12 +425,12 @@ ASSERT(oldRequest); /* Dissociate request from this file system. */ - mtx_lock(&container->listLock); + os_mutex_lock(container->listLock); DblLnkLst_Unlink1(&oldRequest->fsNode); - mtx_unlock(&container->listLock); + os_mutex_unlock(container->listLock); /* State machine update */ - mtx_lock(&oldRequest->stateLock); + os_mutex_lock(oldRequest->stateLock); switch (oldRequest->state) { case HGFS_REQ_ALLOCATED: @@ -430,11 +447,11 @@ NOT_REACHED(); } - mtx_unlock(&oldRequest->stateLock); + os_mutex_unlock(oldRequest->stateLock); /* Dereference file system from request. If refcnt goes to zero, free. */ - if (atomic_fetchadd_int(&oldRequest->refcnt, -1) == 1) { - uma_zfree(hgfsKReqZone, oldRequest); + if (os_add_atomic(&oldRequest->refcnt, -1) == 1) { + os_zone_free(hgfsKReqZone, oldRequest); } DEBUG(VM_DEBUG_REQUEST, "%s done.\n", __func__); @@ -466,9 +483,8 @@ { int ret = 0; - DEBUG(VM_DEBUG_REQUEST, "HgfsEnqueueRequest().\n"); - ASSERT(newreq); + DEBUG(VM_DEBUG_REQUEST, "HgfsEnqueueRequest().\n"); /* * Insert request on pending request list, then alert of its arrival the @@ -476,7 +492,7 @@ * sure to bump its count before unlocking the list! */ - mtx_lock(&hgfsKReqWorkItemLock); + os_mutex_lock(hgfsKReqWorkItemLock); /* * With the work item list locked, lock our object and operate on its state. @@ -484,18 +500,19 @@ * system asynchronously cancelled all requests, it may be in ERROR instead. */ - mtx_lock(&newreq->stateLock); + os_mutex_lock(newreq->stateLock); switch (newreq->state) { case HGFS_REQ_ALLOCATED: /* * Update request's state, bump refcnt, and signal worker thread. */ + newreq->state = HGFS_REQ_SUBMITTED; - atomic_add_int(&newreq->refcnt, 1); + os_add_atomic(&newreq->refcnt, 1); DblLnkLst_LinkLast(&hgfsKReqWorkItemList, &newreq->pendingNode); - cv_signal(&hgfsKReqWorkItemCv); - mtx_unlock(&hgfsKReqWorkItemLock); + os_cv_signal(&hgfsKReqWorkItemCv); + os_mutex_unlock(hgfsKReqWorkItemLock); /* * NB: We're still holding this request's state lock for use with * cv_wait_sig. @@ -506,8 +523,8 @@ /* * Bail ASAP. */ - mtx_unlock(&newreq->stateLock); - mtx_unlock(&hgfsKReqWorkItemLock); + os_mutex_unlock(newreq->stateLock); + os_mutex_unlock(hgfsKReqWorkItemLock); return EIO; break; @@ -524,11 +541,11 @@ /* Sleep until request is processed or we're interrupted. */ while (newreq->state == HGFS_REQ_SUBMITTED && ret == 0) { - ret = cv_wait_sig(&newreq->stateCv, &newreq->stateLock); + ret = os_cv_wait(&newreq->stateCv, newreq->stateLock); } /* Okay, we're finished with the state lock for now. */ - mtx_unlock(&newreq->stateLock); + os_mutex_unlock(newreq->stateLock); return ret; } @@ -566,7 +583,8 @@ * * Return a pointer to the payload area of a request. Callers may write * Hgfs packet data directly to this area. It's guaranteed to hold at - * most HGFS_PACKET_MAX (6144) bytes. + * most HGFS_PACKET_MAX (6144) bytes. For Hgfs version 3, the caller should + * explicitly write request header (HgfsRequest) into this area. * * Results: * Pointer to the payload area. @@ -578,7 +596,7 @@ */ char * -HgfsKReq_GetPayload(HgfsKReqHandle request) // IN: +HgfsKReq_GetPayload(HgfsKReqHandle request) // IN: Request to get pointer to payload { ASSERT(request); @@ -631,7 +649,7 @@ void HgfsKReq_SetPayloadSize(HgfsKReqHandle request, // IN: Request object - size_t payloadSize) // IN: New payload size + size_t payloadSize) // IN: New payload size { ASSERT(request); ASSERT(payloadSize <= HGFS_PACKET_MAX); @@ -662,9 +680,9 @@ ASSERT(req); - mtx_lock(&req->stateLock); + os_mutex_lock(req->stateLock); state = req->state; - mtx_unlock(&req->stateLock); + os_mutex_unlock(req->stateLock); return state; } @@ -674,7 +692,6 @@ * Local functions (definitions) */ - /* *----------------------------------------------------------------------------- * @@ -716,8 +733,12 @@ */ req->id = (uint32_t)((unsigned long)req & 0xffffffff); req->state = HGFS_REQ_UNUSED; - mtx_init(&req->stateLock, "hgfs_req_mtx", NULL, MTX_DEF); - cv_init(&req->stateCv, "hgfs_req_cv"); + req->stateLock = os_mutex_alloc_init("hgfs_req_mtx"); + if (!req->stateLock) { + return ENOMEM; + } + + os_cv_init(&req->stateCv, "hgfs_req_cv"); /* Reset list pointers. */ DblLnkLst_Init(&req->fsNode); @@ -757,8 +778,8 @@ HgfsKReqObject *req = (HgfsKReqObject *)mem; ASSERT(size == sizeof *req); ASSERT(req->state == HGFS_REQ_UNUSED); - mtx_destroy(&req->stateLock); - cv_destroy(&req->stateCv); + os_mutex_free(req->stateLock); + os_cv_destroy(&req->stateCv); } @@ -835,3 +856,4 @@ req->state = HGFS_REQ_UNUSED; } + diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/request.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/request.h --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/request.h 2008-01-28 08:02:47.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/request.h 2008-10-13 08:01:44.000000000 +0100 @@ -77,10 +77,12 @@ extern uint32_t HgfsKReq_GetId(HgfsKReqHandle req); extern char * HgfsKReq_GetPayload(HgfsKReqHandle req); +extern char * HgfsKReq_GetPayload_V3(HgfsKReqHandle req); +extern char * HgfsKRep_GetPayload_V3(HgfsKReqHandle req); extern size_t HgfsKReq_GetPayloadSize(HgfsKReqHandle req); extern void HgfsKReq_SetPayloadSize(HgfsKReqHandle req, size_t newSize); -#endif /* __REQUEST_H_ */ +#endif /* _REQUEST_H_ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/requestInt.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/requestInt.h --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/requestInt.h 2008-01-28 08:02:47.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/requestInt.h 2008-10-13 08:01:44.000000000 +0100 @@ -29,12 +29,17 @@ #define INCLUDE_ALLOW_MODULE #include "includeCheck.h" -#include <sys/libkern.h> // common string, memcpy, etc userland routines -#include <vm/uma.h> // for the UMA (slab) allocator -#include <sys/kthread.h> // for kthread_create() +#if defined(__FreeBSD__) +# include <sys/libkern.h> // common string, memcpy, etc userland routines +# include <vm/uma.h> // for the UMA (slab) allocator +#elif defined(__APPLE__) +# include <string.h> +#endif + #include "vm_assert.h" +#include "os.h" #include "request.h" #include "debug.h" @@ -79,19 +84,20 @@ * drops the reference count, and if it reaches zero, frees the object. */ typedef struct HgfsKReqObject { - DblLnkLst_Links fsNode; /* Link between object and its parent file system. */ - DblLnkLst_Links pendingNode; /* Link between object and pending request list. */ + DblLnkLst_Links fsNode; // Link between object and its parent file system. + DblLnkLst_Links pendingNode; // Link between object and pending request list. - unsigned int refcnt; /* Object reference count */ - HgfsKReqState state; /* Indicates state of request */ - struct mtx stateLock; /* Protects state: ... */ - struct cv stateCv; /* Condition variable to wait for and signal - presence of reply. Used with the stateLock - above. */ - uint32_t id; /* The unique identifier of this request. - Typically set to the address of the HgfsKReq - object. */ - size_t payloadSize; /* Total size of payload */ + unsigned int refcnt; // Object reference count + HgfsKReqState state; // Indicates state of request + OS_MUTEX_T *stateLock; // Protects state: ... + OS_CV_T stateCv; // Condition variable to wait for and signal + // presence of reply. Used with the stateLock + // above. + + uint32_t id; // The unique identifier of this request. + // Typically set to the address of the HgfsKReq + // object. + size_t payloadSize; // Total size of payload /* * The file system is concerned only with the payload portion of an Hgfs * request packet, but the RPC message opens with the command string "f ". @@ -105,9 +111,9 @@ * muck with _payload. */ struct { - char _command[HGFS_CLIENT_CMD_LEN]; /* Typically "f ". */ - char _payload[HGFS_PACKET_MAX]; /* Contains both the request and - its reply. */ + char _command[HGFS_CLIENT_CMD_LEN]; // Typically "f ". + char _payload[HGFS_PACKET_MAX]; // Contains both the request and + // its reply. } __rpc_packet; } HgfsKReqObject; @@ -119,16 +125,16 @@ * only on a typedef'd handle. (See request.h.) */ typedef struct HgfsKReqContainer { - struct mtx listLock; - DblLnkLst_Links list; + OS_MUTEX_T *listLock; + DblLnkLst_Links list; } HgfsKReqContainer; /* * Current state & instruction for the HgfsKReq worker thread. */ typedef struct HgfsKReqWState { - Bool running; /* Is worker running? */ - Bool exit; /* Set this to TRUE at module unload time. */ + Bool running; // Is worker running? + Bool exit; // Set this to TRUE at module unload time. } HgfsKReqWState; @@ -136,26 +142,27 @@ * Module internal variables */ -/* UMA zone (slab) for allocating HgfsKReqs. */ -extern uma_zone_t hgfsKReqZone; - /* Workitem list anchor */ extern DblLnkLst_Links hgfsKReqWorkItemList; -/* Workitem list lock and conditional variable */ -extern struct mtx hgfsKReqWorkItemLock; -extern struct cv hgfsKReqWorkItemCv; +/* Workitem list lock. */ +extern OS_MUTEX_T *hgfsKReqWorkItemLock; + +extern OS_CV_T hgfsKReqWorkItemCv; + +/* UMA zone (slab) for allocating HgfsKReqs. */ +extern OS_ZONE_T *hgfsKReqZone; /* Process structure for the worker thread */ -extern struct proc * hgfsKReqWorkerProc; -extern HgfsKReqWState hgfsKReqWorkerState; +extern OS_THREAD_T hgfsKReqWorkerThread; +extern HgfsKReqWState hgfsKReqWorkerState; /* * Function prototypes */ -extern void HgfsKReqWorker(void *arg); +extern void HgfsKReqWorker(void *arg); #endif // ifndef _requestInt_H_ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/rpcout.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/rpcout.c --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/rpcout.c 2008-01-28 08:02:47.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/rpcout.c 2008-10-13 08:01:44.000000000 +0100 @@ -293,10 +293,13 @@ } /* - * If the command doesn't contain a space, add one to the - * end to maintain compatibility with old VMXs. + * If the command doesn't contain a space, add one to the end to maintain + * compatibility with old VMXs. * - * XXX Do we still need to bother with this? + * 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; @@ -346,7 +349,8 @@ * 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. + * 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 diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/sha1.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/sha1.c --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/sha1.c 2008-01-28 08:02:47.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/sha1.c 2008-10-13 08:01:44.000000000 +0100 @@ -37,11 +37,11 @@ #if defined(USERLEVEL) || defined(_WIN32) # include <string.h> # if defined(_WIN32) -# include <memory.h> +# include <memory.h> # endif #endif -#if defined(sun) && defined(SOL10) +#if defined(sun) && !defined(SOL9) #include <memory.h> #endif @@ -56,11 +56,14 @@ #if defined(__APPLE__) # include <string.h> -#endif +#endif #ifdef USERLEVEL #include "vmware.h" #endif +#ifdef VMKBOOT +#include "vm_libc.h" +#endif #include "sha1.h" #include "vm_basic_asm.h" @@ -72,10 +75,6 @@ #define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits)))) -#if defined(_WIN32) -#define Bswap(x) ((rol((x), 24) & 0xff00ff00) | (rol((x), 8) & 0x00ff00ff)) -#endif - #define F0(w,x,y) ((w&(x^y))^y) #define F1(w,x,y) (w^x^y) #define F2(w,x,y) (((w|x)&y)|(w&x)) @@ -109,7 +108,7 @@ round = 0xCA62C1D6 + F3(b,c,d); } if (i < 16) { -#ifdef LITTLE_ENDIAN +#ifdef LITTLE_ENDIAN blk = Bswap(block->l[i]); #else blk = block->l[i]; @@ -124,7 +123,7 @@ /* Hash a single 512-bit block. This is the core of the algorithm. */ -static void +static void _SHA1Transform(uint32 state[5], unsigned char buffer[64]) { int i; diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/sha1.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/sha1.h --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/sha1.h 2008-01-28 08:02:47.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/sha1.h 2008-10-13 08:01:44.000000000 +0100 @@ -28,6 +28,7 @@ #define INCLUDE_ALLOW_USERLEVEL #define INCLUDE_ALLOW_VMMEXT #define INCLUDE_ALLOW_VMCORE +#define INCLUDE_ALLOW_VMNIXMOD #include "includeCheck.h" /* for uint32 */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/state.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/state.c --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/state.c 2008-01-28 08:02:47.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/state.c 2008-10-13 08:01:44.000000000 +0100 @@ -24,17 +24,27 @@ #include <sys/param.h> #include <sys/types.h> -#include <sys/malloc.h> -#include <sys/libkern.h> #include <sys/queue.h> -#include <sys/lock.h> -#include <sys/mutex.h> +#include <sys/fcntl.h> + +#if defined(__FreeBSD__) +# include <sys/libkern.h> +# include <sys/malloc.h> +# include "sha1.h" +# include "compat_freebsd.h" +#elif defined(__APPLE__) +# include <string.h> +/* + * The OS X kernel includes the same exact SHA1 routines as those + * provided by bora/lib/misc. Use the kernel ones under OS X. + */ +# include <libkern/crypto/sha1.h> +#endif #include "hgfs_kernel.h" #include "state.h" #include "debug.h" -#include "sha1.h" - +#include "os.h" /* * Macros @@ -45,31 +55,30 @@ #define HGFS_IS_ROOT_FILE(sip, file) (HGFS_VP_TO_FP(sip->rootVnode) == file) +#if defined(__APPLE__) +# define SHA1_HASH_LEN SHA_DIGEST_LENGTH +#endif /* * Local functions (prototypes) */ -/* Internal version of a public function, to allow bypassing htp locking as needed */ static int HgfsVnodeGetInt(struct vnode **vpp, - struct HgfsSuperInfo *sip, - struct mount *vfsp, - struct vop_vector *vopp, - const char *fileName, - HgfsFileType fileType, - HgfsFileHashTable *htp, - Bool lockHtp); + struct HgfsSuperInfo *sip, + struct mount *vfsp, + const char *fileName, + HgfsFileType fileType, + HgfsFileHashTable *htp, + Bool rootVnode); /* Allocation/initialization/free of open file state */ static HgfsOpenFile *HgfsAllocOpenFile(const char *fileName, HgfsFileType fileType, - HgfsFileHashTable *htp, - Bool lockHtp); + HgfsFileHashTable *htp); static void HgfsFreeOpenFile(HgfsOpenFile *ofp, HgfsFileHashTable *htp); /* Acquiring/releasing file state */ static HgfsFile *HgfsGetFile(const char *fileName, HgfsFileType fileType, - HgfsFileHashTable *htp, - Bool lockHtp); + HgfsFileHashTable *htp); static void HgfsReleaseFile(HgfsFile *fp, HgfsFileHashTable *htp); static int HgfsInitFile(HgfsFile *fp, const char *fileName, HgfsFileType fileType); @@ -82,8 +91,6 @@ static unsigned int HgfsFileNameHash(const char *fileName); static void HgfsNodeIdHash(const char *fileName, uint32_t fileNameLength, ino_t *outHash); - - /* * Global functions */ @@ -93,19 +100,19 @@ * * HgfsVnodeGet -- * - * Creates a vnode for the provided filename. + * Creates a vnode for the provided filename. * - * This will always allocate a vnode and HgfsOpenFile. If a HgfsFile - * already exists for this filename then that is used, if a HgfsFile doesn't - * exist, one is created. + * This will always allocate a vnode and HgfsOpenFile. If a HgfsFile + * already exists for this filename then that is used, if a HgfsFile doesn't + * exist, one is created. * * Results: - * Returns 0 on success and a non-zero error code on failure. The new - * vnode is returned locked. + * Returns 0 on success and a non-zero error code on failure. The new + * vnode is returned locked. * * Side effects: - * If the HgfsFile already exists, its reference count is incremented; - * otherwise a HgfsFile is created. + * If the HgfsFile already exists, its reference count is incremented; + * otherwise a HgfsFile is created. * *---------------------------------------------------------------------------- */ @@ -114,153 +121,88 @@ HgfsVnodeGet(struct vnode **vpp, // OUT: Filled with address of created vnode HgfsSuperInfo *sip, // IN: Superinfo struct mount *vfsp, // IN: Filesystem structure - struct vop_vector *vopp, // IN: Vnode operations vector const char *fileName, // IN: Name of this file HgfsFileType fileType, // IN: Type of file HgfsFileHashTable *htp) // IN: File hash table { - return HgfsVnodeGetInt(vpp, sip, vfsp, vopp, fileName, fileType, htp, TRUE); + return HgfsVnodeGetInt(vpp, sip, vfsp, fileName, fileType, htp, FALSE); } /* *---------------------------------------------------------------------------- * - * HgfsVnodePut -- - * - * Releases the provided vnode. + * HgfsVnodeGetRoot -- * - * This will always free both the vnode and its associated HgfsOpenFile. - * The HgfsFile's reference count is decremented and, if 0, freed. + * Creates a root vnode. This should only be called by the VFS mount + * function when the filesystem is first being mounted. * * Results: - * Returns 0 on success and a non-zero error code on failure. + * Returns 0 on success and a non-zero error code on failure. The new + * vnode is returned locked on FreeBSD. * * Side effects: - * + * None. * *---------------------------------------------------------------------------- */ int -HgfsVnodePut(struct vnode *vp, // IN: Vnode to release - HgfsFileHashTable *htp) // IN: Hash table pointer +HgfsVnodeGetRoot(struct vnode **vpp, // OUT: Filled with address of created vnode + HgfsSuperInfo *sip, // IN: Superinfo + struct mount *vfsp, // IN: Filesystem structure + const char *fileName, // IN: Name of this file + HgfsFileType fileType, // IN: Type of file + HgfsFileHashTable *htp) // IN: File hash table { - HgfsOpenFile *ofp; - - ASSERT(vp); - ASSERT(htp); - - /* Get our private open-file state. */ - ofp = HGFS_VP_TO_OFP(vp); - if (!ofp) { // XXX Maybe ASSERT() this? - return HGFS_ERR; - } - - /* - * We need to free the open file structure. This takes care of releasing - * our reference on the underlying file structure (and freeing it if - * necessary). - */ - HgfsFreeOpenFile(ofp, htp); - - return 0; + return HgfsVnodeGetInt(vpp, sip, vfsp, fileName, fileType, htp, TRUE); } /* *---------------------------------------------------------------------------- * - * HgfsVnodeDup -- - * - * Duplicates the vnode and HgfsOpenFile (per-open state) of a file and - * increments the reference count of the underlying HgfsFile. This function - * just calls HgfsVnodeGet with the right arguments. - * - * Results: - * Returns 0 on success and a non-zero error code on failure. On success - * the address of the duplicated vnode is written to newVpp. - * - * Side effects: - * The HgfsFile for origVp will have an additional reference. - * - *---------------------------------------------------------------------------- - */ - -int -HgfsVnodeDup(struct vnode **newVpp, // OUT: Given address of new vnode - struct vnode *origVp, // IN: Vnode to duplicate - struct HgfsSuperInfo *sip, // IN: Superinfo pointer - HgfsFileHashTable *htp) // IN: File hash table -{ - ASSERT(newVpp); - ASSERT(origVp); - ASSERT(sip); - ASSERT(htp); - - DEBUG(VM_DEBUG_ALWAYS, "HgfsVnodeDup: duping %s\n", HGFS_VP_TO_FILENAME(origVp)); - - return HgfsVnodeGet(newVpp, sip, origVp->v_mount, origVp->v_op, - HGFS_VP_TO_FILENAME(origVp), HGFS_VP_TO_HGFSFILETYPE(origVp), - &sip->fileHashTable); -} - - -/* - *---------------------------------------------------------------------------- + * HgfsVnodePut -- * - * HgfsFileNameToVnode -- + * Releases the provided vnode. * - * Allocates new per-open-file state if a HgfsFile for fileName exists in - * the provided file hash table. + * This will free the associated vnode. + * The HgfsFile's reference count is decremented and, if 0, freed. * * Results: - * Returns 0 on success or a non-zero error code on failure. On success, - * vpp is filled with the address of the new per-open state. + * Returns 0 on success and a non-zero error code on failure. * * Side effects: - * The reference count of the HgfsFile for fileName is incremented if it - * exists. + * * *---------------------------------------------------------------------------- */ int -HgfsFileNameToVnode(const char *fileName, // IN: Name of the file to look up - struct vnode **vpp, // OUT: Address of created vnode - struct HgfsSuperInfo *sip, // IN: Superinfo pointer - struct mount *vfsp, // IN: Filesystem structure - HgfsFileHashTable *htp) // IN: File hash table +HgfsVnodePut(struct vnode *vp, // IN: Vnode to release + HgfsFileHashTable *htp) // IN: Hash table pointer { - HgfsFile *fp; - int retval; + HgfsOpenFile *ofp; - ASSERT(vpp); - ASSERT(sip); - ASSERT(vfsp); - ASSERT(fileName); + ASSERT(vp); ASSERT(htp); - DEBUG(VM_DEBUG_ALWAYS, "HgfsFileNameToVnode: looking for %s\n", fileName); - - mtx_lock(&htp->mutex); + DEBUG(VM_DEBUG_ENTRY, "Entering HgfsVnodePut\n"); - fp = HgfsFindFile(fileName, htp); - if (!fp) { - mtx_unlock(&htp->mutex); + /* Get our private open-file state. */ + ofp = HGFS_VP_TO_OFP(vp); + if (!ofp) { return HGFS_ERR; } - /* Guaranteed by HgfsFindFile(). */ - ASSERT(strcmp(fileName, fp->fileName) == 0); - - retval = HgfsVnodeGetInt(vpp, sip, vfsp, sip->rootVnode->v_op, fileName, fp->fileType, - htp, FALSE); - mtx_unlock(&htp->mutex); - - DEBUG(VM_DEBUG_ALWAYS, "HgfsFileNameToVnode: found %s\n", fileName); + /* + * We need to free the open file structure. This takes care of releasing + * our reference on the underlying file structure (and freeing it if + * necessary). + */ + HgfsFreeOpenFile(ofp, htp); - return retval; + return 0; } @@ -269,40 +211,40 @@ * * HgfsNodeIdGet -- * - * Gets the node id for the provided file. This will only calculate the - * node id again if a per-file state structure doesn't yet exist for this - * file. (This situation exists on a readdir since dentries are filled in - * rather than creating vnodes.) - * - * In Solaris, node ids are provided in vnodes and inode numbers are - * provided in dentries. For applications to work correctly, we must make - * sure that the inode number of a file's dentry and the node id in a file's - * vnode match one another. This poses a problem since vnodes typically do - * not exist when dentries need to be created, and once a dentry is created - * we have no reference to it since it is copied to the user and freed from - * kernel space. An example of a program that breaks when these values - * don't match is /usr/bin/pwd. This program first acquires the node id of - * "." from its vnode, then traverses backwards to ".." and looks for the - * dentry in that directory with the inode number matching the node id. - * (This is how it obtains the name of the directory it was just in.) - * /usr/bin/pwd repeats this until it reaches the root directory, at which - * point it concatenates the filenames it acquired along the way and - * displays them to the user. When inode numbers don't match the node id, - * /usr/bin/pwd displays an error saying it cannot determine the directory. - * - * The Hgfs protocol does not provide us with unique identifiers for files - * since it must support filesystems that do not have the concept of inode - * numbers. Therefore, we must maintain a mapping from filename to node id/ - * inode numbers. This is done in a stateless manner by calculating the - * SHA-1 hash of the filename. All points in the Hgfs code that need a node - * id/inode number obtain it by either calling this function or directly - * referencing the saved node id value in the vnode, if one is available. + * Gets the node id for the provided file. This will only calculate the + * node id again if a per-file state structure doesn't yet exist for this + * file. (This situation exists on a readdir since dentries are filled in + * rather than creating vnodes.) + * + * In Solaris, node ids are provided in vnodes and inode numbers are + * provided in dentries. For applications to work correctly, we must make + * sure that the inode number of a file's dentry and the node id in a file's + * vnode match one another. This poses a problem since vnodes typically do + * not exist when dentries need to be created, and once a dentry is created + * we have no reference to it since it is copied to the user and freed from + * kernel space. An example of a program that breaks when these values + * don't match is /usr/bin/pwd. This program first acquires the node id of + * "." from its vnode, then traverses backwards to ".." and looks for the + * dentry in that directory with the inode number matching the node id. + * (This is how it obtains the name of the directory it was just in.) + * /usr/bin/pwd repeats this until it reaches the root directory, at which + * point it concatenates the filenames it acquired along the way and + * displays them to the user. When inode numbers don't match the node id, + * /usr/bin/pwd displays an error saying it cannot determine the directory. + * + * The Hgfs protocol does not provide us with unique identifiers for files + * since it must support filesystems that do not have the concept of inode + * numbers. Therefore, we must maintain a mapping from filename to node id/ + * inode numbers. This is done in a stateless manner by calculating the + * SHA-1 hash of the filename. All points in the Hgfs code that need a node + * id/inode number obtain it by either calling this function or directly + * referencing the saved node id value in the vnode, if one is available. * * Results: - * None. + * None. * * Side effects: - * None. + * None. * *---------------------------------------------------------------------------- */ @@ -319,7 +261,7 @@ ASSERT(fileName); ASSERT(outNodeId); - mtx_lock(&htp->mutex); + os_mutex_lock(htp->mutex); fp = HgfsFindFile(fileName, htp); if (fp) { @@ -328,7 +270,7 @@ HgfsNodeIdHash(fileName, fileNameLength, outNodeId); } - mtx_unlock(&htp->mutex); + os_mutex_unlock(htp->mutex); } @@ -337,13 +279,13 @@ * * HgfsInitFileHashTable -- * - * Initializes the hash table used to track per-file state. + * Initializes the hash table used to track per-file state. * * Results: - * Returns 0 on success and a non-zero error code on failure. + * Returns 0 on success and a non-zero error code on failure. * * Side effects: - * None. + * None. * *---------------------------------------------------------------------------- */ @@ -355,7 +297,10 @@ ASSERT(htp); - mtx_init(&htp->mutex, "HgfsHashChain", NULL, MTX_DEF); + htp->mutex = os_mutex_alloc_init("HgfsHashChain"); + if (!htp->mutex) { + return HGFS_ERR; + } for (i = 0; i < ARRAYSIZE(htp->hashTable); i++) { DblLnkLst_Init(&htp->hashTable[i]); @@ -365,11 +310,27 @@ } +/* + *---------------------------------------------------------------------------- + * + * HgfsDestroyFileHashTable -- + * + * Cleanup the hash table used to track per-file state. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + void HgfsDestroyFileHashTable(HgfsFileHashTable *htp) { ASSERT(htp); - mtx_destroy(&htp->mutex); + os_mutex_free(htp->mutex); } @@ -378,19 +339,19 @@ * * HgfsFileHashTableIsEmpty -- * - * Determines whether the hash table is in an acceptable state to unmount - * the file system. + * Determines whether the hash table is in an acceptable state to unmount + * the file system. * - * Note that this is not strictly empty: if the only file in the table is - * the root of the filesystem and its reference count is 1, this is - * considered empty since this is part of the operation of unmounting the - * filesystem. + * Note that this is not strictly empty: if the only file in the table is + * the root of the filesystem and its reference count is 1, this is + * considered empty since this is part of the operation of unmounting the + * filesystem. * * Results: - * Returns 0 on success and a non-zero error code on failure. + * Returns TRUE if the hash table is empty and false otherwise. * * Side effects: - * None. + * None. * *---------------------------------------------------------------------------- */ @@ -404,7 +365,7 @@ ASSERT(sip); ASSERT(htp); - mtx_lock(&htp->mutex); + os_mutex_lock(htp->mutex); /* Traverse each bucket. */ for (i = 0; i < ARRAYSIZE(htp->hashTable); i++) { @@ -426,24 +387,24 @@ * someone calls HgfsRoot(), we return that vnode. */ if (HGFS_IS_ROOT_FILE(sip, currFile)) { - VI_LOCK(sip->rootVnode); - if (sip->rootVnode->v_usecount <= 1) { - VI_UNLOCK(sip->rootVnode); + HGFS_VP_VI_LOCK(sip->rootVnode); + if (!HGFS_VP_ISINUSE(sip->rootVnode, 1)) { + HGFS_VP_VI_UNLOCK(sip->rootVnode); /* This file is okay; skip to the next one. */ currNode = currNode->next; continue; } - DEBUG(VM_DEBUG_FAIL, "HgfsFileHashTableIsEmpty: %s has count of %d.\n", - currFile->fileName, sip->rootVnode->v_usecount); + DEBUG(VM_DEBUG_FAIL, "HgfsFileHashTableIsEmpty: %s is in use.\n", + currFile->fileName); - VI_UNLOCK(sip->rootVnode); + HGFS_VP_VI_UNLOCK(sip->rootVnode); /* Fall through to failure case */ } /* Fail if a file is found. */ - mtx_unlock(&htp->mutex); + os_mutex_unlock(htp->mutex); DEBUG(VM_DEBUG_FAIL, "HgfsFileHashTableIsEmpty: %s " "still in use (file count=%d).\n", currFile->fileName, currFile->refCount); @@ -451,7 +412,7 @@ } } - mtx_unlock(&htp->mutex); + os_mutex_unlock(htp->mutex); return TRUE; } @@ -462,23 +423,23 @@ * * HgfsHandleIsSet -- * - * Determines whether handle of the vnode's open file is currently set. + * Determines whether one of vnode's open file handles is currently set. * * Results: - * Returns TRUE if the handle is set, FALSE if the handle is not set. - * HGFS_ERR is returned on error. + * Returns TRUE if the handle is set, FALSE if the handle is not set. + * HGFS_ERR is returned on error. * * Side effects: - * None. + * None. * *---------------------------------------------------------------------------- */ Bool -HgfsHandleIsSet(struct vnode *vp) // IN: Vnode to check handle of +HgfsHandleIsSet(struct vnode *vp) // IN: Vnode to check handle of { HgfsOpenFile *ofp; - Bool isSet; + Bool ret; ASSERT(vp); @@ -487,34 +448,37 @@ return HGFS_ERR; } - mtx_lock(&ofp->handleMutex); - isSet = ofp->handleIsSet; - mtx_unlock(&ofp->handleMutex); + os_mutex_lock(ofp->handleMutex); - return isSet; -} + ret = ofp->handleRefCount ? TRUE : FALSE; + + os_mutex_unlock(ofp->handleMutex); + + return ret; + } /* *---------------------------------------------------------------------------- * - * HgfsSetOpenFileHandle -- + * HgfsHandleIncrementRefCount -- * - * Sets the open file handle for the provided vnode. + * Increments the reference count of the specified handle associated with + * the vnode (vp). * * Results: - * Returns 0 on success and a non-zero error code on failure. + * Returns 0 on success and HGFS_ERR on error. * * Side effects: - * The handle may not be set again until it is cleared. + * None. * *---------------------------------------------------------------------------- */ int -HgfsSetOpenFileHandle(struct vnode *vp, // IN: Vnode to set handle for - HgfsHandle handle) // IN: Value of handle +HgfsHandleIncrementRefCount(struct vnode *vp) // IN { + int ret = 0; HgfsOpenFile *ofp; ASSERT(vp); @@ -524,24 +488,69 @@ return HGFS_ERR; } - mtx_lock(&ofp->handleMutex); + os_mutex_lock(ofp->handleMutex); + + ++ofp->handleRefCount; + + os_mutex_unlock(ofp->handleMutex); + + return ret; +} - if (ofp->handleIsSet) { - DEBUG(VM_DEBUG_FAIL, "**HgfsSetOpenFileHandle: handle for %s already set to %d; " - "cannot set to %d\n", HGFS_VP_TO_FILENAME(vp), ofp->handle, handle); - mtx_unlock(&ofp->handleMutex); + +/* + *---------------------------------------------------------------------------- + * + * HgfsSetOpenFileHandle -- + * + * Sets the file handle for the provided vnode if it has reference count + * equal to zero. The reference count of the handle must be increased when + * the handle is set. This is done with HgfsHandleIsSet. + * + * Results: + * Returns 0 on success and a non-zero error code on failure. + * + * Side effects: + * The handle may not be set again until it is cleared. + * + *---------------------------------------------------------------------------- + */ + +int +HgfsSetOpenFileHandle(struct vnode *vp, // IN: Vnode to set handle for + HgfsHandle handle) // IN: Value of handle +{ + int ret = 0; + HgfsOpenFile *ofp; + + ASSERT(vp); + + ofp = HGFS_VP_TO_OFP(vp); + if (!ofp) { return HGFS_ERR; } + os_mutex_lock(ofp->handleMutex); + + if (ofp->handleRefCount != 0) { + ret = HGFS_ERR; + goto out; + } + ++ofp->handleRefCount; ofp->handle = handle; - ofp->handleIsSet = TRUE; DEBUG(VM_DEBUG_STATE, "HgfsSetOpenFileHandle: set handle for %s to %d\n", HGFS_VP_TO_FILENAME(vp), ofp->handle); - mtx_unlock(&ofp->handleMutex); +out: + os_mutex_unlock(ofp->handleMutex); - return 0; + if (ret) { + DEBUG(VM_DEBUG_FAIL, "could not set file handle for %s\n", + HGFS_VP_TO_FILENAME(vp)); + } + + return ret; } @@ -550,23 +559,24 @@ * * HgfsGetOpenFileHandle -- * - * Gets the open file handle for the provided vnode. + * Gets the file handle for the provided vnode. * * Results: - * Returns 0 on success and a non-zero error code on failure. On success, - * the value of the vnode's handle is placed in outHandle. + * Returns 0 on success and a non-zero error code on failure. On success, + * the value of the vnode's handle is placed in outHandle. * * Side effects: - * None. + * None. * *---------------------------------------------------------------------------- */ int -HgfsGetOpenFileHandle(struct vnode *vp, // IN: Vnode to get handle for - HgfsHandle *outHandle) // OUT: Filled with value of handle +HgfsGetOpenFileHandle(struct vnode *vp, // IN: Vnode to get handle for + HgfsHandle *outHandle) // OUT: Filled with value of handle { HgfsOpenFile *ofp; + int ret = 0; ASSERT(vp); ASSERT(outHandle); @@ -576,42 +586,43 @@ return HGFS_ERR; } - mtx_lock(&ofp->handleMutex); + os_mutex_lock(ofp->handleMutex); - if (!ofp->handleIsSet) { - DEBUG(VM_DEBUG_FAIL, "**HgfsGetOpenFileHandle: handle for %s is not set.\n", - HGFS_VP_TO_FILENAME(vp)); - mtx_unlock(&ofp->handleMutex); - return HGFS_ERR; + if (ofp->handleRefCount == 0) { + os_mutex_unlock(ofp->handleMutex); + ret = HGFS_ERR; } *outHandle = ofp->handle; - mtx_unlock(&ofp->handleMutex); + os_mutex_unlock(ofp->handleMutex); - return 0; + return ret; } /* *---------------------------------------------------------------------------- * - * HgfsClearOpenFileHandle -- + * HgfsReleaseOpenFileHandle -- * - * Clears the open file handle for the provided vnode. + * Decrements the reference count of one of the handles for the provided + * vnode. If the reference count becomes zero, then the handle is cleared. * * Results: - * Returns 0 on success and a non-zero error code on failure. + * Returns 0 on success and a non-zero error code on failure. * * Side effects: - * The handle may be set. + * The handle may be cleared. * *---------------------------------------------------------------------------- */ int -HgfsClearOpenFileHandle(struct vnode *vp) // IN: Vnode to clear handle for +HgfsReleaseOpenFileHandle(struct vnode *vp, // IN + Bool *closed) // OUT { + int ret = 0; HgfsOpenFile *ofp; ASSERT(vp); @@ -621,17 +632,72 @@ return HGFS_ERR; } - mtx_lock(&ofp->handleMutex); + *closed = FALSE; - ofp->handle = 0; - ofp->handleIsSet = FALSE; + os_mutex_lock(ofp->handleMutex); - DEBUG(VM_DEBUG_STATE, "HgfsClearOpenFileHandle: cleared %s's handle\n", - HGFS_VP_TO_FILENAME(vp)); + /* Make sure the reference count is not going negative! */ + ASSERT(ofp->handleRefCount > 0); - mtx_unlock(&ofp->handleMutex); + --ofp->handleRefCount; - return 0; + /* If the reference count has gone to zero, clear the handle. */ + if (ofp->handleRefCount == 0) { + DEBUG(VM_DEBUG_LOG, "closing directory handle\n"); + ofp->handle = 0; + *closed = TRUE; + } else { + DEBUG(VM_DEBUG_LOG, "ReleaseOpenFileHandle with a refcount of: %d\n", + ofp->handleRefCount); + } + + os_mutex_unlock(ofp->handleMutex); + + return ret; +} + + +/* + *---------------------------------------------------------------------------- + * + * HgfsShouldCloseOpenFileHandle -- + * + * Checks to see if the next call to HgfsReleaseOpenFileHandle will result in + * the file handle being cleared. + * + * Results: + * Returns TRUE if the file handle will be cleared on the next + * HgfsReleaseOpenFileHandle call and FALSE otherwise. + * Returns HGFS_ERR if an error was encountered. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +Bool +HgfsShouldCloseOpenFileHandle(struct vnode *vp) // IN: Vnode to clear handle for +{ + HgfsOpenFile *ofp; + + ASSERT(vp); + + ofp = HGFS_VP_TO_OFP(vp); + if (!ofp) { + return HGFS_ERR; + } + + os_mutex_lock(ofp->handleMutex); + + if (ofp->handleRefCount == 1) { + os_mutex_unlock(ofp->handleMutex); + return TRUE; + } + + os_mutex_unlock(ofp->handleMutex); + + return FALSE; } @@ -640,13 +706,13 @@ * * HgfsSetOpenFileMode -- * - * Sets the mode of the open file for the provided vnode. + * Sets the mode of the open file for the provided vnode. * * Results: - * Returns 0 on success and a non-zero error code on failure. + * Returns 0 on success and a non-zero error code on failure. * * Side effects: - * The mode may not be set again until cleared. + * The mode may not be set again until cleared. * *---------------------------------------------------------------------------- */ @@ -664,12 +730,12 @@ return HGFS_ERR; } - mtx_lock(&ofp->modeMutex); + os_mutex_lock(ofp->modeMutex); if (ofp->modeIsSet) { DEBUG(VM_DEBUG_FAIL, "**HgfsSetOpenFileMode: mode for %s already set to %d; " "cannot set to %d\n", HGFS_VP_TO_FILENAME(vp), ofp->mode, mode); - mtx_unlock(&ofp->modeMutex); + os_mutex_unlock(ofp->modeMutex); return HGFS_ERR; } @@ -679,7 +745,7 @@ DEBUG(VM_DEBUG_STATE, "HgfsSetOpenFileMode: set mode for %s to %d\n", HGFS_VP_TO_FILENAME(vp), ofp->mode); - mtx_unlock(&ofp->modeMutex); + os_mutex_unlock(ofp->modeMutex); return 0; } @@ -690,13 +756,13 @@ * * HgfsGetOpenFileMode -- * - * Gets the mode of the open file for the provided vnode. + * Gets the mode of the file for the provided vnode. * * Results: - * Returns 0 on success and a non-zero error code on failure. + * Returns 0 on success and a non-zero error code on failure. * * Side effects: - * None. + * None. * *---------------------------------------------------------------------------- */ @@ -715,16 +781,16 @@ return HGFS_ERR; } - mtx_lock(&ofp->modeMutex); + os_mutex_lock(ofp->modeMutex); if (!ofp->modeIsSet) { - mtx_unlock(&ofp->modeMutex); + os_mutex_unlock(ofp->modeMutex); return HGFS_ERR; } *outMode = ofp->mode; - mtx_unlock(&ofp->modeMutex); + os_mutex_unlock(ofp->modeMutex); return 0; } @@ -735,13 +801,13 @@ * * HgfsClearOpenFileMode -- * - * Clears the mode of the open file for the provided vnode. + * Clears the mode of the file for the provided vnode. * * Results: - * Returns 0 on success and a non-zero error code on failure. + * Returns 0 on success and a non-zero error code on failure. * * Side effects: - * The mode may be set again. + * The mode may be set again. * *---------------------------------------------------------------------------- */ @@ -758,21 +824,177 @@ return HGFS_ERR; } - mtx_lock(&ofp->modeMutex); + os_mutex_lock(ofp->modeMutex); ofp->mode = 0; ofp->modeIsSet = FALSE; - DEBUG(VM_DEBUG_STATE, "HgfsClearOpenFileMode: cleared %s's mode\n", + DEBUG(VM_DEBUG_STATE, "HgfsClearOpenOpenFileMode: cleared %s's mode\n", HGFS_VP_TO_FILENAME(vp)); - mtx_unlock(&ofp->modeMutex); + os_mutex_unlock(ofp->modeMutex); return 0; } /* + *---------------------------------------------------------------------------- + * + * HgfsFileLock -- + * + * Locks the HgfsFile associated with the vnode (vp). The type specifies is + * we are locking for reads or writes. We only lock the HgfsFile on OS X + * because FreeBSD vnodes are locked when handed to the VFS layer and there + * is a 1:1 mapping between vnodes and HgfsFile objects so no extra locking + * is required. + * + * Results: + * Returns 0 on success and an error code on error. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +int +HgfsFileLock(struct vnode *vp, // IN: Vnode to lock + HgfsLockType type) // IN: Reader or Writer lock? +{ +#if defined(__APPLE__) + HgfsOpenFile *ofp; + + ASSERT(vp); + + ofp = HGFS_VP_TO_OFP(vp); + if (!ofp) { + return HGFS_ERR; + } + + return HgfsFileLockOfp(ofp, type); +#else + NOT_IMPLEMENTED(); +#endif +} + + +/* + *---------------------------------------------------------------------------- + * + * HgfsFileUnlock -- + * + * Unlocks the HgfsFile associated with the vnode (vp). Results are + * undefined the type of lock specified is different than the one that the + * vnode was locked with originally. + * + * Results: + * Returns 0 on success and an error code on error. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +int +HgfsFileUnlock(struct vnode *vp, // IN: Vnode to unlock + HgfsLockType type) // IN: Reader or Writer lock? +{ +#if defined(__APPLE__) + HgfsOpenFile *ofp; + + ASSERT(vp); + + ofp = HGFS_VP_TO_OFP(vp); + if (!ofp) { + return HGFS_ERR; + } + + return HgfsFileUnlockOfp(ofp, type); +#else + NOT_IMPLEMENTED(); +#endif +} + + +/* + *---------------------------------------------------------------------------- + * + * HgfsFileLockOfp -- + * + * Locks the HgfsFile associated with the HgfsOpenFile. This funciton should + * only be called by HgfsFileLock + * + * Results: + * Returns 0 on success and an error code on error. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +int +HgfsFileLockOfp(HgfsOpenFile *ofp, // IN: HgfsOpenFile to lcok + HgfsLockType type) // IN: Reader or Writer lock? +{ +#if defined(__APPLE__) + ASSERT(ofp); + + if (type == HGFS_READER_LOCK) { + os_rw_lock_lock_shared(ofp->rwFileLock); + } else if (type == HGFS_WRITER_LOCK) { + os_rw_lock_lock_exclusive(ofp->rwFileLock); + } else { + return HGFS_ERR; + } + return 0; +#else + NOT_IMPLEMENTED(); +#endif +} + + +/* + *---------------------------------------------------------------------------- + * + * HgfsFileUnlockOfp -- + * + * Unlocks the HgfsFile associated with the HgfsOpenFile. This funciton should + * only be called by inactive, reclaim and the HgfsFileUnlock routine. + * + * Results: + * Returns 0 on success and an error code on error. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +int +HgfsFileUnlockOfp(HgfsOpenFile *ofp, // IN: HgfsOpenFile to unlcok + HgfsLockType type) // IN: Reader or Writer lock? +{ +#if defined(__APPLE__) + ASSERT(ofp); + + if (type == HGFS_READER_LOCK) { + os_rw_lock_unlock_shared(ofp->rwFileLock); + } else if (type == HGFS_WRITER_LOCK) { + os_rw_lock_unlock_exclusive(ofp->rwFileLock); + } else { + return HGFS_ERR; + } + return 0; +#else + NOT_IMPLEMENTED(); +#endif +} + + +/* * Local functions (definitions) */ @@ -783,31 +1005,31 @@ * * HgfsVnodeGetInt -- * - * Creates a vnode for the provided filename. + * Creates a vnode for the provided filename. * - * This will always allocate a vnode and HgfsOpenFile. If a HgfsFile - * already exists for this filename then that is used, if a HgfsFile doesn't - * exist, one is created. + * This will always allocate a vnode and HgfsOpenFile. If a HgfsFile + * already exists for this filename then that is used, if a HgfsFile doesn't + * exist, one is created. * * Results: - * Returns 0 on success and a non-zero error code on failure. The new - * vnode is returned locked. + * Returns 0 on success and a non-zero error code on failure. The new + * vnode is returned locked. * * Side effects: - * If the HgfsFile already exists, its reference count is incremented; - * otherwise a HgfsFile is created. + * None. * *---------------------------------------------------------------------------- */ + +#if defined(__FreeBSD__) static int -HgfsVnodeGetInt(struct vnode **vpp, // OUT: Filled with address of created vnode - HgfsSuperInfo *sip, // IN: Superinfo - struct mount *vfsp, // IN: Filesystem structure - struct vop_vector *vopp, // IN: Vnode operations vector - const char *fileName, // IN: Name of this file - HgfsFileType fileType, // IN: Type of file - HgfsFileHashTable *htp, // IN: File hash table - Bool lockHtp) // IN: Whether to lock the file hash table +HgfsVnodeGetInt(struct vnode **vpp, // OUT: Filled with address of created vnode + HgfsSuperInfo *sip, // IN: Superinfo + struct mount *vfsp, // IN: Filesystem structure + const char *fileName, // IN: Name of this file + HgfsFileType fileType, // IN: Tyoe of file + HgfsFileHashTable *htp, // IN: File hash + Bool rootVnode) // IN: Is this a root vnode? { struct vnode *vp; int ret = 0; @@ -833,14 +1055,18 @@ * be one; the reference count in our HgfsFile takes on the role of the * vnode reference count. */ - if ((ret = getnewvnode(HGFS_FS_NAME, vfsp, vopp, &vp)) != 0) { + if ((ret = getnewvnode(HGFS_FS_NAME, vfsp, &HgfsVnodeOps, &vp)) != 0) { return ret; } /* * Return a locked vnode to the caller. */ - lockmgr(vp->v_vnlock, LK_EXCLUSIVE, NULL, curthread); + ret = compat_lockmgr(vp->v_vnlock, LK_EXCLUSIVE, NULL, curthread); + if (ret) { + DEBUG(VM_DEBUG_FAIL, "Fatal: could not acquire lock on vnode\n"); + goto destroyVnode; + } /* * Now we'll initialize the vnode. We need to set the file type, vnode @@ -859,7 +1085,8 @@ default: /* Hgfs only supports directories and regular files */ - goto vnode_error; + ret = EPERM; + goto destroyOut; } /* @@ -867,10 +1094,15 @@ * initialize the per-open-file state, as well as locate (or create if * necessary) the per-file state. */ - vp->v_data = (void *)HgfsAllocOpenFile(fileName, fileType, htp, lockHtp); + vp->v_data = (void *)HgfsAllocOpenFile(fileName, fileType, htp); if (vp->v_data == NULL) { ret = ENOMEM; - goto vnode_error; + goto destroyOut; + } + + /* If this is going to be the root vnode, we have to mark it as such. */ + if (rootVnode) { + vp->v_vflag |= VV_ROOT; } /* Fill in the provided address with the new vnode. */ @@ -880,11 +1112,118 @@ return 0; /* Cleanup points for errors. */ -vnode_error: +destroyOut: + compat_lockmgr(vp->v_vnlock, LK_RELEASE, NULL, curthread); +destroyVnode: vrele(vp); return ret; } +#elif defined(__APPLE__) +static int +HgfsVnodeGetInt(struct vnode **vpp, // OUT + HgfsSuperInfo *sip, // IN + struct mount *vfsp, // IN + const char *fileName, // IN + HgfsFileType fileType, // IN + HgfsFileHashTable *htp, // IN + Bool rootVnode) // IN +{ + ASSERT(vpp); + ASSERT(sip); + ASSERT(vfsp); + ASSERT(fileName); + ASSERT(htp); + + struct vnode *vp; + struct vnode_fsparam params; + int ret = 0; + + params.vnfs_mp = vfsp; + params.vnfs_str = NULL; + params.vnfs_dvp = NULL; + params.vnfs_fsnode = NULL; + params.vnfs_vops = HgfsVnodeOps; + params.vnfs_marksystem = FALSE; + params.vnfs_rdev = 0; + params.vnfs_filesize = 0; + params.vnfs_cnp = NULL; + /* Do not let OS X cache vnodes for us. */ + params.vnfs_flags = VNFS_NOCACHE | VNFS_CANTCACHE; + + if (rootVnode) { + params.vnfs_markroot = TRUE; + } else { + params.vnfs_markroot = FALSE; + } + + /* + * Now we'll initialize the vnode. We need to set the file type, vnode + * operations, flags, filesystem pointer, reference count, and device. + * After that we'll create our private structures and hang them from the + * vnode's v_data pointer. + */ + switch (fileType) { + case HGFS_FILE_TYPE_REGULAR: + params.vnfs_vtype = VREG; + break; + + case HGFS_FILE_TYPE_DIRECTORY: + params.vnfs_vtype = VDIR; + break; + + default: + /* Hgfs only supports directories and regular files */ + ret = EINVAL; + goto out; + } + + /* + * We now allocate our private open file structure. This will correctly + * initialize the per-open-file state, as well as locate (or create if + * necessary) the per-file state. + */ + + HgfsOpenFile *ofp = HgfsAllocOpenFile(fileName, fileType, htp); + + params.vnfs_fsnode = (void *)ofp; + if (params.vnfs_fsnode == NULL) { + ret = ENOMEM; + goto out; + } + + + ret = vnode_create(VNCREATE_FLAVOR, sizeof(params), ¶ms, &vp); + ofp->vnodep = vp; + + /* Get a soft FS reference to the vnode. This tells the system that the vnode + * has data associated with it. It is considered a weak reference though, in that + * it does not prevent the system from reusing the vnode. + */ + vnode_addfsref(vp); + + if (ret != 0) { + DEBUG(VM_DEBUG_FAIL, "Failed to create vnode"); + ret = EINVAL; + goto destroyVnode; + } + + /* Fill in the provided address with the new vnode. */ + *vpp = vp; + + /* Return success */ + return 0; + + /* Cleanup points for errors. */ +destroyVnode: + vnode_put(vp); +out: + return ret; +} +#else + NOT_IMPLEMENTED(); +#endif + /* Allocation/initialization/free of open file state */ @@ -893,14 +1232,14 @@ * * HgfsAllocOpenFile -- * - * Allocates and initializes an open file structure. Also finds or, if - * necessary, creates the underlying HgfsFile per-file state. + * Allocates and initializes an open file structure. Also finds or, if + * necessary, creates the underlying HgfsFile per-file state. * * Results: - * Returns a pointer to the open file on success, NULL on error. + * Returns a pointer to the open file on success, NULL on error. * * Side effects: - * None. + * None. * *---------------------------------------------------------------------------- */ @@ -908,8 +1247,7 @@ static HgfsOpenFile * HgfsAllocOpenFile(const char *fileName, // IN: Name of file HgfsFileType fileType, // IN: Type of file - HgfsFileHashTable *htp, // IN: Hash table - Bool lockHtp) // IN: Whether to lock the hash table + HgfsFileHashTable *htp) // IN: Hash table { HgfsOpenFile *ofp; @@ -919,28 +1257,66 @@ /* * We allocate and initialize our open-file state. */ - ofp = (HgfsOpenFile *)malloc(sizeof *ofp, M_HGFS, M_ZERO|M_WAITOK); - - /* Manually set these since the public functions need the lock. */ - ofp->handle = 0; - ofp->handleIsSet = FALSE; + ofp = os_malloc(sizeof *ofp, M_ZERO | M_WAITOK); + if (!ofp) { + DEBUG(VM_DEBUG_FAIL, "Failed to allocate memory"); + return NULL; + } ofp->mode = 0; ofp->modeIsSet = FALSE; - mtx_init(&ofp->handleMutex, "hgfs_ofp", NULL, MTX_DEF); - mtx_init(&ofp->modeMutex, "hgfs_ofp_mode", NULL, MTX_DEF); + ofp->handleRefCount = 0; + ofp->handle = 0; + + ofp->handleMutex = os_mutex_alloc_init("hgfs_mtx_handle"); + if (!ofp->handleMutex) { + goto destroyOut; + } + + ofp->modeMutex = os_mutex_alloc_init("hgfs_mtx_mode"); + if (!ofp->modeMutex) { + goto destroyOut; + } + +#if defined(__APPLE__) + ofp->rwFileLock = os_rw_lock_alloc_init("hgfs_rw_file_lock"); + if (!ofp->rwFileLock) { + goto destroyOut; + } +#endif /* * Now we get a reference to the underlying per-file state. */ - ofp->hgfsFile = HgfsGetFile(fileName, fileType, htp, lockHtp); + ofp->hgfsFile = HgfsGetFile(fileName, fileType, htp); if (!ofp->hgfsFile) { - free(ofp, M_HGFS); - return NULL; + goto destroyOut; } + /* Success */ return ofp; + +destroyOut: + ASSERT(ofp); + + if (ofp->handleMutex) { + os_mutex_free(ofp->handleMutex); + } + + if (ofp->modeMutex) { + os_mutex_free(ofp->modeMutex); + } + +#if defined(__APPLE__) + if (ofp->rwFileLock) { + os_rw_lock_free(ofp->rwFileLock); + } +#endif + + os_free(ofp, sizeof *ofp); + return NULL; + } @@ -949,13 +1325,13 @@ * * HgfsFreeOpenFile -- * - * Frees the provided open file. + * Frees the provided open file. * * Results: - * Returns 0 on success and a non-zero error code on failure. + * Returns 0 on success and a non-zero error code on failure. * * Side effects: - * None. + * None. * *---------------------------------------------------------------------------- */ @@ -968,49 +1344,48 @@ ASSERT(htp); /* - * First we release our reference to the underlying per-file state. - */ + * First we release our reference to the underlying per-file state. + */ HgfsReleaseFile(ofp->hgfsFile, htp); /* * Then we destroy anything initialized and free the open file. */ - mtx_destroy(&ofp->handleMutex); - mtx_destroy(&ofp->modeMutex); +#if defined(__APPLE__) + os_rw_lock_free(ofp->rwFileLock); +#endif + os_mutex_free(ofp->handleMutex); + os_mutex_free(ofp->modeMutex); - free(ofp, M_HGFS); + os_free(ofp, sizeof *ofp); } /* Acquiring/releasing file state */ - /* *---------------------------------------------------------------------------- * * HgfsGetFile -- * - * Gets the file for the provided filename. - * - * If no file structure exists for this filename, one is created and added - * to the hash table. + * Gets the file for the provided filename. * * Results: - * Returns a pointer to the file on success, NULL on error. + * Returns a pointer to the file on success, NULL on error. * * Side effects: - * None. + * None. * *---------------------------------------------------------------------------- */ static HgfsFile * HgfsGetFile(const char *fileName, // IN: Filename to get file for - HgfsFileType fileType, // IN: Type of file - HgfsFileHashTable *htp, // IN: Hash table to look in - Bool lockHtp) // IN: Whether to lock the hash table + HgfsFileType fileType, // IN: Type of file + HgfsFileHashTable *htp) // IN: Hash table to look in { HgfsFile *fp; + HgfsFile *newfp; int err; ASSERT(fileName); @@ -1020,54 +1395,71 @@ * We try to find the file in the hash table. If it exists we increment its * reference count and return it. */ - if (lockHtp) { - mtx_lock(&htp->mutex); - } + os_mutex_lock(htp->mutex); fp = HgfsFindFile(fileName, htp); if (fp) { /* Signify our reference to this file. */ - mtx_lock(&fp->mutex); + os_mutex_lock(fp->mutex); fp->refCount++; - mtx_unlock(&fp->mutex); - - if (lockHtp) { - mtx_unlock(&htp->mutex); - } - - return fp; + os_mutex_unlock(fp->mutex); + goto out; } - DEBUG(VM_DEBUG_ALWAYS, "HgfsGetFile: allocated HgfsFile for %s.\n", fileName); + /* Drop the lock here, since we can block on os_malloc */ + os_mutex_unlock(htp->mutex); /* - * If it doesn't exist we create one, initialize it, and add it to the hash - * table. (M_NOWAIT set because sleeping while holding a lock is - * forbidden.) + * If it doesn't exist we create one. Ideally this should never fail, since + * we are ready to block till we get memory. Note that while we are creating + * HgfsFile, other thread(s) could also be creating HgfsFile at the same time. + * Thus once we get memory, we acquire the lock and check hash table to detect + * any race condition. */ - fp = (HgfsFile *)malloc(sizeof *fp, M_HGFS, M_ZERO|M_NOWAIT); - if (!fp) { - /* fp is NULL already */ + newfp = os_malloc(sizeof *newfp, M_ZERO | M_WAITOK); + + if (!newfp) { + /* newfp is NULL already */ + DEBUG(VM_DEBUG_FAIL, "Failed to allocate memory"); + return NULL; + } + + /* Acquire the lock and check for races */ + os_mutex_lock(htp->mutex); + + fp = HgfsFindFile(fileName, htp); + if (fp) { + /* + * Some other thread allocated HgfsFile before us. Free newfp + * and get the reference on this file. + */ + os_free(newfp, sizeof(*newfp)); + os_mutex_lock(fp->mutex); + fp->refCount++; + os_mutex_unlock(fp->mutex); goto out; } - err = HgfsInitFile(fp, fileName, fileType); + DEBUG(VM_DEBUG_INFO, "HgfsGetFile: allocated HgfsFile for %s.\n", fileName); + + err = HgfsInitFile(newfp, fileName, fileType); if (err) { - free(fp, M_HGFS); - fp = NULL; + os_free(newfp, sizeof(*newfp)); + newfp = NULL; goto out; } /* - * This is guaranteed to not add a duplicate since we checked above and have - * held the lock until now. + * This is guaranteed to not add a duplicate since after acquiring the lock on the + * hash table, we rechecked above to detect if the file was present and have held + * the lock until now. */ - HgfsAddFile(fp, htp); + HgfsAddFile(newfp, htp); + fp = newfp; out: - if (lockHtp) { - mtx_unlock(&htp->mutex); - } + os_mutex_unlock(htp->mutex); + DEBUG(VM_DEBUG_DONE, "HgfsGetFile: done\n"); return fp; } @@ -1078,15 +1470,15 @@ * * HgfsReleaseFile -- * - * Releases a reference to the provided file. If the reference count of - * this file becomes zero, the file structure is removed from the hash table - * and freed. + * Releases a reference to the provided file. If the reference count of + * this file becomes zero, the file structure is removed from the hash table + * and freed. * * Results: - * Returns 0 on success and a non-zero error code on failure. + * Returns 0 on success and a non-zero error code on failure. * * Side effects: - * None. + * None. * *---------------------------------------------------------------------------- */ @@ -1102,27 +1494,26 @@ * Decrement this file's reference count. If it becomes zero, then we * remove it from the hash table and free it. */ - mtx_lock(&fp->mutex); + os_mutex_lock(fp->mutex); if ( !(--fp->refCount) ) { - mtx_unlock(&fp->mutex); + os_mutex_unlock(fp->mutex); /* Remove file from hash table, then clean up. */ HgfsRemoveFile(fp, htp); - DEBUG(VM_DEBUG_ALWAYS, "HgfsReleaseFile: freeing HgfsFile for %s.\n", + DEBUG(VM_DEBUG_INFO, "HgfsReleaseFile: freeing HgfsFile for %s.\n", fp->fileName); - sx_destroy(&fp->rwlock); - mtx_destroy(&fp->mutex); - free(fp, M_HGFS); + os_mutex_free(fp->mutex); + os_free(fp, sizeof *fp); return; } - DEBUG(VM_DEBUG_ALWAYS, "HgfsReleaseFile: %s has %d references.\n", + DEBUG(VM_DEBUG_INFO, "HgfsReleaseFile: %s has %d references.\n", fp->fileName, fp->refCount); - mtx_unlock(&fp->mutex); + os_mutex_unlock(fp->mutex); } @@ -1134,16 +1525,16 @@ * * HgfsInitFile -- * - * Initializes a file structure. + * Initializes a file structure. * - * This sets the filename of the file and initializes other structure - * elements. + * This sets the filename of the file and initializes other structure + * elements. * * Results: - * Returns 0 on success and a non-zero error code on failure. + * Returns 0 on success and a non-zero error code on failure. * * Side effects: - * None. + * None. * *---------------------------------------------------------------------------- */ @@ -1164,6 +1555,11 @@ return HGFS_ERR; } + fp->mutex = os_mutex_alloc_init("hgfs_file_mutex_lock"); + if (!fp->mutex) { + return HGFS_ERR; + } + fp->fileNameLength = len; memcpy(fp->fileName, fileName, len + 1); fp->fileName[fp->fileNameLength] = '\0'; @@ -1183,13 +1579,6 @@ */ HgfsNodeIdHash(fp->fileName, fp->fileNameLength, &fp->nodeId); - /* - * The reader/write lock is for the rwlock/rwunlock vnode entry points and - * the mutex is to protect the reference count on this structure. - */ - sx_init(&fp->rwlock, "hgfs_file_sx"); - mtx_init(&fp->mutex, "hgfs_file_mtx", NULL, MTX_DEF); - /* The caller is the single reference. */ fp->refCount = 1; @@ -1205,18 +1594,18 @@ * * HgfsAddFile -- * - * Adds the file to the hash table. + * Adds the file to the hash table. * - * This function must be called with the hash table lock held. This is done - * so adding the file in the hash table can be made with any other - * operations (such as previously finding out that this file wasn't in the - * hash table). + * This function must be called with the hash table lock held. This is done + * so adding the file in the hash table can be made with any other + * operations (such as previously finding out that this file wasn't in the + * hash table). * * Results: - * Returns 0 on success and a non-zero error code on failure. + * Returns 0 on success and a non-zero error code on failure. * * Side effects: - * None. + * None. * *---------------------------------------------------------------------------- */ @@ -1242,18 +1631,18 @@ * * HgfsRemoveFile -- * - * Removes file from the hash table. + * Removes file from the hash table. * - * Note that unlike the other two hash functions, this one performs its own - * locking since the removal doesn't need to be atomic with other - * operations. (This could change in the future if the functions that use - * this one are reorganized.) + * Note that unlike the other two hash functions, this one performs its own + * locking since the removal doesn't need to be atomic with other + * operations. (This could change in the future if the functions that use + * this one are reorganized.) * * Results: - * Returns 0 on success and a non-zero error code on failure. + * Returns 0 on success and a non-zero error code on failure. * * Side effects: - * None. + * None. * *---------------------------------------------------------------------------- */ @@ -1265,12 +1654,12 @@ ASSERT(fp); ASSERT(htp); - mtx_lock(&htp->mutex); + os_mutex_lock(htp->mutex); /* Take this file off its list */ DblLnkLst_Unlink1(&fp->listNode); - mtx_unlock(&htp->mutex); + os_mutex_unlock(htp->mutex); } @@ -1279,17 +1668,17 @@ * * HgfsFindFile -- * - * Looks for a filename in the hash table. + * Looks for a filename in the hash table. * - * This function must be called with the hash table lock held. This is done - * so finding the file in the hash table and using it (after this function - * returns) can be atomic. + * This function must be called with the hash table lock held. This is done + * so finding the file in the hash table and using it (after this function + * returns) can be atomic. * * Results: - * Returns a pointer to the file if found, NULL otherwise. + * Returns a pointer to the file if found, NULL otherwise. * * Side effects: - * None. + * None. * *---------------------------------------------------------------------------- */ @@ -1335,15 +1724,15 @@ * * HgfsFileNameHash -- * - * Hashes the filename to get an index into the hash table. This is known - * as the PJW string hash function and it was taken from "Mastering - * Algorithms in C". + * Hashes the filename to get an index into the hash table. This is known + * as the PJW string hash function and it was taken from "Mastering + * Algorithms in C". * * Results: - * Returns an index between 0 and HGFS_HT_NR_BUCKETS. + * Returns an index between 0 and HGFS_HT_NR_BUCKETS. * * Side effects: - * None. + * None. * *---------------------------------------------------------------------------- */ @@ -1376,13 +1765,13 @@ * * HgfsNodeIdHash -- * - * Hashes the provided filename to generate a node id. + * Hashes the provided filename to generate a node id. * * Results: - * None. The value of the hash is filled into outHash. + * None. The value of the hash is filled into outHash. * * Side effects: - * None. + * None. * *---------------------------------------------------------------------------- */ @@ -1451,3 +1840,4 @@ return; } + diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/state.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/state.h --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/state.h 2008-01-28 08:02:47.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/state.h 2008-10-13 08:01:44.000000000 +0100 @@ -32,26 +32,32 @@ #include <sys/param.h> /* MAXPATHLEN */ #include <sys/lock.h> -#include <sys/mutex.h> -#include <sys/sx.h> -#include <sys/condvar.h> #include <sys/vnode.h> /* struct vnode */ #include "hgfsProto.h" #include "dbllnklst.h" - +#include "os.h" /* * Macros */ - /* Number of buckets for the HgfsInode hash table */ #define HGFS_HT_NR_BUCKETS 5 /* Conversion between different state structures */ -#define HGFS_VP_TO_OFP(vp) ((HgfsOpenFile *)(vp)->v_data) -#define HGFS_VP_TO_FP(vp) ((HgfsFile *)(HGFS_VP_TO_OFP(vp))->hgfsFile) -#define HGFS_OFP_TO_VP(ofp) (ofp)->vnodep +#if defined(__FreeBSD__) +# define HGFS_VP_TO_OFP(vp) \ + ((HgfsOpenFile *)(vp)->v_data) +#elif defined(__APPLE__) +# define HGFS_VP_TO_OFP(vp) \ + ((HgfsOpenFile *)vnode_fsnode(vp)) +#endif + +#define HGFS_VP_TO_FP(vp) \ + ((HgfsFile *)(HGFS_VP_TO_OFP(vp))->hgfsFile) + +#define HGFS_FP_TO_VP(fp) \ + (fp)->vnodep #define HGFS_VP_TO_FILENAME(vp) \ HGFS_VP_TO_FP(vp)->fileName @@ -65,17 +71,26 @@ #define HGFS_VP_TO_RWLOCK(vp) \ HGFS_VP_TO_FP(vp)->rwlock -#define HGFS_VP_TO_RWLOCKP(vp) &(HGFS_VP_TO_RWLOCK(vp)) +#define HGFS_VP_TO_RWLOCKP(vp) \ + &(HGFS_VP_TO_RWLOCK(vp)) #define HGFS_VP_TO_HGFSFILETYPE(vp) \ HGFS_VP_TO_FP(vp)->fileType +#define HGFS_OFP_TO_FP(ofp) \ + (ofp)->hgfsFile + /* * Types */ typedef uint32_t HgfsMode; +typedef enum HgfsLockType { + HGFS_WRITER_LOCK = 0, + HGFS_READER_LOCK = 1 +} HgfsLockType; + /* * State kept per shared file from the host. * @@ -99,29 +114,29 @@ * recreated from a Hgfs file without sending a request to the Hgfs server. */ HgfsFileType fileType; - /* - * Readers/writers lock for this file. Needed by rwlock() and rwunlock() - * entry points. - */ - struct sx rwlock; - /* Lock to protect the reference count of this file state. */ - struct mtx mutex; + + OS_MUTEX_T *mutex; uint32_t refCount; } HgfsFile; - /* * State kept per vnode, which implies per open file within a process. * * Once created, the hgfsFile and vnode/vnodep values are read-only. The - * handle and mode will change throughout this structure's existence, and are - * both protected by their own mutex. + * handle and mode will change throughout this structure's existence. */ typedef struct HgfsOpenFile { - /* Handle provided by reply to a request */ - HgfsHandle handle; - Bool handleIsSet; - struct mtx handleMutex; + /* + * Pointer to the single Hgfs file state structure shared amongst all open + * instances of this file. + */ + HgfsFile *hgfsFile; + + /* + * A pointer back to the vnode this open-file state is for. + */ + struct vnode *vnodep; + /* * Mode specified for this file to be created with. This is necessary * because create is called with the mode then open is called without it. @@ -129,40 +144,42 @@ */ HgfsMode mode; Bool modeIsSet; - struct mtx modeMutex; + OS_MUTEX_T *modeMutex; + /* - * Pointer to the single Hgfs file state structure shared amongst all open - * instances of this file. + * Handle provided by reply to a request. If the reference count is > 0, the + * the handle is valid. */ - HgfsFile *hgfsFile; + uint32_t handleRefCount; + HgfsHandle handle; + OS_MUTEX_T *handleMutex; + /* - * A pointer back to the vnode this open-file state is for. + * One big difference between the OS X and FreeBSD VFS layers is that the + * XNU kernel does not lock a vnode before it calls our VFS functions. As a + * result, we have to provide our RwLock which is locked in macos/vnops.c + * before any common functions are called. */ - struct vnode *vnodep; +#if defined(__APPLE__) + OS_RWLOCK_T *rwFileLock; +#endif + } HgfsOpenFile; /* The hash table for file state. */ typedef struct HgfsFileHashTable { - struct mtx mutex; + OS_MUTEX_T *mutex; DblLnkLst_Links hashTable[HGFS_HT_NR_BUCKETS]; } HgfsFileHashTable; /* Forward declaration to prevent circular dependency between this and hgfsbsd.h. */ struct HgfsSuperInfo; - -/* - * Functions - */ int HgfsVnodeGet(struct vnode **vpp, struct HgfsSuperInfo *sip, struct mount *vfsp, - struct vop_vector *vopp, const char *fileName, HgfsFileType fileType, - HgfsFileHashTable *htp); + const char *fileName, HgfsFileType fileType, HgfsFileHashTable *htp); +int HgfsVnodeGetRoot(struct vnode **vpp, struct HgfsSuperInfo *sip, struct mount *vfsp, + const char *fileName, HgfsFileType fileType, HgfsFileHashTable *htp); int HgfsVnodePut(struct vnode *vp, HgfsFileHashTable *htp); -int HgfsVnodeDup(struct vnode **newVpp, struct vnode *origVp, struct HgfsSuperInfo *sip, - HgfsFileHashTable *htp); -int HgfsFileNameToVnode(const char *fileName, struct vnode **vpp, - struct HgfsSuperInfo *sip, struct mount *vfsp, - HgfsFileHashTable *htp); void HgfsNodeIdGet(HgfsFileHashTable *ht, const char *fileName, uint32_t fileNameLength, ino_t *outNodeId); int HgfsInitFileHashTable(HgfsFileHashTable *htp); @@ -172,13 +189,20 @@ /* Handle get/set/clear functions */ int HgfsSetOpenFileHandle(struct vnode *vp, HgfsHandle handle); int HgfsGetOpenFileHandle(struct vnode *vp, HgfsHandle *outHandle); -int HgfsClearOpenFileHandle(struct vnode *vp); +int HgfsReleaseOpenFileHandle(struct vnode *vp, Bool *closed); +Bool HgfsShouldCloseOpenFileHandle(struct vnode *vp); Bool HgfsHandleIsSet(struct vnode *vp); +int HgfsHandleIncrementRefCount(struct vnode *vp); /* Mode get/set/clear functions */ int HgfsSetOpenFileMode(struct vnode *vp, HgfsMode mode); int HgfsGetOpenFileMode(struct vnode *vp, HgfsMode *outMode); -int HgfsClearOpenFileMode(struct vnode *vp); +int HgfsClearOpenFileMode(struct vnode *); -#endif /* _STATE_H_ */ +/* HgfsFile locking functions */ +int HgfsFileLock(struct vnode *vp, HgfsLockType type); +int HgfsFileLockOfp(HgfsOpenFile *ofp, HgfsLockType type); +int HgfsFileUnlock(struct vnode *vp, HgfsLockType type); +int HgfsFileUnlockOfp(HgfsOpenFile *ofp, HgfsLockType type); +#endif /* _STATE_H_ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/vfsops.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/vfsops.c --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/vfsops.c 2008-01-28 08:02:47.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/vfsops.c 2008-10-13 08:01:43.000000000 +0100 @@ -29,10 +29,17 @@ #include <sys/malloc.h> #include <sys/kernel.h> #include <sys/systm.h> +#if __FreeBSD_version >= 700000 +#include <sys/priv.h> +#endif #include "hgfs_kernel.h" #include "request.h" #include "debug.h" +#include "hgfsDevLinux.h" +#include "os.h" +#include "compat_freebsd.h" +#include "vfsopscommon.h" /* * Local functions (prototypes) @@ -51,11 +58,6 @@ */ /* - * Malloc tag for statistics, debugging, etc. - */ -MALLOC_DEFINE(M_HGFS, HGFS_FS_NAME, HGFS_FS_NAME_LONG); - -/* * Hgfs VFS operations vector */ static struct vfsops HgfsVfsOps = { @@ -68,7 +70,9 @@ .vfs_vget = vfs_stdvget, .vfs_fhtovp = vfs_stdfhtovp, .vfs_checkexp = vfs_stdcheckexp, +#if __FreeBSD_version < 700000 .vfs_vptofh = vfs_stdvptofh, +#endif .vfs_init = HgfsVfsInit, .vfs_uninit = HgfsVfsUninit, .vfs_extattrctl = vfs_stdextattrctl, @@ -112,7 +116,12 @@ struct vnode *vp; int ret = 0; char *target; - int error, len; + int error; + int size; + Bool *uidSet = NULL; + int *uid = NULL; + Bool *gidSet = NULL; + int *gid = NULL; /* * - Examine/validate mount flags from userland. @@ -144,31 +153,30 @@ * Allocate a new HgfsSuperInfo structure. This is the super structure * maintained for each file system. (With M_WAITOK, this call cannot fail.) */ - sip = malloc(sizeof *sip, M_HGFS, M_WAITOK|M_ZERO); + sip = os_malloc(sizeof *sip, M_WAITOK | M_ZERO); mp->mnt_data = sip; - /* - * This doesn't allocate anything, so don't worry about cleanup in - * HgfsVFSUnmount. - */ - HgfsInitFileHashTable(&sip->fileHashTable); + error = HgfsInitFileHashTable(&sip->fileHashTable); + if (error) { + goto out; + } /* * Allocate the root vnode, then record it and the file system information * in our superinfo. */ - HgfsVnodeGet(&vp, sip, mp, &HgfsVnodeOps, "/", - HGFS_FILE_TYPE_DIRECTORY, &sip->fileHashTable); + error = HgfsVnodeGetRoot(&vp, sip, mp, "/", + HGFS_FILE_TYPE_DIRECTORY, &sip->fileHashTable); + if (error) { + HgfsDestroyFileHashTable(&sip->fileHashTable); + goto out; + } sip->vfsp = mp; sip->rootVnode = vp; - /* - * Indicate that this vnode is the root vnode and, since we're finished with - * it, unlock it. - */ - vp->v_vflag |= VV_ROOT; - VOP_UNLOCK(vp, 0, td); + /* We're finished with the root vnode, so unlock it. */ + COMPAT_VOP_UNLOCK(vp, 0, td); /* * Initialize this file system's Hgfs requests container. @@ -184,15 +192,71 @@ mp->mnt_kern_flag |= MNTK_MPSAFE; MNT_IUNLOCK(mp); + /* Get a new unique filesystem ID */ vfs_getnewfsid(mp); - error = vfs_getopt(mp->mnt_optnew, "target", (void **)&target, &len); - if (error || target[len - 1] != '\0') { + error = vfs_getopt(mp->mnt_optnew, "target", (void **)&target, &size); + if (error || target[size - 1] != '\0') { target = "host:hgfs"; } + + /* Get uidSet */ + error = vfs_getopt(mp->mnt_optnew, "uidSet", (void**)&uidSet, &size); + + if (!error && size == sizeof(Bool) && uidSet) { + sip->uidSet = *uidSet; + } else { + sip->uidSet = FALSE; + } + + /* Get uid */ + error = vfs_getopt(mp->mnt_optnew, "uid", (void**)&uid, &size); + + if (!error && size == sizeof(int) && uid) { + sip->uid = *uid; + } else { + sip->uidSet = FALSE; + } + + /* Get gidSet */ + error = vfs_getopt(mp->mnt_optnew, "gidSet", (void**)&gidSet, &size); + + if (!error && size == sizeof(Bool) && gidSet) { + sip->gidSet = *gidSet; + } else { + sip->gidSet = FALSE; + } + + /* Get gid */ + error = vfs_getopt(mp->mnt_optnew, "gid", (void**)&gid, &size); + + if (!error && size == sizeof(int) && gid) { + sip->gid = *gid; + } else { + sip->gidSet = FALSE; + } + vfs_mountedfrom(mp, target); - return 0; + /* + * Fill in the statfs structure. Note that even if HgfsStatfsInt + * fails, we shall just log the error and move on, since it is + * not a critical operation. + */ + error = HgfsStatfsInt(vp, &mp->mnt_stat); + if (error) { + DEBUG(VM_DEBUG_FAIL, "HgfsStatfsInt failed with ret = %d\n", ret); + error = 0; + } + + DEBUG(VM_DEBUG_LOAD, "Exit\n"); + +out: + if (error) { + os_free(sip, sizeof *sip); + } + + return error; } @@ -216,7 +280,8 @@ HgfsVfsUnmount(struct mount *mp, int mntflags, struct thread *td) { HgfsSuperInfo *sip; - int ret = 0, flags = 0; + int ret = 0; + int flags = 0; sip = (HgfsSuperInfo *)mp->mnt_data; @@ -258,7 +323,9 @@ HgfsKReq_FreeContainer(sip->reqs); mp->mnt_data = NULL; - free(sip, M_HGFS); + os_free(sip, sizeof *sip); + + DEBUG(VM_DEBUG_LOAD, "Exit\n"); return 0; } @@ -272,7 +339,7 @@ * "VFS_STATFS(9) - return file system status." * * Results: - * Zero (always succeeds). + * Zero on success and non-zero error code on failure. * * Side effects: * Caller's statfs structure is populated. @@ -283,9 +350,34 @@ static int HgfsVfsStatfs(struct mount *mp, struct statfs *sbp, struct thread *td) { + int ret = 0; + struct vnode *vp; + + /* We always want HGFS_BLOCKSIZE to be a power of two */ + ASSERT_ON_COMPILE(HGFS_IS_POWER_OF_TWO(HGFS_BLOCKSIZE)); + + /* + * This fills in file system ID and the type number that + * we got from a call to vfs_getnewfsid() in HgfsVfsMount() + */ bcopy(&mp->mnt_stat, sbp, sizeof mp->mnt_stat); - return 0; + ret = HgfsVfsRoot(mp, LK_SHARED, &vp, td); + if (ret) { + DEBUG(VM_DEBUG_FAIL, "HgfsVfsRoot failed\n"); + return ret; + } + + ret = HgfsStatfsInt(vp, sbp); + if (ret) { + DEBUG(VM_DEBUG_FAIL, "HgfsStatfsInt failed with ret = %d\n", ret); + goto out; + } + +out: + /* Drop the reference and shared lock that we acquired in HgfsVfsRoot */ + vput(vp); + return ret; } /* @@ -344,9 +436,15 @@ { int ret = 0; - DEBUG(VM_DEBUG_LOAD, "Hgfs filesystem loaded"); + /* Initialize the os memory allocation and thread synchronization subsystem. */ + if ((ret = os_init()) != 0) { + return ret; + } + ret = HgfsKReq_SysInit(); + DEBUG(VM_DEBUG_LOAD, "Hgfs filesystem loaded"); + return ret; } @@ -372,6 +470,8 @@ int ret = 0; ret = HgfsKReq_SysFini(); + os_cleanup(); + DEBUG(VM_DEBUG_LOAD, "Hgfs filesystem unloaded"); return ret; } diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/vfsopscommon.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/vfsopscommon.c --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/vfsopscommon.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/vfsopscommon.c 2008-10-13 08:01:44.000000000 +0100 @@ -0,0 +1,148 @@ +/********************************************************* + * Copyright (C) 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 General Public License as published by the + * Free Software Foundation version 2 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 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 + * + *********************************************************/ + +/* + * vnopscommon.h -- + * + * Common VFS vfsop implementations that are shared between both OS X and FreeBSD. + */ + +#include <sys/param.h> // for everything +#include <sys/vnode.h> // for struct vnode + +#include "fsutil.h" +#include "state.h" +#include "debug.h" +#include "request.h" +#include "vnopscommon.h" +#include "vfsopscommon.h" + +/* + *---------------------------------------------------------------------------- + * + * HgfsStatfsInt -- + * + * Hgfs statfs method. Called by HgfsVfsStatfs on FreeBSD and + * HgfsVfsGetattr on OS X. + * + * Results: + * Returns 0 on success and an error code on error. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +int +HgfsStatfsInt(struct vnode *vp, // IN: vnode + HgfsStatfs *stat) // IN: statfs structure to fill in +{ + HgfsSuperInfo *sip; + HgfsKReqHandle req; + HgfsRequest *requestHeader; + HgfsReply *replyHeader; + HgfsRequestQueryVolumeV3 *request; + HgfsReplyQueryVolumeV3 *reply; + uint32 reqSize; + uint32 reqBufferSize; + uint32 repSize; + char *fullPath = NULL; + uint32 fullPathLen; + int ret = 0; + + /* Get pointer to the superinfo. */ + sip = HGFS_VP_TO_SIP(vp); + if (!sip) { + DEBUG(VM_DEBUG_FAIL, "couldn't acquire superinfo\n"); + return ENOTSUP; + } + + /* Prepare the request */ + req = HgfsKReq_AllocateRequest(sip->reqs); + if (!req) { + return ENOMEM; + } + + requestHeader = (HgfsRequest *)HgfsKReq_GetPayload(req); + request = (HgfsRequestQueryVolumeV3 *)HGFS_REQ_GET_PAYLOAD_V3(requestHeader); + + /* Initialize the request header */ + requestHeader->id = HgfsKReq_GetId(req); + requestHeader->op = HGFS_OP_QUERY_VOLUME_INFO_V3; + + request->fileName.flags = 0; + request->fileName.fid = HGFS_INVALID_HANDLE; + request->fileName.caseType = HGFS_FILE_NAME_CASE_SENSITIVE; + request->reserved = 0; + + reqSize = HGFS_REQ_PAYLOAD_SIZE_V3(request); + reqBufferSize = HGFS_NAME_BUFFER_SIZET(reqSize); + + fullPath = HGFS_VP_TO_FILENAME(vp); + fullPathLen = HGFS_VP_TO_FILENAME_LENGTH(vp); + + ret = HgfsNameToWireEncoding(fullPath, fullPathLen + 1, + request->fileName.name, + reqBufferSize); + if (ret < 0) { + DEBUG(VM_DEBUG_FAIL, "Could not encode to wire format"); + ret = -ret; + goto destroyOut; + } + request->fileName.length = ret; + reqSize += ret; + + /* The request size includes header, request and file length */ + HgfsKReq_SetPayloadSize(req, reqSize); + + ret = HgfsSubmitRequest(sip, req); + + if (ret) { + /* HgfsSubmitRequest() destroys the request if necessary */ + + goto out; + } + + replyHeader = (HgfsReply *)HgfsKReq_GetPayload(req); + reply = (HgfsReplyQueryVolumeV3 *)HGFS_REP_GET_PAYLOAD_V3(replyHeader); + repSize = HGFS_REP_PAYLOAD_SIZE_V3(reply); + + ret = HgfsGetStatus(req, repSize); + if (ret) { + DEBUG(VM_DEBUG_FAIL, "reply was invalid"); + goto destroyOut; + } + + ret = HgfsStatusToBSD(replyHeader->status); + + if (ret) { + goto destroyOut; + } + + stat->f_bsize = HGFS_BLOCKSIZE; + stat->f_iosize = HGFS_BLOCKSIZE; + stat->f_blocks = HGFS_CONVERT_TO_BLOCKS(reply->totalBytes); + stat->f_bfree = HGFS_CONVERT_TO_BLOCKS(reply->freeBytes); + stat->f_bavail = stat->f_bfree; + +destroyOut: + HgfsKReq_ReleaseRequest(sip->reqs, req); +out: + return ret; +} diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/vfsopscommon.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/vfsopscommon.h --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/vfsopscommon.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/vfsopscommon.h 2008-10-13 08:01:44.000000000 +0100 @@ -0,0 +1,48 @@ +/********************************************************* + * Copyright (C) 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 General Public License as published by the + * Free Software Foundation version 2 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 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 + * + *********************************************************/ + +/* + * vfsopscommon.h -- + * + * Common VFS vfsop implementations that are shared between both OS X and FreeBSD. + */ + +#ifndef _HGFS_VFSOPS_COMMON_H_ +#define _HGFS_VFSOPS_COMMON_H_ + +#include <sys/mount.h> +#include <sys/vnode.h> + +/* + * Macros + */ + +#define HGFS_CONVERT_TO_BLOCKS(bytes) (bytes / HGFS_BLOCKSIZE) +#define HGFS_IS_POWER_OF_TWO(val) (val && !(val & (val - 1))) + +#if defined(__FreeBSD__) + typedef struct statfs HgfsStatfs; +#elif defined(__APPLE__) + typedef struct vfsstatfs HgfsStatfs; +#endif + + +int +HgfsStatfsInt(struct vnode *vp, HgfsStatfs *stat); + +#endif // _HGFS_VFSOPS_COMMON_H_ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/vm_assert.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/vm_assert.h --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/vm_assert.h 2008-01-28 08:02:47.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/vm_assert.h 2008-10-13 08:01:44.000000000 +0100 @@ -98,8 +98,6 @@ * ASSERT() is special cased because of interaction with Windows DDK. */ -#define IMPLIES(a,b) (!(a) || (b)) - #if defined VMX86_DEBUG || defined ASSERT_ALWAYS_AVAILABLE #undef ASSERT #define ASSERT(cond) \ @@ -243,12 +241,21 @@ /* - * Compile-time assertions + * 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). */ #define ASSERT_ON_COMPILE(e) \ do { \ - typedef char AssertOnCompileType[(e) ? 1 : -1]; \ + enum { AssertOnCompileMisused = ((e) ? 1 : -1) }; \ + typedef char AssertOnCompileFailed[AssertOnCompileMisused]; \ } while (0) diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/vm_basic_asm.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/vm_basic_asm.h --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/vm_basic_asm.h 2008-01-28 08:02:47.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/vm_basic_asm.h 2008-10-13 08:01:44.000000000 +0100 @@ -413,12 +413,21 @@ #endif } +#ifdef VM_X86_64 + +/* + * No inline assembly in Win64. Implemented in bora/lib/user 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) { -#ifdef VM_X86_64 - *(int*)0 = 0; // NOT_IMPLEMENTED(); -#else __asm push esi __asm push ebx __asm push ecx @@ -437,8 +446,8 @@ __asm pop ecx __asm pop ebx __asm pop esi -#endif } +#endif static INLINE uint32 __GET_EAX_FROM_CPUID(int input) @@ -713,26 +722,50 @@ /* *----------------------------------------------------------------------------- * - * Bswap -- + * Bswap32 -- * - * Swap the 4 bytes of "v" as follows: 3210 -> 0123. + * Swap the 4 bytes of "v" as follows: 3210 -> 0123. * *----------------------------------------------------------------------------- */ -#ifdef __GNUC__ // { static INLINE uint32 -Bswap(uint32 v) +Bswap32(uint32 v) // IN { - /* Checked against the Intel manual and GCC --hpreg */ +#ifdef __GNUC__ // { + /* Checked against the Intel manual and GCC. --hpreg */ __asm__( - "bswap %0" + "bswap %0" : "=r" (v) : "0" (v) ); return v; -} +#else // } { + return (v >> 24) + | ((v >> 8) & 0xFF00) + | ((v & 0xFF00) << 8) + | (v << 24) ; #endif // } +} +#define Bswap Bswap32 + + +/* + *----------------------------------------------------------------------------- + * + * Bswap64 -- + * + * Swap the 8 bytes of "v" as follows: 76543210 -> 01234567. + * + *----------------------------------------------------------------------------- + */ + +static INLINE uint64 +Bswap64(uint64 v) // IN +{ + return ((uint64)Bswap((uint32)v) << 32) | Bswap((uint32)(v >> 32)); +} + #ifdef __GNUC__ // { /* diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/vm_basic_asm_x86_64.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/vm_basic_asm_x86_64.h --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/vm_basic_asm_x86_64.h 2008-01-28 08:02:47.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/vm_basic_asm_x86_64.h 2008-10-13 08:01:44.000000000 +0100 @@ -84,16 +84,25 @@ static INLINE void FXSAVE_ES1(uint8 *save) { - asm ("fxsaveq %0 \n" - : "=m" (*save)); + __asm__ __volatile__ ("fxsaveq %0 \n" : "=m" (*save) : : "memory"); +} + +static INLINE void +FXSAVE_COMPAT_ES1(uint8 *save) +{ + __asm__ __volatile__ ("fxsave %0 \n" : "=m" (*save) : : "memory"); } static INLINE void FXRSTOR_ES1(const uint8 *load) { - asm ("fxrstorq %0 \n" - : - : "m" (*load)); + __asm__ __volatile__ ("fxrstorq %0 \n" : : "m" (*load) : "memory"); +} + +static INLINE void +FXRSTOR_COMPAT_ES1(const uint8 *load) +{ + __asm__ __volatile__ ("fxrstor %0 \n" : : "m" (*load) : "memory"); } static INLINE void @@ -101,7 +110,8 @@ { uint64 dummy = 0; - asm ("fnstsw %%ax \n" // Grab x87 ES bit + __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 @@ -112,10 +122,10 @@ "fxrstorq %1 \n" : : "m" (dummy), "m" (*load) - : "ax"); + : "ax", "memory"); } -#endif +#endif /* __GNUC__ */ /* @@ -152,14 +162,14 @@ uint64 result, dummy; const uint64 multiplier64 = multiplier; - asm("mulq %3 \n\t" - "shrdq %1, %0 \n\t" - : "=a" (result), - "=d" (dummy) - : "0" (multiplier64), - "rm" (multiplicand), + __asm__("mulq %3 \n\t" + "shrdq %1, %0 \n\t" + : "=a" (result), + "=d" (dummy) + : "0" (multiplier64), + "rm" (multiplicand), "c" (shift) - : "cc"); + : "cc"); return result; } @@ -211,7 +221,7 @@ int64 result, dummy; const int64 multiplier64 = multiplier; - asm("imulq %3 \n\t" + __asm__("imulq %3 \n\t" "shrdq %1, %0 \n\t" : "=a" (result), "=d" (dummy) @@ -276,7 +286,7 @@ *----------------------------------------------------------------------------- */ -#if defined(__GNUC__) +#if defined(__GNUC__) || defined(_MSC_VER) static INLINE void Div643232(uint64 dividend, // IN @@ -284,8 +294,8 @@ uint32 *quotient, // OUT uint32 *remainder) // OUT { - *quotient = dividend / divisor; - *remainder = dividend % divisor; + *quotient = (uint32)(dividend / divisor); + *remainder = (uint32)(dividend % divisor); } #endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/vm_basic_asm_x86.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/vm_basic_asm_x86.h --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/vm_basic_asm_x86.h 2008-01-28 08:02:47.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/vm_basic_asm_x86.h 2008-10-13 08:01:44.000000000 +0100 @@ -100,16 +100,13 @@ static INLINE void FXSAVE_ES1(uint8 *save) { - asm ("fxsave %0 \n" - : "=m" (*save)); + __asm__ __volatile__ ("fxsave %0\n" : "=m" (*save) : : "memory"); } static INLINE void FXRSTOR_ES1(const uint8 *load) { - asm ("fxrstor %0 \n" - : - : "m" (*load)); + __asm__ __volatile__ ("fxrstor %0\n" : : "m" (*load) : "memory"); } static INLINE void @@ -117,7 +114,8 @@ { uint64 dummy = 0; - asm ("fnstsw %%ax \n" // Grab x87 ES bit + __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 @@ -128,10 +126,9 @@ "fxrstor %1 \n" : : "m" (dummy), "m" (*load) - : "ax"); + : "ax", "memory"); } - -#endif +#endif /* __GNUC__ */ /* *----------------------------------------------------------------------------- @@ -306,42 +303,42 @@ * smart enough, at least in the version we are currently using. */ if (shift < 32) { - asm("mov %%eax, %2 \n\t" // Save lo(multiplicand) in tmp2 - "mov %%edx, %%eax \n\t" // Get hi(multiplicand) - "mull %4 \n\t" // p2 = hi(multiplicand) * multiplier - "xchg %%eax, %2 \n\t" // Save lo(p2) in tmp2, get lo(multiplicand) - "mov %%edx, %1 \n\t" // Save hi(p2) in tmp1 - "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 - "shrdl %%edx, %%eax \n\t" // result = hi(p2):hi(p1):lo(p1) >> shift - "shrdl %1, %%edx" - : "=A" (result), - "=&r" (tmp1), // use in shrdl requires it to be a register - "=&r" (tmp2) // could be "=&rm" but "m" is slower - : "0" (multiplicand), - "rm" (multiplier), - "c" (shift) - : "cc" - ); + __asm__("mov %%eax, %2 \n\t" // Save lo(multiplicand) in tmp2 + "mov %%edx, %%eax \n\t" // Get hi(multiplicand) + "mull %4 \n\t" // p2 = hi(multiplicand) * multiplier + "xchg %%eax, %2 \n\t" // Save lo(p2) in tmp2, get lo(multiplicand) + "mov %%edx, %1 \n\t" // Save hi(p2) in tmp1 + "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 + "shrdl %%edx, %%eax \n\t" // result = hi(p2):hi(p1):lo(p1) >> shift + "shrdl %1, %%edx" + : "=A" (result), + "=&r" (tmp1), // use in shrdl requires it to be a register + "=&r" (tmp2) // could be "=&rm" but "m" is slower + : "0" (multiplicand), + "rm" (multiplier), + "c" (shift) + : "cc" + ); } else { - asm("mov %%edx, %2 \n\t" // Save hi(multiplicand) in tmp2 - "mull %4 \n\t" // p1 = lo(multiplicand) * multiplier - "mov %%edx, %1 \n\t" // Save hi(p1) in tmp1 - "mov %2, %%eax \n\t" // Discard lo(p1), get hi(multiplicand) - "mull %4 \n\t" // p2 = hi(multiplicand) * multiplier - "addl %1, %%eax \n\t" // lo(p2) += hi(p1) - "adcl $0, %%edx \n\t" // hi(p2) += carry from previous step - "shrdl %%edx, %%eax \n\t" // result = p2 >> (shift & 31) - "shrl %%cl, %%edx" - : "=A" (result), - "=&r" (tmp1), // could be "=&rm" but "m" is slower - "=&r" (tmp2) // could be "=&rm" but "m" is slower - : "0" (multiplicand), - "rm" (multiplier), - "c" (shift) - : "cc" - ); + __asm__("mov %%edx, %2 \n\t" // Save hi(multiplicand) in tmp2 + "mull %4 \n\t" // p1 = lo(multiplicand) * multiplier + "mov %%edx, %1 \n\t" // Save hi(p1) in tmp1 + "mov %2, %%eax \n\t" // Discard lo(p1), get hi(multiplicand) + "mull %4 \n\t" // p2 = hi(multiplicand) * multiplier + "addl %1, %%eax \n\t" // lo(p2) += hi(p1) + "adcl $0, %%edx \n\t" // hi(p2) += carry from previous step + "shrdl %%edx, %%eax \n\t" // result = p2 >> (shift & 31) + "shrl %%cl, %%edx" + : "=A" (result), + "=&r" (tmp1), // could be "=&rm" but "m" is slower + "=&r" (tmp2) // could be "=&rm" but "m" is slower + : "0" (multiplicand), + "rm" (multiplier), + "c" (shift) + : "cc" + ); } return result; } @@ -418,38 +415,38 @@ int64 result; uint32 tmp1, tmp2; // ASSERT(shift >= 0 && shift < 64); - + /* Written and tested by mann, checked by dbudko and hpreg */ /* XXX hpreg suggested some improvements that we haven't converged on yet */ - 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 - "mov %%edx, %%eax\n\t" // result = hi(p2):hi(p1) >> (shift & 31) - "mov %1, %%edx\n\t" - "shrdl %%edx, %%eax\n\t" - "sarl %%cl, %%edx\n\t" - "jmp 3f\n" - "2:\n\t" - "shrdl %%edx, %%eax\n\t" // result = hi(p2):hi(p1):lo(p1) >> shift - "shrdl %1, %%edx\n" - "3:\n\t" - : "=A" (result), "=&r" (tmp1), "=&r" (tmp2) - : "0" (multiplicand), "rm" (multiplier), "c" (shift) - : "cc"); + __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 + "mov %%edx, %%eax\n\t" // result = hi(p2):hi(p1) >> (shift & 31) + "mov %1, %%edx\n\t" + "shrdl %%edx, %%eax\n\t" + "sarl %%cl, %%edx\n\t" + "jmp 3f\n" + "2:\n\t" + "shrdl %%edx, %%eax\n\t" // result = hi(p2):hi(p1):lo(p1) >> shift + "shrdl %1, %%edx\n" + "3:\n\t" + : "=A" (result), "=&r" (tmp1), "=&r" (tmp2) + : "0" (multiplicand), "rm" (multiplier), "c" (shift) + : "cc"); return result; } diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/vm_basic_defs.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/vm_basic_defs.h --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/vm_basic_defs.h 2008-01-28 08:02:47.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/vm_basic_defs.h 2008-10-13 08:01:44.000000000 +0100 @@ -39,6 +39,10 @@ #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 <stddef.h> /* * We re-define offsetof macro from stddef, make @@ -52,7 +56,8 @@ * Simple macros */ -#if defined __APPLE__ && !defined KERNEL +#if (defined __APPLE__ || defined __FreeBSD__) && \ + (!defined KERNEL && !defined _KERNEL && !defined VMKERNEL && !defined __KERNEL__) # include <stddef.h> #else // XXX the __cplusplus one matches that of VC++, to prevent redefinition warning @@ -108,6 +113,7 @@ #define DWORD_ALIGN(x) ((((x)+3) >> 2) << 2) #define QWORD_ALIGN(x) ((((x)+4) >> 3) << 3) +#define IMPLIES(a,b) (!(a) || (b)) /* * Not everybody (e.g., the monitor) has NULL @@ -313,7 +319,22 @@ #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 // { @@ -324,7 +345,7 @@ * guarantee. Bummer. --Jeremy. */ -#if defined(N_PLAT_NLM) || defined(__FreeBSD__) +#if defined(N_PLAT_NLM) /* We do not have YIELD() as we do not need it yet... */ #elif defined(_WIN32) # define YIELD() Sleep(0) @@ -450,12 +471,23 @@ */ #undef DEBUG_ONLY +#undef SL_DEBUG_ONLY +#undef VMX86_SL_DEBUG #ifdef VMX86_DEBUG -#define vmx86_debug 1 -#define DEBUG_ONLY(x) x +#define vmx86_debug 1 +#define DEBUG_ONLY(x) x +/* + * Be very, very, very careful with SL_DEBUG. Pls ask ganesh or min before + * using it. + */ +#define VMX86_SL_DEBUG +#define vmx86_sl_debug 1 +#define SL_DEBUG_ONLY(x) x #else -#define vmx86_debug 0 +#define vmx86_debug 0 #define DEBUG_ONLY(x) +#define vmx86_sl_debug 0 +#define SL_DEBUG_ONLY(x) #endif #ifdef VMX86_STATS @@ -543,18 +575,32 @@ #endif #endif -#ifdef VMX86_VPROBES -#define vmx86_vprobes 1 -#define VPROBES_ONLY(x) x +#ifdef _WIN32 +#define VMW_INVALID_HANDLE INVALID_HANDLE_VALUE +#else +#define VMW_INVALID_HANDLE (-1) +#endif + +#ifdef _WIN32 +#define fsync(fd) _commit(fd) +#define fileno(f) _fileno(f) #else -#define vmx86_vprobes 0 -#define VPROBES_ONLY(x) #endif +/* + * Debug output macros for Windows drivers (the Eng variant is for + * display/printer drivers only. + */ #ifdef _WIN32 -#define VMW_INVALID_HANDLE INVALID_HANDLE_VALUE +#ifndef USES_OLD_WINDDK +#if defined(VMX86_DEBUG) || defined(ASSERT_ALWAYS_AVAILABLE) +#define WinDrvPrint(arg, ...) DbgPrint(arg, __VA_ARGS__) +#define WinDrvEngPrint(arg, ...) EngDbgPrint(arg, __VA_ARGS__) #else -#define VMW_INVALID_HANDLE -1 +#define WinDrvPrint(arg, ...) +#define WinDrvEngPrint(arg, ...) #endif +#endif +#endif // _WIN32 #endif // ifndef _VM_BASIC_DEFS_H_ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/vm_basic_types.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/vm_basic_types.h --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/vm_basic_types.h 2008-01-28 08:02:47.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/vm_basic_types.h 2008-10-13 08:01:44.000000000 +0100 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998-2007 VMware, Inc. All rights reserved. + * Copyright (C) 1998-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 General Public License as published by the @@ -92,10 +92,6 @@ #pragma warning (disable :4305) // truncation from 'const int' to 'short' #pragma warning (disable :4244) // conversion from 'unsigned short' to 'unsigned char' #pragma warning (disable :4267) // truncation of 'size_t' -#if !defined VMX86_DEVEL // XXX until we clean up all the code -- edward -#pragma warning (disable :4133) // incompatible types - from 'struct VM *' to 'int *' -#pragma warning (disable :4047) // differs in levels of indirection -#endif #pragma warning (disable :4146) // unary minus operator applied to unsigned type, result still unsigned #pragma warning (disable :4142) // benign redefinition of type @@ -154,12 +150,16 @@ #include <stdlib.h> #endif +#ifdef __FreeBSD__ +#include <sys/param.h> /* For __FreeBSD_version */ +#endif + #if !defined(USING_AUTOCONF) # if defined(__FreeBSD__) || defined(sun) # ifdef KLD_MODULE # include <sys/types.h> # else -# if (BSD_VERSION >= 50) +# if !defined(VMKERNEL) && (__FreeBSD_version >= 500043) # include <inttypes.h> # include <sys/types.h> # else @@ -254,7 +254,12 @@ || (defined(_POSIX2_VERSION) && _POSIX2_VERSION >= 200112L) /* BSD/Darwin, Linux */ #define FMTSZ "z" - #define FMTPD "t" + + #if defined(VM_X86_64) || defined(__APPLE__) + #define FMTPD "l" + #else + #define FMTPD "" + #endif #else /* Systems with a pre-C99 libc */ #define FMTSZ "Z" @@ -338,8 +343,8 @@ * Type big enough to hold an integer between 0..100 */ typedef uint8 Percent; -#define asPercent(v) ((Percent)(v)) -#define CHOOSE_PERCENT asPercent(-1) +#define AsPercent(v) ((Percent)(v)) +#define CHOOSE_PERCENT AsPercent(101) typedef uintptr_t VA; @@ -371,6 +376,9 @@ typedef User_CartelID User_CartelGroupID; #define INVALID_CARTELGROUP_ID INVALID_CARTEL_ID +typedef uint32 Worldlet_ID; +#define INVALID_WORLDLET_ID ((Worldlet_ID)0) + /* world page number */ typedef uint32 WPN; @@ -381,6 +389,12 @@ #endif /* + * This type should be used for variables that contain sector + * position/quantity. + */ +typedef uint64 SectorType; + +/* * Linear address */ @@ -434,6 +448,7 @@ typedef VA32 UserVA32; typedef VA64 UserVA64; typedef UserVA32 UserVAConst; /* Userspace ptr to data that we may only read. */ +typedef UserVA64 UserVA64Const; /* Used by 64-bit syscalls until conversion is finished. */ #ifdef VMKERNEL typedef UserVA32 UserVA; #else @@ -447,10 +462,10 @@ * for any region other than buserror. */ #define PHYSMEM_MAX_PPN ((PPN)0xffffffff) -#define MAX_PPN ((PPN)0x0fffffff) /* Maximal observable PPN value. */ -#define INVALID_PPN ((PPN)-1) +#define MAX_PPN ((PPN)0x1fffffff) /* Maximal observable PPN value. */ +#define INVALID_PPN ((PPN)0xffffffff) -#define INVALID_BPN ((BPN) 0x3fffffff) /* BPNs don't use the high two bits. */ +#define INVALID_BPN ((BPN) 0x1fffffff) #define INVALID_MPN ((MPN)-1) #define MEMREF_MPN ((MPN)-2) @@ -480,8 +495,9 @@ # define FMTVPN "" #endif - +#ifndef EXTERN #define EXTERN extern +#endif #define CONST const @@ -631,6 +647,12 @@ # define PRINTF_DECL(fmtPos, varPos) #endif +#if defined(__GNUC__) +# define SCANF_DECL(fmtPos, varPos) __attribute__((__format__(__scanf__, fmtPos, varPos))) +#else +# define SCANF_DECL(fmtPos, varPos) +#endif + /* * UNUSED_PARAM should surround the parameter name and type declaration, * e.g. "int MyFunction(int var1, UNUSED_PARAM(int var2))" @@ -677,6 +699,52 @@ #endif /* + *********************************************************************** + * STRUCT_OFFSET_CHECK -- */ /** + * + * \brief Check if the actual offsef of a member in a structure + * is what is expected + * + * + * \param[in] STRUCT Structure the member is a part of. + * \param[in] MEMBER Member to check the offset of. + * \param[in] OFFSET Expected offset of MEMBER in STRUCTURE. + * \param[in] DEBUG_EXTRA Additional bytes to be added to OFFSET to + * compensate for extra info in debug builds. + * + *********************************************************************** + */ +#ifdef VMX86_DEBUG +#define STRUCT_OFFSET_CHECK(STRUCT, MEMBER, OFFSET, DEBUG_EXTRA) \ + ASSERT_ON_COMPILE(vmk_offsetof(STRUCT, MEMBER) == (OFFSET + DEBUG_EXTRA)) +#else +#define STRUCT_OFFSET_CHECK(STRUCT, MEMBER, OFFSET, DEBUG_EXTRA) \ + ASSERT_ON_COMPILE(vmk_offsetof(STRUCT, MEMBER) == OFFSET) +#endif + +/* + *********************************************************************** + * STRUCT_SIZE_CHECK -- */ /** + * + * \brief Check if the actual size of a structure is what is expected + * + * + * \param[in] STRUCT Structure whose size is to be checked. + * \param[in] SIZE Expected size of STRUCT. + * \param[in] DEBUG_EXTRA Additional bytes to be added to SIZE to + * compensate for extra info in debug builds. + * + *********************************************************************** + */ +#ifdef VMX86_DEBUG +#define STRUCT_SIZE_CHECK(STRUCT, SIZE, DEBUG_EXTRA) \ + ASSERT_ON_COMPILE(sizeof(STRUCT) == (SIZE + DEBUG_EXTRA)) +#else +#define STRUCT_SIZE_CHECK(STRUCT, SIZE, DEBUG_EXTRA) \ + ASSERT_ON_COMPILE(sizeof(STRUCT) == SIZE) +#endif + +/* * __func__ is a stringified function name that is part of the C99 standard. The block * below defines __func__ on older systems where the compiler does not support that * macro. @@ -831,4 +899,14 @@ typedef int PollDevHandle; #endif +/* + * Define the utf16_t type. + */ + +#if defined(_WIN32) && defined(_NATIVE_WCHAR_T_DEFINED) +typedef wchar_t utf16_t; +#else +typedef uint16 utf16_t; +#endif + #endif /* _VM_BASIC_TYPES_H_ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/vnops.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/vnops.c --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/vnops.c 2008-01-28 08:02:47.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/vnops.c 2008-10-13 08:01:43.000000000 +0100 @@ -41,37 +41,8 @@ #include "request.h" #include "state.h" #include "debug.h" - - -/* - * Macros - */ - -/* - * Hgfs permissions are similar to Unix permissions in that they both include - * bits for read vs. write vs. execute permissions. However, Hgfs is only - * concerned with file owners, meaning no "group" or "other" bits, so we need to - * translate between Hgfs and Unix permissions with a simple bitshift. The - * shift value corresponds to omitting the "group" and "other" bits. - */ -#define HGFS_ATTR_MODE_SHIFT 6 - -/* Sets the values of request headers properly */ -#define HGFS_INIT_REQUEST_HDR(request, req, _op) \ - do { \ - request->header.id = HgfsKReq_GetId(req); \ - request->header.op = _op; \ - } while(0) - -/* FreeBSD times support nsecs, so only use these functions directly */ -#define HGFS_SET_TIME(unixtm, nttime) \ - HgfsConvertFromNtTimeNsec(&unixtm, nttime) -#define HGFS_GET_TIME(unixtm) \ - HgfsConvertTimeSpecToNtTime(&unixtm) - -/* Determine if this is the root vnode. */ -#define HGFS_IS_ROOT_VNODE(sip, vp) \ - (sip->rootVnode == vp) +#include "fsutil.h" +#include "vnopscommon.h" /* @@ -96,37 +67,6 @@ static vop_reclaim_t HgfsVopReclaim; static vop_print_t HgfsVopPrint; -/* Local vnode functions */ -static int HgfsDirOpen(HgfsSuperInfo *sip, struct vnode *vp); -static int HgfsFileOpen(HgfsSuperInfo *sip, struct vnode *vp, - int flag, int permissions); -static int HgfsDirClose(HgfsSuperInfo *sip, struct vnode *vp); -static int HgfsFileClose(HgfsSuperInfo *sip, struct vnode *vp); -static int HgfsGetNextDirEntry(HgfsSuperInfo *sip, HgfsHandle handle, - uint32_t offset, char *nameOut, size_t nameSize, - HgfsFileType *type, Bool *done); -static int HgfsDoRead(HgfsSuperInfo *sip, HgfsHandle handle, uint64_t offset, - uint32_t size, struct uio *uiop); -static int HgfsDoWrite(HgfsSuperInfo *sip, HgfsHandle handle, int ioflag, - uint64_t offset, uint32_t size, struct uio *uiop); -static int HgfsDelete(HgfsSuperInfo *sip, const char *filename, HgfsOp op); - -/* Local utility functions */ -static int HgfsSubmitRequest(HgfsSuperInfo *sip, HgfsKReqHandle req); -static int HgfsValidateReply(HgfsKReqHandle req, uint32_t minSize); -static int HgfsEscapeBuffer(char const *bufIn, uint32 sizeIn, - uint32 sizeBufOut, char *bufOut); -static int HgfsUnescapeBuffer(char *bufIn, uint32 sizeIn); -static void HgfsAttrToBSD(struct vnode *vp, const HgfsAttr *hgfsAttr, - struct vattr *BSDAttr); -static Bool HgfsSetattrCopy(struct vattr *vap, HgfsAttr *hgfsAttr, - HgfsAttrChanges *update); -static int HgfsMakeFullName(const char *path, uint32_t pathLen, const char *file, - size_t fileLen, char *outBuf, ssize_t bufSize); -static int HgfsGetOpenMode(uint32 flags); -static int HgfsGetOpenFlags(uint32 flags); - - /* * Global data */ @@ -135,6 +75,7 @@ * HGFS vnode operations vector */ struct vop_vector HgfsVnodeOps = { + .vop_default = &default_vnodeops, .vop_lookup = HgfsVopLookup, .vop_create = HgfsVopCreate, .vop_open = HgfsVopOpen, @@ -152,29 +93,6 @@ .vop_inactive = HgfsVopInactive, .vop_reclaim = HgfsVopReclaim, .vop_print = HgfsVopPrint, - - /* - * The following operations are not supported directly by the Hgfs module, - * so we fall back to the kernel's default support routines. (Most cases - * return EOPNOTSUPP or EINVAL. - */ - .vop_advlock = VOP_EINVAL, - .vop_bmap = vop_stdbmap, - .vop_bypass = VOP_EOPNOTSUPP, - .vop_fsync = VOP_NULL, - .vop_getpages = vop_stdgetpages, - .vop_getwritemount = vop_stdgetwritemount, - .vop_ioctl = VOP_ENOTTY, - .vop_islocked = vop_stdislocked, - .vop_kqfilter = vop_stdkqfilter, - .vop_lease = VOP_NULL, - .vop_lock = vop_stdlock, - .vop_pathconf = VOP_EINVAL, - .vop_poll = vop_nopoll, - .vop_putpages = vop_stdputpages, - .vop_readlink = VOP_EINVAL, - .vop_revoke = VOP_PANIC, - .vop_unlock = vop_stdunlock, }; @@ -188,17 +106,15 @@ * * HgfsVopLookup -- * - * Looks in the provided directory for the specified filename. If we cannot - * determine the vnode locally (i.e, the vnode is not the root vnode of the - * filesystem or the provided dvp), we send a getattr request to the server - * and allocate a vnode and internal filesystem state for this file. + * Looks in the provided directory for the specified filename by calling + * HgfsLookupInt. * * Results: - * Returns zero on success and ENOENT if the file cannot be found - * If file is found, a vnode representing the file is returned in vpp. + * Returns zero on success and ENOENT if the file cannot be found + * If file is found, a vnode representing the file is returned in vpp. * * Side effects: - * None. + * None. * *---------------------------------------------------------------------------- */ @@ -217,220 +133,7 @@ struct vnode **vpp = ap->a_vpp; struct componentname *cnp = ap->a_cnp; - HgfsRequestGetattr *request; - HgfsReplyGetattr *reply; - HgfsSuperInfo *sip; - HgfsKReqHandle req; - char *path = NULL; // allocated from M_TEMP; free when done - int ret = 0, len = 0; - - DEBUG(VM_DEBUG_ENTRY, "HgfsVopLookup(%.*s, %.*s).\n", - HGFS_VP_TO_FILENAME_LENGTH(dvp), HGFS_VP_TO_FILENAME(dvp), - (int)cnp->cn_namelen, cnp->cn_nameptr); - - /* - * Get pointer to the superinfo. If the device is not attached, - * hgfsInstance will not be valid and we immediately return an error. - */ - sip = HGFS_VP_TO_SIP(dvp); - if (!sip) { - DEBUG(VM_DEBUG_FAIL, "couldn't acquire superinfo.\n"); - return EDOOFUS; - } - - /* Snag a pathname buffer */ - path = malloc(MAXPATHLEN, M_TEMP, M_WAITOK); - - /* Construct the full path for this lookup. */ - len = HgfsMakeFullName(HGFS_VP_TO_FILENAME(dvp), // Path to this file - HGFS_VP_TO_FILENAME_LENGTH(dvp), // Length of path - cnp->cn_nameptr, // File's name - cnp->cn_namelen, // Filename length - path, // Destination buffer - MAXPATHLEN); // Size of dest buffer - if (len < 0) { - ret = EINVAL; - goto out; - } - - DEBUG(VM_DEBUG_LOAD, "full path is \"%s\"\n", path); - - /* See if the lookup is really for the root vnode. */ - if (strcmp(path, "/") == 0) { - DEBUG(VM_DEBUG_INFO, "returning the root vnode.\n"); - *vpp = sip->rootVnode; - /* - * Note that this is the only vnode we maintain a reference count on; all - * others are per-open-file and should only be given to the Kernel once. - */ - vref(*vpp); - goto out; - } - - /* - * Now that we know the full filename, we can check our hash table for this - * file to prevent having to send a request to the Hgfs Server. If we do - * find this file in the hash table, this function will correctly create - * a vnode and other per-open state for us. - * - * On an 'ls -l', this saves sending two requests for each file in the - * directory. - * - * XXX - * Note that this optimization leaves open the possibility that a file that - * has been removed on the host will not be noticed as promptly by the - * filesystem. This shouldn't cause any problems, though, because as far - * as we can tell this function is invoked internally by the kernel before - * other operations. That is, this function is called implicitly for path - * traversal when user applications issue other system calls. The operation - * next performed on the vnode we create here should happen prior to - * returning to the user application, so if that next operation fails - * because the file has been deleted, the user won't see different behavior - * than if this optimization was not included. - */ - ret = HgfsFileNameToVnode(path, vpp, sip, sip->vfsp, &sip->fileHashTable); - if (ret == 0) { - /* - * The filename was in our hash table and we successfully created new - * per-open state for it. - */ - DEBUG(VM_DEBUG_DONE, "created per-open state from filename.\n"); - goto out; - } - - /* - * We don't have any reference to this vnode, so we must send a get - * attribute request to see if the file exists and create one. - */ - req = HgfsKReq_AllocateRequest(sip->reqs); - if (!req) { - return EIO; - } - - /* Fill in the header of this request. */ - request = (HgfsRequestGetattr *)HgfsKReq_GetPayload(req); - HGFS_INIT_REQUEST_HDR(request, req, HGFS_OP_GETATTR); - - /* Fill in the filename portion of the request. */ - ret = CPName_ConvertTo(path, MAXPATHLEN, request->fileName.name); - if (ret < 0) { - DEBUG(VM_DEBUG_FAIL, "CPName_ConvertTo failed.\n"); - ret = ENAMETOOLONG; - goto destroy_out; - } - ret = HgfsUnescapeBuffer(request->fileName.name, ret); - request->fileName.length = ret; - - /* Packet size includes the request and its payload. */ - HgfsKReq_SetPayloadSize(req, request->fileName.length + sizeof *request); - - DEBUG(VM_DEBUG_COMM, "sending getattr request for ID %d\n", - request->header.id); - DEBUG(VM_DEBUG_COMM, " fileName.length: %d\n", request->fileName.length); - DEBUG(VM_DEBUG_COMM, " fileName.name: \"%s\"\n", request->fileName.name); - - /* - * Submit the request and wait for the reply. HgfsSubmitRequest handles - * destroying the request on both error and interrupt cases. - */ - ret = HgfsSubmitRequest(sip, req); - if (ret) { - goto out; - } - - /* The reply is in the request's packet */ - reply = (HgfsReplyGetattr *)HgfsKReq_GetPayload(req); - - /* Validate the reply was COMPLETED and at least contains a header */ - if (HgfsValidateReply(req, sizeof reply->header) != 0) { - DEBUG(VM_DEBUG_FAIL, "invalid reply received for ID %d " - "with status %d.\n", reply->header.id, reply->header.status); - ret = EPROTO; - goto destroy_out; - } - - DEBUG(VM_DEBUG_COMM, "received reply for ID %d\n", reply->header.id); - DEBUG(VM_DEBUG_COMM, " status: %d (see hgfsProto.h)\n", reply->header.status); - DEBUG(VM_DEBUG_COMM, " file type: %d\n", reply->attr.type); - DEBUG(VM_DEBUG_COMM, " file size: %"FMT64"u\n", reply->attr.size); - DEBUG(VM_DEBUG_COMM, " permissions: %o\n", reply->attr.permissions); - - switch (reply->header.status) { - case HGFS_STATUS_SUCCESS: - /* Ensure packet contains correct amount of data */ - if (HgfsKReq_GetPayloadSize(req) != sizeof *reply) { - DEBUG(VM_DEBUG_COMM, - "HgfsLookup: invalid packet size received for \"%s\".\n", - cnp->cn_nameptr); - ret = EFAULT; - goto destroy_out; - } - /* Success */ - break; - - case HGFS_STATUS_OPERATION_NOT_PERMITTED: - DEBUG(VM_DEBUG_LOG, "operation not permitted on \"%s\".\n", - cnp->cn_nameptr); - ret = EACCES; - goto destroy_out; - - case HGFS_STATUS_NO_SUCH_FILE_OR_DIR: - case HGFS_STATUS_INVALID_NAME: - DEBUG(VM_DEBUG_LOG, "\"%s\" does not exist.\n", - cnp->cn_nameptr); - - /* - * If this is the final pathname component & the user is attempt a CREATE - * or RENAME, just return without a leaf vnode. (This differs from - * FreeBSD where ENOENT would be returned in all cases.) - */ - if ((cnp->cn_nameiop == CREATE || cnp->cn_nameiop == RENAME) && - cnp->cn_flags & ISLASTCN) { - ret = EJUSTRETURN; - } else { - ret = ENOENT; - } - goto destroy_out; - - default: - DEBUG(VM_DEBUG_LOG, "error on \"%s\".\n", cnp->cn_nameptr); - ret = EFAULT; - goto destroy_out; - } - - /* - * We need to create a vnode for this found file to give back to the Kernel. - * Note that v_mount of the filesystem's root vnode was set properly in - * HgfsMount(), so that value (dvp->v_mount) propagates down to each vnode. - */ - ret = HgfsVnodeGet(vpp, // Location to write vnode's address - sip, // Superinfo - dvp->v_mount, // VFS for our filesystem - dvp->v_op, // Vnode op vector - path, // Full name of the file - reply->attr.type, // Type of file - &sip->fileHashTable); // File hash table - - if (ret) { - DEBUG(VM_DEBUG_FAIL, "couldn't create vnode for \"%s\".\n", path); - ret = EFAULT; - goto destroy_out; - } - /* HgfsVnodeGet guarantees this. */ - ASSERT(*vpp); - - DEBUG(VM_DEBUG_LOAD, "assigned vnode %p to %s\n", *vpp, path); - - ret = 0; /* Return success */ - -destroy_out: - HgfsKReq_ReleaseRequest(sip->reqs, req); - -out: - if (path != NULL) { - free(path, M_TEMP); - } - return ret; + return HgfsLookupInt(dvp, vpp, cnp); } @@ -439,18 +142,15 @@ * * HgfsVopCreate -- * - * This entry point is invoked when a user calls open(2) with the O_CREAT - * flag specified. The kernel calls our open entry point (HgfsOpen()) after - * calling this function, so here all we do is consruct the vnode and - * save the filename and permission bits for the file to be created within - * our filesystem internal state. + * This entry point is invoked when a user calls open(2) with the O_CREAT + * flag specified. We simply call HgfsCreateInt which does the file + * creation work in a FreeBSD / Mac OS independent way. * * Results: - * Returns zero on success and an appropriate error code on error. + * Returns zero on success and an appropriate error code on error. * * Side effects: - * If the file exists, the vnode is duplicated since they are kepy per-open. - * If the file doesn't exist, a vnode will be created. + * If the file doesn't exist, a vnode will be created. * *---------------------------------------------------------------------------- */ @@ -470,54 +170,7 @@ struct componentname *cnp = ap->a_cnp; struct vattr *vap = ap->a_vap; - HgfsSuperInfo *sip = HGFS_VP_TO_SIP(dvp); - char *fullname = NULL; // allocated from M_TEMP; free when done. - int ret = 0; - - if (*vpp != NULL) { - DEBUG(VM_DEBUG_ALWAYS, "vpp (%p) not null\n", vpp); - } - - /* - * There are two cases: either the file already exists or it doesn't. If - * the file exists already then *vpp points to its vnode that was allocated - * in HgfsLookup(). In both cases we need to create a new vnode (since our - * vnodes are per-open-file, not per-file), but we don't need to construct - * the full name again if we already have it in the existing vnode. - */ - fullname = malloc(MAXPATHLEN, M_TEMP, M_WAITOK); - - ret = HgfsMakeFullName(HGFS_VP_TO_FILENAME(dvp), // Name of directory to create in - HGFS_VP_TO_FILENAME_LENGTH(dvp), // Length of name - cnp->cn_nameptr, // Name of file to create - cnp->cn_namelen, // Length of new filename - fullname, // Buffer to write full name - MAXPATHLEN); // Size of this buffer - - if (ret < 0) { - DEBUG(VM_DEBUG_FAIL, "couldn't create full path name.\n"); - ret = ENAMETOOLONG; - goto out; - } - - /* Create the vnode for this file. */ - ret = HgfsVnodeGet(vpp, sip, dvp->v_mount, dvp->v_op, fullname, - HGFS_FILE_TYPE_REGULAR, &sip->fileHashTable); - if (ret) { - goto out; - } - - /* HgfsVnodeGet() guarantees this. */ - ASSERT(*vpp); - - /* Save the mode so when open is called we can reference it. */ - HgfsSetOpenFileMode(*vpp, vap->va_mode); - -out: - if (fullname != NULL) { - free(fullname, M_TEMP); - } - return ret; + return HgfsCreateInt(dvp, vpp, cnp, vap->va_mode); } @@ -526,21 +179,21 @@ * * HgfsVopOpen -- * - * Invoked when open(2) is called on a file in our filesystem. Sends an - * OPEN request to the Hgfs server with the filename of this vnode. + * Invoked when open(2) is called on a file in our filesystem. Sends an + * OPEN request to the Hgfs server with the filename of this vnode. * - * "Opens a file referenced by the supplied vnode. The open() system call - * has already done a vop_lookup() on the path name, which returned a vnode - * pointer and then calls to vop_open(). This function typically does very - * little since most of the real work was performed by vop_lookup()." - * (Solaris Internals, p537) + * "Opens a file referenced by the supplied vnode. The open() system call + * has already done a vop_lookup() on the path name, which returned a vnode + * pointer and then calls to vop_open(). This function typically does very + * little since most of the real work was performed by vop_lookup()." + * (Solaris Internals, p537) * * Results: - * Returns 0 on success and an error code on error. + * Returns 0 on success and an error code on error. * * Side effects: - * The HgfsOpenFile for this file is given a handle that can be used on - * future read and write requests. + * The HgfsOpenFile for this file is given a handle that can be used on + * future read and write requests. * *---------------------------------------------------------------------------- */ @@ -560,41 +213,7 @@ struct vnode *vp = ap->a_vp; int mode = ap->a_mode; - HgfsSuperInfo *sip = HGFS_VP_TO_SIP(vp); - - /* - * Each lookup should return its own vnode, so if we've been given a vnode - * already in possession of a handle, something is awry. - */ - ASSERT(HgfsHandleIsSet(vp) == FALSE); - - switch(vp->v_type) { - case VDIR: - DEBUG(VM_DEBUG_COMM, "opening a directory\n"); - return HgfsDirOpen(sip, vp); - - case VREG: - { - HgfsMode hmode = 0; - - /* - * If HgfsCreate() was called prior to this, this fills in the mode we - * saved there. It's okay if this fails since often HgfsCreate() - * won't have been called. - */ - HgfsGetOpenFileMode(vp, &hmode); - - DEBUG(VM_DEBUG_COMM, "opening a file with flag %x\n", mode); - return HgfsFileOpen(sip, vp, mode, hmode); - } - - default: - DEBUG(VM_DEBUG_FAIL, - "HgfsOpen: unrecognized file of type %d.\n", vp->v_type); - return EINVAL; - } - - return 0; + return HgfsOpenInt(vp, mode); } @@ -603,19 +222,16 @@ * * HgfsVopClose -- * - * Invoked when a user calls close(2) on a file in our filesystem. Sends - * a CLOSE request to the Hgfs server with the filename of this vnode. + * Invoked when a user calls close(2) on a file in our filesystem. * - * "Closes the file given by the supplied vnode. When this is the last - * close, some filesystems use vop_close() to initiate a writeback of - * outstanding dirty pages by checking the reference cound in the vnode." - * (Solaris Internals, p536) + * Calls HgfsCloseInt which handles the close in a FreeBSD / Mac OS + * independent way. * * Results: - * Returns 0 on success and an error code on error. + * Returns 0 on success and an error code on error. * * Side effects: - * + * None. * *---------------------------------------------------------------------------- */ @@ -632,27 +248,44 @@ */ { struct vnode *vp = ap->a_vp; - HgfsSuperInfo *sip = HGFS_VP_TO_SIP(vp); + int fflag = ap->a_fflag; + struct vnode *rootVnode; + int ret = 0; + + /* + * According to the FreeBSD manpage, VOP_CLOSE can be called with or + * without a lock held on vp. However, in the FreeBSD 6.2 source code, + * the only place that VOP_CLOSE is called without a lock held is in + * kern/vfs_subr.c::vgone1 and only if the vnode is not already doomed with the + * VI_DOOMED flag. In addition, the VFS layer will not acquire a vnode lock + * on a doomed vnode (kern/vfs_vnops.c::vn_lock). This means that there is no need + * to do any locking here as this function will always be called in a serial manner. + */ /* - * If we are closing a directory we need to send a SEARCH_CLOSE request, - * but if we are closing a regular file we need to send a CLOSE request. - * Other file types are not supported by the Hgfs protocol. + * A problem exists where vflush (on unmount) calls close on the root vnode without + * first having calling open. + * Here is the problematic sequence of events: + * 1. HgfsVfsUnmount calls vflush with 1 v_usecount ref on the rootVnode (the one from mount). + * 2. vflush calls vgone on the root vnode because rootrefs (in FreeBSD vflush code) + * is > 0. + * 3. vgone calls VOP_CLOSE because the root vnode has a v_usecount == 1. + * The problem is that there was never an open to match the close. This means that when + * HgfsCloseInt tries decrement the handle reference count, it will go negative (in addition + * to sending a bad close to the hgfs server). To handle this situation, look for this + * specific case (which only happens on FreeBSD) and do not call HgfsCloseInt. */ - switch (vp->v_type) { - case VDIR: - return HgfsDirClose(sip, vp); - - case VREG: - return HgfsFileClose(sip, vp); - - default: - DEBUG(VM_DEBUG_FAIL, "unsupported filetype %d.\n", vp->v_type); - return EINVAL; + rootVnode = HGFS_VP_TO_SIP(vp)->rootVnode; + if ((rootVnode == vp) && (rootVnode->v_usecount == 1)) { + DEBUG(VM_DEBUG_LOG, "Skipping final close on rootVnode\n"); + goto out; } - return 0; + ret = HgfsCloseInt(vp, fflag); + +out: + return ret; } @@ -661,18 +294,18 @@ * * HgfsVopAccess -- * - * This function is invoked when the user calls access(2) on a file in our - * filesystem. It checks to ensure the user has the specified type of - * access to the file. + * This function is invoked when the user calls access(2) on a file in our + * filesystem. It checks to ensure the user has the specified type of + * access to the file. * - * We send a GET_ATTRIBUTE request by calling HgfsGetattr() to get the mode - * (permissions) for the provided vnode. + * We send a GET_ATTRIBUTE request by calling HgfsGetattr() to get the mode + * (permissions) for the provided vnode. * * Results: - * Returns 0 if access is allowed and a non-zero error code otherwise. + * Returns 0 if access is allowed and a non-zero error code otherwise. * * Side effects: - * None. + * None. * *---------------------------------------------------------------------------- */ @@ -688,50 +321,10 @@ }; */ { - struct vop_getattr_args ga; - struct vattr va; + struct vnode *vp = ap->a_vp; int mode = ap->a_mode; - int ret = 0; - /* Build VOP_GETATTR argument container */ - ga.a_vp = ap->a_vp; - ga.a_vap = &va; - ga.a_cred = ap->a_cred; - ga.a_td = ap->a_td; - - /* Get the attributes for this file from the Hgfs server. */ - ret = HgfsVopGetattr(&ga); - if (ret) { - return ret; - } - - DEBUG(VM_DEBUG_INFO, "vp's mode: %o\n", va.va_mode); - - /* - * mode is the desired access from the caller, and is composed of S_IREAD, - * S_IWRITE, and S_IEXEC from <sys/stat.h>. Since the mode of the file is - * guaranteed to only contain owner permissions (by the Hgfs server), we - * don't need to shift any bits. - */ - if ((mode & S_IREAD) && !(va.va_mode & S_IREAD)) { - DEBUG(VM_DEBUG_FAIL, "read access not allowed (%s).\n", - HGFS_VP_TO_FILENAME(ap->a_vp)); - return EPERM; - } - - if ((mode & S_IWRITE) && !(va.va_mode & S_IWRITE)) { - DEBUG(VM_DEBUG_FAIL, "write access not allowed (%s).\n", - HGFS_VP_TO_FILENAME(ap->a_vp)); - return EPERM; - } - - if ((mode & S_IEXEC) && !(va.va_mode & S_IEXEC)) { - DEBUG(VM_DEBUG_FAIL, "execute access not allowed (%s).\n", - HGFS_VP_TO_FILENAME(ap->a_vp)); - return EPERM; - } - - return 0; + return HgfsAccessInt(vp, mode); } @@ -740,13 +333,13 @@ * * HgfsVopGetattr -- * - * "Gets the attributes for the supplied vnode." (Solaris Internals, p536) + * "Gets the attributes for the supplied vnode." (Solaris Internals, p536) * * Results: - * Zero if successful, an errno-type value otherwise. + * Zero if successful, an errno-type value otherwise. * * Side effects: - * + * None. * *---------------------------------------------------------------------------- */ @@ -765,91 +358,7 @@ struct vnode *vp = ap->a_vp; struct vattr *vap = ap->a_vap; - HgfsSuperInfo *sip = HGFS_VP_TO_SIP(vp); - HgfsKReqHandle req; - HgfsRequestGetattr *request; - HgfsReplyGetattr *reply; - int ret; - - DEBUG(VM_DEBUG_ENTRY, "HgfsGetattr().\n"); - - req = HgfsKReq_AllocateRequest(sip->reqs); - if (!req) { - return EIO; - } - - request = (HgfsRequestGetattr *)HgfsKReq_GetPayload(req); - HGFS_INIT_REQUEST_HDR(request, req, HGFS_OP_GETATTR); - - /* - * Now we need to convert the filename to cross-platform and unescaped - * format. - */ - ret = CPName_ConvertTo(HGFS_VP_TO_FILENAME(vp), MAXPATHLEN, request->fileName.name); - if (ret < 0) { - DEBUG(VM_DEBUG_FAIL, "CPName_ConvertTo failed.\n"); - ret = ENAMETOOLONG; - goto destroy_out; - } - - ret = HgfsUnescapeBuffer(request->fileName.name, ret); /* cannot fail */ - request->fileName.length = ret; - - HgfsKReq_SetPayloadSize(req, sizeof *request + request->fileName.length); - - /* - * Now submit request and wait for reply. The request's state will be - * properly set to COMPLETED, ERROR, or ABANDONED after calling - * HgfsSubmitRequest() - */ - ret = HgfsSubmitRequest(sip, req); - if (ret) { - /* HgfsSubmitRequest destroys the request if necessary */ - goto out; - } - - reply = (HgfsReplyGetattr *)HgfsKReq_GetPayload(req); - - if (HgfsValidateReply(req, sizeof reply->header) != 0) { - DEBUG(VM_DEBUG_FAIL, "reply not valid.\n"); - ret = EPROTO; - goto destroy_out; - } - - switch (reply->header.status) { - case HGFS_STATUS_SUCCESS: - /* Make sure we got all of the attributes */ - if (HgfsKReq_GetPayloadSize(req) != sizeof *reply) { - DEBUG(VM_DEBUG_FAIL, "packet too small.\n"); - ret = EFAULT; - break; - } - - DEBUG(VM_DEBUG_COMM, "received reply for ID %d\n", - reply->header.id); - DEBUG(VM_DEBUG_COMM, " status: %d (see hgfsProto.h)\n", - reply->header.status); - DEBUG(VM_DEBUG_COMM, " file type: %d\n", reply->attr.type); - DEBUG(VM_DEBUG_COMM, " file size: %"FMT64"u\n", reply->attr.size); - DEBUG(VM_DEBUG_COMM, " permissions: %o\n", reply->attr.permissions); - DEBUG(VM_DEBUG_COMM, "filename %s\n", HGFS_VP_TO_FILENAME(vp)); - - /* Map the Hgfs attributes into the FreeBSD attributes */ - HgfsAttrToBSD(vp, &reply->attr, vap); - - DEBUG(VM_DEBUG_DONE, "done.\n"); - break; - - /* We'll add other error codes based on status here */ - default: - ret = EFAULT; - break; - } - -destroy_out: - HgfsKReq_ReleaseRequest(sip->reqs, req); -out: - return ret; + return HgfsGetattrInt(vp, vap); } @@ -858,16 +367,16 @@ * * HgfsVopSetattr -- * - * Maps the FreeBSD attributes to Hgfs attributes (by calling - * HgfsSetattrCopy()) and sends a set attribute request to the Hgfs server. + * Maps the FreeBSD attributes to Hgfs attributes (by calling + * HgfsSetattrCopy()) and sends a set attribute request to the Hgfs server. * - * "Sets the attributes for the supplied vnode." (Solaris Internals, p537) + * "Sets the attributes for the supplied vnode." (Solaris Internals, p537) * * Results: - * Returns 0 on success and a non-zero error code on error. + * Returns 0 on success and a non-zero error code on error. * * Side effects: - * The file on the host will have new attributes. + * The file on the host will have new attributes. * *---------------------------------------------------------------------------- */ @@ -886,125 +395,8 @@ struct vnode *vp = ap->a_vp; struct vattr *vap = ap->a_vap; - HgfsSuperInfo *sip; - HgfsKReqHandle req; - HgfsRequestSetattr *request; - HgfsReplySetattr *reply; - int ret; - - sip = HGFS_VP_TO_SIP(vp); - - DEBUG(VM_DEBUG_ENTRY, "Called for %.*s\n", - HGFS_VP_TO_FILENAME_LENGTH(vp), HGFS_VP_TO_FILENAME(vp)); - - /* - * As per HgfsSetattrCopy, Hgfs supports changing these attributes: permissions/mode - * bits (va_mode), size (va_size), and access/write times (va_atime/va_mtime). All - * other attributes are either ones that Hgfs does not know how to set, or ones that - * it doesn't make sense to set at all. - * - * Because FreeBSD can pass in va_filerev = 0 and va_vaflags = 0 when doing setattr - * after creating a file, we ignore those values as well. - * - * (VNON is used for va_type instead of VNOVAL, as it denotes a file type of - * "None"). - */ - if ((vap->va_type != VNON) || (vap->va_nlink != VNOVAL) || - (vap->va_fsid != VNOVAL) || (vap->va_fileid != VNOVAL) || - (vap->va_blocksize != VNOVAL) || (vap->va_rdev != VNOVAL) || - ((int)vap->va_bytes != VNOVAL) || (vap->va_gen != VNOVAL) || - ((vap->va_filerev != VNOVAL) && (vap->va_filerev != 0)) || - (vap->va_flags != VNOVAL) || - ((vap->va_vaflags != VNOVAL) && (vap->va_vaflags != 0))) { - DEBUG(VM_DEBUG_FAIL, - "HgfsSetattr: You are not allowed to set one of those attributes.\n" - "va_type = %d, va_nlink = %d, va_fsid = %d, va_fileid = %d\n" - "va_blocksize = %d, va_rdev = %d, va_bytes = %d, va_gen = %d\n" - "va_filerev = %d, va_flags = %d, va_vaflags = %d\n", - vap->va_type, vap->va_nlink, vap->va_fsid, (int)vap->va_fileid, - (int)vap->va_blocksize, vap->va_rdev, (int)vap->va_bytes, - (int)vap->va_gen, (int)vap->va_filerev, (int)vap->va_flags, vap->va_vaflags); - return EINVAL; - } - - req = HgfsKReq_AllocateRequest(sip->reqs); - if (!req) { - return EIO; - } - - request = (HgfsRequestSetattr *)HgfsKReq_GetPayload(req); - HGFS_INIT_REQUEST_HDR(request, req, HGFS_OP_SETATTR); + return HgfsSetattrInt(vp, vap); - /* - * Fill the attributes and update fields of the request. If no updates are - * needed then we will just return success without sending the request. - */ - if (HgfsSetattrCopy(vap, &request->attr, &request->update) == FALSE) { - DEBUG(VM_DEBUG_DONE, "don't need to update attributes.\n"); - ret = 0; - goto destroy_out; - } - - /* Convert the filename to cross platform and escape its buffer. */ - ret = CPName_ConvertTo(HGFS_VP_TO_FILENAME(vp), MAXPATHLEN, request->fileName.name); - if (ret < 0) { - DEBUG(VM_DEBUG_FAIL, "CPName_ConvertTo failed.\n"); - ret = ENAMETOOLONG; - goto destroy_out; - } - - ret = HgfsUnescapeBuffer(request->fileName.name, ret); - request->fileName.length = ret; - - /* The request's size includes the request and filename. */ - HgfsKReq_SetPayloadSize(req, sizeof *request + request->fileName.length); - - if (request->update) { - ret = HgfsSubmitRequest(sip, req); - if (ret) { - /* HgfsSubmitRequest() destroys the request if necessary. */ - goto out; - } - - reply = (HgfsReplySetattr *)HgfsKReq_GetPayload(req); - - if (HgfsValidateReply(req, sizeof *reply) != 0) { - DEBUG(VM_DEBUG_FAIL, "invalid reply received.\n"); - ret = EPROTO; - goto destroy_out; - } - - switch(reply->header.status) { - case HGFS_STATUS_SUCCESS: - /* Success handled after switch. */ - break; - - case HGFS_STATUS_NO_SUCH_FILE_OR_DIR: - case HGFS_STATUS_INVALID_NAME: - DEBUG(VM_DEBUG_FAIL, "no such file or directory.\n"); - ret = ENOENT; - goto destroy_out; - - case HGFS_STATUS_OPERATION_NOT_PERMITTED: - DEBUG(VM_DEBUG_FAIL, "operation not permitted.\n"); - ret = EPERM; - goto destroy_out; - - default: - DEBUG(VM_DEBUG_FAIL, "default error.\n"); - ret = EPROTO; - goto destroy_out; - } - } /* else { they were trying to set filerev or vaflags, which we ignore } */ - - /* Success */ - ret = 0; - DEBUG(VM_DEBUG_DONE, "done.\n"); - -destroy_out: - HgfsKReq_ReleaseRequest(sip->reqs, req); -out: - return ret; } @@ -1013,21 +405,13 @@ * * HgfsVopRead -- * - * Invoked when a user calls read(2) on a file in our filesystem. - * - * We call HgfsDoRead() to fill the user's buffer until the request is met - * or the file has no more data. This is done since we can only transfer - * HGFS_IO_MAX bytes in any one request. - * - * "Reads the range supplied for the given vnode. vop_read() typically - * maps the requested range of a file into kernel memory and then uses - * vop_getpage() to do the real work." (Solaris Internals, p537) + * Invoked when a user calls read(2) on a file in our filesystem. * * Results: - * Returns zero on success and an error code on failure. + * Returns zero on success and an error code on failure. * * Side effects: - * None. + * None. * *---------------------------------------------------------------------------- */ @@ -1046,86 +430,7 @@ struct vnode *vp = ap->a_vp; struct uio *uiop = ap->a_uio; - HgfsSuperInfo *sip = HGFS_VP_TO_SIP(vp); - HgfsHandle handle; - uint64_t offset; - int ret; - - DEBUG(VM_DEBUG_ENTRY, "entry.\n"); - - /* We can't read from directories, that's what readdir() is for. */ - if (vp->v_type == VDIR) { - DEBUG(VM_DEBUG_FAIL, "cannot read directories.\n"); - return EISDIR; - } - - /* off_t is a signed quantity */ - if (uiop->uio_offset < 0) { - DEBUG(VM_DEBUG_FAIL, "given negative offset.\n"); - return EINVAL; - } - - /* This is where the user wants to start reading from in the file. */ - offset = uiop->uio_offset; - - /* - * We need to get the handle for the requests sent to the Hgfs server. Note - * that this is guaranteed to not change until a close(2) is called on this - * vnode, so it's safe and correct to acquire it outside the loop below. - */ - ret = HgfsGetOpenFileHandle(vp, &handle); - if (ret) { - DEBUG(VM_DEBUG_FAIL, "could not get handle.\n"); - return EINVAL; - } - - /* - * Here we loop around HgfsDoRead with requests less than or equal to - * HGFS_IO_MAX until one of the following conditions is met: - * (1) All the requested data has been read - * (2) The file has no more data - * (3) An error occurred - * - * Since HgfsDoRead() calls uiomove(9), we know condition (1) is met when - * the uio structure's uio_resid is decremented to zero. If HgfsDoRead() - * returns 0 we know condition (2) was met, and if it returns less than 0 we - * know condtion (3) was met. - */ - do { - uint32_t size; - - DEBUG(VM_DEBUG_INFO, "offset=%"FMT64"d, uio_offset=%jd\n", - offset, uiop->uio_offset); - DEBUG(VM_DEBUG_HANDLE, "** handle=%d, file=%s\n", - handle, HGFS_VP_TO_FILENAME(vp)); - - /* Request at most HGFS_IO_MAX bytes */ - size = (uiop->uio_resid > HGFS_IO_MAX) ? HGFS_IO_MAX : uiop->uio_resid; - - /* Send one read request. */ - ret = HgfsDoRead(sip, handle, offset, size, uiop); - if (ret == 0) { - /* On end of file we return success */ - DEBUG(VM_DEBUG_DONE, "end of file reached.\n"); - return 0; - } else if (ret < 0) { - /* - * HgfsDoRead() returns the negative of an appropriate error code to - * differentiate between success and error cases. We flip the sign - * and return the appropriate error code. See the HgfsDoRead() - * function header for a fuller explanation. - */ - DEBUG(VM_DEBUG_FAIL, "HgfsDoRead() failed.\n"); - return -ret; - } - - /* Bump the offset past where we have already read. */ - offset += ret; - } while (uiop->uio_resid); - - /* We fulfilled the user's read request, so return success. */ - DEBUG(VM_DEBUG_DONE, "done.\n"); - return 0; + return HgfsReadInt(vp, uiop); } @@ -1134,20 +439,14 @@ * * HgfsVopWrite -- * - * This is invoked when a user calls write(2) on a file in our filesystem. + * This is invoked when a user calls write(2) on a file in our filesystem. * - * We call HgfsDoWrite() once with requests less than or equal to - * HGFS_IO_MAX bytes until the user's write request has completed. - * - * "Writes the range supplied for the given vnode. The write system call - * typically maps the requested range of a file into kernel memory and then - * uses vop_putpage() to do the real work." (Solaris Internals, p538) * * Results: - * Returns 0 on success and error code on error. + * Returns 0 on success and error code on error. * * Side effects: - * None. + * None. * *---------------------------------------------------------------------------- */ @@ -1167,76 +466,7 @@ struct uio *uiop = ap->a_uio; int ioflag = ap->a_ioflag; - HgfsSuperInfo *sip = HGFS_VP_TO_SIP(vp); - HgfsHandle handle; - uint64_t offset; - int ret; - - DEBUG(VM_DEBUG_ENTRY, "entry. (vp=%p)\n", vp); - DEBUG(VM_DEBUG_INFO, "***ioflag=%x, uio_resid=%d\n", - ioflag, uiop->uio_resid); - - /* Skip write requests for 0 bytes. */ - if (uiop->uio_resid == 0) { - DEBUG(VM_DEBUG_INFO, "write of 0 bytes requested.\n"); - return 0; - } - - DEBUG(VM_DEBUG_INFO, "file is %s\n", HGFS_VP_TO_FILENAME(vp)); - - /* Off_t is a signed type. */ - if (uiop->uio_offset < 0) { - DEBUG(VM_DEBUG_FAIL, "given negative offset.\n"); - return EINVAL; - } - - /* This is where the user will begin writing into the file. */ - offset = uiop->uio_offset; - - /* Get the handle we need to supply the Hgfs server. */ - ret = HgfsGetOpenFileHandle(vp, &handle); - if (ret) { - DEBUG(VM_DEBUG_FAIL, "could not get handle.\n"); - return EINVAL; - } - - /* - * We loop around calls to HgfsDoWrite() until either (1) we have written all - * of our data or (2) an error has occurred. uiop->uio_resid is decremented - * by uiomove(9F) inside HgfsDoWrite(), so condition (1) is met when it - * reaches zero. Condition (2) occurs when HgfsDoWrite() returns less than - * zero. - */ - do { - uint32_t size; - - DEBUG(VM_DEBUG_INFO, "** offset=%"FMT64"d, uio_offset=%jd\n", - offset, uiop->uio_offset); - DEBUG(VM_DEBUG_HANDLE, "** handle=%d, file=%s\n", - handle, HGFS_VP_TO_FILENAME(vp)); - - /* Write at most HGFS_IO_MAX bytes. */ - size = (uiop->uio_resid > HGFS_IO_MAX) ? HGFS_IO_MAX : uiop->uio_resid; - - /* Send one write request. */ - ret = HgfsDoWrite(sip, handle, ioflag, offset, size, uiop); - if (ret < 0) { - /* - * As in HgfsRead(), we need to flip the sign. See the comment in the - * function header of HgfsDoWrite() for a more complete explanation. - */ - DEBUG(VM_DEBUG_INFO, "HgfsDoWrite failed, returning %d\n", -ret); - return -ret; - } - - /* Increment the offest by the amount already written. */ - offset += ret; - - } while (uiop->uio_resid); - - /* We have completed the user's write request, so return success. */ - DEBUG(VM_DEBUG_DONE, "done.\n"); - return 0; + return HgfsWriteInt(vp, uiop, ioflag); } @@ -1245,17 +475,17 @@ * * HgfsVopRemove -- * - * Composes the full pathname of this file and sends a DELETE_FILE request - * by calling HgfsDelete(). + * Composes the full pathname of this file and sends a DELETE_FILE request + * by calling HgfsDelete(). * - * "Removes the file for the supplied vnode." (Solaris Internals, p537) + * "Removes the file for the supplied vnode." (Solaris Internals, p537) * * Results: - * Returns 0 on success or a non-zero error code on error. + * Returns 0 on success or a non-zero error code on error. * * Side effects: - * If successful, the file specified will be deleted from the host's - * filesystem. + * If successful, the file specified will be deleted from the host's + * filesystem. * *---------------------------------------------------------------------------- */ @@ -1271,17 +501,7 @@ { struct vnode *vp = ap->a_vp; - HgfsSuperInfo *sip = HGFS_VP_TO_SIP(vp); - - DEBUG(VM_DEBUG_ENTRY, "HgfsRemove().\n"); - - /* Removing directories is a no-no; save that for VOP_RMDIR. */ - if (vp->v_type == VDIR) { - return EPERM; - } - - /* We can now send the delete request. */ - return HgfsDelete(sip, HGFS_VP_TO_FILENAME(vp), HGFS_OP_DELETE_FILE); + return HgfsRemoveInt(vp); } @@ -1290,15 +510,15 @@ * * HgfsVopRename -- * - * Renames the provided source name in the source directory with the - * destination name in the destination directory. A RENAME request is sent - * to the Hgfs server. + * Renames the provided source name in the source directory with the + * destination name in the destination directory. A RENAME request is sent + * to the Hgfs server. * * Results: - * Returns 0 on success and an error code on error. + * Returns 0 on success and an error code on error. * * Side effects: - * None. + * None. * *---------------------------------------------------------------------------- */ @@ -1322,147 +542,17 @@ struct vnode *tvp = ap->a_tvp; struct componentname *tcnp = ap->a_tcnp; - HgfsSuperInfo *sip = HGFS_VP_TO_SIP(fdvp); - HgfsKReqHandle req; - HgfsRequestRename *request; - HgfsReplyRename *reply; - HgfsFileName *newNameP; - char *srcFullPath = NULL; // will point to fvp's filename; don't free - char *dstFullPath = NULL; // allocated from M_TEMP; free when done. - int ret = 0; - - /* No cross-device renaming. */ - if (fvp->v_mount != tdvp->v_mount) { - return EXDEV; - } - - /* Make the full path of the source. */ - srcFullPath = HGFS_VP_TO_FILENAME(fvp); - - /* Make the full path of the destination. */ - dstFullPath = malloc(MAXPATHLEN, M_TEMP, M_WAITOK); - ret = HgfsMakeFullName(HGFS_VP_TO_FILENAME(tdvp), HGFS_VP_TO_FILENAME_LENGTH(tdvp), - tcnp->cn_nameptr, tcnp->cn_namelen, dstFullPath, MAXPATHLEN); - if (ret < 0) { - DEBUG(VM_DEBUG_FAIL, "could not construct full path of dest.\n"); - ret = ENAMETOOLONG; - goto out; - } - - /* Ensure both names will fit in one request. */ - if ((sizeof *request + strlen(srcFullPath) + strlen(dstFullPath)) - > HGFS_PACKET_MAX) { - DEBUG(VM_DEBUG_FAIL, "names too big for one request.\n"); - ret = EPROTO; - goto out; - } - - /* - * Now we can prepare and send the request. - */ - req = HgfsKReq_AllocateRequest(sip->reqs); - if (!req) { - ret = EIO; - goto out; - } - - request = (HgfsRequestRename *)HgfsKReq_GetPayload(req); - HGFS_INIT_REQUEST_HDR(request, req, HGFS_OP_RENAME); - - /* Convert the source to cross platform and unescape its buffer. */ - ret = CPName_ConvertTo(srcFullPath, MAXPATHLEN, request->oldName.name); - if (ret < 0) { - DEBUG(VM_DEBUG_FAIL, - "HgfsRename: couldn't convert source to cross platform name.\n"); - ret = ENAMETOOLONG; - goto destroy_out; - } - ret = HgfsUnescapeBuffer(request->oldName.name, ret); - request->oldName.length = ret; + int ret; /* - * The new name is placed directly after the old name in the packet and we - * access it through this pointer. + * Note that fvp and fdvp are not locked when called by the VFS layer. However, + * this does not matter for the HgfsRenameInt implementaiton which does not use + * the handle or mode from the HgfsOpenFile (the two things that can change in an + * HgfsOpenFile struct). So while a normal VFS implementation would lock at least fvp + * here, this one does not. */ - newNameP = (HgfsFileName *)((char *)&request->oldName + - sizeof request->oldName + - request->oldName.length); - - /* Convert the destination to cross platform and unescape its buffer. */ - ret = CPName_ConvertTo(dstFullPath, MAXPATHLEN, newNameP->name); - if (ret < 0) { - DEBUG(VM_DEBUG_FAIL, - "HgfsRename: couldn't convert destination to cross platform name.\n"); - ret = ENAMETOOLONG; - goto destroy_out; - } - - ret = HgfsUnescapeBuffer(newNameP->name, ret); - newNameP->length = ret; - - /* The request's size includes the request and both filenames. */ - HgfsKReq_SetPayloadSize(req, sizeof *request + request->oldName.length + newNameP->length); - - ret = HgfsSubmitRequest(sip, req); - if (ret) { - /* HgfsSubmitRequest() destroys the request if necessary. */ - goto out; - } - - reply = (HgfsReplyRename *)HgfsKReq_GetPayload(req); - - /* Validate the reply's state and size. */ - if (HgfsValidateReply(req, sizeof *reply) != 0) { - DEBUG(VM_DEBUG_FAIL, "invalid reply received.\n"); - ret = EPROTO; - goto destroy_out; - } - - /* Return appropriate value. */ - switch (reply->header.status) { - case HGFS_STATUS_SUCCESS: - /* Handled after switch. */ - break; - - case HGFS_STATUS_OPERATION_NOT_PERMITTED: - DEBUG(VM_DEBUG_FAIL, "operation not permitted.\n"); - ret = EACCES; - goto destroy_out; - - case HGFS_STATUS_NOT_DIRECTORY: - DEBUG(VM_DEBUG_FAIL, "not a directory.\n"); - ret = ENOTDIR; - goto destroy_out; - - case HGFS_STATUS_DIR_NOT_EMPTY: - DEBUG(VM_DEBUG_FAIL, "directory not empty.\n"); - ret = EEXIST; - goto destroy_out; - - case HGFS_STATUS_NO_SUCH_FILE_OR_DIR: - case HGFS_STATUS_INVALID_NAME: - DEBUG(VM_DEBUG_FAIL, "no such file or directory.\n"); - ret = ENOENT; - goto destroy_out; - - default: - DEBUG(VM_DEBUG_FAIL, "default error.\n"); - ret = EPROTO; - goto destroy_out; - } - - - /* Successfully renamed file. */ - ret = 0; - DEBUG(VM_DEBUG_DONE, "done.\n"); - -destroy_out: - HgfsKReq_ReleaseRequest(sip->reqs, req); -out: - if (dstFullPath != NULL) { - free(dstFullPath, M_TEMP); - } + ret = HgfsRenameInt(fvp, tdvp, tvp, tcnp); vrele(fdvp); vrele(fvp); @@ -1481,15 +571,14 @@ * * HgfsMkdir -- * - * Makes a directory named dirname in the directory specified by the dvp - * vnode by sending a CREATE_DIR request, then allocates a vnode for this - * new directory and writes its address into vpp. + * Calls HgfsMkdirInt which does all of the directory creation work in a + * FreeBSD / Mac OS independent way. * * Results: - * Returns 0 on success and a non-zero error code on failure. + * Returns 0 on success and a non-zero error code on failure. * * Side effects: - * If successful, a directory is created on the host's filesystem. + * If successful, a directory is created on the host's filesystem. * *---------------------------------------------------------------------------- */ @@ -1510,141 +599,26 @@ struct componentname *cnp = ap->a_cnp; struct vattr *vap = ap->a_vap; - HgfsSuperInfo *sip = HGFS_VP_TO_SIP(dvp); - HgfsKReqHandle req; - HgfsRequestCreateDir *request; - HgfsReplyCreateDir *reply; - char *fullname = NULL; // allocated from M_TEMP; free when done. - int ret; - - DEBUG(VM_DEBUG_ENTRY, "dvp=%p (%s), dirname=%s, vap=%p, vpp=%p\n", - dvp, HGFS_VP_TO_FILENAME(dvp), cnp->cn_nameptr, vap, - *vpp); - - /* - * We need to construct the full path of the directory to create then send - * a CREATE_DIR request. If successful we will create a vnode and fill in - * vpp with a pointer to it. - * - * Note that unlike in HgfsCreate(), *vpp is always NULL. - */ + return HgfsMkdirInt(dvp, vpp, cnp, vap->va_mode); +} - /* Construct the complete path of the directory to create. */ - fullname = malloc(MAXPATHLEN, M_TEMP, M_WAITOK); - ret = HgfsMakeFullName(HGFS_VP_TO_FILENAME(dvp),// Name of directory to create in - HGFS_VP_TO_FILENAME_LENGTH(dvp), // Length of name - cnp->cn_nameptr, // Name of file to create - cnp->cn_namelen, // Length of filename - fullname, // Buffer to write full name - MAXPATHLEN); // Size of this buffer - - if (ret < 0) { - DEBUG(VM_DEBUG_FAIL, "couldn't create full path name.\n"); - ret = ENAMETOOLONG; - goto out; - } - req = HgfsKReq_AllocateRequest(sip->reqs); - if (!req) { - ret = EIO; - goto out; - } - - /* Initialize the request's contents. */ - request = (HgfsRequestCreateDir *)HgfsKReq_GetPayload(req); - HGFS_INIT_REQUEST_HDR(request, req, HGFS_OP_CREATE_DIR); - - request->permissions = (vap->va_mode & S_IRWXU) >> HGFS_ATTR_MODE_SHIFT; - - ret = CPName_ConvertTo(fullname, MAXPATHLEN, request->fileName.name); - if (ret < 0) { - DEBUG(VM_DEBUG_FAIL, "cross-platform name is too long.\n"); - ret = ENAMETOOLONG; - goto destroy_out; - } - - ret = HgfsUnescapeBuffer(request->fileName.name, ret); - request->fileName.length = ret; - - /* Set the size of this request. */ - HgfsKReq_SetPayloadSize(req, sizeof *request + request->fileName.length); - - /* Send the request to guestd. */ - ret = HgfsSubmitRequest(sip, req); - if (ret) { - /* Request is destroyed in HgfsSubmitRequest() if necessary. */ - goto out; - } - - reply = (HgfsReplyCreateDir *)HgfsKReq_GetPayload(req); - - if (HgfsValidateReply(req, sizeof *reply) != 0) { - DEBUG(VM_DEBUG_FAIL, "invalid reply received.\n"); - ret = EPROTO; - goto destroy_out; - } - - switch (reply->header.status) { - case HGFS_STATUS_SUCCESS: - /* Handled below switch. */ - break; - - case HGFS_STATUS_OPERATION_NOT_PERMITTED: - DEBUG(VM_DEBUG_FAIL, "operation not permitted.\n"); - ret = EACCES; - goto destroy_out; - - case HGFS_STATUS_FILE_EXISTS: - DEBUG(VM_DEBUG_FAIL, "directory already exists.\n"); - ret = EEXIST; - goto destroy_out; - - default: - ret = EPROTO; - goto destroy_out; - } - - /* We now create the vnode for the new directory. */ - ret = HgfsVnodeGet(vpp, sip, dvp->v_mount, dvp->v_op, fullname, - HGFS_FILE_TYPE_DIRECTORY, &sip->fileHashTable); - if (ret) { - ret = EIO; - goto destroy_out; - } - - ASSERT(*vpp); /* HgfsIget guarantees this. */ - ret = 0; - -destroy_out: - HgfsKReq_ReleaseRequest(sip->reqs, req); -out: - if (fullname != NULL) { - free(fullname, M_TEMP); - } - return ret; -} - - -/* - *---------------------------------------------------------------------------- - * - * HgfsVopRmdir -- - * - * Removes the specified name from the provided vnode. Sends a DELETE - * request by calling HgfsDelete() with the filename and correct opcode to - * indicate deletion of a directory. - * - * "Removes the directory pointed to by the supplied vnode." (Solaris - * Internals, p537) - * - * Results: - * Returns 0 on success and an error code on error. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------------- - */ +/* + *---------------------------------------------------------------------------- + * + * HgfsVopRmdir -- + * + * Removes the specified name from the provided vnode by calling + * HgfsRmdirInt. + * + * Results: + * Returns 0 on success and an error code on error. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ static int HgfsVopRmdir(struct vop_rmdir_args *ap) @@ -1658,20 +632,9 @@ { struct vnode *dvp = ap->a_dvp; struct vnode *vp = ap->a_vp; -#ifdef VM_DEBUG_LEV struct componentname *cnp = ap->a_cnp; -#endif - - HgfsSuperInfo *sip = HGFS_VP_TO_SIP(dvp); - - DEBUG(VM_DEBUG_ENTRY, "HgfsRmdir().\n"); - DEBUG(VM_DEBUG_ENTRY, "dvp=%p (%s), nm=%s, vp=%p (%s)\n", - dvp, (HGFS_VP_TO_FP(dvp)) ? HGFS_VP_TO_FILENAME(dvp) : "dvp->v_data null", - cnp->cn_nameptr, vp, - (HGFS_VP_TO_FP(vp)) ? HGFS_VP_TO_FILENAME(vp) : "vp->v_data null"); - - return HgfsDelete(sip, HGFS_VP_TO_FILENAME(vp), HGFS_OP_DELETE_DIR); + return HgfsRmdirInt(dvp, vp, cnp); } @@ -1680,22 +643,17 @@ * * HgfsVopReaddir -- * - * Reads as many entries from the directory as will fit in to the provided - * buffer. Each directory entry is read by calling HgfsGetNextDirEntry(). + * Reads as many entries from the directory as will fit in to the provided + * buffer. Each directory entry is read by calling HgfsGetNextDirEntry(). * - * "The vop_readdir() method reads chunks of the directory into a uio - * structure. Each chunk can contain as many entries as will fit within - * the size supplied by the uio structure. The uio_resid structure member - * shows the size of the getdents request in bytes, which is divided by the - * size of the directory entry made by the vop_readdir() method to - * calculate how many directory entries to return." (Solaris Internals, - * p555) + * The funciton simply calls HgfsReaddirInt to do all of the common + * FreeBSD and Solaris work. * * Results: - * Returns 0 on success and a non-zero error code on failure. + * Returns 0 on success and a non-zero error code on failure. * * Side effects: - * None. + * None. * *---------------------------------------------------------------------------- */ @@ -1717,169 +675,7 @@ struct uio *uiop = ap->a_uio; int *eofp = ap->a_eofflag; - HgfsSuperInfo *sip = HGFS_VP_TO_SIP(vp); - HgfsHandle handle; - uint64_t offset; - Bool done; - char *fullName = NULL; /* Hashed to generate inode number */ - int ret; - - DEBUG(VM_DEBUG_ENTRY, "uiop->uio_resid=%d, " - "uiop->uio_offset=%jd\n", - uiop->uio_resid, uiop->uio_offset); - - /* uio_offset is a signed quantity. */ - if (uiop->uio_offset < 0) { - DEBUG(VM_DEBUG_FAIL, "fed negative offset.\n"); - return EINVAL; - } - - /* - * In order to fill the user's buffer with directory entries, we must - * iterate on HGFS_OP_SEARCH_READ requests until either the user's buffer is - * full or there are no more entries. Each call to HgfsGetNextDirEntry() - * fills in the name and attribute structure for the next entry. We then - * escape that name and place it in a kernel buffer that's the same size as - * the user's buffer. Once there are no more entries or no more room in the - * buffer, we copy it to user space. - */ - - /* - * We need to get the handle for this open directory to send to the Hgfs - * server in our requests. - */ - ret = HgfsGetOpenFileHandle(vp, &handle); - if (ret) { - DEBUG(VM_DEBUG_FAIL, "could not get handle.\n"); - return EINVAL; - } - - /* - * Allocate 1K (MAXPATHLEN) buffer for inode number generation. - */ - fullName = malloc(MAXPATHLEN, M_HGFS, M_WAITOK); - - /* - * Loop until one of the following conditions is met: - * o An error occurs while reading a directory entry - * o There are no more directory entries to read - * o The buffer is full and cannot hold the next entry - * - * We request dentries from the Hgfs server based on their index in the - * directory. The offset value is initialized to the value specified in - * the user's io request and is incremented each time through the loop. - * - * dirp is incremented by the record length each time through the loop and - * is used to determine where in the kernel buffer we write to. - */ - for (offset = uiop->uio_offset, done = 0; /* Nothing */ ; offset++) { - struct dirent dirent, *dirp = &dirent; - char nameBuf[sizeof dirp->d_name]; - HgfsFileType fileType = HGFS_FILE_TYPE_REGULAR; - - DEBUG(VM_DEBUG_COMM, - "HgfsReaddir: getting directory entry at offset %"FMT64"u.\n", offset); - - DEBUG(VM_DEBUG_HANDLE, "** handle=%d, file=%s\n", - handle, HGFS_VP_TO_FILENAME(vp)); - - bzero(dirp, sizeof *dirp); - - ret = HgfsGetNextDirEntry(sip, handle, offset, nameBuf, sizeof nameBuf, - &fileType, &done); - /* If the filename was too long, we skip to the next entry ... */ - if (ret == EOVERFLOW) { - continue; - /* ... but if another error occurred, we return that error code ... */ - } else if (ret) { - DEBUG(VM_DEBUG_FAIL, "failure occurred in HgfsGetNextDirEntry\n"); - goto out; - /* - * ... and if there are no more entries, we set the end of file pointer - * and break out of the loop. - */ - } else if (done == TRUE) { - DEBUG(VM_DEBUG_COMM, "Done reading directory entries.\n"); - if (eofp != NULL) { - *eofp = TRUE; - } - break; - } - - /* - * We now have the directory entry, so we sanitize the name and try to - * put it in our buffer. - */ - DEBUG(VM_DEBUG_COMM, "received filename \"%s\"\n", nameBuf); - - ret = HgfsEscapeBuffer(nameBuf, strlen(nameBuf), sizeof dirp->d_name, dirp->d_name); - /* If the escaped name didn't fit in the buffer, skip to the next entry. */ - if (ret < 0) { - DEBUG(VM_DEBUG_FAIL, "HgfsEscapeBuffer failed.\n"); - continue; - } - - /* Fill in the directory entry. */ - dirp->d_namlen = ret; - dirp->d_reclen = GENERIC_DIRSIZ(dirp); // NB: d_namlen must be set first! - dirp->d_type = - (fileType == HGFS_FILE_TYPE_REGULAR) ? DT_REG : - (fileType == HGFS_FILE_TYPE_DIRECTORY) ? DT_DIR : - DT_UNKNOWN; - - /* - * Make sure there is enough room in the buffer for the entire directory - * entry. If not, we just break out of the loop and copy what we have. - */ - if (dirp->d_reclen > uiop->uio_resid) { - DEBUG(VM_DEBUG_INFO, "ran out of room in the buffer.\n"); - break; - } - - - ret = HgfsMakeFullName(HGFS_VP_TO_FILENAME(vp), // Directorie's name - HGFS_VP_TO_FILENAME_LENGTH(vp), // Length - dirp->d_name, // Name of file - dirp->d_namlen, // Length of filename - fullName, // Destination buffer - MAXPATHLEN); // Size of this buffer - - /* Skip this entry if the full path was too long. */ - if (ret < 0) { - continue; - } - - /* - * Place the node id, which serves the purpose of inode number, for this - * filename directory entry. As long as we are using a dirent64, this is - * okay since ino_t is also a u_longlong_t. - */ - HgfsNodeIdGet(&sip->fileHashTable, fullName, (uint32_t)ret, - &dirp->d_fileno); - - /* Copy out this directory entry. */ - ret = uiomove(dirp, dirp->d_reclen, uiop); - if (ret) { - DEBUG(VM_DEBUG_FAIL, "uiomove failed.\n"); - goto out; - } - } - - /* - * uiomove(9) will have incremented the uio offset by the number of bytes - * written. We reset it here to the fs-specific offset in our directory so - * the next time we are called it is correct. (Note, this does not break - * anything and /is/ how this field is intended to be used.) - */ - uiop->uio_offset = offset; - - DEBUG(VM_DEBUG_DONE, "done (ret=%d, *eofp=%d).\n", ret, *eofp); -out: - if (fullName != NULL) { - free(fullName, M_HGFS); - } - DEBUG(VM_DEBUG_ENTRY, "exiting.\n"); - return ret; + return HgfsReaddirInt(vp, uiop, eofp); } @@ -1888,13 +684,13 @@ * * HgfsVopInactive -- * - * Called when vnode's use count reaches zero. + * Called when vnode's use count reaches zero. * * Results: - * Unconditionally zero. + * Unconditionally zero. * * Side effects: - * None. + * None. * *---------------------------------------------------------------------------- */ @@ -1909,15 +705,11 @@ */ { /* - * Since we allocate vnodes once per file descriptor, a closed vnode - * should be completely dissociated from its HgfsOpenFile. We'll call - * vgone(), which in turn will call our reclaim routine and be done with the - * vnode completely. - * - * (Other file systems would simply put a vnode on an "unused" list such - * that a subsequent re-open would require less work.) + * On FreeBSD we can always call vgone because there is no possibility that the + * vnode is being shared by more than one open file. */ vgone(ap->a_vp); + return 0; } @@ -1927,13 +719,13 @@ * * HgfsVopReclaim -- * - * Dissociates vnode from the underlying filesystem. + * Dissociates vnode from the underlying filesystem. * * Results: - * Zero on success, or an appropriate system error otherwise. + * Zero on success, or an appropriate system error otherwise. * * Side effects: - * None. + * None. * *---------------------------------------------------------------------------- */ @@ -1948,6 +740,7 @@ */ { struct vnode *vp = ap->a_vp; + HgfsSuperInfo *sip = HGFS_VP_TO_SIP(vp); HgfsVnodePut(vp, &sip->fileHashTable); @@ -1962,14 +755,14 @@ * * HgfsVopPrint -- * - * This function is needed to fill in the HgfsVnodeOps structure. - * Right now it does nothing. + * This function is needed to fill in the HgfsVnodeOps structure. + * Right now it does nothing. * * Results: - * None. + * None. * * Side effects: - * None. + * None. * *---------------------------------------------------------------------------- */ @@ -1980,1670 +773,3 @@ return 0; } - -/* - * Local vnode functions. - * - * (The rest of the functions in this file are only invoked by our code so they - * ASSERT() their pointer arguments.) - */ - - -/* - *---------------------------------------------------------------------------- - * - * HgfsDirOpen -- - * - * Invoked when HgfsOpen() is called with a vnode of type VDIR. - * - * Sends a SEARCH_OPEN request to the Hgfs server. - * - * Results: - * Returns zero on success and an error code on error. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------------- - */ - -static int -HgfsDirOpen(HgfsSuperInfo *sip, // IN: Superinfo pointer - struct vnode *vp) // IN: Vnode of directory to open -{ - int ret; - HgfsKReqHandle req; - HgfsRequestSearchOpen *request; - HgfsReplySearchOpen *reply; - - ASSERT(sip); - ASSERT(vp); - - DEBUG(VM_DEBUG_ENTRY, "opening \"%s\"\n", HGFS_VP_TO_FILENAME(vp)); - - req = HgfsKReq_AllocateRequest(sip->reqs); - if (!req) { - return EIO; - } - - /* Set the correct header values */ - request = (HgfsRequestSearchOpen *)HgfsKReq_GetPayload(req); - HGFS_INIT_REQUEST_HDR(request, req, HGFS_OP_SEARCH_OPEN); - - /* - * Convert name to cross-platform and unescape. If the vnode is the root of - * our filesystem the Hgfs server expects an empty string. - */ - ret = CPName_ConvertTo((HGFS_IS_ROOT_VNODE(sip, vp)) ? "" : HGFS_VP_TO_FILENAME(vp), - MAXPATHLEN, request->dirName.name); - if (ret < 0) { - ret = ENAMETOOLONG; - goto destroy_out; - } - - ret = HgfsUnescapeBuffer(request->dirName.name, ret); /* cannot fail */ - request->dirName.length = ret; - - HgfsKReq_SetPayloadSize(req, request->dirName.length + sizeof *request); - - /* Submit the request to the Hgfs server */ - ret = HgfsSubmitRequest(sip, req); - if (ret) { - /* HgfsSubmitRequest destroys the request if necessary */ - goto out; - } - - /* Our reply is in the request packet */ - reply = (HgfsReplySearchOpen *)HgfsKReq_GetPayload(req); - - /* Perform basic validation of packet transfer */ - if (HgfsValidateReply(req, sizeof reply->header) != 0) { - DEBUG(VM_DEBUG_FAIL, "invalid reply received.\n"); - ret = EPROTO; - goto destroy_out; - } - - DEBUG(VM_DEBUG_COMM, "received reply for ID %d\n", reply->header.id); - DEBUG(VM_DEBUG_COMM, " status: %d (see hgfsProto.h)\n", reply->header.status); - DEBUG(VM_DEBUG_COMM, " handle: %d\n", reply->search); - - switch (reply->header.status) { - case HGFS_STATUS_SUCCESS: - if (HgfsKReq_GetPayloadSize(req) != sizeof *reply) { - DEBUG(VM_DEBUG_FAIL, "incorrect packet size.\n"); - ret = EFAULT; - goto destroy_out; - } - /* Success handled after switch. */ - break; - - case HGFS_STATUS_OPERATION_NOT_PERMITTED: - DEBUG(VM_DEBUG_FAIL, "operation not permitted (%s).\n", - HGFS_VP_TO_FILENAME(vp)); - ret = EACCES; - goto destroy_out; - - default: - DEBUG(VM_DEBUG_FAIL, "default error (%s).\n", - HGFS_VP_TO_FILENAME(vp)); - ret = EPROTO; - goto destroy_out; - } - - /* Set the search open handle for use in HgfsReaddir() */ - ret = HgfsSetOpenFileHandle(vp, reply->search); - if (ret) { - DEBUG(VM_DEBUG_FAIL, "couldn't assign handle=%d to %s\n", - reply->search, HGFS_VP_TO_FILENAME(vp)); - ret = EINVAL; - goto destroy_out; - } - - ret = 0; /* Return success */ - -destroy_out: - /* Make sure we put the request back on the list */ - HgfsKReq_ReleaseRequest(sip->reqs, req); -out: - DEBUG(VM_DEBUG_DONE, "done\n"); - return ret; -} - - -/* - *---------------------------------------------------------------------------- - * - * HgfsFileOpen -- - * - * Invoked when HgfsOpen() is called with a vnode of type VREG. Sends - * a OPEN request to the Hgfs server. - * - * Note that this function doesn't need to handle creations since the - * HgfsCreate() entry point is called by the kernel for that. - * - * Results: - * Returns zero on success and an error code on error. - * - * Side effects: - * None. - * - * - *---------------------------------------------------------------------------- - */ - -static int -HgfsFileOpen(HgfsSuperInfo *sip, // IN: Superinfo pointer - struct vnode *vp, // IN: Vnode of file to open - int flag, // IN: Flags of open - int permissions) // IN: Permissions of open (only when creating) -{ - HgfsKReqHandle req; - HgfsRequestOpen *request; - HgfsReplyOpen *reply; - int ret; - - ASSERT(sip); - ASSERT(vp); - - DEBUG(VM_DEBUG_ENTRY, "opening \"%s\"\n", HGFS_VP_TO_FILENAME(vp)); - - req = HgfsKReq_AllocateRequest(sip->reqs); - if (!req) { - DEBUG(VM_DEBUG_FAIL, "HgfsKReq_AllocateRequest failed.\n"); - return EIO; - } - - request = (HgfsRequestOpen *)HgfsKReq_GetPayload(req); - HGFS_INIT_REQUEST_HDR(request, req, HGFS_OP_OPEN); - - /* Convert FreeBSD modes to Hgfs modes */ - ret = HgfsGetOpenMode((uint32_t)flag); - if (ret < 0) { - DEBUG(VM_DEBUG_FAIL, "HgfsGetOpenMode failed.\n"); - ret = EINVAL; - goto destroy_out; - } - - request->mode = ret; - DEBUG(VM_DEBUG_COMM, "open mode is %x\n", request->mode); - - /* Convert FreeBSD flags to Hgfs flags */ - ret = HgfsGetOpenFlags((uint32_t)flag); - if (ret < 0) { - DEBUG(VM_DEBUG_FAIL, "HgfsGetOpenFlags failed.\n"); - ret = EINVAL; - goto destroy_out; - } - - request->flags = ret; - DEBUG(VM_DEBUG_COMM, "open flags are %x\n", request->flags); - - request->permissions = (permissions & S_IRWXU) >> HGFS_ATTR_MODE_SHIFT; - DEBUG(VM_DEBUG_COMM, "permissions are %o\n", request->permissions); - - /* Convert the file name to cross platform format. */ - ret = CPName_ConvertTo(HGFS_VP_TO_FILENAME(vp), MAXPATHLEN, request->fileName.name); - if (ret < 0) { - DEBUG(VM_DEBUG_FAIL, "CPName_ConvertTo failed.\n"); - ret = ENAMETOOLONG; - goto destroy_out; - } - ret = HgfsUnescapeBuffer(request->fileName.name, ret); - request->fileName.length = ret; - - /* Packet size includes the request and its payload. */ - HgfsKReq_SetPayloadSize(req, request->fileName.length + sizeof *request); - - ret = HgfsSubmitRequest(sip, req); - if (ret) { - /* HgfsSubmitRequest will destroy the request if necessary. */ - DEBUG(VM_DEBUG_FAIL, "could not submit request.\n"); - goto out; - } - - reply = (HgfsReplyOpen *)HgfsKReq_GetPayload(req); - - if (HgfsValidateReply(req, sizeof reply->header) != 0) { - DEBUG(VM_DEBUG_FAIL, "request not valid.\n"); - ret = EPROTO; - goto destroy_out; - } - - switch (reply->header.status) { - case HGFS_STATUS_SUCCESS: - if (HgfsKReq_GetPayloadSize(req) != sizeof *reply) { - DEBUG(VM_DEBUG_FAIL, "size of reply is incorrect.\n"); - ret = EFAULT; - goto destroy_out; - } - - /* Success case is handled after switch. */ - break; - - case HGFS_STATUS_NO_SUCH_FILE_OR_DIR: - case HGFS_STATUS_INVALID_NAME: - DEBUG(VM_DEBUG_FAIL, "no such file \"%s\".\n", - HGFS_VP_TO_FILENAME(vp)); - ret = ENOENT; - goto destroy_out; - - case HGFS_STATUS_FILE_EXISTS: - DEBUG(VM_DEBUG_FAIL, "\"%s\" exists.\n", - HGFS_VP_TO_FILENAME(vp)); - ret = EEXIST; - goto destroy_out; - - case HGFS_STATUS_OPERATION_NOT_PERMITTED: - DEBUG(VM_DEBUG_FAIL, "operation not permitted on %s.\n", - HGFS_VP_TO_FILENAME(vp)); - ret = EACCES; - goto destroy_out; - - case HGFS_STATUS_ACCESS_DENIED: - DEBUG(VM_DEBUG_FAIL, "access denied on %s.\n", - HGFS_VP_TO_FILENAME(vp)); - ret = EACCES; - goto destroy_out; - - default: - DEBUG(VM_DEBUG_FAIL, "default/unknown error %d.\n", - reply->header.status); - ret = EACCES; - goto destroy_out; - } - - /* - * We successfully received a reply, so we need to save the handle in - * this file's HgfsOpenFile and return success. - */ - ret = HgfsSetOpenFileHandle(vp, reply->file); - if (ret) { - DEBUG(VM_DEBUG_FAIL, "couldn't assign handle %d (%s)\n", - reply->file, HGFS_VP_TO_FILENAME(vp)); - ret = EINVAL; - goto destroy_out; - } - - ret = 0; - - -destroy_out: - HgfsKReq_ReleaseRequest(sip->reqs, req); -out: - DEBUG(VM_DEBUG_DONE, "returning %d\n", ret); - return ret; -} - - -/* - *---------------------------------------------------------------------------- - * - * HgfsDirClose -- - * - * Invoked when HgfsClose() is called with a vnode of type VDIR. - * - * Sends an SEARCH_CLOSE request to the Hgfs server. - * - * Results: - * Returns zero on success and an error code on error. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------------- - */ - -static int -HgfsDirClose(HgfsSuperInfo *sip, // IN: Superinfo pointer - struct vnode *vp) // IN: Vnode of directory to close -{ - HgfsKReqHandle req; - HgfsRequestSearchClose *request; - HgfsReplySearchClose *reply; - int ret; - - ASSERT(sip); - ASSERT(vp); - - DEBUG(VM_DEBUG_ENTRY, "closing \"%s\"\n", HGFS_VP_TO_FILENAME(vp)); - - req = HgfsKReq_AllocateRequest(sip->reqs); - if (!req) { - return EIO; - } - - /* - * Prepare the request structure. Of note here is that the request is - * always the same size so we just set the packetSize to that. - */ - request = (HgfsRequestSearchClose *)HgfsKReq_GetPayload(req); - HGFS_INIT_REQUEST_HDR(request, req, HGFS_OP_SEARCH_CLOSE); - - /* Get this open file's handle, since that is what we want to close. */ - ret = HgfsGetOpenFileHandle(vp, &request->search); - if (ret) { - DEBUG(VM_DEBUG_FAIL, "couldn't get handle for %s\n", - HGFS_VP_TO_FILENAME(vp)); - ret = EINVAL; - goto destroy_out; - } - HgfsKReq_SetPayloadSize(req, sizeof *request); - - /* Submit the request to the Hgfs server */ - ret = HgfsSubmitRequest(sip, req); - if (ret) { - /* HgfsSubmitRequest destroys the request if necessary */ - goto out; - } - - reply = (HgfsReplySearchClose *)HgfsKReq_GetPayload(req); - - /* Ensure reply was received correctly and is necessary size. */ - if (HgfsValidateReply(req, sizeof reply->header) != 0) { - DEBUG(VM_DEBUG_FAIL, "invalid reply received.\n"); - ret = EPROTO; - goto destroy_out; - } - - DEBUG(VM_DEBUG_COMM, "received reply for ID %d\n", reply->header.id); - DEBUG(VM_DEBUG_COMM, " status: %d (see hgfsProto.h)\n", reply->header.status); - - /* Ensure server was able to close directory. */ - if (reply->header.status != HGFS_STATUS_SUCCESS) { - ret = EFAULT; - goto destroy_out; - } - - /* Now clear this open file's handle for future use. */ - ret = HgfsClearOpenFileHandle(vp); - if (ret) { - DEBUG(VM_DEBUG_FAIL, "couldn't clear handle.\n"); - ret = EINVAL; - goto destroy_out; - } - - /* The directory was closed successfully so we return success. */ - ret = 0; - - -destroy_out: - HgfsKReq_ReleaseRequest(sip->reqs, req); -out: - return ret; -} - - -/* - *---------------------------------------------------------------------------- - * - * HgfsFileClose -- - * - * Invoked when HgfsClose() is called with a vnode of type VREG. - * - * Sends a CLOSE request to the Hgfs server. - * - * Results: - * Returns zero on success and an error code on error. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------------- - */ - -static int -HgfsFileClose(HgfsSuperInfo *sip, // IN: Superinfo pointer - struct vnode *vp) // IN: Vnode of file to close -{ - HgfsKReqHandle req; - HgfsRequestClose *request; - HgfsReplyClose *reply; - int ret; - - ASSERT(sip); - ASSERT(vp); - - DEBUG(VM_DEBUG_ENTRY, "closing \"%s\"\n", HGFS_VP_TO_FILENAME(vp)); - - req = HgfsKReq_AllocateRequest(sip->reqs); - if (!req) { - ret = EFAULT; - goto out; - } - - request = (HgfsRequestClose *)HgfsKReq_GetPayload(req); - HGFS_INIT_REQUEST_HDR(request, req, HGFS_OP_CLOSE); - - /* Tell the Hgfs server which handle to close */ - ret = HgfsGetOpenFileHandle(vp, &request->file); - if (ret) { - DEBUG(VM_DEBUG_FAIL, "couldn't get handle.\n"); - ret = EINVAL; - goto destroy_out; - } - - HgfsKReq_SetPayloadSize(req, sizeof *request); - - ret = HgfsSubmitRequest(sip, req); - if (ret) { - /* HgfsSubmitRequest will destroy the request if necessary. */ - DEBUG(VM_DEBUG_FAIL, "submit request failed.\n"); - goto out; - } - - if (HgfsValidateReply(req, sizeof *reply) != 0) { - DEBUG(VM_DEBUG_FAIL, "reply was invalid.\n"); - ret = EPROTO; - goto destroy_out; - } - - reply = (HgfsReplyClose *)HgfsKReq_GetPayload(req); - - switch (reply->header.status) { - case HGFS_STATUS_SUCCESS: - /* - * We already verified the size of the reply above since this reply type - * only contains a header, so we just clear the handle and return success. - */ - ret = HgfsClearOpenFileHandle(vp); - if (ret) { - DEBUG(VM_DEBUG_FAIL, "couldn't clear handle.\n"); - ret = EINVAL; - goto destroy_out; - } - - ret = 0; - goto destroy_out; - - case HGFS_STATUS_INVALID_HANDLE: - DEBUG(VM_DEBUG_FAIL, "invalid handle error.\n"); - ret = EFAULT; // XXX Is this really EPROTO? - goto destroy_out; - - case HGFS_STATUS_OPERATION_NOT_PERMITTED: - DEBUG(VM_DEBUG_FAIL, "operation not permitted error.\n"); - ret = EACCES; - goto destroy_out; - - default: - DEBUG(VM_DEBUG_FAIL, "other/unknown error.\n"); - ret = EPROTO; - goto destroy_out; - } - -destroy_out: - HgfsKReq_ReleaseRequest(sip->reqs, req); -out: - DEBUG(VM_DEBUG_DONE, "returning %d\n", ret); - return ret; -} - - -/* - *---------------------------------------------------------------------------- - * - * HgfsGetNextDirEntry -- - * - * Writes the name of the directory entry matching the handle and offset to - * nameOut. Also records the entry's type (file, directory) in type. This - * requires sending a SEARCH_READ request. - * - * Results: - * Returns zero on success and an error code on error. The done value is - * set if there are no more directory entries. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------------- - */ - -static int -HgfsGetNextDirEntry(HgfsSuperInfo *sip, // IN: Superinfo pointer - HgfsHandle handle, // IN: Handle for request - uint32_t offset, // IN: Offset - char *nameOut, // OUT: Location to write name - size_t nameSize, // IN : Size of nameOut - HgfsFileType *type, // OUT: Entry's type - Bool *done) // OUT: Whether there are any more -{ - HgfsKReqHandle req; - HgfsRequestSearchRead *request; - HgfsReplySearchRead *reply; - int ret; - - DEBUG(VM_DEBUG_ENTRY, - "HgfsGetNextDirEntry: handle=%d, offset=%d.\n", handle, offset); - - ASSERT(sip); - ASSERT(nameOut); - ASSERT(done); - - req = HgfsKReq_AllocateRequest(sip->reqs); - if (!req) { - DEBUG(VM_DEBUG_FAIL, "couldn't get req.\n"); - return EIO; - } - - /* - * Fill out the search read request that will return a single directory - * entry for the provided handle at the given offset. - */ - request = (HgfsRequestSearchRead *)HgfsKReq_GetPayload(req); - HGFS_INIT_REQUEST_HDR(request, req, HGFS_OP_SEARCH_READ); - - request->search = handle; - request->offset = offset; - - HgfsKReq_SetPayloadSize(req, sizeof *request); - - ret = HgfsSubmitRequest(sip, req); - if (ret) { - /* HgfsSubmitRequest will destroy the request if necessary. */ - DEBUG(VM_DEBUG_FAIL, "HgfsSubmitRequest failed.\n"); - goto out; - } - - reply = (HgfsReplySearchRead *)HgfsKReq_GetPayload(req); - - /* Validate the request state and ensure we have at least a header */ - if (HgfsValidateReply(req, sizeof reply->header) != 0) { - DEBUG(VM_DEBUG_FAIL, "reply not valid.\n"); - ret = EPROTO; - goto destroy_out; - } - - DEBUG(VM_DEBUG_COMM, "received reply for ID %d\n", - reply->header.id); - DEBUG(VM_DEBUG_COMM, " status: %d (see hgfsProto.h)\n", reply->header.status); - - /* Now ensure the server didn't have an error */ - if (reply->header.status != HGFS_STATUS_SUCCESS) { - DEBUG(VM_DEBUG_FAIL, "server didn't return success (%d).\n", - reply->header.status); - ret = EINVAL; - goto destroy_out; - } - - /* Make sure we got an entire reply (excluding filename) */ - if (HgfsKReq_GetPayloadSize(req) < sizeof *reply) { - DEBUG(VM_DEBUG_FAIL, "server didn't provide entire reply.\n"); - ret = EFAULT; - goto destroy_out; - } - - /* See if there are no more filenames to read */ - if (reply->fileName.length <= 0) { - DEBUG(VM_DEBUG_DONE, "no more directory entries.\n"); - *done = TRUE; - ret = 0; /* return success */ - goto destroy_out; - } - - /* Make sure filename isn't too long */ - if ((reply->fileName.length >= nameSize) || - (reply->fileName.length > HGFS_PAYLOAD_MAX(reply)) ) { - DEBUG(VM_DEBUG_FAIL, "filename is too long.\n"); - ret = EOVERFLOW; - goto destroy_out; - } - - /* - * Everything is all right, copy filename to caller's buffer. Note that even though - * the hgfs SearchRead reply holds lots of information about the file's attributes, - * FreeBSD directory entries do not currently need any of that information except the - * file type. - */ - memcpy(nameOut, reply->fileName.name, reply->fileName.length); - nameOut[reply->fileName.length] = '\0'; - *type = reply->attr.type; - ret = 0; - - DEBUG(VM_DEBUG_DONE, "done.\n"); -destroy_out: - HgfsKReq_ReleaseRequest(sip->reqs, req); -out: - return ret; -} - - -/* - *---------------------------------------------------------------------------- - * - * HgfsDoRead -- - * - * Sends a single READ request to the Hgfs server and writes the contents - * into the user's buffer if successful. - * - * This function is called repeatedly by HgfsRead() with requests of size - * less than or equal to HGFS_IO_MAX. - * - * Note that we return the negative of an appropriate error code in this - * function so we can differentiate between success and failure. On success - * we need to return the number of bytes read, but FreeBSD's error codes are - * positive so we negate them before returning. If callers want to return - * these error codes to the Kernel, they will need to flip their sign. - * - * Results: - * Returns number of bytes read on success and a negative value on error. - * - * Side effects: - * On success, size bytes are written into the user's buffer. - * - *---------------------------------------------------------------------------- - */ - -static int -HgfsDoRead(HgfsSuperInfo *sip, // IN: Superinfo pointer - HgfsHandle handle, // IN: Server's handle to read from - uint64_t offset, // IN: File offset to read at - uint32_t size, // IN: Number of bytes to read - struct uio *uiop) // IN: Defines user's read request -{ - HgfsKReqHandle req; - HgfsRequestRead *request; - HgfsReplyRead *reply; - int ret; - - ASSERT(sip); - ASSERT(uiop); - ASSERT(size <= HGFS_IO_MAX); // HgfsRead() should guarantee this - - DEBUG(VM_DEBUG_ENTRY, "entry.\n"); - - req = HgfsKReq_AllocateRequest(sip->reqs); - if (!req) { - return -EIO; - } - - request = (HgfsRequestRead *)HgfsKReq_GetPayload(req); - HGFS_INIT_REQUEST_HDR(request, req, HGFS_OP_READ); - - /* Indicate which file, where in the file, and how much to read. */ - request->file = handle; - request->offset = offset; - request->requiredSize = size; - - HgfsKReq_SetPayloadSize(req, sizeof *request); - - ret = HgfsSubmitRequest(sip, req); - if (ret) { - /* - * We need to flip the sign of the return value to indicate error; see - * the comment in the function header. HgfsSubmitRequest() handles - * destroying the request if necessary, so we don't here. - */ - ret = -ret; - goto out; - } - - reply = (HgfsReplyRead *)HgfsKReq_GetPayload(req); - - /* Ensure we got an entire header. */ - if (HgfsValidateReply(req, sizeof reply->header) != 0) { - DEBUG(VM_DEBUG_FAIL, "invalid reply received.\n"); - ret = -EPROTO; - goto destroy_out; - } - - if (reply->header.status != HGFS_STATUS_SUCCESS) { - DEBUG(VM_DEBUG_FAIL, "request not completed successfully.\n"); - ret = -EACCES; - goto destroy_out; - } - - /* - * Now perform checks on the actualSize. There are three cases: - * o actualSize is less than or equal to size, which indicates success - * o actualSize is zero, which indicates the end of the file (and success) - * o actualSize is greater than size, which indicates a server error - */ - if (reply->actualSize <= size) { - /* If we didn't get any data, we don't need to copy to the user. */ - if (reply->actualSize == 0) { - goto success; - } - - /* Perform the copy to the user */ - ret = uiomove(reply->payload, reply->actualSize, uiop); - if (ret) { - ret = -EIO; - goto destroy_out; - } - - /* We successfully copied the payload to the user's buffer */ - goto success; - - } else { - /* We got too much data: server error. */ - DEBUG(VM_DEBUG_FAIL, "received too much data in payload.\n"); - ret = -EPROTO; - goto destroy_out; - } - - -success: - ret = reply->actualSize; - DEBUG(VM_DEBUG_DONE, "successfully read %d bytes to user.\n", ret); -destroy_out: - HgfsKReq_ReleaseRequest(sip->reqs, req); -out: - return ret; -} - - -/* - *---------------------------------------------------------------------------- - * - * HgfsDoWrite -- - * - * Sends a single WRITE request to the Hgfs server with the contents of - * the user's buffer. - * - * This function is called repeatedly by HgfsWrite() with requests of size - * less than or equal to HGFS_IO_MAX. - * - * Note that we return the negative of an appropriate error code in this - * function so we can differentiate between success and failure. On success - * we need to return the number of bytes written, but FreeBSD's error codes are - * positive so we negate them before returning. If callers want to return - * these error codes to the kernel, they will need to flip their sign. - * - * Results: - * Returns number of bytes written on success and a negative value on error. - * - * Side effects: - * On success, size bytes are written to the file specified by the handle. - * - *---------------------------------------------------------------------------- - */ - -static int -HgfsDoWrite(HgfsSuperInfo *sip, // IN: Superinfo pointer - HgfsHandle handle, // IN: Handle representing file to write to - int ioflag, // IN: Flags for write - uint64_t offset, // IN: Where in the file to begin writing - uint32_t size, // IN: How much data to write - struct uio *uiop) // IN: Describes user's write request -{ - HgfsKReqHandle req; - HgfsRequestWrite *request; - HgfsReplyWrite *reply; - int ret; - - ASSERT(sip); - ASSERT(uiop); - ASSERT(size <= HGFS_IO_MAX); // HgfsWrite() guarantees this - - req = HgfsKReq_AllocateRequest(sip->reqs); - if (!req) { - return -EIO; - } - - request = (HgfsRequestWrite *)HgfsKReq_GetPayload(req); - HGFS_INIT_REQUEST_HDR(request, req, HGFS_OP_WRITE); - - request->file = handle; - request->flags = 0; - request->offset = offset; - request->requiredSize = size; - - if (ioflag & IO_APPEND) { - DEBUG(VM_DEBUG_COMM, "writing in append mode.\n"); - request->flags |= HGFS_WRITE_APPEND; - } - - DEBUG(VM_DEBUG_COMM, "requesting write of %d bytes.\n", size); - - /* Copy the data the user wants to write into the payload. */ - ret = uiomove(request->payload, request->requiredSize, uiop); - if (ret) { - DEBUG(VM_DEBUG_FAIL, - "HgfsDoWrite: uiomove(9F) failed copying data from user.\n"); - ret = -EIO; - goto destroy_out; - } - - /* We subtract one so request's 'char payload[1]' member isn't double counted. */ - HgfsKReq_SetPayloadSize(req, sizeof *request + request->requiredSize - 1); - - ret = HgfsSubmitRequest(sip, req); - if (ret) { - /* - * As in HgfsDoRead(), we need to flip the sign of the error code - * returned by HgfsSubmitRequest(). - */ - DEBUG(VM_DEBUG_FAIL, "HgfsSubmitRequest failed.\n"); - ret = -ret; - goto out; - } - - reply = (HgfsReplyWrite *)HgfsKReq_GetPayload(req); - - if (HgfsValidateReply(req, sizeof reply->header) != 0) { - DEBUG(VM_DEBUG_FAIL, "invalid reply received.\n"); - ret = -EPROTO; - goto destroy_out; - } - - if (reply->header.status != HGFS_STATUS_SUCCESS) { - DEBUG(VM_DEBUG_FAIL, "write failed (status=%d).\n", - reply->header.status); - ret = -EACCES; - goto destroy_out; - } - - if (HgfsKReq_GetPayloadSize(req) != sizeof *reply) { - DEBUG(VM_DEBUG_FAIL, - "HgfsDoWrite: invalid size of reply on successful reply.\n"); - ret = -EPROTO; - goto destroy_out; - } - - /* The write was completed successfully, so return the amount written. */ - ret = reply->actualSize; - DEBUG(VM_DEBUG_DONE, "wrote %d bytes.\n", ret); - -destroy_out: - HgfsKReq_ReleaseRequest(sip->reqs, req); -out: - return ret; -} - - -/* - *---------------------------------------------------------------------------- - * - * HgfsDelete -- - * - * Sends a request to delete a file or directory. - * - * Results: - * Returns 0 on success or an error code on error. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------------- - */ - -static int -HgfsDelete(HgfsSuperInfo *sip, // IN: Superinfo - const char *filename, // IN: Full name of file to remove - HgfsOp op) // IN: Hgfs operation this delete is for -{ - HgfsKReqHandle req; - HgfsRequestDelete *request; - HgfsReplyDelete *reply; - int ret; - - ASSERT(sip); - ASSERT(filename); - ASSERT((op == HGFS_OP_DELETE_FILE) || (op == HGFS_OP_DELETE_DIR)); - - DEBUG(VM_DEBUG_ENTRY, "HgfsDelete().\n"); - - req = HgfsKReq_AllocateRequest(sip->reqs); - if (!req) { - return EIO; - } - - /* Initialize the request's contents. */ - request = (HgfsRequestDelete *)HgfsKReq_GetPayload(req); - HGFS_INIT_REQUEST_HDR(request, req, op); - - /* Convert filename to cross platform and unescape. */ - ret = CPName_ConvertTo(filename, MAXPATHLEN, request->fileName.name); - if (ret < 0) { - ret = ENAMETOOLONG; - goto destroy_out; - } - - ret = HgfsUnescapeBuffer(request->fileName.name, ret); - request->fileName.length = ret; - - /* Set the size of our request. (XXX should this be - 1 for char[1]?) */ - HgfsKReq_SetPayloadSize(req, sizeof *request + request->fileName.length); - - DEBUG(VM_DEBUG_COMM, "deleting \"%s\"\n", filename); - - /* Submit our request to guestd. */ - ret = HgfsSubmitRequest(sip, req); - if (ret) { - /* HgfsSubmitRequest() handles destroying the request if necessary. */ - goto out; - } - - reply = (HgfsReplyDelete *)HgfsKReq_GetPayload(req); - - /* Check the request status and size of reply. */ - if (HgfsValidateReply(req, sizeof *reply) != 0) { - DEBUG(VM_DEBUG_FAIL, "invalid reply received.\n"); - ret = EPROTO; - goto destroy_out; - } - - /* Return the appropriate value. */ - switch (reply->header.status) { - case HGFS_STATUS_SUCCESS: - ret = 0; - break; - - case HGFS_STATUS_OPERATION_NOT_PERMITTED: - DEBUG(VM_DEBUG_FAIL, "operation not permitted.\n"); - ret = EACCES; - goto destroy_out; - - case HGFS_STATUS_NOT_DIRECTORY: - DEBUG(VM_DEBUG_FAIL, "not a directory.\n"); - ret = ENOTDIR; - goto destroy_out; - - case HGFS_STATUS_DIR_NOT_EMPTY: - DEBUG(VM_DEBUG_FAIL, "directory not empty.\n"); - ret = EEXIST; - goto destroy_out; - - case HGFS_STATUS_NO_SUCH_FILE_OR_DIR: - case HGFS_STATUS_INVALID_NAME: - DEBUG(VM_DEBUG_FAIL, "no such file or directory.\n"); - ret = ENOENT; - goto destroy_out; - case HGFS_STATUS_ACCESS_DENIED: - DEBUG(VM_DEBUG_FAIL, "access denied.\n"); - - /* XXX: Add retry behavior after removing r/o bit. */ - ret = EACCES; - goto destroy_out; - default: - DEBUG(VM_DEBUG_FAIL, "default error.\n"); - ret = EPROTO; - goto destroy_out; - } - - DEBUG(VM_DEBUG_DONE, "done.\n"); - -destroy_out: - HgfsKReq_ReleaseRequest(sip->reqs, req); -out: - return ret; -} - - -/* - * Local utility functions. - */ - - -/* - *---------------------------------------------------------------------------- - * - * HgfsSubmitRequest -- - * - * Places a request on the queue for submission to guestd, then waits for - * the response. - * - * Both submitting request and waiting for reply are in this function - * because the signaling of the request list's condition variable and - * waiting on the request's condition variable must be atomic. - * - * Results: - * Returns zero on success, and an appropriate error code on error. - * Note: EINTR is returned if cv_wait_sig() is interrupted. - * - * Side effects: - * The request list's condition variable is signaled. - * - *---------------------------------------------------------------------------- - */ - -static int -HgfsSubmitRequest(HgfsSuperInfo *sip, // IN: Superinfo containing request list, - // condition variable, and mutex - HgfsKReqHandle req) // IN: Request to submit -{ - int ret = 0; - - ASSERT(sip); - ASSERT(req); - - /* - * The process of submitting the request involves putting it on the request - * list, waking up the backdoor req thread if it is waiting for a request, - * then atomically waiting for the reply. - */ - - /* - * Fail the request if a forcible unmount is in progress. - */ - if (sip->vfsp->mnt_kern_flag & MNTK_UNMOUNTF) { - HgfsKReq_ReleaseRequest(sip->reqs, req); - return EIO; - } - - /* Submit the request & wait for a result. */ - ret = HgfsKReq_SubmitRequest(req); - - if (ret == 0) { - /* The reply should now be in HgfsKReq_GetPayload(req). */ - DEBUG(VM_DEBUG_SIG, "awoken because reply received.\n"); - } else { - /* HgfsKReq_SubmitRequest was interrupted, so we'll abandon now. */ - HgfsKReq_ReleaseRequest(sip->reqs, req); - } - - return ret; -} - - -/* - *---------------------------------------------------------------------------- - * - * HgfsValidateReply -- - * - * Validates a reply to ensure that its state is set appropriately and the - * reply is at least the minimum expected size and not greater than the - * maximum allowed packet size. - * - * Results: - * Returns zero on success, and a non-zero on error. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------------- - */ - -static int -HgfsValidateReply(HgfsKReqHandle req, // IN: Request that contains reply data - uint32_t minSize) // IN: Minimum size expected for the reply -{ - ASSERT(req); - ASSERT(minSize <= HGFS_PACKET_MAX); /* we want to know if this fails */ - - switch (HgfsKReq_GetState(req)) { - case HGFS_REQ_ERROR: - DEBUG(VM_DEBUG_FAIL, "received reply with error.\n"); - return -1; - - case HGFS_REQ_COMPLETED: - if ((HgfsKReq_GetPayloadSize(req) < minSize) || (HgfsKReq_GetPayloadSize(req) > HGFS_PACKET_MAX)) { - DEBUG(VM_DEBUG_FAIL, "successfully " - "completed reply is too small/big: !(%d < %" FMTSZ "d < %d).\n", - minSize, HgfsKReq_GetPayloadSize(req), HGFS_PACKET_MAX); - return -1; - } else { - return 0; - } - /* - * If we get here then there is a programming error in this module: - * HGFS_REQ_UNUSED should be for requests in the free list - * HGFS_REQ_SUBMITTED should be for requests only that are awaiting - * a response - * HGFS_REQ_ABANDONED should have returned an error to the client - */ - default: - NOT_REACHED(); - return -1; /* avoid compiler warning */ - } -} - - -/* - * XXX: These were taken directly from hgfs/solaris/vnode.c. Should we - * move them to hgfsUtil.c or similar? (And Solaris took them from the Linux - * implementation.) - */ - - -/* - *----------------------------------------------------------------------------- - * - * HgfsEscapeBuffer -- - * - * Escape any characters that are not legal in a linux filename, - * which is just the character "/". We also of course have to - * escape the escape character, which is "%". - * - * sizeBufOut must account for the NUL terminator. - * - * XXX: See the comments in staticEscape.c and staticEscapeW.c to understand - * why this interface sucks. - * - * Results: - * On success, the size (excluding the NUL terminator) of the - * escaped, NUL terminated buffer. - * On failure (bufOut not big enough to hold result), negative value. - * - * Side effects: - * None - * - *----------------------------------------------------------------------------- - */ - -static int -HgfsEscapeBuffer(char const *bufIn, // IN: Buffer with unescaped input - uint32 sizeIn, // IN: Size of input buffer (chars) - uint32 sizeBufOut, // IN: Size of output buffer (bytes) - char *bufOut) // OUT: Buffer for escaped output -{ - /* - * This is just a wrapper around the more general escape - * routine; we pass it the correct bitvector and the - * buffer to escape. [bac] - */ - EscBitVector bytesToEsc; - - ASSERT(bufIn); - ASSERT(bufOut); - - /* Set up the bitvector for "/" and "%" */ - EscBitVector_Init(&bytesToEsc); - EscBitVector_Set(&bytesToEsc, (unsigned char)'%'); - EscBitVector_Set(&bytesToEsc, (unsigned char)'/'); - - return StaticEscape_Do('%', - &bytesToEsc, - bufIn, - sizeIn, - sizeBufOut, - bufOut); -} - - -/* - *----------------------------------------------------------------------------- - * - * HgfsUnescapeBuffer -- - * - * Unescape a buffer that was escaped using HgfsEscapeBuffer. - * - * The unescaping is done in place in the input buffer, and - * can not fail. - * - * Results: - * The size (excluding the NUL terminator) of the unescaped, NUL - * terminated buffer. - * - * Side effects: - * None - * - *----------------------------------------------------------------------------- - */ - -static int -HgfsUnescapeBuffer(char *bufIn, // IN: Buffer to be unescaped - uint32 sizeIn) // IN: Size of input buffer -{ - /* - * This is just a wrapper around the more general unescape - * routine; we pass it the correct escape characer and the - * buffer to unescape. [bac] - */ - ASSERT(bufIn); - return StaticEscape_Undo('%', bufIn, sizeIn); -} - - -/* - *---------------------------------------------------------------------------- - * - * HgfsAttrToBSD -- - * - * Maps Hgfs attributes to FreeBSD attributes, filling the provided FreeBSD - * attribute structure appropriately. - * - * Results: - * None. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------------- - */ - -static void -HgfsAttrToBSD(struct vnode *vp, // IN: The vnode for this file - const HgfsAttr *hgfsAttr, // IN: Hgfs attributes to copy from - struct vattr *vap) // OUT: BSD attributes to fill -{ - ASSERT(vp); - ASSERT(hgfsAttr); - ASSERT(vap); - - DEBUG(VM_DEBUG_ENTRY, "%p -> %p", hgfsAttr, vap); - - /* Initialize all fields to zero. */ - VATTR_NULL(vap); - - /* Set the file type. */ - switch (hgfsAttr->type) { - case HGFS_FILE_TYPE_REGULAR: - vap->va_type = VREG; - DEBUG(VM_DEBUG_ATTR, " Type: VREG\n"); - break; - - case HGFS_FILE_TYPE_DIRECTORY: - vap->va_type = VDIR; - DEBUG(VM_DEBUG_ATTR, " Type: VDIR\n"); - break; - - default: - /* - * There are only the above two filetypes. If there is an error - * elsewhere that provides another value, we set the FreeBSD type to - * none and ASSERT in devel builds. - */ - vap->va_type = VNON; - DEBUG(VM_DEBUG_FAIL, "invalid HgfsFileType provided.\n"); - ASSERT(0); - } - - /* We only have permissions for owners. */ - vap->va_mode = (hgfsAttr->permissions << HGFS_ATTR_MODE_SHIFT); - DEBUG(VM_DEBUG_ATTR, " Owner's permissions: %o\n", - vap->va_mode >> HGFS_ATTR_MODE_SHIFT); - - DEBUG(VM_DEBUG_ATTR, " Setting nlink\n"); - vap->va_nlink = 1; /* fake */ - - DEBUG(VM_DEBUG_ATTR, " Setting uid\n"); - vap->va_uid = 0; /* XXX root? */ - - DEBUG(VM_DEBUG_ATTR, " Setting gid\n"); - vap->va_gid = 0; /* XXX root? */ - - DEBUG(VM_DEBUG_ATTR, " Setting fsid\n"); - vap->va_fsid = vp->v_mount->mnt_stat.f_fsid.val[0]; - - /* Get the node id calculated for this file in HgfsVnodeGet() */ - vap->va_fileid = HGFS_VP_TO_NODEID(vp); - DEBUG(VM_DEBUG_ATTR, "*HgfsAttrToBSD: fileName %s\n", - HGFS_VP_TO_FILENAME(vp)); - DEBUG(VM_DEBUG_ATTR, " Node ID: %ld\n", vap->va_fileid); - - DEBUG(VM_DEBUG_ATTR, " Setting size\n"); - vap->va_size = vap->va_bytes = hgfsAttr->size; - - DEBUG(VM_DEBUG_ATTR, " Setting blksize\n"); - vap->va_blocksize = HGFS_BLOCKSIZE; - - DEBUG(VM_DEBUG_ATTR, " Setting atime\n"); - HGFS_SET_TIME(vap->va_atime, hgfsAttr->accessTime); - - DEBUG(VM_DEBUG_ATTR, " Setting mtime\n"); - HGFS_SET_TIME(vap->va_mtime, hgfsAttr->writeTime); - - DEBUG(VM_DEBUG_ATTR, " Setting ctime\n"); - /* Since Windows doesn't keep ctime, we may need to use mtime instead. */ - if (HGFS_SET_TIME(vap->va_ctime, hgfsAttr->attrChangeTime)) { - vap->va_ctime = vap->va_mtime; - } - - DEBUG(VM_DEBUG_ATTR, " Setting birthtime\n"); - HGFS_SET_TIME(vap->va_birthtime, hgfsAttr->creationTime); - - HgfsDebugPrintVattr(vap); -} - - -/* - *---------------------------------------------------------------------------- - * - * HgfsSetattrCopy -- - * - * Sets the Hgfs attributes that need to be modified based on the provided - * FreeBSD attribute structure. - * - * Results: - * Returns TRUE if changes need to be made, FALSE otherwise. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------------- - */ - -static Bool -HgfsSetattrCopy(struct vattr *vap, // IN: Attributes to change to - HgfsAttr *hgfsAttr, // OUT: Hgfs attributes to fill in - HgfsAttrChanges *update) // OUT: Hgfs attribute changes to make -{ - Bool ret = FALSE; - - ASSERT(vap); - ASSERT(hgfsAttr); - ASSERT(update); - - memset(hgfsAttr, 0, sizeof *hgfsAttr); - memset(update, 0, sizeof *update); - - /* - * Hgfs supports changing these attributes: - * o mode bits (permissions) - * o size - * o access/write times - */ - - if (vap->va_mode != (mode_t)VNOVAL) { - DEBUG(VM_DEBUG_COMM, "updating permissions.\n"); - *update |= HGFS_ATTR_PERMISSIONS; - hgfsAttr->permissions = (vap->va_mode & S_IRWXU) >> HGFS_ATTR_MODE_SHIFT; - ret = TRUE; - } - - if (vap->va_size != (u_quad_t)VNOVAL) { - DEBUG(VM_DEBUG_COMM, "updating size.\n"); - *update |= HGFS_ATTR_SIZE; - hgfsAttr->size = vap->va_size; - ret = TRUE; - } - - if (vap->va_atime.tv_sec != VNOVAL) { - DEBUG(VM_DEBUG_COMM, "updating access time.\n"); - *update |= HGFS_ATTR_ACCESS_TIME; - hgfsAttr->accessTime = HGFS_GET_TIME(vap->va_atime); - ret = TRUE; - } - - if (vap->va_mtime.tv_sec != VNOVAL) { - DEBUG(VM_DEBUG_COMM, "updating write time.\n"); - *update |= HGFS_ATTR_WRITE_TIME; - hgfsAttr->writeTime = HGFS_GET_TIME(vap->va_mtime); - ret = TRUE; - } - - return ret; -} - - -/* - *---------------------------------------------------------------------------- - * - * HgfsMakeFullName -- - * - * Concatenates the path and filename to construct the full path. This - * handles the special cases of . and .. filenames so the Hgfs server - * doesn't return an error. - * - * Results: - * Returns the length of the full path on success, and a negative value on - * error. The full pathname is placed in outBuf. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------------- - */ - -static int -HgfsMakeFullName(const char *path, // IN: Path of directory containing file - uint32_t pathLen, // IN: Length of path - const char *file, // IN: Name of file - size_t fileLen, // IN: Length of filename - char *outBuf, // OUT: Location to write full path - ssize_t bufSize) // IN: Size of the out buffer -{ - - ASSERT(path); - ASSERT(file); - ASSERT(outBuf); - - - DEBUG(VM_DEBUG_INFO, "HgfsMakeFullName:\n" - " path: \"%.*s\" (%d)\n" - " file: \"%s\" (%zu)\n", - pathLen, path, pathLen, file, fileLen); - - /* - * Here there are three possibilities: - * o file is ".", in which case we just place path in outBuf - * o file is "..", in which case we strip the last component from path and - * put that in outBuf - * o for all other cases, we concatenate path, a path separator, file, and - * a NUL terminator and place it in outBuf - */ - - /* Make sure that the path and a NUL terminator will fit. */ - if (bufSize < pathLen + 1) { - return HGFS_ERR_INVAL; - } - - - /* Copy path for this file into the caller's buffer. */ - memset(outBuf, 0, bufSize); - memcpy(outBuf, path, pathLen); - - /* Handle three cases. */ - if (fileLen == 1 && strncmp(file, ".", 1) == 0) { - /* NUL terminate and return provided length. */ - outBuf[pathLen] = '\0'; - return pathLen; - - } else if (fileLen == 2 && strncmp(file, "..", 2) == 0) { - /* - * Replace the last path separator with a NUL terminator, then return the - * size of the buffer. - */ - char *newEnd = rindex(outBuf, '/'); - if (!newEnd) { - /* - * We should never get here since we name the root vnode "/" in - * HgfsMount(). - */ - return HGFS_ERR_INVAL; - } - - *newEnd = '\0'; - return ((uintptr_t)newEnd - (uintptr_t)outBuf); - - } else { - char *outPos; - - if (bufSize < pathLen + 1 + fileLen + 1) { - return HGFS_ERR_INVAL; - } - - outPos = outBuf + pathLen; - /* - * The CPName_ConvertTo function handles multiple path separators - * at the beginning of the filename, so we skip the checks to limit - * them to one. This also enables clobbering newEnd above to work - * properly on base shares (named "//sharename") that need to turn into - * "/". - */ - if (1) { // outBuf[pathLen - 1] != '/') { - *(outPos++) = '/'; - } - - /* Now append the filename and NUL terminator. */ - memcpy(outPos, file, fileLen); - outPos += fileLen; - *(outPos++) = '\0'; - - DEBUG(VM_DEBUG_INFO, "HgfsMakeFullName returning %s\n", outBuf); - - return (outPos - outBuf); - } -} - - -/* - * XXX - * These were taken and slightly modified from hgfs/driver/solaris/vnode.c. - * (Which, in turn, took them from hgfs/driver/linux/driver.c.) Should we - * move them into a hgfs/driver/posix/driver.c? - */ - - -/* - *---------------------------------------------------------------------- - * - * HgfsGetOpenMode -- - * - * Based on the flags requested by the process making the open() - * syscall, determine which open mode (access type) to request from - * the server. - * - * Results: - * Returns the correct HgfsOpenMode enumeration to send to the - * server, or -1 on failure. - * - * Side effects: - * None - * - *---------------------------------------------------------------------- - */ - -static int -HgfsGetOpenMode(uint32 flags) // IN: Open flags -{ - /* - * Preprocessor wrapper kept for when this function is factored out - * into a common file. - */ -#if defined(__FreeBSD__) - /* - * FreeBSD uses different values in the kernel. These are defined in - * <sys/fcntl.h>. - */ - #undef O_RDONLY - #undef O_WRONLY - #undef O_RDWR - - #define O_RDONLY FREAD - #define O_WRONLY FWRITE - #define O_RDWR (FREAD | FWRITE) -#endif - - uint32 mask = O_RDONLY|O_WRONLY|O_RDWR; - int result = -1; - - DEBUG(VM_DEBUG_LOG, "entered\n"); - - /* - * Mask the flags to only look at the access type. - */ - flags &= mask; - - /* Pick the correct HgfsOpenMode. */ - switch (flags) { - - case O_RDONLY: - DEBUG(VM_DEBUG_COMM, "O_RDONLY\n"); - result = HGFS_OPEN_MODE_READ_ONLY; - break; - - case O_WRONLY: - DEBUG(VM_DEBUG_COMM, "O_WRONLY\n"); - result = HGFS_OPEN_MODE_WRITE_ONLY; - break; - - case O_RDWR: - DEBUG(VM_DEBUG_COMM, "O_RDWR\n"); - result = HGFS_OPEN_MODE_READ_WRITE; - break; - - default: - /* This should never happen. */ - NOT_REACHED(); - DEBUG(VM_DEBUG_LOG, "invalid open flags %o\n", flags); - result = -1; - break; - } - - return result; -} - - -/* - *---------------------------------------------------------------------- - * - * HgfsGetOpenFlags -- - * - * Based on the flags requested by the process making the open() - * syscall, determine which flags to send to the server to open the - * file. - * - * Results: - * Returns the correct HgfsOpenFlags enumeration to send to the - * server, or -1 on failure. - * - * Side effects: - * None - * - *---------------------------------------------------------------------- - */ - -static int -HgfsGetOpenFlags(uint32 flags) // IN: Open flags -{ - uint32 mask = O_CREAT | O_TRUNC | O_EXCL; - int result = -1; - - DEBUG(VM_DEBUG_INFO, "entered\n"); - - /* - * Mask the flags to only look at O_CREAT, O_EXCL, and O_TRUNC. - */ - - flags &= mask; - - /* O_EXCL has no meaning if O_CREAT is not set. */ - if (!(flags & O_CREAT)) { - flags &= ~O_EXCL; - } - - /* Pick the right HgfsOpenFlags. */ - switch (flags) { - - case 0: - /* Regular open; fails if file nonexistant. */ - DEBUG(VM_DEBUG_COMM, "0\n"); - result = HGFS_OPEN; - break; - - case O_CREAT: - /* Create file; if it exists already just open it. */ - DEBUG(VM_DEBUG_COMM, "O_CREAT\n"); - result = HGFS_OPEN_CREATE; - break; - - case O_TRUNC: - /* Truncate existing file; fails if nonexistant. */ - DEBUG(VM_DEBUG_COMM, "O_TRUNC\n"); - result = HGFS_OPEN_EMPTY; - break; - - case (O_CREAT | O_EXCL): - /* Create file; fail if it exists already. */ - DEBUG(VM_DEBUG_COMM, "O_CREAT | O_EXCL\n"); - result = HGFS_OPEN_CREATE_SAFE; - break; - - case (O_CREAT | O_TRUNC): - /* Create file; if it exists already, truncate it. */ - DEBUG(VM_DEBUG_COMM, "O_CREAT | O_TRUNC\n"); - result = HGFS_OPEN_CREATE_EMPTY; - break; - - default: - /* - * This can only happen if all three flags are set, which - * conceptually makes no sense because O_EXCL and O_TRUNC are - * mutually exclusive if O_CREAT is set. - * - * However, the open(2) man page doesn't say you can't set all - * three flags, and certain apps (*cough* Nautilus *cough*) do - * so. To be friendly to those apps, we just silenty drop the - * O_TRUNC flag on the assumption that it's safer to honor - * O_EXCL. - */ - DEBUG(VM_DEBUG_INFO, "invalid open flags %o. " - "Ignoring the O_TRUNC flag.\n", flags); - result = HGFS_OPEN_CREATE_SAFE; - break; - } - - return result; -} diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/vnopscommon.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/vnopscommon.c --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/vnopscommon.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/vnopscommon.c 2008-10-13 08:01:44.000000000 +0100 @@ -0,0 +1,2769 @@ +/********************************************************* + * Copyright (C) 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 General Public License as published by the + * Free Software Foundation version 2 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 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 + * + *********************************************************/ + +/* + * vnopscommon.h -- + * + * Common VFS vnop implementations that are shared between both OS X and FreeBSD. + */ + +#include <sys/param.h> // for everything +#include <sys/vnode.h> // for struct vnode +#include <sys/dirent.h> // for struct dirent + +#include "fsutil.h" +#include "debug.h" +#include "vnopscommon.h" +#include "cpName.h" +#include "staticEscape.h" +#include "os.h" + +/* Local function prototypes */ +int HgfsGetNextDirEntry(HgfsSuperInfo *sip, HgfsHandle handle, + uint32_t offset, char *nameOut, size_t nameSize, + HgfsFileType *type, Bool *done); +int HgfsDirOpen(HgfsSuperInfo *sip, struct vnode *vp); +int HgfsFileOpen(HgfsSuperInfo *sip, struct vnode *vp, + int flag, int permissions); +int HgfsDirClose(HgfsSuperInfo *sip, struct vnode *vp); +int HgfsFileClose(HgfsSuperInfo *sip, struct vnode *vp, int flag); +int HgfsDoRead(HgfsSuperInfo *sip, HgfsHandle handle, uint64_t offset, + uint32_t size, struct uio *uiop); +int HgfsDoWrite(HgfsSuperInfo *sip, HgfsHandle handle, int ioflag, + uint64_t offset, uint32_t size, struct uio *uiop); +int HgfsDelete(HgfsSuperInfo *sip, const char *filename, HgfsOp op); +static int HgfsDoGetattrInt(const char *path, const HgfsHandle handle, HgfsSuperInfo *sip, + HgfsAttrV2 *hgfsAttrV2); +static int HgfsDoGetattrByName(const char *path, HgfsSuperInfo *sip, HgfsAttrV2 *hgfsAttrV2); + +#if 0 +static int HgfsDoGetattrByHandle(HgfsHandle handle, HgfsSuperInfo *sip, HgfsAttrV2 *hgfsAttrV2); +#endif + +#define HGFS_FILE_OPEN_MASK (HGFS_OPEN_VALID_MODE | \ + HGFS_OPEN_VALID_FLAGS | \ + HGFS_OPEN_VALID_SPECIAL_PERMS | \ + HGFS_OPEN_VALID_OWNER_PERMS | \ + HGFS_OPEN_VALID_GROUP_PERMS | \ + HGFS_OPEN_VALID_OTHER_PERMS | \ + HGFS_OPEN_VALID_FILE_NAME) + +#define HGFS_CREATE_DIR_MASK (HGFS_CREATE_DIR_VALID_FILE_NAME | \ + HGFS_CREATE_DIR_VALID_SPECIAL_PERMS | \ + HGFS_CREATE_DIR_VALID_OWNER_PERMS | \ + HGFS_CREATE_DIR_VALID_GROUP_PERMS | \ + HGFS_CREATE_DIR_VALID_OTHER_PERMS) + +/* + *---------------------------------------------------------------------------- + * + * HgfsRenameInt -- + * + * Renames the provided source name in the source directory with the + * destination name in the destination directory. A RENAME request is sent + * to the Hgfs server. + * + * Results: + * Returns 0 on success and an error code on error. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +int +HgfsRenameInt(struct vnode *fvp, // IN: "from" file + struct vnode *tdvp, // IN: "to" parent directory + struct vnode *tvp, // IN: "to" file + struct componentname *tcnp) // IN: "to" pathname info +{ + HgfsSuperInfo *sip = HGFS_VP_TO_SIP(fvp); + HgfsKReqHandle req; + HgfsRequest *requestHeader; + HgfsRequestRenameV3 *request; + HgfsReplyRenameV3 *reply; + HgfsFileNameV3 *newNameP; + char *srcFullPath = NULL; // will point to fvp's filename; don't free + char *dstFullPath = NULL; // allocated from M_TEMP; free when done. + uint32 srcFullPathLen; + uint32 dstFullPathLen; + uint32 reqBufferSize; + uint32 reqSize; + uint32 repSize; + int ret; + + /* No cross-device renaming. */ + if (HGFS_VP_TO_MP(fvp) != HGFS_VP_TO_MP(tdvp)) { + return EXDEV; + } + + req = HgfsKReq_AllocateRequest(sip->reqs); + if (!req) { + return ENOMEM; + } + + requestHeader = (HgfsRequest *)HgfsKReq_GetPayload(req); + request = (HgfsRequestRenameV3 *)HGFS_REQ_GET_PAYLOAD_V3(requestHeader); + + /* Initialize the request header */ + HGFS_INIT_REQUEST_HDR(requestHeader, req, HGFS_OP_RENAME_V3); + request->hints = 0; + request->reserved = 0; + + reqSize = HGFS_REQ_PAYLOAD_SIZE_V3(request); + reqBufferSize = HGFS_PACKET_MAX - (reqSize - 2); + + /* Make the full path of the source. */ + srcFullPath = HGFS_VP_TO_FILENAME(fvp); + srcFullPathLen = HGFS_VP_TO_FILENAME_LENGTH(fvp); + + /* Make the full path of the destination. */ + dstFullPath = os_malloc(MAXPATHLEN, M_WAITOK); + if (!dstFullPath) { + ret = ENOMEM; + goto destroyOut; + } + + ret = HgfsMakeFullName(HGFS_VP_TO_FILENAME(tdvp), + HGFS_VP_TO_FILENAME_LENGTH(tdvp), + tcnp->cn_nameptr, + tcnp->cn_namelen, + dstFullPath, + MAXPATHLEN); + if (ret < 0) { + DEBUG(VM_DEBUG_FAIL, "could not construct full path of dest.\n"); + ret = ENAMETOOLONG; + goto destroyOut; + } + dstFullPathLen = ret; + + /* Ensure both names will fit in one request. */ + if ((reqSize + srcFullPathLen + dstFullPathLen) > HGFS_PACKET_MAX) { + DEBUG(VM_DEBUG_FAIL, "names too big for one request.\n"); + ret = EPROTO; + goto destroyOut; + } + + request->oldName.flags = 0; + request->oldName.fid = HGFS_INVALID_HANDLE; + request->oldName.caseType = HGFS_FILE_NAME_CASE_SENSITIVE; + + /* + * Convert an input string to utf8 precomposed form, convert it to + * the cross platform name format and finally unescape any illegal + * filesystem characters. + */ + ret = HgfsNameToWireEncoding(srcFullPath, srcFullPathLen + 1, + request->oldName.name, reqBufferSize); + if (ret < 0) { + DEBUG(VM_DEBUG_FAIL, "Couldn't encode to wire format\n"); + ret = -ret; + goto destroyOut; + } + request->oldName.length = ret; + reqSize += ret; + reqBufferSize -= ret; + + /* + * The new name is placed directly after the old name in the packet and we + * access it through this pointer. + */ + newNameP = (HgfsFileNameV3 *)((char *)&request->oldName + + sizeof request->oldName + + request->oldName.length); + newNameP->flags = 0; + newNameP->fid = HGFS_INVALID_HANDLE; + newNameP->caseType = HGFS_FILE_NAME_CASE_SENSITIVE; + + ret = HgfsNameToWireEncoding(dstFullPath, dstFullPathLen + 1, + newNameP->name, reqBufferSize); + if (ret < 0) { + DEBUG(VM_DEBUG_FAIL, "Couldn't encode to wire format.\n"); + ret = -ret; + goto destroyOut; + } + newNameP->length = ret; + reqSize += ret; + + /* The request's size includes the header, request and both filenames. */ + HgfsKReq_SetPayloadSize(req, reqSize); + + ret = HgfsSubmitRequest(sip, req); + if (ret) { + /* HgfsSubmitRequest() destroys the request if necessary. */ + goto out; + } + + repSize = HGFS_REP_PAYLOAD_SIZE_V3(reply); + + ret = HgfsGetStatus(req, repSize); + if (ret) { + DEBUG(VM_DEBUG_FAIL, "Error encountered with ret = %d\n", ret); + goto destroyOut; + } + + /* Successfully renamed file on the server. */ + DEBUG(VM_DEBUG_DONE, "done.\n"); + +destroyOut: + HgfsKReq_ReleaseRequest(sip->reqs, req); + +out: + if (dstFullPath != NULL) { + os_free(dstFullPath, MAXPATHLEN); + } + return ret; +} + + +/* + *---------------------------------------------------------------------------- + * + * HgfsReaddirInt -- + * + * Reads as many entries from the directory as will fit in to the provided + * buffer. Each directory entry is read by calling HgfsGetNextDirEntry(). + * + * "The vop_readdir() method reads chunks of the directory into a uio + * structure. Each chunk can contain as many entries as will fit within + * the size supplied by the uio structure. The uio_resid structure member + * shows the size of the getdents request in bytes, which is divided by the + * size of the directory entry made by the vop_readdir() method to + * calculate how many directory entries to return." (Solaris Internals, + * p555) + * + * Results: + * Returns 0 on success and a non-zero error code on failure. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +int +HgfsReaddirInt(struct vnode *vp, // IN : Directory vnode to get entries from. + struct uio *uiop, // IN/OUT: Buffer to place dirents in. + int *eofp) // IN/OUT: Have all entries been read? +{ + + HgfsSuperInfo *sip = HGFS_VP_TO_SIP(vp); + HgfsHandle handle; + uint64_t offset; + Bool done; + char *fullName = NULL; /* Hashed to generate inode number */ + int ret = 0; + + /* uio_offset is a signed quantity. */ + if (HGFS_UIOP_TO_OFFSET(uiop) < 0) { + DEBUG(VM_DEBUG_FAIL, "fed negative offset.\n"); + return EINVAL; + } + + /* + * In order to fill the user's buffer with directory entries, we must + * iterate on HGFS_OP_SEARCH_READ requests until either the user's buffer is + * full or there are no more entries. Each call to HgfsGetNextDirEntry() + * fills in the name and attribute structure for the next entry. We then + * escape that name and place it in a kernel buffer that's the same size as + * the user's buffer. Once there are no more entries or no more room in the + * buffer, we copy it to user space. + */ + + /* + * We need to get the handle for this open directory to send to the Hgfs + * server in our requests. + */ + ret = HgfsGetOpenFileHandle(vp, &handle); + if (ret) { + DEBUG(VM_DEBUG_FAIL, "could not get handle.\n"); + return EINVAL; + } + + /* + * Allocate 1K (MAXPATHLEN) buffer for inode number generation. + */ + fullName = os_malloc(MAXPATHLEN, M_WAITOK); + if (!fullName) { + return ENOMEM; + } + + /* + * Loop until one of the following conditions is met: + * o An error occurs while reading a directory entry + * o There are no more directory entries to read + * o The buffer is full and cannot hold the next entry + * + * We request dentries from the Hgfs server based on their index in the + * directory. The offset value is initialized to the value specified in + * the user's io request and is incremented each time through the loop. + * + * dirp is incremented by the record length each time through the loop and + * is used to determine where in the kernel buffer we write to. + */ + for (offset = HGFS_UIOP_TO_OFFSET(uiop), done = 0; /* Nothing */ ; offset++) { + struct dirent dirent, *dirp = &dirent; + char nameBuf[sizeof dirp->d_name]; + HgfsFileType fileType = HGFS_FILE_TYPE_REGULAR; + + DEBUG(VM_DEBUG_COMM, + "HgfsReaddir: getting directory entry at offset %"FMT64"u.\n", offset); + + DEBUG(VM_DEBUG_HANDLE, "** handle=%d, file=%s\n", + handle, HGFS_VP_TO_FILENAME(vp)); + + bzero(dirp, sizeof *dirp); + + ret = HgfsGetNextDirEntry(sip, handle, offset, nameBuf, sizeof nameBuf, + &fileType, &done); + /* If the filename was too long, we skip to the next entry ... */ + if (ret == EOVERFLOW) { + continue; + /* ... but if another error occurred, we return that error code ... */ + } else if (ret) { + DEBUG(VM_DEBUG_FAIL, "failure occurred in HgfsGetNextDirEntry\n"); + goto out; + /* + * ... and if there are no more entries, we set the end of file pointer + * and break out of the loop. + */ + } else if (done == TRUE) { + DEBUG(VM_DEBUG_COMM, "Done reading directory entries.\n"); + if (eofp != NULL) { + *eofp = TRUE; + } + break; + } + /* + * Convert an input string to utf8 decomposed form and then escape its + * buffer. + */ + ret = HgfsNameFromWireEncoding(nameBuf, sizeof nameBuf, dirp->d_name, + sizeof dirp->d_name); + /* + * If the name didn't fit in the buffer or illegal utf8 characters + * were encountered, skip to the next entry. + */ + if (ret < 0) { + DEBUG(VM_DEBUG_FAIL, "HgfsNameFromWireEncoding failed.\n"); + continue; + } + + /* Fill in the directory entry. */ + dirp->d_namlen = ret; + dirp->d_reclen = sizeof(*dirp); // NB: d_namlen must be set first! + dirp->d_type = + (fileType == HGFS_FILE_TYPE_REGULAR) ? DT_REG : + (fileType == HGFS_FILE_TYPE_DIRECTORY) ? DT_DIR : + DT_UNKNOWN; + + /* + * Make sure there is enough room in the buffer for the entire directory + * entry. If not, we just break out of the loop and copy what we have an set + * the return value to be 0. + */ + if (dirp->d_reclen > HGFS_UIOP_TO_RESID(uiop)) { + DEBUG(VM_DEBUG_INFO, "ran out of room in the buffer.\n"); + ret = 0; + break; + } + + + ret = HgfsMakeFullName(HGFS_VP_TO_FILENAME(vp), // Directorie's name + HGFS_VP_TO_FILENAME_LENGTH(vp), // Length + dirp->d_name, // Name of file + dirp->d_namlen, // Length of filename + fullName, // Destination buffer + MAXPATHLEN); // Size of this buffer + + /* Skip this entry if the full path was too long. */ + if (ret < 0) { + continue; + } + + /* + * Place the node id, which serves the purpose of inode number, for this + * filename directory entry. As long as we are using a dirent64, this is + * okay since ino_t is also a u_longlong_t. + */ + HgfsNodeIdGet(&sip->fileHashTable, fullName, (uint32_t)ret, + &dirp->d_fileno); + + /* Copy out this directory entry. */ + ret = uiomove((caddr_t)dirp, dirp->d_reclen, uiop); + if (ret) { + DEBUG(VM_DEBUG_FAIL, "uiomove failed.\n"); + goto out; + } + } + + /* + * uiomove(9) will have incremented the uio offset by the number of bytes + * written. We reset it here to the fs-specific offset in our directory so + * the next time we are called it is correct. (Note, this does not break + * anything and /is/ how this field is intended to be used.) + */ + HGFS_UIOP_SET_OFFSET(uiop, offset); + + DEBUG(VM_DEBUG_DONE, "done (ret=%d, *eofp=%d).\n", ret, *eofp); +out: + if (fullName != NULL) { + os_free(fullName, MAXPATHLEN); + } + DEBUG(VM_DEBUG_ENTRY, "exiting.\n"); + return ret; +} + + +/* + *---------------------------------------------------------------------------- + * + * HgfsGetattrInt -- + * + * "Gets the attributes for the supplied vnode." (Solaris Internals, p536) + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +int +HgfsGetattrInt(struct vnode *vp, // IN : vnode of the file + HgfsVnodeAttr *vap) // OUT: attributes container +{ + + HgfsSuperInfo *sip = HGFS_VP_TO_SIP(vp); + HgfsAttrV2 hgfsAttrV2; + int ret = 0; + + /* XXX It would be nice to do a GetattrByHandle when possible here. */ + ret = HgfsDoGetattrByName(HGFS_VP_TO_FILENAME(vp), sip, &hgfsAttrV2); + + if (!ret) { + /* + * HgfsDoGetattr obtained attributes from the hgfs server so + * map the attributes into BSD attributes. + */ + + HgfsAttrToBSD(vp, &hgfsAttrV2, vap); + } + + return ret; +} + +/* + *---------------------------------------------------------------------------- + * + * HgfsSetattrInt -- + * + * Maps the Solaris attributes to Hgfs attributes (by calling + * HgfsSetattrCopy()) and sends a set attribute request to the Hgfs server. + * + * "Sets the attributes for the supplied vnode." (Solaris Internals, p537) + * + * Results: + * Returns 0 on success and a non-zero error code on error. + * + * Side effects: + * The file on the host will have new attributes. + * + *---------------------------------------------------------------------------- + */ + +int +HgfsSetattrInt(struct vnode *vp, // IN : vnode of the file + HgfsVnodeAttr *vap) // IN : attributes container +{ + HgfsSuperInfo *sip = HGFS_VP_TO_SIP(vp); + HgfsKReqHandle req; + HgfsRequest *requestHeader; + HgfsRequestSetattrV3 *request; + HgfsReplySetattrV3 *reply; + uint32 reqSize; + uint32 reqBufferSize; + uint32 repSize; + char *fullPath = NULL; + uint32 fullPathLen; + int ret; + + ASSERT(vp); + ASSERT(vap); + + req = HgfsKReq_AllocateRequest(sip->reqs); + if (!req) { + return ENOMEM; + } + + requestHeader = (HgfsRequest *)HgfsKReq_GetPayload(req); + request = (HgfsRequestSetattrV3 *)HGFS_REQ_GET_PAYLOAD_V3(requestHeader); + + HGFS_INIT_REQUEST_HDR(requestHeader, req, HGFS_OP_SETATTR_V3); + + request->reserved = 0; + + /* + * Fill the attributes and hint fields of the request. If no updates are + * needed then we will just return success without sending the request. + */ + if (HgfsSetattrCopy(vap, &request->attr, &request->hints) == FALSE) { + DEBUG(VM_DEBUG_COMM, "don't need to update attributes.\n"); + ret = 0; + goto destroyOut; + } + + fullPath = HGFS_VP_TO_FILENAME(vp); + fullPathLen = HGFS_VP_TO_FILENAME_LENGTH(vp); + + reqSize = HGFS_REQ_PAYLOAD_SIZE_V3(request); + reqBufferSize = HGFS_NAME_BUFFER_SIZET(reqSize); + + /* + * Convert an input string to utf8 precomposed form, convert it to + * the cross platform name format and finally unescape any illegal + * filesystem characters. + */ + ret = HgfsNameToWireEncoding(fullPath, fullPathLen + 1, + request->fileName.name, + reqBufferSize); + + if (ret < 0) { + DEBUG(VM_DEBUG_FAIL, "Could not encode to wire format"); + ret = -ret; + goto destroyOut; + } + + request->fileName.fid = HGFS_INVALID_HANDLE; + request->fileName.caseType = HGFS_FILE_NAME_CASE_SENSITIVE; + request->fileName.flags = 0; + request->fileName.length = ret; + + reqSize += ret; + + /* The request's size includes the header, request and filename. */ + HgfsKReq_SetPayloadSize(req, reqSize); + + if (!request->attr.mask) { + /* they were trying to set filerev or vaflags, which we ignore */ + ret = 0; + goto destroyOut; + } + + ret = HgfsSubmitRequest(sip, req); + if (ret) { + /* HgfsSubmitRequest() destroys the request if necessary. */ + goto out; + } + + repSize = HGFS_REP_PAYLOAD_SIZE_V3(reply); + + ret = HgfsGetStatus(req, repSize); + if (ret) { + if (ret == EPROTO) { + DEBUG(VM_DEBUG_FAIL, "Error encountered with ret = %d\n", ret); + } + goto destroyOut; + } + +destroyOut: + DEBUG(VM_DEBUG_DONE, "done with ret = %d\n", ret); + HgfsKReq_ReleaseRequest(sip->reqs, req); +out: + return ret; +} + + +/* + *---------------------------------------------------------------------------- + * + * HgfsVopRmdir -- + * + * Removes the specified name from the provided vnode. Sends a DELETE + * request by calling HgfsDelete() with the filename and correct opcode to + * indicate deletion of a directory. + * + * "Removes the directory pointed to by the supplied vnode." (Solaris + * Internals, p537) + * + * Results: + * Returns 0 on success and an error code on error. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +int +HgfsRmdirInt(struct vnode *dvp, // IN: parent directory + struct vnode *vp, // IN: directory to remove + struct componentname *cnp) // IN: Only used for debugging +{ + int ret = 0; + + HgfsSuperInfo *sip = HGFS_VP_TO_SIP(dvp); + + DEBUG(VM_DEBUG_ENTRY, "HgfsRmdir().\n"); + + DEBUG(VM_DEBUG_ENTRY, "dvp=%p (%s), nm=%s, vp=%p (%s)\n", + dvp, (HGFS_VP_TO_FP(dvp)) ? HGFS_VP_TO_FILENAME(dvp) : "dvp->v_data null", + cnp->cn_nameptr, vp, + (HGFS_VP_TO_FP(vp)) ? HGFS_VP_TO_FILENAME(vp) : "vp->v_data null"); + + ret = HgfsDelete(sip, HGFS_VP_TO_FILENAME(vp), HGFS_OP_DELETE_DIR_V3); + return ret; +} + + +/* + *---------------------------------------------------------------------------- + * + * HgfsRemoveInt -- + * + * Composes the full pathname of this file and sends a DELETE_FILE request + * by calling HgfsDelete(). + * + * "Removes the file for the supplied vnode." (Solaris Internals, p537) + * + * Results: + * Returns 0 on success or a non-zero error code on error. + * + * Side effects: + * If successful, the file specified will be deleted from the host's + * filesystem. + * + *---------------------------------------------------------------------------- + */ + +int HgfsRemoveInt(struct vnode *vp) // IN: Vnode to delete +{ + + int ret = 0; + + HgfsSuperInfo *sip = HGFS_VP_TO_SIP(vp); + + DEBUG(VM_DEBUG_ENTRY, "HgfsRemove().\n"); + + /* Removing directories is a no-no; save that for VNOP_RMDIR. */ + if (HGFS_VP_TO_VTYPE(vp) == VDIR) { + ret = EPERM; + goto out; + } + + /* We can now send the delete request. */ + ret = HgfsDelete(sip, HGFS_VP_TO_FILENAME(vp), HGFS_OP_DELETE_FILE_V3); + +out: + return ret; +} + + +/* + *---------------------------------------------------------------------------- + * + * HgfsCloseInt -- + * + * Called by HgfsVnopClose under Mac OS or HgfsVopClose under FreeBSD to + * close a file. + * + * "Closes the file given by the supplied vnode. When this is the last + * close, some filesystems use vnop_close() to initiate a writeback of + * outstanding dirty pages by checking the reference cound in the vnode." + * (Solaris Internals, p536) + * + * Results: + * Returns 0 on success and an error code on error. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +int +HgfsCloseInt(struct vnode *vp, // IN: Vnode to close. + int mode) // IN: Mode of vnode being closed. +{ + int ret = 0; + HgfsSuperInfo *sip = HGFS_VP_TO_SIP(vp); + + /* + * If we are closing a directory we need to send a SEARCH_CLOSE request, + * but if we are closing a regular file we need to send a CLOSE request. + * Other file types are not supported by the Hgfs protocol. + */ + + switch (HGFS_VP_TO_VTYPE(vp)) { + case VDIR: + ret = HgfsDirClose(sip, vp); + break; + + case VREG: + ret = HgfsFileClose(sip, vp, mode); + break; + + default: + DEBUG(VM_DEBUG_FAIL, "unsupported filetype %d.\n", + HGFS_VP_TO_VTYPE(vp)); + ret = EINVAL; + break; + } + return 0; +} + + +/* + *---------------------------------------------------------------------------- + * + * HgfsOpenInt -- + * + * Invoked when open(2) is called on a file in our filesystem. Sends an + * OPEN request to the Hgfs server with the filename of this vnode. + * + * "Opens a file referenced by the supplied vnode. The open() system call + * has already done a vnop_lookup() on the path name, which returned a vnode + * pointer and then calls to vnop_open(). This function typically does very + * little since most of the real work was performed by vnop_lookup()." + * (Solaris Internals, p537) + * + * Results: + * Returns 0 on success and an error code on error. + * + * Side effects: + * If the HgfsFile for this file does not already have a handle, it is + * given one that can be used for future read and write requests. + * + *---------------------------------------------------------------------------- + */ + +int +HgfsOpenInt(struct vnode *vp, // IN: Vnode to open. + int mode) // IN: Mode of vnode being opened. +{ + HgfsSuperInfo *sip = HGFS_VP_TO_SIP(vp); + + switch(HGFS_VP_TO_VTYPE(vp)) { + case VDIR: + DEBUG(VM_DEBUG_COMM, "opening a directory\n"); + return HgfsDirOpen(sip, vp); + + case VREG: + { + HgfsMode hmode = 0; + + /* + * If HgfsCreate() was called prior to this, this fills in the mode we + * saved there. It's okay if this fails since often HgfsCreate() + * won't have been called. + */ + HgfsGetOpenFileMode(vp, &hmode); + + DEBUG(VM_DEBUG_COMM, "opening a file with flag %x\n", mode); + return HgfsFileOpen(sip, vp, mode, hmode); + } + + default: + DEBUG(VM_DEBUG_FAIL, + "HgfsOpen: unrecognized file of type %d.\n", HGFS_VP_TO_VTYPE(vp)); + return EINVAL; + } + + return 0; +} + + + +/* + *---------------------------------------------------------------------------- + * + * HgfsLookupInt -- + * + * Looks in the provided directory for the specified filename. If we cannot + * determine the vnode locally (i.e, the vnode is not the root vnode of the + * filesystem provided by dvp or in our hashtable), we send a getattr + * request to the server and allocate a vnode and internal filesystem state + * for this file. + * + * Results: + * Returns zero on success and ENOENT if the file cannot be found + * If file is found, a vnode representing the file is returned in vpp. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +int +HgfsLookupInt(struct vnode *dvp, // IN : directory vnode + struct vnode **vpp, // OUT: ptr to vnode if it exists + struct componentname *cnp) // IN : pathname to component +{ + HgfsAttrV2 attrV2; + HgfsSuperInfo *sip; + char *path = NULL; + int ret = 0; + int len = 0; + + ASSERT(dvp); + ASSERT(vpp); + ASSERT(cnp); + + DEBUG(VM_DEBUG_ENTRY, "HgfsVnopLookup(%.*s, %.*s).\n", + HGFS_VP_TO_FILENAME_LENGTH(dvp), HGFS_VP_TO_FILENAME(dvp), + (int)cnp->cn_namelen, cnp->cn_nameptr); + + /* + * Get pointer to the superinfo. If the device is not attached, + * hgfsInstance will not be valid and we immediately return an error. + */ + sip = HGFS_VP_TO_SIP(dvp); + if (!sip) { + DEBUG(VM_DEBUG_FAIL, "couldn't acquire superinfo.\n"); + return ENOTSUP; + } + + /* Snag a pathname buffer */ + path = os_malloc(MAXPATHLEN, M_WAITOK); + if (!path) { + return ENOMEM; + } + + /* Construct the full path for this lookup. */ + len = HgfsMakeFullName(HGFS_VP_TO_FILENAME(dvp), // Path to this file + HGFS_VP_TO_FILENAME_LENGTH(dvp), // Length of path + cnp->cn_nameptr, // File's name + cnp->cn_namelen, // Filename length + path, // Destination buffer + MAXPATHLEN); // Size of dest buffer + if (len < 0) { + DEBUG(VM_DEBUG_FAIL, "LookupInt length is less than zero\n"); + ret = EINVAL; + goto out; + } + + DEBUG(VM_DEBUG_LOAD, "full path is \"%s\"\n", path); + + /* See if the lookup is really for the root vnode. */ + if (strcmp(path, "/") == 0) { + DEBUG(VM_DEBUG_INFO, "returning the root vnode.\n"); + *vpp = sip->rootVnode; + /* + * If we are returning the root vnode, then we need to get a reference + * to it. Under OS X this gets an I/O Count. + */ + HGFS_VPP_GET_IOCOUNT(vpp); + goto out; + }; + + /* Send a Getattr request to the Hgfs server. */ + ret = HgfsDoGetattrByName(path, sip, &attrV2); + + /* + * If this is the final pathname component & the user is attempt a CREATE + * or RENAME, just return without a leaf vnode. (This differs from + * Solaris where ENOENT would be returned in all cases.) + */ + if (ret == ENOENT) { + if ((cnp->cn_nameiop == CREATE || cnp->cn_nameiop == RENAME) && + cnp->cn_flags & ISLASTCN) { + ret = EJUSTRETURN; + goto out; + } + } + + /* Got an error from HgfsDoGetattrByName, return it to the caller. */ + if (ret) { + goto out; + } + + ret = HgfsVnodeGet(vpp, // Location to write vnode's address + sip, // Superinfo + HGFS_VP_TO_MP(dvp), // VFS for our filesystem + path, // Full name of the file + attrV2.type, // Type of file + &sip->fileHashTable); // File hash table + + if (ret) { + DEBUG(VM_DEBUG_FAIL, "couldn't create vnode for \"%s\".\n", path); + goto out; + } + + /* + * Either we will have a cache hit or called HgfsVnodeGet. Both of these + * paths guarantees that *vpp will be set to a vnode. + */ + ASSERT(*vpp); + + DEBUG(VM_DEBUG_LOAD, "assigned vnode %p to %s\n", *vpp, path); + + ret = 0; /* Return success */ + +out: + if (path != NULL) { + os_free(path, MAXPATHLEN); + } + return ret; +} + + +/* + *---------------------------------------------------------------------------- + * + * HgfsCreateInt -- + * + * Called by either HgfsVnopCreate under Mac OS or HgfsVopCreate under + * FreeBSD when the user is trying to create a file by calling open() with + * the O_CREAT flag specified. + * + * The kernel calls the open entry point which calls (HgfsOpenInt()) after + * calling this function, so here all we do is consruct the vnode and + * save the filename and permission bits for the file to be created within + * our filesystem internal state. + * + * Results: + * Returns zero on success and an appropriate error code on error. + * + * Side effects: + * If the file doesn't exist, a vnode will be created. + * + *---------------------------------------------------------------------------- + */ + +int HgfsCreateInt(struct vnode *dvp, // IN : Directory vnode + struct vnode **vpp, // OUT: Pointer to new vnode + struct componentname *cnp, // IN : Location to create new vnode + int mode) // IN : Mode of vnode being created. +{ + HgfsSuperInfo *sip = HGFS_VP_TO_SIP(dvp); + char *fullname = NULL; // allocated from M_TEMP; free when done. + int ret = 0; + + if (*vpp != NULL) { + DEBUG(VM_DEBUG_ALWAYS, "vpp (%p) not null\n", vpp); + return EEXIST; + } + + /* If we have gotten to this point then we know that we need to create a + * new vnode. The actual file will be created on the HGFS server in the + * HgfsOpenInt call should happen right after this call. + */ + fullname = os_malloc(MAXPATHLEN, M_WAITOK); + if (!fullname) { + return ENOMEM; + } + + ret = HgfsMakeFullName(HGFS_VP_TO_FILENAME(dvp), // Name of directory to create in + HGFS_VP_TO_FILENAME_LENGTH(dvp), // Length of name + cnp->cn_nameptr, // Name of file to create + cnp->cn_namelen, // Length of new filename + fullname, // Buffer to write full name + MAXPATHLEN); // Size of this buffer + + if (ret < 0) { + DEBUG(VM_DEBUG_FAIL, "couldn't create full path name.\n"); + ret = ENAMETOOLONG; + goto out; + } + + /* Create the vnode for this file. */ + ret = HgfsVnodeGet(vpp, sip, HGFS_VP_TO_MP(dvp), fullname, + HGFS_FILE_TYPE_REGULAR, &sip->fileHashTable); + if (ret) { + goto out; + } + + /* HgfsVnodeGet() guarantees this. */ + ASSERT(*vpp); + + /* Save the mode so when open is called we can reference it. */ + HgfsSetOpenFileMode(*vpp, mode); + +out: + if (fullname != NULL) { + os_free(fullname, MAXPATHLEN); + } + return ret; +} + + +/* + *---------------------------------------------------------------------------- + * + * HgfsReadInt -- + * + * Called by HgfsVnopRead under Mac OS or HgfsVopRead under FreeBSD to read + * a file. + * + * We call HgfsDoRead() to fill the user's buffer until the request is met + * or the file has no more data. This is done since we can only transfer + * HGFS_IO_MAX bytes in any one request. + * + * "Reads the range supplied for the given vnode. vop_read() typically + * maps the requested range of a file into kernel memory and then uses + * vop_getpage() to do the real work." (Solaris Internals, p537) + * + * Results: + * Returns zero on success and an error code on failure. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +int +HgfsReadInt(struct vnode *vp, // IN : Vnode to read from + struct uio *uiop) // IN/OUT: Buffer to write data into. +{ + HgfsSuperInfo *sip = HGFS_VP_TO_SIP(vp); + HgfsHandle handle; + uint64_t offset; + int ret; + + DEBUG(VM_DEBUG_ENTRY, "entry.\n"); + + /* We can't read from directories, that's what readdir() is for. */ + if (HGFS_VP_TO_VTYPE(vp) == VDIR) { + DEBUG(VM_DEBUG_FAIL, "cannot read directories.\n"); + return EISDIR; + } + + /* off_t is a signed quantity */ + if (HGFS_UIOP_TO_OFFSET(uiop) < 0) { + DEBUG(VM_DEBUG_FAIL, "given negative offset.\n"); + return EINVAL; + } + + /* This is where the user wants to start reading from in the file. */ + offset = HGFS_UIOP_TO_OFFSET(uiop); + + /* + * We need to get the handle for the requests sent to the Hgfs server. Note + * that this is guaranteed to not change until a close(2) is called on this + * vnode, so it's safe and correct to acquire it outside the loop below. + */ + ret = HgfsGetOpenFileHandle(vp, &handle); + if (ret) { + DEBUG(VM_DEBUG_FAIL, "could not get handle.\n"); + return EINVAL; + } + + /* + * Here we loop around HgfsDoRead with requests less than or equal to + * HGFS_IO_MAX until one of the following conditions is met: + * (1) All the requested data has been read + * (2) The file has no more data + * (3) An error occurred + * + * Since HgfsDoRead() calls uiomove(9), we know condition (1) is met when + * the uio structure's uio_resid is decremented to zero. If HgfsDoRead() + * returns 0 we know condition (2) was met, and if it returns less than 0 we + * know condtion (3) was met. + */ + do { + uint32_t size; + + DEBUG(VM_DEBUG_INFO, "offset=%"FMT64"d, uio_offset=%jd\n", + offset, HGFS_UIOP_TO_OFFSET(uiop)); + DEBUG(VM_DEBUG_HANDLE, "** handle=%d, file=%s\n", + handle, HGFS_VP_TO_FILENAME(vp)); + + /* Request at most HGFS_IO_MAX bytes */ + size = (HGFS_UIOP_TO_RESID(uiop) > HGFS_IO_MAX) ? HGFS_IO_MAX : HGFS_UIOP_TO_RESID(uiop); + + /* Send one read request. */ + ret = HgfsDoRead(sip, handle, offset, size, uiop); + if (ret == 0) { + /* On end of file we return success */ + DEBUG(VM_DEBUG_DONE, "end of file reached.\n"); + return 0; + } else if (ret < 0) { + /* + * HgfsDoRead() returns the negative of an appropriate error code to + * differentiate between success and error cases. We flip the sign + * and return the appropriate error code. See the HgfsDoRead() + * function header for a fuller explanation. + */ + DEBUG(VM_DEBUG_FAIL, "HgfsDoRead() failed.\n"); + return -ret; + } + + /* Bump the offset past where we have already read. */ + offset += ret; + } while (HGFS_UIOP_TO_RESID(uiop)); + + /* We fulfilled the user's read request, so return success. */ + DEBUG(VM_DEBUG_DONE, "done.\n"); + return 0; +} + + +/* + *---------------------------------------------------------------------------- + * + * HgfsWriteInt -- + * + * Called by HgfsVnopWrite under Mac OS or HgfsVopWrite under FreeBSD. + * + * We call HgfsDoWrite() once with requests less than or equal to + * HGFS_IO_MAX bytes until the user's write request has completed. + * + * "Writes the range supplied for the given vnode. The write system call + * typically maps the requested range of a file into kernel memory and then + * uses vop_putpage() to do the real work." (Solaris Internals, p538) + * + * Results: + * Returns 0 on success and error code on error. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +int +HgfsWriteInt(struct vnode *vp, // IN : the vnode of the file + struct uio *uiop, // IN/OUT: location of data to be written + int ioflag) // IN : hints & other directives +{ + HgfsSuperInfo *sip = HGFS_VP_TO_SIP(vp); + HgfsHandle handle; + uint64_t offset; + int ret; + + DEBUG(VM_DEBUG_ENTRY, "entry. (vp=%p)\n", vp); + + /* Skip write requests for 0 bytes. */ + if (HGFS_UIOP_TO_RESID(uiop) == 0) { + DEBUG(VM_DEBUG_INFO, "write of 0 bytes requested.\n"); + return 0; + } + + DEBUG(VM_DEBUG_INFO, "file is %s\n", HGFS_VP_TO_FILENAME(vp)); + + /* Off_t is a signed type. */ + if (HGFS_UIOP_TO_OFFSET(uiop) < 0) { + DEBUG(VM_DEBUG_FAIL, "given negative offset.\n"); + return EINVAL; + } + + /* This is where the user will begin writing into the file. */ + offset = HGFS_UIOP_TO_OFFSET(uiop); + + /* Get the handle we need to supply the Hgfs server. */ + ret = HgfsGetOpenFileHandle(vp, &handle); + if (ret) { + DEBUG(VM_DEBUG_FAIL, "could not get handle.\n"); + return EINVAL; + } + + /* + * We loop around calls to HgfsDoWrite() until either (1) we have written all + * of our data or (2) an error has occurred. HGFS_UIOP_TO_RESID(uiop) is decremented + * by uiomove(9F) inside HgfsDoWrite(), so condition (1) is met when it + * reaches zero. Condition (2) occurs when HgfsDoWrite() returns less than + * zero. + */ + do { + uint32_t size; + + DEBUG(VM_DEBUG_INFO, "** offset=%"FMT64"d, uio_offset=%jd\n", + offset, HGFS_UIOP_TO_OFFSET(uiop)); + DEBUG(VM_DEBUG_HANDLE, "** handle=%d, file=%s\n", + handle, HGFS_VP_TO_FILENAME(vp)); + + /* Write at most HGFS_IO_MAX bytes. */ + size = (HGFS_UIOP_TO_RESID(uiop) > HGFS_IO_MAX) ? HGFS_IO_MAX : HGFS_UIOP_TO_RESID(uiop); + + /* Send one write request. */ + ret = HgfsDoWrite(sip, handle, ioflag, offset, size, uiop); + if (ret < 0) { + /* + * As in HgfsRead(), we need to flip the sign. See the comment in the + * function header of HgfsDoWrite() for a more complete explanation. + */ + DEBUG(VM_DEBUG_INFO, "HgfsDoWrite failed, returning %d\n", -ret); + return -ret; + } + + /* Increment the offest by the amount already written. */ + offset += ret; + + } while (HGFS_UIOP_TO_RESID(uiop)); + + /* We have completed the user's write request, so return success. */ + DEBUG(VM_DEBUG_DONE, "done.\n"); + + return 0; +} + + +/* + *---------------------------------------------------------------------------- + * + * HgfsMkdirInt -- + * + * Makes a directory named dirname in the directory specified by the dvp + * vnode by sending a CREATE_DIR request, then allocates a vnode for this + * new directory and writes its address into vpp. + * + * Results: + * Returns 0 on success and a non-zero error code on failure. + * + * Side effects: + * If successful, a directory is created on the host's filesystem. + * + *---------------------------------------------------------------------------- + */ + +int +HgfsMkdirInt(struct vnode *dvp, // IN : directory vnode + struct vnode **vpp, // OUT: pointer to new directory vnode + struct componentname *cnp, // IN : pathname to component + int mode) // IN : mode to create dir +{ + HgfsSuperInfo *sip = HGFS_VP_TO_SIP(dvp); + HgfsKReqHandle req; + HgfsRequest *requestHeader; + HgfsRequestCreateDirV3 *request; + HgfsReplyCreateDirV3 *reply; + uint32 reqSize; + uint32 repSize; + uint32 reqBufferSize; + char *fullName = NULL; // allocated from M_TEMP; free when done. + uint32 fullNameLen; + int ret; + + DEBUG(VM_DEBUG_ENTRY, "dvp=%p (%s), dirname=%s, vpp=%p\n", + dvp, HGFS_VP_TO_FILENAME(dvp), cnp->cn_nameptr, + *vpp); + + /* + * We need to construct the full path of the directory to create then send + * a CREATE_DIR request. If successful we will create a vnode and fill in + * vpp with a pointer to it. + * + * Note that unlike in HgfsCreate(), *vpp is always NULL. + */ + + /* Construct the complete path of the directory to create. */ + fullName = os_malloc(MAXPATHLEN, M_WAITOK); + if (!fullName) { + return ENOMEM; + } + + ret = HgfsMakeFullName(HGFS_VP_TO_FILENAME(dvp), // Parent directory + HGFS_VP_TO_FILENAME_LENGTH(dvp), // Length of name + cnp->cn_nameptr, // Name of file to create + cnp->cn_namelen, // Length of filename + fullName, // Buffer to write full name + MAXPATHLEN); // Size of this buffer + + if (ret < 0) { + DEBUG(VM_DEBUG_FAIL, "couldn't create full path name.\n"); + ret = ENAMETOOLONG; + goto out; + } + fullNameLen = ret; + + req = HgfsKReq_AllocateRequest(sip->reqs); + if (!req) { + ret = ENOMEM; + goto out; + } + + /* Initialize the request's contents. */ + requestHeader = (HgfsRequest *)HgfsKReq_GetPayload(req); + request = (HgfsRequestCreateDirV3 *)HGFS_REQ_GET_PAYLOAD_V3(requestHeader); + + HGFS_INIT_REQUEST_HDR(requestHeader, req, HGFS_OP_CREATE_DIR_V3); + + request->reserved = 0; + request->mask = HGFS_CREATE_DIR_MASK; + request->specialPerms = (mode & (S_ISUID | S_ISGID | S_ISVTX)) >> + HGFS_ATTR_SPECIAL_PERM_SHIFT; + request->ownerPerms = (mode & S_IRWXU) >> HGFS_ATTR_OWNER_PERM_SHIFT; + request->groupPerms = (mode & S_IRWXG) >> HGFS_ATTR_GROUP_PERM_SHIFT; + request->otherPerms = mode & S_IRWXO; + request->fileName.flags = 0; + request->fileName.fid = HGFS_INVALID_HANDLE; + request->fileName.caseType = HGFS_FILE_NAME_CASE_SENSITIVE; + + reqSize = HGFS_REQ_PAYLOAD_SIZE_V3(request); + reqBufferSize = HGFS_NAME_BUFFER_SIZET(reqSize); + + /* + * Convert an input string to utf8 precomposed form, convert it to + * the cross platform name format and finally unescape any illegal + * filesystem characters. + */ + ret = HgfsNameToWireEncoding(fullName, fullNameLen + 1, + request->fileName.name, + reqBufferSize); + + if (ret < 0) { + DEBUG(VM_DEBUG_FAIL,"Could not encode to wire format"); + ret = -ret; + goto destroyOut; + } + + request->fileName.length = ret; + reqSize += ret; + + /* Set the size of this request. */ + HgfsKReq_SetPayloadSize(req, reqSize); + + /* Send the request to guestd. */ + ret = HgfsSubmitRequest(sip, req); + if (ret) { + /* Request is destroyed in HgfsSubmitRequest() if necessary. */ + goto out; + } + + repSize = HGFS_REP_PAYLOAD_SIZE_V3(reply); + + ret = HgfsGetStatus(req, repSize); + if (ret) { + DEBUG(VM_DEBUG_FAIL, "Error encountered with ret = %d\n", ret); + goto destroyOut; + } + + ret = HgfsVnodeGet(vpp, sip, HGFS_VP_TO_MP(dvp), fullName, + HGFS_FILE_TYPE_DIRECTORY, &sip->fileHashTable); + if (ret) { + ret = EIO; + goto destroyOut; + } + + ASSERT(*vpp); + ret = 0; + +destroyOut: + HgfsKReq_ReleaseRequest(sip->reqs, req); +out: + if (fullName != NULL) { + os_free(fullName, MAXPATHLEN); + } + return ret; +} + + +/* + *---------------------------------------------------------------------------- + * + * HgfsDirOpen -- + * + * Invoked when HgfsOpen() is called with a vnode of type VDIR. + * + * Sends a SEARCH_OPEN request to the Hgfs server. + * + * Results: + * Returns zero on success and an error code on error. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +int +HgfsDirOpen(HgfsSuperInfo *sip, // IN: Superinfo pointer + struct vnode *vp) // IN: Vnode of directory to open +{ + HgfsKReqHandle req; + HgfsRequest *requestHeader; + HgfsReply *replyHeader; + HgfsRequestSearchOpenV3 *request; + HgfsReplySearchOpenV3 *reply; + uint32 reqSize; + uint32 repSize; + uint32 reqBufferSize; + char *fullPath; + uint32 fullPathLen; + int ret; + + ASSERT(sip); + ASSERT(vp); + + DEBUG(VM_DEBUG_ENTRY, "opening \"%s\"\n", HGFS_VP_TO_FILENAME(vp)); + + if (HgfsHandleIsSet(vp)) { + /* + * We already have a handle. Idealy this would never happen, but it + * does on OS X when trying to open "." or ".." (because HgfsLookupInt + * is never called by the VFS layer in that specific case.). If that + * happens, then the "per-open-file" HgfsOpenFile associated with this + * vnode will now be shared between two separate opens. At the open + * level, there is no way to insert a new vnode so the exist handle + * is shared. Since this can only happen for directories and directory + * entries are read off of the server at the time of the + * HGFS_OP_SEARCH_OPEN in HgfsServerScandir, there is nothing to do + * here. The worst that could happen is that a process gets stale + * entries and there isn't really any way to avoid that. + * The root vnode directory handle is also shared on both FreeBSD and + * OS X. + */ + +#if defined(__FreeBSD__) + /* + * XXX It looks like the FreeBSD open call asks for a shared vnode lock. + * It would be nice to allow handle sharing for the root vnode. However, + * until the following is answered, I'm going to leave the behavior as is + * (strict one vnode per open file) for FreeBSD until the implications of + * I have time to think through the behavior of two racing open calls (If this + * can really happen then the open call could try to acquire two handles and + * one would be lost (the HgfsSetOpenFileHandle call would fail) and never be + * closed. I don't think this can actually happen because each open syscall first + * calls namei and then lookup. I think the right solution is to make the open call + * send a close call on the handle if it cannot set the handle later on. This would + * make it so that its fine to share the root vnode and would protect us against + * future changes to how open is called by the FreeBSD kernel. Then again, this + * might be overkill. + * This does not happen on OS X becasue the macos function that called HgfsOpenInt + * first acquired a writer lock on the HgfsOpenFile. + */ + return EIO; +#endif + + DEBUG(VM_DEBUG_LOG, "Not doing an open because we have a handle\n"); + HgfsHandleIncrementRefCount(vp); + return 0; + } + + req = HgfsKReq_AllocateRequest(sip->reqs); + if (!req) { + return ENOMEM; + } + + /* Set the correct header values */ + requestHeader = (HgfsRequest *)HgfsKReq_GetPayload(req); + request = (HgfsRequestSearchOpenV3 *)HGFS_REQ_GET_PAYLOAD_V3(requestHeader); + + HGFS_INIT_REQUEST_HDR(requestHeader, req, HGFS_OP_SEARCH_OPEN_V3); + + request->dirName.flags = 0; + request->dirName.caseType = HGFS_FILE_NAME_CASE_SENSITIVE; + request->dirName.fid = HGFS_INVALID_HANDLE; + request->reserved = 0; + + reqSize = HGFS_REQ_PAYLOAD_SIZE_V3(request); + reqBufferSize = HGFS_NAME_BUFFER_SIZET(reqSize); + + if (HGFS_IS_ROOT_VNODE(sip, vp)) { + fullPath = ""; + fullPathLen = 0; + } else { + fullPath = HGFS_VP_TO_FILENAME(vp); + fullPathLen = HGFS_VP_TO_FILENAME_LENGTH(vp); + } + + /* + * Convert an input string to utf8 precomposed form, convert it to + * the cross platform name format and finally unescape any illegal + * filesystem characters. + */ + ret = HgfsNameToWireEncoding(fullPath, fullPathLen + 1, + request->dirName.name, + reqBufferSize); + + if (ret < 0) { + DEBUG(VM_DEBUG_FAIL, "Could not encode to wire format"); + ret = -ret; + goto destroyOut; + } + + request->dirName.length = ret; + reqSize += ret; + + HgfsKReq_SetPayloadSize(req, reqSize); + + /* Submit the request to the Hgfs server */ + ret = HgfsSubmitRequest(sip, req); + if (ret) { + /* HgfsSubmitRequest destroys the request if necessary */ + + goto out; + } + + /* Our reply is in the request packet */ + replyHeader = (HgfsReply *)HgfsKReq_GetPayload(req); + reply = (HgfsReplySearchOpenV3 *)HGFS_REP_GET_PAYLOAD_V3(replyHeader); + + repSize = HGFS_REP_PAYLOAD_SIZE_V3(reply); + + ret = HgfsGetStatus(req, repSize); + if (ret) { + DEBUG(VM_DEBUG_FAIL, "Error encountered with ret = %d\n", ret); + goto destroyOut; + } + + DEBUG(VM_DEBUG_COMM, "received reply for ID %d\n", replyHeader->id); + DEBUG(VM_DEBUG_COMM, " status: %d (see hgfsProto.h)\n", replyHeader->status); + DEBUG(VM_DEBUG_COMM, " handle: %d\n", reply->search); + + /* Set the search open handle for use in HgfsReaddir() */ + ret = HgfsSetOpenFileHandle(vp, reply->search); + if (ret) { + ret = EINVAL; + goto destroyOut; + } + + ret = 0; /* Return success */ + +destroyOut: + /* Make sure we put the request back on the list */ + HgfsKReq_ReleaseRequest(sip->reqs, req); + +out: + DEBUG(VM_DEBUG_DONE, "done\n"); + return ret; +} + + +/* + *---------------------------------------------------------------------------- + * + * HgfsFileOpen -- + * + * Invoked when HgfsOpen() is called with a vnode of type VREG. Sends + * a OPEN request to the Hgfs server. + * + * Note that this function doesn't need to handle creations since the + * HgfsCreate() entry point is called by the kernel for that. + * + * Results: + * Returns zero on success and an error code on error. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +int +HgfsFileOpen(HgfsSuperInfo *sip, // IN: Superinfo pointer + struct vnode *vp, // IN: Vnode of file to open + int flag, // IN: Flags of open + int permissions) // IN: Permissions of open (only when creating) +{ + HgfsKReqHandle req; + HgfsRequest *requestHeader; + HgfsReply *replyHeader; + HgfsRequestOpenV3 *request; + HgfsReplyOpenV3 *reply; + uint32 reqSize; + uint32 repSize; + uint32 reqBufferSize; + char *fullPath = NULL; + uint32 fullPathLen; + int ret; + + ASSERT(sip); + ASSERT(vp); + + DEBUG(VM_DEBUG_ENTRY, "opening \"%s\"\n", HGFS_VP_TO_FILENAME(vp)); + + /* + * Check if the user is trying to create a new share. This check was + * mainly implemented to address the issue with OS X. When the user + * attempts to create a file in the root folder, the server returns ENOENT + * error code. However, OS X specifically checks for this case. If OS X asks for + * the creation of a new file and if it gets ENOENT as a return error code, + * then it assumes that the error was because of some race condition and tries it + * again. Thus, returning ENOENT to the OS X puts the guest kernel into infinite + * loop. In order to resolve this issue, before passing on the request to the + * server, we validate if user is attempting to create a new share. If yes, + * we return EPERM as the error code. + */ + if (HgfsAttemptToCreateShare(HGFS_VP_TO_FILENAME(vp), flag)) { + DEBUG (VM_DEBUG_LOG, "An attempt to create a new share was made.\n"); + return EPERM; + } + + if (HgfsHandleIsSet(vp)) { + DEBUG(VM_DEBUG_FAIL, "Trying to share a file handle for an already open !file! handle\n"); + return EIO; + } + + req = HgfsKReq_AllocateRequest(sip->reqs); + if (!req) { + DEBUG(VM_DEBUG_FAIL, "HgfsKReq_AllocateRequest failed.\n"); + return ENOMEM; + } + + requestHeader = (HgfsRequest *)HgfsKReq_GetPayload(req); + request = (HgfsRequestOpenV3 *)HGFS_REQ_GET_PAYLOAD_V3(requestHeader); + + HGFS_INIT_REQUEST_HDR(requestHeader, req, HGFS_OP_OPEN_V3); + + request->mask = HGFS_FILE_OPEN_MASK; + request->reserved1 = 0; + request->reserved2 = 0; + + reqSize = HGFS_REQ_PAYLOAD_SIZE_V3(request); + reqBufferSize = HGFS_NAME_BUFFER_SIZET(reqSize); + + /* Convert FreeBSD modes to Hgfs modes */ + ret = HgfsGetOpenMode((uint32_t)flag); + if (ret < 0) { + DEBUG(VM_DEBUG_FAIL, "HgfsGetOpenMode failed.\n"); + ret = EINVAL; + goto destroyOut; + } + + request->mode = ret; + DEBUG(VM_DEBUG_COMM, "open mode is %x\n", request->mode); + + /* Convert FreeBSD flags to Hgfs flags */ + ret = HgfsGetOpenFlags((uint32_t)flag); + if (ret < 0) { + DEBUG(VM_DEBUG_FAIL, "HgfsGetOpenFlags failed.\n"); + ret = EINVAL; + goto destroyOut; + } + + request->flags = ret; + DEBUG(VM_DEBUG_COMM, "open flags are %x\n", request->flags); + + request->specialPerms = (permissions & (S_ISUID | S_ISGID | S_ISVTX)) >> + HGFS_ATTR_SPECIAL_PERM_SHIFT; + request->ownerPerms = (permissions & S_IRWXU) >> HGFS_ATTR_OWNER_PERM_SHIFT; + request->groupPerms = (permissions & S_IRWXG) >> HGFS_ATTR_GROUP_PERM_SHIFT; + request->otherPerms = permissions & S_IRWXO; + + fullPath = HGFS_VP_TO_FILENAME(vp); + fullPathLen = HGFS_VP_TO_FILENAME_LENGTH(vp); + + DEBUG(VM_DEBUG_COMM, "permissions are %o\n", permissions); + + request->fileName.flags = 0; + request->fileName.caseType = HGFS_FILE_NAME_CASE_SENSITIVE; + request->fileName.fid = HGFS_INVALID_HANDLE; + + /* + * Convert an input string to utf8 precomposed form, convert it to + * the cross platform name format and finally unescape any illegal + * filesystem characters. + */ + ret = HgfsNameToWireEncoding(fullPath, fullPathLen + 1, + request->fileName.name, + reqBufferSize); + + if (ret < 0) { + DEBUG(VM_DEBUG_FAIL, "Could not encode to wire format"); + ret = -ret; + goto destroyOut; + } + request->fileName.length = ret; + reqSize += ret; + + /* Packet size includes the request and its payload. */ + HgfsKReq_SetPayloadSize(req, reqSize); + + ret = HgfsSubmitRequest(sip, req); + if (ret) { + /* HgfsSubmitRequest will destroy the request if necessary. */ + DEBUG(VM_DEBUG_FAIL, "could not submit request.\n"); + goto out; + } + + replyHeader = (HgfsReply *)HgfsKReq_GetPayload(req); + reply = (HgfsReplyOpenV3 *)HGFS_REP_GET_PAYLOAD_V3(replyHeader); + + repSize = HGFS_REP_PAYLOAD_SIZE_V3(reply); + + ret = HgfsGetStatus(req, repSize); + if (ret) { + DEBUG(VM_DEBUG_FAIL, "Error encountered with ret = %d.\n", ret); + goto destroyOut; + } + + /* + * We successfully received a reply, so we need to save the handle in + * this file's HgfsOpenFile and return success. + */ + ret = HgfsSetOpenFileHandle(vp, reply->file); + if (ret) { + DEBUG(VM_DEBUG_FAIL, "couldn't assign handle %d (%s)\n", + reply->file, HGFS_VP_TO_FILENAME(vp)); + ret = EINVAL; + goto destroyOut; + } + + ret = 0; + +destroyOut: + HgfsKReq_ReleaseRequest(sip->reqs, req); + +out: + DEBUG(VM_DEBUG_DONE, "returning %d\n", ret); + return ret; +} + + +/* + *---------------------------------------------------------------------------- + * + * HgfsDirClose -- + * + * Invoked when HgfsClose() is called with a vnode of type VDIR. + * + * Sends an SEARCH_CLOSE request to the Hgfs server. + * + * Results: + * Returns zero on success and an error code on error. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +int +HgfsDirClose(HgfsSuperInfo *sip, // IN: Superinfo pointer + struct vnode *vp) // IN: Vnode of directory to close +{ + HgfsKReqHandle req; + HgfsRequest *requestHeader; + HgfsReply *replyHeader; + HgfsRequestSearchCloseV3 *request; + HgfsReplySearchCloseV3 *reply; + uint32 reqSize; + uint32 repSize; + int ret; + Bool closed; + + ASSERT(sip); + ASSERT(vp); + + DEBUG(VM_DEBUG_ENTRY, "closing \"%s\"\n", HGFS_VP_TO_FILENAME(vp)); + + /* + * Check to see if we should close the file handle ( which will happen when + * the reference count of the current handle is 1 and will become 0 after + * this close. + */ + if (!HgfsShouldCloseOpenFileHandle(vp)) { + ret = HgfsReleaseOpenFileHandle(vp, &closed); + if (ret || (closed == TRUE)) { + DEBUG(VM_DEBUG_FAIL, "Dirclose\n"); + return EINVAL; + } + return 0; + } + + req = HgfsKReq_AllocateRequest(sip->reqs); + if (!req) { + return ENOMEM; + } + + /* + * Prepare the request structure. Of note here is that the request is + * always the same size so we just set the packetSize to that. + */ + requestHeader = (HgfsRequest *)HgfsKReq_GetPayload(req); + request = (HgfsRequestSearchCloseV3 *)HGFS_REQ_GET_PAYLOAD_V3(requestHeader); + + HGFS_INIT_REQUEST_HDR(requestHeader, req, HGFS_OP_SEARCH_CLOSE_V3); + + request->reserved = 0; + reqSize = HGFS_REQ_PAYLOAD_SIZE_V3(request); + + /* Get this open file's handle, since that is what we want to close. */ + ret = HgfsGetOpenFileHandle(vp, &request->search); + if (ret) { + DEBUG(VM_DEBUG_FAIL, "couldn't get handle for %s\n", + HGFS_VP_TO_FILENAME(vp)); + ret = EINVAL; + goto destroyOut; + } + + HgfsKReq_SetPayloadSize(req, reqSize); + + /* Submit the request to the Hgfs server */ + ret = HgfsSubmitRequest(sip, req); + if (ret) { + /* HgfsSubmitRequest destroys the request if necessary */ + goto out; + } + + replyHeader = (HgfsReply *)HgfsKReq_GetPayload(req); + repSize = HGFS_REP_PAYLOAD_SIZE_V3(reply); + + ret = HgfsGetStatus(req, repSize); + if (ret) { + DEBUG(VM_DEBUG_FAIL, "Error encountered with ret = %d\n", ret); + if (ret != EPROTO) { + ret = EFAULT; + } + goto destroyOut; + } + + DEBUG(VM_DEBUG_COMM, "received reply for ID %d\n", replyHeader->id); + DEBUG(VM_DEBUG_COMM, " status: %d (see hgfsProto.h)\n", replyHeader->status); + + /* Now clear this open file's handle for future use. */ + ret = HgfsReleaseOpenFileHandle(vp, &closed); + if (ret || (closed == FALSE)) { + DEBUG(VM_DEBUG_FAIL, "couldn't clear handle.\n"); + ret = EINVAL; + goto destroyOut; + } + + DEBUG(VM_DEBUG_LOG, "cleared file handle\n"); + + /* The directory was closed successfully so we return success. */ + ret = 0; + +destroyOut: + HgfsKReq_ReleaseRequest(sip->reqs, req); +out: + return ret; +} + + +/* + *---------------------------------------------------------------------------- + * + * HgfsFileClose -- + * + * Invoked when HgfsClose() is called with a vnode of type VREG. + * + * Sends a CLOSE request to the Hgfs server. + * + * Results: + * Returns zero on success and an error code on error. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +int +HgfsFileClose(HgfsSuperInfo *sip, // IN: Superinfo pointer + struct vnode *vp, // IN: Vnode of file to close + int flags) // IN: The mode flags for the close +{ + HgfsKReqHandle req; + HgfsRequest *requestHeader; + HgfsRequestCloseV3 *request; + HgfsReplyCloseV3 *reply; + uint32 reqSize; + uint32 repSize; + int ret; + Bool closed; + + ASSERT(sip); + ASSERT(vp); + + DEBUG(VM_DEBUG_ENTRY, "closing \"%s\"\n", HGFS_VP_TO_FILENAME(vp)); + + /* + * Check to see if we should close the file handle ( which will happen when + * the reference count of the current handle is 1 and will become 0 after + * this close. + */ + if (!HgfsShouldCloseOpenFileHandle(vp)) { + ret = HgfsReleaseOpenFileHandle(vp, &closed); + if (ret || (closed == TRUE)) { + DEBUG(VM_DEBUG_FAIL, " HgfsFileClose: The handle is closed!\n"); + return EINVAL; + } + return 0; + } + + req = HgfsKReq_AllocateRequest(sip->reqs); + if (!req) { + ret = ENOMEM; + goto out; + } + + requestHeader = (HgfsRequest *)HgfsKReq_GetPayload(req); + request = (HgfsRequestCloseV3 *)HGFS_REQ_GET_PAYLOAD_V3(requestHeader); + + HGFS_INIT_REQUEST_HDR(requestHeader, req, HGFS_OP_CLOSE_V3); + + request->reserved = 0; + reqSize = HGFS_REQ_PAYLOAD_SIZE_V3(request); + + /* Tell the Hgfs server which handle to close */ + ret = HgfsGetOpenFileHandle(vp, &request->file); + if (ret) { + DEBUG(VM_DEBUG_FAIL, "couldn't get handle.\n"); + ret = EINVAL; + goto destroyOut; + } + + HgfsKReq_SetPayloadSize(req, reqSize); + + ret = HgfsSubmitRequest(sip, req); + if (ret) { + /* HgfsSubmitRequest will destroy the request if necessary. */ + DEBUG(VM_DEBUG_FAIL, "submit request failed.\n"); + goto out; + } + + repSize = HGFS_REP_PAYLOAD_SIZE_V3(reply); + + ret = HgfsGetStatus(req, repSize); + if (ret) { + DEBUG(VM_DEBUG_FAIL, "Error encountered with ret = %d\n", ret); + goto destroyOut; + } + + /* + * We already verified the size of the reply above since this reply type + * only contains a header, so we just clear the handle and return success. + */ + ret = HgfsReleaseOpenFileHandle(vp, &closed); + if (ret || (closed == FALSE)) { + DEBUG(VM_DEBUG_FAIL, "couldn't clear handle.\n"); + ret = EINVAL; + goto destroyOut; + } + +destroyOut: + HgfsKReq_ReleaseRequest(sip->reqs, req); +out: + DEBUG(VM_DEBUG_DONE, "returning %d\n", ret); + return ret; +} + + +/* + *---------------------------------------------------------------------------- + * + * HgfsDoRead -- + * + * Sends a single READ request to the Hgfs server and writes the contents + * into the user's buffer if successful. + * + * This function is called repeatedly by HgfsRead() with requests of size + * less than or equal to HGFS_IO_MAX. + * + * Note that we return the negative of an appropriate error code in this + * function so we can differentiate between success and failure. On success + * we need to return the number of bytes read, but FreeBSD's error codes are + * positive so we negate them before returning. If callers want to return + * these error codes to the Kernel, they will need to flip their sign. + * + * Results: + * Returns number of bytes read on success and a negative value on error. + * + * Side effects: + * On success, size bytes are written into the user's buffer. + * + *---------------------------------------------------------------------------- + */ + +int +HgfsDoRead(HgfsSuperInfo *sip, // IN: Superinfo pointer + HgfsHandle handle, // IN: Server's handle to read from + uint64_t offset, // IN: File offset to read at + uint32_t size, // IN: Number of bytes to read + struct uio *uiop) // IN: Defines user's read request +{ + HgfsKReqHandle req; + HgfsRequest *requestHeader; + HgfsReply *replyHeader; + HgfsRequestReadV3 *request; + HgfsReplyReadV3 *reply; + uint32 reqSize; + int ret; + + ASSERT(sip); + ASSERT(uiop); + ASSERT(size <= HGFS_IO_MAX); // HgfsRead() should guarantee this + + DEBUG(VM_DEBUG_ENTRY, "entry.\n"); + + req = HgfsKReq_AllocateRequest(sip->reqs); + if (!req) { + return -ENOMEM; + } + + requestHeader = (HgfsRequest *)HgfsKReq_GetPayload(req); + request = (HgfsRequestReadV3 *)HGFS_REQ_GET_PAYLOAD_V3(requestHeader); + + HGFS_INIT_REQUEST_HDR(requestHeader, req, HGFS_OP_READ_V3); + + /* Indicate which file, where in the file, and how much to read. */ + request->file = handle; + request->offset = offset; + request->requiredSize = size; + request->reserved = 0; + + reqSize = HGFS_REQ_PAYLOAD_SIZE_V3(request); + + HgfsKReq_SetPayloadSize(req, reqSize); + + ret = HgfsSubmitRequest(sip, req); + if (ret) { + /* + * We need to flip the sign of the return value to indicate error; see + * the comment in the function header. HgfsSubmitRequest() handles + * destroying the request if necessary, so we don't here. + */ + DEBUG(VM_DEBUG_FAIL, " hgfssubmitrequest failed\n"); + ret = -ret; + goto out; + } + + replyHeader = (HgfsReply *)HgfsKReq_GetPayload(req); + reply = (HgfsReplyReadV3 *)HGFS_REP_GET_PAYLOAD_V3(replyHeader); + + ret = HgfsGetStatus(req, sizeof *replyHeader); + if (ret) { + DEBUG(VM_DEBUG_FAIL, "Error encountered with ret = %d\n", ret); + if (ret != EPROTO) { + ret = EACCES; + } + ret = -ret; + goto destroyOut; + } + + /* + * Now perform checks on the actualSize. There are three cases: + * o actualSize is less than or equal to size, which indicates success + * o actualSize is zero, which indicates the end of the file (and success) + * o actualSize is greater than size, which indicates a server error + */ + if (reply->actualSize <= size) { + /* If we didn't get any data, we don't need to copy to the user. */ + if (reply->actualSize == 0) { + goto success; + } + + /* Perform the copy to the user */ + ret = uiomove(reply->payload, reply->actualSize, uiop); + if (ret) { + ret = -EIO; + goto destroyOut; + } + + /* We successfully copied the payload to the user's buffer */ + goto success; + + } else { + /* We got too much data: server error. */ + DEBUG(VM_DEBUG_FAIL, "received too much data in payload.\n"); + ret = -EPROTO; + goto destroyOut; + } + +success: + ret = reply->actualSize; + DEBUG(VM_DEBUG_DONE, "successfully read %d bytes to user.\n", ret); +destroyOut: + HgfsKReq_ReleaseRequest(sip->reqs, req); +out: + return ret; +} + + +/* + *---------------------------------------------------------------------------- + * + * HgfsDoWrite -- + * + * Sends a single WRITE request to the Hgfs server with the contents of + * the user's buffer. + * + * This function is called repeatedly by HgfsWrite() with requests of size + * less than or equal to HGFS_IO_MAX. + * + * Note that we return the negative of an appropriate error code in this + * function so we can differentiate between success and failure. On success + * we need to return the number of bytes written, but FreeBSD's error codes are + * positive so we negate them before returning. If callers want to return + * these error codes to the kernel, they will need to flip their sign. + * + * Results: + * Returns number of bytes written on success and a negative value on error. + * + * Side effects: + * On success, size bytes are written to the file specified by the handle. + * + *---------------------------------------------------------------------------- + */ + +int +HgfsDoWrite(HgfsSuperInfo *sip, // IN: Superinfo pointer + HgfsHandle handle, // IN: Handle representing file to write to + int ioflag, // IN: Flags for write + uint64_t offset, // IN: Where in the file to begin writing + uint32_t size, // IN: How much data to write + struct uio *uiop) // IN: Describes user's write request +{ + HgfsKReqHandle req; + HgfsRequest *requestHeader; + HgfsReply *replyHeader; + HgfsRequestWriteV3 *request; + HgfsReplyWriteV3 *reply; + uint32 reqSize; + uint32 repSize; + int ret; + + ASSERT(sip); + ASSERT(uiop); + ASSERT(size <= HGFS_IO_MAX); // HgfsWrite() guarantees this + + req = HgfsKReq_AllocateRequest(sip->reqs); + if (!req) { + return -ENOMEM; + } + + requestHeader = (HgfsRequest *)HgfsKReq_GetPayload(req); + request = (HgfsRequestWriteV3 *)HGFS_REQ_GET_PAYLOAD_V3(requestHeader); + + HGFS_INIT_REQUEST_HDR(requestHeader, req, HGFS_OP_WRITE_V3); + + request->file = handle; + request->flags = 0; + request->offset = offset; + request->requiredSize = size; + request->reserved = 0; + + reqSize = HGFS_REQ_PAYLOAD_SIZE_V3(request); + + if (ioflag & IO_APPEND) { + DEBUG(VM_DEBUG_COMM, "writing in append mode.\n"); + request->flags |= HGFS_WRITE_APPEND; + } + + DEBUG(VM_DEBUG_COMM, "requesting write of %d bytes.\n", size); + + /* Copy the data the user wants to write into the payload. */ + ret = uiomove(request->payload, request->requiredSize, uiop); + if (ret) { + DEBUG(VM_DEBUG_FAIL, + "HgfsDoWrite: uiomove(9F) failed copying data from user.\n"); + ret = -EIO; + goto destroyOut; + } + + /* We subtract one so request's 'char payload[1]' member isn't double counted. */ + HgfsKReq_SetPayloadSize(req, reqSize + request->requiredSize - 1); + + ret = HgfsSubmitRequest(sip, req); + if (ret) { + /* + * As in HgfsDoRead(), we need to flip the sign of the error code + * returned by HgfsSubmitRequest(). + */ + DEBUG(VM_DEBUG_FAIL, "HgfsSubmitRequest failed.\n"); + ret = -ret; + goto out; + } + + replyHeader = (HgfsReply *)HgfsKReq_GetPayload(req); + + ret = HgfsGetStatus(req, sizeof *replyHeader); + if (ret) { + DEBUG(VM_DEBUG_FAIL, "Error encountered with ret = %d\n", ret); + if (ret != EPROTO) { + ret = EACCES; + } + ret = -ret; + goto destroyOut; + } + + repSize = HGFS_REP_PAYLOAD_SIZE_V3(reply); + + if (HgfsKReq_GetPayloadSize(req) != repSize) { + DEBUG(VM_DEBUG_FAIL, + "HgfsDoWrite: invalid size of reply on successful reply.\n"); + ret = -EPROTO; + goto destroyOut; + } + + reply = (HgfsReplyWriteV3 *)HGFS_REP_GET_PAYLOAD_V3(replyHeader); + + /* The write was completed successfully, so return the amount written. */ + ret = reply->actualSize; + DEBUG(VM_DEBUG_DONE, "wrote %d bytes.\n", ret); + +destroyOut: + HgfsKReq_ReleaseRequest(sip->reqs, req); +out: + return ret; +} + + +/* + *---------------------------------------------------------------------------- + * + * HgfsDelete -- + * + * Sends a request to delete a file or directory. + * + * Results: + * Returns 0 on success or an error code on error. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +int +HgfsDelete(HgfsSuperInfo *sip, // IN: Superinfo + const char *filename, // IN: Full name of file to remove + HgfsOp op) // IN: Hgfs operation this delete is for +{ + HgfsKReqHandle req; + HgfsRequest *requestHeader; + HgfsReply *replyHeader; + HgfsRequestDeleteV3 *request; + HgfsReplyDeleteV3 *reply; + uint32 reqSize; + uint32 repSize; + uint32 reqBufferSize; + int ret; + + ASSERT(sip); + ASSERT(filename); + ASSERT((op == HGFS_OP_DELETE_FILE_V3) || (op == HGFS_OP_DELETE_DIR_V3)); + + DEBUG(VM_DEBUG_ENTRY, "HgfsDelete().\n"); + + req = HgfsKReq_AllocateRequest(sip->reqs); + if (!req) { + return ENOMEM; + } + + /* Initialize the request's contents. */ + requestHeader = (HgfsRequest *)HgfsKReq_GetPayload(req); + request = (HgfsRequestDeleteV3 *)HGFS_REQ_GET_PAYLOAD_V3(requestHeader); + + HGFS_INIT_REQUEST_HDR(requestHeader, req, op); + request->hints = 0; + request->fileName.fid = HGFS_INVALID_HANDLE; + request->fileName.flags = 0; + request->fileName.caseType = HGFS_FILE_NAME_DEFAULT_CASE; + request->reserved = 0; + + reqSize = HGFS_REQ_PAYLOAD_SIZE_V3(request); + reqBufferSize = HGFS_NAME_BUFFER_SIZET(reqSize); + + /* + * Convert an input string to utf8 precomposed form, convert it to + * the cross platform name format and finally unescape any illegal + * filesystem characters. + */ + ret = HgfsNameToWireEncoding(filename, strlen(filename) + 1, + request->fileName.name, + reqBufferSize); + + if (ret < 0) { + DEBUG(VM_DEBUG_FAIL, "Could not encode to wire format"); + ret = -ret; + goto destroyOut; + } + + request->fileName.length = ret; + reqSize += ret; + + /* Set the size of our request. */ + HgfsKReq_SetPayloadSize(req, reqSize); + + DEBUG(VM_DEBUG_COMM, "deleting \"%s\"\n", filename); + + /* Submit our request to guestd. */ + ret = HgfsSubmitRequest(sip, req); + if (ret) { + /* HgfsSubmitRequest() handles destroying the request if necessary. */ + goto out; + } + + replyHeader = (HgfsReply *)HgfsKReq_GetPayload(req); + + repSize = HGFS_REP_PAYLOAD_SIZE_V3(reply); + + ret = HgfsGetStatus(req, repSize); + if (ret) { + DEBUG(VM_DEBUG_FAIL, "Error encountered with ret = %d\n", ret); + goto destroyOut; + } + + DEBUG(VM_DEBUG_DONE, "done.\n"); + +destroyOut: + HgfsKReq_ReleaseRequest(sip->reqs, req); +out: + return ret; +} + + +/* + *---------------------------------------------------------------------------- + * + * HgfsGetNextDirEntry -- + * + * Writes the name of the directory entry matching the handle and offset to + * nameOut. Also records the entry's type (file, directory) in type. This + * requires sending a SEARCH_READ request. + * + * Results: + * Returns zero on success and an error code on error. The done value is + * set if there are no more directory entries. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +int +HgfsGetNextDirEntry(HgfsSuperInfo *sip, // IN: Superinfo pointer + HgfsHandle handle, // IN: Handle for request + uint32_t offset, // IN: Offset + char *nameOut, // OUT: Location to write name + size_t nameSize, // IN : Size of nameOut + HgfsFileType *type, // OUT: Entry's type + Bool *done) // OUT: Whether there are any more +{ + HgfsKReqHandle req; + HgfsRequest *requestHeader; + HgfsReply *replyHeader; + HgfsRequestSearchReadV3 *request; + HgfsReplySearchReadV3 *reply; + HgfsDirEntry *dirent; + uint32 reqSize; + uint32 repSize; + int ret; + + DEBUG(VM_DEBUG_ENTRY, + "HgfsGetNextDirEntry: handle=%d, offset=%d.\n", handle, offset); + + ASSERT(sip); + ASSERT(nameOut); + ASSERT(done); + + req = HgfsKReq_AllocateRequest(sip->reqs); + if (!req) { + DEBUG(VM_DEBUG_FAIL, "couldn't get req.\n"); + return ENOMEM; + } + + /* + * Fill out the search read request that will return a single directory + * entry for the provided handle at the given offset. + */ + requestHeader = (HgfsRequest *)HgfsKReq_GetPayload(req); + request = (HgfsRequestSearchReadV3 *)HGFS_REQ_GET_PAYLOAD_V3(requestHeader); + + HGFS_INIT_REQUEST_HDR(requestHeader, req, HGFS_OP_SEARCH_READ_V3); + + request->search = handle; + request->offset = offset; + request->flags = 0; + request->reserved = 0; + + reqSize = HGFS_REQ_PAYLOAD_SIZE_V3(request); + HgfsKReq_SetPayloadSize(req, reqSize); + + ret = HgfsSubmitRequest(sip, req); + if (ret) { + /* HgfsSubmitRequest will destroy the request if necessary. */ + DEBUG(VM_DEBUG_FAIL, "HgfsSubmitRequest failed.\n"); + goto out; + } + + replyHeader = (HgfsReply *)HgfsKReq_GetPayload(req); + + ret = HgfsGetStatus(req, sizeof *replyHeader); + if (ret) { + DEBUG(VM_DEBUG_FAIL, "Error encountered with ret = %d\n", ret); + if (ret != EPROTO) { + ret = EINVAL; + } + goto destroyOut; + } + + DEBUG(VM_DEBUG_COMM, "received reply for ID %d\n", + replyHeader->id); + DEBUG(VM_DEBUG_COMM, " status: %d (see hgfsProto.h)\n", replyHeader->status); + + reply = (HgfsReplySearchReadV3 *)HGFS_REP_GET_PAYLOAD_V3(replyHeader); + reply->count = 1; + repSize = HGFS_REP_PAYLOAD_SIZE_V3(reply) + sizeof *dirent; + dirent = (HgfsDirEntry *)reply->payload; + + /* Make sure we got an entire reply (excluding filename) */ + if (HgfsKReq_GetPayloadSize(req) < repSize) { + DEBUG(VM_DEBUG_FAIL, "server didn't provide entire reply.\n"); + ret = EFAULT; + goto destroyOut; + } + + /* See if there are no more filenames to read */ + if (dirent->fileName.length <= 0) { + DEBUG(VM_DEBUG_DONE, "no more directory entries.\n"); + *done = TRUE; + ret = 0; /* return success */ + goto destroyOut; + } + + /* Make sure filename isn't too long */ + if ((dirent->fileName.length >= nameSize) || + (dirent->fileName.length > HGFS_PAYLOAD_MAX(repSize)) ) { + DEBUG(VM_DEBUG_FAIL, "filename is too long.\n"); + ret = EOVERFLOW; + goto destroyOut; + } + + /* + * Everything is all right, copy filename to caller's buffer. Note that even though + * the hgfs SearchRead reply holds lots of information about the file's attributes, + * FreeBSD directory entries do not currently need any of that information except the + * file type. + */ + memcpy(nameOut, dirent->fileName.name, dirent->fileName.length); + nameOut[dirent->fileName.length] = '\0'; + *type = dirent->attr.type; + ret = 0; + + DEBUG(VM_DEBUG_DONE, "done.\n"); +destroyOut: + HgfsKReq_ReleaseRequest(sip->reqs, req); +out: + return ret; +} + + +/* + *---------------------------------------------------------------------------- + * + * HgfsDoGetattrByName -- + * + * Send a name getattr request to the hgfs server and put the result in + * hgfsAttr. + * + * Results: + * Either 0 on success or a BSD error code on failure. The hgfsAttr field + * is only filled out on success. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +static int +HgfsDoGetattrByName(const char *path, // IN : Path to get attributes for + HgfsSuperInfo *sip, // IN : SuperInfo block of hgfs mount. + HgfsAttrV2 *hgfsAttrV2) // OUT: Attributes from hgfs server +{ + return HgfsDoGetattrInt(path, 0, sip, hgfsAttrV2); +} + + +/* + *---------------------------------------------------------------------------- + * + * HgfsDoGetattrByName -- + * + * Send a handle getattr request to the hgfs server and put the result in + * hgfsAttr. + * + * Results: + * Either 0 on success or a BSD error code on failure. The hgfsAttr field + * is only filled out on success. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +#if 0 +static int +HgfsDoGetattrByHandle(HgfsHandle handle, // IN : Hgfs handle for attr request + HgfsSuperInfo *sip, // IN : SuperInfo block for hgfs mount + HgfsAttrV2 *hgfsAttrV2) // OUT: Attributes from hgfs server +{ + return HgfsDoGetattrInt(NULL, handle, sip, hgfsAttrV2); +} +#endif + +/* + *---------------------------------------------------------------------------- + * + * HgfsDoGetattrInt -- + * + * Internal function that actually sends a getattr request to the hgfs + * server and puts the results in hgfsAttrV2. This function should only + * be called by HgfsDoGetattrByName or HgfsDoGetattrByHandle and will do + * a getattr by filename if path is non-NULL. Otherwise it does a getattr by + * handle. + * + * + * Results: + * Either 0 on success or a BSD error code on failure. The hgfsAttr field + * is only filled out on success. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +static int +HgfsDoGetattrInt(const char *path, // IN : Path to get attributes for + HgfsHandle handle, // IN : Handle to get attribues for + HgfsSuperInfo *sip, // IN : SuperInfo block for hgfs mount + HgfsAttrV2 *hgfsAttrV2) // OUT: Attributes from hgfs server +{ + HgfsKReqHandle req; + HgfsRequest *requestHeader; + HgfsReply *replyHeader; + HgfsRequestGetattrV3 *request; + HgfsReplyGetattrV3 *reply; + uint32 reqSize; + uint32 repSize; + uint32 reqBufferSize; + int ret = 0; + + ASSERT(hgfsAttrV2); + + req = HgfsKReq_AllocateRequest(sip->reqs); + if (!req) { + return ENOMEM; + } + + requestHeader = (HgfsRequest *)HgfsKReq_GetPayload(req); + request = (HgfsRequestGetattrV3 *)HGFS_REQ_GET_PAYLOAD_V3(requestHeader); + + HGFS_INIT_REQUEST_HDR(requestHeader, req, HGFS_OP_GETATTR_V3); + request->reserved = 0; + + reqSize = HGFS_REQ_PAYLOAD_SIZE_V3(request); + reqBufferSize = HGFS_NAME_BUFFER_SIZET(reqSize); + + /* + * Per the calling conventions of this function, if the path is NULL then + * this is a Getattr by handle. + */ + if (path == NULL) { + request->hints = HGFS_ATTR_HINT_USE_FILE_DESC; + request->fileName.fid = handle; + request->fileName.flags = HGFS_FILE_NAME_USE_FILE_DESC; + request->fileName.caseType = HGFS_FILE_NAME_DEFAULT_CASE; + request->fileName.length = 0; + + } else { + /* Do a Getattr by path. */ + request->hints = 0; + request->fileName.caseType = HGFS_FILE_NAME_CASE_SENSITIVE; + request->fileName.fid = HGFS_INVALID_HANDLE; + request->fileName.flags = 0; + + /* + * Convert an input string to utf8 precomposed form, convert it to + * the cross platform name format and finally unescape any illegal + * filesystem characters. + */ + ret = HgfsNameToWireEncoding(path, strlen(path) + 1, + request->fileName.name, + reqBufferSize); + + if (ret < 0) { + DEBUG(VM_DEBUG_FAIL, "Could not encode to wire format"); + ret = -ret; + goto destroyOut; + } + request->fileName.length = ret; + reqSize += ret; + } + + /* Packet size includes the header, request and its payload. */ + HgfsKReq_SetPayloadSize(req, reqSize); + + DEBUG(VM_DEBUG_COMM, "sending getattr request for ID %d\n", + requestHeader->id); + DEBUG(VM_DEBUG_COMM, " fileName.length: %d\n", request->fileName.length); + DEBUG(VM_DEBUG_COMM, " fileName.name: \"%s\"\n", request->fileName.name); + + /* + * Submit the request and wait for the reply. HgfsSubmitRequest handles + * destroying the request on both error and interrupt cases. + */ + ret = HgfsSubmitRequest(sip, req); + if (ret) { + /* HgfsSubmitRequest destroys the request if necessary */ + goto out; + } + + replyHeader = (HgfsReply *)HgfsKReq_GetPayload(req); + + ret = HgfsGetStatus(req, sizeof *replyHeader); + if (ret) { + if (ret == EPROTO) { + DEBUG(VM_DEBUG_FAIL, "Error encountered for ID = %d\n" + "with status %d.\n", replyHeader->id, replyHeader->status); + } + goto destroyOut; + } + + reply = (HgfsReplyGetattrV3 *)HGFS_REP_GET_PAYLOAD_V3(replyHeader); + + DEBUG(VM_DEBUG_COMM, "received reply for ID %d\n", replyHeader->id); + DEBUG(VM_DEBUG_COMM, " status: %d (see hgfsProto.h)\n", replyHeader->status); + DEBUG(VM_DEBUG_COMM, " file type: %d\n", reply->attr.type); + DEBUG(VM_DEBUG_COMM, " file size: %llu\n", (long long unsigned)reply->attr.size); + DEBUG(VM_DEBUG_COMM, " permissions: %o\n", reply->attr.ownerPerms); + DEBUG(VM_DEBUG_COMM, " permissions: %o\n", reply->attr.groupPerms); + DEBUG(VM_DEBUG_COMM, " permissions: %o\n", reply->attr.otherPerms); + DEBUG(VM_DEBUG_COMM, " hostFileId: %llu\n", (long long unsigned)reply->attr.hostFileId); + + repSize = HGFS_REP_PAYLOAD_SIZE_V3(reply) + reply->symlinkTarget.length; + + /* The GetAttr succeeded, ensure packet contains correct amount of data. */ + if (HgfsKReq_GetPayloadSize(req) != repSize) { + DEBUG(VM_DEBUG_COMM, "HgfsLookup: invalid packet size received for \"%s\".\n", + path); + ret = EFAULT; + goto destroyOut; + } + + /* Fill out hgfsAttrV2 with the results from the server. */ + memcpy(hgfsAttrV2, &reply->attr, sizeof *hgfsAttrV2); + +destroyOut: + HgfsKReq_ReleaseRequest(sip->reqs, req); + +out: + return ret; +} + + +/* + *---------------------------------------------------------------------------- + * + * HgfsAccessInt -- + * + * Check to ensure the user has the specified type of access to the file. + * + * Results: + * Returns 0 if access is allowed and a non-zero error code otherwise. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +int +HgfsAccessInt(struct vnode *vp, // IN: Vnode to check access for + int mode) // IN: Access mdoe requested. +{ + HgfsVnodeAttr va; + int ret = 0; + + DEBUG(VM_DEBUG_FAIL, "HgfsAccessInt is called\n"); + + /* Get the attributes for this file from the Hgfs server. */ + ret = HgfsGetattrInt(vp, &va); + if (ret) { + return ret; + } + + DEBUG(VM_DEBUG_INFO, "vp's mode: %o\n", va.va_mode); + + if ((mode & S_ISUID) && !(va.va_mode & S_ISUID)) { + DEBUG(VM_DEBUG_FAIL, "Special: user id not set on execution (%s).\n", + HGFS_VP_TO_FILENAME(vp)); + return EPERM; + } + + if ((mode & S_ISGID) && !(va.va_mode & S_ISGID)) { + DEBUG(VM_DEBUG_FAIL, "Special: group id not set on execution(%s).\n", + HGFS_VP_TO_FILENAME(vp)); + return EPERM; + } + + if ((mode & S_ISVTX) && !(va.va_mode & S_ISVTX)) { + DEBUG(VM_DEBUG_FAIL, "Special: sticky bit not set (%s).\n", + HGFS_VP_TO_FILENAME(vp)); + return EPERM; + } + + if ((mode & S_IRUSR) && !(va.va_mode & S_IRUSR)) { + DEBUG(VM_DEBUG_FAIL, "Owner: read access not allowed (%s).\n", + HGFS_VP_TO_FILENAME(vp)); + return EPERM; + } + + if ((mode & S_IWUSR) && !(va.va_mode & S_IWUSR)) { + DEBUG(VM_DEBUG_FAIL, "Owner: write access not allowed (%s).\n", + HGFS_VP_TO_FILENAME(vp)); + return EPERM; + } + + if ((mode & S_IXUSR) && !(va.va_mode & S_IXUSR)) { + DEBUG(VM_DEBUG_FAIL, "Owner: execute access not allowed (%s).\n", + HGFS_VP_TO_FILENAME(vp)); + return EPERM; + } + + if ((mode & S_IRGRP) && !(va.va_mode & S_IRGRP)) { + DEBUG(VM_DEBUG_FAIL, "Group: read access not allowed (%s).\n", + HGFS_VP_TO_FILENAME(vp)); + return EPERM; + } + + if ((mode & S_IWGRP) && !(va.va_mode & S_IWGRP)) { + DEBUG(VM_DEBUG_FAIL, "Group: write access not allowed (%s).\n", + HGFS_VP_TO_FILENAME(vp)); + return EPERM; + } + + if ((mode & S_IXGRP) && !(va.va_mode & S_IXGRP)) { + DEBUG(VM_DEBUG_FAIL, "Group: execute access not allowed (%s).\n", + HGFS_VP_TO_FILENAME(vp)); + return EPERM; + } + + if ((mode & S_IROTH) && !(va.va_mode & S_IROTH)) { + DEBUG(VM_DEBUG_FAIL, "Other: read access not allowed (%s).\n", + HGFS_VP_TO_FILENAME(vp)); + return EPERM; + } + + if ((mode & S_IWOTH) && !(va.va_mode & S_IWOTH)) { + DEBUG(VM_DEBUG_FAIL, "Other: write access not allowed (%s).\n", + HGFS_VP_TO_FILENAME(vp)); + return EPERM; + } + + if ((mode & S_IXOTH) && !(va.va_mode & S_IXOTH)) { + DEBUG(VM_DEBUG_FAIL, "Other: execute access not allowed (%s).\n", + HGFS_VP_TO_FILENAME(vp)); + return EPERM; + } + + return 0; + +} diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/vnopscommon.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/vnopscommon.h --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/vnopscommon.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/vnopscommon.h 2008-10-13 08:01:44.000000000 +0100 @@ -0,0 +1,85 @@ +/********************************************************* + * Copyright (C) 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 General Public License as published by the + * Free Software Foundation version 2 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 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 + * + *********************************************************/ + +/* + * vnopscommon.h -- + * + * Common VFS vnop implementations that are shared between both OS X and FreeBSD. + */ + +#ifndef _HGFS_VNOPS_COMMON_H_ +#define _HGFS_VNOPS_COMMON_H_ + +#include "hgfs_kernel.h" + +/* + * Macros + */ + +/* Access uio struct information in a Mac OS / FreeBSD independent manner. */ +#if defined(__FreeBSD__) +#define HGFS_UIOP_TO_RESID(uiop) \ + ((uiop)->uio_resid) +#define HGFS_UIOP_TO_OFFSET(uiop) \ + ((uiop)->uio_offset) +#define HGFS_UIOP_SET_OFFSET(uiop, offset) \ + ((uiop)->uio_offset = (offset)) +#elif defined(__APPLE__) +#define HGFS_UIOP_TO_RESID(uiop) \ + (uio_resid(uiop)) +#define HGFS_UIOP_TO_OFFSET(uiop) \ + (uio_offset(uiop)) +#define HGFS_UIOP_SET_OFFSET(uiop, offset) \ + (uio_setoffset(uiop, offset)) +#endif + +/* Access vnode struct information in a Mac OS / FreeBSD independent manner. */ +#if defined(__FreeBSD__) +#define HGFS_VP_TO_VTYPE(vp) \ + (vp->v_type) +#define HGFS_VPP_GET_IOCOUNT(vpp) \ + (vref(*vpp)) +#elif defined(__APPLE__) +#define HGFS_VP_TO_VTYPE(vp) \ + (vnode_vtype(vp)) +#define HGFS_VPP_GET_IOCOUNT(vpp) \ + (vnode_get(*vpp)) +#endif + +/* Internal Vnops functions used by both FreeBSD and Mac OS */ +int HgfsReaddirInt(struct vnode *vp, struct uio *uiop, int *eofp); +int HgfsSetattrInt(struct vnode *vp, HgfsVnodeAttr *vap); +int HgfsGetattrInt(struct vnode *vp, HgfsVnodeAttr *vap); +int HgfsRmdirInt(struct vnode *dvp, struct vnode *vp, + struct componentname *cnp); +int HgfsRemoveInt(struct vnode *vp); +int HgfsCloseInt(struct vnode *vp, int mode); +int HgfsOpenInt(struct vnode *vp, int fflag); +int HgfsLookupInt(struct vnode *dvp, struct vnode **vpp, + struct componentname *cnp); +int HgfsCreateInt(struct vnode *dvp, struct vnode **vpp, + struct componentname *cnp, int mode); +int HgfsReadInt(struct vnode *vp, struct uio *uiop); +int HgfsWriteInt(struct vnode *vp, struct uio *uiop, int ioflag); +int HgfsMkdirInt(struct vnode *dvp, struct vnode **vpp, + struct componentname *cnp, int mode); +int HgfsRenameInt(struct vnode *fvp, + struct vnode *tdvp, struct vnode *tvp, + struct componentname *tcnp); +int HgfsAccessInt(struct vnode *vp, int mode); +#endif // _HGFS_VNOPS_COMMON_H_ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/worker.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/worker.c --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/worker.c 2008-01-28 08:02:47.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/worker.c 2008-10-13 08:01:44.000000000 +0100 @@ -22,15 +22,17 @@ * Worker thread to process issue Guest -> Host Hgfs requests. */ +#if defined(__FreeBSD__) +# include <sys/libkern.h> +#endif + #include "hgfs_kernel.h" #include "request.h" #include "requestInt.h" +#include "os.h" #include "hgfsBd.h" -#include <sys/kthread.h> -#include <sys/libkern.h> - /* * Local data @@ -39,7 +41,7 @@ /* * Process structure filled in when the worker thread is created. */ -struct proc *hgfsKReqWorkerProc; +OS_THREAD_T hgfsKReqWorkerThread; /* * See requestInt.h. @@ -88,10 +90,10 @@ * or if the module is being unloaded. */ - mtx_lock(&hgfsKReqWorkItemLock); + os_mutex_lock(hgfsKReqWorkItemLock); while (!ws->exit && !DblLnkLst_IsLinked(&hgfsKReqWorkItemList)) { - cv_wait(&hgfsKReqWorkItemCv, &hgfsKReqWorkItemLock); + os_cv_wait(&hgfsKReqWorkItemCv, hgfsKReqWorkItemLock); } if (ws->exit) { @@ -121,30 +123,32 @@ DblLnkLst_Unlink1(currNode); req = DblLnkLst_Container(currNode, HgfsKReqObject, pendingNode); - mtx_lock(&req->stateLock); + os_mutex_lock(req->stateLock); switch (req->state) { case HGFS_REQ_SUBMITTED: if (!HgfsBd_OpenBackdoor(&hgfsRpcOut)) { req->state = HGFS_REQ_ERROR; - cv_signal(&req->stateCv); - mtx_unlock(&req->stateLock); + os_cv_signal(&req->stateCv); + os_mutex_unlock(req->stateLock); + os_mutex_unlock(hgfsKReqWorkItemLock); goto done; } break; case HGFS_REQ_ABANDONED: case HGFS_REQ_ERROR: goto done; + os_mutex_unlock(hgfsKReqWorkItemLock); break; default: panic("Request object (%p) in unknown state: %u", req, req->state); } - mtx_unlock(&req->stateLock); + os_mutex_unlock(req->stateLock); /* * We're done with the work item list for now. Unlock it and let the file * system add requests while we're busy. */ - mtx_unlock(&hgfsKReqWorkItemLock); + os_mutex_unlock(hgfsKReqWorkItemLock); ret = HgfsBd_Dispatch(hgfsRpcOut, req->payload, &req->payloadSize, &replyPacket); @@ -154,7 +158,7 @@ * etc. */ - mtx_lock(&req->stateLock); + os_mutex_lock(req->stateLock); if ((ret == 0) && (req->state == HGFS_REQ_SUBMITTED)) { bcopy(replyPacket, req->payload, req->payloadSize); @@ -163,8 +167,8 @@ req->state = HGFS_REQ_ERROR; } - cv_signal(&req->stateCv); - mtx_unlock(&req->stateLock); + os_cv_signal(&req->stateCv); + os_mutex_unlock(req->stateLock); if (ret != 0) { /* @@ -176,8 +180,8 @@ } done: - if (atomic_fetchadd_int(&req->refcnt, -1) == 1) { - uma_zfree(hgfsKReqZone, req); + if (os_add_atomic(&req->refcnt, -1) == 1) { + os_zone_free(hgfsKReqZone, req); } } @@ -192,20 +196,20 @@ DblLnkLst_ForEachSafe(currNode, nextNode, &hgfsKReqWorkItemList) { req = DblLnkLst_Container(currNode, HgfsKReqObject, pendingNode); DblLnkLst_Unlink1(currNode); - mtx_lock(&req->stateLock); + os_mutex_lock(req->stateLock); req->state = HGFS_REQ_ERROR; - cv_signal(&req->stateCv); - mtx_unlock(&req->stateLock); + os_cv_signal(&req->stateCv); + os_mutex_unlock(req->stateLock); /* * If we held the final reference to a request, free it. */ - if (atomic_fetchadd_int(&req->refcnt, -1) == 1) { - uma_zfree(hgfsKReqZone, req); + if (os_add_atomic(&req->refcnt, -1) == 1) { + os_zone_free(hgfsKReqZone, req); } } - mtx_unlock(&hgfsKReqWorkItemLock); + os_mutex_unlock(hgfsKReqWorkItemLock); ws->running = FALSE; @@ -213,5 +217,5 @@ HgfsBd_CloseBackdoor(&hgfsRpcOut); } - kthread_exit(0); + os_thread_exit(0); } diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/x86cpuid.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/x86cpuid.h --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmhgfs/x86cpuid.h 2008-01-28 08:02:47.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmhgfs/x86cpuid.h 2008-10-13 08:01:44.000000000 +0100 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998 VMware, Inc. All rights reserved. + * Copyright (C) 1998-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 General Public License as published by the @@ -54,17 +54,36 @@ } CPUIDRegsUnion; /* - * Results of calling cpuid(eaxArg) on all logical processors. + * Results of calling cpuid(eax, ecx) on all host logical CPU. */ #ifdef _MSC_VER #pragma warning (disable :4200) // non-std extension: zero-sized array in struct #endif -typedef struct CPUIDResult { - uint32 numLogicalCPUs; - uint32 eaxArg; - CPUIDRegs regs[0]; -} CPUIDResult; +typedef +#include "vmware_pack_begin.h" +struct CPUIDReply { + /* + * Unique host logical CPU identifier. It does not change across queries, so + * we use it to correlate the replies of multiple queries. + */ + uint64 tag; // OUT + + CPUIDRegs regs; // OUT +} +#include "vmware_pack_end.h" +CPUIDReply; + +typedef +#include "vmware_pack_begin.h" +struct CPUIDQuery { + uint32 eax; // IN + uint32 ecx; // IN + uint32 numLogicalCPUs; // IN/OUT + CPUIDReply logicalCPUs[0]; // OUT +} +#include "vmware_pack_end.h" +CPUIDQuery; /* * CPUID levels the monitor caches and ones that are not cached, but @@ -83,6 +102,8 @@ #define CPUID_CACHED_LEVELS \ CPUIDLEVEL(TRUE, 0, 0) \ CPUIDLEVEL(TRUE, 1, 1) \ + CPUIDLEVEL(FALSE,400, 0x40000000) \ + CPUIDLEVEL(FALSE,410, 0x40000010) \ CPUIDLEVEL(FALSE, 80, 0x80000000) \ CPUIDLEVEL(TRUE, 81, 0x80000001) \ CPUIDLEVEL(FALSE, 88, 0x80000008) \ @@ -90,6 +111,8 @@ #define CPUID_UNCACHED_LEVELS \ CPUIDLEVEL(FALSE, 4, 4) \ + CPUIDLEVEL(FALSE, 5, 5) \ + CPUIDLEVEL(FALSE, 6, 6) \ CPUIDLEVEL(FALSE, A, 0xA) \ CPUIDLEVEL(FALSE, 86, 0x80000006) \ CPUIDLEVEL(FALSE, 87, 0x80000007) \ @@ -128,21 +151,23 @@ */ typedef enum { + CPUID_VENDOR_UNKNOWN, CPUID_VENDOR_COMMON, CPUID_VENDOR_INTEL, CPUID_VENDOR_AMD, CPUID_VENDOR_CYRIX, - CPUID_VENDOR_UNKNOWN, CPUID_NUM_VENDORS } CpuidVendors; #define CPUID_INTEL_VENDOR_STRING "GenuntelineI" #define CPUID_AMD_VENDOR_STRING "AuthcAMDenti" #define CPUID_CYRIX_VENDOR_STRING "CyriteadxIns" +#define CPUID_HYPERV_HYPERVISOR_VENDOR_STRING "Microsoft Hv" #define CPUID_INTEL_VENDOR_STRING_FIXED "GenuineIntel" #define CPUID_AMD_VENDOR_STRING_FIXED "AuthenticAMD" #define CPUID_CYRIX_VENDOR_STRING_FIXED "CyrixInstead" +#define CPUID_HYPERV_HYPERVISOR_VENDOR_STRING "Microsoft Hv" /* * FIELDDEF can be defined to process the CPUID information provided @@ -207,179 +232,233 @@ CPUID_NUM_FIELD_MASKS } CpuidFieldMasks; -/* LEVEL, REG, VENDOR, POS, SIZE, NAME, MASK TYPE, SET TO, [FUNC] */ + +typedef enum { + CPUID_FIELD_SUPPORTED_NO, + CPUID_FIELD_SUPPORTED_YES, + CPUID_FIELD_SUPPORTED_ANY, + CPUID_FIELD_SUPPORTED_NA, + CPUID_NUM_FIELD_SUPPORTEDS +} CpuidFieldSupported; + + +/* LEVEL, REG, VENDOR, POS, SIZE, NAME, MON SUPP, MASK TYPE, SET TO, CPL3, [FUNC] */ #define CPUID_FIELD_DATA_LEVEL_0 \ -FIELDDEF( 0, EAX, COMMON, 0, 32, NUMLEVELS, IGNORE, 0) \ -FIELDDEF( 0, EBX, COMMON, 0, 32, VENDOR1, HOST, 0) \ -FIELDDEF( 0, ECX, COMMON, 0, 32, VENDOR3, HOST, 0) \ -FIELDDEF( 0, EDX, COMMON, 0, 32, VENDOR2, HOST, 0) +FIELDDEF( 0, EAX, COMMON, 0, 32, NUMLEVELS, ANY, IGNORE, 0, FALSE) \ +FIELDDEF( 0, EBX, COMMON, 0, 32, VENDOR1, YES, HOST, 0, TRUE) \ +FIELDDEF( 0, ECX, COMMON, 0, 32, VENDOR3, YES, HOST, 0, TRUE) \ +FIELDDEF( 0, EDX, COMMON, 0, 32, VENDOR2, YES, HOST, 0, TRUE) -/* LEVEL, REG, VENDOR, POS, SIZE, NAME, MASK TYPE, SET TO, [FUNC] */ +/* LEVEL, REG, VENDOR, POS, SIZE, NAME, MON SUPP, MASK TYPE, SET TO, CPL3, [FUNC] */ #define CPUID_FIELD_DATA_LEVEL_1 \ -FIELDDEFA( 1, EAX, COMMON, 0, 4, STEPPING, IGNORE, 0, STEPPING) \ -FIELDDEFA( 1, EAX, COMMON, 4, 4, MODEL, IGNORE, 0, MODEL) \ -FIELDDEFA( 1, EAX, COMMON, 8, 4, FAMILY, HOST, 0, FAMILY) \ -FIELDDEF( 1, EAX, COMMON, 12, 2, TYPE, IGNORE, 0) \ -FIELDDEFA( 1, EAX, COMMON, 16, 4, EXTMODEL, IGNORE, 0, EXT_MODEL) \ -FIELDDEFA( 1, EAX, COMMON, 20, 8, EXTFAMILY, HOST, 0, EXT_FAMILY) \ -FIELDDEF( 1, EBX, COMMON, 0, 8, BRAND_ID, IGNORE, 0) \ -FIELDDEF( 1, EBX, COMMON, 8, 8, CLFL_SIZE, IGNORE, 0) \ -FIELDDEFA( 1, EBX, COMMON, 16, 8, LCPU_COUNT, IGNORE, 0, LCPU_COUNT) \ -FIELDDEFA( 1, EBX, COMMON, 24, 8, APICID, IGNORE, 0, APICID) \ -FLAGDEFA( 1, ECX, COMMON, 0, 1, SSE3, HOST, 0, SSE3) \ -FLAGDEFA( 1, ECX, INTEL, 3, 1, MWAIT, MASK, 0, MWAIT) \ -FLAGDEF( 1, ECX, INTEL, 4, 1, DSCPL, HOST, 0) \ -FLAGDEFA( 1, ECX, INTEL, 5, 1, VMX, MASK, 0, VMX) \ -FLAGDEF( 1, ECX, INTEL, 6, 1, SMX, MASK, 0) \ -FLAGDEF( 1, ECX, INTEL, 7, 1, EST, MASK, 0) \ -FLAGDEF( 1, ECX, INTEL, 8, 1, TM2, MASK, 0) \ -FLAGDEFA( 1, ECX, COMMON, 9, 1, SSSE3, HOST, 0, SSSE3) \ -FLAGDEF( 1, ECX, INTEL, 10, 1, HTCACHE, MASK, 0) \ -FLAGDEFA( 1, ECX, COMMON, 13, 1, CMPX16, HOST, 0, CMPX16) \ -FLAGDEF( 1, ECX, INTEL, 14, 1, xPPR, MASK, 0) \ -FLAGDEF( 1, ECX, INTEL, 15, 1, PERF_MSR, MASK, 0) \ -FLAGDEF( 1, ECX, INTEL, 16, 1, NDA16, MASK, 0) \ -FLAGDEF( 1, ECX, INTEL, 18, 1, DCA, MASK, 0) \ -FLAGDEFA( 1, ECX, INTEL, 19, 1, SSE41, HOST, 0, SSE41) \ -FLAGDEFA( 1, ECX, INTEL, 20, 1, SSE42, HOST, 0, SSE42) \ -FLAGDEFA( 1, ECX, COMMON, 23, 1, POPCNT, HOST, 0, POPCNT) \ -FLAGDEFA( 1, EDX, COMMON, 0, 1, FPU, HOST, 0, FPU) \ -FLAGDEFA( 1, EDX, COMMON, 1, 1, VME, HOST, 0, VME) \ -FLAGDEF( 1, EDX, COMMON, 2, 1, DBGE, HOST, 0) \ -FLAGDEF( 1, EDX, COMMON, 3, 1, PGSZE, HOST, 0) \ -FLAGDEFA( 1, EDX, COMMON, 4, 1, TSC, HOST, 0, TSC) \ -FLAGDEF( 1, EDX, COMMON, 5, 1, MSR, HOST, 0) \ -FLAGDEFA( 1, EDX, COMMON, 6, 1, PAE, HOST, 0, PAE) \ -FLAGDEF( 1, EDX, COMMON, 7, 1, MCK, HOST, 0) \ -FLAGDEF( 1, EDX, COMMON, 8, 1, CPMX, HOST, 0) \ -FLAGDEFA( 1, EDX, COMMON, 9, 1, APIC, MASK, 1, APIC) \ -FLAGDEFA( 1, EDX, COMMON, 11, 1, SEP, HOST, 0, SEP) \ -FLAGDEFA( 1, EDX, COMMON, 12, 1, MTRR, HOST, 0, MTRR) \ -FLAGDEFA( 1, EDX, COMMON, 13, 1, PGE, HOST, 0, PGE) \ -FLAGDEFA( 1, EDX, COMMON, 14, 1, MCA, HOST, 0, MCA) \ -FLAGDEFA( 1, EDX, COMMON, 15, 1, CMOV, HOST, 0, CMOV) \ -FLAGDEFA( 1, EDX, COMMON, 16, 1, PAT, HOST, 0, PAT) \ -FLAGDEF( 1, EDX, COMMON, 17, 1, 36PG, HOST, 0) \ -FLAGDEF( 1, EDX, INTEL, 18, 1, PSN, HOST, 0) \ -FLAGDEFA( 1, EDX, COMMON, 19, 1, CLFL, HOST, 0, CLFL) \ -FLAGDEF( 1, EDX, INTEL, 21, 1, DTES, HOST, 0) \ -FLAGDEF( 1, EDX, INTEL, 22, 1, ACPI, HOST, 0) \ -FLAGDEFA( 1, EDX, COMMON, 23, 1, MMX, HOST, 0, MMX) \ -FLAGDEFA( 1, EDX, COMMON, 24, 1, FXSAVE, HOST, 0, FXSAVE) \ -FLAGDEFA( 1, EDX, COMMON, 25, 1, SSE, HOST, 0, SSE) \ -FLAGDEFA( 1, EDX, COMMON, 26, 1, SSE2, HOST, 0, SSE2) \ -FLAGDEF( 1, EDX, INTEL, 27, 1, SS, HOST, 0) \ -FLAGDEFA( 1, EDX, COMMON, 28, 1, HT, MASK, 0, HT) \ -FLAGDEF( 1, EDX, INTEL, 29, 1, TM, MASK, 0) \ -FLAGDEF( 1, EDX, INTEL, 30, 1, IA64, MASK, 0) \ -FLAGDEF( 1, EDX, INTEL, 31, 1, PBE, MASK, 0) +FIELDDEFA( 1, EAX, COMMON, 0, 4, STEPPING, ANY, IGNORE, 0, FALSE, STEPPING) \ +FIELDDEFA( 1, EAX, COMMON, 4, 4, MODEL, ANY, IGNORE, 0, FALSE, MODEL) \ +FIELDDEFA( 1, EAX, COMMON, 8, 4, FAMILY, YES, HOST, 0, FALSE, FAMILY) \ +FIELDDEF( 1, EAX, COMMON, 12, 2, TYPE, ANY, IGNORE, 0, FALSE) \ +FIELDDEFA( 1, EAX, COMMON, 16, 4, EXTMODEL, ANY, IGNORE, 0, FALSE, EXT_MODEL) \ +FIELDDEFA( 1, EAX, COMMON, 20, 8, EXTFAMILY, YES, HOST, 0, FALSE, EXT_FAMILY) \ +FIELDDEF( 1, EBX, COMMON, 0, 8, BRAND_ID, ANY, IGNORE, 0, FALSE) \ +FIELDDEF( 1, EBX, COMMON, 8, 8, CLFL_SIZE, ANY, IGNORE, 0, FALSE) \ +FIELDDEFA( 1, EBX, COMMON, 16, 8, LCPU_COUNT, ANY, IGNORE, 0, FALSE, LCPU_COUNT) \ +FIELDDEFA( 1, EBX, COMMON, 24, 8, APICID, ANY, IGNORE, 0, FALSE, APICID) \ +FLAGDEFA( 1, ECX, COMMON, 0, 1, SSE3, YES, HOST, 0, TRUE, SSE3) \ +FLAGDEF( 1, ECX, INTEL, 2, 1, NDA2, NO, MASK, 0, FALSE) \ +FLAGDEFA( 1, ECX, COMMON, 3, 1, MWAIT, NO, MASK, 0, FALSE, MWAIT) \ +FLAGDEFA( 1, ECX, INTEL, 4, 1, DSCPL, NO, MASK, 0, FALSE, DSCPL) \ +FLAGDEFA( 1, ECX, INTEL, 5, 1, VMX, NO, MASK, 0, FALSE, VMX) \ +FLAGDEF( 1, ECX, INTEL, 6, 1, SMX, NO, MASK, 0, FALSE) \ +FLAGDEF( 1, ECX, INTEL, 7, 1, EST, NO, MASK, 0, FALSE) \ +FLAGDEF( 1, ECX, INTEL, 8, 1, TM2, NO, MASK, 0, FALSE) \ +FLAGDEFA( 1, ECX, COMMON, 9, 1, SSSE3, YES, HOST, 0, TRUE, SSSE3) \ +FLAGDEF( 1, ECX, INTEL, 10, 1, HTCACHE, NO, MASK, 0, FALSE) \ +FLAGDEFA( 1, ECX, COMMON, 13, 1, CMPX16, YES, HOST, 0, TRUE, CMPX16) \ +FLAGDEF( 1, ECX, INTEL, 14, 1, xPPR, NO, MASK, 0, FALSE) \ +FLAGDEF( 1, ECX, INTEL, 15, 1, PERF_MSR, NO, MASK, 0, FALSE) \ +FLAGDEF( 1, ECX, INTEL, 18, 1, DCA, NO, MASK, 0, FALSE) \ +FLAGDEFA( 1, ECX, INTEL, 19, 1, SSE41, YES, HOST, 0, TRUE, SSE41) \ +FLAGDEFA( 1, ECX, INTEL, 20, 1, SSE42, YES, HOST, 0, TRUE, SSE42) \ +FLAGDEF( 1, ECX, INTEL, 21, 1, X2APIC, NO, MASK, 0, FALSE) \ +FLAGDEF( 1, ECX, INTEL, 22, 1, MOVBE, NO, RSVD, 0, TRUE) \ +FLAGDEFA( 1, ECX, COMMON, 23, 1, POPCNT, YES, HOST, 0, TRUE, POPCNT) \ +FLAGDEF( 1, ECX, INTEL, 24, 1, ULE, NO, RSVD, 0, TRUE) \ +FLAGDEF( 1, ECX, INTEL, 26, 1, XSAVE, NO, MASK, 0, FALSE) \ +FLAGDEF( 1, ECX, INTEL, 27, 1, OSXSAVE, NO, RSVD, 0, TRUE) \ +FLAGDEFA( 1, ECX, COMMON, 31, 1, HYPERVISOR, ANY, IGNORE, 0, FALSE, HYPERVISOR)\ +FLAGDEFA( 1, EDX, COMMON, 0, 1, FPU, YES, HOST, 0, TRUE, FPU) \ +FLAGDEFA( 1, EDX, COMMON, 1, 1, VME, YES, HOST, 0, FALSE, VME) \ +FLAGDEF( 1, EDX, COMMON, 2, 1, DBGE, YES, HOST, 0, FALSE) \ +FLAGDEF( 1, EDX, COMMON, 3, 1, PGSZE, YES, HOST, 0, FALSE) \ +FLAGDEFA( 1, EDX, COMMON, 4, 1, TSC, YES, HOST, 0, TRUE, TSC) \ +FLAGDEF( 1, EDX, COMMON, 5, 1, MSR, YES, HOST, 0, FALSE) \ +FLAGDEFA( 1, EDX, COMMON, 6, 1, PAE, YES, HOST, 0, FALSE, PAE) \ +FLAGDEF( 1, EDX, COMMON, 7, 1, MCK, YES, HOST, 0, FALSE) \ +FLAGDEF( 1, EDX, COMMON, 8, 1, CPMX, YES, HOST, 0, TRUE) \ +FLAGDEFA( 1, EDX, COMMON, 9, 1, APIC, ANY, MASK, 1, FALSE, APIC) \ +FLAGDEFA( 1, EDX, COMMON, 11, 1, SEP, YES, HOST, 0, TRUE, SEP) \ +FLAGDEFA( 1, EDX, COMMON, 12, 1, MTRR, YES, HOST, 0, FALSE, MTRR) \ +FLAGDEFA( 1, EDX, COMMON, 13, 1, PGE, YES, HOST, 0, FALSE, PGE) \ +FLAGDEFA( 1, EDX, COMMON, 14, 1, MCA, YES, HOST, 0, FALSE, MCA) \ +FLAGDEFA( 1, EDX, COMMON, 15, 1, CMOV, YES, HOST, 0, TRUE, CMOV) \ +FLAGDEFA( 1, EDX, COMMON, 16, 1, PAT, YES, HOST, 0, FALSE, PAT) \ +FLAGDEF( 1, EDX, COMMON, 17, 1, 36PG, YES, HOST, 0, FALSE) \ +FLAGDEF( 1, EDX, INTEL, 18, 1, PSN, YES, HOST, 0, FALSE) \ +FLAGDEFA( 1, EDX, COMMON, 19, 1, CLFL, YES, HOST, 0, TRUE, CLFL) \ +FLAGDEF( 1, EDX, INTEL, 21, 1, DTES, YES, HOST, 0, FALSE) \ +FLAGDEF( 1, EDX, INTEL, 22, 1, ACPI, YES, HOST, 0, FALSE) \ +FLAGDEFA( 1, EDX, COMMON, 23, 1, MMX, YES, HOST, 0, TRUE, MMX) \ +FLAGDEFA( 1, EDX, COMMON, 24, 1, FXSAVE, YES, HOST, 0, TRUE, FXSAVE) \ +FLAGDEFA( 1, EDX, COMMON, 25, 1, SSE, YES, HOST, 0, TRUE, SSE) \ +FLAGDEFA( 1, EDX, COMMON, 26, 1, SSE2, YES, HOST, 0, TRUE, SSE2) \ +FLAGDEF( 1, EDX, INTEL, 27, 1, SS, YES, HOST, 0, FALSE) \ +FLAGDEFA( 1, EDX, COMMON, 28, 1, HT, NO, MASK, 0, FALSE, HT) \ +FLAGDEF( 1, EDX, INTEL, 29, 1, TM, NO, MASK, 0, FALSE) \ +FLAGDEF( 1, EDX, INTEL, 30, 1, IA64, NO, MASK, 0, FALSE) \ +FLAGDEF( 1, EDX, INTEL, 31, 1, PBE, NO, MASK, 0, FALSE) -/* LEVEL, REG, VENDOR, POS, SIZE, NAME, MASK TYPE, SET TO, [FUNC] */ +/* LEVEL, REG, VENDOR, POS, SIZE, NAME, MON SUPP, MASK TYPE, SET TO, CPL3, [FUNC] */ #define CPUID_FIELD_DATA_LEVEL_4 \ -FIELDDEF( 4, EAX, INTEL, 0, 5, CACHE_TYPE, IGNORE, 0) \ -FIELDDEF( 4, EAX, INTEL, 5, 3, CACHE_LEVEL, IGNORE, 0) \ -FIELDDEF( 4, EAX, INTEL, 14, 12, CACHE_NUMHT_SHARING, IGNORE, 0) \ -FIELDDEFA( 4, EAX, INTEL, 26, 6, CORE_COUNT, IGNORE, 0, INTEL_CORE_COUNT) \ -FIELDDEF( 4, EBX, INTEL, 0, 12, CACHE_LINE, IGNORE, 0) \ -FIELDDEF( 4, EBX, INTEL, 12, 10, CACHE_PART, IGNORE, 0) \ -FIELDDEF( 4, EBX, INTEL, 22, 10, CACHE_WAYS, IGNORE, 0) +FIELDDEF( 4, EAX, INTEL, 0, 5, CACHE_TYPE, NA, IGNORE, 0, FALSE) \ +FIELDDEF( 4, EAX, INTEL, 5, 3, CACHE_LEVEL, NA, IGNORE, 0, FALSE) \ +FIELDDEF( 4, EAX, INTEL, 14, 12, CACHE_NUMHT_SHARING, NA, IGNORE, 0, FALSE) \ +FIELDDEFA( 4, EAX, INTEL, 26, 6, CORE_COUNT, NA, IGNORE, 0, FALSE, INTEL_CORE_COUNT) \ +FIELDDEF( 4, EBX, INTEL, 0, 12, CACHE_LINE, NA, IGNORE, 0, FALSE) \ +FIELDDEF( 4, EBX, INTEL, 12, 10, CACHE_PART, NA, IGNORE, 0, FALSE) \ +FIELDDEF( 4, EBX, INTEL, 22, 10, CACHE_WAYS, NA, IGNORE, 0, FALSE) + +/* LEVEL, REG, VENDOR, POS, SIZE, NAME, MON SUPP, MASK TYPE, SET TO, CPL3, [FUNC] */ +#define CPUID_FIELD_DATA_LEVEL_5 \ +FIELDDEF( 5, EAX, COMMON, 0, 16, MWAIT_MIN_SIZE, NA, IGNORE, 0, FALSE) \ +FIELDDEF( 5, EBX, COMMON, 0, 16, MWAIT_MAX_SIZE, NA, IGNORE, 0, FALSE) \ +FLAGDEF( 5, ECX, COMMON, 0, 1, MWAIT_EXTENSIONS, NA, IGNORE, 0, FALSE) \ +FLAGDEF( 5, ECX, COMMON, 1, 1, MWAIT_INTR_BREAK, NA, IGNORE, 0, FALSE) \ +FIELDDEF( 5, EDX, INTEL, 0, 4, MWAIT_C0_SUBSTATE, NA, IGNORE, 0, FALSE) \ +FIELDDEF( 5, EDX, INTEL, 4, 4, MWAIT_C1_SUBSTATE, NA, IGNORE, 0, FALSE) \ +FIELDDEF( 5, EDX, INTEL, 8, 4, MWAIT_C2_SUBSTATE, NA, IGNORE, 0, FALSE) \ +FIELDDEF( 5, EDX, INTEL, 12, 4, MWAIT_C3_SUBSTATE, NA, IGNORE, 0, FALSE) \ +FIELDDEF( 5, EDX, INTEL, 16, 4, MWAIT_C4_SUBSTATE, NA, IGNORE, 0, FALSE) + +/* LEVEL, REG, VENDOR, POS, SIZE, NAME, MON SUPP, MASK TYPE, SET TO, CPL3, [FUNC] */ +#define CPUID_FIELD_DATA_LEVEL_6 \ +FLAGDEF( 6, EAX, INTEL, 0, 1, THERMAL_SENSOR, NA, IGNORE, 0, FALSE) \ +FLAGDEF( 6, EAX, INTEL, 1, 1, TURBO_MODE, NA, IGNORE, 0, FALSE) \ +FIELDDEF( 6, EBX, INTEL, 0, 4, NUM_INTR_THRESHOLDS, NA, IGNORE, 0, FALSE) \ +FLAGDEF( 6, ECX, INTEL, 0, 1, HW_COORD_FEEDBACK, NA, IGNORE, 0, FALSE) -/* LEVEL, REG, VENDOR, POS, SIZE, NAME, MASK TYPE, SET TO, [FUNC] */ +/* LEVEL, REG, VENDOR, POS, SIZE, NAME, MON SUPP, MASK TYPE, SET TO, CPL3, [FUNC] */ #define CPUID_FIELD_DATA_LEVEL_A \ -FIELDDEF( A, EAX, INTEL, 0, 8, PMC_VERSION, IGNORE, 0) \ -FIELDDEFA( A, EAX, INTEL, 8, 8, NUM_PMCS, IGNORE, 0, NUM_PMCS) \ -FIELDDEF( A, EAX, INTEL, 16, 8, PMC_BIT_WIDTH, IGNORE, 0) \ -FIELDDEF( A, EAX, INTEL, 24, 8, PMC_EBX_LENGTH, IGNORE, 0) \ -FLAGDEF( A, EBX, INTEL, 0, 1, PMC_CORE_CYCLE, IGNORE, 0) \ -FLAGDEF( A, EBX, INTEL, 1, 1, PMC_INSTR_RETIRED, IGNORE, 0) \ -FLAGDEF( A, EBX, INTEL, 2, 1, PMC_REF_CYCLES, IGNORE, 0) \ -FLAGDEF( A, EBX, INTEL, 3, 1, PMC_LAST_LVL_CREF, IGNORE, 0) \ -FLAGDEF( A, EBX, INTEL, 4, 1, PMC_LAST_LVL_CMISS, IGNORE, 0) \ -FLAGDEF( A, EBX, INTEL, 5, 1, PMC_BR_INST_RETIRED, IGNORE, 0) \ -FLAGDEF( A, EBX, INTEL, 6, 1, PMC_BR_MISS_RETIRED, IGNORE, 0) +FIELDDEFA( A, EAX, INTEL, 0, 8, PMC_VERSION, NA, IGNORE, 0, FALSE, PMC_VERSION) \ +FIELDDEFA( A, EAX, INTEL, 8, 8, NUM_PMCS, NA, IGNORE, 0, FALSE, NUM_PMCS) \ +FIELDDEF( A, EAX, INTEL, 16, 8, PMC_BIT_WIDTH, NA, IGNORE, 0, FALSE) \ +FIELDDEFA( A, EAX, INTEL, 24, 8, PMC_EBX_LENGTH, NA, IGNORE, 0, FALSE, PMC_EBX_LENGTH) \ +FLAGDEF( A, EBX, INTEL, 0, 1, PMC_CORE_CYCLE, NA, IGNORE, 0, FALSE) \ +FLAGDEF( A, EBX, INTEL, 1, 1, PMC_INSTR_RETIRED, NA, IGNORE, 0, FALSE) \ +FLAGDEF( A, EBX, INTEL, 2, 1, PMC_REF_CYCLES, NA, IGNORE, 0, FALSE) \ +FLAGDEF( A, EBX, INTEL, 3, 1, PMC_LAST_LVL_CREF, NA, IGNORE, 0, FALSE) \ +FLAGDEF( A, EBX, INTEL, 4, 1, PMC_LAST_LVL_CMISS, NA, IGNORE, 0, FALSE) \ +FLAGDEF( A, EBX, INTEL, 5, 1, PMC_BR_INST_RETIRED, NA, IGNORE, 0, FALSE) \ +FLAGDEF( A, EBX, INTEL, 6, 1, PMC_BR_MISS_RETIRED, NA, IGNORE, 0, FALSE) -/* LEVEL, REG, VENDOR, POS, SIZE, NAME, MASK TYPE, SET TO, [FUNC] */ +/* LEVEL, REG, VENDOR, POS, SIZE, NAME, MON SUPP, MASK TYPE, SET TO, CPL3, [FUNC] */ #define CPUID_FIELD_DATA_LEVEL_80 \ -FIELDDEF( 80, EAX, COMMON, 0, 32, NUM_EXT_LEVELS, IGNORE, 0) \ -FIELDDEF( 80, EBX, AMD, 0, 32, AMD_VENDOR1, IGNORE, 0) \ -FIELDDEF( 80, ECX, AMD, 0, 32, AMD_VENDOR3, IGNORE, 0) \ -FIELDDEF( 80, EDX, AMD, 0, 32, AMD_VENDOR2, IGNORE, 0) +FIELDDEF( 80, EAX, COMMON, 0, 32, NUM_EXT_LEVELS, NA, IGNORE, 0, FALSE) \ +FIELDDEF( 80, EBX, AMD, 0, 32, AMD_VENDOR1, NA, IGNORE, 0, FALSE) \ +FIELDDEF( 80, ECX, AMD, 0, 32, AMD_VENDOR3, NA, IGNORE, 0, FALSE) \ +FIELDDEF( 80, EDX, AMD, 0, 32, AMD_VENDOR2, NA, IGNORE, 0, FALSE) -/* LEVEL, REG, VENDOR, POS, SIZE, NAME, MASK TYPE, SET TO, [FUNC] */ +/* LEVEL, REG, VENDOR, POS, SIZE, NAME, MON SUPP, MASK TYPE, SET TO, CPL3, [FUNC] */ #define CPUID_FIELD_DATA_LEVEL_81 \ -FIELDDEF( 81, EAX, INTEL, 0, 32, UNKNOWN81EAX, IGNORE, 0) \ -FIELDDEF( 81, EAX, AMD, 0, 4, STEPPING, IGNORE, 0) \ -FIELDDEF( 81, EAX, AMD, 4, 4, MODEL, IGNORE, 0) \ -FIELDDEF( 81, EAX, AMD, 8, 4, FAMILY, IGNORE, 0) \ -FIELDDEF( 81, EAX, AMD, 12, 2, TYPE, IGNORE, 0) \ -FIELDDEF( 81, EAX, AMD, 16, 4, EXTMODEL, IGNORE, 0) \ -FIELDDEF( 81, EAX, AMD, 20, 8, EXTFAMILY, IGNORE, 0) \ -FIELDDEF( 81, EBX, INTEL, 0, 32, UNKNOWN81EBX, IGNORE, 0) \ -FIELDDEF( 81, EBX, AMD, 0, 16, BRAND_ID, IGNORE, 0) \ -FIELDDEF( 81, EBX, AMD, 16, 16, UNDEF, IGNORE, 0) \ -FLAGDEFA( 81, ECX, COMMON, 0, 1, LAHF, HOST, 0, LAHF64) \ -FLAGDEFA( 81, ECX, AMD, 1, 1, CMPLEGACY, MASK, 0, CMPLEGACY) \ -FLAGDEFA( 81, ECX, AMD, 2, 1, SVM, MASK, 0, SVM) \ -FLAGDEFA( 81, ECX, AMD, 3, 1, EXTAPICSPC, HOST, 0, EXTAPICSPC) \ -FLAGDEFA( 81, ECX, AMD, 4, 1, CR8AVAIL, MASK, 0, CR8AVAIL) \ -FLAGDEFA( 81, ECX, AMD, 5, 1, ABM, HOST, 0, ABM) \ -FLAGDEFA( 81, ECX, AMD, 6, 1, SSE4A, HOST, 0, SSE4A) \ -FLAGDEF( 81, ECX, AMD, 7, 1, MISALIGNED_SSE, HOST, 0) \ -FLAGDEF( 81, ECX, AMD, 8, 1, 3DNPREFETCH, HOST, 0) \ -FLAGDEF( 81, EDX, AMD, 0, 1, FPU, HOST, 0) \ -FLAGDEF( 81, EDX, AMD, 1, 1, VME, HOST, 0) \ -FLAGDEF( 81, EDX, AMD, 2, 1, DBGE, HOST, 0) \ -FLAGDEF( 81, EDX, AMD, 3, 1, PGSZE, HOST, 0) \ -FLAGDEF( 81, EDX, AMD, 4, 1, TSC, HOST, 0) \ -FLAGDEF( 81, EDX, AMD, 5, 1, MSR, HOST, 0) \ -FLAGDEF( 81, EDX, AMD, 6, 1, PAE, HOST, 0) \ -FLAGDEF( 81, EDX, AMD, 7, 1, MCK, HOST, 0) \ -FLAGDEF( 81, EDX, AMD, 8, 1, CPMX, HOST, 0) \ -FLAGDEF( 81, EDX, AMD, 9, 1, APIC, MASK, 1) \ -FLAGDEFA( 81, EDX, COMMON, 11, 1, SYSC, IGNORE, 0, SYSC) \ -FLAGDEF( 81, EDX, AMD, 12, 1, MTRR, HOST, 0) \ -FLAGDEF( 81, EDX, AMD, 13, 1, PGE, HOST, 0) \ -FLAGDEF( 81, EDX, AMD, 14, 1, MCA, HOST, 0) \ -FLAGDEF( 81, EDX, AMD, 15, 1, CMOV, HOST, 0) \ -FLAGDEF( 81, EDX, AMD, 16, 1, PAT, HOST, 0) \ -FLAGDEF( 81, EDX, AMD, 17, 1, 36PG, HOST, 0) \ -FLAGDEFA( 81, EDX, COMMON, 20, 1, NX, HOST, 0, NX) \ -FLAGDEFA( 81, EDX, AMD, 22, 1, MMXEXT, HOST, 0, MMXEXT) \ -FLAGDEF( 81, EDX, AMD, 23, 1, MMX, HOST, 0) \ -FLAGDEF( 81, EDX, AMD, 24, 1, FXSAVE, HOST, 0) \ -FLAGDEFA( 81, EDX, AMD, 25, 1, FFXSR, HOST, 0, FFXSR) \ -FLAGDEF( 81, EDX, AMD, 26, 1, PDPE1GB, MASK, 0) \ -FLAGDEFA( 81, EDX, COMMON, 27, 1, RDTSCP, HOST, 0, RDTSCP) \ -FLAGDEFA( 81, EDX, COMMON, 29, 1, LM, TEST, 1, LM) \ -FLAGDEFA( 81, EDX, AMD, 30, 1, 3DNOWPLUS, HOST, 0, 3DNOWPLUS) \ -FLAGDEFA( 81, EDX, AMD, 31, 1, 3DNOW, HOST, 0, 3DNOW) +FIELDDEF( 81, EAX, INTEL, 0, 32, UNKNOWN81EAX, ANY, IGNORE, 0, FALSE) \ +FIELDDEF( 81, EAX, AMD, 0, 4, STEPPING, ANY, IGNORE, 0, FALSE) \ +FIELDDEF( 81, EAX, AMD, 4, 4, MODEL, ANY, IGNORE, 0, FALSE) \ +FIELDDEF( 81, EAX, AMD, 8, 4, FAMILY, ANY, IGNORE, 0, FALSE) \ +FIELDDEF( 81, EAX, AMD, 12, 2, TYPE, ANY, IGNORE, 0, FALSE) \ +FIELDDEF( 81, EAX, AMD, 16, 4, EXTMODEL, ANY, IGNORE, 0, FALSE) \ +FIELDDEF( 81, EAX, AMD, 20, 8, EXTFAMILY, ANY, IGNORE, 0, FALSE) \ +FIELDDEF( 81, EBX, INTEL, 0, 32, UNKNOWN81EBX, ANY, IGNORE, 0, FALSE) \ +FIELDDEF( 81, EBX, AMD, 0, 16, BRAND_ID, ANY, IGNORE, 0, FALSE) \ +FIELDDEF( 81, EBX, AMD, 16, 16, UNDEF, ANY, IGNORE, 0, FALSE) \ +FLAGDEFA( 81, ECX, COMMON, 0, 1, LAHF, YES, HOST, 0, TRUE, LAHF64) \ +FLAGDEFA( 81, ECX, AMD, 1, 1, CMPLEGACY, NO, MASK, 0, FALSE, CMPLEGACY) \ +FLAGDEFA( 81, ECX, AMD, 2, 1, SVM, NO, MASK, 0, FALSE, SVM) \ +FLAGDEFA( 81, ECX, AMD, 3, 1, EXTAPICSPC, YES, HOST, 0, FALSE, EXTAPICSPC) \ +FLAGDEFA( 81, ECX, AMD, 4, 1, CR8AVAIL, NO, MASK, 0, FALSE, CR8AVAIL) \ +FLAGDEFA( 81, ECX, AMD, 5, 1, ABM, YES, HOST, 0, TRUE, ABM) \ +FLAGDEFA( 81, ECX, AMD, 6, 1, SSE4A, YES, HOST, 0, TRUE, SSE4A) \ +FLAGDEF( 81, ECX, AMD, 7, 1, MISALIGNED_SSE, YES, HOST, 0, TRUE) \ +FLAGDEFA( 81, ECX, AMD, 8, 1, 3DNPREFETCH, YES, HOST, 0, TRUE, 3DNPREFETCH) \ +FLAGDEF( 81, ECX, AMD, 9, 1, OSVW, NO, MASK, 0, FALSE) \ +FLAGDEF( 81, ECX, AMD, 10, 1, IBS, NO, MASK, 0, FALSE) \ +FLAGDEF( 81, ECX, AMD, 11, 1, SSE5, NO, RSVD, 0, TRUE) \ +FLAGDEF( 81, ECX, AMD, 12, 1, SKINIT, NO, MASK, 0, FALSE) \ +FLAGDEF( 81, ECX, AMD, 13, 1, WATCHDOG, NO, MASK, 0, FALSE) \ +FLAGDEF( 81, EDX, AMD, 0, 1, FPU, YES, HOST, 0, TRUE) \ +FLAGDEF( 81, EDX, AMD, 1, 1, VME, YES, HOST, 0, FALSE) \ +FLAGDEF( 81, EDX, AMD, 2, 1, DBGE, YES, HOST, 0, FALSE) \ +FLAGDEF( 81, EDX, AMD, 3, 1, PGSZE, YES, HOST, 0, FALSE) \ +FLAGDEF( 81, EDX, AMD, 4, 1, TSC, YES, HOST, 0, TRUE) \ +FLAGDEF( 81, EDX, AMD, 5, 1, MSR, YES, HOST, 0, FALSE) \ +FLAGDEF( 81, EDX, AMD, 6, 1, PAE, YES, HOST, 0, FALSE) \ +FLAGDEF( 81, EDX, AMD, 7, 1, MCK, YES, HOST, 0, FALSE) \ +FLAGDEF( 81, EDX, AMD, 8, 1, CPMX, YES, HOST, 0, TRUE) \ +FLAGDEF( 81, EDX, AMD, 9, 1, APIC, ANY, MASK, 1, FALSE) \ +FLAGDEFA( 81, EDX, COMMON, 11, 1, SYSC, ANY, IGNORE, 0, TRUE, SYSC) \ +FLAGDEF( 81, EDX, AMD, 12, 1, MTRR, YES, HOST, 0, FALSE) \ +FLAGDEF( 81, EDX, AMD, 13, 1, PGE, YES, HOST, 0, FALSE) \ +FLAGDEF( 81, EDX, AMD, 14, 1, MCA, YES, HOST, 0, FALSE) \ +FLAGDEF( 81, EDX, AMD, 15, 1, CMOV, YES, HOST, 0, TRUE) \ +FLAGDEF( 81, EDX, AMD, 16, 1, PAT, YES, HOST, 0, FALSE) \ +FLAGDEF( 81, EDX, AMD, 17, 1, 36PG, YES, HOST, 0, FALSE) \ +FLAGDEFA( 81, EDX, COMMON, 20, 1, NX, YES, HOST, 0, FALSE, NX) \ +FLAGDEFA( 81, EDX, AMD, 22, 1, MMXEXT, YES, HOST, 0, TRUE, MMXEXT) \ +FLAGDEF( 81, EDX, AMD, 23, 1, MMX, YES, HOST, 0, TRUE) \ +FLAGDEF( 81, EDX, AMD, 24, 1, FXSAVE, YES, HOST, 0, TRUE) \ +FLAGDEFA( 81, EDX, AMD, 25, 1, FFXSR, YES, HOST, 0, FALSE, FFXSR) \ +FLAGDEF( 81, EDX, AMD, 26, 1, PDPE1GB, NO, MASK, 0, FALSE) \ +FLAGDEFA( 81, EDX, COMMON, 27, 1, RDTSCP, YES, HOST, 0, TRUE, RDTSCP) \ +FLAGDEFA( 81, EDX, COMMON, 29, 1, LM, YES, TEST, 1, FALSE, LM) \ +FLAGDEFA( 81, EDX, AMD, 30, 1, 3DNOWPLUS, YES, HOST, 0, TRUE, 3DNOWPLUS) \ +FLAGDEFA( 81, EDX, AMD, 31, 1, 3DNOW, YES, HOST, 0, TRUE, 3DNOW) -/* LEVEL, REG, VENDOR, POS, SIZE, NAME, MASK TYPE, SET TO, [FUNC] */ +/* LEVEL, REG, VENDOR, POS, SIZE, NAME, MON SUPP, MASK TYPE, SET TO, CPL3, [FUNC] */ #define CPUID_FIELD_DATA_LEVEL_8x \ -FIELDDEF( 86, ECX, AMD, 0, 8, CACHE_LINE, IGNORE, 0) \ -FIELDDEF( 86, ECX, AMD, 8, 4, CACHE_LINE_PER_TAG, IGNORE, 0) \ -FIELDDEF( 86, ECX, AMD, 12, 4, CACHE_WAYS, IGNORE, 0) \ -FIELDDEF( 86, ECX, AMD, 16, 16, CACHE_SIZE, IGNORE, 0) \ -FLAGDEF( 87, EDX, AMD, 8, 1, TSC_INVARIANT, IGNORE, 0) \ -FIELDDEFA(88, EAX, COMMON, 0, 8, PHYSBITS, IGNORE, 0, PHYS_BITS) \ -FIELDDEFA(88, EAX, COMMON, 8, 8, VIRTBITS, IGNORE, 0, VIRT_BITS) \ -FIELDDEFA(88, ECX, AMD, 0, 8, CORE_COUNT, IGNORE, 0, AMD_CORE_COUNT) \ -FIELDDEF( 88, ECX, AMD, 12, 4, APICID_COREID_SIZE, IGNORE, 0) \ -FIELDDEFA(8A, EAX, AMD, 0, 8, SVM_REVISION, MASK, 0, SVM_REVISION) \ -FLAGDEF( 8A, EAX, AMD, 8, 1, SVM_HYPERVISOR, MASK, 0) \ -FIELDDEF( 8A, EAX, AMD, 9, 23, SVMEAX_RSVD, MASK, 0) \ -FIELDDEF( 8A, EBX, AMD, 0, 32, SVM_N_ASIDS, MASK, 0) \ -FIELDDEF( 8A, ECX, AMD, 0, 32, SVMECX_RSVD, MASK, 0) \ -FLAGDEF( 8A, EDX, AMD, 0, 1, SVM_NP, MASK, 0) \ -FLAGDEF( 8A, EDX, AMD, 1, 1, SVM_LBR, MASK, 0) \ -FLAGDEF( 8A, EDX, AMD, 2, 1, SVM_LOCK, MASK, 0) \ -FLAGDEF( 8A, EDX, AMD, 3, 1, SVM_NRIP, MASK, 0) \ -FIELDDEF( 8A, EDX, AMD, 4, 28, SVMEDX_RSVD, MASK, 0) +FIELDDEF( 86, ECX, AMD, 0, 8, L2CACHE_LINE, NA, IGNORE, 0, FALSE) \ +FIELDDEF( 86, ECX, AMD, 8, 4, L2CACHE_LINE_PER_TAG, NA, IGNORE, 0, FALSE) \ +FIELDDEF( 86, ECX, AMD, 12, 4, L2CACHE_WAYS, NA, IGNORE, 0, FALSE) \ +FIELDDEF( 86, ECX, AMD, 16, 16, L2CACHE_SIZE, NA, IGNORE, 0, FALSE) \ +FIELDDEF( 86, EDX, AMD, 0, 8, L3CACHE_LINE, NA, IGNORE, 0, FALSE) \ +FIELDDEF( 86, EDX, AMD, 8, 4, L3CACHE_LINE_PER_TAG,NA, IGNORE, 0, FALSE) \ +FIELDDEF( 86, EDX, AMD, 12, 4, L3CACHE_WAYS, NA, IGNORE, 0, FALSE) \ +FIELDDEF( 86, EDX, AMD, 18, 14, L3CACHE_SIZE, NA, IGNORE, 0, FALSE) \ +FLAGDEF( 87, EDX, AMD, 0, 1, TS, NA, IGNORE, 0, FALSE) \ +FLAGDEF( 87, EDX, AMD, 1, 1, FID, NA, IGNORE, 0, FALSE) \ +FLAGDEF( 87, EDX, AMD, 2, 1, VID, NA, IGNORE, 0, FALSE) \ +FLAGDEF( 87, EDX, AMD, 3, 1, TTP, NA, IGNORE, 0, FALSE) \ +FLAGDEF( 87, EDX, AMD, 4, 1, TM, NA, IGNORE, 0, FALSE) \ +FLAGDEF( 87, EDX, AMD, 5, 1, STC, NA, IGNORE, 0, FALSE) \ +FLAGDEF( 87, EDX, AMD, 6, 1, 100MHZSTEPS, NA, IGNORE, 0, FALSE) \ +FLAGDEF( 87, EDX, AMD, 7, 1, HWPSTATE, NA, IGNORE, 0, FALSE) \ +FLAGDEF( 87, EDX, AMD, 8, 1, TSC_INVARIANT, NA, IGNORE, 0, FALSE) \ +FIELDDEFA(88, EAX, COMMON, 0, 8, PHYSBITS, NA, IGNORE, 0, FALSE, PHYS_BITS) \ +FIELDDEFA(88, EAX, COMMON, 8, 8, VIRTBITS, NA, IGNORE, 0, FALSE, VIRT_BITS) \ +FIELDDEFA(88, ECX, AMD, 0, 8, CORE_COUNT, NA, IGNORE, 0, FALSE, AMD_CORE_COUNT) \ +FIELDDEFA(88, ECX, AMD, 12, 4, APICID_COREID_SIZE, NA, IGNORE, 0, FALSE, AMD_APICID_COREID_SIZE) \ +FIELDDEFA(8A, EAX, AMD, 0, 8, SVM_REVISION, NO, MASK, 0, FALSE, SVM_REVISION) \ +FLAGDEF( 8A, EAX, AMD, 8, 1, SVM_HYPERVISOR, NO, MASK, 0, FALSE) \ +FIELDDEF( 8A, EAX, AMD, 9, 23, SVMEAX_RSVD, NO, MASK, 0, FALSE) \ +FIELDDEF( 8A, EBX, AMD, 0, 32, SVM_N_ASIDS, NO, MASK, 0, FALSE) \ +FIELDDEF( 8A, ECX, AMD, 0, 32, SVMECX_RSVD, NO, MASK, 0, FALSE) \ +FLAGDEFA( 8A, EDX, AMD, 0, 1, SVM_NP, NO, MASK, 0, FALSE, NPT) \ +FLAGDEF( 8A, EDX, AMD, 1, 1, SVM_LBR, NO, MASK, 0, FALSE) \ +FLAGDEF( 8A, EDX, AMD, 2, 1, SVM_LOCK, NO, MASK, 0, FALSE) \ +FLAGDEF( 8A, EDX, AMD, 3, 1, SVM_NRIP, NO, MASK, 0, FALSE) \ +FIELDDEF( 8A, EDX, AMD, 4, 28, SVMEDX_RSVD, NO, MASK, 0, FALSE) #define CPUID_FIELD_DATA \ CPUID_FIELD_DATA_LEVEL_0 \ CPUID_FIELD_DATA_LEVEL_1 \ CPUID_FIELD_DATA_LEVEL_4 \ + CPUID_FIELD_DATA_LEVEL_5 \ + CPUID_FIELD_DATA_LEVEL_6 \ CPUID_FIELD_DATA_LEVEL_A \ CPUID_FIELD_DATA_LEVEL_80 \ CPUID_FIELD_DATA_LEVEL_81 \ @@ -402,15 +481,20 @@ */ #define VMW_BIT_MASK(shift) (((1 << (shift - 1)) << 1) - 1) -#define FIELDDEF(lvl, reg, vend, bitpos, size, name, m, v) \ +#define FIELDDEF(lvl, reg, vend, bitpos, size, name, s, m, v, c3) \ CPUID_##vend##_ID##lvl##reg##_##name##_SHIFT = bitpos, \ CPUID_##vend##_ID##lvl##reg##_##name##_MASK = \ VMW_BIT_MASK(size) << bitpos, \ CPUID_FEATURE_##vend##_ID##lvl##reg##_##name = \ CPUID_##vend##_ID##lvl##reg##_##name##_MASK, -#define FIELDDEFA(lvl, reg, vend, bitpos, size, name, m, v, f) \ - FIELDDEF(lvl, reg, vend, bitpos, size, name, m, v) +/* Before simplifying this take a look at bug 293638... */ +#define FIELDDEFA(lvl, reg, vend, bitpos, size, name, s, m, v, c3, f) \ + CPUID_##vend##_ID##lvl##reg##_##name##_SHIFT = bitpos, \ + CPUID_##vend##_ID##lvl##reg##_##name##_MASK = \ + VMW_BIT_MASK(size) << bitpos, \ + CPUID_FEATURE_##vend##_ID##lvl##reg##_##name = \ + CPUID_##vend##_ID##lvl##reg##_##name##_MASK, #define FLAGDEFA FIELDDEFA #define FLAGDEF FIELDDEF @@ -508,6 +592,13 @@ FIELD_FUNC(AMD_APICID_COREID_SIZE, CPUID_AMD_ID88ECX_APICID_COREID_SIZE) FIELD_FUNC(AMD_EXTAPICSPC, CPUID_AMD_ID81ECX_EXTAPICSPC) FIELD_FUNC(NUM_PMCS, CPUID_INTEL_IDAEAX_NUM_PMCS) +FIELD_FUNC(MWAIT_MIN_SIZE, CPUID_COMMON_ID5EAX_MWAIT_MIN_SIZE) +FIELD_FUNC(MWAIT_MAX_SIZE, CPUID_COMMON_ID5EBX_MWAIT_MAX_SIZE) +FIELD_FUNC(MWAIT_C0_SUBSTATE, CPUID_INTEL_ID5EDX_MWAIT_C0_SUBSTATE) +FIELD_FUNC(MWAIT_C1_SUBSTATE, CPUID_INTEL_ID5EDX_MWAIT_C1_SUBSTATE) +FIELD_FUNC(MWAIT_C2_SUBSTATE, CPUID_INTEL_ID5EDX_MWAIT_C2_SUBSTATE) +FIELD_FUNC(MWAIT_C3_SUBSTATE, CPUID_INTEL_ID5EDX_MWAIT_C3_SUBSTATE) +FIELD_FUNC(MWAIT_C4_SUBSTATE, CPUID_INTEL_ID5EDX_MWAIT_C4_SUBSTATE) #undef FIELD_FUNC @@ -534,15 +625,58 @@ /* Intel model information */ #define CPUID_MODEL_PPRO 1 -#define CPUID_MODEL_PII_3 3 -#define CPUID_MODEL_PII_5 5 -#define CPUID_MODEL_CELERON_6 6 -#define CPUID_MODEL_PIII_7 7 -#define CPUID_MODEL_PIII_8 8 -#define CPUID_MODEL_PM 9 -#define CPUID_MODEL_PIII_A 10 -#define CPUID_MODEL_CORE 14 -#define CPUID_MODEL_CORE2 15 +#define CPUID_MODEL_PII_03 3 +#define CPUID_MODEL_PII_05 5 +#define CPUID_MODEL_CELERON_06 6 +#define CPUID_MODEL_PM_09 9 +#define CPUID_MODEL_PM_0D 13 +#define CPUID_MODEL_PM_0E 14 // Yonah / Sossaman +#define CPUID_MODEL_CORE_0F 15 // Conroe / Merom +#define CPUID_MODEL_CORE_17 0x17 // Penryn +#define CPUID_MODEL_NEHALEM_1A 0x1a // Nehalem / Gainestown +#define CPUID_MODEL_ATOM_1C 0x1c // Silverthorne / Diamondville +#define CPUID_MODEL_CORE_1D 0x1d // Dunnington + +#define CPUID_MODEL_PIII_07 7 +#define CPUID_MODEL_PIII_08 8 +#define CPUID_MODEL_PIII_0A 10 + +/* + *---------------------------------------------------------------------- + * + * CPUID_IsVendor{AMD,Intel} -- + * + * Determines if the vendor string in cpuid id0 is from {AMD,Intel}. + * + * Results: + * True iff vendor string is CPUID_{AMD,INTEL}_VENDOR_STRING + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ +static INLINE Bool +CPUID_IsRawVendor(CPUIDRegs *id0, const char* vendor) +{ + // hard to get strcmp() in some environments, so do it in the raw + return (id0->ebx == *(const uint32 *) (vendor + 0) && + id0->ecx == *(const uint32 *) (vendor + 4) && + id0->edx == *(const uint32 *) (vendor + 8)); +} + +static INLINE Bool +CPUID_IsVendorAMD(CPUIDRegs *id0) +{ + return CPUID_IsRawVendor(id0, CPUID_AMD_VENDOR_STRING); +} + +static INLINE Bool +CPUID_IsVendorIntel(CPUIDRegs *id0) +{ + return CPUID_IsRawVendor(id0, CPUID_INTEL_VENDOR_STRING); +} + static INLINE uint32 CPUID_EFFECTIVE_FAMILY(uint32 v) /* %eax from CPUID with %eax=1. */ @@ -590,15 +724,44 @@ return CPUID_EFFECTIVE_FAMILY(_eax) == CPUID_FAMILY_P4; } -/* Intel Core processors are Yonah, Merom, Conroe, Woodcrest, - * Clovertown, Penryn, ... +/* + * Intel Pentium M processors are Yonah/Sossaman or an older P-M */ static INLINE Bool -CPUID_FAMILY_IS_CORE(uint32 v) // IN: %eax from CPUID with %eax=1. +CPUID_UARCH_IS_PENTIUM_M(uint32 v) // IN: %eax from CPUID with %eax=1. { /* Assumes the CPU manufacturer is Intel. */ return CPUID_FAMILY_IS_P6(v) && - CPUID_EFFECTIVE_MODEL(v) >= CPUID_MODEL_CORE; + (CPUID_EFFECTIVE_MODEL(v) == CPUID_MODEL_PM_09 || + CPUID_EFFECTIVE_MODEL(v) == CPUID_MODEL_PM_0D || + CPUID_EFFECTIVE_MODEL(v) == CPUID_MODEL_PM_0E); +} + +/* + * Intel Core processors are Merom, Conroe, Woodcrest, Clovertown, + * Penryn, Dunnington, Kentsfield, Yorktown, Harpertown, ........ + */ +static INLINE Bool +CPUID_UARCH_IS_CORE(uint32 v) // IN: %eax from CPUID with %eax=1. +{ + uint32 model = CPUID_EFFECTIVE_MODEL(v); + /* Assumes the CPU manufacturer is Intel. */ + return CPUID_FAMILY_IS_P6(v) && + model >= CPUID_MODEL_CORE_0F && + (model < CPUID_MODEL_NEHALEM_1A || + model == CPUID_MODEL_CORE_1D); +} + + +/* + * Intel Nehalem processors are: Nehalem, Gainestown. + */ +static INLINE Bool +CPUID_UARCH_IS_NEHALEM(uint32 v) // IN: %eax from CPUID with %eax=1. +{ + /* Assumes the CPU manufacturer is Intel. */ + return CPUID_FAMILY_IS_P6(v) && + CPUID_EFFECTIVE_MODEL(v) == CPUID_MODEL_NEHALEM_1A; } @@ -680,26 +843,94 @@ */ return !((isIntel && ((CPUID_FAMILY_IS_P6(v) && - CPUID_EFFECTIVE_MODEL(v) < CPUID_MODEL_CORE) || + CPUID_EFFECTIVE_MODEL(v) < CPUID_MODEL_PM_0E) || (CPUID_FAMILY_IS_PENTIUM4(v) && CPUID_EFFECTIVE_MODEL(v) < 3))) || (!isIntel && CPUID_FAMILY(v) < CPUID_FAMILY_K8)); } + /* * For certain AMD processors, an lfence instruction is necessary at various * places to ensure ordering. */ + +static INLINE Bool +CPUID_VendorRequiresFence(CpuidVendors vendor) +{ + return vendor == CPUID_VENDOR_AMD; +} + +static INLINE Bool +CPUID_VersionRequiresFence(uint32 version) +{ + return CPUID_EFFECTIVE_FAMILY(version) == CPUID_FAMILY_K8 && + CPUID_EFFECTIVE_MODEL(version) < 0x40; +} + +static INLINE Bool +CPUID_ID0RequiresFence(CPUIDRegs *id0) +{ + if (id0->eax == 0) { + return FALSE; + } + return CPUID_IsVendorAMD(id0); +} + +static INLINE Bool +CPUID_ID1RequiresFence(CPUIDRegs *id1) +{ + return CPUID_VersionRequiresFence(id1->eax); +} + static INLINE Bool CPUID_RequiresFence(CpuidVendors vendor, // IN uint32 version) // IN: %eax from CPUID with %eax=1. { - return ((vendor == CPUID_VENDOR_AMD) && - (CPUID_EFFECTIVE_FAMILY(version) == CPUID_FAMILY_K8) && - (CPUID_EFFECTIVE_MODEL(version) < 0x40)); + return CPUID_VendorRequiresFence(vendor) && + CPUID_VersionRequiresFence(version); +} + + +/* + *---------------------------------------------------------------------- + * + * CPUID_CountsCPUIDAsBranch -- + * + * Returns TRUE iff the cpuid given counts CPUID as a branch + * (i.e. is a pre-Merom E CPU). + * + *---------------------------------------------------------------------- + */ + +static INLINE Bool +CPUID_CountsCPUIDAsBranch(uint32 v) /* %eax from CPUID with %eax=1 */ +{ + /* + * CPUID no longer a branch starting with Merom E. Bug 148411. + * Penryn (Extended Model: 1) also has this fixed. + * + * Merom E is: CPUID.1.eax & 0xfff = 0x6f9 + */ + return !(CPUID_FAMILY_IS_P6(v) && + (CPUID_EFFECTIVE_MODEL(v) > CPUID_MODEL_CORE_0F || + (CPUID_EFFECTIVE_MODEL(v) == CPUID_MODEL_CORE_0F && + CPUID_STEPPING(v) >= 9))); } +/* + * On Merom and later Intel chips, not present PDPTEs with reserved bits + * set do not fault with a #GP. See PR# 109120. + */ +static INLINE Bool +CPUID_FaultOnNPReservedPDPTE(uint32 v) // IN: %eax from CPUID with %eax=1. +{ + return !(CPUID_FAMILY_IS_P6(v) && + (CPUID_EFFECTIVE_MODEL(v) >= CPUID_MODEL_CORE_0F)); +} + + /* * The following low-level functions compute the number of * cores per cpu. They should be used cautiously because @@ -722,4 +953,15 @@ return 1 + CPUID_AMD_CORE_COUNT(v); } +/* + * Hypervisor CPUID space is 0x400000XX. + */ +static INLINE Bool +CPUID_IsHypervisorLevel(uint32 level, uint32 *offset) +{ + *offset = level & 0xff; + return (level & 0xffffff00) == 0x40000000; +} + + #endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmmemctl/balloon_def.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmmemctl/balloon_def.h --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmmemctl/balloon_def.h 2008-01-28 08:02:48.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmmemctl/balloon_def.h 2008-10-13 08:01:45.000000000 +0100 @@ -71,20 +71,4 @@ #define BALLOON_ERROR_RESET (7) #define BALLOON_ERROR_BUSY (8) -/* - * types - */ - -typedef struct { - // platform -> VMM - uint32 target; // target balloon size (in pages) - - // platform <- VMM - uint32 size; // current balloon size (in pages) - uint32 nOps; // stats: operation count - uint32 nReset; // stats: reset count - uint32 guestType; // guest OS identifier - uint32 maxSize; // predicted max balloon size (in pages) -} Balloon_BalloonInfo; - #endif /* _BALLOON_DEF_H */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmmemctl/vm_assert.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmmemctl/vm_assert.h --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmmemctl/vm_assert.h 2008-01-28 08:02:48.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmmemctl/vm_assert.h 2008-10-13 08:01:45.000000000 +0100 @@ -98,8 +98,6 @@ * ASSERT() is special cased because of interaction with Windows DDK. */ -#define IMPLIES(a,b) (!(a) || (b)) - #if defined VMX86_DEBUG || defined ASSERT_ALWAYS_AVAILABLE #undef ASSERT #define ASSERT(cond) \ @@ -243,12 +241,21 @@ /* - * Compile-time assertions + * 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). */ #define ASSERT_ON_COMPILE(e) \ do { \ - typedef char AssertOnCompileType[(e) ? 1 : -1]; \ + enum { AssertOnCompileMisused = ((e) ? 1 : -1) }; \ + typedef char AssertOnCompileFailed[AssertOnCompileMisused]; \ } while (0) diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmmemctl/vmballoon.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmmemctl/vmballoon.c --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmmemctl/vmballoon.c 2008-01-28 08:02:48.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmmemctl/vmballoon.c 2008-10-13 08:01:45.000000000 +0100 @@ -98,6 +98,10 @@ */ #define BALLOON_PAGE_ALLOC_FAILURE (1000) +// Maximum number of page allocations without yielding processor +#define BALLOON_ALLOC_YIELD_THRESHOLD (1024) + + /* * Types */ @@ -1004,7 +1008,7 @@ static int BalloonInflate(Balloon *b, uint32 target) { - int status; + int status, allocations = 0; uint32 i, nAllocNoSleep, nAllocCanSleep; /* @@ -1047,6 +1051,11 @@ b->slowPageAllocationCycles = SLOW_PAGE_ALLOCATION_CYCLES; break; } + + if (++allocations > BALLOON_ALLOC_YIELD_THRESHOLD) { + os_yield(); + allocations = 0; + } } /* @@ -1102,6 +1111,11 @@ Balloon_ErrorPagesFree(b); return(status); } + + if (++allocations > BALLOON_ALLOC_YIELD_THRESHOLD) { + os_yield(); + allocations = 0; + } } /* diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmmemctl/vm_basic_defs.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmmemctl/vm_basic_defs.h --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmmemctl/vm_basic_defs.h 2008-01-28 08:02:48.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmmemctl/vm_basic_defs.h 2008-10-13 08:01:45.000000000 +0100 @@ -39,6 +39,10 @@ #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 <stddef.h> /* * We re-define offsetof macro from stddef, make @@ -52,7 +56,8 @@ * Simple macros */ -#if defined __APPLE__ && !defined KERNEL +#if (defined __APPLE__ || defined __FreeBSD__) && \ + (!defined KERNEL && !defined _KERNEL && !defined VMKERNEL && !defined __KERNEL__) # include <stddef.h> #else // XXX the __cplusplus one matches that of VC++, to prevent redefinition warning @@ -108,6 +113,7 @@ #define DWORD_ALIGN(x) ((((x)+3) >> 2) << 2) #define QWORD_ALIGN(x) ((((x)+4) >> 3) << 3) +#define IMPLIES(a,b) (!(a) || (b)) /* * Not everybody (e.g., the monitor) has NULL @@ -313,7 +319,22 @@ #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 // { @@ -324,7 +345,7 @@ * guarantee. Bummer. --Jeremy. */ -#if defined(N_PLAT_NLM) || defined(__FreeBSD__) +#if defined(N_PLAT_NLM) /* We do not have YIELD() as we do not need it yet... */ #elif defined(_WIN32) # define YIELD() Sleep(0) @@ -450,12 +471,23 @@ */ #undef DEBUG_ONLY +#undef SL_DEBUG_ONLY +#undef VMX86_SL_DEBUG #ifdef VMX86_DEBUG -#define vmx86_debug 1 -#define DEBUG_ONLY(x) x +#define vmx86_debug 1 +#define DEBUG_ONLY(x) x +/* + * Be very, very, very careful with SL_DEBUG. Pls ask ganesh or min before + * using it. + */ +#define VMX86_SL_DEBUG +#define vmx86_sl_debug 1 +#define SL_DEBUG_ONLY(x) x #else -#define vmx86_debug 0 +#define vmx86_debug 0 #define DEBUG_ONLY(x) +#define vmx86_sl_debug 0 +#define SL_DEBUG_ONLY(x) #endif #ifdef VMX86_STATS @@ -543,18 +575,32 @@ #endif #endif -#ifdef VMX86_VPROBES -#define vmx86_vprobes 1 -#define VPROBES_ONLY(x) x +#ifdef _WIN32 +#define VMW_INVALID_HANDLE INVALID_HANDLE_VALUE +#else +#define VMW_INVALID_HANDLE (-1) +#endif + +#ifdef _WIN32 +#define fsync(fd) _commit(fd) +#define fileno(f) _fileno(f) #else -#define vmx86_vprobes 0 -#define VPROBES_ONLY(x) #endif +/* + * Debug output macros for Windows drivers (the Eng variant is for + * display/printer drivers only. + */ #ifdef _WIN32 -#define VMW_INVALID_HANDLE INVALID_HANDLE_VALUE +#ifndef USES_OLD_WINDDK +#if defined(VMX86_DEBUG) || defined(ASSERT_ALWAYS_AVAILABLE) +#define WinDrvPrint(arg, ...) DbgPrint(arg, __VA_ARGS__) +#define WinDrvEngPrint(arg, ...) EngDbgPrint(arg, __VA_ARGS__) #else -#define VMW_INVALID_HANDLE -1 +#define WinDrvPrint(arg, ...) +#define WinDrvEngPrint(arg, ...) #endif +#endif +#endif // _WIN32 #endif // ifndef _VM_BASIC_DEFS_H_ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmmemctl/vm_basic_types.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmmemctl/vm_basic_types.h --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmmemctl/vm_basic_types.h 2008-01-28 08:02:48.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmmemctl/vm_basic_types.h 2008-10-13 08:01:45.000000000 +0100 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998-2007 VMware, Inc. All rights reserved. + * Copyright (C) 1998-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 General Public License as published by the @@ -92,10 +92,6 @@ #pragma warning (disable :4305) // truncation from 'const int' to 'short' #pragma warning (disable :4244) // conversion from 'unsigned short' to 'unsigned char' #pragma warning (disable :4267) // truncation of 'size_t' -#if !defined VMX86_DEVEL // XXX until we clean up all the code -- edward -#pragma warning (disable :4133) // incompatible types - from 'struct VM *' to 'int *' -#pragma warning (disable :4047) // differs in levels of indirection -#endif #pragma warning (disable :4146) // unary minus operator applied to unsigned type, result still unsigned #pragma warning (disable :4142) // benign redefinition of type @@ -154,12 +150,16 @@ #include <stdlib.h> #endif +#ifdef __FreeBSD__ +#include <sys/param.h> /* For __FreeBSD_version */ +#endif + #if !defined(USING_AUTOCONF) # if defined(__FreeBSD__) || defined(sun) # ifdef KLD_MODULE # include <sys/types.h> # else -# if (BSD_VERSION >= 50) +# if !defined(VMKERNEL) && (__FreeBSD_version >= 500043) # include <inttypes.h> # include <sys/types.h> # else @@ -254,7 +254,12 @@ || (defined(_POSIX2_VERSION) && _POSIX2_VERSION >= 200112L) /* BSD/Darwin, Linux */ #define FMTSZ "z" - #define FMTPD "t" + + #if defined(VM_X86_64) || defined(__APPLE__) + #define FMTPD "l" + #else + #define FMTPD "" + #endif #else /* Systems with a pre-C99 libc */ #define FMTSZ "Z" @@ -338,8 +343,8 @@ * Type big enough to hold an integer between 0..100 */ typedef uint8 Percent; -#define asPercent(v) ((Percent)(v)) -#define CHOOSE_PERCENT asPercent(-1) +#define AsPercent(v) ((Percent)(v)) +#define CHOOSE_PERCENT AsPercent(101) typedef uintptr_t VA; @@ -371,6 +376,9 @@ typedef User_CartelID User_CartelGroupID; #define INVALID_CARTELGROUP_ID INVALID_CARTEL_ID +typedef uint32 Worldlet_ID; +#define INVALID_WORLDLET_ID ((Worldlet_ID)0) + /* world page number */ typedef uint32 WPN; @@ -381,6 +389,12 @@ #endif /* + * This type should be used for variables that contain sector + * position/quantity. + */ +typedef uint64 SectorType; + +/* * Linear address */ @@ -434,6 +448,7 @@ typedef VA32 UserVA32; typedef VA64 UserVA64; typedef UserVA32 UserVAConst; /* Userspace ptr to data that we may only read. */ +typedef UserVA64 UserVA64Const; /* Used by 64-bit syscalls until conversion is finished. */ #ifdef VMKERNEL typedef UserVA32 UserVA; #else @@ -447,10 +462,10 @@ * for any region other than buserror. */ #define PHYSMEM_MAX_PPN ((PPN)0xffffffff) -#define MAX_PPN ((PPN)0x0fffffff) /* Maximal observable PPN value. */ -#define INVALID_PPN ((PPN)-1) +#define MAX_PPN ((PPN)0x1fffffff) /* Maximal observable PPN value. */ +#define INVALID_PPN ((PPN)0xffffffff) -#define INVALID_BPN ((BPN) 0x3fffffff) /* BPNs don't use the high two bits. */ +#define INVALID_BPN ((BPN) 0x1fffffff) #define INVALID_MPN ((MPN)-1) #define MEMREF_MPN ((MPN)-2) @@ -480,8 +495,9 @@ # define FMTVPN "" #endif - +#ifndef EXTERN #define EXTERN extern +#endif #define CONST const @@ -631,6 +647,12 @@ # define PRINTF_DECL(fmtPos, varPos) #endif +#if defined(__GNUC__) +# define SCANF_DECL(fmtPos, varPos) __attribute__((__format__(__scanf__, fmtPos, varPos))) +#else +# define SCANF_DECL(fmtPos, varPos) +#endif + /* * UNUSED_PARAM should surround the parameter name and type declaration, * e.g. "int MyFunction(int var1, UNUSED_PARAM(int var2))" @@ -677,6 +699,52 @@ #endif /* + *********************************************************************** + * STRUCT_OFFSET_CHECK -- */ /** + * + * \brief Check if the actual offsef of a member in a structure + * is what is expected + * + * + * \param[in] STRUCT Structure the member is a part of. + * \param[in] MEMBER Member to check the offset of. + * \param[in] OFFSET Expected offset of MEMBER in STRUCTURE. + * \param[in] DEBUG_EXTRA Additional bytes to be added to OFFSET to + * compensate for extra info in debug builds. + * + *********************************************************************** + */ +#ifdef VMX86_DEBUG +#define STRUCT_OFFSET_CHECK(STRUCT, MEMBER, OFFSET, DEBUG_EXTRA) \ + ASSERT_ON_COMPILE(vmk_offsetof(STRUCT, MEMBER) == (OFFSET + DEBUG_EXTRA)) +#else +#define STRUCT_OFFSET_CHECK(STRUCT, MEMBER, OFFSET, DEBUG_EXTRA) \ + ASSERT_ON_COMPILE(vmk_offsetof(STRUCT, MEMBER) == OFFSET) +#endif + +/* + *********************************************************************** + * STRUCT_SIZE_CHECK -- */ /** + * + * \brief Check if the actual size of a structure is what is expected + * + * + * \param[in] STRUCT Structure whose size is to be checked. + * \param[in] SIZE Expected size of STRUCT. + * \param[in] DEBUG_EXTRA Additional bytes to be added to SIZE to + * compensate for extra info in debug builds. + * + *********************************************************************** + */ +#ifdef VMX86_DEBUG +#define STRUCT_SIZE_CHECK(STRUCT, SIZE, DEBUG_EXTRA) \ + ASSERT_ON_COMPILE(sizeof(STRUCT) == (SIZE + DEBUG_EXTRA)) +#else +#define STRUCT_SIZE_CHECK(STRUCT, SIZE, DEBUG_EXTRA) \ + ASSERT_ON_COMPILE(sizeof(STRUCT) == SIZE) +#endif + +/* * __func__ is a stringified function name that is part of the C99 standard. The block * below defines __func__ on older systems where the compiler does not support that * macro. @@ -831,4 +899,14 @@ typedef int PollDevHandle; #endif +/* + * Define the utf16_t type. + */ + +#if defined(_WIN32) && defined(_NATIVE_WCHAR_T_DEFINED) +typedef wchar_t utf16_t; +#else +typedef uint16 utf16_t; +#endif + #endif /* _VM_BASIC_TYPES_H_ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmxnet/if_vxn.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmxnet/if_vxn.c --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmxnet/if_vxn.c 2008-01-28 08:02:49.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmxnet/if_vxn.c 2008-10-13 08:01:46.000000000 +0100 @@ -35,6 +35,14 @@ # include <sys/mutex.h> #endif +/* + * FreeBSD 7.0-RELEASE changed the bus_setup_intr API to include a device_filter_t + * parameter. + */ +#if __FreeBSD_version >= 700031 +# define VXN_NEWNEWBUS +#endif + #if __FreeBSD_version < 600000 #include <machine/bus_pio.h> #else @@ -91,7 +99,11 @@ static int vxn_detach (device_t); typedef struct vxn_softc { - struct arpcom arpcom; +#ifdef VXN_NEEDARPCOM + struct arpcom arpcom; +#else + struct ifnet *vxn_ifp; +#endif #ifdef VXN_MPSAFE struct mtx vxn_mtx; #endif @@ -153,6 +165,7 @@ static devclass_t vxn_devclass; +MODULE_DEPEND(if_vxn, pci, 1, 1, 1); DRIVER_MODULE(if_vxn, pci, vxn_driver, vxn_devclass, 0, 0); /* @@ -227,6 +240,7 @@ u_int32_t r; u_int32_t vLow, vHigh; int driverDataSize; + u_char mac[6]; s = splimp(); @@ -297,7 +311,10 @@ error = ENXIO; goto fail; } -#ifdef VXN_MPSAFE +#if defined(VXN_NEWNEWBUS) + error = bus_setup_intr(dev, sc->vxn_irq, INTR_TYPE_NET | INTR_MPSAFE, + NULL, vxn_intr, sc, &sc->vxn_intrhand); +#elif defined(VXN_MPSAFE) error = bus_setup_intr(dev, sc->vxn_irq, INTR_TYPE_NET | INTR_MPSAFE, vxn_intr, sc, &sc->vxn_intrhand); #else @@ -375,14 +392,21 @@ * read the MAC address from the device */ for (i = 0; i < 6; i++) { - ((char *)(&VXN_SC2ENADDR(sc)))[i] = - bus_space_read_1(sc->vxn_iobtag, sc->vxn_iobhandle, VMXNET_MAC_ADDR + i); + mac[i] = bus_space_read_1(sc->vxn_iobtag, sc->vxn_iobhandle, VMXNET_MAC_ADDR + i); } +#ifdef VXN_NEEDARPCOM + /* + * FreeBSD 4.x requires that we manually record the device's MAC address to + * the attached arpcom structure prior to calling ether_ifattach(). + */ + bcopy(mac, sc->arpcom.ac_enaddr, 6); +#endif + /* * success */ - VXN_ETHER_IFATTACH(ifp, VXN_SC2ENADDR(sc)); + VXN_ETHER_IFATTACH(ifp, mac); printf("vxn%d: attached [num_rx_bufs=(%d*%d) num_tx_bufs=(%d*%d) driverDataSize=%d]\n", unit, sc->vxn_num_rx_bufs, (int)sizeof(Vmxnet2_RxRingEntry), @@ -839,10 +863,9 @@ static void vxn_start(struct ifnet *ifp) { - vxn_softc_t *sc = ifp->if_softc; - VXN_LOCK(sc); + VXN_LOCK((vxn_softc_t *)ifp->if_softc); vxn_startl(ifp); - VXN_UNLOCK(sc); + VXN_UNLOCK((vxn_softc_t *)ifp->if_softc); } /* @@ -909,6 +932,7 @@ VMXNET_INC(dd->txDriverNext, dd->txRingLength); dd->txNumDeferred++; sc->vxn_tx_pending++; + ifp->if_opackets++; } /* diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmxnet/net_compat.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmxnet/net_compat.h --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmxnet/net_compat.h 2008-01-28 08:02:49.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmxnet/net_compat.h 2008-10-13 08:01:46.000000000 +0100 @@ -66,7 +66,7 @@ #define VXN_IF_UNIT(ifp) ((ifp)->if_unit) #define VXN_IF_INITNAME(ifp, name, unit) do { \ - (ifp)->if_name = (name); \ + (ifp)->if_name = (char *)(name); \ (ifp)->if_unit = (unit); \ } while (0) #else /* >= 501113 */ @@ -96,25 +96,23 @@ * returned from if_alloc() and if_alloc() allocates * space for if_l2com. * + * Accessing the link layer address via arpcom's ac_enaddr was deprecated as + * of sys/net/if_var.h:1.98, and drivers are to instead get/set said address + * through the embedded ifnet structure. So with FreeBSD 6 and above, we + * instead define vxn_softc as follows and rely on FreeBSD's macro glue for + * easy access to the LL-address. + * * struct vxn_softc { - * struct arpcom { - * struct ifnet { - * void *if_softc; - * void *if_l2com; - * ... - * } *ac_ifp; - * u_char _ac_enaddr[6]; - * ... - * } <arpcom>; + * struct ifnet *vxn_ifp; * ... * }; */ -#if __FreeBSD_version < 600000 +#if __FreeBSD_version < 600000 /* Pre-FreeBSD 6.0-RELEASE */ + #define VXN_NEEDARPCOM #define VXN_IF_ALLOC(softc) (&(softc)->arpcom.ac_if) #define VXN_IF_FREE(softc) #define VXN_SC2IFP(softc) (&(softc)->arpcom.ac_if) - #define VXN_SC2ENADDR(softc) ((softc)->arpcom.ac_enaddr) #define VXN_PCIR_MAPS PCIR_MAPS @@ -127,12 +125,11 @@ ((ifp)->if_flags &= ~(flags)) #define VXN_GET_IF_DRV_FLAGS(ifp) \ ((ifp)->if_flags) -#else - #define VXN_IF_ALLOC(softc) (((softc)->arpcom.ac_ifp) = if_alloc(IFT_ETHER)); - #define VXN_IF_FREE(softc) if_free((softc)->arpcom.ac_ifp) +#else /* FreeBSD 6.x+ */ + #define VXN_IF_ALLOC(softc) ((softc)->vxn_ifp = if_alloc(IFT_ETHER)) + #define VXN_IF_FREE(softc) if_free((softc)->vxn_ifp) - #define VXN_SC2IFP(softc) ((softc)->arpcom.ac_ifp) - #define VXN_SC2ENADDR(softc) ((softc)->arpcom._ac_enaddr) + #define VXN_SC2IFP(softc) ((softc)->vxn_ifp) #define VXN_PCIR_MAPS PCIR_BARS diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmxnet/net.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmxnet/net.h --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmxnet/net.h 2008-01-28 08:02:49.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmxnet/net.h 2008-10-13 08:01:46.000000000 +0100 @@ -49,27 +49,88 @@ #define ETHER_MAX_QUEUED_PACKET 1600 -/* - * State's that a NIC can be in currently we only use this +/* + * State's that a NIC can be in currently we only use this * in VLance but if we implement/emulate new adapters that - * we also want to be able to morph a new corresponding + * we also want to be able to morph a new corresponding * state should be added. */ #define LANCE_CHIP 0x2934 #define VMXNET_CHIP 0x4392 -/* +/* * Size of reserved IO space needed by the LANCE adapter and * the VMXNET adapter. If you add more ports to Vmxnet than * there is reserved space you must bump VMXNET_CHIP_IO_RESV_SIZE. * The sizes must be powers of 2. */ -#define LANCE_CHIP_IO_RESV_SIZE 0x20 +#define LANCE_CHIP_IO_RESV_SIZE 0x20 #define VMXNET_CHIP_IO_RESV_SIZE 0x40 #define MORPH_PORT_SIZE 4 -#endif // VMWARE_DEVICES_NET_H +#ifdef USERLEVEL + +/* + *---------------------------------------------------------------------------- + * + * Net_AddAddrToLADRF -- + * + * Given a MAC address, sets the corresponding bit in the LANCE style + * Logical Address Filter 'ladrf'. + * The caller should have initialized the ladrf to all 0's, as this + * function only ORs on a bit in the array. + * 'addr' is presumed to be ETHER_ADDR_LEN in size; + * 'ladrf' is presumed to point to a 64-bit vector. + * + * Derived from a long history of derivations, originally inspired by + * sample code from the AMD "Network Products: Ethernet Controllers 1998 + * Data Book, Book 2", pages 1-53..1-55. + * + * Returns: + * None. + * + * Side effects: + * Updates 'ladrf'. + * + *---------------------------------------------------------------------------- + */ + +static INLINE void +Net_AddAddrToLadrf(const uint8 *addr, // IN: pointer to MAC address + uint8 *ladrf) // IN/OUT: pointer to ladrf +{ +#define CRC_POLYNOMIAL_BE 0x04c11db7UL /* Ethernet CRC, big endian */ + + uint16 hashcode; + int32 crc = 0xffffffff; /* init CRC for each address */ + int32 j; + int32 bit; + int32 byte; + + ASSERT(addr); + ASSERT(ladrf); + + for (byte = 0; byte < ETHER_ADDR_LEN; byte++) { /* for each address byte */ + /* process each address bit */ + for (bit = *addr++, j = 0; + j < 8; + j++, bit >>= 1) { + crc = (crc << 1) ^ ((((crc < 0 ? 1 : 0) ^ bit) & 0x01) ? + CRC_POLYNOMIAL_BE : 0); + } + } + hashcode = (crc & 1); /* hashcode is 6 LSb of CRC ... */ + for (j = 0; j < 5; j++) { /* ... in reverse order. */ + hashcode = (hashcode << 1) | ((crc>>=1) & 1); + } + + ladrf[hashcode >> 3] |= 1 << (hashcode & 0x07); +} + +#endif // USERLEVEL + +#endif // VMWARE_DEVICES_NET_H diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmxnet/vm_basic_types.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmxnet/vm_basic_types.h --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmxnet/vm_basic_types.h 2008-01-28 08:02:49.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmxnet/vm_basic_types.h 2008-10-13 08:01:46.000000000 +0100 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998-2007 VMware, Inc. All rights reserved. + * Copyright (C) 1998-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 General Public License as published by the @@ -92,10 +92,6 @@ #pragma warning (disable :4305) // truncation from 'const int' to 'short' #pragma warning (disable :4244) // conversion from 'unsigned short' to 'unsigned char' #pragma warning (disable :4267) // truncation of 'size_t' -#if !defined VMX86_DEVEL // XXX until we clean up all the code -- edward -#pragma warning (disable :4133) // incompatible types - from 'struct VM *' to 'int *' -#pragma warning (disable :4047) // differs in levels of indirection -#endif #pragma warning (disable :4146) // unary minus operator applied to unsigned type, result still unsigned #pragma warning (disable :4142) // benign redefinition of type @@ -154,12 +150,16 @@ #include <stdlib.h> #endif +#ifdef __FreeBSD__ +#include <sys/param.h> /* For __FreeBSD_version */ +#endif + #if !defined(USING_AUTOCONF) # if defined(__FreeBSD__) || defined(sun) # ifdef KLD_MODULE # include <sys/types.h> # else -# if (BSD_VERSION >= 50) +# if !defined(VMKERNEL) && (__FreeBSD_version >= 500043) # include <inttypes.h> # include <sys/types.h> # else @@ -254,7 +254,12 @@ || (defined(_POSIX2_VERSION) && _POSIX2_VERSION >= 200112L) /* BSD/Darwin, Linux */ #define FMTSZ "z" - #define FMTPD "t" + + #if defined(VM_X86_64) || defined(__APPLE__) + #define FMTPD "l" + #else + #define FMTPD "" + #endif #else /* Systems with a pre-C99 libc */ #define FMTSZ "Z" @@ -338,8 +343,8 @@ * Type big enough to hold an integer between 0..100 */ typedef uint8 Percent; -#define asPercent(v) ((Percent)(v)) -#define CHOOSE_PERCENT asPercent(-1) +#define AsPercent(v) ((Percent)(v)) +#define CHOOSE_PERCENT AsPercent(101) typedef uintptr_t VA; @@ -371,6 +376,9 @@ typedef User_CartelID User_CartelGroupID; #define INVALID_CARTELGROUP_ID INVALID_CARTEL_ID +typedef uint32 Worldlet_ID; +#define INVALID_WORLDLET_ID ((Worldlet_ID)0) + /* world page number */ typedef uint32 WPN; @@ -381,6 +389,12 @@ #endif /* + * This type should be used for variables that contain sector + * position/quantity. + */ +typedef uint64 SectorType; + +/* * Linear address */ @@ -434,6 +448,7 @@ typedef VA32 UserVA32; typedef VA64 UserVA64; typedef UserVA32 UserVAConst; /* Userspace ptr to data that we may only read. */ +typedef UserVA64 UserVA64Const; /* Used by 64-bit syscalls until conversion is finished. */ #ifdef VMKERNEL typedef UserVA32 UserVA; #else @@ -447,10 +462,10 @@ * for any region other than buserror. */ #define PHYSMEM_MAX_PPN ((PPN)0xffffffff) -#define MAX_PPN ((PPN)0x0fffffff) /* Maximal observable PPN value. */ -#define INVALID_PPN ((PPN)-1) +#define MAX_PPN ((PPN)0x1fffffff) /* Maximal observable PPN value. */ +#define INVALID_PPN ((PPN)0xffffffff) -#define INVALID_BPN ((BPN) 0x3fffffff) /* BPNs don't use the high two bits. */ +#define INVALID_BPN ((BPN) 0x1fffffff) #define INVALID_MPN ((MPN)-1) #define MEMREF_MPN ((MPN)-2) @@ -480,8 +495,9 @@ # define FMTVPN "" #endif - +#ifndef EXTERN #define EXTERN extern +#endif #define CONST const @@ -631,6 +647,12 @@ # define PRINTF_DECL(fmtPos, varPos) #endif +#if defined(__GNUC__) +# define SCANF_DECL(fmtPos, varPos) __attribute__((__format__(__scanf__, fmtPos, varPos))) +#else +# define SCANF_DECL(fmtPos, varPos) +#endif + /* * UNUSED_PARAM should surround the parameter name and type declaration, * e.g. "int MyFunction(int var1, UNUSED_PARAM(int var2))" @@ -677,6 +699,52 @@ #endif /* + *********************************************************************** + * STRUCT_OFFSET_CHECK -- */ /** + * + * \brief Check if the actual offsef of a member in a structure + * is what is expected + * + * + * \param[in] STRUCT Structure the member is a part of. + * \param[in] MEMBER Member to check the offset of. + * \param[in] OFFSET Expected offset of MEMBER in STRUCTURE. + * \param[in] DEBUG_EXTRA Additional bytes to be added to OFFSET to + * compensate for extra info in debug builds. + * + *********************************************************************** + */ +#ifdef VMX86_DEBUG +#define STRUCT_OFFSET_CHECK(STRUCT, MEMBER, OFFSET, DEBUG_EXTRA) \ + ASSERT_ON_COMPILE(vmk_offsetof(STRUCT, MEMBER) == (OFFSET + DEBUG_EXTRA)) +#else +#define STRUCT_OFFSET_CHECK(STRUCT, MEMBER, OFFSET, DEBUG_EXTRA) \ + ASSERT_ON_COMPILE(vmk_offsetof(STRUCT, MEMBER) == OFFSET) +#endif + +/* + *********************************************************************** + * STRUCT_SIZE_CHECK -- */ /** + * + * \brief Check if the actual size of a structure is what is expected + * + * + * \param[in] STRUCT Structure whose size is to be checked. + * \param[in] SIZE Expected size of STRUCT. + * \param[in] DEBUG_EXTRA Additional bytes to be added to SIZE to + * compensate for extra info in debug builds. + * + *********************************************************************** + */ +#ifdef VMX86_DEBUG +#define STRUCT_SIZE_CHECK(STRUCT, SIZE, DEBUG_EXTRA) \ + ASSERT_ON_COMPILE(sizeof(STRUCT) == (SIZE + DEBUG_EXTRA)) +#else +#define STRUCT_SIZE_CHECK(STRUCT, SIZE, DEBUG_EXTRA) \ + ASSERT_ON_COMPILE(sizeof(STRUCT) == SIZE) +#endif + +/* * __func__ is a stringified function name that is part of the C99 standard. The block * below defines __func__ on older systems where the compiler does not support that * macro. @@ -831,4 +899,14 @@ typedef int PollDevHandle; #endif +/* + * Define the utf16_t type. + */ + +#if defined(_WIN32) && defined(_NATIVE_WCHAR_T_DEFINED) +typedef wchar_t utf16_t; +#else +typedef uint16 utf16_t; +#endif + #endif /* _VM_BASIC_TYPES_H_ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmxnet/vm_device_version.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmxnet/vm_device_version.h --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmxnet/vm_device_version.h 2008-01-28 08:02:49.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmxnet/vm_device_version.h 2008-10-13 08:01:46.000000000 +0100 @@ -53,6 +53,7 @@ #define PCI_DEVICE_ID_VMWARE_BRIDGE 0x0790 #define PCI_DEVICE_ID_VMWARE_ROOTPORT 0x07A0 #define PCI_DEVICE_ID_VMWARE_VMXNET3 0x07B0 +#define PCI_DEVICE_ID_VMWARE_PVSCSI 0x07C0 /* The hypervisor device might grow. Please leave room * for 7 more subfunctions. @@ -84,6 +85,7 @@ * Intel 82443BX (440 BX North Bridge and AGP Bridge) * Intel 82545EM (e1000, server adapter, single port) * Intel 82546EB (e1000, server adapter, dual port) + * Intel ICH7_16 (Hight Definition Audio controller) */ #define PCI_VENDOR_ID_INTEL 0x8086 #define PCI_DEVICE_ID_INTEL_82439TX 0x7100 @@ -96,6 +98,7 @@ #define PCI_DEVICE_ID_INTEL_82443BX_2 0x7192 /* Used when no AGP support */ #define PCI_DEVICE_ID_INTEL_82545EM 0x100f #define PCI_DEVICE_ID_INTEL_82546EB 0x1010 +#define PCI_DEVICE_ID_INTEL_ICH7_16 0x27d8 /************* Strings for IDE Identity Fields **************************/ @@ -124,6 +127,9 @@ /************* SCSI implementation limits ********************************/ #define SCSI_MAX_CONTROLLERS 4 // Need more than 1 for MSCS clustering #define SCSI_MAX_DEVICES 16 // BT-958 emulates only 16 +#define SCSI_IDE_CHANNEL SCSI_MAX_CONTROLLERS +#define SCSI_IDE_HOSTED_CHANNEL (SCSI_MAX_CONTROLLERS + 1) +#define SCSI_MAX_CHANNELS (SCSI_MAX_CONTROLLERS + 2) /************* Strings for the VESA BIOS Identity Fields *****************/ #define VBE_OEM_STRING COMPANY_NAME " SVGA" @@ -139,6 +145,9 @@ /************* PCI Passthrough implementation limits ********************/ #define MAX_PCI_PASSTHRU_DEVICES 2 +/************* USB implementation limits ********************************/ +#define MAX_USB_DEVICES_PER_HOST_CONTROLLER 127 + /************* Strings for Host USB Driver *******************************/ #ifdef _WIN32 diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmxnet/vmnet_def.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmxnet/vmnet_def.h --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmxnet/vmnet_def.h 2008-01-28 08:02:49.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmxnet/vmnet_def.h 2008-10-13 08:01:46.000000000 +0100 @@ -57,4 +57,8 @@ #define VMNET_CAP_RX_CHAIN 0x8000 /* a pkt can span multiple rx entries */ #define VMNET_CAP_LPD 0x10000 /* large pkt delivery */ #define VMNET_CAP_BPF 0x20000 /* BPF Support in VMXNET Virtual Hardware */ +#define VMNET_CAP_SG_SPAN_PAGES 0x40000 /* Can do scatter-gather span multiple pages transmits. */ +#define VMNET_CAP_IP6_CSUM 0x80000 /* Can do IPv6 csum offload. */ +#define VMNET_CAP_TSO6 0x100000 /* Can do TSO segmentation offload for IPv6 pkts. */ +#define VMNET_CAP_TSO256k 0x200000 /* Can do TSO segmentation offload for pkts up to 256kB. */ #endif // _VMNET_DEF_H_ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmxnet/vmxnet2_def.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmxnet/vmxnet2_def.h --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmxnet/vmxnet2_def.h 2008-01-28 08:02:49.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmxnet/vmxnet2_def.h 2008-10-13 08:01:46.000000000 +0100 @@ -40,8 +40,13 @@ #define VMXNET2_MAX_NUM_RX_BUFFERS 128 #define VMXNET2_DEFAULT_NUM_RX_BUFFERS 100 + +/* size of the rx ring when enhanced vmxnet is used */ +#define ENHANCED_VMXNET2_MAX_NUM_RX_BUFFERS 512 +#define ENHANCED_VMXNET2_DEFAULT_NUM_RX_BUFFERS 150 + /* size of the 2nd rx ring */ -#define VMXNET2_MAX_NUM_RX_BUFFERS2 512 +#define VMXNET2_MAX_NUM_RX_BUFFERS2 2048 #define VMXNET2_DEFAULT_NUM_RX_BUFFERS2 512 /* size of the tx ring */ @@ -108,10 +113,6 @@ #define VMXNET2_RX_WITH_FRAG 0x02 #define VMXNET2_RX_FRAG_EOP 0x04 -#ifdef BPF_SUPPORT_ENABLED -#define VMXNET2_RX_BPF_TRAILER 0x08 -#endif /* BPF_SUPPORT_ENABLED */ - typedef struct Vmxnet2_TxRingEntry { uint16 flags; /* Flags as defined below. */ uint16 ownership; /* Who owns this packet. */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/freebsd/vmxnet/vmxnet_def.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmxnet/vmxnet_def.h --- open-vm-tools-2008.01.23-74039/modules/freebsd/vmxnet/vmxnet_def.h 2008-01-28 08:02:49.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/freebsd/vmxnet/vmxnet_def.h 2008-10-13 08:01:46.000000000 +0100 @@ -97,7 +97,7 @@ /* * An invalid ring index. */ -#define VMXNET_INVALID_RING_INDEX -1 +#define VMXNET_INVALID_RING_INDEX (-1) /* * Features that are implemented by the driver. These are driver @@ -120,7 +120,6 @@ #define VMXNET_FEATURE_TSO 0x02 #define VMXNET_FEATURE_JUMBO_FRAME 0x04 #define VMXNET_FEATURE_LPD 0x08 -#define VMXNET_FEATURE_BPF 0x10 /* * Define the set of capabilities required by each feature above @@ -128,7 +127,6 @@ #define VMXNET_FEATURE_ZERO_COPY_TX_CAPS VMXNET_CAP_SG #define VMXNET_FEATURE_TSO_CAPS VMXNET_CAP_TSO #define VMXNET_HIGHEST_FEATURE_BIT VMXNET_FEATURE_TSO -#define VMXNET_FEATURE_BPF_CAPS VMNET_CAP_BPF #define VMXNET_INC(val, max) \ val++; \ @@ -142,16 +140,6 @@ */ typedef uint32 Vmxnet_DDMagic; - -/* - * Max number of packet patterns in a single filter & maximum packet size - * that can match a filter. Used by vmxnet wake-on-packet-pattern-receive. - */ - -#define MAX_NUM_FILTER_PTTRNS 6 -#define MAX_PKT_FILTER_SIZE 128 - - /* * Wake packet pattern commands sent through VMXNET_WAKE_PKT_PATTERNS port */ @@ -179,23 +167,4 @@ } pktPttrn; } Vmxnet_WakePktCmd; - -/* - * Representation for packet filter pattern set, needs to fit w/i an MPN - */ - -typedef struct Vmxnet_PttrnBytes { - uint8 byteOff; /* offset within packet of pattern byte */ - uint8 byteVal; /* value of pattern byte within packet */ -} Vmxnet_PttrnBytes; - -typedef struct Vmxnet_PktFltrPttrns { - uint8 prevCmd; /* to check sanity of VMXNET_PM_OPCODE_START..END sequence */ - uint8 nmPttrns; /* count patterns 1..MAX_NUM_FILTER_PTTRNS */ - uint8 nmPttrnBytes[MAX_NUM_FILTER_PTTRNS]; /* 1..MAX_PKT_FILTER_SIZE */ - Vmxnet_PttrnBytes pttrnBytes[MAX_NUM_FILTER_PTTRNS][MAX_PKT_FILTER_SIZE]; -} Vmxnet_PktFltrPttrns; - #endif /* _VMXNET_DEF_H_ */ - - diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmblock/autoconf/cachector1.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmblock/autoconf/cachector1.c --- open-vm-tools-2008.01.23-74039/modules/linux/vmblock/autoconf/cachector1.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmblock/autoconf/cachector1.c 2008-10-13 08:01:39.000000000 +0100 @@ -0,0 +1,38 @@ +/********************************************************* + * Copyright (C) 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 General Public License as published by the + * Free Software Foundation version 2 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 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 + * + *********************************************************/ + +#include <linux/autoconf.h> +#include <linux/version.h> + +/* + * Between 2.6.27-rc1 and 2.6.27-rc2 ctor prototype was changed from + * ctor(cache, ptr) to ctor(ptr). Unfortunately there + * is no typedef for ctor, so we have to redefine kmem_cache_create + * to find out ctor prototype. If prototype matches, then this is old + * kernel. + */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28) +#error "This test intentionally fails on 2.6.28 and newer kernels." +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26) +#include <linux/slab.h> + +struct kmem_cache *kmem_cache_create(const char *, size_t, size_t, + unsigned long, + void (*)(struct kmem_cache *, void *)); + +#endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmblock/include/compat_fs.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmblock/include/compat_fs.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmblock/include/compat_fs.h 2008-01-28 08:02:43.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmblock/include/compat_fs.h 2008-10-13 08:01:39.000000000 +0100 @@ -80,8 +80,8 @@ * * The VFS exports do_sync_read() and do_sync_write() as the "new" * generic_file_read() and generic_file_write(), but filesystems need not - * actually implement read and write- the VFS will automatically call - * do_sync_write() and do_sync_read() when applications invoke the standard + * actually implement read and write- the VFS will automatically call + * do_sync_write() and do_sync_read() when applications invoke the standard * read() and write() system calls. * * In 2.6.19, generic_file_read() and generic_file_write() were removed, @@ -104,6 +104,14 @@ /* + * iget() was removed from the VFS as of 2.6.25-rc1. The replacement for iget() + * is iget_locked() which was added in 2.5.17. + */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 17) +# define VMW_USE_IGET_LOCKED +#endif + +/* * parent_ino was born in 2.5.5. For older kernels, let's use 2.5.5 * implementation. It uses the dcache lock which is OK because per-dentry * locking appeared after 2.5.5. diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmblock/include/compat_kernel.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmblock/include/compat_kernel.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmblock/include/compat_kernel.h 2008-01-28 08:02:43.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmblock/include/compat_kernel.h 2008-10-13 08:01:39.000000000 +0100 @@ -72,5 +72,12 @@ #endif +/* + * vsnprintf became available in 2.4.10. For older kernels, just fall back on + * vsprintf. + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 10) +#define vsnprintf(str, size, fmt, args) vsprintf(str, fmt, args) +#endif #endif /* __COMPAT_KERNEL_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmblock/include/compat_namei.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmblock/include/compat_namei.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmblock/include/compat_namei.h 2008-01-28 08:02:43.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmblock/include/compat_namei.h 2008-10-13 08:01:39.000000000 +0100 @@ -23,6 +23,23 @@ #include <linux/namei.h> #endif +/* + * In 2.6.25-rc2, dentry and mount objects were removed from the nameidata + * struct. They were both replaced with a struct path. + */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25) +#define compat_vmw_nd_to_dentry(nd) (nd).path.dentry +#else +#define compat_vmw_nd_to_dentry(nd) (nd).dentry +#endif + +/* In 2.6.25-rc2, path_release(&nd) was replaced with path_put(&nd.path). */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25) +#define compat_path_release(nd) path_put(&(nd)->path) +#else +#define compat_path_release(nd) path_release(nd) +#endif + /* path_lookup was exported in 2.4.25 */ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 25) #define compat_path_lookup(path, flags, nd) path_lookup(path, flags, nd) diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmblock/include/compat_sched.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmblock/include/compat_sched.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmblock/include/compat_sched.h 2008-01-28 08:02:43.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmblock/include/compat_sched.h 2008-10-13 08:01:39.000000000 +0100 @@ -27,6 +27,11 @@ #define CLONE_KERNEL CLONE_FILES | CLONE_FS | CLONE_SIGHAND #endif +/* TASK_COMM_LEN become available in 2.6.11. */ +#ifndef TASK_COMM_LEN +#define TASK_COMM_LEN 16 +#endif + /* The capable() API appeared in 2.1.92 --hpreg */ #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 1, 92) # define capable(_capability) suser() @@ -266,4 +271,21 @@ #define compat_set_freezable() do {} while (0) #endif +/* + * Since 2.6.27-rc2 kill_proc() is gone... Replacement (GPL-only!) + * API is available since 2.6.19. Use them from 2.6.27-rc1 up. + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 27) +typedef int compat_pid; +#define compat_find_get_pid(pid) (pid) +#define compat_put_pid(pid) do { } while (0) +#define compat_kill_pid(pid, sig, flag) kill_proc(pid, sig, flag) +#else +typedef struct pid * compat_pid; +#define compat_find_get_pid(pid) find_get_pid(pid) +#define compat_put_pid(pid) put_pid(pid) +#define compat_kill_pid(pid, sig, flag) kill_pid(pid, sig, flag) +#endif + + #endif /* __COMPAT_SCHED_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmblock/include/compat_semaphore.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmblock/include/compat_semaphore.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmblock/include/compat_semaphore.h 2008-01-28 08:02:43.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmblock/include/compat_semaphore.h 2008-10-13 08:01:39.000000000 +0100 @@ -20,7 +20,12 @@ # define __COMPAT_SEMAPHORE_H__ -#include <asm/semaphore.h> +/* <= 2.6.25 have asm only, 2.6.26 has both, and 2.6.27-rc2+ has linux only. */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 27) +# include <asm/semaphore.h> +#else +# include <linux/semaphore.h> +#endif /* diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmblock/include/compat_slab.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmblock/include/compat_slab.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmblock/include/compat_slab.h 2008-01-28 08:02:43.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmblock/include/compat_slab.h 2008-10-13 08:01:39.000000000 +0100 @@ -57,14 +57,29 @@ * Up to 2.6.23 kmem_cache constructor has three arguments - pointer to block to * prepare (aka "this"), from which cache it came, and some unused flags. After * 2.6.23 flags were removed, and order of "this" and cache parameters was swapped... + * Since 2.6.27-rc2 everything is different again, and ctor has only one argument. + * + * HAS_3_ARGS has precedence over HAS_2_ARGS if both are defined. */ #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 23) && !defined(VMW_KMEMCR_CTOR_HAS_3_ARGS) # define VMW_KMEMCR_CTOR_HAS_3_ARGS #endif -#ifdef VMW_KMEMCR_CTOR_HAS_3_ARGS +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26) && !defined(VMW_KMEMCR_CTOR_HAS_2_ARGS) +# define VMW_KMEMCR_CTOR_HAS_2_ARGS +#endif + +#if defined(VMW_KMEMCR_CTOR_HAS_3_ARGS) typedef void compat_kmem_cache_ctor(void *, compat_kmem_cache *, unsigned long); -#else +#define COMPAT_KMEM_CACHE_CTOR_ARGS(arg) void *arg, \ + compat_kmem_cache *cache, \ + unsigned long flags +#elif defined(VMW_KMEMCR_CTOR_HAS_2_ARGS) typedef void compat_kmem_cache_ctor(compat_kmem_cache *, void *); +#define COMPAT_KMEM_CACHE_CTOR_ARGS(arg) compat_kmem_cache *cache, \ + void *arg +#else +typedef void compat_kmem_cache_ctor(void *); +#define COMPAT_KMEM_CACHE_CTOR_ARGS(arg) void *arg #endif #endif /* __COMPAT_SLAB_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmblock/include/compat_wait.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmblock/include/compat_wait.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmblock/include/compat_wait.h 2008-01-28 08:02:43.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmblock/include/compat_wait.h 2008-10-13 08:01:39.000000000 +0100 @@ -52,13 +52,13 @@ * 2.4.20-wolk4.0s. */ -#if VMW_HAVE_EPOLL // { +#ifdef VMW_HAVE_EPOLL // { #define compat_poll_wqueues struct poll_wqueues #else // } { #define compat_poll_wqueues poll_table #endif // } -#if VMW_HAVE_EPOLL // { +#ifdef VMW_HAVE_EPOLL // { /* If prototype does not match, build will abort here */ extern void poll_initwait(compat_poll_wqueues *); @@ -191,4 +191,35 @@ }) #endif +/* + * DEFINE_WAIT() and friends were added in 2.5.39 and backported to 2.4.28. + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 28) || \ + (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 0) && \ + LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 39)) +# define COMPAT_DEFINE_WAIT(_wait) \ + DECLARE_WAITQUEUE(_wait, current) +# define compat_init_prepare_to_wait(_sleep, _wait, _state) \ + do { \ + __set_current_state(_state); \ + add_wait_queue(_sleep, _wait); \ + } while (0) +# define compat_cont_prepare_to_wait(_sleep, _wait, _state) \ + set_current_state(_state) +# define compat_finish_wait(_sleep, _wait, _state) \ + do { \ + __set_current_state(_state); \ + remove_wait_queue(_sleep, _wait); \ + } while (0) +#else +# define COMPAT_DEFINE_WAIT(_wait) \ + DEFINE_WAIT(_wait) +# define compat_init_prepare_to_wait(_sleep, _wait, _state) \ + prepare_to_wait(_sleep, _wait, _state) +# define compat_cont_prepare_to_wait(_sleep, _wait, _state) \ + prepare_to_wait(_sleep, _wait, _state) +# define compat_finish_wait(_sleep, _wait, _state) \ + finish_wait(_sleep, _wait) +#endif + #endif /* __COMPAT_WAIT_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmblock/include/vm_assert.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmblock/include/vm_assert.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmblock/include/vm_assert.h 2008-01-28 08:02:43.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmblock/include/vm_assert.h 2008-10-13 08:01:39.000000000 +0100 @@ -98,8 +98,6 @@ * ASSERT() is special cased because of interaction with Windows DDK. */ -#define IMPLIES(a,b) (!(a) || (b)) - #if defined VMX86_DEBUG || defined ASSERT_ALWAYS_AVAILABLE #undef ASSERT #define ASSERT(cond) \ @@ -243,12 +241,21 @@ /* - * Compile-time assertions + * 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). */ #define ASSERT_ON_COMPILE(e) \ do { \ - typedef char AssertOnCompileType[(e) ? 1 : -1]; \ + enum { AssertOnCompileMisused = ((e) ? 1 : -1) }; \ + typedef char AssertOnCompileFailed[AssertOnCompileMisused]; \ } while (0) diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmblock/include/vm_basic_defs.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmblock/include/vm_basic_defs.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmblock/include/vm_basic_defs.h 2008-01-28 08:02:43.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmblock/include/vm_basic_defs.h 2008-10-13 08:01:39.000000000 +0100 @@ -39,6 +39,10 @@ #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 <stddef.h> /* * We re-define offsetof macro from stddef, make @@ -52,7 +56,8 @@ * Simple macros */ -#if defined __APPLE__ && !defined KERNEL +#if (defined __APPLE__ || defined __FreeBSD__) && \ + (!defined KERNEL && !defined _KERNEL && !defined VMKERNEL && !defined __KERNEL__) # include <stddef.h> #else // XXX the __cplusplus one matches that of VC++, to prevent redefinition warning @@ -108,6 +113,7 @@ #define DWORD_ALIGN(x) ((((x)+3) >> 2) << 2) #define QWORD_ALIGN(x) ((((x)+4) >> 3) << 3) +#define IMPLIES(a,b) (!(a) || (b)) /* * Not everybody (e.g., the monitor) has NULL @@ -313,7 +319,22 @@ #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 // { @@ -324,7 +345,7 @@ * guarantee. Bummer. --Jeremy. */ -#if defined(N_PLAT_NLM) || defined(__FreeBSD__) +#if defined(N_PLAT_NLM) /* We do not have YIELD() as we do not need it yet... */ #elif defined(_WIN32) # define YIELD() Sleep(0) @@ -450,12 +471,23 @@ */ #undef DEBUG_ONLY +#undef SL_DEBUG_ONLY +#undef VMX86_SL_DEBUG #ifdef VMX86_DEBUG -#define vmx86_debug 1 -#define DEBUG_ONLY(x) x +#define vmx86_debug 1 +#define DEBUG_ONLY(x) x +/* + * Be very, very, very careful with SL_DEBUG. Pls ask ganesh or min before + * using it. + */ +#define VMX86_SL_DEBUG +#define vmx86_sl_debug 1 +#define SL_DEBUG_ONLY(x) x #else -#define vmx86_debug 0 +#define vmx86_debug 0 #define DEBUG_ONLY(x) +#define vmx86_sl_debug 0 +#define SL_DEBUG_ONLY(x) #endif #ifdef VMX86_STATS @@ -543,18 +575,32 @@ #endif #endif -#ifdef VMX86_VPROBES -#define vmx86_vprobes 1 -#define VPROBES_ONLY(x) x +#ifdef _WIN32 +#define VMW_INVALID_HANDLE INVALID_HANDLE_VALUE +#else +#define VMW_INVALID_HANDLE (-1) +#endif + +#ifdef _WIN32 +#define fsync(fd) _commit(fd) +#define fileno(f) _fileno(f) #else -#define vmx86_vprobes 0 -#define VPROBES_ONLY(x) #endif +/* + * Debug output macros for Windows drivers (the Eng variant is for + * display/printer drivers only. + */ #ifdef _WIN32 -#define VMW_INVALID_HANDLE INVALID_HANDLE_VALUE +#ifndef USES_OLD_WINDDK +#if defined(VMX86_DEBUG) || defined(ASSERT_ALWAYS_AVAILABLE) +#define WinDrvPrint(arg, ...) DbgPrint(arg, __VA_ARGS__) +#define WinDrvEngPrint(arg, ...) EngDbgPrint(arg, __VA_ARGS__) #else -#define VMW_INVALID_HANDLE -1 +#define WinDrvPrint(arg, ...) +#define WinDrvEngPrint(arg, ...) #endif +#endif +#endif // _WIN32 #endif // ifndef _VM_BASIC_DEFS_H_ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmblock/include/vm_basic_types.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmblock/include/vm_basic_types.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmblock/include/vm_basic_types.h 2008-01-28 08:02:43.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmblock/include/vm_basic_types.h 2008-10-13 08:01:39.000000000 +0100 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998-2007 VMware, Inc. All rights reserved. + * Copyright (C) 1998-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 General Public License as published by the @@ -92,10 +92,6 @@ #pragma warning (disable :4305) // truncation from 'const int' to 'short' #pragma warning (disable :4244) // conversion from 'unsigned short' to 'unsigned char' #pragma warning (disable :4267) // truncation of 'size_t' -#if !defined VMX86_DEVEL // XXX until we clean up all the code -- edward -#pragma warning (disable :4133) // incompatible types - from 'struct VM *' to 'int *' -#pragma warning (disable :4047) // differs in levels of indirection -#endif #pragma warning (disable :4146) // unary minus operator applied to unsigned type, result still unsigned #pragma warning (disable :4142) // benign redefinition of type @@ -154,12 +150,16 @@ #include <stdlib.h> #endif +#ifdef __FreeBSD__ +#include <sys/param.h> /* For __FreeBSD_version */ +#endif + #if !defined(USING_AUTOCONF) # if defined(__FreeBSD__) || defined(sun) # ifdef KLD_MODULE # include <sys/types.h> # else -# if (BSD_VERSION >= 50) +# if !defined(VMKERNEL) && (__FreeBSD_version >= 500043) # include <inttypes.h> # include <sys/types.h> # else @@ -254,7 +254,12 @@ || (defined(_POSIX2_VERSION) && _POSIX2_VERSION >= 200112L) /* BSD/Darwin, Linux */ #define FMTSZ "z" - #define FMTPD "t" + + #if defined(VM_X86_64) || defined(__APPLE__) + #define FMTPD "l" + #else + #define FMTPD "" + #endif #else /* Systems with a pre-C99 libc */ #define FMTSZ "Z" @@ -338,8 +343,8 @@ * Type big enough to hold an integer between 0..100 */ typedef uint8 Percent; -#define asPercent(v) ((Percent)(v)) -#define CHOOSE_PERCENT asPercent(-1) +#define AsPercent(v) ((Percent)(v)) +#define CHOOSE_PERCENT AsPercent(101) typedef uintptr_t VA; @@ -371,6 +376,9 @@ typedef User_CartelID User_CartelGroupID; #define INVALID_CARTELGROUP_ID INVALID_CARTEL_ID +typedef uint32 Worldlet_ID; +#define INVALID_WORLDLET_ID ((Worldlet_ID)0) + /* world page number */ typedef uint32 WPN; @@ -381,6 +389,12 @@ #endif /* + * This type should be used for variables that contain sector + * position/quantity. + */ +typedef uint64 SectorType; + +/* * Linear address */ @@ -434,6 +448,7 @@ typedef VA32 UserVA32; typedef VA64 UserVA64; typedef UserVA32 UserVAConst; /* Userspace ptr to data that we may only read. */ +typedef UserVA64 UserVA64Const; /* Used by 64-bit syscalls until conversion is finished. */ #ifdef VMKERNEL typedef UserVA32 UserVA; #else @@ -447,10 +462,10 @@ * for any region other than buserror. */ #define PHYSMEM_MAX_PPN ((PPN)0xffffffff) -#define MAX_PPN ((PPN)0x0fffffff) /* Maximal observable PPN value. */ -#define INVALID_PPN ((PPN)-1) +#define MAX_PPN ((PPN)0x1fffffff) /* Maximal observable PPN value. */ +#define INVALID_PPN ((PPN)0xffffffff) -#define INVALID_BPN ((BPN) 0x3fffffff) /* BPNs don't use the high two bits. */ +#define INVALID_BPN ((BPN) 0x1fffffff) #define INVALID_MPN ((MPN)-1) #define MEMREF_MPN ((MPN)-2) @@ -480,8 +495,9 @@ # define FMTVPN "" #endif - +#ifndef EXTERN #define EXTERN extern +#endif #define CONST const @@ -631,6 +647,12 @@ # define PRINTF_DECL(fmtPos, varPos) #endif +#if defined(__GNUC__) +# define SCANF_DECL(fmtPos, varPos) __attribute__((__format__(__scanf__, fmtPos, varPos))) +#else +# define SCANF_DECL(fmtPos, varPos) +#endif + /* * UNUSED_PARAM should surround the parameter name and type declaration, * e.g. "int MyFunction(int var1, UNUSED_PARAM(int var2))" @@ -677,6 +699,52 @@ #endif /* + *********************************************************************** + * STRUCT_OFFSET_CHECK -- */ /** + * + * \brief Check if the actual offsef of a member in a structure + * is what is expected + * + * + * \param[in] STRUCT Structure the member is a part of. + * \param[in] MEMBER Member to check the offset of. + * \param[in] OFFSET Expected offset of MEMBER in STRUCTURE. + * \param[in] DEBUG_EXTRA Additional bytes to be added to OFFSET to + * compensate for extra info in debug builds. + * + *********************************************************************** + */ +#ifdef VMX86_DEBUG +#define STRUCT_OFFSET_CHECK(STRUCT, MEMBER, OFFSET, DEBUG_EXTRA) \ + ASSERT_ON_COMPILE(vmk_offsetof(STRUCT, MEMBER) == (OFFSET + DEBUG_EXTRA)) +#else +#define STRUCT_OFFSET_CHECK(STRUCT, MEMBER, OFFSET, DEBUG_EXTRA) \ + ASSERT_ON_COMPILE(vmk_offsetof(STRUCT, MEMBER) == OFFSET) +#endif + +/* + *********************************************************************** + * STRUCT_SIZE_CHECK -- */ /** + * + * \brief Check if the actual size of a structure is what is expected + * + * + * \param[in] STRUCT Structure whose size is to be checked. + * \param[in] SIZE Expected size of STRUCT. + * \param[in] DEBUG_EXTRA Additional bytes to be added to SIZE to + * compensate for extra info in debug builds. + * + *********************************************************************** + */ +#ifdef VMX86_DEBUG +#define STRUCT_SIZE_CHECK(STRUCT, SIZE, DEBUG_EXTRA) \ + ASSERT_ON_COMPILE(sizeof(STRUCT) == (SIZE + DEBUG_EXTRA)) +#else +#define STRUCT_SIZE_CHECK(STRUCT, SIZE, DEBUG_EXTRA) \ + ASSERT_ON_COMPILE(sizeof(STRUCT) == SIZE) +#endif + +/* * __func__ is a stringified function name that is part of the C99 standard. The block * below defines __func__ on older systems where the compiler does not support that * macro. @@ -831,4 +899,14 @@ typedef int PollDevHandle; #endif +/* + * Define the utf16_t type. + */ + +#if defined(_WIN32) && defined(_NATIVE_WCHAR_T_DEFINED) +typedef wchar_t utf16_t; +#else +typedef uint16 utf16_t; +#endif + #endif /* _VM_BASIC_TYPES_H_ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmblock/include/vmblock.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmblock/include/vmblock.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmblock/include/vmblock.h 2008-01-28 08:02:43.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmblock/include/vmblock.h 2008-10-13 08:01:39.000000000 +0100 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2006 VMware, Inc. All rights reserved. + * Copyright (C) 2006-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 General Public License as published by the @@ -20,6 +20,25 @@ * vmblock.h -- * * User-level interface to the vmblock device. + * + * VMBLOCK_DEVICE should be opened with VMBLOCK_DEVICE_MODE mode. Then + * VMBLOCK_CONTROL should be called to perform blocking operations. + * The links which can be blocked are in the directory VMBLOCK_MOUNT_POINT. + * + * VMBLOCK_CONTROL takes the file descriptor of the VMBLOCK_DEVICE, an + * operation, and the path of the target of the file being operated on (if + * applicable). + * + * The operation should be one of: + * VMBLOCK_ADD_FILEBLOCK + * VMBLOCK_DEL_FILEBLOCK + * VMBLOCK_LIST_FILEBLOCKS + * + * path should be something in /tmp/VMwareDnD/ rather than in + * VMBLOCK_MOUNT_POINT. + * + * VMBLOCK_CONTROL returns 0 on success or returns -1 and sets errno on + * failure. */ #ifndef _VMBLOCK_H_ @@ -36,7 +55,69 @@ #define VMBLOCK_FS_NAME "vmblock" /* Commands for the control half of vmblock driver */ -#if defined(linux) +#if defined(vmblock_fuse) +# include <unistd.h> +# include <limits.h> +# include <string.h> +# include <errno.h> +# include "vm_basic_types.h" +# define VMBLOCK_ADD_FILEBLOCK 'a' +# define VMBLOCK_DEL_FILEBLOCK 'd' +# ifdef VMX86_DEVEL +# define VMBLOCK_LIST_FILEBLOCKS 'l' +# endif /* VMX86_DEVEL */ +/* + * Some of the following names don't actually make much sense on their own. + * They're used for consistency with the other ports. See the file header for + * explanations of what they're used for. + */ +# define VMBLOCK_DEVICE_NAME "dev" +# define VMBLOCK_CONTROL_MOUNTPOINT "blockdir" +# define VMBLOCK_DEVICE "/tmp/vmblock/" VMBLOCK_DEVICE_NAME +# define VMBLOCK_DEVICE_MODE O_WRONLY +# define VMBLOCK_MOUNT_POINT "/tmp/vmblock/" VMBLOCK_CONTROL_MOUNTPOINT +static INLINE ssize_t + VMBLOCK_CONTROL(int fd, char op, const char *path) +{ + /* + * buffer needs room for an operation character and a string with max length + * PATH_MAX - 1. + */ + + char buffer[PATH_MAX]; + size_t pathLength; + + pathLength = strlen(path); + if (pathLength >= PATH_MAX) { + errno = ENAMETOOLONG; + return -1; + } + + buffer[0] = op; + memcpy(buffer + 1, path, pathLength); + + /* + * The lseek is only to prevent the file pointer from overflowing; + * vmblock-fuse ignores the file pointer / offset. Overflowing the file + * pointer causes write to fail: + * http://article.gmane.org/gmane.comp.file-systems.fuse.devel/6648 + * There's also a race condition here where many threads all calling + * VMBLOCK_CONTROL at the same time could have all their seeks executed one + * after the other, followed by all the writes. Again, it's not a problem + * unless the file pointer overflows which is very unlikely with 32 bit + * offsets and practically impossible with 64 bit offsets. + */ + + if (lseek(fd, 0, SEEK_SET) < 0) { + return -1; + } + if (write(fd, buffer, pathLength + 1) < 0) { + return -1; + } + return 0; +} + +#elif defined(linux) # define VMBLOCK_ADD_FILEBLOCK 98 # define VMBLOCK_DEL_FILEBLOCK 99 # ifdef VMX86_DEVEL @@ -45,10 +126,11 @@ # define VMBLOCK_CONTROL_DIRNAME VMBLOCK_FS_NAME # define VMBLOCK_CONTROL_DEVNAME "dev" # define VMBLOCK_CONTROL_MOUNTPOINT "mountPoint" +# define VMBLOCK_CONTROL_PROC_DIRNAME "fs/" VMBLOCK_CONTROL_DIRNAME -# define VMBLOCK_MOUNT_POINT "/proc/fs/" VMBLOCK_CONTROL_DIRNAME \ +# define VMBLOCK_MOUNT_POINT "/proc/" VMBLOCK_CONTROL_PROC_DIRNAME \ "/" VMBLOCK_CONTROL_MOUNTPOINT -# define VMBLOCK_DEVICE "/proc/fs/" VMBLOCK_CONTROL_DIRNAME \ +# define VMBLOCK_DEVICE "/proc/" VMBLOCK_CONTROL_PROC_DIRNAME \ "/" VMBLOCK_CONTROL_DEVNAME # define VMBLOCK_DEVICE_MODE O_WRONLY # define VMBLOCK_CONTROL(fd, op, path) write(fd, path, op) diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmblock/linux/block.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmblock/linux/block.c --- open-vm-tools-2008.01.23-74039/modules/linux/vmblock/linux/block.c 2008-01-28 08:02:43.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmblock/linux/block.c 2008-10-13 08:01:39.000000000 +0100 @@ -25,7 +25,8 @@ /* os.h includes necessary OS-specific headers. */ #include "os.h" -#ifdef linux +#if defined(vmblock_fuse) +#elif defined(linux) # include "vmblockInt.h" #elif defined(sun) # include "module.h" @@ -338,7 +339,7 @@ */ if (cookie == NULL) { os_read_lock(&blockedFilesLock); - block = GetBlock(filename, NULL); + block = GetBlock(filename, OS_UNKNOWN_BLOCKER); os_read_unlock(&blockedFilesLock); if (!block) { @@ -407,7 +408,7 @@ os_read_lock(&blockedFilesLock); block = GetBlock(filename, blocker); - + os_read_unlock(&blockedFilesLock); return block; diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmblock/linux/control.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmblock/linux/control.c --- open-vm-tools-2008.01.23-74039/modules/linux/vmblock/linux/control.c 2008-01-28 08:02:43.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmblock/linux/control.c 2008-10-13 08:01:39.000000000 +0100 @@ -149,11 +149,10 @@ struct proc_dir_entry *controlProcMountpoint; /* Create /proc/fs/vmblock */ - controlProcDirEntry = proc_mkdir(VMBLOCK_CONTROL_DIRNAME, - VMBLOCK_CONTROL_PARENT); + controlProcDirEntry = proc_mkdir(VMBLOCK_CONTROL_PROC_DIRNAME, NULL); if (!controlProcDirEntry) { - Warning("SetupProcDevice: could not create /proc/fs/" - VMBLOCK_CONTROL_DIRNAME "\n"); + Warning("SetupProcDevice: could not create /proc/" + VMBLOCK_CONTROL_PROC_DIRNAME "\n"); return -EINVAL; } @@ -163,9 +162,9 @@ controlProcMountpoint = proc_mkdir(VMBLOCK_CONTROL_MOUNTPOINT, controlProcDirEntry); if (!controlProcMountpoint) { - Warning("SetupProcDevice: could not create /proc/fs/" - VMBLOCK_CONTROL_MOUNTPOINT "\n"); - remove_proc_entry(VMBLOCK_CONTROL_DIRNAME, VMBLOCK_CONTROL_PARENT); + Warning("SetupProcDevice: could not create " + VMBLOCK_MOUNT_POINT "\n"); + remove_proc_entry(VMBLOCK_CONTROL_PROC_DIRNAME, NULL); return -EINVAL; } @@ -176,10 +175,9 @@ VMBLOCK_CONTROL_MODE, controlProcDirEntry); if (!controlProcEntry) { - Warning("SetupProcDevice: could not create /proc/fs/" - VMBLOCK_CONTROL_DIRNAME "/" VMBLOCK_CONTROL_DEVNAME "\n"); + Warning("SetupProcDevice: could not create " VMBLOCK_DEVICE "\n"); remove_proc_entry(VMBLOCK_CONTROL_MOUNTPOINT, controlProcDirEntry); - remove_proc_entry(VMBLOCK_CONTROL_DIRNAME, VMBLOCK_CONTROL_PARENT); + remove_proc_entry(VMBLOCK_CONTROL_PROC_DIRNAME, NULL); return -EINVAL; } @@ -210,7 +208,7 @@ if (controlProcDirEntry) { remove_proc_entry(VMBLOCK_CONTROL_MOUNTPOINT, controlProcDirEntry); remove_proc_entry(VMBLOCK_CONTROL_DEVNAME, controlProcDirEntry); - remove_proc_entry(VMBLOCK_CONTROL_DIRNAME, VMBLOCK_CONTROL_PARENT); + remove_proc_entry(VMBLOCK_CONTROL_PROC_DIRNAME, NULL); } return 0; } diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmblock/linux/dbllnklst.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmblock/linux/dbllnklst.c --- open-vm-tools-2008.01.23-74039/modules/linux/vmblock/linux/dbllnklst.c 2008-01-28 08:02:43.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmblock/linux/dbllnklst.c 2008-10-13 08:01:39.000000000 +0100 @@ -164,7 +164,7 @@ */ Bool -DblLnkLst_IsLinked(DblLnkLst_Links *l) // IN +DblLnkLst_IsLinked(DblLnkLst_Links const *l) // IN { ASSERT(l); diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmblock/linux/dbllnklst.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmblock/linux/dbllnklst.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmblock/linux/dbllnklst.h 2008-01-28 08:02:43.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmblock/linux/dbllnklst.h 2008-10-13 08:01:39.000000000 +0100 @@ -58,7 +58,7 @@ void DblLnkLst_Link(DblLnkLst_Links *l1, DblLnkLst_Links *l2); void DblLnkLst_Unlink(DblLnkLst_Links *l1, DblLnkLst_Links *l2); void DblLnkLst_Unlink1(DblLnkLst_Links *l); -Bool DblLnkLst_IsLinked(DblLnkLst_Links *l); +Bool DblLnkLst_IsLinked(DblLnkLst_Links const *l); /* Functions specific to anchored lists. --hpreg */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmblock/linux/dentry.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmblock/linux/dentry.c --- open-vm-tools-2008.01.23-74039/modules/linux/vmblock/linux/dentry.c 2008-01-28 08:02:43.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmblock/linux/dentry.c 2008-10-13 08:01:39.000000000 +0100 @@ -77,11 +77,21 @@ struct dentry *actualDentry; int ret; - if (!dentry || !dentry->d_inode) { + if (!dentry) { Warning("DentryOpRevalidate: invalid args from kernel\n"); return 0; } + /* + * If a dentry does not have an inode associated with it then + * we are dealing with a negative dentry. Always invalidate a negative + * dentry which will cause a fresh lookup. + */ + if (!dentry->d_inode) { + return 0; + } + + iinfo = INODE_TO_IINFO(dentry->d_inode); if (!iinfo) { Warning("DentryOpRevalidate: dentry has no fs-specific data\n"); @@ -112,8 +122,9 @@ LOG(4, "DentryOpRevalidate: [%s] no longer exists\n", iinfo->name); return 0; } - ret = actualNd.dentry && actualNd.dentry->d_inode; - path_release(&actualNd); + ret = compat_vmw_nd_to_dentry(actualNd) && + compat_vmw_nd_to_dentry(actualNd)->d_inode; + compat_path_release(&actualNd); LOG(8, "DentryOpRevalidate: [%s] %s revalidated\n", iinfo->name, ret ? "" : "not"); diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmblock/linux/filesystem.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmblock/linux/filesystem.c --- open-vm-tools-2008.01.23-74039/modules/linux/vmblock/linux/filesystem.c 2008-01-28 08:02:43.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmblock/linux/filesystem.c 2008-10-13 08:01:39.000000000 +0100 @@ -46,6 +46,7 @@ # define KERNEL_25_FS 1 #endif +static struct inode *GetInode(struct super_block *sb, ino_t ino); /* File system operations */ #if KERNEL_25_FS /* { */ @@ -190,6 +191,38 @@ /* *---------------------------------------------------------------------------- * + * VMBlockReadInode -- + * + * A filesystem wide function that is called to initialize a new inode. + * This is called from two different places depending on the kernel version. + * In older kernels that provide the iget() interface, this function is + * called by the kernel as part of inode initialization (from + * SuperOpReadInode). In newer kernels that call iget_locked(), this + * function is called by filesystem code to initialize the new inode. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +void +VMBlockReadInode(struct inode *inode) // IN: Inode to initialize +{ + VMBlockInodeInfo *iinfo = INODE_TO_IINFO(inode); + + iinfo->name[0] = '\0'; + iinfo->nameLen = 0; + iinfo->actualDentry = NULL; +} + + +/* + *---------------------------------------------------------------------------- + * * GetNextIno -- * * Gets the next available inode number. @@ -222,6 +255,48 @@ /* *---------------------------------------------------------------------------- * + * GetInode -- + * + * This function replaces iget() and should be called instead of it. In newer + * kernels that have removed the iget() interface, GetInode() obtains an inode + * and if it is a new one, then initializes the inode by calling + * VMBlockReadInode(). In older kernels that support the iget() interface, + * VMBlockReadInode() is called by iget() internally by the superblock function + * SuperOpReadInode. + * + * Results: + * A new inode object on success, NULL on error. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +static struct inode * +GetInode(struct super_block *sb, // IN: file system superblock object + ino_t ino) // IN: inode number to assign to new inode +{ +#ifdef VMW_USE_IGET_LOCKED + struct inode *inode; + + inode = iget_locked(sb, ino); + if (!inode) { + return NULL; + } else if (inode->i_state & I_NEW) { + VMBlockReadInode(inode); + unlock_new_inode(inode); + } + return inode; +#else + return iget(sb, ino); +#endif +} + + +/* + *---------------------------------------------------------------------------- + * * Iget -- * * Lookup or create a new inode. @@ -240,7 +315,7 @@ * then returns the inode to us (this function). * * Note that in older kernels that don't have the alloc_inode operation - * (where VMW_EMBED_INODE is undefined), the allocation is delayed until + * (where VMW_EMBED_INODE is undefined), the allocation is delayed until * this function and is contained within the INODE_TO_IINFO macro. That * allocation is freed in the SuperOpClearInode() function. * @@ -273,7 +348,7 @@ ASSERT(sb); - inode = iget(sb, ino); + inode = GetInode(sb, ino); if (!inode) { return NULL; } @@ -301,8 +376,8 @@ return inode; } - iinfo->actualDentry = actualNd.dentry; - path_release(&actualNd); + iinfo->actualDentry = compat_vmw_nd_to_dentry(actualNd); + compat_path_release(&actualNd); return inode; @@ -336,19 +411,11 @@ *---------------------------------------------------------------------------- */ -#ifdef VMW_KMEMCR_CTOR_HAS_3_ARGS static void -InodeCacheCtor(void *slabElem, // IN: allocated slab item to initialize - compat_kmem_cache *cache, // IN: cache slab is from - unsigned long flags) // IN: flags associated with allocation -#else -static void -InodeCacheCtor(compat_kmem_cache *cache, // IN: cache slab is from - void *slabElem) // IN: allocated slab item to initialize -#endif +InodeCacheCtor(COMPAT_KMEM_CACHE_CTOR_ARGS(slabElem)) // IN: allocated slab item to initialize { #ifdef VMW_EMBED_INODE - VMBlockInodeInfo *iinfo = (VMBlockInodeInfo *)slabElem; + VMBlockInodeInfo *iinfo = slabElem; inode_init_once(&iinfo->inode); #endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmblock/linux/filesystem.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmblock/linux/filesystem.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmblock/linux/filesystem.h 2008-01-28 08:02:43.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmblock/linux/filesystem.h 2008-10-13 08:01:39.000000000 +0100 @@ -95,6 +95,7 @@ struct dentry *dentry, ino_t ino); int MakeFullName(struct inode *dir, struct dentry *dentry, char *bufOut, size_t bufOutSize); +void VMBlockReadInode(struct inode *inode); /* Variables */ extern compat_kmem_cache *VMBlockInodeCache; diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmblock/linux/os.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmblock/linux/os.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmblock/linux/os.h 2008-01-28 08:02:43.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmblock/linux/os.h 2008-10-13 08:01:39.000000000 +0100 @@ -47,13 +47,13 @@ typedef struct file * os_blocker_id_t; #define OS_UNKNOWN_BLOCKER NULL -#define OS_ENOMEM -ENOMEM -#define OS_ENOENT -ENOENT -#define OS_EEXIST -EEXIST +#define OS_ENOMEM (-ENOMEM) +#define OS_ENOENT (-ENOENT) +#define OS_EEXIST (-EEXIST) #define OS_PATH_MAX PATH_MAX #define OS_FMTTID "d" -#define os_threadid current->pid +#define os_threadid (current->pid) /* * XXX vprintk() wasn't exported until 2.6.9; we should do something more * intelligent here eventually. diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmblock/linux/stubs.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmblock/linux/stubs.c --- open-vm-tools-2008.01.23-74039/modules/linux/vmblock/linux/stubs.c 2008-01-28 08:02:43.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmblock/linux/stubs.c 2008-10-13 08:01:39.000000000 +0100 @@ -23,6 +23,8 @@ * Common stubs. */ +#include <stdarg.h> + #include "os.h" /* diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmblock/linux/stubs.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmblock/linux/stubs.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmblock/linux/stubs.h 2008-01-28 08:02:43.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmblock/linux/stubs.h 2008-10-13 08:01:39.000000000 +0100 @@ -26,7 +26,7 @@ #ifndef __STUBS_H__ #define __STUBS_H__ -#ifdef linux +#if defined(linux) && !defined(vmblock_fuse) # include "driver-config.h" # include "compat_version.h" #endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmblock/linux/super.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmblock/linux/super.c --- open-vm-tools-2008.01.23-74039/modules/linux/vmblock/linux/super.c 2008-01-28 08:02:43.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmblock/linux/super.c 2008-10-13 08:01:39.000000000 +0100 @@ -37,7 +37,9 @@ #else static void SuperOpClearInode(struct inode *inode); #endif +#ifndef VMW_USE_IGET_LOCKED static void SuperOpReadInode(struct inode *inode); +#endif #ifdef VMW_STATFS_2618 static int SuperOpStatfs(struct dentry *dentry, struct compat_kstatfs *stat); #else @@ -52,7 +54,9 @@ #else .clear_inode = SuperOpClearInode, #endif +#ifndef VMW_USE_IGET_LOCKED .read_inode = SuperOpReadInode, +#endif .statfs = SuperOpStatfs, }; @@ -122,12 +126,16 @@ } +#ifndef VMW_USE_IGET_LOCKED /* *---------------------------------------------------------------------------- * * SuperOpReadInode -- * - * Performs any filesystem wide inode initialization. + * Performs any filesystem wide inode initialization. This is only called by + * iget() in older kernels that do not support iget_locked(). Newer kernels + * that use the iget_locked() interface are required to initialize the inode + * after it has been returned to the filesystem. * * Results: * None. @@ -141,13 +149,9 @@ static void SuperOpReadInode(struct inode *inode) // IN: Inode to initialize { - VMBlockInodeInfo *iinfo = INODE_TO_IINFO(inode); - - iinfo->name[0] = '\0'; - iinfo->nameLen = 0; - iinfo->actualDentry = NULL; + VMBlockReadInode(inode); } - +#endif /* *---------------------------------------------------------------------------- diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmblock/linux/vmblockInt.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmblock/linux/vmblockInt.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmblock/linux/vmblockInt.h 2008-01-28 08:02:43.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmblock/linux/vmblockInt.h 2008-10-13 08:01:39.000000000 +0100 @@ -64,7 +64,6 @@ #endif /* __KERNEL__ */ #define VMBLOCK_CONTROL_MODE S_IRUSR | S_IFREG -#define VMBLOCK_CONTROL_PARENT proc_root_fs /* * Our modules may be compatible with kernels built for different processors. diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmblock/linux/vmblock_version.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmblock/linux/vmblock_version.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmblock/linux/vmblock_version.h 2008-01-28 08:02:43.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmblock/linux/vmblock_version.h 2008-10-13 08:01:39.000000000 +0100 @@ -25,8 +25,8 @@ #ifndef _VMBLOCK_VERSION_H_ #define _VMBLOCK_VERSION_H_ -#define VMBLOCK_DRIVER_VERSION 1.0.1.1 -#define VMBLOCK_DRIVER_VERSION_COMMAS 1,0,1,1 -#define VMBLOCK_DRIVER_VERSION_STRING "1.0.1.1" +#define VMBLOCK_DRIVER_VERSION 1.1.2.0 +#define VMBLOCK_DRIVER_VERSION_COMMAS 1,1,2,0 +#define VMBLOCK_DRIVER_VERSION_STRING "1.1.2.0" #endif /* _VMBLOCK_VERSION_H_ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmblock/Makefile /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmblock/Makefile --- open-vm-tools-2008.01.23-74039/modules/linux/vmblock/Makefile 2008-01-28 08:02:43.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmblock/Makefile 2008-10-13 08:01:39.000000000 +0100 @@ -34,6 +34,7 @@ BUILD_DIR = $(HEADER_DIR)/.. DRIVER := vmblock +PRODUCT := @PRODUCT@ # Grep program GREP = /bin/grep @@ -86,7 +87,7 @@ # $(DRIVER_KO) is a phony target, so compare file times explicitly $(DRIVER): $(DRIVER_KO) - if [ $< -nt $@ ]; then cp -f $< $@; fi + if [ $< -nt $@ ] || [ ! -e $@ ] ; then cp -f $< $@; fi # Pass gcc version down the chain, so we can detect if kernel attempts to use unapproved compiler VM_CCVER := $(VMCCVER) diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmblock/Makefile.kernel /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmblock/Makefile.kernel --- open-vm-tools-2008.01.23-74039/modules/linux/vmblock/Makefile.kernel 2008-01-28 08:02:43.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmblock/Makefile.kernel 2008-10-13 08:01:39.000000000 +0100 @@ -25,7 +25,8 @@ EXTRA_CFLAGS += $(call vm_check_build, $(SRCROOT)/autoconf/epoll.c, -DVMW_HAVE_EPOLL, ) EXTRA_CFLAGS += $(call vm_check_build, $(SRCROOT)/autoconf/skas1.c, -DVMW_SKAS_MMAP, ) EXTRA_CFLAGS += $(call vm_check_build, $(SRCROOT)/autoconf/cachecreate.c, -DVMW_KMEMCR_HAS_DTOR, ) -EXTRA_CFLAGS += $(call vm_check_build, $(SRCROOT)/autoconf/cachector.c, -DVMW_KMEMCR_CTOR_HAS_3_ARGS, ) +EXTRA_CFLAGS += $(call vm_check_build, $(SRCROOT)/autoconf/cachector.c, -DVMW_KMEMCR_CTOR_HAS_3_ARGS, ) +EXTRA_CFLAGS += $(call vm_check_build, $(SRCROOT)/autoconf/cachector1.c, -DVMW_KMEMCR_CTOR_HAS_2_ARGS, ) # Note: These tests are inverted. EXTRA_CFLAGS += $(call vm_check_build, $(SRCROOT)/autoconf/getsb1.c, , -DVMW_GETSB_2618) @@ -38,5 +39,5 @@ clean: rm -rf $(wildcard $(DRIVER).mod.c $(DRIVER).ko .tmp_versions \ - Module.symvers Modules.symvers \ + Module.symvers Modules.symvers Module.markers modules.order \ $(foreach dir,./ linux/,$(addprefix $(dir),.*.cmd .*.o.flags *.o))) diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmci/autoconf/epoll.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/autoconf/epoll.c --- open-vm-tools-2008.01.23-74039/modules/linux/vmci/autoconf/epoll.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/autoconf/epoll.c 2008-10-13 08:01:41.000000000 +0100 @@ -0,0 +1,36 @@ +/********************************************************* + * Copyright (C) 2004 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * Detect whether we have 'struct poll_wqueues' + * 2.6.x kernels always had this struct. Stock 2.4.x kernels + * never had it, but some distros backported epoll patch. + */ + +#include <linux/autoconf.h> +#include <linux/version.h> + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0) +#include <linux/poll.h> + +void poll_test(void) { + struct poll_wqueues test; + + return poll_initwait(&test); +} +#endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmci/autoconf/geninclude.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/autoconf/geninclude.c --- open-vm-tools-2008.01.23-74039/modules/linux/vmci/autoconf/geninclude.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/autoconf/geninclude.c 2008-10-13 08:01:41.000000000 +0100 @@ -0,0 +1,40 @@ +/********************************************************* + * Copyright (C) 2003 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +#include <linux/autoconf.h> + +#ifdef CONFIG_X86_VOYAGER +APATH/mach-voyager +#endif +#ifdef CONFIG_X86_VISWS +APATH/mach-visws +#endif +#ifdef CONFIG_X86_NUMAQ +APATH/mach-numaq +#endif +#ifdef CONFIG_X86_BIGSMP +APATH/mach-bigsmp +#endif +#ifdef CONFIG_X86_SUMMIT +APATH/mach-summit +#endif +#ifdef CONFIG_X86_GENERICARCH +APATH/mach-generic +#endif +APATH/mach-default + diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmci/circList.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/circList.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmci/circList.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/circList.h 2008-10-13 08:01:41.000000000 +0100 @@ -0,0 +1,428 @@ +/********************************************************* + * Copyright (C) 1998 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * 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) \ + ((type *)((char *)(ptr) - offsetof(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_ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmci/compat_completion.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/compat_completion.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmci/compat_completion.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/compat_completion.h 2008-10-13 08:01:41.000000000 +0100 @@ -0,0 +1,175 @@ +/********************************************************* + * Copyright (C) 2004 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +#ifndef __COMPAT_COMPLETION_H__ +# define __COMPAT_COMPLETION_H__ + +/* + * The kernel's completion objects were made available for module use in 2.4.9. + * + * Between 2.4.0 and 2.4.9, we implement completions on our own using + * waitqueues and counters. This was done so that we could safely support + * functions like complete_all(), which cannot be implemented using semaphores. + * + * Prior to that, the waitqueue API is substantially different, and since none + * of our modules that are built against older kernels need complete_all(), + * we fallback on a simple semaphore-based implementation. + */ + +/* + * Native completions. + */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 9) + +#include <linux/completion.h> +#define compat_completion struct completion +#define compat_init_completion(comp) init_completion(comp) +#define COMPAT_DECLARE_COMPLETION DECLARE_COMPLETION +#define compat_wait_for_completion(comp) wait_for_completion(comp) +#define compat_complete(comp) complete(comp) + +/* complete_all() was exported in 2.6.6. */ +# if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 6) +# include "compat_wait.h" +# include "compat_list.h" +# include "compat_spinlock.h" +# include "compat_sched.h" +# define compat_complete_all(x) \ + ({ \ + struct list_head *currLinks; \ + spin_lock(&(x)->wait.lock); \ + (x)->done += UINT_MAX/2; \ + \ + list_for_each(currLinks, &(x)->wait.task_list) { \ + wait_queue_t *currQueue = list_entry(currLinks, wait_queue_t, task_list); \ + wake_up_process(currQueue->task); \ + } \ + spin_unlock(&(x)->wait.lock); \ + }) +# else +# define compat_complete_all complete_all +# endif + +/* + * Completions via waitqueues. + */ +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 0) + +/* + * Kernel completions in 2.4.9 and beyond use a counter and a waitqueue, and + * our implementation is quite similar. Because __wake_up_common() is not + * exported, our implementations of compat_complete() and compat_complete_all() + * are somewhat racy: the counter is incremented outside of the waitqueue's + * lock. + * + * As a result, our completion cannot guarantee in-order wake ups. For example, + * suppose thread A is entering compat_complete(), thread B is sleeping inside + * compat_wait_for_completion(), and thread C is just now entering + * compat_wait_for_completion(). If Thread A is scheduled first and increments + * the counter, then gets swapped out, thread C may get scheduled and will + * quickly go through compat_wait_for_completion() (since done != 0) while + * thread B continues to sleep, even though thread B should have been the one + * to wake up. + */ + +#include <asm/current.h> +#include "compat_sched.h" +#include "compat_list.h" +#include <linux/smp_lock.h> // for lock_kernel()/unlock_kernel() +#include "compat_wait.h" + +typedef struct compat_completion { + unsigned int done; + wait_queue_head_t wq; +} compat_completion; + +#define compat_init_completion(comp) do { \ + (comp)->done = 0; \ + init_waitqueue_head(&(comp)->wq); \ +} while (0) +#define COMPAT_DECLARE_COMPLETION(comp) \ + compat_completion comp = { \ + .done = 0, \ + .wq = __WAIT_QUEUE_HEAD_INITIALIZER((comp).wq), \ + } + +/* + * Locking and unlocking the kernel lock here ensures that the thread + * is no longer running in module code: compat_complete_and_exit + * performs the sequence { lock_kernel(); up(comp); compat_exit(); }, with + * the final unlock_kernel performed implicitly by the resident kernel + * in do_exit. + */ +#define compat_wait_for_completion(comp) do { \ + spin_lock_irq(&(comp)->wq.lock); \ + if (!(comp)->done) { \ + DECLARE_WAITQUEUE(wait, current); \ + wait.flags |= WQ_FLAG_EXCLUSIVE; \ + __add_wait_queue_tail(&(comp)->wq, &wait); \ + do { \ + __set_current_state(TASK_UNINTERRUPTIBLE); \ + spin_unlock_irq(&(comp)->wq.lock); \ + schedule(); \ + spin_lock_irq(&(comp)->wq.lock); \ + } while (!(comp)->done); \ + __remove_wait_queue(&(comp)->wq, &wait); \ + } \ + (comp)->done--; \ + spin_unlock_irq(&(comp)->wq.lock); \ + lock_kernel(); \ + unlock_kernel(); \ +} while (0) + +/* XXX: I don't think I need to touch the BKL. */ +#define compat_complete(comp) do { \ + unsigned long flags; \ + spin_lock_irqsave(&(comp)->wq.lock, flags); \ + (comp)->done++; \ + spin_unlock_irqrestore(&(comp)->wq.lock, flags); \ + wake_up(&(comp)->wq); \ +} while (0) + +#define compat_complete_all(comp) do { \ + unsigned long flags; \ + spin_lock_irqsave(&(comp)->wq.lock, flags); \ + (comp)->done += UINT_MAX / 2; \ + spin_unlock_irqrestore(&(comp)->wq.lock, flags); \ + wake_up_all(&(comp)->wq); \ +} while (0) + +/* + * Completions via semaphores. + */ +#else + +#include "compat_semaphore.h" +#define compat_completion struct semaphore +#define compat_init_completion(comp) init_MUTEX_LOCKED(comp) +#define COMPAT_DECLARE_COMPLETION(comp) DECLARE_MUTEX_LOCKED(comp) + +#define compat_wait_for_completion(comp) do { \ + down(comp); \ + lock_kernel(); \ + unlock_kernel(); \ +} while (0) + +#define compat_complete(comp) up(comp) + +#endif + +#endif /* __COMPAT_COMPLETION_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmci/compat_file.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/compat_file.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmci/compat_file.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/compat_file.h 2008-10-13 08:01:41.000000000 +0100 @@ -0,0 +1,56 @@ +/********************************************************* + * Copyright (C) 2002 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +#ifndef __COMPAT_FILE_H__ +# define __COMPAT_FILE_H__ + + +/* The fput() API is modified in 2.2.0 --hpreg */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 2, 0) +# define compat_fput(_file) fput(_file) +#else +# define compat_fput(_file) fput(_file, (_file)->f_inode) +#endif + + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 0) +# define compat_get_file(_file) get_file(_file) +# define compat_file_count(_file) file_count(_file) +#else +# define compat_get_file(_file) (_file)->f_count++ +# define compat_file_count(_file) (_file)->f_count +#endif + + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 2, 4) +# define compat_filp_close(_file, _files) filp_close(_file, _files) +#else +static inline void compat_filp_close(struct file* filp, fl_owner_t files) { + if (filp->f_op && filp->f_op->flush) { + filp->f_op->flush(filp); + } + /* + * Hopefully there are no locks to release on this filp. + * locks_remove_posix is not exported so we cannot use it... + */ + fput(filp); +} +#endif + + +#endif /* __COMPAT_FILE_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmci/compat_highmem.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/compat_highmem.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmci/compat_highmem.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/compat_highmem.h 2008-10-13 08:01:41.000000000 +0100 @@ -0,0 +1,40 @@ +/********************************************************* + * Copyright (C) 2002 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +#ifndef __COMPAT_HIGHMEM_H__ +# define __COMPAT_HIGHMEM_H__ + + +/* + * BIGMEM (4 GB) support appeared in 2.3.16: kmap() API added + * HIGHMEM (4 GB + 64 GB) support appeared in 2.3.23: kmap() API modified + * In 2.3.27, kmap() API modified again + * + * --hpreg + */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 3, 27) +# include <linux/highmem.h> +#else +/* For page_address --hpreg */ +# include <linux/pagemap.h> + +# define kmap(_page) (void*)page_address(_page) +# define kunmap(_page) +#endif + +#endif /* __COMPAT_HIGHMEM_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmci/compat_init.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/compat_init.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmci/compat_init.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/compat_init.h 2008-10-13 08:01:41.000000000 +0100 @@ -0,0 +1,38 @@ +/********************************************************* + * Copyright (C) 1999 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * compat_init.h: Initialization compatibility wrappers. + */ + +#ifndef __COMPAT_INIT_H__ +#define __COMPAT_INIT_H__ + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 2, 0) +#include <linux/init.h> +#endif + +#ifndef module_init +#define module_init(x) int init_module(void) { return x(); } +#endif + +#ifndef module_exit +#define module_exit(x) void cleanup_module(void) { x(); } +#endif + +#endif /* __COMPAT_INIT_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmci/compat_interrupt.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/compat_interrupt.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmci/compat_interrupt.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/compat_interrupt.h 2008-10-13 08:01:41.000000000 +0100 @@ -0,0 +1,55 @@ +/********************************************************* + * Copyright (C) 2003 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +#ifndef __COMPAT_INTERRUPT_H__ +# define __COMPAT_INTERRUPT_H__ + + +#include <linux/interrupt.h> + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 69) +/* + * We cannot just define irqreturn_t, as some 2.4.x kernels have + * typedef void irqreturn_t; for "increasing" backward compatibility. + */ +typedef void compat_irqreturn_t; +#define COMPAT_IRQ_NONE +#define COMPAT_IRQ_HANDLED +#define COMPAT_IRQ_RETVAL(x) +#else +typedef irqreturn_t compat_irqreturn_t; +#define COMPAT_IRQ_NONE IRQ_NONE +#define COMPAT_IRQ_HANDLED IRQ_HANDLED +#define COMPAT_IRQ_RETVAL(x) IRQ_RETVAL(x) +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18) +#define COMPAT_IRQF_DISABLED SA_INTERRUPT +#define COMPAT_IRQF_SHARED SA_SHIRQ +#else +#define COMPAT_IRQF_DISABLED IRQF_DISABLED +#define COMPAT_IRQF_SHARED IRQF_SHARED +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) +#define COMPAT_IRQ_HANDLER_ARGS(irq, devp) (int irq, void *devp, struct pt_regs *regs) +#else +#define COMPAT_IRQ_HANDLER_ARGS(irq, devp) (int irq, void *devp) +#endif + +#endif /* __COMPAT_INTERRUPT_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmci/compat_ioport.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/compat_ioport.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmci/compat_ioport.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/compat_ioport.h 2008-10-13 08:01:41.000000000 +0100 @@ -0,0 +1,63 @@ +/********************************************************* + * Copyright (C) 2003 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +#ifndef __COMPAT_IOPORT_H__ +# define __COMPAT_IOPORT_H__ + + +#include <linux/ioport.h> + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 0) +static inline void * +compat_request_region(unsigned long start, unsigned long len, const char *name) +{ + if (check_region(start, len)) { + return NULL; + } + request_region(start, len, name); + return (void*)1; +} +#else +#define compat_request_region(start, len, name) request_region(start, len, name) +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 3, 7) +/* mmap io support starts from 2.3.7, fail the call for kernel prior to that */ +static inline void * +compat_request_mem_region(unsigned long start, unsigned long len, const char *name) +{ + return NULL; +} + +static inline void +compat_release_mem_region(unsigned long start, unsigned long len) +{ + return; +} +#else +#define compat_request_mem_region(start, len, name) request_mem_region(start, len, name) +#define compat_release_mem_region(start, len) release_mem_region(start, len) +#endif + +/* these two macro defs are needed by compat_pci_request_region */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 3, 15) +# define IORESOURCE_IO 0x00000100 +# define IORESOURCE_MEM 0x00000200 +#endif + +#endif /* __COMPAT_IOPORT_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmci/compat_kernel.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/compat_kernel.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmci/compat_kernel.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/compat_kernel.h 2008-10-13 08:01:41.000000000 +0100 @@ -0,0 +1,83 @@ +/********************************************************* + * Copyright (C) 2004 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +#ifndef __COMPAT_KERNEL_H__ +# define __COMPAT_KERNEL_H__ + +#include <asm/unistd.h> +#include <linux/kernel.h> + +/* + * container_of was introduced in 2.5.28 but it's easier to check like this. + */ +#ifndef container_of +#define container_of(ptr, type, member) ({ \ + const typeof( ((type *)0)->member ) *__mptr = (ptr); \ + (type *)( (char *)__mptr - offsetof(type,member) );}) +#endif + +/* + * wait_for_completion and friends did not exist before 2.4.9. + */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 9) + +#define compat_complete_and_exit(comp, status) complete_and_exit(comp, status) + +#else + +#include "compat_completion.h" + +/* + * Used by _syscallX macros. Note that this is global variable, so + * do not rely on its contents too much. As exit() is only function + * we use, and we never check return value from exit(), we have + * no problem... + */ +extern int errno; + +/* + * compat_exit() provides an access to the exit() function. It must + * be named compat_exit(), as exit() (with different signature) is + * provided by x86-64, arm and other (but not by i386). + */ +#define __NR_compat_exit __NR_exit +static inline _syscall1(int, compat_exit, int, exit_code); + +/* + * See compat_wait_for_completion in compat_completion.h. + * compat_exit implicitly performs an unlock_kernel, in resident code, + * ensuring that the thread is no longer running in module code when the + * module is unloaded. + */ +#define compat_complete_and_exit(comp, status) do { \ + lock_kernel(); \ + compat_complete(comp); \ + compat_exit(status); \ +} while (0) + +#endif + +/* + * vsnprintf became available in 2.4.10. For older kernels, just fall back on + * vsprintf. + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 10) +#define vsnprintf(str, size, fmt, args) vsprintf(str, fmt, args) +#endif + +#endif /* __COMPAT_KERNEL_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmci/compat_list.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/compat_list.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmci/compat_list.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/compat_list.h 2008-10-13 08:01:41.000000000 +0100 @@ -0,0 +1,55 @@ +/********************************************************* + * Copyright (C) 2006 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +#ifndef __COMPAT_LIST_H__ +# define __COMPAT_LIST_H__ + +#include <linux/list.h> + +/* + * list_add_tail is with us since 2.4.0, or something like that. + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 0) +#define list_add_tail(newe, head) do { \ + struct list_head *__h = (head); \ + __list_add((newe), __h->prev, __h); \ +} while (0) +#endif + +/* + * list_for_each_safe() showed up in 2.4.10, but it may be backported so we + * just check for its existence. + */ +#ifndef list_for_each_safe +# define list_for_each_safe(pos, n, head) \ + for (pos = (head)->next, n = pos->next; pos != (head); \ + pos = n, n = pos->next) +#endif + +/* + * list_for_each_entry() showed up in 2.4.20, but it may be backported so we + * just check for its existence. + */ +#ifndef list_for_each_entry +# define list_for_each_entry(pos, head, member) \ + for (pos = list_entry((head)->next, typeof(*pos), member); \ + &pos->member != (head); \ + pos = list_entry(pos->member.next, typeof(*pos), member)) +#endif + +#endif /* __COMPAT_LIST_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmci/compat_mm.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/compat_mm.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmci/compat_mm.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/compat_mm.h 2008-10-13 08:01:41.000000000 +0100 @@ -0,0 +1,134 @@ +/********************************************************* + * Copyright (C) 2002 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +#ifndef __COMPAT_MM_H__ +# define __COMPAT_MM_H__ + + +#include <linux/mm.h> + + +/* The get_page() API appeared in 2.3.7 --hpreg */ +/* Sometime during development it became function instead of macro --petr */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 0) && !defined(get_page) +# define get_page(_page) atomic_inc(&(_page)->count) +/* The __free_page() API is exported in 2.1.67 --hpreg */ +# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 1, 67) +# define put_page __free_page +# else +# include "compat_page.h" + +# define page_to_phys(_page) (page_to_pfn(_page) << PAGE_SHIFT) +# define put_page(_page) free_page(page_to_phys(_page)) +# endif +#endif + + +/* page_count() is 2.4.0 invention. Unfortunately unavailable in some RedHat + * kernels (for example 2.4.21-4-RHEL3). */ +/* It is function since 2.6.0, and hopefully RedHat will not play silly games + * with mm_inline.h again... */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0) && !defined(page_count) +# define page_count(page) atomic_read(&(page)->count) +#endif + + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 0) +# define compat_vm_pgoff(vma) ((vma)->vm_offset >> PAGE_SHIFT) + +static inline unsigned long compat_do_mmap_pgoff(struct file *file, unsigned long addr, + unsigned long len, unsigned long prot, + unsigned long flag, unsigned long pgoff) +{ + unsigned long ret = -EINVAL; + + if (pgoff < 1 << (32 - PAGE_SHIFT)) { + ret = do_mmap(file, addr, len, prot, flag, pgoff << PAGE_SHIFT); + } + return ret; +} + +#else +# define compat_vm_pgoff(vma) (vma)->vm_pgoff +# ifdef VMW_SKAS_MMAP +# define compat_do_mmap_pgoff(f, a, l, p, g, o) \ + do_mmap_pgoff(current->mm, f, a, l, p, g, o) +# else +# define compat_do_mmap_pgoff(f, a, l, p, g, o) \ + do_mmap_pgoff(f, a, l, p, g, o) +# endif +#endif + + +/* 2.2.x uses 0 instead of some define */ +#ifndef NOPAGE_SIGBUS +#define NOPAGE_SIGBUS (0) +#endif + + +/* 2.2.x does not have HIGHMEM support */ +#ifndef GFP_HIGHUSER +#define GFP_HIGHUSER (GFP_USER) +#endif + + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 0) + +#include "compat_page.h" + +static inline struct page * alloc_pages(unsigned int gfp_mask, unsigned int order) +{ + unsigned long addr; + + addr = __get_free_pages(gfp_mask, order); + if (!addr) { + return NULL; + } + return virt_to_page(addr); +} +#define alloc_page(gfp_mask) alloc_pages(gfp_mask, 0) + +#endif + +/* + * In 2.4.14, the logic behind the UnlockPage macro was moved to the + * unlock_page() function. Later (in 2.5.12), the UnlockPage macro was removed + * altogether, and nowadays everyone uses unlock_page(). + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 14) +#define compat_unlock_page(page) UnlockPage(page) +#else +#define compat_unlock_page(page) unlock_page(page) +#endif + +/* + * In 2.4.10, vmtruncate was changed from returning void to returning int. + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 10) +#define compat_vmtruncate(inode, size) \ +({ \ + int result = 0; \ + vmtruncate(inode, size); \ + result; \ +}) +#else +#define compat_vmtruncate(inode, size) vmtruncate(inode, size) +#endif + + +#endif /* __COMPAT_MM_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmci/compat_module.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/compat_module.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmci/compat_module.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/compat_module.h 2008-10-13 08:01:41.000000000 +0100 @@ -0,0 +1,72 @@ +/********************************************************* + * Copyright (C) 2007 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * compat_module.h -- + */ + +#ifndef __COMPAT_MODULE_H__ +# define __COMPAT_MODULE_H__ + + +#include <linux/module.h> + + +/* + * Modules wishing to use the GPL license are required to include a + * MODULE_LICENSE definition in their module source as of 2.4.10. + */ +#ifndef MODULE_LICENSE +#define MODULE_LICENSE(license) +#endif + +/* + * To make use of our own home-brewed MODULE_INFO, we need macros to + * concatenate two expressions to "__mod_", and and to convert an + * expression into a string. I'm sure we've got these in our codebase, + * but I'd rather not introduce such a dependency in a compat header. + */ +#ifndef __module_cat +#define __module_cat_1(a, b) __mod_ ## a ## b +#define __module_cat(a, b) __module_cat_1(a, b) +#endif + +#ifndef __stringify +#define __stringify_1(x) #x +#define __stringify(x) __stringify_1(x) +#endif + +/* + * MODULE_INFO was born in 2.5.69. + */ +#ifndef MODULE_INFO +#define MODULE_INFO(tag, info) \ +static const char __module_cat(tag, __LINE__)[] \ + __attribute__((section(".modinfo"), unused)) = __stringify(tag) "=" info +#endif + +/* + * MODULE_VERSION was born in 2.6.4. The earlier form appends a long "\0xxx" + * string to the module's version, but that was removed in 2.6.10, so we'll + * ignore it in our wrapper. + */ +#ifndef MODULE_VERSION +#define MODULE_VERSION(_version) MODULE_INFO(version, _version) +#endif + +#endif /* __COMPAT_MODULE_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmci/compat_page.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/compat_page.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmci/compat_page.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/compat_page.h 2008-10-13 08:01:41.000000000 +0100 @@ -0,0 +1,75 @@ +/********************************************************* + * Copyright (C) 2002 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +#ifndef __COMPAT_PAGE_H__ +# define __COMPAT_PAGE_H__ + + +#include <linux/mm.h> +#include <asm/page.h> + + +/* The pfn_to_page() API appeared in 2.5.14 and changed to function during 2.6.x */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0) && !defined(pfn_to_page) +# define pfn_to_page(_pfn) (mem_map + (_pfn)) +# define page_to_pfn(_page) ((_page) - mem_map) +#endif + + +/* The virt_to_page() API appeared in 2.4.0 --hpreg */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 0) && !defined(virt_to_page) +# define virt_to_page(_kvAddr) pfn_to_page(MAP_NR(_kvAddr)) +#endif + + +/* + * The get_order() API appeared at some point in 2.3.x, and was then backported + * in 2.2.17-21mdk and in the stock 2.2.18. Because we can only detect its + * definition through makefile tricks, we provide our own for now --hpreg + */ +static inline int +compat_get_order(unsigned long size) // IN +{ + int order; + + size = (size - 1) >> (PAGE_SHIFT - 1); + order = -1; + do { + size >>= 1; + order++; + } while (size); + + return order; +} + +/* + * BUG() was added to <asm/page.h> in 2.2.18, and was moved to <asm/bug.h> + * in 2.5.58. + * + * XXX: Technically, this belongs in some sort of "compat_asm_page.h" file, but + * since our compatibility wrappers don't distinguish between <asm/xxx.h> and + * <linux/xxx.h>, putting it here is reasonable. + */ +#ifndef BUG +#define BUG() do { \ + printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \ + __asm__ __volatile__(".byte 0x0f,0x0b"); \ +} while (0) +#endif + +#endif /* __COMPAT_PAGE_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmci/compat_pci.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/compat_pci.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmci/compat_pci.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/compat_pci.h 2008-10-13 08:01:41.000000000 +0100 @@ -0,0 +1,590 @@ +/********************************************************* + * Copyright (C) 1999 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * compat_pci.h: PCI compatibility wrappers. + */ + +#ifndef __COMPAT_PCI_H__ +#define __COMPAT_PCI_H__ + +#include "compat_ioport.h" +#include <linux/pci.h> +#ifndef KERNEL_2_1 +# include <linux/bios32.h> +#endif + + +/* 2.0.x has useless struct pci_dev; remap it to our own */ +#ifndef KERNEL_2_1 +#define pci_dev vmw_pci_driver_instance +#endif + + +/* 2.0/2.2 does not have pci driver API */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 0) +struct vmw_pci_driver_instance { + struct vmw_pci_driver_instance *next; + void *driver_data; + struct pci_driver *pcidrv; +#ifdef KERNEL_2_1 + struct pci_dev *pcidev; +#else + unsigned char bus; + unsigned char devfn; + unsigned int irq; +#endif +}; +#endif + + +/* 2.0 has pcibios_* calls only... We have to provide pci_* compatible wrappers. */ +#ifndef KERNEL_2_1 +static inline int +pci_read_config_byte(struct pci_dev *pdev, // IN: PCI slot + unsigned char where, // IN: Byte to read + u8 *value) // OUT: Value read +{ + return pcibios_read_config_byte(pdev->bus, pdev->devfn, where, value); +} + +static inline int +pci_read_config_dword(struct pci_dev *pdev, // IN: PCI slot + unsigned char where, // IN: Dword to read + u32 *value) // OUT: Value read +{ + return pcibios_read_config_dword(pdev->bus, pdev->devfn, where, value); +} + +static inline int +pci_write_config_dword(struct pci_dev *pdev, // IN: PCI slot + unsigned char where, // IN: Dword to write + u32 value) // IN: Value to write +{ + return pcibios_write_config_dword(pdev->bus, pdev->devfn, where, value); +} +#endif + + +/* + *----------------------------------------------------------------------------- + * + * compat_pci_name -- + * + * Return human readable PCI slot name. Note that some implementations + * return a pointer to the static storage, so returned value may be + * overwritten by subsequent calls to this function. + * + * Results: + * Returns pointer to the string with slot name. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 22) +#define compat_pci_name(pdev) pci_name(pdev) +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 0) +#define compat_pci_name(pdev) (pdev)->slot_name +#elif defined(KERNEL_2_1) +static inline const char* +compat_pci_name(struct pci_dev* pdev) +{ + static char slot_name[12]; + sprintf(slot_name, "%02X:%02X.%X", pdev->bus->number, + PCI_SLOT(pdev->devfn), PCI_FUNC(pdev->devfn)); + return slot_name; +} +#else +static inline const char* +compat_pci_name(struct pci_dev* pdev) +{ + static char slot_name[12]; + sprintf(slot_name, "%02X:%02X.%X", pdev->bus, + PCI_SLOT(pdev->devfn), PCI_FUNC(pdev->devfn)); + return slot_name; +} +#endif + + +/* pci_resource_start comes in 4 flavors - 2.0, 2.2, early 2.3, 2.4+ */ +#ifndef KERNEL_2_1 +static inline unsigned long +compat_pci_resource_start(struct pci_dev *pdev, + unsigned int index) +{ + u32 addr; + + if (pci_read_config_dword(pdev, PCI_BASE_ADDRESS_0 + index * 4, &addr)) { + printk(KERN_ERR "Unable to read base address %u from PCI slot %s!\n", + index, compat_pci_name(pdev)); + return ~0UL; + } + if (addr & PCI_BASE_ADDRESS_SPACE) { + return addr & PCI_BASE_ADDRESS_IO_MASK; + } else { + return addr & PCI_BASE_ADDRESS_MEM_MASK; + } +} +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 3, 1) +# define compat_pci_resource_start(dev, index) \ + (((dev)->base_address[index] & PCI_BASE_ADDRESS_SPACE) \ + ? ((dev)->base_address[index] & PCI_BASE_ADDRESS_IO_MASK) \ + : ((dev)->base_address[index] & PCI_BASE_ADDRESS_MEM_MASK)) +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 3, 43) +# define compat_pci_resource_start(dev, index) \ + ((dev)->resource[index].start) +#else +# define compat_pci_resource_start(dev, index) \ + pci_resource_start(dev, index) +#endif + +/* since 2.3.15, a new set of s/w res flags IORESOURCE_ is introduced, + * we fake them by returning either IORESOURCE_{IO, MEM} prior to 2.3.15 since + * this is what compat_pci_request_region uses + */ +#ifndef KERNEL_2_1 +static inline unsigned long +compat_pci_resource_flags(struct pci_dev *pdev, + unsigned int index) +{ + u32 addr; + + if (pci_read_config_dword(pdev, PCI_BASE_ADDRESS_0 + index * 4, &addr)) { + printk(KERN_ERR "Unable to read base address %u from PCI slot %s!\n", + index, compat_pci_name(pdev)); + return ~0UL; + } + if (addr & PCI_BASE_ADDRESS_SPACE) { + return IORESOURCE_IO; + } else { + return IORESOURCE_MEM; + } +} +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 3, 1) +# define compat_pci_resource_flags(dev, index) \ + (((dev)->base_address[index] & PCI_BASE_ADDRESS_SPACE) \ + ? IORESOURCE_IO: IORESOURCE_MEM) +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 3, 15) + /* IORESOURCE_xxx appeared in 2.3.15 and is set in resource[].flags */ +# define compat_pci_resource_flags(dev, index) ((dev)->resource[index].flags) +#else +# define compat_pci_resource_flags(dev, index) pci_resource_flags(dev, index) +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 2, 18) +static inline unsigned long +compat_pci_resource_len(struct pci_dev *pdev, // IN + unsigned int index) // IN +{ + u32 addr, mask; + unsigned char reg = PCI_BASE_ADDRESS_0 + index * 4; + + if (pci_read_config_dword(pdev, reg, &addr) || addr == 0xFFFFFFFF) { + return 0; + } + + pci_write_config_dword(pdev, reg, 0xFFFFFFFF); + pci_read_config_dword(pdev, reg, &mask); + pci_write_config_dword(pdev, reg, addr); + + if (mask == 0 || mask == 0xFFFFFFFF) { + return 0; + } + if (addr & PCI_BASE_ADDRESS_SPACE) { + return 65536 - (mask & PCI_BASE_ADDRESS_IO_MASK & 0xFFFF); + } else { + return -(mask & PCI_BASE_ADDRESS_MEM_MASK); + } +} +#else +#define compat_pci_resource_len(dev, index) pci_resource_len(dev, index) +#endif + +/* pci_request_region appears in 2.4.20 */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 20) +static inline int +compat_pci_request_region(struct pci_dev *pdev, int bar, char *name) +{ + if (compat_pci_resource_len(pdev, bar) == 0) { + return 0; + } + + if (compat_pci_resource_flags(pdev, bar) & IORESOURCE_IO) { + if (!compat_request_region(compat_pci_resource_start(pdev, bar), + compat_pci_resource_len(pdev, bar), + name)) { + return -EBUSY; + } + } else if (compat_pci_resource_flags(pdev, bar) & IORESOURCE_MEM) { + if (!compat_request_mem_region(compat_pci_resource_start(pdev, bar), + compat_pci_resource_len(pdev, bar), + name)) { + return -EBUSY; + } + } + + return 0; +} + +static inline void +compat_pci_release_region(struct pci_dev *pdev, int bar) +{ + if (compat_pci_resource_len(pdev, bar) != 0) { + if (compat_pci_resource_flags(pdev, bar) & IORESOURCE_IO) { + release_region(compat_pci_resource_start(pdev, bar), + compat_pci_resource_len(pdev, bar)); + } else if (compat_pci_resource_flags(pdev, bar) & IORESOURCE_MEM) { + compat_release_mem_region(compat_pci_resource_start(pdev, bar), + compat_pci_resource_len(pdev, bar)); + } + } +} +#else +#define compat_pci_request_region(pdev, bar, name) pci_request_region(pdev, bar, name) +#define compat_pci_release_region(pdev, bar) pci_release_region(pdev, bar) +#endif + +/* pci_request_regions appeears in 2.4.3 */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 3) +static inline int +compat_pci_request_regions(struct pci_dev *pdev, char *name) +{ + int i; + + for (i = 0; i < 6; i++) { + if (compat_pci_request_region(pdev, i, name)) { + goto release; + } + } + return 0; + +release: + while (--i >= 0) { + compat_pci_release_region(pdev, i); + } + return -EBUSY; +} +static inline void +compat_pci_release_regions(struct pci_dev *pdev) +{ + int i; + + for (i = 0; i < 6; i++) { + compat_pci_release_region(pdev, i); + } +} +#else +#define compat_pci_request_regions(pdev, name) pci_request_regions(pdev, name) +#define compat_pci_release_regions(pdev) pci_release_regions(pdev) +#endif + +/* pci_enable_device is available since 2.4.0 */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 0) +#define compat_pci_enable_device(pdev) (0) +#else +#define compat_pci_enable_device(pdev) pci_enable_device(pdev) +#endif + + +/* pci_set_master is available since 2.2.0 */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 2, 0) +#define compat_pci_set_master(pdev) (0) +#else +#define compat_pci_set_master(pdev) pci_set_master(pdev) +#endif + + +/* pci_disable_device is available since 2.4.4 */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 4) +#define compat_pci_disable_device(pdev) do {} while (0) +#else +#define compat_pci_disable_device(pdev) pci_disable_device(pdev) +#endif + + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 0) +/* + * Devices supported by particular pci driver. While 2.4+ kernels + * can do match on subsystem and class too, we support match on + * vendor/device IDs only. + */ +struct pci_device_id { + unsigned int vendor, device; + unsigned long driver_data; +}; +#define PCI_DEVICE(vend, dev) .vendor = (vend), .device = (dev) + +/* PCI driver */ +struct pci_driver { + const char *name; + const struct pci_device_id *id_table; + int (*probe)(struct pci_dev* dev, const struct pci_device_id* id); + void (*remove)(struct pci_dev* dev); +}; + + +/* + * Note that this is static variable. Maybe everything below should be in + * separate compat_pci.c file, but currently only user of this file is vmxnet, + * and vmxnet has only one file, so it is fine. Also with vmxnet all + * functions below are called just once, so difference between 'inline' and + * separate compat_pci.c should be very small. + */ + +static struct vmw_pci_driver_instance *pci_driver_instances = NULL; + +#ifdef KERNEL_2_1 +#define vmw_pci_device(instance) (instance)->pcidev +#else +#define vmw_pci_device(instance) (instance) +#endif + + +/* + *----------------------------------------------------------------------------- + * + * pci_register_driver -- + * + * Create driver instances for all matching PCI devices in the box. + * + * Results: + * Returns 0 for success, negative error value for failure. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static inline int +pci_register_driver(struct pci_driver *drv) +{ + const struct pci_device_id *chipID; + + for (chipID = drv->id_table; chipID->vendor; chipID++) { +#ifdef KERNEL_2_1 + struct pci_dev *pdev; + + for (pdev = NULL; + (pdev = pci_find_device(chipID->vendor, chipID->device, pdev)) != NULL; ) { +#else + int adapter; + unsigned char bus, devfn, irq; + + for (adapter = 0; + pcibios_find_device(chipID->vendor, chipID->device, adapter, + &bus, &devfn) == 0; + adapter++) { +#endif + struct vmw_pci_driver_instance *pdi; + int err; + + pdi = kmalloc(sizeof *pdi, GFP_KERNEL); + if (!pdi) { + printk(KERN_ERR "Not enough memory.\n"); + break; + } + pdi->pcidrv = drv; +#ifdef KERNEL_2_1 + pdi->pcidev = pdev; +#else + pdi->bus = bus; + pdi->devfn = devfn; + if (pci_read_config_byte(pdi, PCI_INTERRUPT_LINE, &irq)) { + pdi->irq = -1; + } else { + pdi->irq = irq; + } +#endif + pdi->driver_data = NULL; + pdi->next = pci_driver_instances; + pci_driver_instances = pdi; + err = drv->probe(vmw_pci_device(pdi), chipID); + if (err) { + pci_driver_instances = pdi->next; + kfree(pdi); + } + } + } + return 0; +} + + +/* + *----------------------------------------------------------------------------- + * + * compat_pci_unregister_driver -- + * + * Shut down PCI driver - unbind all device instances from driver. + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static inline void +pci_unregister_driver(struct pci_driver *drv) +{ + struct vmw_pci_driver_instance **ppdi; + + ppdi = &pci_driver_instances; + while (1) { + struct vmw_pci_driver_instance *pdi = *ppdi; + + if (!pdi) { + break; + } + if (pdi->pcidrv == drv) { + drv->remove(vmw_pci_device(pdi)); + *ppdi = pdi->next; + kfree(pdi); + } else { + ppdi = &pdi->next; + } + } +} +#else +/* provide PCI_DEVICE for early 2.4.x kernels */ +#ifndef PCI_DEVICE +#define PCI_DEVICE(vend, dev) .vendor = (vend), .device = (dev), \ + .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID +#endif +#endif + + +/* provide dummy MODULE_DEVICE_TABLE for 2.0/2.2 */ +#ifndef MODULE_DEVICE_TABLE +#define MODULE_DEVICE_TABLE(bus, devices) +#endif + + +/* + *----------------------------------------------------------------------------- + * + * pci_set_drvdata -- + * + * Set per-device driver's private data. + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +/* + *----------------------------------------------------------------------------- + * + * pci_get_drvdata -- + * + * Retrieve per-device driver's private data. + * + * Results: + * per-device driver's data previously set by pci_set_drvdata, + * or NULL on failure. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +#ifndef KERNEL_2_1 +/* 2.0.x is simple, we have driver_data directly in pci_dev */ +#define pci_set_drvdata(pdev, data) do { (pdev)->driver_data = (data); } while (0) +#define pci_get_drvdata(pdev) (pdev)->driver_data +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 0) +/* 2.2.x is trickier, we have to find driver instance first */ +static inline void +pci_set_drvdata(struct pci_dev *pdev, void* data) +{ + struct vmw_pci_driver_instance *pdi; + + for (pdi = pci_driver_instances; pdi; pdi = pdi->next) { + if (pdi->pcidev == pdev) { + pdi->driver_data = data; + return; + } + } + printk(KERN_ERR "pci_set_drvdata issued for unknown device %p\n", pdev); +} + +static inline void * +pci_get_drvdata(struct pci_dev *pdev) +{ + struct vmw_pci_driver_instance *pdi; + + for (pdi = pci_driver_instances; pdi; pdi = pdi->next) { + if (pdi->pcidev == pdev) { + return pdi->driver_data; + } + } + printk(KERN_ERR "pci_get_drvdata issued for unknown device %p\n", pdev); + return NULL; +} +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,48) +# define PCI_DMA_BIDIRECTIONAL 0 +# define PCI_DMA_TODEVICE 1 +# define PCI_DMA_FROMDEVICE 2 +# define PCI_DMA_NONE 3 +#endif + +/* + * Power Management related compat wrappers. + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 10) +# define compat_pci_save_state(pdev) pci_save_state((pdev), NULL) +# define compat_pci_restore_state(pdev) pci_restore_state((pdev), NULL) +#else +# define compat_pci_save_state(pdev) pci_save_state((pdev)) +# define compat_pci_restore_state(pdev) pci_restore_state((pdev)) +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 11) +# define pm_message_t u32 +# define compat_pci_choose_state(pdev, state) (state) +# define PCI_D0 0 +# define PCI_D3hot 3 +#else +# define compat_pci_choose_state(pdev, state) pci_choose_state((pdev), (state)) +#endif + +/* 2.6.14 changed the PCI shutdown callback */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14) +# define COMPAT_PCI_SHUTDOWN(func) .driver = { .shutdown = (func), } +# define COMPAT_PCI_DECLARE_SHUTDOWN(func, var) (func)(struct device *(var)) +# define COMPAT_PCI_TO_DEV(dev) (to_pci_dev(dev)) +#else +# define COMPAT_PCI_SHUTDOWN(func) .shutdown = (func) +# define COMPAT_PCI_DECLARE_SHUTDOWN(func, var) (func)(struct pci_dev *(var)) +# define COMPAT_PCI_TO_DEV(dev) (dev) +#endif + + +#endif /* __COMPAT_PCI_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmci/compat_pgtable.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/compat_pgtable.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmci/compat_pgtable.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/compat_pgtable.h 2008-10-13 08:01:41.000000000 +0100 @@ -0,0 +1,139 @@ +/********************************************************* + * Copyright (C) 2002 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +#ifndef __COMPAT_PGTABLE_H__ +# define __COMPAT_PGTABLE_H__ + + +#if defined(CONFIG_PARAVIRT) && defined(CONFIG_HIGHPTE) +# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 21) +# include <asm/paravirt.h> +# undef paravirt_map_pt_hook +# define paravirt_map_pt_hook(type, va, pfn) do {} while (0) +# endif +#endif +#include <asm/pgtable.h> + + +/* pte_page() API modified in 2.3.23 to return a struct page * --hpreg */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 3, 23) +# define compat_pte_page pte_page +#else +# include "compat_page.h" + +# define compat_pte_page(_pte) virt_to_page(pte_page(_pte)) +#endif + + +/* Appeared in 2.5.5 --hpreg */ +#ifndef pte_offset_map +/* Appeared in SuSE 8.0's 2.4.18 --hpreg */ +# ifdef pte_offset_atomic +# define pte_offset_map pte_offset_atomic +# define pte_unmap pte_kunmap +# else +# define pte_offset_map pte_offset +# define pte_unmap(_pte) +# endif +#endif + + +/* Appeared in 2.5.74-mmX --petr */ +#ifndef pmd_offset_map +# define pmd_offset_map(pgd, address) pmd_offset(pgd, address) +# define pmd_unmap(pmd) +#endif + + +/* + * Appeared in 2.6.10-rc2-mm1. Older kernels did L4 page tables as + * part of pgd_offset, or they did not have L4 page tables at all. + * In 2.6.11 pml4 -> pgd -> pmd -> pte hierarchy was replaced by + * pgd -> pud -> pmd -> pte hierarchy. + */ +#ifdef PUD_MASK +# define compat_pgd_offset(mm, address) pgd_offset(mm, address) +# define compat_pgd_present(pgd) pgd_present(pgd) +# define compat_pud_offset(pgd, address) pud_offset(pgd, address) +# define compat_pud_present(pud) pud_present(pud) +typedef pgd_t compat_pgd_t; +typedef pud_t compat_pud_t; +#elif defined(pml4_offset) +# define compat_pgd_offset(mm, address) pml4_offset(mm, address) +# define compat_pgd_present(pml4) pml4_present(pml4) +# define compat_pud_offset(pml4, address) pml4_pgd_offset(pml4, address) +# define compat_pud_present(pgd) pgd_present(pgd) +typedef pml4_t compat_pgd_t; +typedef pgd_t compat_pud_t; +#else +# define compat_pgd_offset(mm, address) pgd_offset(mm, address) +# define compat_pgd_present(pgd) pgd_present(pgd) +# define compat_pud_offset(pgd, address) (pgd) +# define compat_pud_present(pud) (1) +typedef pgd_t compat_pgd_t; +typedef pgd_t compat_pud_t; +#endif + + +#define compat_pgd_offset_k(mm, address) pgd_offset_k(address) + + +/* Introduced somewhere in 2.6.0, + backported to some 2.4 RedHat kernels */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0) && !defined(pte_pfn) +# define pte_pfn(pte) page_to_pfn(compat_pte_page(pte)) +#endif + + +/* A page_table_lock field is added to struct mm_struct in 2.3.10 --hpreg */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 3, 10) +# define compat_get_page_table_lock(_mm) (&(_mm)->page_table_lock) +#else +# define compat_get_page_table_lock(_mm) NULL +#endif + + +/* + * Define VM_PAGE_KERNEL_EXEC for vmapping executable pages. + * + * On ia32 PAGE_KERNEL_EXEC was introduced in 2.6.8.1. Unfortunately it accesses + * __PAGE_KERNEL_EXEC which is not exported for modules. So we use + * __PAGE_KERNEL and just cut _PAGE_NX bit from it. + * + * For ia32 kernels before 2.6.8.1 we use PAGE_KERNEL directly, these kernels + * do not have noexec support. + * + * On x86-64 situation is a bit better: they always supported noexec, but + * before 2.6.8.1 flag was named PAGE_KERNEL_EXECUTABLE, and it was renamed + * to PAGE_KERNEL_EXEC when ia32 got noexec too (see above). + */ +#ifdef CONFIG_X86 +#ifdef _PAGE_NX +#define VM_PAGE_KERNEL_EXEC __pgprot(__PAGE_KERNEL & ~_PAGE_NX) +#else +#define VM_PAGE_KERNEL_EXEC PAGE_KERNEL +#endif +#else +#ifdef PAGE_KERNEL_EXECUTABLE +#define VM_PAGE_KERNEL_EXEC PAGE_KERNEL_EXECUTABLE +#else +#define VM_PAGE_KERNEL_EXEC PAGE_KERNEL_EXEC +#endif +#endif + + +#endif /* __COMPAT_PGTABLE_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmci/compat_sched.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/compat_sched.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmci/compat_sched.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/compat_sched.h 2008-10-13 08:01:41.000000000 +0100 @@ -0,0 +1,291 @@ +/********************************************************* + * Copyright (C) 2002 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +#ifndef __COMPAT_SCHED_H__ +# define __COMPAT_SCHED_H__ + + +#include <linux/sched.h> + +/* CLONE_KERNEL available in 2.5.35 and higher. */ +#ifndef CLONE_KERNEL +#define CLONE_KERNEL CLONE_FILES | CLONE_FS | CLONE_SIGHAND +#endif + +/* TASK_COMM_LEN become available in 2.6.11. */ +#ifndef TASK_COMM_LEN +#define TASK_COMM_LEN 16 +#endif + +/* The capable() API appeared in 2.1.92 --hpreg */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 1, 92) +# define capable(_capability) suser() +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 2, 0) +# define need_resched() need_resched +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 3) +# define need_resched() (current->need_resched) +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 3) +# define cond_resched() (need_resched() ? schedule() : (void) 0) +#endif + +/* Oh well. We need yield... Happy us! */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 20) +# ifdef __x86_64__ +# define compat_yield() there_is_nothing_like_yield() +# else +# include <linux/unistd.h> +# include <linux/kernel.h> + +/* + * Used by _syscallX macros. Note that this is global variable, so + * do not rely on its contents too much. As exit() is only function + * we use, and we never check return value from exit(), we have + * no problem... + */ +extern int errno; + +/* + * compat_exit() provides an access to the exit() function. It must + * be named compat_exit(), as exit() (with different signature) is + * provided by x86-64, arm and other (but not by i386). + */ +# define __NR_compat_yield __NR_sched_yield +static inline _syscall0(int, compat_yield); +# endif +#else +# define compat_yield() yield() +#endif + + +/* + * Since 2.5.34 there are two methods to enumerate tasks: + * for_each_process(p) { ... } which enumerates only tasks and + * do_each_thread(g,t) { ... } while_each_thread(g,t) which enumerates + * also threads even if they share same pid. + */ +#ifndef for_each_process +# define for_each_process(p) for_each_task(p) +#endif + +#ifndef do_each_thread +# define do_each_thread(g, t) for_each_task(g) { t = g; do +# define while_each_thread(g, t) while (0) } +#endif + + +/* + * Lock for signal mask is moving target... + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 40) && defined(CLONE_PID) +/* 2.4.x without NPTL patches or early 2.5.x */ +#define compat_sigmask_lock sigmask_lock +#define compat_dequeue_signal_current(siginfo_ptr) \ + dequeue_signal(¤t->blocked, (siginfo_ptr)) +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 60) && !defined(INIT_SIGHAND) +/* RedHat's 2.4.x with first version of NPTL support, or 2.5.40 to 2.5.59 */ +#define compat_sigmask_lock sig->siglock +#define compat_dequeue_signal_current(siginfo_ptr) \ + dequeue_signal(¤t->blocked, (siginfo_ptr)) +#else +/* RedHat's 2.4.x with second version of NPTL support, or 2.5.60+. */ +#define compat_sigmask_lock sighand->siglock +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0) +#define compat_dequeue_signal_current(siginfo_ptr) \ + dequeue_signal(¤t->blocked, (siginfo_ptr)) +#else +#define compat_dequeue_signal_current(siginfo_ptr) \ + dequeue_signal(current, ¤t->blocked, (siginfo_ptr)) +#endif +#endif + +/* + * recalc_sigpending() had task argument in the past + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 29) && defined(CLONE_PID) +/* 2.4.x without NPTL patches or early 2.5.x */ +#define compat_recalc_sigpending() recalc_sigpending(current) +#else +/* RedHat's 2.4.x with NPTL support, or 2.5.29+ */ +#define compat_recalc_sigpending() recalc_sigpending() +#endif + + +/* + * reparent_to_init() was introduced in 2.4.8. In 2.5.38 (or possibly + * earlier, but later than 2.5.31) a call to it was added into + * daemonize(), so compat_daemonize no longer needs to call it. + * + * In 2.4.x kernels reparent_to_init() forgets to do correct refcounting + * on current->user. It is better to count one too many than one too few... + */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 8) && LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 38) +#define compat_reparent_to_init() do { \ + reparent_to_init(); \ + atomic_inc(¤t->user->__count); \ + } while (0) +#else +#define compat_reparent_to_init() do {} while (0) +#endif + + +/* + * daemonize appeared in 2.2.18. Except 2.2.17-4-RH7.0, which has it too. + * Fortunately 2.2.17-4-RH7.0 uses versioned symbols, so we can check + * its existence with defined(). + */ +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 2, 18)) && !defined(daemonize) +static inline void daemonize(void) { + struct fs_struct *fs; + + exit_mm(current); + current->session = 1; + current->pgrp = 1; + exit_fs(current); + fs = init_task.fs; + current->fs = fs; + atomic_inc(&fs->count); +} +#endif + + +/* + * flush_signals acquires sighand->siglock since 2.5.61... Verify RH's kernels! + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 61) +#define compat_flush_signals(task) do { \ + spin_lock_irq(&task->compat_sigmask_lock); \ + flush_signals(task); \ + spin_unlock_irq(&task->compat_sigmask_lock); \ + } while (0) +#else +#define compat_flush_signals(task) flush_signals(task) +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 61) +#define compat_allow_signal(signr) do { \ + spin_lock_irq(¤t->compat_sigmask_lock); \ + sigdelset(¤t->blocked, signr); \ + compat_recalc_sigpending(); \ + spin_unlock_irq(¤t->compat_sigmask_lock); \ + } while (0) +#else +#define compat_allow_signal(signr) allow_signal(signr) +#endif + +/* + * daemonize can set process name since 2.5.61. Prior to 2.5.61, daemonize + * didn't block signals on our behalf. + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 61) +#define compat_daemonize(x...) \ +({ \ + /* Beware! No snprintf here, so verify arguments! */ \ + sprintf(current->comm, x); \ + \ + /* Block all signals. */ \ + spin_lock_irq(¤t->compat_sigmask_lock); \ + sigfillset(¤t->blocked); \ + compat_recalc_sigpending(); \ + spin_unlock_irq(¤t->compat_sigmask_lock); \ + compat_flush_signals(current); \ + \ + daemonize(); \ + compat_reparent_to_init(); \ +}) +#else +#define compat_daemonize(x...) daemonize(x) +#endif + + +/* + * set priority for specified thread. Exists on 2.6.x kernels and some + * 2.4.x vendor's kernels. + */ +#if defined(VMW_HAVE_SET_USER_NICE) +#define compat_set_user_nice(task, n) set_user_nice((task), (n)) +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 0) +#define compat_set_user_nice(task, n) do { (task)->priority = 20 - (n); } while (0) +#elif !defined(VMW_HAVE_SET_USER_NICE) +#define compat_set_user_nice(task, n) do { (task)->nice = (n); } while (0) +#endif + +/* + * try to freeze a process. For kernels 2.6.11 or newer, we know how to choose + * the interface. The problem is that the oldest interface, introduced in + * 2.5.18, was backported to 2.4.x kernels. So if we're older than 2.6.11, + * we'll decide what to do based on whether or not swsusp was configured + * for the kernel. For kernels 2.6.20 and newer, we'll also need to include + * freezer.h since the try_to_freeze definition was pulled out of sched.h. + */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 20) +#include <linux/freezer.h> +#endif +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 13) || defined(VMW_TL10S64_WORKAROUND) +#define compat_try_to_freeze() try_to_freeze() +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 11) +#define compat_try_to_freeze() try_to_freeze(PF_FREEZE) +#elif defined(CONFIG_SOFTWARE_SUSPEND) || defined(CONFIG_SOFTWARE_SUSPEND2) +#include "compat_mm.h" +#include <linux/errno.h> +#include <linux/suspend.h> +static inline int compat_try_to_freeze(void) { + if (current->flags & PF_FREEZE) { + refrigerator(PF_FREEZE); + return 1; + } else { + return 0; + } +} +#else +static inline int compat_try_to_freeze(void) { return 0; } +#endif + +/* + * As of 2.6.23-rc1, kernel threads are no longer freezable by + * default. Instead, kernel threads that need to be frozen must opt-in + * by calling set_freezable() as soon as the thread is created. + */ + +#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 22) +#define compat_set_freezable() do { set_freezable(); } while (0) +#else +#define compat_set_freezable() do {} while (0) +#endif + +/* + * Since 2.6.27-rc2 kill_proc() is gone... Replacement (GPL-only!) + * API is available since 2.6.19. Use them from 2.6.27-rc1 up. + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 27) +typedef int compat_pid; +#define compat_find_get_pid(pid) (pid) +#define compat_put_pid(pid) do { } while (0) +#define compat_kill_pid(pid, sig, flag) kill_proc(pid, sig, flag) +#else +typedef struct pid * compat_pid; +#define compat_find_get_pid(pid) find_get_pid(pid) +#define compat_put_pid(pid) put_pid(pid) +#define compat_kill_pid(pid, sig, flag) kill_pid(pid, sig, flag) +#endif + + +#endif /* __COMPAT_SCHED_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmci/compat_semaphore.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/compat_semaphore.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmci/compat_semaphore.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/compat_semaphore.h 2008-10-13 08:01:41.000000000 +0100 @@ -0,0 +1,49 @@ +/********************************************************* + * Copyright (C) 2002 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +#ifndef __COMPAT_SEMAPHORE_H__ +# define __COMPAT_SEMAPHORE_H__ + + +/* <= 2.6.25 have asm only, 2.6.26 has both, and 2.6.27-rc2+ has linux only. */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 27) +# include <asm/semaphore.h> +#else +# include <linux/semaphore.h> +#endif + + +/* +* The init_MUTEX_LOCKED() API appeared in 2.2.18, and is also in +* 2.2.17-21mdk --hpreg +*/ + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 2, 18) + #ifndef init_MUTEX_LOCKED + #define init_MUTEX_LOCKED(_sem) *(_sem) = MUTEX_LOCKED + #endif + #ifndef DECLARE_MUTEX + #define DECLARE_MUTEX(name) struct semaphore name = MUTEX + #endif + #ifndef DECLARE_MUTEX_LOCKED + #define DECLARE_MUTEX_LOCKED(name) struct semaphore name = MUTEX_LOCKED + #endif +#endif + + +#endif /* __COMPAT_SEMAPHORE_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmci/compat_slab.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/compat_slab.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmci/compat_slab.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/compat_slab.h 2008-10-13 08:01:41.000000000 +0100 @@ -0,0 +1,85 @@ +/********************************************************* + * Copyright (C) 2005 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +#ifndef __COMPAT_SLAB_H__ +# define __COMPAT_SLAB_H__ + + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 2, 0) +# include <linux/slab.h> +#else +# include <linux/malloc.h> +#endif + +/* + * Before 2.6.20, kmem_cache_t was the accepted way to refer to a kmem_cache + * structure. Prior to 2.6.15, this structure was called kmem_cache_s, and + * afterwards it was renamed to kmem_cache. Here we keep things simple and use + * the accepted typedef until it became deprecated, at which point we switch + * over to the kmem_cache name. + */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 20) +# define compat_kmem_cache struct kmem_cache +#else +# define compat_kmem_cache kmem_cache_t +#endif + +/* + * Up to 2.6.22 kmem_cache_create has 6 arguments - name, size, alignment, flags, + * constructor, and destructor. Then for some time kernel was asserting that + * destructor is NULL, and since 2.6.23-pre1 kmem_cache_create takes only 5 + * arguments - destructor is gone. + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 22) || defined(VMW_KMEMCR_HAS_DTOR) +#define compat_kmem_cache_create(name, size, align, flags, ctor) \ + kmem_cache_create(name, size, align, flags, ctor, NULL) +#else +#define compat_kmem_cache_create(name, size, align, flags, ctor) \ + kmem_cache_create(name, size, align, flags, ctor) +#endif + +/* + * Up to 2.6.23 kmem_cache constructor has three arguments - pointer to block to + * prepare (aka "this"), from which cache it came, and some unused flags. After + * 2.6.23 flags were removed, and order of "this" and cache parameters was swapped... + * Since 2.6.27-rc2 everything is different again, and ctor has only one argument. + * + * HAS_3_ARGS has precedence over HAS_2_ARGS if both are defined. + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 23) && !defined(VMW_KMEMCR_CTOR_HAS_3_ARGS) +# define VMW_KMEMCR_CTOR_HAS_3_ARGS +#endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26) && !defined(VMW_KMEMCR_CTOR_HAS_2_ARGS) +# define VMW_KMEMCR_CTOR_HAS_2_ARGS +#endif + +#if defined(VMW_KMEMCR_CTOR_HAS_3_ARGS) +typedef void compat_kmem_cache_ctor(void *, compat_kmem_cache *, unsigned long); +#define COMPAT_KMEM_CACHE_CTOR_ARGS(arg) void *arg, \ + compat_kmem_cache *cache, \ + unsigned long flags +#elif defined(VMW_KMEMCR_CTOR_HAS_2_ARGS) +typedef void compat_kmem_cache_ctor(compat_kmem_cache *, void *); +#define COMPAT_KMEM_CACHE_CTOR_ARGS(arg) compat_kmem_cache *cache, \ + void *arg +#else +typedef void compat_kmem_cache_ctor(void *); +#define COMPAT_KMEM_CACHE_CTOR_ARGS(arg) void *arg +#endif + +#endif /* __COMPAT_SLAB_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmci/compat_spinlock.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/compat_spinlock.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmci/compat_spinlock.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/compat_spinlock.h 2008-10-13 08:01:41.000000000 +0100 @@ -0,0 +1,68 @@ +/********************************************************* + * Copyright (C) 2005 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +#ifndef __COMPAT_SPINLOCK_H__ +# define __COMPAT_SPINLOCK_H__ + + +/* + * The spin_lock() API appeared in 2.1.25 in asm/smp_lock.h + * It moved in 2.1.30 to asm/spinlock.h + * It moved again in 2.3.18 to linux/spinlock.h + * + * --hpreg + */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 3, 18) +# include <linux/spinlock.h> +#else +# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 1, 30) +# include <asm/spinlock.h> +# else +typedef struct {} spinlock_t; +# define spin_lock_init(lock) +# define spin_lock(lock) +# define spin_unlock(lock) +# define spin_lock_irqsave(lock, flags) do { \ + save_flags(flags); \ + cli(); \ + spin_lock(lock); \ + } while (0) +# define spin_unlock_irqrestore(lock, flags) do { \ + spin_unlock(lock); \ + restore_flags(flags); \ + } while (0) +# endif +#endif + + +/* + * Preempt support was added during 2.5.x development cycle, and later + * it was backported to 2.4.x. In 2.4.x backport these definitions + * live in linux/spinlock.h, that's why we put them here (in 2.6.x they + * are defined in linux/preempt.h which is included by linux/spinlock.h). + */ +#ifdef CONFIG_PREEMPT +#define compat_preempt_disable() preempt_disable() +#define compat_preempt_enable() preempt_enable() +#else +#define compat_preempt_disable() do { } while (0) +#define compat_preempt_enable() do { } while (0) +#endif + + +#endif /* __COMPAT_SPINLOCK_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmci/compat_uaccess.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/compat_uaccess.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmci/compat_uaccess.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/compat_uaccess.h 2008-10-13 08:01:41.000000000 +0100 @@ -0,0 +1,79 @@ +/********************************************************* + * Copyright (C) 2002 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +#ifndef __COMPAT_UACCESS_H__ +# define __COMPAT_UACCESS_H__ + + +/* User space access functions moved in 2.1.7 to asm/uaccess.h --hpreg */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 1, 7) +# include <asm/uaccess.h> +#else +# include <asm/segment.h> +#endif + + +/* get_user() API modified in 2.1.4 to take 2 arguments --hpreg */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 1, 4) +# define compat_get_user get_user +#else +/* + * We assign 0 to the variable in case of failure to prevent "`_var' might be + * used uninitialized in this function" compiler warnings. I think it is OK, + * because the hardware-based version in newer kernels probably has the same + * semantics and does not guarantee that the value of _var will not be + * modified, should the access fail --hpreg + */ +# define compat_get_user(_var, _uvAddr) ({ \ + int _status; \ + \ + _status = verify_area(VERIFY_READ, _uvAddr, sizeof(*(_uvAddr))); \ + if (_status == 0) { \ + (_var) = get_user(_uvAddr); \ + } else { \ + (_var) = 0; \ + } \ + _status; \ +}) +#endif + + +/* + * The copy_from_user() API appeared in 2.1.4 + * + * The emulation is not perfect here, but it is conservative: on failure, we + * always return the total size, instead of the potentially smaller faulty + * size --hpreg + * + * Since 2.5.55 copy_from_user() is no longer macro. + */ +#if !defined(copy_from_user) && LINUX_VERSION_CODE < KERNEL_VERSION(2, 2, 0) +# define copy_from_user(_to, _from, _size) ( \ + verify_area(VERIFY_READ, _from, _size) \ + ? (_size) \ + : (memcpy_fromfs(_to, _from, _size), 0) \ +) +# define copy_to_user(_to, _from, _size) ( \ + verify_area(VERIFY_WRITE, _to, _size) \ + ? (_size) \ + : (memcpy_tofs(_to, _from, _size), 0) \ +) +#endif + + +#endif /* __COMPAT_UACCESS_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmci/compat_version.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/compat_version.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmci/compat_version.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/compat_version.h 2008-10-13 08:01:41.000000000 +0100 @@ -0,0 +1,121 @@ +/********************************************************* + * Copyright (C) 1998 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +#ifndef __COMPAT_VERSION_H__ +# define __COMPAT_VERSION_H__ + +#define INCLUDE_ALLOW_VMMON +#define INCLUDE_ALLOW_MODULE +#define INCLUDE_ALLOW_VMCORE +#define INCLUDE_ALLOW_VMNIXMOD +#define INCLUDE_ALLOW_DISTRIBUTE +#include "includeCheck.h" + + +#ifndef __linux__ +# error "linux-version.h" +#endif + + +#include <linux/version.h> + +/* Appeared in 2.1.90 --hpreg */ +#ifndef KERNEL_VERSION +# define KERNEL_VERSION(a, b, c) (((a) << 16) + ((b) << 8) + (c)) +#endif + + +/* + * Distinguish relevant classes of Linux kernels. + * + * The convention is that version X defines all + * the KERNEL_Y symbols where Y <= X. + * + * XXX Do not add more definitions here. This way of doing things does not + * scale, and we are going to phase it out soon --hpreg + */ + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 1, 0) +# define KERNEL_2_1 +#endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 2, 0) +# define KERNEL_2_2 +#endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 3, 1) +# define KERNEL_2_3_1 +#endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 3, 15) +/* new networking */ +# define KERNEL_2_3_15 +#endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 3, 25) +/* new procfs */ +# define KERNEL_2_3_25 +#endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 3, 29) +/* even newer procfs */ +# define KERNEL_2_3_29 +#endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 3, 43) +/* softnet changes */ +# define KERNEL_2_3_43 +#endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 3, 47) +/* more softnet changes */ +# define KERNEL_2_3_47 +#endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 3, 99) +/* name in netdevice struct is array and not pointer */ +# define KERNEL_2_3_99 +#endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 0) +/* New 'owner' member at the beginning of struct file_operations */ +# define KERNEL_2_4_0 +#endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 8) +/* New netif_rx_ni() --hpreg */ +# define KERNEL_2_4_8 +#endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 22) +/* New vmap() */ +# define KERNEL_2_4_22 +#endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 2) +/* New kdev_t, major()/minor() API --hpreg */ +# define KERNEL_2_5_2 +#endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 5) +/* New sk_alloc(), pte_offset_map()/pte_unmap() --hpreg */ +# define KERNEL_2_5_5 +#endif + + +#endif /* __COMPAT_VERSION_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmci/compat_wait.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/compat_wait.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmci/compat_wait.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/compat_wait.h 2008-10-13 08:01:41.000000000 +0100 @@ -0,0 +1,225 @@ +/********************************************************* + * Copyright (C) 2002 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +#ifndef __COMPAT_WAIT_H__ +# define __COMPAT_WAIT_H__ + + +#include <linux/wait.h> +#include <linux/poll.h> +#include <linux/file.h> + +#include "compat_file.h" + + +/* + * The DECLARE_WAITQUEUE() API appeared in 2.3.1 + * It was back ported in 2.2.18 + * + * --hpreg + */ + +#ifndef DECLARE_WAITQUEUE + +typedef struct wait_queue *wait_queue_head_t; +# define init_waitqueue_head(_headPtr) *(_headPtr) = NULL +# define DECLARE_WAITQUEUE(_var, _task) \ + struct wait_queue _var = {_task, NULL, } + +typedef struct wait_queue wait_queue_t; +# define init_waitqueue_entry(_wait, _task) ((_wait)->task = (_task)) + +#endif + +/* + * The 'struct poll_wqueues' appeared in 2.5.48, when global + * /dev/epoll interface was added. It was backported to the + * 2.4.20-wolk4.0s. + */ + +#ifdef VMW_HAVE_EPOLL // { +#define compat_poll_wqueues struct poll_wqueues +#else // } { +#define compat_poll_wqueues poll_table +#endif // } + +#ifdef VMW_HAVE_EPOLL // { + +/* If prototype does not match, build will abort here */ +extern void poll_initwait(compat_poll_wqueues *); + +#define compat_poll_initwait(wait, table) ( \ + poll_initwait((table)), \ + (wait) = &(table)->pt \ +) + +#define compat_poll_freewait(wait, table) ( \ + poll_freewait((table)) \ +) + +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 0) // { + +/* If prototype does not match, build will abort here */ +extern void poll_initwait(compat_poll_wqueues *); + +#define compat_poll_initwait(wait, table) ( \ + (wait) = (table), \ + poll_initwait(wait) \ +) + +#define compat_poll_freewait(wait, table) ( \ + poll_freewait((table)) \ +) + +#else // } { + +#define compat_poll_initwait(wait, table) ( \ + (wait) = (table), /* confuse compiler */ \ + (wait) = (poll_table *) __get_free_page(GFP_KERNEL), \ + (wait)->nr = 0, \ + (wait)->entry = (struct poll_table_entry *)((wait) + 1), \ + (wait)->next = NULL \ +) + +static inline void +poll_freewait(poll_table *wait) +{ + while (wait) { + struct poll_table_entry * entry; + poll_table *old; + + entry = wait->entry + wait->nr; + while (wait->nr > 0) { + wait->nr--; + entry--; + remove_wait_queue(entry->wait_address, &entry->wait); + compat_fput(entry->filp); + } + old = wait; + wait = wait->next; + free_page((unsigned long) old); + } +} + +#define compat_poll_freewait(wait, table) ( \ + poll_freewait((wait)) \ +) + +#endif // } + +/* + * The wait_event_interruptible_timeout() interface is not + * defined in pre-2.6 kernels. + */ +#ifndef wait_event_interruptible_timeout +#define __wait_event_interruptible_timeout(wq, condition, ret) \ +do { \ + wait_queue_t __wait; \ + init_waitqueue_entry(&__wait, current); \ + \ + add_wait_queue(&wq, &__wait); \ + for (;;) { \ + set_current_state(TASK_INTERRUPTIBLE); \ + if (condition) \ + break; \ + if (!signal_pending(current)) { \ + ret = schedule_timeout(ret); \ + if (!ret) \ + break; \ + continue; \ + } \ + ret = -ERESTARTSYS; \ + break; \ + } \ + set_current_state(TASK_RUNNING); \ + remove_wait_queue(&wq, &__wait); \ +} while (0) + +#define wait_event_interruptible_timeout(wq, condition, timeout) \ +({ \ + long __ret = timeout; \ + if (!(condition)) \ + __wait_event_interruptible_timeout(wq, condition, __ret); \ + __ret; \ +}) +#endif + +/* + * The wait_event_timeout() interface is not + * defined in pre-2.6 kernels. + */ +#ifndef wait_event_timeout +#define __wait_event_timeout(wq, condition, ret) \ +do { \ + wait_queue_t __wait; \ + init_waitqueue_entry(&__wait, current); \ + \ + add_wait_queue(&wq, &__wait); \ + for (;;) { \ + set_current_state(TASK_UNINTERRUPTIBLE); \ + if (condition) \ + break; \ + ret = schedule_timeout(ret); \ + if (!ret) \ + break; \ + } \ + set_current_state(TASK_RUNNING); \ + remove_wait_queue(&wq, &__wait); \ +} while (0) + +#define wait_event_timeout(wq, condition, timeout) \ +({ \ + long __ret = timeout; \ + if (!(condition)) \ + __wait_event_timeout(wq, condition, __ret); \ + __ret; \ +}) +#endif + +/* + * DEFINE_WAIT() and friends were added in 2.5.39 and backported to 2.4.28. + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 28) || \ + (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 0) && \ + LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 39)) +# define COMPAT_DEFINE_WAIT(_wait) \ + DECLARE_WAITQUEUE(_wait, current) +# define compat_init_prepare_to_wait(_sleep, _wait, _state) \ + do { \ + __set_current_state(_state); \ + add_wait_queue(_sleep, _wait); \ + } while (0) +# define compat_cont_prepare_to_wait(_sleep, _wait, _state) \ + set_current_state(_state) +# define compat_finish_wait(_sleep, _wait, _state) \ + do { \ + __set_current_state(_state); \ + remove_wait_queue(_sleep, _wait); \ + } while (0) +#else +# define COMPAT_DEFINE_WAIT(_wait) \ + DEFINE_WAIT(_wait) +# define compat_init_prepare_to_wait(_sleep, _wait, _state) \ + prepare_to_wait(_sleep, _wait, _state) +# define compat_cont_prepare_to_wait(_sleep, _wait, _state) \ + prepare_to_wait(_sleep, _wait, _state) +# define compat_finish_wait(_sleep, _wait, _state) \ + finish_wait(_sleep, _wait) +#endif + +#endif /* __COMPAT_WAIT_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmci/COPYING /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/COPYING --- open-vm-tools-2008.01.23-74039/modules/linux/vmci/COPYING 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/COPYING 2008-10-13 08:01:41.000000000 +0100 @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 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. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + <signature of Ty Coon>, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmci/driver-config.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/driver-config.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmci/driver-config.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/driver-config.h 2008-10-13 08:01:41.000000000 +0100 @@ -0,0 +1,78 @@ +/********************************************************* + * Copyright (C) 1998 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * Sets the proper defines from the Linux header files + * + * This file must be included before the inclusion of any kernel header file, + * with the exception of linux/autoconf.h and linux/version.h --hpreg + */ + +#ifndef __VMX_CONFIG_H__ +#define __VMX_CONFIG_H__ + +#define INCLUDE_ALLOW_VMCORE +#define INCLUDE_ALLOW_VMMON +#define INCLUDE_ALLOW_MODULE +#define INCLUDE_ALLOW_VMNIXMOD +#include "includeCheck.h" + +#include <linux/autoconf.h> +#include "compat_version.h" + +/* + * We rely on Kernel Module support. Check here. + */ +#ifndef CONFIG_MODULES +# error "No Module support in this kernel. Please configure with CONFIG_MODULES" +#endif + +/* + * 2.2 kernels still use __SMP__ (derived from CONFIG_SMP + * in the main Makefile), so we do it here. + */ + +#ifdef CONFIG_SMP +# define __SMP__ 1 +#endif + +#if defined(CONFIG_MODVERSIONS) && defined(KERNEL_2_1) +# if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,60) +/* + * MODVERSIONS might be already defined when using kernel's Makefiles. + */ +# ifndef MODVERSIONS +# define MODVERSIONS +# endif +# include <linux/modversions.h> +# endif +#endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24) +/* + * Force the uintptr_t definition to come from linux/types.h instead of vm_basic_types.h. + */ +# include <linux/types.h> +# define _STDINT_H 1 +#endif + +#ifndef __KERNEL__ +# define __KERNEL__ +#endif + +#endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmci/includeCheck.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/includeCheck.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmci/includeCheck.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/includeCheck.h 2008-10-13 08:01:41.000000000 +0100 @@ -0,0 +1,132 @@ +/********************************************************* + * Copyright (C) 1998 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * includeCheck.h -- + * + * Restrict include file use. + * + * In every .h file, define one or more of these + * + * INCLUDE_ALLOW_VMX + * INCLUDE_ALLOW_USERLEVEL + * INCLUDE_ALLOW_VMMEXT + * INCLUDE_ALLOW_VMCORE + * INCLUDE_ALLOW_MODULE + * INCLUDE_ALLOW_VMNIXMOD + * INCLUDE_ALLOW_VMKERNEL + * INCLUDE_ALLOW_DISTRIBUTE + * INCLUDE_ALLOW_VMK_MODULE + * INCLUDE_ALLOW_VMKDRIVERS + * INCLUDE_ALLOW_VMIROM + * + * Then include this file. + * + * Any file that has INCLUDE_ALLOW_DISTRIBUTE defined will potentially + * be distributed in source form along with GPLed code. Ensure + * that this is acceptable. + */ + + +/* + * Declare a VMCORE-only variable to help classify object + * files. The variable goes in the common block and does + * not create multiple definition link-time conflicts. + */ + +#if defined VMCORE && defined VMX86_DEVEL && defined VMX86_DEBUG && \ + defined linux && !defined MODULE && \ + !defined COMPILED_WITH_VMCORE +#define COMPILED_WITH_VMCORE compiled_with_vmcore +#ifdef ASM + .comm compiled_with_vmcore, 0 +#else + asm(".comm compiled_with_vmcore, 0"); +#endif /* ASM */ +#endif + + +#if defined VMCORE && \ + !(defined VMX86_VMX || defined VMM || \ + defined MONITOR_APP || defined VMMON) +#error "Makefile problem: VMCORE without VMX86_VMX or \ + VMM or MONITOR_APP or MODULE." +#endif + +#if defined VMCORE && !defined INCLUDE_ALLOW_VMCORE +#error "The surrounding include file is not allowed in vmcore." +#endif +#undef INCLUDE_ALLOW_VMCORE + +#if defined VMX86_VMX && !defined VMCORE && \ + !(defined INCLUDE_ALLOW_VMX || defined INCLUDE_ALLOW_USERLEVEL) +#error "The surrounding include file is not allowed in the VMX." +#endif +#undef INCLUDE_ALLOW_VMX + +#if defined USERLEVEL && !defined VMX86_VMX && !defined VMCORE && \ + !defined INCLUDE_ALLOW_USERLEVEL +#error "The surrounding include file is not allowed at userlevel." +#endif +#undef INCLUDE_ALLOW_USERLEVEL + +#if defined VMM && !defined VMCORE && \ + !defined INCLUDE_ALLOW_VMMEXT +#error "The surrounding include file is not allowed in the monitor." +#endif +#undef INCLUDE_ALLOW_VMMEXT + +#if defined MODULE && !defined VMKERNEL_MODULE && !defined VMNIXMOD && \ + !defined VMMON && !defined INCLUDE_ALLOW_MODULE +#error "The surrounding include file is not allowed in driver modules." +#endif +#undef INCLUDE_ALLOW_MODULE + +#if defined VMMON && !defined INCLUDE_ALLOW_VMMON +#error "The surrounding include file is not allowed in vmmon." +#endif +#undef INCLUDE_ALLOW_VMMON + +#if defined VMKERNEL && !defined INCLUDE_ALLOW_VMKERNEL +#error "The surrounding include file is not allowed in the vmkernel." +#endif +#undef INCLUDE_ALLOW_VMKERNEL + +#if defined GPLED_CODE && !defined INCLUDE_ALLOW_DISTRIBUTE +#error "The surrounding include file is not allowed in GPL code." +#endif +#undef INCLUDE_ALLOW_DISTRIBUTE + +#if defined VMKERNEL_MODULE && !defined VMKERNEL && \ + !defined INCLUDE_ALLOW_VMK_MODULE && !defined INCLUDE_ALLOW_VMKDRIVERS +#error "The surrounding include file is not allowed in vmkernel modules." +#endif +#undef INCLUDE_ALLOW_VMK_MODULE +#undef INCLUDE_ALLOW_VMKDRIVERS + +#if defined VMNIXMOD && !defined INCLUDE_ALLOW_VMNIXMOD +#ifndef VMNIXMOD_VM +#error "The surrounding include file is not allowed in vmnixmod." +#endif +#endif +#undef INCLUDE_ALLOW_VMNIXMOD + +#if defined VMIROM && ! defined INCLUDE_ALLOW_VMIROM +#error "The surrounding include file is not allowed in vmirom." +#endif +#undef INCLUDE_ALLOW_VMIROM diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmci/kernelStubs.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/kernelStubs.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmci/kernelStubs.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/kernelStubs.h 2008-10-13 08:01:41.000000000 +0100 @@ -0,0 +1,146 @@ +/********************************************************* + * Copyright (C) 2006 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * kernelStubs.h + * + * KernelStubs implements some userspace library functions in terms + * of kernel functions to allow library userspace code to be used in a + * kernel. + */ + +#ifndef __KERNELSTUBS_H__ +#define __KERNELSTUBS_H__ + +#ifdef linux +# ifndef __KERNEL__ +# error "__KERNEL__ is not defined" +# endif +# include "driver-config.h" // Must be included before any other header files +# include "vm_basic_types.h" +# include <linux/kernel.h> +# include <linux/string.h> +#elif defined(_WIN32) +# include "vm_basic_types.h" +# include <ntddk.h> /* kernel memory APIs */ +# include <stdio.h> /* for _vsnprintf, vsprintf */ +# include <stdarg.h> /* for va_start stuff */ +# include <stdlib.h> /* for min macro. */ +# include "vm_assert.h" /* Our assert macros */ +#elif defined(__FreeBSD__) +# include "vm_basic_types.h" +# ifndef _KERNEL +# error "_KERNEL is not defined" +# endif +# include <sys/types.h> +# include <sys/malloc.h> +# include <sys/param.h> +# include <sys/kernel.h> +# include <machine/stdarg.h> +# include <sys/libkern.h> +# include "vm_assert.h" +#elif defined(__APPLE__) +# include "vm_basic_types.h" +# ifndef KERNEL +# error "KERNEL is not defined" +# endif +# include <stdarg.h> +# include <string.h> +#endif + +/* + * Function Prototypes + */ + +#if defined(linux) || defined(__APPLE__) /* if (linux) || (__APPLE__) { */ + +# ifdef linux /* if (linux) { */ +char *strdup(const char *source); +# endif + +/* Shared between Linux and Apple kernel stubs. */ +void *malloc(size_t size); +void free(void *mem); +void *calloc(size_t num, size_t len); +void *realloc(void *ptr, size_t newSize); + +#elif defined(_WIN32) /* } else if (_WIN32) { */ + +#if (_WIN32_WINNT == 0x0400) +/* The following declarations are missing on NT4. */ +typedef unsigned int UINT_PTR; +typedef unsigned int SIZE_T; + +/* No free with tag availaible on NT4 kernel! */ +#define KRNL_STUBS_FREE(P,T) ExFreePool((P)) + +#else /* _WIN32_WINNT */ +#define KRNL_STUBS_FREE(P,T) ExFreePoolWithTag((P),(T)) +/* Win 2K and later useful kernel function, documented but not declared! */ +NTKERNELAPI VOID ExFreePoolWithTag(IN PVOID P, IN ULONG Tag); +#endif /* _WIN32_WINNT */ + +#elif defined(__FreeBSD__) /* } else if (FreeBSD) { */ + +/* Kernel memory on FreeBSD is tagged for statistics and sanity checking. */ +MALLOC_DECLARE(M_VMWARE_TEMP); + +/* + * On FreeBSD, the general memory allocator for both userland and the kernel is named + * malloc, but the kernel malloc() takes more arguments. The following alias & macros + * work around this, to provide the standard malloc() API for userspace code that is + * being used in the kernel. + */ + +# undef malloc + +static INLINE void * +__compat_malloc(unsigned long size, struct malloc_type *type, int flags) { + return malloc(size, type, flags); +} + +# define malloc(size) __compat_malloc(size, M_VMWARE_TEMP, M_NOWAIT) +# define calloc(count, size) __compat_malloc((count) * (size), \ + M_VMWARE_TEMP, M_NOWAIT|M_ZERO) +# define realloc(buf, size) realloc(buf, size, M_VMWARE_TEMP, M_NOWAIT) +# define free(buf) free(buf, M_VMWARE_TEMP) +# define strchr(s,c) index(s,c) +# define strrchr(s,c) rindex(s,c) + +#endif /* } */ + +/* + * Stub functions we provide. + */ + +void Panic(const char *fmt, ...); + +char *Str_Strcpy(char *buf, const char *src, size_t maxSize); +int Str_Vsnprintf(char *str, size_t size, const char *format, + va_list arguments); +char *Str_Vasprintf(size_t *length, const char *format, + va_list arguments); +char *Str_Asprintf(size_t *length, const char *Format, ...); + +/* + * Functions the driver must implement for the stubs. + */ +EXTERN void Debug(const char *fmt, ...); + + +#endif /* __KERNELSTUBS_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmci/kernelStubsLinux.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/kernelStubsLinux.c --- open-vm-tools-2008.01.23-74039/modules/linux/vmci/kernelStubsLinux.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/kernelStubsLinux.c 2008-10-13 08:01:41.000000000 +0100 @@ -0,0 +1,426 @@ +/********************************************************* + * Copyright (C) 2006 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * kernelStubsLinux.c + * + * This file contains implementations of common userspace functions in terms + * that the Linux kernel can understand. + */ + +/* Must come before any kernel header file */ +#include "driver-config.h" +#include "kernelStubs.h" +#include "compat_kernel.h" +#include "compat_page.h" +#include "compat_sched.h" +#include <linux/slab.h> + +#include "vm_assert.h" + + +/* + *----------------------------------------------------------------------------- + * + * Panic -- + * + * Prints the debug message and stops the system. + * + * Results: + * None. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +void +Panic(const char *fmt, ...) // IN +{ + va_list args; + char *result; + + va_start(args, fmt); + result = Str_Vasprintf(NULL, fmt, args); + va_end(args); + + if (result) { + printk(KERN_EMERG "%s", result); + } + + BUG(); + + while (1); // Avoid compiler warning. +} + + +/* + *---------------------------------------------------------------------- + * + * 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 +{ + unsigned int *stack = (unsigned int *)&buf; + size_t len; + + len = strlen(src); + if (len >= maxSize) { + Panic("%s:%d Buffer too small 0x%x\n", __FILE__,__LINE__, + stack[-1]); + } + return memcpy(buf, src, len + 1); +} + + +/* + *---------------------------------------------------------------------- + * + * Str_Vsnprintf -- + * + * Compatability wrapper b/w different libc versions + * + * Results: + * int - number of bytes written (not including NULL terminate character), + * -1 on overflow (insufficient space for NULL terminate is considered + * overflow) + * + * NB: on overflow the buffer WILL be null terminated + * + * Side effects: + * None + * + *---------------------------------------------------------------------- + */ + +int +Str_Vsnprintf(char *str, // OUT + size_t size, // IN + const char *format, // IN + va_list arguments) // IN +{ + int retval; + retval = vsnprintf(str, size, format, arguments); + + /* + * Linux glibc 2.0.x returns -1 and null terminates (which we shouldn't + * be linking against), but glibc 2.1.x follows c99 and returns + * characters that would have been written. + */ + if (retval >= size) { + return -1; + } + return retval; +} + + +/* + *----------------------------------------------------------------------------- + * + * Str_Vasprintf -- + * + * 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) + * NULL on failure + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +char * +Str_Vasprintf(size_t *length, // OUT + const char *format, // IN + va_list arguments) // IN +{ + /* + * Simple implementation of Str_Vasprintf when userlevel libraries are not + * available (e.g. for use in drivers). We just fallback to vsnprintf, + * doubling if we didn't have enough space. + */ + unsigned int bufSize; + char *buf; + int retval; + + bufSize = strlen(format); + buf = NULL; + + 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 + */ + va_list args2; + + bufSize *= 2; + buf = realloc(buf, bufSize); + + if (!buf) { + return NULL; + } + + va_copy(args2, arguments); + retval = Str_Vsnprintf(buf, bufSize, format, args2); + va_end(args2); + } while (retval == -1); + + if (length) { + *length = retval; + } + + /* + * Try to trim the buffer here to save memory? + */ + return buf; +} + + +/* + *----------------------------------------------------------------------------- + * + * Str_Asprintf -- + * + * Same as Str_Vasprintf(), but parameters are passed inline --hpreg + * + * Results: + * Same as Str_Vasprintf() + * + * Side effects: + * Same as Str_Vasprintf() + * + *----------------------------------------------------------------------------- + */ + +char * +Str_Asprintf(size_t *length, // OUT + 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; +} + + +/* + *----------------------------------------------------------------------------- + * + * strdup -- + * + * Duplicates a string. + * + * Results: + * A pointer to memory containing the duplicated string or NULL if no + * memory was available. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +char * +strdup(const char *source) // IN +{ + char *target = NULL; + if (source) { + + /* + * We call our special implementation of malloc() because the users of + * strdup() will call free(), and that'll decrement the pointer before + * freeing it. Thus, we need to make sure that the allocated block + * also stores the block length before the block itself (see malloc() + * below). + */ + unsigned int len = strlen(source); + target = malloc(len + 1); + if (target) { + memcpy(target, source, len + 1); + } + } + + return target; +} + + +/* + *---------------------------------------------------------------------------- + * + * malloc -- + * + * Allocate memory using kmalloc. There is no realloc + * equivalent, so we roll our own by padding each allocation with + * 4 (or 8 for 64 bit guests) extra bytes to store the block length. + * + * Results: + * Pointer to driver heap memory, offset by 4 (or 8) + * bytes from the real block pointer. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +void * +malloc(size_t size) // IN +{ + size_t *ptr; + ptr = kmalloc(size + sizeof size, GFP_KERNEL); + + if (ptr) { + *ptr++ = size; + } + return ptr; +} + +/* + *--------------------------------------------------------------------------- + * + * free -- + * + * Free memory allocated by a previous call to malloc, calloc or realloc. + * + * Results: + * None. + * + * Side effects: + * Calls kfree to free the real (base) pointer. + * + *--------------------------------------------------------------------------- + */ + +void +free(void *mem) // IN +{ + if (mem) { + size_t *dataPtr = (size_t *)mem; + kfree(--dataPtr); + } +} + + +/* + *---------------------------------------------------------------------------- + * + * calloc -- + * + * Malloc and zero. + * + * Results: + * Pointer to driver heap memory (see malloc, above). + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +void * +calloc(size_t num, // IN + size_t len) // IN +{ + size_t size; + void *ptr; + + size = num * len; + ptr = malloc(size); + if (ptr) { + memset(ptr, 0, size); + } + return ptr; +} + + +/* + *---------------------------------------------------------------------------- + * + * realloc -- + * + * Since the driver heap has no realloc equivalent, we have to roll our + * own. Fortunately, we can retrieve the block size of every block we + * hand out since we stashed it at allocation time (see malloc above). + * + * Results: + * Pointer to memory block valid for 'newSize' bytes, or NULL if + * allocation failed. + * + * Side effects: + * Could copy memory around. + * + *---------------------------------------------------------------------------- + */ + +void * +realloc(void* ptr, // IN + size_t newSize) // IN +{ + void *newPtr; + size_t *dataPtr; + size_t length, lenUsed; + + dataPtr = (size_t *)ptr; + length = ptr ? dataPtr[-1] : 0; + if (newSize == 0) { + if (ptr) { + free(ptr); + newPtr = NULL; + } else { + newPtr = malloc(newSize); + } + } else if (newSize == length) { + newPtr = ptr; + } else if ((newPtr = malloc(newSize))) { + if (length < newSize) { + lenUsed = length; + } else { + lenUsed = newSize; + } + memcpy(newPtr, ptr, lenUsed); + free(ptr); + } + return newPtr; +} + + diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmci/Makefile /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/Makefile --- open-vm-tools-2008.01.23-74039/modules/linux/vmci/Makefile 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/Makefile 2008-10-13 08:01:41.000000000 +0100 @@ -0,0 +1,149 @@ +#!/usr/bin/make -f +########################################################## +# Copyright (C) 1998 VMware, Inc. All rights reserved. +# +# 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 version 2 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 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 +# +########################################################## + +#### +#### VMware kernel module Makefile to be distributed externally +#### + +#### +#### SRCROOT _must_ be a relative path. +#### +SRCROOT = . + +VM_UNAME = $(shell uname -r) + +# Header directory for the running kernel +HEADER_DIR = /lib/modules/$(VM_UNAME)/build/include + +BUILD_DIR = $(HEADER_DIR)/.. + +DRIVER := vmci +PRODUCT := @PRODUCT@ + +# Grep program +GREP = /bin/grep + +vm_check_gcc = $(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null \ + > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi) +vm_check_file = $(shell if test -f $(1); then echo "yes"; else echo "no"; fi) + +ifndef VM_KBUILD +VM_KBUILD := no +ifeq ($(call vm_check_file,$(BUILD_DIR)/Makefile), yes) +ifneq ($(call vm_check_file,$(BUILD_DIR)/Rules.make), yes) +VM_KBUILD := 26 +endif +endif +export VM_KBUILD +endif + +ifndef VM_KBUILD_SHOWN +ifeq ($(VM_KBUILD), no) +VM_DUMMY := $(shell echo >&2 "Using standalone build system.") +else +ifeq ($(VM_KBUILD), 24) +VM_DUMMY := $(shell echo >&2 "Using 2.4.x kernel build system.") +else +VM_DUMMY := $(shell echo >&2 "Using 2.6.x kernel build system.") +endif +endif +VM_KBUILD_SHOWN := yes +export VM_KBUILD_SHOWN +endif + +ifneq ($(VM_KBUILD), no) + +VMCCVER := $(shell $(CC) -dumpversion) + +# If there is no version defined, we are in toplevel pass, not yet in kernel makefiles... +ifeq ($(VERSION),) + +ifeq ($(VM_KBUILD), 24) +DRIVER_KO := $(DRIVER).o +else +DRIVER_KO := $(DRIVER).ko +endif + +.PHONY: $(DRIVER_KO) + +auto-build: $(DRIVER_KO) + cp -f $< $(SRCROOT)/../$(DRIVER).o + +# $(DRIVER_KO) is a phony target, so compare file times explicitly +$(DRIVER): $(DRIVER_KO) + if [ $< -nt $@ ] || [ ! -e $@ ] ; then cp -f $< $@; fi + +# Pass gcc version down the chain, so we can detect if kernel attempts to use unapproved compiler +VM_CCVER := $(VMCCVER) +export VM_CCVER +VM_CC := $(CC) +export VM_CC + +MAKEOVERRIDES := $(filter-out CC=%,$(MAKEOVERRIDES)) + +$(DRIVER_KO): + make -C $(BUILD_DIR) SUBDIRS=$$PWD SRCROOT=$$PWD/$(SRCROOT) modules + +else + +ifneq ($(VM_CCVER), $(VMCCVER)) +$(warning *** Inappropriate build environment: you wanted to use gcc \ + version $(VM_CCVER) while kernel attempts to use gcc version $(VMCCVER).) +$(error For proper build you'll have to replace $(CC) with symbolic \ + link to $(VM_CC)) +endif + +endif + +vm_check_build = $(shell if $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) \ + $(CPPFLAGS) $(CFLAGS) $(CFLAGS_KERNEL) \ + $(EXTRA_CFLAGS) -Iinclude2/asm/mach-default \ + -DKBUILD_BASENAME=\"$(DRIVER)\" \ + -Werror -S -o /dev/null -xc $(1) \ + > /dev/null 2>&1; then echo "$(2)"; else echo "$(3)"; fi) + +CC_WARNINGS := -Wall -Wstrict-prototypes +CC_OPTS := $(GLOBAL_DEFS) $(CC_WARNINGS) -DVMW_USING_KBUILD +ifdef VMX86_DEVEL +CC_OPTS += -DVMX86_DEVEL +endif +ifdef VMX86_DEBUG +CC_OPTS += -DVMX86_DEBUG +endif + +include $(SRCROOT)/Makefile.kernel + +ifdef TOPDIR +ifeq ($(VM_KBUILD), 24) + +O_TARGET := $(DRIVER).o + +obj-y := $($(DRIVER)-y) + +include $(TOPDIR)/Rules.make +endif +endif + +else + +include $(SRCROOT)/Makefile.normal + +endif + +#.SILENT: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmci/Makefile.kernel /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/Makefile.kernel --- open-vm-tools-2008.01.23-74039/modules/linux/vmci/Makefile.kernel 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/Makefile.kernel 2008-10-13 08:01:41.000000000 +0100 @@ -0,0 +1,37 @@ +#!/usr/bin/make -f +########################################################## +# Copyright (C) 2005 VMware, Inc. All rights reserved. +# +# 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 version 2 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 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 +# +########################################################## + +#### +#### VMware vmci Makefile to be distributed externally +#### + +INCLUDE := -I. + +EXTRA_CFLAGS := $(CC_OPTS) $(INCLUDE) +EXTRA_CFLAGS += $(call vm_check_build, $(SRCROOT)/autoconf/epoll.c, -DVMW_HAVE_EPOLL, ) +EXTRA_CFLAGS += -DVMX86_TOOLS + +obj-m += $(DRIVER).o + +$(DRIVER)-y := $(subst $(SRCROOT)/, , $(patsubst %.c, %.o, $(wildcard $(SRCROOT)/*.c))) + +clean: + rm -rf $(wildcard $(DRIVER).mod.c $(DRIVER).ko .tmp_versions \ + Module.symvers Modules.symvers Module.markers modules.order \ + $(foreach dir,./,$(addprefix $(dir),.*.cmd .*.o.flags *.o))) diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmci/Makefile.normal /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/Makefile.normal --- open-vm-tools-2008.01.23-74039/modules/linux/vmci/Makefile.normal 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/Makefile.normal 2008-10-13 08:01:41.000000000 +0100 @@ -0,0 +1,96 @@ +#!/usr/bin/make -f +########################################################## +# Copyright (C) 2005 VMware, Inc. All rights reserved. +# +# 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 version 2 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 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 +# +########################################################## + +#### +#### VMware vmci Makefile to be distributed externally +#### + +vm_check_build = $(shell if $(CC) $(CC_OPTS) $(INCLUDE) -Werror -S -o /dev/null -xc $(1) \ + > /dev/null 2>&1; then echo "$(2)"; else echo "$(3)"; fi) + +DRIVERNAME = $(DRIVER)-$(VM_UNAME) + +ifneq (,$(filter x86_64%, $(shell $(CC) -dumpmachine))) +MACHINE := x86_64 +else +MACHINE := x386 +endif + +#### +#### You must compile with at least -O level of optimization +#### or the module won't load. +#### If desparate, I think that bringing in <linux/bitops.h> might +#### suffice. +#### +CC_WARNINGS := -Wall -Wstrict-prototypes +# Don't use -pipe or egcs-2.91.66 (shipped with RedHat) will die +CC_KFLAGS := -D__KERNEL__ -fno-strength-reduce -fno-omit-frame-pointer \ + -fno-common -DKBUILD_MODNAME=$(DRIVER) +CC_KFLAGS += $(call vm_check_gcc,-falign-loops=2 -falign-jumps=2 -falign-functions=2, \ + -malign-loops=2 -malign-jumps=2 -malign-functions=2) +CC_KFLAGS += $(call vm_check_gcc,-fno-strict-aliasing,) +CC_KFLAGS += -DVMX86_TOOLS +ifeq ($(MACHINE),x86_64) +CC_KFLAGS += -mno-red-zone -mcmodel=kernel +else +# Gcc 3.0 deprecates -m486 --hpreg +CC_KFLAGS += -DCPU=586 $(call check_gcc,-march=i586,-m486) +endif + +CC_OPTS := -g3 -O2 -DMODULE $(GLOBAL_DEFS) $(CC_KFLAGS) $(CC_WARNINGS) + +INCLUDE := -I. -I$(HEADER_DIR) + +INCLUDE += $(shell $(CC) $(CC_OPTS) $(INCLUDE) \ + -E $(SRCROOT)/autoconf/geninclude.c \ + | sed -n -e 's!^APATH!-I$(HEADER_DIR)/asm!p') + +CC_OPTS += $(call vm_check_build, $(SRCROOT)/autoconf/epoll.c, -DVMW_HAVE_EPOLL, ) + +OBJS := vmci_drv.o +OBJS += vmciDatagram.o +OBJS += vmciEvent.o +OBJS += vmciProcess.o +OBJS += vmciUtil.o +OBJS += vmciKernelIf.o +OBJS += vmciGuestKernelIf.o +OBJS += vmciQueuePair.o +OBJS += kernelStubsLinux.o +OBJS += vmciGuestDs.o + +CFLAGS := $(CC_OPTS) $(INCLUDE) + +LIBS := + +default: all + +all: $(DRIVER).o + +$(DRIVERNAME): $(OBJS) + $(LD) -r -o $@ $^ + +$(DRIVER) $(DRIVER).o ../$(DRIVER).o: $(DRIVERNAME) + cp -f $< $@ + +auto-build: ../$(DRIVER).o + +clean: + rm -f $(DRIVERNAME) ../$(DRIVERNAME) $(DRIVER) $(OBJS) + +.SILENT: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmci/pgtbl.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/pgtbl.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmci/pgtbl.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/pgtbl.h 2008-10-13 08:01:41.000000000 +0100 @@ -0,0 +1,385 @@ +/********************************************************* + * Copyright (C) 2002 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +#ifndef __PGTBL_H__ +# define __PGTBL_H__ + + +#include "compat_highmem.h" +#include "compat_pgtable.h" +#include "compat_spinlock.h" +#include "compat_page.h" + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 3, 11) +# define compat_active_mm mm +#else +# define compat_active_mm active_mm +#endif + + +/* + *----------------------------------------------------------------------------- + * + * PgtblPte2MPN -- + * + * Returns the page structure associated to a Page Table Entry. + * + * This function is not allowed to schedule() because it can be called while + * holding a spinlock --hpreg + * + * Results: + * INVALID_MPN on failure + * mpn on success + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static INLINE MPN +PgtblPte2MPN(pte_t *pte) // IN +{ + if (pte_present(*pte) == 0) { + return INVALID_MPN; + } + return pte_pfn(*pte); +} + + +/* + *----------------------------------------------------------------------------- + * + * PgtblPte2Page -- + * + * Returns the page structure associated to a Page Table Entry. + * + * This function is not allowed to schedule() because it can be called while + * holding a spinlock --hpreg + * + * Results: + * The page structure if the page table entry points to a physical page + * NULL if the page table entry does not point to a physical page + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static INLINE struct page * +PgtblPte2Page(pte_t *pte) // IN +{ + if (pte_present(*pte) == 0) { + return NULL; + } + + return compat_pte_page(*pte); +} + + +/* + *----------------------------------------------------------------------------- + * + * PgtblPGD2PTELocked -- + * + * Walks through the hardware page tables to try to find the pte + * associated to a virtual address. + * + * Results: + * pte. Caller must call pte_unmap if valid pte returned. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static INLINE pte_t * +PgtblPGD2PTELocked(compat_pgd_t *pgd, // IN: PGD to start with + VA addr) // IN: Address in the virtual address + // space of that process +{ + compat_pud_t *pud; + pmd_t *pmd; + pte_t *pte; + + if (compat_pgd_present(*pgd) == 0) { + return NULL; + } + + pud = compat_pud_offset(pgd, addr); + if (compat_pud_present(*pud) == 0) { + return NULL; + } + + pmd = pmd_offset_map(pud, addr); + if (pmd_present(*pmd) == 0) { + pmd_unmap(pmd); + return NULL; + } + + pte = pte_offset_map(pmd, addr); + pmd_unmap(pmd); + return pte; +} + + +/* + *----------------------------------------------------------------------------- + * + * PgtblVa2PTELocked -- + * + * Walks through the hardware page tables to try to find the pte + * associated to a virtual address. + * + * Results: + * pte. Caller must call pte_unmap if valid pte returned. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static INLINE pte_t * +PgtblVa2PTELocked(struct mm_struct *mm, // IN: Mm structure of a process + VA addr) // IN: Address in the virtual address + // space of that process +{ + return PgtblPGD2PTELocked(compat_pgd_offset(mm, addr), addr); +} + + +/* + *----------------------------------------------------------------------------- + * + * PgtblVa2MPNLocked -- + * + * Retrieve MPN for a given va. + * + * Caller must call pte_unmap if valid pte returned. The mm->page_table_lock + * must be held, so this function is not allowed to schedule() --hpreg + * + * Results: + * INVALID_MPN on failure + * mpn on success + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static INLINE MPN +PgtblVa2MPNLocked(struct mm_struct *mm, // IN: Mm structure of a process + VA addr) // IN: Address in the virtual address +{ + pte_t *pte; + + pte = PgtblVa2PTELocked(mm, addr); + if (pte != NULL) { + MPN mpn = PgtblPte2MPN(pte); + pte_unmap(pte); + return mpn; + } + return INVALID_MPN; +} + + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0) +/* + *----------------------------------------------------------------------------- + * + * PgtblKVa2MPNLocked -- + * + * Retrieve MPN for a given kernel va. + * + * Caller must call pte_unmap if valid pte returned. The mm->page_table_lock + * must be held, so this function is not allowed to schedule() --hpreg + * + * Results: + * INVALID_MPN on failure + * mpn on success + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static INLINE MPN +PgtblKVa2MPNLocked(struct mm_struct *mm, // IN: Mm structure of a caller + VA addr) // IN: Address in the virtual address +{ + pte_t *pte; + + pte = PgtblPGD2PTELocked(compat_pgd_offset_k(mm, addr), addr); + if (pte != NULL) { + MPN mpn = PgtblPte2MPN(pte); + pte_unmap(pte); + return mpn; + } + return INVALID_MPN; +} +#endif + + +/* + *----------------------------------------------------------------------------- + * + * PgtblVa2PageLocked -- + * + * Return the "page" struct for a given va. + * + * Results: + * struct page or NULL. The mm->page_table_lock must be held, so this + * function is not allowed to schedule() --hpreg + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static INLINE struct page * +PgtblVa2PageLocked(struct mm_struct *mm, // IN: Mm structure of a process + VA addr) // IN: Address in the virtual address +{ + pte_t *pte; + + pte = PgtblVa2PTELocked(mm, addr); + if (pte != NULL) { + struct page *page = PgtblPte2Page(pte); + pte_unmap(pte); + return page; + } else { + return NULL; + } +} + + +/* + *----------------------------------------------------------------------------- + * + * PgtblVa2MPN -- + * + * Walks through the hardware page tables of the current process to try to + * find the page structure associated to a virtual address. + * + * Results: + * Same as PgtblVa2MPNLocked() + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static INLINE int +PgtblVa2MPN(VA addr) // IN +{ + struct mm_struct *mm; + MPN mpn; + + /* current->mm is NULL for kernel threads, so use active_mm. */ + mm = current->compat_active_mm; + if (compat_get_page_table_lock(mm)) { + spin_lock(compat_get_page_table_lock(mm)); + } + mpn = PgtblVa2MPNLocked(mm, addr); + if (compat_get_page_table_lock(mm)) { + spin_unlock(compat_get_page_table_lock(mm)); + } + return mpn; +} + + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0) +/* + *----------------------------------------------------------------------------- + * + * PgtblKVa2MPN -- + * + * Walks through the hardware page tables of the current process to try to + * find the page structure associated to a virtual address. + * + * Results: + * Same as PgtblVa2MPNLocked() + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static INLINE int +PgtblKVa2MPN(VA addr) // IN +{ + struct mm_struct *mm; + MPN mpn; + + mm = current->compat_active_mm; + if (compat_get_page_table_lock(mm)) { + spin_lock(compat_get_page_table_lock(mm)); + } + mpn = PgtblKVa2MPNLocked(mm, addr); + if (compat_get_page_table_lock(mm)) { + spin_unlock(compat_get_page_table_lock(mm)); + } + return mpn; +} +#endif + + +/* + *----------------------------------------------------------------------------- + * + * PgtblVa2Page -- + * + * Walks through the hardware page tables of the current process to try to + * find the page structure associated to a virtual address. + * + * Results: + * Same as PgtblVa2PageLocked() + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static INLINE struct page * +PgtblVa2Page(VA addr) // IN +{ + struct mm_struct *mm; + struct page *page; + + mm = current->compat_active_mm; + if (compat_get_page_table_lock(mm)) { + spin_lock(compat_get_page_table_lock(mm)); + } + page = PgtblVa2PageLocked(mm, addr); + if (compat_get_page_table_lock(mm)) { + spin_unlock(compat_get_page_table_lock(mm)); + } + return page; +} + + +#endif /* __PGTBL_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmci/vm_assert.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vm_assert.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmci/vm_assert.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vm_assert.h 2008-10-13 08:01:41.000000000 +0100 @@ -0,0 +1,317 @@ +/********************************************************* + * Copyright (C) 1998-2004 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * vm_assert.h -- + * + * The basic assertion facility for all VMware code. + * + * For proper use, see + * 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_VMMEXT +#define INCLUDE_ALLOW_MODULE +#define INCLUDE_ALLOW_VMMON +#define INCLUDE_ALLOW_VMNIXMOD +#define INCLUDE_ALLOW_VMKERNEL +#define INCLUDE_ALLOW_VMKDRIVERS +#define INCLUDE_ALLOW_VMK_MODULE +#define INCLUDE_ALLOW_DISTRIBUTE +#define INCLUDE_ALLOW_VMCORE +#define INCLUDE_ALLOW_VMIROM +#include "includeCheck.h" + +// XXX not necessary except some places include vm_assert.h improperly +#include "vm_basic_types.h" +#include "vm_basic_defs.h" + + +/* + * XXX old file code + */ + +#ifdef FILECODEINT +#error "Don't define FILECODEINT. It is obsolete." +#endif +#ifdef FILECODE +#error "Don't define FILECODE. It is obsolete." +#endif + + +/* + * Panic and log functions + */ + +EXTERN void Log(const char *fmt, ...) PRINTF_DECL(1, 2); +EXTERN void Warning(const char *fmt, ...) PRINTF_DECL(1, 2); +EXTERN NORETURN void Panic(const char *fmt, ...) PRINTF_DECL(1, 2); + +EXTERN void LogThrottled(uint32 *count, const char *fmt, ...) + PRINTF_DECL(2, 3); +EXTERN void WarningThrottled(uint32 *count, const char *fmt, ...) + PRINTF_DECL(2, 3); + +/* DB family: messages which are parsed by logfile database system */ +#define WarningDB Warning +#define LogDB Log +#define WarningThrottledDB WarningThrottled +#define LogThrottledDB LogThrottled + + +/* + * Stress testing: redefine ASSERT_IFNOT() to taste + */ + +#ifndef ASSERT_IFNOT + #ifdef __cplusplus + #define ASSERT_IFNOT(cond, panic) (UNLIKELY(!(cond)) ? (panic) : (void)0) + #else + #define ASSERT_IFNOT(cond, panic) (UNLIKELY(!(cond)) ? (panic) : 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 || defined ASSERT_ALWAYS_AVAILABLE +#undef ASSERT +#define ASSERT(cond) \ + ASSERT_IFNOT(cond, _ASSERT_PANIC(AssertAssert)) +#endif +#define ASSERT_BUG(bug, cond) \ + ASSERT_IFNOT(cond, _ASSERT_PANIC_BUG(bug, AssertAssert)) +#define ASSERT_BUG_DEBUGONLY(bug, cond) ASSERT_BUG(bug, cond) + +#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)) + +#define NOT_IMPLEMENTED() _ASSERT_PANIC(AssertNotImplemented) +#define NOT_IMPLEMENTED_BUG(bug) _ASSERT_PANIC_BUG(bug, AssertNotImplemented) + +#define NOT_REACHED() _ASSERT_PANIC(AssertNotReached) +#define NOT_REACHED_BUG(bug) _ASSERT_PANIC_BUG(bug, AssertNotReached) + +#define ASSERT_MEM_ALLOC(cond) \ + ASSERT_IFNOT(cond, _ASSERT_PANIC(AssertMemAlloc)) + +#ifdef VMX86_DEVEL + #define ASSERT_LENGTH(real, expected) \ + ASSERT_IFNOT((real) == (expected), \ + Panic(AssertLengthFmt, __FILE__, __LINE__, real, expected)) +#else + #define ASSERT_LENGTH(real, expected) ASSERT((real) == (expected)) +#endif + +#ifdef VMX86_DEVEL + #define ASSERT_DEVEL(cond) ASSERT(cond) +#else + #define ASSERT_DEVEL(cond) ((void) 0) +#endif + +#define ASSERT_NO_INTERRUPTS() ASSERT(!INTERRUPTS_ENABLED()) +#define ASSERT_HAS_INTERRUPTS() ASSERT(INTERRUPTS_ENABLED()) + +#define ASSERT_LOG_UNEXPECTED(bug, cond) \ + (UNLIKELY(!(cond)) ? LOG_UNEXPECTED(bug) : 0) +#ifdef VMX86_DEVEL + #define LOG_UNEXPECTED(bug) \ + Warning(AssertUnexpectedFmt, __FILE__, __LINE__, bug) +#else + #define LOG_UNEXPECTED(bug) \ + Log(AssertUnexpectedFmt, __FILE__, __LINE__, bug) +#endif + +#define ASSERT_NOT_TESTED(cond) (UNLIKELY(!(cond)) ? NOT_TESTED() : 0) +#ifdef VMX86_DEVEL + #define NOT_TESTED() Warning(AssertNotTestedFmt, __FILE__, __LINE__) +#else + #define NOT_TESTED() Log(AssertNotTestedFmt, __FILE__, __LINE__) +#endif + +#define NOT_TESTED_ONCE() \ + do { \ + static Bool alreadyPrinted = FALSE; \ + if (UNLIKELY(!alreadyPrinted)) { \ + alreadyPrinted = TRUE; \ + NOT_TESTED(); \ + } \ + } while (0) + +#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 { \ + static Bool logged = FALSE; \ + if (!logged) { \ + Log _s; \ + logged = TRUE; \ + } \ + } while (0) + + +/* + * Redefine macros that are only in debug versions + */ + +#if !defined VMX86_DEBUG && !defined ASSERT_ALWAYS_AVAILABLE // { + +#undef ASSERT +#define ASSERT(cond) ((void) 0) + +#undef ASSERT_BUG_DEBUGONLY +#define ASSERT_BUG_DEBUGONLY(bug, cond) ((void) 0) + +#undef ASSERT_LENGTH +#define ASSERT_LENGTH(real, expected) ((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. + */ + +#ifdef VMM +#undef NOT_REACHED +#define NOT_REACHED() ((void) 0) +#else +// keep debug definition +#endif + +#undef ASSERT_LOG_UNEXPECTED +#define ASSERT_LOG_UNEXPECTED(bug, cond) ((void) 0) + +#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). + */ + +#define ASSERT_ON_COMPILE(e) \ + do { \ + enum { AssertOnCompileMisused = ((e) ? 1 : -1) }; \ + typedef char AssertOnCompileFailed[AssertOnCompileMisused]; \ + } while (0) + + +/* + * 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 \ + } + + +/* + * 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 // { + +#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 AssertLengthFmt _AssertLengthFmt +#define AssertUnexpectedFmt _AssertUnexpectedFmt +#define AssertNotTestedFmt _AssertNotTestedFmt + +#endif // } + +// these don't have newline so a bug can be tacked on +#define _AssertPanicFmt "PANIC %s:%d" +#define _AssertAssertFmt "ASSERT %s:%d" +#define _AssertNotImplementedFmt "NOT_IMPLEMENTED %s:%d" +#define _AssertNotReachedFmt "NOT_REACHED %s:%d" +#define _AssertMemAllocFmt "MEM_ALLOC %s:%d" + +// these are complete formats with newline +#define _AssertLengthFmt "LENGTH %s:%d r=%#x e=%#x\n" +#define _AssertUnexpectedFmt "UNEXPECTED %s:%d bugNr=%d\n" +#define _AssertNotTestedFmt "NOT_TESTED %s:%d\n" + +#endif /* ifndef _VM_ASSERT_H_ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmci/vm_atomic.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vm_atomic.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmci/vm_atomic.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vm_atomic.h 2008-10-13 08:01:41.000000000 +0100 @@ -0,0 +1,2049 @@ +/********************************************************* + * Copyright (C) 1998 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * vm_atomic.h -- + * + * Atomic power + */ + +#ifndef _ATOMIC_H_ +#define _ATOMIC_H_ + +#define INCLUDE_ALLOW_USERLEVEL +#define INCLUDE_ALLOW_VMMEXT +#define INCLUDE_ALLOW_MODULE +#define INCLUDE_ALLOW_VMMON +#define INCLUDE_ALLOW_VMNIXMOD +#define INCLUDE_ALLOW_VMKDRIVERS +#define INCLUDE_ALLOW_VMK_MODULE +#define INCLUDE_ALLOW_VMKERNEL +#define INCLUDE_ALLOW_DISTRIBUTE +#define INCLUDE_ALLOW_VMCORE +#define INCLUDE_ALLOW_VMIROM +#include "includeCheck.h" + +#include "vm_basic_types.h" + + +/* Basic atomic type: 32 bits */ +typedef struct Atomic_uint32 { + volatile uint32 value; +} Atomic_uint32; + + +/* Basic atomic type: 64 bits */ +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 + * untill 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 +#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*); +#pragma intrinsic(_InterlockedExchange, _InterlockedCompareExchange) +#pragma intrinsic(_InterlockedExchangeAdd, _InterlockedDecrement) +#pragma intrinsic(_InterlockedIncrement) + +#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 */ + + +/* Convert a volatile int to Atomic_uint32. */ +static INLINE Atomic_uint32 * +Atomic_VolatileToAtomic(volatile uint32 *var) +{ + return (Atomic_uint32 *)var; +} + +/* + *----------------------------------------------------------------------------- + * + * Atomic_Init, Atomic_SetFence, AtomicUseFence -- + * + * Determine whether an lfence intruction is executed after + * every locked instruction. + * + * Certain AMD processes 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. + * 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__) /* PR136775 */ +#define ATOMIC_USE_FENCE +#endif + +#if defined(VMATOMIC_IMPORT_DLLDATA) +VMX86_EXTERN_DATA Bool AtomicUseFence; +#else +EXTERN Bool AtomicUseFence; +#endif + +EXTERN Bool atomicFenceInitialized; + +void AtomicInitFence(void); + +static INLINE void +Atomic_Init(void) +{ +#ifdef ATOMIC_USE_FENCE + if (!atomicFenceInitialized) { + AtomicInitFence(); + } +#endif +} + +static INLINE void +Atomic_SetFence(Bool fenceAfterLock) /* IN: TRUE to enable lfence */ + /* FALSE to disable. */ +{ + AtomicUseFence = fenceAfterLock; +#if defined(__VMKERNEL__) + extern void Atomic_SetFenceVMKAPI(Bool fenceAfterLock); + Atomic_SetFenceVMKAPI(fenceAfterLock); +#endif + atomicFenceInitialized = TRUE; +} + + +/* Conditionally execute fence after interlocked instruction. */ +static INLINE void +AtomicEpilogue(void) +{ +#ifdef ATOMIC_USE_FENCE + if (UNLIKELY(AtomicUseFence)) { + asm volatile ("lfence" ::: "memory"); + } +#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 + */ + + +/* + *----------------------------------------------------------------------------- + * + * Atomic_Read -- + * + * Read + * + * Results: + * The value of the atomic variable. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static INLINE uint32 +Atomic_Read(Atomic_uint32 const *var) // IN +{ + return var->value; +} +#define Atomic_Read32 Atomic_Read + + +/* + *----------------------------------------------------------------------------- + * + * Atomic_Write -- + * + * Write + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static INLINE void +Atomic_Write(Atomic_uint32 *var, // IN + uint32 val) // IN +{ + var->value = val; +} +#define Atomic_Write32 Atomic_Write + + +/* + *----------------------------------------------------------------------------- + * + * 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 + uint32 val) // IN +#ifdef __GNUC__ +{ + /* Checked against the Intel manual and GCC --walken */ + __asm__ __volatile__( + "xchgl %0, %1" +# if VM_ASM_PLUS + : "=r" (val), + "+m" (var->value) + : "0" (val) +# else + : "=r" (val), + "=m" (var->value) + : "0" (val), + "1" (var->value) +# endif + ); + AtomicEpilogue(); + return val; +} +#elif _MSC_VER >= 1310 +{ + return _InterlockedExchange((long *)&var->value, (long)val); +} +#elif _MSC_VER +#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) +#else +#error No compiler defined for Atomic_ReadWrite +#endif +#define Atomic_ReadWrite32 Atomic_ReadWrite + + +/* + *----------------------------------------------------------------------------- + * + * 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 + uint32 oldVal, // IN + uint32 newVal) // IN +#ifdef __GNUC__ +{ + uint32 val; + + /* Checked against the Intel manual and GCC --walken */ + __asm__ __volatile__( + "lock; cmpxchgl %2, %1" +# if VM_ASM_PLUS + : "=a" (val), + "+m" (var->value) + : "r" (newVal), + "0" (oldVal) +# else + : "=a" (val), + "=m" (var->value) + : "r" (newVal), + "0" (oldVal) + /* + * "1" (var->value): results in inconsistent constraints on gcc 2.7.2.3 + * when compiling enterprise-2.2.17-14-RH7.0-update. + * The constraint has been commented out for now. We may consider doing + * this systematically, but we need to be sure it is the right thing to + * do. However, it is also possible that the offending use of this asm + * function will be removed in the near future in which case we may + * decide to reintroduce the constraint instead. hpreg & agesen. + */ +# endif + : "cc" + ); + AtomicEpilogue(); + return val; +} +#elif _MSC_VER >= 1310 +{ + return _InterlockedCompareExchange((long *)&var->value, + (long)newVal, + (long)oldVal); +} +#elif _MSC_VER +#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) +#else +#error No compiler defined for Atomic_ReadIfEqualWrite +#endif +#define Atomic_ReadIfEqualWrite32 Atomic_ReadIfEqualWrite + + +#if defined(__x86_64__) +/* + *----------------------------------------------------------------------------- + * + * 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 + uint64 oldVal, // IN + uint64 newVal) // IN +{ +#if defined(__GNUC__) + 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; +#elif _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 + uint32 val) // IN +{ +#ifdef __GNUC__ + /* Checked against the Intel manual and GCC --walken */ + __asm__ __volatile__( + "lock; andl %1, %0" +# if VM_ASM_PLUS + : "+m" (var->value) + : "ri" (val) +# else + : "=m" (var->value) + : "ri" (val), + "0" (var->value) +# endif + : "cc" + ); + AtomicEpilogue(); +#elif _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 + + +#if defined(__x86_64__) +/* + *----------------------------------------------------------------------------- + * + * Atomic_And64 -- + * + * Atomic read, bitwise AND with a value, write. + * + * Results: + * None + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static INLINE void +Atomic_And64(Atomic_uint64 *var, // IN + uint64 val) // IN +{ +#if defined(__GNUC__) + /* Checked against the AMD manual and GCC --hpreg */ + __asm__ __volatile__( + "lock; andq %1, %0" + : "+m" (var->value) + : "ri" (val) + : "cc" + ); + AtomicEpilogue(); +#elif _MSC_VER + _InterlockedAnd64((__int64 *)&var->value, (__int64)val); +#else +#error No compiler defined for Atomic_And64 +#endif +} +#endif + + +/* + *----------------------------------------------------------------------------- + * + * Atomic_Or -- + * + * Atomic read, bitwise OR with a value, write. + * + * Results: + * None + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static INLINE void +Atomic_Or(Atomic_uint32 *var, // IN + uint32 val) // IN +{ +#ifdef __GNUC__ + /* Checked against the Intel manual and GCC --walken */ + __asm__ __volatile__( + "lock; orl %1, %0" +# if VM_ASM_PLUS + : "+m" (var->value) + : "ri" (val) +# else + : "=m" (var->value) + : "ri" (val), + "0" (var->value) +# endif + : "cc" + ); + AtomicEpilogue(); +#elif _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 + + +#if defined(__x86_64__) +/* + *----------------------------------------------------------------------------- + * + * Atomic_Or64 -- + * + * Atomic read, bitwise OR with a value, write. + * + * Results: + * None + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static INLINE void +Atomic_Or64(Atomic_uint64 *var, // IN + uint64 val) // IN +{ +#if defined(__GNUC__) + /* Checked against the AMD manual and GCC --hpreg */ + __asm__ __volatile__( + "lock; orq %1, %0" + : "+m" (var->value) + : "ri" (val) + : "cc" + ); + AtomicEpilogue(); +#elif _MSC_VER + _InterlockedOr64((__int64 *)&var->value, (__int64)val); +#else +#error No compiler defined for Atomic_Or64 +#endif +} +#endif + + +/* + *----------------------------------------------------------------------------- + * + * Atomic_Xor -- + * + * Atomic read, bitwise XOR with a value, write. + * + * Results: + * None + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static INLINE void +Atomic_Xor(Atomic_uint32 *var, // IN + uint32 val) // IN +{ +#ifdef __GNUC__ + /* Checked against the Intel manual and GCC --walken */ + __asm__ __volatile__( + "lock; xorl %1, %0" +# if VM_ASM_PLUS + : "+m" (var->value) + : "ri" (val) +# else + : "=m" (var->value) + : "ri" (val), + "0" (var->value) +# endif + : "cc" + ); + AtomicEpilogue(); +#elif _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(__x86_64__) +/* + *----------------------------------------------------------------------------- + * + * Atomic_Xor64 -- + * + * Atomic read, bitwise XOR with a value, write. + * + * Results: + * None + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static INLINE void +Atomic_Xor64(Atomic_uint64 *var, // IN + uint64 val) // IN +{ +#if defined(__GNUC__) + /* Checked against the AMD manual and GCC --hpreg */ + __asm__ __volatile__( + "lock; xorq %1, %0" + : "+m" (var->value) + : "ri" (val) + : "cc" + ); + AtomicEpilogue(); +#elif _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 + uint32 val) // IN +{ +#ifdef __GNUC__ + /* Checked against the Intel manual and GCC --walken */ + __asm__ __volatile__( + "lock; addl %1, %0" +# if VM_ASM_PLUS + : "+m" (var->value) + : "ri" (val) +# else + : "=m" (var->value) + : "ri" (val), + "0" (var->value) +# endif + : "cc" + ); + AtomicEpilogue(); +#elif _MSC_VER >= 1310 + _InterlockedExchangeAdd((long *)&var->value, (long)val); +#elif _MSC_VER + __asm mov eax, val + __asm mov ebx, var + __asm lock add [ebx]Atomic_uint32.value, eax +#else +#error No compiler defined for Atomic_Add +#endif +} +#define Atomic_Add32 Atomic_Add + + +#if defined(__x86_64__) +/* + *----------------------------------------------------------------------------- + * + * Atomic_Add64 -- + * + * Atomic read, add a value, write. + * + * Results: + * None + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static INLINE void +Atomic_Add64(Atomic_uint64 *var, // IN + uint64 val) // IN +{ +#if defined(__GNUC__) + /* Checked against the AMD manual and GCC --hpreg */ + __asm__ __volatile__( + "lock; addq %1, %0" + : "+m" (var->value) + : "ri" (val) + : "cc" + ); + AtomicEpilogue(); +#elif _MSC_VER + _InterlockedExchangeAdd64((__int64 *)&var->value, (__int64)val); +#else +#error No compiler defined for Atomic_Add64 +#endif +} +#endif + + +/* + *----------------------------------------------------------------------------- + * + * Atomic_Sub -- + * + * Atomic read, subtract a value, write. + * + * Results: + * None + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static INLINE void +Atomic_Sub(Atomic_uint32 *var, // IN + uint32 val) // IN +{ +#ifdef __GNUC__ + /* Checked against the Intel manual and GCC --walken */ + __asm__ __volatile__( + "lock; subl %1, %0" +# if VM_ASM_PLUS + : "+m" (var->value) + : "ri" (val) +# else + : "=m" (var->value) + : "ri" (val), + "0" (var->value) +# endif + : "cc" + ); + AtomicEpilogue(); +#elif _MSC_VER >= 1310 + _InterlockedExchangeAdd((long *)&var->value, (long)-val); +#elif _MSC_VER + __asm mov eax, val + __asm mov ebx, var + __asm lock sub [ebx]Atomic_uint32.value, eax +#else +#error No compiler defined for Atomic_Sub +#endif +} +#define Atomic_Sub32 Atomic_Sub + + +#if defined(__x86_64__) +/* + *----------------------------------------------------------------------------- + * + * Atomic_Sub64 -- + * + * Atomic read, subtract a value, write. + * + * Results: + * None + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static INLINE void +Atomic_Sub64(Atomic_uint64 *var, // IN + uint64 val) // IN +{ +#ifdef __GNUC__ + /* Checked against the AMD manual and GCC --hpreg */ + __asm__ __volatile__( + "lock; subq %1, %0" + : "+m" (var->value) + : "ri" (val) + : "cc" + ); + AtomicEpilogue(); +#elif _MSC_VER + _InterlockedExchangeAdd64((__int64 *)&var->value, (__int64)-val); +#else +#error No compiler defined for Atomic_Sub64 +#endif +} +#endif + + +/* + *----------------------------------------------------------------------------- + * + * Atomic_Inc -- + * + * Atomic read, increment, write. + * + * Results: + * None + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static INLINE void +Atomic_Inc(Atomic_uint32 *var) // IN +{ +#ifdef __GNUC__ + /* Checked against the Intel manual and GCC --walken */ + __asm__ __volatile__( + "lock; incl %0" +# if VM_ASM_PLUS + : "+m" (var->value) + : +# else + : "=m" (var->value) + : "0" (var->value) +# endif + : "cc" + ); + AtomicEpilogue(); +#elif _MSC_VER >= 1310 + _InterlockedIncrement((long *)&var->value); +#elif _MSC_VER + __asm mov ebx, var + __asm lock inc [ebx]Atomic_uint32.value +#else +#error No compiler defined for Atomic_Inc +#endif +} +#define Atomic_Inc32 Atomic_Inc + + +#if defined(__x86_64__) +/* + *----------------------------------------------------------------------------- + * + * Atomic_Inc64 -- + * + * Atomic read, increment, write. + * + * Results: + * None + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static INLINE void +Atomic_Inc64(Atomic_uint64 *var) // IN +{ +#if defined(__GNUC__) + /* Checked against the AMD manual and GCC --hpreg */ + __asm__ __volatile__( + "lock; incq %0" + : "+m" (var->value) + : + : "cc" + ); + AtomicEpilogue(); +#elif _MSC_VER + _InterlockedIncrement64((__int64 *)&var->value); +#else +#error No compiler defined for Atomic_Inc64 +#endif +} +#endif + + +/* + *----------------------------------------------------------------------------- + * + * Atomic_Dec -- + * + * Atomic read, decrement, write. + * + * Results: + * None + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static INLINE void +Atomic_Dec(Atomic_uint32 *var) // IN +{ +#ifdef __GNUC__ + /* Checked against the Intel manual and GCC --walken */ + __asm__ __volatile__( + "lock; decl %0" +# if VM_ASM_PLUS + : "+m" (var->value) + : +# else + : "=m" (var->value) + : "0" (var->value) +# endif + : "cc" + ); + AtomicEpilogue(); +#elif _MSC_VER >= 1310 + _InterlockedDecrement((long *)&var->value); +#elif _MSC_VER + __asm mov ebx, var + __asm lock dec [ebx]Atomic_uint32.value +#else +#error No compiler defined for Atomic_Dec +#endif +} +#define Atomic_Dec32 Atomic_Dec + + +#if defined(__x86_64__) +/* + *----------------------------------------------------------------------------- + * + * Atomic_Dec64 -- + * + * Atomic read, decrement, write. + * + * Results: + * None + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static INLINE void +Atomic_Dec64(Atomic_uint64 *var) // IN +{ +#if defined(__GNUC__) + /* Checked against the AMD manual and GCC --hpreg */ + __asm__ __volatile__( + "lock; decq %0" + : "+m" (var->value) + : + : "cc" + ); + AtomicEpilogue(); +#elif _MSC_VER + _InterlockedDecrement64((__int64 *)&var->value); +#else +#error No compiler defined for Atomic_Dec64 +#endif +} +#endif + + +/* + * Note that the technique below can be used to implement ReadX(), where X is + * an arbitrary mathematical function. + */ + + +/* + *----------------------------------------------------------------------------- + * + * Atomic_FetchAndOr -- + * + * 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_FetchAndOr(Atomic_uint32 *var, // IN + uint32 val) // IN +{ + uint32 res; + + do { + res = var->value; + } while (res != Atomic_ReadIfEqualWrite(var, res, res | val)); + + return res; +} + + +/* + *----------------------------------------------------------------------------- + * + * Atomic_FetchAndAnd -- + * + * 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_FetchAndAnd(Atomic_uint32 *var, // IN + uint32 val) // IN +{ + uint32 res; + + do { + res = var->value; + } while (res != Atomic_ReadIfEqualWrite(var, res, res & val)); + + return res; +} +#define Atomic_ReadOr32 Atomic_FetchAndOr + + +#if defined(__x86_64__) +/* + *----------------------------------------------------------------------------- + * + * 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 + uint64 val) // IN +{ + uint64 res; + + do { + res = var->value; + } while (res != Atomic_ReadIfEqualWrite64(var, res, res | val)); + + return res; +} +#endif + + +/* + *----------------------------------------------------------------------------- + * + * Atomic_FetchAndAddUnfenced -- + * + * Atomic read (returned), add a value, write. + * + * If you have to implement FetchAndAdd() on an architecture other than + * x86 or x86-64, you might want to consider doing something similar to + * Atomic_FetchAndOr(). + * + * The "Unfenced" version of Atomic_FetchAndInc never executes + * "lfence" after the interlocked operation. + * + * Results: + * The value of the variable before the operation. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static INLINE uint32 +Atomic_FetchAndAddUnfenced(Atomic_uint32 *var, // IN + uint32 val) // IN +#ifdef __GNUC__ +{ + /* Checked against the Intel manual and GCC --walken */ + __asm__ __volatile__( +# if VM_ASM_PLUS + "lock; xaddl %0, %1" + : "=r" (val), + "+m" (var->value) + : "0" (val) + : "cc" +# else + "lock; xaddl %0, (%1)" + : "=r" (val) + : "r" (&var->value), + "0" (val) + : "cc", "memory" +# endif + ); + return val; +} +#elif _MSC_VER >= 1310 +{ + return _InterlockedExchangeAdd((long *)&var->value, (long)val); +} +#elif _MSC_VER +#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) +#else +#error No compiler defined for Atomic_FetchAndAdd +#endif +#define Atomic_ReadAdd32 Atomic_FetchAndAdd + + +/* + *----------------------------------------------------------------------------- + * + * Atomic_FetchAndAdd -- + * + * Atomic read (returned), add a value, write. + * + * If you have to implement FetchAndAdd() on an architecture other than + * x86 or x86-64, you might want to consider doing something similar to + * Atomic_FetchAndOr(). + * + * Unlike "Unfenced" version, this one may execute the "lfence" after + * interlocked operation. + * + * Results: + * The value of the variable before the operation. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static INLINE uint32 +Atomic_FetchAndAdd(Atomic_uint32 *var, // IN + uint32 val) // IN +#ifdef __GNUC__ +{ + val = Atomic_FetchAndAddUnfenced(var, val); + AtomicEpilogue(); + return val; +} +#else +{ + return Atomic_FetchAndAddUnfenced(var, val); +} +#endif + + +#if defined(__x86_64__) +/* + *----------------------------------------------------------------------------- + * + * Atomic_ReadAdd64 -- + * + * Atomic read (returned), add a value, write. + * + * Results: + * The value of the variable before the operation. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static INLINE uint64 +Atomic_ReadAdd64(Atomic_uint64 *var, // IN + uint64 val) // IN +{ +#if defined(__GNUC__) + /* Checked against the AMD manual and GCC --hpreg */ + __asm__ __volatile__( + "lock; xaddq %0, %1" + : "=r" (val), + "+m" (var->value) + : "0" (val) + : "cc" + ); + AtomicEpilogue(); + return val; +#elif _MSC_VER + return _InterlockedExchangeAdd64((__int64 *)&var->value, (__int64)val); +#else +#error No compiler defined for Atomic_ReadAdd64 +#endif +} +#endif + + +/* + *----------------------------------------------------------------------------- + * + * Atomic_FetchAndInc -- + * + * Atomic read (returned), increment, write. + * + * Results: + * The value of the variable before the operation. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static INLINE uint32 +Atomic_FetchAndInc(Atomic_uint32 *var) // IN +{ + return Atomic_FetchAndAdd(var, 1); +} +#define Atomic_ReadInc32 Atomic_FetchAndInc + + +#if defined(__x86_64__) +/* + *----------------------------------------------------------------------------- + * + * Atomic_ReadInc64 -- + * + * Atomic read (returned), increment, write. + * + * Results: + * The value of the variable before the operation. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static INLINE uint64 +Atomic_ReadInc64(Atomic_uint64 *var) // IN +{ + return Atomic_ReadAdd64(var, 1); +} +#endif + + +/* + *----------------------------------------------------------------------------- + * + * Atomic_FetchAndDec -- + * + * Atomic read (returned), decrement, write. + * + * Results: + * The value of the variable before the operation. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static INLINE uint32 +Atomic_FetchAndDec(Atomic_uint32 *var) // IN +{ + return Atomic_FetchAndAdd(var, (uint32)-1); +} +#define Atomic_ReadDec32 Atomic_FetchAndDec + + +#if defined(__x86_64__) +/* + *----------------------------------------------------------------------------- + * + * Atomic_ReadDec64 -- + * + * Atomic read (returned), decrement, write. + * + * Results: + * The value of the variable before the operation. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static INLINE uint64 +Atomic_ReadDec64(Atomic_uint64 *var) // IN +{ + return Atomic_ReadAdd64(var, CONST64U(-1)); +} +#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 +#ifdef __GNUC__ +{ + Bool equal; + + /* Checked against the Intel manual and GCC --walken */ +#ifdef VMM64 + 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 */ + int dummy1, dummy2; +# if defined __PIC__ && !vm_x86_64 // %ebx is reserved by the compiler. +# if defined __GNUC__ && __GNUC__ < 3 // Part of #188541 - for RHL 6.2 etc. + __asm__ __volatile__( + "xchg %%ebx, %6\n\t" + "mov (%%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) + : "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" + // %3 is a register to make sure it cannot be %ebx-relative. + "lock; cmpxchg8b (%3)" "\n\t" + "xchgl %%ebx, %6" "\n\t" + // Must come after restoring %ebx: %0 could be %ebx-relative. + "sete %0" + : "=qm" (equal), + "=a" (dummy1), + "=d" (dummy2) + : "r" (var), + "1" (((S_uint64 const *)oldVal)->lowValue), + "2" (((S_uint64 const *)oldVal)->highValue), + // Cannot use "m" here: 'newVal' is read-only. + "r" (((S_uint64 const *)newVal)->lowValue), + "c" (((S_uint64 const *)newVal)->highValue) + : "cc", "memory" + ); +# endif +# else + __asm__ __volatile__( + "lock; cmpxchg8b %0" "\n\t" + "sete %1" +# if VM_ASM_PLUS + : "+m" (*var), +# else + : "=m" (*var), +# endif + "=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; +} +#elif _MSC_VER +#if defined(__x86_64__) +{ + return *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 + + +/* + *----------------------------------------------------------------------------- + * + * 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 +{ +#ifdef __GNUC__ + Bool equal; + + uint32 dummy; + __asm__ __volatile__( + "lock; cmpxchgl %3, %0" "\n\t" + "sete %1" +# if VM_ASM_PLUS + : "+m" (*var), + "=qm" (equal), + "=a" (dummy) + : "r" (newVal), + "2" (oldVal) +# else + : "=m" (*var), + "=qm" (equal), + "=a" (dummy) + : /*"0" (*var), */ + "r" (newVal), + "2" (oldVal) +# endif + : "cc" + ); + AtomicEpilogue(); + return equal; +#else + return (Atomic_ReadIfEqualWrite(var, oldVal, newVal) == oldVal); +#endif +} + + +/* + *----------------------------------------------------------------------------- + * + * 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(__x86_64__) +{ + return var->value; +} +#elif defined(__GNUC__) && defined(__i386__) /* GCC on x86 */ +{ + 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 _MSC_VER /* MSC (assume on x86 for now) */ +# 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) +#else +# error No compiler defined for Atomic_Read64 +#endif + + +/* + *---------------------------------------------------------------------- + * + * Atomic_FetchAndAdd64 -- + * + * 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_FetchAndAdd64(Atomic_uint64 *var, // IN/OUT + uint64 addend) // IN +{ + uint64 oldVal; + uint64 newVal; + + do { + oldVal = var->value; + newVal = oldVal + addend; + } while (!Atomic_CMPXCHG64(var, &oldVal, &newVal)); + + return oldVal; +} + + +/* + *---------------------------------------------------------------------- + * + * Atomic_FetchAndInc64 -- + * + * Atomically increments a 64-bit integer + * + * Results: + * Returns the old value just prior to incrementing + * + * Side effects: + * None + * + *---------------------------------------------------------------------- + */ + +static INLINE uint64 +Atomic_FetchAndInc64(Atomic_uint64 *var) // IN/OUT +{ + return Atomic_FetchAndAdd64(var, 1); +} + + +/* + *---------------------------------------------------------------------- + * + * Atomic_FetchAndDec64 -- + * + * Atomically decrements a 64-bit integer + * + * Results: + * Returns the old value just prior to decrementing + * + * Side effects: + * None + * + *---------------------------------------------------------------------- + */ + +static INLINE uint64 +Atomic_FetchAndDec64(Atomic_uint64 *var) // IN/OUT +{ + uint64 oldVal; + uint64 newVal; + + do { + oldVal = var->value; + newVal = oldVal - 1; + } while (!Atomic_CMPXCHG64(var, &oldVal, &newVal)); + + return oldVal; +} + + +/* + *----------------------------------------------------------------------------- + * + * 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 + 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 _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, // IN + uint64 val) // IN +{ +#if defined(__x86_64__) + var->value = val; +#else + (void)Atomic_ReadWrite64(var, val); +#endif +} + + +/* + * Template code for the Atomic_<name> type and its operators. + * + * The cast argument is an intermedia 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 + */ + +#define MAKE_ATOMIC_TYPE(name, size, in, out, cast) \ + typedef Atomic_uint ## size Atomic_ ## name; \ + \ + \ + 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(__x86_64__) +MAKE_ATOMIC_TYPE(Ptr, 64, void const *, void *, uintptr_t) +MAKE_ATOMIC_TYPE(Int, 64, int, int, int) +#else +MAKE_ATOMIC_TYPE(Ptr, 32, void const *, void *, uintptr_t) +MAKE_ATOMIC_TYPE(Int, 32, int, int, int) +#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_". + * + * 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_Xor(&fence, 0x1); +} + +#endif // ifndef _ATOMIC_H_ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmci/vm_basic_defs.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vm_basic_defs.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmci/vm_basic_defs.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vm_basic_defs.h 2008-10-13 08:01:41.000000000 +0100 @@ -0,0 +1,606 @@ +/********************************************************* + * Copyright (C) 2003 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * 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_VMMEXT +#define INCLUDE_ALLOW_MODULE +#define INCLUDE_ALLOW_VMMON +#define INCLUDE_ALLOW_VMNIXMOD +#define INCLUDE_ALLOW_VMKERNEL +#define INCLUDE_ALLOW_VMKDRIVERS +#define INCLUDE_ALLOW_VMK_MODULE +#define INCLUDE_ALLOW_DISTRIBUTE +#define INCLUDE_ALLOW_VMCORE +#define INCLUDE_ALLOW_VMIROM +#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 <stddef.h> /* + * We re-define offsetof macro from stddef, make + * sure that its already defined before we do it + */ + #include <windows.h> // for Sleep() and LOWORD() etc. +#endif + + +/* + * Simple macros + */ + +#if (defined __APPLE__ || defined __FreeBSD__) && \ + (!defined KERNEL && !defined _KERNEL && !defined VMKERNEL && !defined __KERNEL__) +# include <stddef.h> +#else +// XXX the __cplusplus one matches that of VC++, to prevent redefinition warning +// XXX the other one matches that of gcc3.3.3/glibc2.2.4 to prevent redefinition warnings +#ifndef offsetof +#ifdef __cplusplus +#define offsetof(s,m) (size_t)&(((s *)0)->m) +#else +#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) +#endif +#endif +#endif // __APPLE__ + +#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 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 <machine/param.h> +#undef MASK +#endif +#define MASK(n) ((1 << (n)) - 1) /* make an n-bit mask */ +#define DWORD_ALIGN(x) ((((x)+3) >> 2) << 2) +#define QWORD_ALIGN(x) ((((x)+4) >> 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) + + +/* + * 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 +#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 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 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 + +#define HIDWORD(_qw) ((uint32)((_qw) >> 32)) +#define LODWORD(_qw) ((uint32)(_qw)) +#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 + +/* + * Get the frame pointer. We use this assembly hack instead of + * __builtin_frame_address() due to a bug introduced in gcc 4.1.1 + */ +static INLINE_SINGLE_CALLER uintptr_t +GetFrameAddr(void) +{ + uintptr_t bp; +#if (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ == 0)) + bp = (uintptr_t)__builtin_frame_address(0); +#elif (__GNUC__ == 4 && __GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ <= 3) +# if defined(VMM64) || defined(VM_X86_64) + __asm__ __volatile__("movq %%rbp, %0\n" : "=g" (bp)); +# else + __asm__ __volatile__("movl %%ebp, %0\n" : "=g" (bp)); +# endif +#else + __asm__ __volatile__( +#ifdef __linux__ + ".print \"This newer version of GCC may or may not have the " + "__builtin_frame_address bug. Need to update this. " + "See bug 147638.\"\n" + ".abort" +#else /* MacOS */ + ".abort \"This newer version of GCC may or may not have the " + "__builtin_frame_address bug. Need to update this. " + "See bug 147638.\"\n" +#endif + : "=g" (bp) + ); +#endif + return bp; +} + + +/* + * Returns the frame pointer of the calling function. + * Equivalent to __builtin_frame_address(1). + */ +static INLINE_SINGLE_CALLER uintptr_t +GetCallerFrameAddr(void) +{ + return *(uintptr_t*)GetFrameAddr(); +} + +#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) +#else +# include <sched.h> // For sched_yield. Don't ask. --Jeremy. +# define YIELD() sched_yield() +#endif + + +/* + * Standardize some Posix names on Windows. + */ + +#ifdef _WIN32 // { + +#define snprintf _snprintf +#define vsnprintf _vsnprintf + +static INLINE void +sleep(unsigned int sec) +{ + Sleep(sec * 1000); +} + +static INLINE void +usleep(unsigned long usec) +{ + Sleep(CEILING(usec, 1000)); +} + +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) + +/* + * MacOS kernel-mode needs va_copy. Based on inspection of stdarg.h + * from the MacOSX10.4u.sdk kernel framework, this should work. + * (Future versions of the SDK may break this). + */ + +#define va_copy(dest, src) ((dest) = (src)) + +#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 + +/* + * 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_INTEL_SECRET +#if !defined(COMMUNITY_SOURCE) || defined(INTEL_SOURCE) +/* + * It's ok to include INTEL_SECRET source code for non-commsrc, + * or for drops directed at Intel. + */ + #define COMMUNITY_SOURCE_INTEL_SECRET +#endif + +/* + * Convenience macros and definitions. Can often be used instead of #ifdef. + */ + +#undef DEBUG_ONLY +#undef SL_DEBUG_ONLY +#undef VMX86_SL_DEBUG +#ifdef VMX86_DEBUG +#define vmx86_debug 1 +#define DEBUG_ONLY(x) x +/* + * Be very, very, very careful with SL_DEBUG. Pls ask ganesh or min before + * using it. + */ +#define VMX86_SL_DEBUG +#define vmx86_sl_debug 1 +#define SL_DEBUG_ONLY(x) x +#else +#define vmx86_debug 0 +#define DEBUG_ONLY(x) +#define vmx86_sl_debug 0 +#define SL_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_VMM_SERIAL_LOGGING +#define vmx86_vmm_serial_log 1 +#define VMM_SERIAL_LOG_ONLY(x) x +#else +#define vmx86_vmm_serial_log 0 +#define VMM_SERIAL_LOG_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 VMX86_WGS +#define vmx86_wgs 1 +#define WGS_ONLY(x) x +#else +#define vmx86_wgs 0 +#define WGS_ONLY(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) +#else +#define WIN32_ONLY(x) +#define POSIX_ONLY(x) 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 (-1) +#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_DEBUG) || defined(ASSERT_ALWAYS_AVAILABLE) +#define WinDrvPrint(arg, ...) DbgPrint(arg, __VA_ARGS__) +#define WinDrvEngPrint(arg, ...) EngDbgPrint(arg, __VA_ARGS__) +#else +#define WinDrvPrint(arg, ...) +#define WinDrvEngPrint(arg, ...) +#endif +#endif +#endif // _WIN32 + +#endif // ifndef _VM_BASIC_DEFS_H_ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmci/vm_basic_types.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vm_basic_types.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmci/vm_basic_types.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vm_basic_types.h 2008-10-13 08:01:41.000000000 +0100 @@ -0,0 +1,912 @@ +/********************************************************* + * Copyright (C) 1998-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 General Public License as published by the + * Free Software Foundation version 2 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 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 + * + *********************************************************/ + +/* + * + * vm_basic_types.h -- + * + * basic data types. + */ + + +#ifndef _VM_BASIC_TYPES_H_ +#define _VM_BASIC_TYPES_H_ + +#define INCLUDE_ALLOW_USERLEVEL +#define INCLUDE_ALLOW_VMMEXT +#define INCLUDE_ALLOW_MODULE +#define INCLUDE_ALLOW_VMMON +#define INCLUDE_ALLOW_VMNIXMOD +#define INCLUDE_ALLOW_VMKERNEL +#define INCLUDE_ALLOW_VMKDRIVERS +#define INCLUDE_ALLOW_VMK_MODULE +#define INCLUDE_ALLOW_DISTRIBUTE +#define INCLUDE_ALLOW_VMCORE +#define INCLUDE_ALLOW_VMIROM +#include "includeCheck.h" + +/* STRICT ANSI means the Xserver build and X defines Bool differently. */ +#if !defined(__STRICT_ANSI__) || defined(__FreeBSD__) +typedef char Bool; +#endif + +#ifndef FALSE +#define FALSE 0 +#endif + +#ifndef TRUE +#define TRUE 1 +#endif + +#define IsBool(x) (((x) & ~1) == 0) +#define IsBool2(x, y) ((((x) | (y)) & ~1) == 0) + +/* + * Macros __i386__ and __ia64 are intrinsically defined by GCC + */ +#ifdef __i386__ +#define VM_I386 +#endif + +#ifdef _WIN64 +#define __x86_64__ +#endif + +#ifdef __x86_64__ +#define VM_X86_64 +#define VM_I386 +#define vm_x86_64 (1) +#else +#define vm_x86_64 (0) +#endif + + + +#ifdef _WIN32 +/* safe assumption for a while */ +#define VM_I386 +#endif + +#ifdef _MSC_VER +typedef unsigned __int64 uint64; +typedef signed __int64 int64; + +#pragma warning (3 :4505) // unreferenced local function +#pragma warning (disable :4018) // signed/unsigned mismatch +#pragma warning (disable :4761) // integral size mismatch in argument; conversion supplied +#pragma warning (disable :4305) // truncation from 'const int' to 'short' +#pragma warning (disable :4244) // conversion from 'unsigned short' to 'unsigned char' +#pragma warning (disable :4267) // truncation of 'size_t' +#pragma warning (disable :4146) // unary minus operator applied to unsigned type, result still unsigned +#pragma warning (disable :4142) // benign redefinition of type + +#elif __GNUC__ +/* The Xserver source compiles with -ansi -pendantic */ +#ifndef __STRICT_ANSI__ +#if defined(VM_X86_64) +typedef unsigned long uint64; +typedef long int64; +#else +typedef unsigned long long uint64; +typedef long long int64; +#endif +#elif __FreeBSD__ +typedef unsigned long long uint64; +typedef long long int64; +#endif +#else +#error - Need compiler define for int64/uint64 +#endif + +typedef unsigned int uint32; +typedef unsigned short uint16; +typedef unsigned char uint8; + +typedef int int32; +typedef short int16; +typedef char int8; + +/* + * FreeBSD (for the tools build) unconditionally defines these in + * sys/inttypes.h so don't redefine them if this file has already + * been included. [greg] + * + * This applies to Solaris as well. + */ + +/* + * Before trying to do the includes based on OS defines, see if we can use + * feature-based defines to get as much functionality as possible + */ + +#ifdef HAVE_INTTYPES_H +#include <inttypes.h> +#endif +#ifdef HAVE_SYS_TYPES_H +#include <sys/types.h> +#endif +#ifdef HAVE_SYS_INTTYPES_H +#include <sys/inttypes.h> +#endif +#ifdef HAVE_STDINT_H +#include <stdint.h> +#endif +#ifdef HAVE_STDLIB_H +#include <stdlib.h> +#endif + +#ifdef __FreeBSD__ +#include <sys/param.h> /* For __FreeBSD_version */ +#endif + +#if !defined(USING_AUTOCONF) +# if defined(__FreeBSD__) || defined(sun) +# ifdef KLD_MODULE +# include <sys/types.h> +# else +# if !defined(VMKERNEL) && (__FreeBSD_version >= 500043) +# include <inttypes.h> +# include <sys/types.h> +# else +# include <sys/inttypes.h> +# endif +# endif +# elif defined __APPLE__ +# if KERNEL +# include <sys/unistd.h> +# include <sys/types.h> /* mostly for size_t */ +# include <stdint.h> +# else +# include <unistd.h> +# include <inttypes.h> +# include <stdlib.h> +# include <stdint.h> +# endif +# else +# if !defined(__intptr_t_defined) && !defined(intptr_t) +# define __intptr_t_defined +# define intptr_t intptr_t +# ifdef VM_I386 +# ifdef VM_X86_64 +typedef int64 intptr_t; +# else +typedef int32 intptr_t; +# endif +# endif +# endif + +# ifndef _STDINT_H +# ifdef VM_I386 +# ifdef VM_X86_64 +typedef uint64 uintptr_t; +# else +typedef uint32 uintptr_t; +# endif +# endif +# endif +# endif +#endif + + +/* + * Time + * XXX These should be cleaned up. -- edward + */ + +typedef int64 VmTimeType; /* Time in microseconds */ +typedef int64 VmTimeRealClock; /* Real clock kept in microseconds */ +typedef int64 VmTimeVirtualClock; /* Virtual Clock kept in CPU cycles */ + +/* + * Printf format specifiers for size_t and 64-bit number. + * Use them like this: + * printf("%"FMT64"d\n", big); + * + * FMTH is for handles/fds. + */ + +#ifdef _MSC_VER + #define FMT64 "I64" + #ifdef VM_X86_64 + #define FMTSZ "I64" + #define FMTPD "I64" + #define FMTH "I64" + #else + #define FMTSZ "I" + #define FMTPD "I" + #define FMTH "I" + #endif +#elif __GNUC__ + #define FMTH "" + #if defined(N_PLAT_NLM) || defined(sun) || \ + (defined(__FreeBSD__) && (__FreeBSD__ + 0) && ((__FreeBSD__ + 0) < 5)) + /* + * Why (__FreeBSD__ + 0)? See bug 141008. + * Yes, we really need to test both (__FreeBSD__ + 0) and + * ((__FreeBSD__ + 0) < 5). No, we can't remove "+ 0" from + * ((__FreeBSD__ + 0) < 5). + */ + #ifdef VM_X86_64 + #define FMTSZ "l" + #define FMTPD "l" + #else + #define FMTSZ "" + #define FMTPD "" + #endif + #elif defined(__linux__) \ + || (defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200112L) \ + || (defined(_POSIX_VERSION) && _POSIX_VERSION >= 200112L) \ + || (defined(_POSIX2_VERSION) && _POSIX2_VERSION >= 200112L) + /* BSD/Darwin, Linux */ + #define FMTSZ "z" + + #if defined(VM_X86_64) || defined(__APPLE__) + #define FMTPD "l" + #else + #define FMTPD "" + #endif + #else + /* Systems with a pre-C99 libc */ + #define FMTSZ "Z" + #ifdef VM_X86_64 + #define FMTPD "l" + #else + #define FMTPD "" + #endif + #endif + #ifdef VM_X86_64 + #define FMT64 "l" + #elif defined(sun) || defined(__APPLE__) || defined(__FreeBSD__) + #define FMT64 "ll" + #else + #define FMT64 "L" + #endif +#else + #error - Need compiler define for FMT64 and FMTSZ +#endif + +/* + * Suffix for 64-bit constants. Use it like this: + * CONST64(0x7fffffffffffffff) for signed or + * CONST64U(0x7fffffffffffffff) for unsigned. + * + * 2004.08.30(thutt): + * The vmcore/asm64/gen* programs are compiled as 32-bit + * applications, but must handle 64 bit constants. If the + * 64-bit-constant defining macros are already defined, the + * definition will not be overwritten. + */ + +#if !defined(CONST64) || !defined(CONST64U) +#ifdef _MSC_VER +#define CONST64(c) c##I64 +#define CONST64U(c) c##uI64 +#elif __GNUC__ +#ifdef VM_X86_64 +#define CONST64(c) c##L +#define CONST64U(c) c##uL +#else +#define CONST64(c) c##LL +#define CONST64U(c) c##uLL +#endif +#else +#error - Need compiler define for CONST64 +#endif +#endif + +/* + * Use CONST3264/CONST3264U if you want a constant to be + * treated as a 32-bit number on 32-bit compiles and + * a 64-bit number on 64-bit compiles. Useful in the case + * of shifts, like (CONST3264U(1) << x), where x could be + * more than 31 on a 64-bit compile. + */ + +#ifdef VM_X86_64 + #define CONST3264(a) CONST64(a) + #define CONST3264U(a) CONST64U(a) +#else + #define CONST3264(a) (a) + #define CONST3264U(a) (a) +#endif + +#define MIN_INT32 ((int32)0x80000000) +#define MAX_INT32 ((int32)0x7fffffff) + +#define MIN_UINT32 ((uint32)0) +#define MAX_UINT32 ((uint32)0xffffffff) + +#define MIN_INT64 (CONST64(0x8000000000000000)) +#define MAX_INT64 (CONST64(0x7fffffffffffffff)) + +#define MIN_UINT64 (CONST64U(0)) +#define MAX_UINT64 (CONST64U(0xffffffffffffffff)) + +typedef uint8 *TCA; /* Pointer into TC (usually). */ + +/* + * Type big enough to hold an integer between 0..100 + */ +typedef uint8 Percent; +#define AsPercent(v) ((Percent)(v)) +#define CHOOSE_PERCENT AsPercent(101) + + +typedef uintptr_t VA; +typedef uintptr_t VPN; + +typedef uint64 PA; +typedef uint32 PPN; + +typedef uint64 PhysMemOff; +typedef uint64 PhysMemSize; + +/* The Xserver source compiles with -ansi -pendantic */ +#ifndef __STRICT_ANSI__ +typedef uint64 BA; +#endif +typedef uint32 BPN; +typedef uint32 PageNum; +typedef unsigned MemHandle; +typedef int32 World_ID; + +#define INVALID_WORLD_ID ((World_ID)0) + +typedef World_ID User_CartelID; +#define INVALID_CARTEL_ID INVALID_WORLD_ID + +typedef User_CartelID User_SessionID; +#define INVALID_SESSION_ID INVALID_CARTEL_ID + +typedef User_CartelID User_CartelGroupID; +#define INVALID_CARTELGROUP_ID INVALID_CARTEL_ID + +typedef uint32 Worldlet_ID; +#define INVALID_WORLDLET_ID ((Worldlet_ID)0) + +/* world page number */ +typedef uint32 WPN; + +/* The Xserver source compiles with -ansi -pendantic */ +#ifndef __STRICT_ANSI__ +typedef uint64 MA; +typedef uint32 MPN; +#endif + +/* + * This type should be used for variables that contain sector + * position/quantity. + */ +typedef uint64 SectorType; + +/* + * Linear address + */ + +typedef uintptr_t LA; +typedef uintptr_t LPN; +#define LA_2_LPN(_la) ((_la) >> PAGE_SHIFT) +#define LPN_2_LA(_lpn) ((_lpn) << PAGE_SHIFT) + +#define LAST_LPN ((((LA) 1) << (8 * sizeof(LA) - PAGE_SHIFT)) - 1) +#define LAST_LPN32 ((((LA32)1) << (8 * sizeof(LA32) - PAGE_SHIFT)) - 1) +#define LAST_LPN64 ((((LA64)1) << (8 * sizeof(LA64) - PAGE_SHIFT)) - 1) + +/* Valid bits in a LPN. */ +#define LPN_MASK LAST_LPN +#define LPN_MASK32 LAST_LPN32 +#define LPN_MASK64 LAST_LPN64 + +/* + * On 64 bit platform, address and page number types default + * to 64 bit. When we need to represent a 32 bit address, we use + * types defined below. + * + * On 32 bit platform, the following types are the same as the + * default types. + */ +typedef uint32 VA32; +typedef uint32 VPN32; +typedef uint32 LA32; +typedef uint32 LPN32; +typedef uint32 PA32; +typedef uint32 PPN32; +typedef uint32 MA32; +typedef uint32 MPN32; + +/* + * On 64 bit platform, the following types are the same as the + * default types. + */ +typedef uint64 VA64; +typedef uint64 VPN64; +typedef uint64 LA64; +typedef uint64 LPN64; +typedef uint64 PA64; +typedef uint64 PPN64; +typedef uint64 MA64; +typedef uint64 MPN64; + +/* + * VA typedefs for user world apps. + */ +typedef VA32 UserVA32; +typedef VA64 UserVA64; +typedef UserVA32 UserVAConst; /* Userspace ptr to data that we may only read. */ +typedef UserVA64 UserVA64Const; /* Used by 64-bit syscalls until conversion is finished. */ +#ifdef VMKERNEL +typedef UserVA32 UserVA; +#else +typedef void * UserVA; +#endif + + +/* + * Maximal possible PPN value (errors too) that PhysMem can handle. + * Must be at least as large as MAX_PPN which is the maximum PPN + * for any region other than buserror. + */ +#define PHYSMEM_MAX_PPN ((PPN)0xffffffff) +#define MAX_PPN ((PPN)0x1fffffff) /* Maximal observable PPN value. */ +#define INVALID_PPN ((PPN)0xffffffff) + +#define INVALID_BPN ((BPN) 0x1fffffff) + +#define INVALID_MPN ((MPN)-1) +#define MEMREF_MPN ((MPN)-2) +#define RESERVED_MPN ((MPN) 0) +/* Support 39 bits of address space, minus one page. */ +#define MAX_MPN ((MPN) 0x07ffffff) + +#define INVALID_LPN ((LPN)-1) +#define INVALID_VPN ((VPN)-1) +#define INVALID_LPN64 ((LPN64)-1) +#define INVALID_PAGENUM ((PageNum)-1) +#define INVALID_WPN ((WPN) -1) + + +/* + * Format modifier for printing VA, LA, and VPN. + * Use them like this: Log("%#"FMTLA"x\n", laddr) + */ + +#if defined(VMM64) || defined(FROBOS64) || vm_x86_64 || defined __APPLE__ +# define FMTLA "l" +# define FMTVA "l" +# define FMTVPN "l" +#else +# define FMTLA "" +# define FMTVA "" +# define FMTVPN "" +#endif + +#ifndef EXTERN +#define EXTERN extern +#endif +#define CONST const + + +#ifndef INLINE +# ifdef _MSC_VER +# define INLINE __inline +# else +# define INLINE inline +# endif +#endif + + +/* + * Annotation for data that may be exported into a DLL and used by other + * apps that load that DLL and import the data. + */ +#if defined(_WIN32) && defined(VMX86_IMPORT_DLLDATA) +# define VMX86_EXTERN_DATA extern __declspec(dllimport) +#else // !_WIN32 +# define VMX86_EXTERN_DATA extern +#endif + +#if defined(_WIN32) && !defined(VMX86_NO_THREADS) +#define THREADSPECIFIC __declspec(thread) +#else +#define THREADSPECIFIC +#endif + +/* + * Due to the wonderful "registry redirection" feature introduced in + * 64-bit Windows, if you access any key under HKLM\Software in 64-bit + * code, you need to open/create/delete that key with + * VMKEY_WOW64_32KEY if you want a consistent view with 32-bit code. + */ + +#ifdef _WIN32 +#ifdef _WIN64 +#define VMW_KEY_WOW64_32KEY KEY_WOW64_32KEY +#else +#define VMW_KEY_WOW64_32KEY 0x0 +#endif +#endif + + +/* + * Consider the following reasons functions are inlined: + * + * 1) inlined for performance reasons + * 2) inlined because it's a single-use function + * + * Functions which meet only condition 2 should be marked with this + * inline macro; It is not critical to be inlined (but there is a + * code-space & runtime savings by doing so), so when other callers + * are added the inline-ness should be removed. + */ + +#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) +/* + * Starting at version 3.3, gcc does not always inline functions marked + * 'inline' (it depends on their size). To force gcc to do so, one must use the + * extra __always_inline__ attribute. + */ +# define INLINE_SINGLE_CALLER INLINE __attribute__((__always_inline__)) +# if defined(VMM) \ + && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 1)) +# warning Verify INLINE_SINGLE_CALLER '__always_inline__' attribute (did \ + monitor size change?) +# endif +#else +# define INLINE_SINGLE_CALLER INLINE +#endif + +/* + * Used when a hard guaranteed of no inlining is needed. Very few + * instances need this since the absence of INLINE is a good hint + * that gcc will not do inlining. + */ + +#if defined(__GNUC__) && defined(VMM) +#define ABSOLUTELY_NOINLINE __attribute__((__noinline__)) +#endif + +/* + * Attributes placed on function declarations to tell the compiler + * that the function never returns. + */ + +#ifdef _MSC_VER +#define NORETURN __declspec(noreturn) +#elif __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 9) +#define NORETURN __attribute__((__noreturn__)) +#else +#define NORETURN +#endif + +/* + * GCC 3.2 inline asm needs the + constraint for input/ouput memory operands. + * Older GCCs don't know about it --hpreg + */ + +#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2) +# define VM_ASM_PLUS 1 +#else +# define VM_ASM_PLUS 0 +#endif + +/* + * Branch prediction hints: + * LIKELY(exp) - Expression exp is likely TRUE. + * UNLIKELY(exp) - Expression exp is likely FALSE. + * Usage example: + * if (LIKELY(excCode == EXC_NONE)) { + * or + * if (UNLIKELY(REAL_MODE(vc))) { + * + * We know how to predict branches on gcc3 and later (hopefully), + * all others we don't so we do nothing. + */ + +#if (__GNUC__ >= 3) +/* + * gcc3 uses __builtin_expect() to inform the compiler of an expected value. + * We use this to inform the static branch predictor. The '!!' in LIKELY + * will convert any !=0 to a 1. + */ +#define LIKELY(_exp) __builtin_expect(!!(_exp), 1) +#define UNLIKELY(_exp) __builtin_expect((_exp), 0) +#else +#define LIKELY(_exp) (_exp) +#define UNLIKELY(_exp) (_exp) +#endif + +/* + * GCC's argument checking for printf-like functions + * This is conditional until we have replaced all `"%x", void *' + * with `"0x%08x", (uint32) void *'. Note that %p prints different things + * on different platforms. Argument checking is enabled for the + * vmkernel, which has already been cleansed. + * + * fmtPos is the position of the format string argument, beginning at 1 + * varPos is the position of the variable argument, beginning at 1 + */ + +#if defined(__GNUC__) +# define PRINTF_DECL(fmtPos, varPos) __attribute__((__format__(__printf__, fmtPos, varPos))) +#else +# define PRINTF_DECL(fmtPos, varPos) +#endif + +#if defined(__GNUC__) +# define SCANF_DECL(fmtPos, varPos) __attribute__((__format__(__scanf__, fmtPos, varPos))) +#else +# define SCANF_DECL(fmtPos, varPos) +#endif + +/* + * UNUSED_PARAM should surround the parameter name and type declaration, + * e.g. "int MyFunction(int var1, UNUSED_PARAM(int var2))" + * + */ + +#ifndef UNUSED_PARAM +# if defined(__GNUC__) +# define UNUSED_PARAM(_parm) _parm __attribute__((__unused__)) +# else +# define UNUSED_PARAM(_parm) _parm +# endif +#endif + +/* + * REGPARM defaults to REGPARM3, i.e., a requent that gcc + * puts the first three arguments in registers. (It is fine + * if the function has fewer than three args.) Gcc only. + * Syntactically, put REGPARM where you'd put INLINE or NORETURN. + */ + +#if defined(__GNUC__) +# define REGPARM0 __attribute__((regparm(0))) +# define REGPARM1 __attribute__((regparm(1))) +# define REGPARM2 __attribute__((regparm(2))) +# define REGPARM3 __attribute__((regparm(3))) +# define REGPARM REGPARM3 +#else +# define REGPARM0 +# define REGPARM1 +# define REGPARM2 +# define REGPARM3 +# define REGPARM +#endif + +/* + * ALIGNED specifies minimum alignment in "n" bytes. + */ + +#ifdef __GNUC__ +#define ALIGNED(n) __attribute__((__aligned__(n))) +#else +#define ALIGNED(n) +#endif + +/* + *********************************************************************** + * STRUCT_OFFSET_CHECK -- */ /** + * + * \brief Check if the actual offsef of a member in a structure + * is what is expected + * + * + * \param[in] STRUCT Structure the member is a part of. + * \param[in] MEMBER Member to check the offset of. + * \param[in] OFFSET Expected offset of MEMBER in STRUCTURE. + * \param[in] DEBUG_EXTRA Additional bytes to be added to OFFSET to + * compensate for extra info in debug builds. + * + *********************************************************************** + */ +#ifdef VMX86_DEBUG +#define STRUCT_OFFSET_CHECK(STRUCT, MEMBER, OFFSET, DEBUG_EXTRA) \ + ASSERT_ON_COMPILE(vmk_offsetof(STRUCT, MEMBER) == (OFFSET + DEBUG_EXTRA)) +#else +#define STRUCT_OFFSET_CHECK(STRUCT, MEMBER, OFFSET, DEBUG_EXTRA) \ + ASSERT_ON_COMPILE(vmk_offsetof(STRUCT, MEMBER) == OFFSET) +#endif + +/* + *********************************************************************** + * STRUCT_SIZE_CHECK -- */ /** + * + * \brief Check if the actual size of a structure is what is expected + * + * + * \param[in] STRUCT Structure whose size is to be checked. + * \param[in] SIZE Expected size of STRUCT. + * \param[in] DEBUG_EXTRA Additional bytes to be added to SIZE to + * compensate for extra info in debug builds. + * + *********************************************************************** + */ +#ifdef VMX86_DEBUG +#define STRUCT_SIZE_CHECK(STRUCT, SIZE, DEBUG_EXTRA) \ + ASSERT_ON_COMPILE(sizeof(STRUCT) == (SIZE + DEBUG_EXTRA)) +#else +#define STRUCT_SIZE_CHECK(STRUCT, SIZE, DEBUG_EXTRA) \ + ASSERT_ON_COMPILE(sizeof(STRUCT) == SIZE) +#endif + +/* + * __func__ is a stringified function name that is part of the C99 standard. The block + * below defines __func__ on older systems where the compiler does not support that + * macro. + */ +#if defined(__GNUC__) \ + && ((__GNUC__ == 2 && __GNUC_MINOR < 96) \ + || (__GNUC__ < 2)) +# define __func__ __FUNCTION__ +#endif + +/* + * Once upon a time, this was used to silence compiler warnings that + * get generated when the compiler thinks that a function returns + * when it is marked noreturn. Don't do it. Use NOT_REACHED(). + */ + +#define INFINITE_LOOP() do { } while (1) + +/* + * On FreeBSD (for the tools build), size_t is typedef'd if _BSD_SIZE_T_ + * is defined. Use the same logic here so we don't define it twice. [greg] + */ +#ifdef __FreeBSD__ +# ifdef _BSD_SIZE_T_ +# undef _BSD_SIZE_T_ +# ifdef VM_I386 +# ifdef VM_X86_64 + typedef uint64 size_t; +# else + typedef uint32 size_t; +# endif +# endif /* VM_I386 */ +# endif + +# ifdef _BSD_SSIZE_T_ +# undef _BSD_SSIZE_T_ +# define _SSIZE_T +# define __ssize_t_defined +# define _SSIZE_T_DECLARED +# ifdef VM_I386 +# ifdef VM_X86_64 + typedef int64 ssize_t; +# else + typedef int32 ssize_t; +# endif +# endif /* VM_I386 */ +# endif + +#else +# ifndef _SIZE_T +# define _SIZE_T +# ifdef VM_I386 +# ifdef VM_X86_64 + typedef uint64 size_t; +# else + typedef uint32 size_t; +# endif +# endif /* VM_I386 */ +# endif + +# if !defined(FROBOS) && !defined(_SSIZE_T) && !defined(ssize_t) && \ + !defined(__ssize_t_defined) && !defined(_SSIZE_T_DECLARED) +# define _SSIZE_T +# define __ssize_t_defined +# define _SSIZE_T_DECLARED +# ifdef VM_I386 +# ifdef VM_X86_64 + typedef int64 ssize_t; +# else + typedef int32 ssize_t; +# endif +# endif /* VM_I386 */ +# endif + +#endif + +/* + * Format modifier for printing pid_t. On sun the pid_t is a ulong, but on + * Linux it's an int. + * Use this like this: printf("The pid is %"FMTPID".\n", pid); + */ +#ifdef sun +# ifdef VM_X86_64 +# define FMTPID "d" +# else +# define FMTPID "lu" +# endif +#else +# define FMTPID "d" +#endif + +/* + * Format modifier for printing uid_t. On sun the uid_t is a ulong, but on + * Linux it's an int. + * Use this like this: printf("The uid is %"FMTUID".\n", uid); + */ +#ifdef sun +# ifdef VM_X86_64 +# define FMTUID "u" +# else +# define FMTUID "lu" +# endif +#else +# define FMTUID "u" +#endif + +/* + * Format modifier for printing mode_t. On sun the mode_t is a ulong, but on + * Linux it's an int. + * Use this like this: printf("The mode is %"FMTMODE".\n", mode); + */ +#ifdef sun +# ifdef VM_X86_64 +# define FMTMODE "o" +# else +# define FMTMODE "lo" +# endif +#else +# define FMTMODE "o" +#endif + +/* + * Format modifier for printing time_t. Most platforms define a time_t to be + * a long int, but on FreeBSD (as of 5.0, it seems), the time_t is a signed + * size quantity. Refer to the definition of FMTSZ to see why we need silly + * preprocessor arithmetic. + * Use this like this: printf("The mode is %"FMTTIME".\n", time); + */ +#if defined(__FreeBSD__) && (__FreeBSD__ + 0) && ((__FreeBSD__ + 0) >= 5) +# define FMTTIME FMTSZ"d" +#else +# define FMTTIME "ld" +#endif + +/* + * Define MXSemaHandle here so both vmmon and vmx see this definition. + */ + +#ifdef _WIN32 +typedef uintptr_t MXSemaHandle; +#else +typedef int MXSemaHandle; +#endif + +/* + * Define type for poll device handles. + */ + +#ifdef _WIN32 +typedef uintptr_t PollDevHandle; +#else +typedef int PollDevHandle; +#endif + +/* + * Define the utf16_t type. + */ + +#if defined(_WIN32) && defined(_NATIVE_WCHAR_T_DEFINED) +typedef wchar_t utf16_t; +#else +typedef uint16 utf16_t; +#endif + +#endif /* _VM_BASIC_TYPES_H_ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmci/vmci_call_defs.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vmci_call_defs.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmci/vmci_call_defs.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vmci_call_defs.h 2008-10-13 08:01:41.000000000 +0100 @@ -0,0 +1,266 @@ +/********************************************************* + * Copyright (C) 2006-2007 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +#ifndef _VMCI_CALL_DEFS_H_ +#define _VMCI_CALL_DEFS_H_ + +#define INCLUDE_ALLOW_USERLEVEL +#define INCLUDE_ALLOW_VMMEXT +#define INCLUDE_ALLOW_MODULE +#define INCLUDE_ALLOW_VMMON +#define INCLUDE_ALLOW_VMCORE +#define INCLUDE_ALLOW_VMKMOD +#define INCLUDE_ALLOW_VMKERNEL +#define INCLUDE_ALLOW_DISTRIBUTE +#include "includeCheck.h" + +#include "vm_basic_types.h" +#include "vmci_defs.h" + +/* + * All structs here are an integral size of their largest member, ie. a struct + * with at least one 8-byte member will have a size that is an integral of 8. + * A struct which has a largest member of size 4 will have a size that is an + * integral of 4. This is because Windows CL enforces this rule. 32 bit gcc + * doesn't e.g. 32 bit gcc can misalign an 8 byte member if it is preceeded by + * a 4 byte member. + */ + +/* + * Base struct for vmci datagrams. + */ + +typedef struct VMCIDatagram { + VMCIHandle dst; + VMCIHandle src; + uint64 payloadSize; +} VMCIDatagram; + +typedef int +(*VMCIDatagramRecvCB)(void *clientData, // IN: client data for handler + VMCIDatagram *msg); // IN: + +/* Flag for creating a wellknown handle instead of a per context handle. */ +#define VMCI_FLAG_WELLKNOWN_DG_HND 0x1 + +/* + * Maximum supported size of a VMCI datagram for routable datagrams. + * Datagrams going to the hypervisor are allowed to be larger. + */ +#define VMCI_MAX_DG_SIZE (17 * 4096) +#define VMCI_MAX_DG_PAYLOAD_SIZE (VMCI_MAX_DG_SIZE - sizeof(VMCIDatagram)) +#define VMCI_DG_PAYLOAD(_dg) (void *)((char *)(_dg) + sizeof(VMCIDatagram)) +#define VMCI_DG_HEADERSIZE sizeof(VMCIDatagram) +#define VMCI_DG_SIZE(_dg) (VMCI_DG_HEADERSIZE + (size_t)(_dg)->payloadSize) +#define VMCI_DG_SIZE_ALIGNED(_dg) ((VMCI_DG_SIZE(_dg) + 7) & (size_t)CONST64U(0xfffffffffffffff8)) +#define VMCI_MAX_DATAGRAM_QUEUE_SIZE (VMCI_MAX_DG_SIZE * 2) + +/* + * Struct for sending VMCI_DATAGRAM_REQUEST_MAP and VMCI_DATAGRAM_REMOVE_MAP + * datagrams. Struct size is 32 bytes. All fields in struct are aligned to + * their natural alignment. + */ +typedef struct VMCIDatagramWellKnownMapMsg { + VMCIDatagram hdr; + VMCIId wellKnownID; + uint32 _pad; +} VMCIDatagramWellKnownMapMsg; + + +/* + * Struct used for querying, via VMCI_RESOURCES_QUERY, the availability of + * hypervisor resources. + * Struct size is 16 bytes. All fields in struct are aligned to their natural + * alignment. + */ +typedef struct VMCIResourcesQueuryHdr { + VMCIDatagram hdr; + uint32 numResources; + uint32 _padding; +} VMCIResourcesQueryHdr; + + +/* + * Convenience struct for negotiating vectors. Must match layout of + * VMCIResourceQueryHdr minus the VMCIDatagram header. + */ +typedef struct VMCIResourcesQueryMsg { + uint32 numResources; + uint32 _padding; + VMCI_Resource resources[1]; +} VMCIResourcesQueryMsg; + + +/* + * The maximum number of resources that can be queried using + * VMCI_RESOURCE_QUERY is 31, as the result is encoded in the lower 31 + * bits of a positive return value. Negative values are reserved for + * errors. + */ +#define VMCI_RESOURCE_QUERY_MAX_NUM 31 + +/* Maximum size for the VMCI_RESOURCE_QUERY request. */ +#define VMCI_RESOURCE_QUERY_MAX_SIZE sizeof(VMCIResourcesQueryHdr) \ + + VMCI_RESOURCE_QUERY_MAX_NUM * sizeof(VMCI_Resource) + +/* + * Struct used for making VMCI_SHAREDMEM_CREATE message. Struct size is 24 bytes. + * All fields in struct are aligned to their natural alignment. + */ +typedef struct VMCISharedMemCreateMsg { + VMCIDatagram hdr; + VMCIHandle handle; + uint32 memSize; + uint32 _padding; + /* PPNs placed after struct. */ +} VMCISharedMemCreateMsg; + + +/* + * Struct used for sending VMCI_SHAREDMEM_ATTACH messages. Same as struct used + * for create messages. + */ +typedef VMCISharedMemCreateMsg VMCISharedMemAttachMsg; + + +/* + * Struct used for sending VMCI_SHAREDMEM_DETACH messsages. Struct size is 16 + * bytes. All fields in struct are aligned to their natural alignment. + */ +typedef struct VMCISharedMemDetachMsg { + VMCIDatagram hdr; + VMCIHandle handle; +} VMCISharedMemDetachMsg; + + +/* + * Struct used for sending VMCI_SHAREDMEM_QUERY messages. Same as struct used + * for detach messages. + */ +typedef VMCISharedMemDetachMsg VMCISharedMemQueryMsg; + + +/* + * This struct is used to contain data for events. Size of this struct is a + * multiple of 8 bytes, and all fields are aligned to their natural alignment. + */ +typedef struct VMCI_EventData { + VMCI_Event event; /* 4 bytes. */ + uint32 _pad; + /* + * Event payload is put here. + */ +} VMCI_EventData; + + +/* + * We use the following inline function to access the payload data associated + * with an event data. + */ + +static INLINE void * +VMCIEventDataPayload(VMCI_EventData *evData) // IN: +{ + return (void *)((char *)evData + sizeof *evData); +} + +/* + * Define the different VMCI_EVENT payload data types here. All structs must + * be a multiple of 8 bytes, and fields must be aligned to their natural + * alignment. + */ +typedef struct VMCIEventPayload_Context { + VMCIId contextID; /* 4 bytes. */ + uint32 _pad; +} VMCIEventPayload_Context; + +typedef struct VMCIEventPayload_QP { + VMCIHandle handle; /* QueuePair handle. */ + VMCIId peerId; /* Context id of attaching/detaching VM. */ + uint32 _pad; +} VMCIEventPayload_QP; + +/* + * We define the following struct to get the size of the maximum event data + * the hypervisor may send to the guest. If adding a new event payload type + * above, add it to the following struct too (inside the union). + */ +typedef struct VMCIEventData_Max { + VMCI_EventData eventData; + union { + VMCIEventPayload_Context contextPayload; + VMCIEventPayload_QP qpPayload; + } evDataPayload; +} VMCIEventData_Max; + + +/* + * Struct used for VMCI_EVENT_SUBSCRIBE/UNSUBSCRIBE and VMCI_EVENT_HANDLER + * messages. Struct size is 32 bytes. All fields in struct are aligned to + * their natural alignment. + */ +typedef struct VMCIEventMsg { + VMCIDatagram hdr; + VMCI_EventData eventData; /* Has event type and payload. */ + /* + * Payload gets put here. + */ +} VMCIEventMsg; + + +/* + * We use the following inline function to access the payload data associated + * with an event message. + */ + +static INLINE void * +VMCIEventMsgPayload(VMCIEventMsg *eMsg) // IN: +{ + return VMCIEventDataPayload(&eMsg->eventData); +} + + +/* Flags for VMCI QueuePair API. */ +#define VMCI_QPFLAG_ATTACH_ONLY 0x1 /* Fail alloc if QP not created by peer. */ +#define VMCI_QPFLAG_LOCAL 0x2 /* Only allow attaches from local context. */ +/* Update the following (bitwise OR flags) while adding new flags. */ +#define VMCI_QP_ALL_FLAGS (VMCI_QPFLAG_ATTACH_ONLY | VMCI_QPFLAG_LOCAL) + +/* + * Structs used for QueuePair alloc and detach messages. We align fields of + * these structs to 64bit boundaries. + */ + +typedef struct VMCIQueuePairAllocMsg { + VMCIDatagram hdr; + VMCIHandle handle; + VMCIId peer; /* 32bit field. */ + uint32 flags; + uint64 produceSize; + uint64 consumeSize; + uint64 numPPNs; + /* List of PPNs placed here. */ +} VMCIQueuePairAllocMsg; + + +typedef struct VMCIQueuePairDetachMsg { + VMCIDatagram hdr; + VMCIHandle handle; +} VMCIQueuePairDetachMsg; + +#endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmci/vmciDatagram.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vmciDatagram.c --- open-vm-tools-2008.01.23-74039/modules/linux/vmci/vmciDatagram.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vmciDatagram.c 2008-10-13 08:01:41.000000000 +0100 @@ -0,0 +1,914 @@ +/********************************************************* + * Copyright (C) 2006 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * vmciDatagram.c -- + * + * Simple Datagram API for the Linux guest driver. + */ + +#ifdef __linux__ +# include "driver-config.h" + +# define EXPORT_SYMTAB + +# include <linux/module.h> +# include "compat_kernel.h" +# include "compat_pci.h" +#elif defined(_WIN32) +# include <ntddk.h> +#elif defined(SOLARIS) +# include <sys/ddi.h> +# include <sys/sunddi.h> +#else +# error "Platform not support by VMCI datagram API." +#endif // linux + +#include "vm_basic_types.h" +#include "vm_assert.h" +#include "vmci_defs.h" +#include "vmci_kernel_if.h" +#include "vmci_infrastructure.h" +#include "vmciInt.h" +#include "vmciUtil.h" +#include "vmciDatagram.h" + +typedef struct DatagramHashEntry { + struct DatagramHashEntry *next; + int refCount; + + VMCIHandle handle; + uint32 flags; + VMCIDatagramRecvCB recvCB; + void *clientData; + VMCIEvent destroyEvent; +} DatagramHashEntry; + +#define HASH_TABLE_SIZE 64 + +/* + * Hash table containing all the datagram handles for this VM. It is + * synchronized using a single lock but we should consider making it more + * fine grained, e.g. a per bucket lock or per set of buckets' lock. + */ + +typedef struct DatagramHashTable { + VMCILock lock; + DatagramHashEntry *entries[HASH_TABLE_SIZE]; +} DatagramHashTable; + + +static int DatagramReleaseCB(void *clientData); +static int DatagramHashAddEntry(DatagramHashEntry *entry, VMCIId contextID); +static int DatagramHashRemoveEntry(VMCIHandle handle); +static DatagramHashEntry *DatagramHashGetEntry(VMCIHandle handle); +static void DatagramHashReleaseEntry(DatagramHashEntry *entry); +static Bool DatagramHandleUniqueLocked(VMCIHandle handle); +static int DatagramProcessNotify(void *clientData, VMCIDatagram *msg); + +DatagramHashTable hashTable; + +/* + *------------------------------------------------------------------------------ + * + * DatagramReleaseCB -- + * + * Callback to release the datagram entry reference. It is called by the + * VMCI_WaitOnEvent function before it blocks. + * + * Result: + * None. + * + *------------------------------------------------------------------------------ + */ + +static int +DatagramReleaseCB(void *clientData) +{ + DatagramHashEntry *entry = (DatagramHashEntry *)clientData; + ASSERT(entry); + DatagramHashReleaseEntry(entry); + + return 0; +} + + +/* + *------------------------------------------------------------------------- + * + * DatagramHashAddEntry -- + * Given a datagram handle entry, adds it to the hashtable of datagram + * entries. Allocates a resource id iff the handle of the given entry + * is an invalid one. 0 through VMCI_RESERVED_RESOURCE_ID_MAX are + * reserved resource ids. + * + * Result: + * VMCI_SUCCESS if added, error if not. + * + *------------------------------------------------------------------------- + */ + +static int +DatagramHashAddEntry(DatagramHashEntry *entry, // IN: + VMCIId contextID) // IN: +{ + int idx; + VMCILockFlags flags; + static VMCIId datagramRID = VMCI_RESERVED_RESOURCE_ID_MAX + 1; + + ASSERT(entry && contextID != VMCI_INVALID_ID); + + VMCI_GrabLock_BH(&hashTable.lock, &flags); + if (!VMCI_HANDLE_INVALID(entry->handle) && + !DatagramHandleUniqueLocked(entry->handle)) { + VMCI_ReleaseLock_BH(&hashTable.lock, flags); + return VMCI_ERROR_DUPLICATE_ENTRY; + } else if (VMCI_HANDLE_INVALID(entry->handle)) { + VMCIId oldRID = datagramRID; + VMCIHandle handle; + Bool foundRID = FALSE; + + /* + * Generate a unique datagram rid. Keep on trying until we wrap around + * in the RID space. + */ + ASSERT(oldRID > VMCI_RESERVED_RESOURCE_ID_MAX); + do { + handle = VMCI_MAKE_HANDLE(contextID, datagramRID); + foundRID = DatagramHandleUniqueLocked(handle); + datagramRID++; + if (UNLIKELY(!datagramRID)) { + /* + * Skip the reserved rids. + */ + datagramRID = VMCI_RESERVED_RESOURCE_ID_MAX + 1; + } + } while (!foundRID && datagramRID != oldRID); + + if (LIKELY(foundRID)) { + entry->handle = handle; + } else { + /* + * We wrapped around --- no rids were free. + */ + ASSERT(datagramRID == oldRID); + VMCI_ReleaseLock_BH(&hashTable.lock, flags); + return VMCI_ERROR_NO_HANDLE; + } + } + + ASSERT(!VMCI_HANDLE_INVALID(entry->handle)); + idx = VMCI_Hash(entry->handle, HASH_TABLE_SIZE); + + /* New entry is added to top/front of hash bucket. */ + entry->refCount++; + entry->next = hashTable.entries[idx]; + hashTable.entries[idx] = entry; + VMCI_ReleaseLock_BH(&hashTable.lock, flags); + + return VMCI_SUCCESS; +} + + +/* + *------------------------------------------------------------------------- + * + * DatagramHashRemoveEntry -- + * + * Result: + * VMCI_SUCCESS if removed, VMCI_ERROR_NO_HANDLE if not found. + * + *------------------------------------------------------------------------- + */ + +static int +DatagramHashRemoveEntry(VMCIHandle handle) +{ + int result = VMCI_ERROR_NOT_FOUND; + VMCILockFlags flags; + DatagramHashEntry *prev, *cur; + int idx = VMCI_Hash(handle, HASH_TABLE_SIZE); + + prev = NULL; + VMCI_GrabLock_BH(&hashTable.lock, &flags); + cur = hashTable.entries[idx]; + while (TRUE) { + if (cur == NULL) { + break; + } + if (VMCI_HANDLE_EQUAL(cur->handle, handle)) { + /* Remove entry and break. */ + if (prev) { + prev->next = cur->next; + } else { + hashTable.entries[idx] = cur->next; + } + + cur->refCount--; + + /* + * We know that DestroyHnd still has a reference so refCount must be + * at least 1. + */ + ASSERT(cur->refCount > 0); + result = VMCI_SUCCESS; + break; + } + prev = cur; + cur = cur->next; + } + VMCI_ReleaseLock_BH(&hashTable.lock, flags); + + return result; +} + + +/* + *------------------------------------------------------------------------- + * + * DatagramHashGetEntry -- + * + * Result: + * None. + * + *------------------------------------------------------------------------- + */ + +static DatagramHashEntry * +DatagramHashGetEntry(VMCIHandle handle) +{ + VMCILockFlags flags; + DatagramHashEntry *cur; + int idx = VMCI_Hash(handle, HASH_TABLE_SIZE); + + VMCI_GrabLock_BH(&hashTable.lock, &flags); + for (cur = hashTable.entries[idx]; cur != NULL; cur = cur->next) { + if (VMCI_HANDLE_EQUAL(cur->handle, handle)) { + cur->refCount++; + break; + } + } + VMCI_ReleaseLock_BH(&hashTable.lock, flags); + + return cur; +} + + +/* + *------------------------------------------------------------------------- + * + * DatagramHashReleaseEntry -- + * + * Result: + * None. + * + *------------------------------------------------------------------------- + */ + +static void +DatagramHashReleaseEntry(DatagramHashEntry *entry) +{ + VMCILockFlags flags; + + VMCI_GrabLock_BH(&hashTable.lock, &flags); + entry->refCount--; + + /* Check if this is last reference and signal the destroy event if so. */ + if (entry->refCount == 0) { + VMCI_SignalEvent(&entry->destroyEvent); + } + VMCI_ReleaseLock_BH(&hashTable.lock, flags); +} + + +/* + *------------------------------------------------------------------------------ + * + * DatagramHandleUniqueLocked -- + * + * Checks whether the given handle is already in the hash + * table. Assumes that the caller to have the hash table lock. + * + * Result: + * None. + * + *------------------------------------------------------------------------------ + */ + +static Bool +DatagramHandleUniqueLocked(VMCIHandle handle) +{ + Bool unique = TRUE; + DatagramHashEntry *entry; + int idx = VMCI_Hash(handle, HASH_TABLE_SIZE); + + entry = hashTable.entries[idx]; + while (entry) { + if (VMCI_HANDLE_EQUAL(entry->handle, handle)) { + unique = FALSE; + break; + } + entry = entry->next; + } + + return unique; +} + + +/* + *----------------------------------------------------------------------------- + * + * VMCIDatagram_CreateHnd -- + * + * Creates a datagram endpoint and returns a handle to it. + * + * Results: + * Returns handle if success, negative errno value otherwise. + * + * Side effects: + * Datagram endpoint is created both in guest and on host. + * + *----------------------------------------------------------------------------- + */ + +#ifdef __linux__ +EXPORT_SYMBOL(VMCIDatagram_CreateHnd); +#endif + +int +VMCIDatagram_CreateHnd(VMCIId resourceID, // IN: + uint32 flags, // IN: + VMCIDatagramRecvCB recvCB, // IN: + void *clientData, // IN: + VMCIHandle *outHandle) // OUT: + +{ + int result; + DatagramHashEntry *entry; + VMCIHandle handle; + VMCIId contextID = VMCI_GetContextID(); + + if (!recvCB || !outHandle) { + return VMCI_ERROR_INVALID_ARGS; + } + + /* Validate contextID. */ + if (contextID == VMCI_INVALID_ID) { + return VMCI_ERROR_NO_RESOURCES; + } + + if ((flags & VMCI_FLAG_WELLKNOWN_DG_HND) != 0) { + VMCIDatagramWellKnownMapMsg wkMsg; + if (resourceID == VMCI_INVALID_ID) { + return VMCI_ERROR_INVALID_ARGS; + } + wkMsg.hdr.dst.context = VMCI_HYPERVISOR_CONTEXT_ID; + wkMsg.hdr.dst.resource = VMCI_DATAGRAM_REQUEST_MAP; + wkMsg.hdr.src = VMCI_ANON_SRC_HANDLE; + wkMsg.hdr.payloadSize = sizeof wkMsg - VMCI_DG_HEADERSIZE; + wkMsg.wellKnownID = resourceID; + result = VMCI_SendDatagram((VMCIDatagram *)&wkMsg); + if (result < VMCI_SUCCESS) { + VMCI_LOG(("Failed to reserve wellknown id %d, error %d.\n", + resourceID, result)); + return result; + } + + handle = VMCI_MAKE_HANDLE(VMCI_WELL_KNOWN_CONTEXT_ID, resourceID); + } else { + if (resourceID == VMCI_INVALID_ID) { + handle = VMCI_INVALID_HANDLE; + } else { + handle = VMCI_MAKE_HANDLE(contextID, resourceID); + } + } + + /* Update local datastructure. */ + entry = VMCI_AllocKernelMem(sizeof *entry, VMCI_MEMORY_NONPAGED); + if (entry == NULL) { + return VMCI_ERROR_NO_MEM; + } + + entry->handle = handle; + entry->flags = flags; + entry->recvCB = recvCB; + entry->clientData = clientData; + entry->refCount = 0; + VMCI_CreateEvent(&entry->destroyEvent); + + result = DatagramHashAddEntry(entry, contextID); + if (result != VMCI_SUCCESS) { + VMCI_LOG(("Failed to add new entry, err 0x%x.\n", result)); + VMCI_DestroyEvent(&entry->destroyEvent); + VMCI_FreeKernelMem(entry, sizeof *entry); + return result; + } + + ASSERT(!VMCI_HANDLE_INVALID(entry->handle)); + *outHandle = entry->handle; + return VMCI_SUCCESS; +} + + +/* + *----------------------------------------------------------------------------- + * + * VMCIDatagram_DestroyHnd -- + * + * Destroys a handle. + * + * Results: + * VMCI_SUCCESS or error code. + * + * Side effects: + * Host and guest state is cleaned up. + * + *----------------------------------------------------------------------------- + */ + +#ifdef __linux__ +EXPORT_SYMBOL(VMCIDatagram_DestroyHnd); +#endif + +int +VMCIDatagram_DestroyHnd(VMCIHandle handle) // IN +{ + DatagramHashEntry *entry = DatagramHashGetEntry(handle); + if (entry == NULL) { + return VMCI_ERROR_NOT_FOUND; + } + + DatagramHashRemoveEntry(entry->handle); + + /* + * We wait for destroyEvent to be signalled. The resource is released + * as part of the wait. + */ + VMCI_WaitOnEvent(&entry->destroyEvent, DatagramReleaseCB, entry); + + + if ((entry->flags & VMCI_FLAG_WELLKNOWN_DG_HND) != 0) { + int result; + VMCIDatagramWellKnownMapMsg wkMsg; + + wkMsg.hdr.dst.context = VMCI_HYPERVISOR_CONTEXT_ID; + wkMsg.hdr.dst.resource = VMCI_DATAGRAM_REMOVE_MAP; + wkMsg.hdr.src = VMCI_ANON_SRC_HANDLE; + wkMsg.hdr.payloadSize = sizeof wkMsg - VMCI_DG_HEADERSIZE; + wkMsg.wellKnownID = entry->handle.resource; + result = VMCI_SendDatagram((VMCIDatagram *)&wkMsg); + if (result < VMCI_SUCCESS) { + VMCI_LOG(("Failed to remove well-known mapping for resource %d.\n", + entry->handle.resource)); + } + } + + /* We know we are now holding the last reference so we can free the entry. */ + VMCI_DestroyEvent(&entry->destroyEvent); + VMCI_FreeKernelMem(entry, sizeof *entry); + + return VMCI_SUCCESS; +} + + +/* + *----------------------------------------------------------------------------- + * + * VMCIDatagram_Send -- + * + * Sends the payload to the destination datagram handle. + * + * Results: + * Returns number of bytes sent if success, or error code if failure. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +#ifdef __linux__ +EXPORT_SYMBOL(VMCIDatagram_Send); +#endif + +int +VMCIDatagram_Send(VMCIDatagram *msg) // IN +{ + uint32 retval; + DatagramHashEntry *entry; + + if (msg == NULL) { + VMCI_LOG(("Invalid datagram.\n")); + return VMCI_ERROR_INVALID_ARGS; + } + + if (VMCI_DG_SIZE(msg) > VMCI_MAX_DG_SIZE) { + VMCI_LOG(("Payload size %"FMT64"u too big to send.\n", msg->payloadSize)); + return VMCI_ERROR_INVALID_ARGS; + } + + /* Check srcHandle exists otherwise fail. */ + entry = DatagramHashGetEntry(msg->src); + if (entry == NULL) { + VMCI_LOG(("Couldn't find handle 0x%x:0x%x.\n", + msg->src.context, msg->src.resource)); + return VMCI_ERROR_INVALID_ARGS; + } + + retval = VMCI_SendDatagram(msg); + DatagramHashReleaseEntry(entry); + + return retval; +} + + +/* + *----------------------------------------------------------------------------- + * + * VMCIDatagram_Dispatch -- + * + * Forwards the datagram corresponding entry's callback. + * + * Results: + * VMCI_SUCCESS on success, error code if not. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +int +VMCIDatagram_Dispatch(VMCIId contextID, // IN: unused + VMCIDatagram *msg) // IN +{ + DatagramHashEntry *entry; + + ASSERT(msg); + + entry = DatagramHashGetEntry(msg->dst); + if (entry == NULL) { + VMCI_LOG(("destination handle 0x%x:0x%x doesn't exists.\n", + msg->dst.context, msg->dst.resource)); + return VMCI_ERROR_NO_HANDLE; + } + + if (entry->recvCB) { + entry->recvCB(entry->clientData, msg); + } else { + VMCI_LOG(("no handle callback for handle 0x%x:0x%x payload of " + "size %"FMT64"d.\n", + msg->dst.context, msg->dst.resource, msg->payloadSize)); + } + DatagramHashReleaseEntry(entry); + + return VMCI_SUCCESS; +} + + +/* + *----------------------------------------------------------------------------- + * + * VMCIDatagram_Init -- + * + * Register guest call handlers. + * + * Results: + * None + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +void +VMCIDatagram_Init(void) +{ + int i; + + VMCI_InitLock(&hashTable.lock, + "VMCIDatagramHashtable", + VMCI_LOCK_RANK_MIDDLE_BH); + for (i = 0; i < HASH_TABLE_SIZE; i++) { + hashTable.entries[i] = NULL; + } +} + + +/* + *----------------------------------------------------------------------------- + * + * VMCIDatagram_CheckHostCapabilities -- + * + * Verify that the host supports the resources we need. + * None are required for datagrams since they are implicitly supported. + * + * Results: + * TRUE. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +Bool +VMCIDatagram_CheckHostCapabilities(void) +{ + return TRUE; +} + + +/* + *----------------------------------------------------------------------------- + * + * DatagramProcessNotify -- + * + * Callback to send a notificaton to a vmci process. Creates datagram + * copy and signals the process. + * + * Results: + * VMCI_SUCCESS on success, appropriate error code otherwise. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static int +DatagramProcessNotify(void *clientData, // IN: + VMCIDatagram *msg) // IN: +{ + VMCIDatagramProcess *dgmProc = (VMCIDatagramProcess *) clientData; + size_t dgmSize; + VMCIDatagram *dgm; + DatagramQueueEntry *dqEntry; + VMCILockFlags flags; + + ASSERT(dgmProc != NULL && msg != NULL); + dgmSize = VMCI_DG_SIZE(msg); + ASSERT(dgmSize <= VMCI_MAX_DG_SIZE); + + dgm = VMCI_AllocKernelMem(dgmSize, + VMCI_MEMORY_NONPAGED | VMCI_MEMORY_ATOMIC); + if (!dgm) { + VMCI_LOG(("VMCI: Failed to allocate datagram of size %d bytes.\n", + (uint32)dgmSize)); + return VMCI_ERROR_NO_MEM; + } + memcpy(dgm, msg, dgmSize); + + /* Allocate datagram queue entry and add it to the target fd's queue. */ + dqEntry = VMCI_AllocKernelMem(sizeof *dqEntry, + VMCI_MEMORY_NONPAGED | VMCI_MEMORY_ATOMIC); + if (dqEntry == NULL) { + VMCI_FreeKernelMem(dgm, dgmSize); + VMCI_LOG(("VMCI: Failed to allocate memory for process datagram.\n")); + return VMCI_ERROR_NO_MEM; + } + dqEntry->dg = dgm; + + VMCI_GrabLock_BH(&dgmProc->datagramQueueLock, &flags); + if (dgmProc->datagramQueueSize + dgmSize >= VMCI_MAX_DATAGRAM_QUEUE_SIZE) { + VMCI_ReleaseLock_BH(&dgmProc->datagramQueueLock, flags); + VMCI_FreeKernelMem(dgm, dgmSize); + VMCI_FreeKernelMem(dqEntry, sizeof *dqEntry); + VMCI_LOG(("VMCI: Datagram process receive queue is full.\n")); + return VMCI_ERROR_NO_RESOURCES; + } + + LIST_QUEUE(&dqEntry->listItem, &dgmProc->datagramQueue); + dgmProc->pendingDatagrams++; + dgmProc->datagramQueueSize += dgmSize; +#ifdef SOLARIS + /* + * Release the lock here for Solaris. Otherwise, a deadlock + * may occur since pollwakeup(9F) (invoked from VMCIHost_SignalCall) + * and poll_common (invoked from poll(2)) try to grab a common lock. + * The man pages of pollwakeup(9F) and chpoll(9E) talk about this. + */ + VMCI_ReleaseLock_BH(&dgmProc->datagramQueueLock, flags); +#endif + VMCIHost_SignalCall(&dgmProc->host); +#ifndef SOLARIS + /* For platforms other than Solaris, release the lock here. */ + VMCI_ReleaseLock_BH(&dgmProc->datagramQueueLock, flags); +#endif + + DEBUG_ONLY(VMCI_LOG(("VMCI: Sent datagram with resource id %d and size %u.\n", + msg->dst.resource, (uint32)dgmSize));) + /* dqEntry and dgm are freed when user reads call.. */ + + return VMCI_SUCCESS; +} + + +/* + *---------------------------------------------------------------------- + * + * VMCIDatagramProcess_Create -- + * + * Creates a new VMCIDatagramProcess object. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +int +VMCIDatagramProcess_Create(VMCIDatagramProcess **outDgmProc, // IN: + VMCIDatagramCreateInfo *createInfo) // IN: +{ + VMCIDatagramProcess *dgmProc; + + ASSERT(createInfo); + ASSERT(outDgmProc); + dgmProc = VMCI_AllocKernelMem(sizeof *dgmProc, VMCI_MEMORY_NONPAGED); + if (dgmProc == NULL) { + return VMCI_ERROR_NO_MEM; + } + + VMCI_InitLock(&dgmProc->datagramQueueLock, "VMCIDgmProc", + VMCI_LOCK_RANK_MIDDLE_BH); + VMCIHost_InitContext(&dgmProc->host, createInfo->eventHnd); + dgmProc->pendingDatagrams = 0; + dgmProc->datagramQueueSize = 0; + dgmProc->datagramQueue = NULL; + + /* + * We pass the result and corresponding handle to user level via the + * createInfo. + */ + createInfo->result = VMCIDatagram_CreateHnd(createInfo->resourceID, + createInfo->flags, + DatagramProcessNotify, + (void *)dgmProc, + &dgmProc->handle); + if (createInfo->result < VMCI_SUCCESS) { + VMCI_FreeKernelMem(dgmProc, sizeof *dgmProc); + return createInfo->result; + } + createInfo->handle = dgmProc->handle; + + *outDgmProc = dgmProc; + return VMCI_SUCCESS; +} + + +/* + *---------------------------------------------------------------------- + * + * VMCIDatagramProcess_Destroy -- + * + * Destroys a VMCIDatagramProcess object. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +void +VMCIDatagramProcess_Destroy(VMCIDatagramProcess *dgmProc) // IN: +{ + ListItem *curr, *next; + DatagramQueueEntry *dqEntry; + VMCILockFlags flags; + + if (!dgmProc) { + return; + } + + if (!VMCI_HANDLE_EQUAL(dgmProc->handle, VMCI_INVALID_HANDLE)) { + + /* + * We block in destroy so we know that there can be no more + * callbacks to DatagramProcessNotifyCB when we return from + * this call. + */ + VMCIDatagram_DestroyHnd(dgmProc->handle); + dgmProc->handle = VMCI_INVALID_HANDLE; + } + + /* Flush dgmProc's call queue. */ + VMCI_GrabLock_BH(&dgmProc->datagramQueueLock, &flags); + LIST_SCAN_SAFE(curr, next, dgmProc->datagramQueue) { + dqEntry = LIST_CONTAINER(curr, DatagramQueueEntry, listItem); + LIST_DEL(curr, &dgmProc->datagramQueue); + ASSERT(dqEntry && dqEntry->dg); + VMCI_FreeKernelMem(dqEntry->dg, VMCI_DG_SIZE(dqEntry->dg)); + VMCI_FreeKernelMem(dqEntry, sizeof *dqEntry); + } + VMCI_ReleaseLock_BH(&dgmProc->datagramQueueLock, flags); + VMCIHost_ReleaseContext(&dgmProc->host); + VMCI_CleanupLock(&dgmProc->datagramQueueLock); + VMCI_FreeKernelMem(dgmProc, sizeof *dgmProc); +} + + +/* + *---------------------------------------------------------------------- + * + * VMCIDatagramProcess_ReadCall -- + * + * Dequeues the next guest call and returns it to user level. + * + * Results: + * 0 on success, appropriate error code otherwise. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +int +VMCIDatagramProcess_ReadCall(VMCIDatagramProcess *dgmProc, // IN: + size_t maxSize, // IN: max size of dg + VMCIDatagram **dg) // OUT: +{ + DatagramQueueEntry *dqEntry; + ListItem *listItem; + VMCILockFlags flags; + + ASSERT(dgmProc); + ASSERT(dg); + + /* Dequeue the next dgmProc datagram queue entry. */ + VMCI_GrabLock_BH(&dgmProc->datagramQueueLock, &flags); + + /* + * Currently, we do not support blocking read of datagrams on Mac and + * Solaris. XXX: This will go away soon. + */ + +#if defined(SOLARIS) || defined(__APPLE__) + if (dgmProc->pendingDatagrams == 0) { + VMCIHost_ClearCall(&dgmProc->host); + VMCI_ReleaseLock_BH(&dgmProc->datagramQueueLock, flags); + VMCI_LOG(("VMCI: No datagrams pending.\n")); + return VMCI_ERROR_NO_MORE_DATAGRAMS; + } +#else + while (dgmProc->pendingDatagrams == 0) { + VMCIHost_ClearCall(&dgmProc->host); + if (!VMCIHost_WaitForCallLocked(&dgmProc->host, &dgmProc->datagramQueueLock, + &flags, TRUE)) { + VMCI_ReleaseLock_BH(&dgmProc->datagramQueueLock, flags); + VMCI_LOG(("VMCI: Blocking read of datagram interrupted.\n")); + return VMCI_ERROR_NO_MORE_DATAGRAMS; + } + } +#endif + + listItem = LIST_FIRST(dgmProc->datagramQueue); + ASSERT (listItem != NULL); + + dqEntry = LIST_CONTAINER(listItem, DatagramQueueEntry, listItem); + ASSERT(dqEntry->dg); + + /* Check the size of the userland buffer. */ + if (maxSize < VMCI_DG_SIZE(dqEntry->dg)) { + VMCI_ReleaseLock_BH(&dgmProc->datagramQueueLock, flags); + VMCI_LOG(("VMCI: Caller's buffer is too small.\n")); + return VMCI_ERROR_NO_MEM; + } + + LIST_DEL(listItem, &dgmProc->datagramQueue); + dgmProc->pendingDatagrams--; + dgmProc->datagramQueueSize -= VMCI_DG_SIZE(dqEntry->dg); + if (dgmProc->pendingDatagrams == 0) { + VMCIHost_ClearCall(&dgmProc->host); + } + VMCI_ReleaseLock_BH(&dgmProc->datagramQueueLock, flags); + + *dg = dqEntry->dg; + VMCI_FreeKernelMem(dqEntry, sizeof *dqEntry); + + return VMCI_SUCCESS; +} + diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmci/vmciDatagram.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vmciDatagram.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmci/vmciDatagram.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vmciDatagram.h 2008-10-13 08:01:41.000000000 +0100 @@ -0,0 +1,62 @@ +/********************************************************* + * Copyright (C) 2006 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * vmciDatagram.h -- + * + * Simple Datagram API for the Linux guest driver. + */ + +#ifndef __VMCI_DATAGRAM_H__ +#define __VMCI_DATAGRAM_H__ + +#define INCLUDE_ALLOW_MODULE +#include "includeCheck.h" + +#include "vmci_defs.h" +#include "vmci_kernel_if.h" +#include "vmci_infrastructure.h" +#include "circList.h" +#include "vmciGuestKernelAPI.h" +#include "vmci_iocontrols.h" + +typedef struct DatagramQueueEntry { + ListItem listItem; /* For queuing. */ + VMCIDatagram *dg; /* Pending datagram. */ +} DatagramQueueEntry; + +typedef struct VMCIDatagramProcess { + VMCILock datagramQueueLock; + VMCIHandle handle; + VMCIHost host; + uint32 pendingDatagrams; + size_t datagramQueueSize; + ListItem *datagramQueue; +} VMCIDatagramProcess; + +void VMCIDatagram_Init(void); +Bool VMCIDatagram_CheckHostCapabilities(void); +int VMCIDatagram_Dispatch(VMCIId contextID, VMCIDatagram *msg); + +int VMCIDatagramProcess_Create(VMCIDatagramProcess **outDgmProc, + VMCIDatagramCreateInfo *createInfo); +void VMCIDatagramProcess_Destroy(VMCIDatagramProcess *dgmProc); +int VMCIDatagramProcess_ReadCall(VMCIDatagramProcess *dgmProc, + size_t maxSize, VMCIDatagram **dg); + +#endif //__VMCI_DATAGRAM_H__ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmci/vmci_defs.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vmci_defs.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmci/vmci_defs.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vmci_defs.h 2008-10-13 08:01:41.000000000 +0100 @@ -0,0 +1,290 @@ +/********************************************************* + * Copyright (C) 2005-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 General Public License as published by the + * Free Software Foundation version 2 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 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 + * + *********************************************************/ + +#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" + +/* 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 + +/* Interrupt Cause register bits. */ +#define VMCI_ICR_DATAGRAM 0x1 + +/* Interrupt Mask register bits. */ +#define VMCI_IMR_DATAGRAM 0x1 + +/* + * 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_SHAREDMEM_CREATE 2 +#define VMCI_SHAREDMEM_ATTACH 3 +#define VMCI_SHAREDMEM_DETACH 4 +#define VMCI_SHAREDMEM_QUERY 5 +#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 +#define VMCI_RESOURCE_MAX 12 + +/* VMCI Ids. */ +typedef uint32 VMCIId; + +typedef struct VMCIHandle { + VMCIId context; + VMCIId resource; +} VMCIHandle; + +static INLINE +VMCIHandle VMCI_MAKE_HANDLE(VMCIId cid, + VMCIId rid) +{ + VMCIHandle h = {cid, rid}; + return h; +} + +#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. + */ +#define VMCI_WELL_KNOWN_CONTEXT_ID 1 + +/* Todo: Change host context id to dynamic/random id. */ +#define VMCI_HOST_CONTEXT_ID 2 + +/* + * 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 0 +#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) + +/* 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 +#define VMCI_EVENT_CTX_REMOVED 1 +#define VMCI_EVENT_QP_RESUMED 2 +#define VMCI_EVENT_QP_PEER_ATTACH 3 +#define VMCI_EVENT_QP_PEER_DETACH 4 +#define VMCI_EVENT_MAX 5 + +/* 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_SM_CREATE, + VMCI_PRIV_SM_ATTACH, + 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 + +/* VMCI Discovery Service. */ + +/* Well-known handle to the discovery service. */ +#define VMCI_DS_RESOURCE_ID 1 /* Reserved resource ID for discovery service. */ +#define VMCI_DS_HANDLE VMCI_MAKE_HANDLE(VMCI_WELL_KNOWN_CONTEXT_ID, \ + VMCI_DS_RESOURCE_ID) +#define VMCI_DS_CONTEXT VMCI_MAKE_HANDLE(VMCI_WELL_KNOWN_CONTEXT_ID, \ + VMCI_CONTEXT_RESOURCE_ID) + +/* Maximum length of a DS message. */ +#define VMCI_DS_MAX_MSG_SIZE 300 + +/* Command actions. */ +#define VMCI_DS_ACTION_LOOKUP 0 +#define VMCI_DS_ACTION_REGISTER 1 +#define VMCI_DS_ACTION_UNREGISTER 2 + +/* Defines wire-protocol format for a request send to the DS from a context. */ +typedef struct VMCIDsRequestHeader { + int32 action; + int32 msgid; + VMCIHandle handle; + int32 nameLen; + int8 name[1]; +} VMCIDsRequestHeader; + + +/* Defines the wire-protocol format for a request send from the DS to a context. */ +typedef struct VMCIDsReplyHeader { + int32 msgid; + int32 code; + VMCIHandle handle; + int32 msgLen; + int8 msg[1]; +} VMCIDsReplyHeader; + +#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: " + +#endif + diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmci/vmci_drv.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vmci_drv.c --- open-vm-tools-2008.01.23-74039/modules/linux/vmci/vmci_drv.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vmci_drv.c 2008-10-13 08:01:41.000000000 +0100 @@ -0,0 +1,915 @@ +/********************************************************* + * Copyright (C) 2005 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * vmci.c -- + * + * Linux guest driver for the VMCI device. + */ + +#include "driver-config.h" + +#define EXPORT_SYMTAB + + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 9) +#include <linux/moduleparam.h> +#endif + +#include "compat_kernel.h" +#include "compat_module.h" +#include "compat_pci.h" +#include "compat_wait.h" +#include "compat_init.h" +#include "compat_ioport.h" +#include "compat_interrupt.h" +#include "compat_page.h" +#include "vm_basic_types.h" +#include "vm_device_version.h" +#include "kernelStubs.h" +#include "vmci_iocontrols.h" +#include "vmci_defs.h" +#include "vmciInt.h" +#include "vmci_infrastructure.h" +#include "vmciDatagram.h" +#include "vmciProcess.h" +#include "vmciUtil.h" +#include "vmciEvent.h" +#include "vmciQueuePairInt.h" +#include "vmci_version.h" + +#define LGPFX "VMCI: " +#define VMCI_DEVICE_MINOR_NUM 0 + +typedef struct vmci_device { + struct semaphore lock; + + unsigned int ioaddr; + unsigned int ioaddr_size; + unsigned int irq; + + Bool enabled; + spinlock_t dev_spinlock; +} vmci_device; + +static int vmci_probe_device(struct pci_dev *pdev, + const struct pci_device_id *id); +static void vmci_remove_device(struct pci_dev* pdev); +static int vmci_open(struct inode *inode, struct file *file); +static int vmci_close(struct inode *inode, struct file *file); +static int vmci_ioctl(struct inode *inode, struct file *file, + unsigned int cmd, unsigned long arg); +static unsigned int vmci_poll(struct file *file, poll_table *wait); +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19) +static compat_irqreturn_t vmci_interrupt(int irq, void *dev_id, + struct pt_regs * regs); +#else +static compat_irqreturn_t vmci_interrupt(int irq, void *dev_id); +#endif +static void dispatch_datagrams(unsigned long data); + +static const struct pci_device_id vmci_ids[] = { + { PCI_DEVICE(PCI_VENDOR_ID_VMWARE, PCI_DEVICE_ID_VMWARE_VMCI), }, + { 0 }, +}; + +static struct file_operations vmci_ops = { + .owner = THIS_MODULE, + .open = vmci_open, + .release = vmci_close, + .ioctl = vmci_ioctl, + .poll = vmci_poll, +}; + +static struct pci_driver vmci_driver = { + .name = "vmci", + .id_table = vmci_ids, + .probe = vmci_probe_device, + .remove = vmci_remove_device, +}; + +static vmci_device vmci_dev; + +/* We dynamically request the device major number at init time. */ +static int device_major_nr = 0; + +DECLARE_TASKLET(vmci_tasklet, dispatch_datagrams, + (unsigned long)&vmci_dev); + +/* + * Allocate a buffer for incoming datagrams globally to avoid repeated + * allocation in the interrupt handler's atomic context. + */ + +static uint8 *data_buffer = NULL; +static uint32 data_buffer_size = VMCI_MAX_DG_SIZE; + + +/* + *----------------------------------------------------------------------------- + * + * vmci_init -- + * + * Initialization, called by Linux when the module is loaded. + * + * Results: + * Returns 0 for success, negative errno value otherwise. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static int +vmci_init(void) +{ + int err = -ENOMEM; + + /* Register device node ops. */ + err = register_chrdev(0, "vmci", &vmci_ops); + if (err < 0) { + printk(KERN_ERR "Unable to register vmci device\n"); + return err; + } + device_major_nr = err; + + printk("VMCI: Major device number is: %d\n", device_major_nr); + + /* Initialize device data. */ + init_MUTEX(&vmci_dev.lock); + spin_lock_init(&vmci_dev.dev_spinlock); + vmci_dev.enabled = FALSE; + + data_buffer = vmalloc(data_buffer_size); + if (data_buffer == NULL) { + goto error; + } + + /* This should be last to make sure we are done initializing. */ + err = pci_register_driver(&vmci_driver); + if (err < 0) { + goto error; + } + + return 0; + +error: + unregister_chrdev(device_major_nr, "vmci"); + vfree(data_buffer); + return err; +} + + +/* + *----------------------------------------------------------------------------- + * + * vmci_exit -- + * + * Cleanup, called by Linux when the module is unloaded. + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static void +vmci_exit(void) +{ + pci_unregister_driver(&vmci_driver); + + unregister_chrdev(device_major_nr, "vmci"); + + vfree(data_buffer); +} + + +/* + *----------------------------------------------------------------------------- + * + * vmci_probe_device -- + * + * Most of the initialization at module load time is done here. + * + * Results: + * Returns 0 for success, an error otherwise. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static int +vmci_probe_device(struct pci_dev *pdev, // IN: vmci PCI device + const struct pci_device_id *id) // IN: matching device ID +{ + unsigned int ioaddr; + unsigned int ioaddr_size; + unsigned int capabilities; + int result; + + printk(KERN_INFO "Probing for vmci/PCI.\n"); + + result = compat_pci_enable_device(pdev); + if (result) { + printk(KERN_ERR "Cannot VMCI device %s: error %d\n", + compat_pci_name(pdev), result); + return result; + } + compat_pci_set_master(pdev); /* To enable QueuePair functionality. */ + ioaddr = compat_pci_resource_start(pdev, 0); + ioaddr_size = compat_pci_resource_len(pdev, 0); + + /* + * Request I/O region with adjusted base address and size. The adjusted + * values are needed and used if we release the region in case of failure. + */ + + if (!compat_request_region(ioaddr, ioaddr_size, "vmci")) { + printk(KERN_INFO "vmci: Another driver already loaded " + "for device in slot %s.\n", compat_pci_name(pdev)); + goto pci_disable; + } + + printk(KERN_INFO "Found vmci/PCI at %#x, irq %u.\n", ioaddr, pdev->irq); + + /* + * Verify that the VMCI Device supports the capabilities that + * we need. If the device is missing capabilities that we would + * like to use, check for fallback capabilities and use those + * instead (so we can run a new VM on old hosts). Fail the load if + * a required capability is missing and there is no fallback. + * + * Right now, we need datagrams. There are no fallbacks. + */ + capabilities = inl(ioaddr + VMCI_CAPS_ADDR); + + if ((capabilities & VMCI_CAPS_DATAGRAM) == 0) { + printk(KERN_ERR "VMCI device does not support datagrams.\n"); + goto release; + } + + /* Let the host know which capabilities we intend to use. */ + outl(VMCI_CAPS_DATAGRAM, ioaddr + VMCI_CAPS_ADDR); + + /* Device struct initialization. */ + down(&vmci_dev.lock); + if (vmci_dev.enabled) { + printk(KERN_ERR "VMCI device already enabled.\n"); + goto unlock; + } + + vmci_dev.ioaddr = ioaddr; + vmci_dev.ioaddr_size = ioaddr_size; + vmci_dev.irq = pdev->irq; + + /* Check host capabilities. */ + if (!VMCI_CheckHostCapabilities()) { + goto unlock; + } + + /* Enable device. */ + vmci_dev.enabled = TRUE; + pci_set_drvdata(pdev, &vmci_dev); + + /* + * We do global initialization here because we need datagrams for + * event init. If we ever support more than one VMCI device we will + * have to create seperate LateInit/EarlyExit functions that can be + * used to do initialization/cleanup that depends on the device + * being accessible. We need to initialize VMCI components before + * requesting an irq - the VMCI interrupt handler uses these + * components, and it may be invoked once request_irq() has + * registered the handler (as the irq line may be shared). + */ + VMCIProcess_Init(); + VMCIDatagram_Init(); + VMCIEvent_Init(); + VMCIUtil_Init(); + VMCIQueuePair_Init(); + + if (request_irq(vmci_dev.irq, vmci_interrupt, COMPAT_IRQF_SHARED, + "vmci", &vmci_dev)) { + printk(KERN_ERR "vmci: irq %u in use\n", vmci_dev.irq); + goto components_exit; + } + + printk(KERN_INFO "Registered vmci device.\n"); + + up(&vmci_dev.lock); + + /* Enable specific interrupt bits. */ + outl(VMCI_IMR_DATAGRAM, vmci_dev.ioaddr + VMCI_IMR_ADDR); + + /* Enable interrupts. */ + outl(VMCI_CONTROL_INT_ENABLE, vmci_dev.ioaddr + VMCI_CONTROL_ADDR); + + return 0; + + components_exit: + VMCIQueuePair_Exit(); + VMCIUtil_Exit(); + VMCIEvent_Exit(); + VMCIProcess_Exit(); + unlock: + up(&vmci_dev.lock); + release: + release_region(ioaddr, ioaddr_size); + pci_disable: + compat_pci_disable_device(pdev); + return -EBUSY; +} + + +/* + *----------------------------------------------------------------------------- + * + * vmci_remove_device -- + * + * Cleanup, called for each device on unload. + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static void +vmci_remove_device(struct pci_dev* pdev) +{ + struct vmci_device *dev = pci_get_drvdata(pdev); + + printk(KERN_INFO "Removing vmci device\n"); + + VMCIQueuePair_Exit(); + + // XXX Todo add exit/cleanup functions for util, sm, dg, and resource apis. + VMCIUtil_Exit(); + VMCIEvent_Exit(); + //VMCIDatagram_Exit(); + VMCIProcess_Exit(); + + down(&dev->lock); + printk(KERN_INFO "Resetting vmci device\n"); + outl(VMCI_CONTROL_RESET, vmci_dev.ioaddr + VMCI_CONTROL_ADDR); + free_irq(dev->irq, dev); + release_region(dev->ioaddr, dev->ioaddr_size); + dev->enabled = FALSE; + + printk(KERN_INFO "Unregistered vmci device.\n"); + up(&dev->lock); + + compat_pci_disable_device(pdev); +} + + +/* + *----------------------------------------------------------------------------- + * + * vmci_open -- + * + * Open device. + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static int +vmci_open(struct inode *inode, // IN + struct file *file) // IN +{ + VMCIGuestDeviceHandle *devHndl; + int errcode; + + printk(KERN_INFO "Opening vmci device\n"); + + if (MINOR(inode->i_rdev) != VMCI_DEVICE_MINOR_NUM) { + return -ENODEV; + } + + down(&vmci_dev.lock); + if (!vmci_dev.enabled) { + printk(KERN_INFO "Received open on uninitialized vmci device.\n"); + errcode = -ENODEV; + goto unlock; + } + + /* Do open ... */ + devHndl = VMCI_AllocKernelMem(sizeof *devHndl, VMCI_MEMORY_NORMAL); + if (!devHndl) { + printk(KERN_INFO "Failed to create device obj when opening device.\n"); + errcode = -ENOMEM; + goto unlock; + } + devHndl->obj = NULL; + devHndl->objType = VMCIOBJ_NOT_SET; + file->private_data = devHndl; + + up(&vmci_dev.lock); + + return 0; + + unlock: + up(&vmci_dev.lock); + return errcode; +} + + +/* + *----------------------------------------------------------------------------- + * + * vmci_close -- + * + * Close device. + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static int +vmci_close(struct inode *inode, // IN + struct file *file) // IN +{ + VMCIGuestDeviceHandle *devHndl = + (VMCIGuestDeviceHandle *) file->private_data; + + if (devHndl) { + if (devHndl->objType == VMCIOBJ_PROCESS) { + VMCIProcess_Destroy((VMCIProcess *) devHndl->obj); + } else if (devHndl->objType == VMCIOBJ_DATAGRAM_PROCESS) { + VMCIDatagramProcess_Destroy((VMCIDatagramProcess *) devHndl->obj); + } + VMCI_FreeKernelMem(devHndl, sizeof *devHndl); + file->private_data = NULL; + } + return 0; +} + + +/* + *----------------------------------------------------------------------------- + * + * vmci_ioctl -- + * + * IOCTL interface to device. + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static int +vmci_ioctl(struct inode *inode, // IN + struct file *file, // IN + unsigned int cmd, // IN + unsigned long arg) // IN +{ +#ifndef VMX86_DEVEL + return -ENOTTY; +#else + int retval; + VMCIGuestDeviceHandle *devHndl = + (VMCIGuestDeviceHandle *) file->private_data; + + if (devHndl == NULL) { + return -EINVAL; + } + + switch (cmd) { + case IOCTL_VMCI_CREATE_PROCESS: { + if (devHndl->objType != VMCIOBJ_NOT_SET) { + printk("VMCI: Received IOCTLCMD_VMCI_CREATE_PROCESS on " + "initialized handle.\n"); + retval = -EINVAL; + break; + } + ASSERT(!devHndl->obj); + retval = VMCIProcess_Create((VMCIProcess **) &devHndl->obj, -1); + if (retval != 0) { + printk("VMCI: Failed to create process.\n"); + break; + } + devHndl->objType = VMCIOBJ_PROCESS; + break; + } + + case IOCTL_VMCI_CREATE_DATAGRAM_PROCESS: { + VMCIDatagramCreateInfo createInfo; + VMCIDatagramProcess *dgmProc; + + if (devHndl->objType != VMCIOBJ_NOT_SET) { + printk("VMCI: Received IOCTLCMD_VMCI_CREATE_DATAGRAM_PROCESS on " + "initialized handle.\n"); + retval = -EINVAL; + break; + } + ASSERT(!devHndl->obj); + + retval = copy_from_user(&createInfo, (void *)arg, sizeof createInfo); + if (retval != 0) { + printk("VMCI: Error getting datagram create info, %d.\n", retval); + retval = -EFAULT; + break; + } + + if (VMCIDatagramProcess_Create(&dgmProc, &createInfo) < VMCI_SUCCESS) { + retval = -EINVAL; + break; + } + + retval = copy_to_user((void *)arg, &createInfo, sizeof createInfo); + if (retval != 0) { + VMCIDatagramProcess_Destroy(dgmProc); + printk("VMCI: Failed to create datagram process.\n"); + retval = -EFAULT; + break; + } + devHndl->obj = dgmProc; + devHndl->objType = VMCIOBJ_DATAGRAM_PROCESS; + break; + } + + case IOCTL_VMCI_DATAGRAM_SEND: { + VMCIDatagramSendRecvInfo sendInfo; + VMCIDatagram *dg = NULL; + + if (devHndl->objType != VMCIOBJ_DATAGRAM_PROCESS) { + printk("VMCI: Ioctl %d only valid for process datagram handle.\n", + cmd); + retval = -EINVAL; + break; + } + + retval = copy_from_user(&sendInfo, (void *) arg, sizeof sendInfo); + if (retval) { + printk("VMCI: copy_from_user failed.\n"); + retval = -EFAULT; + break; + } + + if (sendInfo.len > VMCI_MAX_DG_SIZE) { + printk("VMCI: datagram size too big.\n"); + retval = -EINVAL; + break; + } + + dg = VMCI_AllocKernelMem(sendInfo.len, VMCI_MEMORY_NORMAL); + if (dg == NULL) { + printk("VMCI: Cannot allocate memory to dispatch datagram.\n"); + retval = -ENOMEM; + break; + } + + retval = copy_from_user(dg, (char *)(VA)sendInfo.addr, sendInfo.len); + if (retval != 0) { + printk("VMCI: Error getting datagram: %d\n", retval); + VMCI_FreeKernelMem(dg, sendInfo.len); + retval = -EFAULT; + break; + } + + DEBUG_ONLY(printk("VMCI: Datagram dst handle 0x%x:0x%x, src handle " + "0x%x:0x%x, payload size %"FMT64"u.\n", + dg->dst.context, dg->dst.resource, + dg->src.context, dg->src.resource, dg->payloadSize)); + + sendInfo.result = VMCIDatagram_Send(dg); + VMCI_FreeKernelMem(dg, sendInfo.len); + + retval = copy_to_user((void *)arg, &sendInfo, sizeof sendInfo); + break; + } + + case IOCTL_VMCI_DATAGRAM_RECEIVE: { + VMCIDatagramSendRecvInfo recvInfo; + VMCIDatagram *dg = NULL; + + if (devHndl->objType != VMCIOBJ_DATAGRAM_PROCESS) { + printk("VMCI: Ioctl %d only valid for process datagram handle.\n", + cmd); + retval = -EINVAL; + break; + } + + retval = copy_from_user(&recvInfo, (void *) arg, sizeof recvInfo); + if (retval) { + printk("VMCI: copy_from_user failed.\n"); + retval = -EFAULT; + break; + } + + ASSERT(devHndl->obj); + recvInfo.result = + VMCIDatagramProcess_ReadCall((VMCIDatagramProcess *)devHndl->obj, + recvInfo.len, &dg); + if (recvInfo.result < VMCI_SUCCESS) { + retval = -EINVAL; + break; + } + ASSERT(dg); + retval = copy_to_user((void *) ((uintptr_t) recvInfo.addr), dg, + VMCI_DG_SIZE(dg)); + VMCI_FreeKernelMem(dg, VMCI_DG_SIZE(dg)); + if (retval != 0) { + break; + } + retval = copy_to_user((void *)arg, &recvInfo, sizeof recvInfo); + break; + } + + case IOCTL_VMCI_GET_CONTEXT_ID: { + VMCIId cid = VMCI_GetContextID(); + + retval = copy_to_user((void *)arg, &cid, sizeof cid); + break; + } + + default: + printk(KERN_DEBUG "vmci_ioctl(): unknown ioctl 0x%x.\n", cmd); + retval = -EINVAL; + break; + } + + return retval; +#endif +} + + +/* + *----------------------------------------------------------------------------- + * + * vmci_poll -- + * + * vmci poll function + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static unsigned int +vmci_poll(struct file *file, // IN + poll_table *wait) // IN +{ + VMCILockFlags flags; + unsigned int mask = 0; + VMCIGuestDeviceHandle *devHndl = + (VMCIGuestDeviceHandle *) file->private_data; + + /* + * Check for call to this VMCI process. + */ + + if (!devHndl) { + return mask; + } + if (devHndl->objType == VMCIOBJ_DATAGRAM_PROCESS) { + VMCIDatagramProcess *dgmProc = (VMCIDatagramProcess *) devHndl->obj; + ASSERT(dgmProc); + + if (wait != NULL) { + poll_wait(file, &dgmProc->host.waitQueue, wait); + } + + VMCI_GrabLock_BH(&dgmProc->datagramQueueLock, &flags); + if (dgmProc->pendingDatagrams > 0) { + mask = POLLIN; + } + VMCI_ReleaseLock_BH(&dgmProc->datagramQueueLock, flags); + } + + return mask; +} + + +/* + *----------------------------------------------------------------------------- + * + * vmci_interrupt -- + * + * Interrupt handler. + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19) +static compat_irqreturn_t +vmci_interrupt(int irq, // IN + void *clientdata, // IN + struct pt_regs *regs) // IN +#else +static compat_irqreturn_t +vmci_interrupt(int irq, // IN + void *clientdata) // IN +#endif +{ + vmci_device *dev = clientdata; + unsigned int icr = 0; + + if (dev == NULL) { + printk (KERN_DEBUG "vmci_interrupt(): irq %d for unknown device.\n", + irq); + return COMPAT_IRQ_NONE; + } + + /* Acknowledge interrupt and determine what needs doing. */ + icr = inl(dev->ioaddr + VMCI_ICR_ADDR); + if (icr == 0) { + return COMPAT_IRQ_NONE; + } + + if (icr & VMCI_ICR_DATAGRAM) { + tasklet_schedule(&vmci_tasklet); + icr &= ~VMCI_ICR_DATAGRAM; + } + if (icr != 0) { + printk(KERN_INFO LGPFX"Ignoring unknown interrupt cause (%d).\n", icr); + } + + return COMPAT_IRQ_HANDLED; +} + + +/* + *----------------------------------------------------------------------------- + * + * VMCI_DeviceEnabled -- + * + * Checks whether the VMCI device is enabled. + * + * Results: + * TRUE if device is enabled, FALSE otherwise. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +Bool +VMCI_DeviceEnabled(void) +{ + Bool retval; + + down(&vmci_dev.lock); + retval = vmci_dev.enabled; + up(&vmci_dev.lock); + + return retval; +} + + +/* + *----------------------------------------------------------------------------- + * + * VMCI_SendDatagram -- + * + * VM to hypervisor call mechanism. We use the standard VMware naming + * convention since shared code is calling this function as well. + * + * Results: + * The result of the hypercall. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +int +VMCI_SendDatagram(VMCIDatagram *dg) +{ + unsigned long flags; + int result; + + /* Check args. */ + if (dg == NULL) { + return VMCI_ERROR_INVALID_ARGS; + } + + /* + * Need to acquire spinlock on the device because + * the datagram data may be spread over multiple pages and the monitor may + * interleave device user rpc calls from multiple VCPUs. Acquiring the + * spinlock precludes that possibility. Disabling interrupts to avoid + * incoming datagrams during a "rep out" and possibly landing up in this + * function. + */ + spin_lock_irqsave(&vmci_dev.dev_spinlock, flags); + + /* + * Send the datagram and retrieve the return value from the result register. + */ + __asm__ __volatile__( + "cld\n\t" + "rep outsb\n\t" + : /* No output. */ + : "d"(vmci_dev.ioaddr + VMCI_DATA_OUT_ADDR), + "c"(VMCI_DG_SIZE(dg)), "S"(dg) + ); + + /* + * XXX Should read result high port as well when updating handlers to + * return 64bit. + */ + result = inl(vmci_dev.ioaddr + VMCI_RESULT_LOW_ADDR); + spin_unlock_irqrestore(&vmci_dev.dev_spinlock, flags); + + return result; +} + + +/* + *----------------------------------------------------------------------------- + * + * dispatch_datagrams -- + * + * Reads and dispatches incoming datagrams. + * + * Results: + * None. + * + * Side effects: + * Reads data from the device. + * + *----------------------------------------------------------------------------- + */ + +void +dispatch_datagrams(unsigned long data) +{ + vmci_device *dev = (vmci_device *)data; + + if (dev == NULL) { + printk(KERN_DEBUG "vmci: dispatch_datagrams(): no vmci device" + "present.\n"); + return; + } + + if (data_buffer == NULL) { + printk(KERN_DEBUG "vmci: dispatch_datagrams(): no buffer present.\n"); + return; + } + + + VMCI_ReadDatagramsFromPort((VMCIIoHandle) 0, dev->ioaddr + VMCI_DATA_IN_ADDR, + data_buffer, data_buffer_size); +} + + +module_init(vmci_init); +module_exit(vmci_exit); +MODULE_DEVICE_TABLE(pci, vmci_ids); + +/* Module information. */ +MODULE_AUTHOR("VMware, Inc."); +MODULE_DESCRIPTION("VMware Virtual Machine Communication Interface"); +MODULE_VERSION(VMCI_DRIVER_VERSION_STRING); +MODULE_LICENSE("GPL v2"); diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmci/vmciEvent.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vmciEvent.c --- open-vm-tools-2008.01.23-74039/modules/linux/vmci/vmciEvent.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vmciEvent.c 2008-10-13 08:01:41.000000000 +0100 @@ -0,0 +1,468 @@ +/********************************************************* + * Copyright (C) 2007 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * vmciEvent.c -- + * + * VMCI Event code for host and guests. + */ + +#if defined(__linux__) && !defined(VMKERNEL) +# include "driver-config.h" + +# define EXPORT_SYMTAB + +# include <linux/module.h> +# include "compat_kernel.h" +#endif // __linux__ +#include "vmci_defs.h" +#include "vmci_kernel_if.h" +#include "vmci_infrastructure.h" +#include "vmciEvent.h" +#ifdef VMX86_TOOLS +# include "vmciInt.h" +# include "vmciGuestKernelAPI.h" +# include "vmciUtil.h" +#else +# include "vmciDriver.h" +#endif +#include "circList.h" +#ifdef VMKERNEL +# include "vm_libc.h" +#endif + +#define EVENT_MAGIC 0xEABE0000 + + +typedef struct VMCISubscription { + VMCIId id; + VMCI_Event event; + VMCI_EventCB callback; + void *callbackData; + ListItem subscriberListItem; +} VMCISubscription; + +typedef struct VMCISubscriptionItem { + ListItem listItem; + VMCISubscription sub; +} VMCISubscriptionItem; + + +static VMCISubscription *VMCIEventFind(VMCIId subID); +static int VMCIEventRegisterSubscription(VMCISubscription *sub, VMCI_Event event, + VMCI_EventCB callback, + void *callbackData); +static VMCISubscription *VMCIEventUnregisterSubscription(VMCIId subID); + +/* + * In the guest, VMCI events are dispatched from interrupt context, so + * the locks need to be bottom half safe. In the host kernel, this + * isn't so, and regular locks are used instead. + */ + +#ifdef VMX86_TOOLS +#define VMCIEventInitLock(_lock, _name) VMCI_InitLock(_lock, _name, VMCI_LOCK_RANK_MIDDLE_BH) +#define VMCIEventGrabLock(_lock, _flags) VMCI_GrabLock_BH(_lock, _flags) +#define VMCIEventReleaseLock(_lock, _flags) VMCI_ReleaseLock_BH(_lock, _flags) +#else +#define VMCIEventInitLock(_lock, _name) VMCI_InitLock(_lock, _name, VMCI_LOCK_RANK_HIGH) +#define VMCIEventGrabLock(_lock, _flags) VMCI_GrabLock(_lock, _flags) +#define VMCIEventReleaseLock(_lock, _flags) VMCI_ReleaseLock(_lock, _flags) +#endif + + +static ListItem *subscriberArray[VMCI_EVENT_MAX] = {NULL}; +static VMCILock subscriberLock; + + +/* + *---------------------------------------------------------------------- + * + * VMCIEvent_Init -- + * + * General init code. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +void +VMCIEvent_Init(void) +{ + VMCIEventInitLock(&subscriberLock, "VMCIEventSubscriberLock"); +} + + +/* + *---------------------------------------------------------------------- + * + * VMCIEvent_Exit -- + * + * General exit code. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +void +VMCIEvent_Exit(void) +{ + VMCILockFlags flags; + ListItem *iter, *iter2; + VMCI_Event e; + + /* We free all memory at exit. */ + VMCIEventGrabLock(&subscriberLock, &flags); + for (e = 0; e < VMCI_EVENT_MAX; e++) { + LIST_SCAN_SAFE(iter, iter2, subscriberArray[e]) { + VMCISubscription *cur = + LIST_CONTAINER(iter, VMCISubscription, subscriberListItem); + VMCI_FreeKernelMem(cur, sizeof *cur); + } + subscriberArray[e] = NULL; + } + VMCIEventReleaseLock(&subscriberLock, flags); + VMCI_CleanupLock(&subscriberLock); +} + +#ifdef VMX86_TOOLS +/* + *----------------------------------------------------------------------------- + * + * VMCIEvent_CheckHostCapabilities -- + * + * Verify that the host supports the hypercalls we need. If it does not, + * try to find fallback hypercalls and use those instead. + * + * Results: + * TRUE if required hypercalls (or fallback hypercalls) are + * supported by the host, FALSE otherwise. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +Bool +VMCIEvent_CheckHostCapabilities(void) +{ + /* VMCIEvent does not require any hypercalls. */ + return TRUE; +} +#endif + +/* + *----------------------------------------------------------------------------- + * + * VMCIEventFind -- + * + * Find entry. Assumes lock is held. + * + * Results: + * Entry if found, NULL if not. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static VMCISubscription * +VMCIEventFind(VMCIId subID) // IN +{ + ListItem *iter; + VMCI_Event e; + + for (e = 0; e < VMCI_EVENT_MAX; e++) { + LIST_SCAN(iter, subscriberArray[e]) { + VMCISubscription *cur = + LIST_CONTAINER(iter, VMCISubscription, subscriberListItem); + if (cur->id == subID) { + return cur; + } + } + } + return NULL; +} + + +/* + *---------------------------------------------------------------------- + * + * VMCIEvent_Dispatch -- + * + * Dispatcher for the VMCI_EVENT_RECEIVE datagrams. Calls all + * subscribers for given event. + * + * Results: + * VMCI_SUCCESS on success, error code otherwise. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +int +VMCIEvent_Dispatch(VMCIDatagram *msg) // IN +{ + ListItem *iter; + VMCILockFlags flags; + VMCIEventMsg *eventMsg = (VMCIEventMsg *)msg; + + ASSERT(msg && + msg->src.context == VMCI_HYPERVISOR_CONTEXT_ID && + msg->dst.resource == VMCI_EVENT_HANDLER); + + if (msg->payloadSize < sizeof(VMCI_Event) || + msg->payloadSize > sizeof(VMCIEventData_Max)) { + return VMCI_ERROR_INVALID_ARGS; + } + + if (eventMsg->eventData.event >= VMCI_EVENT_MAX) { + return VMCI_ERROR_EVENT_UNKNOWN; + } + + VMCIEventGrabLock(&subscriberLock, &flags); + LIST_SCAN(iter, subscriberArray[eventMsg->eventData.event]) { + uint8 eventPayload[sizeof(VMCIEventData_Max)]; + VMCI_EventData *ed; + VMCISubscription *cur = LIST_CONTAINER(iter, VMCISubscription, + subscriberListItem); + ASSERT(cur && cur->event == eventMsg->eventData.event); + + /* We set event data before each callback to ensure isolation. */ + memset(eventPayload, 0, sizeof eventPayload); + memcpy(eventPayload, VMCI_DG_PAYLOAD(eventMsg), + (size_t)eventMsg->hdr.payloadSize); + ed = (VMCI_EventData *)eventPayload; + cur->callback(cur->id, ed, cur->callbackData); + } + VMCIEventReleaseLock(&subscriberLock, flags); + + return VMCI_SUCCESS; +} + + +/* + *---------------------------------------------------------------------- + * + * VMCIEventRegisterSubscription -- + * + * Initialize and add subscription to subscriber list. + * + * Results: + * VMCI_SUCCESS on success, error code otherwise. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +static int +VMCIEventRegisterSubscription(VMCISubscription *sub, // IN + VMCI_Event event, // IN + VMCI_EventCB callback, // IN + void *callbackData) // IN +{ +# define VMCI_EVENT_MAX_ATTEMPTS 10 + static VMCIId subscriptionID = 0; + VMCILockFlags flags; + uint32 attempts = 0; + int result; + Bool success; + + ASSERT(sub); + + if (event >= VMCI_EVENT_MAX || callback == NULL) { + VMCI_LOG(("VMCIEvent: Failed to subscribe to event %d cb %p data %p.\n", + event, callback, callbackData)); + return VMCI_ERROR_INVALID_ARGS; + } + + sub->event = event; + sub->callback = callback; + sub->callbackData = callbackData; + + VMCIEventGrabLock(&subscriberLock, &flags); + ASSERT(subscriberArray); + for (success = FALSE, attempts = 0; + success == FALSE && attempts < VMCI_EVENT_MAX_ATTEMPTS; + attempts++) { + + /* + * We try to get an id a couple of time before claiming we are out of + * resources. + */ + sub->id = ++subscriptionID; + + /* Test for duplicate id. */ + if (VMCIEventFind(sub->id) == NULL) { + /* We succeeded if we didn't find a duplicate. */ + success = TRUE; + } + } + + if (success) { + LIST_QUEUE(&sub->subscriberListItem, &subscriberArray[event]); + result = VMCI_SUCCESS; + } else { + result = VMCI_ERROR_NO_RESOURCES; + } + VMCIEventReleaseLock(&subscriberLock, flags); + + return result; +# undef VMCI_EVENT_MAX_ATTEMPTS +} + + + +/* + *---------------------------------------------------------------------- + * + * VMCIEventUnregisterSubscription -- + * + * Remove subscription from subscriber list. + * + * Results: + * VMCISubscription when found, NULL otherwise. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +static VMCISubscription * +VMCIEventUnregisterSubscription(VMCIId subID) // IN +{ + VMCILockFlags flags; + VMCISubscription *s; + + VMCIEventGrabLock(&subscriberLock, &flags); + s = VMCIEventFind(subID); + if (s != NULL) { + LIST_DEL(&s->subscriberListItem, &subscriberArray[s->event]); + } + VMCIEventReleaseLock(&subscriberLock, flags); + + return s; +} + + +/* + *---------------------------------------------------------------------- + * + * VMCIEvent_Subscribe -- + * + * Subscribe to given event. + * + * Results: + * VMCI_SUCCESS on success, error code otherwise. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +#if defined(__linux__) && !defined(VMKERNEL) +EXPORT_SYMBOL(VMCIEvent_Subscribe); +#endif + +int +VMCIEvent_Subscribe(VMCI_Event event, // IN + VMCI_EventCB callback, // IN + void *callbackData, // IN + VMCIId *subscriptionID) // OUT +{ + int retval; + VMCISubscription *s = NULL; + + if (subscriptionID == NULL) { + VMCI_LOG(("VMCIEvent: Invalid arguments.\n")); + return VMCI_ERROR_INVALID_ARGS; + } + + s = VMCI_AllocKernelMem(sizeof *s, VMCI_MEMORY_NONPAGED); + if (s == NULL) { + return VMCI_ERROR_NO_MEM; + } + + retval = VMCIEventRegisterSubscription(s, event, callback, callbackData); + if (retval < VMCI_SUCCESS) { + VMCI_FreeKernelMem(s, sizeof *s); + return retval; + } + + *subscriptionID = s->id; + return retval; +} + + +/* + *---------------------------------------------------------------------- + * + * VMCIEvent_Unsubscribe -- + * + * Unsubscribe to given event. Removes it from list and frees it. + * Will return callbackData if requested by caller. + * + * Results: + * VMCI_SUCCESS on success, error code otherwise. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +#if defined(__linux__) && !defined(VMKERNEL) +EXPORT_SYMBOL(VMCIEvent_Unsubscribe); +#endif + +int +VMCIEvent_Unsubscribe(VMCIId subID) // IN +{ + VMCISubscription *s; + + /* + * Return subscription. At this point we know noone else is accessing + * the subscription so we can free it. + */ + s = VMCIEventUnregisterSubscription(subID); + if (s == NULL) { + return VMCI_ERROR_NOT_FOUND; + + } + VMCI_FreeKernelMem(s, sizeof *s); + + return VMCI_SUCCESS; +} diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmci/vmciEvent.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vmciEvent.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmci/vmciEvent.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vmciEvent.h 2008-10-13 08:01:41.000000000 +0100 @@ -0,0 +1,56 @@ +/********************************************************* + * Copyright (C) 2007 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * vmciEvent.h -- + * + * Event code for the vmci guest driver + */ + +#ifndef __VMCI_EVENT_H__ +#define __VMCI_EVENT_H__ + +#define INCLUDE_ALLOW_MODULE +#define INCLUDE_ALLOW_VMMON +#define INCLUDE_ALLOW_VMCORE +#define INCLUDE_ALLOW_VMKERNEL +#include "includeCheck.h" + +#include "vmci_defs.h" +#include "vmci_call_defs.h" + +void VMCIEvent_Init(void); +void VMCIEvent_Exit(void); +int VMCIEvent_Dispatch(VMCIDatagram *msg); +#ifdef VMX86_TOOLS +Bool VMCIEvent_CheckHostCapabilities(void); +#else + +/* + * Public VMCI Event API for host kernel. + */ + +typedef void (*VMCI_EventCB)(VMCIId subID, VMCI_EventData *ed, + void *clientData); + +int VMCIEvent_Subscribe(VMCI_Event event, VMCI_EventCB callback, + void *callbackData, VMCIId *subID); +int VMCIEvent_Unsubscribe(VMCIId subID); +#endif + +#endif //__VMCI_EVENT_H__ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmci/vmciGuestDs.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vmciGuestDs.c --- open-vm-tools-2008.01.23-74039/modules/linux/vmci/vmciGuestDs.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vmciGuestDs.c 2008-10-13 08:01:41.000000000 +0100 @@ -0,0 +1,259 @@ +/********************************************************* + * Copyright (C) 2007 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * vmciGuestDs.c + * + * Implements the client-access API to the VMCI discovery service in + * the guest kernel. + * + */ + +#ifdef __linux__ +# include "driver-config.h" + +# define EXPORT_SYMTAB + +# include <linux/module.h> +# include "compat_kernel.h" +# include "compat_pci.h" +#elif defined(_WIN32) +# include <ntddk.h> +#elif defined(SOLARIS) +# include <sys/ddi.h> +# include <sys/sunddi.h> +#else +# error "Platform not support by VMCI datagram API." +#endif // linux + +#include "vm_basic_types.h" +#include "vm_atomic.h" +#include "vm_assert.h" +#include "vmci_defs.h" +#include "vmci_kernel_if.h" +#include "vmci_infrastructure.h" +#include "vmciInt.h" +#include "vmciUtil.h" +#include "vmciDatagram.h" + +static Atomic_uint32 MsgIdCounter = { 0 }; + +typedef struct VMCIDsRecvData { + VMCIHost context; + VMCILock lock; + int status; + uint8 buffer[VMCI_DS_MAX_MSG_SIZE]; +} VMCIDsRecvData; + +static int VMCIDsDoCall(int action, const char *name, VMCIHandle handle, + VMCIHandle *handleOut); +static int VMCIDsRecvCB(void *clientData, struct VMCIDatagram *msg); + +/* + *------------------------------------------------------------------------- + * + * VMCIDs_Lookup -- + * + * Look up a handle in the VMCI discovery service based on + * the given name. + * + * Results: + * Error code. 0 if success. + * + * Side effects: + * None. + * + *------------------------------------------------------------------------- + */ + +#ifdef __linux__ +EXPORT_SYMBOL(VMCIDs_Lookup); +#endif + +int +VMCIDs_Lookup(const char *name, // IN + VMCIHandle *out) // +{ + return VMCIDsDoCall(VMCI_DS_ACTION_LOOKUP, name, VMCI_INVALID_HANDLE, out); +} + + +/* + *------------------------------------------------------------------------- + * + * VMCIDsDoCall -- + * + * Serialize a call into the CDS wire-format, send it across + * the VMCI device, wait for a response, and return + * the results. + * + * Results: + * Error code. 0 if success. + * + * Side effects: + * None. + * + *------------------------------------------------------------------------- + */ + + +static int +VMCIDsDoCall(int action, // IN + const char *name, // IN + VMCIHandle handle, // IN: For the "register" action + VMCIHandle *handleOut) // OUT: For the "lookup" action +{ + int8 *sendBuffer = NULL; + const size_t sendBufferSize = VMCI_DS_MAX_MSG_SIZE + sizeof(VMCIDatagram); + int nameLen, requestSize, res; + uint32 savedMsgIdCounter; + VMCIDsReplyHeader *reply; + VMCIHandle dsHandle = VMCI_INVALID_HANDLE; + VMCIDsRecvData *recvData = NULL; + VMCIDatagram *dgram; + VMCIDsRequestHeader *request; + VMCILockFlags flags; + + nameLen = strlen(name); + if (nameLen + sizeof *request > sendBufferSize) { + res = VMCI_ERROR_INVALID_ARGS; + goto out; + } + + sendBuffer = VMCI_AllocKernelMem(sendBufferSize, VMCI_MEMORY_NONPAGED); + if (sendBuffer == NULL) { + res = VMCI_ERROR_NO_MEM; + goto out; + } + + recvData = VMCI_AllocKernelMem(sizeof *recvData, VMCI_MEMORY_NONPAGED); + if (recvData == NULL) { + res = VMCI_ERROR_NO_MEM; + goto out; + } + + VMCIHost_InitContext(&recvData->context, (uintptr_t) recvData); + VMCI_InitLock(&recvData->lock, "VMCIDsRecvHandler", VMCI_LOCK_RANK_MIDDLE_BH); + + savedMsgIdCounter = Atomic_FetchAndInc(&MsgIdCounter); + + dgram = (VMCIDatagram *) sendBuffer; + request = (VMCIDsRequestHeader *) (sendBuffer + sizeof *dgram); + + /* Serialize request. */ + request->action = action; + request->msgid = savedMsgIdCounter; + request->handle = handle; + request->nameLen = nameLen; + memcpy(request->name, name, nameLen + 1); + + requestSize = sizeof *request + nameLen; + + if (VMCIDatagram_CreateHnd(VMCI_INVALID_ID, 0, VMCIDsRecvCB, + recvData, &dsHandle) != VMCI_SUCCESS) { + res = VMCI_ERROR_NO_HANDLE; + goto out; + } + + dgram->dst = VMCI_DS_HANDLE; + dgram->src = dsHandle; + dgram->payloadSize = requestSize; + + /* Send the datagram to CDS. */ + res = VMCIDatagram_Send(dgram); + if (res <= 0) { + goto out; + } + + /* Block here waiting for the reply */ + VMCI_GrabLock_BH(&recvData->lock, &flags); + VMCIHost_WaitForCallLocked(&recvData->context, &recvData->lock, &flags, TRUE); + VMCI_ReleaseLock_BH(&recvData->lock, flags); + + if (recvData->status != VMCI_SUCCESS) { + res = recvData->status; + goto out; + } + + reply = (VMCIDsReplyHeader *) recvData->buffer; + /* Check that the msgid matches what we expect. */ + if (reply->msgid != savedMsgIdCounter) { + res = VMCI_ERROR_GENERIC; + goto out; + } + + if (handleOut != NULL) { + *handleOut = reply->handle; + } + + res = reply->code; + +out: + if (!VMCI_HANDLE_EQUAL(dsHandle, VMCI_INVALID_HANDLE)) { + VMCIDatagram_DestroyHnd(dsHandle); + } + if (recvData) { + VMCI_CleanupLock(&recvData->lock); + VMCIHost_ReleaseContext(&recvData->context); + VMCI_FreeKernelMem(recvData, sizeof *recvData); + } + if (sendBuffer) { + VMCI_FreeKernelMem(sendBuffer, sendBufferSize); + } + return res; +} + +/* + *----------------------------------------------------------------------------- + * + * VMCIDsRecvCB -- + * + * Receive callback for the Discovery Service query datagram + * handle. + * + * Results: + * If the received payload is not larger than the MAX, it is + * copied into clientData. + * + * Side effects: + * Signals the thread waiting for the reply. + * + *----------------------------------------------------------------------------- + */ + + +static int +VMCIDsRecvCB(void *clientData, // IN: client data for handler + struct VMCIDatagram *msg) // IN +{ + VMCIDsRecvData *recvData = clientData; + VMCILockFlags flags; + + ASSERT(msg->payloadSize <= VMCI_DS_MAX_MSG_SIZE); + if (msg->payloadSize <= VMCI_DS_MAX_MSG_SIZE) { + memcpy(recvData->buffer, VMCI_DG_PAYLOAD(msg), (size_t)msg->payloadSize); + recvData->status = VMCI_SUCCESS; + } else { + recvData->status = VMCI_ERROR_PAYLOAD_TOO_LARGE; + } + + VMCI_GrabLock_BH(&recvData->lock, &flags); + VMCIHost_SignalCall(&recvData->context); + VMCI_ReleaseLock_BH(&recvData->lock, flags); + return 0; +} diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmci/vmciGuestKernelAPI.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vmciGuestKernelAPI.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmci/vmciGuestKernelAPI.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vmciGuestKernelAPI.h 2008-10-13 08:01:41.000000000 +0100 @@ -0,0 +1,81 @@ +/********************************************************* + * Copyright (C) 2007 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * vmciGuestKernelAPI.h -- + * + * Kernel API exported from the VMCI guest driver. + */ + +#ifndef __VMCI_GUESTKERNELAPI_H__ +#define __VMCI_GUESTKERNELAPI_H__ + +/* VMCI guest kernel API version number. */ +#define VMCI_GUEST_KERNEL_API_VERSION 1 + +/* Macros to operate on the driver version number. */ +#define VMCI_MAJOR_VERSION(v) (((v) >> 16) & 0xffff) +#define VMCI_MINOT_VERSION(v) ((v) & 0xffff) + +#define INCLUDE_ALLOW_MODULE +#include "includeCheck.h" + +#include "vmci_defs.h" +#include "vmci_call_defs.h" + +#if defined(__linux__) || defined(_WIN32) + /* XXX TODO for other guests. */ +# include "vmci_queue_pair.h" +#endif + +/* VMCI Device Usage API. */ +Bool VMCI_DeviceGet(void); +void VMCI_DeviceRelease(void); + +/* VMCI Datagram API. */ +int VMCIDatagram_CreateHnd(VMCIId resourceID, uint32 flags, + VMCIDatagramRecvCB recvCB, void *clientData, + VMCIHandle *outHandle); +int VMCIDatagram_DestroyHnd(VMCIHandle handle); +int VMCIDatagram_Send(VMCIDatagram *msg); + +/* VMCI Utility API. */ +VMCIId VMCI_GetContextID(void); +uint32 VMCI_Version(void); + +/* VMCI Event API. */ + +typedef void (*VMCI_EventCB)(VMCIId subID, VMCI_EventData *ed, + void *clientData); + +int VMCIEvent_Subscribe(VMCI_Event event, VMCI_EventCB callback, + void *callbackData, VMCIId *subID); +int VMCIEvent_Unsubscribe(VMCIId subID); + +/* VMCI Discovery Service API. */ +int VMCIDs_Lookup(const char *name, VMCIHandle *out); + +#if defined(__linux__) || defined(_WIN32) +/* VMCI QueuePair API. XXX TODO for other guests. */ +int VMCIQueuePair_Alloc(VMCIHandle *handle, VMCIQueue **produceQ, + uint64 produceSize, VMCIQueue **consumeQ, + uint64 consumeSize, VMCIId peer, uint32 flags); +int VMCIQueuePair_Detach(VMCIHandle handle); +#endif + +#endif /* !__VMCI_GUESTKERNELAPI_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmci/vmciGuestKernelIf.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vmciGuestKernelIf.c --- open-vm-tools-2008.01.23-74039/modules/linux/vmci/vmciGuestKernelIf.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vmciGuestKernelIf.c 2008-10-13 08:01:41.000000000 +0100 @@ -0,0 +1,66 @@ +/********************************************************* + * Copyright (C) 2007 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * vmciGuestKernelIf.c -- + * + * This file implements guest only OS helper functions for VMCI. + * This is the linux specific implementation. + */ + +/* Must come before any kernel header file */ +#include "driver-config.h" + +#if !defined(linux) || defined(VMKERNEL) +#error "Wrong platform." +#endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 9) +#include <linux/moduleparam.h> +#endif + +#include "compat_version.h" +#include "compat_pci.h" +#include "vm_basic_types.h" +#include "vmciGuestKernelIf.h" + + +/* + *----------------------------------------------------------------------------- + * + * VMCI_ReadPortBytes -- + * + * Copy memory from an I/O port to kernel memory. + * + * Results: + * No results. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +void +VMCI_ReadPortBytes(VMCIIoHandle handle, // IN: Unused + VMCIIoPort port, // IN + uint8 *buffer, // OUT + size_t bufferLength) // IN +{ + insb(port, buffer, bufferLength); +} diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmci/vmciGuestKernelIf.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vmciGuestKernelIf.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmci/vmciGuestKernelIf.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vmciGuestKernelIf.h 2008-10-13 08:01:41.000000000 +0100 @@ -0,0 +1,63 @@ +/********************************************************* + * Copyright (C) 2007 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * vmciGuestKernelIf.h -- + * + * This file defines OS encapsulation helper functions that are + * needed only in VMCI guest kernel code. It must work for + * windows, solaris and linux kernel, ie. using defines + * where necessary. + */ + +#ifndef _VMCI_GUEST_KERNEL_IF_H_ +#define _VMCI_GUEST_KERNEL_IF_H_ + +#if !defined(linux) && !defined(_WIN32) && !defined(SOLARIS) +#error "Platform not supported." +#endif + +#if defined(_WIN32) +#include <ntddk.h> +#endif + +#ifdef SOLARIS +# include <sys/ddi.h> +# include <sys/sunddi.h> +# include <sys/types.h> +#endif + +#include "vm_basic_types.h" +#include "vmci_defs.h" + +#if defined(linux) + typedef unsigned short int VMCIIoPort; + typedef int VMCIIoHandle; +#elif defined(_WIN32) + typedef PUCHAR VMCIIoPort; + typedef int VMCIIoHandle; +#elif defined(SOLARIS) + typedef uint8_t * VMCIIoPort; + typedef ddi_acc_handle_t VMCIIoHandle; +#endif // VMKERNEL + +void VMCI_ReadPortBytes(VMCIIoHandle handle, VMCIIoPort port, uint8 *buffer, + size_t bufferLength); + +#endif // _VMCI_GUEST_KERNEL_IF_H_ + diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmci/vmci_handle_array.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vmci_handle_array.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmci/vmci_handle_array.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vmci_handle_array.h 2008-10-13 08:01:41.000000000 +0100 @@ -0,0 +1,344 @@ +/********************************************************* + * Copyright (C) 2006 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * vmci_handle_array.h -- + * + * Simple dynamic array. + */ + +#ifndef _VMCI_HANDLE_ARRAY_H_ +#define _VMCI_HANDLE_ARRAY_H_ + +#define INCLUDE_ALLOW_VMMON +#define INCLUDE_ALLOW_MODULE +#define INCLUDE_ALLOW_VMCORE +#define INCLUDE_ALLOW_VMKERNEL +#include "includeCheck.h" + +#include "vmci_kernel_if.h" +#include "vmware.h" + +#include "vmci_defs.h" +#include "vm_assert.h" +#ifdef VMKERNEL +#include "vm_libc.h" +#endif // VMKERNEL + +#ifdef SOLARIS +#include <sys/ddi.h> +#include <sys/kmem.h> +#include <sys/types.h> +#include <sys/systm.h> +#endif + +#define VMCI_HANDLE_ARRAY_DEFAULT_SIZE 4 + +typedef struct VMCIHandleArray { + uint32 capacity; + uint32 size; + VMCIHandle entries[1]; +} VMCIHandleArray; + + +/* + *----------------------------------------------------------------------------------- + * + * VMCIHandleArray_Create -- + * + * Results: + * Array if successful, NULL if not. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------------- + */ + +static INLINE VMCIHandleArray * +VMCIHandleArray_Create(uint32 capacity) +{ + VMCIHandleArray *array; + + if (capacity == 0) { + capacity = VMCI_HANDLE_ARRAY_DEFAULT_SIZE; + } + + array = (VMCIHandleArray *)VMCI_AllocKernelMem(sizeof array->capacity + + sizeof array->size + + capacity * sizeof(VMCIHandle), + VMCI_MEMORY_NONPAGED); + if (array == NULL) { + return NULL; + } + array->capacity = capacity; + array->size = 0; + + return array; +} + + +/* + *----------------------------------------------------------------------------------- + * + * VMCIHandleArray_Destroy -- + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------------- + */ + +static INLINE void +VMCIHandleArray_Destroy(VMCIHandleArray *array) +{ + VMCI_FreeKernelMem(array, + sizeof array->capacity + sizeof array->size + + array->capacity * sizeof(VMCIHandle)); +} + + +/* + *----------------------------------------------------------------------------------- + * + * VMCIHandleArray_AppendEntry -- + * + * Results: + * None. + * + * Side effects: + * Array may be reallocated. + * + *----------------------------------------------------------------------------------- + */ + +static INLINE void +VMCIHandleArray_AppendEntry(VMCIHandleArray **arrayPtr, + VMCIHandle handle) +{ + VMCIHandleArray *array; + + ASSERT(arrayPtr && *arrayPtr); + array = *arrayPtr; + + if (UNLIKELY(array->size >= array->capacity)) { + /* reallocate. */ + uint32 arraySize = sizeof array->capacity + sizeof array->size + + array->capacity * sizeof(VMCIHandle); + VMCIHandleArray *newArray = + VMCI_AllocKernelMem(arraySize + array->capacity * sizeof(VMCIHandle), + VMCI_MEMORY_NONPAGED); + if (newArray == NULL) { + return; + } + memcpy(newArray, array, arraySize); + newArray->capacity *= 2; + VMCI_FreeKernelMem(array, arraySize); + *arrayPtr = newArray; + array = newArray; + } + array->entries[array->size] = handle; + array->size++; +} + + +/* + *----------------------------------------------------------------------------------- + * + * VMCIHandleArray_RemoveEntry -- + * + * Results: + * Handle that was removed, VMCI_INVALID_HANDLE if entry not found. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------------- + */ + +static INLINE VMCIHandle +VMCIHandleArray_RemoveEntry(VMCIHandleArray *array, + VMCIHandle entryHandle) +{ + int i; + VMCIHandle handle = VMCI_INVALID_HANDLE; + + ASSERT(array); + for (i = 0; i < array->size; i++) { + if (VMCI_HANDLE_EQUAL(array->entries[i], entryHandle)) { + handle = array->entries[i]; + array->entries[i] = array->entries[array->size-1]; + array->entries[array->size-1] = VMCI_INVALID_HANDLE; + array->size--; + break; + } + } + + return handle; +} + + +/* + *----------------------------------------------------------------------------------- + * + * VMCIHandleArray_RemoveTail -- + * + * Results: + * Handle that was removed, VMCI_INVALID_HANDLE if array was empty. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------------- + */ + +static INLINE VMCIHandle +VMCIHandleArray_RemoveTail(VMCIHandleArray *array) +{ + VMCIHandle handle; + + if (array->size == 0) { + return VMCI_INVALID_HANDLE; + } + handle = array->entries[array->size-1]; + array->entries[array->size-1] = VMCI_INVALID_HANDLE; + array->size--; + + return handle; +} + + +/* + *----------------------------------------------------------------------------------- + * + * VMCIHandleArray_GetEntry -- + * + * Results: + * Handle at given index, VMCI_INVALID_HANDLE if invalid index. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------------- + */ + +static INLINE VMCIHandle +VMCIHandleArray_GetEntry(const VMCIHandleArray *array, + uint32 index) +{ + ASSERT(array); + if (UNLIKELY(index >= array->size)) { + return VMCI_INVALID_HANDLE; + } + + return array->entries[index]; +} + + +/* + *----------------------------------------------------------------------------------- + * + * VMCIHandleArray_GetSize -- + * + * Results: + * Number of entries in array. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------------- + */ + +static INLINE uint32 +VMCIHandleArray_GetSize(const VMCIHandleArray *array) +{ + ASSERT(array); + return array->size; +} + + +/* + *----------------------------------------------------------------------------------- + * + * VMCIHandleArray_HasEntry -- + * + * Results: + * TRUE is entry exists in array, FALSE if not. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------------- + */ + +static INLINE Bool +VMCIHandleArray_HasEntry(const VMCIHandleArray *array, + VMCIHandle entryHandle) +{ + int i; + + ASSERT(array); + for (i = 0; i < array->size; i++) { + if (VMCI_HANDLE_EQUAL(array->entries[i], entryHandle)) { + return TRUE; + } + } + + return FALSE; +} + + +/* + *----------------------------------------------------------------------------------- + * + * VMCIHandleArray_GetCopy -- + * + * Results: + * Returns pointer to copy of array on success or NULL, if memory allocation + * fails. + * + * Side effects: + * Allocates nonpaged memory. + * + *----------------------------------------------------------------------------------- + */ + +static INLINE VMCIHandleArray * +VMCIHandleArray_GetCopy(const VMCIHandleArray *array) +{ + VMCIHandleArray *arrayCopy; + + ASSERT(array); + + arrayCopy = (VMCIHandleArray *)VMCI_AllocKernelMem(sizeof array->capacity + + sizeof array->size + + array->size * sizeof(VMCIHandle), + VMCI_MEMORY_NONPAGED); + if (arrayCopy != NULL) { + memcpy(&arrayCopy->size, &array->size, + sizeof array->size + array->size * sizeof(VMCIHandle)); + arrayCopy->capacity = array->size; + } + + return arrayCopy; +} + +#endif // _VMCI_HANDLE_ARRAY_H_ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmci/vmci_infrastructure.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vmci_infrastructure.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmci/vmci_infrastructure.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vmci_infrastructure.h 2008-10-13 08:01:41.000000000 +0100 @@ -0,0 +1,95 @@ +/********************************************************* + * Copyright (C) 2006 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * vmci_infrastructure.h -- + * + * This file implements the VMCI infrastructure. + */ + +#ifndef _VMCI_INFRASTRUCTURE_H_ +#define _VMCI_INFRASTRUCTURE_H_ + +#define INCLUDE_ALLOW_USERLEVEL +#define INCLUDE_ALLOW_VMMEXT +#define INCLUDE_ALLOW_MODULE +#define INCLUDE_ALLOW_VMMON +#define INCLUDE_ALLOW_VMCORE +#define INCLUDE_ALLOW_VMKERNEL +#define INCLUDE_ALLOW_DISTRIBUTE +#include "includeCheck.h" + +#include "vmware.h" +#include "vmci_defs.h" + +typedef enum { + VMCIOBJ_VMX_VM = 10, + VMCIOBJ_CONTEXT, + VMCIOBJ_PROCESS, + VMCIOBJ_DATAGRAM_PROCESS, + VMCIOBJ_NOT_SET, +} VMCIObjType; + +/* Guestcalls currently support a maximum of 8 uint64 arguments. */ +#define VMCI_GUESTCALL_MAX_ARGS_SIZE 64 + +/* Used to determine what checkpoint state to get and set. */ +#define VMCI_NOTIFICATION_CPT_STATE 0x1 +#define VMCI_WELLKNOWN_CPT_STATE 0x2 +#define VMCI_QP_CPT_STATE 0x3 +#define VMCI_QP_INFO_CPT_STATE 0x4 + +/* Used to control the VMCI device in the vmkernel */ +#define VMCI_DEV_RESET 0x01 +#define VMCI_DEV_QP_RESET 0x02 +#define VMCI_DEV_QUIESCE 0x03 +#define VMCI_DEV_UNQUIESCE 0x04 +#define VMCI_DEV_QP_BREAK_SHARING 0x05 + +/* + *------------------------------------------------------------------------- + * + * VMCI_Hash -- + * + * Hash function used by the Simple Datagram API. Based on the djb2 + * hash function by Dan Bernstein. + * + * Result: + * Returns guest call size. + * + * Side effects: + * None. + * + *------------------------------------------------------------------------- + */ + +static INLINE int +VMCI_Hash(VMCIHandle handle, // IN + unsigned size) // IN +{ + unsigned i; + int hash = 5381; + const uint64 handleValue = QWORD(handle.resource, handle.context); + + for (i = 0; i < sizeof handle; i++) { + hash = ((hash << 5) + hash) + (uint8)(handleValue >> (i * 8)); + } + return hash & (size - 1); +} + +#endif // _VMCI_INFRASTRUCTURE_H_ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmci/vmciInt.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vmciInt.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmci/vmciInt.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vmciInt.h 2008-10-13 08:01:41.000000000 +0100 @@ -0,0 +1,39 @@ +/********************************************************* + * Copyright (C) 2006 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +#ifndef __VMCI_INT_H__ +#define __VMCI_INT_H__ + +#define INCLUDE_ALLOW_MODULE +#include "includeCheck.h" + +#include "vm_basic_types.h" +#include "vmci_call_defs.h" +#include "vmciProcess.h" + +#define DOLOG(...) printk(KERN_INFO __VA_ARGS__) +#define VMCI_LOG(_args) DOLOG _args + +/* + * Called by common code, hence the different naming convention. + * XXX Should be in vmci.h. + */ +int VMCI_SendDatagram(VMCIDatagram *dg); +Bool VMCI_DeviceEnabled(void); + +#endif /* __VMCIINT_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmci/vmci_iocontrols.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vmci_iocontrols.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmci/vmci_iocontrols.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vmci_iocontrols.h 2008-10-13 08:01:41.000000000 +0100 @@ -0,0 +1,419 @@ +/********************************************************* + * Copyright (C) 2007 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + + +/* + * vmci_iocontrols.h + * + * The VMCI driver io controls. + */ + +#ifndef _VMCI_IOCONTROLS_H_ +#define _VMCI_IOCONTROLS_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 "vmci_defs.h" + +/* + * Driver version. + * + * Increment major version when you make an incompatible change. + * Compatibility goes both ways (old driver with new executable + * as well as new driver with old executable). + */ + +#define VMCI_VERSION_SHIFT_WIDTH 16 /* Never change this. */ +#define VMCI_MAJOR_VERSION_VALUE 8 /* Bump major version number here. */ +#define VMCI_MINOR_VERSION_VALUE 0 /* Bump minor version number here. */ + +/* Don't modify the next three macros. */ +#define VMCI_VERSION (VMCI_MAJOR_VERSION_VALUE << \ + VMCI_VERSION_SHIFT_WIDTH | \ + VMCI_MINOR_VERSION_VALUE) +#define VMCI_VERSION_MAJOR(v) ((uint32) (v) >> VMCI_VERSION_SHIFT_WIDTH) +#define VMCI_VERSION_MINOR(v) ((uint16) (v)) + +#if defined(__linux__) || defined(__APPLE__) || defined(SOLARIS) || defined(VMKERNEL) +/* + * Linux defines _IO* macros, but the core kernel code ignore the encoded + * ioctl value. It is up to individual drivers to decode the value (for + * example to look at the size of a structure to determine which version + * of a specific command should be used) or not (which is what we + * currently do, so right now the ioctl value for a given command is the + * command itself). + * + * Hence, we just define the IOCTL_VMCI_foo values directly, with no + * intermediate IOCTLCMD_ representation. + */ +# define IOCTLCMD(_cmd) IOCTL_VMCI_ ## _cmd +#else // if defined(__linux__) +/* + * On platforms other than Linux, IOCTLCMD_foo values are just numbers, and + * we build the IOCTL_VMCI_foo values around these using platform-specific + * format for encoding arguments and sizes. + */ +# define IOCTLCMD(_cmd) IOCTLCMD_VMCI_ ## _cmd +#endif + + +enum IOCTLCmd_VMCI { + /* + * We need to bracket the range of values used for ioctls, because x86_64 + * Linux forces us to explicitly register ioctl handlers by value for + * handling 32 bit ioctl syscalls. Hence FIRST and LAST. Pick something + * for FIRST that doesn't collide with vmmon (2001+). + */ +#if defined(__linux__) + IOCTLCMD(FIRST) = 1951, +#else + /* Start at 0. */ + IOCTLCMD(FIRST), +#endif + IOCTLCMD(VERSION) = IOCTLCMD(FIRST), + + /* BEGIN VMCI */ + IOCTLCMD(INIT_CONTEXT), + IOCTLCMD(CREATE_PROCESS), + IOCTLCMD(CREATE_DATAGRAM_PROCESS), + IOCTLCMD(SHAREDMEM_CREATE), + IOCTLCMD(SHAREDMEM_ATTACH), + IOCTLCMD(SHAREDMEM_QUERY), + IOCTLCMD(SHAREDMEM_DETACH), + IOCTLCMD(VERSION2), + IOCTLCMD(QUEUEPAIR_ALLOC), + IOCTLCMD(QUEUEPAIR_SETPAGEFILE), + IOCTLCMD(QUEUEPAIR_DETACH), + IOCTLCMD(DATAGRAM_SEND), + IOCTLCMD(DATAGRAM_RECEIVE), + IOCTLCMD(DATAGRAM_REQUEST_MAP), + IOCTLCMD(DATAGRAM_REMOVE_MAP), + IOCTLCMD(CTX_ADD_NOTIFICATION), + IOCTLCMD(CTX_REMOVE_NOTIFICATION), + IOCTLCMD(CTX_GET_CPT_STATE), + IOCTLCMD(CTX_SET_CPT_STATE), + IOCTLCMD(GET_CONTEXT_ID), + /* END VMCI */ + + /* + * BEGIN VMCI SOCKETS + * + * We mark the end of the vmci commands and the start of the vmci sockets + * commands since they are used in separate modules on Linux. + * */ + IOCTLCMD(LAST), + IOCTLCMD(SOCKETS_FIRST) = IOCTLCMD(LAST), + IOCTLCMD(SOCKETS_ACCEPT) = IOCTLCMD(SOCKETS_FIRST), + IOCTLCMD(SOCKETS_BIND), + IOCTLCMD(SOCKETS_CLOSE), + IOCTLCMD(SOCKETS_CONNECT), + /* + * The next two values are public (vmci_sockets.h) and cannot be changed. + * That means the number of values above these cannot be changed either + * unless the base index (specified below) is updated accordingly. + */ + IOCTLCMD(SOCKETS_GET_AF_VALUE), + IOCTLCMD(SOCKETS_GET_LOCAL_CID), + IOCTLCMD(SOCKETS_GET_SOCK_NAME), + IOCTLCMD(SOCKETS_GET_SOCK_OPT), + IOCTLCMD(SOCKETS_GET_VM_BY_NAME), + IOCTLCMD(SOCKETS_LISTEN), + IOCTLCMD(SOCKETS_RECV), + IOCTLCMD(SOCKETS_RECV_FROM), + IOCTLCMD(SOCKETS_SELECT), + IOCTLCMD(SOCKETS_SEND), + IOCTLCMD(SOCKETS_SEND_TO), + IOCTLCMD(SOCKETS_SET_SOCK_OPT), + IOCTLCMD(SOCKETS_SHUTDOWN), + IOCTLCMD(SOCKETS_SOCKET), /* 1989 on Linux. */ + /* END VMCI SOCKETS */ + + /* + * We reserve a range of 5 ioctls for VMCI Sockets to grow. We cannot + * reserve many ioctls here since we are close to overlapping with vmmon + * ioctls. Define a meta-ioctl if running out of this binary space. + */ + // Must be last. + IOCTLCMD(SOCKETS_LAST) = IOCTLCMD(SOCKETS_SOCKET) + 5, /* 1994 on Linux. */ + + /* + * The VSockets ioctls occupy the block above. We define a new range of + * VMCI ioctls to maintain binary compatibility between the user land and + * the kernel driver. Careful, vmmon ioctls start from 2001, so this means + * we can add only 5 new VMCI ioctls. Define a meta-ioctl if running out of + * this binary space. + */ + + IOCTLCMD(FIRST2), + IOCTLCMD(SET_NOTIFY) = IOCTLCMD(FIRST2), /* 1995 on Linux. */ + IOCTLCMD(LAST2), +}; + + +#if defined _WIN32 +/* + * Windows VMCI ioctl definitions. + */ + +/* These values cannot be changed since some of the ioctl values are public. */ +#define FILE_DEVICE_VMCI 0x8103 +#define VMCI_IOCTL_BASE_INDEX 0x801 +#define VMCIIOCTL_BUFFERED(name) \ + CTL_CODE(FILE_DEVICE_VMCI, \ + VMCI_IOCTL_BASE_INDEX + IOCTLCMD_VMCI_ ## name, \ + METHOD_BUFFERED, \ + FILE_ANY_ACCESS) +#define VMCIIOCTL_NEITHER(name) \ + CTL_CODE(FILE_DEVICE_VMCI, \ + VMCI_IOCTL_BASE_INDEX + IOCTLCMD_VMCI_ ## name, \ + METHOD_NEITHER, \ + FILE_ANY_ACCESS) + +#define IOCTL_VMCI_VERSION VMCIIOCTL_BUFFERED(VERSION) + +/* BEGIN VMCI */ +#define IOCTL_VMCI_INIT_CONTEXT VMCIIOCTL_BUFFERED(INIT_CONTEXT) +#define IOCTL_VMCI_CREATE_PROCESS VMCIIOCTL_BUFFERED(CREATE_PROCESS) +#define IOCTL_VMCI_CREATE_DATAGRAM_PROCESS \ + VMCIIOCTL_BUFFERED(CREATE_DATAGRAM_PROCESS) +#define IOCTL_VMCI_HYPERCALL VMCIIOCTL_BUFFERED(HYPERCALL) +#define IOCTL_VMCI_SHAREDMEM_CREATE \ + VMCIIOCTL_BUFFERED(SHAREDMEM_CREATE) +#define IOCTL_VMCI_SHAREDMEM_ATTACH \ + VMCIIOCTL_BUFFERED(SHAREDMEM_ATTACH) +#define IOCTL_VMCI_SHAREDMEM_QUERY \ + VMCIIOCTL_BUFFERED(SHAREDMEM_QUERY) +#define IOCTL_VMCI_SHAREDMEM_DETACH \ + VMCIIOCTL_BUFFERED(SHAREDMEM_DETACH) +#define IOCTL_VMCI_VERSION2 VMCIIOCTL_BUFFERED(VERSION2) +#define IOCTL_VMCI_QUEUEPAIR_ALLOC \ + VMCIIOCTL_BUFFERED(QUEUEPAIR_ALLOC) +#define IOCTL_VMCI_QUEUEPAIR_SETPAGEFILE \ + VMCIIOCTL_BUFFERED(QUEUEPAIR_SETPAGEFILE) +#define IOCTL_VMCI_QUEUEPAIR_DETACH \ + VMCIIOCTL_BUFFERED(QUEUEPAIR_DETACH) +#define IOCTL_VMCI_DATAGRAM_SEND VMCIIOCTL_BUFFERED(DATAGRAM_SEND) +#define IOCTL_VMCI_DATAGRAM_RECEIVE VMCIIOCTL_NEITHER(DATAGRAM_RECEIVE) +#define IOCTL_VMCI_DATAGRAM_REQUEST_MAP VMCIIOCTL_BUFFERED(DATAGRAM_REQUEST_MAP) +#define IOCTL_VMCI_DATAGRAM_REMOVE_MAP VMCIIOCTL_BUFFERED(DATAGRAM_REMOVE_MAP) +#define IOCTL_VMCI_CTX_ADD_NOTIFICATION VMCIIOCTL_BUFFERED(CTX_ADD_NOTIFICATION) +#define IOCTL_VMCI_CTX_REMOVE_NOTIFICATION \ + VMCIIOCTL_BUFFERED(CTX_REMOVE_NOTIFICATION) +#define IOCTL_VMCI_CTX_GET_CPT_STATE \ + VMCIIOCTL_BUFFERED(CTX_GET_CPT_STATE) +#define IOCTL_VMCI_CTX_SET_CPT_STATE \ + VMCIIOCTL_BUFFERED(CTX_SET_CPT_STATE) +#define IOCTL_VMCI_GET_CONTEXT_ID \ + VMCIIOCTL_BUFFERED(GET_CONTEXT_ID) +/* END VMCI */ + +/* BEGIN VMCI SOCKETS */ +#define IOCTL_VMCI_SOCKETS_ACCEPT \ + VMCIIOCTL_BUFFERED(SOCKETS_ACCEPT) +#define IOCTL_VMCI_SOCKETS_BIND \ + VMCIIOCTL_BUFFERED(SOCKETS_BIND) +#define IOCTL_VMCI_SOCKETS_CLOSE \ + VMCIIOCTL_BUFFERED(SOCKETS_CLOSE) +#define IOCTL_VMCI_SOCKETS_CONNECT \ + VMCIIOCTL_BUFFERED(SOCKETS_CONNECT) +#define IOCTL_VMCI_SOCKETS_GET_AF_VALUE \ + VMCIIOCTL_BUFFERED(SOCKETS_GET_AF_VALUE) +#define IOCTL_VMCI_SOCKETS_GET_LOCAL_CID \ + VMCIIOCTL_BUFFERED(SOCKETS_GET_LOCAL_CID) +#define IOCTL_VMCI_SOCKETS_GET_SOCK_NAME \ + VMCIIOCTL_BUFFERED(SOCKETS_GET_SOCK_NAME) +#define IOCTL_VMCI_SOCKETS_GET_SOCK_OPT \ + VMCIIOCTL_BUFFERED(SOCKETS_GET_SOCK_OPT) +#define IOCTL_VMCI_SOCKETS_GET_VM_BY_NAME \ + VMCIIOCTL_BUFFERED(SOCKETS_GET_VM_BY_NAME) +#define IOCTL_VMCI_SOCKETS_LISTEN \ + VMCIIOCTL_BUFFERED(SOCKETS_LISTEN) +#define IOCTL_VMCI_SOCKETS_RECV \ + VMCIIOCTL_BUFFERED(SOCKETS_RECV) +#define IOCTL_VMCI_SOCKETS_RECV_FROM \ + VMCIIOCTL_BUFFERED(SOCKETS_RECV_FROM) +#define IOCTL_VMCI_SOCKETS_SELECT \ + VMCIIOCTL_BUFFERED(SOCKETS_SELECT) +#define IOCTL_VMCI_SOCKETS_SEND \ + VMCIIOCTL_BUFFERED(SOCKETS_SEND) +#define IOCTL_VMCI_SOCKETS_SEND_TO \ + VMCIIOCTL_BUFFERED(SOCKETS_SEND_TO) +#define IOCTL_VMCI_SOCKETS_SET_SOCK_OPT \ + VMCIIOCTL_BUFFERED(SOCKETS_SET_SOCK_OPT) +#define IOCTL_VMCI_SOCKETS_SHUTDOWN \ + VMCIIOCTL_BUFFERED(SOCKETS_SHUTDOWN) +#define IOCTL_VMCI_SOCKETS_SOCKET \ + VMCIIOCTL_BUFFERED(SOCKETS_SOCKET) +/* END VMCI SOCKETS */ + +#endif // _WIN32 + + +/* + * VMCI driver initialization. This block can also be used to + * pass initial group membership etc. + */ +typedef struct VMCIInitBlock { + VMCIId cid; + VMCIPrivilegeFlags flags; +#ifdef _WIN32 + uint64 event; /* Handle for signalling vmci calls on windows. */ +#endif // _WIN32 +} VMCIInitBlock; + +typedef struct VMCISharedMemInfo { + VMCIHandle handle; + uint32 size; + uint32 result; + VA64 va; /* Currently only used in the guest. */ + char pageFileName[VMCI_PATH_MAX]; +} VMCISharedMemInfo; + +typedef struct VMCIQueuePairAllocInfo { + VMCIHandle handle; + VMCIId peer; + uint32 flags; + uint64 produceSize; + uint64 consumeSize; + VA64 producePageFile; /* User VA. */ + VA64 consumePageFile; /* User VA. */ + uint64 producePageFileSize; /* Size of the file name array. */ + uint64 consumePageFileSize; /* Size of the file name array. */ + int32 result; + uint32 _pad; +} VMCIQueuePairAllocInfo; + +typedef struct VMCIQueuePairPageFileInfo { + VMCIHandle handle; + VA64 producePageFile; /* User VA. */ + VA64 consumePageFile; /* User VA. */ + uint64 producePageFileSize; /* Size of the file name array. */ + uint64 consumePageFileSize; /* Size of the file name array. */ + int32 result; + uint32 _pad; +} VMCIQueuePairPageFileInfo; + +typedef struct VMCIQueuePairDetachInfo { + VMCIHandle handle; + int32 result; + uint32 _pad; +} VMCIQueuePairDetachInfo; + +typedef struct VMCIDatagramSendRecvInfo { + VA64 addr; + uint32 len; + int32 result; +} VMCIDatagramSendRecvInfo; + +/* Used to create datagram endpoints in guest or host userlevel. */ +typedef struct VMCIDatagramCreateInfo { + VMCIId resourceID; + uint32 flags; + int eventHnd; + int result; // result of handle create operation + VMCIHandle handle; // handle if successfull +} VMCIDatagramCreateInfo; + +/* Used to add/remove well-known datagram mappings. */ +typedef struct VMCIDatagramMapInfo { + VMCIId wellKnownID; + int result; +} VMCIDatagramMapInfo; + + +/* Used to add/remove remote context notifications. */ +typedef struct VMCINotifyAddRemoveInfo { + VMCIId remoteCID; + int result; +} VMCINotifyAddRemoveInfo; + + +/* Used to set/get current context's checkpoint state. */ +typedef struct VMCICptBufInfo { + VA64 cptBuf; + uint32 cptType; + uint32 bufSize; + int32 result; + uint32 _pad; +} VMCICptBufInfo; + +/* Used to pass notify flag's address to the host driver. */ +typedef struct VMCISetNotifyInfo { + VA64 notifyUVA; + int32 result; + uint32 _pad; +} VMCISetNotifyInfo; + + +#ifdef __APPLE__ +/* + * Mac OS ioctl definitions. + * + * Mac OS defines _IO* macros, and the core kernel code uses the size encoded + * in the ioctl value to copy the memory back and forth (depending on the + * direction encoded in the ioctl value) between the user and kernel address + * spaces. + * See iocontrolsMacOS.h for details on how this is done. We use sockets only + * for vmci. + */ + +#include <sys/ioccom.h> + +enum VMCrossTalkSockOpt { + VMCI_SO_VERSION = 0, + VMCI_SO_CONTEXT = IOCTL_VMCI_INIT_CONTEXT, + VMCI_SO_PROCESS = IOCTL_VMCI_CREATE_PROCESS, + VMCI_SO_DATAGRAM_PROCESS = IOCTL_VMCI_CREATE_DATAGRAM_PROCESS, + VMCI_SO_SHAREDMEM_CREATE = IOCTL_VMCI_SHAREDMEM_CREATE, + VMCI_SO_SHAREDMEM_ATTACH = IOCTL_VMCI_SHAREDMEM_ATTACH, + VMCI_SO_SHAREDMEM_QUERY = IOCTL_VMCI_SHAREDMEM_QUERY, + VMCI_SO_SHAREDMEM_DETACH = IOCTL_VMCI_SHAREDMEM_DETACH, + VMCI_SO_VERSION2 = IOCTL_VMCI_VERSION2, + VMCI_SO_QUEUEPAIR_ALLOC = IOCTL_VMCI_QUEUEPAIR_ALLOC, + VMCI_SO_QUEUEPAIR_SETPAGEFILE = IOCTL_VMCI_QUEUEPAIR_SETPAGEFILE, + VMCI_SO_QUEUEPAIR_DETACH = IOCTL_VMCI_QUEUEPAIR_DETACH, + VMCI_SO_DATAGRAM_SEND = IOCTL_VMCI_DATAGRAM_SEND, + VMCI_SO_DATAGRAM_RECEIVE = IOCTL_VMCI_DATAGRAM_RECEIVE, + VMCI_SO_DATAGRAM_REQUEST_MAP = IOCTL_VMCI_DATAGRAM_REQUEST_MAP, + VMCI_SO_DATAGRAM_REMOVE_MAP = IOCTL_VMCI_DATAGRAM_REMOVE_MAP, + VMCI_SO_CTX_ADD_NOTIFICATION = IOCTL_VMCI_CTX_ADD_NOTIFICATION, + VMCI_SO_CTX_REMOVE_NOTIFICATION = IOCTL_VMCI_CTX_REMOVE_NOTIFICATION, + VMCI_SO_CTX_GET_CPT_STATE = IOCTL_VMCI_CTX_GET_CPT_STATE, + VMCI_SO_CTX_SET_CPT_STATE = IOCTL_VMCI_CTX_SET_CPT_STATE, + VMCI_SO_GET_CONTEXT_ID = IOCTL_VMCI_GET_CONTEXT_ID, + VMCI_SO_USERFD, +}; + +# define VMCI_MACOS_HOST_DEVICE_BASE "com.vmware.kext.vmci" +# ifdef VMX86_DEVEL +# define VMCI_MACOS_HOST_DEVICE VMCI_MACOS_HOST_DEVICE_BASE ".devel" +# else +# define VMCI_MACOS_HOST_DEVICE VMCI_MACOS_HOST_DEVICE_BASE +# endif + +#endif + +/* Clean up helper macros */ +#undef IOCTLCMD + +#endif // ifndef _VMCI_IOCONTROLS_H_ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmci/vmciKernelIf.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vmciKernelIf.c --- open-vm-tools-2008.01.23-74039/modules/linux/vmci/vmciKernelIf.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vmciKernelIf.c 2008-10-13 08:01:41.000000000 +0100 @@ -0,0 +1,1354 @@ +/********************************************************* + * Copyright (C) 2007 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * vmciKernelIf.c -- + * + * This file implements defines and helper functions for VMCI + * host _and_ guest kernel code. This is the linux specific + * implementation. + */ + +/* Must come before any kernel header file */ +#include "driver-config.h" + +#if !defined(linux) || defined(VMKERNEL) +#error "Wrong platform." +#endif + +#define EXPORT_SYMTAB +#define __NO_VERSION__ +#include "compat_module.h" + +#include "compat_version.h" +#include "compat_wait.h" +#include "compat_interrupt.h" +#include "compat_spinlock.h" +#include "compat_slab.h" +#include "compat_semaphore.h" +#include "compat_page.h" +#include "compat_mm.h" +#include "compat_highmem.h" +#include "vm_basic_types.h" +#include "pgtbl.h" +#include <linux/vmalloc.h> +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0) +# include <linux/mm.h> /* For vmalloc_to_page() */ +#endif +#include <linux/socket.h> /* For memcpy_{to,from}iovec(). */ +#include "vm_assert.h" +#include "vmci_kernel_if.h" +#include "vmci_queue_pair.h" + +/* + * In Linux 2.6.25 kernels and onwards, the symbol init_mm is no + * longer exported. This affects the function PgtblKVa2MPN, as it + * calls pgd_offset_k which in turn is a macro referencing init_mm. + * + * We can avoid using PgtblKVa2MPN on more recent kernels by instead + * using the function vmalloc_to_page followed by + * page_to_pfn. vmalloc_to_page was introduced in the 2.5 kernels and + * backported to some 2.4.x kernels. We use vmalloc_to_page on all + * 2.6.x kernels, where it is present for sure, and use PgtblKVa2MPN + * on older kernels where it works just fine. + */ + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0) +# define VMCIKVaToMPN(__VA) page_to_pfn(vmalloc_to_page((void *)(__VA))) +#else +# define VMCIKVaToMPN(__VA) PgtblKVa2MPN(__VA) +#endif + +/* + *----------------------------------------------------------------------------- + * + * VMCI_InitLock + * + * Initializes the lock. Must be called before use. + * + * Results: + * None + * + * Side effects: + * Thread can block. + * + *----------------------------------------------------------------------------- + */ + +void +VMCI_InitLock(VMCILock *lock, // IN: + char *name, // IN: Unused on Linux + VMCILockRank rank) // IN: Unused on Linux +{ + spin_lock_init(lock); +} + + +/* + *----------------------------------------------------------------------------- + * + * VMCI_CleanupLock + * + * Cleanup the lock. Must be called before deallocating lock. + * + * Results: + * None + * + * Side effects: + * Deletes kernel lock state + * + *----------------------------------------------------------------------------- + */ + +void +VMCI_CleanupLock(VMCILock *lock) +{ +} + + +/* + *----------------------------------------------------------------------------- + * + * VMCI_GrabLock + * + * Grabs the given lock. XXX Fill in specific lock requirements. XXX Move + * locking code into hostif if VMCI stays in vmmon. + * + * Results: + * None + * + * Side effects: + * Thread can block. + * + *----------------------------------------------------------------------------- + */ + +void +VMCI_GrabLock(VMCILock *lock, // IN + VMCILockFlags *flags) // OUT: used to restore irql on windows +{ + spin_lock(lock); +} + + +/* + *----------------------------------------------------------------------------- + * + * VMCI_ReleaseLock + * + * Releases the given lock. XXX Move locking code into hostif if VMCI + * stays in vmmon. + * + * Results: + * None + * + * Side effects: + * A thread blocked on this lock may wake up. + * + *----------------------------------------------------------------------------- + */ + +void +VMCI_ReleaseLock(VMCILock *lock, // IN + VMCILockFlags flags) // IN +{ + spin_unlock(lock); +} + + +/* + *----------------------------------------------------------------------------- + * + * VMCI_GrabLock_BH + * + * Grabs the given lock and for linux kernels disables bottom half execution. + * . This should be used with locks accessed both from bottom half/tasklet + * contexts, ie. guestcall handlers, and from process contexts to avoid + * deadlocks where the process has the lock and gets descheduled due to a + * bh/tasklet coming in. + * + * Results: + * None + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +void +VMCI_GrabLock_BH(VMCILock *lock, // IN + VMCILockFlags *flags) // OUT: used to restore +{ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 3, 4) + spin_lock_bh(lock); +#else + + /* + * Before 2.3.4 linux kernels spin_unlock_bh didn't exist so we are using + * spin_lock_irqsave/restore instead. I wanted to define spin_[un]lock_bh + * functions in compat_spinlock.h as local_bh_disable;spin_lock(lock) and + * so on, but local_bh_disable/enable does not exist on 2.2.26. + */ + spin_lock_irqsave(lock, *flags); +#endif // LINUX_VERSION_CODE +} + + +/* + *----------------------------------------------------------------------------- + * + * VMCI_ReleaseLock_BH + * + * Releases the given lock and for linux kernels reenables bottom half + * execution. + * . This should be used with locks accessed both from bottom half/tasklet + * contexts, ie. guestcall handlers, and from process contexts to avoid + * deadlocks where the process has the lock and get descheduled due to a + * bh/tasklet coming in. + * + * Results: + * None + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +void +VMCI_ReleaseLock_BH(VMCILock *lock, // IN + VMCILockFlags flags) // IN +{ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 3, 4) + spin_unlock_bh(lock); +#else + + /* + * Before 2.3.4 linux kernels spin_unlock_bh didn't exist so we are using + * spin_lock_irqsave/restore instead. I wanted to define spin_[un]lock_bh + * functions in compat_spinlock.h as local_bh_disable;spin_lock(lock) and + * so on, but local_bh_disable/enable does not exist on 2.2.26. + */ + + spin_unlock_irqrestore(lock, flags); +#endif // LINUX_VERSION_CODE +} + + +/* + *---------------------------------------------------------------------- + * + * VMCIHost_InitContext -- + * + * Host-specific initialization of VMCI context state. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +void +VMCIHost_InitContext(VMCIHost *hostContext, // IN + uintptr_t eventHnd) // IN +{ + init_waitqueue_head(&hostContext->waitQueue); +} + + +/* + *---------------------------------------------------------------------- + * + * VMCIHost_ReleaseContext -- + * + * Host-specific release of state allocated by + * VMCIHost_InitContext. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +void +VMCIHost_ReleaseContext(VMCIHost *hostContext) // IN +{ +} + + +/* + *---------------------------------------------------------------------- + * + * VMCIHost_SignalCall -- + * + * Signal to userlevel that a VMCI call is waiting. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +void +VMCIHost_SignalCall(VMCIHost *hostContext) // IN +{ + wake_up(&hostContext->waitQueue); +} + + +/* + *---------------------------------------------------------------------- + * + * VMCIHost_WaitForCallLocked -- + * + * Wait until a VMCI call is pending or the waiting thread is + * interrupted. It is assumed that a lock is held prior to + * calling this function. The lock will be released during the + * wait. The correctnes of this funtion depends on that the same + * lock is held when the call is signalled. + * + * Results: + * TRUE on success + * FALSE if the wait was interrupted. + * + * Side effects: + * The call may block. + * + *---------------------------------------------------------------------- + */ + +Bool +VMCIHost_WaitForCallLocked(VMCIHost *hostContext, // IN + VMCILock *lock, // IN + VMCILockFlags *flags, // IN + Bool useBH) // IN + +{ + DECLARE_WAITQUEUE(wait, current); + + /* + * The thread must be added to the wait queue and have its state + * changed while holding the lock - otherwise a signal may change + * the state in between and have it overwritten causing a loss of + * the event. + */ + + add_wait_queue(&hostContext->waitQueue, &wait); + current->state = TASK_INTERRUPTIBLE; + + if (useBH) { + VMCI_ReleaseLock_BH(lock, *flags); + } else { + VMCI_ReleaseLock(lock, *flags); + } + + schedule(); + + if (useBH) { + VMCI_GrabLock_BH(lock, flags); + } else { + VMCI_GrabLock(lock, flags); + } + + current->state = TASK_RUNNING; + + remove_wait_queue(&hostContext->waitQueue, &wait); + + if (signal_pending(current)) { + return FALSE; + } + + return TRUE; +} + + +/* + *---------------------------------------------------------------------- + * + * VMCIHost_ClearCall -- + * + * Clear the pending call signal. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +void +VMCIHost_ClearCall(VMCIHost *hostContext) // IN +{ +} + +/* + *---------------------------------------------------------------------- + * + * VMCI_AllocKernelMem + * + * Allocate some kernel memory for the VMCI driver. + * + * Results: + * The address allocated or NULL on error. + * + * + * Side effects: + * memory is malloced + *---------------------------------------------------------------------- + */ + +void * +VMCI_AllocKernelMem(size_t size, int flags) +{ + void *ptr; + + if ((flags & VMCI_MEMORY_ATOMIC) != 0) { + ptr = kmalloc(size, GFP_ATOMIC); + } else { + ptr = kmalloc(size, GFP_KERNEL); + } + + return ptr; +} + + +/* + *---------------------------------------------------------------------- + * + * VMCI_FreeKernelMem + * + * Free kernel memory allocated for the VMCI driver. + * + * Results: + * None. + * + * Side effects: + * memory is freed. + *---------------------------------------------------------------------- + */ + +void +VMCI_FreeKernelMem(void *ptr, // IN: + size_t size) // IN: Unused on Linux +{ + kfree(ptr); +} + + +/* + *---------------------------------------------------------------------- + * + * VMCI_AllocBuffer + * + * Allocate some kernel memory for the VMCI driver. The memory is + * not guaranteed to have a mapping in the virtual address + * space. Use VMCI_MapBuffer to get a VA mapping for the memory. + * + * Results: + * A reference to the allocated memory or VMCI_BUFFER_INVALID + * on error. + * + * + * Side effects: + * memory is allocated. + *---------------------------------------------------------------------- + */ + +VMCIBuffer +VMCI_AllocBuffer(size_t size, int flags) +{ + return VMCI_AllocKernelMem(size, flags); +} + + +/* + *---------------------------------------------------------------------- + * + * VMCI_MapBuffer + * + * Ensures that the kernel memory allocated with VMCI_AllocBuffer + * has a mapping in the virtual address space. + * + * Results: + * None. + * + * Side effects: + * virtual address mapping of kernel memory is established. + *---------------------------------------------------------------------- + */ + +void * +VMCI_MapBuffer(VMCIBuffer buf) +{ + return buf; +} + + +/* + *---------------------------------------------------------------------- + * + * VMCI_ReleaseBuffer + * + * Releases the VA mapping of kernel memory allocated with + * VMCI_AllocBuffer. + * + * Results: + * None. + * + * Side effects: + * virtual address mapping of kernel memory is released. + *---------------------------------------------------------------------- + */ + +void +VMCI_ReleaseBuffer(void *ptr) // IN: The VA of the mapped memory +{ +} + + +/* + *---------------------------------------------------------------------- + * + * VMCI_FreeBuffer + * + * Free temporary kernel memory allocated for the VMCI driver. + * + * Results: + * None. + * + * Side effects: + * memory is freed. + *---------------------------------------------------------------------- + */ + +void +VMCI_FreeBuffer(VMCIBuffer buf, // IN: + size_t size) // IN: Unused on Linux +{ + VMCI_FreeKernelMem(buf, size); +} + + +/* + *----------------------------------------------------------------------------- + * + * VMCI_CopyToUser -- + * + * Copy memory to the user application from a kernel buffer. This + * function may block, so don't call it while holding any kind of + * lock. + * + * Results: + * 0 on success. + * Nonzero on failure. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +int +VMCI_CopyToUser(void *dst, // OUT + const void *src, // IN + unsigned int len) // IN +{ + return copy_to_user(dst, src, len) ? -EFAULT : 0; +} + + +/* + *----------------------------------------------------------------------------- + * + * VMCI_CopyFromUser -- + * + * Copy memory from the user application to a kernel buffer. This + * function may block, so don't call it while holding any kind of + * lock. + * + * Results: + * 0 on success. + * Nonzero on failure. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +int +VMCI_CopyFromUser(void *dst, // OUT + const void *src, // IN + size_t len) // IN +{ + return copy_from_user(dst, src, len); +} + + +/* + *----------------------------------------------------------------------------- + * + * VMCI_CreateEvent -- + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +void +VMCI_CreateEvent(VMCIEvent *event) // IN: +{ + init_waitqueue_head(event); +} + + +/* + *----------------------------------------------------------------------------- + * + * VMCI_DestroyEvent -- + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +void +VMCI_DestroyEvent(VMCIEvent *event) // IN: +{ + /* Nothing to do. */ +} + + +/* + *----------------------------------------------------------------------------- + * + * VMCI_SignalEvent -- + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +void +VMCI_SignalEvent(VMCIEvent *event) // IN: +{ + wake_up(event); +} + + +/* + *----------------------------------------------------------------------------- + * + * VMCI_WaitOnEvent -- + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +void +VMCI_WaitOnEvent(VMCIEvent *event, // IN: + VMCIEventReleaseCB releaseCB, // IN: + void *clientData) // IN: +{ + DECLARE_WAITQUEUE(wait, current); + + if (event == NULL || releaseCB == NULL) { + return; + } + + add_wait_queue(event, &wait); + current->state = TASK_INTERRUPTIBLE; + + /* + * Release the lock or other primitive that makes it possible for us to + * put the current thread on the wait queue without missing the signal. + * Ie. on Linux we need to put ourselves on the wait queue and set our + * stateto TASK_INTERRUPTIBLE without another thread signalling us. + * The releaseCB is used to synchronize this. + */ + releaseCB(clientData); + + schedule(); + current->state = TASK_RUNNING; + remove_wait_queue(event, &wait); +} + + +/* + *----------------------------------------------------------------------------- + * + * VMCIMutex_Init -- + * + * Initializes the mutex. Must be called before use. + * + * Results: + * Success. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +int +VMCIMutex_Init(VMCIMutex *mutex) // IN: +{ + sema_init(mutex, 1); + return VMCI_SUCCESS; +} + + +/* + *----------------------------------------------------------------------------- + * + * VMCIMutex_Destroy -- + * + * Destroys the mutex. Does nothing on Linux. + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +void +VMCIMutex_Destroy(VMCIMutex *mutex) // IN: Unused +{ +} + + +/* + *----------------------------------------------------------------------------- + * + * VMCIMutex_Acquire -- + * + * Acquires the mutex. + * + * Results: + * None. + * + * Side effects: + * Thread may block. + * + *----------------------------------------------------------------------------- + */ + +void +VMCIMutex_Acquire(VMCIMutex *mutex) // IN: +{ + down(mutex); +} + + +/* + *----------------------------------------------------------------------------- + * + * VMCIMutex_Release -- + * + * Releases the mutex. + * + * Results: + * None. + * + * Side effects: + * May wake up the thread blocking on this mutex. + * + *----------------------------------------------------------------------------- + */ + +void +VMCIMutex_Release(VMCIMutex *mutex) // IN: +{ + up(mutex); +} + + +/* + *----------------------------------------------------------------------------- + * + * VMCI_AllocQueueKVA -- + * + * Allocates kernel memory for the queue header (1 page) plus the + * translation structure for offset -> page mappings. Allocates physical + * pages for the queue (buffer area), and initializes the translation + * structure. + * + * Results: + * The VA on success, NULL otherwise. + * + * Side effects: + * Memory is allocated. + * + *----------------------------------------------------------------------------- + */ + +VA +VMCI_AllocQueueKVA(uint64 size) // IN: size of queue (not including header) +{ + const uint64 numPages = CEILING(size, PAGE_SIZE); + VMCIQueue *queue; + + queue = vmalloc(sizeof *queue + numPages * sizeof queue->page[0]); + if (queue) { + uint64 i; + + /* + * Allocate physical pages, they will be mapped/unmapped on demand. + */ + for (i = 0; i < numPages; i++) { + queue->page[i] = alloc_pages(GFP_KERNEL, 0); /* One page. */ + if (!queue->page[i]) { + /* + * Free all pages allocated. + */ + while (i) { + __free_page(queue->page[--i]); + } + vfree(queue); + queue = NULL; + break; + } + } + } + return (VA)queue; +} + + +/* + *----------------------------------------------------------------------------- + * + * VMCI_FreeQueueKVA -- + * + * Frees kernel memory for a given queue (header plus translation + * structure). Frees all physical pages that held the buffers for this + * queue. + * + * Results: + * None. + * + * Side effects: + * Memory is freed. + * + *----------------------------------------------------------------------------- + */ + +void +VMCI_FreeQueueKVA(VA va, // IN: + uint64 size) // IN: size of queue (not including header) +{ + VMCIQueue *queue = (VMCIQueue *)va; + + if (queue) { + uint64 i; + + for (i = 0; i < CEILING(size, PAGE_SIZE); i++) { + __free_page(queue->page[i]); + } + vfree(queue); + } +} + + +/* + *----------------------------------------------------------------------------- + * + * VMCI_AllocPPNSet -- + * + * Allocates two list of PPNs --- one for the pages in the produce queue, + * and the other for the pages in the consume queue. Intializes the list + * of PPNs with the page frame numbers of the KVA for the two queues (and + * the queue headers). + * + * Results: + * Success or failure. + * + * Side effects: + * Memory may be allocated. + * + *----------------------------------------------------------------------------- + */ + +int +VMCI_AllocPPNSet(VA produceVA, // IN: + uint64 numProducePages, // IN: for queue plus header + VA consumeVA, // IN: + uint64 numConsumePages, // IN: for queue plus header + PPNSet *ppnSet) // OUT: +{ + VMCIPpnList producePPNs; + VMCIPpnList consumePPNs; + uint64 i; + VMCIQueue *produceQ = (VMCIQueue *)produceVA; + VMCIQueue *consumeQ = (VMCIQueue *)consumeVA; + + if (!produceVA || !numProducePages || !consumeVA || !numConsumePages || + !ppnSet) { + return VMCI_ERROR_INVALID_ARGS; + } + + if (ppnSet->initialized) { + return VMCI_ERROR_ALREADY_EXISTS; + } + + producePPNs = + VMCI_AllocKernelMem(numProducePages * sizeof *producePPNs, + VMCI_MEMORY_NORMAL); + if (!producePPNs) { + return VMCI_ERROR_NO_MEM; + } + + consumePPNs = + VMCI_AllocKernelMem(numConsumePages * sizeof *consumePPNs, + VMCI_MEMORY_NORMAL); + if (!consumePPNs) { + VMCI_FreeKernelMem(producePPNs, numProducePages * sizeof *producePPNs); + return VMCI_ERROR_NO_MEM; + } + + producePPNs[0] = VMCIKVaToMPN(produceVA); + for (i = 1; i < numProducePages; i++) { + unsigned long pfn; + + producePPNs[i] = pfn = page_to_pfn(produceQ->page[i - 1]); + + /* + * Fail allocation if PFN isn't supported by hypervisor. + */ + + if (sizeof pfn > sizeof *producePPNs && + pfn != producePPNs[i]) { + goto ppnError; + } + } + consumePPNs[0] = VMCIKVaToMPN(consumeVA); + for (i = 1; i < numConsumePages; i++) { + unsigned long pfn; + + consumePPNs[i] = pfn = page_to_pfn(consumeQ->page[i - 1]); + + /* + * Fail allocation if PFN isn't supported by hypervisor. + */ + + if (sizeof pfn > sizeof *consumePPNs && + pfn != consumePPNs[i]) { + goto ppnError; + } + } + + ppnSet->numProducePages = numProducePages; + ppnSet->numConsumePages = numConsumePages; + ppnSet->producePPNs = producePPNs; + ppnSet->consumePPNs = consumePPNs; + ppnSet->initialized = TRUE; + return VMCI_SUCCESS; + +ppnError: + VMCI_FreeKernelMem(producePPNs, numProducePages * sizeof *producePPNs); + VMCI_FreeKernelMem(consumePPNs, numConsumePages * sizeof *consumePPNs); + return VMCI_ERROR_INVALID_ARGS; +} + + +/* + *----------------------------------------------------------------------------- + * + * VMCI_FreePPNSet -- + * + * Frees the two list of PPNs for a queue pair. + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +void +VMCI_FreePPNSet(PPNSet *ppnSet) // IN: +{ + ASSERT(ppnSet); + if (ppnSet->initialized) { + /* Do not call these functions on NULL inputs. */ + ASSERT(ppnSet->producePPNs && ppnSet->consumePPNs); + VMCI_FreeKernelMem(ppnSet->producePPNs, + ppnSet->numProducePages * sizeof *ppnSet->producePPNs); + VMCI_FreeKernelMem(ppnSet->consumePPNs, + ppnSet->numConsumePages * sizeof *ppnSet->consumePPNs); + } + memset(ppnSet, 0, sizeof *ppnSet); +} + + +/* + *----------------------------------------------------------------------------- + * + * VMCI_PopulatePPNList -- + * + * Populates the list of PPNs in the hypercall structure with the PPNS + * of the produce queue and the consume queue. + * + * Results: + * VMCI_SUCCESS. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +int +VMCI_PopulatePPNList(uint8 *callBuf, // OUT: + const PPNSet *ppnSet) // IN: +{ + ASSERT(callBuf && ppnSet && ppnSet->initialized); + memcpy(callBuf, ppnSet->producePPNs, + ppnSet->numProducePages * sizeof *ppnSet->producePPNs); + memcpy(callBuf + ppnSet->numProducePages * sizeof *ppnSet->producePPNs, + ppnSet->consumePPNs, + ppnSet->numConsumePages * sizeof *ppnSet->consumePPNs); + + return VMCI_SUCCESS; +} + + +#ifdef __KERNEL__ + + +/* + *----------------------------------------------------------------------------- + * + * __VMCIMemcpyToQueue -- + * + * Copies from a given buffer or iovector to a VMCI Queue. Uses + * kmap()/kunmap() to dynamically map/unmap required portions of the queue + * by traversing the offset -> page translation structure for the queue. + * Assumes that offset + size does not wrap around in the queue. + * + * Results: + * Zero on success, negative error code on failure. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +int +__VMCIMemcpyToQueue(VMCIQueue *queue, // OUT: + uint64 queueOffset, // IN: + const void *src, // IN: + size_t size, // IN: + Bool isIovec) // IN: if src is a struct iovec * +{ + size_t bytesCopied = 0; + + while (bytesCopied < size) { + uint64 pageIndex = (queueOffset + bytesCopied) / PAGE_SIZE; + size_t pageOffset = (queueOffset + bytesCopied) & (PAGE_SIZE - 1); + void *va = kmap(queue->page[pageIndex]); + size_t toCopy; + + ASSERT(va); + if (size - bytesCopied > PAGE_SIZE - pageOffset) { + /* Enough payload to fill up from this page. */ + toCopy = PAGE_SIZE - pageOffset; + } else { + toCopy = size - bytesCopied; + } + + if (isIovec) { + struct iovec *iov = (struct iovec *)src; + int err; + + /* The iovec will track bytesCopied internally. */ + err = memcpy_fromiovec((uint8 *)va + pageOffset, iov, toCopy); + if (err != 0) { + kunmap(queue->page[pageIndex]); + return err; + } + } else { + memcpy((uint8 *)va + pageOffset, (uint8 *)src + bytesCopied, toCopy); + } + + bytesCopied += toCopy; + kunmap(queue->page[pageIndex]); + } + + return 0; +} + + +/* + *----------------------------------------------------------------------------- + * + * __VMCIMemcpyFromQueue -- + * + * Copies to a given buffer or iovector from a VMCI Queue. Uses + * kmap()/kunmap() to dynamically map/unmap required portions of the queue + * by traversing the offset -> page translation structure for the queue. + * Assumes that offset + size does not wrap around in the queue. + * + * Results: + * Zero on success, negative error code on failure. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +int +__VMCIMemcpyFromQueue(void *dest, // OUT: + const VMCIQueue *queue, // IN: + uint64 queueOffset, // IN: + size_t size, // IN: + Bool isIovec) // IN: if dest is a struct iovec * +{ + size_t bytesCopied = 0; + + while (bytesCopied < size) { + uint64 pageIndex = (queueOffset + bytesCopied) / PAGE_SIZE; + size_t pageOffset = (queueOffset + bytesCopied) & (PAGE_SIZE - 1); + void *va = kmap(queue->page[pageIndex]); + size_t toCopy; + + ASSERT(va); + if (size - bytesCopied > PAGE_SIZE - pageOffset) { + /* Enough payload to fill up this page. */ + toCopy = PAGE_SIZE - pageOffset; + } else { + toCopy = size - bytesCopied; + } + + if (isIovec) { + struct iovec *iov = (struct iovec *)dest; + int err; + + /* The iovec will track bytesCopied internally. */ + err = memcpy_toiovec(iov, (uint8 *)va + pageOffset, toCopy); + if (err != 0) { + kunmap(queue->page[pageIndex]); + return err; + } + } else { + memcpy((uint8 *)dest + bytesCopied, (uint8 *)va + pageOffset, toCopy); + } + + bytesCopied += toCopy; + kunmap(queue->page[pageIndex]); + } + + return 0; +} + + +/* + *----------------------------------------------------------------------------- + * + * VMCIMemcpyToQueue -- + * + * Copies from a given buffer to a VMCI Queue. + * + * Results: + * Zero on success, negative error code on failure. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +EXPORT_SYMBOL(VMCIMemcpyToQueue); + +int +VMCIMemcpyToQueue(VMCIQueue *queue, // OUT: + uint64 queueOffset, // IN: + const void *src, // IN: + size_t srcOffset, // IN: + size_t size) // IN: +{ + return __VMCIMemcpyToQueue(queue, queueOffset, + (uint8 *)src + srcOffset, size, FALSE); +} + + +/* + *----------------------------------------------------------------------------- + * + * VMCIMemcpyFromQueue -- + * + * Copies to a given buffer from a VMCI Queue. + * + * Results: + * Zero on success, negative error code on failure. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +EXPORT_SYMBOL(VMCIMemcpyFromQueue); + +int +VMCIMemcpyFromQueue(void *dest, // OUT: + size_t destOffset, // IN: + const VMCIQueue *queue, // IN: + uint64 queueOffset, // IN: + size_t size) // IN: +{ + return __VMCIMemcpyFromQueue((uint8 *)dest + destOffset, + queue, queueOffset, size, FALSE); +} + + +/* + *---------------------------------------------------------------------------- + * + * VMCIMemcpyToQueueV -- + * + * Copies from a given iovec from a VMCI Queue. + * + * Results: + * Zero on success, negative error code on failure. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +EXPORT_SYMBOL(VMCIMemcpyToQueueV); + +int +VMCIMemcpyToQueueV(VMCIQueue *queue, // OUT: + uint64 queueOffset, // IN: + const void *src, // IN: iovec + size_t srcOffset, // IN: ignored + size_t size) // IN: +{ + + /* + * We ignore srcOffset because src is really a struct iovec * and will + * maintain offset internally. + */ + return __VMCIMemcpyToQueue(queue, queueOffset, src, size, TRUE); +} + + +/* + *---------------------------------------------------------------------------- + * + * VMCIMemcpyFromQueueV -- + * + * Copies to a given iovec from a VMCI Queue. + * + * Results: + * Zero on success, negative error code on failure. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +EXPORT_SYMBOL(VMCIMemcpyFromQueueV); + +int +VMCIMemcpyFromQueueV(void *dest, // OUT: iovec + size_t destOffset, // IN: ignored + const VMCIQueue *queue, // IN: + uint64 queueOffset, // IN: + size_t size) // IN: +{ + /* + * We ignore destOffset because dest is really a struct iovec * and will + * maintain offset internally. + */ + return __VMCIMemcpyFromQueue(dest, queue, queueOffset, size, TRUE); +} + +#endif + + +/* + *----------------------------------------------------------------------------- + * + * VMCIWellKnownID_AllowMap -- + * + * Checks whether the calling context is allowed to register for the given + * well known service ID. Currently returns FALSE if the service ID is + * within the reserved range and VMCI_PRIVILEGE_FLAG_TRUSTED is not + * provided as the input privilege flags. Otherwise returns TRUE. + * XXX TODO access control based on host configuration information; this + * will be platform specific implementation. + * + * Results: + * Boolean value indicating access granted or denied. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +Bool +VMCIWellKnownID_AllowMap(VMCIId wellKnownID, // IN: + VMCIPrivilegeFlags privFlags) // IN: +{ + if (wellKnownID < VMCI_RESERVED_RESOURCE_ID_MAX && + !(privFlags & VMCI_PRIVILEGE_FLAG_TRUSTED)) { + return FALSE; + } + return TRUE; +} diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmci/vmci_kernel_if.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vmci_kernel_if.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmci/vmci_kernel_if.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vmci_kernel_if.h 2008-10-13 08:01:41.000000000 +0100 @@ -0,0 +1,266 @@ +/********************************************************* + * Copyright (C) 2006 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * vmci_kernel_if.h -- + * + * This file defines helper functions for VMCI host _and_ guest + * kernel code. It must work for windows, macosx, vmkernel and + * linux kernel, ie. using defines where necessary. + */ + +#ifndef _VMCI_KERNEL_IF_H_ +#define _VMCI_KERNEL_IF_H_ + +#if !defined(linux) && !defined(_WIN32) && !defined(__APPLE__) && \ + !defined(VMKERNEL) && !defined(SOLARIS) +#error "Platform not supported." +#endif + +#if defined(_WIN32) +#include <ntddk.h> +#endif + +#if defined(linux) && !defined(VMKERNEL) +# include "compat_version.h" +# include "compat_wait.h" +# include "compat_spinlock.h" +# include "compat_semaphore.h" +#endif // linux + +#ifdef __APPLE__ +# include <IOKit/IOLib.h> +#include <mach/task.h> +#include <mach/semaphore.h> +#endif + +#ifdef VMKERNEL +#include "splock.h" +#include "semaphore_ext.h" +#endif + +#ifdef SOLARIS +# include <sys/mutex.h> +# include <sys/poll.h> +# include <sys/semaphore.h> +#endif + +#include "vm_basic_types.h" +#include "vmci_defs.h" + +/* Flags for specifying memory type. */ +#define VMCI_MEMORY_NORMAL 0x0 +#define VMCI_MEMORY_ATOMIC 0x1 +#define VMCI_MEMORY_NONPAGED 0x2 + +/* Platform specific type definitions. */ + +#if defined(VMKERNEL) + typedef SP_SpinLock VMCILock; + typedef SP_IRQL VMCILockFlags; + typedef Semaphore VMCIEvent; + typedef Semaphore VMCIMutex; +#elif defined(linux) + typedef spinlock_t VMCILock; + typedef unsigned long VMCILockFlags; + typedef wait_queue_head_t VMCIEvent; + typedef struct semaphore VMCIMutex; + typedef PPN *VMCIPpnList; /* List of PPNs in produce/consume queue. */ +#elif defined(__APPLE__) + typedef IOLock *VMCILock; + typedef unsigned long VMCILockFlags; + typedef semaphore_t VMCIEvent; + typedef IOLock *VMCIMutex; +#elif defined(_WIN32) + typedef KSPIN_LOCK VMCILock; + typedef KIRQL VMCILockFlags; + typedef KEVENT VMCIEvent; + typedef FAST_MUTEX VMCIMutex; + typedef PMDL VMCIPpnList; /* MDL to map the produce/consume queue. */ +#elif defined(SOLARIS) + typedef kmutex_t VMCILock; + typedef unsigned long VMCILockFlags; + typedef ksema_t VMCIEvent; +#endif // VMKERNEL + +/* Callback needed for correctly waiting on events. */ +typedef int (*VMCIEventReleaseCB)(void *clientData); + +/* + * The VMCI locks use a ranking scheme similar to the one used by + * vmkernel. While holding a lock L1 with rank R1, only locks with + * rank higher than R1 may be grabbed. The available ranks for VMCI + * locks are (in descending order): + * - VMCI_LOCK_RANK_HIGH_BH : to be used for locks grabbed while executing + * in a bottom half and not held while grabbing other locks. + * - VMCI_LOCK_RANK_MIDDLE_BH : to be for locks grabbed while executing in a + * bottom half and held while grabbing locks of rank VMCI_LOCK_RANK_HIGH_BH. + * - VMCI_LOCK_RANK_LOW_BH : to be for locks grabbed while executing in a + * bottom half and held while grabbing locks of rank + * VMCI_LOCK_RANK_MIDDLE_BH. + * - VMCI_LOCK_RANK_HIGHEST : to be used for locks that are not held while + * grabbing other locks except system locks with higher ranks and bottom + * half locks. + * - VMCI_LOCK_RANK_HIGHER : to be used for locks that are held while + * grabbing locks of rank VMCI_LOCK_RANK_HIGHEST or higher. + * - VMCI_LOCK_RANK_HIGH : to be used for locks that are held while + * grabbing locks of rank VMCI_LOCK_RANK_HIGHER or higher. This is + * the highest lock rank used by core VMCI services + * - VMCI_LOCK_RANK_MIDDLE : to be used for locks that are held while + * grabbing locks of rank VMCI_LOCK_RANK_HIGH or higher. + * - VMCI_LOCK_RANK_LOW : to be used for locks that are held while + * grabbing locks of rank VMCI_LOCK_RANK_MIDDLE or higher. + * - VMCI_LOCK_RANK_LOWEST : to be used for locks that are held while + * grabbing locks of rank VMCI_LOCK_RANK_LOW or higher. + */ +#ifdef VMKERNEL + typedef SP_Rank VMCILockRank; + + #define VMCI_LOCK_RANK_HIGH_BH SP_RANK_IRQ_LEAF + #define VMCI_LOCK_RANK_MIDDLE_BH (SP_RANK_IRQ_LEAF-1) + #define VMCI_LOCK_RANK_LOW_BH SP_RANK_IRQ_LOWEST + #define VMCI_LOCK_RANK_HIGHEST SP_RANK_SHM_MGR-1 +#else + typedef unsigned long VMCILockRank; + + #define VMCI_LOCK_RANK_HIGH_BH 0x4000 + #define VMCI_LOCK_RANK_MIDDLE_BH 0x2000 + #define VMCI_LOCK_RANK_LOW_BH 0x1000 + #define VMCI_LOCK_RANK_HIGHEST 0x0fff +#endif // VMKERNEL +#define VMCI_LOCK_RANK_HIGHER (VMCI_LOCK_RANK_HIGHEST-1) +#define VMCI_LOCK_RANK_HIGH (VMCI_LOCK_RANK_HIGHER-1) +#define VMCI_LOCK_RANK_MIDDLE_HIGH (VMCI_LOCK_RANK_HIGH-1) +#define VMCI_LOCK_RANK_MIDDLE (VMCI_LOCK_RANK_MIDDLE_HIGH-1) +#define VMCI_LOCK_RANK_MIDDLE_LOW (VMCI_LOCK_RANK_MIDDLE-1) +#define VMCI_LOCK_RANK_LOW (VMCI_LOCK_RANK_MIDDLE_LOW-1) +#define VMCI_LOCK_RANK_LOWEST (VMCI_LOCK_RANK_LOW-1) + + +/* + * In vmkernel, we try to reduce the amount of memory mapped into the + * virtual address space by only mapping the memory of buffered + * datagrams when copying from and to the guest. In other OSes, + * regular kernel memory is used. VMCIBuffer is used to reference + * possibly unmapped memory. + */ + +#ifdef VMKERNEL +typedef MPN VMCIBuffer; +#define VMCI_BUFFER_INVALID INVALID_MPN +#else +typedef void * VMCIBuffer; +#define VMCI_BUFFER_INVALID NULL +#endif + +/* + * Host specific struct used for signalling. + */ + +typedef struct VMCIHost { +#if defined(VMKERNEL) + World_ID vmmWorldID; +#elif defined(linux) + wait_queue_head_t waitQueue; +#elif defined(__APPLE__) + struct Socket *socket; /* vmci Socket object on Mac OS. */ +#elif defined(_WIN32) + KEVENT *callEvent; /* Ptr to userlevel event used when signalling + * new pending guestcalls in kernel. + */ +#elif defined(SOLARIS) + struct pollhead pollhead; /* Per datagram handle pollhead structure to + * be treated as a black-box. None of its + * fields should be referenced. + */ +#endif +} VMCIHost; + + +void VMCI_InitLock(VMCILock *lock, char *name, VMCILockRank rank); +void VMCI_CleanupLock(VMCILock *lock); +void VMCI_GrabLock(VMCILock *lock, VMCILockFlags *flags); +void VMCI_ReleaseLock(VMCILock *lock, VMCILockFlags flags); +void VMCI_GrabLock_BH(VMCILock *lock, VMCILockFlags *flags); +void VMCI_ReleaseLock_BH(VMCILock *lock, VMCILockFlags flags); + +void VMCIHost_InitContext(VMCIHost *hostContext, uintptr_t eventHnd); +void VMCIHost_ReleaseContext(VMCIHost *hostContext); +void VMCIHost_SignalCall(VMCIHost *hostContext); +void VMCIHost_ClearCall(VMCIHost *hostContext); +Bool VMCIHost_WaitForCallLocked(VMCIHost *hostContext, + VMCILock *lock, + VMCILockFlags *flags, + Bool useBH); + +void *VMCI_AllocKernelMem(size_t size, int flags); +void VMCI_FreeKernelMem(void *ptr, size_t size); +VMCIBuffer VMCI_AllocBuffer(size_t size, int flags); +void *VMCI_MapBuffer(VMCIBuffer buf); +void VMCI_ReleaseBuffer(void *ptr); +void VMCI_FreeBuffer(VMCIBuffer buf, size_t size); +#ifdef SOLARIS +int VMCI_CopyToUser(void *dst, const void *src, unsigned int len, int mode); +#else +int VMCI_CopyToUser(void *dst, const void *src, unsigned int len); +/* + * Don't need the following for guests, hence no Solaris code for this + * function. + */ +Bool VMCIWellKnownID_AllowMap(VMCIId wellKnownID, + VMCIPrivilegeFlags privFlags); +#endif + +void VMCI_CreateEvent(VMCIEvent *event); +void VMCI_DestroyEvent(VMCIEvent *event); +void VMCI_SignalEvent(VMCIEvent *event); +void VMCI_WaitOnEvent(VMCIEvent *event, VMCIEventReleaseCB releaseCB, + void *clientData); + +/* XXX TODO for VMKERNEL (host) and Solaris (guest). */ +#if !defined(VMKERNEL) && (defined(__linux__) || defined(_WIN32) || \ + defined(__APPLE__)) +int VMCI_CopyFromUser(void *dst, const void *src, size_t len); +#endif + +#if !defined(SOLARIS) +int VMCIMutex_Init(VMCIMutex *mutex); +void VMCIMutex_Destroy(VMCIMutex *mutex); +void VMCIMutex_Acquire(VMCIMutex *mutex); +void VMCIMutex_Release(VMCIMutex *mutex); +#endif + +/* XXX TODO for Solaris (guest). */ +#if !defined(VMKERNEL) && (defined(__linux__) || defined(_WIN32)) +VA VMCI_AllocQueueKVA(uint64 size); +void VMCI_FreeQueueKVA(VA va, uint64 size); +typedef struct PPNSet { + uint64 numProducePages; + uint64 numConsumePages; + VMCIPpnList producePPNs; + VMCIPpnList consumePPNs; + Bool initialized; +} PPNSet; +int VMCI_AllocPPNSet(VA produceVA, uint64 numProducePages, VA consumeVA, + uint64 numConsumePages, PPNSet *ppnSet); +void VMCI_FreePPNSet(PPNSet *ppnSet); +int VMCI_PopulatePPNList(uint8 *callBuf, const PPNSet *ppnSet); +#endif + +#endif // _VMCI_KERNEL_IF_H_ + diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmci/vmciProcess.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vmciProcess.c --- open-vm-tools-2008.01.23-74039/modules/linux/vmci/vmciProcess.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vmciProcess.c 2008-10-13 08:01:41.000000000 +0100 @@ -0,0 +1,227 @@ +/********************************************************* + * Copyright (C) 2006 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * vmciProcess.c -- + * + * VMCI Process code for guest driver. + */ + +#ifdef __linux__ +# include "driver-config.h" + +# define EXPORT_SYMTAB + +# include <linux/module.h> +# include "compat_kernel.h" +# include "compat_pci.h" +#endif // __linux__ + +#include "vmciInt.h" +#include "vmci_defs.h" +#include "vmci_kernel_if.h" +#include "vmciProcess.h" +#include "vmciDatagram.h" +#include "vmci_infrastructure.h" +#include "circList.h" +#include "vmciUtil.h" +#include "vmciGuestKernelAPI.h" + +static ListItem *processList = NULL; +static VMCILock processLock; + +/* + *---------------------------------------------------------------------- + * + * VMCIProcess_Init -- + * + * General init code. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +void +VMCIProcess_Init(void) +{ + VMCI_InitLock(&processLock, "VMCIProcessListLock", VMCI_LOCK_RANK_HIGH); +} + + +/* + *---------------------------------------------------------------------- + * + * VMCIProcess_Exit -- + * + * General init code. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +void +VMCIProcess_Exit(void) +{ + VMCI_CleanupLock(&processLock); +} + + +/* + *----------------------------------------------------------------------------- + * + * VMCIProcess_CheckHostCapabilities -- + * + * Verify that the host supports the hypercalls we need. If it does not, + * try to find fallback hypercalls and use those instead. + * + * Results: + * TRUE if required hypercalls (or fallback hypercalls) are + * supported by the host, FALSE otherwise. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +Bool +VMCIProcess_CheckHostCapabilities(void) +{ + /* VMCIProcess does not require any hypercalls. */ + return TRUE; +} + + +/* + *---------------------------------------------------------------------- + * + * VMCIProcess_Create -- + * + * Creates a new VMCI process. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +int +VMCIProcess_Create(VMCIProcess **outProcess, // IN + int eventHnd) // IN +{ + VMCIProcess *process; + VMCILockFlags flags; + + process = VMCI_AllocKernelMem(sizeof *process, VMCI_MEMORY_NONPAGED); + if (process == NULL) { + return VMCI_ERROR_NO_MEM; + } + + process->pid = (VMCIId)(uintptr_t)process >> 1; + + VMCI_GrabLock(&processLock, &flags); + LIST_QUEUE(&process->listItem, &processList); + VMCI_ReleaseLock(&processLock, flags); + + *outProcess = process; + return 0; +} + + +/* + *---------------------------------------------------------------------- + * + * VMCIProcess_Destroy -- + * + * Destroys a VMCI process. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +void +VMCIProcess_Destroy(VMCIProcess *process) +{ + VMCILockFlags flags; + + /* Dequeue process. */ + VMCI_GrabLock(&processLock, &flags); + LIST_DEL(&process->listItem, &processList); + VMCI_ReleaseLock(&processLock, flags); + + VMCI_FreeKernelMem(process, sizeof *process); +} + + +/* + *---------------------------------------------------------------------- + * + * VMCIProcess_Get -- + * + * Get the process corresponding to the pid. + * + * Results: + * VMCI process on success, NULL otherwise. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +VMCIProcess * +VMCIProcess_Get(VMCIId processID) // IN +{ + VMCIProcess *process = NULL; + ListItem *next; + VMCILockFlags flags; + + VMCI_GrabLock(&processLock, &flags); + if (processList == NULL) { + goto out; + } + + LIST_SCAN(next, processList) { + process = LIST_CONTAINER(next, VMCIProcess, listItem); + if (process->pid == processID) { + break; + } + } + +out: + VMCI_ReleaseLock(&processLock, flags); + return (process && process->pid == processID) ? process : NULL; +} diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmci/vmciProcess.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vmciProcess.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmci/vmciProcess.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vmciProcess.h 2008-10-13 08:01:41.000000000 +0100 @@ -0,0 +1,49 @@ +/********************************************************* + * Copyright (C) 2006 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * vmciProcess.h -- + * + * Process code for the Linux guest driver + */ + +#ifndef __VMCI_PROCESS_H__ +#define __VMCI_PROCESS_H__ + +#define INCLUDE_ALLOW_MODULE +#include "includeCheck.h" + +#include "vm_basic_types.h" + +#include "vmci_defs.h" +#include "vmci_handle_array.h" +#include "circList.h" + +typedef struct VMCIProcess { + ListItem listItem; /* For global process list. */ + VMCIId pid; /* Process id. */ +} VMCIProcess; + +void VMCIProcess_Init(void); +void VMCIProcess_Exit(void); +Bool VMCIProcess_CheckHostCapabilities(void); +int VMCIProcess_Create(VMCIProcess **outProcess, int eventHnd); +void VMCIProcess_Destroy(VMCIProcess *process); +VMCIProcess *VMCIProcess_Get(VMCIId processID); + +#endif //__VMCI_PROCESS_H__ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmci/vmciQueuePair.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vmciQueuePair.c --- open-vm-tools-2008.01.23-74039/modules/linux/vmci/vmciQueuePair.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vmciQueuePair.c 2008-10-13 08:01:41.000000000 +0100 @@ -0,0 +1,934 @@ +/********************************************************* + * Copyright (C) 2007 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * vmciQueuePair.c -- + * + * Implements the VMCI QueuePair API. + */ + +#ifdef __linux__ +# include "driver-config.h" +# define EXPORT_SYMTAB +# include <asm/page.h> +# include <linux/module.h> +#elif defined(_WIN32) +# include <wdm.h> +#endif /* __linux__ */ + +#include "vm_assert.h" +#include "vmci_kernel_if.h" +#include "vmci_queue_pair.h" +#include "vmciQueuePairInt.h" +#include "vmciUtil.h" +#include "vmciInt.h" +#include "vmciEvent.h" +#include "circList.h" + +#define LGPFX "VMCIQueuePair: " + +typedef struct QueuePairEntry { + VMCIHandle handle; + VMCIId peer; + uint32 flags; + uint64 produceSize; + uint64 consumeSize; + uint64 numPPNs; + PPNSet ppnSet; + VA produceQVA; + VA consumeQVA; + uint32 refCount; + ListItem listItem; +} QueuePairEntry; + +typedef struct QueuePairList { + ListItem *head; + VMCIMutex mutex; +} QueuePairList; + +static QueuePairList queuePairList; + +static QueuePairEntry *QueuePairList_FindEntry(VMCIHandle handle); +static void QueuePairList_AddEntry(QueuePairEntry *entry); +static void QueuePairList_RemoveEntry(QueuePairEntry *entry); +static QueuePairEntry *QueuePairList_GetHead(void); +static QueuePairEntry *QueuePairEntryCreate(VMCIHandle handle, + VMCIId peer, uint32 flags, + uint64 produceSize, + uint64 consumeSize, + VA produceQVA, VA consumeQVA); +static void QueuePairEntryDestroy(QueuePairEntry *entry); +static int VMCIQueuePairAlloc_HyperCall(const QueuePairEntry *entry); +static int VMCIQueuePairAllocHelper(VMCIHandle *handle, VMCIQueue **produceQ, + uint64 produceSize, VMCIQueue **consumeQ, + uint64 consumeSize, + VMCIId peer, uint32 flags); +static int VMCIQueuePairDetachHelper(VMCIHandle handle); +static int QueuePairNotifyPeerLocal(Bool attach, VMCIHandle handle); + + +/* + *----------------------------------------------------------------------------- + * + * QueuePairLock_Init -- + * + * Creates the lock protecting the QueuePair list. + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static INLINE void +QueuePairLock_Init(void) +{ + VMCIMutex_Init(&queuePairList.mutex); +} + + +/* + *----------------------------------------------------------------------------- + * + * QueuePairLock_Destroy -- + * + * Destroys the lock protecting the QueuePair list. + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static INLINE void +QueuePairLock_Destroy(void) +{ + VMCIMutex_Destroy(&queuePairList.mutex); /* No-op on Linux and Windows. */ +} + + +/* + *----------------------------------------------------------------------------- + * + * QueuePairList_Lock -- + * + * Acquires the lock protecting the QueuePair list. + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static INLINE void +QueuePairList_Lock(void) +{ + VMCIMutex_Acquire(&queuePairList.mutex); +} + + +/* + *----------------------------------------------------------------------------- + * + * QueuePairList_Unlock -- + * + * Releases the lock protecting the QueuePair list. + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static INLINE void +QueuePairList_Unlock(void) +{ + VMCIMutex_Release(&queuePairList.mutex); +} + + +/* + *----------------------------------------------------------------------------- + * + * VMCIQueuePair_Init -- + * + * Initalizes QueuePair data structure state. + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +void +VMCIQueuePair_Init(void) +{ + queuePairList.head = NULL; + QueuePairLock_Init(); +} + + +/* + *----------------------------------------------------------------------------- + * + * VMCIQueuePair_Exit -- + * + * Destroys all QueuePairs. Makes hypercalls to detach from QueuePairs. + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +void +VMCIQueuePair_Exit(void) +{ + QueuePairEntry *entry; + + QueuePairList_Lock(); + + while ((entry = QueuePairList_GetHead())) { + /* + * Don't make a hypercall for local QueuePairs. + */ + if (!(entry->flags & VMCI_QPFLAG_LOCAL)) { + VMCIQueuePairDetachMsg detachMsg; + + detachMsg.hdr.dst = VMCI_MAKE_HANDLE(VMCI_HYPERVISOR_CONTEXT_ID, + VMCI_QUEUEPAIR_DETACH); + detachMsg.hdr.src = VMCI_ANON_SRC_HANDLE; + detachMsg.hdr.payloadSize = sizeof entry->handle; + detachMsg.handle = entry->handle; + + (void)VMCI_SendDatagram((VMCIDatagram *)&detachMsg); + } + /* + * We cannot fail the exit, so let's reset refCount. + */ + entry->refCount = 0; + QueuePairList_RemoveEntry(entry); + QueuePairEntryDestroy(entry); + } + + QueuePairList_Unlock(); + QueuePairLock_Destroy(); +} + + +/* + *----------------------------------------------------------------------------- + * + * QueuePairList_FindEntry -- + * + * Searches the list of QueuePairs to find if an entry already exists. + * Assumes that the lock on the list is held. + * + * Results: + * Pointer to the entry if it exists, NULL otherwise. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static QueuePairEntry * +QueuePairList_FindEntry(VMCIHandle handle) // IN: +{ + ListItem *next; + + if (VMCI_HANDLE_INVALID(handle)) { + return NULL; + } + + LIST_SCAN(next, queuePairList.head) { + QueuePairEntry *entry = LIST_CONTAINER(next, QueuePairEntry, listItem); + + if (VMCI_HANDLE_EQUAL(entry->handle, handle)) { + return entry; + } + } + + return NULL; +} + + +/* + *----------------------------------------------------------------------------- + * + * QueuePairList_AddEntry -- + * + * Appends a QueuePair entry to the list. Assumes that the lock on the + * list is held. + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static void +QueuePairList_AddEntry(QueuePairEntry *entry) // IN: +{ + if (entry) { + LIST_QUEUE(&entry->listItem, &queuePairList.head); + } +} + + +/* + *----------------------------------------------------------------------------- + * + * QueuePairList_RemoveEntry -- + * + * Removes a QueuePair entry from the list. Assumes that the lock on the + * list is held. + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static void +QueuePairList_RemoveEntry(QueuePairEntry *entry) // IN: +{ + if (entry) { + LIST_DEL(&entry->listItem, &queuePairList.head); + } +} + + +/* + *----------------------------------------------------------------------------- + * + * QueuePairList_GetHead -- + * + * Returns the entry from the head of the list. Assumes that the list is + * locked. + * + * Results: + * Pointer to entry. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static QueuePairEntry * +QueuePairList_GetHead(void) +{ + ListItem *first = LIST_FIRST(queuePairList.head); + + if (first) { + QueuePairEntry *entry = LIST_CONTAINER(first, QueuePairEntry, listItem); + return entry; + } + + return NULL; +} + + +/* + *----------------------------------------------------------------------------- + * + * VMCIQueuePair_Alloc -- + * + * Allocates a VMCI QueuePair. Only checks validity of input arguments. + * Real work is done in the OS-specific helper routine. + * + * Results: + * Success or failure. + * + * Side effects: + * Memory is allocated. + * + *----------------------------------------------------------------------------- + */ + +#ifdef __linux__ +EXPORT_SYMBOL(VMCIQueuePair_Alloc); +#endif + +int +VMCIQueuePair_Alloc(VMCIHandle *handle, // IN/OUT: + VMCIQueue **produceQ, // OUT: + uint64 produceSize, // IN: + VMCIQueue **consumeQ, // OUT: + uint64 consumeSize, // IN: + VMCIId peer, // IN: + uint32 flags) // IN: +{ + ASSERT_ON_COMPILE(sizeof(VMCIQueueHeader) <= PAGE_SIZE); +# define VMCIQP_OFFSET_OF(Struct, field) ((uintptr_t)&(((Struct *)0)->field)) +#ifdef __linux__ + ASSERT_ON_COMPILE(VMCIQP_OFFSET_OF(VMCIQueue, page) == PAGE_SIZE); +#else + ASSERT_ON_COMPILE(VMCIQP_OFFSET_OF(VMCIQueue, buffer) == PAGE_SIZE); +#endif +# undef VMCIQP_OFFSET_OF + + if (!handle || !produceQ || !consumeQ || (!produceSize && !consumeSize) || + (flags & ~VMCI_QP_ALL_FLAGS)) { + return VMCI_ERROR_INVALID_ARGS; + } + + return VMCIQueuePairAllocHelper(handle, produceQ, produceSize, consumeQ, + consumeSize, peer, flags); +} + + +/* + *----------------------------------------------------------------------------- + * + * VMCIQueuePair_Detach -- + * + * Detaches from a VMCI QueuePair. Only checks validity of input argument. + * Real work is done in the OS-specific helper routine. + * + * Results: + * Success or failure. + * + * Side effects: + * Memory is freed. + * + *----------------------------------------------------------------------------- + */ + +#ifdef __linux__ +EXPORT_SYMBOL(VMCIQueuePair_Detach); +#endif + +int +VMCIQueuePair_Detach(VMCIHandle handle) // IN: +{ + if (VMCI_HANDLE_INVALID(handle)) { + return VMCI_ERROR_INVALID_ARGS; + } + return VMCIQueuePairDetachHelper(handle); +} + + +/* + *----------------------------------------------------------------------------- + * + * QueuePairEntryCreate -- + * + * Allocates and initializes a QueuePairEntry structure. Allocates a + * QueuePair rid (and handle) iff the given entry has an invalid handle. + * 0 through VMCI_RESERVED_RESOURCE_ID_MAX are reserved handles. Assumes + * that the QP list lock is held by the caller. + * + * Results: + * Pointer to structure intialized. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +QueuePairEntry * +QueuePairEntryCreate(VMCIHandle handle, // IN: + VMCIId peer, // IN: + uint32 flags, // IN: + uint64 produceSize, // IN: + uint64 consumeSize, // IN: + VA produceQVA, // IN: + VA consumeQVA) // IN: +{ + static VMCIId queuePairRID = VMCI_RESERVED_RESOURCE_ID_MAX + 1; + QueuePairEntry *entry; + const uint64 numPPNs = CEILING(produceSize, PAGE_SIZE) + + CEILING(consumeSize, PAGE_SIZE) + + 2; /* One page each for the queue headers. */ + + ASSERT((produceSize || consumeSize) && produceQVA && consumeQVA); + + if (VMCI_HANDLE_INVALID(handle)) { + VMCIId contextID = VMCI_GetContextID(); + VMCIId oldRID = queuePairRID; + + /* + * Generate a unique QueuePair rid. Keep on trying until we wrap around + * in the RID space. + */ + ASSERT(oldRID > VMCI_RESERVED_RESOURCE_ID_MAX); + do { + handle = VMCI_MAKE_HANDLE(contextID, queuePairRID); + entry = QueuePairList_FindEntry(handle); + queuePairRID++; + if (UNLIKELY(!queuePairRID)) { + /* + * Skip the reserved rids. + */ + queuePairRID = VMCI_RESERVED_RESOURCE_ID_MAX + 1; + } + } while (entry && queuePairRID != oldRID); + + if (UNLIKELY(entry != NULL)) { + ASSERT(queuePairRID == oldRID); + /* + * We wrapped around --- no rids were free. + */ + return NULL; + } + } + + ASSERT(!VMCI_HANDLE_INVALID(handle) && + QueuePairList_FindEntry(handle) == NULL); + entry = VMCI_AllocKernelMem(sizeof *entry, VMCI_MEMORY_NORMAL); + if (entry) { + entry->handle = handle; + entry->peer = peer; + entry->flags = flags; + entry->produceSize = produceSize; + entry->consumeSize = consumeSize; + entry->numPPNs = numPPNs; + memset(&entry->ppnSet, 0, sizeof entry->ppnSet); + entry->produceQVA = produceQVA; + entry->consumeQVA = consumeQVA; + entry->refCount = 0; + INIT_LIST_ITEM(&entry->listItem); + } + return entry; +} + + +/* + *----------------------------------------------------------------------------- + * + * QueuePairEntryDestroy -- + * + * Frees a QueuePairEntry structure. + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +void +QueuePairEntryDestroy(QueuePairEntry *entry) // IN: +{ + ASSERT(entry); + ASSERT(entry->refCount == 0); + + VMCI_FreePPNSet(&entry->ppnSet); + VMCI_FreeQueueKVA(entry->produceQVA, entry->produceSize); + VMCI_FreeQueueKVA(entry->consumeQVA, entry->consumeSize); + VMCI_FreeKernelMem(entry, sizeof *entry); +} + + +/* + *----------------------------------------------------------------------------- + * + * VMCIQueuePairAlloc_HyperCall -- + * + * Helper to make a QueuePairAlloc hypercall. + * + * Results: + * Result of the hypercall. + * + * Side effects: + * Memory is allocated & freed. + * + *----------------------------------------------------------------------------- + */ + +int +VMCIQueuePairAlloc_HyperCall(const QueuePairEntry *entry) // IN: +{ + VMCIQueuePairAllocMsg *allocMsg; + size_t msgSize; + int result; + + if (!entry || entry->numPPNs <= 2) { + return VMCI_ERROR_INVALID_ARGS; + } + + ASSERT(!(entry->flags & VMCI_QPFLAG_LOCAL)); + + msgSize = sizeof *allocMsg + (size_t)entry->numPPNs * sizeof(PPN); + allocMsg = VMCI_AllocKernelMem(msgSize, VMCI_MEMORY_NONPAGED); + if (!allocMsg) { + return VMCI_ERROR_NO_MEM; + } + + allocMsg->hdr.dst = VMCI_MAKE_HANDLE(VMCI_HYPERVISOR_CONTEXT_ID, + VMCI_QUEUEPAIR_ALLOC); + allocMsg->hdr.src = VMCI_ANON_SRC_HANDLE; + allocMsg->hdr.payloadSize = msgSize - VMCI_DG_HEADERSIZE; + allocMsg->handle = entry->handle; + allocMsg->peer = entry->peer; + allocMsg->flags = entry->flags; + allocMsg->produceSize = entry->produceSize; + allocMsg->consumeSize = entry->consumeSize; + allocMsg->numPPNs = entry->numPPNs; + result = VMCI_PopulatePPNList((uint8 *)allocMsg + sizeof *allocMsg, &entry->ppnSet); + if (result == VMCI_SUCCESS) { + result = VMCI_SendDatagram((VMCIDatagram *)allocMsg); + } + VMCI_FreeKernelMem(allocMsg, msgSize); + + return result; +} + + +/* + *----------------------------------------------------------------------------- + * + * VMCIQueuePairAllocHelper -- + * + * Helper for VMCI QueuePairAlloc. Allocates physical pages for the + * QueuePair. Makes OS dependent calls through generic wrappers. + * + * Results: + * Success or failure. + * + * Side effects: + * Memory is allocated. + * + *----------------------------------------------------------------------------- + */ + +static int +VMCIQueuePairAllocHelper(VMCIHandle *handle, // IN/OUT: + VMCIQueue **produceQ, // OUT: + uint64 produceSize, // IN: + VMCIQueue **consumeQ, // OUT: + uint64 consumeSize, // IN: + VMCIId peer, // IN: + uint32 flags) // IN: +{ + const uint64 numProducePages = CEILING(produceSize, PAGE_SIZE) + 1; + const uint64 numConsumePages = CEILING(consumeSize, PAGE_SIZE) + 1; + VA produceVA = 0; + VA consumeVA = 0; + int result; + QueuePairEntry *queuePairEntry = NULL; + + /* + * XXX Check for possible overflow of 'size' arguments when passed to + * compat_get_order (after some arithmetic ops). + */ + + ASSERT(handle && produceQ && consumeQ && (produceSize || consumeSize)); + + QueuePairList_Lock(); + + if ((queuePairEntry = QueuePairList_FindEntry(*handle))) { + if (queuePairEntry->flags & VMCI_QPFLAG_LOCAL) { + /* Local attach case. */ + if (queuePairEntry->refCount > 1) { + VMCI_LOG((LGPFX "Error attempting to attach more than once.\n")); + result = VMCI_ERROR_UNAVAILABLE; + goto errorKeepEntry; + } + + if (queuePairEntry->produceSize != consumeSize || + queuePairEntry->consumeSize != produceSize || + queuePairEntry->flags != (flags & ~VMCI_QPFLAG_ATTACH_ONLY)) { + VMCI_LOG((LGPFX "Error mismatched queue pair in local attach.\n")); + result = VMCI_ERROR_QUEUEPAIR_MISMATCH; + goto errorKeepEntry; + } + + /* + * Do a local attach. We swap the consume and produce queues for the + * attacher and deliver an attach event. + */ + result = QueuePairNotifyPeerLocal(TRUE, *handle); + if (result < VMCI_SUCCESS) { + goto errorKeepEntry; + } + produceVA = queuePairEntry->consumeQVA; + consumeVA = queuePairEntry->produceQVA; + goto out; + } + result = VMCI_ERROR_ALREADY_EXISTS; + goto errorKeepEntry; + } + + produceVA = VMCI_AllocQueueKVA(produceSize); + if (!produceVA) { + VMCI_LOG((LGPFX "Error allocating pages for produce queue.\n")); + result = VMCI_ERROR_NO_MEM; + goto error; + } + + consumeVA = VMCI_AllocQueueKVA(consumeSize); + if (!consumeVA) { + VMCI_LOG((LGPFX "Error allocating pages for consume queue.\n")); + result = VMCI_ERROR_NO_MEM; + goto error; + } + + queuePairEntry = QueuePairEntryCreate(*handle, peer, flags, + produceSize, consumeSize, + produceVA, consumeVA); + if (!queuePairEntry) { + VMCI_LOG((LGPFX "Error allocating memory in %s.\n", __FUNCTION__)); + result = VMCI_ERROR_NO_MEM; + goto error; + } + + result = VMCI_AllocPPNSet(produceVA, numProducePages, consumeVA, + numConsumePages, &queuePairEntry->ppnSet); + if (result < VMCI_SUCCESS) { + VMCI_LOG((LGPFX "VMCI_AllocPPNSet failed.\n")); + goto error; + } + + /* + * It's only necessary to notify the host if this queue pair will be + * attached to from another context. + */ + if (queuePairEntry->flags & VMCI_QPFLAG_LOCAL) { + /* Local create case. */ + VMCIId contextId = VMCI_GetContextID(); + + /* + * Enforce similar checks on local queue pairs as we do for regular ones. + * The handle's context must match the creator or attacher context id + * (here they are both the current context id) and the attach-only flag + * cannot exist during create. We also ensure specified peer is this + * context or an invalid one. + */ + if (queuePairEntry->handle.context != contextId || + (queuePairEntry->peer != VMCI_INVALID_ID && + queuePairEntry->peer != contextId)) { + result = VMCI_ERROR_NO_ACCESS; + goto error; + } + + if (queuePairEntry->flags & VMCI_QPFLAG_ATTACH_ONLY) { + result = VMCI_ERROR_NOT_FOUND; + goto error; + } + } else { + result = VMCIQueuePairAlloc_HyperCall(queuePairEntry); + if (result < VMCI_SUCCESS) { + VMCI_LOG((LGPFX "VMCIQueuePairAlloc_HyperCall result = %d.\n", + result)); + goto error; + } + } + + QueuePairList_AddEntry(queuePairEntry); + +out: + queuePairEntry->refCount++; + *handle = queuePairEntry->handle; + *produceQ = (VMCIQueue *)produceVA; + *consumeQ = (VMCIQueue *)consumeVA; + + /* + * We should initialize the queue pair header pages on a local queue pair + * create. For non-local queue pairs, the hypervisor initializes the header + * pages in the create step. + */ + if ((queuePairEntry->flags & VMCI_QPFLAG_LOCAL) && + queuePairEntry->refCount == 1) { + VMCIQueue_Init(*handle, *produceQ); + VMCIQueue_Init(*handle, *consumeQ); + } + + QueuePairList_Unlock(); + + return VMCI_SUCCESS; + +error: + QueuePairList_Unlock(); + if (queuePairEntry) { + /* The KVAs will be freed inside the destroy routine. */ + QueuePairEntryDestroy(queuePairEntry); + } else { + if (produceVA) { + VMCI_FreeQueueKVA(produceVA, produceSize); + } + if (consumeVA) { + VMCI_FreeQueueKVA(consumeVA, consumeSize); + } + } + return result; + +errorKeepEntry: + /* This path should only be used when an existing entry was found. */ + ASSERT(queuePairEntry->refCount > 0); + QueuePairList_Unlock(); + return result; +} + + +/* + *----------------------------------------------------------------------------- + * + * VMCIQueuePairDetachHelper -- + * + * Helper for VMCI QueuePair detach interface on Linux. Frees the physical + * pages for the QueuePair. + * + * Results: + * Success or failure. + * + * Side effects: + * Memory may be freed. + * + *----------------------------------------------------------------------------- + */ + +static int +VMCIQueuePairDetachHelper(VMCIHandle handle) // IN: +{ + int result; + QueuePairEntry *entry; + uint32 refCount; + + ASSERT(!VMCI_HANDLE_INVALID(handle)); + + QueuePairList_Lock(); + + entry = QueuePairList_FindEntry(handle); + if (!entry) { + result = VMCI_ERROR_NOT_FOUND; + goto out; + } + + ASSERT(entry->refCount >= 1); + + if (entry->flags & VMCI_QPFLAG_LOCAL) { + result = VMCI_SUCCESS; + + if (entry->refCount > 1) { + result = QueuePairNotifyPeerLocal(FALSE, handle); + if (result < VMCI_SUCCESS) { + goto out; + } + } + } else { + VMCIQueuePairDetachMsg detachMsg; + + detachMsg.hdr.dst = VMCI_MAKE_HANDLE(VMCI_HYPERVISOR_CONTEXT_ID, + VMCI_QUEUEPAIR_DETACH); + detachMsg.hdr.src = VMCI_ANON_SRC_HANDLE; + detachMsg.hdr.payloadSize = sizeof handle; + detachMsg.handle = handle; + + result = VMCI_SendDatagram((VMCIDatagram *)&detachMsg); + } + +out: + if (result >= VMCI_SUCCESS) { + entry->refCount--; + + if (entry->refCount == 0) { + QueuePairList_RemoveEntry(entry); + } + } + + /* If we didn't remove the entry, this could change once we unlock. */ + refCount = entry ? entry->refCount : + 0xffffffff; /* + * Value does not matter, silence the + * compiler. + */ + + + QueuePairList_Unlock(); + + if (result >= VMCI_SUCCESS && refCount == 0) { + QueuePairEntryDestroy(entry); + } + return result; +} + + +/* + *---------------------------------------------------------------------------- + * + * QueuePairNotifyPeerLocal -- + * + * Dispatches a queue pair event message directly into the local event + * queue. + * + * Results: + * VMCI_SUCCESS on success, error code otherwise + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +static int +QueuePairNotifyPeerLocal(Bool attach, // IN: attach or detach? + VMCIHandle handle) // IN: queue pair handle +{ + VMCIEventMsg *eMsg; + VMCIEventPayload_QP *ePayload; + /* buf is only 48 bytes. */ + char buf[sizeof *eMsg + sizeof *ePayload]; + VMCIId contextId; + + contextId = VMCI_GetContextID(); + + eMsg = (VMCIEventMsg *)buf; + ePayload = VMCIEventMsgPayload(eMsg); + + eMsg->hdr.dst = VMCI_MAKE_HANDLE(contextId, VMCI_EVENT_HANDLER); + eMsg->hdr.src = VMCI_MAKE_HANDLE(VMCI_HYPERVISOR_CONTEXT_ID, + VMCI_CONTEXT_RESOURCE_ID); + eMsg->hdr.payloadSize = sizeof *eMsg + sizeof *ePayload - sizeof eMsg->hdr; + eMsg->eventData.event = attach ? VMCI_EVENT_QP_PEER_ATTACH : + VMCI_EVENT_QP_PEER_DETACH; + ePayload->peerId = contextId; + ePayload->handle = handle; + + return VMCIEvent_Dispatch((VMCIDatagram *)eMsg); +} diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmci/vmci_queue_pair.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vmci_queue_pair.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmci/vmci_queue_pair.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vmci_queue_pair.h 2008-10-13 08:01:41.000000000 +0100 @@ -0,0 +1,668 @@ +/********************************************************* + * Copyright (C) 2007 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +#ifndef _VMCI_QUEUE_PAIR_H_ +#define _VMCI_QUEUE_PAIR_H_ + +/* + * + * vmci_queue_pair.h -- + * + * Defines queue layout in memory, and helper functions to enqueue and + * dequeue items. XXX needs checksumming? + */ + +#define INCLUDE_ALLOW_MODULE +#define INCLUDE_ALLOW_VMX +#include "includeCheck.h" + +#include "vm_basic_defs.h" +#include "vm_basic_types.h" +#include "vm_atomic.h" +#include "vmci_defs.h" +#include "vm_assert.h" +#if defined(__linux__) && defined(__KERNEL__) +# include "vmci_kernel_if.h" +#endif + + +#if defined(__linux__) && defined(__KERNEL__) +struct page; +#endif + + +/* + * For a queue of buffer 'size' bytes, the tail and head pointers will be in + * the range [0, size-1]. + */ + +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; + +typedef struct VMCIQueue { + VMCIQueueHeader queueHeader; + uint8 _padding[PAGE_SIZE - sizeof(VMCIQueueHeader)]; +#if defined(__linux__) && defined(__KERNEL__) + struct page *page[0]; /* List of pages containing queue data. */ +#else + uint8 buffer[0]; /* Buffer containing data. */ +#endif +} VMCIQueue; + + +typedef int VMCIMemcpyToQueueFunc(VMCIQueue *queue, uint64 queueOffset, + const void *src, size_t srcOffset, + size_t size); +typedef int VMCIMemcpyFromQueueFunc(void *dest, size_t destOffset, + const VMCIQueue *queue, uint64 queueOffset, + size_t size); + +#if defined(__linux__) && defined(__KERNEL__) +int VMCIMemcpyToQueue(VMCIQueue *queue, uint64 queueOffset, const void *src, + size_t srcOffset, size_t size); +int VMCIMemcpyFromQueue(void *dest, size_t destOffset, const VMCIQueue *queue, + uint64 queueOffset, size_t size); +int VMCIMemcpyToQueueV(VMCIQueue *queue, uint64 queueOffset, const void *src, + size_t srcOffset, size_t size); +int VMCIMemcpyFromQueueV(void *dest, size_t destOffset, const VMCIQueue *queue, + uint64 queueOffset, size_t size); +#elif defined(_WIN32) && defined(WINNT_DDK) +int VMCIMemcpyToQueue(VMCIQueue *queue, uint64 queueOffset, const void *src, + size_t srcOffset, size_t size); +int VMCIMemcpyFromQueue(void *dest, size_t destOffset, const VMCIQueue *queue, + uint64 queueOffset, size_t size); +#else + + +/* + *----------------------------------------------------------------------------- + * + * VMCIMemcpyToQueue -- + * + * Wrapper for memcpy --- copies from a given buffer to a VMCI Queue. + * Assumes that offset + size does not wrap around in the queue. + * + * Results: + * Zero on success, negative error code on failure. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static INLINE int +VMCIMemcpyToQueue(VMCIQueue *queue, // OUT: + uint64 queueOffset, // IN: + const void *src, // IN: + size_t srcOffset, // IN: + size_t size) // IN: +{ + memcpy(queue->buffer + queueOffset, (uint8 *)src + srcOffset, size); + return 0; +} + + +/* + *----------------------------------------------------------------------------- + * + * VMCIMemcpyFromQueue -- + * + * Wrapper for memcpy --- copies to a given buffer from a VMCI Queue. + * Assumes that offset + size does not wrap around in the queue. + * + * Results: + * Zero on success, negative error code on failure. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static INLINE int +VMCIMemcpyFromQueue(void *dest, // OUT: + size_t destOffset, // IN: + const VMCIQueue *queue, // IN: + uint64 queueOffset, // IN: + size_t size) // IN: +{ + memcpy((uint8 *)dest + destOffset, queue->buffer + queueOffset, size); + return 0; +} +#endif /* __linux__ && __KERNEL__ */ + + +/* + * 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 +# define QP_MAX_QUEUE_SIZE_ARCH CONST64U(0xffffffff) +# define QPAtomic_ReadOffset(x) Atomic_Read32((Atomic_uint32 *)(x)) +# define QPAtomic_WriteOffset(x, y) \ + Atomic_Write32((Atomic_uint32 *)(x), (uint32)(y)) +#endif + + +/* + *----------------------------------------------------------------------------- + * + * VMCIQueue_CheckAlignment -- + * + * Checks if the given queue is aligned to page boundary. + * + * Results: + * TRUE or FALSE. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static INLINE Bool +VMCIQueue_CheckAlignment(const VMCIQueue *queue) // IN: +{ + return ((uintptr_t)queue & (PAGE_SIZE - 1)) == 0; +} + + +static INLINE void +VMCIQueue_GetPointers(const VMCIQueue *produceQ, + const VMCIQueue *consumeQ, + uint64 *producerTail, + uint64 *consumerHead) +{ + *producerTail = QPAtomic_ReadOffset(&produceQ->queueHeader.producerTail); + *consumerHead = QPAtomic_ReadOffset(&consumeQ->queueHeader.consumerHead); +} + + +/* + *----------------------------------------------------------------------------- + * + * VMCIQueue_ResetPointers -- + * + * Reset the tail pointer (of "this" queue) and the head pointer (of + * "peer" queue). + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static INLINE void +VMCIQueue_ResetPointers(VMCIQueue *queue) // IN: +{ + QPAtomic_WriteOffset(&queue->queueHeader.producerTail, CONST64U(0)); + QPAtomic_WriteOffset(&queue->queueHeader.consumerHead, CONST64U(0)); +} + + +/* + *----------------------------------------------------------------------------- + * + * VMCIQueue_Init -- + * + * Initializes a queue's state (head & tail pointers). + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static INLINE void +VMCIQueue_Init(const VMCIHandle handle, // IN: + VMCIQueue *queue) // IN: +{ + ASSERT_NOT_IMPLEMENTED(VMCIQueue_CheckAlignment(queue)); + queue->queueHeader.handle = handle; + VMCIQueue_ResetPointers(queue); +} + + +/* + *----------------------------------------------------------------------------- + * + * VMCIQueueFreeSpaceInt -- + * + * 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. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static INLINE int +VMCIQueueFreeSpaceInt(const VMCIQueue *produceQueue, // IN: + const VMCIQueue *consumeQueue, // IN: + const uint64 produceQSize, // IN: + uint64 *freeSpace) // OUT: +{ + const uint64 tail = + QPAtomic_ReadOffset(&produceQueue->queueHeader.producerTail); + const uint64 head = + QPAtomic_ReadOffset(&consumeQueue->queueHeader.consumerHead); + + ASSERT(freeSpace); + + 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 VMCI_SUCCESS; +} + + +/* + *----------------------------------------------------------------------------- + * + * VMCIQueue_FreeSpace -- + * + * Finds available free space in a produce queue to enqueue more data. + * + * Results: + * On success, free space size in bytes (up to MAX_INT64). + * On failure, appropriate error code. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static INLINE int64 +VMCIQueue_FreeSpace(const VMCIQueue *produceQueue, // IN: + const VMCIQueue *consumeQueue, // IN: + const uint64 produceQSize) // IN: +{ + uint64 freeSpace; + int retval; + + retval = VMCIQueueFreeSpaceInt(produceQueue, consumeQueue, produceQSize, + &freeSpace); + + if (retval != VMCI_SUCCESS) { + return retval; + } + + return MIN(freeSpace, MAX_INT64); +} + + +/* + *----------------------------------------------------------------------------- + * + * VMCIQueue_BufReady -- + * + * Finds available data to dequeue from a consume queue. + * + * Results: + * On success, available data size in bytes (up to MAX_INT64). + * On failure, appropriate error code. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static INLINE int64 +VMCIQueue_BufReady(const VMCIQueue *consumeQueue, // IN: + const VMCIQueue *produceQueue, // IN: + const uint64 consumeQSize) // IN: +{ + int retval; + uint64 freeSpace; + + retval = VMCIQueueFreeSpaceInt(consumeQueue, produceQueue, + consumeQSize, &freeSpace); + if (retval != VMCI_SUCCESS) { + return retval; + } else { + uint64 available = consumeQSize - freeSpace - 1; + return MIN(available, MAX_INT64); + } +} + + +/* + *----------------------------------------------------------------------------- + * + * AddPointer -- + * + * 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 +AddPointer(Atomic_uint64 *var, // IN: + size_t add, // IN: + uint64 max) // IN: +{ + uint64 newVal = QPAtomic_ReadOffset(var); + + if (newVal >= max - add) { + newVal -= max; + } + newVal += add; + + QPAtomic_WriteOffset(var, newVal); +} + + +/* + *----------------------------------------------------------------------------- + * + * __VMCIQueue_Enqueue -- + * + * Enqueues a given buffer to the produce queue using the provided + * function. As many bytes as possible (space available in the queue) + * are enqueued. + * + * Results: + * VMCI_ERROR_QUEUEPAIR_NOSPACE if no space was available to enqueue data. + * VMCI_ERROR_INVALID_SIZE, if any queue pointer is outside the queue + * (as defined by the queue size). + * Otherwise, the number of bytes written to the queue is returned. + * + * Side effects: + * Updates the tail pointer of the produce queue. + * + *----------------------------------------------------------------------------- + */ + +static INLINE ssize_t +__VMCIQueue_Enqueue(VMCIQueue *produceQueue, // IN: + const VMCIQueue *consumeQueue, // IN: + const uint64 produceQSize, // IN: + const void *buf, // IN: + size_t bufSize, // IN: + VMCIMemcpyToQueueFunc memcpyToQueue) // IN: +{ + const int64 freeSpace = VMCIQueue_FreeSpace(produceQueue, consumeQueue, + produceQSize); + const uint64 tail = + QPAtomic_ReadOffset(&produceQueue->queueHeader.producerTail); + size_t written; + + if (!freeSpace) { + return VMCI_ERROR_QUEUEPAIR_NOSPACE; + } + if (freeSpace < 0) { + return (ssize_t)freeSpace; + } + + written = (size_t)(freeSpace > bufSize ? bufSize : freeSpace); + if (LIKELY(tail + written < produceQSize)) { + memcpyToQueue(produceQueue, tail, buf, 0, written); + } else { + /* Tail pointer wraps around. */ + const size_t tmp = (size_t)(produceQSize - tail); + + memcpyToQueue(produceQueue, tail, buf, 0, tmp); + memcpyToQueue(produceQueue, 0, buf, tmp, written - tmp); + } + AddPointer(&produceQueue->queueHeader.producerTail, written, produceQSize); + return written; +} + + +/* + *----------------------------------------------------------------------------- + * + * VMCIQueue_Enqueue -- + * + * Enqueues a given buffer to the produce queue. As many bytes as possible + * (space available in the queue) are enqueued. If bufSize is larger than + * the maximum value of ssize_t the result is unspecified. + * + * Results: + * VMCI_ERROR_QUEUEPAIR_NOSPACE if no space was available to enqueue data. + * VMCI_ERROR_INVALID_SIZE, if any queue pointer is outside the queue + * (as defined by the queue size). + * Otherwise, the number of bytes written to the queue is returned. + * + * Side effects: + * Updates the tail pointer of the produce queue. + * + *----------------------------------------------------------------------------- + */ + +static INLINE ssize_t +VMCIQueue_Enqueue(VMCIQueue *produceQueue, // IN: + const VMCIQueue *consumeQueue, // IN: + const uint64 produceQSize, // IN: + const void *buf, // IN: + size_t bufSize) // IN: +{ + return __VMCIQueue_Enqueue(produceQueue, consumeQueue, produceQSize, + buf, bufSize, VMCIMemcpyToQueue); +} + + +#if defined(__linux__) && defined(__KERNEL__) +/* + *----------------------------------------------------------------------------- + * + * VMCIQueue_EnqueueV -- + * + * Enqueues a given iovec to the produce queue. As many bytes as possible + * (space available in the queue) are enqueued. If bufSize is larger than + * the maximum value of ssize_t the result is unspecified. + * + * Results: + * VMCI_ERROR_QUEUEPAIR_NOSPACE if no space was available to enqueue data. + * VMCI_ERROR_INVALID_SIZE, if any queue pointer is outside the queue + * (as defined by the queue size). + * Otherwise, the number of bytes written to the queue is returned. + * + * Side effects: + * Updates the tail pointer of the produce queue. + * + *----------------------------------------------------------------------------- + */ + +static INLINE ssize_t +VMCIQueue_EnqueueV(VMCIQueue *produceQueue, // IN: + const VMCIQueue *consumeQueue, // IN: + const uint64 produceQSize, // IN: + struct iovec *iov, // IN: + size_t iovSize) // IN: +{ + return __VMCIQueue_Enqueue(produceQueue, consumeQueue, produceQSize, + (void *)iov, iovSize, VMCIMemcpyToQueueV); +} +#endif + + +/* + *----------------------------------------------------------------------------- + * + * __VMCIQueue_Dequeue -- + * + * Dequeues data (if available) from the given consume queue. Writes data + * to the user provided buffer using the provided function. + * + * Results: + * VMCI_ERROR_QUEUEPAIR_NODATA if no data was available to dequeue. + * VMCI_ERROR_INVALID_SIZE, if any queue pointer is outside the queue + * (as defined by the queue size). + * Otherwise the number of bytes dequeued is returned. + * + * Side effects: + * Updates the head pointer of the consume queue. + * + *----------------------------------------------------------------------------- + */ + +static INLINE ssize_t +__VMCIQueue_Dequeue(VMCIQueue *produceQueue, // IN: + const VMCIQueue *consumeQueue, // IN: + const uint64 consumeQSize, // IN: + void *buf, // IN: + size_t bufSize, // IN: + VMCIMemcpyFromQueueFunc memcpyFromQueue) // IN: +{ + const int64 bufReady = VMCIQueue_BufReady(consumeQueue, produceQueue, + consumeQSize); + const uint64 head = + QPAtomic_ReadOffset(&produceQueue->queueHeader.consumerHead); + size_t written; + + if (!bufReady) { + return VMCI_ERROR_QUEUEPAIR_NODATA; + } + if (bufReady < 0) { + return (ssize_t)bufReady; + } + + written = (size_t)(bufReady > bufSize ? bufSize : bufReady); + if (LIKELY(head + written < consumeQSize)) { + memcpyFromQueue(buf, 0, consumeQueue, head, written); + } else { + /* Head pointer wraps around. */ + const size_t tmp = (size_t)(consumeQSize - head); + + memcpyFromQueue(buf, 0, consumeQueue, head, tmp); + memcpyFromQueue(buf, tmp, consumeQueue, 0, written - tmp); + } + AddPointer(&produceQueue->queueHeader.consumerHead, written, consumeQSize); + return written; +} + + +/* + *----------------------------------------------------------------------------- + * + * VMCIQueue_Dequeue -- + * + * Dequeues data (if available) from the given consume queue. Writes data + * to the user provided buffer. If bufSize is larger than the maximum + * value of ssize_t the result is unspecified. + * + * Results: + * VMCI_ERROR_QUEUEPAIR_NODATA if no data was available to dequeue. + * VMCI_ERROR_INVALID_SIZE, if any queue pointer is outside the queue + * (as defined by the queue size). + * Otherwise the number of bytes dequeued is returned. + * + * Side effects: + * Updates the head pointer of the consume queue. + * + *----------------------------------------------------------------------------- + */ + +static INLINE ssize_t +VMCIQueue_Dequeue(VMCIQueue *produceQueue, // IN: + const VMCIQueue *consumeQueue, // IN: + const uint64 consumeQSize, // IN: + void *buf, // IN: + size_t bufSize) // IN: +{ + return __VMCIQueue_Dequeue(produceQueue, consumeQueue, consumeQSize, + buf, bufSize, VMCIMemcpyFromQueue); +} + + +#if defined(__linux__) && defined(__KERNEL__) +/* + *----------------------------------------------------------------------------- + * + * VMCIQueue_DequeueV -- + * + * Dequeues data (if available) from the given consume queue. Writes data + * to the user provided iovec. If bufSize is larger than the maximum + * value of ssize_t the result is unspecified. + * + * Results: + * VMCI_ERROR_QUEUEPAIR_NODATA if no data was available to dequeue. + * VMCI_ERROR_INVALID_SIZE, if any queue pointer is outside the queue + * (as defined by the queue size). + * Otherwise the number of bytes dequeued is returned. + * + * Side effects: + * Updates the head pointer of the consume queue. + * + *----------------------------------------------------------------------------- + */ + +static INLINE ssize_t +VMCIQueue_DequeueV(VMCIQueue *produceQueue, // IN: + const VMCIQueue *consumeQueue, // IN: + const uint64 consumeQSize, // IN: + struct iovec *iov, // IN: + size_t iovSize) // IN: +{ + return __VMCIQueue_Dequeue(produceQueue, consumeQueue, consumeQSize, + (void *)iov, iovSize, VMCIMemcpyFromQueueV); +} +#endif + +#endif /* !_VMCI_QUEUE_PAIR_H_ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmci/vmciQueuePairInt.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vmciQueuePairInt.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmci/vmciQueuePairInt.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vmciQueuePairInt.h 2008-10-13 08:01:41.000000000 +0100 @@ -0,0 +1,34 @@ +/********************************************************* + * Copyright (C) 2007 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * vmciQueuePairInt.h -- + * + * Helper function declarations for VMCI QueuePair API. + */ + +#ifndef _VMCI_QUEUE_PAIR_INT_H_ +#define _VMCI_QUEUE_PAIR_INT_H_ + +#include "vmci_queue_pair.h" +#include "vmciGuestKernelAPI.h" + +void VMCIQueuePair_Init(void); +void VMCIQueuePair_Exit(void); + +#endif /* !_VMCI_QUEUE_PAIR_INT_H_ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmci/vmciUtil.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vmciUtil.c --- open-vm-tools-2008.01.23-74039/modules/linux/vmci/vmciUtil.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vmciUtil.c 2008-10-13 08:01:41.000000000 +0100 @@ -0,0 +1,538 @@ +/********************************************************* + * Copyright (C) 2006 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * vmciUtil.c + * + * Small utility function for allocating kernel memory and copying data. + * + */ + +#ifdef __linux__ +# include "driver-config.h" + +# define EXPORT_SYMTAB + +# include <linux/module.h> +# include <linux/module.h> +# include "compat_kernel.h" +# include "compat_slab.h" +# include "compat_wait.h" +# include "compat_interrupt.h" +#elif defined(_WIN32) +# ifndef WINNT_DDK +# error This file only works with the NT ddk +# endif // WINNT_DDK +# include <ntddk.h> +#elif defined(SOLARIS) +# include <sys/ddi.h> +# include <sys/sunddi.h> +# include <sys/disp.h> +#else +#error "platform not supported." +#endif //linux + +#define LGPFX "VMCIUtil: " + +#include "vmware.h" +#include "vm_atomic.h" +#include "vmci_defs.h" +#include "vmci_kernel_if.h" +#include "vmciGuestKernelIf.h" +#include "vmciInt.h" +#include "vmciProcess.h" +#include "vmciDatagram.h" +#include "vmciUtil.h" +#include "vmciEvent.h" + +static void VMCIUtilCidUpdate(VMCIId subID, VMCI_EventData *eventData, + void *clientData); + +static VMCIId ctxUpdateSubID = VMCI_INVALID_ID; +static Atomic_uint32 vmContextID = { VMCI_INVALID_ID }; + + +/* + *----------------------------------------------------------------------------- + * + * VMCIUtil_Init -- + * + * Subscribe to context id update event. + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +void +VMCIUtil_Init(void) +{ + /* + * We subscribe to the VMCI_EVENT_CTX_ID_UPDATE here so we can update the + * internal context id when needed. + */ + if (VMCIEvent_Subscribe(VMCI_EVENT_CTX_ID_UPDATE, VMCIUtilCidUpdate, NULL, + &ctxUpdateSubID) < VMCI_SUCCESS) { + VMCI_LOG(("VMCIUtil: Failed to subscribe to event %d.\n", + VMCI_EVENT_CTX_ID_UPDATE)); + } +} + + +/* + *----------------------------------------------------------------------------- + * + * VMCIUtil_Exit -- + * + * Cleanup + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +void +VMCIUtil_Exit(void) +{ + if (VMCIEvent_Unsubscribe(ctxUpdateSubID) < VMCI_SUCCESS) { + VMCI_LOG(("VMCIUtil: Failed to unsubscribe to event %d with subscriber " + "id %d.\n", VMCI_EVENT_CTX_ID_UPDATE, ctxUpdateSubID)); + } +} + + +/* + *----------------------------------------------------------------------------- + * + * VMCIUtilCidUpdate -- + * + * Gets called with the new context id if updated or resumed. + * + * Results: + * Context id. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static void +VMCIUtilCidUpdate(VMCIId subID, // IN: + VMCI_EventData *eventData, // IN: + void *clientData) // IN: +{ + VMCIEventPayload_Context *evPayload = VMCIEventDataPayload(eventData); + + if (subID != ctxUpdateSubID) { + VMCI_LOG(("VMCIUtil: Invalid subscriber id. %d.\n", subID)); + return; + } + if (eventData == NULL || evPayload->contextID == VMCI_INVALID_ID) { + VMCI_LOG(("VMCIUtil: Invalid event data.\n")); + return; + } + VMCI_LOG(("VMCIUtil: Updating context id from 0x%x to 0x%x on event %d.\n", + Atomic_Read(&vmContextID), + evPayload->contextID, + eventData->event)); + Atomic_Write(&vmContextID, evPayload->contextID); +} + + + +/* + *----------------------------------------------------------------------------- + * + * VMCIUtil_CheckHostCapabilities -- + * + * Verify that the host supports the hypercalls we need. If it does not, + * try to find fallback hypercalls and use those instead. + * + * Results: + * TRUE if required hypercalls (or fallback hypercalls) are + * supported by the host, FALSE otherwise. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +#define VMCI_UTIL_NUM_RESOURCES 1 + +Bool +VMCIUtil_CheckHostCapabilities(void) +{ + int result; + VMCIResourcesQueryMsg *msg; + uint32 msgSize = sizeof(VMCIResourcesQueryHdr) + + VMCI_UTIL_NUM_RESOURCES * sizeof(VMCI_Resource); + VMCIDatagram *checkMsg = VMCI_AllocKernelMem(msgSize, VMCI_MEMORY_NONPAGED); + + if (checkMsg == NULL) { + VMCI_LOG((LGPFX"Check host: Insufficient memory.\n")); + return FALSE; + } + + checkMsg->dst = VMCI_MAKE_HANDLE(VMCI_HYPERVISOR_CONTEXT_ID, + VMCI_RESOURCES_QUERY); + checkMsg->src = VMCI_ANON_SRC_HANDLE; + checkMsg->payloadSize = msgSize - VMCI_DG_HEADERSIZE; + msg = (VMCIResourcesQueryMsg *)VMCI_DG_PAYLOAD(checkMsg); + + msg->numResources = VMCI_UTIL_NUM_RESOURCES; + msg->resources[0] = VMCI_GET_CONTEXT_ID; + + result = VMCI_SendDatagram(checkMsg); + VMCI_FreeKernelMem(checkMsg, msgSize); + + /* We need the vector. There are no fallbacks. */ + return (result == 0x1); +} + + +/* + *----------------------------------------------------------------------------- + * + * VMCI_GetContextID -- + * + * Returns the context id. + * + * Results: + * Context id. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +#ifdef __linux__ +EXPORT_SYMBOL(VMCI_GetContextID); +#endif + +VMCIId +VMCI_GetContextID(void) +{ + if (Atomic_Read(&vmContextID) == VMCI_INVALID_ID) { + uint32 result; + VMCIDatagram getCidMsg; + getCidMsg.dst = VMCI_MAKE_HANDLE(VMCI_HYPERVISOR_CONTEXT_ID, + VMCI_GET_CONTEXT_ID); + getCidMsg.src = VMCI_ANON_SRC_HANDLE; + getCidMsg.payloadSize = 0; + result = VMCI_SendDatagram(&getCidMsg); + Atomic_Write(&vmContextID, result); + } + return Atomic_Read(&vmContextID); +} + + +/* + *----------------------------------------------------------------------------- + * + * VMCI_CheckHostCapabilities -- + * + * Tell host which guestcalls we support and let each API check + * that the host supports the hypercalls it needs. If a hypercall + * is not supported, the API can check for a fallback hypercall, + * or fail the check. + * + * Results: + * TRUE if successful, FALSE otherwise. + * + * Side effects: + * Fallback mechanisms may be enabled in the API and vmmon. + * + *----------------------------------------------------------------------------- + */ + +Bool +VMCI_CheckHostCapabilities(void) +{ + Bool result = VMCIEvent_CheckHostCapabilities(); + result &= VMCIProcess_CheckHostCapabilities(); + result &= VMCIDatagram_CheckHostCapabilities(); + result &= VMCIUtil_CheckHostCapabilities(); + + VMCI_LOG((LGPFX"Host capability check: %s\n", result ? "PASSED" : "FAILED")); + + return result; +} + +/* + *---------------------------------------------------------------------- + * + * VMCI_Version -- + * + * Returns the version of the VMCI guest driver. + * + * Results: + * Returns a version number. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +#ifdef __linux__ +EXPORT_SYMBOL(VMCI_Version); +#endif + +uint32 +VMCI_Version() +{ + return VMCI_VERSION_NUMBER; +} + + +/* + *---------------------------------------------------------------------- + * + * VMCI_InInterrupt -- + * + * Determines if we are running in tasklet/dispatch level or above. + * + * Results: + * TRUE if tasklet/dispatch or above, FALSE otherwise. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +Bool +VMCI_InInterrupt() +{ +#if defined(_WIN32) + return KeGetCurrentIrql() >= DISPATCH_LEVEL; +#elif defined(__linux__) + return in_interrupt(); +#elif defined(SOLARIS) + return servicing_interrupt(); /* servicing_interrupt is not part of DDI. */ +#endif // +} + + +/* + *---------------------------------------------------------------------- + * + * VMCI_DeviceGet -- + * + * Verifies that a valid VMCI device is present, and indicates + * the callers intention to use the device until it calls + * VMCI_DeviceRelease(). + * + * Results: + * TRUE if a valid VMCI device is present, FALSE otherwise. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +#ifdef __linux__ +EXPORT_SYMBOL(VMCI_DeviceGet); +#endif + +Bool +VMCI_DeviceGet(void) +{ + return VMCI_DeviceEnabled(); +} + + +/* + *---------------------------------------------------------------------- + * + * VMCI_DeviceRelease -- + * + * Indicates that the caller is done using the VMCI device. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +#ifdef __linux__ +EXPORT_SYMBOL(VMCI_DeviceRelease); +#endif + +void +VMCI_DeviceRelease(void) +{ +} + + +/* + *---------------------------------------------------------------------- + * + * VMCI_ReadDatagramsFromPort -- + * + * Reads datagrams from the data in port and dispatches them. We + * always start reading datagrams into only the first page of the + * datagram buffer. If the datagrams don't fit into one page, we + * use the maximum datagram buffer size for the remainder of the + * invocation. This is a simple heuristic for not penalizing + * small datagrams. + * + * This function assumes that it has exclusive access to the data + * in port for the duration of the call. + * + * Results: + * No result. + * + * Side effects: + * Datagram handlers may be invoked. + * + *---------------------------------------------------------------------- + */ + +void +VMCI_ReadDatagramsFromPort(VMCIIoHandle ioHandle, // IN + VMCIIoPort dgInPort, // IN + uint8 *dgInBuffer, // IN + size_t dgInBufferSize) // IN +{ + VMCIDatagram *dg; + size_t currentDgInBufferSize = PAGE_SIZE; + size_t remainingBytes; + + ASSERT(dgInBufferSize >= PAGE_SIZE); + + VMCI_ReadPortBytes(ioHandle, dgInPort, dgInBuffer, currentDgInBufferSize); + dg = (VMCIDatagram *)dgInBuffer; + remainingBytes = currentDgInBufferSize; + + while (dg->dst.resource != VMCI_ERROR_INVALID_RESOURCE || remainingBytes > PAGE_SIZE) { + unsigned dgInSize; + + /* + * When the input buffer spans multiple pages, a datagram can + * start on any page boundary in the buffer. + */ + + if (dg->dst.resource == VMCI_ERROR_INVALID_RESOURCE) { + ASSERT(remainingBytes > PAGE_SIZE); + dg = (VMCIDatagram *)ROUNDUP((uintptr_t)dg + 1, PAGE_SIZE); + ASSERT((uint8 *)dg < dgInBuffer + currentDgInBufferSize); + remainingBytes = (size_t)(dgInBuffer + currentDgInBufferSize - (uint8 *)dg); + continue; + } + + dgInSize = VMCI_DG_SIZE_ALIGNED(dg); + + if (dgInSize <= dgInBufferSize) { + int result; + + /* + * If the remaining bytes in the datagram buffer doesn't + * contain the complete datagram, we first make sure we have + * enough room for it and then we read the reminder of the + * datagram and possibly any following datagrams. + */ + + if (dgInSize > remainingBytes) { + + if (remainingBytes != currentDgInBufferSize) { + + /* + * We move the partial datagram to the front and read + * the reminder of the datagram and possibly following + * calls into the following bytes. + */ + + memmove(dgInBuffer, dgInBuffer + currentDgInBufferSize - remainingBytes, + remainingBytes); + + dg = (VMCIDatagram *)dgInBuffer; + } + + if (currentDgInBufferSize != dgInBufferSize) { + currentDgInBufferSize = dgInBufferSize; + } + + VMCI_ReadPortBytes(ioHandle, dgInPort, dgInBuffer + remainingBytes, + currentDgInBufferSize - remainingBytes); + } + + /* We special case event datagrams from the hypervisor. */ + if (dg->src.context == VMCI_HYPERVISOR_CONTEXT_ID && + dg->dst.resource == VMCI_EVENT_HANDLER) { + result = VMCIEvent_Dispatch(dg); + } else { + result = VMCIDatagram_Dispatch(dg->src.context, dg); + } + if (result < VMCI_SUCCESS) { + VMCI_LOG(("Datagram with resource %d failed with err %x.\n", + dg->dst.resource, result)); + } + + /* On to the next datagram. */ + dg = (VMCIDatagram *)((uint8 *)dg + dgInSize); + } else { + size_t bytesToSkip; + + /* + * Datagram doesn't fit in datagram buffer of maximal size. We drop it. + */ + + VMCI_LOG(("Failed to receive datagram of size %u.\n", + dgInSize)); + + bytesToSkip = dgInSize - remainingBytes; + if (currentDgInBufferSize != dgInBufferSize) { + currentDgInBufferSize = dgInBufferSize; + } + for (;;) { + VMCI_ReadPortBytes(ioHandle, dgInPort, dgInBuffer, currentDgInBufferSize); + if (bytesToSkip <= currentDgInBufferSize) { + break; + } + bytesToSkip -= currentDgInBufferSize; + } + dg = (VMCIDatagram *)(dgInBuffer + bytesToSkip); + } + + remainingBytes = (size_t) (dgInBuffer + currentDgInBufferSize - (uint8 *)dg); + + if (remainingBytes < VMCI_DG_HEADERSIZE) { + /* Get the next batch of datagrams. */ + + VMCI_ReadPortBytes(ioHandle, dgInPort, dgInBuffer, currentDgInBufferSize); + dg = (VMCIDatagram *)dgInBuffer; + remainingBytes = currentDgInBufferSize; + } + } +} diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmci/vmciUtil.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vmciUtil.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmci/vmciUtil.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vmciUtil.h 2008-10-13 08:01:41.000000000 +0100 @@ -0,0 +1,53 @@ +/********************************************************* + * Copyright (C) 2006 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * vmciUtil.h -- + * + * Helper functions. + */ + +#ifndef __VMCI_UTIL_H__ +#define __VMCI_UTIL_H__ + +#define INCLUDE_ALLOW_MODULE +#include "includeCheck.h" + +#include "vmciGuestKernelIf.h" +#include "vmci_infrastructure.h" +#include "vmciGuestKernelAPI.h" + +#define VMCI_MAJOR_VERSION_NUMBER 1 +#define VMCI_MINOR_VERSION_NUMBER 0 +#define VMCI_VERSION_NUMBER \ + ((VMCI_MAJOR_VERSION_NUMBER << 16) | (VMCI_MINOR_VERSION_NUMBER)) + +typedef struct VMCIGuestDeviceHandle { + void *obj; + VMCIObjType objType; +} VMCIGuestDeviceHandle; + +void VMCIUtil_Init(void); +void VMCIUtil_Exit(void); +Bool VMCIUtil_CheckHostCapabilities(void); +Bool VMCI_CheckHostCapabilities(void); +Bool VMCI_InInterrupt(void); +void VMCI_ReadDatagramsFromPort(VMCIIoHandle ioHandle, VMCIIoPort dgInPort, + uint8 *dgInBuffer, size_t dgInBufferSize); + +#endif //__VMCI_UTIL_H__ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmci/vmci_version.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vmci_version.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmci/vmci_version.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vmci_version.h 2008-10-13 08:01:41.000000000 +0100 @@ -0,0 +1,32 @@ +/********************************************************* + * Copyright (C) 2007 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * vmci_version.h -- + * + * Version definitions for the Linux vmci driver. + */ + +#ifndef _VMCI_VERSION_H_ +#define _VMCI_VERSION_H_ + +#define VMCI_DRIVER_VERSION 1.0.15.0 +#define VMCI_DRIVER_VERSION_COMMAS 1,0,15,0 +#define VMCI_DRIVER_VERSION_STRING "1.0.15.0" + +#endif /* _VMCI_VERSION_H_ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmci/vm_device_version.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vm_device_version.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmci/vm_device_version.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vm_device_version.h 2008-10-13 08:01:41.000000000 +0100 @@ -0,0 +1,188 @@ +/********************************************************* + * Copyright (C) 1998 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +#ifndef VM_DEVICE_VERSION_H +#define VM_DEVICE_VERSION_H + +#define INCLUDE_ALLOW_USERLEVEL +#define INCLUDE_ALLOW_VMMEXT +#define INCLUDE_ALLOW_MODULE +#define INCLUDE_ALLOW_VMKERNEL +#define INCLUDE_ALLOW_VMCORE +#include "includeCheck.h" + +#ifdef _WIN32 +#include "guiddef.h" +#endif + +/* Our own PCI IDs + * VMware SVGA II (Unified VGA) + * VMware SVGA (PCI Accelerator) + * VMware vmxnet (Idealized NIC) + * VMware vmxscsi (Abortive idealized SCSI controller) + * VMware chipset (Subsystem ID for our motherboards) + * VMware e1000 (Subsystem ID) + * VMware vmxnet3 (Uniform Pass Through NIC) + */ +#define PCI_VENDOR_ID_VMWARE 0x15AD +#define PCI_DEVICE_ID_VMWARE_SVGA2 0x0405 +#define PCI_DEVICE_ID_VMWARE_SVGA 0x0710 +#define PCI_DEVICE_ID_VMWARE_NET 0x0720 +#define PCI_DEVICE_ID_VMWARE_SCSI 0x0730 +#define PCI_DEVICE_ID_VMWARE_VMCI 0x0740 +#define PCI_DEVICE_ID_VMWARE_CHIPSET 0x1976 +#define PCI_DEVICE_ID_VMWARE_82545EM 0x0750 /* single port */ +#define PCI_DEVICE_ID_VMWARE_82546EB 0x0760 /* dual port */ +#define PCI_DEVICE_ID_VMWARE_EHCI 0x0770 +#define PCI_DEVICE_ID_VMWARE_1394 0x0780 +#define PCI_DEVICE_ID_VMWARE_BRIDGE 0x0790 +#define PCI_DEVICE_ID_VMWARE_ROOTPORT 0x07A0 +#define PCI_DEVICE_ID_VMWARE_VMXNET3 0x07B0 +#define PCI_DEVICE_ID_VMWARE_PVSCSI 0x07C0 + +/* The hypervisor device might grow. Please leave room + * for 7 more subfunctions. + */ +#define PCI_DEVICE_ID_VMWARE_HYPER 0x0800 +#define PCI_DEVICE_ID_VMWARE_VMI 0x0801 + +#define PCI_DEVICE_VMI_CLASS 0x05 +#define PCI_DEVICE_VMI_SUBCLASS 0x80 +#define PCI_DEVICE_VMI_INTERFACE 0x00 +#define PCI_DEVICE_VMI_REVISION 0x01 + +/* From linux/pci_ids.h: + * AMD Lance Ethernet controller + * BusLogic SCSI controller + * Ensoniq ES1371 sound controller + */ +#define PCI_VENDOR_ID_AMD 0x1022 +#define PCI_DEVICE_ID_AMD_VLANCE 0x2000 +#define PCI_VENDOR_ID_BUSLOGIC 0x104B +#define PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER_NC 0x0140 +#define PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER 0x1040 +#define PCI_VENDOR_ID_ENSONIQ 0x1274 +#define PCI_DEVICE_ID_ENSONIQ_ES1371 0x1371 + +/* From linux/pci_ids.h: + * Intel 82439TX (430 HX North Bridge) + * Intel 82371AB (PIIX4 South Bridge) + * Intel 82443BX (440 BX North Bridge and AGP Bridge) + * Intel 82545EM (e1000, server adapter, single port) + * Intel 82546EB (e1000, server adapter, dual port) + * Intel ICH7_16 (Hight Definition Audio controller) + */ +#define PCI_VENDOR_ID_INTEL 0x8086 +#define PCI_DEVICE_ID_INTEL_82439TX 0x7100 +#define PCI_DEVICE_ID_INTEL_82371AB_0 0x7110 +#define PCI_DEVICE_ID_INTEL_82371AB_2 0x7112 +#define PCI_DEVICE_ID_INTEL_82371AB_3 0x7113 +#define PCI_DEVICE_ID_INTEL_82371AB 0x7111 +#define PCI_DEVICE_ID_INTEL_82443BX 0x7190 +#define PCI_DEVICE_ID_INTEL_82443BX_1 0x7191 +#define PCI_DEVICE_ID_INTEL_82443BX_2 0x7192 /* Used when no AGP support */ +#define PCI_DEVICE_ID_INTEL_82545EM 0x100f +#define PCI_DEVICE_ID_INTEL_82546EB 0x1010 +#define PCI_DEVICE_ID_INTEL_ICH7_16 0x27d8 + + +/************* Strings for IDE Identity Fields **************************/ +#define VIDE_ID_SERIAL_STR "00000000000000000001" /* Must be 20 Bytes */ +#define VIDE_ID_FIRMWARE_STR "00000001" /* Must be 8 Bytes */ + +/* No longer than 40 Bytes */ +#define VIDE_ATA_MODEL_STR PRODUCT_GENERIC_NAME " Virtual IDE Hard Drive" +#define VIDE_ATAPI_MODEL_STR PRODUCT_GENERIC_NAME " Virtual IDE CDROM Drive" + +#define ATAPI_VENDOR_ID "NECVMWar" /* Must be 8 Bytes */ +#define ATAPI_PRODUCT_ID PRODUCT_GENERIC_NAME " IDE CDROM" /* Must be 16 Bytes */ +#define ATAPI_REV_LEVEL "1.00" /* Must be 4 Bytes */ + +#define IDE_NUM_INTERFACES 2 /* support for two interfaces */ +#define IDE_DRIVES_PER_IF 2 + +/************* Strings for SCSI Identity Fields **************************/ +#define SCSI_DISK_MODEL_STR PRODUCT_GENERIC_NAME " Virtual SCSI Hard Drive" +#define SCSI_DISK_VENDOR_NAME COMPANY_NAME +#define SCSI_DISK_REV_LEVEL "1.0" +#define SCSI_CDROM_MODEL_STR PRODUCT_GENERIC_NAME " Virtual SCSI CDROM Drive" +#define SCSI_CDROM_VENDOR_NAME COMPANY_NAME +#define SCSI_CDROM_REV_LEVEL "1.0" + +/************* SCSI implementation limits ********************************/ +#define SCSI_MAX_CONTROLLERS 4 // Need more than 1 for MSCS clustering +#define SCSI_MAX_DEVICES 16 // BT-958 emulates only 16 +#define SCSI_IDE_CHANNEL SCSI_MAX_CONTROLLERS +#define SCSI_IDE_HOSTED_CHANNEL (SCSI_MAX_CONTROLLERS + 1) +#define SCSI_MAX_CHANNELS (SCSI_MAX_CONTROLLERS + 2) + +/************* Strings for the VESA BIOS Identity Fields *****************/ +#define VBE_OEM_STRING COMPANY_NAME " SVGA" +#define VBE_VENDOR_NAME COMPANY_NAME +#define VBE_PRODUCT_NAME PRODUCT_GENERIC_NAME + +/************* PCI implementation limits ********************************/ +#define PCI_MAX_BRIDGES 15 + +/************* Ethernet implementation limits ***************************/ +#define MAX_ETHERNET_CARDS 10 + +/************* PCI Passthrough implementation limits ********************/ +#define MAX_PCI_PASSTHRU_DEVICES 2 + +/************* USB implementation limits ********************************/ +#define MAX_USB_DEVICES_PER_HOST_CONTROLLER 127 + +/************* Strings for Host USB Driver *******************************/ + +#ifdef _WIN32 + +/* + * Globally unique ID for the VMware device interface. Define INITGUID before including + * this header file to instantiate the variable. + */ +DEFINE_GUID(GUID_DEVICE_INTERFACE_VMWARE_USB_DEVICES, +0x2da1fe75, 0xaab3, 0x4d2c, 0xac, 0xdf, 0x39, 0x8, 0x8c, 0xad, 0xa6, 0x65); + +/* + * Globally unique ID for the VMware device setup class. + */ +DEFINE_GUID(GUID_CLASS_VMWARE_USB_DEVICES, +0x3b3e62a5, 0x3556, 0x4d7e, 0xad, 0xad, 0xf5, 0xfa, 0x3a, 0x71, 0x2b, 0x56); + +/* + * This string defines the device ID string of a VMware USB device. + * The format is USB\Vid_XXXX&Pid_YYYY, where XXXX and YYYY are the + * hexadecimal representations of the vendor and product ids, respectively. + * + * The official vendor ID for VMware, Inc. is 0x0E0F. + * The product id for USB generic devices is 0x0001. + */ +#define USB_VMWARE_DEVICE_ID_WIDE L"USB\\Vid_0E0F&Pid_0001" +#define USB_DEVICE_ID_LENGTH (sizeof(USB_VMWARE_DEVICE_ID_WIDE) / sizeof(WCHAR)) + +#ifdef UNICODE +#define USB_PNP_SETUP_CLASS_NAME L"VMwareUSBDevices" +#define USB_PNP_DRIVER_NAME L"vmusb" +#else +#define USB_PNP_SETUP_CLASS_NAME "VMwareUSBDevices" +#define USB_PNP_DRIVER_NAME "vmusb" +#endif +#endif + +#endif /* VM_DEVICE_VERSION_H */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmci/vmware.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vmware.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmci/vmware.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vmware.h 2008-10-13 08:01:41.000000000 +0100 @@ -0,0 +1,58 @@ +/********************************************************* + * Copyright (C) 2003 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * vmware.h -- + * + * Standard include file for VMware source code. + */ + +#ifndef _VMWARE_H_ +#define _VMWARE_H_ + +#define INCLUDE_ALLOW_USERLEVEL +#define INCLUDE_ALLOW_VMCORE +#define INCLUDE_ALLOW_MODULE +#define INCLUDE_ALLOW_VMMON +#define INCLUDE_ALLOW_VMNIXMOD +#define INCLUDE_ALLOW_VMKERNEL +#define INCLUDE_ALLOW_VMK_MODULE +#define INCLUDE_ALLOW_DISTRIBUTE +#include "includeCheck.h" + +#include "vm_basic_types.h" +#include "vm_basic_defs.h" +#include "vm_assert.h" + +/* + * Global error codes. Currently used internally, but may be exported + * to customers one day, like VM_E_XXX in vmcontrol_constants.h + */ + +typedef enum VMwareStatus { + VMWARE_STATUS_SUCCESS, /* success */ + VMWARE_STATUS_ERROR, /* generic error */ + VMWARE_STATUS_NOMEM, /* generic memory allocation error */ + VMWARE_STATUS_INSUFFICIENT_RESOURCES, /* internal or system resource limit exceeded */ + VMWARE_STATUS_INVALID_ARGS /* invalid arguments */ +} VMwareStatus; + +#define VMWARE_SUCCESS(s) ((s) == VMWARE_STATUS_SUCCESS) + + +#endif // ifndef _VMWARE_H_ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmci/vmware_pack_begin.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vmware_pack_begin.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmci/vmware_pack_begin.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vmware_pack_begin.h 2008-10-13 08:01:41.000000000 +0100 @@ -0,0 +1,43 @@ +/********************************************************* + * Copyright (C) 2002 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * 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 diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmci/vmware_pack_end.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vmware_pack_end.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmci/vmware_pack_end.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vmware_pack_end.h 2008-10-13 08:01:41.000000000 +0100 @@ -0,0 +1,44 @@ +/********************************************************* + * Copyright (C) 2002 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * vmware_pack_end.h -- + * + * End 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(pop) +#elif __GNUC__ +__attribute__((__packed__)) +#else +# error Compiler packing... +#endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmci/vmware_pack_init.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vmware_pack_init.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmci/vmware_pack_init.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmci/vmware_pack_init.h 2008-10-13 08:01:41.000000000 +0100 @@ -0,0 +1,65 @@ +/********************************************************* + * Copyright (C) 2002 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +#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__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/autoconf/cachector1.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/autoconf/cachector1.c --- open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/autoconf/cachector1.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/autoconf/cachector1.c 2008-10-13 08:01:42.000000000 +0100 @@ -0,0 +1,38 @@ +/********************************************************* + * Copyright (C) 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 General Public License as published by the + * Free Software Foundation version 2 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 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 + * + *********************************************************/ + +#include <linux/autoconf.h> +#include <linux/version.h> + +/* + * Between 2.6.27-rc1 and 2.6.27-rc2 ctor prototype was changed from + * ctor(cache, ptr) to ctor(ptr). Unfortunately there + * is no typedef for ctor, so we have to redefine kmem_cache_create + * to find out ctor prototype. If prototype matches, then this is old + * kernel. + */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28) +#error "This test intentionally fails on 2.6.28 and newer kernels." +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26) +#include <linux/slab.h> + +struct kmem_cache *kmem_cache_create(const char *, size_t, size_t, + unsigned long, + void (*)(struct kmem_cache *, void *)); + +#endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/backdoor_def.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/backdoor_def.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/backdoor_def.h 2008-01-28 08:02:46.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/backdoor_def.h 2008-10-13 08:01:42.000000000 +0100 @@ -79,7 +79,7 @@ #define BDOOR_CMD_GETUUID 19 #define BDOOR_CMD_GETMEMSIZE 20 #define BDOOR_CMD_HOSTCOPY 21 /* Devel only */ -/* BDOOR_CMD_GETOS2INTCURSOR, 22, is very old and defunct. Reuse. */ +#define BDOOR_CMD_SERVICE_VM 22 /* prototype only */ #define BDOOR_CMD_GETTIME 23 /* Deprecated. Use GETTIMEFULL. */ #define BDOOR_CMD_STOPCATCHUP 24 #define BDOOR_CMD_PUTCHR 25 /* Devel only */ @@ -109,7 +109,12 @@ #define BDOOR_CMD_CHECKFORCEBIOSSETUP 48 #define BDOOR_CMD_LAZYTIMEREMULATION 49 #define BDOOR_CMD_BIOSBBS 50 -#define BDOOR_CMD_MAX 51 +#define BDOOR_CMD_VASSERT 51 +#define BDOOR_CMD_ISGOSDARWIN 52 +#define BDOOR_CMD_DEBUGEVENT 53 +#define BDOOR_CMD_OSNOTMACOSXSERVER 54 +#define BDOOR_CMD_GETTIMEFULL_WITH_LAG 55 +#define BDOOR_CMD_MAX 56 /* * IMPORTANT NOTE: When modifying the behavior of an existing backdoor command, @@ -123,7 +128,8 @@ #define BDOORHB_PORT 0x5659 #define BDOORHB_CMD_MESSAGE 0 -#define BDOORHB_CMD_MAX 1 +#define BDOORHB_CMD_VASSERT 1 +#define BDOORHB_CMD_MAX 2 /* * There is another backdoor which allows access to certain TSC-related diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/bdhandler.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/bdhandler.c --- open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/bdhandler.c 2008-01-28 08:02:46.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/bdhandler.c 2008-10-13 08:01:42.000000000 +0100 @@ -26,17 +26,19 @@ #include "driver-config.h" #include <asm/atomic.h> -#include <asm/semaphore.h> #include <linux/errno.h> -#include <linux/timer.h> #include "compat_completion.h" #include "compat_kernel.h" +#include "compat_kthread.h" #include "compat_list.h" #include "compat_sched.h" +#include "compat_semaphore.h" #include "compat_slab.h" #include "compat_spinlock.h" #include "compat_version.h" +/* Must be included after semaphore.h. */ +#include <linux/timer.h> /* Must be included after sched.h. */ #include <linux/smp_lock.h> @@ -105,7 +107,7 @@ *---------------------------------------------------------------------- */ -static inline void +static inline void HgfsCompleteReq(HgfsReq *req, // IN: Request char const *reply, // IN: Reply packet size_t replySize) // IN: Size of reply packet @@ -116,7 +118,7 @@ req->payloadSize = replySize; req->state = HGFS_REQ_STATE_COMPLETED; list_del_init(&req->list); - HgfsWakeWaitingClient(req); + HgfsWakeWaitingClient(req); } @@ -148,7 +150,7 @@ list_for_each_safe(cur, tmp, &hgfsReqsUnsent) { req = list_entry(cur, HgfsReq, list); - /* + /* * A big "wtf" from the driver is in order. Perhaps by "wtf" I really * mean BUG_ON(). */ @@ -164,9 +166,9 @@ LOG(8, (KERN_DEBUG "VMware hgfs: HgfsSendUnsentReqs: Sending packet " "over backdoor\n")); - /* - * We should attempt to reopen the backdoor channel with every request, - * because the HGFS server in the host can be enabled or disabled at any + /* + * We should attempt to reopen the backdoor channel with every request, + * because the HGFS server in the host can be enabled or disabled at any * time. */ if (!HgfsBd_OpenBackdoor(&hgfsRpcOut)) { @@ -182,7 +184,7 @@ LOG(8, (KERN_DEBUG "VMware hgfs: HgfsSendUnsentReqs: Backdoor " "reply received\n")); } else { - + /* Pass the error into the request. */ req->state = HGFS_REQ_STATE_ERROR; list_del_init(&req->list); @@ -225,11 +227,21 @@ void HgfsResetOps(void) { - atomic_set(&hgfsVersionOpen, HGFS_OP_OPEN_V2); - atomic_set(&hgfsVersionGetattr, HGFS_OP_GETATTR_V2); - atomic_set(&hgfsVersionSetattr, HGFS_OP_SETATTR_V2); - atomic_set(&hgfsVersionSearchRead, HGFS_OP_SEARCH_READ_V2); - atomic_set(&hgfsVersionCreateDir, HGFS_OP_CREATE_DIR_V2); + atomic_set(&hgfsVersionOpen, HGFS_OP_OPEN_V3); + atomic_set(&hgfsVersionRead, HGFS_OP_READ_V3); + atomic_set(&hgfsVersionWrite, HGFS_OP_WRITE_V3); + atomic_set(&hgfsVersionClose, HGFS_OP_CLOSE_V3); + atomic_set(&hgfsVersionSearchOpen, HGFS_OP_SEARCH_OPEN_V3); + atomic_set(&hgfsVersionSearchRead, HGFS_OP_SEARCH_READ_V3); + atomic_set(&hgfsVersionSearchClose, HGFS_OP_SEARCH_CLOSE_V3); + atomic_set(&hgfsVersionGetattr, HGFS_OP_GETATTR_V3); + atomic_set(&hgfsVersionSetattr, HGFS_OP_SETATTR_V3); + atomic_set(&hgfsVersionCreateDir, HGFS_OP_CREATE_DIR_V3); + atomic_set(&hgfsVersionDeleteFile, HGFS_OP_DELETE_FILE_V3); + atomic_set(&hgfsVersionDeleteDir, HGFS_OP_DELETE_DIR_V3); + atomic_set(&hgfsVersionRename, HGFS_OP_RENAME_V3); + atomic_set(&hgfsVersionQueryVolumeInfo, HGFS_OP_QUERY_VOLUME_INFO_V3); + atomic_set(&hgfsVersionCreateSymlink, HGFS_OP_CREATE_SYMLINK_V3); } @@ -242,6 +254,9 @@ * the filesystem half of the driver, send them over the backdoor, * get replies, and send them back to the filesystem. * + * Note that this function is called out of the kthread subsystem or, in + * older kernels, a similar abstraction built in compat_kthread.h. + * * Results: * Always returns zero. * @@ -251,28 +266,26 @@ *---------------------------------------------------------------------- */ -int -HgfsBdHandler(void *data) +int +HgfsBdHandler(void *data) // Ignored { LOG(6, (KERN_DEBUG "VMware hgfs: HgfsBdHandler: Thread starting\n")); - compat_daemonize(HGFS_NAME); compat_set_freezable(); for (;;) { - /* Sleep, waiting for a request, a poll time, or exit. */ + /* Sleep, waiting for a request or exit. */ wait_event_interruptible(hgfsReqThreadWait, - test_bit(HGFS_REQ_THREAD_SEND, + test_bit(HGFS_REQ_THREAD_SEND, &hgfsReqThreadFlags) || - test_bit(HGFS_REQ_THREAD_EXIT, - &hgfsReqThreadFlags)); - - /* + compat_kthread_should_stop()); + + /* * First, check for suspend. I'm not convinced that this actually * has to come first, but whatever. */ if (compat_try_to_freeze()) { - LOG(6, (KERN_DEBUG + LOG(6, (KERN_DEBUG "VMware hgfs: HgfsBdHandler: Closing backdoor after resume\n")); HgfsBd_CloseBackdoor(&hgfsRpcOut); } @@ -284,7 +297,7 @@ } /* Kill yourself. */ - if (test_and_clear_bit(HGFS_REQ_THREAD_EXIT, &hgfsReqThreadFlags)) { + if (compat_kthread_should_stop()) { LOG(6, (KERN_DEBUG "VMware hgfs: HgfsBdHandler: Told to exit\n")); break; } @@ -293,8 +306,6 @@ LOG(6, (KERN_DEBUG "VMware hgfs: HgfsBdHandler: Closing backdoor\n")); HgfsBd_CloseBackdoor(&hgfsRpcOut); - /* Signal our parent that we're exiting, and exit, all at once. */ LOG(6, (KERN_DEBUG "VMware hgfs: HgfsBdHandler: Thread exiting\n")); - compat_complete_and_exit(&hgfsReqThreadDone, 0); - NOT_REACHED(); + return 0; } diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/compat_fs.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/compat_fs.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/compat_fs.h 2008-01-28 08:02:46.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/compat_fs.h 2008-10-13 08:01:43.000000000 +0100 @@ -80,8 +80,8 @@ * * The VFS exports do_sync_read() and do_sync_write() as the "new" * generic_file_read() and generic_file_write(), but filesystems need not - * actually implement read and write- the VFS will automatically call - * do_sync_write() and do_sync_read() when applications invoke the standard + * actually implement read and write- the VFS will automatically call + * do_sync_write() and do_sync_read() when applications invoke the standard * read() and write() system calls. * * In 2.6.19, generic_file_read() and generic_file_write() were removed, @@ -104,6 +104,14 @@ /* + * iget() was removed from the VFS as of 2.6.25-rc1. The replacement for iget() + * is iget_locked() which was added in 2.5.17. + */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 17) +# define VMW_USE_IGET_LOCKED +#endif + +/* * parent_ino was born in 2.5.5. For older kernels, let's use 2.5.5 * implementation. It uses the dcache lock which is OK because per-dentry * locking appeared after 2.5.5. diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/compat_kernel.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/compat_kernel.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/compat_kernel.h 2008-01-28 08:02:46.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/compat_kernel.h 2008-10-13 08:01:43.000000000 +0100 @@ -72,5 +72,12 @@ #endif +/* + * vsnprintf became available in 2.4.10. For older kernels, just fall back on + * vsprintf. + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 10) +#define vsnprintf(str, size, fmt, args) vsprintf(str, fmt, args) +#endif #endif /* __COMPAT_KERNEL_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/compat_kthread.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/compat_kthread.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/compat_kthread.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/compat_kthread.h 2008-10-13 08:01:43.000000000 +0100 @@ -0,0 +1,223 @@ +/********************************************************* + * Copyright (C) 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 General Public License as published by the + * Free Software Foundation version 2 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 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 + * + *********************************************************/ + +#ifndef __COMPAT_KTHREAD_H__ +# define __COMPAT_KTHREAD_H__ + +/* + * The kthread interface for managing kernel threads appeared in 2.6.4, but was + * only exported for module use in 2.6.7. + */ + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 7) +# include <linux/kthread.h> + +# define COMPAT_KTHREAD_DECLARE_STOP_INFO() +# define compat_kthread_stop(_tsk) kthread_stop(_tsk) +# define compat_kthread_should_stop() kthread_should_stop() +# define compat_kthread_run(_fn, _data, _namefmt, ...) \ + kthread_run(_fn, _data, _namefmt, ## __VA_ARGS__) +# define compat_kthread_create(_fn, _data, _namefmt, ...) \ + kthread_create(_fn, _data, _namefmt, ## __VA_ARGS__) +#else + +/* + * When the kthread interface isn't available, we do our best to emulate it, + * with a few notable exceptions: + * + * 1: We use semaphores instead of mutexes for locking, because mutexes aren't + * available in kernels where kthread isn't available. + * 2: The real kthread interface uses the kthreadd kernel_thread to broker the + * creation of new kernel threads. This makes sense because kthreadd is part + * of the kernel, but doesn't make sense at all in the context of an + * individual module. So in our emulation, thread creation occurs in the + * context of a kthread_create call. + * 3: Because kthreadd is responsible for creating kernel threads in the real + * kthread interface, there's no need to explicitly reparent any of them. We + * aren't using kthreadd, so we call daemonize to reparent, which also sets + * the name of the new kernel thread. That's why we don't set the name as + * the real kthread interface does (within kthread_create). Furthermore, to + * get the name to daemonize, we're forced to pass it through the + * kthread_start_info struct. + * 4: Since our interface isn't in the kernel proper, we can't make use of + * get_task_struct/put_task_struct so as to acquire references to kernel + * threads that we're managing. To prevent races, we use an extra completion + * when stopping kernel threads. See the comments in compat_kthread_stop for + * more details. + * + * Like the real kthread interface, ours must be globally available so that we + * can emulate functions like kthread_should_stop without using different + * signatures. + */ + +# include "compat_completion.h" +# include "compat_kernel.h" +# include "compat_sched.h" + +struct compat_kthread_start_info { + int (*fn)(void *); + void *data; + compat_completion created; + char comm[TASK_COMM_LEN]; +}; + +struct compat_kthread_stop_info { + struct semaphore lock; + struct task_struct *task; + compat_completion woken; + compat_completion stopped; + int ret; +}; + +extern struct compat_kthread_stop_info compat_kthread_stop_info; + +# define COMPAT_KTHREAD_DECLARE_STOP_INFO() \ + struct compat_kthread_stop_info compat_kthread_stop_info = { \ + .lock = __SEMAPHORE_INITIALIZER(compat_kthread_stop_info.lock, 1), \ + .task = NULL, \ + } + + +static inline int +compat_kthread_should_stop(void) +{ + return (compat_kthread_stop_info.task == current); +} + + +static inline int +compat_kthread_stop(struct task_struct *_task) +{ + int ret; + + down(&compat_kthread_stop_info.lock); + + /* + * We use a write memory barrier to ensure that all CPUs see _task after + * the completions have been initialized. + * + * There's a race between kernel threads managed by kthread and the upcoming + * call to wake_up_process. If the kernel thread wakes up after we set task + * but before the call to wake_up_process, the thread's call to + * compat_kthread_should_stop will return true and the thread will exit. At + * that point, the call to wake_up_process will be on a dead task_struct. + * + * XXX: The real kthread interface protects against this race by grabbing + * and releasing a reference to _task. We don't have that luxury, because + * there is a range of kernels where put_task_struct isn't exported to + * modules. In fact, no other modules call get_task_struct or + * put_task_struct, so to do so from this context may be unwise. Instead, + * we'll use an extra completion to ensure that the kernel thread only exits + * after wake_up_process has been called. + */ + compat_init_completion(&compat_kthread_stop_info.woken); + compat_init_completion(&compat_kthread_stop_info.stopped); + smp_wmb(); + + compat_kthread_stop_info.task = _task; + wake_up_process(_task); + compat_complete(&compat_kthread_stop_info.woken); + + compat_wait_for_completion(&compat_kthread_stop_info.stopped); + compat_kthread_stop_info.task = NULL; + ret = compat_kthread_stop_info.ret; + up(&compat_kthread_stop_info.lock); + return ret; +} + + +# define compat_kthread_run(_fn, _data, _namefmt, ...) \ +({ \ + struct task_struct *tsk; \ + tsk = compat_kthread_create(_fn, _data, _namefmt, ## __VA_ARGS__); \ + if (!IS_ERR(tsk)) { \ + wake_up_process(tsk); \ + } \ + tsk; \ +}) + + +static inline int +compat_kthread(void *_data) +{ + int ret = -EINTR; + struct compat_kthread_start_info *info; + int (*fn)(void *data); + void *data; + + info = (struct compat_kthread_start_info *)_data; + fn = info->fn; + data = info->data; + + compat_daemonize(info->comm); + __set_current_state(TASK_UNINTERRUPTIBLE); + compat_complete(&info->created); + schedule(); + + if (!compat_kthread_should_stop()) { + ret = fn(data); + } + + if (compat_kthread_should_stop()) { + compat_wait_for_completion(&compat_kthread_stop_info.woken); + compat_kthread_stop_info.ret = ret; + compat_complete_and_exit(&compat_kthread_stop_info.stopped, 0); + BUG(); + } + return 0; +} + + +static inline struct task_struct * +compat_kthread_create(int (*_fn)(void *data), + void *_data, + const char _namefmt[], + ...) +{ + pid_t pid; + struct task_struct *task = NULL; + struct compat_kthread_start_info info; + va_list args; + + info.fn = _fn; + info.data = _data; + compat_init_completion(&info.created); + va_start(args, _namefmt); + vsnprintf(info.comm, sizeof info.comm, _namefmt, args); + va_end(args); + pid = kernel_thread(compat_kthread, &info, CLONE_KERNEL); + if (pid >= 0) { + compat_wait_for_completion(&info.created); + + /* + * find_task_by_pid must be called with tasklist_lock held or under + * rcu_read_lock. As the latter doesn't exist in old kernels, we use the + * former for convenience. + */ + read_lock(&tasklist_lock); + task = find_task_by_pid(pid); + read_unlock(&tasklist_lock); + + /* XXX: Do we need to get a reference on task? */ + } + return task; +} + +#endif + +#endif /* __COMPAT_KTHREAD_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/compat_namei.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/compat_namei.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/compat_namei.h 2008-01-28 08:02:46.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/compat_namei.h 2008-10-13 08:01:43.000000000 +0100 @@ -23,6 +23,23 @@ #include <linux/namei.h> #endif +/* + * In 2.6.25-rc2, dentry and mount objects were removed from the nameidata + * struct. They were both replaced with a struct path. + */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25) +#define compat_vmw_nd_to_dentry(nd) (nd).path.dentry +#else +#define compat_vmw_nd_to_dentry(nd) (nd).dentry +#endif + +/* In 2.6.25-rc2, path_release(&nd) was replaced with path_put(&nd.path). */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25) +#define compat_path_release(nd) path_put(&(nd)->path) +#else +#define compat_path_release(nd) path_release(nd) +#endif + /* path_lookup was exported in 2.4.25 */ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 25) #define compat_path_lookup(path, flags, nd) path_lookup(path, flags, nd) diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/compat_sched.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/compat_sched.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/compat_sched.h 2008-01-28 08:02:46.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/compat_sched.h 2008-10-13 08:01:43.000000000 +0100 @@ -27,6 +27,11 @@ #define CLONE_KERNEL CLONE_FILES | CLONE_FS | CLONE_SIGHAND #endif +/* TASK_COMM_LEN become available in 2.6.11. */ +#ifndef TASK_COMM_LEN +#define TASK_COMM_LEN 16 +#endif + /* The capable() API appeared in 2.1.92 --hpreg */ #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 1, 92) # define capable(_capability) suser() @@ -266,4 +271,21 @@ #define compat_set_freezable() do {} while (0) #endif +/* + * Since 2.6.27-rc2 kill_proc() is gone... Replacement (GPL-only!) + * API is available since 2.6.19. Use them from 2.6.27-rc1 up. + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 27) +typedef int compat_pid; +#define compat_find_get_pid(pid) (pid) +#define compat_put_pid(pid) do { } while (0) +#define compat_kill_pid(pid, sig, flag) kill_proc(pid, sig, flag) +#else +typedef struct pid * compat_pid; +#define compat_find_get_pid(pid) find_get_pid(pid) +#define compat_put_pid(pid) put_pid(pid) +#define compat_kill_pid(pid, sig, flag) kill_pid(pid, sig, flag) +#endif + + #endif /* __COMPAT_SCHED_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/compat_semaphore.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/compat_semaphore.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/compat_semaphore.h 2008-01-28 08:02:46.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/compat_semaphore.h 2008-10-13 08:01:43.000000000 +0100 @@ -20,7 +20,12 @@ # define __COMPAT_SEMAPHORE_H__ -#include <asm/semaphore.h> +/* <= 2.6.25 have asm only, 2.6.26 has both, and 2.6.27-rc2+ has linux only. */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 27) +# include <asm/semaphore.h> +#else +# include <linux/semaphore.h> +#endif /* diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/compat_slab.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/compat_slab.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/compat_slab.h 2008-01-28 08:02:46.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/compat_slab.h 2008-10-13 08:01:43.000000000 +0100 @@ -57,14 +57,29 @@ * Up to 2.6.23 kmem_cache constructor has three arguments - pointer to block to * prepare (aka "this"), from which cache it came, and some unused flags. After * 2.6.23 flags were removed, and order of "this" and cache parameters was swapped... + * Since 2.6.27-rc2 everything is different again, and ctor has only one argument. + * + * HAS_3_ARGS has precedence over HAS_2_ARGS if both are defined. */ #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 23) && !defined(VMW_KMEMCR_CTOR_HAS_3_ARGS) # define VMW_KMEMCR_CTOR_HAS_3_ARGS #endif -#ifdef VMW_KMEMCR_CTOR_HAS_3_ARGS +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26) && !defined(VMW_KMEMCR_CTOR_HAS_2_ARGS) +# define VMW_KMEMCR_CTOR_HAS_2_ARGS +#endif + +#if defined(VMW_KMEMCR_CTOR_HAS_3_ARGS) typedef void compat_kmem_cache_ctor(void *, compat_kmem_cache *, unsigned long); -#else +#define COMPAT_KMEM_CACHE_CTOR_ARGS(arg) void *arg, \ + compat_kmem_cache *cache, \ + unsigned long flags +#elif defined(VMW_KMEMCR_CTOR_HAS_2_ARGS) typedef void compat_kmem_cache_ctor(compat_kmem_cache *, void *); +#define COMPAT_KMEM_CACHE_CTOR_ARGS(arg) compat_kmem_cache *cache, \ + void *arg +#else +typedef void compat_kmem_cache_ctor(void *); +#define COMPAT_KMEM_CACHE_CTOR_ARGS(arg) void *arg #endif #endif /* __COMPAT_SLAB_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/compat_wait.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/compat_wait.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/compat_wait.h 2008-01-28 08:02:46.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/compat_wait.h 2008-10-13 08:01:43.000000000 +0100 @@ -52,13 +52,13 @@ * 2.4.20-wolk4.0s. */ -#if VMW_HAVE_EPOLL // { +#ifdef VMW_HAVE_EPOLL // { #define compat_poll_wqueues struct poll_wqueues #else // } { #define compat_poll_wqueues poll_table #endif // } -#if VMW_HAVE_EPOLL // { +#ifdef VMW_HAVE_EPOLL // { /* If prototype does not match, build will abort here */ extern void poll_initwait(compat_poll_wqueues *); @@ -191,4 +191,35 @@ }) #endif +/* + * DEFINE_WAIT() and friends were added in 2.5.39 and backported to 2.4.28. + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 28) || \ + (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 0) && \ + LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 39)) +# define COMPAT_DEFINE_WAIT(_wait) \ + DECLARE_WAITQUEUE(_wait, current) +# define compat_init_prepare_to_wait(_sleep, _wait, _state) \ + do { \ + __set_current_state(_state); \ + add_wait_queue(_sleep, _wait); \ + } while (0) +# define compat_cont_prepare_to_wait(_sleep, _wait, _state) \ + set_current_state(_state) +# define compat_finish_wait(_sleep, _wait, _state) \ + do { \ + __set_current_state(_state); \ + remove_wait_queue(_sleep, _wait); \ + } while (0) +#else +# define COMPAT_DEFINE_WAIT(_wait) \ + DEFINE_WAIT(_wait) +# define compat_init_prepare_to_wait(_sleep, _wait, _state) \ + prepare_to_wait(_sleep, _wait, _state) +# define compat_cont_prepare_to_wait(_sleep, _wait, _state) \ + prepare_to_wait(_sleep, _wait, _state) +# define compat_finish_wait(_sleep, _wait, _state) \ + finish_wait(_sleep, _wait) +#endif + #endif /* __COMPAT_WAIT_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/cpNameLinux.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/cpNameLinux.c --- open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/cpNameLinux.c 2008-01-28 08:02:46.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/cpNameLinux.c 2008-10-13 08:01:42.000000000 +0100 @@ -24,7 +24,7 @@ * */ -#if defined(sun) && defined(SOL10) +#if defined(sun) && !defined(SOL9) #include <memory.h> #endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/dbllnklst.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/dbllnklst.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/dbllnklst.h 2008-01-28 08:02:46.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/dbllnklst.h 2008-10-13 08:01:42.000000000 +0100 @@ -58,7 +58,7 @@ void DblLnkLst_Link(DblLnkLst_Links *l1, DblLnkLst_Links *l2); void DblLnkLst_Unlink(DblLnkLst_Links *l1, DblLnkLst_Links *l2); void DblLnkLst_Unlink1(DblLnkLst_Links *l); -Bool DblLnkLst_IsLinked(DblLnkLst_Links *l); +Bool DblLnkLst_IsLinked(DblLnkLst_Links const *l); /* Functions specific to anchored lists. --hpreg */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/dir.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/dir.c --- open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/dir.c 2008-01-28 08:02:46.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/dir.c 2008-10-13 08:01:42.000000000 +0100 @@ -32,6 +32,7 @@ #include "compat_slab.h" #include "cpName.h" +#include "hgfsEscape.h" #include "hgfsProto.h" #include "hgfsUtil.h" #include "module.h" @@ -48,6 +49,10 @@ uint32 offset, HgfsAttrInfo *attr, Bool *done); +static int HgfsPackDirOpenRequest(struct inode *inode, + struct file *file, + HgfsOp opUsed, + HgfsReq *req); /* HGFS file operations for directories. */ static int HgfsDirOpen(struct inode *inode, @@ -95,9 +100,8 @@ HgfsUnpackSearchReadReply(HgfsReq *req, // IN: Reply packet HgfsAttrInfo *attr) // IN/OUT: Attributes { - HgfsReplySearchReadV2 *replyV2; - HgfsReplySearchRead *replyV1; - HgfsFileName *fileNameP; + char *fileName; + uint32 fileNameLength; uint32 replySize; int result; @@ -110,16 +114,37 @@ } switch(attr->requestType) { - case HGFS_OP_SEARCH_READ_V2: + case HGFS_OP_SEARCH_READ_V3: { + HgfsReplySearchReadV3 *replyV3; + HgfsDirEntry *dirent; + + /* Currently V3 returns only 1 entry. */ + replyV3 = (HgfsReplySearchReadV3 *)(HGFS_REP_PAYLOAD_V3(req)); + replyV3->count = 1; + replySize = HGFS_REP_PAYLOAD_SIZE_V3(replyV3) + sizeof *dirent; + dirent = (HgfsDirEntry *)replyV3->payload; + fileName = dirent->fileName.name; + fileNameLength = dirent->fileName.length; + break; + } + case HGFS_OP_SEARCH_READ_V2: { + HgfsReplySearchReadV2 *replyV2; + replyV2 = (HgfsReplySearchReadV2 *)(HGFS_REQ_PAYLOAD(req)); replySize = sizeof *replyV2; - fileNameP = &replyV2->fileName; + fileName = replyV2->fileName.name; + fileNameLength = replyV2->fileName.length; break; - case HGFS_OP_SEARCH_READ: + } + case HGFS_OP_SEARCH_READ: { + HgfsReplySearchRead *replyV1; + replyV1 = (HgfsReplySearchRead *)(HGFS_REQ_PAYLOAD(req)); replySize = sizeof *replyV1; - fileNameP = &replyV1->fileName; + fileName = replyV1->fileName.name; + fileNameLength = replyV1->fileName.length; break; + } default: LOG(4, (KERN_DEBUG "VMware hgfs: HgfsUnpackSearchReadReply: unexpected " "OP type encountered\n")); @@ -129,34 +154,34 @@ /* * Make sure name length is legal. */ - if (fileNameP->length > NAME_MAX || - fileNameP->length > HGFS_PACKET_MAX - replySize) { + if (fileNameLength > NAME_MAX || + fileNameLength > HGFS_PACKET_MAX - replySize) { return -ENAMETOOLONG; } - + /* - * If the size of the name is valid (meaning the end of the directory has + * If the size of the name is valid (meaning the end of the directory has * not yet been reached), copy the name to the AttrInfo struct. * * XXX: This operation happens often and the length of the filename is * bounded by NAME_MAX. Perhaps I should just put a statically-sized * array in HgfsAttrInfo and use a slab allocator to allocate the struct. */ - if (fileNameP->length > 0) { + if (fileNameLength > 0) { /* Sanity check on name length. */ - if (fileNameP->length != strlen(fileNameP->name)) { + if (fileNameLength != strlen(fileName)) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsUnpackSearchReadReply: name " - "length mismatch %u/%Zu, name \"%s\"\n", - fileNameP->length, strlen(fileNameP->name), fileNameP->name)); + "length mismatch %u/%Zu, name \"%s\"\n", + fileNameLength, strlen(fileName), fileName)); return -EPROTO; } - attr->fileName = kmalloc(fileNameP->length + 1, GFP_KERNEL); + attr->fileName = kmalloc(fileNameLength + 1, GFP_KERNEL); if (attr->fileName == NULL) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsUnpackSearchReadReply: out of " "memory allocating filename, ignoring\n")); return -ENOMEM; } - memcpy(attr->fileName, fileNameP->name, fileNameP->length + 1); + memcpy(attr->fileName, fileName, fileNameLength + 1); } else { attr->fileName = NULL; } @@ -192,8 +217,8 @@ // no more dentries { HgfsReq *req; - HgfsRequestSearchRead *request; - HgfsReply *replyHeader; + HgfsOp opUsed; + HgfsStatus replyStatus; int result = 0; ASSERT(si); @@ -207,23 +232,39 @@ return -ENOMEM; } - request = (HgfsRequestSearchRead *)(HGFS_REQ_PAYLOAD(req)); - retry: - /* Fill out the request's fields. */ - request->header.op = attr->requestType = - atomic_read(&hgfsVersionSearchRead); - request->header.id = req->id; - request->search = searchHandle; - request->offset = offset; - req->payloadSize = sizeof *request; + opUsed = atomic_read(&hgfsVersionSearchRead); + if (opUsed == HGFS_OP_SEARCH_READ_V3) { + HgfsRequest *header; + HgfsRequestSearchReadV3 *request; + + header = (HgfsRequest *)(HGFS_REQ_PAYLOAD(req)); + header->op = attr->requestType = opUsed; + header->id = req->id; + + request = (HgfsRequestSearchReadV3 *)(HGFS_REQ_PAYLOAD_V3(req)); + request->search = searchHandle; + request->offset = offset; + request->flags = 0; + request->reserved = 0; + req->payloadSize = HGFS_REQ_PAYLOAD_SIZE_V3(request); + } else { + HgfsRequestSearchRead *request; + + request = (HgfsRequestSearchRead *)(HGFS_REQ_PAYLOAD(req)); + request->header.op = attr->requestType = opUsed; + request->header.id = req->id; + request->search = searchHandle; + request->offset = offset; + req->payloadSize = sizeof *request; + } /* Send the request and process the reply. */ result = HgfsSendRequest(req); if (result == 0) { LOG(6, (KERN_DEBUG "VMware hgfs: HgfsGetNextDirEntry: got reply\n")); - replyHeader = (HgfsReply *)(HGFS_REQ_PAYLOAD(req)); - result = HgfsStatusConvertToLinux(replyHeader->status); + replyStatus = HgfsReplyStatus(req); + result = HgfsStatusConvertToLinux(replyStatus); switch(result) { case 0: @@ -237,8 +278,13 @@ break; case -EPROTO: - /* Retry with Version 1 of SearchRead. Set globally. */ - if (attr->requestType == HGFS_OP_SEARCH_READ_V2) { + /* Retry with older version(s). Set globally. */ + if (attr->requestType == HGFS_OP_SEARCH_READ_V3) { + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsGetNextDirEntry: Version 3 " + "not supported. Falling back to version 2.\n")); + atomic_set(&hgfsVersionSearchRead, HGFS_OP_SEARCH_READ_V2); + goto retry; + } else if (attr->requestType == HGFS_OP_SEARCH_READ_V2) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsGetNextDirEntry: Version 2 " "not supported. Falling back to version 1.\n")); atomic_set(&hgfsVersionSearchRead, HGFS_OP_SEARCH_READ); @@ -263,6 +309,107 @@ return result; } + +/* + *---------------------------------------------------------------------- + * + * HgfsPackDirOpenRequest -- + * + * Setup the directory open request, depending on the op version. + * + * Results: + * Returns zero on success, or negative error on failure. + * + * Side effects: + * None + * + *---------------------------------------------------------------------- + */ + +static int +HgfsPackDirOpenRequest(struct inode *inode, // IN: Inode of the file to open + struct file *file, // IN: File pointer for this open + HgfsOp opUsed, // IN: Op to be used + HgfsReq *req) // IN/OUT: Packet to write into +{ + char *name; + uint32 *nameLength; + size_t requestSize; + int result; + + ASSERT(inode); + ASSERT(file); + ASSERT(req); + + switch (opUsed) { + case HGFS_OP_SEARCH_OPEN_V3: { + HgfsRequest *requestHeader; + HgfsRequestSearchOpenV3 *requestV3; + + requestHeader = (HgfsRequest *)(HGFS_REQ_PAYLOAD(req)); + requestHeader->op = opUsed; + requestHeader->id = req->id; + + requestV3 = (HgfsRequestSearchOpenV3 *)HGFS_REQ_PAYLOAD_V3(req); + + /* We'll use these later. */ + name = requestV3->dirName.name; + nameLength = &requestV3->dirName.length; + requestV3->dirName.flags = 0; + requestV3->dirName.caseType = HGFS_FILE_NAME_CASE_SENSITIVE; + requestV3->dirName.fid = HGFS_INVALID_HANDLE; + requestV3->reserved = 0; + requestSize = HGFS_REQ_PAYLOAD_SIZE_V3(requestV3); + break; + } + + case HGFS_OP_SEARCH_OPEN: { + HgfsRequestSearchOpen *request; + + request = (HgfsRequestSearchOpen *)(HGFS_REQ_PAYLOAD(req)); + request->header.op = opUsed; + request->header.id = req->id; + + /* We'll use these later. */ + name = request->dirName.name; + nameLength = &request->dirName.length; + requestSize = sizeof *request; + break; + } + + default: + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsPackDirOpenRequest: unexpected " + "OP type encountered\n")); + return -EPROTO; + } + + /* Build full name to send to server. */ + if (HgfsBuildPath(name, HGFS_PACKET_MAX - (requestSize - 1), + file->f_dentry) < 0) { + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsPackDirOpenRequest: build path failed\n")); + return -EINVAL; + } + LOG(6, (KERN_DEBUG "VMware hgfs: HgfsPackDirOpenRequest: opening \"%s\"\n", + name)); + + /* Convert to CP name. */ + result = CPName_ConvertTo(name, + HGFS_PACKET_MAX - (requestSize - 1), + name); + if (result < 0) { + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsPackDirOpenRequest: CP conversion failed\n")); + return -EINVAL; + } + + /* Unescape the CP name. */ + result = HgfsEscape_Undo(name, result); + *nameLength = (uint32) result; + req->payloadSize = requestSize + result; + + return 0; +} + + /* * HGFS file operations for directories. */ @@ -292,18 +439,16 @@ HgfsDirOpen(struct inode *inode, // IN: Inode of the dir to open struct file *file) // IN: File pointer for this open { - HgfsSuperInfo *si; HgfsReq *req; - HgfsRequestSearchOpen *request; - HgfsReplySearchOpen *reply; int result; + HgfsOp opUsed; + HgfsStatus replyStatus; + HgfsHandle *replySearch; ASSERT(inode); ASSERT(inode->i_sb); ASSERT(file); - si = HGFS_SB_TO_COMMON(inode->i_sb); - req = HgfsGetNewRequest(); if (!req) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDirOpen: out of memory while " @@ -312,62 +457,52 @@ goto out; } - request = (HgfsRequestSearchOpen *)(HGFS_REQ_PAYLOAD(req)); - - /* Fill out the request's fields. */ - request->header.id = req->id; - request->header.op = HGFS_OP_SEARCH_OPEN; - - /* Build full name to send to server. */ - if (HgfsBuildPath(request->dirName.name, HGFS_NAME_BUFFER_SIZE(request), - file->f_dentry) < 0) { - LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDirOpen: build path failed\n")); - result = -EINVAL; - goto out; + retry: + opUsed = atomic_read(&hgfsVersionSearchOpen); + if (opUsed == HGFS_OP_SEARCH_OPEN_V3) { + replySearch = &((HgfsReplySearchOpenV3 *)HGFS_REP_PAYLOAD_V3(req))->search; + } else { + replySearch = &((HgfsReplySearchOpen *)HGFS_REQ_PAYLOAD(req))->search; } - LOG(6, (KERN_DEBUG "VMware hgfs: HgfsDirOpen: opening \"%s\"\n", - request->dirName.name)); - /* Convert to CP name. */ - result = CPName_ConvertTo(request->dirName.name, - HGFS_NAME_BUFFER_SIZE(request), - request->dirName.name); - if (result < 0) { - LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDirOpen: CP conversion failed\n")); - result = -EINVAL; + result = HgfsPackDirOpenRequest(inode, file, opUsed, req); + if (result != 0) { + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDirOpen: error packing request\n")); goto out; } - /* Unescape the CP name. */ - result = HgfsUnescapeBuffer(request->dirName.name, result); - request->dirName.length = result; - req->payloadSize = sizeof *request + result; - /* Send the request and process the reply. */ result = HgfsSendRequest(req); if (result == 0) { /* Get the reply and check return status. */ - reply = (HgfsReplySearchOpen *)(HGFS_REQ_PAYLOAD(req)); - result = HgfsStatusConvertToLinux(reply->header.status); + replyStatus = HgfsReplyStatus(req); + result = HgfsStatusConvertToLinux(replyStatus); - if (result == 0) { - if (req->payloadSize != sizeof *reply) { - /* - * If status != success, the payloadSize will be smaller, - * so this test only applies in the success case. [bac] - */ - LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDirOpen: wrong " - "packet size\n")); - result = -EPROTO; - goto out; - } - - result = HgfsCreateFileInfo(file, reply->search); + switch (result) { + case 0: + result = HgfsCreateFileInfo(file, *replySearch); if (result) { - goto out; + goto out; } LOG(6, (KERN_DEBUG "VMware hgfs: HgfsDirOpen: set handle to %u\n", - reply->search)); + *replySearch)); + break; + case -EPROTO: + /* Retry with older version(s). Set globally. */ + if (opUsed == HGFS_OP_SEARCH_OPEN_V3) { + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDirOpen: Version 3 not " + "supported. Falling back to version 1.\n")); + atomic_set(&hgfsVersionSearchOpen, HGFS_OP_SEARCH_OPEN); + goto retry; + } + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDirOpen: server " + "returned error: %d\n", result)); + break; + + default: + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDirOpen: server " + "returned error: %d\n", result)); + break; } } else if (result == -EIO) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDirOpen: timed out\n")); @@ -492,9 +627,9 @@ &attr, &done); if (result == -ENAMETOOLONG) { - /* + /* * Skip dentry if its name is too long (see below). - * + * * XXX: If a bad server sends us bad packets, we can loop here * forever, as I did while testing *grumble*. Maybe we should error * in that case. @@ -521,10 +656,10 @@ * CP name format, but that is done implicitely here since we * are guaranteed to have just one path component per dentry. */ - result = HgfsEscapeBuffer(attr.fileName, - strlen(attr.fileName), - escNameLength, - escName); + result = HgfsEscape_Do(attr.fileName, + strlen(attr.fileName), + escNameLength, + escName); kfree(attr.fileName); /* @@ -535,14 +670,14 @@ * incrementing file->f_pos and repeating the loop to get the * next dentry. * - * HgfsEscapeBuffer returns a negative value if the escaped + * HgfsEscape_Do returns a negative value if the escaped * output didn't fit in the specified output size, so we can * just check its return value. */ if (result < 0) { - /* + /* * XXX: Another area where a bad server could cause us to loop - * forever. + * forever. */ file->f_pos++; continue; @@ -593,11 +728,11 @@ if (attr.mask & HGFS_ATTR_VALID_FILEID) { ino = attr.hostFileId; } else { - ino = iunique(file->f_dentry->d_inode->i_sb, + ino = iunique(file->f_dentry->d_inode->i_sb, HGFS_RESERVED_INO); } } - + /* * Call filldir for this dentry. */ @@ -649,11 +784,10 @@ HgfsDirRelease(struct inode *inode, // IN: Inode that the file* points to struct file *file) // IN: File for the dir getting released { - HgfsSuperInfo *si; HgfsReq *req; - HgfsRequestSearchClose *request; - HgfsReplySearchClose *reply; + HgfsStatus replyStatus; HgfsHandle handle; + HgfsOp opUsed; int result = 0; ASSERT(inode); @@ -665,7 +799,6 @@ LOG(6, (KERN_DEBUG "VMware hgfs: HgfsDirRelease: close fh %u\n", handle)); HgfsReleaseFileInfo(file); - si = HGFS_SB_TO_COMMON(file->f_dentry->d_sb); req = HgfsGetNewRequest(); if (!req) { @@ -675,25 +808,55 @@ goto out; } - /* Fill in the request's fields. */ - request = (HgfsRequestSearchClose *)(HGFS_REQ_PAYLOAD(req)); - request->header.id = req->id; - request->header.op = HGFS_OP_SEARCH_CLOSE; - request->search = handle; - req->payloadSize = sizeof *request; + retry: + opUsed = atomic_read(&hgfsVersionSearchClose); + if (opUsed == HGFS_OP_SEARCH_CLOSE_V3) { + HgfsRequestSearchCloseV3 *request; + HgfsRequest *header; + + header = (HgfsRequest *)(HGFS_REQ_PAYLOAD(req)); + header->id = req->id; + header->op = opUsed; + + request = (HgfsRequestSearchCloseV3 *)(HGFS_REQ_PAYLOAD_V3(req)); + request->search = handle; + request->reserved = 0; + req->payloadSize = HGFS_REQ_PAYLOAD_SIZE_V3(request); + } else { + HgfsRequestSearchClose *request; + + request = (HgfsRequestSearchClose *)(HGFS_REQ_PAYLOAD(req)); + request->header.id = req->id; + request->header.op = opUsed; + request->search = handle; + req->payloadSize = sizeof *request; + } /* Send the request and process the reply. */ result = HgfsSendRequest(req); if (result == 0) { /* Get the reply. */ - reply = (HgfsReplySearchClose *)(HGFS_REQ_PAYLOAD(req)); - result = HgfsStatusConvertToLinux(reply->header.status); - if (result == 0) { + replyStatus = HgfsReplyStatus(req); + result = HgfsStatusConvertToLinux(replyStatus); + + switch (result) { + case 0: LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDirRelease: release handle %u\n", handle)); - } else { + break; + case -EPROTO: + /* Retry with older version(s). Set globally. */ + if (opUsed == HGFS_OP_SEARCH_CLOSE_V3) { + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDirRelease: Version 3 not " + "supported. Falling back to version 1.\n")); + atomic_set(&hgfsVersionSearchClose, HGFS_OP_SEARCH_CLOSE); + goto retry; + } + break; + default: LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDirRelease: failed handle %u\n", handle)); + break; } } else if (result == -EIO) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDirRelease: timed out\n")); diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/file.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/file.c --- open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/file.c 2008-01-28 08:02:46.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/file.c 2008-10-13 08:01:42.000000000 +0100 @@ -33,9 +33,11 @@ #include "compat_slab.h" #include "cpName.h" +#include "hgfsEscape.h" #include "hgfsProto.h" #include "module.h" #include "request.h" +#include "hgfsUtil.h" #include "fsutil.h" #include "vm_assert.h" #include "vm_basic_types.h" @@ -43,6 +45,7 @@ /* Private functions. */ static int HgfsPackOpenRequest(struct inode *inode, struct file *file, + HgfsOp opUsed, HgfsReq *req); static int HgfsUnpackOpenReply(HgfsReq *req, HgfsOp opUsed, @@ -125,9 +128,19 @@ #endif }; +/* File open mask. */ +#define HGFS_FILE_OPEN_MASK (HGFS_OPEN_VALID_MODE | \ + HGFS_OPEN_VALID_FLAGS | \ + HGFS_OPEN_VALID_SPECIAL_PERMS | \ + HGFS_OPEN_VALID_OWNER_PERMS | \ + HGFS_OPEN_VALID_GROUP_PERMS | \ + HGFS_OPEN_VALID_OTHER_PERMS | \ + HGFS_OPEN_VALID_FILE_NAME | \ + HGFS_OPEN_VALID_SERVER_LOCK) -/* - * Private functions. + +/* + * Private functions. */ /* @@ -138,7 +151,7 @@ * Setup the Open request, depending on the op version. * * Results: - * Returns zero on success, or negative error on failure. + * Returns zero on success, or negative error on failure. * * Side effects: * None @@ -146,36 +159,90 @@ *---------------------------------------------------------------------- */ -static int +static int HgfsPackOpenRequest(struct inode *inode, // IN: Inode of the file to open struct file *file, // IN: File pointer for this open + HgfsOp opUsed, // IN: Op to use HgfsReq *req) // IN/OUT: Packet to write into { - HgfsRequest *requestHeader; - HgfsRequestOpenV2 *requestV2; - HgfsRequestOpen *request; - HgfsFileName *fileNameP; + char *name; + uint32 *nameLength; size_t requestSize; int result; - + ASSERT(inode); ASSERT(file); ASSERT(req); - requestHeader = (HgfsRequest *)(HGFS_REQ_PAYLOAD(req)); + switch (opUsed) { + case HGFS_OP_OPEN_V3: { + HgfsRequest *requestHeader; + HgfsRequestOpenV3 *requestV3; + + requestHeader = (HgfsRequest *)HGFS_REQ_PAYLOAD(req); + requestHeader->op = opUsed; + requestHeader->id = req->id; + + requestV3 = (HgfsRequestOpenV3 *)HGFS_REQ_PAYLOAD_V3(req); + requestSize = HGFS_REQ_PAYLOAD_SIZE_V3(requestV3); + + /* We'll use these later. */ + name = requestV3->fileName.name; + nameLength = &requestV3->fileName.length; + + requestV3->mask = HGFS_FILE_OPEN_MASK; + + /* Linux clients need case-sensitive lookups. */ + requestV3->fileName.flags = 0; + requestV3->fileName.caseType = HGFS_FILE_NAME_CASE_SENSITIVE; + requestV3->fileName.fid = HGFS_INVALID_HANDLE; + + /* Set mode. */ + result = HgfsGetOpenMode(file->f_flags); + if (result < 0) { + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsPackOpenRequest: failed to get " + "open mode\n")); + return -EINVAL; + } + requestV3->mode = result; + + /* Set flags. */ + result = HgfsGetOpenFlags(file->f_flags); + if (result < 0) { + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsPackOpenRequest: failed to get " + "open flags\n")); + return -EINVAL; + } + requestV3->flags = result; + + /* Set permissions. */ + requestV3->specialPerms = (inode->i_mode & (S_ISUID | S_ISGID | S_ISVTX)) + >> 9; + requestV3->ownerPerms = (inode->i_mode & S_IRWXU) >> 6; + requestV3->groupPerms = (inode->i_mode & S_IRWXG) >> 3; + requestV3->otherPerms = (inode->i_mode & S_IRWXO); + + /* XXX: Request no lock for now. */ + requestV3->desiredLock = HGFS_LOCK_NONE; + + requestV3->reserved1 = 0; + requestV3->reserved2 = 0; + break; + } + + case HGFS_OP_OPEN_V2: { + HgfsRequestOpenV2 *requestV2; - switch (requestHeader->op) { - case HGFS_OP_OPEN_V2: requestV2 = (HgfsRequestOpenV2 *)(HGFS_REQ_PAYLOAD(req)); - + requestV2->header.op = opUsed; + requestV2->header.id = req->id; + /* We'll use these later. */ - fileNameP = &requestV2->fileName; + name = requestV2->fileName.name; + nameLength = &requestV2->fileName.length; requestSize = sizeof *requestV2; - - requestV2->mask = HGFS_OPEN_VALID_MODE | HGFS_OPEN_VALID_FLAGS | - HGFS_OPEN_VALID_SPECIAL_PERMS | HGFS_OPEN_VALID_OWNER_PERMS | - HGFS_OPEN_VALID_GROUP_PERMS | HGFS_OPEN_VALID_OTHER_PERMS | - HGFS_OPEN_VALID_FILE_NAME | HGFS_OPEN_VALID_SERVER_LOCK; + + requestV2->mask = HGFS_FILE_OPEN_MASK; /* Set mode. */ result = HgfsGetOpenMode(file->f_flags); @@ -205,11 +272,17 @@ /* XXX: Request no lock for now. */ requestV2->desiredLock = HGFS_LOCK_NONE; break; - case HGFS_OP_OPEN: + } + case HGFS_OP_OPEN: { + HgfsRequestOpen *request; + request = (HgfsRequestOpen *)(HGFS_REQ_PAYLOAD(req)); - + request->header.op = opUsed; + request->header.id = req->id; + /* We'll use these later. */ - fileNameP = &request->fileName; + name = request->fileName.name; + nameLength = &request->fileName.length; requestSize = sizeof *request; /* Set mode. */ @@ -233,6 +306,7 @@ /* Set permissions. */ request->permissions = (inode->i_mode & S_IRWXU) >> 6; break; + } default: LOG(4, (KERN_DEBUG "VMware hgfs: HgfsPackOpenRequest: unexpected " "OP type encountered\n")); @@ -240,7 +314,7 @@ } /* Build full name to send to server. */ - if (HgfsBuildPath(fileNameP->name, + if (HgfsBuildPath(name, HGFS_PACKET_MAX - (requestSize - 1), file->f_dentry) < 0) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsPackOpenRequest: build path " @@ -248,13 +322,13 @@ return -EINVAL; } LOG(6, (KERN_DEBUG "VMware hgfs: HgfsPackOpenRequest: opening \"%s\", " - "flags %o, create perms %o\n", fileNameP->name, + "flags %o, create perms %o\n", name, file->f_flags, file->f_mode)); /* Convert to CP name. */ - result = CPName_ConvertTo(fileNameP->name, + result = CPName_ConvertTo(name, HGFS_PACKET_MAX - (requestSize - 1), - fileNameP->name); + name); if (result < 0) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsPackOpenRequest: CP conversion " "failed\n")); @@ -262,8 +336,8 @@ } /* Unescape the CP name. */ - result = HgfsUnescapeBuffer(fileNameP->name, result); - fileNameP->length = result; + result = HgfsEscape_Undo(name, result); + *nameLength = (uint32) result; req->payloadSize = requestSize + result; return 0; @@ -275,7 +349,7 @@ * * HgfsUnpackOpenReply -- * - * Get interesting fields out of the Open reply, depending on the op + * Get interesting fields out of the Open reply, depending on the op * version. * * Results: @@ -293,6 +367,7 @@ HgfsHandle *file, // OUT: Handle in reply packet HgfsServerLock *lock) // OUT: The server lock we got { + HgfsReplyOpenV3 *replyV3; HgfsReplyOpenV2 *replyV2; HgfsReplyOpen *replyV1; size_t replySize; @@ -302,8 +377,14 @@ ASSERT(lock); switch (opUsed) { + case HGFS_OP_OPEN_V3: + replyV3 = (HgfsReplyOpenV3 *)HGFS_REP_PAYLOAD_V3(req); + replySize = HGFS_REP_PAYLOAD_SIZE_V3(replyV3); + *file = replyV3->file; + *lock = replyV3->acquiredLock; + break; case HGFS_OP_OPEN_V2: - replyV2 = (HgfsReplyOpenV2 *)(HGFS_REQ_PAYLOAD(req)); + replyV2 = (HgfsReplyOpenV2 *)(HGFS_REQ_PAYLOAD(req)); replySize = sizeof *replyV2; *file = replyV2->file; *lock = replyV2->acquiredLock; @@ -315,7 +396,7 @@ *lock = HGFS_LOCK_NONE; break; default: - + /* This really shouldn't happen since we set opUsed ourselves. */ LOG(4, (KERN_DEBUG "VMware hgfs: HgfsUnpackOpenReply: unexpected " "OP type encountered\n")); @@ -456,8 +537,7 @@ HgfsSuperInfo *si; HgfsReq *req; HgfsOp opUsed; - HgfsRequest *requestHeader; - HgfsReply *replyHeader; + HgfsStatus replyStatus; HgfsHandle replyFile; HgfsServerLock replyLock; HgfsInodeInfo *iinfo; @@ -480,19 +560,16 @@ goto out; } - requestHeader = (HgfsRequest *)(HGFS_REQ_PAYLOAD(req)); - retry: - /* - * Set up pointers using the proper struct This lets us check the - * version exactly once and use the pointers later. + /* + * Set up pointers using the proper struct This lets us check the + * version exactly once and use the pointers later. */ - requestHeader->op = opUsed = atomic_read(&hgfsVersionOpen); - requestHeader->id = req->id; - result = HgfsPackOpenRequest(inode, file, req); + opUsed = atomic_read(&hgfsVersionOpen); + result = HgfsPackOpenRequest(inode, file, opUsed, req); if (result != 0) { - LOG(4, (KERN_DEBUG "VMware hgfs: HgfsOpen: error packing request\n")); + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsOpen: error packing request\n")); goto out; } @@ -500,8 +577,8 @@ result = HgfsSendRequest(req); if (result == 0) { /* Get the reply and check return status. */ - replyHeader = (HgfsReply *)(HGFS_REQ_PAYLOAD(req)); - result = HgfsStatusConvertToLinux(replyHeader->status); + replyStatus = HgfsReplyStatus(req); + result = HgfsStatusConvertToLinux(replyStatus); switch (result) { case 0: @@ -518,45 +595,63 @@ replyFile)); /* - * HgfsCreate faked all of the inode's attributes, so by the time - * we're done in HgfsOpen, we need to make sure that the attributes - * in the inode are real. The following is only necessary when - * O_CREAT is set, otherwise we got here after HgfsLookup (which sent + * HgfsCreate faked all of the inode's attributes, so by the time + * we're done in HgfsOpen, we need to make sure that the attributes + * in the inode are real. The following is only necessary when + * O_CREAT is set, otherwise we got here after HgfsLookup (which sent * a getattr to the server and got the real attributes). * - * In particular, we'd like to at least try and set the inode's - * uid/gid to match the caller's. We don't expect this to work, - * because Windows servers will ignore it, and Linux servers running - * as non-root won't be able to change it, but we're forward thinking + * In particular, we'd like to at least try and set the inode's + * uid/gid to match the caller's. We don't expect this to work, + * because Windows servers will ignore it, and Linux servers running + * as non-root won't be able to change it, but we're forward thinking * people. - * - * Either way, we force a revalidate following the setattr so that + * + * Either way, we force a revalidate following the setattr so that * we'll get the actual uid/gid from the server. */ if (file->f_flags & O_CREAT) { - struct iattr setUidGid; - - setUidGid.ia_valid = ATTR_UID | ATTR_GID; - setUidGid.ia_uid = current->fsuid; - /* - * XXX: How can we handle SGID from here? We would need access to - * this dentry's parent inode's mode and gid. + struct dentry *dparent; + struct inode *iparent; + + /* + * This is not the root of our file system so there should always + * be a parent. + */ + ASSERT(file->f_dentry->d_parent); + + /* + * Here we obtain a reference on the parent to make sure it doesn't + * go away. This might not be necessary, since the existence of + * a child (which we hold a reference to in this call) should + * account for a reference in the parent, but it's safe to do so. + * Overly cautious and safe is better than risky and broken. * - * After the setattr, we desperately want a revalidate so we can - * get the true attributes from the server. However, the setattr - * may have done that for us. To prevent a spurious revalidate, - * reset the dentry's time before the setattr. That way, if setattr - * ends up revalidating the dentry, the subsequent call to - * revalidate will do nothing. + * XXX Note that this and a handful of other hacks wouldn't be + * necessary if we actually created the file in our create + * implementation (where references and locks are properly held). + * We could do this if we were willing to give up support for + * O_EXCL on 2.4 kernels. */ - setUidGid.ia_gid = current->fsgid; - HgfsDentryAgeForce(file->f_dentry); - HgfsSetattr(file->f_dentry, &setUidGid); - HgfsRevalidate(file->f_dentry); + dparent = dget(file->f_dentry->d_parent); + iparent = dparent->d_inode; + + HgfsSetUidGid(iparent, file->f_dentry, + current->fsuid, current->fsgid); + + dput(dparent); } break; case -EPROTO: + /* Retry with older version(s). Set globally. */ + if (opUsed == HGFS_OP_OPEN_V3) { + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsOpen: Version 3 not " + "supported. Falling back to version 2.\n")); + atomic_set(&hgfsVersionOpen, HGFS_OP_OPEN_V2); + goto retry; + } + /* Retry with Version 1 of Open. Set globally. */ if (opUsed == HGFS_OP_OPEN_V2) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsOpen: Version 2 not " @@ -564,7 +659,7 @@ atomic_set(&hgfsVersionOpen, HGFS_OP_OPEN); goto retry; } - + /* Fallthrough. */ default: break; @@ -581,18 +676,18 @@ out: HgfsFreeRequest(req); - /* - * If the open failed (for any reason) and we tried to open a newly created - * file, we must ensure that the next operation on this inode triggers a - * revalidate to the server. This is because the file wasn't created on the + /* + * If the open failed (for any reason) and we tried to open a newly created + * file, we must ensure that the next operation on this inode triggers a + * revalidate to the server. This is because the file wasn't created on the * server, yet we currently believe that it was, because we created a fake * inode with a hashed dentry for it in HgfsCreate. We will continue to - * believe this until the dentry's ttl expires, which will cause a + * believe this until the dentry's ttl expires, which will cause a * revalidate to the server that will reveal the truth. So in order to find - * the truth as soon as possible, we'll reset the dentry's last revalidate + * the truth as soon as possible, we'll reset the dentry's last revalidate * time now to force a revalidate the next time someone uses the dentry. * - * We're using our own flag to track this case because using O_CREAT isn't + * We're using our own flag to track this case because using O_CREAT isn't * good enough: HgfsOpen will be called with O_CREAT even if the file exists * on the server, and if that's the case, there's no need to revalidate. * @@ -614,7 +709,7 @@ * HgfsAioRead -- * * Called when the kernel initiates an asynchronous read to a file in - * our filesystem. Our function is just a thin wrapper around + * our filesystem. Our function is just a thin wrapper around * generic_file_aio_read() that tries to validate the dentry first. * * Results: @@ -627,7 +722,7 @@ *---------------------------------------------------------------------- */ -static ssize_t +static ssize_t HgfsAioRead(struct kiocb *iocb, // IN: I/O control block const struct iovec *iov, // OUT: Array of I/O buffers unsigned long numSegs, // IN: Number of buffers @@ -660,7 +755,7 @@ * HgfsAioWrite -- * * Called when the kernel initiates an asynchronous write to a file in - * our filesystem. Our function is just a thin wrapper around + * our filesystem. Our function is just a thin wrapper around * generic_file_aio_write() that tries to validate the dentry first. * * Note that files opened with O_SYNC (or superblocks mounted with @@ -676,7 +771,7 @@ *---------------------------------------------------------------------- */ -static ssize_t +static ssize_t HgfsAioWrite(struct kiocb *iocb, // IN: I/O control block const struct iovec *iov, // IN: Array of I/O buffers unsigned long numSegs, // IN: Number of buffers @@ -690,14 +785,14 @@ ASSERT(iov); LOG(6, (KERN_DEBUG "VMware hgfs: HgfsAioWrite: was called\n")); - + result = HgfsRevalidate(iocb->ki_filp->f_dentry); if (result) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsAioWrite: invalid dentry\n")); goto out; } - result = generic_file_aio_write(iocb, iov, numSegs, offset); + result = generic_file_aio_write(iocb, iov, numSegs, offset); out: return result; } @@ -911,9 +1006,9 @@ { HgfsSuperInfo *si; HgfsReq *req; - HgfsRequestClose *request; - HgfsReplyClose *reply; HgfsHandle handle; + HgfsOp opUsed; + HgfsStatus replyStatus; int result = 0; ASSERT(inode); @@ -924,7 +1019,7 @@ handle = FILE_GET_FI_P(file)->handle; LOG(6, (KERN_DEBUG "VMware hgfs: HgfsRelease: close fh %u\n", handle)); - /* + /* * This may be our last open handle to an inode, so we should flush our * dirty pages before closing it. */ @@ -941,25 +1036,55 @@ goto out; } - /* Fill in the request's fields. */ - request = (HgfsRequestClose *)(HGFS_REQ_PAYLOAD(req)); - request->header.id = req->id; - request->header.op = HGFS_OP_CLOSE; - request->file = handle; - req->payloadSize = sizeof *request; + retry: + opUsed = atomic_read(&hgfsVersionClose); + if (opUsed == HGFS_OP_CLOSE_V3) { + HgfsRequest *header; + HgfsRequestCloseV3 *request; + + header = (HgfsRequest *)(HGFS_REQ_PAYLOAD(req)); + header->id = req->id; + header->op = opUsed; + + request = (HgfsRequestCloseV3 *)(HGFS_REQ_PAYLOAD_V3(req)); + request->file = handle; + request->reserved = 0; + req->payloadSize = HGFS_REQ_PAYLOAD_SIZE_V3(request); + } else { + HgfsRequestClose *request; + + request = (HgfsRequestClose *)(HGFS_REQ_PAYLOAD(req)); + request->header.id = req->id; + request->header.op = opUsed; + request->file = handle; + req->payloadSize = sizeof *request; + } /* Send the request and process the reply. */ result = HgfsSendRequest(req); if (result == 0) { /* Get the reply. */ - reply = (HgfsReplyClose *)(HGFS_REQ_PAYLOAD(req)); - result = HgfsStatusConvertToLinux(reply->header.status); - if (result == 0) { + replyStatus = HgfsReplyStatus(req); + result = HgfsStatusConvertToLinux(replyStatus); + + switch (result) { + case 0: LOG(4, (KERN_DEBUG "VMware hgfs: HgfsRelease: released handle %u\n", handle)); - } else { + break; + case -EPROTO: + /* Retry with older version(s). Set globally. */ + if (opUsed == HGFS_OP_CLOSE_V3) { + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsRelease: Version 3 not " + "supported. Falling back to version 1.\n")); + atomic_set(&hgfsVersionClose, HGFS_OP_CLOSE); + goto retry; + } + break; + default: LOG(4, (KERN_DEBUG "VMware hgfs: HgfsRelease: failed handle %u\n", handle)); + break; } } else if (result == -EIO) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsRelease: timed out\n")); diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/filesystem.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/filesystem.c --- open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/filesystem.c 2008-01-28 08:02:46.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/filesystem.c 2008-10-13 08:01:42.000000000 +0100 @@ -27,7 +27,6 @@ #include "driver-config.h" #include <asm/atomic.h> -#include <asm/semaphore.h> #include <linux/errno.h> #include <linux/list.h> #include <linux/module.h> @@ -36,7 +35,9 @@ #include "compat_dcache.h" #include "compat_fs.h" #include "compat_kernel.h" +#include "compat_kthread.h" #include "compat_sched.h" +#include "compat_semaphore.h" #include "compat_slab.h" #include "compat_spinlock.h" #include "compat_string.h" @@ -71,7 +72,8 @@ spinlock_t hgfsBigLock = SPIN_LOCK_UNLOCKED; long hgfsReqThreadFlags; wait_queue_head_t hgfsReqThreadWait; -compat_completion hgfsReqThreadDone; +struct task_struct *hgfsReqThread; +COMPAT_KTHREAD_DECLARE_STOP_INFO(); /* Other variables. */ compat_kmem_cache *hgfsReqCache = NULL; @@ -79,11 +81,23 @@ RpcOut *hgfsRpcOut = NULL; unsigned int hgfsIdCounter = 0; struct list_head hgfsReqsUnsent; + +/* Global protocol version switch. */ atomic_t hgfsVersionOpen; +atomic_t hgfsVersionRead; +atomic_t hgfsVersionWrite; +atomic_t hgfsVersionClose; +atomic_t hgfsVersionSearchOpen; +atomic_t hgfsVersionSearchRead; +atomic_t hgfsVersionSearchClose; atomic_t hgfsVersionGetattr; atomic_t hgfsVersionSetattr; -atomic_t hgfsVersionSearchRead; atomic_t hgfsVersionCreateDir; +atomic_t hgfsVersionDeleteFile; +atomic_t hgfsVersionDeleteDir; +atomic_t hgfsVersionRename; +atomic_t hgfsVersionQueryVolumeInfo; +atomic_t hgfsVersionCreateSymlink; /* Private functions. */ static inline unsigned long HgfsComputeBlockBits(unsigned long blockSize); @@ -186,16 +200,8 @@ *----------------------------------------------------------------------------- */ -#ifdef VMW_KMEMCR_CTOR_HAS_3_ARGS static void -HgfsInodeCacheCtor(void *slabElem, // IN: slab item to initialize - compat_kmem_cache *cache, // IN: cache slab is from - unsigned long flags) // IN: flags associated with allocation -#else -static void -HgfsInodeCacheCtor(compat_kmem_cache *cache, // IN: cache slab is from - void *slabElem) // IN: slab item to initialize -#endif +HgfsInodeCacheCtor(COMPAT_KMEM_CACHE_CTOR_ARGS(slabElem)) // IN: slab item to initialize { #ifdef VMW_EMBED_INODE HgfsInodeInfo *iinfo = (HgfsInodeInfo *)slabElem; @@ -581,12 +587,11 @@ HgfsInitFileSystem(void) { Bool success = FALSE; - pid_t pid = 0; /* Initialize primitives. */ INIT_LIST_HEAD(&hgfsReqsUnsent); init_waitqueue_head(&hgfsReqThreadWait); - compat_init_completion(&hgfsReqThreadDone); + hgfsReqThread = NULL; hgfsReqThreadFlags = 0; HgfsResetOps(); @@ -613,8 +618,8 @@ } /* Create backdoor handler. */ - pid = kernel_thread(HgfsBdHandler, NULL, CLONE_KERNEL); - if (pid < 0) { + hgfsReqThread = compat_kthread_run(HgfsBdHandler, NULL, HGFS_NAME); + if (IS_ERR(hgfsReqThread)) { printk(KERN_WARNING "VMware hgfs: failed to create kernel thread\n"); goto exit; } @@ -637,10 +642,8 @@ /* Cleanup if an error occurred. */ if (success == FALSE) { - if (pid > 0) { - set_bit(HGFS_REQ_THREAD_EXIT, &hgfsReqThreadFlags); - wake_up_interruptible(&hgfsReqThreadWait); - compat_wait_for_completion(&hgfsReqThreadDone); + if (!IS_ERR(hgfsReqThread)) { + compat_kthread_stop(hgfsReqThread); } if (hgfsInodeCache != NULL) { kmem_cache_destroy(hgfsInodeCache); @@ -692,9 +695,7 @@ } /* Kill the backdoor handler thread. */ - set_bit(HGFS_REQ_THREAD_EXIT, &hgfsReqThreadFlags); - wake_up_interruptible(&hgfsReqThreadWait); - compat_wait_for_completion(&hgfsReqThreadDone); + compat_kthread_stop(hgfsReqThread); /* Destroy the inode and request slabs. */ kmem_cache_destroy(hgfsInodeCache); diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/filesystem.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/filesystem.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/filesystem.h 2008-01-28 08:02:46.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/filesystem.h 2008-10-13 08:01:42.000000000 +0100 @@ -19,7 +19,7 @@ /* * filesystem.h -- * - * High-level filesystem operations for the filesystem portion of + * High-level filesystem operations for the filesystem portion of * the vmhgfs driver. */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/fsutil.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/fsutil.c --- open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/fsutil.c 2008-01-28 08:02:46.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/fsutil.c 2008-10-13 08:01:43.000000000 +0100 @@ -37,7 +37,8 @@ #include "compat_slab.h" #include "compat_spinlock.h" -#include "escBitvector.h" +#include "vm_assert.h" +#include "hgfsEscape.h" #include "cpName.h" #include "cpNameLite.h" #include "hgfsUtil.h" @@ -45,8 +46,6 @@ #include "request.h" #include "fsutil.h" #include "hgfsProto.h" -#include "staticEscape.h" -#include "vm_assert.h" #include "vm_basic_types.h" static struct inode *HgfsInodeLookup(struct super_block *sb, @@ -57,8 +56,9 @@ HgfsAttrInfo *attr); static int HgfsPackGetattrRequest(HgfsReq *req, struct dentry *dentry, - HgfsAttrInfo *attr, - Bool allowHandleReuse); + Bool allowHandleReuse, + HgfsOp opUsed, + HgfsAttrInfo *attr); /* * Private function implementations. @@ -89,11 +89,11 @@ { #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 42) return ilookup(sb, ino); -#else +#else struct inode *inode; HgfsInodeInfo *iinfo; - /* + /* * Note that returning NULL in both of these cases will make the * caller think that no such inode exists, which is correct. In the first * case, we failed to allocate an inode inside iget(), meaning the inode @@ -101,18 +101,18 @@ * inode got marked bad inside read_inode, also indicative of a new inode * allocation. */ - inode = iget(sb, ino); + inode = HgfsGetInode(sb, ino); if (inode == NULL) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsInodeLookup: iget ran out of " "memory and returned NULL\n")); - return NULL; - } + return NULL; + } if (is_bad_inode(inode)) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsInodeLookup: inode marked bad\n")); goto iput_and_exit; } - /* + /* * Our read_inode function should guarantee that if we're here, iinfo should * have been allocated already. */ @@ -123,8 +123,8 @@ "bailing out\n")); goto iput_and_exit; } - - /* + + /* * It's HGFS's job to make sure this is set to TRUE in all inodes on which * we hold a reference. If it is set to TRUE, we return the inode, just as * ilookup() does. @@ -137,7 +137,7 @@ if (iinfo->isReferencedInode) { goto exit; } - + iput_and_exit: iput(inode); inode = NULL; @@ -231,6 +231,8 @@ HgfsAttrInfo *attr) // IN/OUT: Attributes { int result; + char *name = NULL; + uint32 length = 0; ASSERT(req); ASSERT(attr); @@ -240,31 +242,45 @@ return result; } - /* GetattrV2 also wants a symlink target if it exists. */ - if (attr->requestType == HGFS_OP_GETATTR_V2) { + /* GetattrV2+ also wants a symlink target if it exists. */ + if (attr->requestType == HGFS_OP_GETATTR_V3) { + HgfsReplyGetattrV3 *replyV3 = (HgfsReplyGetattrV3 *)(HGFS_REP_PAYLOAD_V3(req)); + name = replyV3->symlinkTarget.name; + length = replyV3->symlinkTarget.length; + + /* Skip the symlinkTarget if it's too long. */ + if (length > HGFS_NAME_BUFFER_SIZET(sizeof *replyV3 + sizeof(HgfsReply))) { + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsUnpackGetattrReply: symlink " + "target name too long, ignoring\n")); + return -ENAMETOOLONG; + } + } else if (attr->requestType == HGFS_OP_GETATTR_V2) { HgfsReplyGetattrV2 *replyV2 = (HgfsReplyGetattrV2 *) (HGFS_REQ_PAYLOAD(req)); - uint32 length = replyV2->symlinkTarget.length; - if (length != 0) { + name = replyV2->symlinkTarget.name; + length = replyV2->symlinkTarget.length; - /* Skip the symlinkTarget if it's too long. */ - if (length > HGFS_NAME_BUFFER_SIZE(replyV2)) { - LOG(4, (KERN_DEBUG "VMware hgfs: HgfsUnpackGetattrReply: symlink " - "target name too long, ignoring\n")); - return -ENAMETOOLONG; - } - attr->fileName = kmalloc(length + 1, GFP_KERNEL); - if (attr->fileName == NULL) { - LOG(4, (KERN_DEBUG "VMware hgfs: HgfsUnpackGetattrReply: out of " - "memory allocating symlink target name, ignoring\n")); - return -ENOMEM; - } - - /* Copy and convert. From now on, the symlink target is in UTF8. */ - memcpy(attr->fileName, replyV2->symlinkTarget.name, length); - CPNameLite_ConvertFrom(attr->fileName, length, '/'); - attr->fileName[length] = '\0'; + /* Skip the symlinkTarget if it's too long. */ + if (length > HGFS_NAME_BUFFER_SIZE(replyV2)) { + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsUnpackGetattrReply: symlink " + "target name too long, ignoring\n")); + return -ENAMETOOLONG; + } + } + + if (length != 0) { + + attr->fileName = kmalloc(length + 1, GFP_KERNEL); + if (attr->fileName == NULL) { + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsUnpackGetattrReply: out of " + "memory allocating symlink target name, ignoring\n")); + return -ENOMEM; } + + /* Copy and convert. From now on, the symlink target is in UTF8. */ + memcpy(attr->fileName, name, length); + CPNameLite_ConvertFrom(attr->fileName, length, '/'); + attr->fileName[length] = '\0'; } return 0; @@ -280,7 +296,7 @@ * we will issue the getattr using an existing open HGFS handle. * * Results: - * Returns zero on success, or negative error on failure. + * Returns zero on success, or negative error on failure. * * Side effects: * None @@ -291,56 +307,105 @@ static int HgfsPackGetattrRequest(HgfsReq *req, // IN/OUT: Request buffer struct dentry *dentry, // IN: Dentry containing name - HgfsAttrInfo *attr, // OUT: Attrs to update - Bool allowHandleReuse) // IN: Can we use a handle? + Bool allowHandleReuse, // IN: Can we use a handle? + HgfsOp opUsed, // IN: Op to be used + HgfsAttrInfo *attr) // OUT: Attrs to update { - HgfsRequest *requestHeader; - HgfsRequestGetattrV2 *requestV2; - HgfsRequestGetattr *requestV1; size_t reqBufferSize; size_t reqSize; - HgfsFileName *fileName; int result = 0; HgfsHandle handle; + char *fileName = NULL; + uint32 *fileNameLength = NULL; ASSERT(attr); ASSERT(dentry); ASSERT(req); - /* Fill out the request packet. */ - requestHeader = (HgfsRequest *)(HGFS_REQ_PAYLOAD(req)); - attr->requestType = requestHeader->op; + attr->requestType = opUsed; - switch (requestHeader->op) { - case HGFS_OP_GETATTR_V2: - requestV2 = (HgfsRequestGetattrV2 *)requestHeader; + switch (opUsed) { + case HGFS_OP_GETATTR_V3: { + HgfsRequest *requestHeader; + HgfsRequestGetattrV3 *requestV3; + + /* Fill out the request packet. */ + requestHeader = (HgfsRequest *)(HGFS_REQ_PAYLOAD(req)); + requestHeader->op = opUsed; + requestHeader->id = req->id; + + requestV3 = (HgfsRequestGetattrV3 *)HGFS_REQ_PAYLOAD_V3(req); + + /* + * When possible, issue a getattr using an existing handle. This will + * give us slightly better performance on a Windows server, and is more + * correct regardless. If we don't find a handle, fall back on getattr + * by name. + */ + requestV3->hints = 0; + if (allowHandleReuse && HgfsGetHandle(dentry->d_inode, + 0, + &handle) == 0) { + requestV3->fileName.flags = HGFS_FILE_NAME_USE_FILE_DESC; + requestV3->fileName.fid = handle; + requestV3->fileName.length = 0; + requestV3->fileName.caseType = HGFS_FILE_NAME_DEFAULT_CASE; + fileName = NULL; + } else { + fileName = requestV3->fileName.name; + fileNameLength = &requestV3->fileName.length; + requestV3->fileName.flags = 0; + requestV3->fileName.fid = HGFS_INVALID_HANDLE; + requestV3->fileName.caseType = HGFS_FILE_NAME_CASE_SENSITIVE; + } + requestV3->reserved = 0; + reqSize = HGFS_REQ_PAYLOAD_SIZE_V3(requestV3); + reqBufferSize = HGFS_NAME_BUFFER_SIZET(reqSize); + break; + } - /* - * When possible, issue a getattr using an existing handle. This will - * give us slightly better performance on a Windows server, and is more + case HGFS_OP_GETATTR_V2: { + HgfsRequestGetattrV2 *requestV2; + + requestV2 = (HgfsRequestGetattrV2 *)(HGFS_REQ_PAYLOAD(req)); + requestV2->header.op = opUsed; + requestV2->header.id = req->id; + + /* + * When possible, issue a getattr using an existing handle. This will + * give us slightly better performance on a Windows server, and is more * correct regardless. If we don't find a handle, fall back on getattr * by name. */ - if (allowHandleReuse && HgfsGetHandle(dentry->d_inode, - 0, + if (allowHandleReuse && HgfsGetHandle(dentry->d_inode, + 0, &handle) == 0) { requestV2->hints = HGFS_ATTR_HINT_USE_FILE_DESC; requestV2->file = handle; fileName = NULL; } else { requestV2->hints = 0; - fileName = &requestV2->fileName; + fileName = requestV2->fileName.name; + fileNameLength = &requestV2->fileName.length; } reqSize = sizeof *requestV2; reqBufferSize = HGFS_NAME_BUFFER_SIZE(requestV2); break; + } - case HGFS_OP_GETATTR: - requestV1 = (HgfsRequestGetattr *)requestHeader; - fileName = &requestV1->fileName; + case HGFS_OP_GETATTR: { + HgfsRequestGetattr *requestV1; + + requestV1 = (HgfsRequestGetattr *)(HGFS_REQ_PAYLOAD(req)); + requestV1->header.op = opUsed; + requestV1->header.id = req->id; + + fileName = requestV1->fileName.name; + fileNameLength = &requestV1->fileName.length; reqSize = sizeof *requestV1; reqBufferSize = HGFS_NAME_BUFFER_SIZE(requestV1); break; + } default: LOG(4, (KERN_DEBUG "VMware hgfs: HgfsPackGetattrRequest: unexpected " @@ -353,7 +418,7 @@ if (fileName != NULL) { /* Build full name to send to server. */ - if (HgfsBuildPath(fileName->name, reqBufferSize, + if (HgfsBuildPath(fileName, reqBufferSize, dentry) < 0) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsPackGetattrRequest: build path " "failed\n")); @@ -361,22 +426,22 @@ goto out; } LOG(6, (KERN_DEBUG "VMware hgfs: HgfsPackGetattrRequest: getting attrs " - "for \"%s\"\n", fileName->name)); - + "for \"%s\"\n", fileName)); + /* Convert to CP name. */ - result = CPName_ConvertTo(fileName->name, + result = CPName_ConvertTo(fileName, reqBufferSize, - fileName->name); + fileName); if (result < 0) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsPackGetattrRequest: CP " "conversion failed\n")); result = -EINVAL; goto out; } - + /* Unescape the CP name. */ - result = HgfsUnescapeBuffer(fileName->name, result); - fileName->length = result; + result = HgfsEscape_Undo(fileName, result); + *fileNameLength = result; } req->payloadSize = reqSize + result; result = 0; @@ -384,8 +449,8 @@ return result; } -/* - * Public function implementations. +/* + * Public function implementations. */ /* @@ -397,7 +462,7 @@ * Callers can pass one of four replies into it and receive back the * attributes for those replies. * - * Callers must populate attr->requestType so that we know whether to + * Callers must populate attr->requestType so that we know whether to * expect a V1 or V2 Attr struct. * * Results: @@ -408,21 +473,28 @@ * *---------------------------------------------------------------------- */ -int +int HgfsUnpackCommonAttr(HgfsReq *req, // IN: Reply packet HgfsAttrInfo *attrInfo) // OUT: Attributes { + HgfsReplyGetattrV3 *getattrReplyV3; HgfsReplyGetattrV2 *getattrReplyV2; HgfsReplyGetattr *getattrReplyV1; + HgfsReplySearchReadV3 *searchReadReplyV3; HgfsReplySearchReadV2 *searchReadReplyV2; HgfsReplySearchRead *searchReadReplyV1; + HgfsDirEntry *dirent; HgfsAttrV2 *attrV2 = NULL; HgfsAttr *attrV1 = NULL; - + ASSERT(req); ASSERT(attrInfo); switch (attrInfo->requestType) { + case HGFS_OP_GETATTR_V3: + getattrReplyV3 = (HgfsReplyGetattrV3 *)(HGFS_REP_PAYLOAD_V3(req)); + attrV2 = &getattrReplyV3->attr; + break; case HGFS_OP_GETATTR_V2: getattrReplyV2 = (HgfsReplyGetattrV2 *)(HGFS_REQ_PAYLOAD(req)); attrV2 = &getattrReplyV2->attr; @@ -431,6 +503,11 @@ getattrReplyV1 = (HgfsReplyGetattr *)(HGFS_REQ_PAYLOAD(req)); attrV1 = &getattrReplyV1->attr; break; + case HGFS_OP_SEARCH_READ_V3: + searchReadReplyV3 = (HgfsReplySearchReadV3 *)(HGFS_REP_PAYLOAD_V3(req)); + dirent = (HgfsDirEntry *)searchReadReplyV3->payload; + attrV2 = &dirent->attr; + break; case HGFS_OP_SEARCH_READ_V2: searchReadReplyV2 = (HgfsReplySearchReadV2 *)(HGFS_REQ_PAYLOAD(req)); attrV2 = &searchReadReplyV2->attr; @@ -518,95 +595,6 @@ /* - *----------------------------------------------------------------------------- - * - * HgfsEscapeBuffer -- - * - * Escape any characters that are not legal in a linux filename, - * which is just the character "/". We also of course have to - * escape the escape character, which is "%". - * - * sizeBufOut must account for the NUL terminator. - * - * XXX: See the comments in staticEscape.c and staticEscapeW.c to understand - * why this interface sucks. - * - * Results: - * On success, the size (excluding the NUL terminator) of the - * escaped, NUL terminated buffer. - * On failure (bufOut not big enough to hold result), negative value. - * - * Side effects: - * None - * - *----------------------------------------------------------------------------- - */ - -int -HgfsEscapeBuffer(char const *bufIn, // IN: Buffer with unescaped input - uint32 sizeIn, // IN: Size of input buffer (chars) - uint32 sizeBufOut, // IN: Size of output buffer (bytes) - char *bufOut) // OUT: Buffer for escaped output -{ - /* - * This is just a wrapper around the more general escape - * routine; we pass it the correct bitvector and the - * buffer to escape. [bac] - */ - EscBitVector bytesToEsc; - - ASSERT(bufIn); - ASSERT(bufOut); - - /* Set up the bitvector for "/" and "%" */ - EscBitVector_Init(&bytesToEsc); - EscBitVector_Set(&bytesToEsc, (unsigned char)'%'); - EscBitVector_Set(&bytesToEsc, (unsigned char)'/'); - - return StaticEscape_Do('%', - &bytesToEsc, - bufIn, - sizeIn, - sizeBufOut, - bufOut); -} - - -/* - *----------------------------------------------------------------------------- - * - * HgfsUnescapeBuffer -- - * - * Unescape a buffer that was escaped using HgfsEscapeBuffer. - * - * The unescaping is done in place in the input buffer, and - * can not fail. - * - * Results: - * The size (excluding the NUL terminator) of the unescaped, NUL - * terminated buffer. - * - * Side effects: - * None - * - *----------------------------------------------------------------------------- - */ - -int -HgfsUnescapeBuffer(char *bufIn, // IN: Buffer to be unescaped - uint32 sizeIn) // IN: Size of input buffer -{ - /* - * This is just a wrapper around the more general unescape - * routine; we pass it the correct escape character and the - * buffer to unescape. [bac] - */ - ASSERT(bufIn); - return StaticEscape_Undo('%', bufIn, sizeIn); -} - - -/* *---------------------------------------------------------------------- * * HgfsChangeFileAttributes -- @@ -638,10 +626,10 @@ si = HGFS_SB_TO_COMMON(inode->i_sb); - LOG(6, (KERN_DEBUG "VMware hgfs: HgfsChangeFileAttributes: entered\n")); + LOG(6, (KERN_DEBUG "VMware hgfs: HgfsChangeFileAttributes: entered\n")); HgfsSetFileType(inode, attr); - /* + /* * Set the access mode. For hosts that don't give us group or other * bits (Windows), we use the owner bits in their stead. */ @@ -662,7 +650,7 @@ } else { inode->i_mode |= ((inode->i_mode & S_IRWXU) >> 6); } - + /* Mask the access mode. */ switch (attr->type) { case HGFS_FILE_TYPE_REGULAR: @@ -676,17 +664,17 @@ break; } - /* + /* * This field is used to represent the number of hard links. If the file is * really a file, this is easy; our filesystem doesn't support hard-linking, - * so we just set it to 1. If the field is a directory, the number of links + * so we just set it to 1. If the field is a directory, the number of links * represents the number of subdirectories, including '.' and "..". * * In either case, what we're doing isn't ideal. We've carefully tracked the * number of links through calls to HgfsMkdir and HgfsDelete, and now some * revalidate will make us trample on the number of links. But we have no * choice: someone on the server may have made our local view of the number - * of links inconsistent (by, say, removing a directory) , and without the + * of links inconsistent (by, say, removing a directory) , and without the * ability to retrieve nlink via getattr, we have no way of knowing that. * * XXX: So in the future, adding nlink to getattr would be nice. At that @@ -698,8 +686,8 @@ */ inode->i_nlink = 1; - /* - * Use the stored uid and gid if we were given them at mount-time, or if + /* + * Use the stored uid and gid if we were given them at mount-time, or if * the server didn't give us a uid or gid. */ if (si->uidSet || (attr->mask & HGFS_ATTR_VALID_USERID) == 0) { @@ -718,7 +706,7 @@ inode->i_blksize = HGFS_BLOCKSIZE; #endif - /* + /* * Invalidate cached pages if we didn't receive the file size, or if it has * changed on the server. */ @@ -743,7 +731,7 @@ HGFS_SET_TIME(inode->i_atime, HGFS_GET_CURRENT_TIME()); } - /* + /* * Invalidate cached pages if we didn't receive the modification time, or if * it has changed on the server. */ @@ -752,7 +740,7 @@ HGFS_SET_TIME(newTime, attr->writeTime); if (!HGFS_EQUAL_TIME(newTime, inode->i_mtime)) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsChangeFileAttributes: new mod " - "time: %ld:%lu, old mod time: %ld:%lu\n", + "time: %ld:%lu, old mod time: %ld:%lu\n", HGFS_PRINT_TIME(newTime), HGFS_PRINT_TIME(inode->i_mtime))); needInvalidate = TRUE; } @@ -776,7 +764,7 @@ HGFS_SET_TIME(inode->i_ctime, HGFS_GET_CURRENT_TIME()); } - /* + /* * Compare old size and write time with new size and write time. If there's * a difference (or if we didn't get a new size or write time), the file * must have been written to, and we need to invalidate our cached pages. @@ -799,8 +787,8 @@ * for the indicated remote name, and if it succeeds copy the * results of the getattr into the provided HgfsAttrInfo. * - * attr->fileName will be allocated on success if the file is a - * symlink; it's the caller's duty to free it. + * attr->fileName will be allocated on success if the file is a + * symlink; it's the caller's duty to free it. * * Results: * Returns zero on success, or a negative error on failure. @@ -817,7 +805,8 @@ { struct HgfsSuperInfo *si; HgfsReq *req; - HgfsReply *replyHeader; + HgfsStatus replyStatus; + HgfsOp opUsed; int result = 0; HgfsRequest *requestHeader; Bool allowHandleReuse = TRUE; @@ -838,20 +827,19 @@ requestHeader = (HgfsRequest *)(HGFS_REQ_PAYLOAD(req)); retry: - /* Fill out the request packet. */ - requestHeader->op = atomic_read(&hgfsVersionGetattr); - requestHeader->id = req->id; - result = HgfsPackGetattrRequest(req, dentry, attr, allowHandleReuse); + + opUsed = atomic_read(&hgfsVersionGetattr); + result = HgfsPackGetattrRequest(req, dentry, allowHandleReuse, opUsed, attr); if (result != 0) { - LOG(4, (KERN_DEBUG "VMware hgfs: HgfsPrivateGetattr: no attrs\n")); + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsPrivateGetattr: no attrs\n")); goto out; } result = HgfsSendRequest(req); if (result == 0) { LOG(6, (KERN_DEBUG "VMware hgfs: HgfsPrivateGetattr: got reply\n")); - replyHeader = (HgfsReply *)(HGFS_REQ_PAYLOAD(req)); - result = HgfsStatusConvertToLinux(replyHeader->status); + replyStatus = HgfsReplyStatus(req); + result = HgfsStatusConvertToLinux(replyStatus); /* * If the getattr succeeded on the server, copy the stats @@ -862,7 +850,7 @@ result = HgfsUnpackGetattrReply(req, attr); break; case -EBADF: - /* + /* * This can happen if we attempted a getattr by handle and the handle * was closed. Because we have no control over the backdoor, it's * possible that an attacker closed our handle, in which case the @@ -875,16 +863,21 @@ goto retry; } - /* + /* * There's no reason why the server should have sent us this error * when we haven't used a handle. But to prevent an infinite loop in * the driver, let's make sure that we don't retry again. */ break; - + case -EPROTO: - /* Retry with Version 1 of Getattr. Set globally. */ - if (attr->requestType == HGFS_OP_GETATTR_V2) { + /* Retry with older version(s). Set globally. */ + if (attr->requestType == HGFS_OP_GETATTR_V3) { + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsPrivateGetattr: Version 3 " + "not supported. Falling back to version 2.\n")); + atomic_set(&hgfsVersionGetattr, HGFS_OP_GETATTR_V2); + goto retry; + } else if (attr->requestType == HGFS_OP_GETATTR_V2) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsPrivateGetattr: Version 2 " "not supported. Falling back to version 1.\n")); atomic_set(&hgfsVersionGetattr, HGFS_OP_GETATTR); @@ -958,7 +951,7 @@ * * XXX: This logic is also racy. After our call to HgfsInodeLookup(), it's * possible another caller came in and grabbed that inode number, which - * will cause us to collide in iget() and step on their inode. + * will cause us to collide in iget() and step on their inode. */ if (attr->mask & HGFS_ATTR_VALID_FILEID) { struct inode *oldInode; @@ -966,16 +959,16 @@ oldInode = HgfsInodeLookup(sb, attr->hostFileId); if (oldInode) { - /* + /* * If this inode's inode number was generated via iunique(), we * have a collision and cannot use the server's inode number. - * Otherwise, we should reuse this inode. + * Otherwise, we should reuse this inode. */ iinfo = INODE_GET_II_P(oldInode); if (iinfo->isFakeInodeNumber) { LOG(6, (KERN_DEBUG "VMware hgfs: HgfsIget: found existing " - "iuniqued inode %"FMT64"d, generating new one\n", - attr->hostFileId)); + "iuniqued inode %"FMT64"d, generating new one\n", + attr->hostFileId)); ino = iunique(sb, HGFS_RESERVED_INO); isFakeInodeNumber = TRUE; } else { @@ -988,13 +981,13 @@ ino = attr->hostFileId; } } else { - /* + /* * Get the next available inode number. There is a bit of a problem - * with using iunique() in cases where HgfsIget was called to - * instantiate an inode that's already in memory to a new dentry. In + * with using iunique() in cases where HgfsIget was called to + * instantiate an inode that's already in memory to a new dentry. In * such cases, we would like to get the old inode. But if we're * generating inode numbers with iunique(), we'll always have a new - * inode number, thus we'll never get the old inode. This is + * inode number, thus we'll never get the old inode. This is * especially unfortunate when the old inode has some cached pages * attached to it that we won't be able to reuse. * @@ -1012,13 +1005,13 @@ LOG(6, (KERN_DEBUG "VMware hgfs: HgfsIget: calling iget on inode number " "%lu\n", ino)); - + /* Now we have a good inode number, get the inode itself. */ - inode = iget(sb, ino); + inode = HgfsGetInode(sb, ino); if (inode) { - /* + /* * On an allocation failure in read_super, the inode will have been * marked "bad". If it was, we certainly don't want to start playing with * the HgfsInodeInfo. So quietly put the inode back and fail. @@ -1027,8 +1020,8 @@ LOG(6, (KERN_DEBUG "VMware hgfs: HgfsIget: encountered bad inode\n")); iput(inode); return NULL; - } - + } + iinfo = INODE_GET_II_P(inode); iinfo->isFakeInodeNumber = isFakeInodeNumber; iinfo->isReferencedInode = TRUE; @@ -1048,9 +1041,9 @@ * Tie a dentry to a looked up or created inode. Callers may choose to * supply their own attributes, or may leave attr NULL in which case the * attributes will be queried from the server. Likewise, an inode number - * of zero may be specified, in which case HgfsIget will get one from the + * of zero may be specified, in which case HgfsIget will get one from the * server or, barring that, from iunique(). - * + * * Results: * Zero on success, negative error otherwise. * @@ -1087,7 +1080,7 @@ } /* - * Get the inode with this inode number and the attrs we got from + * Get the inode with this inode number and the attrs we got from * the server. */ inode = HgfsIget(dentry->d_sb, ino, attr); @@ -1125,7 +1118,7 @@ *----------------------------------------------------------------------------- */ -int +int HgfsBuildPath(unsigned char *buffer, // IN/OUT: Buffer to write into size_t bufferLen, // IN: Size of buffer struct dentry *dentry) // IN: First dentry to walk @@ -1141,10 +1134,10 @@ si = HGFS_SB_TO_COMMON(dentry->d_sb); originalBuffer = buffer; - - /* + + /* * Buffer must hold at least the share name (which is already prefixed with - * a forward slash), and nul. + * a forward slash), and nul. */ shortestNameLength = si->shareNameLen + 1; if (bufferLen < shortestNameLength) { @@ -1154,7 +1147,7 @@ /* Short-circuit if we're at the root already. */ if (IS_ROOT(dentry)) { - LOG(4, (KERN_DEBUG "VMware hgfs: HgfsBuildPath: Sending root \"%s\"\n", + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsBuildPath: Sending root \"%s\"\n", buffer)); return shortestNameLength; } @@ -1208,7 +1201,7 @@ /* Don't forget the share name length (which also accounts for the nul). */ retval += shortestNameLength; - LOG(4, (KERN_DEBUG "VMware hgfs: HgfsBuildPath: Built \"%s\"\n", + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsBuildPath: Built \"%s\"\n", originalBuffer)); return retval; @@ -1222,7 +1215,7 @@ * * Reset the age of this dentry by setting d_time to now. * - * XXX: smb_renew_times from smbfs claims it is safe to reset the time of + * XXX: smb_renew_times from smbfs claims it is safe to reset the time of * all the parent dentries too, but how is that possible? If I stat a file * using a relative path, only that relative path will be validated. Sure, * it means that the parents still /exist/, but that doesn't mean their @@ -1386,7 +1379,7 @@ /* * Store the file information for this open() in the file*. This needs * to be freed on a close(). Note that we trim all flags from the open - * mode and increment it so that it is guaranteed to be non-zero, because + * mode and increment it so that it is guaranteed to be non-zero, because * callers of HgfsGetHandle may pass in zero as the desired mode if they * don't care about the mode of the opened handle. * @@ -1401,8 +1394,8 @@ fileInfo->handle = handle; fileInfo->mode = HGFS_OPEN_MODE_ACCMODE(mode) + 1; FILE_SET_FI_P(file, fileInfo); - - /* + + /* * I don't think we need any VFS locks since we're only touching the HGFS * specific state. But we should still acquire our own lock. * @@ -1421,7 +1414,7 @@ * * HgfsReleaseFileInfo -- * - * Release HGFS-specific file information struct created in + * Release HGFS-specific file information struct created in * HgfsCreateFileInfo. * * Results: @@ -1433,7 +1426,7 @@ *----------------------------------------------------------------------------- */ -void +void HgfsReleaseFileInfo(struct file *file) // IN: File pointer to detach from { HgfsFileInfo *fileInfo; @@ -1460,8 +1453,8 @@ * The handle retrieved satisfies the mode desired by the client. * * The desired mode does not correspond directly to HgfsOpenMode. Callers - * should either increment the desired HgfsOpenMode, or, if any mode will - * do, pass zero instead. This is in line with the Linux kernel's behavior + * should either increment the desired HgfsOpenMode, or, if any mode will + * do, pass zero instead. This is in line with the Linux kernel's behavior * (see do_filp_open() and open_namei() for details). * * Results: @@ -1486,9 +1479,9 @@ LOG(6, (KERN_DEBUG "VMware hgfs: HgfsGetHandle: desired mode %u\n", mode)); - /* + /* * We may have been called from a dentry without an associated inode. - * HgfsReadSuper is one such caller. No inode means no open files, so + * HgfsReadSuper is one such caller. No inode means no open files, so * return an error. */ if (inode == NULL) { @@ -1497,7 +1490,7 @@ } iinfo = INODE_GET_II_P(inode); - /* + /* * Unfortunately, we can't reuse handles belonging to directories. These * handles were created by a SearchOpen request, but the server itself * backed them with an artificial list of dentries populated via scandir. So @@ -1508,16 +1501,16 @@ LOG(8, (KERN_DEBUG "VMware hgfs: HgfsGetHandle: Called on directory\n")); return -EINVAL; } - - /* + + /* * Iterate over the open handles for this inode, and find one that allows - * the given mode. A desired mode of zero means "any mode will do". + * the given mode. A desired mode of zero means "any mode will do". * Otherwise return an error; */ spin_lock(&hgfsBigLock); list_for_each(cur, &iinfo->files) { HgfsFileInfo *finfo = list_entry(cur, HgfsFileInfo, list); - + if (mode == 0 || finfo->mode & mode) { *handle = finfo->handle; found = TRUE; @@ -1527,7 +1520,7 @@ spin_unlock(&hgfsBigLock); if (found) { - LOG(6, (KERN_DEBUG "VMware hgfs: HgfsGetHandle: Returning handle %d\n", + LOG(6, (KERN_DEBUG "VMware hgfs: HgfsGetHandle: Returning handle %d\n", *handle)); return 0; } else { @@ -1543,17 +1536,17 @@ * * HgfsStatusConvertToLinux -- * - * Convert a cross-platform HGFS status code to its Linux-kernel specific - * counterpart. + * Convert a cross-platform HGFS status code to its Linux-kernel specific + * counterpart. * - * Rather than encapsulate the status codes within an array indexed by the - * various HGFS status codes, we explicitly enumerate them in a switch - * statement, saving the reader some time when matching HGFS status codes + * Rather than encapsulate the status codes within an array indexed by the + * various HGFS status codes, we explicitly enumerate them in a switch + * statement, saving the reader some time when matching HGFS status codes * against Linux status codes. * * Results: * Zero if the converted status code represents success, negative error - * otherwise. Unknown status codes are converted to the more generic + * otherwise. Unknown status codes are converted to the more generic * "protocol error" status code to maintain forwards compatibility. * * Side effects: @@ -1613,3 +1606,156 @@ return -EIO; } } + + +/* + *---------------------------------------------------------------------------- + * + * HgfsSetUidGid -- + * + * Sets the uid and gid of the host file represented by the provided + * dentry. + * + * Note that this function assumes it is being called for a file that has + * been created on the host with the correct gid if the sgid bit is set for + * the parent directory. That is, we treat the presence of the sgid bit in + * the parent direcory's mode as an indication not to set the gid manually + * ourselves here. If we did, we would clobber the gid that the host file + * system chose for us automatically when the file was created. + * + * Also note that the sgid bit itself would have been propagated to the new + * file by the host file system as well. + * + * Results: + * None. + * + * Side effects: + * The host file's uid and gid are modified if the hgfs server has + * permission to do so. + * + *---------------------------------------------------------------------------- + */ + +void +HgfsSetUidGid(struct inode *parent, // IN: parent inode + struct dentry *dentry, // IN: dentry of file to update + uid_t uid, // IN: uid to set + gid_t gid) // IN: gid to set +{ + struct iattr setUidGid; + + setUidGid.ia_valid = ATTR_UID; + setUidGid.ia_uid = uid; + + /* + * Only set the gid if the host file system wouldn't have for us. See the + * comment in the function header. + */ + if (!parent || !(parent->i_mode & S_ISGID)) { + setUidGid.ia_valid |= ATTR_GID; + setUidGid.ia_gid = gid; + } + + /* + * After the setattr, we desperately want a revalidate so we can + * get the true attributes from the server. However, the setattr + * may have done that for us. To prevent a spurious revalidate, + * reset the dentry's time before the setattr. That way, if setattr + * ends up revalidating the dentry, the subsequent call to + * revalidate will do nothing. + */ + HgfsDentryAgeForce(dentry); + HgfsSetattr(dentry, &setUidGid); + HgfsRevalidate(dentry); +} + + +/* + *---------------------------------------------------------------------------- + * + * HgfsGetInode -- + * + * This function replaces iget() and should be called instead of it. In newer + * kernels that have removed the iget() interface, GetInode() obtains an inode + * and if it is a new one, then initializes the inode by calling + * HgfsDoReadInode(). In older kernels that support the iget() interface, + * HgfsDoReadInode() is called by iget() internally. + * + * Results: + * A new inode object on success, NULL on error. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +struct inode * +HgfsGetInode(struct super_block *sb, // IN: file system superblock object + ino_t ino) // IN: inode number to assign to new inode +{ +#ifdef VMW_USE_IGET_LOCKED + struct inode *inode; + + inode = iget_locked(sb, ino); + if (inode && (inode->i_state & I_NEW)) { + HgfsDoReadInode(inode); + unlock_new_inode(inode); + } + return inode; +#else + return iget(sb, ino); +#endif +} + + +/* + *---------------------------------------------------------------------------- + * + * HgfsDoReadInode -- + * + * A filesystem wide function that is called to initialize a new inode. + * This is called from two different places depending on the kernel version. + * In older kernels that provide the iget() interface, this function is + * called by the kernel as part of inode initialization (from + * HgfsDoReadInode). In newer kernels that call iget_locked(), this + * function is called by filesystem code to initialize the new inode. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +void +HgfsDoReadInode(struct inode *inode) // IN: Inode to initialize +{ + HgfsInodeInfo *iinfo = INODE_GET_II_P(inode); + + /* + * If the vfs inode is not embedded within the HgfsInodeInfo, then we + * haven't yet allocated the HgfsInodeInfo. Do so now. + * + * XXX: We could allocate with GFP_ATOMIC. But instead, we'll do a standard + * allocation and mark the inode "bad" if the allocation fails. This'll + * make all subsequent operations on the inode fail, which is what we want. + */ +#ifndef VMW_EMBED_INODE + iinfo = kmem_cache_alloc(hgfsInodeCache, GFP_KERNEL); + if (!iinfo) { + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDoReadInode: no memory for " + "iinfo!\n")); + make_bad_inode(inode); + return; + } +#endif + INODE_SET_II_P(inode, iinfo); + INIT_LIST_HEAD(&iinfo->files); + iinfo->isReferencedInode = FALSE; + iinfo->isFakeInodeNumber = FALSE; + iinfo->createdAndUnopened = FALSE; + +} diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/fsutil.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/fsutil.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/fsutil.h 2008-01-28 08:02:46.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/fsutil.h 2008-10-13 08:01:43.000000000 +0100 @@ -37,7 +37,7 @@ #include "vm_basic_types.h" #include "hgfsProto.h" -/* +/* * Struct used to pass around attributes that Linux cares about. * These aren't just the attributes seen in HgfsAttr[V2]; we add a filename * pointer for convenience (used by SearchRead and Getattr). @@ -64,12 +64,6 @@ /* Public functions (with respect to the entire module). */ int HgfsUnpackCommonAttr(HgfsReq *req, HgfsAttrInfo *attr); -int HgfsEscapeBuffer(char const *bufIn, - uint32 sizeIn, - uint32 sizeBufOut, - char *bufOut); -int HgfsUnescapeBuffer(char *bufIn, - uint32 sizeIn); void HgfsChangeFileAttributes(struct inode *inode, HgfsAttrInfo const *attr); int HgfsPrivateGetattr(struct dentry *dentry, @@ -93,5 +87,12 @@ HgfsOpenMode mode, HgfsHandle *handle); int HgfsStatusConvertToLinux(HgfsStatus hgfsStatus); +void HgfsSetUidGid(struct inode *parent, + struct dentry *dentry, + uid_t uid, + gid_t gid); +struct inode *HgfsGetInode(struct super_block *sb, ino_t ino); +void HgfsDoReadInode(struct inode *inode); + #endif // _HGFS_DRIVER_FSUTIL_H_ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/guest_msg_def.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/guest_msg_def.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/guest_msg_def.h 2008-01-28 08:02:46.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/guest_msg_def.h 2008-10-13 08:01:42.000000000 +0100 @@ -83,5 +83,10 @@ #define GUESTMSG_FLAG_COOKIE 0x80000000 #define GUESTMSG_FLAG_ALL GUESTMSG_FLAG_COOKIE +/* + * Maximum size of incoming message. This is to prevent denial of host service + * attacks from guest applications. + */ +#define GUESTMSG_MAX_IN_SIZE (64 * 1024) #endif /* _GUEST_MSG_DEF_H_ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/hgfsBd.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/hgfsBd.c --- open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/hgfsBd.c 2008-01-28 08:02:46.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/hgfsBd.c 2008-10-13 08:01:43.000000000 +0100 @@ -42,9 +42,11 @@ /* *----------------------------------------------------------------------------- * - * HgfsBd_GetBuf -- + * HgfsBdGetBufInt -- * - * Get a buffer to send hgfs requests in. + * Allocates a buffer to send a hgfs request in. This can be either a + * HGFS_PACKET_MAX or HGFS_LARGE_PACKET_MAX size buffer depending on the + * external funciton called. * * Results: * Pointer to a buffer that has the correct backdoor command prefix for @@ -52,20 +54,20 @@ * NULL on failure (not enough memory). * * Side effects: - * None + * None. * *----------------------------------------------------------------------------- */ -char * -HgfsBd_GetBuf(void) +static char * +HgfsBdGetBufInt(size_t bufSize) { /* * Allocate a buffer that is large enough for an HGFS packet and the * synchronous HGFS command, write the command, and return a pointer that * points into the buffer, after the command. */ - size_t len = HGFS_PACKET_MAX + HGFS_SYNC_REQREP_CLIENT_CMD_LEN; + size_t len = bufSize + HGFS_SYNC_REQREP_CLIENT_CMD_LEN; char *buf = (char*) calloc(sizeof(char), len); if (!buf) { @@ -82,6 +84,51 @@ /* *----------------------------------------------------------------------------- * + * HgfsBd_GetBuf -- + * + * Get a buffer of size HGFS_PACKET_MAX to send hgfs requests in. + * + * Results: + * See HgfsBdGetBufInt. + * + * Side effects: + * Allocates memory that must be freed with a call to HgfsBd_PutBuf. + * + *----------------------------------------------------------------------------- + */ + +char * +HgfsBd_GetBuf(void) +{ + return HgfsBdGetBufInt(HGFS_PACKET_MAX); +} + +/* + *----------------------------------------------------------------------------- + * + * HgfsBd_GetLargeBuf -- + * + * Get a buffer of size HGFS_LARGE_PACKET_MAX to send hgfs requests in. + * + * Results: + * See HgfsBdGetBufInt. + * + * Side effects: + * Allocates memory that must be freed with a call to HgfsBd_PutBuf. + * + *----------------------------------------------------------------------------- + */ + +char * +HgfsBd_GetLargeBuf(void) +{ + return HgfsBdGetBufInt(HGFS_LARGE_PACKET_MAX); +} + + +/* + *----------------------------------------------------------------------------- + * * HgfsBd_PutBuf -- * * Release a buffer obtained with HgfsBd_GetBuf. @@ -215,7 +262,7 @@ return -1; } - ASSERT(replyLen <= HGFS_PACKET_MAX); + ASSERT(replyLen <= HGFS_LARGE_PACKET_MAX); *packetOut = reply; *packetSize = replyLen; diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/hgfsBd.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/hgfsBd.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/hgfsBd.h 2008-01-28 08:02:46.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/hgfsBd.h 2008-10-13 08:01:43.000000000 +0100 @@ -29,6 +29,8 @@ char *HgfsBd_GetBuf(void); +char *HgfsBd_GetLargeBuf(void); + void HgfsBd_PutBuf(char *); RpcOut *HgfsBd_GetChannel(void); diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/hgfsEscape.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/hgfsEscape.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/hgfsEscape.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/hgfsEscape.h 2008-10-13 08:01:42.000000000 +0100 @@ -0,0 +1,52 @@ +/********************************************************* + * Copyright (C) 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 General Public License as published by the + * Free Software Foundation version 2 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 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 + * + *********************************************************/ + +/* + * hgfsEscape.h -- + * + * Escape and unescape filenames that are not legal on a particular + * platform. + * + */ + +#ifndef __HGFS_ESCAPE_H__ +#define __HGFS_ESCAPE_H__ + +#if defined(WIN32) +int HgfsEscape_GetSizeW(wchar_t const *bufIn, // IN + uint32 sizeIn); // IN (chars) +int HgfsEscape_DoW(wchar_t const *bufIn, // IN + uint32 sizeIn, // IN (chars) + uint32 sizeBufOut, // IN (bytes) + wchar_t *bufOut); // OUT + +int HgfsEscape_Undo(char *bufIn, // IN + uint32 sizeIn); // IN + +int HgfsEscape_UndoW(wchar_t *bufIn, // IN + uint32 sizeIn); // IN +#else +int HgfsEscape_Do(char const *bufIn, // IN + uint32 sizeIn, // IN (chars) + uint32 sizeBufOut, // IN (bytes) + char *bufOut); // OUT + +int HgfsEscape_Undo(char *bufIn, // IN + uint32 sizeIn); // IN +#endif // defined(WIN32) +#endif // __HGFS_ESCAPE_H__ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/hgfsEscapeLinux.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/hgfsEscapeLinux.c --- open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/hgfsEscapeLinux.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/hgfsEscapeLinux.c 2008-10-13 08:01:42.000000000 +0100 @@ -0,0 +1,117 @@ +/********************************************************* + * Copyright (C) 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 General Public License as published by the + * Free Software Foundation version 2 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 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 + * + *********************************************************/ + +/* + * hgfsEscapeLinux.c -- + * + * Escape and unescape filenames that are not legal on linux. + * + */ + +#include "staticEscape.h" +#include "vmware.h" +#include "hgfsEscape.h" + + +/* + *----------------------------------------------------------------------------- + * + * HgfsEscape_Do -- + * + * Escape any characters that are not legal in a linux filename, + * which is just the character "/". We also of course have to + * escape the escape character, which is "%". + * + * sizeBufOut must account for the NUL terminator. + * + * XXX: See the comments in staticEscape.c and staticEscapeW.c to understand + * why this interface sucks. + * + * Results: + * On success, the size (excluding the NUL terminator) of the + * escaped, NUL terminated buffer. + * On failure (bufOut not big enough to hold result), negative value. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +int +HgfsEscape_Do(char const *bufIn, // IN: Buffer with unescaped input + uint32 sizeIn, // IN: Size of input buffer (chars) + uint32 sizeBufOut, // IN: Size of output buffer (bytes) + char *bufOut) // OUT: Buffer for escaped output +{ + /* + * This is just a wrapper around the more general escape + * routine; we pass it the correct bitvector and the + * buffer to escape. [bac] + */ + EscBitVector bytesToEsc; + + ASSERT(bufIn); + ASSERT(bufOut); + + /* Set up the bitvector for "/" and "%" */ + EscBitVector_Init(&bytesToEsc); + EscBitVector_Set(&bytesToEsc, (unsigned char)'%'); + EscBitVector_Set(&bytesToEsc, (unsigned char)'/'); + + return StaticEscape_Do('%', + &bytesToEsc, + bufIn, + sizeIn, + sizeBufOut, + bufOut); +} + + +/* + *----------------------------------------------------------------------------- + * + * HgfsEscape_Undo -- + * + * Unescape a buffer that was escaped using HgfsEscapeBuffer. + * + * The unescaping is done in place in the input buffer, and + * can not fail. + * + * Results: + * The size (excluding the NUL terminator) of the unescaped, NUL + * terminated buffer. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +int +HgfsEscape_Undo(char *bufIn, // IN: Buffer to be unescaped + uint32 sizeIn) // IN: Size of input buffer +{ + /* + * This is just a wrapper around the more general unescape + * routine; we pass it the correct escape character and the + * buffer to unescape. [bac] + */ + ASSERT(bufIn); + return StaticEscape_Undo('%', bufIn, sizeIn); +} diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/hgfs.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/hgfs.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/hgfs.h 2008-01-28 08:02:46.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/hgfs.h 2008-10-13 08:01:42.000000000 +0100 @@ -39,6 +39,11 @@ #include "includeCheck.h" #include "vm_assert.h" +/* + * Maximum number of pages to transfer to/from the HGFS server for V3 protocol + * operations that support large requests/replies, e.g. reads and writes. + */ +#define HGFS_LARGE_IO_MAX_PAGES 15 /* * Maximum allowed packet size in bytes. All hgfs code should be made @@ -46,6 +51,19 @@ */ #define HGFS_PACKET_MAX 6144 +/* + * The HGFS_LARGE_PACKET_MAX size is used to allow guests to make + * read / write requests of sizes larger than HGFS_PACKET_MAX. The larger size + * can only be used with server operations that are specified to be large packet + * capable in hgfsProto.h. + */ +#define HGFS_LARGE_PACKET_MAX ((4096 * HGFS_LARGE_IO_MAX_PAGES) + 2048) + +/* Maximum number of bytes to read or write to a hgfs server in a single packet. */ +#define HGFS_IO_MAX 4096 + +/* Maximum number of bytes to read or write to a V3 server in a single hgfs packet. */ +#define HGFS_LARGE_IO_MAX (HGFS_LARGE_IO_MAX_PAGES * 4096) /* * Open mode @@ -113,8 +131,8 @@ * error codes travelled from hgfsProto.h to hgfs.h in that same change. Worse, * we GA'ed a product (Server 1.0) this way. * - * XXX: I've reversed the order because otherwise new HGFS clients working - * against WS55-era HGFS servers will think they got HGFS_STATUS_GENERIC_ERROR + * XXX: I've reversed the order because otherwise new HGFS clients working + * against WS55-era HGFS servers will think they got HGFS_STATUS_GENERIC_ERROR * when the server sent them HGFS_STATUS_INVALID_NAME. This was a problem * the Linux client converts HGFS_STATUS_GENERIC_ERROR to -EIO, which causes * HgfsLookup to fail unexpectedly (normally HGFS_STATUS_INVALID_NAME is @@ -136,6 +154,7 @@ HGFS_STATUS_NO_SPACE, HGFS_STATUS_OPERATION_NOT_SUPPORTED, HGFS_STATUS_NAME_TOO_LONG, + HGFS_STATUS_INVALID_PARAMETER, } HgfsStatus; /* @@ -150,9 +169,9 @@ * the command and the space into some buffer that is then sent over the * backdoor. * - * In Host --> Guest RPC traffic, the host endpoint is TCLO and the guest - * endpoint is RpcIn. TCLO is a particularly confusing name choice which dates - * back to when the host was to send raw TCL code to the guest (TCL Out == + * In Host --> Guest RPC traffic, the host endpoint is TCLO and the guest + * endpoint is RpcIn. TCLO is a particularly confusing name choice which dates + * back to when the host was to send raw TCL code to the guest (TCL Out == * TCLO). * * In Guest --> Host RPC traffic, the guest endpoint is RpcOut and the host @@ -161,11 +180,11 @@ /* * When an RPCI listener registers for this command, HGFS requests are expected - * to be synchronously sent from the guest and replies are expected to be + * to be synchronously sent from the guest and replies are expected to be * synchronously returned. - * - * When an RpcIn listener registers for this command, requests are expected to - * be asynchronously sent from the host and synchronously returned from the + * + * When an RpcIn listener registers for this command, requests are expected to + * be asynchronously sent from the host and synchronously returned from the * guest. * * In short, an endpoint sending this command is sending a request whose reply @@ -176,41 +195,6 @@ #define HGFS_SYNC_REQREP_CLIENT_CMD_LEN (sizeof HGFS_SYNC_REQREP_CLIENT_CMD - 1) /* - * When an RPCI listener registers for this command, HGFS requests are expected - * to be synchronously sent from the guest and replies are expected to be - * asynchronously returned. - * - * When an RpcIn listener registers for this command, requests are expected to - * be asynchronously sent from the host and asynchronously returned from the - * guest. - * - * In short, an endpoint sending this command is sending a request whose reply - * should be returned asynchronously. - */ -#define HGFS_ASYNC_REQUEST_CMD "g" -#define HGFS_ASYNC_REQUEST_CLIENT_CMD HGFS_ASYNC_REQUEST_CMD " " -#define HGFS_ASYNC_REQUEST_CLIENT_CMD_LEN (sizeof HGFS_ASYNC_REQUEST_CLIENT_CMD - 1) - -/* - * An endpoint sending this command is sending an asynchronous HGFS reply to a - * request sent by the HGFS_ASYNC_REQUEST command. - */ -#define HGFS_ASYNC_REPLY_CMD "h" -#define HGFS_ASYNC_REPLY_CLIENT_CMD HGFS_ASYNC_REPLY_CMD " " -#define HGFS_ASYNC_REPLY_CLIENT_CMD_LEN (sizeof HGFS_ASYNC_REPLY_CLIENT_CMD - 1) - -/* - * Ensuring that all commands are the same length eases the implementation of - * HGFS client code. - */ -MY_ASSERTS(HGFS_CMD_LENGTHS, - ASSERT_ON_COMPILE(HGFS_SYNC_REQREP_CLIENT_CMD_LEN == - HGFS_ASYNC_REQUEST_CLIENT_CMD_LEN); - ASSERT_ON_COMPILE(HGFS_ASYNC_REQUEST_CLIENT_CMD_LEN == - HGFS_ASYNC_REPLY_CLIENT_CMD_LEN); -) - -/* * This is just for the sake of macro naming. Since we are guaranteed * equal command lengths, defining command length via a generalized macro name * will prevent confusion. diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/hgfsProto.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/hgfsProto.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/hgfsProto.h 2008-01-28 08:02:46.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/hgfsProto.h 2008-10-13 08:01:42.000000000 +0100 @@ -66,12 +66,12 @@ HGFS_OP_DELETE_DIR, /* Delete a directory */ HGFS_OP_RENAME, /* Rename a file or directory */ HGFS_OP_QUERY_VOLUME_INFO, /* Query volume information */ - + /* * The following operations are only available in version 2 of the hgfs - * protocol. The corresponding version 1 opcodes above are deprecated. + * protocol. The corresponding version 1 opcodes above are deprecated. */ - + HGFS_OP_OPEN_V2, /* Open file */ HGFS_OP_GETATTR_V2, /* Get file attributes */ HGFS_OP_SETATTR_V2, /* Set file attributes */ @@ -79,14 +79,48 @@ HGFS_OP_CREATE_SYMLINK, /* Create a symlink */ HGFS_OP_SERVER_LOCK_CHANGE, /* Change the oplock on a file */ HGFS_OP_CREATE_DIR_V2, /* Create a directory */ - HGFS_OP_DELETE_FILE_V2, /* Delete a file */ - HGFS_OP_DELETE_DIR_V2, /* Delete a directory */ - HGFS_OP_RENAME_V2, /* Rename a file or directory */ - - HGFS_OP_MAX, /* Dummy op, must be last in enum */ + HGFS_OP_DELETE_FILE_V2, /* Delete a file */ + HGFS_OP_DELETE_DIR_V2, /* Delete a directory */ + HGFS_OP_RENAME_V2, /* Rename a file or directory */ + + /* + * Operations for version 3, deprecating version 2 operations. + */ + + HGFS_OP_OPEN_V3, /* Open file */ + HGFS_OP_READ_V3, /* Read from file */ + HGFS_OP_WRITE_V3, /* Write to file */ + HGFS_OP_CLOSE_V3, /* Close file */ + HGFS_OP_SEARCH_OPEN_V3, /* Start new search */ + HGFS_OP_SEARCH_READ_V3, /* Start new search */ + HGFS_OP_SEARCH_CLOSE_V3, /* End a search */ + HGFS_OP_GETATTR_V3, /* Get file attributes */ + HGFS_OP_SETATTR_V3, /* Set file attributes */ + HGFS_OP_CREATE_DIR_V3, /* Create new directory */ + HGFS_OP_DELETE_FILE_V3, /* Delete a file */ + HGFS_OP_DELETE_DIR_V3, /* Delete a directory */ + HGFS_OP_RENAME_V3, /* Rename a file or directory */ + HGFS_OP_QUERY_VOLUME_INFO_V3, /* Query volume information */ + HGFS_OP_CREATE_SYMLINK_V3, /* Create a symlink */ + HGFS_OP_SERVER_LOCK_CHANGE_V3, /* Change the oplock on a file */ + + HGFS_OP_MAX, /* Dummy op, must be last in enum */ } HgfsOp; +/* HGFS protocol versions. */ +#define HGFS_VERSION_OLD (1 << 0) +#define HGFS_VERSION_3 (1 << 1) + +/* XXX: Needs change when VMCI is supported. */ +#define HGFS_REQ_PAYLOAD_SIZE_V3(hgfsReq) (sizeof *hgfsReq + sizeof(HgfsRequest)) +#define HGFS_REP_PAYLOAD_SIZE_V3(hgfsRep) (sizeof *hgfsRep + sizeof(HgfsReply)) + +/* XXX: Needs change when VMCI is supported. */ +#define HGFS_REQ_GET_PAYLOAD_V3(hgfsReq) ((char *)(hgfsReq) + sizeof(HgfsRequest)) +#define HGFS_REP_GET_PAYLOAD_V3(hgfsRep) ((char *)(hgfsRep) + sizeof(HgfsReply)) + + /* * File types, used in HgfsAttr. We support regular files, * directories, and symlinks. @@ -150,10 +184,10 @@ * * The client can ask the server to acquire opportunistic locking/leasing * from the host FS on its behalf. This is communicated as part of an open request. - * + * * HGFS_LOCK_OPPORTUNISTIC means that the client trusts the server * to decide what kind of locking to request from the host FS. - * All other values tell the server explicitly the type of lock to + * All other values tell the server explicitly the type of lock to * request. * * The server will attempt to acquire the desired lock and will notify the client @@ -189,9 +223,9 @@ /* - * Hints to indicate in a getattr or setattr which attributes + * Hints to indicate in a getattr or setattr which attributes * are valid for the request. - * For setattr only, attributes should be set by host even if + * For setattr only, attributes should be set by host even if * no valid values are specified by the guest. */ @@ -202,7 +236,7 @@ #define HGFS_ATTR_HINT_USE_FILE_DESC (1 << 2) /* - * Hint to determine using a name or a handle to determine + * Hint to determine using a name or a handle to determine * what to delete. */ @@ -211,7 +245,7 @@ #define HGFS_DELETE_HINT_USE_FILE_DESC (1 << 0) /* - * Hint to determine using a name or a handle to determine + * Hint to determine using a name or a handle to determine * what to renames. */ @@ -229,7 +263,7 @@ * units of 100ns since Jan 1, 1601, UTC. */ -/* +/* * Version 1 attributes. Deprecated. * Version 2 should be using HgfsAttrV2. */ @@ -252,14 +286,15 @@ /* Various flags and Windows attributes. */ -typedef uint64 HgfsAttrFlags; +typedef uint64 HgfsAttrFlags; #define HGFS_ATTR_HIDDEN (1 << 0) #define HGFS_ATTR_SYSTEM (1 << 1) #define HGFS_ATTR_ARCHIVE (1 << 2) +#define HGFS_ATTR_HIDDEN_FORCED (1 << 3) -/* +/* * Specifies which open request fields contain * valid values. */ @@ -268,7 +303,7 @@ #define HGFS_OPEN_VALID_NONE 0 #define HGFS_OPEN_VALID_MODE (1 << 0) -#define HGFS_OPEN_VALID_FLAGS (1 << 1) +#define HGFS_OPEN_VALID_FLAGS (1 << 1) #define HGFS_OPEN_VALID_SPECIAL_PERMS (1 << 2) #define HGFS_OPEN_VALID_OWNER_PERMS (1 << 3) #define HGFS_OPEN_VALID_GROUP_PERMS (1 << 4) @@ -281,7 +316,7 @@ #define HGFS_OPEN_VALID_FILE_NAME (1 << 11) -/* +/* * Specifies which attribute fields contain * valid values. */ @@ -301,12 +336,29 @@ #define HGFS_ATTR_VALID_OTHER_PERMS (1 << 9) #define HGFS_ATTR_VALID_FLAGS (1 << 10) #define HGFS_ATTR_VALID_ALLOCATION_SIZE (1 << 11) -#define HGFS_ATTR_VALID_USERID (1 << 12) +#define HGFS_ATTR_VALID_USERID (1 << 12) #define HGFS_ATTR_VALID_GROUPID (1 << 13) #define HGFS_ATTR_VALID_FILEID (1 << 14) - - +#define HGFS_ATTR_VALID_VOLID (1 << 15) /* + * Add our file and volume identifiers. + * NOTE: On Windows hosts, the file identifier is not guaranteed to be valid + * particularly with FAT. A defrag operation could cause it to change. + * Therefore, to not confuse older clients, and non-Windows + * clients we have added a separate flag. + * The Windows client will check for both flags for the + * file ID, and return the information to the guest application. + * However, it will use the ID internally, when it has an open + * handle on the server. + * Non-Windows clients need the file ID to be always guaranteed, + * which is to say, that the ID remains constant over the course of the + * file's lifetime, and will use the HGFS_ATTR_VALID_FILEID flag + * only to determine if the ID is valid. + */ +#define HGFS_ATTR_VALID_NON_STATIC_FILEID (1 << 16) + + +/* * Specifies which create dir request fields contain * valid values. */ @@ -320,12 +372,12 @@ #define HGFS_CREATE_DIR_VALID_OTHER_PERMS (1 << 3) #define HGFS_CREATE_DIR_VALID_FILE_NAME (1 << 4) -/* +/* * Version 2 of HgfsAttr */ -typedef -#include "vmware_pack_begin.h" +typedef +#include "vmware_pack_begin.h" struct HgfsAttrV2 { HgfsAttrValid mask; /* A bit mask to determine valid attribute fields */ HgfsFileType type; /* File type */ @@ -335,23 +387,24 @@ uint64 writeTime; /* Time of last write */ uint64 attrChangeTime; /* Time file attributes were last * changed. Ignored by Windows */ - HgfsPermissions specialPerms; /* Special permissions bits (suid, etc.). + HgfsPermissions specialPerms; /* Special permissions bits (suid, etc.). * Ignored by Windows */ HgfsPermissions ownerPerms; /* Owner permissions bits */ - HgfsPermissions groupPerms; /* Group permissions bits. Ignored by + HgfsPermissions groupPerms; /* Group permissions bits. Ignored by * Windows */ - HgfsPermissions otherPerms; /* Other permissions bits. Ignored by + 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 */ - uint64 reserved1; /* Reserved for future use */ + uint32 volumeId; /* volume identifier, non-zero is valid. */ + uint32 reserved1; /* Reserved for future use */ uint64 reserved2; /* Reserved for future use */ -} -#include "vmware_pack_end.h" -HgfsAttrV2; +} +#include "vmware_pack_end.h" +HgfsAttrV2; /* @@ -382,16 +435,16 @@ * SEARCH_OPEN. * * In the current HGFS server implementation, each request has a minimum packet - * size that must be met for it to be considered valid. This minimum is simply + * size that must be met for it to be considered valid. This minimum is simply * the sizeof the particular request, which includes the solitary byte from the * HgfsFileName struct. For these particular requests, clients add an extra * byte to their payload size, without that byte being present anywhere. * * It isn't clear that this behavior is correct, but the end result is that - * neither end malfunctions, as an extra byte gets sent by the client and is + * neither end malfunctions, as an extra byte gets sent by the client and is * ignored by the server. Unfortunately, it cannot be easily fixed. The * server's minimum packet size can be changed, but the client should continue - * to send an extra byte, otherwise older servers with a slightly longer + * to send an extra byte, otherwise older servers with a slightly longer * minimum packet size may consider the new client's packets to be too short. * * UTF-8 representation @@ -410,11 +463,11 @@ * * Precomposed (normal form C) versus Decomposed (normal form D) * ------------------------------------------------------------- - * Certain Unicode characters can be encoded in more than one way. - * For example, an Á (A acute) can be encoded either precomposed, - * as U+00C1 (LATIN CAPITAL LETTER A WITH ACUTE), or decomposed, + * Certain Unicode characters can be encoded in more than one way. + * For example, an (A acute) can be encoded either precomposed, + * as U+00C1 (LATIN CAPITAL LETTER A WITH ACUTE), or decomposed, * as U+0041 U+0301 (LATIN CAPITAL LETTER A followed by a COMBINING ACUTE ACCENT). - * Precomposed characters are more common in the Windows world, + * Precomposed characters are more common in the Windows world, * whereas decomposed characters are more common on the Mac. * * See UAX 15 (http://unicode.org/reports/tr15/) @@ -431,6 +484,43 @@ /* + * Case-sensitiviy flags are only used when any lookup is + * involved on the server side. + */ + +typedef enum { + HGFS_FILE_NAME_DEFAULT_CASE, + HGFS_FILE_NAME_CASE_SENSITIVE, + HGFS_FILE_NAME_CASE_INSENSITIVE, +} HgfsCaseType; + + +/* + * HgfsFileNameV3 - new header to incorporate case-sensitivity flags along with + * Hgfs file handle. + */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsFileNameV3 { + uint32 length; /* Does NOT include terminating NUL */ + uint32 flags; /* Flags described below. */ + HgfsCaseType caseType; /* Case-sensitivity type. */ + HgfsHandle fid; + char name[1]; +} +#include "vmware_pack_end.h" +HgfsFileNameV3; + + +/* + * HgfsFileNameV3 flags. Case-sensitiviy flags are only used when any lookup is + * involved on the server side. + */ +#define HGFS_FILE_NAME_USE_FILE_DESC (1 << 0) /* Case type ignored if set. */ + + +/* * Request/reply structs. These are the first members of all * operation request and reply messages, respectively. */ @@ -478,26 +568,51 @@ typedef #include "vmware_pack_begin.h" -struct HgfsRequestOpenV2 { - HgfsRequest header; +struct HgfsRequestOpenV2 { + HgfsRequest header; 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 */ + 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 */ HgfsServerLock desiredLock; /* The type of lock desired by the client */ uint64 reserved1; /* Reserved for future use */ uint64 reserved2; /* Reserved for future use */ - HgfsFileName fileName; -} -#include "vmware_pack_end.h" -HgfsRequestOpenV2; + HgfsFileName fileName; +} +#include "vmware_pack_end.h" +HgfsRequestOpenV2; + + +/* Version 3 of HgfsRequestOpen */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestOpenV3 { + 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 */ + HgfsServerLock desiredLock; /* The type of lock desired by the client */ + uint64 reserved1; /* Reserved for future use */ + uint64 reserved2; /* Reserved for future use */ + HgfsFileNameV3 fileName; +} +#include "vmware_pack_end.h" +HgfsRequestOpenV3; /* Deprecated */ @@ -525,6 +640,21 @@ HgfsReplyOpenV2; +/* Version 3 of HgfsReplyOpen */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsReplyOpenV3 { + HgfsHandle file; /* Opaque file ID used by the server */ + HgfsServerLock acquiredLock; /* The type of lock acquired by the server */ + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsReplyOpenV3; + + +/* Deprecated */ + typedef #include "vmware_pack_begin.h" struct HgfsRequestRead { @@ -536,6 +666,7 @@ #include "vmware_pack_end.h" HgfsRequestRead; +/* Deprecated */ typedef #include "vmware_pack_begin.h" @@ -548,6 +679,35 @@ HgfsReplyRead; +/* + * Version 3 of HgfsRequestRead. + * Server must support HGFS_LARGE_PACKET_MAX to implement this op. + */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestReadV3 { + HgfsHandle file; /* Opaque file ID used by the server */ + uint64 offset; + uint32 requiredSize; + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsRequestReadV3; + +typedef +#include "vmware_pack_begin.h" +struct HgfsReplyReadV3 { + uint32 actualSize; + uint64 reserved; /* Reserved for future use */ + char payload[1]; +} +#include "vmware_pack_end.h" +HgfsReplyReadV3; + + +/* Deprecated */ + typedef #include "vmware_pack_begin.h" struct HgfsRequestWrite { @@ -562,6 +722,8 @@ HgfsRequestWrite; +/* Deprecated */ + typedef #include "vmware_pack_begin.h" struct HgfsReplyWrite { @@ -571,6 +733,36 @@ #include "vmware_pack_end.h" HgfsReplyWrite; +/* + * Version 3 of HgfsRequestWrite. + * Server must support HGFS_LARGE_PACKET_MAX to implement this op. + */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestWriteV3 { + HgfsHandle file; /* Opaque file ID used by the server */ + HgfsWriteFlags flags; + uint64 offset; + uint32 requiredSize; + uint64 reserved; /* Reserved for future use */ + char payload[1]; +} +#include "vmware_pack_end.h" +HgfsRequestWriteV3; + + +typedef +#include "vmware_pack_begin.h" +struct HgfsReplyWriteV3 { + uint32 actualSize; + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsReplyWriteV3; + + +/* Deprecated */ typedef #include "vmware_pack_begin.h" @@ -582,6 +774,8 @@ HgfsRequestClose; +/* Deprecated */ + typedef #include "vmware_pack_begin.h" struct HgfsReplyClose { @@ -593,6 +787,27 @@ typedef #include "vmware_pack_begin.h" +struct HgfsRequestCloseV3 { + HgfsHandle file; /* Opaque file ID used by the server */ + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsRequestCloseV3; + + +typedef +#include "vmware_pack_begin.h" +struct HgfsReplyCloseV3 { + uint64 reserved; +} +#include "vmware_pack_end.h" +HgfsReplyCloseV3; + + +/* Deprecated */ + +typedef +#include "vmware_pack_begin.h" struct HgfsRequestSearchOpen { HgfsRequest header; HgfsFileName dirName; @@ -603,6 +818,18 @@ typedef #include "vmware_pack_begin.h" +struct HgfsRequestSearchOpenV3 { + uint64 reserved; /* Reserved for future use */ + HgfsFileNameV3 dirName; +} +#include "vmware_pack_end.h" +HgfsRequestSearchOpenV3; + + +/* Deprecated */ + +typedef +#include "vmware_pack_begin.h" struct HgfsReplySearchOpen { HgfsReply header; HgfsHandle search; /* Opaque search ID used by the server */ @@ -611,6 +838,16 @@ HgfsReplySearchOpen; +typedef +#include "vmware_pack_begin.h" +struct HgfsReplySearchOpenV3 { + HgfsHandle search; /* Opaque search ID used by the server */ + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsReplySearchOpenV3; + + /* Deprecated */ typedef @@ -636,6 +873,17 @@ #include "vmware_pack_end.h" HgfsRequestSearchReadV2; +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestSearchReadV3 { + HgfsHandle search; /* Opaque search ID used by the server */ + uint32 offset; /* The first result is offset 0 */ + uint32 flags; /* Reserved for reading multiple directory entries. */ + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsRequestSearchReadV3; + /* Deprecated */ @@ -655,20 +903,47 @@ typedef #include "vmware_pack_begin.h" -struct HgfsReplySearchReadV2 { - HgfsReply header; +struct HgfsReplySearchReadV2 { + HgfsReply header; HgfsAttrV2 attr; - - /* - * fileName.length = 0 means "no entry at this offset" + + /* + * fileName.length = 0 means "no entry at this offset" * If the file is a symlink (as specified in attr) * this name is the name of the symlink, not the target. - */ - HgfsFileName fileName; -} -#include "vmware_pack_end.h" -HgfsReplySearchReadV2; + */ + HgfsFileName fileName; +} +#include "vmware_pack_end.h" +HgfsReplySearchReadV2; + +/* Directory entry structure. */ + +typedef struct HgfsDirEntry { + uint32 nextEntry; + HgfsAttrV2 attr; + + /* + * fileName.length = 0 means "no entry at this offset" + * If the file is a symlink (as specified in attr) + * this name is the name of the symlink, not the target. + */ + HgfsFileNameV3 fileName; +} HgfsDirEntry; + +typedef +#include "vmware_pack_begin.h" +struct HgfsReplySearchReadV3 { + uint64 count; /* Number of directory entries. */ + uint64 reserved; /* Reserved for future use. */ + char payload[1]; /* Directory entries. */ +} +#include "vmware_pack_end.h" +HgfsReplySearchReadV3; + + +/* Deprecated */ typedef #include "vmware_pack_begin.h" @@ -680,6 +955,8 @@ HgfsRequestSearchClose; +/* Deprecated */ + typedef #include "vmware_pack_begin.h" struct HgfsReplySearchClose { @@ -689,6 +966,25 @@ HgfsReplySearchClose; +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestSearchCloseV3 { + HgfsHandle search; /* Opaque search ID used by the server */ + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsRequestSearchCloseV3; + + +typedef +#include "vmware_pack_begin.h" +struct HgfsReplySearchCloseV3 { + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsReplySearchCloseV3; + + /* Deprecated */ typedef @@ -715,6 +1011,17 @@ HgfsRequestGetattrV2; +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestGetattrV3 { + HgfsAttrHint hints; /* Flags for file handle valid. */ + uint64 reserved; /* Reserved for future use */ + HgfsFileNameV3 fileName; /* Filename used when file handle invalid. */ +} +#include "vmware_pack_end.h" +HgfsRequestGetattrV3; + + /* Deprecated */ typedef @@ -734,10 +1041,10 @@ struct HgfsReplyGetattrV2 { HgfsReply header; HgfsAttrV2 attr; - + /* - * If the file is a symlink, as specified in attr.type, then this is - * the target for the symlink. If the file is not a symlink, this should + * If the file is a symlink, as specified in attr.type, then this is + * the target for the symlink. If the file is not a symlink, this should * be ignored. * * This filename is in "CPNameLite" format. See CPNameLite.c for details. @@ -748,6 +1055,25 @@ HgfsReplyGetattrV2; +typedef +#include "vmware_pack_begin.h" +struct HgfsReplyGetattrV3 { + HgfsAttrV2 attr; + + /* + * If the file is a symlink, as specified in attr.type, then this is + * the target for the symlink. If the file is not a symlink, this should + * be ignored. + * + * This filename is in "CPNameLite" format. See CPNameLite.c for details. + */ + uint64 reserved; /* Reserved for future use */ + HgfsFileNameV3 symlinkTarget; +} +#include "vmware_pack_end.h" +HgfsReplyGetattrV3; + + /* Deprecated */ typedef @@ -777,6 +1103,17 @@ HgfsRequestSetattrV2; +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestSetattrV3 { + HgfsAttrHint hints; + HgfsAttrV2 attr; + uint64 reserved; /* Reserved for future use */ + HgfsFileNameV3 fileName; /* Filename used when file handle invalid. */ +} +#include "vmware_pack_end.h" +HgfsRequestSetattrV3; + /* Deprecated */ typedef @@ -798,6 +1135,27 @@ #include "vmware_pack_end.h" HgfsReplySetattrV2; +typedef +#include "vmware_pack_begin.h" +struct HgfsReplySetattrV3 { + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsReplySetattrV3; + + +/* Deprecated */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestCreateDir { + HgfsRequest header; + HgfsPermissions permissions; + HgfsFileName fileName; +} +#include "vmware_pack_end.h" +HgfsRequestCreateDir; + /* Version 2 of HgfsRequestCreateDir */ @@ -816,17 +1174,32 @@ HgfsRequestCreateDirV2; +/* Version 3 of HgfsRequestCreateDir */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestCreateDirV3 { + HgfsCreateDirValid mask; + HgfsPermissions specialPerms; + HgfsPermissions ownerPerms; + HgfsPermissions groupPerms; + HgfsPermissions otherPerms; + uint64 reserved; /* Reserved for future use */ + HgfsFileNameV3 fileName; +} +#include "vmware_pack_end.h" +HgfsRequestCreateDirV3; + + /* Deprecated */ typedef #include "vmware_pack_begin.h" -struct HgfsRequestCreateDir { - HgfsRequest header; - HgfsPermissions permissions; - HgfsFileName fileName; +struct HgfsReplyCreateDir { + HgfsReply header; } #include "vmware_pack_end.h" -HgfsRequestCreateDir; +HgfsReplyCreateDir; /* Version 2 of HgfsReplyCreateDir */ @@ -840,16 +1213,18 @@ HgfsReplyCreateDirV2; -/* Deprecated */ +/* Version 3 of HgfsReplyCreateDir */ typedef #include "vmware_pack_begin.h" -struct HgfsReplyCreateDir { - HgfsReply header; +struct HgfsReplyCreateDirV3 { + uint64 reserved; /* Reserved for future use */ } #include "vmware_pack_end.h" -HgfsReplyCreateDir; +HgfsReplyCreateDirV3; + +/* Deprecated */ typedef #include "vmware_pack_begin.h" @@ -860,6 +1235,9 @@ #include "vmware_pack_end.h" HgfsRequestDelete; + +/* Version 2 of HgfsRequestDelete */ + typedef #include "vmware_pack_begin.h" struct HgfsRequestDeleteV2 { @@ -871,6 +1249,22 @@ #include "vmware_pack_end.h" HgfsRequestDeleteV2; + +/* Version 3 of HgfsRequestDelete */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestDeleteV3 { + HgfsDeleteHint hints; + uint64 reserved; /* Reserved for future use */ + HgfsFileNameV3 fileName; /* Name used if the file is HGFS_HANDLE_INVALID */ +} +#include "vmware_pack_end.h" +HgfsRequestDeleteV3; + + +/* Deprecated */ + typedef #include "vmware_pack_begin.h" struct HgfsReplyDelete { @@ -889,6 +1283,18 @@ #include "vmware_pack_end.h" HgfsReplyDeleteV2; + +/* Version 2 of HgfsReplyDelete */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsReplyDeleteV3 { + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsReplyDeleteV3; + + /* * The size of the HgfsFileName struct is variable depending on the * length of the name, so you can't use request->newName to get the @@ -942,6 +1348,29 @@ HgfsReplyRenameV2; +/* HgfsRequestRename and HgfsReplyRename for v3. */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestRenameV3 { + HgfsRenameHint hints; + uint64 reserved; /* Reserved for future use */ + HgfsFileNameV3 oldName; + HgfsFileNameV3 newName; +} +#include "vmware_pack_end.h" +HgfsRequestRenameV3; + + +typedef +#include "vmware_pack_begin.h" +struct HgfsReplyRenameV3 { + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsReplyRenameV3; + + typedef #include "vmware_pack_begin.h" struct HgfsRequestQueryVolume { @@ -963,6 +1392,30 @@ HgfsReplyQueryVolume; +/* HgfsRequestQueryVolume and HgfsReplyQueryVolume for v3. */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestQueryVolumeV3 { + uint64 reserved; /* Reserved for future use */ + HgfsFileNameV3 fileName; +} +#include "vmware_pack_end.h" +HgfsRequestQueryVolumeV3; + + +typedef +#include "vmware_pack_begin.h" +struct HgfsReplyQueryVolumeV3 { + uint64 freeBytes; + uint64 totalBytes; + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsReplyQueryVolumeV3; + + + /* New operations for Version 2 */ typedef @@ -1008,4 +1461,28 @@ HgfsReplySymlinkCreate; +/* HgfsRequestSymlinkCreate and HgfsReplySymlinkCreate for v3. */ + +typedef +#include "vmware_pack_begin.h" +struct HgfsRequestSymlinkCreateV3 { + uint64 reserved; /* Reserved for future use */ + HgfsFileNameV3 symlinkName; + + /* This filename is in "CPNameLite" format. See CPNameLite.c for details. */ + HgfsFileNameV3 targetName; +} +#include "vmware_pack_end.h" +HgfsRequestSymlinkCreateV3; + + +typedef +#include "vmware_pack_begin.h" +struct HgfsReplySymlinkCreateV3 { + uint64 reserved; /* Reserved for future use */ +} +#include "vmware_pack_end.h" +HgfsReplySymlinkCreateV3; + + #endif /* _HGFS_PROTO_H_ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/hgfsUtil.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/hgfsUtil.c --- open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/hgfsUtil.c 2008-01-28 08:02:46.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/hgfsUtil.c 2008-10-13 08:01:42.000000000 +0100 @@ -142,7 +142,7 @@ * * Results: * 0 on success - * nonzero if time is not representable on UNIX + * nonzero if time is not representable on UNIX * * Side effects: * None @@ -156,7 +156,7 @@ { struct timespec tm; int ret; - + ret = HgfsConvertFromNtTimeNsec(&tm, ntTime); *unixTime = tm.tv_sec; return ret; @@ -215,6 +215,8 @@ return HGFS_STATUS_NO_SPACE; case ERROR_NOT_SUPPORTED: return HGFS_STATUS_OPERATION_NOT_SUPPORTED; + case ERROR_INVALID_PARAMETER: + return HGFS_STATUS_INVALID_PARAMETER; case HGFS_INTERNAL_STATUS_ERROR: default: return HGFS_STATUS_GENERIC_ERROR; @@ -253,6 +255,8 @@ return HGFS_STATUS_OPERATION_NOT_SUPPORTED; case ENAMETOOLONG: return HGFS_STATUS_NAME_TOO_LONG; + case EPARAMETERNOTSUPPORTED: + return HGFS_STATUS_INVALID_PARAMETER; case HGFS_INTERNAL_STATUS_ERROR: default: return HGFS_STATUS_GENERIC_ERROR; diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/hgfsUtil.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/hgfsUtil.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/hgfsUtil.h 2008-01-28 08:02:46.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/hgfsUtil.h 2008-10-13 08:01:42.000000000 +0100 @@ -19,7 +19,7 @@ /* * hgfsUtil.h -- - * + * * Utility functions and macros used by hgfs. */ @@ -29,15 +29,15 @@ # if defined(__linux__) && defined(__KERNEL__) # include "driver-config.h" -# include <linux/time.h> // for time_t and timespec +# include <linux/time.h> // for time_t and timespec /* Include time.h in userspace code, but not in Solaris kernel code. */ # elif defined(__FreeBSD__) && defined(_KERNEL) /* Do nothing. */ # elif defined(__APPLE__) && defined(KERNEL) # include <sys/time.h> -# else +# else # include <time.h> -# endif +# endif # include "vm_basic_types.h" # if !defined(_STRUCT_TIMESPEC) && \ !defined(_TIMESPEC_DECLARED) && \ @@ -71,15 +71,27 @@ typedef DWORD HgfsInternalStatus; #endif -/* - * Unfortunately, we need a catch-all "generic error" to use with +/* + * Unfortunately, we need a catch-all "generic error" to use with * HgfsInternalStatus, because there are times when cross-platform code needs - * to return its own errors along with errors from platform specific code. + * to return its own errors along with errors from platform specific code. * * Using -1 should be safe because we expect our platforms to use zero as * success and a positive range of numbers as error values. */ -#define HGFS_INTERNAL_STATUS_ERROR -1 +#define HGFS_INTERNAL_STATUS_ERROR (-1) + +#ifndef _WIN32 +/* + * This error code is used to notify the client that some of the parameters passed + * (e.g. file handles) are not supported. Clients are expected to correct + * the parameter (e.g. pass file name instead) and retry. + * + * Note that this error code is artificially made up and in future may conflict + * with an "official" error code when added. + */ +#define EPARAMETERNOTSUPPORTED (MAX_INT32 - 1) +#endif /* * FreeBSD (pre-6.0) does not define EPROTO, so we'll define our own error code. @@ -89,6 +101,7 @@ #endif #define HGFS_NAME_BUFFER_SIZE(request) (HGFS_PACKET_MAX - (sizeof *request - 1)) +#define HGFS_NAME_BUFFER_SIZET(sizet) (HGFS_PACKET_MAX - ((sizet) - 1)) #ifndef _WIN32 /* @@ -114,3 +127,4 @@ HgfsStatus HgfsConvertFromInternalStatus(HgfsInternalStatus status); // IN #endif /* _HGFSUTIL_H_ */ + diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/inode.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/inode.c --- open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/inode.c 2008-01-28 08:02:46.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/inode.c 2008-10-13 08:01:43.000000000 +0100 @@ -38,6 +38,7 @@ #include "cpName.h" #include "cpNameLite.h" +#include "hgfsEscape.h" #include "hgfsProto.h" #include "hgfsUtil.h" #include "inode.h" @@ -72,14 +73,20 @@ HgfsOp op); static int HgfsPackSetattrRequest(struct iattr *iattr, struct dentry *dentry, + Bool allowHandleReuse, + HgfsOp opUsed, HgfsReq *req, - Bool *changed, - Bool allowHandleReuse); + Bool *changed); static int HgfsPackCreateDirRequest(struct dentry *dentry, int mode, + HgfsOp opUsed, HgfsReq *req); static int HgfsTruncatePages(struct inode *inode, loff_t newSize); +static int HgfsPackSymlinkCreateRequest(struct dentry *dentry, + const char *symname, + HgfsOp opUsed, + HgfsReq *req); /* HGFS inode operations. */ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 75) @@ -117,6 +124,12 @@ struct kstat *stat); #endif +#define HGFS_CREATE_DIR_MASK (HGFS_CREATE_DIR_VALID_FILE_NAME | \ + HGFS_CREATE_DIR_VALID_SPECIAL_PERMS | \ + HGFS_CREATE_DIR_VALID_OWNER_PERMS | \ + HGFS_CREATE_DIR_VALID_GROUP_PERMS | \ + HGFS_CREATE_DIR_VALID_OTHER_PERMS) + /* HGFS inode operations structure for directories. */ struct inode_operations HgfsDirInodeOperations = { /* Optional */ @@ -179,12 +192,14 @@ struct dentry *dentry, // IN: Dentry of file/dir to delete HgfsOp op) // IN: Opcode for file type (file or dir) { - struct HgfsSuperInfo *si; - HgfsRequestDelete *request; - HgfsReplyDelete *reply; HgfsReq *req = NULL; int result = 0; Bool secondAttempt = FALSE; + HgfsStatus replyStatus; + char *fileName = NULL; + uint32 *fileNameLength; + uint32 reqSize; + HgfsOp opUsed; ASSERT(dir); ASSERT(dir->i_sb); @@ -197,17 +212,13 @@ goto out; } - /* Check opcode. */ if ((op != HGFS_OP_DELETE_FILE) && - (op != HGFS_OP_DELETE_DIR)) { + (op != HGFS_OP_DELETE_DIR)) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDelete: Invalid opcode\n")); result = -EINVAL; goto out; } - - si = HGFS_SB_TO_COMMON(dir->i_sb); - req = HgfsGetNewRequest(); if (!req) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDelete: out of memory while " @@ -216,27 +227,57 @@ goto out; } - request = (HgfsRequestDelete *)(HGFS_REQ_PAYLOAD(req)); - retry: - /* Fill out the request packet. */ - request->header.id = req->id; - request->header.op = op; + if (op == HGFS_OP_DELETE_FILE) { + opUsed = atomic_read(&hgfsVersionDeleteFile); + } else { + opUsed = atomic_read(&hgfsVersionDeleteDir); + } + + if (opUsed == HGFS_OP_DELETE_FILE_V3 || + opUsed == HGFS_OP_DELETE_DIR_V3) { + HgfsRequestDeleteV3 *request; + HgfsRequest *header; + + header = (HgfsRequest *)(HGFS_REQ_PAYLOAD(req)); + header->id = req->id; + header->op = opUsed; + + request = (HgfsRequestDeleteV3 *)(HGFS_REQ_PAYLOAD_V3(req)); + request->hints = 0; + fileName = request->fileName.name; + fileNameLength = &request->fileName.length; + request->fileName.fid = HGFS_INVALID_HANDLE; + request->fileName.flags = 0; + request->fileName.caseType = HGFS_FILE_NAME_DEFAULT_CASE; + request->reserved = 0; + reqSize = HGFS_REQ_PAYLOAD_SIZE_V3(request); + } else { + HgfsRequestDelete *request; + + request = (HgfsRequestDelete *)(HGFS_REQ_PAYLOAD(req)); + /* Fill out the request packet. */ + request->header.id = req->id; + request->header.op = opUsed; + fileName = request->fileName.name; + fileNameLength = &request->fileName.length; + reqSize = sizeof *request; + } /* Build full name to send to server. */ - if (HgfsBuildPath(request->fileName.name, HGFS_NAME_BUFFER_SIZE(request), + if (HgfsBuildPath(fileName, HGFS_NAME_BUFFER_SIZET(reqSize), dentry) < 0) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDelete: build path failed\n")); result = -EINVAL; goto out; } - LOG(6, (KERN_DEBUG "VMware hgfs: HgfsDelete: deleting \"%s\", op %u\n", - request->fileName.name, op)); + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDelete: deleting \"%s\", opUsed %u\n", + fileName, opUsed)); /* Convert to CP name. */ - result = CPName_ConvertTo(request->fileName.name, - HGFS_NAME_BUFFER_SIZE(request), - request->fileName.name); + result = CPName_ConvertTo(fileName, + HGFS_NAME_BUFFER_SIZET(reqSize), + fileName); if (result < 0) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDelete: CP conversion failed\n")); result = -EINVAL; @@ -244,73 +285,83 @@ } /* Unescape the CP name. */ - result = HgfsUnescapeBuffer(request->fileName.name, result); - request->fileName.length = result; - req->payloadSize = sizeof *request + result; + result = HgfsEscape_Undo(fileName, result); + *fileNameLength = result; + req->payloadSize = reqSize + result; result = HgfsSendRequest(req); if (result == 0) { - if (req->payloadSize != sizeof *reply) { - /* This packet size should never vary. */ - LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDelete: wrong packet size\n")); - result = -EPROTO; - } else { + LOG(6, (KERN_DEBUG "VMware hgfs: HgfsDelete: got reply\n")); + replyStatus = HgfsReplyStatus(req); + result = HgfsStatusConvertToLinux(replyStatus); - LOG(6, (KERN_DEBUG "VMware hgfs: HgfsDelete: got reply\n")); - reply = (HgfsReplyDelete *)(HGFS_REQ_PAYLOAD(req)); - result = HgfsStatusConvertToLinux(reply->header.status); - - switch (result) { - case 0: - /* - * Since we deleted the file, decrement its hard link count. As - * we don't support hard links, this has the effect of making the - * link count 0, which means that when the last reference to the - * inode is dropped, the inode will be freed instead of moved to - * the unused list. - * - * Also update the mtime/ctime of the parent directory, and the - * ctime of the deleted file. - */ - compat_drop_nlink(dentry->d_inode); - dentry->d_inode->i_ctime = dir->i_ctime = dir->i_mtime = - CURRENT_TIME; - break; + switch (result) { + case 0: + /* + * Since we deleted the file, decrement its hard link count. As + * we don't support hard links, this has the effect of making the + * link count 0, which means that when the last reference to the + * inode is dropped, the inode will be freed instead of moved to + * the unused list. + * + * Also update the mtime/ctime of the parent directory, and the + * ctime of the deleted file. + */ + compat_drop_nlink(dentry->d_inode); + dentry->d_inode->i_ctime = dir->i_ctime = dir->i_mtime = + CURRENT_TIME; + break; - case -EACCES: - case -EPERM: - /* - * It's possible that we're talking to a Windows server with - * a file marked read-only. Let's try again, after removing - * the read-only bit from the file. - * - * XXX: I think old servers will send -EPERM here. Is this entirely - * safe? - */ - if (!secondAttempt) { - struct iattr enableWrite; - secondAttempt = TRUE; - - LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDelete: access denied, " - "attempting to work around read-only bit\n")); - enableWrite.ia_mode = (dentry->d_inode->i_mode | S_IWUSR); - enableWrite.ia_valid = ATTR_MODE; - result = HgfsSetattr(dentry, &enableWrite); - if (result == 0) { - LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDelete: file is no " - "longer read-only, retrying delete\n")); - goto retry; - } - LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDelete: failed to remove " - "read-only property\n")); - } else { - LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDelete: second attempt at " - "delete failed\n")); + case -EACCES: + case -EPERM: + /* + * It's possible that we're talking to a Windows server with + * a file marked read-only. Let's try again, after removing + * the read-only bit from the file. + * + * XXX: I think old servers will send -EPERM here. Is this entirely + * safe? + */ + if (!secondAttempt) { + struct iattr enableWrite; + secondAttempt = TRUE; + + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDelete: access denied, " + "attempting to work around read-only bit\n")); + enableWrite.ia_mode = (dentry->d_inode->i_mode | S_IWUSR); + enableWrite.ia_valid = ATTR_MODE; + result = HgfsSetattr(dentry, &enableWrite); + if (result == 0) { + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDelete: file is no " + "longer read-only, retrying delete\n")); + goto retry; } - break; - default: - break; + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDelete: failed to remove " + "read-only property\n")); + } else { + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDelete: second attempt at " + "delete failed\n")); + } + break; + case -EPROTO: + /* Retry with older version(s). Set globally. */ + if (opUsed == HGFS_OP_DELETE_DIR_V3) { + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDelete: Version 3 not " + "supported. Falling back to version 1.\n")); + atomic_set(&hgfsVersionDeleteDir, HGFS_OP_DELETE_DIR); + goto retry; + } else if (opUsed == HGFS_OP_DELETE_FILE_V3) { + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDelete: Version 3 not " + "supported. Falling back to version 1.\n")); + atomic_set(&hgfsVersionDeleteFile, HGFS_OP_DELETE_FILE); + goto retry; } + + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDelete: server " + "returned error: %d\n", result)); + break; + default: + break; } } else if (result == -EIO) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDelete: timed out\n")); @@ -319,7 +370,7 @@ "returned error: %d\n", result)); } else { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDelete: unknown error: " - "%d\n", result)); + "%d\n", result)); } out: @@ -337,9 +388,9 @@ * we will issue the setattr request using an existing open HGFS handle. * * Results: - * Returns zero on success, or negative error on failure. + * Returns zero on success, or negative error on failure. * - * On success, the changed argument is set indicating whether the + * On success, the changed argument is set indicating whether the * attributes have actually changed. * * Side effects: @@ -351,19 +402,18 @@ static int HgfsPackSetattrRequest(struct iattr *iattr, // IN: Inode attrs to update from struct dentry *dentry, // IN: File to set attributes of - HgfsReq *req, // IN/OUT: Packet to write into - Bool *changed, // OUT: Have the attrs changed? - Bool allowHandleReuse) // IN: Can we use a handle? + Bool allowHandleReuse, // IN: Can we use a handle? + HgfsOp opUsed, // IN: Op to be used + HgfsReq *req, // IN/OUT: Packet to write into + Bool *changed) // OUT: Have the attrs changed? { - HgfsRequest *requestHeader; - HgfsRequestSetattrV2 *requestV2; - HgfsRequestSetattr *request; HgfsAttrV2 *attrV2; HgfsAttr *attr; HgfsAttrHint *hints; HgfsAttrChanges *update; - HgfsFileName *fileNameP; HgfsHandle handle; + char *fileName = NULL; + uint32 *fileNameLength = NULL; unsigned int valid; size_t reqBufferSize; size_t reqSize; @@ -376,10 +426,125 @@ valid = iattr->ia_valid; - requestHeader = (HgfsRequest *)(HGFS_REQ_PAYLOAD(req)); - switch (requestHeader->op) { - case HGFS_OP_SETATTR_V2: + switch (opUsed) { + case HGFS_OP_SETATTR_V3: { + HgfsRequest *requestHeader; + HgfsRequestSetattrV3 *requestV3; + + requestHeader = (HgfsRequest *)(HGFS_REQ_PAYLOAD(req)); + requestHeader->op = opUsed; + requestHeader->id = req->id; + + requestV3 = (HgfsRequestSetattrV3 *)HGFS_REQ_PAYLOAD_V3(req); + attrV2 = &requestV3->attr; + hints = &requestV3->hints; + + /* + * Clear attributes, mask, and hints before touching them. + * We can't rely on GetNewRequest() to zero our structures, so + * make sure to zero them all here. + */ + memset(attrV2, 0, sizeof *attrV2); + memset(hints, 0, sizeof *hints); + + /* + * When possible, issue a setattr using an existing handle. This will + * give us slightly better performance on a Windows server, and is more + * correct regardless. If we don't find a handle, fall back on setattr + * by name. + * + * Changing the size (via truncate) requires write permissions. Changing + * the times also requires write permissions on Windows, so we require it + * here too. Otherwise, any handle will do. + */ + if (allowHandleReuse && HgfsGetHandle(dentry->d_inode, + (valid & ATTR_SIZE) || + (valid & ATTR_ATIME) || + (valid & ATTR_MTIME) ? + HGFS_OPEN_MODE_WRITE_ONLY + 1 : 0, + &handle) == 0) { + requestV3->fileName.fid = handle; + requestV3->fileName.flags = HGFS_FILE_NAME_USE_FILE_DESC; + requestV3->fileName.caseType = HGFS_FILE_NAME_DEFAULT_CASE; + requestV3->fileName.length = 0; + LOG(6, (KERN_DEBUG "VMware hgfs: HgfsPackSetattrRequest: setting " + "attributes of handle %u\n", handle)); + } else { + fileName = requestV3->fileName.name; + fileNameLength = &requestV3->fileName.length; + requestV3->fileName.caseType = HGFS_FILE_NAME_CASE_SENSITIVE; + requestV3->fileName.fid = HGFS_INVALID_HANDLE; + requestV3->fileName.flags = 0; + } + requestV3->reserved = 0; + reqSize = HGFS_REQ_PAYLOAD_SIZE_V3(requestV3); + reqBufferSize = HGFS_NAME_BUFFER_SIZET(reqSize); + + /* + * We only support changing these attributes: + * - all mode bits (i.e. all permissions) + * - uid/gid + * - size + * - access/write times + */ + + if (valid & ATTR_MODE) { + attrV2->mask |= HGFS_ATTR_VALID_SPECIAL_PERMS | + HGFS_ATTR_VALID_OWNER_PERMS | HGFS_ATTR_VALID_GROUP_PERMS | + HGFS_ATTR_VALID_OTHER_PERMS; + attrV2->specialPerms = ((iattr->ia_mode & + (S_ISUID | S_ISGID | S_ISVTX)) >> 9); + attrV2->ownerPerms = ((iattr->ia_mode & S_IRWXU) >> 6); + attrV2->groupPerms = ((iattr->ia_mode & S_IRWXG) >> 3); + attrV2->otherPerms = (iattr->ia_mode & S_IRWXO); + *changed = TRUE; + } + + if (valid & ATTR_UID) { + attrV2->mask |= HGFS_ATTR_VALID_USERID; + attrV2->userId = iattr->ia_uid; + *changed = TRUE; + } + + if (valid & ATTR_GID) { + attrV2->mask |= HGFS_ATTR_VALID_GROUPID; + attrV2->groupId = iattr->ia_gid; + *changed = TRUE; + } + + if (valid & ATTR_SIZE) { + attrV2->mask |= HGFS_ATTR_VALID_SIZE; + attrV2->size = iattr->ia_size; + *changed = TRUE; + } + + if (valid & ATTR_ATIME) { + attrV2->mask |= HGFS_ATTR_VALID_ACCESS_TIME; + attrV2->accessTime = HGFS_GET_TIME(iattr->ia_atime); + if (valid & ATTR_ATIME_SET) { + *hints |= HGFS_ATTR_HINT_SET_ACCESS_TIME; + } + *changed = TRUE; + } + + if (valid & ATTR_MTIME) { + attrV2->mask |= HGFS_ATTR_VALID_WRITE_TIME; + attrV2->writeTime = HGFS_GET_TIME(iattr->ia_mtime); + if (valid & ATTR_MTIME_SET) { + *hints |= HGFS_ATTR_HINT_SET_WRITE_TIME; + } + *changed = TRUE; + } + break; + } + + case HGFS_OP_SETATTR_V2: { + HgfsRequestSetattrV2 *requestV2; + requestV2 = (HgfsRequestSetattrV2 *)(HGFS_REQ_PAYLOAD(req)); + requestV2->header.op = opUsed; + requestV2->header.id = req->id; + attrV2 = &requestV2->attr; hints = &requestV2->hints; @@ -391,9 +556,9 @@ memset(attrV2, 0, sizeof *attrV2); memset(hints, 0, sizeof *hints); - /* - * When possible, issue a setattr using an existing handle. This will - * give us slightly better performance on a Windows server, and is more + /* + * When possible, issue a setattr using an existing handle. This will + * give us slightly better performance on a Windows server, and is more * correct regardless. If we don't find a handle, fall back on setattr * by name. * @@ -401,19 +566,19 @@ * the times also requires write permissions on Windows, so we require it * here too. Otherwise, any handle will do. */ - if (allowHandleReuse && HgfsGetHandle(dentry->d_inode, - (valid & ATTR_SIZE) || - (valid & ATTR_ATIME) || - (valid & ATTR_MTIME) ? - HGFS_OPEN_MODE_WRITE_ONLY + 1 : 0, + if (allowHandleReuse && HgfsGetHandle(dentry->d_inode, + (valid & ATTR_SIZE) || + (valid & ATTR_ATIME) || + (valid & ATTR_MTIME) ? + HGFS_OPEN_MODE_WRITE_ONLY + 1 : 0, &handle) == 0) { *hints = HGFS_ATTR_HINT_USE_FILE_DESC; requestV2->file = handle; - fileNameP = NULL; LOG(6, (KERN_DEBUG "VMware hgfs: HgfsPackSetattrRequest: setting " "attributes of handle %u\n", handle)); } else { - fileNameP = &requestV2->fileName; + fileName = requestV2->fileName.name; + fileNameLength = &requestV2->fileName.length; } reqSize = sizeof *requestV2; reqBufferSize = HGFS_NAME_BUFFER_SIZE(requestV2); @@ -427,17 +592,17 @@ */ if (valid & ATTR_MODE) { - attrV2->mask |= HGFS_ATTR_VALID_SPECIAL_PERMS | - HGFS_ATTR_VALID_OWNER_PERMS | HGFS_ATTR_VALID_GROUP_PERMS | + attrV2->mask |= HGFS_ATTR_VALID_SPECIAL_PERMS | + HGFS_ATTR_VALID_OWNER_PERMS | HGFS_ATTR_VALID_GROUP_PERMS | HGFS_ATTR_VALID_OTHER_PERMS; - attrV2->specialPerms = ((iattr->ia_mode & + attrV2->specialPerms = ((iattr->ia_mode & (S_ISUID | S_ISGID | S_ISVTX)) >> 9); attrV2->ownerPerms = ((iattr->ia_mode & S_IRWXU) >> 6); attrV2->groupPerms = ((iattr->ia_mode & S_IRWXG) >> 3); attrV2->otherPerms = (iattr->ia_mode & S_IRWXO); *changed = TRUE; } - + if (valid & ATTR_UID) { attrV2->mask |= HGFS_ATTR_VALID_USERID; attrV2->userId = iattr->ia_uid; @@ -455,7 +620,7 @@ attrV2->size = iattr->ia_size; *changed = TRUE; } - + if (valid & ATTR_ATIME) { attrV2->mask |= HGFS_ATTR_VALID_ACCESS_TIME; attrV2->accessTime = HGFS_GET_TIME(iattr->ia_atime); @@ -464,7 +629,7 @@ } *changed = TRUE; } - + if (valid & ATTR_MTIME) { attrV2->mask |= HGFS_ATTR_VALID_WRITE_TIME; attrV2->writeTime = HGFS_GET_TIME(iattr->ia_mtime); @@ -474,13 +639,21 @@ *changed = TRUE; } break; - case HGFS_OP_SETATTR: + } + + case HGFS_OP_SETATTR: { + HgfsRequestSetattr *request; + request = (HgfsRequestSetattr *)(HGFS_REQ_PAYLOAD(req)); + request->header.op = opUsed; + request->header.id = req->id; + attr = &request->attr; update = &request->update; /* We'll use these later. */ - fileNameP = &request->fileName; + fileName = request->fileName.name; + fileNameLength = &request->fileName.length; reqSize = sizeof *request; reqBufferSize = HGFS_NAME_BUFFER_SIZE(request); @@ -505,20 +678,20 @@ attr->permissions = ((iattr->ia_mode & S_IRWXU) >> 6); *changed = TRUE; } - + if (valid & ATTR_SIZE) { *update |= HGFS_ATTR_SIZE; attr->size = iattr->ia_size; *changed = TRUE; } - + if (valid & ATTR_ATIME) { *update |= HGFS_ATTR_ACCESS_TIME | ((valid & ATTR_ATIME_SET) ? HGFS_ATTR_ACCESS_TIME_SET : 0); attr->accessTime = HGFS_GET_TIME(iattr->ia_atime); *changed = TRUE; } - + if (valid & ATTR_MTIME) { *update |= HGFS_ATTR_WRITE_TIME | ((valid & ATTR_MTIME_SET) ? HGFS_ATTR_WRITE_TIME_SET : 0); @@ -526,6 +699,8 @@ *changed = TRUE; } break; + } + default: LOG(4, (KERN_DEBUG "VMware hgfs: HgfsPackSetattrRequest: unexpected " "OP type encountered\n")); @@ -533,21 +708,21 @@ } /* Avoid all this extra work when we're doing a setattr by handle. */ - if (fileNameP != NULL) { + if (fileName != NULL) { /* Build full name to send to server. */ - if (HgfsBuildPath(fileNameP->name, reqBufferSize, dentry) < 0) { + if (HgfsBuildPath(fileName, reqBufferSize, dentry) < 0) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsPackSetattrRequest: build path " "failed\n")); return -EINVAL; } LOG(6, (KERN_DEBUG "VMware hgfs: HgfsPackSetattrRequest: setting " - "attributes of \"%s\"\n", fileNameP->name)); - + "attributes of \"%s\"\n", fileName)); + /* Convert to CP name. */ - result = CPName_ConvertTo(fileNameP->name, + result = CPName_ConvertTo(fileName, reqBufferSize, - fileNameP->name); + fileName); if (result < 0) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsPackSetattrRequest: CP " "conversion failed\n")); @@ -555,8 +730,8 @@ } /* Unescape the CP name. */ - result = HgfsUnescapeBuffer(fileNameP->name, result); - fileNameP->length = result; + result = HgfsEscape_Undo(fileName, result); + *fileNameLength = result; } req->payloadSize = reqSize + result; return 0; @@ -571,7 +746,7 @@ * Setup the CreateDir request, depending on the op version. * * Results: - * Returns zero on success, or negative error on failure. + * Returns zero on success, or negative error on failure. * * Side effects: * None @@ -582,34 +757,60 @@ static int HgfsPackCreateDirRequest(struct dentry *dentry, // IN: Directory to create int mode, // IN: Mode to assign dir + HgfsOp opUsed, // IN: Op to be used. HgfsReq *req) // IN/OUT: Packet to write into { - HgfsRequest *requestHeader; - HgfsRequestCreateDirV2 *requestV2; - HgfsRequestCreateDir *request; - HgfsFileName *fileNameP; + char *fileName = NULL; + uint32 *fileNameLength; size_t requestSize; int result; - + ASSERT(dentry); ASSERT(req); - requestHeader = (HgfsRequest *)(HGFS_REQ_PAYLOAD(req)); + switch (opUsed) { + case HGFS_OP_CREATE_DIR_V3: { + HgfsRequest *requestHeader; + HgfsRequestCreateDirV3 *requestV3; + + requestHeader = (HgfsRequest *)(HGFS_REQ_PAYLOAD(req)); + requestHeader->op = opUsed; + requestHeader->id = req->id; + + requestV3 = (HgfsRequestCreateDirV3 *)(HGFS_REQ_PAYLOAD_V3(req)); + + /* We'll use these later. */ + fileName = requestV3->fileName.name; + fileNameLength = &requestV3->fileName.length; + requestV3->fileName.flags = 0; + requestV3->fileName.fid = HGFS_INVALID_HANDLE; + requestV3->fileName.caseType = HGFS_FILE_NAME_CASE_SENSITIVE; + + requestSize = HGFS_REQ_PAYLOAD_SIZE_V3(requestV3); + + requestV3->mask = HGFS_CREATE_DIR_MASK; + + /* Set permissions. */ + requestV3->specialPerms = (mode & (S_ISUID | S_ISGID | S_ISVTX)) >> 9; + requestV3->ownerPerms = (mode & S_IRWXU) >> 6; + requestV3->groupPerms = (mode & S_IRWXG) >> 3; + requestV3->otherPerms = (mode & S_IRWXO); + requestV3->reserved = 0; + break; + } + case HGFS_OP_CREATE_DIR_V2: { + HgfsRequestCreateDirV2 *requestV2; - switch (requestHeader->op) { - case HGFS_OP_CREATE_DIR_V2: requestV2 = (HgfsRequestCreateDirV2 *)(HGFS_REQ_PAYLOAD(req)); - + requestV2->header.op = opUsed; + requestV2->header.id = req->id; + /* We'll use these later. */ - fileNameP = &requestV2->fileName; + fileName = requestV2->fileName.name; + fileNameLength = &requestV2->fileName.length; requestSize = sizeof *requestV2; - - requestV2->mask = - HGFS_CREATE_DIR_VALID_FILE_NAME | - HGFS_CREATE_DIR_VALID_SPECIAL_PERMS | - HGFS_CREATE_DIR_VALID_OWNER_PERMS | - HGFS_CREATE_DIR_VALID_GROUP_PERMS | - HGFS_CREATE_DIR_VALID_OTHER_PERMS; + + requestV2->mask = HGFS_CREATE_DIR_MASK; /* Set permissions. */ requestV2->specialPerms = (mode & (S_ISUID | S_ISGID | S_ISVTX)) >> 9; @@ -617,16 +818,22 @@ requestV2->groupPerms = (mode & S_IRWXG) >> 3; requestV2->otherPerms = (mode & S_IRWXO); break; - case HGFS_OP_CREATE_DIR: + } + case HGFS_OP_CREATE_DIR: { + HgfsRequestCreateDir *request; + request = (HgfsRequestCreateDir *)(HGFS_REQ_PAYLOAD(req)); - + /* We'll use these later. */ - fileNameP = &request->fileName; + fileName = request->fileName.name; + fileNameLength = &request->fileName.length; + requestSize = sizeof *request; requestSize = sizeof *request; /* Set permissions. */ request->permissions = (mode & S_IRWXU) >> 6; break; + } default: LOG(4, (KERN_DEBUG "VMware hgfs: HgfsPackCreateDirRequest: unexpected " "OP type encountered\n")); @@ -634,7 +841,7 @@ } /* Build full name to send to server. */ - if (HgfsBuildPath(fileNameP->name, + if (HgfsBuildPath(fileName, HGFS_PACKET_MAX - (requestSize - 1), dentry) < 0) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsPackCreateDirRequest: build path " @@ -642,12 +849,12 @@ return -EINVAL; } LOG(6, (KERN_DEBUG "VMware hgfs: HgfsPackCreateDirRequest: create dir " - "\"%s\", perms %o\n", fileNameP->name, mode)); + "\"%s\", perms %o\n", fileName, mode)); /* Convert to CP name. */ - result = CPName_ConvertTo(fileNameP->name, + result = CPName_ConvertTo(fileName, HGFS_PACKET_MAX - (requestSize - 1), - fileNameP->name); + fileName); if (result < 0) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsPackCreateDirRequest: CP " "conversion failed\n")); @@ -655,8 +862,8 @@ } /* Unescape the CP name. */ - result = HgfsUnescapeBuffer(fileNameP->name, result); - fileNameP->length = result; + result = HgfsEscape_Undo(fileName, result); + *fileNameLength = result; req->payloadSize = requestSize + result; return 0; @@ -676,7 +883,7 @@ * rest of the page to zero. * * Results: - * Returns zero on success, or negative error on failure. + * Returns zero on success, or negative error on failure. * * Side effects: * None @@ -684,7 +891,7 @@ *---------------------------------------------------------------------- */ -static int +static int HgfsTruncatePages(struct inode *inode, // IN: Inode whose page to truncate loff_t newSize) // IN: New size of the file { @@ -693,7 +900,7 @@ unsigned pageOffset = newSize & (PAGE_CACHE_SIZE - 1); struct page *page; char *buffer; - + ASSERT(inode); LOG(4, (KERN_DEBUG "VMware hgfs: HgfsTruncatePages: entered\n")); @@ -704,11 +911,11 @@ return result; } - /* + /* * This is a bit complicated, so it merits an explanation. grab_cache_page() - * will give us back the page with the specified index, after having locked - * and incremented its reference count. We must first map it into memory so - * we can modify it. After we're done modifying the page, we flush its data + * will give us back the page with the specified index, after having locked + * and incremented its reference count. We must first map it into memory so + * we can modify it. After we're done modifying the page, we flush its data * from the data cache, unmap it, release our reference, and unlock it. */ page = grab_cache_page(inode->i_mapping, pageIndex); @@ -727,8 +934,8 @@ } -/* - * HGFS inode operations. +/* + * HGFS inode operations. */ /* @@ -755,10 +962,10 @@ * opened with O_EXCL or O_TRUNC. Knowing about O_TRUNC isn't crucial * because we can always create the file now and truncate it later, in * HgfsOpen. But without knowing about O_EXCL, we can't "fail if the file - * exists on the server", which is the desired behavior for O_EXCL. The + * exists on the server", which is the desired behavior for O_EXCL. The * source code for NFSv3 in 2.4.2 describes this shortcoming. The only - * solution, barring massive architectural differences between the 2.4 and - * 2.6 HGFS drivers, is to ignore O_EXCL, but we've supported it up until + * solution, barring massive architectural differences between the 2.4 and + * 2.6 HGFS drivers, is to ignore O_EXCL, but we've supported it up until * now... * * Results: @@ -793,7 +1000,7 @@ * We can call HgfsBuildPath and make the full path to this new entry, * but why bother if it's only for logging. */ - LOG(6, (KERN_DEBUG "VMware hgfs: HgfsCreate: new entry \"%s\"\n", + LOG(6, (KERN_DEBUG "VMware hgfs: HgfsCreate: new entry \"%s\"\n", dentry->d_name.name)); /* Create appropriate attrs for this file. */ @@ -803,13 +1010,13 @@ attr.ownerPerms = (mode & S_IRWXU) >> 6; attr.groupPerms = (mode & S_IRWXG) >> 3; attr.otherPerms = mode & S_IRWXO; - attr.mask = HGFS_ATTR_VALID_TYPE | HGFS_ATTR_VALID_SIZE | - HGFS_ATTR_VALID_SPECIAL_PERMS | HGFS_ATTR_VALID_OWNER_PERMS | + attr.mask = HGFS_ATTR_VALID_TYPE | HGFS_ATTR_VALID_SIZE | + HGFS_ATTR_VALID_SPECIAL_PERMS | HGFS_ATTR_VALID_OWNER_PERMS | HGFS_ATTR_VALID_GROUP_PERMS | HGFS_ATTR_VALID_OTHER_PERMS; result = HgfsInstantiate(dentry, 0, &attr); - /* + /* * Mark the inode as recently created but not yet opened so that if we do * fail to create the actual file in HgfsOpen, we know to force a * revalidate so that the next operation on this inode will fail. @@ -877,7 +1084,7 @@ LOG(6, (KERN_DEBUG "VMware hgfs: HgfsLookup: dir ino %lu, i_dev %u\n", dir->i_ino, dir->i_sb->s_dev)); - LOG(6, (KERN_DEBUG "VMware hgfs: HgfsLookup: entry name is \"%s\"\n", + LOG(6, (KERN_DEBUG "VMware hgfs: HgfsLookup: entry name is \"%s\"\n", dentry->d_name.name)); /* Do a getattr on the file to see if it exists on the server. */ @@ -888,7 +1095,7 @@ /* File exists on the server. */ /* - * Get the inode with this inode number and the attrs we got from + * Get the inode with this inode number and the attrs we got from * the server. */ inode = HgfsIget(dir->i_sb, 0, &attr); @@ -946,19 +1153,15 @@ struct dentry *dentry, // IN: Dentry with name to be created int mode) // IN: Mode of dir to be created { - struct HgfsSuperInfo *si; HgfsReq *req; + HgfsStatus replyStatus; HgfsOp opUsed; - HgfsRequest *requestHeader; - HgfsReplyCreateDir *reply; int result = 0; ASSERT(dir); ASSERT(dir->i_sb); ASSERT(dentry); - si = HGFS_SB_TO_COMMON(dir->i_sb); - req = HgfsGetNewRequest(); if (!req) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsMkdir: out of memory while " @@ -967,64 +1170,65 @@ goto out; } - requestHeader = (HgfsRequest *)(HGFS_REQ_PAYLOAD(req)); retry: - /* - * Set up pointers using the proper struct This lets us check the - * version exactly once and use the pointers later. - */ - requestHeader->op = opUsed = atomic_read(&hgfsVersionCreateDir); - requestHeader->id = req->id; - - result = HgfsPackCreateDirRequest(dentry, mode, req); + opUsed = atomic_read(&hgfsVersionCreateDir); + result = HgfsPackCreateDirRequest(dentry, mode, opUsed, req); if (result != 0) { - LOG(4, (KERN_DEBUG "VMware hgfs: HgfsMkdir: error packing request\n")); + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsMkdir: error packing request\n")); goto out; } - /* - * Send the request and process the reply. Since HgfsReplyCreateDirV2 and + /* + * Send the request and process the reply. Since HgfsReplyCreateDirV2 and * HgfsReplyCreateDir are identical, we need no special logic here. */ result = HgfsSendRequest(req); if (result == 0) { - if (req->payloadSize != sizeof *reply) { - /* This packet size should never vary. */ - LOG(4, (KERN_DEBUG "VMware hgfs: HgfsMkdir: wrong packet size\n")); - result = -EPROTO; - } else { + LOG(6, (KERN_DEBUG "VMware hgfs: HgfsMkdir: got reply\n")); + replyStatus = HgfsReplyStatus(req); + result = HgfsStatusConvertToLinux(replyStatus); - LOG(6, (KERN_DEBUG "VMware hgfs: HgfsMkdir: got reply\n")); - reply = (HgfsReplyCreateDir *)(HGFS_REQ_PAYLOAD(req)); - result = HgfsStatusConvertToLinux(reply->header.status); - - switch (result) { - case 0: - LOG(6, (KERN_DEBUG "VMware hgfs: HgfsMkdir: directory created " - "successfully, instantiating dentry\n")); - result = HgfsInstantiate(dentry, 0, NULL); - - /* - * XXX: When we support hard links, this is a good place to - * increment link count of parent dir. + switch (result) { + case 0: + LOG(6, (KERN_DEBUG "VMware hgfs: HgfsMkdir: directory created " + "successfully, instantiating dentry\n")); + result = HgfsInstantiate(dentry, 0, NULL); + if (result == 0) { + /* + * Attempt to set host directory's uid/gid to that of the + * current user. As with the open(.., O_CREAT) case, this is + * only expected to work when the hgfs server is running on + * a Linux machine and as root, but we might as well give it + * a go. */ - break; - case -EPROTO: - /* Retry with Version 1 of CreateDir. Set globally. */ - if (opUsed == HGFS_OP_CREATE_DIR_V2) { + HgfsSetUidGid(dir, dentry, current->fsuid, current->fsgid); + } + + /* + * XXX: When we support hard links, this is a good place to + * increment link count of parent dir. + */ + break; + case -EPROTO: + /* Retry with older version(s). Set globally. */ + if (opUsed == HGFS_OP_CREATE_DIR_V3) { + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsMkdir: Version 3 not " + "supported. Falling back to version 2.\n")); + atomic_set(&hgfsVersionCreateDir, HGFS_OP_CREATE_DIR_V2); + goto retry; + } else if (opUsed == HGFS_OP_CREATE_DIR_V2) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsMkdir: Version 2 not " "supported. Falling back to version 1.\n")); atomic_set(&hgfsVersionCreateDir, HGFS_OP_CREATE_DIR); goto retry; } - + /* Fallthrough. */ default: LOG(6, (KERN_DEBUG "VMware hgfs: HgfsMkdir: directory was not " "created, error %d\n", result)); break; } - } } else if (result == -EIO) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsMkdir: timed out\n")); } else if (result == -EPROTO) { @@ -1032,7 +1236,7 @@ "returned error: %d\n", result)); } else { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsMkdir: unknown error: " - "%d\n", result)); + "%d\n", result)); } out: @@ -1130,12 +1334,15 @@ struct inode *newDir, // IN: Inode of new directory struct dentry *newDentry) // IN: Dentry containing new name { - struct HgfsSuperInfo *si; HgfsReq *req = NULL; - HgfsRequestRename *request; - HgfsReplyRename *reply; - HgfsFileName *newNameP = NULL; + char *oldName; + char *newName; + uint32 *oldNameLength; + uint32 *newNameLength; int result = 0; + uint32 reqSize; + HgfsOp opUsed; + HgfsStatus replyStatus; ASSERT(oldDir); ASSERT(oldDir->i_sb); @@ -1149,8 +1356,6 @@ goto out; } - si = HGFS_SB_TO_COMMON(oldDir->i_sb); - req = HgfsGetNewRequest(); if (!req) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsRename: out of memory while " @@ -1159,25 +1364,46 @@ goto out; } - request = (HgfsRequestRename *)(HGFS_REQ_PAYLOAD(req)); +retry: + opUsed = atomic_read(&hgfsVersionRename); + if (opUsed == HGFS_OP_RENAME_V3) { + HgfsRequestRenameV3 *request = (HgfsRequestRenameV3 *)HGFS_REQ_PAYLOAD_V3(req); + HgfsRequest *header = (HgfsRequest *)HGFS_REQ_PAYLOAD(req); + + header->op = opUsed; + header->id = req->id; + + oldName = request->oldName.name; + oldNameLength = &request->oldName.length; + request->hints = 0; + request->oldName.flags = 0; + request->oldName.fid = HGFS_INVALID_HANDLE; + request->oldName.caseType = HGFS_FILE_NAME_CASE_SENSITIVE; + request->reserved = 0; + reqSize = HGFS_REQ_PAYLOAD_SIZE_V3(request); + } else { + HgfsRequestRename *request = (HgfsRequestRename *)HGFS_REQ_PAYLOAD(req); - request->header.id = req->id; - request->header.op = HGFS_OP_RENAME; + request->header.op = opUsed; + oldName = request->oldName.name; + oldNameLength = &request->oldName.length; + reqSize = sizeof *request; + } /* Build full old name to send to server. */ - if (HgfsBuildPath(request->oldName.name, HGFS_NAME_BUFFER_SIZE(request), + if (HgfsBuildPath(oldName, HGFS_NAME_BUFFER_SIZET(reqSize), oldDentry) < 0) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsRename: build old path failed\n")); result = -EINVAL; goto out; } LOG(6, (KERN_DEBUG "VMware hgfs: HgfsRename: Old name: \"%s\"\n", - request->oldName.name)); + oldName)); /* Convert old name to CP format. */ - result = CPName_ConvertTo(request->oldName.name, - HGFS_NAME_BUFFER_SIZE(request), - request->oldName.name); + result = CPName_ConvertTo(oldName, + HGFS_NAME_BUFFER_SIZET(reqSize), + oldName); if (result < 0) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsRename: oldName CP " "conversion failed\n")); @@ -1186,32 +1412,49 @@ } /* Unescape the old CP name. */ - result = HgfsUnescapeBuffer(request->oldName.name, result); - request->oldName.length = result; - req->payloadSize = sizeof *request + result; - - /* - * Build full new name to send to server. - * Note the different buffer length. This is because HgfsRequestRename - * contains two filenames, and once we place the first into the packet we - * must account for it when determining the amount of buffer available for + result = HgfsEscape_Undo(oldName, result); + *oldNameLength = result; + reqSize += result; + + /* + * Build full new name to send to server. + * Note the different buffer length. This is because HgfsRequestRename + * contains two filenames, and once we place the first into the packet we + * must account for it when determining the amount of buffer available for * the second. */ - newNameP = (HgfsFileName *)((char *)&request->oldName + - sizeof request->oldName + result); - if (HgfsBuildPath(newNameP->name, HGFS_NAME_BUFFER_SIZE(request) - result, + if (opUsed == HGFS_OP_RENAME_V3) { + HgfsRequestRenameV3 *request = (HgfsRequestRenameV3 *)HGFS_REQ_PAYLOAD_V3(req); + HgfsFileNameV3 *newNameP; + newNameP = (HgfsFileNameV3 *)((char *)&request->oldName + + sizeof request->oldName + result); + newName = newNameP->name; + newNameLength = &newNameP->length; + newNameP->flags = 0; + newNameP->fid = HGFS_INVALID_HANDLE; + newNameP->caseType = HGFS_FILE_NAME_CASE_SENSITIVE; + } else { + HgfsRequestRename *request = (HgfsRequestRename *)HGFS_REQ_PAYLOAD(req); + HgfsFileName *newNameP; + newNameP = (HgfsFileName *)((char *)&request->oldName + + sizeof request->oldName + result); + newName = newNameP->name; + newNameLength = &newNameP->length; + } + + if (HgfsBuildPath(newName, HGFS_NAME_BUFFER_SIZET(reqSize) - result, newDentry) < 0) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsRename: build new path failed\n")); result = -EINVAL; goto out; } LOG(6, (KERN_DEBUG "VMware hgfs: HgfsRename: New name: \"%s\"\n", - newNameP->name)); + newName)); /* Convert new name to CP format. */ - result = CPName_ConvertTo(newNameP->name, - HGFS_NAME_BUFFER_SIZE(request) - result, - newNameP->name); + result = CPName_ConvertTo(newName, + HGFS_NAME_BUFFER_SIZET(reqSize) - result, + newName); if (result < 0) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsRename: newName CP " "conversion failed\n")); @@ -1220,20 +1463,27 @@ } /* Unescape the new CP name. */ - result = HgfsUnescapeBuffer(newNameP->name, result); - newNameP->length = result; - req->payloadSize += result; + result = HgfsEscape_Undo(newName, result); + *newNameLength = result; + reqSize += result; + req->payloadSize = reqSize; result = HgfsSendRequest(req); if (result == 0) { - if (req->payloadSize != sizeof *reply) { - /* This packet size should never vary. */ - LOG(4, (KERN_DEBUG "VMware hgfs: HgfsRename: wrong packet size\n")); - result = -EPROTO; - } else { - LOG(6, (KERN_DEBUG "VMware hgfs: HgfsRename: got reply\n")); - reply = (HgfsReplyRename *)(HGFS_REQ_PAYLOAD(req)); - result = HgfsStatusConvertToLinux(reply->header.status); + LOG(6, (KERN_DEBUG "VMware hgfs: HgfsRename: got reply\n")); + replyStatus = HgfsReplyStatus(req); + result = HgfsStatusConvertToLinux(replyStatus); + + if (result == -EPROTO) { + /* Retry with older version(s). Set globally. */ + if (opUsed == HGFS_OP_RENAME_V3) { + atomic_set(&hgfsVersionRename, HGFS_OP_RENAME); + goto retry; + } else { + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsRename: server " + "returned error: %d\n", result)); + goto out; + } } } else if (result == -EIO) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsRename: timed out\n")); @@ -1242,9 +1492,9 @@ "returned error: %d\n", result)); } else { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsRename: unknown error: " - "%d\n", result)); + "%d\n", result)); } - + out: HgfsFreeRequest(req); return result; @@ -1254,12 +1504,12 @@ /* *---------------------------------------------------------------------- * - * HgfsSymlink -- + * HgfsPackSymlinkCreateRequest -- * - * Handle a symlink request + * Setup the create symlink request, depending on the op version. * * Results: - * Returns zero on success, or a negative error on failure. + * Returns zero on success, or negative error on failure. * * Side effects: * None @@ -1268,115 +1518,205 @@ */ static int -HgfsSymlink(struct inode *dir, // IN: Inode of parent directory - struct dentry *dentry, // IN: Dentry of new symlink file - const char *symname) // IN: Target name +HgfsPackSymlinkCreateRequest(struct dentry *dentry, // IN: File pointer for this open + const char *symname, // IN: Target name + HgfsOp opUsed, // IN: Op to be used + HgfsReq *req) // IN/OUT: Packet to write into { - struct HgfsSuperInfo *si; - HgfsReq *req; - HgfsRequestSymlinkCreate *request; - HgfsReplySymlinkCreate *reply; - HgfsFileName *targetNameP = NULL; - int result = 0; + HgfsRequestSymlinkCreateV3 *requestV3 = NULL; + HgfsRequestSymlinkCreate *request = NULL; + char *symlinkName; + uint32 *symlinkNameLength; + char *targetName; + uint32 *targetNameLength; size_t targetNameBytes; - ASSERT(dir); - ASSERT(dir->i_sb); + size_t requestSize; + int result; + ASSERT(dentry); ASSERT(symname); + ASSERT(req); - si = HGFS_SB_TO_COMMON(dir->i_sb); + switch (opUsed) { + case HGFS_OP_CREATE_SYMLINK_V3: { + HgfsRequest *requestHeader; + + requestHeader = (HgfsRequest *)(HGFS_REQ_PAYLOAD(req)); + requestHeader->op = opUsed; + requestHeader->id = req->id; - req = HgfsGetNewRequest(); - if (!req) { - LOG(4, (KERN_DEBUG "VMware hgfs: HgfsSymlink: out of memory while " - "getting new request\n")); - result = -ENOMEM; - goto out; + requestV3 = (HgfsRequestSymlinkCreateV3 *)HGFS_REQ_PAYLOAD_V3(req); + + /* We'll use these later. */ + symlinkName = requestV3->symlinkName.name; + symlinkNameLength = &requestV3->symlinkName.length; + requestV3->symlinkName.flags = 0; + requestV3->symlinkName.fid = HGFS_INVALID_HANDLE; + requestV3->symlinkName.caseType = HGFS_FILE_NAME_CASE_SENSITIVE; + requestV3->reserved = 0; + requestSize = HGFS_REQ_PAYLOAD_SIZE_V3(requestV3); + break; } + case HGFS_OP_CREATE_SYMLINK: { - request = (HgfsRequestSymlinkCreate *)(HGFS_REQ_PAYLOAD(req)); + request = (HgfsRequestSymlinkCreate *)(HGFS_REQ_PAYLOAD(req)); + request->header.op = opUsed; + request->header.id = req->id; - request->header.id = req->id; - request->header.op = HGFS_OP_CREATE_SYMLINK; + /* We'll use these later. */ + symlinkName = request->symlinkName.name; + symlinkNameLength = &request->symlinkName.length; + requestSize = sizeof *request; + break; + } + default: + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsPackSymlinkCreateRequest: unexpected " + "OP type encountered\n")); + return -EPROTO; + } - /* Build full symlink name to send to server. */ - if (HgfsBuildPath(request->symlinkName.name, HGFS_NAME_BUFFER_SIZE(request), + if (HgfsBuildPath(symlinkName, HGFS_PACKET_MAX - (requestSize - 1), dentry) < 0) { - LOG(4, (KERN_DEBUG "VMware hgfs: HgfsSymlink: build symlink path " + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsPackSymlinkCreateRequest: build symlink path " "failed\n")); - result = -EINVAL; - goto out; + return -EINVAL; } - LOG(6, (KERN_DEBUG "VMware hgfs: HgfsSymlink: Symlink name: \"%s\"\n", - request->symlinkName.name)); + + LOG(6, (KERN_DEBUG "VMware hgfs: HgfsPackSymlinkCreateRequest: Symlink name: \"%s\"\n", + symlinkName)); /* Convert symlink name to CP format. */ - result = CPName_ConvertTo(request->symlinkName.name, - HGFS_NAME_BUFFER_SIZE(request), - request->symlinkName.name); + result = CPName_ConvertTo(symlinkName, + HGFS_PACKET_MAX - (requestSize - 1), + symlinkName); if (result < 0) { - LOG(4, (KERN_DEBUG "VMware hgfs: HgfsSymlink: symlinkName CP " + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsPackSymlinkCreateRequest: symlinkName CP " "conversion failed\n")); - result = -EINVAL; - goto out; + return -EINVAL; } /* Unescape the symlink CP name. */ - result = HgfsUnescapeBuffer(request->symlinkName.name, result); - request->symlinkName.length = result; - req->payloadSize = sizeof *request + result; - - /* - * Note the different buffer length. This is because HgfsRequestSymlink - * contains two filenames, and once we place the first into the packet we - * must account for it when determining the amount of buffer available for + result = HgfsEscape_Undo(symlinkName, result); + *symlinkNameLength = result; + req->payloadSize = requestSize + result; + + /* + * Note the different buffer length. This is because HgfsRequestSymlink + * contains two filenames, and once we place the first into the packet we + * must account for it when determining the amount of buffer available for * the second. * * Also note that targetNameBytes accounts for the NUL character. Once * we've converted it to CP name, it won't be NUL-terminated and the length * of the string in the packet itself won't account for it. */ - targetNameP = (HgfsFileName *)((char *)&request->symlinkName + - sizeof request->symlinkName + result); + if (opUsed == HGFS_OP_CREATE_SYMLINK_V3) { + HgfsFileNameV3 *fileNameP; + fileNameP = (HgfsFileNameV3 *)((char *)&requestV3->symlinkName + + sizeof requestV3->symlinkName + result); + targetName = fileNameP->name; + targetNameLength = &fileNameP->length; + fileNameP->flags = 0; + fileNameP->fid = HGFS_INVALID_HANDLE; + fileNameP->caseType = HGFS_FILE_NAME_CASE_SENSITIVE; + } else { + HgfsFileName *fileNameP; + fileNameP = (HgfsFileName *)((char *)&request->symlinkName + + sizeof request->symlinkName + result); + targetName = fileNameP->name; + targetNameLength = &fileNameP->length; + } targetNameBytes = strlen(symname) + 1; /* Copy target name into request packet. */ - if (targetNameBytes > HGFS_NAME_BUFFER_SIZE(request) - result) { - LOG(4, (KERN_DEBUG "VMware hgfs: HgfsSymlink: target name is too " + if (targetNameBytes > HGFS_PACKET_MAX - (requestSize - 1)) { + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsPackSymlinkCreateRequest: target name is too " "big\n")); - result = -EINVAL; - goto out; + return -EINVAL; } - memcpy(targetNameP->name, symname, targetNameBytes); - LOG(6, (KERN_DEBUG "VMware hgfs: HgfsSymlink: target name: \"%s\"\n", - targetNameP->name)); + memcpy(targetName, symname, targetNameBytes); + LOG(6, (KERN_DEBUG "VMware hgfs: HgfsPackSymlinkCreateRequest: target name: \"%s\"\n", + targetName)); /* Convert target name to CPName-lite format. */ - CPNameLite_ConvertTo(targetNameP->name, targetNameBytes - 1, '/'); + CPNameLite_ConvertTo(targetName, targetNameBytes - 1, '/'); /* Unescape the target CP-lite name. */ - result = HgfsUnescapeBuffer(targetNameP->name, targetNameBytes - 1); - targetNameP->length = result; + result = HgfsEscape_Undo(targetName, targetNameBytes - 1); + *targetNameLength = result; req->payloadSize += result; + return 0; +} + + +/* + *---------------------------------------------------------------------- + * + * HgfsSymlink -- + * + * Handle a symlink request + * + * Results: + * Returns zero on success, or a negative error on failure. + * + * Side effects: + * None + * + *---------------------------------------------------------------------- + */ + +static int +HgfsSymlink(struct inode *dir, // IN: Inode of parent directory + struct dentry *dentry, // IN: Dentry of new symlink file + const char *symname) // IN: Target name +{ + HgfsReq *req; + int result = 0; + HgfsOp opUsed; + HgfsStatus replyStatus; + + ASSERT(dir); + ASSERT(dir->i_sb); + ASSERT(dentry); + ASSERT(symname); + + req = HgfsGetNewRequest(); + if (!req) { + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsSymlink: out of memory while " + "getting new request\n")); + result = -ENOMEM; + goto out; + } + + retry: + opUsed = atomic_read(&hgfsVersionCreateSymlink); + result = HgfsPackSymlinkCreateRequest(dentry, symname, opUsed, req); + if (result != 0) { + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsSymlink: error packing request\n")); + goto out; + } + result = HgfsSendRequest(req); if (result == 0) { - if (req->payloadSize != sizeof *reply) { - /* This packet size should never vary. */ - LOG(4, (KERN_DEBUG "VMware hgfs: HgfsSymlink: wrong packet size\n")); - result = -EPROTO; - } else { - LOG(6, (KERN_DEBUG "VMware hgfs: HgfsSymlink: got reply\n")); - reply = (HgfsReplySymlinkCreate *)(HGFS_REQ_PAYLOAD(req)); - result = HgfsStatusConvertToLinux(reply->header.status); - if (result == 0) { - LOG(6, (KERN_DEBUG "VMware hgfs: HgfsSymlink: symlink created " - "successfully, instantiating dentry\n")); - result = HgfsInstantiate(dentry, 0, NULL); + LOG(6, (KERN_DEBUG "VMware hgfs: HgfsSymlink: got reply\n")); + replyStatus = HgfsReplyStatus(req); + result = HgfsStatusConvertToLinux(replyStatus); + if (result == 0) { + LOG(6, (KERN_DEBUG "VMware hgfs: HgfsSymlink: symlink created " + "successfully, instantiating dentry\n")); + result = HgfsInstantiate(dentry, 0, NULL); + } else if (result == -EPROTO) { + /* Retry with older version(s). Set globally. */ + if (opUsed == HGFS_OP_CREATE_SYMLINK_V3) { + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsSymlink: Version 3 " + "not supported. Falling back to version 2.\n")); + atomic_set(&hgfsVersionCreateSymlink, HGFS_OP_CREATE_SYMLINK); + goto retry; } else { LOG(6, (KERN_DEBUG "VMware hgfs: HgfsSymlink: symlink was not " - "created, error %d\n", result)); + "created, error %d\n", result)); } } } else if (result == -EIO) { @@ -1386,9 +1726,9 @@ "returned error: %d\n", result)); } else { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsSymlink: unknown error: " - "%d\n", result)); + "%d\n", result)); } - + out: HgfsFreeRequest(req); @@ -1464,10 +1804,8 @@ HgfsSetattr(struct dentry *dentry, // IN: File to set attributes of struct iattr *iattr) // IN: Attributes to set { - struct HgfsSuperInfo *si; HgfsReq *req; - HgfsRequest *requestHeader; - HgfsReplySetattr *reply; + HgfsStatus replyStatus; int result = 0; Bool changed = FALSE; Bool allowHandleReuse = TRUE; @@ -1479,8 +1817,6 @@ ASSERT(dentry->d_sb); ASSERT(iattr); - si = HGFS_SB_TO_COMMON(dentry->d_sb); - req = HgfsGetNewRequest(); if (!req) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsSetattr: out of memory while " @@ -1489,20 +1825,17 @@ goto out; } - requestHeader = (HgfsRequest *)(HGFS_REQ_PAYLOAD(req)); - retry: /* Fill out the request packet. */ - requestHeader->op = opUsed = atomic_read(&hgfsVersionSetattr); - requestHeader->id = req->id; - result = HgfsPackSetattrRequest(iattr, dentry, req, &changed, - allowHandleReuse); + opUsed = atomic_read(&hgfsVersionSetattr); + result = HgfsPackSetattrRequest(iattr, dentry, allowHandleReuse, + opUsed, req, &changed); if (result != 0 || !changed) { - LOG(4, (KERN_DEBUG "VMware hgfs: HgfsSetattr: no attrs changed\n")); + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsSetattr: no attrs changed\n")); goto out; } - /* + /* * Flush all dirty pages prior to sending the request if we're going to * modify the file size. */ @@ -1514,13 +1847,13 @@ result = HgfsSendRequest(req); if (result == 0) { /* Get the reply. */ - reply = (HgfsReplySetattr *)(HGFS_REQ_PAYLOAD(req)); - result = HgfsStatusConvertToLinux(reply->header.status); - + replyStatus = HgfsReplyStatus(req); + result = HgfsStatusConvertToLinux(replyStatus); + switch (result) { case 0: - /* - * If we modified the file size, we must truncate our pages from the + /* + * If we modified the file size, we must truncate our pages from the * page cache. */ if (iattr->ia_valid & ATTR_SIZE) { @@ -1529,12 +1862,12 @@ /* Fallthrough to revalidate. */ case -EPERM: - /* + /* * Now that the server's attributes are updated, let's update our * local view of them. Unfortunately, we can't trust iattr, because * the server may have chosen to ignore certain attributes that we * asked it to set. For example, a Windows server will have ignored - * the mode nearly entirely. Therefore, rather than calling + * the mode nearly entirely. Therefore, rather than calling * inode_setattr() to update the inode with the contents of iattr, * just force a revalidate. * @@ -1546,7 +1879,7 @@ break; case -EBADF: - /* + /* * This can happen if we attempted a setattr by handle and the handle * was closed. Because we have no control over the backdoor, it's * possible that an attacker closed our handle, in which case the @@ -1559,7 +1892,7 @@ goto retry; } - /* + /* * There's no reason why the server should have sent us this error * when we haven't used a handle. But to prevent an infinite loop in * the driver, let's make sure that we don't retry again. @@ -1567,8 +1900,13 @@ break; case -EPROTO: - /* Retry with Version 1 of Setattr. Set globally. */ - if (opUsed == HGFS_OP_SETATTR_V2) { + /* Retry with older version(s). Set globally. */ + if (opUsed == HGFS_OP_SETATTR_V3) { + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsSetattr: Version 3 " + "not supported. Falling back to version 2.\n")); + atomic_set(&hgfsVersionSetattr, HGFS_OP_SETATTR_V2); + goto retry; + } else if (opUsed == HGFS_OP_SETATTR_V2) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsSetattr: Version 2 " "not supported. Falling back to version 1.\n")); atomic_set(&hgfsVersionSetattr, HGFS_OP_SETATTR); @@ -1586,9 +1924,9 @@ "returned error: %d\n", result)); } else { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsSetattr: unknown error: " - "%d\n", result)); + "%d\n", result)); } - + out: HgfsFreeRequest(req); return result; @@ -1656,7 +1994,7 @@ } } else { LOG(6, (KERN_DEBUG "VMware hgfs: HgfsRevalidate: using cached dentry " - "attributes\n")); + "attributes\n")); } return error; diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/kernelStubs.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/kernelStubs.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/kernelStubs.h 2008-01-28 08:02:46.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/kernelStubs.h 2008-10-13 08:01:43.000000000 +0100 @@ -21,7 +21,7 @@ * * KernelStubs implements some userspace library functions in terms * of kernel functions to allow library userspace code to be used in a - * kernel. + * kernel. */ #ifndef __KERNELSTUBS_H__ @@ -29,7 +29,7 @@ #ifdef linux # ifndef __KERNEL__ -# error "__KERNEL__ is not defined" +# error "__KERNEL__ is not defined" # endif # include "driver-config.h" // Must be included before any other header files # include "vm_basic_types.h" @@ -57,10 +57,10 @@ #elif defined(__APPLE__) # include "vm_basic_types.h" # ifndef KERNEL -# error "KERNEL is not defined" +# error "KERNEL is not defined" # endif # include <stdarg.h> -# include <string.h> +# include <string.h> #endif /* @@ -71,9 +71,6 @@ # ifdef linux /* if (linux) { */ char *strdup(const char *source); -# elif defined(__APPLE__) /* else if (__APPLE__) { */ -void KernelStubs_Init(void); -void KernelStubs_Cleanup(void); # endif /* Shared between Linux and Apple kernel stubs. */ @@ -130,8 +127,8 @@ /* * Stub functions we provide. */ + void Panic(const char *fmt, ...); -uint64 System_Uptime(void); char *Str_Strcpy(char *buf, const char *src, size_t maxSize); int Str_Vsnprintf(char *str, size_t size, const char *format, diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/kernelStubsLinux.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/kernelStubsLinux.c --- open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/kernelStubsLinux.c 2008-01-28 08:02:46.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/kernelStubsLinux.c 2008-10-13 08:01:43.000000000 +0100 @@ -19,27 +19,20 @@ /* * kernelStubsLinux.c * - * This file contains implementations of common userspace functions in terms + * This file contains implementations of common userspace functions in terms * that the Linux kernel can understand. */ /* Must come before any kernel header file */ #include "driver-config.h" #include "kernelStubs.h" +#include "compat_kernel.h" #include "compat_page.h" #include "compat_sched.h" #include <linux/slab.h> #include "vm_assert.h" -/* - * vsnprintf was born in 2.4.10. Fall back on vsprintf if we're - * an older kernel. - */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 10) -#define vsnprintf(str, size, fmt, args) vsprintf(str, fmt, args) -#endif - /* *----------------------------------------------------------------------------- @@ -66,7 +59,7 @@ va_start(args, fmt); result = Str_Vasprintf(NULL, fmt, args); va_end(args); - + if (result) { printk(KERN_EMERG "%s", result); } @@ -102,7 +95,7 @@ size_t len; len = strlen(src); - if (len >= maxSize) { + if (len >= maxSize) { Panic("%s:%d Buffer too small 0x%x\n", __FILE__,__LINE__, stack[-1]); } @@ -241,7 +234,7 @@ { va_list arguments; char *result; - + va_start(arguments, format); result = Str_Vasprintf(length, format, arguments); va_end(arguments); @@ -253,28 +246,6 @@ /* *----------------------------------------------------------------------------- * - * System_Uptime -- - * - * Retrieves the uptime in hundredths of a second. - * - * Results: - * The uptime value. Always successful. - * - * Side effects: - * None. - * - *----------------------------------------------------------------------------- - */ -uint64 -System_Uptime(void) -{ - return (jiffies * 100) / HZ; -} - - -/* - *----------------------------------------------------------------------------- - * * strdup -- * * Duplicates a string. @@ -294,8 +265,8 @@ { char *target = NULL; if (source) { - - /* + + /* * We call our special implementation of malloc() because the users of * strdup() will call free(), and that'll decrement the pointer before * freeing it. Thus, we need to make sure that the allocated block @@ -315,141 +286,141 @@ /* *---------------------------------------------------------------------------- - * - * malloc -- - * - * Allocate memory using kmalloc. There is no realloc - * equivalent, so we roll our own by padding each allocation with - * 4 (or 8 for 64 bit guests) extra bytes to store the block length. - * - * Results: - * Pointer to driver heap memory, offset by 4 (or 8) - * bytes from the real block pointer. - * - * Side effects: - * None. - * + * + * malloc -- + * + * Allocate memory using kmalloc. There is no realloc + * equivalent, so we roll our own by padding each allocation with + * 4 (or 8 for 64 bit guests) extra bytes to store the block length. + * + * Results: + * Pointer to driver heap memory, offset by 4 (or 8) + * bytes from the real block pointer. + * + * Side effects: + * None. + * *---------------------------------------------------------------------------- - */ - -void * -malloc(size_t size) // IN -{ - unsigned int *ptr; - ptr = kmalloc(size + sizeof(unsigned int), GFP_KERNEL); - - if (ptr) { - *ptr++ = size; - } + */ + +void * +malloc(size_t size) // IN +{ + size_t *ptr; + ptr = kmalloc(size + sizeof size, GFP_KERNEL); + + if (ptr) { + *ptr++ = size; + } return ptr; } -/* +/* *--------------------------------------------------------------------------- - * - * free -- - * + * + * free -- + * * Free memory allocated by a previous call to malloc, calloc or realloc. - * - * Results: - * None. - * - * Side effects: - * Calls kfree to free the real (base) pointer. - * + * + * Results: + * None. + * + * Side effects: + * Calls kfree to free the real (base) pointer. + * *--------------------------------------------------------------------------- - */ + */ + +void +free(void *mem) // IN +{ + if (mem) { + size_t *dataPtr = (size_t *)mem; + kfree(--dataPtr); + } +} + -void -free(void *mem) // IN -{ - if (mem) { - unsigned int *dataPtr = (unsigned int *)mem; - kfree(--dataPtr); - } -} - - -/* +/* *---------------------------------------------------------------------------- - * - * calloc -- - * - * Malloc and zero. - * - * Results: - * Pointer to driver heap memory (see malloc, above). - * - * Side effects: - * None. - * + * + * calloc -- + * + * Malloc and zero. + * + * Results: + * Pointer to driver heap memory (see malloc, above). + * + * Side effects: + * None. + * *---------------------------------------------------------------------------- - */ - -void * -calloc(size_t num, // IN - size_t len) // IN -{ - size_t size; - void *ptr; - - size = num * len; - ptr = malloc(size); - if (ptr) { - memset(ptr, 0, size); - } - return ptr; -} - - -/* + */ + +void * +calloc(size_t num, // IN + size_t len) // IN +{ + size_t size; + void *ptr; + + size = num * len; + ptr = malloc(size); + if (ptr) { + memset(ptr, 0, size); + } + return ptr; +} + + +/* *---------------------------------------------------------------------------- - * - * realloc -- - * - * Since the driver heap has no realloc equivalent, we have to roll our - * own. Fortunately, we can retrieve the block size of every block we + * + * realloc -- + * + * Since the driver heap has no realloc equivalent, we have to roll our + * own. Fortunately, we can retrieve the block size of every block we * hand out since we stashed it at allocation time (see malloc above). - * - * Results: - * Pointer to memory block valid for 'newSize' bytes, or NULL if - * allocation failed. - * - * Side effects: - * Could copy memory around. - * + * + * Results: + * Pointer to memory block valid for 'newSize' bytes, or NULL if + * allocation failed. + * + * Side effects: + * Could copy memory around. + * *---------------------------------------------------------------------------- - */ - -void * -realloc(void* ptr, // IN - size_t newSize) // IN -{ - void *newPtr; - unsigned int *dataPtr; - size_t length, lenUsed; - - dataPtr = (unsigned int *)ptr; - length = ptr ? dataPtr[-1] : 0; - if (newSize == 0) { - if (ptr) { - free(ptr); - newPtr = NULL; - } else { - newPtr = malloc(newSize); - } - } else if (newSize == length) { - newPtr = ptr; - } else if ((newPtr = malloc(newSize))) { - if (length < newSize) { - lenUsed = length; - } else { - lenUsed = newSize; - } - memcpy(newPtr, ptr, lenUsed); - free(ptr); - } - return newPtr; -} + */ + +void * +realloc(void* ptr, // IN + size_t newSize) // IN +{ + void *newPtr; + size_t *dataPtr; + size_t length, lenUsed; + + dataPtr = (size_t *)ptr; + length = ptr ? dataPtr[-1] : 0; + if (newSize == 0) { + if (ptr) { + free(ptr); + newPtr = NULL; + } else { + newPtr = malloc(newSize); + } + } else if (newSize == length) { + newPtr = ptr; + } else if ((newPtr = malloc(newSize))) { + if (length < newSize) { + lenUsed = length; + } else { + lenUsed = newSize; + } + memcpy(newPtr, ptr, lenUsed); + free(ptr); + } + return newPtr; +} diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/link.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/link.c --- open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/link.c 2008-01-28 08:02:46.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/link.c 2008-10-13 08:01:43.000000000 +0100 @@ -19,7 +19,7 @@ /* * link.c -- * - * Symlink-specific inode operations for the filesystem portion of the + * Symlink-specific inode operations for the filesystem portion of the * vmhgfs driver. */ @@ -36,10 +36,10 @@ /* HGFS symlink operations. */ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 13) -static void *HgfsFollowlink(struct dentry *dentry, +static void *HgfsFollowlink(struct dentry *dentry, struct nameidata *nd); #else -static int HgfsFollowlink(struct dentry *dentry, +static int HgfsFollowlink(struct dentry *dentry, struct nameidata *nd); #endif static int HgfsReadlink(struct dentry *dentry, @@ -52,8 +52,8 @@ .readlink = HgfsReadlink, }; -/* - * HGFS symlink operations. +/* + * HGFS symlink operations. */ /* @@ -103,14 +103,14 @@ attr.fileName = NULL; error = HgfsPrivateGetattr(dentry, &attr); if (!error) { - + /* Let's make sure we got called on a symlink. */ if (attr.type != HGFS_FILE_TYPE_SYMLINK || attr.fileName == NULL) { LOG(6, (KERN_DEBUG "VMware hgfs: HgfsFollowlink: got called " "on something that wasn't a symlink\n")); error = -EINVAL; - } else { + } else { LOG(6, (KERN_DEBUG "VMware hgfs: HgfsFollowlink: calling " "vfs_follow_link\n")); error = vfs_follow_link(nd, attr.fileName); @@ -144,7 +144,7 @@ *---------------------------------------------------------------------- */ -static int +static int HgfsReadlink(struct dentry *dentry, // IN: Dentry containing link char __user *buffer, // OUT: User buffer to copy link into int buflen) // IN: Length of user buffer @@ -166,14 +166,14 @@ attr.fileName = NULL; error = HgfsPrivateGetattr(dentry, &attr); if (!error) { - + /* Let's make sure we got called on a symlink. */ if (attr.type != HGFS_FILE_TYPE_SYMLINK || attr.fileName == NULL) { LOG(6, (KERN_DEBUG "VMware hgfs: HgfsReadlink: got called " "on something that wasn't a symlink\n")); error = -EINVAL; - } else { + } else { LOG(6, (KERN_DEBUG "VMware hgfs: HgfsReadlink: calling " "vfs_readlink\n")); error = vfs_readlink(dentry, buffer, buflen, attr.fileName); diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/Makefile /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/Makefile --- open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/Makefile 2008-01-28 08:02:46.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/Makefile 2008-10-13 08:01:43.000000000 +0100 @@ -34,6 +34,7 @@ BUILD_DIR = $(HEADER_DIR)/.. DRIVER := vmhgfs +PRODUCT := @PRODUCT@ # Grep program GREP = /bin/grep @@ -86,7 +87,7 @@ # $(DRIVER_KO) is a phony target, so compare file times explicitly $(DRIVER): $(DRIVER_KO) - if [ $< -nt $@ ]; then cp -f $< $@; fi + if [ $< -nt $@ ] || [ ! -e $@ ] ; then cp -f $< $@; fi # Pass gcc version down the chain, so we can detect if kernel attempts to use unapproved compiler VM_CCVER := $(VMCCVER) diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/Makefile.kernel /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/Makefile.kernel --- open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/Makefile.kernel 2008-01-28 08:02:46.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/Makefile.kernel 2008-10-13 08:01:43.000000000 +0100 @@ -30,6 +30,7 @@ EXTRA_CFLAGS += $(call vm_check_build, $(SRCROOT)/autoconf/maxbytes.c, -DVMW_SB_HAS_MAXBYTES, ) EXTRA_CFLAGS += $(call vm_check_build, $(SRCROOT)/autoconf/cachecreate.c, -DVMW_KMEMCR_HAS_DTOR, ) EXTRA_CFLAGS += $(call vm_check_build, $(SRCROOT)/autoconf/cachector.c, -DVMW_KMEMCR_CTOR_HAS_3_ARGS, ) +EXTRA_CFLAGS += $(call vm_check_build, $(SRCROOT)/autoconf/cachector1.c, -DVMW_KMEMCR_CTOR_HAS_2_ARGS, ) # Note: These tests are inverted EXTRA_CFLAGS += $(call vm_check_build, $(SRCROOT)/autoconf/getsb1.c,, -DVMW_GETSB_2618) @@ -50,6 +51,6 @@ endif clean: - rm -rf $(wildcard $(DRIVER).mod.c $(DRIVER).ko \ - .tmp_versions Module.symvers Modules.symvers \ + rm -rf $(wildcard $(DRIVER).mod.c $(DRIVER).ko .tmp_versions \ + Module.symvers Modules.symvers Module.markers modules.order \ $(foreach dir,./,$(addprefix $(dir),.*.cmd .*.o.flags *.o))) diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/Makefile.normal /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/Makefile.normal --- open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/Makefile.normal 2008-01-28 08:02:46.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/Makefile.normal 2008-10-13 08:01:43.000000000 +0100 @@ -80,17 +80,18 @@ OBJS += super.o # Additional components +OBJS += backdoor.o OBJS += cpName.o OBJS += cpNameLinux.o OBJS += cpNameLite.o -OBJS += hgfsUtil.o -OBJS += staticEscape.o -OBJS += backdoor.o OBJS += hgfsBd.o +OBJS += hgfsEscapeLinux.o +OBJS += hgfsUtil.o OBJS += kernelStubsLinux.o OBJS += message.o OBJS += messageBackdoor.o OBJS += rpcout.o +OBJS += staticEscape.o ifeq ($(MACHINE),x86_64) OBJS += backdoorGcc64.o diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/module.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/module.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/module.h 2008-01-28 08:02:46.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/module.h 2008-10-13 08:01:43.000000000 +0100 @@ -29,9 +29,10 @@ #include "driver-config.h" #include <asm/atomic.h> -#include <asm/semaphore.h> #include "compat_completion.h" #include "compat_fs.h" +#include "compat_kthread.h" +#include "compat_semaphore.h" #include "compat_slab.h" #include "compat_spinlock.h" #include "compat_version.h" @@ -58,7 +59,7 @@ /* The amount of time we'll wait for the backdoor to process our request. */ #define HGFS_REQUEST_TIMEOUT (30 * HZ) -/* +/* * Inode number of the root inode. We set this to be non-zero because, * according to glibc source, when the returned inode number in a dirent * is zero, that entry has been deleted. This is presumably when you've done @@ -126,7 +127,7 @@ /* * The writeback support we're using (set_page_dirty()) was added in - * 2.5.12, so we only support writeback from then on. + * 2.5.12, so we only support writeback from then on. */ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 12) #define HGFS_ENABLE_WRITEBACK @@ -161,8 +162,8 @@ size_t shareNameLen; /* To avoid repeated strlen() calls. */ } HgfsSuperInfo; -/* - * HGFS specific per-inode data. +/* + * HGFS specific per-inode data. */ typedef struct HgfsInodeInfo { #ifdef VMW_EMBED_INODE @@ -194,9 +195,9 @@ /* Handle to be sent to the server. Needed for writepage(). */ HgfsHandle handle; - /* - * Mode with which handle was opened. When we reuse a handle, we need to - * choose one with appropriate permissions. + /* + * Mode with which handle was opened. When we reuse a handle, we need to + * choose one with appropriate permissions. */ HgfsOpenMode mode; } HgfsFileInfo; @@ -207,23 +208,23 @@ */ /* - * We use hgfsBigLock to protect certain global structures that are locked for + * We use hgfsBigLock to protect certain global structures that are locked for * a very short amount of time. */ extern spinlock_t hgfsBigLock; -/* +/* * The request handler thread uses hgfsReqThreadWait to wake up and handle * IO. Possible operations include: * -Sending outgoing HGFS requests. * -Shutting down the request handler thread. * - * Finally, we use hgfsReqThreadDone to synchronize the stopping of the + * Finally, we use hgfsReqThread to synchronize the stopping of the * backdoor handler thread. */ extern long hgfsReqThreadFlags; extern wait_queue_head_t hgfsReqThreadWait; -extern compat_completion hgfsReqThreadDone; +extern struct task_struct *hgfsReqThread; /* Hgfs filesystem structs. */ extern struct super_operations HgfsSuperOperations; @@ -241,10 +242,21 @@ extern RpcOut *hgfsRpcOut; extern unsigned int hgfsIdCounter; extern struct list_head hgfsReqsUnsent; + extern atomic_t hgfsVersionOpen; +extern atomic_t hgfsVersionRead; +extern atomic_t hgfsVersionWrite; +extern atomic_t hgfsVersionClose; +extern atomic_t hgfsVersionSearchOpen; +extern atomic_t hgfsVersionSearchRead; +extern atomic_t hgfsVersionSearchClose; extern atomic_t hgfsVersionGetattr; extern atomic_t hgfsVersionSetattr; -extern atomic_t hgfsVersionSearchRead; extern atomic_t hgfsVersionCreateDir; +extern atomic_t hgfsVersionDeleteFile; +extern atomic_t hgfsVersionDeleteDir; +extern atomic_t hgfsVersionRename; +extern atomic_t hgfsVersionQueryVolumeInfo; +extern atomic_t hgfsVersionCreateSymlink; #endif // _HGFS_DRIVER_MODULE_H_ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/page.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/page.c --- open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/page.c 2008-01-28 08:02:46.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/page.c 2008-10-13 08:01:43.000000000 +0100 @@ -39,18 +39,12 @@ #include "hgfsProto.h" #include "module.h" #include "request.h" +#include "hgfsUtil.h" #include "fsutil.h" #include "inode.h" #include "vm_assert.h" #include "vm_basic_types.h" -/* - * Max amount of read/write data per server request. Must be smaller than - * HGFS_PACKET_MAX by a large enough margin to allow for headers and - * other request fields. - */ -#define HGFS_IO_MAX 4096 - /* Private functions. */ static int HgfsDoWrite(HgfsHandle handle, const char *buf, @@ -70,21 +64,21 @@ unsigned pageTo); /* HGFS address space operations. */ -static int HgfsReadpage(struct file *file, +static int HgfsReadpage(struct file *file, struct page *page); #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 52) -static int HgfsWritepage(struct page *page, +static int HgfsWritepage(struct page *page, struct writeback_control *wbc); #else static int HgfsWritepage(struct page *page); #endif -static int HgfsPrepareWrite(struct file *file, +static int HgfsPrepareWrite(struct file *file, struct page *page, - unsigned pageFrom, + unsigned pageFrom, unsigned pageTo); -static int HgfsCommitWrite(struct file *file, +static int HgfsCommitWrite(struct file *file, struct page *page, - unsigned pageFrom, + unsigned pageFrom, unsigned pageTo); /* HGFS address space operations structure. */ @@ -99,8 +93,8 @@ }; -/* - * Private functions. +/* + * Private functions. */ /* @@ -113,7 +107,7 @@ * * We send a "Read" request to the server with the given handle. * - * It is assumed that this function is never called with a larger read than + * It is assumed that this function is never called with a larger read than * what can be sent in one request. * * Results: @@ -132,9 +126,11 @@ loff_t offset) // IN: Offset at which to read { HgfsReq *req; - HgfsRequestRead *request; - HgfsReplyRead *reply; + HgfsOp opUsed; int result = 0; + uint32 actualSize = 0; + char *payload = NULL; + HgfsStatus replyStatus; ASSERT(buf); @@ -146,48 +142,87 @@ goto out; } - /* Fill out the request fields. */ - request = (HgfsRequestRead *)(HGFS_REQ_PAYLOAD(req)); - request->header.id = req->id; - request->header.op = HGFS_OP_READ; - request->file = handle; - request->offset = offset; - request->requiredSize = count; - req->payloadSize = sizeof *request; + retry: + opUsed = atomic_read(&hgfsVersionRead); + if (opUsed == HGFS_OP_READ_V3) { + HgfsRequest *header; + HgfsRequestReadV3 *request; + + header = (HgfsRequest *)(HGFS_REQ_PAYLOAD(req)); + header->id = req->id; + header->op = opUsed; + + request = (HgfsRequestReadV3 *)(HGFS_REQ_PAYLOAD_V3(req)); + request->file = handle; + request->offset = offset; + request->requiredSize = count; + request->reserved = 0; + req->payloadSize = HGFS_REQ_PAYLOAD_SIZE_V3(request); + } else { + HgfsRequestRead *request; + + request = (HgfsRequestRead *)(HGFS_REQ_PAYLOAD(req)); + request->header.id = req->id; + request->header.op = opUsed; + request->file = handle; + request->offset = offset; + request->requiredSize = count; + req->payloadSize = sizeof *request; + } + /* Send the request and process the reply. */ result = HgfsSendRequest(req); if (result == 0) { /* Get the reply. */ - reply = (HgfsReplyRead *)(HGFS_REQ_PAYLOAD(req)); - result = HgfsStatusConvertToLinux(reply->header.status); - - if (result != 0) { - LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDoRead: read failed\n")); - goto out; - } - - /* Sanity check on read size. */ - if (reply->actualSize > count) { - LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDoRead: read too big!\n")); - result = -EPROTO; - goto out; - } - - if (!reply->actualSize) { - /* We got no bytes, so don't need to copy to user. */ - LOG(6, (KERN_DEBUG "VMware hgfs: HgfsDoRead: server returned " - "zero\n")); - result = reply->actualSize; - goto out; + replyStatus = HgfsReplyStatus(req); + result = HgfsStatusConvertToLinux(replyStatus); + + switch (result) { + case 0: + if (opUsed == HGFS_OP_READ_V3) { + actualSize = ((HgfsReplyReadV3 *)HGFS_REP_PAYLOAD_V3(req))->actualSize; + payload = ((HgfsReplyReadV3 *)HGFS_REP_PAYLOAD_V3(req))->payload; + } else { + actualSize = ((HgfsReplyRead *)HGFS_REQ_PAYLOAD(req))->actualSize; + payload = ((HgfsReplyRead *)HGFS_REQ_PAYLOAD(req))->payload; + } + + /* Sanity check on read size. */ + if (actualSize > count) { + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDoRead: read too big!\n")); + result = -EPROTO; + goto out; + } + + if (!actualSize) { + /* We got no bytes, so don't need to copy to user. */ + LOG(6, (KERN_DEBUG "VMware hgfs: HgfsDoRead: server returned " + "zero\n")); + result = actualSize; + goto out; + } + + /* Return result. */ + memcpy(buf, payload, actualSize); + LOG(6, (KERN_DEBUG "VMware hgfs: HgfsDoRead: copied %u\n", + actualSize)); + result = actualSize; + break; + + case -EPROTO: + /* Retry with older version(s). Set globally. */ + if (opUsed == HGFS_OP_READ_V3) { + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDoRead: Version 3 not " + "supported. Falling back to version 1.\n")); + atomic_set(&hgfsVersionRead, HGFS_OP_READ); + goto retry; + } + break; + + default: + break; } - - /* Return result. */ - memcpy(buf, reply->payload, reply->actualSize); - LOG(6, (KERN_DEBUG "VMware hgfs: HgfsDoRead: copied %u\n", - reply->actualSize)); - result = reply->actualSize; - goto out; } else if (result == -EIO) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDoRead: timed out\n")); } else if (result == -EPROTO) { @@ -209,13 +244,13 @@ * * HgfsDoWrite -- * - * Do one write request. Called by HgfsDoWritepage, possibly multiple - * times if the size of the write is too big to be handled by one server + * Do one write request. Called by HgfsDoWritepage, possibly multiple + * times if the size of the write is too big to be handled by one server * request. * * We send a "Write" request to the server with the given handle. * - * It is assumed that this function is never called with a larger write + * It is assumed that this function is never called with a larger write * than what can be sent in one request. * * Results: @@ -234,9 +269,13 @@ loff_t offset) // IN: Offset to begin writing at { HgfsReq *req; - HgfsRequestWrite *request; - HgfsReplyWrite *reply; int result = 0; + HgfsOp opUsed; + uint32 requiredSize = 0; + uint32 actualSize = 0; + char *payload = NULL; + uint32 reqSize; + HgfsStatus replyStatus; ASSERT(buf); @@ -248,35 +287,79 @@ goto out; } - /* Fill out the request fields. */ - request = (HgfsRequestWrite *)(HGFS_REQ_PAYLOAD(req)); - request->header.id = req->id; - request->header.op = HGFS_OP_WRITE; - request->file = handle; - request->flags = 0; - request->offset = offset; - request->requiredSize = count; + retry: + opUsed = atomic_read(&hgfsVersionWrite); + if (opUsed == HGFS_OP_WRITE_V3) { + HgfsRequest *header; + HgfsRequestWriteV3 *request; + + header = (HgfsRequest *)(HGFS_REQ_PAYLOAD(req)); + header->id = req->id; + header->op = opUsed; + + request = (HgfsRequestWriteV3 *)(HGFS_REQ_PAYLOAD_V3(req)); + request->file = handle; + request->flags = 0; + request->offset = offset; + request->requiredSize = count; + request->reserved = 0; + payload = request->payload; + requiredSize = request->requiredSize; + reqSize = HGFS_REQ_PAYLOAD_SIZE_V3(request); + } else { + HgfsRequestWrite *request; - memcpy(request->payload, buf, request->requiredSize); - req->payloadSize = sizeof *request + request->requiredSize - 1; + request = (HgfsRequestWrite *)(HGFS_REQ_PAYLOAD(req)); + request->header.id = req->id; + request->header.op = opUsed; + request->file = handle; + request->flags = 0; + request->offset = offset; + request->requiredSize = count; + payload = request->payload; + requiredSize = request->requiredSize; + reqSize = sizeof *request; + } + + memcpy(payload, buf, requiredSize); + req->payloadSize = reqSize + requiredSize - 1; /* Send the request and process the reply. */ result = HgfsSendRequest(req); if (result == 0) { /* Get the reply. */ - reply = (HgfsReplyWrite *)(HGFS_REQ_PAYLOAD(req)); - result = HgfsStatusConvertToLinux(reply->header.status); + replyStatus = HgfsReplyStatus(req); + result = HgfsStatusConvertToLinux(replyStatus); - if (result != 0) { - LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDoWrite: write failed\n")); - goto out; + switch (result) { + case 0: + if (opUsed == HGFS_OP_WRITE_V3) { + actualSize = ((HgfsReplyWriteV3 *)HGFS_REP_PAYLOAD_V3(req))->actualSize; + } else { + actualSize = ((HgfsReplyWrite *)HGFS_REQ_PAYLOAD(req))->actualSize; + } + + /* Return result. */ + LOG(6, (KERN_DEBUG "VMware hgfs: HgfsDoWrite: wrote %u bytes\n", + actualSize)); + result = actualSize; + break; + + case -EPROTO: + /* Retry with older version(s). Set globally. */ + if (opUsed == HGFS_OP_WRITE_V3) { + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDoWrite: Version 3 not " + "supported. Falling back to version 1.\n")); + atomic_set(&hgfsVersionWrite, HGFS_OP_WRITE); + goto retry; + } + break; + + default: + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDoWrite: server " + "returned error: %d\n", result)); + break; } - - /* Return result. */ - LOG(6, (KERN_DEBUG "VMware hgfs: HgfsDoWrite: wrote %u bytes\n", - reply->actualSize)); - result = reply->actualSize; - goto out; } else if (result == -EIO) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDoWrite: timed out\n")); } else if (result == -EPROTO) { @@ -313,7 +396,7 @@ *----------------------------------------------------------------------------- */ -static int +static int HgfsDoReadpage(HgfsHandle handle, // IN: Handle to use for reading struct page *page, // IN/OUT: Page to read into unsigned pageFrom, // IN: Where to start reading to @@ -347,15 +430,15 @@ buffer += result; } while ((result > 0) && (remainingCount > 0)); - /* + /* * It's possible that despite being asked to read a full page, there is less - * than a page in the file from this offset, so we should zero the rest of + * than a page in the file from this offset, so we should zero the rest of * the page's memory. */ memset(buffer, 0, remainingCount); - /* - * We read a full page (or all of the page that actually belongs to the + /* + * We read a full page (or all of the page that actually belongs to the * file), so mark it up to date. Also, flush the old page data from the data * cache. */ @@ -403,7 +486,7 @@ *----------------------------------------------------------------------------- */ -static int +static int HgfsDoWritepage(HgfsHandle handle, // IN: Handle to use for writing struct page *page, // IN: Page containing data to write unsigned pageFrom, // IN: Beginning page offset @@ -431,7 +514,7 @@ HGFS_IO_MAX : remainingCount; result = HgfsDoWrite(handle, buffer, nextCount, curOffset); if (result < 0) { - LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDoWritepage: write error %d\n", + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsDoWritepage: write error %d\n", result)); goto out; } @@ -478,8 +561,8 @@ *----------------------------------------------------------------------------- */ -static int -HgfsReadpage(struct file *file, // IN: File to read from +static int +HgfsReadpage(struct file *file, // IN: File to read from struct page *page) // IN/OUT: Page to write to { int result = 0; @@ -492,7 +575,7 @@ handle = FILE_GET_FI_P(file)->handle; LOG(6, (KERN_DEBUG "VMware hgfs: HgfsReadPage: reading from handle %u\n", - handle)); + handle)); page_cache_get(page); result = HgfsDoReadpage(handle, page, 0, PAGE_CACHE_SIZE); @@ -508,9 +591,9 @@ * HgfsWritepage -- * * The "spontaneous" way to write a page, called when the kernel is under - * memory pressure or is asked to sync a memory mapped file. Because - * writepage() can be called from so many different places, we don't get a - * filp with which to write, and we have to be very careful about races and + * memory pressure or is asked to sync a memory mapped file. Because + * writepage() can be called from so many different places, we don't get a + * filp with which to write, and we have to be very careful about races and * locking. * * Results: @@ -523,11 +606,11 @@ */ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 52) -static int +static int HgfsWritepage(struct page *page, // IN: Page to write from struct writeback_control *wbc) // IN: Ignored #else -static int +static int HgfsWritepage(struct page *page) // IN: Page to write from #endif { @@ -544,8 +627,8 @@ inode = page->mapping->host; /* We need a writable file handle. */ - result = HgfsGetHandle(inode, - HGFS_OPEN_MODE_WRITE_ONLY + 1, + result = HgfsGetHandle(inode, + HGFS_OPEN_MODE_WRITE_ONLY + 1, &handle); if (result) { LOG(4, (KERN_DEBUG "VMware hgfs: HgfsWritepage: could not get writable " @@ -553,7 +636,7 @@ goto exit; } - /* + /* * We were given an entire page to write. In most cases this means "start * writing from the beginning of the page (byte 0) to the very end (byte * PAGE_CACHE_SIZE). But what if this is the last page of the file? Then @@ -576,7 +659,7 @@ } } - /* + /* * This part is fairly intricate, so it deserves some explanation. We're * really interested in calling HgfsDoWritepage with our page and * handle, without having to then worry about locks or references. See @@ -584,19 +667,19 @@ * must obey. * * Firstly, we acquire a reference to the page via page_cache_get() and call - * compat_set_page_writeback(). The latter does a number of things: it sets - * the writeback bit on the page, and if it wasn't already set, it sets the + * compat_set_page_writeback(). The latter does a number of things: it sets + * the writeback bit on the page, and if it wasn't already set, it sets the * writeback bit in the radix tree. Then, if the page isn't dirty, it clears - * the dirty bit in the radix tree. The end result is that the radix tree's + * the dirty bit in the radix tree. The end result is that the radix tree's * notion of dirty and writeback is fully synced with the page itself. * - * Secondly, we write the page itself. + * Secondly, we write the page itself. * - * Thirdly, we end writeback of the page via compat_end_page_writeback(), + * Thirdly, we end writeback of the page via compat_end_page_writeback(), * and release our reference on the page. * - * Finally, we unlock the page, waking up its waiters and making it - * available to anyone else. Note that this step must be performed + * Finally, we unlock the page, waking up its waiters and making it + * available to anyone else. Note that this step must be performed * regardless of whether we wrote anything, as the VFS locked the page for * us. */ @@ -619,7 +702,7 @@ * * Called by the generic write path to set up a write request for a page. * We're expected to do any pre-allocation and housekeeping prior to - * receiving the write. + * receiving the write. * * Results: * Always zero. @@ -630,7 +713,7 @@ *----------------------------------------------------------------------------- */ -static int +static int HgfsPrepareWrite(struct file *file, // IN: Ignored struct page *page, // IN: Page to prepare unsigned pageFrom, // IN: Beginning page offset @@ -648,7 +731,7 @@ if ((offset >= currentFileSize) || ((pageFrom == 0) && (offset + pageTo) >= currentFileSize)) { void *kaddr = kmap_atomic(page, KM_USER0); - + if (pageFrom) { memset(kaddr, 0, pageFrom); } @@ -660,11 +743,11 @@ } #endif - /* - * Prior to 2.4.10, our caller expected to call page_address(page) between + /* + * Prior to 2.4.10, our caller expected to call page_address(page) between * the calls to prepare_write() and commit_write(). This meant filesystems - * had to kmap() the page in prepare_write() and kunmap() it in - * commit_write(). In 2.4.10, the call to page_address() was replaced with + * had to kmap() the page in prepare_write() and kunmap() it in + * commit_write(). In 2.4.10, the call to page_address() was replaced with * __copy_to_user(), and while its not clear to me why this is safer, * nfs_prepare_write() dropped the kmap()/kunmap() calls in the same patch, * so the two events must be related. @@ -682,9 +765,9 @@ * HgfsCommitWrite -- * * This function is the more common write path for HGFS, called from - * generic_file_buffered_write. It is much simpler for us than - * HgfsWritepage above: the caller has obtained a reference to the page - * and will unlock it when we're done. And we don't need to worry about + * generic_file_buffered_write. It is much simpler for us than + * HgfsWritepage above: the caller has obtained a reference to the page + * and will unlock it when we're done. And we don't need to worry about * properly marking the writeback bit, either. See mm/filemap.c in the * kernel for details about how we are called. * @@ -697,7 +780,7 @@ *----------------------------------------------------------------------------- */ -static int +static int HgfsCommitWrite(struct file *file, // IN: File we're writing to struct page *page, // IN: Page we're writing from unsigned pageFrom, // IN: Beginning page offset @@ -724,15 +807,15 @@ if (writeTo > currentFileSize) { compat_i_size_write(inode, writeTo); } - + /* We wrote a complete page, so it is up to date. */ if ((pageTo - pageFrom) == PAGE_CACHE_SIZE) { SetPageUptodate(page); } #ifdef HGFS_ENABLE_WRITEBACK - /* - * Check if this is a partial write to a new page, which was + /* + * Check if this is a partial write to a new page, which was * initialized in HgfsPrepareWrite. */ if ((offset >= currentFileSize) || @@ -756,8 +839,8 @@ * would make it uptodate (ie a complete cached page). */ handle = FILE_GET_FI_P(file)->handle; - LOG(6, (KERN_DEBUG "VMware hgfs: HgfsCommitWrite: writing to handle %u\n", - handle)); + LOG(6, (KERN_DEBUG "VMware hgfs: HgfsCommitWrite: writing to handle %u\n", + handle)); return HgfsDoWritepage(handle, page, pageFrom, pageTo); } diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/request.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/request.c --- open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/request.c 2008-01-28 08:02:46.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/request.c 2008-10-13 08:01:43.000000000 +0100 @@ -27,11 +27,11 @@ #include "driver-config.h" #include <asm/atomic.h> -#include <asm/semaphore.h> #include <linux/list.h> #include <linux/signal.h> #include "compat_kernel.h" #include "compat_sched.h" +#include "compat_semaphore.h" #include "compat_slab.h" #include "compat_spinlock.h" @@ -79,13 +79,13 @@ LOG(4, (KERN_DEBUG "VMware hgfs: HgfsWaitRequestReply: null req\n")); return -EINVAL; } - - timeleft = wait_event_timeout(req->queue, + + timeleft = wait_event_timeout(req->queue, (req->state == HGFS_REQ_STATE_COMPLETED || req->state == HGFS_REQ_STATE_ERROR), HGFS_REQUEST_TIMEOUT); - /* - * Did we time out? If so, abandon the request. We have to be careful, + /* + * Did we time out? If so, abandon the request. We have to be careful, * because a timeout means that the request is still on a list somewhere. */ if (timeleft == 0) { @@ -95,7 +95,7 @@ } spin_unlock(&hgfsBigLock); - /* + /* * Notice that we're completely ignoring any pending signals. That's * because the request timed out; it was not interrupted. There's no * point in having the client retry the syscall (through -ERESTARTSYS) if @@ -103,7 +103,7 @@ */ err = -EIO; } else if (req->state == HGFS_REQ_STATE_ERROR) { - /* + /* * If the backdoor exploded, let's modify the return value so the client * knows about it. We only care about this if we didn't timeout. */ @@ -195,10 +195,10 @@ req->state = HGFS_REQ_STATE_UNSENT; - LOG(8, (KERN_DEBUG "VMware hgfs: HgfsSendRequest: Sending request id %d\n", + LOG(8, (KERN_DEBUG "VMware hgfs: HgfsSendRequest: Sending request id %d\n", req->id)); - /* + /* * Add the request to the queue, wake up the backdoor handler thread, and * wait for a reply. */ @@ -210,7 +210,7 @@ wake_up_interruptible(&hgfsReqThreadWait); error = HgfsWaitRequestReply(req); - return error; + return error; } @@ -234,7 +234,7 @@ HgfsFreeRequest(HgfsReq *req) // IN: Request to free { ASSERT(hgfsReqCache); - + /* Atomically decrement counter. */ spin_lock(&hgfsBigLock); hgfsIdCounter--; @@ -245,3 +245,31 @@ } } + +/* + *---------------------------------------------------------------------- + * + * HgfsReplyStatus -- + * + * Return reply status. + * + * Results: + * Returns reply status as per the protocol. + * XXX: Needs changes when vmci headers are added. + * + * Side effects: + * None + * + *---------------------------------------------------------------------- + */ + +HgfsStatus +HgfsReplyStatus(HgfsReq *req) // IN +{ + HgfsReply *rep; + + rep = (HgfsReply *)(HGFS_REQ_PAYLOAD(req)); + + return rep->status; +} + diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/request.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/request.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/request.h 2008-01-28 08:02:46.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/request.h 2008-10-13 08:01:43.000000000 +0100 @@ -40,6 +40,10 @@ /* Macros for accessing the payload portion of the HGFS request packet. */ #define HGFS_REQ_PAYLOAD(hgfsReq) ((hgfsReq)->packet + HGFS_CLIENT_CMD_LEN) +/* XXX: Needs change when VMCI is supported. */ +#define HGFS_REQ_PAYLOAD_V3(hgfsReq) (HGFS_REQ_PAYLOAD(hgfsReq) + sizeof(HgfsRequest)) +#define HGFS_REP_PAYLOAD_V3(hgfsRep) (HGFS_REQ_PAYLOAD(hgfsRep) + sizeof(HgfsReply)) + /* * HGFS_REQ_STATE_ALLOCATED: * The filesystem half has allocated the request from the slab @@ -56,7 +60,7 @@ * asynchronously. The request is now on the sent list, and whenever * the reply arrives, the backdoor handler will remove the request from * the sent list and stuff the reply into the request's packet buffer. - * + * * HGFS_REQ_STATE_ERROR: * The backdoor handler encountered an error while sending the request * or getting the reply. The filesystem half of the driver should @@ -79,11 +83,11 @@ * A request to be sent to the user process. */ typedef struct HgfsReq { - + /* Links to place the object on various lists. */ struct list_head list; - - /* + + /* * When clients wait for the reply to a request, they'll wait on this * wait queue. */ @@ -98,7 +102,7 @@ /* Total size of the payload.*/ size_t payloadSize; - /* + /* * Packet of data, for both incoming and outgoing messages. * Include room for the command. */ @@ -109,5 +113,6 @@ HgfsReq *HgfsGetNewRequest(void); int HgfsSendRequest(HgfsReq *req); void HgfsFreeRequest(HgfsReq *req); +HgfsStatus HgfsReplyStatus(HgfsReq *req); // IN #endif // _HGFS_DRIVER_REQUEST_H_ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/rpcout.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/rpcout.c --- open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/rpcout.c 2008-01-28 08:02:46.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/rpcout.c 2008-10-13 08:01:43.000000000 +0100 @@ -293,10 +293,13 @@ } /* - * If the command doesn't contain a space, add one to the - * end to maintain compatibility with old VMXs. + * If the command doesn't contain a space, add one to the end to maintain + * compatibility with old VMXs. * - * XXX Do we still need to bother with this? + * 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; @@ -346,7 +349,8 @@ * 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. + * 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 diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/super.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/super.c --- open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/super.c 2008-01-28 08:02:46.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/super.c 2008-10-13 08:01:43.000000000 +0100 @@ -35,11 +35,11 @@ #include "hgfsProto.h" #include "escBitvector.h" +#include "hgfsEscape.h" #include "cpName.h" #include "hgfsUtil.h" #include "request.h" #include "fsutil.h" -#include "staticEscape.h" #include "hgfsDevLinux.h" #include "module.h" #include "vm_assert.h" @@ -50,7 +50,9 @@ static struct inode *HgfsAllocInode(struct super_block *sb); static void HgfsDestroyInode(struct inode *inode); #endif +#ifndef VMW_USE_IGET_LOCKED static void HgfsReadInode(struct inode *inode); +#endif static void HgfsClearInode(struct inode *inode); static void HgfsPutSuper(struct super_block *sb); #if defined(VMW_STATFS_2618) @@ -66,7 +68,9 @@ .alloc_inode = HgfsAllocInode, .destroy_inode = HgfsDestroyInode, #endif +#ifndef VMW_USE_IGET_LOCKED .read_inode = HgfsReadInode, +#endif .clear_inode = HgfsClearInode, .put_super = HgfsPutSuper, .statfs = HgfsStatfs, @@ -134,6 +138,9 @@ } #endif + + +#ifndef VMW_USE_IGET_LOCKED /* *----------------------------------------------------------------------------- * @@ -154,31 +161,9 @@ static void HgfsReadInode(struct inode *inode) // IN/OUT: VFS inode to fill in { - HgfsInodeInfo *iinfo = INODE_GET_II_P(inode); - - /* - * If the vfs inode is not embedded within the HgfsInodeInfo, then we - * haven't yet allocated the HgfsInodeInfo. Do so now. - * - * XXX: We could allocate with GFP_ATOMIC. But instead, we'll do a standard - * allocation and mark the inode "bad" if the allocation fails. This'll - * make all subsequent operations on the inode fail, which is what we want. - */ -#ifndef VMW_EMBED_INODE - iinfo = kmem_cache_alloc(hgfsInodeCache, GFP_KERNEL); - if (!iinfo) { - LOG(4, (KERN_DEBUG "VMware hgfs: HgfsReadInode: no memory for " - "iinfo!\n")); - make_bad_inode(inode); - return; - } -#endif - INODE_SET_II_P(inode, iinfo); - INIT_LIST_HEAD(&iinfo->files); - iinfo->isReferencedInode = FALSE; - iinfo->isFakeInodeNumber = FALSE; - iinfo->createdAndUnopened = FALSE; + HgfsDoReadInode(inode); } +#endif /* @@ -250,6 +235,102 @@ /* + *---------------------------------------------------------------------- + * + * HgfsPackQueryVolumeRequest -- + * + * Setup the query volume request, depending on the op version. + * + * Results: + * Returns zero on success, or negative error on failure. + * + * Side effects: + * None + * + *---------------------------------------------------------------------- + */ + +static int +HgfsPackQueryVolumeRequest(struct dentry *dentry, // IN: File pointer for this open + HgfsOp opUsed, // IN: Op to be used. + HgfsReq *req) // IN/OUT: Packet to write into +{ + char *name; + uint32 *nameLength; + size_t requestSize; + int result; + + ASSERT(dentry); + ASSERT(req); + + switch (opUsed) { + case HGFS_OP_QUERY_VOLUME_INFO_V3: { + HgfsRequest *requestHeader; + HgfsRequestQueryVolumeV3 *requestV3; + + requestHeader = (HgfsRequest *)(HGFS_REQ_PAYLOAD(req)); + requestHeader->op = opUsed; + requestHeader->id = req->id; + + requestV3 = (HgfsRequestQueryVolumeV3 *)HGFS_REQ_PAYLOAD_V3(req); + + /* We'll use these later. */ + name = requestV3->fileName.name; + nameLength = &requestV3->fileName.length; + requestV3->fileName.flags = 0; + requestV3->fileName.fid = HGFS_INVALID_HANDLE; + requestV3->fileName.caseType = HGFS_FILE_NAME_CASE_SENSITIVE; + requestV3->reserved = 0; + requestSize = HGFS_REQ_PAYLOAD_SIZE_V3(requestV3); + break; + } + case HGFS_OP_QUERY_VOLUME_INFO: { + HgfsRequestQueryVolume *request; + + request = (HgfsRequestQueryVolume *)(HGFS_REQ_PAYLOAD(req)); + request->header.op = opUsed; + request->header.id = req->id; + + /* We'll use these later. */ + name = request->fileName.name; + nameLength = &request->fileName.length; + requestSize = sizeof *request; + break; + } + default: + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsPackQueryVolumeRequest: unexpected " + "OP type encountered\n")); + return -EPROTO; + } + + /* Build full name to send to server. */ + if (HgfsBuildPath(name, HGFS_PACKET_MAX - (requestSize - 1), + dentry) < 0) { + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsPackQueryVolumeRequest: build path failed\n")); + return -EINVAL; + } + LOG(6, (KERN_DEBUG "VMware hgfs: HgfsPackQueryVolumeRequest: opening \"%s\"\n", + name)); + + /* Convert to CP name. */ + result = CPName_ConvertTo(name, + HGFS_PACKET_MAX - (requestSize - 1), + name); + if (result < 0) { + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsPackQueryVolumeRequest: CP conversion failed\n")); + return -EINVAL; + } + + /* Unescape the CP name. */ + result = HgfsEscape_Undo(name, result); + *nameLength = (uint32) result; + req->payloadSize = requestSize + result; + + return 0; +} + + +/* *----------------------------------------------------------------------------- * * HgfsStatfs -- @@ -278,11 +359,13 @@ #endif { HgfsReq *req; - HgfsRequestQueryVolume *request; - HgfsReplyQueryVolume *reply; int result = 0; struct dentry *dentryToUse; struct super_block *sbToUse; + HgfsOp opUsed; + HgfsStatus replyStatus; + uint64 freeBytes; + uint64 totalBytes; ASSERT(stat); #if defined(VMW_STATFS_2618) @@ -307,42 +390,19 @@ goto out; } - request = (HgfsRequestQueryVolume *)(HGFS_REQ_PAYLOAD(req)); - - /* Fill out the request packet. */ - request->header.op = HGFS_OP_QUERY_VOLUME_INFO; - request->header.id = req->id; - - /* Build full name to send to server. */ - if (HgfsBuildPath(request->fileName.name, HGFS_NAME_BUFFER_SIZE(request), - dentryToUse) < 0) { - LOG(4, (KERN_DEBUG "VMware hgfs: HgfsStatfs: build path failed\n")); - result = -EINVAL; - goto out; - } - LOG(6, (KERN_DEBUG "VMware hgfs: HgfsStatfs: getting fs stats on \"%s\"\n", - request->fileName.name)); - - /* Convert to CP name. */ - result = CPName_ConvertTo(request->fileName.name, - HGFS_NAME_BUFFER_SIZE(request), - request->fileName.name); - if (result < 0) { - LOG(4, (KERN_DEBUG "VMware hgfs: HgfsStatfs: CP conversion failed\n")); - result = -EINVAL; + retry: + opUsed = atomic_read(&hgfsVersionQueryVolumeInfo); + result = HgfsPackQueryVolumeRequest(dentryToUse, opUsed, req); + if (result != 0) { + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsStatfs: error packing request\n")); goto out; } - /* Unescape the CP name. */ - result = HgfsUnescapeBuffer(request->fileName.name, result); - request->fileName.length = result; - req->payloadSize = sizeof *request + result; - result = HgfsSendRequest(req); if (result == 0) { LOG(6, (KERN_DEBUG "VMware hgfs: HgfsStatfs: got reply\n")); - reply = (HgfsReplyQueryVolume *)(HGFS_REQ_PAYLOAD(req)); - result = HgfsStatusConvertToLinux(reply->header.status); + replyStatus = HgfsReplyStatus(req); + result = HgfsStatusConvertToLinux(replyStatus); /* * If the statfs succeeded on the server, copy the stats @@ -353,21 +413,38 @@ stat->f_type = HGFS_SUPER_MAGIC; stat->f_bsize = sbToUse->s_blocksize; stat->f_namelen = PATH_MAX; - stat->f_blocks = reply->totalBytes >> sbToUse->s_blocksize_bits; - stat->f_bfree = reply->freeBytes >> sbToUse->s_blocksize_bits; + if (opUsed == HGFS_OP_QUERY_VOLUME_INFO_V3) { + totalBytes = ((HgfsReplyQueryVolumeV3 *)HGFS_REP_PAYLOAD_V3(req))->totalBytes; + freeBytes = ((HgfsReplyQueryVolumeV3 *)HGFS_REP_PAYLOAD_V3(req))->freeBytes; + } else { + totalBytes = ((HgfsReplyQueryVolume *)HGFS_REQ_PAYLOAD(req))->totalBytes; + freeBytes = ((HgfsReplyQueryVolume *)HGFS_REQ_PAYLOAD(req))->freeBytes; + } + stat->f_blocks = totalBytes >> sbToUse->s_blocksize_bits; + stat->f_bfree = freeBytes >> sbToUse->s_blocksize_bits; stat->f_bavail = stat->f_bfree; break; case -EPERM: - /* - * We're cheating! This will cause statfs will return success. + /* + * We're cheating! This will cause statfs will return success. * We're doing this because an old server will complain when it gets * a statfs on a per-share mount. Rather than have 'df' spit an * error, let's just return all zeroes. */ result = 0; break; - + + case -EPROTO: + /* Retry with older version(s). Set globally. */ + if (opUsed == HGFS_OP_QUERY_VOLUME_INFO_V3) { + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsStatfs: Version 3 not " + "supported. Falling back to version 1.\n")); + atomic_set(&hgfsVersionQueryVolumeInfo, HGFS_OP_QUERY_VOLUME_INFO); + goto retry; + } + break; + default: break; } @@ -377,7 +454,7 @@ LOG(4, (KERN_DEBUG "VMware hgfs: HgfsStatfs: server returned error: " "%d\n", result)); } else { - LOG(4, (KERN_DEBUG "VMware hgfs: HgfsStatfs: unknown error: %d\n", + LOG(4, (KERN_DEBUG "VMware hgfs: HgfsStatfs: unknown error: %d\n", result)); } diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/vm_assert.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/vm_assert.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/vm_assert.h 2008-01-28 08:02:46.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/vm_assert.h 2008-10-13 08:01:42.000000000 +0100 @@ -98,8 +98,6 @@ * ASSERT() is special cased because of interaction with Windows DDK. */ -#define IMPLIES(a,b) (!(a) || (b)) - #if defined VMX86_DEBUG || defined ASSERT_ALWAYS_AVAILABLE #undef ASSERT #define ASSERT(cond) \ @@ -243,12 +241,21 @@ /* - * Compile-time assertions + * 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). */ #define ASSERT_ON_COMPILE(e) \ do { \ - typedef char AssertOnCompileType[(e) ? 1 : -1]; \ + enum { AssertOnCompileMisused = ((e) ? 1 : -1) }; \ + typedef char AssertOnCompileFailed[AssertOnCompileMisused]; \ } while (0) diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/vm_basic_asm.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/vm_basic_asm.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/vm_basic_asm.h 2008-01-28 08:02:46.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/vm_basic_asm.h 2008-10-13 08:01:42.000000000 +0100 @@ -413,12 +413,21 @@ #endif } +#ifdef VM_X86_64 + +/* + * No inline assembly in Win64. Implemented in bora/lib/user 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) { -#ifdef VM_X86_64 - *(int*)0 = 0; // NOT_IMPLEMENTED(); -#else __asm push esi __asm push ebx __asm push ecx @@ -437,8 +446,8 @@ __asm pop ecx __asm pop ebx __asm pop esi -#endif } +#endif static INLINE uint32 __GET_EAX_FROM_CPUID(int input) @@ -713,26 +722,50 @@ /* *----------------------------------------------------------------------------- * - * Bswap -- + * Bswap32 -- * - * Swap the 4 bytes of "v" as follows: 3210 -> 0123. + * Swap the 4 bytes of "v" as follows: 3210 -> 0123. * *----------------------------------------------------------------------------- */ -#ifdef __GNUC__ // { static INLINE uint32 -Bswap(uint32 v) +Bswap32(uint32 v) // IN { - /* Checked against the Intel manual and GCC --hpreg */ +#ifdef __GNUC__ // { + /* Checked against the Intel manual and GCC. --hpreg */ __asm__( - "bswap %0" + "bswap %0" : "=r" (v) : "0" (v) ); return v; -} +#else // } { + return (v >> 24) + | ((v >> 8) & 0xFF00) + | ((v & 0xFF00) << 8) + | (v << 24) ; #endif // } +} +#define Bswap Bswap32 + + +/* + *----------------------------------------------------------------------------- + * + * Bswap64 -- + * + * Swap the 8 bytes of "v" as follows: 76543210 -> 01234567. + * + *----------------------------------------------------------------------------- + */ + +static INLINE uint64 +Bswap64(uint64 v) // IN +{ + return ((uint64)Bswap((uint32)v) << 32) | Bswap((uint32)(v >> 32)); +} + #ifdef __GNUC__ // { /* diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/vm_basic_asm_x86_64.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/vm_basic_asm_x86_64.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/vm_basic_asm_x86_64.h 2008-01-28 08:02:46.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/vm_basic_asm_x86_64.h 2008-10-13 08:01:42.000000000 +0100 @@ -84,16 +84,25 @@ static INLINE void FXSAVE_ES1(uint8 *save) { - asm ("fxsaveq %0 \n" - : "=m" (*save)); + __asm__ __volatile__ ("fxsaveq %0 \n" : "=m" (*save) : : "memory"); +} + +static INLINE void +FXSAVE_COMPAT_ES1(uint8 *save) +{ + __asm__ __volatile__ ("fxsave %0 \n" : "=m" (*save) : : "memory"); } static INLINE void FXRSTOR_ES1(const uint8 *load) { - asm ("fxrstorq %0 \n" - : - : "m" (*load)); + __asm__ __volatile__ ("fxrstorq %0 \n" : : "m" (*load) : "memory"); +} + +static INLINE void +FXRSTOR_COMPAT_ES1(const uint8 *load) +{ + __asm__ __volatile__ ("fxrstor %0 \n" : : "m" (*load) : "memory"); } static INLINE void @@ -101,7 +110,8 @@ { uint64 dummy = 0; - asm ("fnstsw %%ax \n" // Grab x87 ES bit + __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 @@ -112,10 +122,10 @@ "fxrstorq %1 \n" : : "m" (dummy), "m" (*load) - : "ax"); + : "ax", "memory"); } -#endif +#endif /* __GNUC__ */ /* @@ -152,14 +162,14 @@ uint64 result, dummy; const uint64 multiplier64 = multiplier; - asm("mulq %3 \n\t" - "shrdq %1, %0 \n\t" - : "=a" (result), - "=d" (dummy) - : "0" (multiplier64), - "rm" (multiplicand), + __asm__("mulq %3 \n\t" + "shrdq %1, %0 \n\t" + : "=a" (result), + "=d" (dummy) + : "0" (multiplier64), + "rm" (multiplicand), "c" (shift) - : "cc"); + : "cc"); return result; } @@ -211,7 +221,7 @@ int64 result, dummy; const int64 multiplier64 = multiplier; - asm("imulq %3 \n\t" + __asm__("imulq %3 \n\t" "shrdq %1, %0 \n\t" : "=a" (result), "=d" (dummy) @@ -276,7 +286,7 @@ *----------------------------------------------------------------------------- */ -#if defined(__GNUC__) +#if defined(__GNUC__) || defined(_MSC_VER) static INLINE void Div643232(uint64 dividend, // IN @@ -284,8 +294,8 @@ uint32 *quotient, // OUT uint32 *remainder) // OUT { - *quotient = dividend / divisor; - *remainder = dividend % divisor; + *quotient = (uint32)(dividend / divisor); + *remainder = (uint32)(dividend % divisor); } #endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/vm_basic_asm_x86.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/vm_basic_asm_x86.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/vm_basic_asm_x86.h 2008-01-28 08:02:46.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/vm_basic_asm_x86.h 2008-10-13 08:01:42.000000000 +0100 @@ -100,16 +100,13 @@ static INLINE void FXSAVE_ES1(uint8 *save) { - asm ("fxsave %0 \n" - : "=m" (*save)); + __asm__ __volatile__ ("fxsave %0\n" : "=m" (*save) : : "memory"); } static INLINE void FXRSTOR_ES1(const uint8 *load) { - asm ("fxrstor %0 \n" - : - : "m" (*load)); + __asm__ __volatile__ ("fxrstor %0\n" : : "m" (*load) : "memory"); } static INLINE void @@ -117,7 +114,8 @@ { uint64 dummy = 0; - asm ("fnstsw %%ax \n" // Grab x87 ES bit + __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 @@ -128,10 +126,9 @@ "fxrstor %1 \n" : : "m" (dummy), "m" (*load) - : "ax"); + : "ax", "memory"); } - -#endif +#endif /* __GNUC__ */ /* *----------------------------------------------------------------------------- @@ -306,42 +303,42 @@ * smart enough, at least in the version we are currently using. */ if (shift < 32) { - asm("mov %%eax, %2 \n\t" // Save lo(multiplicand) in tmp2 - "mov %%edx, %%eax \n\t" // Get hi(multiplicand) - "mull %4 \n\t" // p2 = hi(multiplicand) * multiplier - "xchg %%eax, %2 \n\t" // Save lo(p2) in tmp2, get lo(multiplicand) - "mov %%edx, %1 \n\t" // Save hi(p2) in tmp1 - "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 - "shrdl %%edx, %%eax \n\t" // result = hi(p2):hi(p1):lo(p1) >> shift - "shrdl %1, %%edx" - : "=A" (result), - "=&r" (tmp1), // use in shrdl requires it to be a register - "=&r" (tmp2) // could be "=&rm" but "m" is slower - : "0" (multiplicand), - "rm" (multiplier), - "c" (shift) - : "cc" - ); + __asm__("mov %%eax, %2 \n\t" // Save lo(multiplicand) in tmp2 + "mov %%edx, %%eax \n\t" // Get hi(multiplicand) + "mull %4 \n\t" // p2 = hi(multiplicand) * multiplier + "xchg %%eax, %2 \n\t" // Save lo(p2) in tmp2, get lo(multiplicand) + "mov %%edx, %1 \n\t" // Save hi(p2) in tmp1 + "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 + "shrdl %%edx, %%eax \n\t" // result = hi(p2):hi(p1):lo(p1) >> shift + "shrdl %1, %%edx" + : "=A" (result), + "=&r" (tmp1), // use in shrdl requires it to be a register + "=&r" (tmp2) // could be "=&rm" but "m" is slower + : "0" (multiplicand), + "rm" (multiplier), + "c" (shift) + : "cc" + ); } else { - asm("mov %%edx, %2 \n\t" // Save hi(multiplicand) in tmp2 - "mull %4 \n\t" // p1 = lo(multiplicand) * multiplier - "mov %%edx, %1 \n\t" // Save hi(p1) in tmp1 - "mov %2, %%eax \n\t" // Discard lo(p1), get hi(multiplicand) - "mull %4 \n\t" // p2 = hi(multiplicand) * multiplier - "addl %1, %%eax \n\t" // lo(p2) += hi(p1) - "adcl $0, %%edx \n\t" // hi(p2) += carry from previous step - "shrdl %%edx, %%eax \n\t" // result = p2 >> (shift & 31) - "shrl %%cl, %%edx" - : "=A" (result), - "=&r" (tmp1), // could be "=&rm" but "m" is slower - "=&r" (tmp2) // could be "=&rm" but "m" is slower - : "0" (multiplicand), - "rm" (multiplier), - "c" (shift) - : "cc" - ); + __asm__("mov %%edx, %2 \n\t" // Save hi(multiplicand) in tmp2 + "mull %4 \n\t" // p1 = lo(multiplicand) * multiplier + "mov %%edx, %1 \n\t" // Save hi(p1) in tmp1 + "mov %2, %%eax \n\t" // Discard lo(p1), get hi(multiplicand) + "mull %4 \n\t" // p2 = hi(multiplicand) * multiplier + "addl %1, %%eax \n\t" // lo(p2) += hi(p1) + "adcl $0, %%edx \n\t" // hi(p2) += carry from previous step + "shrdl %%edx, %%eax \n\t" // result = p2 >> (shift & 31) + "shrl %%cl, %%edx" + : "=A" (result), + "=&r" (tmp1), // could be "=&rm" but "m" is slower + "=&r" (tmp2) // could be "=&rm" but "m" is slower + : "0" (multiplicand), + "rm" (multiplier), + "c" (shift) + : "cc" + ); } return result; } @@ -418,38 +415,38 @@ int64 result; uint32 tmp1, tmp2; // ASSERT(shift >= 0 && shift < 64); - + /* Written and tested by mann, checked by dbudko and hpreg */ /* XXX hpreg suggested some improvements that we haven't converged on yet */ - 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 - "mov %%edx, %%eax\n\t" // result = hi(p2):hi(p1) >> (shift & 31) - "mov %1, %%edx\n\t" - "shrdl %%edx, %%eax\n\t" - "sarl %%cl, %%edx\n\t" - "jmp 3f\n" - "2:\n\t" - "shrdl %%edx, %%eax\n\t" // result = hi(p2):hi(p1):lo(p1) >> shift - "shrdl %1, %%edx\n" - "3:\n\t" - : "=A" (result), "=&r" (tmp1), "=&r" (tmp2) - : "0" (multiplicand), "rm" (multiplier), "c" (shift) - : "cc"); + __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 + "mov %%edx, %%eax\n\t" // result = hi(p2):hi(p1) >> (shift & 31) + "mov %1, %%edx\n\t" + "shrdl %%edx, %%eax\n\t" + "sarl %%cl, %%edx\n\t" + "jmp 3f\n" + "2:\n\t" + "shrdl %%edx, %%eax\n\t" // result = hi(p2):hi(p1):lo(p1) >> shift + "shrdl %1, %%edx\n" + "3:\n\t" + : "=A" (result), "=&r" (tmp1), "=&r" (tmp2) + : "0" (multiplicand), "rm" (multiplier), "c" (shift) + : "cc"); return result; } diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/vm_basic_defs.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/vm_basic_defs.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/vm_basic_defs.h 2008-01-28 08:02:46.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/vm_basic_defs.h 2008-10-13 08:01:42.000000000 +0100 @@ -39,6 +39,10 @@ #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 <stddef.h> /* * We re-define offsetof macro from stddef, make @@ -52,7 +56,8 @@ * Simple macros */ -#if defined __APPLE__ && !defined KERNEL +#if (defined __APPLE__ || defined __FreeBSD__) && \ + (!defined KERNEL && !defined _KERNEL && !defined VMKERNEL && !defined __KERNEL__) # include <stddef.h> #else // XXX the __cplusplus one matches that of VC++, to prevent redefinition warning @@ -108,6 +113,7 @@ #define DWORD_ALIGN(x) ((((x)+3) >> 2) << 2) #define QWORD_ALIGN(x) ((((x)+4) >> 3) << 3) +#define IMPLIES(a,b) (!(a) || (b)) /* * Not everybody (e.g., the monitor) has NULL @@ -313,7 +319,22 @@ #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 // { @@ -324,7 +345,7 @@ * guarantee. Bummer. --Jeremy. */ -#if defined(N_PLAT_NLM) || defined(__FreeBSD__) +#if defined(N_PLAT_NLM) /* We do not have YIELD() as we do not need it yet... */ #elif defined(_WIN32) # define YIELD() Sleep(0) @@ -450,12 +471,23 @@ */ #undef DEBUG_ONLY +#undef SL_DEBUG_ONLY +#undef VMX86_SL_DEBUG #ifdef VMX86_DEBUG -#define vmx86_debug 1 -#define DEBUG_ONLY(x) x +#define vmx86_debug 1 +#define DEBUG_ONLY(x) x +/* + * Be very, very, very careful with SL_DEBUG. Pls ask ganesh or min before + * using it. + */ +#define VMX86_SL_DEBUG +#define vmx86_sl_debug 1 +#define SL_DEBUG_ONLY(x) x #else -#define vmx86_debug 0 +#define vmx86_debug 0 #define DEBUG_ONLY(x) +#define vmx86_sl_debug 0 +#define SL_DEBUG_ONLY(x) #endif #ifdef VMX86_STATS @@ -543,18 +575,32 @@ #endif #endif -#ifdef VMX86_VPROBES -#define vmx86_vprobes 1 -#define VPROBES_ONLY(x) x +#ifdef _WIN32 +#define VMW_INVALID_HANDLE INVALID_HANDLE_VALUE +#else +#define VMW_INVALID_HANDLE (-1) +#endif + +#ifdef _WIN32 +#define fsync(fd) _commit(fd) +#define fileno(f) _fileno(f) #else -#define vmx86_vprobes 0 -#define VPROBES_ONLY(x) #endif +/* + * Debug output macros for Windows drivers (the Eng variant is for + * display/printer drivers only. + */ #ifdef _WIN32 -#define VMW_INVALID_HANDLE INVALID_HANDLE_VALUE +#ifndef USES_OLD_WINDDK +#if defined(VMX86_DEBUG) || defined(ASSERT_ALWAYS_AVAILABLE) +#define WinDrvPrint(arg, ...) DbgPrint(arg, __VA_ARGS__) +#define WinDrvEngPrint(arg, ...) EngDbgPrint(arg, __VA_ARGS__) #else -#define VMW_INVALID_HANDLE -1 +#define WinDrvPrint(arg, ...) +#define WinDrvEngPrint(arg, ...) #endif +#endif +#endif // _WIN32 #endif // ifndef _VM_BASIC_DEFS_H_ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/vm_basic_types.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/vm_basic_types.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/vm_basic_types.h 2008-01-28 08:02:46.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/vm_basic_types.h 2008-10-13 08:01:42.000000000 +0100 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998-2007 VMware, Inc. All rights reserved. + * Copyright (C) 1998-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 General Public License as published by the @@ -92,10 +92,6 @@ #pragma warning (disable :4305) // truncation from 'const int' to 'short' #pragma warning (disable :4244) // conversion from 'unsigned short' to 'unsigned char' #pragma warning (disable :4267) // truncation of 'size_t' -#if !defined VMX86_DEVEL // XXX until we clean up all the code -- edward -#pragma warning (disable :4133) // incompatible types - from 'struct VM *' to 'int *' -#pragma warning (disable :4047) // differs in levels of indirection -#endif #pragma warning (disable :4146) // unary minus operator applied to unsigned type, result still unsigned #pragma warning (disable :4142) // benign redefinition of type @@ -154,12 +150,16 @@ #include <stdlib.h> #endif +#ifdef __FreeBSD__ +#include <sys/param.h> /* For __FreeBSD_version */ +#endif + #if !defined(USING_AUTOCONF) # if defined(__FreeBSD__) || defined(sun) # ifdef KLD_MODULE # include <sys/types.h> # else -# if (BSD_VERSION >= 50) +# if !defined(VMKERNEL) && (__FreeBSD_version >= 500043) # include <inttypes.h> # include <sys/types.h> # else @@ -254,7 +254,12 @@ || (defined(_POSIX2_VERSION) && _POSIX2_VERSION >= 200112L) /* BSD/Darwin, Linux */ #define FMTSZ "z" - #define FMTPD "t" + + #if defined(VM_X86_64) || defined(__APPLE__) + #define FMTPD "l" + #else + #define FMTPD "" + #endif #else /* Systems with a pre-C99 libc */ #define FMTSZ "Z" @@ -338,8 +343,8 @@ * Type big enough to hold an integer between 0..100 */ typedef uint8 Percent; -#define asPercent(v) ((Percent)(v)) -#define CHOOSE_PERCENT asPercent(-1) +#define AsPercent(v) ((Percent)(v)) +#define CHOOSE_PERCENT AsPercent(101) typedef uintptr_t VA; @@ -371,6 +376,9 @@ typedef User_CartelID User_CartelGroupID; #define INVALID_CARTELGROUP_ID INVALID_CARTEL_ID +typedef uint32 Worldlet_ID; +#define INVALID_WORLDLET_ID ((Worldlet_ID)0) + /* world page number */ typedef uint32 WPN; @@ -381,6 +389,12 @@ #endif /* + * This type should be used for variables that contain sector + * position/quantity. + */ +typedef uint64 SectorType; + +/* * Linear address */ @@ -434,6 +448,7 @@ typedef VA32 UserVA32; typedef VA64 UserVA64; typedef UserVA32 UserVAConst; /* Userspace ptr to data that we may only read. */ +typedef UserVA64 UserVA64Const; /* Used by 64-bit syscalls until conversion is finished. */ #ifdef VMKERNEL typedef UserVA32 UserVA; #else @@ -447,10 +462,10 @@ * for any region other than buserror. */ #define PHYSMEM_MAX_PPN ((PPN)0xffffffff) -#define MAX_PPN ((PPN)0x0fffffff) /* Maximal observable PPN value. */ -#define INVALID_PPN ((PPN)-1) +#define MAX_PPN ((PPN)0x1fffffff) /* Maximal observable PPN value. */ +#define INVALID_PPN ((PPN)0xffffffff) -#define INVALID_BPN ((BPN) 0x3fffffff) /* BPNs don't use the high two bits. */ +#define INVALID_BPN ((BPN) 0x1fffffff) #define INVALID_MPN ((MPN)-1) #define MEMREF_MPN ((MPN)-2) @@ -480,8 +495,9 @@ # define FMTVPN "" #endif - +#ifndef EXTERN #define EXTERN extern +#endif #define CONST const @@ -631,6 +647,12 @@ # define PRINTF_DECL(fmtPos, varPos) #endif +#if defined(__GNUC__) +# define SCANF_DECL(fmtPos, varPos) __attribute__((__format__(__scanf__, fmtPos, varPos))) +#else +# define SCANF_DECL(fmtPos, varPos) +#endif + /* * UNUSED_PARAM should surround the parameter name and type declaration, * e.g. "int MyFunction(int var1, UNUSED_PARAM(int var2))" @@ -677,6 +699,52 @@ #endif /* + *********************************************************************** + * STRUCT_OFFSET_CHECK -- */ /** + * + * \brief Check if the actual offsef of a member in a structure + * is what is expected + * + * + * \param[in] STRUCT Structure the member is a part of. + * \param[in] MEMBER Member to check the offset of. + * \param[in] OFFSET Expected offset of MEMBER in STRUCTURE. + * \param[in] DEBUG_EXTRA Additional bytes to be added to OFFSET to + * compensate for extra info in debug builds. + * + *********************************************************************** + */ +#ifdef VMX86_DEBUG +#define STRUCT_OFFSET_CHECK(STRUCT, MEMBER, OFFSET, DEBUG_EXTRA) \ + ASSERT_ON_COMPILE(vmk_offsetof(STRUCT, MEMBER) == (OFFSET + DEBUG_EXTRA)) +#else +#define STRUCT_OFFSET_CHECK(STRUCT, MEMBER, OFFSET, DEBUG_EXTRA) \ + ASSERT_ON_COMPILE(vmk_offsetof(STRUCT, MEMBER) == OFFSET) +#endif + +/* + *********************************************************************** + * STRUCT_SIZE_CHECK -- */ /** + * + * \brief Check if the actual size of a structure is what is expected + * + * + * \param[in] STRUCT Structure whose size is to be checked. + * \param[in] SIZE Expected size of STRUCT. + * \param[in] DEBUG_EXTRA Additional bytes to be added to SIZE to + * compensate for extra info in debug builds. + * + *********************************************************************** + */ +#ifdef VMX86_DEBUG +#define STRUCT_SIZE_CHECK(STRUCT, SIZE, DEBUG_EXTRA) \ + ASSERT_ON_COMPILE(sizeof(STRUCT) == (SIZE + DEBUG_EXTRA)) +#else +#define STRUCT_SIZE_CHECK(STRUCT, SIZE, DEBUG_EXTRA) \ + ASSERT_ON_COMPILE(sizeof(STRUCT) == SIZE) +#endif + +/* * __func__ is a stringified function name that is part of the C99 standard. The block * below defines __func__ on older systems where the compiler does not support that * macro. @@ -831,4 +899,14 @@ typedef int PollDevHandle; #endif +/* + * Define the utf16_t type. + */ + +#if defined(_WIN32) && defined(_NATIVE_WCHAR_T_DEFINED) +typedef wchar_t utf16_t; +#else +typedef uint16 utf16_t; +#endif + #endif /* _VM_BASIC_TYPES_H_ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/vmhgfs_version.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/vmhgfs_version.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/vmhgfs_version.h 2008-01-28 08:02:46.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/vmhgfs_version.h 2008-10-13 08:01:43.000000000 +0100 @@ -25,8 +25,8 @@ #ifndef _VMHGFS_VERSION_H_ #define _VMHGFS_VERSION_H_ -#define VMHGFS_DRIVER_VERSION 1.1.1.1 -#define VMHGFS_DRIVER_VERSION_COMMAS 1,1,1,1 -#define VMHGFS_DRIVER_VERSION_STRING "1.1.1.1" +#define VMHGFS_DRIVER_VERSION 1.4.1.1 +#define VMHGFS_DRIVER_VERSION_COMMAS 1,4,1,1 +#define VMHGFS_DRIVER_VERSION_STRING "1.4.1.1" #endif /* _VMHGFS_VERSION_H_ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/x86cpuid.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/x86cpuid.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmhgfs/x86cpuid.h 2008-01-28 08:02:46.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmhgfs/x86cpuid.h 2008-10-13 08:01:42.000000000 +0100 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998 VMware, Inc. All rights reserved. + * Copyright (C) 1998-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 General Public License as published by the @@ -54,17 +54,36 @@ } CPUIDRegsUnion; /* - * Results of calling cpuid(eaxArg) on all logical processors. + * Results of calling cpuid(eax, ecx) on all host logical CPU. */ #ifdef _MSC_VER #pragma warning (disable :4200) // non-std extension: zero-sized array in struct #endif -typedef struct CPUIDResult { - uint32 numLogicalCPUs; - uint32 eaxArg; - CPUIDRegs regs[0]; -} CPUIDResult; +typedef +#include "vmware_pack_begin.h" +struct CPUIDReply { + /* + * Unique host logical CPU identifier. It does not change across queries, so + * we use it to correlate the replies of multiple queries. + */ + uint64 tag; // OUT + + CPUIDRegs regs; // OUT +} +#include "vmware_pack_end.h" +CPUIDReply; + +typedef +#include "vmware_pack_begin.h" +struct CPUIDQuery { + uint32 eax; // IN + uint32 ecx; // IN + uint32 numLogicalCPUs; // IN/OUT + CPUIDReply logicalCPUs[0]; // OUT +} +#include "vmware_pack_end.h" +CPUIDQuery; /* * CPUID levels the monitor caches and ones that are not cached, but @@ -83,6 +102,8 @@ #define CPUID_CACHED_LEVELS \ CPUIDLEVEL(TRUE, 0, 0) \ CPUIDLEVEL(TRUE, 1, 1) \ + CPUIDLEVEL(FALSE,400, 0x40000000) \ + CPUIDLEVEL(FALSE,410, 0x40000010) \ CPUIDLEVEL(FALSE, 80, 0x80000000) \ CPUIDLEVEL(TRUE, 81, 0x80000001) \ CPUIDLEVEL(FALSE, 88, 0x80000008) \ @@ -90,6 +111,8 @@ #define CPUID_UNCACHED_LEVELS \ CPUIDLEVEL(FALSE, 4, 4) \ + CPUIDLEVEL(FALSE, 5, 5) \ + CPUIDLEVEL(FALSE, 6, 6) \ CPUIDLEVEL(FALSE, A, 0xA) \ CPUIDLEVEL(FALSE, 86, 0x80000006) \ CPUIDLEVEL(FALSE, 87, 0x80000007) \ @@ -128,21 +151,23 @@ */ typedef enum { + CPUID_VENDOR_UNKNOWN, CPUID_VENDOR_COMMON, CPUID_VENDOR_INTEL, CPUID_VENDOR_AMD, CPUID_VENDOR_CYRIX, - CPUID_VENDOR_UNKNOWN, CPUID_NUM_VENDORS } CpuidVendors; #define CPUID_INTEL_VENDOR_STRING "GenuntelineI" #define CPUID_AMD_VENDOR_STRING "AuthcAMDenti" #define CPUID_CYRIX_VENDOR_STRING "CyriteadxIns" +#define CPUID_HYPERV_HYPERVISOR_VENDOR_STRING "Microsoft Hv" #define CPUID_INTEL_VENDOR_STRING_FIXED "GenuineIntel" #define CPUID_AMD_VENDOR_STRING_FIXED "AuthenticAMD" #define CPUID_CYRIX_VENDOR_STRING_FIXED "CyrixInstead" +#define CPUID_HYPERV_HYPERVISOR_VENDOR_STRING "Microsoft Hv" /* * FIELDDEF can be defined to process the CPUID information provided @@ -207,179 +232,233 @@ CPUID_NUM_FIELD_MASKS } CpuidFieldMasks; -/* LEVEL, REG, VENDOR, POS, SIZE, NAME, MASK TYPE, SET TO, [FUNC] */ + +typedef enum { + CPUID_FIELD_SUPPORTED_NO, + CPUID_FIELD_SUPPORTED_YES, + CPUID_FIELD_SUPPORTED_ANY, + CPUID_FIELD_SUPPORTED_NA, + CPUID_NUM_FIELD_SUPPORTEDS +} CpuidFieldSupported; + + +/* LEVEL, REG, VENDOR, POS, SIZE, NAME, MON SUPP, MASK TYPE, SET TO, CPL3, [FUNC] */ #define CPUID_FIELD_DATA_LEVEL_0 \ -FIELDDEF( 0, EAX, COMMON, 0, 32, NUMLEVELS, IGNORE, 0) \ -FIELDDEF( 0, EBX, COMMON, 0, 32, VENDOR1, HOST, 0) \ -FIELDDEF( 0, ECX, COMMON, 0, 32, VENDOR3, HOST, 0) \ -FIELDDEF( 0, EDX, COMMON, 0, 32, VENDOR2, HOST, 0) +FIELDDEF( 0, EAX, COMMON, 0, 32, NUMLEVELS, ANY, IGNORE, 0, FALSE) \ +FIELDDEF( 0, EBX, COMMON, 0, 32, VENDOR1, YES, HOST, 0, TRUE) \ +FIELDDEF( 0, ECX, COMMON, 0, 32, VENDOR3, YES, HOST, 0, TRUE) \ +FIELDDEF( 0, EDX, COMMON, 0, 32, VENDOR2, YES, HOST, 0, TRUE) -/* LEVEL, REG, VENDOR, POS, SIZE, NAME, MASK TYPE, SET TO, [FUNC] */ +/* LEVEL, REG, VENDOR, POS, SIZE, NAME, MON SUPP, MASK TYPE, SET TO, CPL3, [FUNC] */ #define CPUID_FIELD_DATA_LEVEL_1 \ -FIELDDEFA( 1, EAX, COMMON, 0, 4, STEPPING, IGNORE, 0, STEPPING) \ -FIELDDEFA( 1, EAX, COMMON, 4, 4, MODEL, IGNORE, 0, MODEL) \ -FIELDDEFA( 1, EAX, COMMON, 8, 4, FAMILY, HOST, 0, FAMILY) \ -FIELDDEF( 1, EAX, COMMON, 12, 2, TYPE, IGNORE, 0) \ -FIELDDEFA( 1, EAX, COMMON, 16, 4, EXTMODEL, IGNORE, 0, EXT_MODEL) \ -FIELDDEFA( 1, EAX, COMMON, 20, 8, EXTFAMILY, HOST, 0, EXT_FAMILY) \ -FIELDDEF( 1, EBX, COMMON, 0, 8, BRAND_ID, IGNORE, 0) \ -FIELDDEF( 1, EBX, COMMON, 8, 8, CLFL_SIZE, IGNORE, 0) \ -FIELDDEFA( 1, EBX, COMMON, 16, 8, LCPU_COUNT, IGNORE, 0, LCPU_COUNT) \ -FIELDDEFA( 1, EBX, COMMON, 24, 8, APICID, IGNORE, 0, APICID) \ -FLAGDEFA( 1, ECX, COMMON, 0, 1, SSE3, HOST, 0, SSE3) \ -FLAGDEFA( 1, ECX, INTEL, 3, 1, MWAIT, MASK, 0, MWAIT) \ -FLAGDEF( 1, ECX, INTEL, 4, 1, DSCPL, HOST, 0) \ -FLAGDEFA( 1, ECX, INTEL, 5, 1, VMX, MASK, 0, VMX) \ -FLAGDEF( 1, ECX, INTEL, 6, 1, SMX, MASK, 0) \ -FLAGDEF( 1, ECX, INTEL, 7, 1, EST, MASK, 0) \ -FLAGDEF( 1, ECX, INTEL, 8, 1, TM2, MASK, 0) \ -FLAGDEFA( 1, ECX, COMMON, 9, 1, SSSE3, HOST, 0, SSSE3) \ -FLAGDEF( 1, ECX, INTEL, 10, 1, HTCACHE, MASK, 0) \ -FLAGDEFA( 1, ECX, COMMON, 13, 1, CMPX16, HOST, 0, CMPX16) \ -FLAGDEF( 1, ECX, INTEL, 14, 1, xPPR, MASK, 0) \ -FLAGDEF( 1, ECX, INTEL, 15, 1, PERF_MSR, MASK, 0) \ -FLAGDEF( 1, ECX, INTEL, 16, 1, NDA16, MASK, 0) \ -FLAGDEF( 1, ECX, INTEL, 18, 1, DCA, MASK, 0) \ -FLAGDEFA( 1, ECX, INTEL, 19, 1, SSE41, HOST, 0, SSE41) \ -FLAGDEFA( 1, ECX, INTEL, 20, 1, SSE42, HOST, 0, SSE42) \ -FLAGDEFA( 1, ECX, COMMON, 23, 1, POPCNT, HOST, 0, POPCNT) \ -FLAGDEFA( 1, EDX, COMMON, 0, 1, FPU, HOST, 0, FPU) \ -FLAGDEFA( 1, EDX, COMMON, 1, 1, VME, HOST, 0, VME) \ -FLAGDEF( 1, EDX, COMMON, 2, 1, DBGE, HOST, 0) \ -FLAGDEF( 1, EDX, COMMON, 3, 1, PGSZE, HOST, 0) \ -FLAGDEFA( 1, EDX, COMMON, 4, 1, TSC, HOST, 0, TSC) \ -FLAGDEF( 1, EDX, COMMON, 5, 1, MSR, HOST, 0) \ -FLAGDEFA( 1, EDX, COMMON, 6, 1, PAE, HOST, 0, PAE) \ -FLAGDEF( 1, EDX, COMMON, 7, 1, MCK, HOST, 0) \ -FLAGDEF( 1, EDX, COMMON, 8, 1, CPMX, HOST, 0) \ -FLAGDEFA( 1, EDX, COMMON, 9, 1, APIC, MASK, 1, APIC) \ -FLAGDEFA( 1, EDX, COMMON, 11, 1, SEP, HOST, 0, SEP) \ -FLAGDEFA( 1, EDX, COMMON, 12, 1, MTRR, HOST, 0, MTRR) \ -FLAGDEFA( 1, EDX, COMMON, 13, 1, PGE, HOST, 0, PGE) \ -FLAGDEFA( 1, EDX, COMMON, 14, 1, MCA, HOST, 0, MCA) \ -FLAGDEFA( 1, EDX, COMMON, 15, 1, CMOV, HOST, 0, CMOV) \ -FLAGDEFA( 1, EDX, COMMON, 16, 1, PAT, HOST, 0, PAT) \ -FLAGDEF( 1, EDX, COMMON, 17, 1, 36PG, HOST, 0) \ -FLAGDEF( 1, EDX, INTEL, 18, 1, PSN, HOST, 0) \ -FLAGDEFA( 1, EDX, COMMON, 19, 1, CLFL, HOST, 0, CLFL) \ -FLAGDEF( 1, EDX, INTEL, 21, 1, DTES, HOST, 0) \ -FLAGDEF( 1, EDX, INTEL, 22, 1, ACPI, HOST, 0) \ -FLAGDEFA( 1, EDX, COMMON, 23, 1, MMX, HOST, 0, MMX) \ -FLAGDEFA( 1, EDX, COMMON, 24, 1, FXSAVE, HOST, 0, FXSAVE) \ -FLAGDEFA( 1, EDX, COMMON, 25, 1, SSE, HOST, 0, SSE) \ -FLAGDEFA( 1, EDX, COMMON, 26, 1, SSE2, HOST, 0, SSE2) \ -FLAGDEF( 1, EDX, INTEL, 27, 1, SS, HOST, 0) \ -FLAGDEFA( 1, EDX, COMMON, 28, 1, HT, MASK, 0, HT) \ -FLAGDEF( 1, EDX, INTEL, 29, 1, TM, MASK, 0) \ -FLAGDEF( 1, EDX, INTEL, 30, 1, IA64, MASK, 0) \ -FLAGDEF( 1, EDX, INTEL, 31, 1, PBE, MASK, 0) +FIELDDEFA( 1, EAX, COMMON, 0, 4, STEPPING, ANY, IGNORE, 0, FALSE, STEPPING) \ +FIELDDEFA( 1, EAX, COMMON, 4, 4, MODEL, ANY, IGNORE, 0, FALSE, MODEL) \ +FIELDDEFA( 1, EAX, COMMON, 8, 4, FAMILY, YES, HOST, 0, FALSE, FAMILY) \ +FIELDDEF( 1, EAX, COMMON, 12, 2, TYPE, ANY, IGNORE, 0, FALSE) \ +FIELDDEFA( 1, EAX, COMMON, 16, 4, EXTMODEL, ANY, IGNORE, 0, FALSE, EXT_MODEL) \ +FIELDDEFA( 1, EAX, COMMON, 20, 8, EXTFAMILY, YES, HOST, 0, FALSE, EXT_FAMILY) \ +FIELDDEF( 1, EBX, COMMON, 0, 8, BRAND_ID, ANY, IGNORE, 0, FALSE) \ +FIELDDEF( 1, EBX, COMMON, 8, 8, CLFL_SIZE, ANY, IGNORE, 0, FALSE) \ +FIELDDEFA( 1, EBX, COMMON, 16, 8, LCPU_COUNT, ANY, IGNORE, 0, FALSE, LCPU_COUNT) \ +FIELDDEFA( 1, EBX, COMMON, 24, 8, APICID, ANY, IGNORE, 0, FALSE, APICID) \ +FLAGDEFA( 1, ECX, COMMON, 0, 1, SSE3, YES, HOST, 0, TRUE, SSE3) \ +FLAGDEF( 1, ECX, INTEL, 2, 1, NDA2, NO, MASK, 0, FALSE) \ +FLAGDEFA( 1, ECX, COMMON, 3, 1, MWAIT, NO, MASK, 0, FALSE, MWAIT) \ +FLAGDEFA( 1, ECX, INTEL, 4, 1, DSCPL, NO, MASK, 0, FALSE, DSCPL) \ +FLAGDEFA( 1, ECX, INTEL, 5, 1, VMX, NO, MASK, 0, FALSE, VMX) \ +FLAGDEF( 1, ECX, INTEL, 6, 1, SMX, NO, MASK, 0, FALSE) \ +FLAGDEF( 1, ECX, INTEL, 7, 1, EST, NO, MASK, 0, FALSE) \ +FLAGDEF( 1, ECX, INTEL, 8, 1, TM2, NO, MASK, 0, FALSE) \ +FLAGDEFA( 1, ECX, COMMON, 9, 1, SSSE3, YES, HOST, 0, TRUE, SSSE3) \ +FLAGDEF( 1, ECX, INTEL, 10, 1, HTCACHE, NO, MASK, 0, FALSE) \ +FLAGDEFA( 1, ECX, COMMON, 13, 1, CMPX16, YES, HOST, 0, TRUE, CMPX16) \ +FLAGDEF( 1, ECX, INTEL, 14, 1, xPPR, NO, MASK, 0, FALSE) \ +FLAGDEF( 1, ECX, INTEL, 15, 1, PERF_MSR, NO, MASK, 0, FALSE) \ +FLAGDEF( 1, ECX, INTEL, 18, 1, DCA, NO, MASK, 0, FALSE) \ +FLAGDEFA( 1, ECX, INTEL, 19, 1, SSE41, YES, HOST, 0, TRUE, SSE41) \ +FLAGDEFA( 1, ECX, INTEL, 20, 1, SSE42, YES, HOST, 0, TRUE, SSE42) \ +FLAGDEF( 1, ECX, INTEL, 21, 1, X2APIC, NO, MASK, 0, FALSE) \ +FLAGDEF( 1, ECX, INTEL, 22, 1, MOVBE, NO, RSVD, 0, TRUE) \ +FLAGDEFA( 1, ECX, COMMON, 23, 1, POPCNT, YES, HOST, 0, TRUE, POPCNT) \ +FLAGDEF( 1, ECX, INTEL, 24, 1, ULE, NO, RSVD, 0, TRUE) \ +FLAGDEF( 1, ECX, INTEL, 26, 1, XSAVE, NO, MASK, 0, FALSE) \ +FLAGDEF( 1, ECX, INTEL, 27, 1, OSXSAVE, NO, RSVD, 0, TRUE) \ +FLAGDEFA( 1, ECX, COMMON, 31, 1, HYPERVISOR, ANY, IGNORE, 0, FALSE, HYPERVISOR)\ +FLAGDEFA( 1, EDX, COMMON, 0, 1, FPU, YES, HOST, 0, TRUE, FPU) \ +FLAGDEFA( 1, EDX, COMMON, 1, 1, VME, YES, HOST, 0, FALSE, VME) \ +FLAGDEF( 1, EDX, COMMON, 2, 1, DBGE, YES, HOST, 0, FALSE) \ +FLAGDEF( 1, EDX, COMMON, 3, 1, PGSZE, YES, HOST, 0, FALSE) \ +FLAGDEFA( 1, EDX, COMMON, 4, 1, TSC, YES, HOST, 0, TRUE, TSC) \ +FLAGDEF( 1, EDX, COMMON, 5, 1, MSR, YES, HOST, 0, FALSE) \ +FLAGDEFA( 1, EDX, COMMON, 6, 1, PAE, YES, HOST, 0, FALSE, PAE) \ +FLAGDEF( 1, EDX, COMMON, 7, 1, MCK, YES, HOST, 0, FALSE) \ +FLAGDEF( 1, EDX, COMMON, 8, 1, CPMX, YES, HOST, 0, TRUE) \ +FLAGDEFA( 1, EDX, COMMON, 9, 1, APIC, ANY, MASK, 1, FALSE, APIC) \ +FLAGDEFA( 1, EDX, COMMON, 11, 1, SEP, YES, HOST, 0, TRUE, SEP) \ +FLAGDEFA( 1, EDX, COMMON, 12, 1, MTRR, YES, HOST, 0, FALSE, MTRR) \ +FLAGDEFA( 1, EDX, COMMON, 13, 1, PGE, YES, HOST, 0, FALSE, PGE) \ +FLAGDEFA( 1, EDX, COMMON, 14, 1, MCA, YES, HOST, 0, FALSE, MCA) \ +FLAGDEFA( 1, EDX, COMMON, 15, 1, CMOV, YES, HOST, 0, TRUE, CMOV) \ +FLAGDEFA( 1, EDX, COMMON, 16, 1, PAT, YES, HOST, 0, FALSE, PAT) \ +FLAGDEF( 1, EDX, COMMON, 17, 1, 36PG, YES, HOST, 0, FALSE) \ +FLAGDEF( 1, EDX, INTEL, 18, 1, PSN, YES, HOST, 0, FALSE) \ +FLAGDEFA( 1, EDX, COMMON, 19, 1, CLFL, YES, HOST, 0, TRUE, CLFL) \ +FLAGDEF( 1, EDX, INTEL, 21, 1, DTES, YES, HOST, 0, FALSE) \ +FLAGDEF( 1, EDX, INTEL, 22, 1, ACPI, YES, HOST, 0, FALSE) \ +FLAGDEFA( 1, EDX, COMMON, 23, 1, MMX, YES, HOST, 0, TRUE, MMX) \ +FLAGDEFA( 1, EDX, COMMON, 24, 1, FXSAVE, YES, HOST, 0, TRUE, FXSAVE) \ +FLAGDEFA( 1, EDX, COMMON, 25, 1, SSE, YES, HOST, 0, TRUE, SSE) \ +FLAGDEFA( 1, EDX, COMMON, 26, 1, SSE2, YES, HOST, 0, TRUE, SSE2) \ +FLAGDEF( 1, EDX, INTEL, 27, 1, SS, YES, HOST, 0, FALSE) \ +FLAGDEFA( 1, EDX, COMMON, 28, 1, HT, NO, MASK, 0, FALSE, HT) \ +FLAGDEF( 1, EDX, INTEL, 29, 1, TM, NO, MASK, 0, FALSE) \ +FLAGDEF( 1, EDX, INTEL, 30, 1, IA64, NO, MASK, 0, FALSE) \ +FLAGDEF( 1, EDX, INTEL, 31, 1, PBE, NO, MASK, 0, FALSE) -/* LEVEL, REG, VENDOR, POS, SIZE, NAME, MASK TYPE, SET TO, [FUNC] */ +/* LEVEL, REG, VENDOR, POS, SIZE, NAME, MON SUPP, MASK TYPE, SET TO, CPL3, [FUNC] */ #define CPUID_FIELD_DATA_LEVEL_4 \ -FIELDDEF( 4, EAX, INTEL, 0, 5, CACHE_TYPE, IGNORE, 0) \ -FIELDDEF( 4, EAX, INTEL, 5, 3, CACHE_LEVEL, IGNORE, 0) \ -FIELDDEF( 4, EAX, INTEL, 14, 12, CACHE_NUMHT_SHARING, IGNORE, 0) \ -FIELDDEFA( 4, EAX, INTEL, 26, 6, CORE_COUNT, IGNORE, 0, INTEL_CORE_COUNT) \ -FIELDDEF( 4, EBX, INTEL, 0, 12, CACHE_LINE, IGNORE, 0) \ -FIELDDEF( 4, EBX, INTEL, 12, 10, CACHE_PART, IGNORE, 0) \ -FIELDDEF( 4, EBX, INTEL, 22, 10, CACHE_WAYS, IGNORE, 0) +FIELDDEF( 4, EAX, INTEL, 0, 5, CACHE_TYPE, NA, IGNORE, 0, FALSE) \ +FIELDDEF( 4, EAX, INTEL, 5, 3, CACHE_LEVEL, NA, IGNORE, 0, FALSE) \ +FIELDDEF( 4, EAX, INTEL, 14, 12, CACHE_NUMHT_SHARING, NA, IGNORE, 0, FALSE) \ +FIELDDEFA( 4, EAX, INTEL, 26, 6, CORE_COUNT, NA, IGNORE, 0, FALSE, INTEL_CORE_COUNT) \ +FIELDDEF( 4, EBX, INTEL, 0, 12, CACHE_LINE, NA, IGNORE, 0, FALSE) \ +FIELDDEF( 4, EBX, INTEL, 12, 10, CACHE_PART, NA, IGNORE, 0, FALSE) \ +FIELDDEF( 4, EBX, INTEL, 22, 10, CACHE_WAYS, NA, IGNORE, 0, FALSE) + +/* LEVEL, REG, VENDOR, POS, SIZE, NAME, MON SUPP, MASK TYPE, SET TO, CPL3, [FUNC] */ +#define CPUID_FIELD_DATA_LEVEL_5 \ +FIELDDEF( 5, EAX, COMMON, 0, 16, MWAIT_MIN_SIZE, NA, IGNORE, 0, FALSE) \ +FIELDDEF( 5, EBX, COMMON, 0, 16, MWAIT_MAX_SIZE, NA, IGNORE, 0, FALSE) \ +FLAGDEF( 5, ECX, COMMON, 0, 1, MWAIT_EXTENSIONS, NA, IGNORE, 0, FALSE) \ +FLAGDEF( 5, ECX, COMMON, 1, 1, MWAIT_INTR_BREAK, NA, IGNORE, 0, FALSE) \ +FIELDDEF( 5, EDX, INTEL, 0, 4, MWAIT_C0_SUBSTATE, NA, IGNORE, 0, FALSE) \ +FIELDDEF( 5, EDX, INTEL, 4, 4, MWAIT_C1_SUBSTATE, NA, IGNORE, 0, FALSE) \ +FIELDDEF( 5, EDX, INTEL, 8, 4, MWAIT_C2_SUBSTATE, NA, IGNORE, 0, FALSE) \ +FIELDDEF( 5, EDX, INTEL, 12, 4, MWAIT_C3_SUBSTATE, NA, IGNORE, 0, FALSE) \ +FIELDDEF( 5, EDX, INTEL, 16, 4, MWAIT_C4_SUBSTATE, NA, IGNORE, 0, FALSE) + +/* LEVEL, REG, VENDOR, POS, SIZE, NAME, MON SUPP, MASK TYPE, SET TO, CPL3, [FUNC] */ +#define CPUID_FIELD_DATA_LEVEL_6 \ +FLAGDEF( 6, EAX, INTEL, 0, 1, THERMAL_SENSOR, NA, IGNORE, 0, FALSE) \ +FLAGDEF( 6, EAX, INTEL, 1, 1, TURBO_MODE, NA, IGNORE, 0, FALSE) \ +FIELDDEF( 6, EBX, INTEL, 0, 4, NUM_INTR_THRESHOLDS, NA, IGNORE, 0, FALSE) \ +FLAGDEF( 6, ECX, INTEL, 0, 1, HW_COORD_FEEDBACK, NA, IGNORE, 0, FALSE) -/* LEVEL, REG, VENDOR, POS, SIZE, NAME, MASK TYPE, SET TO, [FUNC] */ +/* LEVEL, REG, VENDOR, POS, SIZE, NAME, MON SUPP, MASK TYPE, SET TO, CPL3, [FUNC] */ #define CPUID_FIELD_DATA_LEVEL_A \ -FIELDDEF( A, EAX, INTEL, 0, 8, PMC_VERSION, IGNORE, 0) \ -FIELDDEFA( A, EAX, INTEL, 8, 8, NUM_PMCS, IGNORE, 0, NUM_PMCS) \ -FIELDDEF( A, EAX, INTEL, 16, 8, PMC_BIT_WIDTH, IGNORE, 0) \ -FIELDDEF( A, EAX, INTEL, 24, 8, PMC_EBX_LENGTH, IGNORE, 0) \ -FLAGDEF( A, EBX, INTEL, 0, 1, PMC_CORE_CYCLE, IGNORE, 0) \ -FLAGDEF( A, EBX, INTEL, 1, 1, PMC_INSTR_RETIRED, IGNORE, 0) \ -FLAGDEF( A, EBX, INTEL, 2, 1, PMC_REF_CYCLES, IGNORE, 0) \ -FLAGDEF( A, EBX, INTEL, 3, 1, PMC_LAST_LVL_CREF, IGNORE, 0) \ -FLAGDEF( A, EBX, INTEL, 4, 1, PMC_LAST_LVL_CMISS, IGNORE, 0) \ -FLAGDEF( A, EBX, INTEL, 5, 1, PMC_BR_INST_RETIRED, IGNORE, 0) \ -FLAGDEF( A, EBX, INTEL, 6, 1, PMC_BR_MISS_RETIRED, IGNORE, 0) +FIELDDEFA( A, EAX, INTEL, 0, 8, PMC_VERSION, NA, IGNORE, 0, FALSE, PMC_VERSION) \ +FIELDDEFA( A, EAX, INTEL, 8, 8, NUM_PMCS, NA, IGNORE, 0, FALSE, NUM_PMCS) \ +FIELDDEF( A, EAX, INTEL, 16, 8, PMC_BIT_WIDTH, NA, IGNORE, 0, FALSE) \ +FIELDDEFA( A, EAX, INTEL, 24, 8, PMC_EBX_LENGTH, NA, IGNORE, 0, FALSE, PMC_EBX_LENGTH) \ +FLAGDEF( A, EBX, INTEL, 0, 1, PMC_CORE_CYCLE, NA, IGNORE, 0, FALSE) \ +FLAGDEF( A, EBX, INTEL, 1, 1, PMC_INSTR_RETIRED, NA, IGNORE, 0, FALSE) \ +FLAGDEF( A, EBX, INTEL, 2, 1, PMC_REF_CYCLES, NA, IGNORE, 0, FALSE) \ +FLAGDEF( A, EBX, INTEL, 3, 1, PMC_LAST_LVL_CREF, NA, IGNORE, 0, FALSE) \ +FLAGDEF( A, EBX, INTEL, 4, 1, PMC_LAST_LVL_CMISS, NA, IGNORE, 0, FALSE) \ +FLAGDEF( A, EBX, INTEL, 5, 1, PMC_BR_INST_RETIRED, NA, IGNORE, 0, FALSE) \ +FLAGDEF( A, EBX, INTEL, 6, 1, PMC_BR_MISS_RETIRED, NA, IGNORE, 0, FALSE) -/* LEVEL, REG, VENDOR, POS, SIZE, NAME, MASK TYPE, SET TO, [FUNC] */ +/* LEVEL, REG, VENDOR, POS, SIZE, NAME, MON SUPP, MASK TYPE, SET TO, CPL3, [FUNC] */ #define CPUID_FIELD_DATA_LEVEL_80 \ -FIELDDEF( 80, EAX, COMMON, 0, 32, NUM_EXT_LEVELS, IGNORE, 0) \ -FIELDDEF( 80, EBX, AMD, 0, 32, AMD_VENDOR1, IGNORE, 0) \ -FIELDDEF( 80, ECX, AMD, 0, 32, AMD_VENDOR3, IGNORE, 0) \ -FIELDDEF( 80, EDX, AMD, 0, 32, AMD_VENDOR2, IGNORE, 0) +FIELDDEF( 80, EAX, COMMON, 0, 32, NUM_EXT_LEVELS, NA, IGNORE, 0, FALSE) \ +FIELDDEF( 80, EBX, AMD, 0, 32, AMD_VENDOR1, NA, IGNORE, 0, FALSE) \ +FIELDDEF( 80, ECX, AMD, 0, 32, AMD_VENDOR3, NA, IGNORE, 0, FALSE) \ +FIELDDEF( 80, EDX, AMD, 0, 32, AMD_VENDOR2, NA, IGNORE, 0, FALSE) -/* LEVEL, REG, VENDOR, POS, SIZE, NAME, MASK TYPE, SET TO, [FUNC] */ +/* LEVEL, REG, VENDOR, POS, SIZE, NAME, MON SUPP, MASK TYPE, SET TO, CPL3, [FUNC] */ #define CPUID_FIELD_DATA_LEVEL_81 \ -FIELDDEF( 81, EAX, INTEL, 0, 32, UNKNOWN81EAX, IGNORE, 0) \ -FIELDDEF( 81, EAX, AMD, 0, 4, STEPPING, IGNORE, 0) \ -FIELDDEF( 81, EAX, AMD, 4, 4, MODEL, IGNORE, 0) \ -FIELDDEF( 81, EAX, AMD, 8, 4, FAMILY, IGNORE, 0) \ -FIELDDEF( 81, EAX, AMD, 12, 2, TYPE, IGNORE, 0) \ -FIELDDEF( 81, EAX, AMD, 16, 4, EXTMODEL, IGNORE, 0) \ -FIELDDEF( 81, EAX, AMD, 20, 8, EXTFAMILY, IGNORE, 0) \ -FIELDDEF( 81, EBX, INTEL, 0, 32, UNKNOWN81EBX, IGNORE, 0) \ -FIELDDEF( 81, EBX, AMD, 0, 16, BRAND_ID, IGNORE, 0) \ -FIELDDEF( 81, EBX, AMD, 16, 16, UNDEF, IGNORE, 0) \ -FLAGDEFA( 81, ECX, COMMON, 0, 1, LAHF, HOST, 0, LAHF64) \ -FLAGDEFA( 81, ECX, AMD, 1, 1, CMPLEGACY, MASK, 0, CMPLEGACY) \ -FLAGDEFA( 81, ECX, AMD, 2, 1, SVM, MASK, 0, SVM) \ -FLAGDEFA( 81, ECX, AMD, 3, 1, EXTAPICSPC, HOST, 0, EXTAPICSPC) \ -FLAGDEFA( 81, ECX, AMD, 4, 1, CR8AVAIL, MASK, 0, CR8AVAIL) \ -FLAGDEFA( 81, ECX, AMD, 5, 1, ABM, HOST, 0, ABM) \ -FLAGDEFA( 81, ECX, AMD, 6, 1, SSE4A, HOST, 0, SSE4A) \ -FLAGDEF( 81, ECX, AMD, 7, 1, MISALIGNED_SSE, HOST, 0) \ -FLAGDEF( 81, ECX, AMD, 8, 1, 3DNPREFETCH, HOST, 0) \ -FLAGDEF( 81, EDX, AMD, 0, 1, FPU, HOST, 0) \ -FLAGDEF( 81, EDX, AMD, 1, 1, VME, HOST, 0) \ -FLAGDEF( 81, EDX, AMD, 2, 1, DBGE, HOST, 0) \ -FLAGDEF( 81, EDX, AMD, 3, 1, PGSZE, HOST, 0) \ -FLAGDEF( 81, EDX, AMD, 4, 1, TSC, HOST, 0) \ -FLAGDEF( 81, EDX, AMD, 5, 1, MSR, HOST, 0) \ -FLAGDEF( 81, EDX, AMD, 6, 1, PAE, HOST, 0) \ -FLAGDEF( 81, EDX, AMD, 7, 1, MCK, HOST, 0) \ -FLAGDEF( 81, EDX, AMD, 8, 1, CPMX, HOST, 0) \ -FLAGDEF( 81, EDX, AMD, 9, 1, APIC, MASK, 1) \ -FLAGDEFA( 81, EDX, COMMON, 11, 1, SYSC, IGNORE, 0, SYSC) \ -FLAGDEF( 81, EDX, AMD, 12, 1, MTRR, HOST, 0) \ -FLAGDEF( 81, EDX, AMD, 13, 1, PGE, HOST, 0) \ -FLAGDEF( 81, EDX, AMD, 14, 1, MCA, HOST, 0) \ -FLAGDEF( 81, EDX, AMD, 15, 1, CMOV, HOST, 0) \ -FLAGDEF( 81, EDX, AMD, 16, 1, PAT, HOST, 0) \ -FLAGDEF( 81, EDX, AMD, 17, 1, 36PG, HOST, 0) \ -FLAGDEFA( 81, EDX, COMMON, 20, 1, NX, HOST, 0, NX) \ -FLAGDEFA( 81, EDX, AMD, 22, 1, MMXEXT, HOST, 0, MMXEXT) \ -FLAGDEF( 81, EDX, AMD, 23, 1, MMX, HOST, 0) \ -FLAGDEF( 81, EDX, AMD, 24, 1, FXSAVE, HOST, 0) \ -FLAGDEFA( 81, EDX, AMD, 25, 1, FFXSR, HOST, 0, FFXSR) \ -FLAGDEF( 81, EDX, AMD, 26, 1, PDPE1GB, MASK, 0) \ -FLAGDEFA( 81, EDX, COMMON, 27, 1, RDTSCP, HOST, 0, RDTSCP) \ -FLAGDEFA( 81, EDX, COMMON, 29, 1, LM, TEST, 1, LM) \ -FLAGDEFA( 81, EDX, AMD, 30, 1, 3DNOWPLUS, HOST, 0, 3DNOWPLUS) \ -FLAGDEFA( 81, EDX, AMD, 31, 1, 3DNOW, HOST, 0, 3DNOW) +FIELDDEF( 81, EAX, INTEL, 0, 32, UNKNOWN81EAX, ANY, IGNORE, 0, FALSE) \ +FIELDDEF( 81, EAX, AMD, 0, 4, STEPPING, ANY, IGNORE, 0, FALSE) \ +FIELDDEF( 81, EAX, AMD, 4, 4, MODEL, ANY, IGNORE, 0, FALSE) \ +FIELDDEF( 81, EAX, AMD, 8, 4, FAMILY, ANY, IGNORE, 0, FALSE) \ +FIELDDEF( 81, EAX, AMD, 12, 2, TYPE, ANY, IGNORE, 0, FALSE) \ +FIELDDEF( 81, EAX, AMD, 16, 4, EXTMODEL, ANY, IGNORE, 0, FALSE) \ +FIELDDEF( 81, EAX, AMD, 20, 8, EXTFAMILY, ANY, IGNORE, 0, FALSE) \ +FIELDDEF( 81, EBX, INTEL, 0, 32, UNKNOWN81EBX, ANY, IGNORE, 0, FALSE) \ +FIELDDEF( 81, EBX, AMD, 0, 16, BRAND_ID, ANY, IGNORE, 0, FALSE) \ +FIELDDEF( 81, EBX, AMD, 16, 16, UNDEF, ANY, IGNORE, 0, FALSE) \ +FLAGDEFA( 81, ECX, COMMON, 0, 1, LAHF, YES, HOST, 0, TRUE, LAHF64) \ +FLAGDEFA( 81, ECX, AMD, 1, 1, CMPLEGACY, NO, MASK, 0, FALSE, CMPLEGACY) \ +FLAGDEFA( 81, ECX, AMD, 2, 1, SVM, NO, MASK, 0, FALSE, SVM) \ +FLAGDEFA( 81, ECX, AMD, 3, 1, EXTAPICSPC, YES, HOST, 0, FALSE, EXTAPICSPC) \ +FLAGDEFA( 81, ECX, AMD, 4, 1, CR8AVAIL, NO, MASK, 0, FALSE, CR8AVAIL) \ +FLAGDEFA( 81, ECX, AMD, 5, 1, ABM, YES, HOST, 0, TRUE, ABM) \ +FLAGDEFA( 81, ECX, AMD, 6, 1, SSE4A, YES, HOST, 0, TRUE, SSE4A) \ +FLAGDEF( 81, ECX, AMD, 7, 1, MISALIGNED_SSE, YES, HOST, 0, TRUE) \ +FLAGDEFA( 81, ECX, AMD, 8, 1, 3DNPREFETCH, YES, HOST, 0, TRUE, 3DNPREFETCH) \ +FLAGDEF( 81, ECX, AMD, 9, 1, OSVW, NO, MASK, 0, FALSE) \ +FLAGDEF( 81, ECX, AMD, 10, 1, IBS, NO, MASK, 0, FALSE) \ +FLAGDEF( 81, ECX, AMD, 11, 1, SSE5, NO, RSVD, 0, TRUE) \ +FLAGDEF( 81, ECX, AMD, 12, 1, SKINIT, NO, MASK, 0, FALSE) \ +FLAGDEF( 81, ECX, AMD, 13, 1, WATCHDOG, NO, MASK, 0, FALSE) \ +FLAGDEF( 81, EDX, AMD, 0, 1, FPU, YES, HOST, 0, TRUE) \ +FLAGDEF( 81, EDX, AMD, 1, 1, VME, YES, HOST, 0, FALSE) \ +FLAGDEF( 81, EDX, AMD, 2, 1, DBGE, YES, HOST, 0, FALSE) \ +FLAGDEF( 81, EDX, AMD, 3, 1, PGSZE, YES, HOST, 0, FALSE) \ +FLAGDEF( 81, EDX, AMD, 4, 1, TSC, YES, HOST, 0, TRUE) \ +FLAGDEF( 81, EDX, AMD, 5, 1, MSR, YES, HOST, 0, FALSE) \ +FLAGDEF( 81, EDX, AMD, 6, 1, PAE, YES, HOST, 0, FALSE) \ +FLAGDEF( 81, EDX, AMD, 7, 1, MCK, YES, HOST, 0, FALSE) \ +FLAGDEF( 81, EDX, AMD, 8, 1, CPMX, YES, HOST, 0, TRUE) \ +FLAGDEF( 81, EDX, AMD, 9, 1, APIC, ANY, MASK, 1, FALSE) \ +FLAGDEFA( 81, EDX, COMMON, 11, 1, SYSC, ANY, IGNORE, 0, TRUE, SYSC) \ +FLAGDEF( 81, EDX, AMD, 12, 1, MTRR, YES, HOST, 0, FALSE) \ +FLAGDEF( 81, EDX, AMD, 13, 1, PGE, YES, HOST, 0, FALSE) \ +FLAGDEF( 81, EDX, AMD, 14, 1, MCA, YES, HOST, 0, FALSE) \ +FLAGDEF( 81, EDX, AMD, 15, 1, CMOV, YES, HOST, 0, TRUE) \ +FLAGDEF( 81, EDX, AMD, 16, 1, PAT, YES, HOST, 0, FALSE) \ +FLAGDEF( 81, EDX, AMD, 17, 1, 36PG, YES, HOST, 0, FALSE) \ +FLAGDEFA( 81, EDX, COMMON, 20, 1, NX, YES, HOST, 0, FALSE, NX) \ +FLAGDEFA( 81, EDX, AMD, 22, 1, MMXEXT, YES, HOST, 0, TRUE, MMXEXT) \ +FLAGDEF( 81, EDX, AMD, 23, 1, MMX, YES, HOST, 0, TRUE) \ +FLAGDEF( 81, EDX, AMD, 24, 1, FXSAVE, YES, HOST, 0, TRUE) \ +FLAGDEFA( 81, EDX, AMD, 25, 1, FFXSR, YES, HOST, 0, FALSE, FFXSR) \ +FLAGDEF( 81, EDX, AMD, 26, 1, PDPE1GB, NO, MASK, 0, FALSE) \ +FLAGDEFA( 81, EDX, COMMON, 27, 1, RDTSCP, YES, HOST, 0, TRUE, RDTSCP) \ +FLAGDEFA( 81, EDX, COMMON, 29, 1, LM, YES, TEST, 1, FALSE, LM) \ +FLAGDEFA( 81, EDX, AMD, 30, 1, 3DNOWPLUS, YES, HOST, 0, TRUE, 3DNOWPLUS) \ +FLAGDEFA( 81, EDX, AMD, 31, 1, 3DNOW, YES, HOST, 0, TRUE, 3DNOW) -/* LEVEL, REG, VENDOR, POS, SIZE, NAME, MASK TYPE, SET TO, [FUNC] */ +/* LEVEL, REG, VENDOR, POS, SIZE, NAME, MON SUPP, MASK TYPE, SET TO, CPL3, [FUNC] */ #define CPUID_FIELD_DATA_LEVEL_8x \ -FIELDDEF( 86, ECX, AMD, 0, 8, CACHE_LINE, IGNORE, 0) \ -FIELDDEF( 86, ECX, AMD, 8, 4, CACHE_LINE_PER_TAG, IGNORE, 0) \ -FIELDDEF( 86, ECX, AMD, 12, 4, CACHE_WAYS, IGNORE, 0) \ -FIELDDEF( 86, ECX, AMD, 16, 16, CACHE_SIZE, IGNORE, 0) \ -FLAGDEF( 87, EDX, AMD, 8, 1, TSC_INVARIANT, IGNORE, 0) \ -FIELDDEFA(88, EAX, COMMON, 0, 8, PHYSBITS, IGNORE, 0, PHYS_BITS) \ -FIELDDEFA(88, EAX, COMMON, 8, 8, VIRTBITS, IGNORE, 0, VIRT_BITS) \ -FIELDDEFA(88, ECX, AMD, 0, 8, CORE_COUNT, IGNORE, 0, AMD_CORE_COUNT) \ -FIELDDEF( 88, ECX, AMD, 12, 4, APICID_COREID_SIZE, IGNORE, 0) \ -FIELDDEFA(8A, EAX, AMD, 0, 8, SVM_REVISION, MASK, 0, SVM_REVISION) \ -FLAGDEF( 8A, EAX, AMD, 8, 1, SVM_HYPERVISOR, MASK, 0) \ -FIELDDEF( 8A, EAX, AMD, 9, 23, SVMEAX_RSVD, MASK, 0) \ -FIELDDEF( 8A, EBX, AMD, 0, 32, SVM_N_ASIDS, MASK, 0) \ -FIELDDEF( 8A, ECX, AMD, 0, 32, SVMECX_RSVD, MASK, 0) \ -FLAGDEF( 8A, EDX, AMD, 0, 1, SVM_NP, MASK, 0) \ -FLAGDEF( 8A, EDX, AMD, 1, 1, SVM_LBR, MASK, 0) \ -FLAGDEF( 8A, EDX, AMD, 2, 1, SVM_LOCK, MASK, 0) \ -FLAGDEF( 8A, EDX, AMD, 3, 1, SVM_NRIP, MASK, 0) \ -FIELDDEF( 8A, EDX, AMD, 4, 28, SVMEDX_RSVD, MASK, 0) +FIELDDEF( 86, ECX, AMD, 0, 8, L2CACHE_LINE, NA, IGNORE, 0, FALSE) \ +FIELDDEF( 86, ECX, AMD, 8, 4, L2CACHE_LINE_PER_TAG, NA, IGNORE, 0, FALSE) \ +FIELDDEF( 86, ECX, AMD, 12, 4, L2CACHE_WAYS, NA, IGNORE, 0, FALSE) \ +FIELDDEF( 86, ECX, AMD, 16, 16, L2CACHE_SIZE, NA, IGNORE, 0, FALSE) \ +FIELDDEF( 86, EDX, AMD, 0, 8, L3CACHE_LINE, NA, IGNORE, 0, FALSE) \ +FIELDDEF( 86, EDX, AMD, 8, 4, L3CACHE_LINE_PER_TAG,NA, IGNORE, 0, FALSE) \ +FIELDDEF( 86, EDX, AMD, 12, 4, L3CACHE_WAYS, NA, IGNORE, 0, FALSE) \ +FIELDDEF( 86, EDX, AMD, 18, 14, L3CACHE_SIZE, NA, IGNORE, 0, FALSE) \ +FLAGDEF( 87, EDX, AMD, 0, 1, TS, NA, IGNORE, 0, FALSE) \ +FLAGDEF( 87, EDX, AMD, 1, 1, FID, NA, IGNORE, 0, FALSE) \ +FLAGDEF( 87, EDX, AMD, 2, 1, VID, NA, IGNORE, 0, FALSE) \ +FLAGDEF( 87, EDX, AMD, 3, 1, TTP, NA, IGNORE, 0, FALSE) \ +FLAGDEF( 87, EDX, AMD, 4, 1, TM, NA, IGNORE, 0, FALSE) \ +FLAGDEF( 87, EDX, AMD, 5, 1, STC, NA, IGNORE, 0, FALSE) \ +FLAGDEF( 87, EDX, AMD, 6, 1, 100MHZSTEPS, NA, IGNORE, 0, FALSE) \ +FLAGDEF( 87, EDX, AMD, 7, 1, HWPSTATE, NA, IGNORE, 0, FALSE) \ +FLAGDEF( 87, EDX, AMD, 8, 1, TSC_INVARIANT, NA, IGNORE, 0, FALSE) \ +FIELDDEFA(88, EAX, COMMON, 0, 8, PHYSBITS, NA, IGNORE, 0, FALSE, PHYS_BITS) \ +FIELDDEFA(88, EAX, COMMON, 8, 8, VIRTBITS, NA, IGNORE, 0, FALSE, VIRT_BITS) \ +FIELDDEFA(88, ECX, AMD, 0, 8, CORE_COUNT, NA, IGNORE, 0, FALSE, AMD_CORE_COUNT) \ +FIELDDEFA(88, ECX, AMD, 12, 4, APICID_COREID_SIZE, NA, IGNORE, 0, FALSE, AMD_APICID_COREID_SIZE) \ +FIELDDEFA(8A, EAX, AMD, 0, 8, SVM_REVISION, NO, MASK, 0, FALSE, SVM_REVISION) \ +FLAGDEF( 8A, EAX, AMD, 8, 1, SVM_HYPERVISOR, NO, MASK, 0, FALSE) \ +FIELDDEF( 8A, EAX, AMD, 9, 23, SVMEAX_RSVD, NO, MASK, 0, FALSE) \ +FIELDDEF( 8A, EBX, AMD, 0, 32, SVM_N_ASIDS, NO, MASK, 0, FALSE) \ +FIELDDEF( 8A, ECX, AMD, 0, 32, SVMECX_RSVD, NO, MASK, 0, FALSE) \ +FLAGDEFA( 8A, EDX, AMD, 0, 1, SVM_NP, NO, MASK, 0, FALSE, NPT) \ +FLAGDEF( 8A, EDX, AMD, 1, 1, SVM_LBR, NO, MASK, 0, FALSE) \ +FLAGDEF( 8A, EDX, AMD, 2, 1, SVM_LOCK, NO, MASK, 0, FALSE) \ +FLAGDEF( 8A, EDX, AMD, 3, 1, SVM_NRIP, NO, MASK, 0, FALSE) \ +FIELDDEF( 8A, EDX, AMD, 4, 28, SVMEDX_RSVD, NO, MASK, 0, FALSE) #define CPUID_FIELD_DATA \ CPUID_FIELD_DATA_LEVEL_0 \ CPUID_FIELD_DATA_LEVEL_1 \ CPUID_FIELD_DATA_LEVEL_4 \ + CPUID_FIELD_DATA_LEVEL_5 \ + CPUID_FIELD_DATA_LEVEL_6 \ CPUID_FIELD_DATA_LEVEL_A \ CPUID_FIELD_DATA_LEVEL_80 \ CPUID_FIELD_DATA_LEVEL_81 \ @@ -402,15 +481,20 @@ */ #define VMW_BIT_MASK(shift) (((1 << (shift - 1)) << 1) - 1) -#define FIELDDEF(lvl, reg, vend, bitpos, size, name, m, v) \ +#define FIELDDEF(lvl, reg, vend, bitpos, size, name, s, m, v, c3) \ CPUID_##vend##_ID##lvl##reg##_##name##_SHIFT = bitpos, \ CPUID_##vend##_ID##lvl##reg##_##name##_MASK = \ VMW_BIT_MASK(size) << bitpos, \ CPUID_FEATURE_##vend##_ID##lvl##reg##_##name = \ CPUID_##vend##_ID##lvl##reg##_##name##_MASK, -#define FIELDDEFA(lvl, reg, vend, bitpos, size, name, m, v, f) \ - FIELDDEF(lvl, reg, vend, bitpos, size, name, m, v) +/* Before simplifying this take a look at bug 293638... */ +#define FIELDDEFA(lvl, reg, vend, bitpos, size, name, s, m, v, c3, f) \ + CPUID_##vend##_ID##lvl##reg##_##name##_SHIFT = bitpos, \ + CPUID_##vend##_ID##lvl##reg##_##name##_MASK = \ + VMW_BIT_MASK(size) << bitpos, \ + CPUID_FEATURE_##vend##_ID##lvl##reg##_##name = \ + CPUID_##vend##_ID##lvl##reg##_##name##_MASK, #define FLAGDEFA FIELDDEFA #define FLAGDEF FIELDDEF @@ -508,6 +592,13 @@ FIELD_FUNC(AMD_APICID_COREID_SIZE, CPUID_AMD_ID88ECX_APICID_COREID_SIZE) FIELD_FUNC(AMD_EXTAPICSPC, CPUID_AMD_ID81ECX_EXTAPICSPC) FIELD_FUNC(NUM_PMCS, CPUID_INTEL_IDAEAX_NUM_PMCS) +FIELD_FUNC(MWAIT_MIN_SIZE, CPUID_COMMON_ID5EAX_MWAIT_MIN_SIZE) +FIELD_FUNC(MWAIT_MAX_SIZE, CPUID_COMMON_ID5EBX_MWAIT_MAX_SIZE) +FIELD_FUNC(MWAIT_C0_SUBSTATE, CPUID_INTEL_ID5EDX_MWAIT_C0_SUBSTATE) +FIELD_FUNC(MWAIT_C1_SUBSTATE, CPUID_INTEL_ID5EDX_MWAIT_C1_SUBSTATE) +FIELD_FUNC(MWAIT_C2_SUBSTATE, CPUID_INTEL_ID5EDX_MWAIT_C2_SUBSTATE) +FIELD_FUNC(MWAIT_C3_SUBSTATE, CPUID_INTEL_ID5EDX_MWAIT_C3_SUBSTATE) +FIELD_FUNC(MWAIT_C4_SUBSTATE, CPUID_INTEL_ID5EDX_MWAIT_C4_SUBSTATE) #undef FIELD_FUNC @@ -534,15 +625,58 @@ /* Intel model information */ #define CPUID_MODEL_PPRO 1 -#define CPUID_MODEL_PII_3 3 -#define CPUID_MODEL_PII_5 5 -#define CPUID_MODEL_CELERON_6 6 -#define CPUID_MODEL_PIII_7 7 -#define CPUID_MODEL_PIII_8 8 -#define CPUID_MODEL_PM 9 -#define CPUID_MODEL_PIII_A 10 -#define CPUID_MODEL_CORE 14 -#define CPUID_MODEL_CORE2 15 +#define CPUID_MODEL_PII_03 3 +#define CPUID_MODEL_PII_05 5 +#define CPUID_MODEL_CELERON_06 6 +#define CPUID_MODEL_PM_09 9 +#define CPUID_MODEL_PM_0D 13 +#define CPUID_MODEL_PM_0E 14 // Yonah / Sossaman +#define CPUID_MODEL_CORE_0F 15 // Conroe / Merom +#define CPUID_MODEL_CORE_17 0x17 // Penryn +#define CPUID_MODEL_NEHALEM_1A 0x1a // Nehalem / Gainestown +#define CPUID_MODEL_ATOM_1C 0x1c // Silverthorne / Diamondville +#define CPUID_MODEL_CORE_1D 0x1d // Dunnington + +#define CPUID_MODEL_PIII_07 7 +#define CPUID_MODEL_PIII_08 8 +#define CPUID_MODEL_PIII_0A 10 + +/* + *---------------------------------------------------------------------- + * + * CPUID_IsVendor{AMD,Intel} -- + * + * Determines if the vendor string in cpuid id0 is from {AMD,Intel}. + * + * Results: + * True iff vendor string is CPUID_{AMD,INTEL}_VENDOR_STRING + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ +static INLINE Bool +CPUID_IsRawVendor(CPUIDRegs *id0, const char* vendor) +{ + // hard to get strcmp() in some environments, so do it in the raw + return (id0->ebx == *(const uint32 *) (vendor + 0) && + id0->ecx == *(const uint32 *) (vendor + 4) && + id0->edx == *(const uint32 *) (vendor + 8)); +} + +static INLINE Bool +CPUID_IsVendorAMD(CPUIDRegs *id0) +{ + return CPUID_IsRawVendor(id0, CPUID_AMD_VENDOR_STRING); +} + +static INLINE Bool +CPUID_IsVendorIntel(CPUIDRegs *id0) +{ + return CPUID_IsRawVendor(id0, CPUID_INTEL_VENDOR_STRING); +} + static INLINE uint32 CPUID_EFFECTIVE_FAMILY(uint32 v) /* %eax from CPUID with %eax=1. */ @@ -590,15 +724,44 @@ return CPUID_EFFECTIVE_FAMILY(_eax) == CPUID_FAMILY_P4; } -/* Intel Core processors are Yonah, Merom, Conroe, Woodcrest, - * Clovertown, Penryn, ... +/* + * Intel Pentium M processors are Yonah/Sossaman or an older P-M */ static INLINE Bool -CPUID_FAMILY_IS_CORE(uint32 v) // IN: %eax from CPUID with %eax=1. +CPUID_UARCH_IS_PENTIUM_M(uint32 v) // IN: %eax from CPUID with %eax=1. { /* Assumes the CPU manufacturer is Intel. */ return CPUID_FAMILY_IS_P6(v) && - CPUID_EFFECTIVE_MODEL(v) >= CPUID_MODEL_CORE; + (CPUID_EFFECTIVE_MODEL(v) == CPUID_MODEL_PM_09 || + CPUID_EFFECTIVE_MODEL(v) == CPUID_MODEL_PM_0D || + CPUID_EFFECTIVE_MODEL(v) == CPUID_MODEL_PM_0E); +} + +/* + * Intel Core processors are Merom, Conroe, Woodcrest, Clovertown, + * Penryn, Dunnington, Kentsfield, Yorktown, Harpertown, ........ + */ +static INLINE Bool +CPUID_UARCH_IS_CORE(uint32 v) // IN: %eax from CPUID with %eax=1. +{ + uint32 model = CPUID_EFFECTIVE_MODEL(v); + /* Assumes the CPU manufacturer is Intel. */ + return CPUID_FAMILY_IS_P6(v) && + model >= CPUID_MODEL_CORE_0F && + (model < CPUID_MODEL_NEHALEM_1A || + model == CPUID_MODEL_CORE_1D); +} + + +/* + * Intel Nehalem processors are: Nehalem, Gainestown. + */ +static INLINE Bool +CPUID_UARCH_IS_NEHALEM(uint32 v) // IN: %eax from CPUID with %eax=1. +{ + /* Assumes the CPU manufacturer is Intel. */ + return CPUID_FAMILY_IS_P6(v) && + CPUID_EFFECTIVE_MODEL(v) == CPUID_MODEL_NEHALEM_1A; } @@ -680,26 +843,94 @@ */ return !((isIntel && ((CPUID_FAMILY_IS_P6(v) && - CPUID_EFFECTIVE_MODEL(v) < CPUID_MODEL_CORE) || + CPUID_EFFECTIVE_MODEL(v) < CPUID_MODEL_PM_0E) || (CPUID_FAMILY_IS_PENTIUM4(v) && CPUID_EFFECTIVE_MODEL(v) < 3))) || (!isIntel && CPUID_FAMILY(v) < CPUID_FAMILY_K8)); } + /* * For certain AMD processors, an lfence instruction is necessary at various * places to ensure ordering. */ + +static INLINE Bool +CPUID_VendorRequiresFence(CpuidVendors vendor) +{ + return vendor == CPUID_VENDOR_AMD; +} + +static INLINE Bool +CPUID_VersionRequiresFence(uint32 version) +{ + return CPUID_EFFECTIVE_FAMILY(version) == CPUID_FAMILY_K8 && + CPUID_EFFECTIVE_MODEL(version) < 0x40; +} + +static INLINE Bool +CPUID_ID0RequiresFence(CPUIDRegs *id0) +{ + if (id0->eax == 0) { + return FALSE; + } + return CPUID_IsVendorAMD(id0); +} + +static INLINE Bool +CPUID_ID1RequiresFence(CPUIDRegs *id1) +{ + return CPUID_VersionRequiresFence(id1->eax); +} + static INLINE Bool CPUID_RequiresFence(CpuidVendors vendor, // IN uint32 version) // IN: %eax from CPUID with %eax=1. { - return ((vendor == CPUID_VENDOR_AMD) && - (CPUID_EFFECTIVE_FAMILY(version) == CPUID_FAMILY_K8) && - (CPUID_EFFECTIVE_MODEL(version) < 0x40)); + return CPUID_VendorRequiresFence(vendor) && + CPUID_VersionRequiresFence(version); +} + + +/* + *---------------------------------------------------------------------- + * + * CPUID_CountsCPUIDAsBranch -- + * + * Returns TRUE iff the cpuid given counts CPUID as a branch + * (i.e. is a pre-Merom E CPU). + * + *---------------------------------------------------------------------- + */ + +static INLINE Bool +CPUID_CountsCPUIDAsBranch(uint32 v) /* %eax from CPUID with %eax=1 */ +{ + /* + * CPUID no longer a branch starting with Merom E. Bug 148411. + * Penryn (Extended Model: 1) also has this fixed. + * + * Merom E is: CPUID.1.eax & 0xfff = 0x6f9 + */ + return !(CPUID_FAMILY_IS_P6(v) && + (CPUID_EFFECTIVE_MODEL(v) > CPUID_MODEL_CORE_0F || + (CPUID_EFFECTIVE_MODEL(v) == CPUID_MODEL_CORE_0F && + CPUID_STEPPING(v) >= 9))); } +/* + * On Merom and later Intel chips, not present PDPTEs with reserved bits + * set do not fault with a #GP. See PR# 109120. + */ +static INLINE Bool +CPUID_FaultOnNPReservedPDPTE(uint32 v) // IN: %eax from CPUID with %eax=1. +{ + return !(CPUID_FAMILY_IS_P6(v) && + (CPUID_EFFECTIVE_MODEL(v) >= CPUID_MODEL_CORE_0F)); +} + + /* * The following low-level functions compute the number of * cores per cpu. They should be used cautiously because @@ -722,4 +953,15 @@ return 1 + CPUID_AMD_CORE_COUNT(v); } +/* + * Hypervisor CPUID space is 0x400000XX. + */ +static INLINE Bool +CPUID_IsHypervisorLevel(uint32 level, uint32 *offset) +{ + *offset = level & 0xff; + return (level & 0xffffff00) == 0x40000000; +} + + #endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmmemctl/backdoor_def.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmmemctl/backdoor_def.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmmemctl/backdoor_def.h 2008-01-28 08:02:47.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmmemctl/backdoor_def.h 2008-10-13 08:01:45.000000000 +0100 @@ -79,7 +79,7 @@ #define BDOOR_CMD_GETUUID 19 #define BDOOR_CMD_GETMEMSIZE 20 #define BDOOR_CMD_HOSTCOPY 21 /* Devel only */ -/* BDOOR_CMD_GETOS2INTCURSOR, 22, is very old and defunct. Reuse. */ +#define BDOOR_CMD_SERVICE_VM 22 /* prototype only */ #define BDOOR_CMD_GETTIME 23 /* Deprecated. Use GETTIMEFULL. */ #define BDOOR_CMD_STOPCATCHUP 24 #define BDOOR_CMD_PUTCHR 25 /* Devel only */ @@ -109,7 +109,12 @@ #define BDOOR_CMD_CHECKFORCEBIOSSETUP 48 #define BDOOR_CMD_LAZYTIMEREMULATION 49 #define BDOOR_CMD_BIOSBBS 50 -#define BDOOR_CMD_MAX 51 +#define BDOOR_CMD_VASSERT 51 +#define BDOOR_CMD_ISGOSDARWIN 52 +#define BDOOR_CMD_DEBUGEVENT 53 +#define BDOOR_CMD_OSNOTMACOSXSERVER 54 +#define BDOOR_CMD_GETTIMEFULL_WITH_LAG 55 +#define BDOOR_CMD_MAX 56 /* * IMPORTANT NOTE: When modifying the behavior of an existing backdoor command, @@ -123,7 +128,8 @@ #define BDOORHB_PORT 0x5659 #define BDOORHB_CMD_MESSAGE 0 -#define BDOORHB_CMD_MAX 1 +#define BDOORHB_CMD_VASSERT 1 +#define BDOORHB_CMD_MAX 2 /* * There is another backdoor which allows access to certain TSC-related diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmmemctl/balloon_def.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmmemctl/balloon_def.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmmemctl/balloon_def.h 2008-01-28 08:02:47.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmmemctl/balloon_def.h 2008-10-13 08:01:44.000000000 +0100 @@ -71,20 +71,4 @@ #define BALLOON_ERROR_RESET (7) #define BALLOON_ERROR_BUSY (8) -/* - * types - */ - -typedef struct { - // platform -> VMM - uint32 target; // target balloon size (in pages) - - // platform <- VMM - uint32 size; // current balloon size (in pages) - uint32 nOps; // stats: operation count - uint32 nReset; // stats: reset count - uint32 guestType; // guest OS identifier - uint32 maxSize; // predicted max balloon size (in pages) -} Balloon_BalloonInfo; - #endif /* _BALLOON_DEF_H */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmmemctl/compat_kernel.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmmemctl/compat_kernel.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmmemctl/compat_kernel.h 2008-01-28 08:02:47.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmmemctl/compat_kernel.h 2008-10-13 08:01:45.000000000 +0100 @@ -72,5 +72,12 @@ #endif +/* + * vsnprintf became available in 2.4.10. For older kernels, just fall back on + * vsprintf. + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 10) +#define vsnprintf(str, size, fmt, args) vsprintf(str, fmt, args) +#endif #endif /* __COMPAT_KERNEL_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmmemctl/compat_kthread.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmmemctl/compat_kthread.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmmemctl/compat_kthread.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmmemctl/compat_kthread.h 2008-10-13 08:01:45.000000000 +0100 @@ -0,0 +1,223 @@ +/********************************************************* + * Copyright (C) 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 General Public License as published by the + * Free Software Foundation version 2 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 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 + * + *********************************************************/ + +#ifndef __COMPAT_KTHREAD_H__ +# define __COMPAT_KTHREAD_H__ + +/* + * The kthread interface for managing kernel threads appeared in 2.6.4, but was + * only exported for module use in 2.6.7. + */ + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 7) +# include <linux/kthread.h> + +# define COMPAT_KTHREAD_DECLARE_STOP_INFO() +# define compat_kthread_stop(_tsk) kthread_stop(_tsk) +# define compat_kthread_should_stop() kthread_should_stop() +# define compat_kthread_run(_fn, _data, _namefmt, ...) \ + kthread_run(_fn, _data, _namefmt, ## __VA_ARGS__) +# define compat_kthread_create(_fn, _data, _namefmt, ...) \ + kthread_create(_fn, _data, _namefmt, ## __VA_ARGS__) +#else + +/* + * When the kthread interface isn't available, we do our best to emulate it, + * with a few notable exceptions: + * + * 1: We use semaphores instead of mutexes for locking, because mutexes aren't + * available in kernels where kthread isn't available. + * 2: The real kthread interface uses the kthreadd kernel_thread to broker the + * creation of new kernel threads. This makes sense because kthreadd is part + * of the kernel, but doesn't make sense at all in the context of an + * individual module. So in our emulation, thread creation occurs in the + * context of a kthread_create call. + * 3: Because kthreadd is responsible for creating kernel threads in the real + * kthread interface, there's no need to explicitly reparent any of them. We + * aren't using kthreadd, so we call daemonize to reparent, which also sets + * the name of the new kernel thread. That's why we don't set the name as + * the real kthread interface does (within kthread_create). Furthermore, to + * get the name to daemonize, we're forced to pass it through the + * kthread_start_info struct. + * 4: Since our interface isn't in the kernel proper, we can't make use of + * get_task_struct/put_task_struct so as to acquire references to kernel + * threads that we're managing. To prevent races, we use an extra completion + * when stopping kernel threads. See the comments in compat_kthread_stop for + * more details. + * + * Like the real kthread interface, ours must be globally available so that we + * can emulate functions like kthread_should_stop without using different + * signatures. + */ + +# include "compat_completion.h" +# include "compat_kernel.h" +# include "compat_sched.h" + +struct compat_kthread_start_info { + int (*fn)(void *); + void *data; + compat_completion created; + char comm[TASK_COMM_LEN]; +}; + +struct compat_kthread_stop_info { + struct semaphore lock; + struct task_struct *task; + compat_completion woken; + compat_completion stopped; + int ret; +}; + +extern struct compat_kthread_stop_info compat_kthread_stop_info; + +# define COMPAT_KTHREAD_DECLARE_STOP_INFO() \ + struct compat_kthread_stop_info compat_kthread_stop_info = { \ + .lock = __SEMAPHORE_INITIALIZER(compat_kthread_stop_info.lock, 1), \ + .task = NULL, \ + } + + +static inline int +compat_kthread_should_stop(void) +{ + return (compat_kthread_stop_info.task == current); +} + + +static inline int +compat_kthread_stop(struct task_struct *_task) +{ + int ret; + + down(&compat_kthread_stop_info.lock); + + /* + * We use a write memory barrier to ensure that all CPUs see _task after + * the completions have been initialized. + * + * There's a race between kernel threads managed by kthread and the upcoming + * call to wake_up_process. If the kernel thread wakes up after we set task + * but before the call to wake_up_process, the thread's call to + * compat_kthread_should_stop will return true and the thread will exit. At + * that point, the call to wake_up_process will be on a dead task_struct. + * + * XXX: The real kthread interface protects against this race by grabbing + * and releasing a reference to _task. We don't have that luxury, because + * there is a range of kernels where put_task_struct isn't exported to + * modules. In fact, no other modules call get_task_struct or + * put_task_struct, so to do so from this context may be unwise. Instead, + * we'll use an extra completion to ensure that the kernel thread only exits + * after wake_up_process has been called. + */ + compat_init_completion(&compat_kthread_stop_info.woken); + compat_init_completion(&compat_kthread_stop_info.stopped); + smp_wmb(); + + compat_kthread_stop_info.task = _task; + wake_up_process(_task); + compat_complete(&compat_kthread_stop_info.woken); + + compat_wait_for_completion(&compat_kthread_stop_info.stopped); + compat_kthread_stop_info.task = NULL; + ret = compat_kthread_stop_info.ret; + up(&compat_kthread_stop_info.lock); + return ret; +} + + +# define compat_kthread_run(_fn, _data, _namefmt, ...) \ +({ \ + struct task_struct *tsk; \ + tsk = compat_kthread_create(_fn, _data, _namefmt, ## __VA_ARGS__); \ + if (!IS_ERR(tsk)) { \ + wake_up_process(tsk); \ + } \ + tsk; \ +}) + + +static inline int +compat_kthread(void *_data) +{ + int ret = -EINTR; + struct compat_kthread_start_info *info; + int (*fn)(void *data); + void *data; + + info = (struct compat_kthread_start_info *)_data; + fn = info->fn; + data = info->data; + + compat_daemonize(info->comm); + __set_current_state(TASK_UNINTERRUPTIBLE); + compat_complete(&info->created); + schedule(); + + if (!compat_kthread_should_stop()) { + ret = fn(data); + } + + if (compat_kthread_should_stop()) { + compat_wait_for_completion(&compat_kthread_stop_info.woken); + compat_kthread_stop_info.ret = ret; + compat_complete_and_exit(&compat_kthread_stop_info.stopped, 0); + BUG(); + } + return 0; +} + + +static inline struct task_struct * +compat_kthread_create(int (*_fn)(void *data), + void *_data, + const char _namefmt[], + ...) +{ + pid_t pid; + struct task_struct *task = NULL; + struct compat_kthread_start_info info; + va_list args; + + info.fn = _fn; + info.data = _data; + compat_init_completion(&info.created); + va_start(args, _namefmt); + vsnprintf(info.comm, sizeof info.comm, _namefmt, args); + va_end(args); + pid = kernel_thread(compat_kthread, &info, CLONE_KERNEL); + if (pid >= 0) { + compat_wait_for_completion(&info.created); + + /* + * find_task_by_pid must be called with tasklist_lock held or under + * rcu_read_lock. As the latter doesn't exist in old kernels, we use the + * former for convenience. + */ + read_lock(&tasklist_lock); + task = find_task_by_pid(pid); + read_unlock(&tasklist_lock); + + /* XXX: Do we need to get a reference on task? */ + } + return task; +} + +#endif + +#endif /* __COMPAT_KTHREAD_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmmemctl/compat_sched.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmmemctl/compat_sched.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmmemctl/compat_sched.h 2008-01-28 08:02:47.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmmemctl/compat_sched.h 2008-10-13 08:01:45.000000000 +0100 @@ -27,6 +27,11 @@ #define CLONE_KERNEL CLONE_FILES | CLONE_FS | CLONE_SIGHAND #endif +/* TASK_COMM_LEN become available in 2.6.11. */ +#ifndef TASK_COMM_LEN +#define TASK_COMM_LEN 16 +#endif + /* The capable() API appeared in 2.1.92 --hpreg */ #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 1, 92) # define capable(_capability) suser() @@ -266,4 +271,21 @@ #define compat_set_freezable() do {} while (0) #endif +/* + * Since 2.6.27-rc2 kill_proc() is gone... Replacement (GPL-only!) + * API is available since 2.6.19. Use them from 2.6.27-rc1 up. + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 27) +typedef int compat_pid; +#define compat_find_get_pid(pid) (pid) +#define compat_put_pid(pid) do { } while (0) +#define compat_kill_pid(pid, sig, flag) kill_proc(pid, sig, flag) +#else +typedef struct pid * compat_pid; +#define compat_find_get_pid(pid) find_get_pid(pid) +#define compat_put_pid(pid) put_pid(pid) +#define compat_kill_pid(pid, sig, flag) kill_pid(pid, sig, flag) +#endif + + #endif /* __COMPAT_SCHED_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmmemctl/compat_semaphore.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmmemctl/compat_semaphore.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmmemctl/compat_semaphore.h 2008-01-28 08:02:47.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmmemctl/compat_semaphore.h 2008-10-13 08:01:45.000000000 +0100 @@ -20,7 +20,12 @@ # define __COMPAT_SEMAPHORE_H__ -#include <asm/semaphore.h> +/* <= 2.6.25 have asm only, 2.6.26 has both, and 2.6.27-rc2+ has linux only. */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 27) +# include <asm/semaphore.h> +#else +# include <linux/semaphore.h> +#endif /* diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmmemctl/compat_wait.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmmemctl/compat_wait.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmmemctl/compat_wait.h 2008-01-28 08:02:47.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmmemctl/compat_wait.h 2008-10-13 08:01:45.000000000 +0100 @@ -52,13 +52,13 @@ * 2.4.20-wolk4.0s. */ -#if VMW_HAVE_EPOLL // { +#ifdef VMW_HAVE_EPOLL // { #define compat_poll_wqueues struct poll_wqueues #else // } { #define compat_poll_wqueues poll_table #endif // } -#if VMW_HAVE_EPOLL // { +#ifdef VMW_HAVE_EPOLL // { /* If prototype does not match, build will abort here */ extern void poll_initwait(compat_poll_wqueues *); @@ -191,4 +191,35 @@ }) #endif +/* + * DEFINE_WAIT() and friends were added in 2.5.39 and backported to 2.4.28. + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 28) || \ + (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 0) && \ + LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 39)) +# define COMPAT_DEFINE_WAIT(_wait) \ + DECLARE_WAITQUEUE(_wait, current) +# define compat_init_prepare_to_wait(_sleep, _wait, _state) \ + do { \ + __set_current_state(_state); \ + add_wait_queue(_sleep, _wait); \ + } while (0) +# define compat_cont_prepare_to_wait(_sleep, _wait, _state) \ + set_current_state(_state) +# define compat_finish_wait(_sleep, _wait, _state) \ + do { \ + __set_current_state(_state); \ + remove_wait_queue(_sleep, _wait); \ + } while (0) +#else +# define COMPAT_DEFINE_WAIT(_wait) \ + DEFINE_WAIT(_wait) +# define compat_init_prepare_to_wait(_sleep, _wait, _state) \ + prepare_to_wait(_sleep, _wait, _state) +# define compat_cont_prepare_to_wait(_sleep, _wait, _state) \ + prepare_to_wait(_sleep, _wait, _state) +# define compat_finish_wait(_sleep, _wait, _state) \ + finish_wait(_sleep, _wait) +#endif + #endif /* __COMPAT_WAIT_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmmemctl/Makefile /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmmemctl/Makefile --- open-vm-tools-2008.01.23-74039/modules/linux/vmmemctl/Makefile 2008-01-28 08:02:48.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmmemctl/Makefile 2008-10-13 08:01:45.000000000 +0100 @@ -34,6 +34,7 @@ BUILD_DIR = $(HEADER_DIR)/.. DRIVER := vmmemctl +PRODUCT := @PRODUCT@ # Grep program GREP = /bin/grep @@ -86,7 +87,7 @@ # $(DRIVER_KO) is a phony target, so compare file times explicitly $(DRIVER): $(DRIVER_KO) - if [ $< -nt $@ ]; then cp -f $< $@; fi + if [ $< -nt $@ ] || [ ! -e $@ ] ; then cp -f $< $@; fi # Pass gcc version down the chain, so we can detect if kernel attempts to use unapproved compiler VM_CCVER := $(VMCCVER) diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmmemctl/Makefile.kernel /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmmemctl/Makefile.kernel --- open-vm-tools-2008.01.23-74039/modules/linux/vmmemctl/Makefile.kernel 2008-01-28 08:02:48.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmmemctl/Makefile.kernel 2008-10-13 08:01:45.000000000 +0100 @@ -41,6 +41,6 @@ endif clean: - rm -rf $(wildcard $(DRIVER).mod.c $(DRIVER).ko \ - .tmp_versions Module.symvers Modules.symvers \ + rm -rf $(wildcard $(DRIVER).mod.c $(DRIVER).ko .tmp_versions \ + Module.symvers Modules.symvers Module.markers modules.order \ $(foreach dir,./,$(addprefix $(dir),.*.cmd .*.o.flags *.o))) diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmmemctl/os.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmmemctl/os.c --- open-vm-tools-2008.01.23-74039/modules/linux/vmmemctl/os.c 2008-01-28 08:02:48.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmmemctl/os.c 2008-10-13 08:01:45.000000000 +0100 @@ -54,10 +54,19 @@ #ifdef CONFIG_PROC_FS #include <linux/stat.h> #include <linux/proc_fs.h> +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26) +/* + * The get_info callback of proc_dir_entry was removed in 2.6.26. + * We must therefore use the seq_file interface from that point on. + */ +#define VMW_USE_SEQ_FILE +#include <linux/seq_file.h> +#endif #endif /* CONFIG_PROC_FS */ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) #include <linux/smp_lock.h> +#include "compat_kthread.h" #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 9) int errno; /* compat_exit() needs global errno variable. */ @@ -72,6 +81,7 @@ * Allow allocations from high memory on 2.4.x kernels. */ #define OS_KTHREAD (1) +COMPAT_KTHREAD_DECLARE_STOP_INFO(); #endif #include "os.h" @@ -148,12 +158,6 @@ #endif -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 41) -#define OS_USE_SCHEDULE_DELAYED_WORK -#else -#undef OS_USE_SCHEDULE_DELAYED_WORK -#endif - /* * Types */ @@ -164,23 +168,17 @@ void *data; int period; - /* termination flag */ - volatile int stop; - /* system structures */ #ifdef OS_KTHREAD wait_queue_head_t delay; - compat_completion notifyStart; - compat_completion notifyStop; - pid_t pid; -#else -#ifdef OS_USE_SCHEDULE_DELAYED_WORK - struct work_struct work; + struct task_struct *task; #else + /* termination flag */ + atomic_t stop; + struct timer_list timer; struct tq_struct task; #endif -#endif } os_timer; typedef struct { @@ -202,8 +200,18 @@ #ifdef CONFIG_PROC_FS #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) -static int os_proc_read(char *, char **, off_t, int); static struct proc_dir_entry *global_proc_entry; +#ifdef VMW_USE_SEQ_FILE +static int os_proc_open(struct inode *, struct file *); +static struct file_operations global_proc_fops = { + .open = os_proc_open, + .read = seq_read, + .llseek = seq_lseek, + .release = single_release, +}; +#else +static int os_proc_read(char *, char **, off_t, int); +#endif /* VMW_USE_SEQ_FILE */ #else static int os_proc_read(char *, char **, off_t, int, int); static struct proc_dir_entry global_proc_entry = { @@ -344,20 +352,32 @@ } #ifndef OS_KTHREAD -static void os_timer_add(os_timer *t); +static void os_timer_add(os_timer *t) +{ + /* schedule timer callback */ + struct timer_list *timer = &t->timer; + timer->expires = jiffies + t->period; + add_timer(timer); +} + +static void os_timer_remove(os_timer *t) +{ + /* deschedule timer callback */ + struct timer_list *timer = &t->timer; + (void) del_timer(timer); +} static void os_timer_bh(void *data) { os_timer *t = (os_timer *) data; - if (!t->stop) { + if (!atomic_read(&t->stop)) { /* execute registered handler, rearm timer */ (*(t->handler))(t->data); os_timer_add(t); } } -#ifndef OS_USE_SCHEDULE_DELAYED_WORK static void os_timer_internal(ulong data) { os_timer *t = (os_timer *) data; @@ -368,31 +388,6 @@ } #endif -static void os_timer_add(os_timer *t) -{ -#ifdef OS_USE_SCHEDULE_DELAYED_WORK - schedule_delayed_work(&t->work, t->period); -#else - /* schedule timer callback */ - struct timer_list *timer = &t->timer; - timer->expires = jiffies + t->period; - add_timer(timer); -#endif -} - -static void os_timer_remove(os_timer *t) -{ -#ifdef OS_USE_SCHEDULE_DELAYED_WORK - cancel_delayed_work(&t->work); - flush_scheduled_work(); -#else - /* deschedule timer callback */ - struct timer_list *timer = &t->timer; - (void) del_timer(timer); -#endif -} -#endif - void CDECL os_timer_init(os_timer_handler handler, void *data, int period) { @@ -400,11 +395,8 @@ t->handler = handler; t->data = data; t->period = period; - t->stop = 0; #ifndef OS_KTHREAD -#ifdef OS_USE_SCHEDULE_DELAYED_WORK - INIT_WORK(&t->work, os_timer_bh, t); -#else + atomic_set(&t->stop, 0); t->task.routine = os_timer_bh; t->task.data = t; /* initialize timer state */ @@ -412,7 +404,6 @@ t->timer.function = os_timer_internal; t->timer.data = (ulong) t; #endif -#endif } #ifdef OS_KTHREAD @@ -420,21 +411,16 @@ { os_timer *t = (os_timer *) data; - /* detach thread */ - lock_kernel(); - compat_daemonize("vmmemctl"); - unlock_kernel(); - /* we are running */ - compat_complete(&t->notifyStart); compat_set_freezable(); /* main loop */ while (1) { /* sleep for specified period */ - wait_event_interruptible_timeout(t->delay, t->stop, t->period); + wait_event_interruptible_timeout(t->delay, compat_kthread_should_stop(), + t->period); compat_try_to_freeze(); - if (t->stop) { + if (compat_kthread_should_stop()) { break; } @@ -443,7 +429,6 @@ } /* terminate */ - compat_complete_and_exit(&t->notifyStop, 0); return(0); } @@ -452,31 +437,27 @@ os_status *s = &global_state.status; /* initialize sync objects */ - compat_init_completion(&t->notifyStart); - compat_init_completion(&t->notifyStop); init_waitqueue_head(&t->delay); /* create kernel thread */ - t->pid = kernel_thread(os_timer_thread_loop, t, 0); - if (t->pid < 0) { + t->task = compat_kthread_run(os_timer_thread_loop, t, "vmmemctl"); + if (IS_ERR(t->task)) { /* fail */ - printk(KERN_WARNING "%s: unable to create kernel thread (%d)\n", s->name, t->pid); + printk(KERN_WARNING "%s: unable to create kernel thread\n", s->name); return(-1); } if (OS_DEBUG) { - printk(KERN_DEBUG "%s: started kernel thread pid=%d\n", s->name, t->pid); + printk(KERN_DEBUG "%s: started kernel thread pid=%d\n", s->name, + t->task->pid); } - /* block until started... Why?! */ - compat_wait_for_completion(&t->notifyStart); return(0); } static void os_timer_thread_stop(os_timer *t) { - wake_up_interruptible(&t->delay); - compat_wait_for_completion(&t->notifyStop); + compat_kthread_stop(t->task); } #endif @@ -485,12 +466,12 @@ { os_timer *t = &global_state.timer; - /* clear termination flag */ - t->stop = 0; - #ifdef OS_KTHREAD os_timer_thread_start(t); #else + /* clear termination flag */ + atomic_set(&t->stop, 0); + os_timer_add(t); #endif } @@ -500,12 +481,12 @@ { os_timer *t = &global_state.timer; - /* set termination flag */ - t->stop = 1; - #ifdef OS_KTHREAD os_timer_thread_stop(t); #else + /* set termination flag */ + atomic_set(&t->stop, 1); + os_timer_remove(t); #endif } @@ -527,6 +508,47 @@ } #ifdef CONFIG_PROC_FS +#ifdef VMW_USE_SEQ_FILE +static int os_proc_show(struct seq_file *f, + void *data) +{ + os_status *s = &global_state.status; + char *buf = NULL; + int err = -1; + + if (s->handler == NULL) { + err = 0; + goto out; + } + + buf = kmalloc(PAGE_SIZE, GFP_KERNEL); + if (buf == NULL) { + err = -ENOMEM; + goto out; + } + + s->handler(buf); + + if (seq_puts(f, buf) != 0) { + err = -ENOSPC; + goto out; + } + + err = 0; + + out: + kfree(buf); + + return err; +} + +static int os_proc_open(struct inode *inode, + struct file *file) +{ + return single_open(file, os_proc_show, NULL); +} + +#else #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) static int os_proc_read(char *buf, char **start, @@ -550,6 +572,7 @@ /* invoke registered handler */ return(s->handler(buf)); } +#endif /* VMW_USE_SEQ_FILE */ #endif void CDECL @@ -587,7 +610,11 @@ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,0) global_proc_entry = create_proc_entry("vmmemctl", S_IFREG | S_IRUGO, NULL); if (global_proc_entry != NULL) { +#ifdef VMW_USE_SEQ_FILE + global_proc_entry->proc_fops = &global_proc_fops; +#else global_proc_entry->get_info = os_proc_read; +#endif /* VMW_USE_SEQ_FILE */ } #else proc_register(&proc_root, &global_proc_entry); diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmmemctl/vm_assert.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmmemctl/vm_assert.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmmemctl/vm_assert.h 2008-01-28 08:02:47.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmmemctl/vm_assert.h 2008-10-13 08:01:44.000000000 +0100 @@ -98,8 +98,6 @@ * ASSERT() is special cased because of interaction with Windows DDK. */ -#define IMPLIES(a,b) (!(a) || (b)) - #if defined VMX86_DEBUG || defined ASSERT_ALWAYS_AVAILABLE #undef ASSERT #define ASSERT(cond) \ @@ -243,12 +241,21 @@ /* - * Compile-time assertions + * 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). */ #define ASSERT_ON_COMPILE(e) \ do { \ - typedef char AssertOnCompileType[(e) ? 1 : -1]; \ + enum { AssertOnCompileMisused = ((e) ? 1 : -1) }; \ + typedef char AssertOnCompileFailed[AssertOnCompileMisused]; \ } while (0) diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmmemctl/vmballoon.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmmemctl/vmballoon.c --- open-vm-tools-2008.01.23-74039/modules/linux/vmmemctl/vmballoon.c 2008-01-28 08:02:47.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmmemctl/vmballoon.c 2008-10-13 08:01:45.000000000 +0100 @@ -98,6 +98,10 @@ */ #define BALLOON_PAGE_ALLOC_FAILURE (1000) +// Maximum number of page allocations without yielding processor +#define BALLOON_ALLOC_YIELD_THRESHOLD (1024) + + /* * Types */ @@ -1004,7 +1008,7 @@ static int BalloonInflate(Balloon *b, uint32 target) { - int status; + int status, allocations = 0; uint32 i, nAllocNoSleep, nAllocCanSleep; /* @@ -1047,6 +1051,11 @@ b->slowPageAllocationCycles = SLOW_PAGE_ALLOCATION_CYCLES; break; } + + if (++allocations > BALLOON_ALLOC_YIELD_THRESHOLD) { + os_yield(); + allocations = 0; + } } /* @@ -1102,6 +1111,11 @@ Balloon_ErrorPagesFree(b); return(status); } + + if (++allocations > BALLOON_ALLOC_YIELD_THRESHOLD) { + os_yield(); + allocations = 0; + } } /* diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmmemctl/vm_basic_defs.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmmemctl/vm_basic_defs.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmmemctl/vm_basic_defs.h 2008-01-28 08:02:47.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmmemctl/vm_basic_defs.h 2008-10-13 08:01:45.000000000 +0100 @@ -39,6 +39,10 @@ #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 <stddef.h> /* * We re-define offsetof macro from stddef, make @@ -52,7 +56,8 @@ * Simple macros */ -#if defined __APPLE__ && !defined KERNEL +#if (defined __APPLE__ || defined __FreeBSD__) && \ + (!defined KERNEL && !defined _KERNEL && !defined VMKERNEL && !defined __KERNEL__) # include <stddef.h> #else // XXX the __cplusplus one matches that of VC++, to prevent redefinition warning @@ -108,6 +113,7 @@ #define DWORD_ALIGN(x) ((((x)+3) >> 2) << 2) #define QWORD_ALIGN(x) ((((x)+4) >> 3) << 3) +#define IMPLIES(a,b) (!(a) || (b)) /* * Not everybody (e.g., the monitor) has NULL @@ -313,7 +319,22 @@ #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 // { @@ -324,7 +345,7 @@ * guarantee. Bummer. --Jeremy. */ -#if defined(N_PLAT_NLM) || defined(__FreeBSD__) +#if defined(N_PLAT_NLM) /* We do not have YIELD() as we do not need it yet... */ #elif defined(_WIN32) # define YIELD() Sleep(0) @@ -450,12 +471,23 @@ */ #undef DEBUG_ONLY +#undef SL_DEBUG_ONLY +#undef VMX86_SL_DEBUG #ifdef VMX86_DEBUG -#define vmx86_debug 1 -#define DEBUG_ONLY(x) x +#define vmx86_debug 1 +#define DEBUG_ONLY(x) x +/* + * Be very, very, very careful with SL_DEBUG. Pls ask ganesh or min before + * using it. + */ +#define VMX86_SL_DEBUG +#define vmx86_sl_debug 1 +#define SL_DEBUG_ONLY(x) x #else -#define vmx86_debug 0 +#define vmx86_debug 0 #define DEBUG_ONLY(x) +#define vmx86_sl_debug 0 +#define SL_DEBUG_ONLY(x) #endif #ifdef VMX86_STATS @@ -543,18 +575,32 @@ #endif #endif -#ifdef VMX86_VPROBES -#define vmx86_vprobes 1 -#define VPROBES_ONLY(x) x +#ifdef _WIN32 +#define VMW_INVALID_HANDLE INVALID_HANDLE_VALUE +#else +#define VMW_INVALID_HANDLE (-1) +#endif + +#ifdef _WIN32 +#define fsync(fd) _commit(fd) +#define fileno(f) _fileno(f) #else -#define vmx86_vprobes 0 -#define VPROBES_ONLY(x) #endif +/* + * Debug output macros for Windows drivers (the Eng variant is for + * display/printer drivers only. + */ #ifdef _WIN32 -#define VMW_INVALID_HANDLE INVALID_HANDLE_VALUE +#ifndef USES_OLD_WINDDK +#if defined(VMX86_DEBUG) || defined(ASSERT_ALWAYS_AVAILABLE) +#define WinDrvPrint(arg, ...) DbgPrint(arg, __VA_ARGS__) +#define WinDrvEngPrint(arg, ...) EngDbgPrint(arg, __VA_ARGS__) #else -#define VMW_INVALID_HANDLE -1 +#define WinDrvPrint(arg, ...) +#define WinDrvEngPrint(arg, ...) #endif +#endif +#endif // _WIN32 #endif // ifndef _VM_BASIC_DEFS_H_ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmmemctl/vm_basic_types.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmmemctl/vm_basic_types.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmmemctl/vm_basic_types.h 2008-01-28 08:02:47.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmmemctl/vm_basic_types.h 2008-10-13 08:01:45.000000000 +0100 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998-2007 VMware, Inc. All rights reserved. + * Copyright (C) 1998-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 General Public License as published by the @@ -92,10 +92,6 @@ #pragma warning (disable :4305) // truncation from 'const int' to 'short' #pragma warning (disable :4244) // conversion from 'unsigned short' to 'unsigned char' #pragma warning (disable :4267) // truncation of 'size_t' -#if !defined VMX86_DEVEL // XXX until we clean up all the code -- edward -#pragma warning (disable :4133) // incompatible types - from 'struct VM *' to 'int *' -#pragma warning (disable :4047) // differs in levels of indirection -#endif #pragma warning (disable :4146) // unary minus operator applied to unsigned type, result still unsigned #pragma warning (disable :4142) // benign redefinition of type @@ -154,12 +150,16 @@ #include <stdlib.h> #endif +#ifdef __FreeBSD__ +#include <sys/param.h> /* For __FreeBSD_version */ +#endif + #if !defined(USING_AUTOCONF) # if defined(__FreeBSD__) || defined(sun) # ifdef KLD_MODULE # include <sys/types.h> # else -# if (BSD_VERSION >= 50) +# if !defined(VMKERNEL) && (__FreeBSD_version >= 500043) # include <inttypes.h> # include <sys/types.h> # else @@ -254,7 +254,12 @@ || (defined(_POSIX2_VERSION) && _POSIX2_VERSION >= 200112L) /* BSD/Darwin, Linux */ #define FMTSZ "z" - #define FMTPD "t" + + #if defined(VM_X86_64) || defined(__APPLE__) + #define FMTPD "l" + #else + #define FMTPD "" + #endif #else /* Systems with a pre-C99 libc */ #define FMTSZ "Z" @@ -338,8 +343,8 @@ * Type big enough to hold an integer between 0..100 */ typedef uint8 Percent; -#define asPercent(v) ((Percent)(v)) -#define CHOOSE_PERCENT asPercent(-1) +#define AsPercent(v) ((Percent)(v)) +#define CHOOSE_PERCENT AsPercent(101) typedef uintptr_t VA; @@ -371,6 +376,9 @@ typedef User_CartelID User_CartelGroupID; #define INVALID_CARTELGROUP_ID INVALID_CARTEL_ID +typedef uint32 Worldlet_ID; +#define INVALID_WORLDLET_ID ((Worldlet_ID)0) + /* world page number */ typedef uint32 WPN; @@ -381,6 +389,12 @@ #endif /* + * This type should be used for variables that contain sector + * position/quantity. + */ +typedef uint64 SectorType; + +/* * Linear address */ @@ -434,6 +448,7 @@ typedef VA32 UserVA32; typedef VA64 UserVA64; typedef UserVA32 UserVAConst; /* Userspace ptr to data that we may only read. */ +typedef UserVA64 UserVA64Const; /* Used by 64-bit syscalls until conversion is finished. */ #ifdef VMKERNEL typedef UserVA32 UserVA; #else @@ -447,10 +462,10 @@ * for any region other than buserror. */ #define PHYSMEM_MAX_PPN ((PPN)0xffffffff) -#define MAX_PPN ((PPN)0x0fffffff) /* Maximal observable PPN value. */ -#define INVALID_PPN ((PPN)-1) +#define MAX_PPN ((PPN)0x1fffffff) /* Maximal observable PPN value. */ +#define INVALID_PPN ((PPN)0xffffffff) -#define INVALID_BPN ((BPN) 0x3fffffff) /* BPNs don't use the high two bits. */ +#define INVALID_BPN ((BPN) 0x1fffffff) #define INVALID_MPN ((MPN)-1) #define MEMREF_MPN ((MPN)-2) @@ -480,8 +495,9 @@ # define FMTVPN "" #endif - +#ifndef EXTERN #define EXTERN extern +#endif #define CONST const @@ -631,6 +647,12 @@ # define PRINTF_DECL(fmtPos, varPos) #endif +#if defined(__GNUC__) +# define SCANF_DECL(fmtPos, varPos) __attribute__((__format__(__scanf__, fmtPos, varPos))) +#else +# define SCANF_DECL(fmtPos, varPos) +#endif + /* * UNUSED_PARAM should surround the parameter name and type declaration, * e.g. "int MyFunction(int var1, UNUSED_PARAM(int var2))" @@ -677,6 +699,52 @@ #endif /* + *********************************************************************** + * STRUCT_OFFSET_CHECK -- */ /** + * + * \brief Check if the actual offsef of a member in a structure + * is what is expected + * + * + * \param[in] STRUCT Structure the member is a part of. + * \param[in] MEMBER Member to check the offset of. + * \param[in] OFFSET Expected offset of MEMBER in STRUCTURE. + * \param[in] DEBUG_EXTRA Additional bytes to be added to OFFSET to + * compensate for extra info in debug builds. + * + *********************************************************************** + */ +#ifdef VMX86_DEBUG +#define STRUCT_OFFSET_CHECK(STRUCT, MEMBER, OFFSET, DEBUG_EXTRA) \ + ASSERT_ON_COMPILE(vmk_offsetof(STRUCT, MEMBER) == (OFFSET + DEBUG_EXTRA)) +#else +#define STRUCT_OFFSET_CHECK(STRUCT, MEMBER, OFFSET, DEBUG_EXTRA) \ + ASSERT_ON_COMPILE(vmk_offsetof(STRUCT, MEMBER) == OFFSET) +#endif + +/* + *********************************************************************** + * STRUCT_SIZE_CHECK -- */ /** + * + * \brief Check if the actual size of a structure is what is expected + * + * + * \param[in] STRUCT Structure whose size is to be checked. + * \param[in] SIZE Expected size of STRUCT. + * \param[in] DEBUG_EXTRA Additional bytes to be added to SIZE to + * compensate for extra info in debug builds. + * + *********************************************************************** + */ +#ifdef VMX86_DEBUG +#define STRUCT_SIZE_CHECK(STRUCT, SIZE, DEBUG_EXTRA) \ + ASSERT_ON_COMPILE(sizeof(STRUCT) == (SIZE + DEBUG_EXTRA)) +#else +#define STRUCT_SIZE_CHECK(STRUCT, SIZE, DEBUG_EXTRA) \ + ASSERT_ON_COMPILE(sizeof(STRUCT) == SIZE) +#endif + +/* * __func__ is a stringified function name that is part of the C99 standard. The block * below defines __func__ on older systems where the compiler does not support that * macro. @@ -831,4 +899,14 @@ typedef int PollDevHandle; #endif +/* + * Define the utf16_t type. + */ + +#if defined(_WIN32) && defined(_NATIVE_WCHAR_T_DEFINED) +typedef wchar_t utf16_t; +#else +typedef uint16 utf16_t; +#endif + #endif /* _VM_BASIC_TYPES_H_ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmmemctl/vmmemctl_version.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmmemctl/vmmemctl_version.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmmemctl/vmmemctl_version.h 2008-01-28 08:02:47.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmmemctl/vmmemctl_version.h 2008-10-13 08:01:45.000000000 +0100 @@ -25,8 +25,8 @@ #ifndef _VMMEMCTL_VERSION_H_ #define _VMMEMCTL_VERSION_H_ -#define VMMEMCTL_DRIVER_VERSION 1.0.1.0 -#define VMMEMCTL_DRIVER_VERSION_COMMAS 1,0,1,0 -#define VMMEMCTL_DRIVER_VERSION_STRING "1.0.1.0" +#define VMMEMCTL_DRIVER_VERSION 1.2.1.0 +#define VMMEMCTL_DRIVER_VERSION_COMMAS 1,2,1,0 +#define VMMEMCTL_DRIVER_VERSION_STRING "1.2.1.0" #endif /* _VMMEMCTL_VERSION_H_ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmsync/autoconf/cachector1.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmsync/autoconf/cachector1.c --- open-vm-tools-2008.01.23-74039/modules/linux/vmsync/autoconf/cachector1.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmsync/autoconf/cachector1.c 2008-10-13 08:01:47.000000000 +0100 @@ -0,0 +1,38 @@ +/********************************************************* + * Copyright (C) 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 General Public License as published by the + * Free Software Foundation version 2 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 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 + * + *********************************************************/ + +#include <linux/autoconf.h> +#include <linux/version.h> + +/* + * Between 2.6.27-rc1 and 2.6.27-rc2 ctor prototype was changed from + * ctor(cache, ptr) to ctor(ptr). Unfortunately there + * is no typedef for ctor, so we have to redefine kmem_cache_create + * to find out ctor prototype. If prototype matches, then this is old + * kernel. + */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 28) +#error "This test intentionally fails on 2.6.28 and newer kernels." +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26) +#include <linux/slab.h> + +struct kmem_cache *kmem_cache_create(const char *, size_t, size_t, + unsigned long, + void (*)(struct kmem_cache *, void *)); + +#endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmsync/compat_fs.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmsync/compat_fs.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmsync/compat_fs.h 2008-01-28 08:02:49.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmsync/compat_fs.h 2008-10-13 08:01:47.000000000 +0100 @@ -80,8 +80,8 @@ * * The VFS exports do_sync_read() and do_sync_write() as the "new" * generic_file_read() and generic_file_write(), but filesystems need not - * actually implement read and write- the VFS will automatically call - * do_sync_write() and do_sync_read() when applications invoke the standard + * actually implement read and write- the VFS will automatically call + * do_sync_write() and do_sync_read() when applications invoke the standard * read() and write() system calls. * * In 2.6.19, generic_file_read() and generic_file_write() were removed, @@ -104,6 +104,14 @@ /* + * iget() was removed from the VFS as of 2.6.25-rc1. The replacement for iget() + * is iget_locked() which was added in 2.5.17. + */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 17) +# define VMW_USE_IGET_LOCKED +#endif + +/* * parent_ino was born in 2.5.5. For older kernels, let's use 2.5.5 * implementation. It uses the dcache lock which is OK because per-dentry * locking appeared after 2.5.5. diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmsync/compat_namei.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmsync/compat_namei.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmsync/compat_namei.h 2008-01-28 08:02:49.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmsync/compat_namei.h 2008-10-13 08:01:47.000000000 +0100 @@ -23,6 +23,23 @@ #include <linux/namei.h> #endif +/* + * In 2.6.25-rc2, dentry and mount objects were removed from the nameidata + * struct. They were both replaced with a struct path. + */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25) +#define compat_vmw_nd_to_dentry(nd) (nd).path.dentry +#else +#define compat_vmw_nd_to_dentry(nd) (nd).dentry +#endif + +/* In 2.6.25-rc2, path_release(&nd) was replaced with path_put(&nd.path). */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25) +#define compat_path_release(nd) path_put(&(nd)->path) +#else +#define compat_path_release(nd) path_release(nd) +#endif + /* path_lookup was exported in 2.4.25 */ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 25) #define compat_path_lookup(path, flags, nd) path_lookup(path, flags, nd) diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmsync/compat_semaphore.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmsync/compat_semaphore.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmsync/compat_semaphore.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmsync/compat_semaphore.h 2008-10-13 08:01:47.000000000 +0100 @@ -0,0 +1,49 @@ +/********************************************************* + * Copyright (C) 2002 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +#ifndef __COMPAT_SEMAPHORE_H__ +# define __COMPAT_SEMAPHORE_H__ + + +/* <= 2.6.25 have asm only, 2.6.26 has both, and 2.6.27-rc2+ has linux only. */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 27) +# include <asm/semaphore.h> +#else +# include <linux/semaphore.h> +#endif + + +/* +* The init_MUTEX_LOCKED() API appeared in 2.2.18, and is also in +* 2.2.17-21mdk --hpreg +*/ + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 2, 18) + #ifndef init_MUTEX_LOCKED + #define init_MUTEX_LOCKED(_sem) *(_sem) = MUTEX_LOCKED + #endif + #ifndef DECLARE_MUTEX + #define DECLARE_MUTEX(name) struct semaphore name = MUTEX + #endif + #ifndef DECLARE_MUTEX_LOCKED + #define DECLARE_MUTEX_LOCKED(name) struct semaphore name = MUTEX_LOCKED + #endif +#endif + + +#endif /* __COMPAT_SEMAPHORE_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmsync/compat_slab.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmsync/compat_slab.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmsync/compat_slab.h 2008-01-28 08:02:49.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmsync/compat_slab.h 2008-10-13 08:01:47.000000000 +0100 @@ -57,14 +57,29 @@ * Up to 2.6.23 kmem_cache constructor has three arguments - pointer to block to * prepare (aka "this"), from which cache it came, and some unused flags. After * 2.6.23 flags were removed, and order of "this" and cache parameters was swapped... + * Since 2.6.27-rc2 everything is different again, and ctor has only one argument. + * + * HAS_3_ARGS has precedence over HAS_2_ARGS if both are defined. */ #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 23) && !defined(VMW_KMEMCR_CTOR_HAS_3_ARGS) # define VMW_KMEMCR_CTOR_HAS_3_ARGS #endif -#ifdef VMW_KMEMCR_CTOR_HAS_3_ARGS +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26) && !defined(VMW_KMEMCR_CTOR_HAS_2_ARGS) +# define VMW_KMEMCR_CTOR_HAS_2_ARGS +#endif + +#if defined(VMW_KMEMCR_CTOR_HAS_3_ARGS) typedef void compat_kmem_cache_ctor(void *, compat_kmem_cache *, unsigned long); -#else +#define COMPAT_KMEM_CACHE_CTOR_ARGS(arg) void *arg, \ + compat_kmem_cache *cache, \ + unsigned long flags +#elif defined(VMW_KMEMCR_CTOR_HAS_2_ARGS) typedef void compat_kmem_cache_ctor(compat_kmem_cache *, void *); +#define COMPAT_KMEM_CACHE_CTOR_ARGS(arg) compat_kmem_cache *cache, \ + void *arg +#else +typedef void compat_kmem_cache_ctor(void *); +#define COMPAT_KMEM_CACHE_CTOR_ARGS(arg) void *arg #endif #endif /* __COMPAT_SLAB_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmsync/compat_workqueue.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmsync/compat_workqueue.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmsync/compat_workqueue.h 2008-01-28 08:02:49.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmsync/compat_workqueue.h 2008-10-13 08:01:47.000000000 +0100 @@ -20,38 +20,145 @@ # define __COMPAT_WORKQUEUE_H__ #include <linux/kernel.h> -#include <linux/workqueue.h> + +#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 5, 41) +# include <linux/workqueue.h> +#endif /* - * Linux 2.6.20 differentiates normal work structs ("work_struct") from - * delayed work ("delayed_work"). So define a few of the names that don't - * exist in older kernels to use the old work_struct. - * - * Also, in 2.6.20 and beyond, the work_struct itself is passed as an - * argument to the function, and the data is retrieved similar to how - * linked lists work. To properly pass an argument to the callback function, - * the work struct should be declared as part of a struct, and the struct - * retrieved by using the COMPAT_DELAYEDWORK_GETDATA macro (for instances - * of delayed_work). + * + * Work queues and delayed work queues. + * + * Prior to 2.5.41, the notion of work queues did not exist. Taskqueues are + * used for work queues and timers are used for delayed work queues. + * + * After 2.6.20, normal work structs ("work_struct") and delayed work + * ("delayed_work") structs were separated so that the work_struct could be + * slimmed down. The interface was also changed such that the address of the + * work_struct itself is passed in as the argument to the work function. This + * requires that one embed the work struct in the larger struct containing the + * information necessary to complete the work and use container_of() to obtain + * the address of the containing structure. + * + * Users of these macros should embed a compat_work or compat_delayed_work in + * a larger structure, then specify the larger structure as the _data argument + * for the initialization functions, specify the work function to take + * a compat_work_arg or compat_delayed_work_arg, then use the appropriate + * _GET_DATA macro to obtain the reference to the structure passed in as _data. + * An example is below. + * + * + * typedef struct WorkData { + * int data; + * compat_work work; + * } WorkData; + * + * + * void + * WorkFunc(compat_work_arg data) + * { + * WorkData *workData = COMPAT_WORK_GET_DATA(data, WorkData, work); + * + * ... + * } + * + * + * { + * WorkData *workData = kmalloc(sizeof *workData, GFP_EXAMPLE); + * if (!workData) { + * return -ENOMEM; + * } + * + * COMPAT_INIT_WORK(&workData->work, WorkFunc, workData); + * compat_schedule_work(&workData->work); + * } */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) /* { */ - -typedef void compat_workqueue_arg; - -# define delayed_work work_struct -# define INIT_DELAYED_WORK(work, func) INIT_WORK((work), (func), (work)) -# define COMPAT_DELAYEDWORK_GETDATA(data, type, field) container_of(data, type, field) - -#else /* } Linux >= 2.6.20 { */ - -typedef struct work_struct compat_workqueue_arg; - -# define COMPAT_DELAYEDWORK_GETDATA(data, type, field) \ -({ \ - struct delayed_work *__dwork = container_of(data, struct delayed_work, work); \ - container_of(__dwork, type, field); \ -}) +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 41) /* { */ +typedef struct tq_struct compat_work; +typedef struct compat_delayed_work { + struct tq_struct work; + struct timer_list timer; +} compat_delayed_work; +typedef void * compat_work_arg; +typedef void * compat_delayed_work_arg; +/* + * Delayed work queues need to run at some point in the future in process + * context, but task queues don't support delaying the task one is scheduling. + * Timers allow us to delay the execution of our work queue until the future, + * but timer handlers run in bottom-half context. As such, we use both a timer + * and task queue and use the timer handler below to schedule the task in + * process context immediately. The timer lets us delay execution, and the + * task queue lets us run in process context. + * + * Note that this is similar to how delayed_work is implemented with work + * queues in later kernel versions. + */ +static inline void +__compat_delayed_work_timer(unsigned long arg) +{ + compat_delayed_work *dwork = (compat_delayed_work *)arg; + if (dwork) { + schedule_task(&dwork->work); + } +} + +# define COMPAT_INIT_WORK(_work, _func, _data) \ + INIT_LIST_HEAD(&(_work)->list); \ + (_work)->sync = 0; \ + (_work)->routine = _func; \ + (_work)->data = _data +# define COMPAT_INIT_DELAYED_WORK(_work, _func, _data) \ + COMPAT_INIT_WORK(&(_work)->work, _func, _data); \ + init_timer(&(_work)->timer); \ + (_work)->timer.expires = 0; \ + (_work)->timer.function = __compat_delayed_work_timer; \ + (_work)->timer.data = (unsigned long)_work +# define compat_schedule_work(_work) \ + schedule_task(_work) +# define compat_schedule_delayed_work(_work, _delay) \ + (_work)->timer.expires = jiffies + _delay; \ + add_timer(&(_work)->timer) +# define COMPAT_WORK_GET_DATA(_p, _type) \ + (_type *)(_p) +# define COMPAT_DELAYED_WORK_GET_DATA(_p, _type, _member) \ + (_type *)(_p) + +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) /* } { */ +typedef struct work_struct compat_work; +typedef struct work_struct compat_delayed_work; +typedef void * compat_work_arg; +typedef void * compat_delayed_work_arg; +# define COMPAT_INIT_WORK(_work, _func, _data) \ + INIT_WORK(_work, _func, _data) +# define COMPAT_INIT_DELAYED_WORK(_work, _func, _data) \ + INIT_WORK(_work, _func, _data) +# define compat_schedule_work(_work) \ + schedule_work(_work) +# define compat_schedule_delayed_work(_work, _delay) \ + schedule_delayed_work(_work, _delay) +# define COMPAT_WORK_GET_DATA(_p, _type) \ + (_type *)(_p) +# define COMPAT_DELAYED_WORK_GET_DATA(_p, _type, _member) \ + (_type *)(_p) + +#else /* } Linux >= 2.6.20 { */ +typedef struct work_struct compat_work; +typedef struct delayed_work compat_delayed_work; +typedef struct work_struct * compat_work_arg; +typedef struct work_struct * compat_delayed_work_arg; +# define COMPAT_INIT_WORK(_work, _func, _data) \ + INIT_WORK(_work, _func) +# define COMPAT_INIT_DELAYED_WORK(_work, _func, _data) \ + INIT_DELAYED_WORK(_work, _func) +# define compat_schedule_work(_work) \ + schedule_work(_work) +# define compat_schedule_delayed_work(_work, _delay) \ + schedule_delayed_work(_work, _delay) +# define COMPAT_WORK_GET_DATA(_p, _type) \ + container_of(_p, _type, work) +# define COMPAT_DELAYED_WORK_GET_DATA(_p, _type, _member) \ + container_of(_p, _type, _member.work) #endif /* } */ #endif /* __COMPAT_WORKQUEUE_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmsync/Makefile /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmsync/Makefile --- open-vm-tools-2008.01.23-74039/modules/linux/vmsync/Makefile 2008-01-28 08:02:49.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmsync/Makefile 2008-10-13 08:01:47.000000000 +0100 @@ -34,6 +34,7 @@ BUILD_DIR = $(HEADER_DIR)/.. DRIVER := vmsync +PRODUCT := @PRODUCT@ # Grep program GREP = /bin/grep @@ -86,7 +87,7 @@ # $(DRIVER_KO) is a phony target, so compare file times explicitly $(DRIVER): $(DRIVER_KO) - if [ $< -nt $@ ]; then cp -f $< $@; fi + if [ $< -nt $@ ] || [ ! -e $@ ] ; then cp -f $< $@; fi # Pass gcc version down the chain, so we can detect if kernel attempts to use unapproved compiler VM_CCVER := $(VMCCVER) diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmsync/Makefile.kernel /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmsync/Makefile.kernel --- open-vm-tools-2008.01.23-74039/modules/linux/vmsync/Makefile.kernel 2008-01-28 08:02:49.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmsync/Makefile.kernel 2008-10-13 08:01:47.000000000 +0100 @@ -26,12 +26,13 @@ EXTRA_CFLAGS := $(CC_OPTS) $(INCLUDE) EXTRA_CFLAGS += $(call vm_check_build, $(SRCROOT)/autoconf/cachecreate.c, -DVMW_KMEMCR_HAS_DTOR, ) EXTRA_CFLAGS += $(call vm_check_build, $(SRCROOT)/autoconf/cachector.c, -DVMW_KMEMCR_CTOR_HAS_3_ARGS, ) +EXTRA_CFLAGS += $(call vm_check_build, $(SRCROOT)/autoconf/cachector1.c, -DVMW_KMEMCR_CTOR_HAS_2_ARGS, ) obj-m += $(DRIVER).o $(DRIVER)-y := $(subst $(SRCROOT)/, , $(patsubst %.c, %.o, $(wildcard $(SRCROOT)/*.c))) clean: - rm -rf $(wildcard $(DRIVER).mod.c $(DRIVER).ko \ - .tmp_versions Module.symvers Modules.symvers \ + rm -rf $(wildcard $(DRIVER).mod.c $(DRIVER).ko .tmp_versions \ + Module.symvers Modules.symvers Module.markers modules.order \ $(foreach dir,./,$(addprefix $(dir),.*.cmd .*.o.flags *.o))) diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmsync/sync.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmsync/sync.c --- open-vm-tools-2008.01.23-74039/modules/linux/vmsync/sync.c 2008-01-28 08:02:49.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmsync/sync.c 2008-10-13 08:01:47.000000000 +0100 @@ -40,7 +40,6 @@ #include <asm/bug.h> #include <asm/uaccess.h> -#include <asm/semaphore.h> #include <asm/string.h> #include <linux/buffer_head.h> #include <linux/proc_fs.h> @@ -48,6 +47,7 @@ #include "compat_fs.h" #include "compat_module.h" #include "compat_namei.h" +#include "compat_semaphore.h" #include "compat_slab.h" #include "compat_workqueue.h" @@ -106,7 +106,7 @@ typedef struct VmSyncState { struct list_head devices; struct semaphore lock; - struct delayed_work thawTask; + compat_delayed_work thawTask; } VmSyncState; @@ -183,9 +183,10 @@ */ static void -VmSyncThawDevicesCallback(compat_workqueue_arg *data) // IN +VmSyncThawDevicesCallback(compat_delayed_work_arg data) // IN { - VmSyncState *state = COMPAT_DELAYEDWORK_GETDATA(data, VmSyncState, thawTask); + VmSyncState *state = COMPAT_DELAYED_WORK_GET_DATA(data, + VmSyncState, thawTask); VmSyncThawDevices(state); } @@ -222,7 +223,7 @@ if ((result = path_lookup(path, LOOKUP_FOLLOW, &nd)) != 0) { goto exit; } - inode = nd.dentry->d_inode; + inode = compat_vmw_nd_to_dentry(nd)->d_inode; /* * Abort if the inode's superblock isn't backed by a block device, or if @@ -231,7 +232,7 @@ if (inode->i_sb->s_bdev == NULL || inode->i_sb->s_frozen != SB_UNFROZEN) { result = (inode->i_sb->s_bdev == NULL) ? -EINVAL : -EALREADY; - path_release(&nd); + compat_path_release(&nd); goto exit; } @@ -242,7 +243,7 @@ dev = list_entry(cur, VmSyncBlockDevice, list); if (dev->bdev == inode->i_sb->s_bdev) { result = 0; - path_release(&nd); + compat_path_release(&nd); goto exit; } } @@ -253,7 +254,7 @@ dev = kmem_cache_alloc(gBlockDeviceCache, GFP_KERNEL); if (dev == NULL) { result = -ENOMEM; - path_release(&nd); + compat_path_release(&nd); goto exit; } @@ -349,7 +350,7 @@ dev = list_entry(cur, VmSyncBlockDevice, list); if (result == 0) { dev->sb = freeze_bdev(dev->bdev); - path_release(&dev->nd); + compat_path_release(&dev->nd); if (dev->sb != NULL) { atomic_inc(&gFreezeCount); } @@ -364,7 +365,7 @@ up(&gFreezeLock); if (result == 0) { - schedule_delayed_work(&state->thawTask, VMSYNC_THAW_TASK_DELAY); + compat_schedule_delayed_work(&state->thawTask, VMSYNC_THAW_TASK_DELAY); } return result; } @@ -575,18 +576,11 @@ *----------------------------------------------------------------------------- */ -#ifdef VMW_KMEMCR_CTOR_HAS_3_ARGS static void -VmSyncBlockDeviceCtor(void *slabelem, // IN - compat_kmem_cache *cache, // IN - unsigned long flags) // IN -#else -static void -VmSyncBlockDeviceCtor(compat_kmem_cache *cache, // IN - void *slabelem) // IN -#endif +VmSyncBlockDeviceCtor(COMPAT_KMEM_CACHE_CTOR_ARGS(slabelem)) // IN { - VmSyncBlockDevice *dev = (VmSyncBlockDevice *) slabelem; + VmSyncBlockDevice *dev = slabelem; + INIT_LIST_HEAD(&dev->list); dev->bdev = NULL; dev->sb = NULL; @@ -609,20 +603,14 @@ *----------------------------------------------------------------------------- */ -#ifdef VMW_KMEMCR_CTOR_HAS_3_ARGS static void -VmSyncStateCtor(void *slabelem, // IN - compat_kmem_cache *cache, // IN - unsigned long flags) // IN -#else -static void -VmSyncStateCtor(compat_kmem_cache *cache, // IN - void *slabelem) // IN -#endif +VmSyncStateCtor(COMPAT_KMEM_CACHE_CTOR_ARGS(slabelem)) // IN { - VmSyncState *state = (VmSyncState *) slabelem; + VmSyncState *state = slabelem; + INIT_LIST_HEAD(&state->devices); - INIT_DELAYED_WORK(&state->thawTask, VmSyncThawDevicesCallback); + COMPAT_INIT_DELAYED_WORK(&state->thawTask, + VmSyncThawDevicesCallback, &state); init_MUTEX(&state->lock); } @@ -675,9 +663,9 @@ } /* Create /proc/driver/vmware-sync */ - controlProcEntry = create_proc_entry("vmware-sync", + controlProcEntry = create_proc_entry("driver/vmware-sync", S_IFREG | S_IRUSR | S_IRGRP | S_IROTH, - proc_root_driver); + NULL); if (!controlProcEntry) { printk(KERN_ERR "vmsync: could not create /proc/driver/vmware-sync\n"); kmem_cache_destroy(gSyncStateCache); @@ -709,7 +697,7 @@ void cleanup_module(void) { - remove_proc_entry("vmware-sync", proc_root_driver); + remove_proc_entry("driver/vmware-sync", NULL); kmem_cache_destroy(gSyncStateCache); kmem_cache_destroy(gBlockDeviceCache); } diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmsync/vmsync_version.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmsync/vmsync_version.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmsync/vmsync_version.h 2008-01-28 08:02:49.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmsync/vmsync_version.h 2008-10-13 08:01:47.000000000 +0100 @@ -25,8 +25,8 @@ #ifndef _VMSYNC_VERSION_H_ #define _VMSYNC_VERSION_H_ -#define VMSYNC_DRIVER_VERSION 1.0.0.1 -#define VMSYNC_DRIVER_VERSION_COMMAS 1,0,0,1 -#define VMSYNC_DRIVER_VERSION_STRING "1.0.0.1" +#define VMSYNC_DRIVER_VERSION 1.1.0.1 +#define VMSYNC_DRIVER_VERSION_COMMAS 1,1,0,1 +#define VMSYNC_DRIVER_VERSION_STRING "1.1.0.1" #endif /* _VMSYNC_VERSION_H_ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmxnet/bpf_meta.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet/bpf_meta.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmxnet/bpf_meta.h 2008-01-28 08:02:48.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet/bpf_meta.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,59 +0,0 @@ -/********************************************************* - * Copyright (C) 2007 VMware, Inc. All rights reserved. - * - * 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 version 2 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 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 - * - *********************************************************/ - -#ifndef _BPF_META_H_ -#define _BPF_META_H_ - -/* This file is to be shared between vmxnet and afpacket */ - -/* The Control byte flags of bpf_meta_data */ - -#define VMXNET_BPF_PROCESSED 0x01 - -/* The following is the definition for dev feature bpf in linux */ - -#ifndef NETIF_F_BPF -#define NETIF_F_BPF (1<<31) /* BPF Capable Virtual Nic */ -#endif /* NETIF_F_BPF */ - - -/* TODO: These three definitions are picked up from vmkernel/public/net_pkt.h. - * Reorg the code and take this from a common place - */ - -#define MAX_BPF_FILTERS 8 /* Maximum number of Filters supported */ -typedef unsigned int BpfSnapLen; -typedef unsigned int BpfSnapLens[MAX_BPF_FILTERS]; - -/* - * skb->cb[40] maps to this structure. The bpf Trailer in vmxnet is stashed to - * this structure in skb. - * - */ - -struct BPF_MetaData { - - BpfSnapLens bpfSnapLens; /* 4 * 8 = 32 bytes of SnapLens as recved from VMK*/ - - unsigned char unused[7]; /* 7 bytes unused */ - - unsigned char controlByte; /* 1 used as controlbyte. For now indicates - whether VMK processed BPF or not*/ -}; - -#endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmxnet/compat_interrupt.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet/compat_interrupt.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmxnet/compat_interrupt.h 2008-01-28 08:02:48.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet/compat_interrupt.h 2008-10-13 08:01:45.000000000 +0100 @@ -46,5 +46,10 @@ #define COMPAT_IRQF_SHARED IRQF_SHARED #endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) +#define COMPAT_IRQ_HANDLER_ARGS(irq, devp) (int irq, void *devp, struct pt_regs *regs) +#else +#define COMPAT_IRQ_HANDLER_ARGS(irq, devp) (int irq, void *devp) +#endif #endif /* __COMPAT_INTERRUPT_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmxnet/compat_ioport.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet/compat_ioport.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmxnet/compat_ioport.h 2008-01-28 08:02:48.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet/compat_ioport.h 2008-10-13 08:01:46.000000000 +0100 @@ -36,5 +36,28 @@ #define compat_request_region(start, len, name) request_region(start, len, name) #endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 3, 7) +/* mmap io support starts from 2.3.7, fail the call for kernel prior to that */ +static inline void * +compat_request_mem_region(unsigned long start, unsigned long len, const char *name) +{ + return NULL; +} + +static inline void +compat_release_mem_region(unsigned long start, unsigned long len) +{ + return; +} +#else +#define compat_request_mem_region(start, len, name) request_mem_region(start, len, name) +#define compat_release_mem_region(start, len) release_mem_region(start, len) +#endif + +/* these two macro defs are needed by compat_pci_request_region */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 3, 15) +# define IORESOURCE_IO 0x00000100 +# define IORESOURCE_MEM 0x00000200 +#endif #endif /* __COMPAT_IOPORT_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmxnet/compat_netdevice.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet/compat_netdevice.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmxnet/compat_netdevice.h 2008-01-28 08:02:48.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet/compat_netdevice.h 2008-10-13 08:01:46.000000000 +0100 @@ -20,6 +20,8 @@ # define __COMPAT_NETDEVICE_H__ +#include <linux/skbuff.h> +#include <linux/rtnetlink.h> #include <linux/netdevice.h> #include <linux/etherdevice.h> @@ -169,5 +171,117 @@ # define compat_free_netdev(dev) free_netdev(dev) #endif +/* netdev_priv() appeared in 2.6.3 */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 3) +# define compat_netdev_priv(netdev) (netdev)->priv +#else +# define compat_netdev_priv(netdev) netdev_priv(netdev) +#endif + +#if defined(NETDEV_TX_OK) +# define COMPAT_NETDEV_TX_OK NETDEV_TX_OK +# define COMPAT_NETDEV_TX_BUSY NETDEV_TX_BUSY +#else +# define COMPAT_NETDEV_TX_OK 0 +# define COMPAT_NETDEV_TX_BUSY 1 +#endif + +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,43)) +static inline void +compat_netif_start_queue(struct device *dev) +{ + clear_bit(0, &dev->tbusy); +} + +static inline void +compat_netif_stop_queue(struct device *dev) +{ + set_bit(0, &dev->tbusy); +} + +static inline int +compat_netif_queue_stopped(struct device *dev) +{ + return test_bit(0, &dev->tbusy); +} + +static inline void +compat_netif_wake_queue(struct device *dev) +{ + clear_bit(0, &dev->tbusy); + mark_bh(NET_BH); +} + +static inline int +compat_netif_running(struct device *dev) +{ + return dev->start == 0; +} + +static inline int +compat_netif_carrier_ok(struct device *dev) +{ + return 1; +} + +static inline void +compat_netif_carrier_on(struct device *dev) +{ +} + +static inline void +compat_netif_carrier_off(struct device *dev) +{ +} + +#else +#define compat_netif_start_queue(dev) netif_start_queue(dev) +#define compat_netif_stop_queue(dev) netif_stop_queue(dev) +#define compat_netif_queue_stopped(dev) netif_queue_stopped(dev) +#define compat_netif_wake_queue(dev) netif_wake_queue(dev) +#define compat_netif_running(dev) netif_running(dev) +#define compat_netif_carrier_ok(dev) netif_carrier_ok(dev) +#define compat_netif_carrier_on(dev) netif_carrier_on(dev) +#define compat_netif_carrier_off(dev) netif_carrier_off(dev) +#endif + +/* unregister_netdevice_notifier was not safe prior to 2.6.17 */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 17) && \ + !defined(ATOMIC_NOTIFIER_INIT) +/* pre 2.6.17 and not patched */ +static inline int compat_unregister_netdevice_notifier(struct notifier_block *nb) { + int err; + + rtnl_lock(); + err = unregister_netdevice_notifier(nb); + rtnl_unlock(); + return err; +} +#else +/* post 2.6.17 or patched */ +#define compat_unregister_netdevice_notifier(_nb) \ + unregister_netdevice_notifier(_nb); +#endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24) +#define compat_netif_napi_add(dev, napi, poll, quota) \ + netif_napi_add(dev, napi, poll, quota) +#define compat_netif_rx_schedule(dev, napi) netif_rx_schedule(dev, napi) +#define compat_napi_enable(dev, napi) napi_enable(napi) +#define compat_napi_disable(dev, napi) napi_disable(napi) +#else +struct napi_struct { + int dummy; +}; + +#define compat_netif_napi_add(dev, napi, pollcb, quota) \ + do { \ + (dev)->poll = (pollcb); \ + (dev)->weight = (quota);\ + } while (0) +#define compat_netif_rx_schedule(dev, napi) netif_rx_schedule(dev) +#define compat_napi_enable(dev, napi) netif_poll_enable(dev) +#define compat_napi_disable(dev, napi) netif_poll_disable(dev) +#endif #endif /* __COMPAT_NETDEVICE_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmxnet/compat_pci.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet/compat_pci.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmxnet/compat_pci.h 2008-01-28 08:02:48.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet/compat_pci.h 2008-10-13 08:01:46.000000000 +0100 @@ -23,6 +23,7 @@ #ifndef __COMPAT_PCI_H__ #define __COMPAT_PCI_H__ +#include "compat_ioport.h" #include <linux/pci.h> #ifndef KERNEL_2_1 # include <linux/bios32.h> @@ -155,6 +156,38 @@ pci_resource_start(dev, index) #endif +/* since 2.3.15, a new set of s/w res flags IORESOURCE_ is introduced, + * we fake them by returning either IORESOURCE_{IO, MEM} prior to 2.3.15 since + * this is what compat_pci_request_region uses + */ +#ifndef KERNEL_2_1 +static inline unsigned long +compat_pci_resource_flags(struct pci_dev *pdev, + unsigned int index) +{ + u32 addr; + + if (pci_read_config_dword(pdev, PCI_BASE_ADDRESS_0 + index * 4, &addr)) { + printk(KERN_ERR "Unable to read base address %u from PCI slot %s!\n", + index, compat_pci_name(pdev)); + return ~0UL; + } + if (addr & PCI_BASE_ADDRESS_SPACE) { + return IORESOURCE_IO; + } else { + return IORESOURCE_MEM; + } +} +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 3, 1) +# define compat_pci_resource_flags(dev, index) \ + (((dev)->base_address[index] & PCI_BASE_ADDRESS_SPACE) \ + ? IORESOURCE_IO: IORESOURCE_MEM) +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 3, 15) + /* IORESOURCE_xxx appeared in 2.3.15 and is set in resource[].flags */ +# define compat_pci_resource_flags(dev, index) ((dev)->resource[index].flags) +#else +# define compat_pci_resource_flags(dev, index) pci_resource_flags(dev, index) +#endif #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 2, 18) static inline unsigned long @@ -185,6 +218,83 @@ #define compat_pci_resource_len(dev, index) pci_resource_len(dev, index) #endif +/* pci_request_region appears in 2.4.20 */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 20) +static inline int +compat_pci_request_region(struct pci_dev *pdev, int bar, char *name) +{ + if (compat_pci_resource_len(pdev, bar) == 0) { + return 0; + } + + if (compat_pci_resource_flags(pdev, bar) & IORESOURCE_IO) { + if (!compat_request_region(compat_pci_resource_start(pdev, bar), + compat_pci_resource_len(pdev, bar), + name)) { + return -EBUSY; + } + } else if (compat_pci_resource_flags(pdev, bar) & IORESOURCE_MEM) { + if (!compat_request_mem_region(compat_pci_resource_start(pdev, bar), + compat_pci_resource_len(pdev, bar), + name)) { + return -EBUSY; + } + } + + return 0; +} + +static inline void +compat_pci_release_region(struct pci_dev *pdev, int bar) +{ + if (compat_pci_resource_len(pdev, bar) != 0) { + if (compat_pci_resource_flags(pdev, bar) & IORESOURCE_IO) { + release_region(compat_pci_resource_start(pdev, bar), + compat_pci_resource_len(pdev, bar)); + } else if (compat_pci_resource_flags(pdev, bar) & IORESOURCE_MEM) { + compat_release_mem_region(compat_pci_resource_start(pdev, bar), + compat_pci_resource_len(pdev, bar)); + } + } +} +#else +#define compat_pci_request_region(pdev, bar, name) pci_request_region(pdev, bar, name) +#define compat_pci_release_region(pdev, bar) pci_release_region(pdev, bar) +#endif + +/* pci_request_regions appeears in 2.4.3 */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 3) +static inline int +compat_pci_request_regions(struct pci_dev *pdev, char *name) +{ + int i; + + for (i = 0; i < 6; i++) { + if (compat_pci_request_region(pdev, i, name)) { + goto release; + } + } + return 0; + +release: + while (--i >= 0) { + compat_pci_release_region(pdev, i); + } + return -EBUSY; +} +static inline void +compat_pci_release_regions(struct pci_dev *pdev) +{ + int i; + + for (i = 0; i < 6; i++) { + compat_pci_release_region(pdev, i); + } +} +#else +#define compat_pci_request_regions(pdev, name) pci_request_regions(pdev, name) +#define compat_pci_release_regions(pdev) pci_release_regions(pdev) +#endif /* pci_enable_device is available since 2.4.0 */ #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 0) @@ -438,4 +548,43 @@ } #endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,48) +# define PCI_DMA_BIDIRECTIONAL 0 +# define PCI_DMA_TODEVICE 1 +# define PCI_DMA_FROMDEVICE 2 +# define PCI_DMA_NONE 3 +#endif + +/* + * Power Management related compat wrappers. + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 10) +# define compat_pci_save_state(pdev) pci_save_state((pdev), NULL) +# define compat_pci_restore_state(pdev) pci_restore_state((pdev), NULL) +#else +# define compat_pci_save_state(pdev) pci_save_state((pdev)) +# define compat_pci_restore_state(pdev) pci_restore_state((pdev)) +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 11) +# define pm_message_t u32 +# define compat_pci_choose_state(pdev, state) (state) +# define PCI_D0 0 +# define PCI_D3hot 3 +#else +# define compat_pci_choose_state(pdev, state) pci_choose_state((pdev), (state)) +#endif + +/* 2.6.14 changed the PCI shutdown callback */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14) +# define COMPAT_PCI_SHUTDOWN(func) .driver = { .shutdown = (func), } +# define COMPAT_PCI_DECLARE_SHUTDOWN(func, var) (func)(struct device *(var)) +# define COMPAT_PCI_TO_DEV(dev) (to_pci_dev(dev)) +#else +# define COMPAT_PCI_SHUTDOWN(func) .shutdown = (func) +# define COMPAT_PCI_DECLARE_SHUTDOWN(func, var) (func)(struct pci_dev *(var)) +# define COMPAT_PCI_TO_DEV(dev) (dev) +#endif + + #endif /* __COMPAT_PCI_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmxnet/compat_skbuff.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet/compat_skbuff.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmxnet/compat_skbuff.h 2008-01-28 08:02:48.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet/compat_skbuff.h 2008-10-13 08:01:46.000000000 +0100 @@ -62,8 +62,14 @@ # if LINUX_VERSION_CODE == KERNEL_VERSION(2, 6, 0) # define compat_skb_linearize(skb) __skb_linearize((skb), GFP_ATOMIC) -# else +# elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 4) # define compat_skb_linearize(skb) skb_linearize((skb), GFP_ATOMIC) +# else +static inline int +compat_skb_linearize(struct sk_buff *skb) +{ + return 0; +} # endif #endif @@ -86,4 +92,65 @@ #define compat_skb_csum_start(skb) compat_skb_transport_offset(skb) #endif +#if defined(NETIF_F_GSO) /* 2.6.18 and upwards */ +#define compat_skb_mss(skb) (skb_shinfo(skb)->gso_size) +#else +#define compat_skb_mss(skb) (skb_shinfo(skb)->tso_size) +#endif + +/* used by both received pkts and outgoing ones */ +#define VM_CHECKSUM_UNNECESSARY CHECKSUM_UNNECESSARY + +/* csum status of received pkts */ +#if defined(CHECKSUM_COMPLETE) +# define VM_RX_CHECKSUM_PARTIAL CHECKSUM_COMPLETE +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19) && defined(CHECKSUM_HW) +# define VM_RX_CHECKSUM_PARTIAL CHECKSUM_HW +#else +# define VM_RX_CHECKSUM_PARTIAL CHECKSUM_PARTIAL +#endif + +/* csum status of outgoing pkts */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19) && defined(CHECKSUM_HW) +# define VM_TX_CHECKSUM_PARTIAL CHECKSUM_HW +#else +# define VM_TX_CHECKSUM_PARTIAL CHECKSUM_PARTIAL +#endif + +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,1,0)) +# define compat_kfree_skb(skb, type) kfree_skb(skb, type) +# define compat_dev_kfree_skb(skb, type) dev_kfree_skb(skb, type) +# define compat_dev_kfree_skb_any(skb, type) dev_kfree_skb(skb, type) +# define compat_dev_kfree_skb_irq(skb, type) dev_kfree_skb(skb, type) +#else +# define compat_kfree_skb(skb, type) kfree_skb(skb) +# define compat_dev_kfree_skb(skb, type) dev_kfree_skb(skb) +# if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,43)) +# define compat_dev_kfree_skb_any(skb, type) dev_kfree_skb(skb) +# define compat_dev_kfree_skb_irq(skb, type) dev_kfree_skb(skb) +# else +# define compat_dev_kfree_skb_any(skb, type) dev_kfree_skb_any(skb) +# define compat_dev_kfree_skb_irq(skb, type) dev_kfree_skb_irq(skb) +# endif +#endif + +#ifndef NET_IP_ALIGN +# define COMPAT_NET_IP_ALIGN 2 +#else +# define COMPAT_NET_IP_ALIGN NET_IP_ALIGN +#endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 4) +# define compat_skb_headlen(skb) skb_headlen(skb) +# define compat_pskb_may_pull(skb, len) pskb_may_pull(skb, len) +#else +# define compat_skb_headlen(skb) (skb)->len +# define compat_pskb_may_pull(skb, len) 1 +#endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 12) +# define compat_skb_header_cloned(skb) skb_header_cloned(skb) +#else +# define compat_skb_header_cloned(skb) 0 +#endif #endif /* __COMPAT_SKBUFF_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmxnet/compat_slab.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet/compat_slab.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmxnet/compat_slab.h 2008-01-28 08:02:48.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet/compat_slab.h 2008-10-13 08:01:46.000000000 +0100 @@ -57,14 +57,29 @@ * Up to 2.6.23 kmem_cache constructor has three arguments - pointer to block to * prepare (aka "this"), from which cache it came, and some unused flags. After * 2.6.23 flags were removed, and order of "this" and cache parameters was swapped... + * Since 2.6.27-rc2 everything is different again, and ctor has only one argument. + * + * HAS_3_ARGS has precedence over HAS_2_ARGS if both are defined. */ #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 23) && !defined(VMW_KMEMCR_CTOR_HAS_3_ARGS) # define VMW_KMEMCR_CTOR_HAS_3_ARGS #endif -#ifdef VMW_KMEMCR_CTOR_HAS_3_ARGS +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26) && !defined(VMW_KMEMCR_CTOR_HAS_2_ARGS) +# define VMW_KMEMCR_CTOR_HAS_2_ARGS +#endif + +#if defined(VMW_KMEMCR_CTOR_HAS_3_ARGS) typedef void compat_kmem_cache_ctor(void *, compat_kmem_cache *, unsigned long); -#else +#define COMPAT_KMEM_CACHE_CTOR_ARGS(arg) void *arg, \ + compat_kmem_cache *cache, \ + unsigned long flags +#elif defined(VMW_KMEMCR_CTOR_HAS_2_ARGS) typedef void compat_kmem_cache_ctor(compat_kmem_cache *, void *); +#define COMPAT_KMEM_CACHE_CTOR_ARGS(arg) compat_kmem_cache *cache, \ + void *arg +#else +typedef void compat_kmem_cache_ctor(void *); +#define COMPAT_KMEM_CACHE_CTOR_ARGS(arg) void *arg #endif #endif /* __COMPAT_SLAB_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmxnet/compat_timer.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet/compat_timer.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmxnet/compat_timer.h 2008-01-28 08:02:48.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet/compat_timer.h 2008-10-13 08:01:46.000000000 +0100 @@ -56,6 +56,7 @@ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 9) # include <linux/delay.h> # define compat_msleep_interruptible(msecs) msleep_interruptible(msecs) +# define compat_msleep(msecs) msleep(msecs) #else # include <linux/sched.h> /* @@ -79,6 +80,13 @@ set_current_state(TASK_INTERRUPTIBLE); schedule_timeout(msecs_to_jiffies(msecs) + 1); } + +static inline void +compat_msleep(unsigned long msecs) // IN +{ + set_current_state(TASK_UNINTERRUPTIBLE); + schedule_timeout(msecs_to_jiffies(msecs) + 1); +} #endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmxnet/Makefile /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet/Makefile --- open-vm-tools-2008.01.23-74039/modules/linux/vmxnet/Makefile 2008-01-28 08:02:48.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet/Makefile 2008-10-13 08:01:46.000000000 +0100 @@ -34,6 +34,7 @@ BUILD_DIR = $(HEADER_DIR)/.. DRIVER := vmxnet +PRODUCT := @PRODUCT@ # Grep program GREP = /bin/grep @@ -86,7 +87,7 @@ # $(DRIVER_KO) is a phony target, so compare file times explicitly $(DRIVER): $(DRIVER_KO) - if [ $< -nt $@ ]; then cp -f $< $@; fi + if [ $< -nt $@ ] || [ ! -e $@ ] ; then cp -f $< $@; fi # Pass gcc version down the chain, so we can detect if kernel attempts to use unapproved compiler VM_CCVER := $(VMCCVER) diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmxnet/Makefile.kernel /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet/Makefile.kernel --- open-vm-tools-2008.01.23-74039/modules/linux/vmxnet/Makefile.kernel 2008-01-28 08:02:48.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet/Makefile.kernel 2008-10-13 08:01:46.000000000 +0100 @@ -30,6 +30,6 @@ obj-m += $(DRIVER).o clean: - rm -rf $(wildcard $(DRIVER).mod.c $(DRIVER).ko \ - .tmp_versions Module.symvers Modules.symvers \ + rm -rf $(wildcard $(DRIVER).mod.c $(DRIVER).ko .tmp_versions \ + Module.symvers Modules.symvers Module.markers modules.order \ $(foreach dir,./,$(addprefix $(dir),.*.cmd .*.o.flags *.o))) diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmxnet/net.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet/net.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmxnet/net.h 2008-01-28 08:02:48.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet/net.h 2008-10-13 08:01:45.000000000 +0100 @@ -49,27 +49,88 @@ #define ETHER_MAX_QUEUED_PACKET 1600 -/* - * State's that a NIC can be in currently we only use this +/* + * State's that a NIC can be in currently we only use this * in VLance but if we implement/emulate new adapters that - * we also want to be able to morph a new corresponding + * we also want to be able to morph a new corresponding * state should be added. */ #define LANCE_CHIP 0x2934 #define VMXNET_CHIP 0x4392 -/* +/* * Size of reserved IO space needed by the LANCE adapter and * the VMXNET adapter. If you add more ports to Vmxnet than * there is reserved space you must bump VMXNET_CHIP_IO_RESV_SIZE. * The sizes must be powers of 2. */ -#define LANCE_CHIP_IO_RESV_SIZE 0x20 +#define LANCE_CHIP_IO_RESV_SIZE 0x20 #define VMXNET_CHIP_IO_RESV_SIZE 0x40 #define MORPH_PORT_SIZE 4 -#endif // VMWARE_DEVICES_NET_H +#ifdef USERLEVEL + +/* + *---------------------------------------------------------------------------- + * + * Net_AddAddrToLADRF -- + * + * Given a MAC address, sets the corresponding bit in the LANCE style + * Logical Address Filter 'ladrf'. + * The caller should have initialized the ladrf to all 0's, as this + * function only ORs on a bit in the array. + * 'addr' is presumed to be ETHER_ADDR_LEN in size; + * 'ladrf' is presumed to point to a 64-bit vector. + * + * Derived from a long history of derivations, originally inspired by + * sample code from the AMD "Network Products: Ethernet Controllers 1998 + * Data Book, Book 2", pages 1-53..1-55. + * + * Returns: + * None. + * + * Side effects: + * Updates 'ladrf'. + * + *---------------------------------------------------------------------------- + */ + +static INLINE void +Net_AddAddrToLadrf(const uint8 *addr, // IN: pointer to MAC address + uint8 *ladrf) // IN/OUT: pointer to ladrf +{ +#define CRC_POLYNOMIAL_BE 0x04c11db7UL /* Ethernet CRC, big endian */ + + uint16 hashcode; + int32 crc = 0xffffffff; /* init CRC for each address */ + int32 j; + int32 bit; + int32 byte; + + ASSERT(addr); + ASSERT(ladrf); + + for (byte = 0; byte < ETHER_ADDR_LEN; byte++) { /* for each address byte */ + /* process each address bit */ + for (bit = *addr++, j = 0; + j < 8; + j++, bit >>= 1) { + crc = (crc << 1) ^ ((((crc < 0 ? 1 : 0) ^ bit) & 0x01) ? + CRC_POLYNOMIAL_BE : 0); + } + } + hashcode = (crc & 1); /* hashcode is 6 LSb of CRC ... */ + for (j = 0; j < 5; j++) { /* ... in reverse order. */ + hashcode = (hashcode << 1) | ((crc>>=1) & 1); + } + + ladrf[hashcode >> 3] |= 1 << (hashcode & 0x07); +} + +#endif // USERLEVEL + +#endif // VMWARE_DEVICES_NET_H diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmxnet/vm_basic_types.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet/vm_basic_types.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmxnet/vm_basic_types.h 2008-01-28 08:02:48.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet/vm_basic_types.h 2008-10-13 08:01:45.000000000 +0100 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 1998-2007 VMware, Inc. All rights reserved. + * Copyright (C) 1998-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 General Public License as published by the @@ -92,10 +92,6 @@ #pragma warning (disable :4305) // truncation from 'const int' to 'short' #pragma warning (disable :4244) // conversion from 'unsigned short' to 'unsigned char' #pragma warning (disable :4267) // truncation of 'size_t' -#if !defined VMX86_DEVEL // XXX until we clean up all the code -- edward -#pragma warning (disable :4133) // incompatible types - from 'struct VM *' to 'int *' -#pragma warning (disable :4047) // differs in levels of indirection -#endif #pragma warning (disable :4146) // unary minus operator applied to unsigned type, result still unsigned #pragma warning (disable :4142) // benign redefinition of type @@ -154,12 +150,16 @@ #include <stdlib.h> #endif +#ifdef __FreeBSD__ +#include <sys/param.h> /* For __FreeBSD_version */ +#endif + #if !defined(USING_AUTOCONF) # if defined(__FreeBSD__) || defined(sun) # ifdef KLD_MODULE # include <sys/types.h> # else -# if (BSD_VERSION >= 50) +# if !defined(VMKERNEL) && (__FreeBSD_version >= 500043) # include <inttypes.h> # include <sys/types.h> # else @@ -254,7 +254,12 @@ || (defined(_POSIX2_VERSION) && _POSIX2_VERSION >= 200112L) /* BSD/Darwin, Linux */ #define FMTSZ "z" - #define FMTPD "t" + + #if defined(VM_X86_64) || defined(__APPLE__) + #define FMTPD "l" + #else + #define FMTPD "" + #endif #else /* Systems with a pre-C99 libc */ #define FMTSZ "Z" @@ -338,8 +343,8 @@ * Type big enough to hold an integer between 0..100 */ typedef uint8 Percent; -#define asPercent(v) ((Percent)(v)) -#define CHOOSE_PERCENT asPercent(-1) +#define AsPercent(v) ((Percent)(v)) +#define CHOOSE_PERCENT AsPercent(101) typedef uintptr_t VA; @@ -371,6 +376,9 @@ typedef User_CartelID User_CartelGroupID; #define INVALID_CARTELGROUP_ID INVALID_CARTEL_ID +typedef uint32 Worldlet_ID; +#define INVALID_WORLDLET_ID ((Worldlet_ID)0) + /* world page number */ typedef uint32 WPN; @@ -381,6 +389,12 @@ #endif /* + * This type should be used for variables that contain sector + * position/quantity. + */ +typedef uint64 SectorType; + +/* * Linear address */ @@ -434,6 +448,7 @@ typedef VA32 UserVA32; typedef VA64 UserVA64; typedef UserVA32 UserVAConst; /* Userspace ptr to data that we may only read. */ +typedef UserVA64 UserVA64Const; /* Used by 64-bit syscalls until conversion is finished. */ #ifdef VMKERNEL typedef UserVA32 UserVA; #else @@ -447,10 +462,10 @@ * for any region other than buserror. */ #define PHYSMEM_MAX_PPN ((PPN)0xffffffff) -#define MAX_PPN ((PPN)0x0fffffff) /* Maximal observable PPN value. */ -#define INVALID_PPN ((PPN)-1) +#define MAX_PPN ((PPN)0x1fffffff) /* Maximal observable PPN value. */ +#define INVALID_PPN ((PPN)0xffffffff) -#define INVALID_BPN ((BPN) 0x3fffffff) /* BPNs don't use the high two bits. */ +#define INVALID_BPN ((BPN) 0x1fffffff) #define INVALID_MPN ((MPN)-1) #define MEMREF_MPN ((MPN)-2) @@ -480,8 +495,9 @@ # define FMTVPN "" #endif - +#ifndef EXTERN #define EXTERN extern +#endif #define CONST const @@ -631,6 +647,12 @@ # define PRINTF_DECL(fmtPos, varPos) #endif +#if defined(__GNUC__) +# define SCANF_DECL(fmtPos, varPos) __attribute__((__format__(__scanf__, fmtPos, varPos))) +#else +# define SCANF_DECL(fmtPos, varPos) +#endif + /* * UNUSED_PARAM should surround the parameter name and type declaration, * e.g. "int MyFunction(int var1, UNUSED_PARAM(int var2))" @@ -677,6 +699,52 @@ #endif /* + *********************************************************************** + * STRUCT_OFFSET_CHECK -- */ /** + * + * \brief Check if the actual offsef of a member in a structure + * is what is expected + * + * + * \param[in] STRUCT Structure the member is a part of. + * \param[in] MEMBER Member to check the offset of. + * \param[in] OFFSET Expected offset of MEMBER in STRUCTURE. + * \param[in] DEBUG_EXTRA Additional bytes to be added to OFFSET to + * compensate for extra info in debug builds. + * + *********************************************************************** + */ +#ifdef VMX86_DEBUG +#define STRUCT_OFFSET_CHECK(STRUCT, MEMBER, OFFSET, DEBUG_EXTRA) \ + ASSERT_ON_COMPILE(vmk_offsetof(STRUCT, MEMBER) == (OFFSET + DEBUG_EXTRA)) +#else +#define STRUCT_OFFSET_CHECK(STRUCT, MEMBER, OFFSET, DEBUG_EXTRA) \ + ASSERT_ON_COMPILE(vmk_offsetof(STRUCT, MEMBER) == OFFSET) +#endif + +/* + *********************************************************************** + * STRUCT_SIZE_CHECK -- */ /** + * + * \brief Check if the actual size of a structure is what is expected + * + * + * \param[in] STRUCT Structure whose size is to be checked. + * \param[in] SIZE Expected size of STRUCT. + * \param[in] DEBUG_EXTRA Additional bytes to be added to SIZE to + * compensate for extra info in debug builds. + * + *********************************************************************** + */ +#ifdef VMX86_DEBUG +#define STRUCT_SIZE_CHECK(STRUCT, SIZE, DEBUG_EXTRA) \ + ASSERT_ON_COMPILE(sizeof(STRUCT) == (SIZE + DEBUG_EXTRA)) +#else +#define STRUCT_SIZE_CHECK(STRUCT, SIZE, DEBUG_EXTRA) \ + ASSERT_ON_COMPILE(sizeof(STRUCT) == SIZE) +#endif + +/* * __func__ is a stringified function name that is part of the C99 standard. The block * below defines __func__ on older systems where the compiler does not support that * macro. @@ -831,4 +899,14 @@ typedef int PollDevHandle; #endif +/* + * Define the utf16_t type. + */ + +#if defined(_WIN32) && defined(_NATIVE_WCHAR_T_DEFINED) +typedef wchar_t utf16_t; +#else +typedef uint16 utf16_t; +#endif + #endif /* _VM_BASIC_TYPES_H_ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmxnet/vm_device_version.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet/vm_device_version.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmxnet/vm_device_version.h 2008-01-28 08:02:48.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet/vm_device_version.h 2008-10-13 08:01:45.000000000 +0100 @@ -53,6 +53,7 @@ #define PCI_DEVICE_ID_VMWARE_BRIDGE 0x0790 #define PCI_DEVICE_ID_VMWARE_ROOTPORT 0x07A0 #define PCI_DEVICE_ID_VMWARE_VMXNET3 0x07B0 +#define PCI_DEVICE_ID_VMWARE_PVSCSI 0x07C0 /* The hypervisor device might grow. Please leave room * for 7 more subfunctions. @@ -84,6 +85,7 @@ * Intel 82443BX (440 BX North Bridge and AGP Bridge) * Intel 82545EM (e1000, server adapter, single port) * Intel 82546EB (e1000, server adapter, dual port) + * Intel ICH7_16 (Hight Definition Audio controller) */ #define PCI_VENDOR_ID_INTEL 0x8086 #define PCI_DEVICE_ID_INTEL_82439TX 0x7100 @@ -96,6 +98,7 @@ #define PCI_DEVICE_ID_INTEL_82443BX_2 0x7192 /* Used when no AGP support */ #define PCI_DEVICE_ID_INTEL_82545EM 0x100f #define PCI_DEVICE_ID_INTEL_82546EB 0x1010 +#define PCI_DEVICE_ID_INTEL_ICH7_16 0x27d8 /************* Strings for IDE Identity Fields **************************/ @@ -124,6 +127,9 @@ /************* SCSI implementation limits ********************************/ #define SCSI_MAX_CONTROLLERS 4 // Need more than 1 for MSCS clustering #define SCSI_MAX_DEVICES 16 // BT-958 emulates only 16 +#define SCSI_IDE_CHANNEL SCSI_MAX_CONTROLLERS +#define SCSI_IDE_HOSTED_CHANNEL (SCSI_MAX_CONTROLLERS + 1) +#define SCSI_MAX_CHANNELS (SCSI_MAX_CONTROLLERS + 2) /************* Strings for the VESA BIOS Identity Fields *****************/ #define VBE_OEM_STRING COMPANY_NAME " SVGA" @@ -139,6 +145,9 @@ /************* PCI Passthrough implementation limits ********************/ #define MAX_PCI_PASSTHRU_DEVICES 2 +/************* USB implementation limits ********************************/ +#define MAX_USB_DEVICES_PER_HOST_CONTROLLER 127 + /************* Strings for Host USB Driver *******************************/ #ifdef _WIN32 diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmxnet/vmnet_def.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet/vmnet_def.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmxnet/vmnet_def.h 2008-01-28 08:02:48.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet/vmnet_def.h 2008-10-13 08:01:45.000000000 +0100 @@ -57,4 +57,8 @@ #define VMNET_CAP_RX_CHAIN 0x8000 /* a pkt can span multiple rx entries */ #define VMNET_CAP_LPD 0x10000 /* large pkt delivery */ #define VMNET_CAP_BPF 0x20000 /* BPF Support in VMXNET Virtual Hardware */ +#define VMNET_CAP_SG_SPAN_PAGES 0x40000 /* Can do scatter-gather span multiple pages transmits. */ +#define VMNET_CAP_IP6_CSUM 0x80000 /* Can do IPv6 csum offload. */ +#define VMNET_CAP_TSO6 0x100000 /* Can do TSO segmentation offload for IPv6 pkts. */ +#define VMNET_CAP_TSO256k 0x200000 /* Can do TSO segmentation offload for pkts up to 256kB. */ #endif // _VMNET_DEF_H_ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmxnet/vmxnet2_def.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet/vmxnet2_def.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmxnet/vmxnet2_def.h 2008-01-28 08:02:48.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet/vmxnet2_def.h 2008-10-13 08:01:45.000000000 +0100 @@ -40,8 +40,13 @@ #define VMXNET2_MAX_NUM_RX_BUFFERS 128 #define VMXNET2_DEFAULT_NUM_RX_BUFFERS 100 + +/* size of the rx ring when enhanced vmxnet is used */ +#define ENHANCED_VMXNET2_MAX_NUM_RX_BUFFERS 512 +#define ENHANCED_VMXNET2_DEFAULT_NUM_RX_BUFFERS 150 + /* size of the 2nd rx ring */ -#define VMXNET2_MAX_NUM_RX_BUFFERS2 512 +#define VMXNET2_MAX_NUM_RX_BUFFERS2 2048 #define VMXNET2_DEFAULT_NUM_RX_BUFFERS2 512 /* size of the tx ring */ @@ -108,10 +113,6 @@ #define VMXNET2_RX_WITH_FRAG 0x02 #define VMXNET2_RX_FRAG_EOP 0x04 -#ifdef BPF_SUPPORT_ENABLED -#define VMXNET2_RX_BPF_TRAILER 0x08 -#endif /* BPF_SUPPORT_ENABLED */ - typedef struct Vmxnet2_TxRingEntry { uint16 flags; /* Flags as defined below. */ uint16 ownership; /* Who owns this packet. */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmxnet/vmxnet.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet/vmxnet.c --- open-vm-tools-2008.01.23-74039/modules/linux/vmxnet/vmxnet.c 2008-01-28 08:02:48.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet/vmxnet.c 2008-10-13 08:01:46.000000000 +0100 @@ -16,7 +16,7 @@ * *********************************************************/ -/* +/* * vmxnet.c: A virtual network driver for VMware. */ #include "driver-config.h" @@ -25,7 +25,7 @@ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 9) #include <linux/moduleparam.h> #endif - + #include "compat_slab.h" #include "compat_spinlock.h" #include "compat_pci.h" @@ -54,14 +54,9 @@ #include "net.h" #include "vmxnet_version.h" -#ifdef BPF_SUPPORT_ENABLED -#include "bpf_meta.h" -#include "compat_highmem.h" -#endif - static int vmxnet_debug = 1; -#define VMXNET_WATCHDOG_TIMEOUT (5 * HZ) +#define VMXNET_WATCHDOG_TIMEOUT (5 * HZ) #if defined(CONFIG_NET_POLL_CONTROLLER) || defined(HAVE_POLL_CONTROLLER) #define VMW_HAVE_POLL_CONTROLLER @@ -70,7 +65,7 @@ static int vmxnet_open(struct net_device *dev); static int vmxnet_start_tx(struct sk_buff *skb, struct net_device *dev); #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19) -static compat_irqreturn_t vmxnet_interrupt(int irq, void *dev_id, +static compat_irqreturn_t vmxnet_interrupt(int irq, void *dev_id, struct pt_regs * regs); #else static compat_irqreturn_t vmxnet_interrupt(int irq, void *dev_id); @@ -103,7 +98,7 @@ #endif #if defined(MAX_SKB_FRAGS) && ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,18) ) && ( LINUX_VERSION_CODE != KERNEL_VERSION(2, 6, 0) ) -#define VMXNET_DO_ZERO_COPY +#define VMXNET_DO_ZERO_COPY #endif #ifdef VMXNET_DO_ZERO_COPY @@ -112,11 +107,11 @@ #include <linux/in.h> #include <linux/tcp.h> -/* +/* * Tx buffer size that we need for copying header * max header is: 14(ip) + 4(vlan) + ip (60) + tcp(60) = 138 * round it up to the power of 2 - */ + */ #define TX_PKT_HEADER_SIZE 256 /* Constants used for Zero Copy Tx */ @@ -149,7 +144,7 @@ #if defined(NETIF_F_GSO) /* 2.6.18 and upwards */ #define VMXNET_SKB_MSS(skb) skb_shinfo(skb)->gso_size -#else +#else #define VMXNET_SKB_MSS(skb) skb_shinfo(skb)->tso_size #endif #endif @@ -158,7 +153,7 @@ #ifdef VMXNET_DEBUG #define VMXNET_LOG(msg...) printk(KERN_ERR msg) -#else +#else #define VMXNET_LOG(msg...) #endif // VMXNET_DEBUG @@ -207,6 +202,132 @@ #endif +#ifdef SET_ETHTOOL_OPS +/* + *---------------------------------------------------------------------------- + * + * vmxnet_get_settings -- + * + * Get device-specific settings. + * + * Results: + * 0 on success, errno on failure. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +static int +vmxnet_get_settings(struct net_device *dev, + struct ethtool_cmd *ecmd) +{ + ecmd->supported = SUPPORTED_1000baseT_Full | SUPPORTED_TP; + ecmd->advertising = ADVERTISED_TP; + ecmd->port = PORT_TP; + ecmd->transceiver = XCVR_INTERNAL; + + if (netif_carrier_ok(dev)) { + ecmd->speed = 1000; + ecmd->duplex = DUPLEX_FULL; + } else { + ecmd->speed = -1; + ecmd->duplex = -1; + } + return 0; +} + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet_get_drvinfo -- + * + * Ethtool callback to return driver information + * + * Results: + * None. + * + * Side effects: + * Updates *drvinfo + * + *---------------------------------------------------------------------------- + */ + +static void +vmxnet_get_drvinfo(struct net_device *dev, + struct ethtool_drvinfo *drvinfo) +{ + struct Vmxnet_Private *lp = dev->priv; + + strncpy(drvinfo->driver, vmxnet_driver.name, sizeof(drvinfo->driver)); + drvinfo->driver[sizeof(drvinfo->driver) - 1] = '\0'; + + strncpy(drvinfo->version, VMXNET_DRIVER_VERSION_STRING, + sizeof(drvinfo->version)); + drvinfo->driver[sizeof(drvinfo->version) - 1] = '\0'; + + strncpy(drvinfo->fw_version, "N/A", sizeof(drvinfo->fw_version)); + drvinfo->fw_version[sizeof(drvinfo->fw_version) - 1] = '\0'; + + strncpy(drvinfo->bus_info, compat_pci_name(lp->pdev), ETHTOOL_BUSINFO_LEN); +} + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet_set_tso -- + * + * Ethtool handler to set TSO. If the data is non-zero, TSO is + * enabled. Othewrise, it is disabled. + * + * Results: + * 0 if successful, error code otherwise. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +#ifdef VMXNET_DO_TSO +static int +vmxnet_set_tso(struct net_device *dev, u32 data) +{ + if (data) { + struct Vmxnet_Private *lp = (struct Vmxnet_Private *)dev->priv; + + if (!lp->tso) { + return -EINVAL; + } + dev->features |= NETIF_F_TSO; + } else { + dev->features &= ~NETIF_F_TSO; + } + return 0; +} +#endif + + +static struct ethtool_ops +vmxnet_ethtool_ops = { + .get_settings = vmxnet_get_settings, + .get_drvinfo = vmxnet_get_drvinfo, + .get_link = ethtool_op_get_link, + .get_sg = ethtool_op_get_sg, + .set_sg = ethtool_op_set_sg, +#ifdef VMXNET_DO_TSO + .get_tso = ethtool_op_get_tso, + .set_tso = vmxnet_set_tso, +#endif +}; + + +#else /* !defined(SET_ETHTOOL_OPS) */ + + /* *---------------------------------------------------------------------------- * @@ -295,7 +416,7 @@ value.data = (dev->features & NETIF_F_TSO) ? 1 : 0; if (copy_to_user(addr, &value, sizeof(value))) { return -EFAULT; - } + } return 0; } #endif @@ -326,7 +447,7 @@ if (copy_from_user(&value, addr, sizeof(value))) { return -EFAULT; } - + if (value.data) { struct Vmxnet_Private *lp = (struct Vmxnet_Private *)dev->priv; @@ -346,7 +467,7 @@ *---------------------------------------------------------------------------- * * vmxnet_ethtool_ioctl -- - * + * * Handler for ethtool ioctl calls. * * Results: @@ -378,7 +499,7 @@ #endif #ifdef VMXNET_DO_TSO case ETHTOOL_GTSO: - return vmxnet_get_tso(dev, ifr->ifr_data); + return vmxnet_get_tso(dev, ifr->ifr_data); case ETHTOOL_STSO: return vmxnet_set_tso(dev, ifr->ifr_data); #endif @@ -419,6 +540,7 @@ printk(KERN_DEBUG" ioctl operation %d not supported\n", cmd); return -EOPNOTSUPP; } +#endif /* SET_ETHTOOL_OPS */ /* @@ -499,7 +621,7 @@ static void vmxnet_tx_timeout(struct net_device *dev) { - netif_wake_queue(dev); + compat_netif_wake_queue(dev); } #endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,43) */ @@ -583,9 +705,10 @@ unsigned int irq_line; /* VMware's version of the magic number */ unsigned int low_vmware_version; - unsigned int numRxBuffers, numRxBuffers2; + unsigned int numRxBuffers, numRxBuffers2, maxNumRxBuffers, defNumRxBuffers; unsigned int numTxBuffers, maxNumTxBuffers, defNumTxBuffers; Bool morphed = FALSE; + Bool enhanced = FALSE; int i; unsigned int driverDataSize; @@ -771,7 +894,7 @@ #ifdef VMXNET_DO_TSO if ((lp->capabilities & VMNET_CAP_TSO) && - (lp->capabilities & (VMNET_CAP_IP4_CSUM | VMNET_CAP_HW_CSUM)) && + (lp->capabilities & (VMNET_CAP_IP4_CSUM | VMNET_CAP_HW_CSUM)) && // tso only makes sense if we have hw csum offload lp->chainTx && lp->zeroCopyTx && lp->features & VMXNET_FEATURE_TSO) { @@ -788,31 +911,39 @@ #endif #endif -#ifdef BPF_SUPPORT_ENABLED - if(lp->capabilities & VMNET_CAP_BPF && - lp->features & VMXNET_FEATURE_BPF) { - dev->features |= NETIF_F_BPF; - printk(" bpf"); - } -#endif - + printk("\n"); + /* check if this is enhanced vmxnet device */ + if ((lp->features & VMXNET_FEATURE_TSO) && + (lp->features & VMXNET_FEATURE_JUMBO_FRAME)) { + enhanced = TRUE; + } - printk("\n"); + /* determine rx/tx ring sizes */ + if (enhanced) { + maxNumRxBuffers = ENHANCED_VMXNET2_MAX_NUM_RX_BUFFERS; + defNumRxBuffers = ENHANCED_VMXNET2_DEFAULT_NUM_RX_BUFFERS; + } else { + maxNumRxBuffers = VMXNET2_MAX_NUM_RX_BUFFERS; + defNumRxBuffers = VMXNET2_DEFAULT_NUM_RX_BUFFERS; + } - /* determine rx/tx ring sizes */ outl(VMXNET_CMD_GET_NUM_RX_BUFFERS, dev->base_addr + VMXNET_COMMAND_ADDR); numRxBuffers = inl(dev->base_addr + VMXNET_COMMAND_ADDR); - if (numRxBuffers == 0 || numRxBuffers > VMXNET2_MAX_NUM_RX_BUFFERS) { - numRxBuffers = VMXNET2_DEFAULT_NUM_RX_BUFFERS; + if (numRxBuffers == 0 || numRxBuffers > maxNumRxBuffers) { + numRxBuffers = defNumRxBuffers; } if (lp->jumboFrame || lp->lpd) { numRxBuffers2 = numRxBuffers * 4; + if (numRxBuffers2 > VMXNET2_MAX_NUM_RX_BUFFERS2) { + numRxBuffers2 = VMXNET2_MAX_NUM_RX_BUFFERS2; + } } else { numRxBuffers2 = 1; } + printk("numRxBuffers = %d, numRxBuffers2 = %d\n", numRxBuffers, numRxBuffers2); if (lp->tso || lp->jumboFrame) { maxNumTxBuffers = VMXNET2_MAX_NUM_TX_BUFFERS_TSO; defNumTxBuffers = VMXNET2_DEFAULT_NUM_TX_BUFFERS_TSO; @@ -829,7 +960,7 @@ driverDataSize = sizeof(Vmxnet2_DriverData) + - (numRxBuffers + numRxBuffers2) * sizeof(Vmxnet2_RxRingEntry) + + (numRxBuffers + numRxBuffers2) * sizeof(Vmxnet2_RxRingEntry) + numTxBuffers * sizeof(Vmxnet2_TxRingEntry); VMXNET_LOG("vmxnet: numRxBuffers=((%d+%d)*%d) numTxBuffers=(%d*%d) driverDataSize=%d\n", numRxBuffers, numRxBuffers2, (uint32)sizeof(Vmxnet2_RxRingEntry), @@ -890,14 +1021,14 @@ if (lp->partialHeaderCopyEnabled) { unsigned int txBufferSize; - + txBufferSize = numTxBuffers * TX_PKT_HEADER_SIZE; lp->txBufferStartRaw = kmalloc(txBufferSize + PAGE_SIZE, GFP_DMA | GFP_KERNEL); if (lp->txBufferStartRaw) { - lp->txBufferStart = (char*)((unsigned long)(lp->txBufferStartRaw + PAGE_SIZE - 1) & + lp->txBufferStart = (char*)((unsigned long)(lp->txBufferStartRaw + PAGE_SIZE - 1) & (unsigned long)~(PAGE_SIZE - 1)); - lp->dd->txBufferPhysStart = virt_to_phys(lp->txBufferStart); + lp->dd->txBufferPhysStart = virt_to_phys(lp->txBufferStart); lp->dd->txBufferPhysLength = txBufferSize; lp->dd->txPktMaxSize = TX_PKT_HEADER_SIZE; } else { @@ -927,7 +1058,12 @@ /* Do this after ether_setup(), which sets the default value. */ dev->set_mac_address = &vmxnet_set_mac_address; + +#ifdef SET_ETHTOOL_OPS + SET_ETHTOOL_OPS(dev, &vmxnet_ethtool_ops); +#else dev->do_ioctl = vmxnet_ioctl; +#endif COMPAT_SET_MODULE_OWNER(dev); COMPAT_SET_NETDEV_DEV(dev, &pdev->dev); @@ -1070,7 +1206,7 @@ dd->rxRingOffset = offset; lp->rxRing = (Vmxnet2_RxRingEntry *)((uintptr_t)dd + offset); offset += lp->numRxBuffers * sizeof(Vmxnet2_RxRingEntry); - + dd->rxRingLength2 = lp->numRxBuffers2; dd->rxRingOffset2 = offset; lp->rxRing2 = (Vmxnet2_RxRingEntry *)((uintptr_t)dd + offset); @@ -1081,7 +1217,7 @@ lp->txRing = (Vmxnet2_TxRingEntry *)((uintptr_t)dd + offset); offset += lp->numTxBuffers * sizeof(Vmxnet2_TxRingEntry); - VMXNET_LOG("vmxnet_init_ring: offset=%"FMT64"d length=%d\n", + VMXNET_LOG("vmxnet_init_ring: offset=%"FMT64"d length=%d\n", (uint64)offset, dd->length); for (i = 0; i < lp->numRxBuffers; i++) { @@ -1126,13 +1262,13 @@ return -ENOMEM; } - lp->rxRing2[i].paddr = pci_map_page(pdev, lp->rxPages[i], 0, + lp->rxRing2[i].paddr = pci_map_page(pdev, lp->rxPages[i], 0, PAGE_SIZE, PCI_DMA_FROMDEVICE); lp->rxRing2[i].bufferLength = PAGE_SIZE; lp->rxRing2[i].actualLength = 0; lp->rxRing2[i].ownership = VMXNET2_OWNERSHIP_NIC_FRAG; } - } else + } else #endif { // dummy rxRing2 tacked on to the end, with a single unusable entry @@ -1216,7 +1352,7 @@ #endif lp->dd->txStopped = FALSE; - netif_start_queue(dev); + compat_netif_start_queue(dev); #if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,43) dev->interrupt = 0; @@ -1236,7 +1372,7 @@ * * vmxnet_unmap_buf -- * - * Unmap the PAs of the tx entry that we pinned for DMA. + * Unmap the PAs of the tx entry that we pinned for DMA. * * Results: * None. @@ -1247,7 +1383,7 @@ */ void -vmxnet_unmap_buf(struct sk_buff *skb, +vmxnet_unmap_buf(struct sk_buff *skb, struct Vmxnet2_TxBuf *tb, Vmxnet2_TxRingEntry *xre, struct pci_dev *pdev) @@ -1281,34 +1417,34 @@ * * vmxnet_map_pkt -- * - * Map the buffers/pages that we need for DMA and populate the SG. + * Map the buffers/pages that we need for DMA and populate the SG. * * "offset" indicates the position inside the pkt where mapping should start. * "startSgIdx" indicates the first free sg slot of the first tx entry * (pointed to by txDriverNext). * * The caller should guarantee the first tx has at least one sg slot - * available. The caller should also ensure that enough tx entries are - * available for this pkt. - * + * available. The caller should also ensure that enough tx entries are + * available for this pkt. + * * Results: * None. * * Side effects: - * 1. Ownership of all tx entries used (EXCEPT the 1st one) are updated. - * The only flag set is VMXNET2_TX_MORE if needed. caller is + * 1. Ownership of all tx entries used (EXCEPT the 1st one) are updated. + * The only flag set is VMXNET2_TX_MORE if needed. caller is * responsible to set up other flags after this call returns. * 2. lp->dd->numTxPending is updated * 3. txBufInfo corresponding to used tx entries (including the 1st one) * are updated - * 4. txDriverNext is advanced accordingly + * 4. txDriverNext is advanced accordingly * *----------------------------------------------------------------------------- */ void -vmxnet_map_pkt(struct sk_buff *skb, - int offset, +vmxnet_map_pkt(struct sk_buff *skb, + int offset, struct Vmxnet_Private *lp, int startSgIdx) { @@ -1318,7 +1454,7 @@ Vmxnet2_TxRingEntry *xre; struct Vmxnet2_TxBuf *tb; dma_addr_t dma; - + VMXNET_ASSERT(startSgIdx < VMXNET2_SG_DEFAULT_LENGTH); lp->numTxPending ++; @@ -1329,13 +1465,13 @@ tb->sgForLinear = -1; tb->firstSgForFrag = nextSg; } else if (offset < skb_headlen(skb)) { - /* we need to map some of the non-frag data. */ - dma = pci_map_single(lp->pdev, - skb->data + offset, - skb_headlen(skb) - offset, + /* we need to map some of the non-frag data. */ + dma = pci_map_single(lp->pdev, + skb->data + offset, + skb_headlen(skb) - offset, PCI_DMA_TODEVICE); VMXNET_FILL_SG(xre->sg.sg[nextSg], dma, skb_headlen(skb) - offset); - VMXNET_LOG("vmxnet_map_pkt: txRing[%u].sg[%d] -> data %p offset %u size %u\n", + VMXNET_LOG("vmxnet_map_pkt: txRing[%u].sg[%d] -> data %p offset %u size %u\n", dd->txDriverNext, nextSg, skb->data, offset, skb_headlen(skb) - offset); tb->sgForLinear = nextSg++; tb->firstSgForFrag = nextSg; @@ -1348,8 +1484,8 @@ for ( ; nextFrag < skb_shinfo(skb)->nr_frags; nextFrag++){ frag = &skb_shinfo(skb)->frags[nextFrag]; - - // skip those frags that are completely copied + + // skip those frags that are completely copied if (offset >= frag->size){ offset -= frag->size; } else { @@ -1364,7 +1500,7 @@ dd->txDriverNext, nextSg, nextFrag, offset, frag->size - offset); nextSg++; nextFrag++; - + break; } } @@ -1373,28 +1509,28 @@ // map the remaining frags, we might need to use additional tx entries for ( ; nextFrag < skb_shinfo(skb)->nr_frags; nextFrag++) { frag = &skb_shinfo(skb)->frags[nextFrag]; - dma = pci_map_page(lp->pdev, + dma = pci_map_page(lp->pdev, frag->page, frag->page_offset, frag->size, PCI_DMA_TODEVICE); - + if (nextSg == VMXNET2_SG_DEFAULT_LENGTH) { xre->flags = VMXNET2_TX_MORE; xre->sg.length = VMXNET2_SG_DEFAULT_LENGTH; tb->skb = skb; tb->eop = 0; - - // move to the next tx entry + + // move to the next tx entry VMXNET_INC(dd->txDriverNext, dd->txRingLength); xre = &lp->txRing[dd->txDriverNext]; tb = &lp->txBufInfo[dd->txDriverNext]; // the new tx entry must be available - VMXNET_ASSERT(xre->ownership == VMXNET2_OWNERSHIP_DRIVER && tb->skb == NULL); + VMXNET_ASSERT(xre->ownership == VMXNET2_OWNERSHIP_DRIVER && tb->skb == NULL); - /* - * we change it even before the sg are populated but this is + /* + * we change it even before the sg are populated but this is * fine, because the first tx entry's ownership is not * changed yet */ @@ -1472,8 +1608,8 @@ lp->numTxPending -= completed; // XXX conditionally wake up the queue based on the # of freed entries - if (netif_queue_stopped(dev)) { - netif_wake_queue(dev); + if (compat_netif_queue_stopped(dev)) { + compat_netif_wake_queue(dev); dd->txStopped = FALSE; } } @@ -1517,17 +1653,17 @@ #ifdef VMXNET_DO_ZERO_COPY if (lp->zeroCopyTx) { int txEntries, sgCount; - unsigned int headerSize; - + unsigned int headerSize; + /* conservatively estimate the # of tx entries needed in the worse case */ sgCount = (lp->partialHeaderCopyEnabled ? 2 : 1) + skb_shinfo(skb)->nr_frags; txEntries = (sgCount + VMXNET2_SG_DEFAULT_LENGTH - 1) / VMXNET2_SG_DEFAULT_LENGTH; if (UNLIKELY(!lp->chainTx && txEntries > 1)) { - /* + /* * rare case, no tx desc chaining support but the pkt need more than 1 * tx entry, linearize it - */ + */ if (compat_skb_linearize(skb) != 0) { VMXNET_LOG("vmxnet_tx: skb_linearize failed\n"); compat_dev_kfree_skb(skb, FREE_WRITE); @@ -1537,7 +1673,7 @@ txEntries = 1; } - VMXNET_LOG("\n%d(%d) bytes, %d frags, %d tx entries\n", skb->len, + VMXNET_LOG("\n%d(%d) bytes, %d frags, %d tx entries\n", skb->len, skb_headlen(skb), skb_shinfo(skb)->nr_frags, txEntries); spin_lock_irqsave(&lp->txLock, flags); @@ -1545,14 +1681,14 @@ /* check for the availability of tx ring entries */ if (dd->txRingLength - lp->numTxPending < txEntries) { dd->txStopped = TRUE; - netif_stop_queue(dev); + compat_netif_stop_queue(dev); check_tx_queue(dev); spin_unlock_irqrestore(&lp->txLock, flags); VMXNET_LOG("queue stopped\n"); return VMXNET_STOP_TRANSMIT; } - + /* copy protocol headers if needed */ if (LIKELY(lp->partialHeaderCopyEnabled)) { unsigned int pos = dd->txDriverNext * dd->txPktMaxSize; @@ -1637,7 +1773,7 @@ } } } - + if (skb_copy_bits(skb, 0, header, headerSize) != 0) { compat_dev_kfree_skb(skb, FREE_WRITE); spin_unlock_irqrestore(&lp->txLock, flags); @@ -1673,13 +1809,13 @@ if (lp->txBufInfo[dd->txDriverNext].skb != NULL) { dd->txStopped = TRUE; - netif_stop_queue(dev); + compat_netif_stop_queue(dev); check_tx_queue(dev); spin_unlock_irqrestore(&lp->txLock, flags); return VMXNET_STOP_TRANSMIT; } - + lp->numTxPending ++; xre->sg.sg[0].addrLow = virt_to_bus(skb->data); @@ -1700,10 +1836,10 @@ } /* at this point, xre must point to the 1st tx entry for the pkt */ - if (skb->ip_summed == VM_CHECKSUM_PARTIAL) { + if (skb->ip_summed == VM_TX_CHECKSUM_PARTIAL) { xre->flags |= VMXNET2_TX_HW_XSUM | VMXNET2_TX_CAN_KEEP; } else { - xre->flags |= VMXNET2_TX_CAN_KEEP; + xre->flags |= VMXNET2_TX_CAN_KEEP; } if (lp->numTxPending > dd->txRingLength - 5) { xre->flags |= VMXNET2_TX_RING_LOW; @@ -1811,7 +1947,7 @@ * vmxnet_rx_frags -- * * get data from the 2nd rx ring and append the frags to the skb. Multiple - * rx entries in the 2nd rx ring are processed until the one with + * rx entries in the 2nd rx ring are processed until the one with * VMXNET2_RX_FRAG_EOP set. * * Result: @@ -1840,7 +1976,7 @@ rre2 = &lp->rxRing2[dd->rxDriverNext2]; flags = rre2->flags; VMXNET_ASSERT(rre2->ownership == VMXNET2_OWNERSHIP_DRIVER_FRAG); - + if (rre2->actualLength > 0) { newPage = alloc_page(GFP_ATOMIC); if (UNLIKELY(newPage == NULL)) { @@ -1878,8 +2014,8 @@ skb_shinfo(skb)->nr_frags = numFrags; skb->len += skb->data_len; skb->truesize += skb->data_len; - VMXNET_LOG("vmxnet_rx: %dB from rxRing[%d](%dB)+rxRing2[%d, %d)(%dB)\n", - skb->len, dd->rxDriverNext, skb_headlen(skb), + VMXNET_LOG("vmxnet_rx: %dB from rxRing[%d](%dB)+rxRing2[%d, %d)(%dB)\n", + skb->len, dd->rxDriverNext, skb_headlen(skb), firstFrag, dd->rxDriverNext2, skb->data_len); return 0; } @@ -1906,10 +2042,6 @@ Vmxnet_Private *lp = (Vmxnet_Private *)dev->priv; Vmxnet2_DriverData *dd = lp->dd; -#ifdef BPF_SUPPORT_ENABLED - struct BPF_MetaData *meta = NULL; -#endif - if (!lp->devOpen) { return 0; } @@ -1942,7 +2074,7 @@ #ifdef VMXNET_DO_ZERO_COPY if (rre->flags & VMXNET2_RX_WITH_FRAG) { vmxnet_drop_frags(lp); - } + } #endif lp->stats.rx_errors++; goto next_pkt; @@ -1973,7 +2105,7 @@ * is stripped, such frames become ETH_MIN_FRAME_LEN - 4. (PR106153) */ if (skb->len != 0) { - printk(KERN_DEBUG "%s: Runt pkt (%d bytes) entry %d!\n", dev->name, + printk(KERN_DEBUG "%s: Runt pkt (%d bytes) entry %d!\n", dev->name, skb->len, dd->rxDriverNext); } lp->stats.rx_errors++; @@ -1981,51 +2113,6 @@ if (rre->flags & VMXNET2_RX_HW_XSUM_OK) { skb->ip_summed = CHECKSUM_UNNECESSARY; } -#ifdef BPF_SUPPORT_ENABLED - - meta = (struct BPF_MetaData *)skb->cb; - - if(rre->flags & VMXNET2_RX_BPF_TRAILER) { - char *vaddr; - int numFrags = skb_shinfo(skb)->nr_frags; - - if (numFrags > 0) { - - /* If fragments are present, the trailer is present in the - * last fragement. Map it and remove the trailer - */ - vaddr = kmap_atomic(skb_shinfo(skb)->frags[numFrags - 1].page, - KM_USER0); - if (vaddr) { - - memcpy(meta->bpfSnapLens, - vaddr + skb_shinfo(skb)->frags[numFrags-1].size, - sizeof meta->bpfSnapLens); - kunmap_atomic((struct page *)vaddr, KM_USER0); - - } else { - printk(KERN_ERR"Error mapping Last Fragment of Packet\n"); - /* Act as if there was no bpf trailer at all*/ - meta->controlByte = 0; - goto error; - } - } else { - - /* The trailer is present in the linear data array */ - - vaddr = (char *)skb->data; - - memcpy(meta->bpfSnapLens, vaddr + skb->len, - sizeof meta->bpfSnapLens); - } - - meta->controlByte |= VMXNET_BPF_PROCESSED; - - } else { - meta->controlByte = 0; - } -error: -#endif skb->dev = dev; #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,2,0) @@ -2099,8 +2186,8 @@ spin_unlock(&lp->txLock); } - if (netif_queue_stopped(dev) && !lp->dd->txStopped) { - netif_wake_queue(dev); + if (compat_netif_queue_stopped(dev) && !lp->dd->txStopped) { + compat_netif_wake_queue(dev); } #if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,43) @@ -2172,14 +2259,14 @@ dev->start = 0; #endif - netif_stop_queue(dev); + compat_netif_stop_queue(dev); lp->devOpen = FALSE; spin_lock_irqsave(&lp->txLock, flags); if (lp->numTxPending > 0) { //Wait absurdly long (2sec) for all the pending packets to be returned. - printk(KERN_DEBUG "vmxnet_close: Pending tx = %d\n", lp->numTxPending); + printk(KERN_DEBUG "vmxnet_close: Pending tx = %d\n", lp->numTxPending); for (i = 0; i < 200 && lp->numTxPending > 0; i++) { outl(VMXNET_CMD_CHECK_TX_DONE, dev->base_addr + VMXNET_COMMAND_ADDR); udelay(10000); @@ -2198,7 +2285,7 @@ } } spin_unlock_irqrestore(&lp->txLock, flags); - + outl(0, ioaddr + VMXNET_INIT_ADDR); free_irq(dev->irq, dev); @@ -2247,7 +2334,7 @@ * *----------------------------------------------------------------------------- */ -static int +static int vmxnet_load_multicast (struct net_device *dev) { Vmxnet_Private *lp = (Vmxnet_Private *) dev->priv; @@ -2307,7 +2394,7 @@ * *----------------------------------------------------------------------------- */ -static void +static void vmxnet_set_multicast_list(struct net_device *dev) { unsigned int ioaddr = dev->base_addr; @@ -2334,7 +2421,7 @@ lp->dd->ifflags |= VMXNET_IFF_MULTICAST; } } - outl(VMXNET_CMD_UPDATE_LADRF, ioaddr + VMXNET_COMMAND_ADDR); + outl(VMXNET_CMD_UPDATE_LADRF, ioaddr + VMXNET_COMMAND_ADDR); outl(VMXNET_CMD_UPDATE_IFF, ioaddr + VMXNET_COMMAND_ADDR); } @@ -2361,7 +2448,7 @@ unsigned int ioaddr = dev->base_addr; int i; - if (netif_running(dev)) + if (compat_netif_running(dev)) return -EBUSY; memcpy(dev->dev_addr, addr->sa_data, dev->addr_len); diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmxnet/vmxnet_def.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet/vmxnet_def.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmxnet/vmxnet_def.h 2008-01-28 08:02:48.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet/vmxnet_def.h 2008-10-13 08:01:45.000000000 +0100 @@ -97,7 +97,7 @@ /* * An invalid ring index. */ -#define VMXNET_INVALID_RING_INDEX -1 +#define VMXNET_INVALID_RING_INDEX (-1) /* * Features that are implemented by the driver. These are driver @@ -120,7 +120,6 @@ #define VMXNET_FEATURE_TSO 0x02 #define VMXNET_FEATURE_JUMBO_FRAME 0x04 #define VMXNET_FEATURE_LPD 0x08 -#define VMXNET_FEATURE_BPF 0x10 /* * Define the set of capabilities required by each feature above @@ -128,7 +127,6 @@ #define VMXNET_FEATURE_ZERO_COPY_TX_CAPS VMXNET_CAP_SG #define VMXNET_FEATURE_TSO_CAPS VMXNET_CAP_TSO #define VMXNET_HIGHEST_FEATURE_BIT VMXNET_FEATURE_TSO -#define VMXNET_FEATURE_BPF_CAPS VMNET_CAP_BPF #define VMXNET_INC(val, max) \ val++; \ @@ -142,16 +140,6 @@ */ typedef uint32 Vmxnet_DDMagic; - -/* - * Max number of packet patterns in a single filter & maximum packet size - * that can match a filter. Used by vmxnet wake-on-packet-pattern-receive. - */ - -#define MAX_NUM_FILTER_PTTRNS 6 -#define MAX_PKT_FILTER_SIZE 128 - - /* * Wake packet pattern commands sent through VMXNET_WAKE_PKT_PATTERNS port */ @@ -179,23 +167,4 @@ } pktPttrn; } Vmxnet_WakePktCmd; - -/* - * Representation for packet filter pattern set, needs to fit w/i an MPN - */ - -typedef struct Vmxnet_PttrnBytes { - uint8 byteOff; /* offset within packet of pattern byte */ - uint8 byteVal; /* value of pattern byte within packet */ -} Vmxnet_PttrnBytes; - -typedef struct Vmxnet_PktFltrPttrns { - uint8 prevCmd; /* to check sanity of VMXNET_PM_OPCODE_START..END sequence */ - uint8 nmPttrns; /* count patterns 1..MAX_NUM_FILTER_PTTRNS */ - uint8 nmPttrnBytes[MAX_NUM_FILTER_PTTRNS]; /* 1..MAX_PKT_FILTER_SIZE */ - Vmxnet_PttrnBytes pttrnBytes[MAX_NUM_FILTER_PTTRNS][MAX_PKT_FILTER_SIZE]; -} Vmxnet_PktFltrPttrns; - #endif /* _VMXNET_DEF_H_ */ - - diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmxnet/vmxnetInt.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet/vmxnetInt.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmxnet/vmxnetInt.h 2008-01-28 08:02:48.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet/vmxnetInt.h 2008-10-13 08:01:46.000000000 +0100 @@ -44,79 +44,17 @@ # define net_device_stats enet_statistics #endif -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,14)) -# define net_device device -#endif - -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,43)) -static inline void -netif_start_queue(struct device *dev) -{ - clear_bit(0, &dev->tbusy); -} - -static inline void -netif_stop_queue(struct device *dev) -{ - set_bit(0, &dev->tbusy); -} - -static inline int -netif_queue_stopped(struct device *dev) -{ - return test_bit(0, &dev->tbusy); -} - -static inline void -netif_wake_queue(struct device *dev) -{ - clear_bit(0, &dev->tbusy); - mark_bh(NET_BH); -} - -static inline int -netif_running(struct device *dev) -{ - return dev->start == 0; -} -#endif - #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,2,0)) # define le16_to_cpu(x) ((__u16)(x)) # define le32_to_cpu(x) ((__u32)(x)) #endif -#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,1,0)) -# define compat_kfree_skb(skb, type) kfree_skb(skb, type) -# define compat_dev_kfree_skb(skb, type) dev_kfree_skb(skb, type) -# define compat_dev_kfree_skb_any(skb, type) dev_kfree_skb(skb, type) -# define compat_dev_kfree_skb_irq(skb, type) dev_kfree_skb(skb, type) -#else -# define compat_kfree_skb(skb, type) kfree_skb(skb) -# define compat_dev_kfree_skb(skb, type) dev_kfree_skb(skb) -# if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,43)) -# define compat_dev_kfree_skb_any(skb, type) dev_kfree_skb(skb) -# define compat_dev_kfree_skb_irq(skb, type) dev_kfree_skb(skb) -# else -# define compat_dev_kfree_skb_any(skb, type) dev_kfree_skb_any(skb) -# define compat_dev_kfree_skb_irq(skb, type) dev_kfree_skb_irq(skb) -# endif -#endif - #if defined(BUG_ON) #define VMXNET_ASSERT(cond) BUG_ON(!(cond)) #else #define VMXNET_ASSERT(cond) #endif -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19) && defined(CHECKSUM_HW) -# define VM_CHECKSUM_PARTIAL CHECKSUM_HW -# define VM_CHECKSUM_UNNECESSARY CHECKSUM_UNNECESSARY -#else -# define VM_CHECKSUM_PARTIAL CHECKSUM_PARTIAL -# define VM_CHECKSUM_UNNECESSARY CHECKSUM_UNNECESSARY -#endif - struct Vmxnet2_TxBuf { struct sk_buff *skb; char sgForLinear; /* the sg entry mapping the linear part @@ -135,7 +73,7 @@ Vmxnet2_DriverData *dd; const char *name; struct net_device_stats stats; - struct sk_buff *rxSkbuff[VMXNET2_MAX_NUM_RX_BUFFERS]; + struct sk_buff *rxSkbuff[ENHANCED_VMXNET2_MAX_NUM_RX_BUFFERS]; struct page *rxPages[VMXNET2_MAX_NUM_RX_BUFFERS2]; struct Vmxnet2_TxBuf txBufInfo[VMXNET2_MAX_NUM_TX_BUFFERS_TSO]; spinlock_t txLock; diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmxnet/vmxnet_version.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet/vmxnet_version.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmxnet/vmxnet_version.h 2008-01-28 08:02:48.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet/vmxnet_version.h 2008-10-13 08:01:46.000000000 +0100 @@ -25,8 +25,8 @@ #ifndef _VMXNET_VERSION_H_ #define _VMXNET_VERSION_H_ -#define VMXNET_DRIVER_VERSION 2.0.1.0 -#define VMXNET_DRIVER_VERSION_COMMAS 2,0,1,0 -#define VMXNET_DRIVER_VERSION_STRING "2.0.1.0" +#define VMXNET_DRIVER_VERSION 2.0.1.1 +#define VMXNET_DRIVER_VERSION_COMMAS 2,0,1,1 +#define VMXNET_DRIVER_VERSION_STRING "2.0.1.1" #endif /* _VMXNET_VERSION_H_ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/autoconf/geninclude.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/autoconf/geninclude.c --- open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/autoconf/geninclude.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/autoconf/geninclude.c 2008-10-13 08:01:46.000000000 +0100 @@ -0,0 +1,40 @@ +/********************************************************* + * Copyright (C) 2003 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +#include <linux/autoconf.h> + +#ifdef CONFIG_X86_VOYAGER +APATH/mach-voyager +#endif +#ifdef CONFIG_X86_VISWS +APATH/mach-visws +#endif +#ifdef CONFIG_X86_NUMAQ +APATH/mach-numaq +#endif +#ifdef CONFIG_X86_BIGSMP +APATH/mach-bigsmp +#endif +#ifdef CONFIG_X86_SUMMIT +APATH/mach-summit +#endif +#ifdef CONFIG_X86_GENERICARCH +APATH/mach-generic +#endif +APATH/mach-default + diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/autoconf/skblin.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/autoconf/skblin.c --- open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/autoconf/skblin.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/autoconf/skblin.c 2008-10-13 08:01:46.000000000 +0100 @@ -0,0 +1,41 @@ +/********************************************************* + * Copyright (C) 2006 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * Detect whether skb_linearize takes one or two arguments. + */ + +#include <linux/autoconf.h> +#include <linux/version.h> + +#if LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 17) +/* + * Since 2.6.18 all kernels have single-argument skb_linearize. For + * older kernels use autodetection. Not using autodetection on newer + * kernels saves us from compile failure on some post 2.6.18 kernels + * which do not have selfcontained skbuff.h. + */ + +#include <linux/skbuff.h> + +int test_skb_linearize(struct sk_buff *skb) +{ + return skb_linearize(skb); +} + +#endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/compat_ethtool.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/compat_ethtool.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/compat_ethtool.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/compat_ethtool.h 2008-10-13 08:01:46.000000000 +0100 @@ -0,0 +1,54 @@ +/********************************************************* + * Copyright (C) 2007 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +#ifndef _COMPAT_ETHTOOL_H +#define _COMPAT_ETHTOOL_H + +/* + * ethtool is a userspace utility for getting and setting ethernet device + * settings. Kernel support for it was first published in 2.4.0-test11, but + * only in 2.4.15 were the ethtool_value struct and the ETHTOOL_GLINK ioctl + * added to ethtool.h (together, because the ETHTOOL_GLINK ioctl expects a + * single value response). + * + * Likewise, ioctls for getting and setting TSO were published in 2.4.22. + */ + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 0) +# include <linux/ethtool.h> + +# ifndef ETHTOOL_GLINK +# define ETHTOOL_GLINK 0x0a + +typedef struct { + __u32 cmd; + __u32 data; +} compat_ethtool_value; + +# else + +typedef struct ethtool_value compat_ethtool_value; +# endif + +# ifndef ETHTOOL_GTSO +# define ETHTOOL_GTSO 0x1E +# define ETHTOOL_STSO 0x1F +# endif +#endif + +#endif /* _COMPAT_ETHTOOL_H */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/compat_highmem.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/compat_highmem.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/compat_highmem.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/compat_highmem.h 2008-10-13 08:01:46.000000000 +0100 @@ -0,0 +1,40 @@ +/********************************************************* + * Copyright (C) 2002 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +#ifndef __COMPAT_HIGHMEM_H__ +# define __COMPAT_HIGHMEM_H__ + + +/* + * BIGMEM (4 GB) support appeared in 2.3.16: kmap() API added + * HIGHMEM (4 GB + 64 GB) support appeared in 2.3.23: kmap() API modified + * In 2.3.27, kmap() API modified again + * + * --hpreg + */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 3, 27) +# include <linux/highmem.h> +#else +/* For page_address --hpreg */ +# include <linux/pagemap.h> + +# define kmap(_page) (void*)page_address(_page) +# define kunmap(_page) +#endif + +#endif /* __COMPAT_HIGHMEM_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/compat_init.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/compat_init.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/compat_init.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/compat_init.h 2008-10-13 08:01:46.000000000 +0100 @@ -0,0 +1,38 @@ +/********************************************************* + * Copyright (C) 1999 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * compat_init.h: Initialization compatibility wrappers. + */ + +#ifndef __COMPAT_INIT_H__ +#define __COMPAT_INIT_H__ + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 2, 0) +#include <linux/init.h> +#endif + +#ifndef module_init +#define module_init(x) int init_module(void) { return x(); } +#endif + +#ifndef module_exit +#define module_exit(x) void cleanup_module(void) { x(); } +#endif + +#endif /* __COMPAT_INIT_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/compat_interrupt.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/compat_interrupt.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/compat_interrupt.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/compat_interrupt.h 2008-10-13 08:01:46.000000000 +0100 @@ -0,0 +1,55 @@ +/********************************************************* + * Copyright (C) 2003 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +#ifndef __COMPAT_INTERRUPT_H__ +# define __COMPAT_INTERRUPT_H__ + + +#include <linux/interrupt.h> + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 69) +/* + * We cannot just define irqreturn_t, as some 2.4.x kernels have + * typedef void irqreturn_t; for "increasing" backward compatibility. + */ +typedef void compat_irqreturn_t; +#define COMPAT_IRQ_NONE +#define COMPAT_IRQ_HANDLED +#define COMPAT_IRQ_RETVAL(x) +#else +typedef irqreturn_t compat_irqreturn_t; +#define COMPAT_IRQ_NONE IRQ_NONE +#define COMPAT_IRQ_HANDLED IRQ_HANDLED +#define COMPAT_IRQ_RETVAL(x) IRQ_RETVAL(x) +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18) +#define COMPAT_IRQF_DISABLED SA_INTERRUPT +#define COMPAT_IRQF_SHARED SA_SHIRQ +#else +#define COMPAT_IRQF_DISABLED IRQF_DISABLED +#define COMPAT_IRQF_SHARED IRQF_SHARED +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) +#define COMPAT_IRQ_HANDLER_ARGS(irq, devp) (int irq, void *devp, struct pt_regs *regs) +#else +#define COMPAT_IRQ_HANDLER_ARGS(irq, devp) (int irq, void *devp) +#endif + +#endif /* __COMPAT_INTERRUPT_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/compat_ioport.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/compat_ioport.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/compat_ioport.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/compat_ioport.h 2008-10-13 08:01:46.000000000 +0100 @@ -0,0 +1,63 @@ +/********************************************************* + * Copyright (C) 2003 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +#ifndef __COMPAT_IOPORT_H__ +# define __COMPAT_IOPORT_H__ + + +#include <linux/ioport.h> + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 0) +static inline void * +compat_request_region(unsigned long start, unsigned long len, const char *name) +{ + if (check_region(start, len)) { + return NULL; + } + request_region(start, len, name); + return (void*)1; +} +#else +#define compat_request_region(start, len, name) request_region(start, len, name) +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 3, 7) +/* mmap io support starts from 2.3.7, fail the call for kernel prior to that */ +static inline void * +compat_request_mem_region(unsigned long start, unsigned long len, const char *name) +{ + return NULL; +} + +static inline void +compat_release_mem_region(unsigned long start, unsigned long len) +{ + return; +} +#else +#define compat_request_mem_region(start, len, name) request_mem_region(start, len, name) +#define compat_release_mem_region(start, len) release_mem_region(start, len) +#endif + +/* these two macro defs are needed by compat_pci_request_region */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 3, 15) +# define IORESOURCE_IO 0x00000100 +# define IORESOURCE_MEM 0x00000200 +#endif + +#endif /* __COMPAT_IOPORT_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/compat_module.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/compat_module.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/compat_module.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/compat_module.h 2008-10-13 08:01:46.000000000 +0100 @@ -0,0 +1,72 @@ +/********************************************************* + * Copyright (C) 2007 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * compat_module.h -- + */ + +#ifndef __COMPAT_MODULE_H__ +# define __COMPAT_MODULE_H__ + + +#include <linux/module.h> + + +/* + * Modules wishing to use the GPL license are required to include a + * MODULE_LICENSE definition in their module source as of 2.4.10. + */ +#ifndef MODULE_LICENSE +#define MODULE_LICENSE(license) +#endif + +/* + * To make use of our own home-brewed MODULE_INFO, we need macros to + * concatenate two expressions to "__mod_", and and to convert an + * expression into a string. I'm sure we've got these in our codebase, + * but I'd rather not introduce such a dependency in a compat header. + */ +#ifndef __module_cat +#define __module_cat_1(a, b) __mod_ ## a ## b +#define __module_cat(a, b) __module_cat_1(a, b) +#endif + +#ifndef __stringify +#define __stringify_1(x) #x +#define __stringify(x) __stringify_1(x) +#endif + +/* + * MODULE_INFO was born in 2.5.69. + */ +#ifndef MODULE_INFO +#define MODULE_INFO(tag, info) \ +static const char __module_cat(tag, __LINE__)[] \ + __attribute__((section(".modinfo"), unused)) = __stringify(tag) "=" info +#endif + +/* + * MODULE_VERSION was born in 2.6.4. The earlier form appends a long "\0xxx" + * string to the module's version, but that was removed in 2.6.10, so we'll + * ignore it in our wrapper. + */ +#ifndef MODULE_VERSION +#define MODULE_VERSION(_version) MODULE_INFO(version, _version) +#endif + +#endif /* __COMPAT_MODULE_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/compat_netdevice.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/compat_netdevice.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/compat_netdevice.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/compat_netdevice.h 2008-10-13 08:01:46.000000000 +0100 @@ -0,0 +1,287 @@ +/********************************************************* + * Copyright (C) 2002 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +#ifndef __COMPAT_NETDEVICE_H__ +# define __COMPAT_NETDEVICE_H__ + + +#include <linux/skbuff.h> +#include <linux/rtnetlink.h> +#include <linux/netdevice.h> +#include <linux/etherdevice.h> + +/* + * The enet_statistics structure moved from linux/if_ether.h to + * linux/netdevice.h and is renamed net_device_stats in 2.1.25 --hpreg + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 1, 25) +# include <linux/if_ether.h> + +# define net_device_stats enet_statistics +#endif + + +/* The netif_rx_ni() API appeared in 2.4.8 --hpreg */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 8) +# define netif_rx_ni netif_rx +#endif + + +/* The device struct was renamed net_device in 2.3.14 --hpreg */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 3, 14) +# define net_device device +#endif + + +/* + * SET_MODULE_OWNER appeared sometime during 2.3.x. It was setting + * dev->owner = THIS_MODULE until 2.5.70, where netdevice refcounting + * was completely changed. SET_MODULE_OWNER was nop for whole + * 2.6.x series, and finally disappeared in 2.6.24. + * + * MOD_xxx_USE_COUNT wrappers are here, as they must be mutually + * exclusive with SET_MODULE_OWNER call. + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 0) +# define COMPAT_SET_MODULE_OWNER(dev) do {} while (0) +# define COMPAT_NETDEV_MOD_INC_USE_COUNT MOD_INC_USE_COUNT +# define COMPAT_NETDEV_MOD_DEC_USE_COUNT MOD_DEC_USE_COUNT +#else +# if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0) +# define COMPAT_SET_MODULE_OWNER(dev) SET_MODULE_OWNER(dev) +# else +# define COMPAT_SET_MODULE_OWNER(dev) do {} while (0) +# endif +# define COMPAT_NETDEV_MOD_INC_USE_COUNT do {} while (0) +# define COMPAT_NETDEV_MOD_DEC_USE_COUNT do {} while (0) +#endif + +/* + * SET_NETDEV_DEV appeared sometime during 2.5.x, and later was + * crossported to various 2.4.x kernels (as dummy macro). + */ +#ifdef SET_NETDEV_DEV +# define COMPAT_SET_NETDEV_DEV(dev, pdev) SET_NETDEV_DEV(dev, pdev) +#else +# define COMPAT_SET_NETDEV_DEV(dev, pdev) do {} while (0) +#endif + +/* + * Build alloc_etherdev API on the top of init_etherdev. For 2.0.x kernels + * we must provide dummy init method, otherwise register_netdev does + * nothing. + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 3) + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 2, 0) +int +vmware_dummy_init(struct net_device *dev) +{ + return 0; +} +#endif + + +static inline struct net_device* +compat_alloc_etherdev(int priv_size) +{ + struct net_device* dev; + int size = sizeof *dev + priv_size; + + /* + * The name is dynamically allocated before 2.4.0, but + * is an embedded array in later kernels. + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 0) + size += sizeof("ethXXXXXXX"); +#endif + dev = kmalloc(size, GFP_KERNEL); + if (dev) { + memset(dev, 0, size); + if (priv_size) { + dev->priv = dev + 1; + } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 0) + dev->name = (char *)(dev + 1) + priv_size; +#endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 2, 0) + dev->init = vmware_dummy_init; +#endif + if (init_etherdev(dev, 0) != dev) { + kfree(dev); + dev = NULL; + } + } + return dev; +} +#else +#define compat_alloc_etherdev(sz) alloc_etherdev(sz) +#endif + + +/* + * alloc_netdev and free_netdev are there since 2.4.23. Their use is mandatory + * since 2.6.24. + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 23) +static inline struct net_device * +compat_alloc_netdev(int priv_size, + const char *mask, + void (*setup)(struct net_device *)) +{ + struct net_device *dev; + int netdev_size = sizeof *dev; + int alloc_size; + +# if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 0) + netdev_size += IFNAMSIZ; +# endif + + alloc_size = netdev_size + priv_size; + dev = kmalloc(alloc_size, GFP_KERNEL); + if (dev) { + memset(dev, 0, alloc_size); + dev->priv = (char*)dev + netdev_size; + setup(dev); +# if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 0) + dev->name = (char*)(dev + 1); +# endif + strcpy(dev->name, mask); + } + return dev; +} +# define compat_free_netdev(dev) kfree(dev) +#else +# define compat_alloc_netdev(size, mask, setup) alloc_netdev(size, mask, setup) +# define compat_free_netdev(dev) free_netdev(dev) +#endif + +/* netdev_priv() appeared in 2.6.3 */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 3) +# define compat_netdev_priv(netdev) (netdev)->priv +#else +# define compat_netdev_priv(netdev) netdev_priv(netdev) +#endif + +#if defined(NETDEV_TX_OK) +# define COMPAT_NETDEV_TX_OK NETDEV_TX_OK +# define COMPAT_NETDEV_TX_BUSY NETDEV_TX_BUSY +#else +# define COMPAT_NETDEV_TX_OK 0 +# define COMPAT_NETDEV_TX_BUSY 1 +#endif + +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,43)) +static inline void +compat_netif_start_queue(struct device *dev) +{ + clear_bit(0, &dev->tbusy); +} + +static inline void +compat_netif_stop_queue(struct device *dev) +{ + set_bit(0, &dev->tbusy); +} + +static inline int +compat_netif_queue_stopped(struct device *dev) +{ + return test_bit(0, &dev->tbusy); +} + +static inline void +compat_netif_wake_queue(struct device *dev) +{ + clear_bit(0, &dev->tbusy); + mark_bh(NET_BH); +} + +static inline int +compat_netif_running(struct device *dev) +{ + return dev->start == 0; +} + +static inline int +compat_netif_carrier_ok(struct device *dev) +{ + return 1; +} + +static inline void +compat_netif_carrier_on(struct device *dev) +{ +} + +static inline void +compat_netif_carrier_off(struct device *dev) +{ +} + +#else +#define compat_netif_start_queue(dev) netif_start_queue(dev) +#define compat_netif_stop_queue(dev) netif_stop_queue(dev) +#define compat_netif_queue_stopped(dev) netif_queue_stopped(dev) +#define compat_netif_wake_queue(dev) netif_wake_queue(dev) +#define compat_netif_running(dev) netif_running(dev) +#define compat_netif_carrier_ok(dev) netif_carrier_ok(dev) +#define compat_netif_carrier_on(dev) netif_carrier_on(dev) +#define compat_netif_carrier_off(dev) netif_carrier_off(dev) +#endif + +/* unregister_netdevice_notifier was not safe prior to 2.6.17 */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 17) && \ + !defined(ATOMIC_NOTIFIER_INIT) +/* pre 2.6.17 and not patched */ +static inline int compat_unregister_netdevice_notifier(struct notifier_block *nb) { + int err; + + rtnl_lock(); + err = unregister_netdevice_notifier(nb); + rtnl_unlock(); + return err; +} +#else +/* post 2.6.17 or patched */ +#define compat_unregister_netdevice_notifier(_nb) \ + unregister_netdevice_notifier(_nb); +#endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24) +#define compat_netif_napi_add(dev, napi, poll, quota) \ + netif_napi_add(dev, napi, poll, quota) +#define compat_netif_rx_schedule(dev, napi) netif_rx_schedule(dev, napi) +#define compat_napi_enable(dev, napi) napi_enable(napi) +#define compat_napi_disable(dev, napi) napi_disable(napi) +#else +struct napi_struct { + int dummy; +}; + +#define compat_netif_napi_add(dev, napi, pollcb, quota) \ + do { \ + (dev)->poll = (pollcb); \ + (dev)->weight = (quota);\ + } while (0) +#define compat_netif_rx_schedule(dev, napi) netif_rx_schedule(dev) +#define compat_napi_enable(dev, napi) netif_poll_enable(dev) +#define compat_napi_disable(dev, napi) netif_poll_disable(dev) +#endif + +#endif /* __COMPAT_NETDEVICE_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/compat_pci.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/compat_pci.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/compat_pci.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/compat_pci.h 2008-10-13 08:01:46.000000000 +0100 @@ -0,0 +1,590 @@ +/********************************************************* + * Copyright (C) 1999 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * compat_pci.h: PCI compatibility wrappers. + */ + +#ifndef __COMPAT_PCI_H__ +#define __COMPAT_PCI_H__ + +#include "compat_ioport.h" +#include <linux/pci.h> +#ifndef KERNEL_2_1 +# include <linux/bios32.h> +#endif + + +/* 2.0.x has useless struct pci_dev; remap it to our own */ +#ifndef KERNEL_2_1 +#define pci_dev vmw_pci_driver_instance +#endif + + +/* 2.0/2.2 does not have pci driver API */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 0) +struct vmw_pci_driver_instance { + struct vmw_pci_driver_instance *next; + void *driver_data; + struct pci_driver *pcidrv; +#ifdef KERNEL_2_1 + struct pci_dev *pcidev; +#else + unsigned char bus; + unsigned char devfn; + unsigned int irq; +#endif +}; +#endif + + +/* 2.0 has pcibios_* calls only... We have to provide pci_* compatible wrappers. */ +#ifndef KERNEL_2_1 +static inline int +pci_read_config_byte(struct pci_dev *pdev, // IN: PCI slot + unsigned char where, // IN: Byte to read + u8 *value) // OUT: Value read +{ + return pcibios_read_config_byte(pdev->bus, pdev->devfn, where, value); +} + +static inline int +pci_read_config_dword(struct pci_dev *pdev, // IN: PCI slot + unsigned char where, // IN: Dword to read + u32 *value) // OUT: Value read +{ + return pcibios_read_config_dword(pdev->bus, pdev->devfn, where, value); +} + +static inline int +pci_write_config_dword(struct pci_dev *pdev, // IN: PCI slot + unsigned char where, // IN: Dword to write + u32 value) // IN: Value to write +{ + return pcibios_write_config_dword(pdev->bus, pdev->devfn, where, value); +} +#endif + + +/* + *----------------------------------------------------------------------------- + * + * compat_pci_name -- + * + * Return human readable PCI slot name. Note that some implementations + * return a pointer to the static storage, so returned value may be + * overwritten by subsequent calls to this function. + * + * Results: + * Returns pointer to the string with slot name. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 22) +#define compat_pci_name(pdev) pci_name(pdev) +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 0) +#define compat_pci_name(pdev) (pdev)->slot_name +#elif defined(KERNEL_2_1) +static inline const char* +compat_pci_name(struct pci_dev* pdev) +{ + static char slot_name[12]; + sprintf(slot_name, "%02X:%02X.%X", pdev->bus->number, + PCI_SLOT(pdev->devfn), PCI_FUNC(pdev->devfn)); + return slot_name; +} +#else +static inline const char* +compat_pci_name(struct pci_dev* pdev) +{ + static char slot_name[12]; + sprintf(slot_name, "%02X:%02X.%X", pdev->bus, + PCI_SLOT(pdev->devfn), PCI_FUNC(pdev->devfn)); + return slot_name; +} +#endif + + +/* pci_resource_start comes in 4 flavors - 2.0, 2.2, early 2.3, 2.4+ */ +#ifndef KERNEL_2_1 +static inline unsigned long +compat_pci_resource_start(struct pci_dev *pdev, + unsigned int index) +{ + u32 addr; + + if (pci_read_config_dword(pdev, PCI_BASE_ADDRESS_0 + index * 4, &addr)) { + printk(KERN_ERR "Unable to read base address %u from PCI slot %s!\n", + index, compat_pci_name(pdev)); + return ~0UL; + } + if (addr & PCI_BASE_ADDRESS_SPACE) { + return addr & PCI_BASE_ADDRESS_IO_MASK; + } else { + return addr & PCI_BASE_ADDRESS_MEM_MASK; + } +} +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 3, 1) +# define compat_pci_resource_start(dev, index) \ + (((dev)->base_address[index] & PCI_BASE_ADDRESS_SPACE) \ + ? ((dev)->base_address[index] & PCI_BASE_ADDRESS_IO_MASK) \ + : ((dev)->base_address[index] & PCI_BASE_ADDRESS_MEM_MASK)) +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 3, 43) +# define compat_pci_resource_start(dev, index) \ + ((dev)->resource[index].start) +#else +# define compat_pci_resource_start(dev, index) \ + pci_resource_start(dev, index) +#endif + +/* since 2.3.15, a new set of s/w res flags IORESOURCE_ is introduced, + * we fake them by returning either IORESOURCE_{IO, MEM} prior to 2.3.15 since + * this is what compat_pci_request_region uses + */ +#ifndef KERNEL_2_1 +static inline unsigned long +compat_pci_resource_flags(struct pci_dev *pdev, + unsigned int index) +{ + u32 addr; + + if (pci_read_config_dword(pdev, PCI_BASE_ADDRESS_0 + index * 4, &addr)) { + printk(KERN_ERR "Unable to read base address %u from PCI slot %s!\n", + index, compat_pci_name(pdev)); + return ~0UL; + } + if (addr & PCI_BASE_ADDRESS_SPACE) { + return IORESOURCE_IO; + } else { + return IORESOURCE_MEM; + } +} +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 3, 1) +# define compat_pci_resource_flags(dev, index) \ + (((dev)->base_address[index] & PCI_BASE_ADDRESS_SPACE) \ + ? IORESOURCE_IO: IORESOURCE_MEM) +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 3, 15) + /* IORESOURCE_xxx appeared in 2.3.15 and is set in resource[].flags */ +# define compat_pci_resource_flags(dev, index) ((dev)->resource[index].flags) +#else +# define compat_pci_resource_flags(dev, index) pci_resource_flags(dev, index) +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 2, 18) +static inline unsigned long +compat_pci_resource_len(struct pci_dev *pdev, // IN + unsigned int index) // IN +{ + u32 addr, mask; + unsigned char reg = PCI_BASE_ADDRESS_0 + index * 4; + + if (pci_read_config_dword(pdev, reg, &addr) || addr == 0xFFFFFFFF) { + return 0; + } + + pci_write_config_dword(pdev, reg, 0xFFFFFFFF); + pci_read_config_dword(pdev, reg, &mask); + pci_write_config_dword(pdev, reg, addr); + + if (mask == 0 || mask == 0xFFFFFFFF) { + return 0; + } + if (addr & PCI_BASE_ADDRESS_SPACE) { + return 65536 - (mask & PCI_BASE_ADDRESS_IO_MASK & 0xFFFF); + } else { + return -(mask & PCI_BASE_ADDRESS_MEM_MASK); + } +} +#else +#define compat_pci_resource_len(dev, index) pci_resource_len(dev, index) +#endif + +/* pci_request_region appears in 2.4.20 */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 20) +static inline int +compat_pci_request_region(struct pci_dev *pdev, int bar, char *name) +{ + if (compat_pci_resource_len(pdev, bar) == 0) { + return 0; + } + + if (compat_pci_resource_flags(pdev, bar) & IORESOURCE_IO) { + if (!compat_request_region(compat_pci_resource_start(pdev, bar), + compat_pci_resource_len(pdev, bar), + name)) { + return -EBUSY; + } + } else if (compat_pci_resource_flags(pdev, bar) & IORESOURCE_MEM) { + if (!compat_request_mem_region(compat_pci_resource_start(pdev, bar), + compat_pci_resource_len(pdev, bar), + name)) { + return -EBUSY; + } + } + + return 0; +} + +static inline void +compat_pci_release_region(struct pci_dev *pdev, int bar) +{ + if (compat_pci_resource_len(pdev, bar) != 0) { + if (compat_pci_resource_flags(pdev, bar) & IORESOURCE_IO) { + release_region(compat_pci_resource_start(pdev, bar), + compat_pci_resource_len(pdev, bar)); + } else if (compat_pci_resource_flags(pdev, bar) & IORESOURCE_MEM) { + compat_release_mem_region(compat_pci_resource_start(pdev, bar), + compat_pci_resource_len(pdev, bar)); + } + } +} +#else +#define compat_pci_request_region(pdev, bar, name) pci_request_region(pdev, bar, name) +#define compat_pci_release_region(pdev, bar) pci_release_region(pdev, bar) +#endif + +/* pci_request_regions appeears in 2.4.3 */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 3) +static inline int +compat_pci_request_regions(struct pci_dev *pdev, char *name) +{ + int i; + + for (i = 0; i < 6; i++) { + if (compat_pci_request_region(pdev, i, name)) { + goto release; + } + } + return 0; + +release: + while (--i >= 0) { + compat_pci_release_region(pdev, i); + } + return -EBUSY; +} +static inline void +compat_pci_release_regions(struct pci_dev *pdev) +{ + int i; + + for (i = 0; i < 6; i++) { + compat_pci_release_region(pdev, i); + } +} +#else +#define compat_pci_request_regions(pdev, name) pci_request_regions(pdev, name) +#define compat_pci_release_regions(pdev) pci_release_regions(pdev) +#endif + +/* pci_enable_device is available since 2.4.0 */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 0) +#define compat_pci_enable_device(pdev) (0) +#else +#define compat_pci_enable_device(pdev) pci_enable_device(pdev) +#endif + + +/* pci_set_master is available since 2.2.0 */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 2, 0) +#define compat_pci_set_master(pdev) (0) +#else +#define compat_pci_set_master(pdev) pci_set_master(pdev) +#endif + + +/* pci_disable_device is available since 2.4.4 */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 4) +#define compat_pci_disable_device(pdev) do {} while (0) +#else +#define compat_pci_disable_device(pdev) pci_disable_device(pdev) +#endif + + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 0) +/* + * Devices supported by particular pci driver. While 2.4+ kernels + * can do match on subsystem and class too, we support match on + * vendor/device IDs only. + */ +struct pci_device_id { + unsigned int vendor, device; + unsigned long driver_data; +}; +#define PCI_DEVICE(vend, dev) .vendor = (vend), .device = (dev) + +/* PCI driver */ +struct pci_driver { + const char *name; + const struct pci_device_id *id_table; + int (*probe)(struct pci_dev* dev, const struct pci_device_id* id); + void (*remove)(struct pci_dev* dev); +}; + + +/* + * Note that this is static variable. Maybe everything below should be in + * separate compat_pci.c file, but currently only user of this file is vmxnet, + * and vmxnet has only one file, so it is fine. Also with vmxnet all + * functions below are called just once, so difference between 'inline' and + * separate compat_pci.c should be very small. + */ + +static struct vmw_pci_driver_instance *pci_driver_instances = NULL; + +#ifdef KERNEL_2_1 +#define vmw_pci_device(instance) (instance)->pcidev +#else +#define vmw_pci_device(instance) (instance) +#endif + + +/* + *----------------------------------------------------------------------------- + * + * pci_register_driver -- + * + * Create driver instances for all matching PCI devices in the box. + * + * Results: + * Returns 0 for success, negative error value for failure. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static inline int +pci_register_driver(struct pci_driver *drv) +{ + const struct pci_device_id *chipID; + + for (chipID = drv->id_table; chipID->vendor; chipID++) { +#ifdef KERNEL_2_1 + struct pci_dev *pdev; + + for (pdev = NULL; + (pdev = pci_find_device(chipID->vendor, chipID->device, pdev)) != NULL; ) { +#else + int adapter; + unsigned char bus, devfn, irq; + + for (adapter = 0; + pcibios_find_device(chipID->vendor, chipID->device, adapter, + &bus, &devfn) == 0; + adapter++) { +#endif + struct vmw_pci_driver_instance *pdi; + int err; + + pdi = kmalloc(sizeof *pdi, GFP_KERNEL); + if (!pdi) { + printk(KERN_ERR "Not enough memory.\n"); + break; + } + pdi->pcidrv = drv; +#ifdef KERNEL_2_1 + pdi->pcidev = pdev; +#else + pdi->bus = bus; + pdi->devfn = devfn; + if (pci_read_config_byte(pdi, PCI_INTERRUPT_LINE, &irq)) { + pdi->irq = -1; + } else { + pdi->irq = irq; + } +#endif + pdi->driver_data = NULL; + pdi->next = pci_driver_instances; + pci_driver_instances = pdi; + err = drv->probe(vmw_pci_device(pdi), chipID); + if (err) { + pci_driver_instances = pdi->next; + kfree(pdi); + } + } + } + return 0; +} + + +/* + *----------------------------------------------------------------------------- + * + * compat_pci_unregister_driver -- + * + * Shut down PCI driver - unbind all device instances from driver. + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static inline void +pci_unregister_driver(struct pci_driver *drv) +{ + struct vmw_pci_driver_instance **ppdi; + + ppdi = &pci_driver_instances; + while (1) { + struct vmw_pci_driver_instance *pdi = *ppdi; + + if (!pdi) { + break; + } + if (pdi->pcidrv == drv) { + drv->remove(vmw_pci_device(pdi)); + *ppdi = pdi->next; + kfree(pdi); + } else { + ppdi = &pdi->next; + } + } +} +#else +/* provide PCI_DEVICE for early 2.4.x kernels */ +#ifndef PCI_DEVICE +#define PCI_DEVICE(vend, dev) .vendor = (vend), .device = (dev), \ + .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID +#endif +#endif + + +/* provide dummy MODULE_DEVICE_TABLE for 2.0/2.2 */ +#ifndef MODULE_DEVICE_TABLE +#define MODULE_DEVICE_TABLE(bus, devices) +#endif + + +/* + *----------------------------------------------------------------------------- + * + * pci_set_drvdata -- + * + * Set per-device driver's private data. + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +/* + *----------------------------------------------------------------------------- + * + * pci_get_drvdata -- + * + * Retrieve per-device driver's private data. + * + * Results: + * per-device driver's data previously set by pci_set_drvdata, + * or NULL on failure. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +#ifndef KERNEL_2_1 +/* 2.0.x is simple, we have driver_data directly in pci_dev */ +#define pci_set_drvdata(pdev, data) do { (pdev)->driver_data = (data); } while (0) +#define pci_get_drvdata(pdev) (pdev)->driver_data +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 0) +/* 2.2.x is trickier, we have to find driver instance first */ +static inline void +pci_set_drvdata(struct pci_dev *pdev, void* data) +{ + struct vmw_pci_driver_instance *pdi; + + for (pdi = pci_driver_instances; pdi; pdi = pdi->next) { + if (pdi->pcidev == pdev) { + pdi->driver_data = data; + return; + } + } + printk(KERN_ERR "pci_set_drvdata issued for unknown device %p\n", pdev); +} + +static inline void * +pci_get_drvdata(struct pci_dev *pdev) +{ + struct vmw_pci_driver_instance *pdi; + + for (pdi = pci_driver_instances; pdi; pdi = pdi->next) { + if (pdi->pcidev == pdev) { + return pdi->driver_data; + } + } + printk(KERN_ERR "pci_get_drvdata issued for unknown device %p\n", pdev); + return NULL; +} +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,3,48) +# define PCI_DMA_BIDIRECTIONAL 0 +# define PCI_DMA_TODEVICE 1 +# define PCI_DMA_FROMDEVICE 2 +# define PCI_DMA_NONE 3 +#endif + +/* + * Power Management related compat wrappers. + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 10) +# define compat_pci_save_state(pdev) pci_save_state((pdev), NULL) +# define compat_pci_restore_state(pdev) pci_restore_state((pdev), NULL) +#else +# define compat_pci_save_state(pdev) pci_save_state((pdev)) +# define compat_pci_restore_state(pdev) pci_restore_state((pdev)) +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 11) +# define pm_message_t u32 +# define compat_pci_choose_state(pdev, state) (state) +# define PCI_D0 0 +# define PCI_D3hot 3 +#else +# define compat_pci_choose_state(pdev, state) pci_choose_state((pdev), (state)) +#endif + +/* 2.6.14 changed the PCI shutdown callback */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,14) +# define COMPAT_PCI_SHUTDOWN(func) .driver = { .shutdown = (func), } +# define COMPAT_PCI_DECLARE_SHUTDOWN(func, var) (func)(struct device *(var)) +# define COMPAT_PCI_TO_DEV(dev) (to_pci_dev(dev)) +#else +# define COMPAT_PCI_SHUTDOWN(func) .shutdown = (func) +# define COMPAT_PCI_DECLARE_SHUTDOWN(func, var) (func)(struct pci_dev *(var)) +# define COMPAT_PCI_TO_DEV(dev) (dev) +#endif + + +#endif /* __COMPAT_PCI_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/compat_skbuff.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/compat_skbuff.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/compat_skbuff.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/compat_skbuff.h 2008-10-13 08:01:46.000000000 +0100 @@ -0,0 +1,156 @@ +/********************************************************* + * Copyright (C) 2007 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +#ifndef __COMPAT_SKBUFF_H__ +# define __COMPAT_SKBUFF_H__ + +#include <linux/skbuff.h> + +/* + * When transition from mac/nh/h to skb_* accessors was made, also SKB_WITH_OVERHEAD + * was introduced. + */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22) || \ + (LINUX_VERSION_CODE == KERNEL_VERSION(2, 6, 21) && defined(SKB_WITH_OVERHEAD)) +#define compat_skb_mac_header(skb) skb_mac_header(skb) +#define compat_skb_network_header(skb) skb_network_header(skb) +#define compat_skb_network_offset(skb) skb_network_offset(skb) +#define compat_skb_transport_header(skb) skb_transport_header(skb) +#define compat_skb_transport_offset(skb) skb_transport_offset(skb) +#define compat_skb_network_header_len(skb) skb_network_header_len(skb) +#define compat_skb_tail_pointer(skb) skb_tail_pointer(skb) +#define compat_skb_end_pointer(skb) skb_end_pointer(skb) +#define compat_skb_ip_header(skb) ((struct iphdr *)skb_network_header(skb)) +#define compat_skb_tcp_header(skb) ((struct tcphdr *)skb_transport_header(skb)) +#define compat_skb_reset_mac_header(skb) skb_reset_mac_header(skb) +#define compat_skb_set_network_header(skb, off) skb_set_network_header(skb, off) +#define compat_skb_set_transport_header(skb, off) skb_set_transport_header(skb, off) +#else +#define compat_skb_mac_header(skb) (skb)->mac.raw +#define compat_skb_network_header(skb) (skb)->nh.raw +#define compat_skb_network_offset(skb) ((skb)->nh.raw - (skb)->data) +#define compat_skb_transport_header(skb) (skb)->h.raw +#define compat_skb_transport_offset(skb) ((skb)->h.raw - (skb)->data) +#define compat_skb_network_header_len(skb) ((skb)->h.raw - (skb)->nh.raw) +#define compat_skb_tail_pointer(skb) (skb)->tail +#define compat_skb_end_pointer(skb) (skb)->end +#define compat_skb_ip_header(skb) (skb)->nh.iph +#define compat_skb_tcp_header(skb) (skb)->h.th +#define compat_skb_reset_mac_header(skb) ((skb)->mac.raw = (skb)->data) +#define compat_skb_set_network_header(skb, off) ((skb)->nh.raw = (skb)->data + (off)) +#define compat_skb_set_transport_header(skb, off) ((skb)->h.raw = (skb)->data + (off)) +#endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 18) || defined(VMW_SKB_LINEARIZE_2618) +# define compat_skb_linearize(skb) skb_linearize((skb)) +#else + +# if LINUX_VERSION_CODE == KERNEL_VERSION(2, 6, 0) +# define compat_skb_linearize(skb) __skb_linearize((skb), GFP_ATOMIC) +# elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 4) +# define compat_skb_linearize(skb) skb_linearize((skb), GFP_ATOMIC) +# else +static inline int +compat_skb_linearize(struct sk_buff *skb) +{ + return 0; +} +# endif + +#endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 20) +#define compat_skb_csum_offset(skb) (skb)->csum_offset +#else +#define compat_skb_csum_offset(skb) (skb)->csum +#endif + +/* + * Note that compat_skb_csum_start() has semantic different from kernel's csum_start: + * kernel's skb->csum_start is offset between start of checksummed area and start of + * complete skb buffer, while our compat_skb_csum_start(skb) is offset from start + * of packet itself. + */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22) +#define compat_skb_csum_start(skb) ((skb)->csum_start - skb_headroom(skb)) +#else +#define compat_skb_csum_start(skb) compat_skb_transport_offset(skb) +#endif + +#if defined(NETIF_F_GSO) /* 2.6.18 and upwards */ +#define compat_skb_mss(skb) (skb_shinfo(skb)->gso_size) +#else +#define compat_skb_mss(skb) (skb_shinfo(skb)->tso_size) +#endif + +/* used by both received pkts and outgoing ones */ +#define VM_CHECKSUM_UNNECESSARY CHECKSUM_UNNECESSARY + +/* csum status of received pkts */ +#if defined(CHECKSUM_COMPLETE) +# define VM_RX_CHECKSUM_PARTIAL CHECKSUM_COMPLETE +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19) && defined(CHECKSUM_HW) +# define VM_RX_CHECKSUM_PARTIAL CHECKSUM_HW +#else +# define VM_RX_CHECKSUM_PARTIAL CHECKSUM_PARTIAL +#endif + +/* csum status of outgoing pkts */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19) && defined(CHECKSUM_HW) +# define VM_TX_CHECKSUM_PARTIAL CHECKSUM_HW +#else +# define VM_TX_CHECKSUM_PARTIAL CHECKSUM_PARTIAL +#endif + +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,1,0)) +# define compat_kfree_skb(skb, type) kfree_skb(skb, type) +# define compat_dev_kfree_skb(skb, type) dev_kfree_skb(skb, type) +# define compat_dev_kfree_skb_any(skb, type) dev_kfree_skb(skb, type) +# define compat_dev_kfree_skb_irq(skb, type) dev_kfree_skb(skb, type) +#else +# define compat_kfree_skb(skb, type) kfree_skb(skb) +# define compat_dev_kfree_skb(skb, type) dev_kfree_skb(skb) +# if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,43)) +# define compat_dev_kfree_skb_any(skb, type) dev_kfree_skb(skb) +# define compat_dev_kfree_skb_irq(skb, type) dev_kfree_skb(skb) +# else +# define compat_dev_kfree_skb_any(skb, type) dev_kfree_skb_any(skb) +# define compat_dev_kfree_skb_irq(skb, type) dev_kfree_skb_irq(skb) +# endif +#endif + +#ifndef NET_IP_ALIGN +# define COMPAT_NET_IP_ALIGN 2 +#else +# define COMPAT_NET_IP_ALIGN NET_IP_ALIGN +#endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 4) +# define compat_skb_headlen(skb) skb_headlen(skb) +# define compat_pskb_may_pull(skb, len) pskb_may_pull(skb, len) +#else +# define compat_skb_headlen(skb) (skb)->len +# define compat_pskb_may_pull(skb, len) 1 +#endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 12) +# define compat_skb_header_cloned(skb) skb_header_cloned(skb) +#else +# define compat_skb_header_cloned(skb) 0 +#endif +#endif /* __COMPAT_SKBUFF_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/compat_slab.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/compat_slab.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/compat_slab.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/compat_slab.h 2008-10-13 08:01:46.000000000 +0100 @@ -0,0 +1,85 @@ +/********************************************************* + * Copyright (C) 2005 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +#ifndef __COMPAT_SLAB_H__ +# define __COMPAT_SLAB_H__ + + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 2, 0) +# include <linux/slab.h> +#else +# include <linux/malloc.h> +#endif + +/* + * Before 2.6.20, kmem_cache_t was the accepted way to refer to a kmem_cache + * structure. Prior to 2.6.15, this structure was called kmem_cache_s, and + * afterwards it was renamed to kmem_cache. Here we keep things simple and use + * the accepted typedef until it became deprecated, at which point we switch + * over to the kmem_cache name. + */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 20) +# define compat_kmem_cache struct kmem_cache +#else +# define compat_kmem_cache kmem_cache_t +#endif + +/* + * Up to 2.6.22 kmem_cache_create has 6 arguments - name, size, alignment, flags, + * constructor, and destructor. Then for some time kernel was asserting that + * destructor is NULL, and since 2.6.23-pre1 kmem_cache_create takes only 5 + * arguments - destructor is gone. + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 22) || defined(VMW_KMEMCR_HAS_DTOR) +#define compat_kmem_cache_create(name, size, align, flags, ctor) \ + kmem_cache_create(name, size, align, flags, ctor, NULL) +#else +#define compat_kmem_cache_create(name, size, align, flags, ctor) \ + kmem_cache_create(name, size, align, flags, ctor) +#endif + +/* + * Up to 2.6.23 kmem_cache constructor has three arguments - pointer to block to + * prepare (aka "this"), from which cache it came, and some unused flags. After + * 2.6.23 flags were removed, and order of "this" and cache parameters was swapped... + * Since 2.6.27-rc2 everything is different again, and ctor has only one argument. + * + * HAS_3_ARGS has precedence over HAS_2_ARGS if both are defined. + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 23) && !defined(VMW_KMEMCR_CTOR_HAS_3_ARGS) +# define VMW_KMEMCR_CTOR_HAS_3_ARGS +#endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26) && !defined(VMW_KMEMCR_CTOR_HAS_2_ARGS) +# define VMW_KMEMCR_CTOR_HAS_2_ARGS +#endif + +#if defined(VMW_KMEMCR_CTOR_HAS_3_ARGS) +typedef void compat_kmem_cache_ctor(void *, compat_kmem_cache *, unsigned long); +#define COMPAT_KMEM_CACHE_CTOR_ARGS(arg) void *arg, \ + compat_kmem_cache *cache, \ + unsigned long flags +#elif defined(VMW_KMEMCR_CTOR_HAS_2_ARGS) +typedef void compat_kmem_cache_ctor(compat_kmem_cache *, void *); +#define COMPAT_KMEM_CACHE_CTOR_ARGS(arg) compat_kmem_cache *cache, \ + void *arg +#else +typedef void compat_kmem_cache_ctor(void *); +#define COMPAT_KMEM_CACHE_CTOR_ARGS(arg) void *arg +#endif + +#endif /* __COMPAT_SLAB_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/compat_spinlock.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/compat_spinlock.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/compat_spinlock.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/compat_spinlock.h 2008-10-13 08:01:46.000000000 +0100 @@ -0,0 +1,68 @@ +/********************************************************* + * Copyright (C) 2005 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +#ifndef __COMPAT_SPINLOCK_H__ +# define __COMPAT_SPINLOCK_H__ + + +/* + * The spin_lock() API appeared in 2.1.25 in asm/smp_lock.h + * It moved in 2.1.30 to asm/spinlock.h + * It moved again in 2.3.18 to linux/spinlock.h + * + * --hpreg + */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 3, 18) +# include <linux/spinlock.h> +#else +# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 1, 30) +# include <asm/spinlock.h> +# else +typedef struct {} spinlock_t; +# define spin_lock_init(lock) +# define spin_lock(lock) +# define spin_unlock(lock) +# define spin_lock_irqsave(lock, flags) do { \ + save_flags(flags); \ + cli(); \ + spin_lock(lock); \ + } while (0) +# define spin_unlock_irqrestore(lock, flags) do { \ + spin_unlock(lock); \ + restore_flags(flags); \ + } while (0) +# endif +#endif + + +/* + * Preempt support was added during 2.5.x development cycle, and later + * it was backported to 2.4.x. In 2.4.x backport these definitions + * live in linux/spinlock.h, that's why we put them here (in 2.6.x they + * are defined in linux/preempt.h which is included by linux/spinlock.h). + */ +#ifdef CONFIG_PREEMPT +#define compat_preempt_disable() preempt_disable() +#define compat_preempt_enable() preempt_enable() +#else +#define compat_preempt_disable() do { } while (0) +#define compat_preempt_enable() do { } while (0) +#endif + + +#endif /* __COMPAT_SPINLOCK_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/compat_timer.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/compat_timer.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/compat_timer.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/compat_timer.h 2008-10-13 08:01:46.000000000 +0100 @@ -0,0 +1,103 @@ +/********************************************************* + * Copyright (C) 2002 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +#ifndef __COMPAT_TIMER_H__ +# define __COMPAT_TIMER_H__ + + +/* + * The del_timer_sync() API appeared in 2.3.43 + * It became reliable in 2.4.0-test3 + * + * --hpreg + */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 0) +# define compat_del_timer_sync(timer) del_timer_sync(timer) +#else +# if LINUX_VERSION_CODE < KERNEL_VERSION(2, 3, 43) + /* 2.3.43 removed asm/softirq.h's reference to bh_base. */ +# include <linux/interrupt.h> +# endif +# include <asm/softirq.h> + +static inline int +compat_del_timer_sync(struct timer_list *timer) // IN +{ + int wasPending; + + start_bh_atomic(); + wasPending = del_timer(timer); + end_bh_atomic(); + + return wasPending; +} +#endif + + +/* + * The msleep_interruptible() API appeared in 2.6.9. + * It is based on the msleep() API, which appeared in 2.4.29. + */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 9) +# include <linux/delay.h> +# define compat_msleep_interruptible(msecs) msleep_interruptible(msecs) +# define compat_msleep(msecs) msleep(msecs) +#else +# include <linux/sched.h> +/* + * msecs_to_jiffies appeared in 2.6.7. For earlier kernels, + * fall back to slow-case code (we don't use this operation + * enough to need the performance). + */ +# if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 7) +# define msecs_to_jiffies(msecs) (((msecs) * HZ + 999) / 1000) +# endif +/* + * set_current_state appeared in 2.2.18. + */ +# if LINUX_VERSION_CODE < KERNEL_VERSION(2, 2, 18) +# define set_current_state(a) do { current->state = (a); } while(0) +# endif + +static inline void +compat_msleep_interruptible(unsigned long msecs) // IN +{ + set_current_state(TASK_INTERRUPTIBLE); + schedule_timeout(msecs_to_jiffies(msecs) + 1); +} + +static inline void +compat_msleep(unsigned long msecs) // IN +{ + set_current_state(TASK_UNINTERRUPTIBLE); + schedule_timeout(msecs_to_jiffies(msecs) + 1); +} +#endif + + +/* + * There is init_timer_deferrable() since 2.6.22. + */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 22) +# define compat_init_timer_deferrable(timer) init_timer_deferrable(timer) +#else +# define compat_init_timer_deferrable(timer) init_timer(timer) +#endif + + +#endif /* __COMPAT_TIMER_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/compat_version.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/compat_version.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/compat_version.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/compat_version.h 2008-10-13 08:01:46.000000000 +0100 @@ -0,0 +1,121 @@ +/********************************************************* + * Copyright (C) 1998 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +#ifndef __COMPAT_VERSION_H__ +# define __COMPAT_VERSION_H__ + +#define INCLUDE_ALLOW_VMMON +#define INCLUDE_ALLOW_MODULE +#define INCLUDE_ALLOW_VMCORE +#define INCLUDE_ALLOW_VMNIXMOD +#define INCLUDE_ALLOW_DISTRIBUTE +#include "includeCheck.h" + + +#ifndef __linux__ +# error "linux-version.h" +#endif + + +#include <linux/version.h> + +/* Appeared in 2.1.90 --hpreg */ +#ifndef KERNEL_VERSION +# define KERNEL_VERSION(a, b, c) (((a) << 16) + ((b) << 8) + (c)) +#endif + + +/* + * Distinguish relevant classes of Linux kernels. + * + * The convention is that version X defines all + * the KERNEL_Y symbols where Y <= X. + * + * XXX Do not add more definitions here. This way of doing things does not + * scale, and we are going to phase it out soon --hpreg + */ + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 1, 0) +# define KERNEL_2_1 +#endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 2, 0) +# define KERNEL_2_2 +#endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 3, 1) +# define KERNEL_2_3_1 +#endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 3, 15) +/* new networking */ +# define KERNEL_2_3_15 +#endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 3, 25) +/* new procfs */ +# define KERNEL_2_3_25 +#endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 3, 29) +/* even newer procfs */ +# define KERNEL_2_3_29 +#endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 3, 43) +/* softnet changes */ +# define KERNEL_2_3_43 +#endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 3, 47) +/* more softnet changes */ +# define KERNEL_2_3_47 +#endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 3, 99) +/* name in netdevice struct is array and not pointer */ +# define KERNEL_2_3_99 +#endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 0) +/* New 'owner' member at the beginning of struct file_operations */ +# define KERNEL_2_4_0 +#endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 8) +/* New netif_rx_ni() --hpreg */ +# define KERNEL_2_4_8 +#endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 22) +/* New vmap() */ +# define KERNEL_2_4_22 +#endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 2) +/* New kdev_t, major()/minor() API --hpreg */ +# define KERNEL_2_5_2 +#endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 5) +/* New sk_alloc(), pte_offset_map()/pte_unmap() --hpreg */ +# define KERNEL_2_5_5 +#endif + + +#endif /* __COMPAT_VERSION_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/compat_workqueue.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/compat_workqueue.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/compat_workqueue.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/compat_workqueue.h 2008-10-13 08:01:46.000000000 +0100 @@ -0,0 +1,165 @@ +/********************************************************* + * Copyright (C) 2007 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +#ifndef __COMPAT_WORKQUEUE_H__ +# define __COMPAT_WORKQUEUE_H__ + +#include <linux/kernel.h> + +#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 5, 41) +# include <linux/workqueue.h> +#endif + +/* + * + * Work queues and delayed work queues. + * + * Prior to 2.5.41, the notion of work queues did not exist. Taskqueues are + * used for work queues and timers are used for delayed work queues. + * + * After 2.6.20, normal work structs ("work_struct") and delayed work + * ("delayed_work") structs were separated so that the work_struct could be + * slimmed down. The interface was also changed such that the address of the + * work_struct itself is passed in as the argument to the work function. This + * requires that one embed the work struct in the larger struct containing the + * information necessary to complete the work and use container_of() to obtain + * the address of the containing structure. + * + * Users of these macros should embed a compat_work or compat_delayed_work in + * a larger structure, then specify the larger structure as the _data argument + * for the initialization functions, specify the work function to take + * a compat_work_arg or compat_delayed_work_arg, then use the appropriate + * _GET_DATA macro to obtain the reference to the structure passed in as _data. + * An example is below. + * + * + * typedef struct WorkData { + * int data; + * compat_work work; + * } WorkData; + * + * + * void + * WorkFunc(compat_work_arg data) + * { + * WorkData *workData = COMPAT_WORK_GET_DATA(data, WorkData, work); + * + * ... + * } + * + * + * { + * WorkData *workData = kmalloc(sizeof *workData, GFP_EXAMPLE); + * if (!workData) { + * return -ENOMEM; + * } + * + * COMPAT_INIT_WORK(&workData->work, WorkFunc, workData); + * compat_schedule_work(&workData->work); + * } + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 41) /* { */ +typedef struct tq_struct compat_work; +typedef struct compat_delayed_work { + struct tq_struct work; + struct timer_list timer; +} compat_delayed_work; +typedef void * compat_work_arg; +typedef void * compat_delayed_work_arg; + +/* + * Delayed work queues need to run at some point in the future in process + * context, but task queues don't support delaying the task one is scheduling. + * Timers allow us to delay the execution of our work queue until the future, + * but timer handlers run in bottom-half context. As such, we use both a timer + * and task queue and use the timer handler below to schedule the task in + * process context immediately. The timer lets us delay execution, and the + * task queue lets us run in process context. + * + * Note that this is similar to how delayed_work is implemented with work + * queues in later kernel versions. + */ +static inline void +__compat_delayed_work_timer(unsigned long arg) +{ + compat_delayed_work *dwork = (compat_delayed_work *)arg; + if (dwork) { + schedule_task(&dwork->work); + } +} + +# define COMPAT_INIT_WORK(_work, _func, _data) \ + INIT_LIST_HEAD(&(_work)->list); \ + (_work)->sync = 0; \ + (_work)->routine = _func; \ + (_work)->data = _data +# define COMPAT_INIT_DELAYED_WORK(_work, _func, _data) \ + COMPAT_INIT_WORK(&(_work)->work, _func, _data); \ + init_timer(&(_work)->timer); \ + (_work)->timer.expires = 0; \ + (_work)->timer.function = __compat_delayed_work_timer; \ + (_work)->timer.data = (unsigned long)_work +# define compat_schedule_work(_work) \ + schedule_task(_work) +# define compat_schedule_delayed_work(_work, _delay) \ + (_work)->timer.expires = jiffies + _delay; \ + add_timer(&(_work)->timer) +# define COMPAT_WORK_GET_DATA(_p, _type) \ + (_type *)(_p) +# define COMPAT_DELAYED_WORK_GET_DATA(_p, _type, _member) \ + (_type *)(_p) + +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) /* } { */ +typedef struct work_struct compat_work; +typedef struct work_struct compat_delayed_work; +typedef void * compat_work_arg; +typedef void * compat_delayed_work_arg; +# define COMPAT_INIT_WORK(_work, _func, _data) \ + INIT_WORK(_work, _func, _data) +# define COMPAT_INIT_DELAYED_WORK(_work, _func, _data) \ + INIT_WORK(_work, _func, _data) +# define compat_schedule_work(_work) \ + schedule_work(_work) +# define compat_schedule_delayed_work(_work, _delay) \ + schedule_delayed_work(_work, _delay) +# define COMPAT_WORK_GET_DATA(_p, _type) \ + (_type *)(_p) +# define COMPAT_DELAYED_WORK_GET_DATA(_p, _type, _member) \ + (_type *)(_p) + +#else /* } Linux >= 2.6.20 { */ +typedef struct work_struct compat_work; +typedef struct delayed_work compat_delayed_work; +typedef struct work_struct * compat_work_arg; +typedef struct work_struct * compat_delayed_work_arg; +# define COMPAT_INIT_WORK(_work, _func, _data) \ + INIT_WORK(_work, _func) +# define COMPAT_INIT_DELAYED_WORK(_work, _func, _data) \ + INIT_DELAYED_WORK(_work, _func) +# define compat_schedule_work(_work) \ + schedule_work(_work) +# define compat_schedule_delayed_work(_work, _delay) \ + schedule_delayed_work(_work, _delay) +# define COMPAT_WORK_GET_DATA(_p, _type) \ + container_of(_p, _type, work) +# define COMPAT_DELAYED_WORK_GET_DATA(_p, _type, _member) \ + container_of(_p, _type, _member.work) +#endif /* } */ + +#endif /* __COMPAT_WORKQUEUE_H__ */ + diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/COPYING /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/COPYING --- open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/COPYING 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/COPYING 2008-10-13 08:01:46.000000000 +0100 @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 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. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + <signature of Ty Coon>, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/driver-config.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/driver-config.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/driver-config.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/driver-config.h 2008-10-13 08:01:46.000000000 +0100 @@ -0,0 +1,78 @@ +/********************************************************* + * Copyright (C) 1998 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * Sets the proper defines from the Linux header files + * + * This file must be included before the inclusion of any kernel header file, + * with the exception of linux/autoconf.h and linux/version.h --hpreg + */ + +#ifndef __VMX_CONFIG_H__ +#define __VMX_CONFIG_H__ + +#define INCLUDE_ALLOW_VMCORE +#define INCLUDE_ALLOW_VMMON +#define INCLUDE_ALLOW_MODULE +#define INCLUDE_ALLOW_VMNIXMOD +#include "includeCheck.h" + +#include <linux/autoconf.h> +#include "compat_version.h" + +/* + * We rely on Kernel Module support. Check here. + */ +#ifndef CONFIG_MODULES +# error "No Module support in this kernel. Please configure with CONFIG_MODULES" +#endif + +/* + * 2.2 kernels still use __SMP__ (derived from CONFIG_SMP + * in the main Makefile), so we do it here. + */ + +#ifdef CONFIG_SMP +# define __SMP__ 1 +#endif + +#if defined(CONFIG_MODVERSIONS) && defined(KERNEL_2_1) +# if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,60) +/* + * MODVERSIONS might be already defined when using kernel's Makefiles. + */ +# ifndef MODVERSIONS +# define MODVERSIONS +# endif +# include <linux/modversions.h> +# endif +#endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24) +/* + * Force the uintptr_t definition to come from linux/types.h instead of vm_basic_types.h. + */ +# include <linux/types.h> +# define _STDINT_H 1 +#endif + +#ifndef __KERNEL__ +# define __KERNEL__ +#endif + +#endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/includeCheck.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/includeCheck.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/includeCheck.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/includeCheck.h 2008-10-13 08:01:46.000000000 +0100 @@ -0,0 +1,132 @@ +/********************************************************* + * Copyright (C) 1998 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * includeCheck.h -- + * + * Restrict include file use. + * + * In every .h file, define one or more of these + * + * INCLUDE_ALLOW_VMX + * INCLUDE_ALLOW_USERLEVEL + * INCLUDE_ALLOW_VMMEXT + * INCLUDE_ALLOW_VMCORE + * INCLUDE_ALLOW_MODULE + * INCLUDE_ALLOW_VMNIXMOD + * INCLUDE_ALLOW_VMKERNEL + * INCLUDE_ALLOW_DISTRIBUTE + * INCLUDE_ALLOW_VMK_MODULE + * INCLUDE_ALLOW_VMKDRIVERS + * INCLUDE_ALLOW_VMIROM + * + * Then include this file. + * + * Any file that has INCLUDE_ALLOW_DISTRIBUTE defined will potentially + * be distributed in source form along with GPLed code. Ensure + * that this is acceptable. + */ + + +/* + * Declare a VMCORE-only variable to help classify object + * files. The variable goes in the common block and does + * not create multiple definition link-time conflicts. + */ + +#if defined VMCORE && defined VMX86_DEVEL && defined VMX86_DEBUG && \ + defined linux && !defined MODULE && \ + !defined COMPILED_WITH_VMCORE +#define COMPILED_WITH_VMCORE compiled_with_vmcore +#ifdef ASM + .comm compiled_with_vmcore, 0 +#else + asm(".comm compiled_with_vmcore, 0"); +#endif /* ASM */ +#endif + + +#if defined VMCORE && \ + !(defined VMX86_VMX || defined VMM || \ + defined MONITOR_APP || defined VMMON) +#error "Makefile problem: VMCORE without VMX86_VMX or \ + VMM or MONITOR_APP or MODULE." +#endif + +#if defined VMCORE && !defined INCLUDE_ALLOW_VMCORE +#error "The surrounding include file is not allowed in vmcore." +#endif +#undef INCLUDE_ALLOW_VMCORE + +#if defined VMX86_VMX && !defined VMCORE && \ + !(defined INCLUDE_ALLOW_VMX || defined INCLUDE_ALLOW_USERLEVEL) +#error "The surrounding include file is not allowed in the VMX." +#endif +#undef INCLUDE_ALLOW_VMX + +#if defined USERLEVEL && !defined VMX86_VMX && !defined VMCORE && \ + !defined INCLUDE_ALLOW_USERLEVEL +#error "The surrounding include file is not allowed at userlevel." +#endif +#undef INCLUDE_ALLOW_USERLEVEL + +#if defined VMM && !defined VMCORE && \ + !defined INCLUDE_ALLOW_VMMEXT +#error "The surrounding include file is not allowed in the monitor." +#endif +#undef INCLUDE_ALLOW_VMMEXT + +#if defined MODULE && !defined VMKERNEL_MODULE && !defined VMNIXMOD && \ + !defined VMMON && !defined INCLUDE_ALLOW_MODULE +#error "The surrounding include file is not allowed in driver modules." +#endif +#undef INCLUDE_ALLOW_MODULE + +#if defined VMMON && !defined INCLUDE_ALLOW_VMMON +#error "The surrounding include file is not allowed in vmmon." +#endif +#undef INCLUDE_ALLOW_VMMON + +#if defined VMKERNEL && !defined INCLUDE_ALLOW_VMKERNEL +#error "The surrounding include file is not allowed in the vmkernel." +#endif +#undef INCLUDE_ALLOW_VMKERNEL + +#if defined GPLED_CODE && !defined INCLUDE_ALLOW_DISTRIBUTE +#error "The surrounding include file is not allowed in GPL code." +#endif +#undef INCLUDE_ALLOW_DISTRIBUTE + +#if defined VMKERNEL_MODULE && !defined VMKERNEL && \ + !defined INCLUDE_ALLOW_VMK_MODULE && !defined INCLUDE_ALLOW_VMKDRIVERS +#error "The surrounding include file is not allowed in vmkernel modules." +#endif +#undef INCLUDE_ALLOW_VMK_MODULE +#undef INCLUDE_ALLOW_VMKDRIVERS + +#if defined VMNIXMOD && !defined INCLUDE_ALLOW_VMNIXMOD +#ifndef VMNIXMOD_VM +#error "The surrounding include file is not allowed in vmnixmod." +#endif +#endif +#undef INCLUDE_ALLOW_VMNIXMOD + +#if defined VMIROM && ! defined INCLUDE_ALLOW_VMIROM +#error "The surrounding include file is not allowed in vmirom." +#endif +#undef INCLUDE_ALLOW_VMIROM diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/Makefile /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/Makefile --- open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/Makefile 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/Makefile 2008-10-13 08:01:47.000000000 +0100 @@ -0,0 +1,149 @@ +#!/usr/bin/make -f +########################################################## +# Copyright (C) 1998 VMware, Inc. All rights reserved. +# +# 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 version 2 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 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 +# +########################################################## + +#### +#### VMware kernel module Makefile to be distributed externally +#### + +#### +#### SRCROOT _must_ be a relative path. +#### +SRCROOT = . + +VM_UNAME = $(shell uname -r) + +# Header directory for the running kernel +HEADER_DIR = /lib/modules/$(VM_UNAME)/build/include + +BUILD_DIR = $(HEADER_DIR)/.. + +DRIVER := vmxnet3 +PRODUCT := @PRODUCT@ + +# Grep program +GREP = /bin/grep + +vm_check_gcc = $(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null \ + > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi) +vm_check_file = $(shell if test -f $(1); then echo "yes"; else echo "no"; fi) + +ifndef VM_KBUILD +VM_KBUILD := no +ifeq ($(call vm_check_file,$(BUILD_DIR)/Makefile), yes) +ifneq ($(call vm_check_file,$(BUILD_DIR)/Rules.make), yes) +VM_KBUILD := 26 +endif +endif +export VM_KBUILD +endif + +ifndef VM_KBUILD_SHOWN +ifeq ($(VM_KBUILD), no) +VM_DUMMY := $(shell echo >&2 "Using standalone build system.") +else +ifeq ($(VM_KBUILD), 24) +VM_DUMMY := $(shell echo >&2 "Using 2.4.x kernel build system.") +else +VM_DUMMY := $(shell echo >&2 "Using 2.6.x kernel build system.") +endif +endif +VM_KBUILD_SHOWN := yes +export VM_KBUILD_SHOWN +endif + +ifneq ($(VM_KBUILD), no) + +VMCCVER := $(shell $(CC) -dumpversion) + +# If there is no version defined, we are in toplevel pass, not yet in kernel makefiles... +ifeq ($(VERSION),) + +ifeq ($(VM_KBUILD), 24) +DRIVER_KO := $(DRIVER).o +else +DRIVER_KO := $(DRIVER).ko +endif + +.PHONY: $(DRIVER_KO) + +auto-build: $(DRIVER_KO) + cp -f $< $(SRCROOT)/../$(DRIVER).o + +# $(DRIVER_KO) is a phony target, so compare file times explicitly +$(DRIVER): $(DRIVER_KO) + if [ $< -nt $@ ] || [ ! -e $@ ] ; then cp -f $< $@; fi + +# Pass gcc version down the chain, so we can detect if kernel attempts to use unapproved compiler +VM_CCVER := $(VMCCVER) +export VM_CCVER +VM_CC := $(CC) +export VM_CC + +MAKEOVERRIDES := $(filter-out CC=%,$(MAKEOVERRIDES)) + +$(DRIVER_KO): + make -C $(BUILD_DIR) SUBDIRS=$$PWD SRCROOT=$$PWD/$(SRCROOT) modules + +else + +ifneq ($(VM_CCVER), $(VMCCVER)) +$(warning *** Inappropriate build environment: you wanted to use gcc \ + version $(VM_CCVER) while kernel attempts to use gcc version $(VMCCVER).) +$(error For proper build you'll have to replace $(CC) with symbolic \ + link to $(VM_CC)) +endif + +endif + +vm_check_build = $(shell if $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) \ + $(CPPFLAGS) $(CFLAGS) $(CFLAGS_KERNEL) \ + $(EXTRA_CFLAGS) -Iinclude2/asm/mach-default \ + -DKBUILD_BASENAME=\"$(DRIVER)\" \ + -Werror -S -o /dev/null -xc $(1) \ + > /dev/null 2>&1; then echo "$(2)"; else echo "$(3)"; fi) + +CC_WARNINGS := -Wall -Wstrict-prototypes +CC_OPTS := $(GLOBAL_DEFS) $(CC_WARNINGS) -DVMW_USING_KBUILD +ifdef VMX86_DEVEL +CC_OPTS += -DVMX86_DEVEL +endif +ifdef VMX86_DEBUG +CC_OPTS += -DVMX86_DEBUG +endif + +include $(SRCROOT)/Makefile.kernel + +ifdef TOPDIR +ifeq ($(VM_KBUILD), 24) + +O_TARGET := $(DRIVER).o + +obj-y := $($(DRIVER)-y) + +include $(TOPDIR)/Rules.make +endif +endif + +else + +include $(SRCROOT)/Makefile.normal + +endif + +#.SILENT: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/Makefile.kernel /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/Makefile.kernel --- open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/Makefile.kernel 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/Makefile.kernel 2008-10-13 08:01:47.000000000 +0100 @@ -0,0 +1,35 @@ +#!/usr/bin/make -f +########################################################## +# Copyright (C) 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 General Public License as published by the +# Free Software Foundation version 2 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 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 +# +########################################################## + +#### +#### VMware vmxnet3 Makefile to be distributed externally +#### + +INCLUDE := -I. + +EXTRA_CFLAGS := $(CC_OPTS) $(INCLUDE) + +EXTRA_CFLAGS += $(call vm_check_build, $(SRCROOT)/autoconf/skblin.c, -DVMW_SKB_LINEARIZE_2618, ) + +obj-m += $(DRIVER).o + +clean: + rm -rf $(wildcard $(DRIVER).mod.c $(DRIVER).ko .tmp_versions \ + Module.symvers Modules.symvers Module.markers modules.order \ + $(foreach dir,./,$(addprefix $(dir),.*.cmd .*.o.flags *.o))) diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/Makefile.normal /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/Makefile.normal --- open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/Makefile.normal 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/Makefile.normal 2008-10-13 08:01:47.000000000 +0100 @@ -0,0 +1,86 @@ +#!/usr/bin/make -f +########################################################## +# Copyright (C) 1998 VMware, Inc. All rights reserved. +# +# 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 version 2 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 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 +# +########################################################## + +#### +#### VMware vmxnet3 Makefile to be distributed externally +#### + +vm_check_build = $(shell if $(CC) $(CC_OPTS) $(INCLUDE) -Werror -S -o /dev/null -xc $(1) \ + > /dev/null 2>&1; then echo "$(2)"; else echo "$(3)"; fi) + +DRIVERNAME = $(DRIVER)-$(VM_UNAME) + +ifneq (,$(filter x86_64%, $(shell $(CC) -dumpmachine))) +MACHINE := x86_64 +else +MACHINE := x386 +endif + +#### +#### You must compile with at least -O level of optimization +#### or the module won't load. +#### If desparate, I think that bringing in <linux/bitops.h> might +#### suffice. +#### +CC_WARNINGS := -Wall -Wstrict-prototypes +# Don't use -pipe or egcs-2.91.66 (shipped with RedHat) will die +CC_KFLAGS := -D__KERNEL__ -fno-strength-reduce -fno-omit-frame-pointer \ + -fno-common -DKBUILD_MODNAME=$(DRIVER) +CC_KFLAGS += $(call vm_check_gcc,-falign-loops=2 -falign-jumps=2 -falign-functions=2, \ + -malign-loops=2 -malign-jumps=2 -malign-functions=2) +CC_KFLAGS += $(call vm_check_gcc,-fno-strict-aliasing,) +ifeq ($(MACHINE),x86_64) +CC_KFLAGS += -mno-red-zone -mcmodel=kernel +else +# Gcc 3.0 deprecates -m486 --hpreg +CC_KFLAGS += -DCPU=586 $(call check_gcc,-march=i586,-m486) +endif + +CC_OPTS := -g3 -O2 -DMODULE $(GLOBAL_DEFS) $(CC_KFLAGS) $(CC_WARNINGS) + +INCLUDE := -I$(HEADER_DIR) + +INCLUDE += $(shell $(CC) $(CC_OPTS) $(INCLUDE) \ + -E $(SRCROOT)/autoconf/geninclude.c \ + | sed -n -e 's!^APATH!-I$(HEADER_DIR)/asm!p') + +CC_OPTS += $(call vm_check_build, $(SRCROOT)/autoconf/skblin.c, -DVMW_SKB_LINEARIZE_2618, ) + +OBJS := vmxnet3.o + +CFLAGS := $(CC_OPTS) $(INCLUDE) + +LIBS := + +default: all + +all: $(DRIVERNAME) + +$(DRIVERNAME): $(OBJS) + $(LD) -r -o $@ $^ + +$(DRIVER) ../$(DRIVER).o: $(DRIVERNAME) + cp -f $< $@ + +auto-build: ../$(DRIVER).o + +clean: + rm -f $(DRIVERNAME) ../$(DRIVERNAME) $(DRIVER) $(OBJS) + +.SILENT: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/README /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/README --- open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/README 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/README 2008-10-13 08:01:46.000000000 +0100 @@ -0,0 +1,11 @@ +The files in this directory are the source files for the VMware +3rd Generation Virtual Ethernet Adapter driver. In order to build, +make certain the Makefile is correct, especially about whether or +not your system is multi-processor or not, and then just type: + + make + +from this directory. A copy of the module will be left in 'vmxnet3.o', +which can then be installed in /lib/modules/<kernel-name>/net. + +If you have any problems or questions, send mail to support@vmware.com diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/upt1_defs.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/upt1_defs.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/upt1_defs.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/upt1_defs.h 2008-10-13 08:01:46.000000000 +0100 @@ -0,0 +1,163 @@ +/********************************************************* + * Copyright (C) 2007 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* upt1_defs.h + * + * Definitions for UPTv1 + */ + +#ifndef _UPT1_DEFS_H +#define _UPT1_DEFS_H + +#define UPT1_MAX_TX_QUEUES 64 +#define UPT1_MAX_RX_QUEUES 64 + +#define UPT1_MAX_INTRS (UPT1_MAX_TX_QUEUES + UPT1_MAX_RX_QUEUES) + +typedef +#include "vmware_pack_begin.h" +struct UPT1_RingDesc { + uint64 basePA; /* physical addr of the ring */ + uint16 size; /* # of descriptors */ + uint16 prodIdx; /* index of the descriptor the producer of the ring + * will write to next */ + uint16 consIdx; /* index of the descriptor the consumer of the ring + * will read next */ + uint16 pad; +} +#include "vmware_pack_end.h" +UPT1_RingDesc; + +typedef +#include "vmware_pack_begin.h" +struct UPT1_TxStats { + uint64 TSOPktsTxOK; /* TSO pkts post-segmentation */ + uint64 TSOBytesTxOK; + uint64 ucastPktsTxOK; + uint64 ucastBytesTxOK; + uint64 mcastPktsTxOK; + uint64 mcastBytesTxOK; + uint64 bcastPktsTxOK; + uint64 bcastBytesTxOK; + uint64 pktsTxError; + uint64 pktsTxDiscard; +} +#include "vmware_pack_end.h" +UPT1_TxStats; + +typedef +#include "vmware_pack_begin.h" +struct UPT1_TxQueueState { + UPT1_RingDesc txRing; + UPT1_RingDesc dataRing; + UPT1_RingDesc compRing; + uint8 tcGen; /* value of the TCGEN register */ + uint8 intrIdx; /* which MSI/MSI-X vector to use for the tx queue */ + Bool stopped; /* is the queue stopped? */ + uint8 pad; + uint32 error; /* error code if the queue is stopped due to error */ + UPT1_TxStats stats; /* stats for the tx queue */ +} +#include "vmware_pack_end.h" +UPT1_TxQueueState; + +typedef +#include "vmware_pack_begin.h" +struct UPT1_RxStats { + uint64 LROPktsRxOK; /* LRO pkts */ + uint64 LROBytesRxOK; /* bytes from LRO pkts */ + /* the following counters are for pkts from the wire, i.e., pre-LRO */ + uint64 ucastPktsRxOK; + uint64 ucastBytesRxOK; + uint64 mcastPktsRxOK; + uint64 mcastBytesRxOK; + uint64 bcastPktsRxOK; + uint64 bcastBytesRxOK; + uint64 pktsRxOutOfBuf; + uint64 pktsRxError; +} +#include "vmware_pack_end.h" +UPT1_RxStats; + +typedef +#include "vmware_pack_begin.h" +struct UPT1_RxQueueState { + UPT1_RingDesc rxRing[2]; + UPT1_RingDesc compRing; + uint8 rcGen; /* value of the RCGEN register */ + uint8 intrIdx; /* which MSI/MSI-X vector to use for the rx queue */ + Bool stopped; /* is the queue stopped? */ + uint8 pad; + uint32 error; /* error code if the queue is stopped due to error */ + UPT1_RxStats stats; /* stats for the rx queue */ +} +#include "vmware_pack_end.h" +UPT1_RxQueueState; + +/* physical dev intr type */ +typedef enum { + UPT1_IT_MSI = 1, + UPT1_IT_MSIX +} UPT1_IntrType; + +/* interrupt moderation level */ +#define UPT1_IML_NONE 0 /* no interrupt moderation */ +#define UPT1_IML_HIGHEST 7 /* least intr generated */ +#define UPT1_IML_ADAPTIVE 8 /* adpative intr moderation */ + +typedef struct UPT1_IntrState { + UPT1_IntrType type; + Bool autoMask; + uint8 numIntrs; /* # of MSI/MSI-X vectors allocated */ + uint8 *modLevels; /* interrupt moderation level */ + uint8 *imr; /* IMR register values */ +} UPT1_IntrState; + +/* values for UPT1_RSSConf.hashFunc */ +#define UPT1_RSS_HASH_TYPE_NONE 0x0 +#define UPT1_RSS_HASH_TYPE_IPV4 0x01 +#define UPT1_RSS_HASH_TYPE_TCP_IPV4 0x02 +#define UPT1_RSS_HASH_TYPE_IPV6 0x04 +#define UPT1_RSS_HASH_TYPE_TCP_IPV6 0x08 + +#define UPT1_RSS_HASH_FUNC_NONE 0x0 +#define UPT1_RSS_HASH_FUNC_TOEPLITZ 0x01 + +#define UPT1_RSS_MAX_KEY_SIZE 40 +#define UPT1_RSS_MAX_IND_TABLE_SIZE 128 + +typedef +#include "vmware_pack_begin.h" +struct UPT1_RSSConf { + uint16 hashType; + uint16 hashFunc; + uint16 hashKeySize; + uint16 indTableSize; + uint8 hashKey[UPT1_RSS_MAX_KEY_SIZE]; + uint8 indTable[UPT1_RSS_MAX_IND_TABLE_SIZE]; +} +#include "vmware_pack_end.h" +UPT1_RSSConf; + +/* features */ +#define UPT1_F_RXCSUM 0x0001 /* rx csum verification */ +#define UPT1_F_RSS 0x0002 +#define UPT1_F_RXVLAN 0x0004 /* VLAN tag stripping */ +#define UPT1_F_LRO 0x0008 + +#endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/vm_basic_types.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/vm_basic_types.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/vm_basic_types.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/vm_basic_types.h 2008-10-13 08:01:46.000000000 +0100 @@ -0,0 +1,912 @@ +/********************************************************* + * Copyright (C) 1998-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 General Public License as published by the + * Free Software Foundation version 2 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 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 + * + *********************************************************/ + +/* + * + * vm_basic_types.h -- + * + * basic data types. + */ + + +#ifndef _VM_BASIC_TYPES_H_ +#define _VM_BASIC_TYPES_H_ + +#define INCLUDE_ALLOW_USERLEVEL +#define INCLUDE_ALLOW_VMMEXT +#define INCLUDE_ALLOW_MODULE +#define INCLUDE_ALLOW_VMMON +#define INCLUDE_ALLOW_VMNIXMOD +#define INCLUDE_ALLOW_VMKERNEL +#define INCLUDE_ALLOW_VMKDRIVERS +#define INCLUDE_ALLOW_VMK_MODULE +#define INCLUDE_ALLOW_DISTRIBUTE +#define INCLUDE_ALLOW_VMCORE +#define INCLUDE_ALLOW_VMIROM +#include "includeCheck.h" + +/* STRICT ANSI means the Xserver build and X defines Bool differently. */ +#if !defined(__STRICT_ANSI__) || defined(__FreeBSD__) +typedef char Bool; +#endif + +#ifndef FALSE +#define FALSE 0 +#endif + +#ifndef TRUE +#define TRUE 1 +#endif + +#define IsBool(x) (((x) & ~1) == 0) +#define IsBool2(x, y) ((((x) | (y)) & ~1) == 0) + +/* + * Macros __i386__ and __ia64 are intrinsically defined by GCC + */ +#ifdef __i386__ +#define VM_I386 +#endif + +#ifdef _WIN64 +#define __x86_64__ +#endif + +#ifdef __x86_64__ +#define VM_X86_64 +#define VM_I386 +#define vm_x86_64 (1) +#else +#define vm_x86_64 (0) +#endif + + + +#ifdef _WIN32 +/* safe assumption for a while */ +#define VM_I386 +#endif + +#ifdef _MSC_VER +typedef unsigned __int64 uint64; +typedef signed __int64 int64; + +#pragma warning (3 :4505) // unreferenced local function +#pragma warning (disable :4018) // signed/unsigned mismatch +#pragma warning (disable :4761) // integral size mismatch in argument; conversion supplied +#pragma warning (disable :4305) // truncation from 'const int' to 'short' +#pragma warning (disable :4244) // conversion from 'unsigned short' to 'unsigned char' +#pragma warning (disable :4267) // truncation of 'size_t' +#pragma warning (disable :4146) // unary minus operator applied to unsigned type, result still unsigned +#pragma warning (disable :4142) // benign redefinition of type + +#elif __GNUC__ +/* The Xserver source compiles with -ansi -pendantic */ +#ifndef __STRICT_ANSI__ +#if defined(VM_X86_64) +typedef unsigned long uint64; +typedef long int64; +#else +typedef unsigned long long uint64; +typedef long long int64; +#endif +#elif __FreeBSD__ +typedef unsigned long long uint64; +typedef long long int64; +#endif +#else +#error - Need compiler define for int64/uint64 +#endif + +typedef unsigned int uint32; +typedef unsigned short uint16; +typedef unsigned char uint8; + +typedef int int32; +typedef short int16; +typedef char int8; + +/* + * FreeBSD (for the tools build) unconditionally defines these in + * sys/inttypes.h so don't redefine them if this file has already + * been included. [greg] + * + * This applies to Solaris as well. + */ + +/* + * Before trying to do the includes based on OS defines, see if we can use + * feature-based defines to get as much functionality as possible + */ + +#ifdef HAVE_INTTYPES_H +#include <inttypes.h> +#endif +#ifdef HAVE_SYS_TYPES_H +#include <sys/types.h> +#endif +#ifdef HAVE_SYS_INTTYPES_H +#include <sys/inttypes.h> +#endif +#ifdef HAVE_STDINT_H +#include <stdint.h> +#endif +#ifdef HAVE_STDLIB_H +#include <stdlib.h> +#endif + +#ifdef __FreeBSD__ +#include <sys/param.h> /* For __FreeBSD_version */ +#endif + +#if !defined(USING_AUTOCONF) +# if defined(__FreeBSD__) || defined(sun) +# ifdef KLD_MODULE +# include <sys/types.h> +# else +# if !defined(VMKERNEL) && (__FreeBSD_version >= 500043) +# include <inttypes.h> +# include <sys/types.h> +# else +# include <sys/inttypes.h> +# endif +# endif +# elif defined __APPLE__ +# if KERNEL +# include <sys/unistd.h> +# include <sys/types.h> /* mostly for size_t */ +# include <stdint.h> +# else +# include <unistd.h> +# include <inttypes.h> +# include <stdlib.h> +# include <stdint.h> +# endif +# else +# if !defined(__intptr_t_defined) && !defined(intptr_t) +# define __intptr_t_defined +# define intptr_t intptr_t +# ifdef VM_I386 +# ifdef VM_X86_64 +typedef int64 intptr_t; +# else +typedef int32 intptr_t; +# endif +# endif +# endif + +# ifndef _STDINT_H +# ifdef VM_I386 +# ifdef VM_X86_64 +typedef uint64 uintptr_t; +# else +typedef uint32 uintptr_t; +# endif +# endif +# endif +# endif +#endif + + +/* + * Time + * XXX These should be cleaned up. -- edward + */ + +typedef int64 VmTimeType; /* Time in microseconds */ +typedef int64 VmTimeRealClock; /* Real clock kept in microseconds */ +typedef int64 VmTimeVirtualClock; /* Virtual Clock kept in CPU cycles */ + +/* + * Printf format specifiers for size_t and 64-bit number. + * Use them like this: + * printf("%"FMT64"d\n", big); + * + * FMTH is for handles/fds. + */ + +#ifdef _MSC_VER + #define FMT64 "I64" + #ifdef VM_X86_64 + #define FMTSZ "I64" + #define FMTPD "I64" + #define FMTH "I64" + #else + #define FMTSZ "I" + #define FMTPD "I" + #define FMTH "I" + #endif +#elif __GNUC__ + #define FMTH "" + #if defined(N_PLAT_NLM) || defined(sun) || \ + (defined(__FreeBSD__) && (__FreeBSD__ + 0) && ((__FreeBSD__ + 0) < 5)) + /* + * Why (__FreeBSD__ + 0)? See bug 141008. + * Yes, we really need to test both (__FreeBSD__ + 0) and + * ((__FreeBSD__ + 0) < 5). No, we can't remove "+ 0" from + * ((__FreeBSD__ + 0) < 5). + */ + #ifdef VM_X86_64 + #define FMTSZ "l" + #define FMTPD "l" + #else + #define FMTSZ "" + #define FMTPD "" + #endif + #elif defined(__linux__) \ + || (defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200112L) \ + || (defined(_POSIX_VERSION) && _POSIX_VERSION >= 200112L) \ + || (defined(_POSIX2_VERSION) && _POSIX2_VERSION >= 200112L) + /* BSD/Darwin, Linux */ + #define FMTSZ "z" + + #if defined(VM_X86_64) || defined(__APPLE__) + #define FMTPD "l" + #else + #define FMTPD "" + #endif + #else + /* Systems with a pre-C99 libc */ + #define FMTSZ "Z" + #ifdef VM_X86_64 + #define FMTPD "l" + #else + #define FMTPD "" + #endif + #endif + #ifdef VM_X86_64 + #define FMT64 "l" + #elif defined(sun) || defined(__APPLE__) || defined(__FreeBSD__) + #define FMT64 "ll" + #else + #define FMT64 "L" + #endif +#else + #error - Need compiler define for FMT64 and FMTSZ +#endif + +/* + * Suffix for 64-bit constants. Use it like this: + * CONST64(0x7fffffffffffffff) for signed or + * CONST64U(0x7fffffffffffffff) for unsigned. + * + * 2004.08.30(thutt): + * The vmcore/asm64/gen* programs are compiled as 32-bit + * applications, but must handle 64 bit constants. If the + * 64-bit-constant defining macros are already defined, the + * definition will not be overwritten. + */ + +#if !defined(CONST64) || !defined(CONST64U) +#ifdef _MSC_VER +#define CONST64(c) c##I64 +#define CONST64U(c) c##uI64 +#elif __GNUC__ +#ifdef VM_X86_64 +#define CONST64(c) c##L +#define CONST64U(c) c##uL +#else +#define CONST64(c) c##LL +#define CONST64U(c) c##uLL +#endif +#else +#error - Need compiler define for CONST64 +#endif +#endif + +/* + * Use CONST3264/CONST3264U if you want a constant to be + * treated as a 32-bit number on 32-bit compiles and + * a 64-bit number on 64-bit compiles. Useful in the case + * of shifts, like (CONST3264U(1) << x), where x could be + * more than 31 on a 64-bit compile. + */ + +#ifdef VM_X86_64 + #define CONST3264(a) CONST64(a) + #define CONST3264U(a) CONST64U(a) +#else + #define CONST3264(a) (a) + #define CONST3264U(a) (a) +#endif + +#define MIN_INT32 ((int32)0x80000000) +#define MAX_INT32 ((int32)0x7fffffff) + +#define MIN_UINT32 ((uint32)0) +#define MAX_UINT32 ((uint32)0xffffffff) + +#define MIN_INT64 (CONST64(0x8000000000000000)) +#define MAX_INT64 (CONST64(0x7fffffffffffffff)) + +#define MIN_UINT64 (CONST64U(0)) +#define MAX_UINT64 (CONST64U(0xffffffffffffffff)) + +typedef uint8 *TCA; /* Pointer into TC (usually). */ + +/* + * Type big enough to hold an integer between 0..100 + */ +typedef uint8 Percent; +#define AsPercent(v) ((Percent)(v)) +#define CHOOSE_PERCENT AsPercent(101) + + +typedef uintptr_t VA; +typedef uintptr_t VPN; + +typedef uint64 PA; +typedef uint32 PPN; + +typedef uint64 PhysMemOff; +typedef uint64 PhysMemSize; + +/* The Xserver source compiles with -ansi -pendantic */ +#ifndef __STRICT_ANSI__ +typedef uint64 BA; +#endif +typedef uint32 BPN; +typedef uint32 PageNum; +typedef unsigned MemHandle; +typedef int32 World_ID; + +#define INVALID_WORLD_ID ((World_ID)0) + +typedef World_ID User_CartelID; +#define INVALID_CARTEL_ID INVALID_WORLD_ID + +typedef User_CartelID User_SessionID; +#define INVALID_SESSION_ID INVALID_CARTEL_ID + +typedef User_CartelID User_CartelGroupID; +#define INVALID_CARTELGROUP_ID INVALID_CARTEL_ID + +typedef uint32 Worldlet_ID; +#define INVALID_WORLDLET_ID ((Worldlet_ID)0) + +/* world page number */ +typedef uint32 WPN; + +/* The Xserver source compiles with -ansi -pendantic */ +#ifndef __STRICT_ANSI__ +typedef uint64 MA; +typedef uint32 MPN; +#endif + +/* + * This type should be used for variables that contain sector + * position/quantity. + */ +typedef uint64 SectorType; + +/* + * Linear address + */ + +typedef uintptr_t LA; +typedef uintptr_t LPN; +#define LA_2_LPN(_la) ((_la) >> PAGE_SHIFT) +#define LPN_2_LA(_lpn) ((_lpn) << PAGE_SHIFT) + +#define LAST_LPN ((((LA) 1) << (8 * sizeof(LA) - PAGE_SHIFT)) - 1) +#define LAST_LPN32 ((((LA32)1) << (8 * sizeof(LA32) - PAGE_SHIFT)) - 1) +#define LAST_LPN64 ((((LA64)1) << (8 * sizeof(LA64) - PAGE_SHIFT)) - 1) + +/* Valid bits in a LPN. */ +#define LPN_MASK LAST_LPN +#define LPN_MASK32 LAST_LPN32 +#define LPN_MASK64 LAST_LPN64 + +/* + * On 64 bit platform, address and page number types default + * to 64 bit. When we need to represent a 32 bit address, we use + * types defined below. + * + * On 32 bit platform, the following types are the same as the + * default types. + */ +typedef uint32 VA32; +typedef uint32 VPN32; +typedef uint32 LA32; +typedef uint32 LPN32; +typedef uint32 PA32; +typedef uint32 PPN32; +typedef uint32 MA32; +typedef uint32 MPN32; + +/* + * On 64 bit platform, the following types are the same as the + * default types. + */ +typedef uint64 VA64; +typedef uint64 VPN64; +typedef uint64 LA64; +typedef uint64 LPN64; +typedef uint64 PA64; +typedef uint64 PPN64; +typedef uint64 MA64; +typedef uint64 MPN64; + +/* + * VA typedefs for user world apps. + */ +typedef VA32 UserVA32; +typedef VA64 UserVA64; +typedef UserVA32 UserVAConst; /* Userspace ptr to data that we may only read. */ +typedef UserVA64 UserVA64Const; /* Used by 64-bit syscalls until conversion is finished. */ +#ifdef VMKERNEL +typedef UserVA32 UserVA; +#else +typedef void * UserVA; +#endif + + +/* + * Maximal possible PPN value (errors too) that PhysMem can handle. + * Must be at least as large as MAX_PPN which is the maximum PPN + * for any region other than buserror. + */ +#define PHYSMEM_MAX_PPN ((PPN)0xffffffff) +#define MAX_PPN ((PPN)0x1fffffff) /* Maximal observable PPN value. */ +#define INVALID_PPN ((PPN)0xffffffff) + +#define INVALID_BPN ((BPN) 0x1fffffff) + +#define INVALID_MPN ((MPN)-1) +#define MEMREF_MPN ((MPN)-2) +#define RESERVED_MPN ((MPN) 0) +/* Support 39 bits of address space, minus one page. */ +#define MAX_MPN ((MPN) 0x07ffffff) + +#define INVALID_LPN ((LPN)-1) +#define INVALID_VPN ((VPN)-1) +#define INVALID_LPN64 ((LPN64)-1) +#define INVALID_PAGENUM ((PageNum)-1) +#define INVALID_WPN ((WPN) -1) + + +/* + * Format modifier for printing VA, LA, and VPN. + * Use them like this: Log("%#"FMTLA"x\n", laddr) + */ + +#if defined(VMM64) || defined(FROBOS64) || vm_x86_64 || defined __APPLE__ +# define FMTLA "l" +# define FMTVA "l" +# define FMTVPN "l" +#else +# define FMTLA "" +# define FMTVA "" +# define FMTVPN "" +#endif + +#ifndef EXTERN +#define EXTERN extern +#endif +#define CONST const + + +#ifndef INLINE +# ifdef _MSC_VER +# define INLINE __inline +# else +# define INLINE inline +# endif +#endif + + +/* + * Annotation for data that may be exported into a DLL and used by other + * apps that load that DLL and import the data. + */ +#if defined(_WIN32) && defined(VMX86_IMPORT_DLLDATA) +# define VMX86_EXTERN_DATA extern __declspec(dllimport) +#else // !_WIN32 +# define VMX86_EXTERN_DATA extern +#endif + +#if defined(_WIN32) && !defined(VMX86_NO_THREADS) +#define THREADSPECIFIC __declspec(thread) +#else +#define THREADSPECIFIC +#endif + +/* + * Due to the wonderful "registry redirection" feature introduced in + * 64-bit Windows, if you access any key under HKLM\Software in 64-bit + * code, you need to open/create/delete that key with + * VMKEY_WOW64_32KEY if you want a consistent view with 32-bit code. + */ + +#ifdef _WIN32 +#ifdef _WIN64 +#define VMW_KEY_WOW64_32KEY KEY_WOW64_32KEY +#else +#define VMW_KEY_WOW64_32KEY 0x0 +#endif +#endif + + +/* + * Consider the following reasons functions are inlined: + * + * 1) inlined for performance reasons + * 2) inlined because it's a single-use function + * + * Functions which meet only condition 2 should be marked with this + * inline macro; It is not critical to be inlined (but there is a + * code-space & runtime savings by doing so), so when other callers + * are added the inline-ness should be removed. + */ + +#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) +/* + * Starting at version 3.3, gcc does not always inline functions marked + * 'inline' (it depends on their size). To force gcc to do so, one must use the + * extra __always_inline__ attribute. + */ +# define INLINE_SINGLE_CALLER INLINE __attribute__((__always_inline__)) +# if defined(VMM) \ + && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 1)) +# warning Verify INLINE_SINGLE_CALLER '__always_inline__' attribute (did \ + monitor size change?) +# endif +#else +# define INLINE_SINGLE_CALLER INLINE +#endif + +/* + * Used when a hard guaranteed of no inlining is needed. Very few + * instances need this since the absence of INLINE is a good hint + * that gcc will not do inlining. + */ + +#if defined(__GNUC__) && defined(VMM) +#define ABSOLUTELY_NOINLINE __attribute__((__noinline__)) +#endif + +/* + * Attributes placed on function declarations to tell the compiler + * that the function never returns. + */ + +#ifdef _MSC_VER +#define NORETURN __declspec(noreturn) +#elif __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 9) +#define NORETURN __attribute__((__noreturn__)) +#else +#define NORETURN +#endif + +/* + * GCC 3.2 inline asm needs the + constraint for input/ouput memory operands. + * Older GCCs don't know about it --hpreg + */ + +#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2) +# define VM_ASM_PLUS 1 +#else +# define VM_ASM_PLUS 0 +#endif + +/* + * Branch prediction hints: + * LIKELY(exp) - Expression exp is likely TRUE. + * UNLIKELY(exp) - Expression exp is likely FALSE. + * Usage example: + * if (LIKELY(excCode == EXC_NONE)) { + * or + * if (UNLIKELY(REAL_MODE(vc))) { + * + * We know how to predict branches on gcc3 and later (hopefully), + * all others we don't so we do nothing. + */ + +#if (__GNUC__ >= 3) +/* + * gcc3 uses __builtin_expect() to inform the compiler of an expected value. + * We use this to inform the static branch predictor. The '!!' in LIKELY + * will convert any !=0 to a 1. + */ +#define LIKELY(_exp) __builtin_expect(!!(_exp), 1) +#define UNLIKELY(_exp) __builtin_expect((_exp), 0) +#else +#define LIKELY(_exp) (_exp) +#define UNLIKELY(_exp) (_exp) +#endif + +/* + * GCC's argument checking for printf-like functions + * This is conditional until we have replaced all `"%x", void *' + * with `"0x%08x", (uint32) void *'. Note that %p prints different things + * on different platforms. Argument checking is enabled for the + * vmkernel, which has already been cleansed. + * + * fmtPos is the position of the format string argument, beginning at 1 + * varPos is the position of the variable argument, beginning at 1 + */ + +#if defined(__GNUC__) +# define PRINTF_DECL(fmtPos, varPos) __attribute__((__format__(__printf__, fmtPos, varPos))) +#else +# define PRINTF_DECL(fmtPos, varPos) +#endif + +#if defined(__GNUC__) +# define SCANF_DECL(fmtPos, varPos) __attribute__((__format__(__scanf__, fmtPos, varPos))) +#else +# define SCANF_DECL(fmtPos, varPos) +#endif + +/* + * UNUSED_PARAM should surround the parameter name and type declaration, + * e.g. "int MyFunction(int var1, UNUSED_PARAM(int var2))" + * + */ + +#ifndef UNUSED_PARAM +# if defined(__GNUC__) +# define UNUSED_PARAM(_parm) _parm __attribute__((__unused__)) +# else +# define UNUSED_PARAM(_parm) _parm +# endif +#endif + +/* + * REGPARM defaults to REGPARM3, i.e., a requent that gcc + * puts the first three arguments in registers. (It is fine + * if the function has fewer than three args.) Gcc only. + * Syntactically, put REGPARM where you'd put INLINE or NORETURN. + */ + +#if defined(__GNUC__) +# define REGPARM0 __attribute__((regparm(0))) +# define REGPARM1 __attribute__((regparm(1))) +# define REGPARM2 __attribute__((regparm(2))) +# define REGPARM3 __attribute__((regparm(3))) +# define REGPARM REGPARM3 +#else +# define REGPARM0 +# define REGPARM1 +# define REGPARM2 +# define REGPARM3 +# define REGPARM +#endif + +/* + * ALIGNED specifies minimum alignment in "n" bytes. + */ + +#ifdef __GNUC__ +#define ALIGNED(n) __attribute__((__aligned__(n))) +#else +#define ALIGNED(n) +#endif + +/* + *********************************************************************** + * STRUCT_OFFSET_CHECK -- */ /** + * + * \brief Check if the actual offsef of a member in a structure + * is what is expected + * + * + * \param[in] STRUCT Structure the member is a part of. + * \param[in] MEMBER Member to check the offset of. + * \param[in] OFFSET Expected offset of MEMBER in STRUCTURE. + * \param[in] DEBUG_EXTRA Additional bytes to be added to OFFSET to + * compensate for extra info in debug builds. + * + *********************************************************************** + */ +#ifdef VMX86_DEBUG +#define STRUCT_OFFSET_CHECK(STRUCT, MEMBER, OFFSET, DEBUG_EXTRA) \ + ASSERT_ON_COMPILE(vmk_offsetof(STRUCT, MEMBER) == (OFFSET + DEBUG_EXTRA)) +#else +#define STRUCT_OFFSET_CHECK(STRUCT, MEMBER, OFFSET, DEBUG_EXTRA) \ + ASSERT_ON_COMPILE(vmk_offsetof(STRUCT, MEMBER) == OFFSET) +#endif + +/* + *********************************************************************** + * STRUCT_SIZE_CHECK -- */ /** + * + * \brief Check if the actual size of a structure is what is expected + * + * + * \param[in] STRUCT Structure whose size is to be checked. + * \param[in] SIZE Expected size of STRUCT. + * \param[in] DEBUG_EXTRA Additional bytes to be added to SIZE to + * compensate for extra info in debug builds. + * + *********************************************************************** + */ +#ifdef VMX86_DEBUG +#define STRUCT_SIZE_CHECK(STRUCT, SIZE, DEBUG_EXTRA) \ + ASSERT_ON_COMPILE(sizeof(STRUCT) == (SIZE + DEBUG_EXTRA)) +#else +#define STRUCT_SIZE_CHECK(STRUCT, SIZE, DEBUG_EXTRA) \ + ASSERT_ON_COMPILE(sizeof(STRUCT) == SIZE) +#endif + +/* + * __func__ is a stringified function name that is part of the C99 standard. The block + * below defines __func__ on older systems where the compiler does not support that + * macro. + */ +#if defined(__GNUC__) \ + && ((__GNUC__ == 2 && __GNUC_MINOR < 96) \ + || (__GNUC__ < 2)) +# define __func__ __FUNCTION__ +#endif + +/* + * Once upon a time, this was used to silence compiler warnings that + * get generated when the compiler thinks that a function returns + * when it is marked noreturn. Don't do it. Use NOT_REACHED(). + */ + +#define INFINITE_LOOP() do { } while (1) + +/* + * On FreeBSD (for the tools build), size_t is typedef'd if _BSD_SIZE_T_ + * is defined. Use the same logic here so we don't define it twice. [greg] + */ +#ifdef __FreeBSD__ +# ifdef _BSD_SIZE_T_ +# undef _BSD_SIZE_T_ +# ifdef VM_I386 +# ifdef VM_X86_64 + typedef uint64 size_t; +# else + typedef uint32 size_t; +# endif +# endif /* VM_I386 */ +# endif + +# ifdef _BSD_SSIZE_T_ +# undef _BSD_SSIZE_T_ +# define _SSIZE_T +# define __ssize_t_defined +# define _SSIZE_T_DECLARED +# ifdef VM_I386 +# ifdef VM_X86_64 + typedef int64 ssize_t; +# else + typedef int32 ssize_t; +# endif +# endif /* VM_I386 */ +# endif + +#else +# ifndef _SIZE_T +# define _SIZE_T +# ifdef VM_I386 +# ifdef VM_X86_64 + typedef uint64 size_t; +# else + typedef uint32 size_t; +# endif +# endif /* VM_I386 */ +# endif + +# if !defined(FROBOS) && !defined(_SSIZE_T) && !defined(ssize_t) && \ + !defined(__ssize_t_defined) && !defined(_SSIZE_T_DECLARED) +# define _SSIZE_T +# define __ssize_t_defined +# define _SSIZE_T_DECLARED +# ifdef VM_I386 +# ifdef VM_X86_64 + typedef int64 ssize_t; +# else + typedef int32 ssize_t; +# endif +# endif /* VM_I386 */ +# endif + +#endif + +/* + * Format modifier for printing pid_t. On sun the pid_t is a ulong, but on + * Linux it's an int. + * Use this like this: printf("The pid is %"FMTPID".\n", pid); + */ +#ifdef sun +# ifdef VM_X86_64 +# define FMTPID "d" +# else +# define FMTPID "lu" +# endif +#else +# define FMTPID "d" +#endif + +/* + * Format modifier for printing uid_t. On sun the uid_t is a ulong, but on + * Linux it's an int. + * Use this like this: printf("The uid is %"FMTUID".\n", uid); + */ +#ifdef sun +# ifdef VM_X86_64 +# define FMTUID "u" +# else +# define FMTUID "lu" +# endif +#else +# define FMTUID "u" +#endif + +/* + * Format modifier for printing mode_t. On sun the mode_t is a ulong, but on + * Linux it's an int. + * Use this like this: printf("The mode is %"FMTMODE".\n", mode); + */ +#ifdef sun +# ifdef VM_X86_64 +# define FMTMODE "o" +# else +# define FMTMODE "lo" +# endif +#else +# define FMTMODE "o" +#endif + +/* + * Format modifier for printing time_t. Most platforms define a time_t to be + * a long int, but on FreeBSD (as of 5.0, it seems), the time_t is a signed + * size quantity. Refer to the definition of FMTSZ to see why we need silly + * preprocessor arithmetic. + * Use this like this: printf("The mode is %"FMTTIME".\n", time); + */ +#if defined(__FreeBSD__) && (__FreeBSD__ + 0) && ((__FreeBSD__ + 0) >= 5) +# define FMTTIME FMTSZ"d" +#else +# define FMTTIME "ld" +#endif + +/* + * Define MXSemaHandle here so both vmmon and vmx see this definition. + */ + +#ifdef _WIN32 +typedef uintptr_t MXSemaHandle; +#else +typedef int MXSemaHandle; +#endif + +/* + * Define type for poll device handles. + */ + +#ifdef _WIN32 +typedef uintptr_t PollDevHandle; +#else +typedef int PollDevHandle; +#endif + +/* + * Define the utf16_t type. + */ + +#if defined(_WIN32) && defined(_NATIVE_WCHAR_T_DEFINED) +typedef wchar_t utf16_t; +#else +typedef uint16 utf16_t; +#endif + +#endif /* _VM_BASIC_TYPES_H_ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/vm_device_version.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/vm_device_version.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/vm_device_version.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/vm_device_version.h 2008-10-13 08:01:46.000000000 +0100 @@ -0,0 +1,188 @@ +/********************************************************* + * Copyright (C) 1998 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +#ifndef VM_DEVICE_VERSION_H +#define VM_DEVICE_VERSION_H + +#define INCLUDE_ALLOW_USERLEVEL +#define INCLUDE_ALLOW_VMMEXT +#define INCLUDE_ALLOW_MODULE +#define INCLUDE_ALLOW_VMKERNEL +#define INCLUDE_ALLOW_VMCORE +#include "includeCheck.h" + +#ifdef _WIN32 +#include "guiddef.h" +#endif + +/* Our own PCI IDs + * VMware SVGA II (Unified VGA) + * VMware SVGA (PCI Accelerator) + * VMware vmxnet (Idealized NIC) + * VMware vmxscsi (Abortive idealized SCSI controller) + * VMware chipset (Subsystem ID for our motherboards) + * VMware e1000 (Subsystem ID) + * VMware vmxnet3 (Uniform Pass Through NIC) + */ +#define PCI_VENDOR_ID_VMWARE 0x15AD +#define PCI_DEVICE_ID_VMWARE_SVGA2 0x0405 +#define PCI_DEVICE_ID_VMWARE_SVGA 0x0710 +#define PCI_DEVICE_ID_VMWARE_NET 0x0720 +#define PCI_DEVICE_ID_VMWARE_SCSI 0x0730 +#define PCI_DEVICE_ID_VMWARE_VMCI 0x0740 +#define PCI_DEVICE_ID_VMWARE_CHIPSET 0x1976 +#define PCI_DEVICE_ID_VMWARE_82545EM 0x0750 /* single port */ +#define PCI_DEVICE_ID_VMWARE_82546EB 0x0760 /* dual port */ +#define PCI_DEVICE_ID_VMWARE_EHCI 0x0770 +#define PCI_DEVICE_ID_VMWARE_1394 0x0780 +#define PCI_DEVICE_ID_VMWARE_BRIDGE 0x0790 +#define PCI_DEVICE_ID_VMWARE_ROOTPORT 0x07A0 +#define PCI_DEVICE_ID_VMWARE_VMXNET3 0x07B0 +#define PCI_DEVICE_ID_VMWARE_PVSCSI 0x07C0 + +/* The hypervisor device might grow. Please leave room + * for 7 more subfunctions. + */ +#define PCI_DEVICE_ID_VMWARE_HYPER 0x0800 +#define PCI_DEVICE_ID_VMWARE_VMI 0x0801 + +#define PCI_DEVICE_VMI_CLASS 0x05 +#define PCI_DEVICE_VMI_SUBCLASS 0x80 +#define PCI_DEVICE_VMI_INTERFACE 0x00 +#define PCI_DEVICE_VMI_REVISION 0x01 + +/* From linux/pci_ids.h: + * AMD Lance Ethernet controller + * BusLogic SCSI controller + * Ensoniq ES1371 sound controller + */ +#define PCI_VENDOR_ID_AMD 0x1022 +#define PCI_DEVICE_ID_AMD_VLANCE 0x2000 +#define PCI_VENDOR_ID_BUSLOGIC 0x104B +#define PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER_NC 0x0140 +#define PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER 0x1040 +#define PCI_VENDOR_ID_ENSONIQ 0x1274 +#define PCI_DEVICE_ID_ENSONIQ_ES1371 0x1371 + +/* From linux/pci_ids.h: + * Intel 82439TX (430 HX North Bridge) + * Intel 82371AB (PIIX4 South Bridge) + * Intel 82443BX (440 BX North Bridge and AGP Bridge) + * Intel 82545EM (e1000, server adapter, single port) + * Intel 82546EB (e1000, server adapter, dual port) + * Intel ICH7_16 (Hight Definition Audio controller) + */ +#define PCI_VENDOR_ID_INTEL 0x8086 +#define PCI_DEVICE_ID_INTEL_82439TX 0x7100 +#define PCI_DEVICE_ID_INTEL_82371AB_0 0x7110 +#define PCI_DEVICE_ID_INTEL_82371AB_2 0x7112 +#define PCI_DEVICE_ID_INTEL_82371AB_3 0x7113 +#define PCI_DEVICE_ID_INTEL_82371AB 0x7111 +#define PCI_DEVICE_ID_INTEL_82443BX 0x7190 +#define PCI_DEVICE_ID_INTEL_82443BX_1 0x7191 +#define PCI_DEVICE_ID_INTEL_82443BX_2 0x7192 /* Used when no AGP support */ +#define PCI_DEVICE_ID_INTEL_82545EM 0x100f +#define PCI_DEVICE_ID_INTEL_82546EB 0x1010 +#define PCI_DEVICE_ID_INTEL_ICH7_16 0x27d8 + + +/************* Strings for IDE Identity Fields **************************/ +#define VIDE_ID_SERIAL_STR "00000000000000000001" /* Must be 20 Bytes */ +#define VIDE_ID_FIRMWARE_STR "00000001" /* Must be 8 Bytes */ + +/* No longer than 40 Bytes */ +#define VIDE_ATA_MODEL_STR PRODUCT_GENERIC_NAME " Virtual IDE Hard Drive" +#define VIDE_ATAPI_MODEL_STR PRODUCT_GENERIC_NAME " Virtual IDE CDROM Drive" + +#define ATAPI_VENDOR_ID "NECVMWar" /* Must be 8 Bytes */ +#define ATAPI_PRODUCT_ID PRODUCT_GENERIC_NAME " IDE CDROM" /* Must be 16 Bytes */ +#define ATAPI_REV_LEVEL "1.00" /* Must be 4 Bytes */ + +#define IDE_NUM_INTERFACES 2 /* support for two interfaces */ +#define IDE_DRIVES_PER_IF 2 + +/************* Strings for SCSI Identity Fields **************************/ +#define SCSI_DISK_MODEL_STR PRODUCT_GENERIC_NAME " Virtual SCSI Hard Drive" +#define SCSI_DISK_VENDOR_NAME COMPANY_NAME +#define SCSI_DISK_REV_LEVEL "1.0" +#define SCSI_CDROM_MODEL_STR PRODUCT_GENERIC_NAME " Virtual SCSI CDROM Drive" +#define SCSI_CDROM_VENDOR_NAME COMPANY_NAME +#define SCSI_CDROM_REV_LEVEL "1.0" + +/************* SCSI implementation limits ********************************/ +#define SCSI_MAX_CONTROLLERS 4 // Need more than 1 for MSCS clustering +#define SCSI_MAX_DEVICES 16 // BT-958 emulates only 16 +#define SCSI_IDE_CHANNEL SCSI_MAX_CONTROLLERS +#define SCSI_IDE_HOSTED_CHANNEL (SCSI_MAX_CONTROLLERS + 1) +#define SCSI_MAX_CHANNELS (SCSI_MAX_CONTROLLERS + 2) + +/************* Strings for the VESA BIOS Identity Fields *****************/ +#define VBE_OEM_STRING COMPANY_NAME " SVGA" +#define VBE_VENDOR_NAME COMPANY_NAME +#define VBE_PRODUCT_NAME PRODUCT_GENERIC_NAME + +/************* PCI implementation limits ********************************/ +#define PCI_MAX_BRIDGES 15 + +/************* Ethernet implementation limits ***************************/ +#define MAX_ETHERNET_CARDS 10 + +/************* PCI Passthrough implementation limits ********************/ +#define MAX_PCI_PASSTHRU_DEVICES 2 + +/************* USB implementation limits ********************************/ +#define MAX_USB_DEVICES_PER_HOST_CONTROLLER 127 + +/************* Strings for Host USB Driver *******************************/ + +#ifdef _WIN32 + +/* + * Globally unique ID for the VMware device interface. Define INITGUID before including + * this header file to instantiate the variable. + */ +DEFINE_GUID(GUID_DEVICE_INTERFACE_VMWARE_USB_DEVICES, +0x2da1fe75, 0xaab3, 0x4d2c, 0xac, 0xdf, 0x39, 0x8, 0x8c, 0xad, 0xa6, 0x65); + +/* + * Globally unique ID for the VMware device setup class. + */ +DEFINE_GUID(GUID_CLASS_VMWARE_USB_DEVICES, +0x3b3e62a5, 0x3556, 0x4d7e, 0xad, 0xad, 0xf5, 0xfa, 0x3a, 0x71, 0x2b, 0x56); + +/* + * This string defines the device ID string of a VMware USB device. + * The format is USB\Vid_XXXX&Pid_YYYY, where XXXX and YYYY are the + * hexadecimal representations of the vendor and product ids, respectively. + * + * The official vendor ID for VMware, Inc. is 0x0E0F. + * The product id for USB generic devices is 0x0001. + */ +#define USB_VMWARE_DEVICE_ID_WIDE L"USB\\Vid_0E0F&Pid_0001" +#define USB_DEVICE_ID_LENGTH (sizeof(USB_VMWARE_DEVICE_ID_WIDE) / sizeof(WCHAR)) + +#ifdef UNICODE +#define USB_PNP_SETUP_CLASS_NAME L"VMwareUSBDevices" +#define USB_PNP_DRIVER_NAME L"vmusb" +#else +#define USB_PNP_SETUP_CLASS_NAME "VMwareUSBDevices" +#define USB_PNP_DRIVER_NAME "vmusb" +#endif +#endif + +#endif /* VM_DEVICE_VERSION_H */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/vmnet_def.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/vmnet_def.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/vmnet_def.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/vmnet_def.h 2008-10-13 08:01:46.000000000 +0100 @@ -0,0 +1,64 @@ +/********************************************************* + * Copyright (C) 2004 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * vmnet_def.h + * + * - definitions which are (mostly) not vmxnet or vlance specific + */ + +#ifndef _VMNET_DEF_H_ +#define _VMNET_DEF_H_ + +#define INCLUDE_ALLOW_USERLEVEL +#define INCLUDE_ALLOW_VMMEXT +#define INCLUDE_ALLOW_MODULE +#define INCLUDE_ALLOW_VMK_MODULE +#define INCLUDE_ALLOW_VMKERNEL +#define INCLUDE_ALLOW_DISTRIBUTE +#define INCLUDE_ALLOW_VMNIXMOD +#include "includeCheck.h" + +/* + * capabilities - not all of these are implemented in the virtual HW + * (eg VLAN support is in the virtual switch) so even vlance + * can use them + */ +#define VMNET_CAP_SG 0x0001 /* Can do scatter-gather transmits. */ +#define VMNET_CAP_IP4_CSUM 0x0002 /* Can checksum only TCP/UDP over IPv4. */ +#define VMNET_CAP_HW_CSUM 0x0004 /* Can checksum all packets. */ +#define VMNET_CAP_HIGH_DMA 0x0008 /* Can DMA to high memory. */ +#define VMNET_CAP_TOE 0x0010 /* Supports TCP/IP offload. */ +#define VMNET_CAP_TSO 0x0020 /* Supports TCP Segmentation offload */ +#define VMNET_CAP_SW_TSO 0x0040 /* Supports SW TCP Segmentation */ +#define VMNET_CAP_VMXNET_APROM 0x0080 /* Vmxnet APROM support */ +#define VMNET_CAP_HW_TX_VLAN 0x0100 /* Can we do VLAN tagging in HW */ +#define VMNET_CAP_HW_RX_VLAN 0x0200 /* Can we do VLAN untagging in HW */ +#define VMNET_CAP_SW_VLAN 0x0400 /* Can we do VLAN tagging/untagging in SW */ +#define VMNET_CAP_WAKE_PCKT_RCV 0x0800 /* Can wake on network packet recv? */ +#define VMNET_CAP_ENABLE_INT_INLINE 0x1000 /* Enable Interrupt Inline */ +#define VMNET_CAP_ENABLE_HEADER_COPY 0x2000 /* copy header for vmkernel */ +#define VMNET_CAP_TX_CHAIN 0x4000 /* Guest can use multiple tx entries for a pkt */ +#define VMNET_CAP_RX_CHAIN 0x8000 /* a pkt can span multiple rx entries */ +#define VMNET_CAP_LPD 0x10000 /* large pkt delivery */ +#define VMNET_CAP_BPF 0x20000 /* BPF Support in VMXNET Virtual Hardware */ +#define VMNET_CAP_SG_SPAN_PAGES 0x40000 /* Can do scatter-gather span multiple pages transmits. */ +#define VMNET_CAP_IP6_CSUM 0x80000 /* Can do IPv6 csum offload. */ +#define VMNET_CAP_TSO6 0x100000 /* Can do TSO segmentation offload for IPv6 pkts. */ +#define VMNET_CAP_TSO256k 0x200000 /* Can do TSO segmentation offload for pkts up to 256kB. */ +#endif // _VMNET_DEF_H_ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/vmware_pack_begin.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/vmware_pack_begin.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/vmware_pack_begin.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/vmware_pack_begin.h 2008-10-13 08:01:46.000000000 +0100 @@ -0,0 +1,43 @@ +/********************************************************* + * Copyright (C) 2002 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * 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 diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/vmware_pack_end.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/vmware_pack_end.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/vmware_pack_end.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/vmware_pack_end.h 2008-10-13 08:01:46.000000000 +0100 @@ -0,0 +1,44 @@ +/********************************************************* + * Copyright (C) 2002 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * vmware_pack_end.h -- + * + * End 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(pop) +#elif __GNUC__ +__attribute__((__packed__)) +#else +# error Compiler packing... +#endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/vmware_pack_init.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/vmware_pack_init.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/vmware_pack_init.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/vmware_pack_init.h 2008-10-13 08:01:46.000000000 +0100 @@ -0,0 +1,65 @@ +/********************************************************* + * Copyright (C) 2002 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +#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__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/vmxnet3.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/vmxnet3.c --- open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/vmxnet3.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/vmxnet3.c 2008-10-13 08:01:47.000000000 +0100 @@ -0,0 +1,4407 @@ +/********************************************************* + * Copyright (C) 2007 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * vmxnet3.c -- + * + * Linux driver for VMXNET3 NIC + * XXX: + * + invoke request_irq after device is activated + */ +#include "driver-config.h" + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0) +#error "vmxnet3 driver is not supported on kernels earlier than 2.6" +#endif + +#include "compat_module.h" +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 9) +#include <linux/moduleparam.h> +#endif + +#include "compat_slab.h" +#include "compat_spinlock.h" +#include "compat_ioport.h" +#include "compat_pci.h" +#include "compat_init.h" +#include "compat_timer.h" +#include "compat_netdevice.h" +#include "compat_skbuff.h" +#include "compat_interrupt.h" +#include "compat_workqueue.h" + +#include <asm/dma.h> +#include <asm/page.h> +#include <asm/uaccess.h> +#include <linux/tcp.h> +#include <linux/udp.h> +#include <linux/ip.h> +#include <linux/ipv6.h> +#include <linux/in.h> +#include <linux/etherdevice.h> +#include <linux/ethtool.h> +#include <linux/delay.h> +#include <asm/checksum.h> + +#include <linux/if_vlan.h> +#include <linux/if_arp.h> +#include <linux/inetdevice.h> + +#include "vm_basic_types.h" +#include "vmnet_def.h" +#include "vm_device_version.h" +#include "vmxnet3_version.h" + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0) && !defined(VMXNET3_NO_NAPI) +# define VMXNET3_NAPI +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24) +# define VMXNET3_NEW_NAPI +#endif +#endif + +#include "vmxnet3_int.h" + +#ifdef VLAN_GROUP_ARRAY_SPLIT_PARTS +# define compat_vlan_group_get_device(vlan_grp, vid) vlan_group_get_device(vlan_grp, vid) +# define compat_vlan_group_set_device(vlan_grp, vid, dev) vlan_group_set_device(vlan_grp, vid, dev) +#else +# define compat_vlan_group_get_device(vlan_grp, vid) ((vlan_grp)->vlan_devices[(vid)]) +# define compat_vlan_group_set_device(vlan_grp, vid, dev) ((vlan_grp)->vlan_devices[(vid)] = (dev)) +#endif + +#ifdef VMX86_DEBUG +# define VMXNET3_ASSERT(cond) BUG_ON(!(cond)) +#else +# define VMXNET3_ASSERT(cond) do {} while (0) +#endif + +#ifdef VMXNET3_DO_LOG +# define VMXNET3_LOG(msg...) printk(KERN_ERR msg) +#else +# define VMXNET3_LOG(msg...) +#endif + +#ifdef VMXNET3_NAPI +# ifdef VMX86_DEBUG +# define VMXNET3_DRIVER_VERSION_REPORT VMXNET3_DRIVER_VERSION_STRING"-NAPI(debug)" +# else +# define VMXNET3_DRIVER_VERSION_REPORT VMXNET3_DRIVER_VERSION_STRING"-NAPI" +# endif +#else +# ifdef VMX86_DEBUG +# define VMXNET3_DRIVER_VERSION_REPORT VMXNET3_DRIVER_VERSION_STRING"(debug)" +# else +# define VMXNET3_DRIVER_VERSION_REPORT VMXNET3_DRIVER_VERSION_STRING +# endif +#endif + +static char vmxnet3_driver_name[] = "vmxnet3"; +#define VMXNET3_DRIVER_DESC "VMware vmxnet3 virtual NIC driver" + +static const struct pci_device_id vmxnet3_pciid_table[] = { + {PCI_DEVICE(PCI_VENDOR_ID_VMWARE, PCI_DEVICE_ID_VMWARE_VMXNET3)}, + {0} +}; + +static void vmxnet3_setup_driver_shared(struct vmxnet3_adapter *adapter); +static int vmxnet3_probe_device(struct pci_dev *pdev, const struct pci_device_id *id); +static void vmxnet3_remove_device(struct pci_dev *pdev); +#ifdef CONFIG_PM +static int vmxnet3_suspend(struct pci_dev *pdev, pm_message_t state); +static int vmxnet3_resume(struct pci_dev *pdev); +#endif +static int vmxnet3_tq_tx_complete(struct vmxnet3_tx_queue *tq, + struct vmxnet3_adapter *adapter); +#ifdef VMXNET3_NAPI +static int vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq, + struct vmxnet3_adapter *adapter, + int quota); +#else +static int vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq, + struct vmxnet3_adapter *adapter); +#endif +static inline Bool vmxnet3_tq_stopped(struct vmxnet3_tx_queue *tq, + struct vmxnet3_adapter *adapter); +static inline void vmxnet3_tq_start(struct vmxnet3_tx_queue *tq, + struct vmxnet3_adapter *adapter); +static inline void vmxnet3_tq_stop(struct vmxnet3_tx_queue *tq, + struct vmxnet3_adapter *adapter); +static inline void vmxnet3_tq_wake(struct vmxnet3_tx_queue *tq, + struct vmxnet3_adapter *adapter); + +static struct pci_driver vmxnet3_driver = { + .name = vmxnet3_driver_name, + .id_table = vmxnet3_pciid_table, + .probe = vmxnet3_probe_device, + .remove = vmxnet3_remove_device, +#ifdef CONFIG_PM + .suspend = vmxnet3_suspend, + .resume = vmxnet3_resume, +#endif +}; + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_enable_intr/vmxnet3_disable_intr -- + * + * Enable/Disable the given intr + * + * Result: + * None + * + * Side-effects: + * None + * + *---------------------------------------------------------------------------- + */ + +static inline void +vmxnet3_enable_intr(struct vmxnet3_adapter *adapter, unsigned intr_idx) +{ + VMXNET3_WRITE_BAR0_REG(adapter, VMXNET3_REG_IMR + intr_idx * 8, 0); +} + + +static inline void +vmxnet3_disable_intr(struct vmxnet3_adapter *adapter, unsigned intr_idx) +{ + VMXNET3_WRITE_BAR0_REG(adapter, VMXNET3_REG_IMR + intr_idx * 8, 1); +} + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_enable_all_intrs/vmxnet3_disable_all_intrs-- + * + * Enable/Disable all intrs used by the device + * + * Result: + * None + * + * Side-effects: + * None + * + *---------------------------------------------------------------------------- + */ + +static void +vmxnet3_enable_all_intrs(struct vmxnet3_adapter *adapter) +{ + int i; + + for (i = 0; i < adapter->intr.num_intrs; i++) { + vmxnet3_enable_intr(adapter, i); + } +} + + +static void +vmxnet3_disable_all_intrs(struct vmxnet3_adapter *adapter) +{ + int i; + + for (i = 0; i < adapter->intr.num_intrs; i++) { + vmxnet3_disable_intr(adapter, i); + } +} + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_ack_events -- + * + * Ack the events we received. + * + * Result: + * None + * + * Side-effects: + * None + * + *---------------------------------------------------------------------------- + */ + +static INLINE void +vmxnet3_ack_events(struct vmxnet3_adapter *adapter, uint32 events) +{ + VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_ECR, events); +} + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_check_link -- + * + * Check link state. + * + * Results: + * None. + * + * Side effects: + * May start or stop the tx queue. + * + *---------------------------------------------------------------------------- + */ + +static void +vmxnet3_check_link(struct vmxnet3_adapter *adapter) +{ + uint32 ret; + + VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD, VMXNET3_CMD_GET_LINK); + ret = VMXNET3_READ_BAR1_REG(adapter, VMXNET3_REG_CMD); + adapter->link_speed = ret >> 16; + if (ret & 1) { /* Link is up. */ + printk(KERN_INFO "%s: NIC Link is Up %d Mbps\n", adapter->netdev->name, + adapter->link_speed); + if (!netif_carrier_ok(adapter->netdev)) { + netif_carrier_on(adapter->netdev); + } + vmxnet3_tq_start(&adapter->tx_queue, adapter); + } else { + printk(KERN_INFO "%s: NIC Link is Down\n", adapter->netdev->name); + if (netif_carrier_ok(adapter->netdev)) { + netif_carrier_off(adapter->netdev); + } + vmxnet3_tq_stop(&adapter->tx_queue, adapter); + } +} + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_process_events -- + * + * process events indicated in ECR + * + * Result: + * None + * + * Side-effects: + * None + * + *---------------------------------------------------------------------------- + */ + +static void +vmxnet3_process_events(struct vmxnet3_adapter *adapter) +{ + uint32 events = adapter->shared->ecr; + if (events) { + vmxnet3_ack_events(adapter, events); + + if (events & VMXNET3_ECR_LINK) { + vmxnet3_check_link(adapter); + } + if (events & (VMXNET3_ECR_TQERR | VMXNET3_ECR_RQERR)) { + VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD, VMXNET3_CMD_GET_QUEUE_STATUS); + + if (adapter->tqd_start->status.stopped) { + printk(KERN_ERR "%s: tq error 0x%x\n", adapter->netdev->name, + adapter->tqd_start->status.error); + } + if (adapter->rqd_start->status.stopped) { + printk(KERN_ERR "%s: rq error 0x%x\n", adapter->netdev->name, + adapter->rqd_start->status.error); + } + + compat_schedule_work(&adapter->work); + } + } +} + + +#ifdef VMXNET3_NAPI + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_do_poll -- + * + * The actual polling function. + * + * Results: + * void + * + * Side-effects: + * None + * + *---------------------------------------------------------------------------- + */ +static inline void +vmxnet3_do_poll(struct vmxnet3_adapter *adapter, int budget, + int *txd_done, int *rxd_done) +{ + if (UNLIKELY(adapter->shared->ecr)) { + vmxnet3_process_events(adapter); + } + + *txd_done = vmxnet3_tq_tx_complete(&adapter->tx_queue, adapter); + *rxd_done = vmxnet3_rq_rx_complete(&adapter->rx_queue, adapter, budget); +} + + +#ifdef VMXNET3_NEW_NAPI +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_poll -- + * + * new NAPI polling function + * + * Result: + * # of the NAPI credit consumed (# of rx descriptors processed) + * + *---------------------------------------------------------------------------- + */ +static int +vmxnet3_poll(struct napi_struct *napi, int budget) +{ + struct vmxnet3_adapter *adapter = container_of(napi, struct vmxnet3_adapter, napi); + int rxd_done, txd_done; + struct net_device *netdev = adapter->netdev; + + vmxnet3_do_poll(adapter, budget, &txd_done, &rxd_done); + + if (rxd_done < budget) { + netif_rx_complete(netdev, napi); + vmxnet3_enable_intr(adapter, 0); + } + return rxd_done; +} +#else +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_poll -- + * + * NAPI polling function + * + * Result: + * 0: napi is done + * 1: continue polling + * + *---------------------------------------------------------------------------- + */ + +static int +vmxnet3_poll(struct net_device *poll_dev, int *budget) +{ + int rxd_done, txd_done, quota; + struct vmxnet3_adapter *adapter = poll_dev->priv; + + quota = min(*budget, poll_dev->quota); + + vmxnet3_do_poll(adapter, quota, &txd_done, &rxd_done); + + *budget -= rxd_done; + poll_dev->quota -= rxd_done; + + if (rxd_done < quota) { + netif_rx_complete(poll_dev); + vmxnet3_enable_intr(adapter, 0); + return 0; + } + + return 1; /* not done */ +} +#endif +#endif + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_intr -- + * + * vmxnet3 intr handler, the same version for all intr types + * + * Result: + * whether or not the intr is handled + * + *---------------------------------------------------------------------------- + */ + +static compat_irqreturn_t +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19) +vmxnet3_intr(int irq, void *dev_id, struct pt_regs * regs) +#else +vmxnet3_intr(int irq, void *dev_id) +#endif +{ + struct net_device *dev = dev_id; + struct vmxnet3_adapter *adapter = dev->priv; + + if (UNLIKELY(adapter->intr.type == VMXNET3_IT_INTX)) { + uint32 icr = VMXNET3_READ_BAR1_REG(adapter, VMXNET3_REG_ICR); + if (UNLIKELY(icr == 0)) { + /* not ours */ + return COMPAT_IRQ_NONE; + } + } + +#ifdef VMXNET3_NAPI + /* disable intr if needed */ + if (adapter->intr.mask_mode == VMXNET3_IMM_ACTIVE) { + vmxnet3_disable_intr(adapter, 0); + } + + compat_netif_rx_schedule(dev, &adapter->napi); + +#else + vmxnet3_tq_tx_complete(&adapter->tx_queue, adapter); + vmxnet3_rq_rx_complete(&adapter->rx_queue, adapter); + if (UNLIKELY(adapter->shared->ecr)) { + vmxnet3_process_events(adapter); + } + vmxnet3_enable_intr(adapter, 0); +#endif + + return COMPAT_IRQ_HANDLED; +} + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_request_irqs -- + * + * based on adapter->intr.type, register the intr handler + * + * Result: + * 0 or error code + * + * Side-effects: + * 1. event_intr_idx and intr_idx for different comp rings are updated + * + *---------------------------------------------------------------------------- + */ + +static int +vmxnet3_request_irqs(struct vmxnet3_adapter *adapter) +{ + int err; + +#ifdef CONFIG_PCI_MSI + if (adapter->intr.type == VMXNET3_IT_MSIX) { + /* we only use 1 MSI-X vector */ + err = request_irq(adapter->intr.msix_entries[0].vector, + vmxnet3_intr, 0, adapter->netdev->name, adapter->netdev); + if (err) { + printk(KERN_ERR "Failed to request irq for MSIX, %s, error %d\n", + adapter->netdev->name, err); + } + } else if (adapter->intr.type == VMXNET3_IT_MSI) { + err = request_irq(adapter->pdev->irq, vmxnet3_intr, 0, + adapter->netdev->name, adapter->netdev); + if (err) { + printk(KERN_ERR "Failed to request irq for MSI, %s, error %d\n", + adapter->netdev->name, err); + } + } else { +#endif + VMXNET3_ASSERT(adapter->intr.type == VMXNET3_IT_INTX); + + err = request_irq(adapter->pdev->irq, vmxnet3_intr, COMPAT_IRQF_SHARED, + adapter->netdev->name, adapter->netdev); + if (err) { + printk(KERN_ERR "Failed to request irq, %s, error %d\n", + adapter->netdev->name, err); + } +#ifdef CONFIG_PCI_MSI + } +#endif + + if (!err) { + int i; + /* init our intr settings */ + for (i = 0; i < adapter->intr.num_intrs; i++) { + adapter->intr.mod_levels[i] = UPT1_IML_ADAPTIVE; + } + + /* next setup intr index for all intr sources */ + adapter->tx_queue.comp_ring.intr_idx = 0; + adapter->rx_queue.comp_ring.intr_idx = 0; + adapter->intr.event_intr_idx = 0; + + printk(KERN_INFO "%s: intr type %u, mode %u, %u vectors allocated\n", + adapter->netdev->name, adapter->intr.type, + adapter->intr.mask_mode, adapter->intr.num_intrs); + } + + return err; +} + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_free_irqs -- + * + * free IRQs allocated + * + * Result: + * None + * + * Side-effects: + * None + *---------------------------------------------------------------------------- + */ + +static void +vmxnet3_free_irqs(struct vmxnet3_adapter *adapter) +{ + VMXNET3_ASSERT(adapter->intr.type != VMXNET3_IT_AUTO && + adapter->intr.num_intrs > 0); + + switch (adapter->intr.type) { +#ifdef CONFIG_PCI_MSI + case VMXNET3_IT_MSIX: + { + int i; + + for (i = 0; i < adapter->intr.num_intrs; i++) { + free_irq(adapter->intr.msix_entries[i].vector, adapter->netdev); + } + break; + } + case VMXNET3_IT_MSI: + free_irq(adapter->pdev->irq, adapter->netdev); + break; +#endif + case VMXNET3_IT_INTX: + free_irq(adapter->pdev->irq, adapter->netdev); + break; + default: + VMXNET3_ASSERT(FALSE); + } +} + + +static inline Bool +vmxnet3_tq_stopped(struct vmxnet3_tx_queue *tq, + struct vmxnet3_adapter *adapter) +{ + return compat_netif_queue_stopped(adapter->netdev); +} + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_tq_start/stop/wake -- + * + * Request the stack to start/stop/wake the tq. This only deals with the OS side, + * it does NOT handle the device side + * + * Result: + * None + * + * Side-effects: + * None + *---------------------------------------------------------------------------- + */ +static inline void +vmxnet3_tq_start(struct vmxnet3_tx_queue *tq, + struct vmxnet3_adapter *adapter) +{ + tq->stopped = FALSE; + compat_netif_start_queue(adapter->netdev); +} + + +static inline void +vmxnet3_tq_wake(struct vmxnet3_tx_queue *tq, + struct vmxnet3_adapter *adapter) +{ + tq->stopped = FALSE; + compat_netif_wake_queue(adapter->netdev); +} + + +static inline void +vmxnet3_tq_stop(struct vmxnet3_tx_queue *tq, + struct vmxnet3_adapter *adapter) +{ + tq->stopped = TRUE; + tq->num_stop++; + compat_netif_stop_queue(adapter->netdev); +} + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_map_pkt -- + * + * map the tx buffer and set up ONLY TXD.{addr, len, gen} based on the mapping. + * It sets the other fields of the descriptors to 0. + * + * Result: + * None + * + * Side-effects: + * 1. the corresponding buf_info entries are upated, + * 2. ring indices are advanced + * + *---------------------------------------------------------------------------- + */ + +static void +vmxnet3_map_pkt(struct sk_buff *skb, + struct vmxnet3_tx_ctx *ctx, + struct vmxnet3_tx_queue *tq, + struct pci_dev *pdev) +{ + uint32 dw2, len; + char *buf; + int i; + Vmxnet3_GenericDesc *gdesc; + struct vmxnet3_tx_buf_info *tbi = NULL; + + VMXNET3_ASSERT(ctx->copy_size <= compat_skb_headlen(skb)); + + /* use the previous gen bit for the SOP desc */ + dw2 = (tq->tx_ring.gen ^ 0x1) << VMXNET3_TXD_GEN_SHIFT; + + ctx->sop_txd = tq->tx_ring.base + tq->tx_ring.next2fill; + gdesc = ctx->sop_txd; // both loops below can be skipped + + /* no need to map the buffer if headers are copied */ + if (ctx->copy_size) { + VMXNET3_ASSERT(ctx->sop_txd->txd.gen != tq->tx_ring.gen); + + ctx->sop_txd->txd.addr = tq->data_ring.basePA + + tq->tx_ring.next2fill * sizeof(Vmxnet3_TxDataDesc); + ctx->sop_txd->dword[2] = dw2 | ctx->copy_size; + ctx->sop_txd->dword[3] = 0; + + tbi = tq->buf_info + tq->tx_ring.next2fill; + tbi->map_type = VMXNET3_MAP_NONE; + + VMXNET3_LOG("txd[%u]: 0x%"FMT64"x 0x%x 0x%x\n", tq->tx_ring.next2fill, + ctx->sop_txd->txd.addr, ctx->sop_txd->dword[2], + ctx->sop_txd->dword[3]); + vmxnet3_cmd_ring_adv_next2fill(&tq->tx_ring); + + /* use the right gen for non-SOP desc */ + dw2 = tq->tx_ring.gen << VMXNET3_TXD_GEN_SHIFT; + } + + /* linear part can use multiple tx desc if it's big */ + len = compat_skb_headlen(skb) - ctx->copy_size; + buf = skb->data + ctx->copy_size; + while (len) { + uint32 buf_size; + + buf_size = len > VMXNET3_MAX_TX_BUF_SIZE ? VMXNET3_MAX_TX_BUF_SIZE : len; + + tbi = tq->buf_info + tq->tx_ring.next2fill; + tbi->map_type = VMXNET3_MAP_SINGLE; + tbi->dma_addr = pci_map_single(pdev, buf, + buf_size, PCI_DMA_TODEVICE); + tbi->len = buf_size; /* this automatically convert 2^14 to 0 */ + + gdesc = tq->tx_ring.base + tq->tx_ring.next2fill; + VMXNET3_ASSERT(gdesc->txd.gen != tq->tx_ring.gen); + + gdesc->txd.addr = tbi->dma_addr; + gdesc->dword[2] = dw2 | buf_size; + gdesc->dword[3] = 0; + + VMXNET3_LOG("txd[%u]: 0x%"FMT64"x 0x%x 0x%x\n", tq->tx_ring.next2fill, + gdesc->txd.addr, gdesc->dword[2], gdesc->dword[3]); + vmxnet3_cmd_ring_adv_next2fill(&tq->tx_ring); + dw2 = tq->tx_ring.gen << VMXNET3_TXD_GEN_SHIFT; + + len -= buf_size; + buf += buf_size; + } + + for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { + struct skb_frag_struct *frag = &skb_shinfo(skb)->frags[i]; + + tbi = tq->buf_info + tq->tx_ring.next2fill; + tbi->map_type = VMXNET3_MAP_PAGE; + tbi->dma_addr = pci_map_page(pdev, frag->page, frag->page_offset, + frag->size, PCI_DMA_TODEVICE); + tbi->len = frag->size; + + gdesc = tq->tx_ring.base + tq->tx_ring.next2fill; + VMXNET3_ASSERT(gdesc->txd.gen != tq->tx_ring.gen); + + gdesc->txd.addr = tbi->dma_addr; + gdesc->dword[2] = dw2 | frag->size; + gdesc->dword[3] = 0; + + VMXNET3_LOG("txd[%u]: %"FMT64"u %u %u\n", tq->tx_ring.next2fill, + gdesc->txd.addr, gdesc->dword[2], gdesc->dword[3]); + vmxnet3_cmd_ring_adv_next2fill(&tq->tx_ring); + dw2 = tq->tx_ring.gen << VMXNET3_TXD_GEN_SHIFT; + } + + ctx->eop_txd = gdesc; + + /* set the last buf_info for the pkt */ + tbi->skb = skb; + tbi->sop_idx = ctx->sop_txd - tq->tx_ring.base; +} + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_parse_and_copy_hdr -- + * + * parse and copy relevant protocol headers: + * For a tso pkt, relevant headers are L2/3/4 including options + * For a pkt requesting csum offloading, they are L2/3 and may include L4 + * if it's a TCP/UDP pkt + * + * The implementation works only when h/w vlan insertion is used, see PR + * 171928 + * + * Result: + * -1: error happens during parsing + * 0: protocol headers parsed, but too big to be copied + * 1: protocol headers parsed and copied + * + * Side-effects: + * 1. related *ctx fields are updated. + * 2. ctx->copy_size is # of bytes copied + * 3. the portion copied is guaranteed to be in the linear part + * + *---------------------------------------------------------------------------- + */ +static int +vmxnet3_parse_and_copy_hdr(struct sk_buff *skb, + struct vmxnet3_tx_queue *tq, + struct vmxnet3_tx_ctx *ctx) +{ + Vmxnet3_TxDataDesc *tdd; + + if (ctx->mss) { + ctx->eth_ip_hdr_size = compat_skb_transport_offset(skb); + ctx->l4_hdr_size = compat_skb_tcp_header(skb)->doff * 4; + ctx->copy_size = ctx->eth_ip_hdr_size + ctx->l4_hdr_size; + } else { + unsigned int pull_size; + + if (skb->ip_summed == VM_TX_CHECKSUM_PARTIAL) { + ctx->eth_ip_hdr_size = compat_skb_transport_offset(skb); + + if (ctx->ipv4) { + if (compat_skb_ip_header(skb)->protocol == IPPROTO_TCP) { + pull_size = ctx->eth_ip_hdr_size + sizeof(struct tcphdr); + + if (UNLIKELY(!compat_pskb_may_pull(skb, pull_size))) { + goto err; + } + ctx->l4_hdr_size = compat_skb_tcp_header(skb)->doff * 4; + } else if (compat_skb_ip_header(skb)->protocol == IPPROTO_UDP) { + ctx->l4_hdr_size = sizeof(struct udphdr); + } else { + ctx->l4_hdr_size = 0; + } + } else { + // for simplicity, don't copy L4 headers + ctx->l4_hdr_size = 0; + } + ctx->copy_size = ctx->eth_ip_hdr_size + ctx->l4_hdr_size; + } else { + ctx->eth_ip_hdr_size = 14; + ctx->l4_hdr_size = 0; + /* copy as much as allowed */ + ctx->copy_size = min((unsigned int)VMXNET3_HDR_COPY_SIZE, skb->len); + } + + /* make sure headers are accessible directly */ + if (UNLIKELY(!compat_pskb_may_pull(skb, ctx->copy_size))) { + goto err; + } + } + + if (ctx->copy_size > VMXNET3_HDR_COPY_SIZE) { + tq->stats.oversized_hdr++; + ctx->copy_size = 0; + return 0; + } + + tdd = tq->data_ring.base + tq->tx_ring.next2fill; + VMXNET3_ASSERT(ctx->copy_size <= compat_skb_headlen(skb)); + + memcpy(tdd->data, skb->data, ctx->copy_size); + VMXNET3_LOG("copy %u bytes to dataRing[%u]\n", ctx->copy_size, tq->tx_ring.next2fill); + return 1; + +err: + return -1; +} + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_prepare_tso -- + * + * Fix pkt headers for tso + * + * Result: + * None + * + * Side-effects: + * ip hdr and tcp hdr are changed + * + *---------------------------------------------------------------------------- + */ + +static void +vmxnet3_prepare_tso(struct sk_buff *skb, + struct vmxnet3_tx_ctx *ctx) +{ + if (ctx->ipv4) { + struct iphdr *iph = compat_skb_ip_header(skb); + iph->check = 0; + compat_skb_tcp_header(skb)->check = ~csum_tcpudp_magic(iph->saddr, + iph->daddr, + 0, + IPPROTO_TCP, + 0); +#ifdef NETIF_F_TSO6 + } else { + struct ipv6hdr *iph = (struct ipv6hdr*)compat_skb_network_header(skb); + compat_skb_tcp_header(skb)->check = ~csum_ipv6_magic(&iph->saddr, + &iph->daddr, + 0, + IPPROTO_TCP, + 0); +#endif + } +} + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_tq_prepare_tx -- + * + * fill tx descriptors for the given pkt + * + * Result: + * VMXNET3_TX_OK: descriptors are setup successfully + * VMXNET3_TX_DROPPED: error occured, the pkt is dropped + * VMXNET3_TX_FULL: tx ring is full, queue is NOT stopped + * + * Side-effects: + * 1. tx ring may be changed + * 2. tq stats may be updated accordingly + * 3. shared->txNumDeferred may be updated + *---------------------------------------------------------------------------- + */ + +static int +vmxnet3_tq_prepare_tx(struct sk_buff *skb, + struct vmxnet3_tx_queue *tq, + struct vmxnet3_adapter *adapter) +{ + uint32 count; + int ret; + struct vmxnet3_tx_ctx ctx; + Vmxnet3_GenericDesc *gdesc; + + /* conservatively estimate # of descriptors to use */ + count = VMXNET3_TXD_NEEDED(skb_headlen(skb)) + skb_shinfo(skb)->nr_frags + 1; + + if (count > vmxnet3_cmd_ring_desc_avail(&tq->tx_ring)) { + tq->stats.tx_ring_full++; + printk(KERN_INFO "tx queue stopped on %s, next2comp %u next2fill %u\n", + adapter->netdev->name, tq->tx_ring.next2comp, tq->tx_ring.next2fill); + return VMXNET3_TX_FULL; + } + + ctx.ipv4 = (skb->protocol == __constant_ntohs(ETH_P_IP)); + ctx.ipv6 = (skb->protocol == __constant_ntohs(ETH_P_IPV6)); + + ctx.mss = compat_skb_mss(skb); + if (ctx.mss) { + if (compat_skb_header_cloned(skb)) { + if (UNLIKELY(pskb_expand_head(skb, 0, 0, GFP_ATOMIC) != 0)) { + tq->stats.drop_tso++; + goto drop_pkt; + } + tq->stats.copy_skb_header++; + } + vmxnet3_prepare_tso(skb, &ctx); + } else { + if (UNLIKELY(count > VMXNET3_MAX_TXD_PER_PKT)) { + /* non-tso pkts must not use more than VMXNET3_MAX_TXD_PER_PKT entries */ + if (compat_skb_linearize(skb) != 0) { + tq->stats.drop_too_many_frags++; + goto drop_pkt; + } + tq->stats.linearized++; + } + } + + ret = vmxnet3_parse_and_copy_hdr(skb, tq, &ctx); + if (ret >= 0) { + VMXNET3_ASSERT(ret > 0 || ctx.copy_size == 0); + /* hdrs parsed, check against other limits */ + if (ctx.mss) { + if (UNLIKELY(ctx.eth_ip_hdr_size + ctx.l4_hdr_size > VMXNET3_MAX_TX_BUF_SIZE)) { + goto hdr_too_big; + } + } else { + if (skb->ip_summed == VM_TX_CHECKSUM_PARTIAL) { + if (UNLIKELY(ctx.eth_ip_hdr_size + compat_skb_csum_offset(skb) > VMXNET3_MAX_CSUM_OFFSET)) { + goto hdr_too_big; + } + } + } + } else { + tq->stats.drop_hdr_inspect_err++; + goto drop_pkt; + } + + /* fill tx descs related to addr & len */ + vmxnet3_map_pkt(skb, &ctx, tq, adapter->pdev); + + /* setup the EOP desc */ + ctx.eop_txd->dword[3] = VMXNET3_TXD_CQ | VMXNET3_TXD_EOP; + + /* setup the SOP desc */ + gdesc = ctx.sop_txd; + if (ctx.mss) { + gdesc->txd.hlen = ctx.eth_ip_hdr_size + ctx.l4_hdr_size; + gdesc->txd.om = VMXNET3_OM_TSO; + gdesc->txd.msscof = ctx.mss; + tq->shared->txNumDeferred += (skb->len - gdesc->txd.hlen + ctx.mss - 1) / ctx.mss; + } else { + if (skb->ip_summed == VM_TX_CHECKSUM_PARTIAL) { + gdesc->txd.hlen = ctx.eth_ip_hdr_size; + gdesc->txd.om = VMXNET3_OM_CSUM; + gdesc->txd.msscof = ctx.eth_ip_hdr_size + compat_skb_csum_offset(skb); + } else { + gdesc->txd.om = 0; + gdesc->txd.msscof = 0; + } + tq->shared->txNumDeferred ++; + } + + if (vlan_tx_tag_present(skb)) { + gdesc->txd.ti = 1; + gdesc->txd.tci = vlan_tx_tag_get(skb); + } + + wmb(); + + /* finally flips the GEN bit of the SOP desc */ + gdesc->dword[2] ^= VMXNET3_TXD_GEN; + VMXNET3_LOG("txd[%u]: SOP 0x%"FMT64"x 0x%x 0x%x\n", + (uint32)((Vmxnet3_GenericDesc *)ctx.sop_txd - tq->tx_ring.base), + gdesc->txd.addr, gdesc->dword[2], gdesc->dword[3]); + return VMXNET3_TX_OK; + +hdr_too_big: + tq->stats.drop_oversized_hdr++; +drop_pkt: + tq->stats.drop_total++; + compat_dev_kfree_skb(skb, FREE_WRITE); + return VMXNET3_TX_DROPPED; +} + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_xmit_frame -- + * + * called by the stack to tx a pkt + * + * Result: + * COMPAT_NETDEV_TX_OK if the pkt is sent or dropped + * COMPAT_NETDEV_TX_BUSY if the pkt has to be requeued + * + * Side-effects: + * None + * + *---------------------------------------------------------------------------- + */ + +static int +vmxnet3_xmit_frame(struct sk_buff *skb, struct net_device *netdev) +{ + struct vmxnet3_adapter *adapter = compat_netdev_priv(netdev); + struct vmxnet3_tx_queue *tq = &adapter->tx_queue; + int ret = COMPAT_NETDEV_TX_OK; + unsigned long flags; + + spin_lock_irqsave(&tq->tx_lock, flags); + + ret = vmxnet3_tq_prepare_tx(skb, tq, adapter); + if (ret == VMXNET3_TX_OK) { + if (tq->shared->txNumDeferred >= tq->shared->txThreshold) { + tq->shared->txNumDeferred = 0; + VMXNET3_WRITE_BAR0_REG(adapter, VMXNET3_REG_TXPROD, tq->tx_ring.next2fill); + } + netdev->trans_start = jiffies; + ret = COMPAT_NETDEV_TX_OK; + } else if (ret == VMXNET3_TX_FULL) { + vmxnet3_tq_stop(tq, adapter); + ret = COMPAT_NETDEV_TX_BUSY; + } else { + ret = COMPAT_NETDEV_TX_OK; + } + + spin_unlock_irqrestore(&tq->tx_lock, flags); + return ret; +} + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_unmap_tx_buf -- + * + * unmap, if necessay, the given tx buffer + * + * Result: + * None + * + * Side-effects: + * 1. tbi->map_type is reset to VMXNET3_MAP_NONE + * + *---------------------------------------------------------------------------- + */ + +static inline void +vmxnet3_unmap_tx_buf(struct vmxnet3_tx_buf_info *tbi, + struct pci_dev *pdev) +{ + if (tbi->map_type == VMXNET3_MAP_SINGLE) { + pci_unmap_single(pdev, + tbi->dma_addr, + tbi->len, + PCI_DMA_TODEVICE); + } else if (tbi->map_type == VMXNET3_MAP_PAGE) { + pci_unmap_page(pdev, + tbi->dma_addr, + tbi->len, + PCI_DMA_TODEVICE); + } else { + VMXNET3_ASSERT(tbi->map_type == VMXNET3_MAP_NONE); + } + tbi->map_type = VMXNET3_MAP_NONE; /* to help debugging */ +} + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_unmap_pkt -- + * + * handle tx completion for a pkt. Basically undo vmxnet3_map_pkt(). + * @eop_idx is the index of the eop desc in the tx ring for the pkt + * + * Result: + * # of tx descs that this pkt used + * + * Side-effects: + * 1. mappings are freed + * 2. buf_info[] are updated + * 3. tx_ring.{avail, next2comp} are updated. + * + *---------------------------------------------------------------------------- + */ + +static int +vmxnet3_unmap_pkt(uint32 eop_idx, + struct vmxnet3_tx_queue *tq, + struct pci_dev *pdev) +{ + struct sk_buff *skb; + int entries = 0; + + /* no out of order completion */ + VMXNET3_ASSERT(tq->buf_info[eop_idx].sop_idx == tq->tx_ring.next2comp); + VMXNET3_ASSERT(tq->tx_ring.base[eop_idx].txd.eop == 1); + + VMXNET3_LOG("tx complete [%u %u]\n", tq->tx_ring.next2comp, eop_idx); + + skb = tq->buf_info[eop_idx].skb; + VMXNET3_ASSERT(skb != NULL); + tq->buf_info[eop_idx].skb = NULL; + + VMXNET3_INC_RING_IDX_ONLY(eop_idx, tq->tx_ring.size); + + while (tq->tx_ring.next2comp != eop_idx) { + vmxnet3_unmap_tx_buf(tq->buf_info + tq->tx_ring.next2comp, pdev); + + /* update next2comp w/o tx_lock. Since we are marking more, instead of + * less, tx ring entries avail, the worst case is that the tx routine + * incorrectly re-queues a pkt due to insufficient tx ring entries. + */ + vmxnet3_cmd_ring_adv_next2comp(&tq->tx_ring); + entries ++; + } + + compat_dev_kfree_skb_any(skb, FREE_WRITE); + return entries; +} + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_tq_tx_complete -- + * + * process tx completion for the given tx queue + * + * Result: + * # of tx ring entries completed + * + *---------------------------------------------------------------------------- + */ + +static int +vmxnet3_tq_tx_complete(struct vmxnet3_tx_queue *tq, + struct vmxnet3_adapter *adapter) +{ + int completed = 0; + Vmxnet3_GenericDesc *gdesc; + + gdesc = tq->comp_ring.base + tq->comp_ring.next2proc; + while (gdesc->tcd.gen == tq->comp_ring.gen) { + completed += vmxnet3_unmap_pkt(gdesc->tcd.txdIdx, tq, adapter->pdev); + + vmxnet3_comp_ring_adv_next2proc(&tq->comp_ring); + gdesc = tq->comp_ring.base + tq->comp_ring.next2proc; + } + + if (completed) { + spin_lock(&tq->tx_lock); + if (UNLIKELY(vmxnet3_tq_stopped(tq, adapter) && + vmxnet3_cmd_ring_desc_avail(&tq->tx_ring) > + VMXNET3_WAKE_QUEUE_THRESHOLD(tq) && + compat_netif_carrier_ok(adapter->netdev))) { + vmxnet3_tq_wake(tq, adapter); + } + spin_unlock(&tq->tx_lock); + } + return completed; +} + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_tq_cleanup -- + * + * unmap tx buffers, free pkts, and reset ring indices and gen + * + * Result: + * None + * + *---------------------------------------------------------------------------- + */ + +static void +vmxnet3_tq_cleanup(struct vmxnet3_tx_queue *tq, + struct vmxnet3_adapter *adapter) +{ + while (tq->tx_ring.next2comp != tq->tx_ring.next2fill) { + struct vmxnet3_tx_buf_info *tbi; + Vmxnet3_GenericDesc *gdesc; + + tbi = tq->buf_info + tq->tx_ring.next2comp; + gdesc = tq->tx_ring.base + tq->tx_ring.next2comp; + + vmxnet3_unmap_tx_buf(tbi, adapter->pdev); + if (tbi->skb) { + compat_dev_kfree_skb_any(tbi->skb, FREE_WRITE); + tbi->skb = NULL; + } + vmxnet3_cmd_ring_adv_next2comp(&tq->tx_ring); + } + + /* sanity check */ +#ifdef VMX86_DEBUG + { + /* verify all buffers are indeed unmapped and freed */ + int i; + for (i = 0; i < tq->tx_ring.size; i++) { + VMXNET3_ASSERT(tq->buf_info[i].skb == NULL && + tq->buf_info[i].map_type == VMXNET3_MAP_NONE); + } + } +#endif + + tq->tx_ring.gen = VMXNET3_INIT_GEN; + tq->tx_ring.next2fill = tq->tx_ring.next2comp = 0; + + tq->comp_ring.gen = VMXNET3_INIT_GEN; + tq->comp_ring.next2proc = 0; +} + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_tq_destroy -- + * + * free rings and buf_info for the tx queue. There must be no pending pkt + * in the tx ring. + * + * Result: + * None + * + * Side-effects: + * the .base fields of all rings and buf_info will be set to NULL + * + *---------------------------------------------------------------------------- + */ + +static void +vmxnet3_tq_destroy(struct vmxnet3_tx_queue *tq, + struct vmxnet3_adapter *adapter) +{ + if (tq->tx_ring.base) { + pci_free_consistent(adapter->pdev, + tq->tx_ring.size * sizeof(Vmxnet3_TxDesc), + tq->tx_ring.base, tq->tx_ring.basePA); + tq->tx_ring.base = NULL; + } + if (tq->data_ring.base) { + pci_free_consistent(adapter->pdev, + tq->data_ring.size * sizeof(Vmxnet3_TxDataDesc), + tq->data_ring.base, tq->data_ring.basePA); + tq->data_ring.base = NULL; + } + if (tq->comp_ring.base) { + pci_free_consistent(adapter->pdev, + tq->comp_ring.size * sizeof(Vmxnet3_TxCompDesc), + tq->comp_ring.base, tq->comp_ring.basePA); + tq->comp_ring.base = NULL; + } + if (tq->buf_info) { + kfree(tq->buf_info); + tq->buf_info = NULL; + } +} + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_tq_init -- + * + * reset all internal states and rings for a tx queue + * + * Result: + * None + * + * Side-effects: + * 1. contents of the rings are reset to 0 + * 2. indices and gen of rings are reset + * 3. bookkeeping data is reset + * + *---------------------------------------------------------------------------- + */ +static void +vmxnet3_tq_init(struct vmxnet3_tx_queue *tq, + struct vmxnet3_adapter *adapter) +{ + int i; + + /* reset the tx ring contents to 0 and reset the tx ring states */ + memset(tq->tx_ring.base, 0, tq->tx_ring.size * sizeof(Vmxnet3_TxDesc)); + tq->tx_ring.next2fill = tq->tx_ring.next2comp = 0; + tq->tx_ring.gen = VMXNET3_INIT_GEN; + + memset(tq->data_ring.base, 0, tq->data_ring.size * sizeof(Vmxnet3_TxDataDesc)); + + /* reset the tx comp ring contents to 0 and reset the comp ring states */ + memset(tq->comp_ring.base, 0, tq->comp_ring.size * sizeof(Vmxnet3_TxCompDesc)); + tq->comp_ring.next2proc = 0; + tq->comp_ring.gen = VMXNET3_INIT_GEN; + + /* reset the bookkeeping data */ + memset(tq->buf_info, 0, sizeof(tq->buf_info[0]) * tq->tx_ring.size); + for (i = 0; i < tq->tx_ring.size; i++) { + tq->buf_info[i].map_type = VMXNET3_MAP_NONE; + } + + /* stats are not reset */ +} + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_tq_create -- + * + * allocate and initialize rings for the tx queue, also allocate and + * initialize buf_info + * + * Result: + * 0 on success, negative errno on failure. + * + *---------------------------------------------------------------------------- + */ +static int +vmxnet3_tq_create(struct vmxnet3_tx_queue *tq, + struct vmxnet3_adapter *adapter) +{ + VMXNET3_ASSERT(tq->tx_ring.size > 0 && + tq->data_ring.size == tq->tx_ring.size); + VMXNET3_ASSERT((tq->tx_ring.size & VMXNET3_RING_SIZE_MASK) == 0); + VMXNET3_ASSERT(!tq->tx_ring.base && !tq->data_ring.base && + !tq->comp_ring.base && !tq->buf_info); + + tq->tx_ring.base = pci_alloc_consistent(adapter->pdev, + tq->tx_ring.size * sizeof(Vmxnet3_TxDesc), + &tq->tx_ring.basePA); + if (!tq->tx_ring.base) { + printk(KERN_ERR "%s: failed to allocate tx ring\n", adapter->netdev->name); + goto err; + } + + tq->data_ring.base = pci_alloc_consistent(adapter->pdev, + tq->data_ring.size * sizeof(Vmxnet3_TxDataDesc), + &tq->data_ring.basePA); + if (!tq->data_ring.base) { + printk(KERN_ERR "%s: failed to allocate data ring\n", adapter->netdev->name); + goto err; + } + + tq->comp_ring.base = pci_alloc_consistent(adapter->pdev, + tq->comp_ring.size * sizeof(Vmxnet3_TxCompDesc), + &tq->comp_ring.basePA); + if (!tq->comp_ring.base) { + printk(KERN_ERR "%s: failed to allocate tx comp ring\n", adapter->netdev->name); + goto err; + } + + tq->buf_info = kmalloc(sizeof(tq->buf_info[0]) * tq->tx_ring.size, GFP_KERNEL); + if (!tq->buf_info) { + printk(KERN_ERR "%s: failed to allocate tx bufinfo\n", adapter->netdev->name); + goto err; + } + + return 0; + +err: + vmxnet3_tq_destroy(tq, adapter); + return -ENOMEM; +} + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_rq_alloc_rx_buf -- + * + * starting from ring->next2fill, allocate rx buffers for the given ring + * of the rx queue and update the rx desc. stop after @num_to_alloc buffers + * are allocated or allocation fails + * + * Result: + * returns # of buffers allocated + * + * Side-effects: + * 1. rx descs are updated + * 2. ring->{gen, next2fill} are updated + * 3. uncommitted[ring_idx] is incremented + * + *---------------------------------------------------------------------------- + */ + +static int +vmxnet3_rq_alloc_rx_buf(struct vmxnet3_rx_queue *rq, + uint32 ring_idx, + int num_to_alloc, + struct vmxnet3_adapter *adapter) +{ + int num_allocated = 0; + struct vmxnet3_rx_buf_info *rbi_base = rq->buf_info[ring_idx]; + struct vmxnet3_cmd_ring *ring = &rq->rx_ring[ring_idx]; + uint32 val; + + while (num_allocated < num_to_alloc) { + struct vmxnet3_rx_buf_info *rbi; + Vmxnet3_GenericDesc *gd; + + rbi = rbi_base + ring->next2fill; + gd = ring->base + ring->next2fill; + + if (rbi->buf_type == VMXNET3_RX_BUF_SKB) { + if (rbi->skb == NULL) { + rbi->skb = dev_alloc_skb(rbi->len + COMPAT_NET_IP_ALIGN); + if (UNLIKELY(rbi->skb == NULL)) { + rq->stats.rx_buf_alloc_failure++; + break; + } + skb_reserve(rbi->skb, COMPAT_NET_IP_ALIGN); + rbi->skb->dev = adapter->netdev; + rbi->dma_addr = pci_map_single(adapter->pdev, rbi->skb->data, + rbi->len, PCI_DMA_FROMDEVICE); + } else { + /* rx buffer skipped by the device */ + } + val = VMXNET3_RXD_BTYPE_HEAD << VMXNET3_RXD_BTYPE_SHIFT; + } else { + VMXNET3_ASSERT(rbi->buf_type == VMXNET3_RX_BUF_PAGE && + rbi->len == PAGE_SIZE); + + if (rbi->page == NULL) { + rbi->page = alloc_page(GFP_ATOMIC); + if (UNLIKELY(rbi->page == NULL)) { + rq->stats.rx_buf_alloc_failure++; + break; + } + rbi->dma_addr = pci_map_page(adapter->pdev, rbi->page, 0, + PAGE_SIZE, PCI_DMA_FROMDEVICE); + } else { + /* rx buffers skipped by the device */ + } + val = VMXNET3_RXD_BTYPE_BODY << VMXNET3_RXD_BTYPE_SHIFT; + } + + VMXNET3_ASSERT(rbi->dma_addr != 0); + gd->rxd.addr = rbi->dma_addr; + wmb(); + gd->dword[2] = (ring->gen << VMXNET3_RXD_GEN_SHIFT) | val | rbi->len; + + num_allocated ++; + vmxnet3_cmd_ring_adv_next2fill(ring); + } + rq->uncommitted[ring_idx] += num_allocated; + + VMXNET3_LOG("alloc_rx_buf: %d allocated, next2fill %u, next2comp %u, uncommited %u\n", + num_allocated, ring->next2fill, ring->next2comp, + rq->uncommitted[ring_idx]); + + /* so that the device can distinguish a full ring and an empty ring */ + VMXNET3_ASSERT(num_allocated == 0 || ring->next2fill != ring->next2comp); + + return num_allocated; +} + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_append_frag -- + * + * Append a frag to the speicified skb. It assumes the skb still has space + * to accommodate the frag. It only increments skb->data_len + * + * Result: + * None + * + * Side-effects: + * None + * + *---------------------------------------------------------------------------- + */ + +static inline void +vmxnet3_append_frag(struct sk_buff *skb, + Vmxnet3_RxCompDesc *rcd, + struct vmxnet3_rx_buf_info *rbi) +{ + struct skb_frag_struct *frag = skb_shinfo(skb)->frags + skb_shinfo(skb)->nr_frags; + + VMXNET3_ASSERT(skb_shinfo(skb)->nr_frags < MAX_SKB_FRAGS); + + frag->page = rbi->page; + frag->page_offset = 0; + frag->size = rcd->len; + skb->data_len += frag->size; + skb_shinfo(skb)->nr_frags ++; +} + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_rx_csum -- + * + * called to process csum related bits in the EOP RCD descriptor + * + * Result: + * None + * + * Side-effects: + * None + * + *---------------------------------------------------------------------------- + */ + +static inline void +vmxnet3_rx_csum(struct vmxnet3_adapter *adapter, + struct sk_buff *skb, + Vmxnet3_GenericDesc *gdesc) +{ + if (!gdesc->rcd.cnc && adapter->rxcsum) { + /* typical case: TCP/UDP over IP and both csums are correct */ + if ((gdesc->dword[3] & VMXNET3_RCD_CSUM_OK) == VMXNET3_RCD_CSUM_OK) { + skb->ip_summed = VM_CHECKSUM_UNNECESSARY; + VMXNET3_ASSERT((gdesc->rcd.tcp || gdesc->rcd.udp) && + (gdesc->rcd.v4 || gdesc->rcd.v6) && + !gdesc->rcd.frg); + } else { + if (gdesc->rcd.csum) { + skb->csum = htons(gdesc->rcd.csum); + skb->ip_summed = VM_RX_CHECKSUM_PARTIAL; + } else { + skb->ip_summed = CHECKSUM_NONE; + } + } + } else { + skb->ip_summed = CHECKSUM_NONE; + } +} + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_rx_error -- + * + * called when ERR bit is set for a received pkt + * + * Result: + * none + * + * Side-effects: + * 1. up the stat counters + * 2. free the pkt + * 3. reset ctx->skb + * + *---------------------------------------------------------------------------- + */ + +static void +vmxnet3_rx_error(struct vmxnet3_rx_queue *rq, + Vmxnet3_RxCompDesc *rcd, + struct vmxnet3_rx_ctx *ctx) +{ + rq->stats.drop_err++; + if (!rcd->fcs) { + rq->stats.drop_fcs++; + } + rq->stats.drop_total++; + + compat_dev_kfree_skb_irq(ctx->skb, FREE_WRITE); + ctx->skb = NULL; +} + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_rq_rx_complete -- + * + * process the rx completion ring of the given rx queue. Quota specified the + * max # of rx completion entries to be processed + * + * Result: + * # of rx descs completed + * + * Side-effects: + * None + *---------------------------------------------------------------------------- + */ +static int +#ifdef VMXNET3_NAPI +vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq, + struct vmxnet3_adapter *adapter, + int quota) +#else +vmxnet3_rq_rx_complete(struct vmxnet3_rx_queue *rq, + struct vmxnet3_adapter *adapter) +#endif +{ + static uint32 rxprod_reg[2] = {VMXNET3_REG_RXPROD, VMXNET3_REG_RXPROD2}; + uint32 num_rxd = 0; + Vmxnet3_RxCompDesc *rcd; + struct vmxnet3_rx_ctx *ctx = &rq->rx_ctx; + + rcd = &rq->comp_ring.base[rq->comp_ring.next2proc].rcd; + while (rcd->gen == rq->comp_ring.gen) { + struct vmxnet3_rx_buf_info *rbi; + struct sk_buff *skb; + int num_to_alloc; + Vmxnet3_RxDesc *rxd; + uint32 idx, ring_idx; +#ifdef VMXNET3_NAPI + if (num_rxd >= quota) { + /* we may stop even before we see the EOP desc of the current pkt */ + break; + } + num_rxd++; +#endif + + idx = rcd->rxdIdx; + ring_idx = rcd->rqID == rq->qid ? 0 : 1; + + rxd = &rq->rx_ring[ring_idx].base[idx].rxd; + rbi = rq->buf_info[ring_idx] + idx; + + VMXNET3_ASSERT(rcd->len <= rxd->len); + VMXNET3_ASSERT(rxd->addr == rbi->dma_addr && rxd->len == rbi->len); + + if (rcd->sop) { /* first buf of the pkt */ + VMXNET3_ASSERT(rxd->btype == VMXNET3_RXD_BTYPE_HEAD && + rcd->rqID == rq->qid); + + VMXNET3_ASSERT(rbi->buf_type == VMXNET3_RX_BUF_SKB); + VMXNET3_ASSERT(ctx->skb == NULL && rbi->skb != NULL); + + if (UNLIKELY(rcd->len == 0)) { + /* Pretend the rx buffer is skipped. */ + VMXNET3_ASSERT(rcd->sop && rcd->eop); + VMXNET3_LOG("rxRing[%u][%u] 0 length\n", ring_idx, idx); + goto rcd_done; + } + + ctx->skb = rbi->skb; + rbi->skb = NULL; + + skb_put(ctx->skb, rcd->len); + pci_unmap_single(adapter->pdev, + rbi->dma_addr, + rbi->len, + PCI_DMA_FROMDEVICE); + } else { + VMXNET3_ASSERT(ctx->skb != NULL); + /* non SOP buffer must be type 1 in most cases */ + if (rbi->buf_type == VMXNET3_RX_BUF_PAGE) { + VMXNET3_ASSERT(rxd->btype == VMXNET3_RXD_BTYPE_BODY); + + if (rcd->len) { + vmxnet3_append_frag(ctx->skb, rcd, rbi); + pci_unmap_page(adapter->pdev, + rbi->dma_addr, + rbi->len, + PCI_DMA_FROMDEVICE); + rbi->page = NULL; + } + } else { + /* the only time a non-SOP buffer is type 0 is when it's EOP and + * error flag is raised + */ + if (UNLIKELY(rcd->err && rcd->eop)) { + /* pretend this buffer is skipped by the device. + * dont chain it and don't reset rbi->skb to NULL + */ + VMXNET3_LOG("Err EOP is type 0 from ring[%u].rxd[%u]\n", ring_idx, idx); + } else { + /* bug in the device */ + VMXNET3_ASSERT(FALSE); + } + } + } + + skb = ctx->skb; + if (rcd->eop) { + skb->len += skb->data_len; + skb->truesize += skb->data_len; + + if (UNLIKELY(rcd->err)) { + vmxnet3_rx_error(rq, rcd, ctx); + goto rcd_done; + } + + vmxnet3_rx_csum(adapter, skb, (Vmxnet3_GenericDesc*)rcd); + skb->protocol = eth_type_trans(skb, adapter->netdev); + +#ifdef VMXNET3_NAPI + if (UNLIKELY(adapter->vlan_grp && rcd->ts)) { + vlan_hwaccel_receive_skb(skb, adapter->vlan_grp, rcd->tci); + } else { + netif_receive_skb(skb); + } +#else + if (UNLIKELY(adapter->vlan_grp && rcd->ts)) { + vlan_hwaccel_rx(skb, adapter->vlan_grp, rcd->tci); + } else { + netif_rx(skb); + } +#endif + adapter->netdev->last_rx = jiffies; + ctx->skb = NULL; + } + +rcd_done: + /* device may skip some rx descs */ + rq->rx_ring[ring_idx].next2comp = idx; + VMXNET3_INC_RING_IDX_ONLY(rq->rx_ring[ring_idx].next2comp, + rq->rx_ring[ring_idx].size); + + /* refill rx buffers from time to time to avoid starving the h/w */ + num_to_alloc = vmxnet3_cmd_ring_desc_avail(rq->rx_ring + ring_idx); + if (UNLIKELY(num_to_alloc > VMXNET3_RX_ALLOC_THRESHOLD(rq, ring_idx, adapter))) { + vmxnet3_rq_alloc_rx_buf(rq, ring_idx, num_to_alloc, adapter); + + /* if needed, update the register */ + if (UNLIKELY(rq->shared->updateRxProd)) { + VMXNET3_WRITE_BAR0_REG(adapter, rxprod_reg[ring_idx] + rq->qid * 8, + rq->rx_ring[ring_idx].next2fill); + rq->uncommitted[ring_idx] = 0; + } + } + + vmxnet3_comp_ring_adv_next2proc(&rq->comp_ring); + rcd = &rq->comp_ring.base[rq->comp_ring.next2proc].rcd; + } + + return num_rxd; +} + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_rq_cleanup -- + * + * Unmap and free the rx buffers allocated to the rx queue. Other resources + * are NOT freed. This is the counterpart of vmxnet3_rq_init() + * + * the content of the rx rings must still be valid when we are invoked + * + * Result: + * None + * + * Side-effects: + * 1. indices and gen of each ring are reset to the initial value + * 2. buf_info[] and buf_info2[] are cleared. + * + *---------------------------------------------------------------------------- + */ + +static void +vmxnet3_rq_cleanup(struct vmxnet3_rx_queue *rq, + struct vmxnet3_adapter *adapter) +{ + uint32 i, ring_idx; + Vmxnet3_RxDesc *rxd; + + for (ring_idx = 0; ring_idx < 2; ring_idx++) { + for (i = 0; i < rq->rx_ring[ring_idx].size; i++) { + rxd = &rq->rx_ring[ring_idx].base[i].rxd; + + if (rxd->btype == VMXNET3_RXD_BTYPE_HEAD && + rq->buf_info[ring_idx][i].skb) { + pci_unmap_single(adapter->pdev, + rxd->addr, + rxd->len, + PCI_DMA_FROMDEVICE); + compat_dev_kfree_skb(rq->buf_info[ring_idx][i].skb, FREE_WRITE); + rq->buf_info[ring_idx][i].skb = NULL; + } else if (rxd->btype == VMXNET3_RXD_BTYPE_BODY && + rq->buf_info[ring_idx][i].page) { + pci_unmap_page(adapter->pdev, + rxd->addr, + rxd->len, + PCI_DMA_FROMDEVICE); + put_page(rq->buf_info[ring_idx][i].page); + rq->buf_info[ring_idx][i].page = NULL; + } + } + + rq->rx_ring[ring_idx].gen = VMXNET3_INIT_GEN; + rq->rx_ring[ring_idx].next2fill = rq->rx_ring[ring_idx].next2comp = 0; + rq->uncommitted[ring_idx] = 0; + } + + rq->comp_ring.gen = VMXNET3_INIT_GEN; + rq->comp_ring.next2proc = 0; +} + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_rq_destroy -- + * + * Free rings and buf_info for the rx queue. The rx buffers must have + * ALREADY been freed. + * + * Result: + * None + * + * Side-effects: + * the .base fields of all rings will be set to NULL + *---------------------------------------------------------------------------- + */ + +static void +vmxnet3_rq_destroy(struct vmxnet3_rx_queue *rq, + struct vmxnet3_adapter *adapter) +{ + int i; + +#ifdef VMX86_DEBUG + /* all rx buffers must have already been freed */ + { + int j; + + for (i = 0; i < 2; i++) { + if (rq->buf_info[i]) { + for (j = 0; j < rq->rx_ring[i].size; j++) { + VMXNET3_ASSERT(rq->buf_info[i][j].page == NULL); + } + } + } + } +#endif + + if (rq->buf_info[0]) { + kfree(rq->buf_info[0]); + } + + for (i = 0; i < 2; i++) { + if (rq->rx_ring[i].base) { + pci_free_consistent(adapter->pdev, + rq->rx_ring[i].size * sizeof(Vmxnet3_RxDesc), + rq->rx_ring[i].base, rq->rx_ring[i].basePA); + rq->rx_ring[i].base = NULL; + } + rq->buf_info[i] = NULL; + } + + if (rq->comp_ring.base) { + pci_free_consistent(adapter->pdev, + rq->comp_ring.size * sizeof(Vmxnet3_RxCompDesc), + rq->comp_ring.base, rq->comp_ring.basePA); + rq->comp_ring.base = NULL; + } +} + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_rq_init -- + * + * initialize buf_info, allocate rx buffers and fill the rx rings. On + * failure, the rx buffers already allocated are NOT freed + * + * Result: + * 0 on success or error code + * + *---------------------------------------------------------------------------- + */ + +static int +vmxnet3_rq_init(struct vmxnet3_rx_queue *rq, + struct vmxnet3_adapter *adapter) +{ + int i; + + VMXNET3_ASSERT(adapter->rx_buf_per_pkt > 0 && + rq->rx_ring[0].size % adapter->rx_buf_per_pkt == 0); + + /* initialize buf_info */ + for (i = 0; i < rq->rx_ring[0].size; i++) { + VMXNET3_ASSERT(rq->buf_info[0][i].skb == NULL); + if (i % adapter->rx_buf_per_pkt == 0) { /* 1st buf for a pkt is skbuff */ + rq->buf_info[0][i].buf_type = VMXNET3_RX_BUF_SKB; + rq->buf_info[0][i].len = adapter->skb_buf_size; + } else { /* subsequent bufs for a pkt is frag */ + rq->buf_info[0][i].buf_type = VMXNET3_RX_BUF_PAGE; + rq->buf_info[0][i].len = PAGE_SIZE; + } + } + for (i = 0; i < rq->rx_ring[1].size; i++) { + VMXNET3_ASSERT(rq->buf_info[1][i].page == NULL); + rq->buf_info[1][i].buf_type = VMXNET3_RX_BUF_PAGE; + rq->buf_info[1][i].len = PAGE_SIZE; + } + + /* reset internal state and allocate buffers for both rings */ + for (i = 0; i < 2; i++) { + rq->rx_ring[i].next2fill = rq->rx_ring[i].next2comp = 0; + rq->uncommitted[i] = 0; + + memset(rq->rx_ring[i].base, 0, rq->rx_ring[i].size * sizeof(Vmxnet3_RxDesc)); + rq->rx_ring[i].gen = VMXNET3_INIT_GEN; + } + if (vmxnet3_rq_alloc_rx_buf(rq, 0, rq->rx_ring[0].size - 1, adapter) == 0) { + // at least has 1 rx buffer for the 1st ring + return -ENOMEM; + } + vmxnet3_rq_alloc_rx_buf(rq, 1, rq->rx_ring[1].size - 1, adapter); + + /* reset the comp ring */ + rq->comp_ring.next2proc = 0; + memset(rq->comp_ring.base, 0, rq->comp_ring.size * sizeof(Vmxnet3_RxCompDesc)); + rq->comp_ring.gen = VMXNET3_INIT_GEN; + + /* reset rxctx */ + rq->rx_ctx.skb = NULL; + + /* stats are not reset */ + return 0; +} + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_rq_create -- + * + * allocate and initialize two cmd rings and the completion ring for the + * given rx queue. Also allocate and initialize buf_info. + * rx buffers are NOT allocated + * + * Result: + * 0 on success, negative errno on failure + *---------------------------------------------------------------------------- + */ +static int +vmxnet3_rq_create(struct vmxnet3_rx_queue *rq, + struct vmxnet3_adapter *adapter) +{ + int i; + size_t sz; + struct vmxnet3_rx_buf_info *bi; + + VMXNET3_ASSERT(rq->rx_ring[0].size % adapter->rx_buf_per_pkt == 0); + + for (i = 0; i < 2; i++) { + VMXNET3_ASSERT((rq->rx_ring[i].size & VMXNET3_RING_SIZE_MASK) == 0); + VMXNET3_ASSERT(rq->rx_ring[i].base == NULL); + + sz = rq->rx_ring[i].size * sizeof(Vmxnet3_RxDesc); + rq->rx_ring[i].base = pci_alloc_consistent(adapter->pdev, + sz, + &rq->rx_ring[i].basePA); + if (!rq->rx_ring[i].base) { + printk(KERN_ERR "%s: failed to allocate rx ring %d\n", adapter->netdev->name, i); + goto err; + } + } + + sz = rq->comp_ring.size * sizeof(Vmxnet3_RxCompDesc); + VMXNET3_ASSERT(rq->comp_ring.base == NULL); + rq->comp_ring.base = pci_alloc_consistent(adapter->pdev, + sz, + &rq->comp_ring.basePA); + if (!rq->comp_ring.base) { + printk(KERN_ERR "%s: failed to allocate rx comp ring\n", adapter->netdev->name); + goto err; + } + + VMXNET3_ASSERT(!rq->buf_info[0] && !rq->buf_info[1]); + sz = sizeof(struct vmxnet3_rx_buf_info) * (rq->rx_ring[0].size + rq->rx_ring[1].size); + bi = kmalloc(sz, GFP_KERNEL); + if (!bi) { + printk(KERN_ERR "%s: failed to allocate rx bufinfo\n", adapter->netdev->name); + goto err; + } + memset(bi, 0, sz); + rq->buf_info[0] = bi; + rq->buf_info[1] = bi + rq->rx_ring[0].size; + + return 0; + +err: + vmxnet3_rq_destroy(rq, adapter); + return -ENOMEM; +} + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_vlan_rx_register -- + * + * Called to enable/disable VLAN stripping. + * + * Result: + * None + * + * Side effects: + * None + * + *---------------------------------------------------------------------------- + */ + +static void +vmxnet3_vlan_rx_register(struct net_device *netdev, struct vlan_group *grp) +{ + struct vmxnet3_adapter *adapter = compat_netdev_priv(netdev); + Vmxnet3_DriverShared *shared = adapter->shared; + uint32 *vfTable = adapter->shared->devRead.rxFilterConf.vfTable; + + if (grp) { + // add vlan rx stripping. + if (adapter->netdev->features & NETIF_F_HW_VLAN_RX) { + int i; + Vmxnet3_DSDevRead *devRead = &shared->devRead; + adapter->vlan_grp = grp; + + /* update FEATURES to device */ + devRead->misc.uptFeatures |= UPT1_F_RXVLAN; + VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD, VMXNET3_CMD_UPDATE_FEATURE); + /* + * Clear entire vfTable; then enable untagged pkts. + * Note: setting one entry in vfTable to non-zero turns on VLAN rx filtering. + */ + for (i = 0; i < VMXNET3_VFT_SIZE; i++) { + // + vfTable[i] = 0; + } + VMXNET3_SET_VFTABLE_ENTRY(vfTable, 0); + VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD, VMXNET3_CMD_UPDATE_VLAN_FILTERS); + } else { + printk(KERN_ERR "%s: vlan_rx_register when device has no NETIF_F_HW_VLAN_RX\n", + netdev->name); + } + } else { + // remove vlan rx stripping. + Vmxnet3_DSDevRead *devRead = &shared->devRead; + adapter->vlan_grp = NULL; + + if (devRead->misc.uptFeatures & UPT1_F_RXVLAN) { + int i; + + for (i = 0; i < VMXNET3_VFT_SIZE; i++) { + // clear entire vfTable; this also disables VLAN rx filtering + vfTable[i] = 0; + } + VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD, VMXNET3_CMD_UPDATE_VLAN_FILTERS); + + /* update FEATURES to device */ + devRead->misc.uptFeatures &= ~UPT1_F_RXVLAN; + VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD, VMXNET3_CMD_UPDATE_FEATURE); + } + } +} + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_restore_vlan -- + * + * Setup driverShared.devRead.rxFilter.vfTable + * + * Result: + * None + * + * Side effects: + * None + * + *---------------------------------------------------------------------------- + */ + +static void +vmxnet3_restore_vlan(struct vmxnet3_adapter *adapter) +{ + if (adapter->vlan_grp) { + uint16 vid; + uint32 *vfTable = adapter->shared->devRead.rxFilterConf.vfTable; + Bool activeVlan = FALSE; + + for (vid = 0; vid < 4096; vid++) { + if (compat_vlan_group_get_device(adapter->vlan_grp, vid)) { + VMXNET3_SET_VFTABLE_ENTRY(vfTable, vid); + activeVlan = TRUE; + } + } + if (activeVlan) { + /* continue to allow untagged pkts */ + VMXNET3_SET_VFTABLE_ENTRY(vfTable, 0); + } + } +} + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_vlan_rx_add_vid -- + * + * Called to add a VLAN ID. + * + * Result: + * None + * + * Side effects: + * None + * + *---------------------------------------------------------------------------- + */ + +static void +vmxnet3_vlan_rx_add_vid(struct net_device *netdev, uint16_t vid) +{ + struct vmxnet3_adapter *adapter = compat_netdev_priv(netdev); + uint32 *vfTable = adapter->shared->devRead.rxFilterConf.vfTable; + + VMXNET3_SET_VFTABLE_ENTRY(vfTable, vid); + VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD, VMXNET3_CMD_UPDATE_VLAN_FILTERS); +} + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_vlan_rx_kill_vid -- + * + * Called to remove a VLAN ID. + * + * Result: + * None + * + * Side effects: + * None + * + *---------------------------------------------------------------------------- + */ + +static void +vmxnet3_vlan_rx_kill_vid(struct net_device *netdev, uint16_t vid) +{ + struct vmxnet3_adapter *adapter = compat_netdev_priv(netdev); + uint32 *vfTable = adapter->shared->devRead.rxFilterConf.vfTable; + + VMXNET3_CLEAR_VFTABLE_ENTRY(vfTable, vid); + VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD, VMXNET3_CMD_UPDATE_VLAN_FILTERS); +} + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_copy_mc -- + * + * Allocate a buffer and copy into the mcast list. + * It returns NULL if the mcast list exceeds the limit. + * + * Result: + * The addr of the allocated buffer or NULL. + * + * Side effects: + * None + * + *---------------------------------------------------------------------------- + */ + +static uint8 * +vmxnet3_copy_mc(struct net_device *netdev) +{ + uint8 *buf = NULL; + uint32 sz = netdev->mc_count * ETH_ALEN; + + /* Vmxnet3_RxFilterConf.mfTableLen is uint16. */ + if (sz <= 0xffff) { + /* We may be called with BH disabled */ + buf = kmalloc(sz, GFP_ATOMIC); + if (buf) { + int i; + struct dev_mc_list *mc = netdev->mc_list; + + for (i = 0; i < netdev->mc_count; i++) { + VMXNET3_ASSERT(mc); + memcpy(buf + i * ETH_ALEN, mc->dmi_addr, ETH_ALEN); + mc = mc->next; + } + } + } + return buf; +} + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_set_mc -- + * + * Called to change rx mode as well as multicast list. + * + * Result: + * None + * + * Side effects: + * None + * + *---------------------------------------------------------------------------- + */ + +static void +vmxnet3_set_mc(struct net_device *netdev) +{ + struct vmxnet3_adapter *adapter = compat_netdev_priv(netdev); + Vmxnet3_RxFilterConf *rxConf = &adapter->shared->devRead.rxFilterConf; + uint8 *new_table = NULL; + uint32 new_mode = VMXNET3_RXM_UCAST; + + if (netdev->flags & IFF_PROMISC) { + new_mode |= VMXNET3_RXM_PROMISC; + } + if (netdev->flags & IFF_BROADCAST) { + new_mode |= VMXNET3_RXM_BCAST; + } + if (netdev->flags & IFF_ALLMULTI) { + new_mode |= VMXNET3_RXM_ALL_MULTI; + } else { + if (netdev->mc_count > 0) { + new_table = vmxnet3_copy_mc(netdev); + if (new_table) { + new_mode |= VMXNET3_RXM_MCAST; + rxConf->mfTableLen = netdev->mc_count * ETH_ALEN; + rxConf->mfTablePA = virt_to_phys(new_table); + } else { + printk(KERN_INFO "%s: failed to copy mcast list, setting ALL_MULTI\n", + netdev->name); + new_mode |= VMXNET3_RXM_ALL_MULTI; + } + } + } + if (!(new_mode & VMXNET3_RXM_MCAST)) { + rxConf->mfTableLen = 0; + rxConf->mfTablePA = 0; + } + + if (new_mode != rxConf->rxMode) { + rxConf->rxMode = new_mode; + VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD, VMXNET3_CMD_UPDATE_RX_MODE); + } + + VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD, VMXNET3_CMD_UPDATE_MAC_FILTERS); + + if (new_table) { + kfree(new_table); + } +} + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_activate_dev -- + * + * put the vNIC into an operational state. After this function finishes, the + * adapter is fully functional. It does the following: + * + * 1. initialize tq and rq + * 2. fill rx rings with rx buffers + * 3. setup intr + * 4. setup driver_shared + * 5. activate the dev + * 6. signal the stack that the vNIC is ready to tx/rx + * 7. enable intrs for the vNIC + * + * Result: + * 0 if the vNIC is in operation state + * error code if any intermediate step fails. + * + *---------------------------------------------------------------------------- + */ + +static int +vmxnet3_activate_dev(struct vmxnet3_adapter *adapter) +{ + int err; + uint32 ret; + + VMXNET3_LOG("%s: skb_buf_size %d, rx_buf_per_pkt %d, ring sizes %u %u %u\n", + adapter->netdev->name, + adapter->skb_buf_size, adapter->rx_buf_per_pkt, + adapter->tx_queue.tx_ring.size, + adapter->rx_queue.rx_ring[0].size, + adapter->rx_queue.rx_ring[1].size); + + vmxnet3_tq_init(&adapter->tx_queue, adapter); + err = vmxnet3_rq_init(&adapter->rx_queue, adapter); + if (err) { + printk(KERN_ERR "Failed to init rx queue for %s: error %d\n", + adapter->netdev->name, err); + goto rq_err; + } + + err = vmxnet3_request_irqs(adapter); + if (err) { + printk(KERN_ERR "Failed to setup irq for %s: error %d\n", + adapter->netdev->name, err); + goto irq_err; + } + + vmxnet3_setup_driver_shared(adapter); + + VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_DSAL, VMXNET3_GET_ADDR_LO(adapter->shared_pa)); + VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_DSAH, VMXNET3_GET_ADDR_HI(adapter->shared_pa)); + + VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD, VMXNET3_CMD_ACTIVATE_DEV); + ret = VMXNET3_READ_BAR1_REG(adapter, VMXNET3_REG_CMD); + if (ret != 0) { + printk(KERN_ERR "Failed to activate dev %s: error %u\n", + adapter->netdev->name, ret); + err = -EINVAL; + goto activate_err; + } + VMXNET3_WRITE_BAR0_REG(adapter, VMXNET3_REG_RXPROD, + adapter->rx_queue.rx_ring[0].next2fill); + VMXNET3_WRITE_BAR0_REG(adapter, VMXNET3_REG_RXPROD2, + adapter->rx_queue.rx_ring[1].next2fill); + + /* Apply the rx filter settins last. */ + vmxnet3_set_mc(adapter->netdev); + + /* + * Check link state when first activating device. It will start the tx queue + * if the link is up. + */ + vmxnet3_check_link(adapter); + +#ifdef VMXNET3_NAPI + compat_napi_enable(adapter->netdev, &adapter->napi); +#endif + + vmxnet3_enable_all_intrs(adapter); + + clear_bit(VMXNET3_STATE_BIT_QUIESCED, &adapter->state); + return 0; + +activate_err: + VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_DSAL, 0); + VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_DSAH, 0); + vmxnet3_free_irqs(adapter); +irq_err: +rq_err: + /* free up buffers we allocated */ + vmxnet3_rq_cleanup(&adapter->rx_queue, adapter); + return err; +} + + +static void +vmxnet3_reset_dev(struct vmxnet3_adapter *adapter) +{ + VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD, VMXNET3_CMD_RESET_DEV); +} + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_quiesce_dev -- + * + * stop the device. After this function returns, the adapter stop pkt tx/rx + * and won't generate intrs. The stack won't try to xmit pkts through us, + * nor will it poll us for pkts. It does the following: + * + * 1. ask the vNIC to quiesce + * 2. disable the vNIC from generating intrs + * 3. free intr + * 4. stop the stack from xmiting pkts thru us and polling + * 5. free rx buffers + * 6. tx complete pkts pending + * + * Result: + * 0 on success + * + *---------------------------------------------------------------------------- + */ + +static int +vmxnet3_quiesce_dev(struct vmxnet3_adapter *adapter) +{ + if (test_and_set_bit(VMXNET3_STATE_BIT_QUIESCED, &adapter->state)) { + printk(KERN_INFO "%s: already quiesced\n", adapter->netdev->name); + return 0; + } + + VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD, VMXNET3_CMD_QUIESCE_DEV); + vmxnet3_disable_all_intrs(adapter); + +#ifdef VMXNET3_NAPI + compat_napi_disable(adapter->netdev, &adapter->napi); +#endif + + netif_tx_disable(adapter->netdev); + + adapter->link_speed = 0; + netif_carrier_off(adapter->netdev); + + /* TODO: force tx completion */ + + vmxnet3_tq_cleanup(&adapter->tx_queue, adapter); + vmxnet3_rq_cleanup(&adapter->rx_queue, adapter); + + vmxnet3_free_irqs(adapter); + return 0; +} + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_write_mac_addr -- + * + * Write the given MAC address to the device register + * + * Result: + * None + * + * Side-effects: + * None + * + *---------------------------------------------------------------------------- + */ + +static void +vmxnet3_write_mac_addr(struct vmxnet3_adapter *adapter, uint8 *mac) +{ + uint32 tmp; + + tmp = *(uint32*)mac; + VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_MACL, tmp); + + tmp = (mac[5] << 8) | mac[4]; + VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_MACH, tmp); +} + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_set_mac_addr -- + * + * Change the current MAC address + * + * Result: + * 0 on success + * + * Side-effects: + * None + * + *---------------------------------------------------------------------------- + */ + +static int +vmxnet3_set_mac_addr(struct net_device *netdev, void *p) +{ + struct sockaddr *addr = p; + struct vmxnet3_adapter *adapter = compat_netdev_priv(netdev); + + memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len); + vmxnet3_write_mac_addr(adapter, addr->sa_data); + + return 0; +} + + +/* ==================== initialization and cleanup routines ============ */ + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_alloc_pci_resources -- + * + * allocate pci resources + * + * Result: + * 0 on success or error code + * + *---------------------------------------------------------------------------- + */ +static int +vmxnet3_alloc_pci_resources(struct vmxnet3_adapter *adapter, Bool *dma64) +{ + int err; + unsigned long mmio_start, mmio_len; + struct pci_dev *pdev = adapter->pdev; + + err = compat_pci_enable_device(pdev); + if (err) { + printk(KERN_ERR "Failed to enable adapter %s: error %d\n", + compat_pci_name(pdev), err); + return err; + } + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 6) + if (pci_set_dma_mask(pdev, DMA_64BIT_MASK) == 0) { + if (pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK) != 0) { + printk(KERN_ERR "pci_set_consistent_dma_mask failed for adapter %s\n", + compat_pci_name(pdev)); + err = -EIO; + goto err_set_mask; + } + *dma64 = TRUE; + } else { + if (pci_set_dma_mask(pdev, DMA_32BIT_MASK) != 0) { + printk(KERN_ERR "pci_set_dma_mask failed for adapter %s\n", + compat_pci_name(pdev)); + err = -EIO; + goto err_set_mask; + } + *dma64 = FALSE; + } +#else + *dma64 = TRUE; +#endif + + err = compat_pci_request_regions(pdev, vmxnet3_driver_name); + if (err) { + printk(KERN_ERR "Failed to request region for adapter %s: error %d\n", + compat_pci_name(pdev), err); + goto err_set_mask; + } + + compat_pci_set_master(pdev); + + mmio_start = compat_pci_resource_start(pdev, 0); + mmio_len = compat_pci_resource_len(pdev, 0); + adapter->hw_addr0 = ioremap(mmio_start, mmio_len); + if (!adapter->hw_addr0) { + printk(KERN_ERR "Failed to map bar0 for adapter %s\n", + compat_pci_name(pdev)); + err = -EIO; + goto err_ioremap; + } + + mmio_start = compat_pci_resource_start(pdev, 1); + mmio_len = compat_pci_resource_len(pdev, 1); + adapter->hw_addr1 = ioremap(mmio_start, mmio_len); + if (!adapter->hw_addr1) { + printk(KERN_ERR "Failed to map bar1 for adapter %s\n", + compat_pci_name(pdev)); + err = -EIO; + goto err_bar1; + } + return 0; + +err_bar1: + iounmap(adapter->hw_addr0); +err_ioremap: + compat_pci_release_regions(pdev); +err_set_mask: + compat_pci_disable_device(pdev); + return err; +} + + +static void +vmxnet3_free_pci_resources(struct vmxnet3_adapter *adapter) +{ + VMXNET3_ASSERT(adapter->pdev); + + iounmap(adapter->hw_addr0); + iounmap(adapter->hw_addr1); + compat_pci_release_regions(adapter->pdev); + compat_pci_disable_device(adapter->pdev); +} + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_setup_driver_shared -- + * + * Set up driver_shared based on settings in adapter. + * + * Result: + * 1. the whole driver_shared area is wiped out and re-initialized + * + *---------------------------------------------------------------------------- + */ + +static void +vmxnet3_setup_driver_shared(struct vmxnet3_adapter *adapter) +{ + Vmxnet3_DriverShared *shared = adapter->shared; + Vmxnet3_DSDevRead *devRead = &shared->devRead; + Vmxnet3_TxQueueConf *tqc; + Vmxnet3_RxQueueConf *rqc; + int i; + + memset(shared, 0, sizeof(*shared)); + + /* driver settings */ + shared->magic = VMXNET3_REV1_MAGIC; + devRead->misc.driverInfo.version = VMXNET3_DRIVER_VERSION_NUM; + devRead->misc.driverInfo.gos.gosBits = sizeof(void*) == 4 ? VMXNET3_GOS_BITS_32 : + VMXNET3_GOS_BITS_64; + devRead->misc.driverInfo.gos.gosType = VMXNET3_GOS_TYPE_LINUX; + devRead->misc.driverInfo.vmxnet3RevSpt = 1; + devRead->misc.driverInfo.uptVerSpt = 1; + + devRead->misc.ddPA = virt_to_phys(adapter); + devRead->misc.ddLen = sizeof(struct vmxnet3_adapter); + + /* set up feature flags */ + if (adapter->rxcsum) { + devRead->misc.uptFeatures |= UPT1_F_RXCSUM; + } + if (adapter->lro) { + devRead->misc.uptFeatures |= UPT1_F_LRO; + devRead->misc.maxNumRxSG = 1 + MAX_SKB_FRAGS; + } + if ((adapter->netdev->features & NETIF_F_HW_VLAN_RX) + && adapter->vlan_grp) { + devRead->misc.uptFeatures |= UPT1_F_RXVLAN; + } + + devRead->misc.mtu = adapter->netdev->mtu; + devRead->misc.queueDescPA = adapter->queue_desc_pa; + devRead->misc.queueDescLen = sizeof(Vmxnet3_TxQueueDesc) + + sizeof(Vmxnet3_RxQueueDesc); + + /* tx queue settings */ + VMXNET3_ASSERT(adapter->tx_queue.tx_ring.base != NULL); + + devRead->misc.numTxQueues = 1; + tqc = &adapter->tqd_start->conf; + tqc->txRingBasePA = adapter->tx_queue.tx_ring.basePA; + tqc->dataRingBasePA = adapter->tx_queue.data_ring.basePA; + tqc->compRingBasePA = adapter->tx_queue.comp_ring.basePA; + tqc->ddPA = virt_to_phys(adapter->tx_queue.buf_info); + tqc->txRingSize = adapter->tx_queue.tx_ring.size; + tqc->dataRingSize = adapter->tx_queue.data_ring.size; + tqc->compRingSize = adapter->tx_queue.comp_ring.size; + tqc->ddLen = sizeof(struct vmxnet3_tx_buf_info) * + tqc->txRingSize; + tqc->intrIdx = adapter->tx_queue.comp_ring.intr_idx; + + /* rx queue settings */ + devRead->misc.numRxQueues = 1; + rqc = &adapter->rqd_start->conf; + rqc->rxRingBasePA[0] = adapter->rx_queue.rx_ring[0].basePA; + rqc->rxRingBasePA[1] = adapter->rx_queue.rx_ring[1].basePA; + rqc->compRingBasePA = adapter->rx_queue.comp_ring.basePA; + rqc->ddPA = virt_to_phys(adapter->rx_queue.buf_info); + rqc->rxRingSize[0] = adapter->rx_queue.rx_ring[0].size; + rqc->rxRingSize[1] = adapter->rx_queue.rx_ring[1].size; + rqc->compRingSize = adapter->rx_queue.comp_ring.size; + rqc->ddLen = sizeof(struct vmxnet3_rx_buf_info) * + (rqc->rxRingSize[0] + rqc->rxRingSize[1]); + rqc->intrIdx = adapter->rx_queue.comp_ring.intr_idx; + + /* intr settings */ + devRead->intrConf.autoMask = adapter->intr.mask_mode == VMXNET3_IMM_AUTO; + devRead->intrConf.numIntrs = adapter->intr.num_intrs; + for (i = 0; i < adapter->intr.num_intrs; i++) { + devRead->intrConf.modLevels[i] = adapter->intr.mod_levels[i]; + } + devRead->intrConf.eventIntrIdx = adapter->intr.event_intr_idx; + + /* rx filter settings */ + devRead->rxFilterConf.rxMode = 0; + vmxnet3_restore_vlan(adapter); + /* the rest are already zeroed */ +} + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_adjust_rx_ring_size -- + * + * calc the # of buffers for a pkt based on mtu, then adjust the size of the + * 1st rx ring accordingly + * + * Result: + * None + * + *---------------------------------------------------------------------------- + */ + +static void +vmxnet3_adjust_rx_ring_size(struct vmxnet3_adapter *adapter) +{ + size_t sz; + + if (adapter->netdev->mtu <= VMXNET3_MAX_SKB_BUF_SIZE - VMXNET3_MAX_ETH_HDR_SIZE) { + adapter->skb_buf_size = adapter->netdev->mtu + VMXNET3_MAX_ETH_HDR_SIZE; + if (adapter->skb_buf_size < VMXNET3_MIN_T0_BUF_SIZE) { + adapter->skb_buf_size = VMXNET3_MIN_T0_BUF_SIZE; + } + adapter->rx_buf_per_pkt = 1; + } else { + adapter->skb_buf_size = VMXNET3_MAX_SKB_BUF_SIZE; + sz = adapter->netdev->mtu - VMXNET3_MAX_SKB_BUF_SIZE + VMXNET3_MAX_ETH_HDR_SIZE; + adapter->rx_buf_per_pkt = 1 + (sz + PAGE_SIZE - 1) / PAGE_SIZE; + } + + /* + * for simplicity, force the ring0 size to be a multiple of + * rx_buf_per_pkt * VMXNET3_RING_SIZE_ALIGN + */ + sz = adapter->rx_buf_per_pkt * VMXNET3_RING_SIZE_ALIGN; + adapter->rx_queue.rx_ring[0].size = + (adapter->rx_queue.rx_ring[0].size + sz - 1) / sz * sz; + adapter->rx_queue.rx_ring[0].size = min_t(uint32, adapter->rx_queue.rx_ring[0].size, + VMXNET3_RX_RING_MAX_SIZE / sz * sz); +} + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_create_queues -- + * + * Create the specified number of tx queues and rx queues. On failure, it + * destroys the queues created. + * + * Results: + * 0 on success, errno value on failure. + * + * Side effects: + * None + * + *---------------------------------------------------------------------------- + */ + +static int +vmxnet3_create_queues(struct vmxnet3_adapter *adapter, + uint32 tx_ring_size, + uint32 rx_ring_size, + uint32 rx_ring2_size) +{ + int err; + + adapter->tx_queue.tx_ring.size = tx_ring_size; + adapter->tx_queue.data_ring.size = tx_ring_size; + adapter->tx_queue.comp_ring.size = tx_ring_size; + adapter->tx_queue.shared = &adapter->tqd_start->ctrl; + adapter->tx_queue.stopped = TRUE; + err = vmxnet3_tq_create(&adapter->tx_queue, adapter); + if (err) { + return err; + } + + adapter->rx_queue.rx_ring[0].size = rx_ring_size; + adapter->rx_queue.rx_ring[1].size = rx_ring2_size; + vmxnet3_adjust_rx_ring_size(adapter); + adapter->rx_queue.comp_ring.size = adapter->rx_queue.rx_ring[0].size + + adapter->rx_queue.rx_ring[1].size; + adapter->rx_queue.qid = 0; + adapter->rx_queue.qid2 = 1; + adapter->rx_queue.shared = &adapter->rqd_start->ctrl; + err = vmxnet3_rq_create(&adapter->rx_queue, adapter); + if (err) { + vmxnet3_tq_destroy(&adapter->tx_queue, adapter); + } + + return err; +} + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_open -- + * + * called when the interface is brought up + * + * Result: + * 0 on success, negative errno value on failure + * + * Side-effects: + * setup rings, allocate necessary resources, request for IRQs, configure + * the device. The device is functional after this function finishes + * successfully. + * + *---------------------------------------------------------------------------- + */ + +static int +vmxnet3_open(struct net_device *netdev) +{ + struct vmxnet3_adapter *adapter; + int err; + + adapter = compat_netdev_priv(netdev); + + spin_lock_init(&adapter->tx_queue.tx_lock); + + err = vmxnet3_create_queues(adapter, VMXNET3_DEF_TX_RING_SIZE, + VMXNET3_DEF_RX_RING_SIZE, VMXNET3_DEF_RX_RING_SIZE); + if (err) { + goto queue_err; + } + + err = vmxnet3_activate_dev(adapter); + if (err) { + goto activate_err; + } + + COMPAT_NETDEV_MOD_INC_USE_COUNT; + + return 0; + +activate_err: + vmxnet3_rq_destroy(&adapter->rx_queue, adapter); + vmxnet3_tq_destroy(&adapter->tx_queue, adapter); +queue_err: + return err; +} + + +static int +vmxnet3_close(struct net_device *netdev) +{ + struct vmxnet3_adapter *adapter = compat_netdev_priv(netdev); + + /* + * Reset_work may be in the middle of resetting the device, wait for its + * completion. + */ + while (test_and_set_bit(VMXNET3_STATE_BIT_RESETTING, &adapter->state)) { + compat_msleep(1); + } + + vmxnet3_quiesce_dev(adapter); + + vmxnet3_rq_destroy(&adapter->rx_queue, adapter); + vmxnet3_tq_destroy(&adapter->tx_queue, adapter); + + COMPAT_NETDEV_MOD_DEC_USE_COUNT; + + clear_bit(VMXNET3_STATE_BIT_RESETTING, &adapter->state); + return 0; +} + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_force_close -- + * + * called to forcibly close the device when the driver failed to re-activate it. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ +static void +vmxnet3_force_close(struct vmxnet3_adapter *adapter) +{ + /* + * we must clear VMXNET3_STATE_BIT_RESETTING, otherwise + * vmxnet3_close() will deadlock. + */ + VMXNET3_ASSERT(!test_bit(VMXNET3_STATE_BIT_RESETTING, &adapter->state)); + +#ifdef VMXNET3_NAPI + /* we need to enable NAPI, otherwise dev_close will deadlock */ + compat_napi_enable(adapter->netdev, &adapter->napi); +#endif + dev_close(adapter->netdev); +} + + +static int +vmxnet3_change_mtu(struct net_device *netdev, int new_mtu) +{ + struct vmxnet3_adapter *adapter = compat_netdev_priv(netdev); + int err = 0; + + if (new_mtu < VMXNET3_MIN_MTU || new_mtu > VMXNET3_MAX_MTU) { + return -EINVAL; + } + + if (new_mtu > 1500 && !adapter->jumbo_frame) { + return -EINVAL; + } + + netdev->mtu = new_mtu; + + /* + * Reset_work may be in the middle of resetting the device, wait for its + * completion. + */ + while (test_and_set_bit(VMXNET3_STATE_BIT_RESETTING, &adapter->state)) { + compat_msleep(1); + } + + if (compat_netif_running(netdev)) { + vmxnet3_quiesce_dev(adapter); + vmxnet3_reset_dev(adapter); + + /* we need to re-create the rx queue based on the new mtu */ + vmxnet3_rq_destroy(&adapter->rx_queue, adapter); + vmxnet3_adjust_rx_ring_size(adapter); + adapter->rx_queue.comp_ring.size = adapter->rx_queue.rx_ring[0].size + + adapter->rx_queue.rx_ring[1].size; + err = vmxnet3_rq_create(&adapter->rx_queue, adapter); + if (err) { + printk(KERN_ERR "%s: failed to re-create rx queue, error %d. Closing it.\n", + netdev->name, err); + goto out; + } + + err = vmxnet3_activate_dev(adapter); + if (err) { + printk(KERN_ERR "%s: failed to re-activate, error %d. Closing it\n", + netdev->name, err); + goto out; + } + } + +out: + clear_bit(VMXNET3_STATE_BIT_RESETTING, &adapter->state); + if (err) { + vmxnet3_force_close(adapter); + } + return err; +} + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_declare_features -- + * + * set netdev->features based on the device's capabilities + * + * Result: + * None + * + * Side-effects: + * netdev->features is set + * + *---------------------------------------------------------------------------- + */ + +static void +vmxnet3_declare_features(struct vmxnet3_adapter *adapter, Bool dma64) +{ + struct net_device *netdev = adapter->netdev; + + netdev->features = NETIF_F_SG | + NETIF_F_HW_CSUM | + NETIF_F_HW_VLAN_TX | + NETIF_F_HW_VLAN_RX | + NETIF_F_HW_VLAN_FILTER | + NETIF_F_TSO; + printk(KERN_INFO "features: sg csum vlan jf tso"); + + adapter->rxcsum = TRUE; + adapter->jumbo_frame = TRUE; + +#ifdef NETIF_F_TSO6 + netdev->features |= NETIF_F_TSO6; + printk(" tsoIPv6"); +#endif + + adapter->lro = TRUE; + printk(" lro"); + + if (dma64) { + netdev->features |= NETIF_F_HIGHDMA; + printk(" highDMA"); + } + + printk("\n"); +} + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_read_mac_addr -- + * + * Read the current MAC address from the device and store into @mac + * + * Result: + * None + * + * Side-effects: + * None + * + *---------------------------------------------------------------------------- + */ + +static void +vmxnet3_read_mac_addr(struct vmxnet3_adapter *adapter, uint8 *mac) +{ + uint32 tmp; + + tmp = VMXNET3_READ_BAR1_REG(adapter, VMXNET3_REG_MACL); + *(uint32*)mac = tmp; + + tmp = VMXNET3_READ_BAR1_REG(adapter, VMXNET3_REG_MACH); + mac[4] = tmp & 0xff; + mac[5] = (tmp >> 8) & 0xff; +} + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_get_rx_csum -- + * + * Ethtool callback to return whether or not the dev verifies rx csum + * + * Result: + * 1 if the device verifies rx csum and 0 otherwise + * + * Side-effects: + * None + * + *---------------------------------------------------------------------------- + */ + +static uint32 +vmxnet3_get_rx_csum(struct net_device *netdev) +{ + struct vmxnet3_adapter *adapter = compat_netdev_priv(netdev); + return adapter->rxcsum; +} + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_set_rx_csum -- + * + * Ethtool callback to change if rx csum verification should be done + * + * Result: + * 0 on success + * + * Side-effects: + * None + * + *---------------------------------------------------------------------------- + */ + +static int +vmxnet3_set_rx_csum(struct net_device *netdev, uint32 val) +{ + struct vmxnet3_adapter *adapter = compat_netdev_priv(netdev); + + if (adapter->rxcsum != val) { + adapter->rxcsum = val; + if (compat_netif_running(netdev)) { + if (val) { + adapter->shared->devRead.misc.uptFeatures |= UPT1_F_RXCSUM; + } else { + adapter->shared->devRead.misc.uptFeatures &= ~UPT1_F_RXCSUM; + } + VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD, VMXNET3_CMD_UPDATE_FEATURE); + } + } + return 0; +} + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_get_tx_csum -- + * + * Ethtool op to return whether or not tx csum offload is enabled + * + * Result: + * 1 if tx csum offload is currently used and 0 otherwise + * + * Side-effects: + * None + * + *---------------------------------------------------------------------------- + */ + +static uint32 +vmxnet3_get_tx_csum(struct net_device *netdev) +{ + return (netdev->features & NETIF_F_HW_CSUM) != 0; +} + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_set_tx_csum -- + * + * Ethtool op to change if tx csum offloading should be used or not + * + * Result: + * 0 on success + * + * Side-effects: + * None + * + *---------------------------------------------------------------------------- + */ + +static int +vmxnet3_set_tx_csum(struct net_device *netdev, uint32 val) +{ + if (val) { + netdev->features |= NETIF_F_HW_CSUM; + } else { + netdev->features &= ~ NETIF_F_HW_CSUM; + } + return 0; +} + + +/* per tq stats maintained by the device */ +static const struct vmxnet3_stat_desc +vmxnet3_tq_dev_stats[] = { + /* description, offset */ + { "TSO pkts tx", offsetof(UPT1_TxStats, TSOPktsTxOK) }, + { "TSO bytes tx", offsetof(UPT1_TxStats, TSOBytesTxOK) }, + { "ucast pkts tx", offsetof(UPT1_TxStats, ucastPktsTxOK) }, + { "ucast bytes tx", offsetof(UPT1_TxStats, ucastBytesTxOK) }, + { "mcast pkts tx", offsetof(UPT1_TxStats, mcastPktsTxOK) }, + { "mcast bytes tx", offsetof(UPT1_TxStats, mcastBytesTxOK) }, + { "bcast pkts tx", offsetof(UPT1_TxStats, bcastPktsTxOK) }, + { "bcast bytes tx", offsetof(UPT1_TxStats, bcastBytesTxOK) }, + { "pkts tx err", offsetof(UPT1_TxStats, pktsTxError) }, + { "pkts tx discard", offsetof(UPT1_TxStats, pktsTxDiscard) }, +}; + +/* per tq stats maintained by the driver */ +static const struct vmxnet3_stat_desc +vmxnet3_tq_driver_stats[] = { + /* description, offset */ + { "drv dropped tx total", offsetof(struct vmxnet3_tq_driver_stats, drop_total) }, + { " too many frags", offsetof(struct vmxnet3_tq_driver_stats, drop_too_many_frags) }, + { " giant hdr", offsetof(struct vmxnet3_tq_driver_stats, drop_oversized_hdr) }, + { " hdr err", offsetof(struct vmxnet3_tq_driver_stats, drop_hdr_inspect_err) }, + { " tso", offsetof(struct vmxnet3_tq_driver_stats, drop_tso) }, + { "ring full", offsetof(struct vmxnet3_tq_driver_stats, tx_ring_full) }, + { "pkts linearized", offsetof(struct vmxnet3_tq_driver_stats, linearized) }, + { "hdr cloned", offsetof(struct vmxnet3_tq_driver_stats, copy_skb_header) }, + { "giant hdr", offsetof(struct vmxnet3_tq_driver_stats, oversized_hdr) }, +}; + +/* per rq stats maintained by the device */ +static const struct vmxnet3_stat_desc +vmxnet3_rq_dev_stats[] = { + { "LRO pkts rx", offsetof(UPT1_RxStats, LROPktsRxOK) }, + { "LRO byte rx", offsetof(UPT1_RxStats, LROBytesRxOK) }, + { "ucast pkts rx", offsetof(UPT1_RxStats, ucastPktsRxOK) }, + { "ucast bytes rx", offsetof(UPT1_RxStats, ucastBytesRxOK) }, + { "mcast pkts rx", offsetof(UPT1_RxStats, mcastPktsRxOK) }, + { "mcast bytes rx", offsetof(UPT1_RxStats, mcastBytesRxOK) }, + { "bcast pkts rx", offsetof(UPT1_RxStats, bcastPktsRxOK) }, + { "bcast bytes rx", offsetof(UPT1_RxStats, bcastBytesRxOK) }, + { "pkts rx out of buf", offsetof(UPT1_RxStats, pktsRxOutOfBuf) }, + { "pkts rx err", offsetof(UPT1_RxStats, pktsRxError) }, +}; + +/* per rq stats maintained by the driver */ +static const struct vmxnet3_stat_desc +vmxnet3_rq_driver_stats[] = { + /* description, offset */ + { "drv dropped rx total", offsetof(struct vmxnet3_rq_driver_stats, drop_total) }, + { " err", offsetof(struct vmxnet3_rq_driver_stats, drop_err) }, + { " fcs", offsetof(struct vmxnet3_rq_driver_stats, drop_fcs) }, + { "rx buf alloc fail", offsetof(struct vmxnet3_rq_driver_stats, rx_buf_alloc_failure) }, +}; + +/* gloabl stats maintained by the driver */ +static const struct vmxnet3_stat_desc +vmxnet3_global_stats[] = { + /* description, offset */ + { "tx timeout count", offsetof(struct vmxnet3_adapter, tx_timeout_count) } +}; + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_get_stats -- + * + * Collect the device and driver statistics and present in the + * net_device_stats format. + * + * Results: + * Pointer to the net_device_stats struct in the adapter. + * + * Side effects: + * None + * + *---------------------------------------------------------------------------- + */ + + +static struct net_device_stats* +vmxnet3_get_stats(struct net_device *netdev) +{ + struct vmxnet3_adapter *adapter; + struct vmxnet3_tq_driver_stats *drvTxStats; + struct vmxnet3_rq_driver_stats *drvRxStats; + UPT1_TxStats *devTxStats; + UPT1_RxStats *devRxStats; + + adapter = compat_netdev_priv(netdev); + + /* Collect the dev stats into the shared area */ + VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD, VMXNET3_CMD_GET_STATS); + + /* Assuming that we have a single queue device */ + devTxStats = &adapter->tqd_start->stats; + devRxStats = &adapter->rqd_start->stats; + + /* Get access to the driver stats per queue */ + drvTxStats = &adapter->tx_queue.stats; + drvRxStats = &adapter->rx_queue.stats; + + memset(&adapter->net_stats, 0, sizeof(adapter->net_stats)); + + adapter->net_stats.rx_packets = devRxStats->ucastPktsRxOK + + devRxStats->mcastPktsRxOK + + devRxStats->bcastPktsRxOK; + + adapter->net_stats.tx_packets = devTxStats->ucastPktsTxOK + + devTxStats->mcastPktsTxOK + + devTxStats->bcastPktsTxOK; + + adapter->net_stats.rx_bytes = devRxStats->ucastBytesRxOK + + devRxStats->mcastBytesRxOK + + devRxStats->bcastBytesRxOK; + + adapter->net_stats.tx_bytes = devTxStats->ucastBytesTxOK + + devTxStats->mcastBytesTxOK + + devTxStats->bcastBytesTxOK; + + adapter->net_stats.rx_errors = devRxStats->pktsRxError; + adapter->net_stats.tx_errors = devTxStats->pktsTxError; + adapter->net_stats.rx_dropped = drvRxStats->drop_total; + adapter->net_stats.tx_dropped = drvTxStats->drop_total; + adapter->net_stats.multicast = devRxStats->mcastPktsRxOK; + + return &adapter->net_stats; +} + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_get_stats_count -- + * + * Return the number of counters we will return in vmxnet3_get_ethtool_stats. + * Assume each counter is uint64 + * + * Result: + * # of counters we will return in vmxnet3_get_ethtool_stats + * + * Side-effects: + * None + * + *---------------------------------------------------------------------------- + */ + +static int +vmxnet3_get_stats_count(struct net_device *netdev) +{ + return ARRAY_SIZE(vmxnet3_tq_dev_stats) + + ARRAY_SIZE(vmxnet3_tq_driver_stats) + + ARRAY_SIZE(vmxnet3_rq_dev_stats) + + ARRAY_SIZE(vmxnet3_rq_driver_stats) + + ARRAY_SIZE(vmxnet3_global_stats); +} + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_get_regs_len -- + * + * Return the size of buffer needed to dump registers. + * + * Result: + * The number of bytes needed. + * + * Side-effects: + * None + * + *---------------------------------------------------------------------------- + */ +static int +vmxnet3_get_regs_len(struct net_device *netdev) +{ + return 20 * sizeof(uint32); +} + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_get_drvinfo -- + * + * Ethtool callback to return driver information + * + * Result: + * None + * + * Side-effects: + * 1. *drvinfo is updated + * + *---------------------------------------------------------------------------- + */ + +static void +vmxnet3_get_drvinfo(struct net_device *netdev, + struct ethtool_drvinfo *drvinfo) +{ + struct vmxnet3_adapter *adapter = compat_netdev_priv(netdev); + + strncpy(drvinfo->driver, vmxnet3_driver_name, sizeof(drvinfo->driver)); + drvinfo->driver[sizeof(drvinfo->driver) - 1] = '\0'; + + strncpy(drvinfo->version, VMXNET3_DRIVER_VERSION_REPORT, sizeof(drvinfo->version)); + drvinfo->driver[sizeof(drvinfo->version) - 1] = '\0'; + + strncpy(drvinfo->fw_version, "N/A", sizeof(drvinfo->fw_version)); + drvinfo->fw_version[sizeof(drvinfo->fw_version) - 1] = '\0'; + + strncpy(drvinfo->bus_info, compat_pci_name(adapter->pdev), ETHTOOL_BUSINFO_LEN); + drvinfo->n_stats = vmxnet3_get_stats_count(netdev); + drvinfo->testinfo_len = 0; + drvinfo->eedump_len = 0; + drvinfo->regdump_len = vmxnet3_get_regs_len(netdev); +} + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_get_strings -- + * + * Return the description strings for the counters returned by + * vmxnet3_get_ethtool_stats. + * + * Result: + * None + * + * Side-effects: + * None + * + *---------------------------------------------------------------------------- + */ + +static void +vmxnet3_get_strings(struct net_device *netdev, + u32 stringset, + u8 *buf) +{ + if (stringset == ETH_SS_STATS) { + int i; + + for (i = 0; i < ARRAY_SIZE(vmxnet3_tq_dev_stats); i++) { + memcpy(buf, vmxnet3_tq_dev_stats[i].desc, ETH_GSTRING_LEN); + buf += ETH_GSTRING_LEN; + } + for (i = 0; i < ARRAY_SIZE(vmxnet3_tq_driver_stats); i++) { + memcpy(buf, vmxnet3_tq_driver_stats[i].desc, ETH_GSTRING_LEN); + buf += ETH_GSTRING_LEN; + } + for (i = 0; i < ARRAY_SIZE(vmxnet3_rq_dev_stats); i++) { + memcpy(buf, vmxnet3_rq_dev_stats[i].desc, ETH_GSTRING_LEN); + buf += ETH_GSTRING_LEN; + } + for (i = 0; i < ARRAY_SIZE(vmxnet3_rq_driver_stats); i++) { + memcpy(buf, vmxnet3_rq_driver_stats[i].desc, ETH_GSTRING_LEN); + buf += ETH_GSTRING_LEN; + } + for (i = 0; i < ARRAY_SIZE(vmxnet3_global_stats); i++) { + memcpy(buf, vmxnet3_global_stats[i].desc, ETH_GSTRING_LEN); + buf += ETH_GSTRING_LEN; + } + } +} + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_get_ethtool_stats -- + * + * Return the values of the maintained counters in 'buf' + * + * Result: + * None + * + * Side-effects: + * None + * + *---------------------------------------------------------------------------- + */ + +static void +vmxnet3_get_ethtool_stats(struct net_device *netdev, + struct ethtool_stats *stats, + u64 *buf) +{ + struct vmxnet3_adapter *adapter = compat_netdev_priv(netdev); + uint8 *base; + int i; + + VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD, VMXNET3_CMD_GET_STATS); + + /* this does assume each counter is 64-bit wide */ + + base = (uint8*)&adapter->tqd_start->stats; + for (i = 0; i < ARRAY_SIZE(vmxnet3_tq_dev_stats); i++) { + *buf++ = *(uint64*)(base + vmxnet3_tq_dev_stats[i].offset); + } + + base = (uint8*)&adapter->tx_queue.stats; + for (i = 0; i < ARRAY_SIZE(vmxnet3_tq_driver_stats); i++) { + *buf++ = *(uint64*)(base + vmxnet3_tq_driver_stats[i].offset); + } + + base = (uint8*)&adapter->rqd_start->stats; + for (i = 0; i < ARRAY_SIZE(vmxnet3_rq_dev_stats); i++) { + *buf++ = *(uint64*)(base + vmxnet3_rq_dev_stats[i].offset); + } + + base = (uint8*)&adapter->rx_queue.stats; + for (i = 0; i < ARRAY_SIZE(vmxnet3_rq_driver_stats); i++) { + *buf++ = *(uint64*)(base + vmxnet3_rq_driver_stats[i].offset); + } + + base = (uint8*)adapter; + for (i = 0; i < ARRAY_SIZE(vmxnet3_global_stats); i++) { + *buf++ = *(uint64*)(base + vmxnet3_global_stats[i].offset); + } +} + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_get_regs -- + * + * Dump out the register values. + * + * Result: + * None + * + * Side-effects: + * None + * + *---------------------------------------------------------------------------- + */ + +static void +vmxnet3_get_regs(struct net_device *netdev, struct ethtool_regs *regs, void *p) +{ + struct vmxnet3_adapter *adapter = compat_netdev_priv(netdev); + uint32 *buf = p; + + memset(p, 0, vmxnet3_get_regs_len(netdev)); + + regs->version = 1; + + /* Update vmxnet3_get_regs_len if we want to dump more registers */ + + /* make each ring use multiple of 16 bytes */ + buf[0] = adapter->tx_queue.tx_ring.next2fill; + buf[1] = adapter->tx_queue.tx_ring.next2comp; + buf[2] = adapter->tx_queue.tx_ring.gen; + buf[3] = 0; + + buf[4] = adapter->tx_queue.comp_ring.next2proc; + buf[5] = adapter->tx_queue.comp_ring.gen; + buf[6] = adapter->tx_queue.stopped; + buf[7] = 0; + + buf[8] = adapter->rx_queue.rx_ring[0].next2fill; + buf[9] = adapter->rx_queue.rx_ring[0].next2comp; + buf[10] = adapter->rx_queue.rx_ring[0].gen; + buf[11] = 0; + + buf[12] = adapter->rx_queue.rx_ring[1].next2fill; + buf[13] = adapter->rx_queue.rx_ring[1].next2comp; + buf[14] = adapter->rx_queue.rx_ring[1].gen; + buf[15] = 0; + + buf[16] = adapter->rx_queue.comp_ring.next2proc; + buf[17] = adapter->rx_queue.comp_ring.gen; + buf[18] = 0; + buf[19] = 0; +} + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_get_wol -- + * + * Report whether Wake-on-Lan is enabled. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +static void +vmxnet3_get_wol(struct net_device *netdev, + struct ethtool_wolinfo *wol) +{ + struct vmxnet3_adapter *adapter = compat_netdev_priv(netdev); + + wol->supported = WAKE_UCAST | WAKE_ARP | WAKE_MAGIC; + wol->wolopts = adapter->wol; +} + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_set_wol -- + * + * Turn Wake-on-Lan on or off. + * + * Results: + * 0 on success, errno on failure. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +static int +vmxnet3_set_wol(struct net_device *netdev, + struct ethtool_wolinfo *wol) +{ + struct vmxnet3_adapter *adapter = compat_netdev_priv(netdev); + + if (wol->wolopts & (WAKE_PHY | WAKE_MCAST | WAKE_BCAST | + WAKE_MAGICSECURE)) { + return -EOPNOTSUPP; + } + + adapter->wol = wol->wolopts; + return 0; +} + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_get_settings -- + * + * Get device-specific settings. + * + * Results: + * 0 on success, errno on failure. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +static int +vmxnet3_get_settings(struct net_device *netdev, + struct ethtool_cmd *ecmd) +{ + struct vmxnet3_adapter *adapter = compat_netdev_priv(netdev); + + ecmd->supported = SUPPORTED_10000baseT_Full | SUPPORTED_1000baseT_Full | + SUPPORTED_TP; + ecmd->advertising = ADVERTISED_TP; + ecmd->port = PORT_TP; + ecmd->transceiver = XCVR_INTERNAL; + + if (adapter->link_speed) { + ecmd->speed = adapter->link_speed; + ecmd->duplex = DUPLEX_FULL; + } else { + ecmd->speed = -1; + ecmd->duplex = -1; + } + return 0; +} + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_get_ringparam -- + * + * Get ring sizes + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ +static void +vmxnet3_get_ringparam(struct net_device *netdev, + struct ethtool_ringparam *param) +{ + struct vmxnet3_adapter *adapter = compat_netdev_priv(netdev); + + param->rx_max_pending = VMXNET3_RX_RING_MAX_SIZE; + param->tx_max_pending = VMXNET3_TX_RING_MAX_SIZE; + param->rx_mini_max_pending = 0; + param->rx_jumbo_max_pending = 0; + + param->rx_pending = adapter->rx_queue.rx_ring[0].size; + param->tx_pending = adapter->tx_queue.tx_ring.size; + param->rx_mini_pending = 0; + param->rx_jumbo_pending = 0; +} + + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_set_ringparam -- + * + * Set ring sizes + * + * Results: + * 0 on success or errno. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ +static int +vmxnet3_set_ringparam(struct net_device *netdev, + struct ethtool_ringparam *param) +{ + struct vmxnet3_adapter *adapter = compat_netdev_priv(netdev); + uint32 new_tx_ring_size, new_rx_ring_size; + uint32 sz; + int err = 0; + + if (param->tx_pending == 0 || param->tx_pending > VMXNET3_TX_RING_MAX_SIZE) { + printk(KERN_ERR "%s: invalid tx ring size %u\n", netdev->name, param->tx_pending); + return -EINVAL; + } + if (param->rx_pending == 0 || param->rx_pending > VMXNET3_RX_RING_MAX_SIZE) { + printk(KERN_ERR "%s: invalid rx ring size %u\n", netdev->name, param->rx_pending); + return -EINVAL; + } + + /* round it up to a multiple of VMXNET3_RING_SIZE_ALIGN */ + new_tx_ring_size = (param->tx_pending + VMXNET3_RING_SIZE_MASK) & + ~VMXNET3_RING_SIZE_MASK; + new_tx_ring_size = min_t(uint32, new_tx_ring_size, VMXNET3_TX_RING_MAX_SIZE); + VMXNET3_ASSERT(new_tx_ring_size <= VMXNET3_TX_RING_MAX_SIZE); + VMXNET3_ASSERT(new_tx_ring_size % VMXNET3_RING_SIZE_ALIGN == 0); + + /* ring0 has to be a multiple of rx_buf_per_pkt * VMXNET3_RING_SIZE_ALIGN */ + sz = adapter->rx_buf_per_pkt * VMXNET3_RING_SIZE_ALIGN; + new_rx_ring_size = (param->rx_pending + sz - 1) / sz * sz; + new_rx_ring_size = min_t(uint32, new_rx_ring_size, + VMXNET3_RX_RING_MAX_SIZE / sz * sz); + VMXNET3_ASSERT(new_rx_ring_size <= VMXNET3_RX_RING_MAX_SIZE); + VMXNET3_ASSERT(new_rx_ring_size % sz == 0); + + if (new_tx_ring_size == adapter->tx_queue.tx_ring.size && + new_rx_ring_size == adapter->rx_queue.rx_ring[0].size) { + return 0; + } + + /* + * Reset_work may be in the middle of resetting the device, wait for its + * completion. + */ + while (test_and_set_bit(VMXNET3_STATE_BIT_RESETTING, &adapter->state)) { + compat_msleep(1); + } + + if (compat_netif_running(netdev)) { + vmxnet3_quiesce_dev(adapter); + vmxnet3_reset_dev(adapter); + + /* recreate the rx queue and the tx queue based on the new sizes */ + vmxnet3_tq_destroy(&adapter->tx_queue, adapter); + vmxnet3_rq_destroy(&adapter->rx_queue, adapter); + + err = vmxnet3_create_queues(adapter, new_tx_ring_size, new_rx_ring_size, + VMXNET3_DEF_RX_RING_SIZE); + if (err) { + /* failed, most likely because of OOM, try the default size */ + printk(KERN_ERR "%s: failed to apply new sizes, try the default ones\n", + netdev->name); + err = vmxnet3_create_queues(adapter, VMXNET3_DEF_TX_RING_SIZE, + VMXNET3_DEF_RX_RING_SIZE, VMXNET3_DEF_RX_RING_SIZE); + if (err) { + printk(KERN_ERR "%s: failed to create queues with default sizes. Closing it\n", + netdev->name); + goto out; + } + } + + err = vmxnet3_activate_dev(adapter); + if (err) { + printk(KERN_ERR "%s: failed to re-activate, error %d. Closing it\n", + netdev->name, err); + goto out; + } + } + +out: + clear_bit(VMXNET3_STATE_BIT_RESETTING, &adapter->state); + if (err) { + vmxnet3_force_close(adapter); + } + return err; +} + + +static struct ethtool_ops +vmxnet3_ethtool_ops = { + .get_settings = vmxnet3_get_settings, + .get_drvinfo = vmxnet3_get_drvinfo, + .get_regs_len = vmxnet3_get_regs_len, + .get_regs = vmxnet3_get_regs, + .get_wol = vmxnet3_get_wol, + .set_wol = vmxnet3_set_wol, + .get_link = ethtool_op_get_link, + .get_rx_csum = vmxnet3_get_rx_csum, + .set_rx_csum = vmxnet3_set_rx_csum, + .get_tx_csum = vmxnet3_get_tx_csum, + .set_tx_csum = vmxnet3_set_tx_csum, + .get_sg = ethtool_op_get_sg, + .set_sg = ethtool_op_set_sg, + .get_tso = ethtool_op_get_tso, + .set_tso = ethtool_op_set_tso, + .get_strings = vmxnet3_get_strings, + .get_stats_count = vmxnet3_get_stats_count, + .get_ethtool_stats = vmxnet3_get_ethtool_stats, + .get_ringparam = vmxnet3_get_ringparam, + .set_ringparam = vmxnet3_set_ringparam, +}; + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_alloc_intr_resources -- + * + * read the intr configuration, pick the intr type, and enable MSI/MSI-X if + * needed. + * + * Results: + * None + * + * Side effects: + * adapter->intr.{type, mask_mode, num_intr} are modified + * + *---------------------------------------------------------------------------- + */ + +static void +vmxnet3_alloc_intr_resources(struct vmxnet3_adapter *adapter) +{ + uint32 cfg; + + /* intr settings */ + VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD, VMXNET3_CMD_GET_CONF_INTR); + cfg = VMXNET3_READ_BAR1_REG(adapter, VMXNET3_REG_CMD); + adapter->intr.type = cfg & 0x3; + adapter->intr.mask_mode = (cfg >> 2) & 0x3; + +#ifdef CONFIG_PCI_MSI + if (adapter->intr.type == VMXNET3_IT_AUTO) { +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19) + /* start with MSI-X */ + adapter->intr.type = VMXNET3_IT_MSIX; +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 13) + adapter->intr.type = VMXNET3_IT_MSI; +#else + adapter->intr.type = VMXNET3_IT_INTX; +#endif + } + + if (adapter->intr.type == VMXNET3_IT_MSIX) { + int err; + + adapter->intr.msix_entries[0].entry = 0; + err = pci_enable_msix(adapter->pdev, adapter->intr.msix_entries, + VMXNET3_LINUX_MAX_MSIX_VECT); + if (!err) { + adapter->intr.num_intrs = 1; + return; + } + + printk(KERN_INFO "Failed to enable MSI-X for %s, error %d, try MSI\n", + adapter->netdev->name, err); + adapter->intr.type = VMXNET3_IT_MSI; + } + + if (adapter->intr.type == VMXNET3_IT_MSI) { + int err; + + err = pci_enable_msi(adapter->pdev); + if (!err) { + adapter->intr.num_intrs = 1; + return; + } + + printk(KERN_INFO "Failed to enable MSI for %s, error %d, use INTx\n", + adapter->netdev->name, err); + adapter->intr.type = VMXNET3_IT_INTX; + } +#else + adapter->intr.type = VMXNET3_IT_INTX; +#endif + + /* INT-X related setting */ + adapter->intr.num_intrs = 1; +} + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_free_intr_resources -- + * + * disable MSI/MSI-X if previously enabled + * + * Results: + * None + * + * Side effects: + * None + * + *---------------------------------------------------------------------------- + */ + +static void +vmxnet3_free_intr_resources(struct vmxnet3_adapter *adapter) +{ +#ifdef CONFIG_PCI_MSI + if (adapter->intr.type == VMXNET3_IT_MSIX) { + pci_disable_msix(adapter->pdev); + } else if (adapter->intr.type == VMXNET3_IT_MSI) { + pci_disable_msi(adapter->pdev); + } else +#endif + { + VMXNET3_ASSERT(adapter->intr.type == VMXNET3_IT_INTX); + } +} + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_tx_timeout -- + * + * Called when the stack detects a Tx hang. + * + * Results: + * None + * + * Side effects: + * schedule a job to reset the device + * + *---------------------------------------------------------------------------- + */ + +static void +vmxnet3_tx_timeout(struct net_device *netdev) +{ + struct vmxnet3_adapter *adapter = compat_netdev_priv(netdev); + adapter->tx_timeout_count++; + + printk(KERN_ERR "%s: tx hang\n", adapter->netdev->name); + compat_schedule_work(&adapter->work); +} + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_reset_work -- + * + * Reset the device + * + * Results: + * None + * + * Side effects: + * None + * + *---------------------------------------------------------------------------- + */ + +static void +vmxnet3_reset_work(compat_work_arg data) +{ + struct vmxnet3_adapter *adapter; + + adapter = COMPAT_WORK_GET_DATA(data, struct vmxnet3_adapter); + + /* if another thread is resetting the device, no need to proceed */ + if (test_and_set_bit(VMXNET3_STATE_BIT_RESETTING, &adapter->state)) { + printk(KERN_INFO "%s: resetting already in progress\n", adapter->netdev->name); + return; + } + + /* if the device is closed, we must leave it alone */ + if (netif_running(adapter->netdev)) { + printk(KERN_INFO "%s: resetting\n", adapter->netdev->name); + + vmxnet3_quiesce_dev(adapter); + vmxnet3_reset_dev(adapter); + vmxnet3_activate_dev(adapter); + } else { + printk(KERN_INFO "%s: already closed\n", adapter->netdev->name); + } + + clear_bit(VMXNET3_STATE_BIT_RESETTING, &adapter->state); +} + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_probe_device -- + * + * initialize a vmxnet3 device + * + * Result: + * 0 on success, negative errno code otherwise + * + * Side-effects: + * Initialize the h/w and allocate necessary resources + * + *---------------------------------------------------------------------------- + */ + +static int +vmxnet3_probe_device(struct pci_dev *pdev, + const struct pci_device_id *id) +{ + int err; + Bool dma64 = FALSE; /* stupid gcc */ + uint32 ver; + struct net_device *netdev; + struct vmxnet3_adapter *adapter; + uint8 mac[ETH_ALEN]; + + netdev = compat_alloc_etherdev(sizeof(struct vmxnet3_adapter)); + if (!netdev) { + printk(KERN_ERR "Failed to alloc ethernet device for adapter %s\n", + compat_pci_name(pdev)); + return -ENOMEM; + } + + pci_set_drvdata(pdev, netdev); + adapter = compat_netdev_priv(netdev); + adapter->netdev = netdev; + adapter->pdev = pdev; + + adapter->shared = pci_alloc_consistent(adapter->pdev, + sizeof(Vmxnet3_DriverShared), + &adapter->shared_pa); + if (!adapter->shared) { + printk(KERN_ERR "Failed to allocate memory for %s\n", compat_pci_name(pdev)); + err = -ENOMEM; + goto err_alloc_shared; + } + + adapter->tqd_start = pci_alloc_consistent(adapter->pdev, + sizeof(Vmxnet3_TxQueueDesc) + sizeof(Vmxnet3_RxQueueDesc), + &adapter->queue_desc_pa); + if (!adapter->tqd_start) { + printk(KERN_ERR "Failed to allocate memory for %s\n", compat_pci_name(pdev)); + err = -ENOMEM; + goto err_alloc_queue_desc; + } + adapter->rqd_start = (Vmxnet3_RxQueueDesc *)(adapter->tqd_start + 1); + + adapter->pm_conf = kmalloc(sizeof(Vmxnet3_PMConf), GFP_KERNEL); + if (adapter->pm_conf == NULL) { + printk(KERN_ERR "Failed to allocate memory for %s\n", compat_pci_name(pdev)); + err = -ENOMEM; + goto err_alloc_pm; + } + + err = vmxnet3_alloc_pci_resources(adapter, &dma64); + if (err < 0) { + goto err_alloc_pci; + } + + ver = VMXNET3_READ_BAR1_REG(adapter, VMXNET3_REG_VRRS); + if (ver & 1) { + VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_VRRS, 1); + } else { + printk(KERN_ERR "Incompatible h/w version (0x%x) for adapter %s\n", + ver, compat_pci_name(pdev)); + err = -EBUSY; + goto err_ver; + } + + ver = VMXNET3_READ_BAR1_REG(adapter, VMXNET3_REG_UVRS); + if (ver & 1) { + VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_UVRS, 1); + } else { + printk(KERN_ERR "Incompatible upt version (0x%x) for adapter %s\n", + ver, compat_pci_name(pdev)); + err = -EBUSY; + goto err_ver; + } + + vmxnet3_declare_features(adapter, dma64); + + vmxnet3_alloc_intr_resources(adapter); + + vmxnet3_read_mac_addr(adapter, mac); + memcpy(netdev->dev_addr, mac, netdev->addr_len); + + netdev->open = vmxnet3_open; + netdev->stop = vmxnet3_close; + netdev->hard_start_xmit = vmxnet3_xmit_frame; + netdev->set_mac_address = vmxnet3_set_mac_addr; + netdev->change_mtu = vmxnet3_change_mtu; + netdev->get_stats = vmxnet3_get_stats; + SET_ETHTOOL_OPS(netdev, &vmxnet3_ethtool_ops); + netdev->tx_timeout = vmxnet3_tx_timeout; + netdev->watchdog_timeo = 5 * HZ; + + COMPAT_INIT_WORK(&adapter->work, vmxnet3_reset_work, adapter); + +#ifdef VMXNET3_NAPI + compat_netif_napi_add(netdev, &adapter->napi, vmxnet3_poll, 64); +#endif + + netdev->set_multicast_list = vmxnet3_set_mc; + netdev->vlan_rx_register = vmxnet3_vlan_rx_register; + netdev->vlan_rx_add_vid = vmxnet3_vlan_rx_add_vid; + netdev->vlan_rx_kill_vid = vmxnet3_vlan_rx_kill_vid; + + COMPAT_SET_MODULE_OWNER(netdev); + COMPAT_SET_NETDEV_DEV(netdev, &pdev->dev); + + err = register_netdev(netdev); + if (err) { + printk(KERN_ERR "Failed to register adapter %s\n", compat_pci_name(pdev)); + goto err_register; + } + + set_bit(VMXNET3_STATE_BIT_QUIESCED, &adapter->state); + return 0; + +err_register: + vmxnet3_free_intr_resources(adapter); +err_ver: + vmxnet3_free_pci_resources(adapter); +err_alloc_pci: + kfree(adapter->pm_conf); +err_alloc_pm: + pci_free_consistent(adapter->pdev, + sizeof(Vmxnet3_TxQueueDesc) + sizeof(Vmxnet3_RxQueueDesc), + adapter->tqd_start, adapter->queue_desc_pa); +err_alloc_queue_desc: + pci_free_consistent(adapter->pdev, sizeof(Vmxnet3_DriverShared), + adapter->shared, adapter->shared_pa); +err_alloc_shared: + pci_set_drvdata(pdev, NULL); + compat_free_netdev(netdev); + return err; +} + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_remove_device -- + * + * Called by the PCI subsystem to release a device + * + * Result: + * None + * + * Side-effects: + * unregister the adapter with the kernel and free resources + * + *---------------------------------------------------------------------------- + */ + +static void +vmxnet3_remove_device(struct pci_dev *pdev) +{ + struct net_device *netdev = pci_get_drvdata(pdev); + struct vmxnet3_adapter *adapter = compat_netdev_priv(netdev); + + flush_scheduled_work(); + + unregister_netdev(netdev); + + vmxnet3_free_intr_resources(adapter); + vmxnet3_free_pci_resources(adapter); + kfree(adapter->pm_conf); + pci_free_consistent(adapter->pdev, + sizeof(Vmxnet3_TxQueueDesc) + sizeof(Vmxnet3_RxQueueDesc), + adapter->tqd_start, adapter->queue_desc_pa); + pci_free_consistent(adapter->pdev, sizeof(Vmxnet3_DriverShared), + adapter->shared, adapter->shared_pa); + compat_free_netdev(netdev); +} + + +#ifdef CONFIG_PM + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_suspend -- + * + * Called by the PCI subsystem to save device state before suspending + * system. + * + * Results: + * 0 on success, errno on failure. + * + * Side effects: + * May programs the wake-up filters if configured to do so. + * + *---------------------------------------------------------------------------- + */ + +static int +vmxnet3_suspend(struct pci_dev *pdev, pm_message_t state) +{ + struct net_device *netdev = pci_get_drvdata(pdev); + struct vmxnet3_adapter *adapter = compat_netdev_priv(netdev); + Vmxnet3_PMConf *pmConf; + struct ethhdr *ehdr; + struct arphdr *ahdr; + uint8 *arpreq; + struct in_device *in_dev; + struct in_ifaddr *ifa; + int i = 0; + + if (!compat_netif_running(netdev)) { + return 0; + } + + netif_device_detach(netdev); + netif_stop_queue(netdev); + + /* Create wake-up filters. */ + pmConf = adapter->pm_conf; + memset(pmConf, 0, sizeof (*pmConf)); + + if (adapter->wol & WAKE_UCAST) { + pmConf->filters[i].patternSize = ETH_ALEN; + pmConf->filters[i].maskSize = 1; + memcpy(pmConf->filters[i].pattern, netdev->dev_addr, ETH_ALEN); + pmConf->filters[i].mask[0] = 0x3F; // LSB ETH_ALEN bits + + pmConf->wakeUpEvents |= VMXNET3_PM_WAKEUP_FILTER; + i++; + } + + if (adapter->wol & WAKE_ARP) { + in_dev = in_dev_get(netdev); + if (!in_dev) { + VMXNET3_LOG("Cannot program WoL ARP filter for %s: IPv4 not enabled.\n", + netdev->name); + goto skip_arp; + } + ifa = (struct in_ifaddr *)in_dev->ifa_list; + if (!ifa) { + VMXNET3_LOG("Cannot program WoL ARP filter for %s: no IPv4 address.\n", + netdev->name); + in_dev_put(in_dev); + goto skip_arp; + } + pmConf->filters[i].patternSize = ETH_HLEN + // Ethernet header + sizeof(struct arphdr) + // ARP header + 2 * ETH_ALEN + // 2 Ethernet addresses + 2 * sizeof (uint32); // 2 IPv4 addresses + pmConf->filters[i].maskSize = + (pmConf->filters[i].patternSize - 1) / 8 + 1; + /* ETH_P_ARP in Ethernet header. */ + ehdr = (struct ethhdr *)pmConf->filters[i].pattern; + ehdr->h_proto = htons(ETH_P_ARP); + /* ARPOP_REQUEST in ARP header. */ + ahdr = (struct arphdr *)&pmConf->filters[i].pattern[ETH_HLEN]; + ahdr->ar_op = htons(ARPOP_REQUEST); + arpreq = (uint8 *)(ahdr + 1); + /* The Unicast IPv4 address in 'tip' field. */ + arpreq += 2 * ETH_ALEN + sizeof(uint32); + *(uint32 *)arpreq = ifa->ifa_address; + /* The mask for the relevant bits. */ + pmConf->filters[i].mask[0] = 0x00; + pmConf->filters[i].mask[1] = 0x30; // ETH_P_ARP + pmConf->filters[i].mask[2] = 0x30; // ARPOP_REQUEST + pmConf->filters[i].mask[3] = 0x00; + pmConf->filters[i].mask[4] = 0xC0; // IPv4 TIP + pmConf->filters[i].mask[5] = 0x03; // IPv4 TIP + in_dev_put(in_dev); + + pmConf->wakeUpEvents |= VMXNET3_PM_WAKEUP_FILTER; + i++; + } + +skip_arp: + if (adapter->wol & WAKE_MAGIC) { + pmConf->wakeUpEvents |= VMXNET3_PM_WAKEUP_MAGIC; + } + + pmConf->numFilters = i; + + adapter->shared->devRead.pmConfDesc.confVer = 1; + adapter->shared->devRead.pmConfDesc.confLen = sizeof(*pmConf); + adapter->shared->devRead.pmConfDesc.confPA = virt_to_phys(pmConf); + + VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD, VMXNET3_CMD_UPDATE_PMCFG); + + compat_pci_save_state(pdev); + pci_enable_wake(pdev, compat_pci_choose_state(pdev, state), adapter->wol); + compat_pci_disable_device(pdev); + pci_set_power_state(pdev, compat_pci_choose_state(pdev, state)); + + return 0; +} + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_resume -- + * + * Called by the PCI subsystem to restore device state when resuming the + * system. + * + * Results: + * 0 on success, errno on failure. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +static int +vmxnet3_resume(struct pci_dev *pdev) +{ + int err; + struct net_device *netdev = pci_get_drvdata(pdev); + struct vmxnet3_adapter *adapter = compat_netdev_priv(netdev); + Vmxnet3_PMConf *pmConf; + + if (!compat_netif_running(netdev)) { + return 0; + } + + /* Destroy wake-up filters. */ + pmConf = adapter->pm_conf; + memset(pmConf, 0, sizeof (*pmConf)); + + adapter->shared->devRead.pmConfDesc.confVer = 1; + adapter->shared->devRead.pmConfDesc.confLen = sizeof(*pmConf); + adapter->shared->devRead.pmConfDesc.confPA = virt_to_phys(pmConf); + + netif_device_attach(netdev); + pci_set_power_state(pdev, PCI_D0); + compat_pci_restore_state(pdev); + err = compat_pci_enable_device(pdev); + if (err != 0) { + return err; + } + + pci_enable_wake(pdev, PCI_D0, 0); + + VMXNET3_WRITE_BAR1_REG(adapter, VMXNET3_REG_CMD, VMXNET3_CMD_UPDATE_PMCFG); + + return 0; +} + +#endif + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_init_module -- + * + * Called when the driver is loaded + * + * Result: + * 0 on success, negative errno value on error + * + * Side-effects: + * register ourselves with the pci system, and claim devices + * + *---------------------------------------------------------------------------- + */ + +static int __init +vmxnet3_init_module(void) +{ + printk(KERN_INFO "%s - version %s\n", VMXNET3_DRIVER_DESC, VMXNET3_DRIVER_VERSION_REPORT); + return pci_register_driver(&vmxnet3_driver); +} + + +/* + *---------------------------------------------------------------------------- + * + * vmxnet3_exit_module -- + * + * Called when the driver is to be unloaded + * + * Result: + * None + * + * Side-effects: + * unregister ourselves with the pci system + * + *---------------------------------------------------------------------------- + */ + +static void +vmxnet3_exit_module(void) +{ + pci_unregister_driver(&vmxnet3_driver); +} + + +module_init(vmxnet3_init_module); +module_exit(vmxnet3_exit_module); +MODULE_DEVICE_TABLE(pci, vmxnet3_pciid_table); + +MODULE_AUTHOR("VMware, Inc."); +MODULE_DESCRIPTION(VMXNET3_DRIVER_DESC); +MODULE_LICENSE("GPL v2"); +MODULE_VERSION(VMXNET3_DRIVER_VERSION_STRING); + + diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/vmxnet3_defs.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/vmxnet3_defs.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/vmxnet3_defs.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/vmxnet3_defs.h 2008-10-13 08:01:46.000000000 +0100 @@ -0,0 +1,591 @@ +/********************************************************* + * Copyright (C) 2007 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * vmxnet3_defs.h -- + * + * Definitions shared by device emulation and guest drivers for + * VMXNET3 NIC + */ + +#ifndef _VMXNET3_DEFS_H_ +#define _VMXNET3_DEFS_H_ + +#define INCLUDE_ALLOW_USERLEVEL +#define INCLUDE_ALLOW_VMKERNEL +#define INCLUDE_ALLOW_VMMEXT +#define INCLUDE_ALLOW_VMCORE +#define INCLUDE_ALLOW_MODULE +#include "includeCheck.h" + +#include "upt1_defs.h" + +/* all registers are 32 bit wide */ +/* BAR 1 */ +#define VMXNET3_REG_VRRS 0x0 /* Vmxnet3 Revision Report Selection */ +#define VMXNET3_REG_UVRS 0x8 /* UPT Version Report Selection */ +#define VMXNET3_REG_DSAL 0x10 /* Driver Shared Address Low */ +#define VMXNET3_REG_DSAH 0x18 /* Driver Shared Address High */ +#define VMXNET3_REG_CMD 0x20 /* Command */ +#define VMXNET3_REG_MACL 0x28 /* MAC Address Low */ +#define VMXNET3_REG_MACH 0x30 /* MAC Address High */ +#define VMXNET3_REG_ICR 0x38 /* Interrupt Cause Register */ +#define VMXNET3_REG_ECR 0x40 /* Event Cause Register */ + +/* BAR 0 */ +#define VMXNET3_REG_IMR 0x0 /* Interrupt Mask Register */ +#define VMXNET3_REG_TXPROD 0x600 /* Tx Producer Index */ +#define VMXNET3_REG_RXPROD 0x800 /* Rx Producer Index for ring 1 */ +#define VMXNET3_REG_RXPROD2 0xA00 /* Rx Producer Index for ring 2 */ + +#define VMXNET3_PT_REG_SIZE 4096 /* BAR 0 */ +#define VMXNET3_VD_REG_SIZE 4096 /* BAR 1 */ + +#define VMXNET3_REG_ALIGN 8 /* All registers are 8-byte aligned. */ +#define VMXNET3_REG_ALIGN_MASK 0x7 + +/* I/O Mapped access to registers */ +#define VMXNET3_IO_TYPE_PT 0 +#define VMXNET3_IO_TYPE_VD 1 +#define VMXNET3_IO_ADDR(type, reg) (((type) << 24) | ((reg) & 0xFFFFFF)) +#define VMXNET3_IO_TYPE(addr) ((addr) >> 24) +#define VMXNET3_IO_REG(addr) ((addr) & 0xFFFFFF) + +typedef enum { + VMXNET3_CMD_FIRST_SET = 0xCAFE0000, + VMXNET3_CMD_ACTIVATE_DEV = VMXNET3_CMD_FIRST_SET, + VMXNET3_CMD_QUIESCE_DEV, + VMXNET3_CMD_RESET_DEV, + VMXNET3_CMD_UPDATE_RX_MODE, + VMXNET3_CMD_UPDATE_MAC_FILTERS, + VMXNET3_CMD_UPDATE_VLAN_FILTERS, + VMXNET3_CMD_UPDATE_RSSIDT, + VMXNET3_CMD_UPDATE_IML, + VMXNET3_CMD_UPDATE_PMCFG, + VMXNET3_CMD_UPDATE_FEATURE, + + VMXNET3_CMD_FIRST_GET = 0xF00D0000, + VMXNET3_CMD_GET_QUEUE_STATUS = VMXNET3_CMD_FIRST_GET, + VMXNET3_CMD_GET_STATS, + VMXNET3_CMD_GET_LINK, + VMXNET3_CMD_GET_PERM_MAC_LO, + VMXNET3_CMD_GET_PERM_MAC_HI, + VMXNET3_CMD_GET_DID_LO, + VMXNET3_CMD_GET_DID_HI, + VMXNET3_CMD_GET_DEV_EXTRA_INFO, + VMXNET3_CMD_GET_CONF_INTR +} Vmxnet3_Cmd; + +typedef +#include "vmware_pack_begin.h" +struct Vmxnet3_TxDesc { + uint64 addr; + + uint32 len:14; + uint32 gen:1; /* generation bit */ + uint32 rsvd:1; + uint32 dtype:1; /* descriptor type */ + uint32 ext1:1; + uint32 msscof:14; /* MSS, checksum offset, flags */ + + uint32 hlen:10; /* header len */ + uint32 om:2; /* offload mode */ + uint32 eop:1; /* End Of Packet */ + uint32 cq:1; /* completion request */ + uint32 ext2:1; + uint32 ti:1; /* VLAN Tag Insertion */ + uint32 tci:16; /* Tag to Insert */ +} +#include "vmware_pack_end.h" +Vmxnet3_TxDesc; + +/* TxDesc.OM values */ +#define VMXNET3_OM_NONE 0 +#define VMXNET3_OM_CSUM 2 +#define VMXNET3_OM_TSO 3 + +/* fields in TxDesc we access w/o using bit fields */ +#define VMXNET3_TXD_EOP_SHIFT 12 +#define VMXNET3_TXD_CQ_SHIFT 13 +#define VMXNET3_TXD_GEN_SHIFT 14 + +#define VMXNET3_TXD_CQ (1 << VMXNET3_TXD_CQ_SHIFT) +#define VMXNET3_TXD_EOP (1 << VMXNET3_TXD_EOP_SHIFT) +#define VMXNET3_TXD_GEN (1 << VMXNET3_TXD_GEN_SHIFT) + +#define VMXNET3_HDR_COPY_SIZE 128 + +typedef +#include "vmware_pack_begin.h" +struct vmxnet3_TxDataDesc { + uint8 data[VMXNET3_HDR_COPY_SIZE]; +} +#include "vmware_pack_end.h" +Vmxnet3_TxDataDesc; + +typedef +#include "vmware_pack_begin.h" +struct Vmxnet3_TxCompDesc { + uint32 txdIdx:12; /* Index of the EOP TxDesc */ + uint32 ext1:20; + + uint32 ext2; + uint32 ext3; + + uint32 rsvd:24; + uint32 type:7; /* completion type */ + uint32 gen:1; /* generation bit */ +} +#include "vmware_pack_end.h" +Vmxnet3_TxCompDesc; + +typedef +#include "vmware_pack_begin.h" +struct Vmxnet3_RxDesc { + uint64 addr; + + uint32 len:14; + uint32 btype:1; /* Buffer Type */ + uint32 dtype:1; /* Descriptor type */ + uint32 rsvd:15; + uint32 gen:1; /* Generation bit */ + + uint32 ext1; +} +#include "vmware_pack_end.h" +Vmxnet3_RxDesc; + +/* values of RXD.BTYPE */ +#define VMXNET3_RXD_BTYPE_HEAD 0 /* head only */ +#define VMXNET3_RXD_BTYPE_BODY 1 /* body only */ + +/* fields in RxDesc we access w/o using bit fields */ +#define VMXNET3_RXD_BTYPE_SHIFT 14 +#define VMXNET3_RXD_GEN_SHIFT 31 + +typedef +#include "vmware_pack_begin.h" +struct Vmxnet3_RxCompDesc { + uint32 rxdIdx:12; /* Index of the RxDesc */ + uint32 ext1:2; + uint32 eop:1; /* End of Packet */ + uint32 sop:1; /* Start of Packet */ + uint32 rqID:10; /* rx queue/ring ID */ + uint32 rssType:4; /* RSS hash type used */ + uint32 cnc:1; /* Checksum Not Calculated */ + uint32 ext2:1; + + uint32 rssHash; /* RSS hash value */ + + uint32 len:14; /* data length */ + uint32 err:1; /* Error */ + uint32 ts:1; /* Tag is stripped */ + uint32 tci:16; /* Tag stripped */ + + uint32 csum:16; + uint32 tuc:1; /* TCP/UDP Checksum Correct */ + uint32 udp:1; /* UDP packet */ + uint32 tcp:1; /* TCP packet */ + uint32 ipc:1; /* IP Checksum Correct */ + uint32 v6:1; /* IPv6 */ + uint32 v4:1; /* IPv4 */ + uint32 frg:1; /* IP Fragment */ + uint32 fcs:1; /* Frame CRC correct */ + uint32 type:7; /* completion type */ + uint32 gen:1; /* generation bit */ +} +#include "vmware_pack_end.h" +Vmxnet3_RxCompDesc; + +/* fields in RxCompDesc we access via Vmxnet3_GenericDesc.dword[3] */ +#define VMXNET3_RCD_TUC_SHIFT 16 +#define VMXNET3_RCD_IPC_SHIFT 19 + +/* fields in RxCompDesc we access via Vmxnet3_GenericDesc.qword[1] */ +#define VMXNET3_RCD_TYPE_SHIFT 56 +#define VMXNET3_RCD_GEN_SHIFT 63 + +/* csum OK for TCP/UDP pkts over IP */ +#define VMXNET3_RCD_CSUM_OK (1 << VMXNET3_RCD_TUC_SHIFT | 1 << VMXNET3_RCD_IPC_SHIFT) + +/* value of RxCompDesc.rssType */ +#define VMXNET3_RCD_RSS_TYPE_NONE 0 +#define VMXNET3_RCD_RSS_TYPE_IPV4 1 +#define VMXNET3_RCD_RSS_TYPE_TCPIPV4 2 +#define VMXNET3_RCD_RSS_TYPE_IPV6 3 +#define VMXNET3_RCD_RSS_TYPE_TCPIPV6 4 + +/* a union for accessing all cmd/completion descriptors */ +typedef union Vmxnet3_GenericDesc { + uint64 qword[2]; + uint32 dword[4]; + uint16 word[8]; + Vmxnet3_TxDesc txd; + Vmxnet3_RxDesc rxd; + Vmxnet3_TxCompDesc tcd; + Vmxnet3_RxCompDesc rcd; +} Vmxnet3_GenericDesc; + +#define VMXNET3_INIT_GEN 1 + +/* Max size of a single tx buffer */ +#define VMXNET3_MAX_TX_BUF_SIZE (1 << 14) + +/* # of tx desc needed for a tx buffer size */ +#define VMXNET3_TXD_NEEDED(size) (((size) + VMXNET3_MAX_TX_BUF_SIZE - 1) / VMXNET3_MAX_TX_BUF_SIZE) + +/* max # of tx descs for a non-tso pkt */ +#define VMXNET3_MAX_TXD_PER_PKT 16 + +/* Max size of a single rx buffer */ +#define VMXNET3_MAX_RX_BUF_SIZE ((1 << 14) - 1) +/* Minimum size of a type 0 buffer */ +#define VMXNET3_MIN_T0_BUF_SIZE 128 +#define VMXNET3_MAX_CSUM_OFFSET 1024 + +/* Ring base address alignment */ +#define VMXNET3_RING_BA_ALIGN 512 +#define VMXNET3_RING_BA_MASK (VMXNET3_RING_BA_ALIGN - 1) + +/* Ring size must be a multiple of 32 */ +#define VMXNET3_RING_SIZE_ALIGN 32 +#define VMXNET3_RING_SIZE_MASK (VMXNET3_RING_SIZE_ALIGN - 1) + +/* Max ring size */ +#define VMXNET3_TX_RING_MAX_SIZE 4096 +#define VMXNET3_TC_RING_MAX_SIZE 4096 +#define VMXNET3_RX_RING_MAX_SIZE 4096 +#define VMXNET3_RC_RING_MAX_SIZE 8192 + +/* a list of reasons for queue stop */ + +#define VMXNET3_ERR_NOEOP 0x80000000 /* cannot find the EOP desc of a pkt */ +#define VMXNET3_ERR_TXD_REUSE 0x80000001 /* reuse a TxDesc before tx completion */ +#define VMXNET3_ERR_BIG_PKT 0x80000002 /* too many TxDesc for a pkt */ +#define VMXNET3_ERR_DESC_NOT_SPT 0x80000003 /* descriptor type not supported */ +#define VMXNET3_ERR_SMALL_BUF 0x80000004 /* type 0 buffer too small */ +#define VMXNET3_ERR_STRESS 0x80000005 /* stress option firing in vmkernel */ +#define VMXNET3_ERR_SWITCH 0x80000006 /* mode switch failure */ +#define VMXNET3_ERR_TXD_INVALID 0x80000007 /* invalid TxDesc */ + +/* completion descriptor types */ +#define VMXNET3_CDTYPE_TXCOMP 0 /* Tx Completion Descriptor */ +#define VMXNET3_CDTYPE_RXCOMP 3 /* Rx Completion Descriptor */ + +#define VMXNET3_GOS_BITS_UNK 0 /* unknown */ +#define VMXNET3_GOS_BITS_32 1 +#define VMXNET3_GOS_BITS_64 2 + +#define VMXNET3_GOS_TYPE_UNK 0 /* unknown */ +#define VMXNET3_GOS_TYPE_LINUX 1 +#define VMXNET3_GOS_TYPE_WIN 2 +#define VMXNET3_GOS_TYPE_SOLARIS 3 +#define VMXNET3_GOS_TYPE_FREEBSD 4 +#define VMXNET3_GOS_TYPE_PXE 5 + +/* All structures in DriverShared are padded to multiples of 8 bytes */ + +typedef +#include "vmware_pack_begin.h" +struct Vmxnet3_GOSInfo { + uint32 gosBits: 2; /* 32-bit or 64-bit? */ + uint32 gosType: 4; /* which guest */ + uint32 gosVer: 16; /* gos version */ + uint32 gosMisc: 10; /* other info about gos */ +} +#include "vmware_pack_end.h" +Vmxnet3_GOSInfo; + +typedef +#include "vmware_pack_begin.h" +struct Vmxnet3_DriverInfo { + uint32 version; /* driver version */ + Vmxnet3_GOSInfo gos; + uint32 vmxnet3RevSpt; /* vmxnet3 revision supported */ + uint32 uptVerSpt; /* upt version supported */ +} +#include "vmware_pack_end.h" +Vmxnet3_DriverInfo; + +#define VMXNET3_REV1_MAGIC 0xbabefee1 + +/* + * QueueDescPA must be 128 bytes aligned. It points to an array of + * Vmxnet3_TxQueueDesc followed by an array of Vmxnet3_RxQueueDesc. + * The number of Vmxnet3_TxQueueDesc/Vmxnet3_RxQueueDesc are specified by + * Vmxnet3_MiscConf.numTxQueues/numRxQueues, respectively. + */ +#define VMXNET3_QUEUE_DESC_ALIGN 128 + +typedef +#include "vmware_pack_begin.h" +struct Vmxnet3_MiscConf { + Vmxnet3_DriverInfo driverInfo; + uint64 uptFeatures; + uint64 ddPA; /* driver data PA */ + uint64 queueDescPA; /* queue descriptor table PA */ + uint32 ddLen; /* driver data len */ + uint32 queueDescLen; /* queue descriptor table len, in bytes */ + uint32 mtu; + uint16 maxNumRxSG; + uint8 numTxQueues; + uint8 numRxQueues; + uint32 reserved[4]; +} +#include "vmware_pack_end.h" +Vmxnet3_MiscConf; + +typedef +#include "vmware_pack_begin.h" +struct vmxnet3_TxQueueConf { + uint64 txRingBasePA; + uint64 dataRingBasePA; + uint64 compRingBasePA; + uint64 ddPA; /* driver data */ + uint64 reserved; + uint32 txRingSize; /* # of tx desc */ + uint32 dataRingSize; /* # of data desc */ + uint32 compRingSize; /* # of comp desc */ + uint32 ddLen; /* size of driver data */ + uint8 intrIdx; + uint8 _pad[7]; +} +#include "vmware_pack_end.h" +Vmxnet3_TxQueueConf; + +typedef +#include "vmware_pack_begin.h" +struct Vmxnet3_RxQueueConf { + uint64 rxRingBasePA[2]; + uint64 compRingBasePA; + uint64 ddPA; /* driver data */ + uint64 reserved; + uint32 rxRingSize[2]; /* # of rx desc */ + uint32 compRingSize; /* # of rx comp desc */ + uint32 ddLen; /* size of driver data */ + uint8 intrIdx; + uint8 _pad[7]; +} +#include "vmware_pack_end.h" +Vmxnet3_RxQueueConf; + +enum vmxnet3_intr_mask_mode { + VMXNET3_IMM_AUTO = 0, + VMXNET3_IMM_ACTIVE = 1, + VMXNET3_IMM_LAZY = 2 +}; + +enum vmxnet3_intr_type { + VMXNET3_IT_AUTO = 0, + VMXNET3_IT_INTX = 1, + VMXNET3_IT_MSI = 2, + VMXNET3_IT_MSIX = 3 +}; + +#define VMXNET3_MAX_TX_QUEUES 8 +#define VMXNET3_MAX_RX_QUEUES 16 +/* addition 1 for events */ +#define VMXNET3_MAX_INTRS 25 + +typedef +#include "vmware_pack_begin.h" +struct Vmxnet3_IntrConf { + Bool autoMask; + uint8 numIntrs; /* # of interrupts */ + uint8 eventIntrIdx; + uint8 modLevels[VMXNET3_MAX_INTRS]; /* moderation level for each intr */ + uint32 reserved[3]; +} +#include "vmware_pack_end.h" +Vmxnet3_IntrConf; + +/* one bit per VLAN ID, the size is in the units of uint32 */ +#define VMXNET3_VFT_SIZE (4096 / (sizeof(uint32) * 8)) + +typedef +#include "vmware_pack_begin.h" +struct Vmxnet3_QueueStatus { + Bool stopped; + uint8 _pad[3]; + uint32 error; +} +#include "vmware_pack_end.h" +Vmxnet3_QueueStatus; + +typedef +#include "vmware_pack_begin.h" +struct Vmxnet3_TxQueueCtrl { + uint32 txNumDeferred; + uint32 txThreshold; + uint64 reserved; +} +#include "vmware_pack_end.h" +Vmxnet3_TxQueueCtrl; + +typedef +#include "vmware_pack_begin.h" +struct Vmxnet3_RxQueueCtrl { + Bool updateRxProd; + uint8 _pad[7]; + uint64 reserved; +} +#include "vmware_pack_end.h" +Vmxnet3_RxQueueCtrl; + +#define VMXNET3_RXM_UCAST 0x01 /* unicast only */ +#define VMXNET3_RXM_MCAST 0x02 /* multicast passing the filters */ +#define VMXNET3_RXM_BCAST 0x04 /* broadcast only */ +#define VMXNET3_RXM_ALL_MULTI 0x08 /* all multicast */ +#define VMXNET3_RXM_PROMISC 0x10 /* promiscuous */ + +typedef +#include "vmware_pack_begin.h" +struct Vmxnet3_RxFilterConf { + uint32 rxMode; /* VMXNET3_RXM_xxx */ + uint16 mfTableLen; /* size of the multicast filter table */ + uint16 _pad1; + uint64 mfTablePA; /* PA of the multicast filters table */ + uint32 vfTable[VMXNET3_VFT_SIZE]; /* vlan filter */ +} +#include "vmware_pack_end.h" +Vmxnet3_RxFilterConf; + +#define VMXNET3_PM_MAX_FILTERS 6 +#define VMXNET3_PM_MAX_PATTERN_SIZE 128 +#define VMXNET3_PM_MAX_MASK_SIZE (VMXNET3_PM_MAX_PATTERN_SIZE / 8) + +#define VMXNET3_PM_WAKEUP_MAGIC 0x01 /* wake up on magic pkts */ +#define VMXNET3_PM_WAKEUP_FILTER 0x02 /* wake up on pkts matching filters */ + +typedef +#include "vmware_pack_begin.h" +struct Vmxnet3_PM_PktFilter { + uint8 maskSize; + uint8 patternSize; + uint8 mask[VMXNET3_PM_MAX_MASK_SIZE]; + uint8 pattern[VMXNET3_PM_MAX_PATTERN_SIZE]; + uint8 pad[6]; +} +#include "vmware_pack_end.h" +Vmxnet3_PM_PktFilter; + +typedef +#include "vmware_pack_begin.h" +struct Vmxnet3_PMConf { + uint16 wakeUpEvents; /* VMXNET3_PM_WAKEUP_xxx */ + uint8 numFilters; + uint8 pad[5]; + Vmxnet3_PM_PktFilter filters[VMXNET3_PM_MAX_FILTERS]; +} +#include "vmware_pack_end.h" +Vmxnet3_PMConf; + +typedef +#include "vmware_pack_begin.h" +struct Vmxnet3_VariableLenConfDesc { + uint32 confVer; + uint32 confLen; + uint64 confPA; +} +#include "vmware_pack_end.h" +Vmxnet3_VariableLenConfDesc; + +typedef +#include "vmware_pack_begin.h" +struct Vmxnet3_DSDevRead { + /* read-only region for device, read by dev in response to a SET cmd */ + Vmxnet3_MiscConf misc; + Vmxnet3_IntrConf intrConf; + Vmxnet3_RxFilterConf rxFilterConf; + Vmxnet3_VariableLenConfDesc rssConfDesc; + Vmxnet3_VariableLenConfDesc pmConfDesc; + uint64 reserved[2]; +} +#include "vmware_pack_end.h" +Vmxnet3_DSDevRead; + +typedef +#include "vmware_pack_begin.h" +struct Vmxnet3_TxQueueDesc { + Vmxnet3_TxQueueCtrl ctrl; + Vmxnet3_TxQueueConf conf; + /* Driver read after a GET command */ + Vmxnet3_QueueStatus status; + UPT1_TxStats stats; + uint8 _pad[88]; /* 128 aligned */ +} +#include "vmware_pack_end.h" +Vmxnet3_TxQueueDesc; + +typedef +#include "vmware_pack_begin.h" +struct Vmxnet3_RxQueueDesc { + Vmxnet3_RxQueueCtrl ctrl; + Vmxnet3_RxQueueConf conf; + /* Driver read after a GET command */ + Vmxnet3_QueueStatus status; + UPT1_RxStats stats; + uint8 _pad[88]; /* 128 aligned */ +} +#include "vmware_pack_end.h" +Vmxnet3_RxQueueDesc; + +typedef +#include "vmware_pack_begin.h" +struct Vmxnet3_DriverShared { + uint32 magic; + uint32 pad; /* make devRead start at 64-bit boundaries */ + Vmxnet3_DSDevRead devRead; + uint32 ecr; + uint32 reserved[5]; +} +#include "vmware_pack_end.h" +Vmxnet3_DriverShared; + +#define VMXNET3_ECR_RQERR (1 << 0) +#define VMXNET3_ECR_TQERR (1 << 1) +#define VMXNET3_ECR_LINK (1 << 2) +#define VMXNET3_ECR_DIC (1 << 3) +#define VMXNET3_ECR_DEBUG (1 << 4) + +/* flip the gen bit of a ring */ +#define VMXNET3_FLIP_RING_GEN(gen) ((gen) = (gen) ^ 0x1) + +/* only use this if moving the idx won't affect the gen bit */ +#define VMXNET3_INC_RING_IDX_ONLY(idx, ring_size) \ +do {\ + (idx)++;\ + if (UNLIKELY((idx) == (ring_size))) {\ + (idx) = 0;\ + }\ +} while (0) + +#define VMXNET3_SET_VFTABLE_ENTRY(vfTable, vid) \ + vfTable[vid >> 5] |= (1 << (vid & 31)) +#define VMXNET3_CLEAR_VFTABLE_ENTRY(vfTable, vid) \ + vfTable[vid >> 5] &= ~(1 << (vid & 31)) + +#define VMXNET3_VFTABLE_ENTRY_IS_SET(vfTable, vid) \ + ((vfTable[vid >> 5] & (1 << (vid & 31))) != 0) + +#define VMXNET3_MAX_MTU 9000 +#define VMXNET3_MIN_MTU 60 + +#define VMXNET3_LINK_UP (10000 << 16 | 1) // 10 Gbps, up +#define VMXNET3_LINK_DOWN 0 +#endif /* _VMXNET3_DEFS_H_ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/vmxnet3_int.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/vmxnet3_int.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/vmxnet3_int.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/vmxnet3_int.h 2008-10-13 08:01:47.000000000 +0100 @@ -0,0 +1,271 @@ +/********************************************************* + * Copyright (C) 2007 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +#ifndef _VMXNET3_INT_H +#define _VMXNET3_INT_H + +#define INCLUDE_ALLOW_MODULE +#include "includeCheck.h" + +#include "vmxnet3_defs.h" + +typedef struct vmxnet3_cmd_ring { + Vmxnet3_GenericDesc *base; + uint32 size; + uint32 next2fill; + uint32 next2comp; + uint8 gen; + dma_addr_t basePA; +} Vmxnet3_CmdRing; + +static INLINE void +vmxnet3_cmd_ring_adv_next2fill(struct vmxnet3_cmd_ring *ring) +{ + ring->next2fill++; + if (UNLIKELY(ring->next2fill == ring->size)) { + ring->next2fill = 0; + VMXNET3_FLIP_RING_GEN(ring->gen); + } +} + +static INLINE void +vmxnet3_cmd_ring_adv_next2comp(struct vmxnet3_cmd_ring *ring) +{ + VMXNET3_INC_RING_IDX_ONLY(ring->next2comp, ring->size); +} + +static INLINE int +vmxnet3_cmd_ring_desc_avail(struct vmxnet3_cmd_ring *ring) +{ + return (ring->next2comp > ring->next2fill ? 0 : ring->size) + + ring->next2comp - ring->next2fill - 1; +} + +typedef struct vmxnet3_comp_ring { + Vmxnet3_GenericDesc *base; + uint32 size; + uint32 next2proc; + uint8 gen; + uint8 intr_idx; + dma_addr_t basePA; +} Vmxnet3_CompRing; + +static INLINE void +vmxnet3_comp_ring_adv_next2proc(struct vmxnet3_comp_ring *ring) +{ + ring->next2proc++; + if (UNLIKELY(ring->next2proc == ring->size)) { + ring->next2proc = 0; + VMXNET3_FLIP_RING_GEN(ring->gen); + } +} + +struct vmxnet3_tx_data_ring { + Vmxnet3_TxDataDesc *base; + uint32 size; + dma_addr_t basePA; +}; + +enum vmxnet3_buf_map_type { + VMXNET3_MAP_INVALID = 0, + VMXNET3_MAP_NONE, + VMXNET3_MAP_SINGLE, + VMXNET3_MAP_PAGE, +}; + +struct vmxnet3_tx_buf_info { + uint32 map_type; + uint16 len; + uint16 sop_idx; + dma_addr_t dma_addr; + struct sk_buff *skb; +}; + +struct vmxnet3_tq_driver_stats { + uint64 drop_total; /* # of pkts dropped by the driver, the + * counters below track droppings due to + * different reasons + */ + uint64 drop_too_many_frags; + uint64 drop_oversized_hdr; + uint64 drop_hdr_inspect_err; + uint64 drop_tso; + + uint64 tx_ring_full; + uint64 linearized; /* # of pkts linearized */ + uint64 copy_skb_header; /* # of times we have to copy skb header */ + uint64 oversized_hdr; +}; + +struct vmxnet3_tx_ctx { + Bool ipv4; + Bool ipv6; + uint16 mss; + uint32 eth_ip_hdr_size; /* only valid for pkts requesting tso or csum offloading */ + uint32 l4_hdr_size; /* only valid if mss != 0 */ + uint32 copy_size; /* # of bytes copied into the data ring */ + Vmxnet3_GenericDesc *sop_txd; + Vmxnet3_GenericDesc *eop_txd; +}; + +struct vmxnet3_tx_queue { + spinlock_t tx_lock; + struct vmxnet3_cmd_ring tx_ring; + struct vmxnet3_tx_buf_info *buf_info; + struct vmxnet3_tx_data_ring data_ring; + struct vmxnet3_comp_ring comp_ring; + Vmxnet3_TxQueueCtrl *shared; + struct vmxnet3_tq_driver_stats stats; + Bool stopped; + int num_stop; /* # of time queue is stopped */ +} __attribute__((__aligned__(SMP_CACHE_BYTES))); + +enum vmxnet3_rx_buf_type { + VMXNET3_RX_BUF_NONE = 0, + VMXNET3_RX_BUF_SKB = 1, + VMXNET3_RX_BUF_PAGE = 2 +}; + +struct vmxnet3_rx_buf_info { + enum vmxnet3_rx_buf_type buf_type; + uint16 len; + union { + struct sk_buff *skb; + struct page *page; + }; + dma_addr_t dma_addr; +}; + +struct vmxnet3_rx_ctx { + struct sk_buff *skb; + uint32 sop_idx; +}; + +struct vmxnet3_rq_driver_stats { + uint64 drop_total; + uint64 drop_err; + uint64 drop_fcs; + uint64 rx_buf_alloc_failure; +}; + +struct vmxnet3_rx_queue { + struct vmxnet3_cmd_ring rx_ring[2]; + struct vmxnet3_comp_ring comp_ring; + struct vmxnet3_rx_ctx rx_ctx; + uint32 qid; /* rqID in RCD for buffer from 1st ring */ + uint32 qid2; /* rqID in RCD for buffer from 2nd ring */ + uint32 uncommitted[2]; /* # of buffers allocated since last RXPROD update */ + struct vmxnet3_rx_buf_info *buf_info[2]; + Vmxnet3_RxQueueCtrl *shared; + struct vmxnet3_rq_driver_stats stats; +} __attribute__((__aligned__(SMP_CACHE_BYTES))); + +#define VMXNET3_LINUX_MAX_MSIX_VECT 1 + +struct vmxnet3_intr { + enum vmxnet3_intr_mask_mode mask_mode; + enum vmxnet3_intr_type type; /* MSI-X, MSI, or INTx? */ + uint8 num_intrs; /* # of intr vectors */ + uint8 event_intr_idx; /* idx of the intr vector for event */ + uint8 mod_levels[VMXNET3_LINUX_MAX_MSIX_VECT]; /* moderation level */ +#ifdef CONFIG_PCI_MSI + struct msix_entry msix_entries[VMXNET3_LINUX_MAX_MSIX_VECT]; +#endif +}; + +#define VMXNET3_STATE_BIT_RESETTING 0 +#define VMXNET3_STATE_BIT_QUIESCED 1 +struct vmxnet3_adapter { + struct vmxnet3_tx_queue tx_queue; + struct vmxnet3_rx_queue rx_queue; +#ifdef VMXNET3_NAPI + struct napi_struct napi; +#endif + struct vlan_group *vlan_grp; + + struct vmxnet3_intr intr; + + struct Vmxnet3_DriverShared *shared; + struct Vmxnet3_PMConf *pm_conf; + struct Vmxnet3_TxQueueDesc *tqd_start; /* first tx queue desc */ + struct Vmxnet3_RxQueueDesc *rqd_start; /* first rx queue desc */; + struct net_device *netdev; + struct net_device_stats net_stats; + struct pci_dev *pdev; + + uint8 *hw_addr0; /* for BAR 0 */ + uint8 *hw_addr1; /* for BAR 1 */ + + /* feature control */ + Bool rxcsum; + Bool lro; + Bool jumbo_frame; + + /* rx buffer related */ + unsigned skb_buf_size; + int rx_buf_per_pkt; /* only apply to the 1st ring */ + dma_addr_t shared_pa; + dma_addr_t queue_desc_pa; + + /* Wake-on-LAN */ + uint32 wol; + + /* Link speed */ + uint32 link_speed; /* in mbps */ + + uint64 tx_timeout_count; + compat_work work; + + unsigned long state; /* VMXNET3_STATE_BIT_xxx */ +}; + +struct vmxnet3_stat_desc { + char desc[ETH_GSTRING_LEN]; + int offset; +}; + +#define VMXNET3_WRITE_BAR0_REG(adapter, reg, val) \ + writel((val), (adapter)->hw_addr0 + (reg)) +#define VMXNET3_READ_BAR0_REG(adapter, reg) \ + readl((adapter)->hw_addr0 + (reg)) + +#define VMXNET3_WRITE_BAR1_REG(adapter, reg, val) \ + writel((val), (adapter)->hw_addr1 + (reg)) +#define VMXNET3_READ_BAR1_REG(adapter, reg) \ + readl((adapter)->hw_addr1 + (reg)) + +#define VMXNET3_WAKE_QUEUE_THRESHOLD(tq) (5) +#define VMXNET3_RX_ALLOC_THRESHOLD(rq, ring_idx, adapter) \ + ((rq)->rx_ring[ring_idx].size >> 3) + +#define VMXNET3_TX_OK 0 +#define VMXNET3_TX_DROPPED 1 +#define VMXNET3_TX_FULL 2 + +#define VMXNET3_GET_ADDR_LO(dma) ((uint32)(dma)) +#define VMXNET3_GET_ADDR_HI(dma) ((uint32)(((uint64)(dma)) >> 32)) + +/* must be a multiple of VMXNET3_RING_SIZE_ALIGN */ +#define VMXNET3_DEF_TX_RING_SIZE 512 +#define VMXNET3_DEF_RX_RING_SIZE 256 + +/* FIXME: what's the right value for this? */ +#define VMXNET3_MAX_ETH_HDR_SIZE 22 + +#define VMXNET3_MAX_SKB_BUF_SIZE (3*1024) +#endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/vmxnet3_version.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/vmxnet3_version.h --- open-vm-tools-2008.01.23-74039/modules/linux/vmxnet3/vmxnet3_version.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vmxnet3/vmxnet3_version.h 2008-10-13 08:01:47.000000000 +0100 @@ -0,0 +1,34 @@ +/********************************************************* + * Copyright (C) 2007 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * vmxnet3_version.h -- + * + * Version definitions for the Linux vmxnet3 driver. + */ + +#ifndef _VMXNET3_VERSION_H_ +#define _VMXNET3_VERSION_H_ + +#define VMXNET3_DRIVER_VERSION 0.0.0.28 +#define VMXNET3_DRIVER_VERSION_COMMAS 0,0,0,28 +#define VMXNET3_DRIVER_VERSION_STRING "0.0.0.28" + +#define VMXNET3_DRIVER_VERSION_NUM 28 + +#endif /* _VMXNET3_VERSION_H_ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vsock/autoconf/cachecreate.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/autoconf/cachecreate.c --- open-vm-tools-2008.01.23-74039/modules/linux/vsock/autoconf/cachecreate.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/autoconf/cachecreate.c 2008-10-13 08:01:40.000000000 +0100 @@ -0,0 +1,42 @@ +/********************************************************* + * Copyright (C) 2006 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +#include <linux/autoconf.h> +#include <linux/version.h> + +/* + * All kernels before 2.6.22 take 6 arguments. All kernels since + * 2.6.23-rc1 take 5 arguments. Only kernels between 2.6.22 and + * 2.6.23-rc1 are questionable - we could ignore them if we wanted, + * nobody cares about them even now. But unfortunately RedHat is + * re-releasing 2.6.X-rc kernels under 2.6.(X-1) name, so they + * are releasing 2.6.23-rc1 as 2.6.22-5055-something, so we have + * to do autodetection for them. + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 22) +/* Success... */ +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 23) +#error "This test intentionally fails on 2.6.23 and newer kernels." +#else +#include <linux/slab.h> + +struct kmem_cache *kmemtest(void) { + return kmem_cache_create("test", 12, 0, 0, NULL, NULL); +} + +#endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vsock/autoconf/epoll.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/autoconf/epoll.c --- open-vm-tools-2008.01.23-74039/modules/linux/vsock/autoconf/epoll.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/autoconf/epoll.c 2008-10-13 08:01:40.000000000 +0100 @@ -0,0 +1,36 @@ +/********************************************************* + * Copyright (C) 2004 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * Detect whether we have 'struct poll_wqueues' + * 2.6.x kernels always had this struct. Stock 2.4.x kernels + * never had it, but some distros backported epoll patch. + */ + +#include <linux/autoconf.h> +#include <linux/version.h> + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0) +#include <linux/poll.h> + +void poll_test(void) { + struct poll_wqueues test; + + return poll_initwait(&test); +} +#endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vsock/autoconf/filldir1.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/autoconf/filldir1.c --- open-vm-tools-2008.01.23-74039/modules/linux/vsock/autoconf/filldir1.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/autoconf/filldir1.c 2008-10-13 08:01:40.000000000 +0100 @@ -0,0 +1,50 @@ +/********************************************************* + * Copyright (C) 2006 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +#include <linux/autoconf.h> +#include <linux/version.h> + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) +#include <linux/fs.h> +#include <linux/types.h> /* loff_t */ +#include <linux/stddef.h> /* NULL */ + +/* + * After 2.6.18, filldir and statfs were changed to send 64-bit inode + * numbers to user space. Red Hat backported this behavior into a 2.6.17 + * kernel. + * + * This test will fail on a kernel with such a patch. + */ +static int LinuxDriverFilldir(void *buf, + const char *name, + int namelen, + loff_t offset, + ino_t ino, + unsigned int d_type) +{ + return 0; +} + +void test(void) +{ + vfs_readdir(NULL, LinuxDriverFilldir, NULL); +} +#else +#error "This test intentionally fails on 2.6.20 and newer kernels." +#endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vsock/autoconf/geninclude.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/autoconf/geninclude.c --- open-vm-tools-2008.01.23-74039/modules/linux/vsock/autoconf/geninclude.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/autoconf/geninclude.c 2008-10-13 08:01:40.000000000 +0100 @@ -0,0 +1,40 @@ +/********************************************************* + * Copyright (C) 2003 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +#include <linux/autoconf.h> + +#ifdef CONFIG_X86_VOYAGER +APATH/mach-voyager +#endif +#ifdef CONFIG_X86_VISWS +APATH/mach-visws +#endif +#ifdef CONFIG_X86_NUMAQ +APATH/mach-numaq +#endif +#ifdef CONFIG_X86_BIGSMP +APATH/mach-bigsmp +#endif +#ifdef CONFIG_X86_SUMMIT +APATH/mach-summit +#endif +#ifdef CONFIG_X86_GENERICARCH +APATH/mach-generic +#endif +APATH/mach-default + diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vsock/autoconf/getsb1.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/autoconf/getsb1.c --- open-vm-tools-2008.01.23-74039/modules/linux/vsock/autoconf/getsb1.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/autoconf/getsb1.c 2008-10-13 08:01:40.000000000 +0100 @@ -0,0 +1,45 @@ +/********************************************************* + * Copyright (C) 2006 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +#include <linux/autoconf.h> +#include <linux/version.h> + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19) + +#include <linux/fs.h> + +/* + * Around 2.6.18, a pointer to a vfsmount was added to get_sb. Red Hat + * backported this behavior into a 2.6.17 kernel. + * + * This test will fail on a kernel with such a patch. + */ +static struct super_block * LinuxDriverGetSb(struct file_system_type *fs_type, + int flags, + const char *dev_name, + void *rawData) +{ + return 0; +} + +struct file_system_type fs_type = { + .get_sb = LinuxDriverGetSb +}; +#else +#error "This test intentionally fails on 2.6.19 or newer kernels." +#endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vsock/autoconf/setnice.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/autoconf/setnice.c --- open-vm-tools-2008.01.23-74039/modules/linux/vsock/autoconf/setnice.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/autoconf/setnice.c 2008-10-13 08:01:40.000000000 +0100 @@ -0,0 +1,32 @@ +/********************************************************* + * Copyright (C) 2005 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * set_user_nice appeared in 2.4.21. But some distros + * backported it to older kernels. + */ +#include <linux/autoconf.h> +#include <linux/version.h> + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 21) +#include <linux/sched.h> + +void test(void) { + set_user_nice(current, -20); +} +#endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vsock/autoconf/skas1.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/autoconf/skas1.c --- open-vm-tools-2008.01.23-74039/modules/linux/vsock/autoconf/skas1.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/autoconf/skas1.c 2008-10-13 08:01:40.000000000 +0100 @@ -0,0 +1,32 @@ +/********************************************************* + * Copyright (C) 2004 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * SKAS patch adds 'struct mm *mm' as first argument to do_mmap_pgoff. + * This patch never hit mainstream kernel. + */ + +#include <linux/mm.h> + +unsigned long check_do_mmap_pgoff(struct mm_struct *mm, struct file *file, + unsigned long addr, unsigned long len, + unsigned long prot, unsigned long flag, + unsigned long pgoff) { + return do_mmap_pgoff(mm, file, addr, len, prot, flag, pgoff); +} + diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vsock/autoconf/sk_filter.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/autoconf/sk_filter.c --- open-vm-tools-2008.01.23-74039/modules/linux/vsock/autoconf/sk_filter.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/autoconf/sk_filter.c 2008-10-13 08:01:40.000000000 +0100 @@ -0,0 +1,53 @@ +/********************************************************* + * Copyright (C) 2007 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * Detect whether the old or new sk_filter() interface is used. This was + * changed in 2.4.21, but it's backported to some distro kernels. + * + * This test will fail to build on kernels with the new interface. + */ + +#include <linux/autoconf.h> +#include <linux/version.h> + +/* + * We'd restrict this test to 2.4.21 and earlier kernels, but Mandrake's + * enterprise-2.4.21-013mdk-9.1 appears to really be 2.4.20 with some patches, + * and not the patches we care about, so let's test on 2.4.21 kernels too. + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 22) +#include <linux/stddef.h> +#include <linux/socket.h> +#include <net/sock.h> +#include <linux/filter.h> + +struct sk_buff test_skbuff; +struct sk_filter test_filter; + +int +sk_filter_test(void) +{ + struct sk_buff *skb = &test_skbuff; + struct sk_filter *filter = &test_filter; + + return sk_filter(skb, filter); +} +#else +#error "This test intentionally fails on 2.4.22 or newer kernels." +#endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vsock/autoconf/statfs1.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/autoconf/statfs1.c --- open-vm-tools-2008.01.23-74039/modules/linux/vsock/autoconf/statfs1.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/autoconf/statfs1.c 2008-10-13 08:01:40.000000000 +0100 @@ -0,0 +1,42 @@ +/********************************************************* + * Copyright (C) 2006 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +#include <linux/autoconf.h> +#include <linux/version.h> + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19) +#include <linux/fs.h> + +/* + * Around 2.6.18, the super_block pointer in statfs was changed to a dentry + * pointer. Red Hat backported this behavior into a 2.6.17 kernel. + * + * This test will fail on a kernel with such a patch. + */ +static int LinuxDriverStatFs(struct super_block *sb, + struct kstatfs *stat) +{ + return 0; +} + +struct super_operations super_ops = { + .statfs = LinuxDriverStatFs +}; +#else +#error "This test intentionally fails on 2.6.19 and newer kernels." +#endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vsock/COPYING /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/COPYING --- open-vm-tools-2008.01.23-74039/modules/linux/vsock/COPYING 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/COPYING 2008-10-13 08:01:40.000000000 +0100 @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 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. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + <one line to give the program's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + <signature of Ty Coon>, 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/circList.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/circList.h --- open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/circList.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/circList.h 2008-10-13 08:01:40.000000000 +0100 @@ -0,0 +1,428 @@ +/********************************************************* + * Copyright (C) 1998 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * 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) \ + ((type *)((char *)(ptr) - offsetof(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_ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/compat_completion.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/compat_completion.h --- open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/compat_completion.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/compat_completion.h 2008-10-13 08:01:40.000000000 +0100 @@ -0,0 +1,175 @@ +/********************************************************* + * Copyright (C) 2004 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +#ifndef __COMPAT_COMPLETION_H__ +# define __COMPAT_COMPLETION_H__ + +/* + * The kernel's completion objects were made available for module use in 2.4.9. + * + * Between 2.4.0 and 2.4.9, we implement completions on our own using + * waitqueues and counters. This was done so that we could safely support + * functions like complete_all(), which cannot be implemented using semaphores. + * + * Prior to that, the waitqueue API is substantially different, and since none + * of our modules that are built against older kernels need complete_all(), + * we fallback on a simple semaphore-based implementation. + */ + +/* + * Native completions. + */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 9) + +#include <linux/completion.h> +#define compat_completion struct completion +#define compat_init_completion(comp) init_completion(comp) +#define COMPAT_DECLARE_COMPLETION DECLARE_COMPLETION +#define compat_wait_for_completion(comp) wait_for_completion(comp) +#define compat_complete(comp) complete(comp) + +/* complete_all() was exported in 2.6.6. */ +# if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 6) +# include "compat_wait.h" +# include "compat_list.h" +# include "compat_spinlock.h" +# include "compat_sched.h" +# define compat_complete_all(x) \ + ({ \ + struct list_head *currLinks; \ + spin_lock(&(x)->wait.lock); \ + (x)->done += UINT_MAX/2; \ + \ + list_for_each(currLinks, &(x)->wait.task_list) { \ + wait_queue_t *currQueue = list_entry(currLinks, wait_queue_t, task_list); \ + wake_up_process(currQueue->task); \ + } \ + spin_unlock(&(x)->wait.lock); \ + }) +# else +# define compat_complete_all complete_all +# endif + +/* + * Completions via waitqueues. + */ +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 0) + +/* + * Kernel completions in 2.4.9 and beyond use a counter and a waitqueue, and + * our implementation is quite similar. Because __wake_up_common() is not + * exported, our implementations of compat_complete() and compat_complete_all() + * are somewhat racy: the counter is incremented outside of the waitqueue's + * lock. + * + * As a result, our completion cannot guarantee in-order wake ups. For example, + * suppose thread A is entering compat_complete(), thread B is sleeping inside + * compat_wait_for_completion(), and thread C is just now entering + * compat_wait_for_completion(). If Thread A is scheduled first and increments + * the counter, then gets swapped out, thread C may get scheduled and will + * quickly go through compat_wait_for_completion() (since done != 0) while + * thread B continues to sleep, even though thread B should have been the one + * to wake up. + */ + +#include <asm/current.h> +#include "compat_sched.h" +#include "compat_list.h" +#include <linux/smp_lock.h> // for lock_kernel()/unlock_kernel() +#include "compat_wait.h" + +typedef struct compat_completion { + unsigned int done; + wait_queue_head_t wq; +} compat_completion; + +#define compat_init_completion(comp) do { \ + (comp)->done = 0; \ + init_waitqueue_head(&(comp)->wq); \ +} while (0) +#define COMPAT_DECLARE_COMPLETION(comp) \ + compat_completion comp = { \ + .done = 0, \ + .wq = __WAIT_QUEUE_HEAD_INITIALIZER((comp).wq), \ + } + +/* + * Locking and unlocking the kernel lock here ensures that the thread + * is no longer running in module code: compat_complete_and_exit + * performs the sequence { lock_kernel(); up(comp); compat_exit(); }, with + * the final unlock_kernel performed implicitly by the resident kernel + * in do_exit. + */ +#define compat_wait_for_completion(comp) do { \ + spin_lock_irq(&(comp)->wq.lock); \ + if (!(comp)->done) { \ + DECLARE_WAITQUEUE(wait, current); \ + wait.flags |= WQ_FLAG_EXCLUSIVE; \ + __add_wait_queue_tail(&(comp)->wq, &wait); \ + do { \ + __set_current_state(TASK_UNINTERRUPTIBLE); \ + spin_unlock_irq(&(comp)->wq.lock); \ + schedule(); \ + spin_lock_irq(&(comp)->wq.lock); \ + } while (!(comp)->done); \ + __remove_wait_queue(&(comp)->wq, &wait); \ + } \ + (comp)->done--; \ + spin_unlock_irq(&(comp)->wq.lock); \ + lock_kernel(); \ + unlock_kernel(); \ +} while (0) + +/* XXX: I don't think I need to touch the BKL. */ +#define compat_complete(comp) do { \ + unsigned long flags; \ + spin_lock_irqsave(&(comp)->wq.lock, flags); \ + (comp)->done++; \ + spin_unlock_irqrestore(&(comp)->wq.lock, flags); \ + wake_up(&(comp)->wq); \ +} while (0) + +#define compat_complete_all(comp) do { \ + unsigned long flags; \ + spin_lock_irqsave(&(comp)->wq.lock, flags); \ + (comp)->done += UINT_MAX / 2; \ + spin_unlock_irqrestore(&(comp)->wq.lock, flags); \ + wake_up_all(&(comp)->wq); \ +} while (0) + +/* + * Completions via semaphores. + */ +#else + +#include "compat_semaphore.h" +#define compat_completion struct semaphore +#define compat_init_completion(comp) init_MUTEX_LOCKED(comp) +#define COMPAT_DECLARE_COMPLETION(comp) DECLARE_MUTEX_LOCKED(comp) + +#define compat_wait_for_completion(comp) do { \ + down(comp); \ + lock_kernel(); \ + unlock_kernel(); \ +} while (0) + +#define compat_complete(comp) up(comp) + +#endif + +#endif /* __COMPAT_COMPLETION_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/compat_file.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/compat_file.h --- open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/compat_file.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/compat_file.h 2008-10-13 08:01:40.000000000 +0100 @@ -0,0 +1,56 @@ +/********************************************************* + * Copyright (C) 2002 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +#ifndef __COMPAT_FILE_H__ +# define __COMPAT_FILE_H__ + + +/* The fput() API is modified in 2.2.0 --hpreg */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 2, 0) +# define compat_fput(_file) fput(_file) +#else +# define compat_fput(_file) fput(_file, (_file)->f_inode) +#endif + + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 0) +# define compat_get_file(_file) get_file(_file) +# define compat_file_count(_file) file_count(_file) +#else +# define compat_get_file(_file) (_file)->f_count++ +# define compat_file_count(_file) (_file)->f_count +#endif + + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 2, 4) +# define compat_filp_close(_file, _files) filp_close(_file, _files) +#else +static inline void compat_filp_close(struct file* filp, fl_owner_t files) { + if (filp->f_op && filp->f_op->flush) { + filp->f_op->flush(filp); + } + /* + * Hopefully there are no locks to release on this filp. + * locks_remove_posix is not exported so we cannot use it... + */ + fput(filp); +} +#endif + + +#endif /* __COMPAT_FILE_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/compat_fs.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/compat_fs.h --- open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/compat_fs.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/compat_fs.h 2008-10-13 08:01:40.000000000 +0100 @@ -0,0 +1,247 @@ +/********************************************************* + * Copyright (C) 2006 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +#ifndef __COMPAT_FS_H__ +# define __COMPAT_FS_H__ + +#include <linux/fs.h> + +/* + * 2.6.5+ kernels define FS_BINARY_MOUNTDATA. Since it didn't exist and + * wasn't used prior, it's safe to define it to zero. + */ + +#ifndef FS_BINARY_MOUNTDATA +#define FS_BINARY_MOUNTDATA 0 +#endif + +/* + * MAX_LFS_FILESIZE wasn't defined until 2.5.4. + */ +#ifndef MAX_LFS_FILESIZE +# include <linux/pagemap.h> +# if BITS_PER_LONG == 32 +# define MAX_LFS_FILESIZE (((u64)PAGE_CACHE_SIZE << (BITS_PER_LONG - 1)) - 1) +# elif BITS_PER_LONG == 64 +# define MAX_LFS_FILESIZE 0x7fffffffffffffffUL +# endif +#endif + + +/* + * sendfile as a VFS op was born in 2.5.30. Unfortunately, it also changed + * signatures, first in 2.5.47, then again in 2.5.70, then again in 2.6.8. + * Luckily, the 2.6.8+ signature is the same as the 2.5.47 signature. And + * as of 2.6.23-rc1 sendfile is gone, replaced by splice_read... + * + * Let's not support sendfile from 2.5.30 to 2.5.47, because the 2.5.30 + * signature is much different and file_send_actor isn't externed. + */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 23) +#define VMW_SENDFILE_NONE +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 8) +#define VMW_SENDFILE_NEW +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 70) +#define VMW_SENDFILE_OLD +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 47) +#define VMW_SENDFILE_NEW +#else +#define VMW_SENDFILE_NONE +#endif + +/* + * splice_read is there since 2.6.17, but let's avoid 2.6.17-rcX kernels... + * After all nobody is using splice system call until 2.6.23 using it to + * implement sendfile. + */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 18) +#define VMW_SPLICE_READ 1 +#endif + +/* + * Filesystems wishing to use generic page cache read/write routines are + * supposed to implement aio_read and aio_write (calling into + * generic_file_aio_read() and generic_file_aio_write() if necessary). + * + * The VFS exports do_sync_read() and do_sync_write() as the "new" + * generic_file_read() and generic_file_write(), but filesystems need not + * actually implement read and write- the VFS will automatically call + * do_sync_write() and do_sync_read() when applications invoke the standard + * read() and write() system calls. + * + * In 2.6.19, generic_file_read() and generic_file_write() were removed, + * necessitating this change. AIO dates as far back as 2.5.42, but the API has + * changed over time, so for simplicity, we'll only enable it from 2.6.19 and + * on. + */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19) +# define VMW_USE_AIO +#endif + + +/* + * The alloc_inode and destroy_inode VFS ops didn't exist prior to 2.4.21. + * Without these functions, file systems can't embed inodes. + */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 21) +# define VMW_EMBED_INODE +#endif + + +/* + * iget() was removed from the VFS as of 2.6.25-rc1. The replacement for iget() + * is iget_locked() which was added in 2.5.17. + */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 17) +# define VMW_USE_IGET_LOCKED +#endif + +/* + * parent_ino was born in 2.5.5. For older kernels, let's use 2.5.5 + * implementation. It uses the dcache lock which is OK because per-dentry + * locking appeared after 2.5.5. + */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 5) +#define compat_parent_ino(dentry) parent_ino(dentry) +#else +#define compat_parent_ino(dentry) \ +({ \ + ino_t res; \ + spin_lock(&dcache_lock); \ + res = dentry->d_parent->d_inode->i_ino; \ + spin_unlock(&dcache_lock); \ + res; \ +}) +#endif + + +/* + * putname changed to __putname in 2.6.6. + */ +#define compat___getname() __getname() +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 6) +#define compat___putname(name) putname(name) +#else +#define compat___putname(name) __putname(name) +#endif + + +/* + * inc_nlink, drop_nlink, and clear_nlink were added in 2.6.19. + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19) +#define compat_inc_nlink(inode) ((inode)->i_nlink++) +#define compat_drop_nlink(inode) ((inode)->i_nlink--) +#define compat_clear_nlink(inode) ((inode)->i_nlink = 0) +#else +#define compat_inc_nlink(inode) inc_nlink(inode) +#define compat_drop_nlink(inode) drop_nlink(inode) +#define compat_clear_nlink(inode) clear_nlink(inode) +#endif + + +/* + * i_size_write and i_size_read were introduced in 2.6.0-test1 + * (though we'll look for them as of 2.6.1). They employ slightly different + * locking in order to guarantee atomicity, depending on the length of a long, + * whether the kernel is SMP, or whether the kernel is preemptible. Prior to + * i_size_write and i_size_read, there was no such locking, so that's the + * behavior we'll emulate. + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 1) +#define compat_i_size_read(inode) ((inode)->i_size) +#define compat_i_size_write(inode, size) ((inode)->i_size = size) +#else +#define compat_i_size_read(inode) i_size_read(inode) +#define compat_i_size_write(inode, size) i_size_write(inode, size) +#endif + + +/* + * filemap_fdatawrite was introduced in 2.5.12. Prior to that, modules used + * filemap_fdatasync instead. In 2.4.18, both filemap_fdatawrite and + * filemap_fdatawait began returning status codes. Prior to that, they were + * void functions, so we'll just have them return 0. + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 18) +#define compat_filemap_fdatawrite(mapping) \ +({ \ + int result = 0; \ + filemap_fdatasync(mapping); \ + result; \ +}) +#define compat_filemap_fdatawait(mapping) \ +({ \ + int result = 0; \ + filemap_fdatawait(mapping); \ + result; \ +}) +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 12) +#define compat_filemap_fdatawrite(mapping) filemap_fdatasync(mapping) +#define compat_filemap_fdatawait(mapping) filemap_fdatawait(mapping) +#else +#define compat_filemap_fdatawrite(mapping) filemap_fdatawrite(mapping) +#define compat_filemap_fdatawait(mapping) filemap_fdatawait(mapping) +#endif + + +/* + * filemap_write_and_wait was introduced in 2.6.6 and exported for module use + * in 2.6.16. It's really just a simple wrapper around filemap_fdatawrite and + * and filemap_fdatawait, which initiates a flush of all dirty pages, then + * waits for the pages to flush. The implementation here is a simplified form + * of the one found in 2.6.20-rc3. + * + * Unfortunately, it just isn't possible to implement this prior to 2.4.5, when + * neither filemap_fdatawait nor filemap_fdatasync were exported for module + * use. So we'll define it out and hope for the best. + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 5) +#define compat_filemap_write_and_wait(mapping) +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 16) +#define compat_filemap_write_and_wait(mapping) \ +({ \ + int result = 0; \ + if (mapping->nrpages) { \ + result = compat_filemap_fdatawrite(mapping); \ + if (result != -EIO) { \ + int result2 = compat_filemap_fdatawait(mapping); \ + if (!result) { \ + result = result2; \ + } \ + } \ + } \ + result; \ +}) +#else +#define compat_filemap_write_and_wait(mapping) filemap_write_and_wait(mapping) +#endif + + +/* + * invalidate_remote_inode was introduced in 2.6.0-test5. Prior to that, + * filesystems wishing to invalidate pages belonging to an inode called + * invalidate_inode_pages. + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0) +#define compat_invalidate_remote_inode(inode) invalidate_inode_pages(inode) +#else +#define compat_invalidate_remote_inode(inode) invalidate_remote_inode(inode) +#endif + +#endif /* __COMPAT_FS_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/compat_init.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/compat_init.h --- open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/compat_init.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/compat_init.h 2008-10-13 08:01:40.000000000 +0100 @@ -0,0 +1,38 @@ +/********************************************************* + * Copyright (C) 1999 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * compat_init.h: Initialization compatibility wrappers. + */ + +#ifndef __COMPAT_INIT_H__ +#define __COMPAT_INIT_H__ + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 2, 0) +#include <linux/init.h> +#endif + +#ifndef module_init +#define module_init(x) int init_module(void) { return x(); } +#endif + +#ifndef module_exit +#define module_exit(x) void cleanup_module(void) { x(); } +#endif + +#endif /* __COMPAT_INIT_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/compat_kernel.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/compat_kernel.h --- open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/compat_kernel.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/compat_kernel.h 2008-10-13 08:01:40.000000000 +0100 @@ -0,0 +1,83 @@ +/********************************************************* + * Copyright (C) 2004 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +#ifndef __COMPAT_KERNEL_H__ +# define __COMPAT_KERNEL_H__ + +#include <asm/unistd.h> +#include <linux/kernel.h> + +/* + * container_of was introduced in 2.5.28 but it's easier to check like this. + */ +#ifndef container_of +#define container_of(ptr, type, member) ({ \ + const typeof( ((type *)0)->member ) *__mptr = (ptr); \ + (type *)( (char *)__mptr - offsetof(type,member) );}) +#endif + +/* + * wait_for_completion and friends did not exist before 2.4.9. + */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 9) + +#define compat_complete_and_exit(comp, status) complete_and_exit(comp, status) + +#else + +#include "compat_completion.h" + +/* + * Used by _syscallX macros. Note that this is global variable, so + * do not rely on its contents too much. As exit() is only function + * we use, and we never check return value from exit(), we have + * no problem... + */ +extern int errno; + +/* + * compat_exit() provides an access to the exit() function. It must + * be named compat_exit(), as exit() (with different signature) is + * provided by x86-64, arm and other (but not by i386). + */ +#define __NR_compat_exit __NR_exit +static inline _syscall1(int, compat_exit, int, exit_code); + +/* + * See compat_wait_for_completion in compat_completion.h. + * compat_exit implicitly performs an unlock_kernel, in resident code, + * ensuring that the thread is no longer running in module code when the + * module is unloaded. + */ +#define compat_complete_and_exit(comp, status) do { \ + lock_kernel(); \ + compat_complete(comp); \ + compat_exit(status); \ +} while (0) + +#endif + +/* + * vsnprintf became available in 2.4.10. For older kernels, just fall back on + * vsprintf. + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 10) +#define vsnprintf(str, size, fmt, args) vsprintf(str, fmt, args) +#endif + +#endif /* __COMPAT_KERNEL_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/compat_list.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/compat_list.h --- open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/compat_list.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/compat_list.h 2008-10-13 08:01:40.000000000 +0100 @@ -0,0 +1,55 @@ +/********************************************************* + * Copyright (C) 2006 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +#ifndef __COMPAT_LIST_H__ +# define __COMPAT_LIST_H__ + +#include <linux/list.h> + +/* + * list_add_tail is with us since 2.4.0, or something like that. + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 0) +#define list_add_tail(newe, head) do { \ + struct list_head *__h = (head); \ + __list_add((newe), __h->prev, __h); \ +} while (0) +#endif + +/* + * list_for_each_safe() showed up in 2.4.10, but it may be backported so we + * just check for its existence. + */ +#ifndef list_for_each_safe +# define list_for_each_safe(pos, n, head) \ + for (pos = (head)->next, n = pos->next; pos != (head); \ + pos = n, n = pos->next) +#endif + +/* + * list_for_each_entry() showed up in 2.4.20, but it may be backported so we + * just check for its existence. + */ +#ifndef list_for_each_entry +# define list_for_each_entry(pos, head, member) \ + for (pos = list_entry((head)->next, typeof(*pos), member); \ + &pos->member != (head); \ + pos = list_entry(pos->member.next, typeof(*pos), member)) +#endif + +#endif /* __COMPAT_LIST_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/compat_mm.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/compat_mm.h --- open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/compat_mm.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/compat_mm.h 2008-10-13 08:01:40.000000000 +0100 @@ -0,0 +1,134 @@ +/********************************************************* + * Copyright (C) 2002 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +#ifndef __COMPAT_MM_H__ +# define __COMPAT_MM_H__ + + +#include <linux/mm.h> + + +/* The get_page() API appeared in 2.3.7 --hpreg */ +/* Sometime during development it became function instead of macro --petr */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 0) && !defined(get_page) +# define get_page(_page) atomic_inc(&(_page)->count) +/* The __free_page() API is exported in 2.1.67 --hpreg */ +# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 1, 67) +# define put_page __free_page +# else +# include "compat_page.h" + +# define page_to_phys(_page) (page_to_pfn(_page) << PAGE_SHIFT) +# define put_page(_page) free_page(page_to_phys(_page)) +# endif +#endif + + +/* page_count() is 2.4.0 invention. Unfortunately unavailable in some RedHat + * kernels (for example 2.4.21-4-RHEL3). */ +/* It is function since 2.6.0, and hopefully RedHat will not play silly games + * with mm_inline.h again... */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0) && !defined(page_count) +# define page_count(page) atomic_read(&(page)->count) +#endif + + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 0) +# define compat_vm_pgoff(vma) ((vma)->vm_offset >> PAGE_SHIFT) + +static inline unsigned long compat_do_mmap_pgoff(struct file *file, unsigned long addr, + unsigned long len, unsigned long prot, + unsigned long flag, unsigned long pgoff) +{ + unsigned long ret = -EINVAL; + + if (pgoff < 1 << (32 - PAGE_SHIFT)) { + ret = do_mmap(file, addr, len, prot, flag, pgoff << PAGE_SHIFT); + } + return ret; +} + +#else +# define compat_vm_pgoff(vma) (vma)->vm_pgoff +# ifdef VMW_SKAS_MMAP +# define compat_do_mmap_pgoff(f, a, l, p, g, o) \ + do_mmap_pgoff(current->mm, f, a, l, p, g, o) +# else +# define compat_do_mmap_pgoff(f, a, l, p, g, o) \ + do_mmap_pgoff(f, a, l, p, g, o) +# endif +#endif + + +/* 2.2.x uses 0 instead of some define */ +#ifndef NOPAGE_SIGBUS +#define NOPAGE_SIGBUS (0) +#endif + + +/* 2.2.x does not have HIGHMEM support */ +#ifndef GFP_HIGHUSER +#define GFP_HIGHUSER (GFP_USER) +#endif + + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 0) + +#include "compat_page.h" + +static inline struct page * alloc_pages(unsigned int gfp_mask, unsigned int order) +{ + unsigned long addr; + + addr = __get_free_pages(gfp_mask, order); + if (!addr) { + return NULL; + } + return virt_to_page(addr); +} +#define alloc_page(gfp_mask) alloc_pages(gfp_mask, 0) + +#endif + +/* + * In 2.4.14, the logic behind the UnlockPage macro was moved to the + * unlock_page() function. Later (in 2.5.12), the UnlockPage macro was removed + * altogether, and nowadays everyone uses unlock_page(). + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 14) +#define compat_unlock_page(page) UnlockPage(page) +#else +#define compat_unlock_page(page) unlock_page(page) +#endif + +/* + * In 2.4.10, vmtruncate was changed from returning void to returning int. + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 10) +#define compat_vmtruncate(inode, size) \ +({ \ + int result = 0; \ + vmtruncate(inode, size); \ + result; \ +}) +#else +#define compat_vmtruncate(inode, size) vmtruncate(inode, size) +#endif + + +#endif /* __COMPAT_MM_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/compat_module.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/compat_module.h --- open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/compat_module.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/compat_module.h 2008-10-13 08:01:40.000000000 +0100 @@ -0,0 +1,72 @@ +/********************************************************* + * Copyright (C) 2007 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * compat_module.h -- + */ + +#ifndef __COMPAT_MODULE_H__ +# define __COMPAT_MODULE_H__ + + +#include <linux/module.h> + + +/* + * Modules wishing to use the GPL license are required to include a + * MODULE_LICENSE definition in their module source as of 2.4.10. + */ +#ifndef MODULE_LICENSE +#define MODULE_LICENSE(license) +#endif + +/* + * To make use of our own home-brewed MODULE_INFO, we need macros to + * concatenate two expressions to "__mod_", and and to convert an + * expression into a string. I'm sure we've got these in our codebase, + * but I'd rather not introduce such a dependency in a compat header. + */ +#ifndef __module_cat +#define __module_cat_1(a, b) __mod_ ## a ## b +#define __module_cat(a, b) __module_cat_1(a, b) +#endif + +#ifndef __stringify +#define __stringify_1(x) #x +#define __stringify(x) __stringify_1(x) +#endif + +/* + * MODULE_INFO was born in 2.5.69. + */ +#ifndef MODULE_INFO +#define MODULE_INFO(tag, info) \ +static const char __module_cat(tag, __LINE__)[] \ + __attribute__((section(".modinfo"), unused)) = __stringify(tag) "=" info +#endif + +/* + * MODULE_VERSION was born in 2.6.4. The earlier form appends a long "\0xxx" + * string to the module's version, but that was removed in 2.6.10, so we'll + * ignore it in our wrapper. + */ +#ifndef MODULE_VERSION +#define MODULE_VERSION(_version) MODULE_INFO(version, _version) +#endif + +#endif /* __COMPAT_MODULE_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/compat_namei.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/compat_namei.h --- open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/compat_namei.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/compat_namei.h 2008-10-13 08:01:40.000000000 +0100 @@ -0,0 +1,57 @@ +/********************************************************* + * Copyright (C) 2006 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +#ifndef __COMPAT_NAMEI_H__ +# define __COMPAT_NAMEI_H__ + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 18) +#include <linux/namei.h> +#endif + +/* + * In 2.6.25-rc2, dentry and mount objects were removed from the nameidata + * struct. They were both replaced with a struct path. + */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25) +#define compat_vmw_nd_to_dentry(nd) (nd).path.dentry +#else +#define compat_vmw_nd_to_dentry(nd) (nd).dentry +#endif + +/* In 2.6.25-rc2, path_release(&nd) was replaced with path_put(&nd.path). */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25) +#define compat_path_release(nd) path_put(&(nd)->path) +#else +#define compat_path_release(nd) path_release(nd) +#endif + +/* path_lookup was exported in 2.4.25 */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 25) +#define compat_path_lookup(path, flags, nd) path_lookup(path, flags, nd) +#else +#define compat_path_lookup(path, flags, nd) \ + ({ \ + int ret = 0; \ + if (path_init(path, flags, nd)) { \ + ret = path_walk(path, nd); \ + } \ + ret; \ + }) +#endif + +#endif /* __COMPAT_NAMEI_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/compat_page.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/compat_page.h --- open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/compat_page.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/compat_page.h 2008-10-13 08:01:40.000000000 +0100 @@ -0,0 +1,75 @@ +/********************************************************* + * Copyright (C) 2002 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +#ifndef __COMPAT_PAGE_H__ +# define __COMPAT_PAGE_H__ + + +#include <linux/mm.h> +#include <asm/page.h> + + +/* The pfn_to_page() API appeared in 2.5.14 and changed to function during 2.6.x */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0) && !defined(pfn_to_page) +# define pfn_to_page(_pfn) (mem_map + (_pfn)) +# define page_to_pfn(_page) ((_page) - mem_map) +#endif + + +/* The virt_to_page() API appeared in 2.4.0 --hpreg */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 0) && !defined(virt_to_page) +# define virt_to_page(_kvAddr) pfn_to_page(MAP_NR(_kvAddr)) +#endif + + +/* + * The get_order() API appeared at some point in 2.3.x, and was then backported + * in 2.2.17-21mdk and in the stock 2.2.18. Because we can only detect its + * definition through makefile tricks, we provide our own for now --hpreg + */ +static inline int +compat_get_order(unsigned long size) // IN +{ + int order; + + size = (size - 1) >> (PAGE_SHIFT - 1); + order = -1; + do { + size >>= 1; + order++; + } while (size); + + return order; +} + +/* + * BUG() was added to <asm/page.h> in 2.2.18, and was moved to <asm/bug.h> + * in 2.5.58. + * + * XXX: Technically, this belongs in some sort of "compat_asm_page.h" file, but + * since our compatibility wrappers don't distinguish between <asm/xxx.h> and + * <linux/xxx.h>, putting it here is reasonable. + */ +#ifndef BUG +#define BUG() do { \ + printk("kernel BUG at %s:%d!\n", __FILE__, __LINE__); \ + __asm__ __volatile__(".byte 0x0f,0x0b"); \ +} while (0) +#endif + +#endif /* __COMPAT_PAGE_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/compat_sched.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/compat_sched.h --- open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/compat_sched.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/compat_sched.h 2008-10-13 08:01:40.000000000 +0100 @@ -0,0 +1,291 @@ +/********************************************************* + * Copyright (C) 2002 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +#ifndef __COMPAT_SCHED_H__ +# define __COMPAT_SCHED_H__ + + +#include <linux/sched.h> + +/* CLONE_KERNEL available in 2.5.35 and higher. */ +#ifndef CLONE_KERNEL +#define CLONE_KERNEL CLONE_FILES | CLONE_FS | CLONE_SIGHAND +#endif + +/* TASK_COMM_LEN become available in 2.6.11. */ +#ifndef TASK_COMM_LEN +#define TASK_COMM_LEN 16 +#endif + +/* The capable() API appeared in 2.1.92 --hpreg */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 1, 92) +# define capable(_capability) suser() +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 2, 0) +# define need_resched() need_resched +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 3) +# define need_resched() (current->need_resched) +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 3) +# define cond_resched() (need_resched() ? schedule() : (void) 0) +#endif + +/* Oh well. We need yield... Happy us! */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 20) +# ifdef __x86_64__ +# define compat_yield() there_is_nothing_like_yield() +# else +# include <linux/unistd.h> +# include <linux/kernel.h> + +/* + * Used by _syscallX macros. Note that this is global variable, so + * do not rely on its contents too much. As exit() is only function + * we use, and we never check return value from exit(), we have + * no problem... + */ +extern int errno; + +/* + * compat_exit() provides an access to the exit() function. It must + * be named compat_exit(), as exit() (with different signature) is + * provided by x86-64, arm and other (but not by i386). + */ +# define __NR_compat_yield __NR_sched_yield +static inline _syscall0(int, compat_yield); +# endif +#else +# define compat_yield() yield() +#endif + + +/* + * Since 2.5.34 there are two methods to enumerate tasks: + * for_each_process(p) { ... } which enumerates only tasks and + * do_each_thread(g,t) { ... } while_each_thread(g,t) which enumerates + * also threads even if they share same pid. + */ +#ifndef for_each_process +# define for_each_process(p) for_each_task(p) +#endif + +#ifndef do_each_thread +# define do_each_thread(g, t) for_each_task(g) { t = g; do +# define while_each_thread(g, t) while (0) } +#endif + + +/* + * Lock for signal mask is moving target... + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 40) && defined(CLONE_PID) +/* 2.4.x without NPTL patches or early 2.5.x */ +#define compat_sigmask_lock sigmask_lock +#define compat_dequeue_signal_current(siginfo_ptr) \ + dequeue_signal(¤t->blocked, (siginfo_ptr)) +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 60) && !defined(INIT_SIGHAND) +/* RedHat's 2.4.x with first version of NPTL support, or 2.5.40 to 2.5.59 */ +#define compat_sigmask_lock sig->siglock +#define compat_dequeue_signal_current(siginfo_ptr) \ + dequeue_signal(¤t->blocked, (siginfo_ptr)) +#else +/* RedHat's 2.4.x with second version of NPTL support, or 2.5.60+. */ +#define compat_sigmask_lock sighand->siglock +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0) +#define compat_dequeue_signal_current(siginfo_ptr) \ + dequeue_signal(¤t->blocked, (siginfo_ptr)) +#else +#define compat_dequeue_signal_current(siginfo_ptr) \ + dequeue_signal(current, ¤t->blocked, (siginfo_ptr)) +#endif +#endif + +/* + * recalc_sigpending() had task argument in the past + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 29) && defined(CLONE_PID) +/* 2.4.x without NPTL patches or early 2.5.x */ +#define compat_recalc_sigpending() recalc_sigpending(current) +#else +/* RedHat's 2.4.x with NPTL support, or 2.5.29+ */ +#define compat_recalc_sigpending() recalc_sigpending() +#endif + + +/* + * reparent_to_init() was introduced in 2.4.8. In 2.5.38 (or possibly + * earlier, but later than 2.5.31) a call to it was added into + * daemonize(), so compat_daemonize no longer needs to call it. + * + * In 2.4.x kernels reparent_to_init() forgets to do correct refcounting + * on current->user. It is better to count one too many than one too few... + */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 8) && LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 38) +#define compat_reparent_to_init() do { \ + reparent_to_init(); \ + atomic_inc(¤t->user->__count); \ + } while (0) +#else +#define compat_reparent_to_init() do {} while (0) +#endif + + +/* + * daemonize appeared in 2.2.18. Except 2.2.17-4-RH7.0, which has it too. + * Fortunately 2.2.17-4-RH7.0 uses versioned symbols, so we can check + * its existence with defined(). + */ +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 2, 18)) && !defined(daemonize) +static inline void daemonize(void) { + struct fs_struct *fs; + + exit_mm(current); + current->session = 1; + current->pgrp = 1; + exit_fs(current); + fs = init_task.fs; + current->fs = fs; + atomic_inc(&fs->count); +} +#endif + + +/* + * flush_signals acquires sighand->siglock since 2.5.61... Verify RH's kernels! + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 61) +#define compat_flush_signals(task) do { \ + spin_lock_irq(&task->compat_sigmask_lock); \ + flush_signals(task); \ + spin_unlock_irq(&task->compat_sigmask_lock); \ + } while (0) +#else +#define compat_flush_signals(task) flush_signals(task) +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 61) +#define compat_allow_signal(signr) do { \ + spin_lock_irq(¤t->compat_sigmask_lock); \ + sigdelset(¤t->blocked, signr); \ + compat_recalc_sigpending(); \ + spin_unlock_irq(¤t->compat_sigmask_lock); \ + } while (0) +#else +#define compat_allow_signal(signr) allow_signal(signr) +#endif + +/* + * daemonize can set process name since 2.5.61. Prior to 2.5.61, daemonize + * didn't block signals on our behalf. + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 61) +#define compat_daemonize(x...) \ +({ \ + /* Beware! No snprintf here, so verify arguments! */ \ + sprintf(current->comm, x); \ + \ + /* Block all signals. */ \ + spin_lock_irq(¤t->compat_sigmask_lock); \ + sigfillset(¤t->blocked); \ + compat_recalc_sigpending(); \ + spin_unlock_irq(¤t->compat_sigmask_lock); \ + compat_flush_signals(current); \ + \ + daemonize(); \ + compat_reparent_to_init(); \ +}) +#else +#define compat_daemonize(x...) daemonize(x) +#endif + + +/* + * set priority for specified thread. Exists on 2.6.x kernels and some + * 2.4.x vendor's kernels. + */ +#if defined(VMW_HAVE_SET_USER_NICE) +#define compat_set_user_nice(task, n) set_user_nice((task), (n)) +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 0) +#define compat_set_user_nice(task, n) do { (task)->priority = 20 - (n); } while (0) +#elif !defined(VMW_HAVE_SET_USER_NICE) +#define compat_set_user_nice(task, n) do { (task)->nice = (n); } while (0) +#endif + +/* + * try to freeze a process. For kernels 2.6.11 or newer, we know how to choose + * the interface. The problem is that the oldest interface, introduced in + * 2.5.18, was backported to 2.4.x kernels. So if we're older than 2.6.11, + * we'll decide what to do based on whether or not swsusp was configured + * for the kernel. For kernels 2.6.20 and newer, we'll also need to include + * freezer.h since the try_to_freeze definition was pulled out of sched.h. + */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 20) +#include <linux/freezer.h> +#endif +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 13) || defined(VMW_TL10S64_WORKAROUND) +#define compat_try_to_freeze() try_to_freeze() +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 11) +#define compat_try_to_freeze() try_to_freeze(PF_FREEZE) +#elif defined(CONFIG_SOFTWARE_SUSPEND) || defined(CONFIG_SOFTWARE_SUSPEND2) +#include "compat_mm.h" +#include <linux/errno.h> +#include <linux/suspend.h> +static inline int compat_try_to_freeze(void) { + if (current->flags & PF_FREEZE) { + refrigerator(PF_FREEZE); + return 1; + } else { + return 0; + } +} +#else +static inline int compat_try_to_freeze(void) { return 0; } +#endif + +/* + * As of 2.6.23-rc1, kernel threads are no longer freezable by + * default. Instead, kernel threads that need to be frozen must opt-in + * by calling set_freezable() as soon as the thread is created. + */ + +#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 22) +#define compat_set_freezable() do { set_freezable(); } while (0) +#else +#define compat_set_freezable() do {} while (0) +#endif + +/* + * Since 2.6.27-rc2 kill_proc() is gone... Replacement (GPL-only!) + * API is available since 2.6.19. Use them from 2.6.27-rc1 up. + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 27) +typedef int compat_pid; +#define compat_find_get_pid(pid) (pid) +#define compat_put_pid(pid) do { } while (0) +#define compat_kill_pid(pid, sig, flag) kill_proc(pid, sig, flag) +#else +typedef struct pid * compat_pid; +#define compat_find_get_pid(pid) find_get_pid(pid) +#define compat_put_pid(pid) put_pid(pid) +#define compat_kill_pid(pid, sig, flag) kill_pid(pid, sig, flag) +#endif + + +#endif /* __COMPAT_SCHED_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/compat_semaphore.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/compat_semaphore.h --- open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/compat_semaphore.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/compat_semaphore.h 2008-10-13 08:01:40.000000000 +0100 @@ -0,0 +1,49 @@ +/********************************************************* + * Copyright (C) 2002 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +#ifndef __COMPAT_SEMAPHORE_H__ +# define __COMPAT_SEMAPHORE_H__ + + +/* <= 2.6.25 have asm only, 2.6.26 has both, and 2.6.27-rc2+ has linux only. */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 27) +# include <asm/semaphore.h> +#else +# include <linux/semaphore.h> +#endif + + +/* +* The init_MUTEX_LOCKED() API appeared in 2.2.18, and is also in +* 2.2.17-21mdk --hpreg +*/ + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 2, 18) + #ifndef init_MUTEX_LOCKED + #define init_MUTEX_LOCKED(_sem) *(_sem) = MUTEX_LOCKED + #endif + #ifndef DECLARE_MUTEX + #define DECLARE_MUTEX(name) struct semaphore name = MUTEX + #endif + #ifndef DECLARE_MUTEX_LOCKED + #define DECLARE_MUTEX_LOCKED(name) struct semaphore name = MUTEX_LOCKED + #endif +#endif + + +#endif /* __COMPAT_SEMAPHORE_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/compat_slab.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/compat_slab.h --- open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/compat_slab.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/compat_slab.h 2008-10-13 08:01:40.000000000 +0100 @@ -0,0 +1,85 @@ +/********************************************************* + * Copyright (C) 2005 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +#ifndef __COMPAT_SLAB_H__ +# define __COMPAT_SLAB_H__ + + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 2, 0) +# include <linux/slab.h> +#else +# include <linux/malloc.h> +#endif + +/* + * Before 2.6.20, kmem_cache_t was the accepted way to refer to a kmem_cache + * structure. Prior to 2.6.15, this structure was called kmem_cache_s, and + * afterwards it was renamed to kmem_cache. Here we keep things simple and use + * the accepted typedef until it became deprecated, at which point we switch + * over to the kmem_cache name. + */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 20) +# define compat_kmem_cache struct kmem_cache +#else +# define compat_kmem_cache kmem_cache_t +#endif + +/* + * Up to 2.6.22 kmem_cache_create has 6 arguments - name, size, alignment, flags, + * constructor, and destructor. Then for some time kernel was asserting that + * destructor is NULL, and since 2.6.23-pre1 kmem_cache_create takes only 5 + * arguments - destructor is gone. + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 22) || defined(VMW_KMEMCR_HAS_DTOR) +#define compat_kmem_cache_create(name, size, align, flags, ctor) \ + kmem_cache_create(name, size, align, flags, ctor, NULL) +#else +#define compat_kmem_cache_create(name, size, align, flags, ctor) \ + kmem_cache_create(name, size, align, flags, ctor) +#endif + +/* + * Up to 2.6.23 kmem_cache constructor has three arguments - pointer to block to + * prepare (aka "this"), from which cache it came, and some unused flags. After + * 2.6.23 flags were removed, and order of "this" and cache parameters was swapped... + * Since 2.6.27-rc2 everything is different again, and ctor has only one argument. + * + * HAS_3_ARGS has precedence over HAS_2_ARGS if both are defined. + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 23) && !defined(VMW_KMEMCR_CTOR_HAS_3_ARGS) +# define VMW_KMEMCR_CTOR_HAS_3_ARGS +#endif +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26) && !defined(VMW_KMEMCR_CTOR_HAS_2_ARGS) +# define VMW_KMEMCR_CTOR_HAS_2_ARGS +#endif + +#if defined(VMW_KMEMCR_CTOR_HAS_3_ARGS) +typedef void compat_kmem_cache_ctor(void *, compat_kmem_cache *, unsigned long); +#define COMPAT_KMEM_CACHE_CTOR_ARGS(arg) void *arg, \ + compat_kmem_cache *cache, \ + unsigned long flags +#elif defined(VMW_KMEMCR_CTOR_HAS_2_ARGS) +typedef void compat_kmem_cache_ctor(compat_kmem_cache *, void *); +#define COMPAT_KMEM_CACHE_CTOR_ARGS(arg) compat_kmem_cache *cache, \ + void *arg +#else +typedef void compat_kmem_cache_ctor(void *); +#define COMPAT_KMEM_CACHE_CTOR_ARGS(arg) void *arg +#endif + +#endif /* __COMPAT_SLAB_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/compat_sock.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/compat_sock.h --- open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/compat_sock.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/compat_sock.h 2008-10-13 08:01:40.000000000 +0100 @@ -0,0 +1,210 @@ +/********************************************************* + * Copyright (C) 2003 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +#ifndef __COMPAT_SOCK_H__ +# define __COMPAT_SOCK_H__ + +#include <linux/stddef.h> /* for NULL */ +#include <net/sock.h> + + +/* + * Between 2.5.70 and 2.5.71 all sock members were renamed from XXX to sk_XXX. + * + * VMW_HAVE_SK_WMEM_ALLOC is defined in module Makefile if kernel's struct sock + * has sk_wmem_alloc member. See vmnet's Makefile.kernel for details. + * It also means that all modules including this file should do + * + * EXTRA_CFLAGS += $(call vm_check_build, $(SRCROOT)/socket.c, -DVMW_HAVE_SK_WMEM_ALLOC, ) + * + * in their Makefiles. + */ +#ifndef VMW_HAVE_SK_WMEM_ALLOC +# define sk_wmem_alloc wmem_alloc +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 71) +# define compat_sk_backlog_rcv backlog_rcv +# define compat_sk_destruct destruct +# define compat_sk_shutdown shutdown +# define compat_sk_receive_queue receive_queue +# define compat_sk_sleep sleep +# define compat_sk_err err +# define compat_sk_state_change state_change +# define compat_sk_data_ready data_ready +# define compat_sk_write_space write_space +# define compat_sk_error_report error_report +# define compat_sk_type type +# define compat_sk_refcnt refcnt +# define compat_sk_state state +# define compat_sk_error_report error_report +# define compat_sk_socket socket +# define compat_sk_ack_backlog ack_backlog +# define compat_sk_max_ack_backlog max_ack_backlog +#else +# define compat_sk_backlog_rcv sk_backlog_rcv +# define compat_sk_destruct sk_destruct +# define compat_sk_shutdown sk_shutdown +# define compat_sk_receive_queue sk_receive_queue +# define compat_sk_sleep sk_sleep +# define compat_sk_err sk_err +# define compat_sk_state_change sk_state_change +# define compat_sk_data_ready sk_data_ready +# define compat_sk_write_space sk_write_space +# define compat_sk_error_report sk_error_report +# define compat_sk_type sk_type +# define compat_sk_refcnt sk_refcnt +# define compat_sk_state sk_state +# define compat_sk_error_report sk_error_report +# define compat_sk_socket sk_socket +# define compat_sk_ack_backlog sk_ack_backlog +# define compat_sk_max_ack_backlog sk_max_ack_backlog +#endif + + +/* + * Prior to 2.5.65, struct sock contained individual fields for certain + * socket flags including SOCK_DONE. Between 2.5.65 and 2.5.71 these were + * replaced with a bitmask but the generic bit test functions were used. + * In 2.5.71, these were replaced with socket specific functions. + */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 71) +# define compat_sock_test_done(sk) sock_flag(sk, SOCK_DONE) +# define compat_sock_set_done(sk) sock_set_flag(sk, SOCK_DONE) +# define compat_sock_reset_done(sk) sock_reset_flag(sk, SOCK_DONE) +#elif LINUX_VERISON_CODE >= KERNEL_VERSION(2, 5, 65) +# define compat_sock_test_done(sk) test_bit(SOCK_DONE, &(sk)->flags) +# define compat_sock_set_done(sk) __set_bit(SOCK_DONE, &(sk)->flags) +# define compat_sock_reset_done(sk) __clear_bit(SOCK_DONE, &(sk)->flags) +#else +# define compat_sock_test_done(sk) (sk)->done +# define compat_sock_set_done(sk) ((sk)->done = 1) +# define compat_sock_reset_done(sk) ((sk)->done = 0) +#endif + + +/* + * Prior to 2.6.24, there was no sock network namespace member. In 2.6.26, it + * was hidden behind accessor functions so that its behavior could vary + * depending on the value of CONFIG_NET_NS. + */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26) +# define compat_sock_net(sk) sock_net(sk) +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24) +# define compat_sock_net(sk) sk->sk_net +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 42) +# define compat_sock_owned_by_user(sk) ((sk)->lock.users != 0) +#else +# define compat_sock_owned_by_user(sk) sock_owned_by_user(sk) +#endif + +/* + * Up until 2.4.21 for the 2.4 series and 2.5.60 for the 2.5 series, + * sk_filter() calls were protected with CONFIG_FILTER. Wrapping our compat + * definition in a similar check allows us to build on those kernels. + * + */ +#ifdef CONFIG_FILTER +/* + * Unfortunately backports for certain kernels require the use of an autoconf + * program to check the interface for sk_filter(). + */ +# ifndef VMW_HAVE_NEW_SKFILTER +/* + * Up until 2.4.21 for the 2.4 series and 2.5.60 for the 2.5 series, + * callers to sk->filter were responsible for ensuring that the filter + * was not NULL. + * Additionally, the new version of sk_filter returns 0 or -EPERM on error + * while the old function returned 0 or 1. Return -EPERM here as well to + * be consistent. + */ +# define compat_sk_filter(sk, skb, needlock) \ + ({ \ + int rc = 0; \ + \ + if ((sk)->filter) { \ + rc = sk_filter(skb, (sk)->filter); \ + if (rc) { \ + rc = -EPERM; \ + } \ + } \ + \ + rc; \ + }) +# else +# define compat_sk_filter(sk, skb, needlock) sk_filter(sk, skb, needlock) +# endif +#else +# define compat_sk_filter(sk, skb, needlock) 0 +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 16) +/* Taken from 2.6.16's sock.h and modified for macro. */ +# define compat_sk_receive_skb(sk, skb, nested) \ + ({ \ + int rc = NET_RX_SUCCESS; \ + \ + if (compat_sk_filter(sk, skb, 0)) { \ + kfree_skb(skb); \ + sock_put(sk); \ + } else { \ + skb->dev = NULL; \ + bh_lock_sock(sk); \ + if (!compat_sock_owned_by_user(sk)) { \ + rc = (sk)->compat_sk_backlog_rcv(sk, skb); \ + } else { \ + sk_add_backlog(sk, skb); \ + } \ + bh_unlock_sock(sk); \ + sock_put(sk); \ + } \ + \ + rc; \ + }) +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) +# define compat_sk_receive_skb(sk, skb, nested) sk_receive_skb(sk, skb) +#else +# define compat_sk_receive_skb(sk, skb, nested) sk_receive_skb(sk, skb, nested) +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 72) +/* + * Before 2.5.72, the helper socket functions for hlist management did not + * exist, so we use the sklist_ functions instead. These are not ideal since + * they grab a system-wide sklist lock despite not needing it since we provide + * our own list. + */ +#define compat_sk_next next /* for when we find out it became sk_next */ +# define compat_sklist_table struct sock * +/* This isn't really used in the iterator, but we need something. */ +# define compat_sklist_table_entry struct sock +# define compat_sk_for_each(sk, node, list) \ + for (sk = *(list), node = NULL; sk != NULL; sk = (sk)->compat_sk_next) +# define compat_sk_add_node(sk, list) sklist_insert_socket(list, sk) +# define compat_sk_del_node_init(sk, list) sklist_remove_socket(list, sk) +#else +# define compat_sklist_table struct hlist_head +# define compat_sklist_table_entry struct hlist_node +# define compat_sk_for_each(sk, node, list) sk_for_each(sk, node, list) +# define compat_sk_add_node(sk, list) sk_add_node(sk, list) +# define compat_sk_del_node_init(sk, list) sk_del_node_init(sk) +#endif + +#endif /* __COMPAT_SOCK_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/compat_spinlock.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/compat_spinlock.h --- open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/compat_spinlock.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/compat_spinlock.h 2008-10-13 08:01:40.000000000 +0100 @@ -0,0 +1,68 @@ +/********************************************************* + * Copyright (C) 2005 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +#ifndef __COMPAT_SPINLOCK_H__ +# define __COMPAT_SPINLOCK_H__ + + +/* + * The spin_lock() API appeared in 2.1.25 in asm/smp_lock.h + * It moved in 2.1.30 to asm/spinlock.h + * It moved again in 2.3.18 to linux/spinlock.h + * + * --hpreg + */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 3, 18) +# include <linux/spinlock.h> +#else +# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 1, 30) +# include <asm/spinlock.h> +# else +typedef struct {} spinlock_t; +# define spin_lock_init(lock) +# define spin_lock(lock) +# define spin_unlock(lock) +# define spin_lock_irqsave(lock, flags) do { \ + save_flags(flags); \ + cli(); \ + spin_lock(lock); \ + } while (0) +# define spin_unlock_irqrestore(lock, flags) do { \ + spin_unlock(lock); \ + restore_flags(flags); \ + } while (0) +# endif +#endif + + +/* + * Preempt support was added during 2.5.x development cycle, and later + * it was backported to 2.4.x. In 2.4.x backport these definitions + * live in linux/spinlock.h, that's why we put them here (in 2.6.x they + * are defined in linux/preempt.h which is included by linux/spinlock.h). + */ +#ifdef CONFIG_PREEMPT +#define compat_preempt_disable() preempt_disable() +#define compat_preempt_enable() preempt_enable() +#else +#define compat_preempt_disable() do { } while (0) +#define compat_preempt_enable() do { } while (0) +#endif + + +#endif /* __COMPAT_SPINLOCK_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/compat_statfs.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/compat_statfs.h --- open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/compat_statfs.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/compat_statfs.h 2008-10-13 08:01:40.000000000 +0100 @@ -0,0 +1,32 @@ +/********************************************************* + * Copyright (C) 2006 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +#ifndef __COMPAT_STATFS_H__ +# define __COMPAT_STATFS_H__ + +/* vfs.h simply include statfs.h, but it knows what directory statfs.h is in. */ +#include <linux/vfs.h> + +/* 2.5.74 renamed struct statfs to kstatfs. */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 74) +#define compat_kstatfs kstatfs +#else +#define compat_kstatfs statfs +#endif + +#endif /* __COMPAT_STATFS_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/compat_string.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/compat_string.h --- open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/compat_string.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/compat_string.h 2008-10-13 08:01:40.000000000 +0100 @@ -0,0 +1,42 @@ +/********************************************************* + * Copyright (C) 2007 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +#ifndef __COMPAT_STRING_H__ +# define __COMPAT_STRING_H__ + +#include <linux/string.h> + +/* + * kstrdup was born in 2.6.13. This implementation is almost identical to the + * one found there. + */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 13) +#define compat_kstrdup(s, gfp) kstrdup(s, gfp) +#else +#define compat_kstrdup(s, gfp) \ +({ \ + size_t len; \ + char *buf; \ + len = strlen(s) + 1; \ + buf = kmalloc(len, gfp); \ + memcpy(buf, s, len); \ + buf; \ +}) +#endif + +#endif /* __COMPAT_STRING_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/compat_uaccess.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/compat_uaccess.h --- open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/compat_uaccess.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/compat_uaccess.h 2008-10-13 08:01:40.000000000 +0100 @@ -0,0 +1,79 @@ +/********************************************************* + * Copyright (C) 2002 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +#ifndef __COMPAT_UACCESS_H__ +# define __COMPAT_UACCESS_H__ + + +/* User space access functions moved in 2.1.7 to asm/uaccess.h --hpreg */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 1, 7) +# include <asm/uaccess.h> +#else +# include <asm/segment.h> +#endif + + +/* get_user() API modified in 2.1.4 to take 2 arguments --hpreg */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 1, 4) +# define compat_get_user get_user +#else +/* + * We assign 0 to the variable in case of failure to prevent "`_var' might be + * used uninitialized in this function" compiler warnings. I think it is OK, + * because the hardware-based version in newer kernels probably has the same + * semantics and does not guarantee that the value of _var will not be + * modified, should the access fail --hpreg + */ +# define compat_get_user(_var, _uvAddr) ({ \ + int _status; \ + \ + _status = verify_area(VERIFY_READ, _uvAddr, sizeof(*(_uvAddr))); \ + if (_status == 0) { \ + (_var) = get_user(_uvAddr); \ + } else { \ + (_var) = 0; \ + } \ + _status; \ +}) +#endif + + +/* + * The copy_from_user() API appeared in 2.1.4 + * + * The emulation is not perfect here, but it is conservative: on failure, we + * always return the total size, instead of the potentially smaller faulty + * size --hpreg + * + * Since 2.5.55 copy_from_user() is no longer macro. + */ +#if !defined(copy_from_user) && LINUX_VERSION_CODE < KERNEL_VERSION(2, 2, 0) +# define copy_from_user(_to, _from, _size) ( \ + verify_area(VERIFY_READ, _from, _size) \ + ? (_size) \ + : (memcpy_fromfs(_to, _from, _size), 0) \ +) +# define copy_to_user(_to, _from, _size) ( \ + verify_area(VERIFY_WRITE, _to, _size) \ + ? (_size) \ + : (memcpy_tofs(_to, _from, _size), 0) \ +) +#endif + + +#endif /* __COMPAT_UACCESS_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/compat_version.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/compat_version.h --- open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/compat_version.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/compat_version.h 2008-10-13 08:01:40.000000000 +0100 @@ -0,0 +1,121 @@ +/********************************************************* + * Copyright (C) 1998 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +#ifndef __COMPAT_VERSION_H__ +# define __COMPAT_VERSION_H__ + +#define INCLUDE_ALLOW_VMMON +#define INCLUDE_ALLOW_MODULE +#define INCLUDE_ALLOW_VMCORE +#define INCLUDE_ALLOW_VMNIXMOD +#define INCLUDE_ALLOW_DISTRIBUTE +#include "includeCheck.h" + + +#ifndef __linux__ +# error "linux-version.h" +#endif + + +#include <linux/version.h> + +/* Appeared in 2.1.90 --hpreg */ +#ifndef KERNEL_VERSION +# define KERNEL_VERSION(a, b, c) (((a) << 16) + ((b) << 8) + (c)) +#endif + + +/* + * Distinguish relevant classes of Linux kernels. + * + * The convention is that version X defines all + * the KERNEL_Y symbols where Y <= X. + * + * XXX Do not add more definitions here. This way of doing things does not + * scale, and we are going to phase it out soon --hpreg + */ + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 1, 0) +# define KERNEL_2_1 +#endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 2, 0) +# define KERNEL_2_2 +#endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 3, 1) +# define KERNEL_2_3_1 +#endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 3, 15) +/* new networking */ +# define KERNEL_2_3_15 +#endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 3, 25) +/* new procfs */ +# define KERNEL_2_3_25 +#endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 3, 29) +/* even newer procfs */ +# define KERNEL_2_3_29 +#endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 3, 43) +/* softnet changes */ +# define KERNEL_2_3_43 +#endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 3, 47) +/* more softnet changes */ +# define KERNEL_2_3_47 +#endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 3, 99) +/* name in netdevice struct is array and not pointer */ +# define KERNEL_2_3_99 +#endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 0) +/* New 'owner' member at the beginning of struct file_operations */ +# define KERNEL_2_4_0 +#endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 8) +/* New netif_rx_ni() --hpreg */ +# define KERNEL_2_4_8 +#endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 22) +/* New vmap() */ +# define KERNEL_2_4_22 +#endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 2) +/* New kdev_t, major()/minor() API --hpreg */ +# define KERNEL_2_5_2 +#endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 5) +/* New sk_alloc(), pte_offset_map()/pte_unmap() --hpreg */ +# define KERNEL_2_5_5 +#endif + + +#endif /* __COMPAT_VERSION_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/compat_wait.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/compat_wait.h --- open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/compat_wait.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/compat_wait.h 2008-10-13 08:01:40.000000000 +0100 @@ -0,0 +1,225 @@ +/********************************************************* + * Copyright (C) 2002 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +#ifndef __COMPAT_WAIT_H__ +# define __COMPAT_WAIT_H__ + + +#include <linux/wait.h> +#include <linux/poll.h> +#include <linux/file.h> + +#include "compat_file.h" + + +/* + * The DECLARE_WAITQUEUE() API appeared in 2.3.1 + * It was back ported in 2.2.18 + * + * --hpreg + */ + +#ifndef DECLARE_WAITQUEUE + +typedef struct wait_queue *wait_queue_head_t; +# define init_waitqueue_head(_headPtr) *(_headPtr) = NULL +# define DECLARE_WAITQUEUE(_var, _task) \ + struct wait_queue _var = {_task, NULL, } + +typedef struct wait_queue wait_queue_t; +# define init_waitqueue_entry(_wait, _task) ((_wait)->task = (_task)) + +#endif + +/* + * The 'struct poll_wqueues' appeared in 2.5.48, when global + * /dev/epoll interface was added. It was backported to the + * 2.4.20-wolk4.0s. + */ + +#ifdef VMW_HAVE_EPOLL // { +#define compat_poll_wqueues struct poll_wqueues +#else // } { +#define compat_poll_wqueues poll_table +#endif // } + +#ifdef VMW_HAVE_EPOLL // { + +/* If prototype does not match, build will abort here */ +extern void poll_initwait(compat_poll_wqueues *); + +#define compat_poll_initwait(wait, table) ( \ + poll_initwait((table)), \ + (wait) = &(table)->pt \ +) + +#define compat_poll_freewait(wait, table) ( \ + poll_freewait((table)) \ +) + +#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 0) // { + +/* If prototype does not match, build will abort here */ +extern void poll_initwait(compat_poll_wqueues *); + +#define compat_poll_initwait(wait, table) ( \ + (wait) = (table), \ + poll_initwait(wait) \ +) + +#define compat_poll_freewait(wait, table) ( \ + poll_freewait((table)) \ +) + +#else // } { + +#define compat_poll_initwait(wait, table) ( \ + (wait) = (table), /* confuse compiler */ \ + (wait) = (poll_table *) __get_free_page(GFP_KERNEL), \ + (wait)->nr = 0, \ + (wait)->entry = (struct poll_table_entry *)((wait) + 1), \ + (wait)->next = NULL \ +) + +static inline void +poll_freewait(poll_table *wait) +{ + while (wait) { + struct poll_table_entry * entry; + poll_table *old; + + entry = wait->entry + wait->nr; + while (wait->nr > 0) { + wait->nr--; + entry--; + remove_wait_queue(entry->wait_address, &entry->wait); + compat_fput(entry->filp); + } + old = wait; + wait = wait->next; + free_page((unsigned long) old); + } +} + +#define compat_poll_freewait(wait, table) ( \ + poll_freewait((wait)) \ +) + +#endif // } + +/* + * The wait_event_interruptible_timeout() interface is not + * defined in pre-2.6 kernels. + */ +#ifndef wait_event_interruptible_timeout +#define __wait_event_interruptible_timeout(wq, condition, ret) \ +do { \ + wait_queue_t __wait; \ + init_waitqueue_entry(&__wait, current); \ + \ + add_wait_queue(&wq, &__wait); \ + for (;;) { \ + set_current_state(TASK_INTERRUPTIBLE); \ + if (condition) \ + break; \ + if (!signal_pending(current)) { \ + ret = schedule_timeout(ret); \ + if (!ret) \ + break; \ + continue; \ + } \ + ret = -ERESTARTSYS; \ + break; \ + } \ + set_current_state(TASK_RUNNING); \ + remove_wait_queue(&wq, &__wait); \ +} while (0) + +#define wait_event_interruptible_timeout(wq, condition, timeout) \ +({ \ + long __ret = timeout; \ + if (!(condition)) \ + __wait_event_interruptible_timeout(wq, condition, __ret); \ + __ret; \ +}) +#endif + +/* + * The wait_event_timeout() interface is not + * defined in pre-2.6 kernels. + */ +#ifndef wait_event_timeout +#define __wait_event_timeout(wq, condition, ret) \ +do { \ + wait_queue_t __wait; \ + init_waitqueue_entry(&__wait, current); \ + \ + add_wait_queue(&wq, &__wait); \ + for (;;) { \ + set_current_state(TASK_UNINTERRUPTIBLE); \ + if (condition) \ + break; \ + ret = schedule_timeout(ret); \ + if (!ret) \ + break; \ + } \ + set_current_state(TASK_RUNNING); \ + remove_wait_queue(&wq, &__wait); \ +} while (0) + +#define wait_event_timeout(wq, condition, timeout) \ +({ \ + long __ret = timeout; \ + if (!(condition)) \ + __wait_event_timeout(wq, condition, __ret); \ + __ret; \ +}) +#endif + +/* + * DEFINE_WAIT() and friends were added in 2.5.39 and backported to 2.4.28. + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 28) || \ + (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 0) && \ + LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 39)) +# define COMPAT_DEFINE_WAIT(_wait) \ + DECLARE_WAITQUEUE(_wait, current) +# define compat_init_prepare_to_wait(_sleep, _wait, _state) \ + do { \ + __set_current_state(_state); \ + add_wait_queue(_sleep, _wait); \ + } while (0) +# define compat_cont_prepare_to_wait(_sleep, _wait, _state) \ + set_current_state(_state) +# define compat_finish_wait(_sleep, _wait, _state) \ + do { \ + __set_current_state(_state); \ + remove_wait_queue(_sleep, _wait); \ + } while (0) +#else +# define COMPAT_DEFINE_WAIT(_wait) \ + DEFINE_WAIT(_wait) +# define compat_init_prepare_to_wait(_sleep, _wait, _state) \ + prepare_to_wait(_sleep, _wait, _state) +# define compat_cont_prepare_to_wait(_sleep, _wait, _state) \ + prepare_to_wait(_sleep, _wait, _state) +# define compat_finish_wait(_sleep, _wait, _state) \ + finish_wait(_sleep, _wait) +#endif + +#endif /* __COMPAT_WAIT_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/compat_workqueue.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/compat_workqueue.h --- open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/compat_workqueue.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/compat_workqueue.h 2008-10-13 08:01:40.000000000 +0100 @@ -0,0 +1,165 @@ +/********************************************************* + * Copyright (C) 2007 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +#ifndef __COMPAT_WORKQUEUE_H__ +# define __COMPAT_WORKQUEUE_H__ + +#include <linux/kernel.h> + +#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 5, 41) +# include <linux/workqueue.h> +#endif + +/* + * + * Work queues and delayed work queues. + * + * Prior to 2.5.41, the notion of work queues did not exist. Taskqueues are + * used for work queues and timers are used for delayed work queues. + * + * After 2.6.20, normal work structs ("work_struct") and delayed work + * ("delayed_work") structs were separated so that the work_struct could be + * slimmed down. The interface was also changed such that the address of the + * work_struct itself is passed in as the argument to the work function. This + * requires that one embed the work struct in the larger struct containing the + * information necessary to complete the work and use container_of() to obtain + * the address of the containing structure. + * + * Users of these macros should embed a compat_work or compat_delayed_work in + * a larger structure, then specify the larger structure as the _data argument + * for the initialization functions, specify the work function to take + * a compat_work_arg or compat_delayed_work_arg, then use the appropriate + * _GET_DATA macro to obtain the reference to the structure passed in as _data. + * An example is below. + * + * + * typedef struct WorkData { + * int data; + * compat_work work; + * } WorkData; + * + * + * void + * WorkFunc(compat_work_arg data) + * { + * WorkData *workData = COMPAT_WORK_GET_DATA(data, WorkData, work); + * + * ... + * } + * + * + * { + * WorkData *workData = kmalloc(sizeof *workData, GFP_EXAMPLE); + * if (!workData) { + * return -ENOMEM; + * } + * + * COMPAT_INIT_WORK(&workData->work, WorkFunc, workData); + * compat_schedule_work(&workData->work); + * } + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 41) /* { */ +typedef struct tq_struct compat_work; +typedef struct compat_delayed_work { + struct tq_struct work; + struct timer_list timer; +} compat_delayed_work; +typedef void * compat_work_arg; +typedef void * compat_delayed_work_arg; + +/* + * Delayed work queues need to run at some point in the future in process + * context, but task queues don't support delaying the task one is scheduling. + * Timers allow us to delay the execution of our work queue until the future, + * but timer handlers run in bottom-half context. As such, we use both a timer + * and task queue and use the timer handler below to schedule the task in + * process context immediately. The timer lets us delay execution, and the + * task queue lets us run in process context. + * + * Note that this is similar to how delayed_work is implemented with work + * queues in later kernel versions. + */ +static inline void +__compat_delayed_work_timer(unsigned long arg) +{ + compat_delayed_work *dwork = (compat_delayed_work *)arg; + if (dwork) { + schedule_task(&dwork->work); + } +} + +# define COMPAT_INIT_WORK(_work, _func, _data) \ + INIT_LIST_HEAD(&(_work)->list); \ + (_work)->sync = 0; \ + (_work)->routine = _func; \ + (_work)->data = _data +# define COMPAT_INIT_DELAYED_WORK(_work, _func, _data) \ + COMPAT_INIT_WORK(&(_work)->work, _func, _data); \ + init_timer(&(_work)->timer); \ + (_work)->timer.expires = 0; \ + (_work)->timer.function = __compat_delayed_work_timer; \ + (_work)->timer.data = (unsigned long)_work +# define compat_schedule_work(_work) \ + schedule_task(_work) +# define compat_schedule_delayed_work(_work, _delay) \ + (_work)->timer.expires = jiffies + _delay; \ + add_timer(&(_work)->timer) +# define COMPAT_WORK_GET_DATA(_p, _type) \ + (_type *)(_p) +# define COMPAT_DELAYED_WORK_GET_DATA(_p, _type, _member) \ + (_type *)(_p) + +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20) /* } { */ +typedef struct work_struct compat_work; +typedef struct work_struct compat_delayed_work; +typedef void * compat_work_arg; +typedef void * compat_delayed_work_arg; +# define COMPAT_INIT_WORK(_work, _func, _data) \ + INIT_WORK(_work, _func, _data) +# define COMPAT_INIT_DELAYED_WORK(_work, _func, _data) \ + INIT_WORK(_work, _func, _data) +# define compat_schedule_work(_work) \ + schedule_work(_work) +# define compat_schedule_delayed_work(_work, _delay) \ + schedule_delayed_work(_work, _delay) +# define COMPAT_WORK_GET_DATA(_p, _type) \ + (_type *)(_p) +# define COMPAT_DELAYED_WORK_GET_DATA(_p, _type, _member) \ + (_type *)(_p) + +#else /* } Linux >= 2.6.20 { */ +typedef struct work_struct compat_work; +typedef struct delayed_work compat_delayed_work; +typedef struct work_struct * compat_work_arg; +typedef struct work_struct * compat_delayed_work_arg; +# define COMPAT_INIT_WORK(_work, _func, _data) \ + INIT_WORK(_work, _func) +# define COMPAT_INIT_DELAYED_WORK(_work, _func, _data) \ + INIT_DELAYED_WORK(_work, _func) +# define compat_schedule_work(_work) \ + schedule_work(_work) +# define compat_schedule_delayed_work(_work, _delay) \ + schedule_delayed_work(_work, _delay) +# define COMPAT_WORK_GET_DATA(_p, _type) \ + container_of(_p, _type, work) +# define COMPAT_DELAYED_WORK_GET_DATA(_p, _type, _member) \ + container_of(_p, _type, _member.work) +#endif /* } */ + +#endif /* __COMPAT_WORKQUEUE_H__ */ + diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/driver-config.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/driver-config.h --- open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/driver-config.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/driver-config.h 2008-10-13 08:01:40.000000000 +0100 @@ -0,0 +1,78 @@ +/********************************************************* + * Copyright (C) 1998 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * Sets the proper defines from the Linux header files + * + * This file must be included before the inclusion of any kernel header file, + * with the exception of linux/autoconf.h and linux/version.h --hpreg + */ + +#ifndef __VMX_CONFIG_H__ +#define __VMX_CONFIG_H__ + +#define INCLUDE_ALLOW_VMCORE +#define INCLUDE_ALLOW_VMMON +#define INCLUDE_ALLOW_MODULE +#define INCLUDE_ALLOW_VMNIXMOD +#include "includeCheck.h" + +#include <linux/autoconf.h> +#include "compat_version.h" + +/* + * We rely on Kernel Module support. Check here. + */ +#ifndef CONFIG_MODULES +# error "No Module support in this kernel. Please configure with CONFIG_MODULES" +#endif + +/* + * 2.2 kernels still use __SMP__ (derived from CONFIG_SMP + * in the main Makefile), so we do it here. + */ + +#ifdef CONFIG_SMP +# define __SMP__ 1 +#endif + +#if defined(CONFIG_MODVERSIONS) && defined(KERNEL_2_1) +# if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,60) +/* + * MODVERSIONS might be already defined when using kernel's Makefiles. + */ +# ifndef MODVERSIONS +# define MODVERSIONS +# endif +# include <linux/modversions.h> +# endif +#endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24) +/* + * Force the uintptr_t definition to come from linux/types.h instead of vm_basic_types.h. + */ +# include <linux/types.h> +# define _STDINT_H 1 +#endif + +#ifndef __KERNEL__ +# define __KERNEL__ +#endif + +#endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/vm_assert.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/vm_assert.h --- open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/vm_assert.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/vm_assert.h 2008-10-13 08:01:40.000000000 +0100 @@ -0,0 +1,317 @@ +/********************************************************* + * Copyright (C) 1998-2004 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * vm_assert.h -- + * + * The basic assertion facility for all VMware code. + * + * For proper use, see + * 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_VMMEXT +#define INCLUDE_ALLOW_MODULE +#define INCLUDE_ALLOW_VMMON +#define INCLUDE_ALLOW_VMNIXMOD +#define INCLUDE_ALLOW_VMKERNEL +#define INCLUDE_ALLOW_VMKDRIVERS +#define INCLUDE_ALLOW_VMK_MODULE +#define INCLUDE_ALLOW_DISTRIBUTE +#define INCLUDE_ALLOW_VMCORE +#define INCLUDE_ALLOW_VMIROM +#include "includeCheck.h" + +// XXX not necessary except some places include vm_assert.h improperly +#include "vm_basic_types.h" +#include "vm_basic_defs.h" + + +/* + * XXX old file code + */ + +#ifdef FILECODEINT +#error "Don't define FILECODEINT. It is obsolete." +#endif +#ifdef FILECODE +#error "Don't define FILECODE. It is obsolete." +#endif + + +/* + * Panic and log functions + */ + +EXTERN void Log(const char *fmt, ...) PRINTF_DECL(1, 2); +EXTERN void Warning(const char *fmt, ...) PRINTF_DECL(1, 2); +EXTERN NORETURN void Panic(const char *fmt, ...) PRINTF_DECL(1, 2); + +EXTERN void LogThrottled(uint32 *count, const char *fmt, ...) + PRINTF_DECL(2, 3); +EXTERN void WarningThrottled(uint32 *count, const char *fmt, ...) + PRINTF_DECL(2, 3); + +/* DB family: messages which are parsed by logfile database system */ +#define WarningDB Warning +#define LogDB Log +#define WarningThrottledDB WarningThrottled +#define LogThrottledDB LogThrottled + + +/* + * Stress testing: redefine ASSERT_IFNOT() to taste + */ + +#ifndef ASSERT_IFNOT + #ifdef __cplusplus + #define ASSERT_IFNOT(cond, panic) (UNLIKELY(!(cond)) ? (panic) : (void)0) + #else + #define ASSERT_IFNOT(cond, panic) (UNLIKELY(!(cond)) ? (panic) : 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 || defined ASSERT_ALWAYS_AVAILABLE +#undef ASSERT +#define ASSERT(cond) \ + ASSERT_IFNOT(cond, _ASSERT_PANIC(AssertAssert)) +#endif +#define ASSERT_BUG(bug, cond) \ + ASSERT_IFNOT(cond, _ASSERT_PANIC_BUG(bug, AssertAssert)) +#define ASSERT_BUG_DEBUGONLY(bug, cond) ASSERT_BUG(bug, cond) + +#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)) + +#define NOT_IMPLEMENTED() _ASSERT_PANIC(AssertNotImplemented) +#define NOT_IMPLEMENTED_BUG(bug) _ASSERT_PANIC_BUG(bug, AssertNotImplemented) + +#define NOT_REACHED() _ASSERT_PANIC(AssertNotReached) +#define NOT_REACHED_BUG(bug) _ASSERT_PANIC_BUG(bug, AssertNotReached) + +#define ASSERT_MEM_ALLOC(cond) \ + ASSERT_IFNOT(cond, _ASSERT_PANIC(AssertMemAlloc)) + +#ifdef VMX86_DEVEL + #define ASSERT_LENGTH(real, expected) \ + ASSERT_IFNOT((real) == (expected), \ + Panic(AssertLengthFmt, __FILE__, __LINE__, real, expected)) +#else + #define ASSERT_LENGTH(real, expected) ASSERT((real) == (expected)) +#endif + +#ifdef VMX86_DEVEL + #define ASSERT_DEVEL(cond) ASSERT(cond) +#else + #define ASSERT_DEVEL(cond) ((void) 0) +#endif + +#define ASSERT_NO_INTERRUPTS() ASSERT(!INTERRUPTS_ENABLED()) +#define ASSERT_HAS_INTERRUPTS() ASSERT(INTERRUPTS_ENABLED()) + +#define ASSERT_LOG_UNEXPECTED(bug, cond) \ + (UNLIKELY(!(cond)) ? LOG_UNEXPECTED(bug) : 0) +#ifdef VMX86_DEVEL + #define LOG_UNEXPECTED(bug) \ + Warning(AssertUnexpectedFmt, __FILE__, __LINE__, bug) +#else + #define LOG_UNEXPECTED(bug) \ + Log(AssertUnexpectedFmt, __FILE__, __LINE__, bug) +#endif + +#define ASSERT_NOT_TESTED(cond) (UNLIKELY(!(cond)) ? NOT_TESTED() : 0) +#ifdef VMX86_DEVEL + #define NOT_TESTED() Warning(AssertNotTestedFmt, __FILE__, __LINE__) +#else + #define NOT_TESTED() Log(AssertNotTestedFmt, __FILE__, __LINE__) +#endif + +#define NOT_TESTED_ONCE() \ + do { \ + static Bool alreadyPrinted = FALSE; \ + if (UNLIKELY(!alreadyPrinted)) { \ + alreadyPrinted = TRUE; \ + NOT_TESTED(); \ + } \ + } while (0) + +#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 { \ + static Bool logged = FALSE; \ + if (!logged) { \ + Log _s; \ + logged = TRUE; \ + } \ + } while (0) + + +/* + * Redefine macros that are only in debug versions + */ + +#if !defined VMX86_DEBUG && !defined ASSERT_ALWAYS_AVAILABLE // { + +#undef ASSERT +#define ASSERT(cond) ((void) 0) + +#undef ASSERT_BUG_DEBUGONLY +#define ASSERT_BUG_DEBUGONLY(bug, cond) ((void) 0) + +#undef ASSERT_LENGTH +#define ASSERT_LENGTH(real, expected) ((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. + */ + +#ifdef VMM +#undef NOT_REACHED +#define NOT_REACHED() ((void) 0) +#else +// keep debug definition +#endif + +#undef ASSERT_LOG_UNEXPECTED +#define ASSERT_LOG_UNEXPECTED(bug, cond) ((void) 0) + +#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). + */ + +#define ASSERT_ON_COMPILE(e) \ + do { \ + enum { AssertOnCompileMisused = ((e) ? 1 : -1) }; \ + typedef char AssertOnCompileFailed[AssertOnCompileMisused]; \ + } while (0) + + +/* + * 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 \ + } + + +/* + * 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 // { + +#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 AssertLengthFmt _AssertLengthFmt +#define AssertUnexpectedFmt _AssertUnexpectedFmt +#define AssertNotTestedFmt _AssertNotTestedFmt + +#endif // } + +// these don't have newline so a bug can be tacked on +#define _AssertPanicFmt "PANIC %s:%d" +#define _AssertAssertFmt "ASSERT %s:%d" +#define _AssertNotImplementedFmt "NOT_IMPLEMENTED %s:%d" +#define _AssertNotReachedFmt "NOT_REACHED %s:%d" +#define _AssertMemAllocFmt "MEM_ALLOC %s:%d" + +// these are complete formats with newline +#define _AssertLengthFmt "LENGTH %s:%d r=%#x e=%#x\n" +#define _AssertUnexpectedFmt "UNEXPECTED %s:%d bugNr=%d\n" +#define _AssertNotTestedFmt "NOT_TESTED %s:%d\n" + +#endif /* ifndef _VM_ASSERT_H_ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/vm_atomic.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/vm_atomic.h --- open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/vm_atomic.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/vm_atomic.h 2008-10-13 08:01:40.000000000 +0100 @@ -0,0 +1,2049 @@ +/********************************************************* + * Copyright (C) 1998 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * vm_atomic.h -- + * + * Atomic power + */ + +#ifndef _ATOMIC_H_ +#define _ATOMIC_H_ + +#define INCLUDE_ALLOW_USERLEVEL +#define INCLUDE_ALLOW_VMMEXT +#define INCLUDE_ALLOW_MODULE +#define INCLUDE_ALLOW_VMMON +#define INCLUDE_ALLOW_VMNIXMOD +#define INCLUDE_ALLOW_VMKDRIVERS +#define INCLUDE_ALLOW_VMK_MODULE +#define INCLUDE_ALLOW_VMKERNEL +#define INCLUDE_ALLOW_DISTRIBUTE +#define INCLUDE_ALLOW_VMCORE +#define INCLUDE_ALLOW_VMIROM +#include "includeCheck.h" + +#include "vm_basic_types.h" + + +/* Basic atomic type: 32 bits */ +typedef struct Atomic_uint32 { + volatile uint32 value; +} Atomic_uint32; + + +/* Basic atomic type: 64 bits */ +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 + * untill 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 +#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*); +#pragma intrinsic(_InterlockedExchange, _InterlockedCompareExchange) +#pragma intrinsic(_InterlockedExchangeAdd, _InterlockedDecrement) +#pragma intrinsic(_InterlockedIncrement) + +#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 */ + + +/* Convert a volatile int to Atomic_uint32. */ +static INLINE Atomic_uint32 * +Atomic_VolatileToAtomic(volatile uint32 *var) +{ + return (Atomic_uint32 *)var; +} + +/* + *----------------------------------------------------------------------------- + * + * Atomic_Init, Atomic_SetFence, AtomicUseFence -- + * + * Determine whether an lfence intruction is executed after + * every locked instruction. + * + * Certain AMD processes 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. + * 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__) /* PR136775 */ +#define ATOMIC_USE_FENCE +#endif + +#if defined(VMATOMIC_IMPORT_DLLDATA) +VMX86_EXTERN_DATA Bool AtomicUseFence; +#else +EXTERN Bool AtomicUseFence; +#endif + +EXTERN Bool atomicFenceInitialized; + +void AtomicInitFence(void); + +static INLINE void +Atomic_Init(void) +{ +#ifdef ATOMIC_USE_FENCE + if (!atomicFenceInitialized) { + AtomicInitFence(); + } +#endif +} + +static INLINE void +Atomic_SetFence(Bool fenceAfterLock) /* IN: TRUE to enable lfence */ + /* FALSE to disable. */ +{ + AtomicUseFence = fenceAfterLock; +#if defined(__VMKERNEL__) + extern void Atomic_SetFenceVMKAPI(Bool fenceAfterLock); + Atomic_SetFenceVMKAPI(fenceAfterLock); +#endif + atomicFenceInitialized = TRUE; +} + + +/* Conditionally execute fence after interlocked instruction. */ +static INLINE void +AtomicEpilogue(void) +{ +#ifdef ATOMIC_USE_FENCE + if (UNLIKELY(AtomicUseFence)) { + asm volatile ("lfence" ::: "memory"); + } +#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 + */ + + +/* + *----------------------------------------------------------------------------- + * + * Atomic_Read -- + * + * Read + * + * Results: + * The value of the atomic variable. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static INLINE uint32 +Atomic_Read(Atomic_uint32 const *var) // IN +{ + return var->value; +} +#define Atomic_Read32 Atomic_Read + + +/* + *----------------------------------------------------------------------------- + * + * Atomic_Write -- + * + * Write + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static INLINE void +Atomic_Write(Atomic_uint32 *var, // IN + uint32 val) // IN +{ + var->value = val; +} +#define Atomic_Write32 Atomic_Write + + +/* + *----------------------------------------------------------------------------- + * + * 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 + uint32 val) // IN +#ifdef __GNUC__ +{ + /* Checked against the Intel manual and GCC --walken */ + __asm__ __volatile__( + "xchgl %0, %1" +# if VM_ASM_PLUS + : "=r" (val), + "+m" (var->value) + : "0" (val) +# else + : "=r" (val), + "=m" (var->value) + : "0" (val), + "1" (var->value) +# endif + ); + AtomicEpilogue(); + return val; +} +#elif _MSC_VER >= 1310 +{ + return _InterlockedExchange((long *)&var->value, (long)val); +} +#elif _MSC_VER +#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) +#else +#error No compiler defined for Atomic_ReadWrite +#endif +#define Atomic_ReadWrite32 Atomic_ReadWrite + + +/* + *----------------------------------------------------------------------------- + * + * 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 + uint32 oldVal, // IN + uint32 newVal) // IN +#ifdef __GNUC__ +{ + uint32 val; + + /* Checked against the Intel manual and GCC --walken */ + __asm__ __volatile__( + "lock; cmpxchgl %2, %1" +# if VM_ASM_PLUS + : "=a" (val), + "+m" (var->value) + : "r" (newVal), + "0" (oldVal) +# else + : "=a" (val), + "=m" (var->value) + : "r" (newVal), + "0" (oldVal) + /* + * "1" (var->value): results in inconsistent constraints on gcc 2.7.2.3 + * when compiling enterprise-2.2.17-14-RH7.0-update. + * The constraint has been commented out for now. We may consider doing + * this systematically, but we need to be sure it is the right thing to + * do. However, it is also possible that the offending use of this asm + * function will be removed in the near future in which case we may + * decide to reintroduce the constraint instead. hpreg & agesen. + */ +# endif + : "cc" + ); + AtomicEpilogue(); + return val; +} +#elif _MSC_VER >= 1310 +{ + return _InterlockedCompareExchange((long *)&var->value, + (long)newVal, + (long)oldVal); +} +#elif _MSC_VER +#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) +#else +#error No compiler defined for Atomic_ReadIfEqualWrite +#endif +#define Atomic_ReadIfEqualWrite32 Atomic_ReadIfEqualWrite + + +#if defined(__x86_64__) +/* + *----------------------------------------------------------------------------- + * + * 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 + uint64 oldVal, // IN + uint64 newVal) // IN +{ +#if defined(__GNUC__) + 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; +#elif _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 + uint32 val) // IN +{ +#ifdef __GNUC__ + /* Checked against the Intel manual and GCC --walken */ + __asm__ __volatile__( + "lock; andl %1, %0" +# if VM_ASM_PLUS + : "+m" (var->value) + : "ri" (val) +# else + : "=m" (var->value) + : "ri" (val), + "0" (var->value) +# endif + : "cc" + ); + AtomicEpilogue(); +#elif _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 + + +#if defined(__x86_64__) +/* + *----------------------------------------------------------------------------- + * + * Atomic_And64 -- + * + * Atomic read, bitwise AND with a value, write. + * + * Results: + * None + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static INLINE void +Atomic_And64(Atomic_uint64 *var, // IN + uint64 val) // IN +{ +#if defined(__GNUC__) + /* Checked against the AMD manual and GCC --hpreg */ + __asm__ __volatile__( + "lock; andq %1, %0" + : "+m" (var->value) + : "ri" (val) + : "cc" + ); + AtomicEpilogue(); +#elif _MSC_VER + _InterlockedAnd64((__int64 *)&var->value, (__int64)val); +#else +#error No compiler defined for Atomic_And64 +#endif +} +#endif + + +/* + *----------------------------------------------------------------------------- + * + * Atomic_Or -- + * + * Atomic read, bitwise OR with a value, write. + * + * Results: + * None + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static INLINE void +Atomic_Or(Atomic_uint32 *var, // IN + uint32 val) // IN +{ +#ifdef __GNUC__ + /* Checked against the Intel manual and GCC --walken */ + __asm__ __volatile__( + "lock; orl %1, %0" +# if VM_ASM_PLUS + : "+m" (var->value) + : "ri" (val) +# else + : "=m" (var->value) + : "ri" (val), + "0" (var->value) +# endif + : "cc" + ); + AtomicEpilogue(); +#elif _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 + + +#if defined(__x86_64__) +/* + *----------------------------------------------------------------------------- + * + * Atomic_Or64 -- + * + * Atomic read, bitwise OR with a value, write. + * + * Results: + * None + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static INLINE void +Atomic_Or64(Atomic_uint64 *var, // IN + uint64 val) // IN +{ +#if defined(__GNUC__) + /* Checked against the AMD manual and GCC --hpreg */ + __asm__ __volatile__( + "lock; orq %1, %0" + : "+m" (var->value) + : "ri" (val) + : "cc" + ); + AtomicEpilogue(); +#elif _MSC_VER + _InterlockedOr64((__int64 *)&var->value, (__int64)val); +#else +#error No compiler defined for Atomic_Or64 +#endif +} +#endif + + +/* + *----------------------------------------------------------------------------- + * + * Atomic_Xor -- + * + * Atomic read, bitwise XOR with a value, write. + * + * Results: + * None + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static INLINE void +Atomic_Xor(Atomic_uint32 *var, // IN + uint32 val) // IN +{ +#ifdef __GNUC__ + /* Checked against the Intel manual and GCC --walken */ + __asm__ __volatile__( + "lock; xorl %1, %0" +# if VM_ASM_PLUS + : "+m" (var->value) + : "ri" (val) +# else + : "=m" (var->value) + : "ri" (val), + "0" (var->value) +# endif + : "cc" + ); + AtomicEpilogue(); +#elif _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(__x86_64__) +/* + *----------------------------------------------------------------------------- + * + * Atomic_Xor64 -- + * + * Atomic read, bitwise XOR with a value, write. + * + * Results: + * None + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static INLINE void +Atomic_Xor64(Atomic_uint64 *var, // IN + uint64 val) // IN +{ +#if defined(__GNUC__) + /* Checked against the AMD manual and GCC --hpreg */ + __asm__ __volatile__( + "lock; xorq %1, %0" + : "+m" (var->value) + : "ri" (val) + : "cc" + ); + AtomicEpilogue(); +#elif _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 + uint32 val) // IN +{ +#ifdef __GNUC__ + /* Checked against the Intel manual and GCC --walken */ + __asm__ __volatile__( + "lock; addl %1, %0" +# if VM_ASM_PLUS + : "+m" (var->value) + : "ri" (val) +# else + : "=m" (var->value) + : "ri" (val), + "0" (var->value) +# endif + : "cc" + ); + AtomicEpilogue(); +#elif _MSC_VER >= 1310 + _InterlockedExchangeAdd((long *)&var->value, (long)val); +#elif _MSC_VER + __asm mov eax, val + __asm mov ebx, var + __asm lock add [ebx]Atomic_uint32.value, eax +#else +#error No compiler defined for Atomic_Add +#endif +} +#define Atomic_Add32 Atomic_Add + + +#if defined(__x86_64__) +/* + *----------------------------------------------------------------------------- + * + * Atomic_Add64 -- + * + * Atomic read, add a value, write. + * + * Results: + * None + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static INLINE void +Atomic_Add64(Atomic_uint64 *var, // IN + uint64 val) // IN +{ +#if defined(__GNUC__) + /* Checked against the AMD manual and GCC --hpreg */ + __asm__ __volatile__( + "lock; addq %1, %0" + : "+m" (var->value) + : "ri" (val) + : "cc" + ); + AtomicEpilogue(); +#elif _MSC_VER + _InterlockedExchangeAdd64((__int64 *)&var->value, (__int64)val); +#else +#error No compiler defined for Atomic_Add64 +#endif +} +#endif + + +/* + *----------------------------------------------------------------------------- + * + * Atomic_Sub -- + * + * Atomic read, subtract a value, write. + * + * Results: + * None + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static INLINE void +Atomic_Sub(Atomic_uint32 *var, // IN + uint32 val) // IN +{ +#ifdef __GNUC__ + /* Checked against the Intel manual and GCC --walken */ + __asm__ __volatile__( + "lock; subl %1, %0" +# if VM_ASM_PLUS + : "+m" (var->value) + : "ri" (val) +# else + : "=m" (var->value) + : "ri" (val), + "0" (var->value) +# endif + : "cc" + ); + AtomicEpilogue(); +#elif _MSC_VER >= 1310 + _InterlockedExchangeAdd((long *)&var->value, (long)-val); +#elif _MSC_VER + __asm mov eax, val + __asm mov ebx, var + __asm lock sub [ebx]Atomic_uint32.value, eax +#else +#error No compiler defined for Atomic_Sub +#endif +} +#define Atomic_Sub32 Atomic_Sub + + +#if defined(__x86_64__) +/* + *----------------------------------------------------------------------------- + * + * Atomic_Sub64 -- + * + * Atomic read, subtract a value, write. + * + * Results: + * None + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static INLINE void +Atomic_Sub64(Atomic_uint64 *var, // IN + uint64 val) // IN +{ +#ifdef __GNUC__ + /* Checked against the AMD manual and GCC --hpreg */ + __asm__ __volatile__( + "lock; subq %1, %0" + : "+m" (var->value) + : "ri" (val) + : "cc" + ); + AtomicEpilogue(); +#elif _MSC_VER + _InterlockedExchangeAdd64((__int64 *)&var->value, (__int64)-val); +#else +#error No compiler defined for Atomic_Sub64 +#endif +} +#endif + + +/* + *----------------------------------------------------------------------------- + * + * Atomic_Inc -- + * + * Atomic read, increment, write. + * + * Results: + * None + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static INLINE void +Atomic_Inc(Atomic_uint32 *var) // IN +{ +#ifdef __GNUC__ + /* Checked against the Intel manual and GCC --walken */ + __asm__ __volatile__( + "lock; incl %0" +# if VM_ASM_PLUS + : "+m" (var->value) + : +# else + : "=m" (var->value) + : "0" (var->value) +# endif + : "cc" + ); + AtomicEpilogue(); +#elif _MSC_VER >= 1310 + _InterlockedIncrement((long *)&var->value); +#elif _MSC_VER + __asm mov ebx, var + __asm lock inc [ebx]Atomic_uint32.value +#else +#error No compiler defined for Atomic_Inc +#endif +} +#define Atomic_Inc32 Atomic_Inc + + +#if defined(__x86_64__) +/* + *----------------------------------------------------------------------------- + * + * Atomic_Inc64 -- + * + * Atomic read, increment, write. + * + * Results: + * None + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static INLINE void +Atomic_Inc64(Atomic_uint64 *var) // IN +{ +#if defined(__GNUC__) + /* Checked against the AMD manual and GCC --hpreg */ + __asm__ __volatile__( + "lock; incq %0" + : "+m" (var->value) + : + : "cc" + ); + AtomicEpilogue(); +#elif _MSC_VER + _InterlockedIncrement64((__int64 *)&var->value); +#else +#error No compiler defined for Atomic_Inc64 +#endif +} +#endif + + +/* + *----------------------------------------------------------------------------- + * + * Atomic_Dec -- + * + * Atomic read, decrement, write. + * + * Results: + * None + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static INLINE void +Atomic_Dec(Atomic_uint32 *var) // IN +{ +#ifdef __GNUC__ + /* Checked against the Intel manual and GCC --walken */ + __asm__ __volatile__( + "lock; decl %0" +# if VM_ASM_PLUS + : "+m" (var->value) + : +# else + : "=m" (var->value) + : "0" (var->value) +# endif + : "cc" + ); + AtomicEpilogue(); +#elif _MSC_VER >= 1310 + _InterlockedDecrement((long *)&var->value); +#elif _MSC_VER + __asm mov ebx, var + __asm lock dec [ebx]Atomic_uint32.value +#else +#error No compiler defined for Atomic_Dec +#endif +} +#define Atomic_Dec32 Atomic_Dec + + +#if defined(__x86_64__) +/* + *----------------------------------------------------------------------------- + * + * Atomic_Dec64 -- + * + * Atomic read, decrement, write. + * + * Results: + * None + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static INLINE void +Atomic_Dec64(Atomic_uint64 *var) // IN +{ +#if defined(__GNUC__) + /* Checked against the AMD manual and GCC --hpreg */ + __asm__ __volatile__( + "lock; decq %0" + : "+m" (var->value) + : + : "cc" + ); + AtomicEpilogue(); +#elif _MSC_VER + _InterlockedDecrement64((__int64 *)&var->value); +#else +#error No compiler defined for Atomic_Dec64 +#endif +} +#endif + + +/* + * Note that the technique below can be used to implement ReadX(), where X is + * an arbitrary mathematical function. + */ + + +/* + *----------------------------------------------------------------------------- + * + * Atomic_FetchAndOr -- + * + * 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_FetchAndOr(Atomic_uint32 *var, // IN + uint32 val) // IN +{ + uint32 res; + + do { + res = var->value; + } while (res != Atomic_ReadIfEqualWrite(var, res, res | val)); + + return res; +} + + +/* + *----------------------------------------------------------------------------- + * + * Atomic_FetchAndAnd -- + * + * 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_FetchAndAnd(Atomic_uint32 *var, // IN + uint32 val) // IN +{ + uint32 res; + + do { + res = var->value; + } while (res != Atomic_ReadIfEqualWrite(var, res, res & val)); + + return res; +} +#define Atomic_ReadOr32 Atomic_FetchAndOr + + +#if defined(__x86_64__) +/* + *----------------------------------------------------------------------------- + * + * 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 + uint64 val) // IN +{ + uint64 res; + + do { + res = var->value; + } while (res != Atomic_ReadIfEqualWrite64(var, res, res | val)); + + return res; +} +#endif + + +/* + *----------------------------------------------------------------------------- + * + * Atomic_FetchAndAddUnfenced -- + * + * Atomic read (returned), add a value, write. + * + * If you have to implement FetchAndAdd() on an architecture other than + * x86 or x86-64, you might want to consider doing something similar to + * Atomic_FetchAndOr(). + * + * The "Unfenced" version of Atomic_FetchAndInc never executes + * "lfence" after the interlocked operation. + * + * Results: + * The value of the variable before the operation. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static INLINE uint32 +Atomic_FetchAndAddUnfenced(Atomic_uint32 *var, // IN + uint32 val) // IN +#ifdef __GNUC__ +{ + /* Checked against the Intel manual and GCC --walken */ + __asm__ __volatile__( +# if VM_ASM_PLUS + "lock; xaddl %0, %1" + : "=r" (val), + "+m" (var->value) + : "0" (val) + : "cc" +# else + "lock; xaddl %0, (%1)" + : "=r" (val) + : "r" (&var->value), + "0" (val) + : "cc", "memory" +# endif + ); + return val; +} +#elif _MSC_VER >= 1310 +{ + return _InterlockedExchangeAdd((long *)&var->value, (long)val); +} +#elif _MSC_VER +#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) +#else +#error No compiler defined for Atomic_FetchAndAdd +#endif +#define Atomic_ReadAdd32 Atomic_FetchAndAdd + + +/* + *----------------------------------------------------------------------------- + * + * Atomic_FetchAndAdd -- + * + * Atomic read (returned), add a value, write. + * + * If you have to implement FetchAndAdd() on an architecture other than + * x86 or x86-64, you might want to consider doing something similar to + * Atomic_FetchAndOr(). + * + * Unlike "Unfenced" version, this one may execute the "lfence" after + * interlocked operation. + * + * Results: + * The value of the variable before the operation. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static INLINE uint32 +Atomic_FetchAndAdd(Atomic_uint32 *var, // IN + uint32 val) // IN +#ifdef __GNUC__ +{ + val = Atomic_FetchAndAddUnfenced(var, val); + AtomicEpilogue(); + return val; +} +#else +{ + return Atomic_FetchAndAddUnfenced(var, val); +} +#endif + + +#if defined(__x86_64__) +/* + *----------------------------------------------------------------------------- + * + * Atomic_ReadAdd64 -- + * + * Atomic read (returned), add a value, write. + * + * Results: + * The value of the variable before the operation. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static INLINE uint64 +Atomic_ReadAdd64(Atomic_uint64 *var, // IN + uint64 val) // IN +{ +#if defined(__GNUC__) + /* Checked against the AMD manual and GCC --hpreg */ + __asm__ __volatile__( + "lock; xaddq %0, %1" + : "=r" (val), + "+m" (var->value) + : "0" (val) + : "cc" + ); + AtomicEpilogue(); + return val; +#elif _MSC_VER + return _InterlockedExchangeAdd64((__int64 *)&var->value, (__int64)val); +#else +#error No compiler defined for Atomic_ReadAdd64 +#endif +} +#endif + + +/* + *----------------------------------------------------------------------------- + * + * Atomic_FetchAndInc -- + * + * Atomic read (returned), increment, write. + * + * Results: + * The value of the variable before the operation. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static INLINE uint32 +Atomic_FetchAndInc(Atomic_uint32 *var) // IN +{ + return Atomic_FetchAndAdd(var, 1); +} +#define Atomic_ReadInc32 Atomic_FetchAndInc + + +#if defined(__x86_64__) +/* + *----------------------------------------------------------------------------- + * + * Atomic_ReadInc64 -- + * + * Atomic read (returned), increment, write. + * + * Results: + * The value of the variable before the operation. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static INLINE uint64 +Atomic_ReadInc64(Atomic_uint64 *var) // IN +{ + return Atomic_ReadAdd64(var, 1); +} +#endif + + +/* + *----------------------------------------------------------------------------- + * + * Atomic_FetchAndDec -- + * + * Atomic read (returned), decrement, write. + * + * Results: + * The value of the variable before the operation. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static INLINE uint32 +Atomic_FetchAndDec(Atomic_uint32 *var) // IN +{ + return Atomic_FetchAndAdd(var, (uint32)-1); +} +#define Atomic_ReadDec32 Atomic_FetchAndDec + + +#if defined(__x86_64__) +/* + *----------------------------------------------------------------------------- + * + * Atomic_ReadDec64 -- + * + * Atomic read (returned), decrement, write. + * + * Results: + * The value of the variable before the operation. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static INLINE uint64 +Atomic_ReadDec64(Atomic_uint64 *var) // IN +{ + return Atomic_ReadAdd64(var, CONST64U(-1)); +} +#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 +#ifdef __GNUC__ +{ + Bool equal; + + /* Checked against the Intel manual and GCC --walken */ +#ifdef VMM64 + 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 */ + int dummy1, dummy2; +# if defined __PIC__ && !vm_x86_64 // %ebx is reserved by the compiler. +# if defined __GNUC__ && __GNUC__ < 3 // Part of #188541 - for RHL 6.2 etc. + __asm__ __volatile__( + "xchg %%ebx, %6\n\t" + "mov (%%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) + : "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" + // %3 is a register to make sure it cannot be %ebx-relative. + "lock; cmpxchg8b (%3)" "\n\t" + "xchgl %%ebx, %6" "\n\t" + // Must come after restoring %ebx: %0 could be %ebx-relative. + "sete %0" + : "=qm" (equal), + "=a" (dummy1), + "=d" (dummy2) + : "r" (var), + "1" (((S_uint64 const *)oldVal)->lowValue), + "2" (((S_uint64 const *)oldVal)->highValue), + // Cannot use "m" here: 'newVal' is read-only. + "r" (((S_uint64 const *)newVal)->lowValue), + "c" (((S_uint64 const *)newVal)->highValue) + : "cc", "memory" + ); +# endif +# else + __asm__ __volatile__( + "lock; cmpxchg8b %0" "\n\t" + "sete %1" +# if VM_ASM_PLUS + : "+m" (*var), +# else + : "=m" (*var), +# endif + "=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; +} +#elif _MSC_VER +#if defined(__x86_64__) +{ + return *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 + + +/* + *----------------------------------------------------------------------------- + * + * 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 +{ +#ifdef __GNUC__ + Bool equal; + + uint32 dummy; + __asm__ __volatile__( + "lock; cmpxchgl %3, %0" "\n\t" + "sete %1" +# if VM_ASM_PLUS + : "+m" (*var), + "=qm" (equal), + "=a" (dummy) + : "r" (newVal), + "2" (oldVal) +# else + : "=m" (*var), + "=qm" (equal), + "=a" (dummy) + : /*"0" (*var), */ + "r" (newVal), + "2" (oldVal) +# endif + : "cc" + ); + AtomicEpilogue(); + return equal; +#else + return (Atomic_ReadIfEqualWrite(var, oldVal, newVal) == oldVal); +#endif +} + + +/* + *----------------------------------------------------------------------------- + * + * 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(__x86_64__) +{ + return var->value; +} +#elif defined(__GNUC__) && defined(__i386__) /* GCC on x86 */ +{ + 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 _MSC_VER /* MSC (assume on x86 for now) */ +# 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) +#else +# error No compiler defined for Atomic_Read64 +#endif + + +/* + *---------------------------------------------------------------------- + * + * Atomic_FetchAndAdd64 -- + * + * 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_FetchAndAdd64(Atomic_uint64 *var, // IN/OUT + uint64 addend) // IN +{ + uint64 oldVal; + uint64 newVal; + + do { + oldVal = var->value; + newVal = oldVal + addend; + } while (!Atomic_CMPXCHG64(var, &oldVal, &newVal)); + + return oldVal; +} + + +/* + *---------------------------------------------------------------------- + * + * Atomic_FetchAndInc64 -- + * + * Atomically increments a 64-bit integer + * + * Results: + * Returns the old value just prior to incrementing + * + * Side effects: + * None + * + *---------------------------------------------------------------------- + */ + +static INLINE uint64 +Atomic_FetchAndInc64(Atomic_uint64 *var) // IN/OUT +{ + return Atomic_FetchAndAdd64(var, 1); +} + + +/* + *---------------------------------------------------------------------- + * + * Atomic_FetchAndDec64 -- + * + * Atomically decrements a 64-bit integer + * + * Results: + * Returns the old value just prior to decrementing + * + * Side effects: + * None + * + *---------------------------------------------------------------------- + */ + +static INLINE uint64 +Atomic_FetchAndDec64(Atomic_uint64 *var) // IN/OUT +{ + uint64 oldVal; + uint64 newVal; + + do { + oldVal = var->value; + newVal = oldVal - 1; + } while (!Atomic_CMPXCHG64(var, &oldVal, &newVal)); + + return oldVal; +} + + +/* + *----------------------------------------------------------------------------- + * + * 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 + 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 _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, // IN + uint64 val) // IN +{ +#if defined(__x86_64__) + var->value = val; +#else + (void)Atomic_ReadWrite64(var, val); +#endif +} + + +/* + * Template code for the Atomic_<name> type and its operators. + * + * The cast argument is an intermedia 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 + */ + +#define MAKE_ATOMIC_TYPE(name, size, in, out, cast) \ + typedef Atomic_uint ## size Atomic_ ## name; \ + \ + \ + 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(__x86_64__) +MAKE_ATOMIC_TYPE(Ptr, 64, void const *, void *, uintptr_t) +MAKE_ATOMIC_TYPE(Int, 64, int, int, int) +#else +MAKE_ATOMIC_TYPE(Ptr, 32, void const *, void *, uintptr_t) +MAKE_ATOMIC_TYPE(Int, 32, int, int, int) +#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_". + * + * 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_Xor(&fence, 0x1); +} + +#endif // ifndef _ATOMIC_H_ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/vm_basic_defs.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/vm_basic_defs.h --- open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/vm_basic_defs.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/vm_basic_defs.h 2008-10-13 08:01:40.000000000 +0100 @@ -0,0 +1,606 @@ +/********************************************************* + * Copyright (C) 2003 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * 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_VMMEXT +#define INCLUDE_ALLOW_MODULE +#define INCLUDE_ALLOW_VMMON +#define INCLUDE_ALLOW_VMNIXMOD +#define INCLUDE_ALLOW_VMKERNEL +#define INCLUDE_ALLOW_VMKDRIVERS +#define INCLUDE_ALLOW_VMK_MODULE +#define INCLUDE_ALLOW_DISTRIBUTE +#define INCLUDE_ALLOW_VMCORE +#define INCLUDE_ALLOW_VMIROM +#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 <stddef.h> /* + * We re-define offsetof macro from stddef, make + * sure that its already defined before we do it + */ + #include <windows.h> // for Sleep() and LOWORD() etc. +#endif + + +/* + * Simple macros + */ + +#if (defined __APPLE__ || defined __FreeBSD__) && \ + (!defined KERNEL && !defined _KERNEL && !defined VMKERNEL && !defined __KERNEL__) +# include <stddef.h> +#else +// XXX the __cplusplus one matches that of VC++, to prevent redefinition warning +// XXX the other one matches that of gcc3.3.3/glibc2.2.4 to prevent redefinition warnings +#ifndef offsetof +#ifdef __cplusplus +#define offsetof(s,m) (size_t)&(((s *)0)->m) +#else +#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) +#endif +#endif +#endif // __APPLE__ + +#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 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 <machine/param.h> +#undef MASK +#endif +#define MASK(n) ((1 << (n)) - 1) /* make an n-bit mask */ +#define DWORD_ALIGN(x) ((((x)+3) >> 2) << 2) +#define QWORD_ALIGN(x) ((((x)+4) >> 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) + + +/* + * 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 +#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 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 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 + +#define HIDWORD(_qw) ((uint32)((_qw) >> 32)) +#define LODWORD(_qw) ((uint32)(_qw)) +#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 + +/* + * Get the frame pointer. We use this assembly hack instead of + * __builtin_frame_address() due to a bug introduced in gcc 4.1.1 + */ +static INLINE_SINGLE_CALLER uintptr_t +GetFrameAddr(void) +{ + uintptr_t bp; +#if (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ == 0)) + bp = (uintptr_t)__builtin_frame_address(0); +#elif (__GNUC__ == 4 && __GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL__ <= 3) +# if defined(VMM64) || defined(VM_X86_64) + __asm__ __volatile__("movq %%rbp, %0\n" : "=g" (bp)); +# else + __asm__ __volatile__("movl %%ebp, %0\n" : "=g" (bp)); +# endif +#else + __asm__ __volatile__( +#ifdef __linux__ + ".print \"This newer version of GCC may or may not have the " + "__builtin_frame_address bug. Need to update this. " + "See bug 147638.\"\n" + ".abort" +#else /* MacOS */ + ".abort \"This newer version of GCC may or may not have the " + "__builtin_frame_address bug. Need to update this. " + "See bug 147638.\"\n" +#endif + : "=g" (bp) + ); +#endif + return bp; +} + + +/* + * Returns the frame pointer of the calling function. + * Equivalent to __builtin_frame_address(1). + */ +static INLINE_SINGLE_CALLER uintptr_t +GetCallerFrameAddr(void) +{ + return *(uintptr_t*)GetFrameAddr(); +} + +#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) +#else +# include <sched.h> // For sched_yield. Don't ask. --Jeremy. +# define YIELD() sched_yield() +#endif + + +/* + * Standardize some Posix names on Windows. + */ + +#ifdef _WIN32 // { + +#define snprintf _snprintf +#define vsnprintf _vsnprintf + +static INLINE void +sleep(unsigned int sec) +{ + Sleep(sec * 1000); +} + +static INLINE void +usleep(unsigned long usec) +{ + Sleep(CEILING(usec, 1000)); +} + +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) + +/* + * MacOS kernel-mode needs va_copy. Based on inspection of stdarg.h + * from the MacOSX10.4u.sdk kernel framework, this should work. + * (Future versions of the SDK may break this). + */ + +#define va_copy(dest, src) ((dest) = (src)) + +#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 + +/* + * 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_INTEL_SECRET +#if !defined(COMMUNITY_SOURCE) || defined(INTEL_SOURCE) +/* + * It's ok to include INTEL_SECRET source code for non-commsrc, + * or for drops directed at Intel. + */ + #define COMMUNITY_SOURCE_INTEL_SECRET +#endif + +/* + * Convenience macros and definitions. Can often be used instead of #ifdef. + */ + +#undef DEBUG_ONLY +#undef SL_DEBUG_ONLY +#undef VMX86_SL_DEBUG +#ifdef VMX86_DEBUG +#define vmx86_debug 1 +#define DEBUG_ONLY(x) x +/* + * Be very, very, very careful with SL_DEBUG. Pls ask ganesh or min before + * using it. + */ +#define VMX86_SL_DEBUG +#define vmx86_sl_debug 1 +#define SL_DEBUG_ONLY(x) x +#else +#define vmx86_debug 0 +#define DEBUG_ONLY(x) +#define vmx86_sl_debug 0 +#define SL_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_VMM_SERIAL_LOGGING +#define vmx86_vmm_serial_log 1 +#define VMM_SERIAL_LOG_ONLY(x) x +#else +#define vmx86_vmm_serial_log 0 +#define VMM_SERIAL_LOG_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 VMX86_WGS +#define vmx86_wgs 1 +#define WGS_ONLY(x) x +#else +#define vmx86_wgs 0 +#define WGS_ONLY(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) +#else +#define WIN32_ONLY(x) +#define POSIX_ONLY(x) 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 (-1) +#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_DEBUG) || defined(ASSERT_ALWAYS_AVAILABLE) +#define WinDrvPrint(arg, ...) DbgPrint(arg, __VA_ARGS__) +#define WinDrvEngPrint(arg, ...) EngDbgPrint(arg, __VA_ARGS__) +#else +#define WinDrvPrint(arg, ...) +#define WinDrvEngPrint(arg, ...) +#endif +#endif +#endif // _WIN32 + +#endif // ifndef _VM_BASIC_DEFS_H_ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/vm_basic_types.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/vm_basic_types.h --- open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/vm_basic_types.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/vm_basic_types.h 2008-10-13 08:01:40.000000000 +0100 @@ -0,0 +1,912 @@ +/********************************************************* + * Copyright (C) 1998-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 General Public License as published by the + * Free Software Foundation version 2 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 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 + * + *********************************************************/ + +/* + * + * vm_basic_types.h -- + * + * basic data types. + */ + + +#ifndef _VM_BASIC_TYPES_H_ +#define _VM_BASIC_TYPES_H_ + +#define INCLUDE_ALLOW_USERLEVEL +#define INCLUDE_ALLOW_VMMEXT +#define INCLUDE_ALLOW_MODULE +#define INCLUDE_ALLOW_VMMON +#define INCLUDE_ALLOW_VMNIXMOD +#define INCLUDE_ALLOW_VMKERNEL +#define INCLUDE_ALLOW_VMKDRIVERS +#define INCLUDE_ALLOW_VMK_MODULE +#define INCLUDE_ALLOW_DISTRIBUTE +#define INCLUDE_ALLOW_VMCORE +#define INCLUDE_ALLOW_VMIROM +#include "includeCheck.h" + +/* STRICT ANSI means the Xserver build and X defines Bool differently. */ +#if !defined(__STRICT_ANSI__) || defined(__FreeBSD__) +typedef char Bool; +#endif + +#ifndef FALSE +#define FALSE 0 +#endif + +#ifndef TRUE +#define TRUE 1 +#endif + +#define IsBool(x) (((x) & ~1) == 0) +#define IsBool2(x, y) ((((x) | (y)) & ~1) == 0) + +/* + * Macros __i386__ and __ia64 are intrinsically defined by GCC + */ +#ifdef __i386__ +#define VM_I386 +#endif + +#ifdef _WIN64 +#define __x86_64__ +#endif + +#ifdef __x86_64__ +#define VM_X86_64 +#define VM_I386 +#define vm_x86_64 (1) +#else +#define vm_x86_64 (0) +#endif + + + +#ifdef _WIN32 +/* safe assumption for a while */ +#define VM_I386 +#endif + +#ifdef _MSC_VER +typedef unsigned __int64 uint64; +typedef signed __int64 int64; + +#pragma warning (3 :4505) // unreferenced local function +#pragma warning (disable :4018) // signed/unsigned mismatch +#pragma warning (disable :4761) // integral size mismatch in argument; conversion supplied +#pragma warning (disable :4305) // truncation from 'const int' to 'short' +#pragma warning (disable :4244) // conversion from 'unsigned short' to 'unsigned char' +#pragma warning (disable :4267) // truncation of 'size_t' +#pragma warning (disable :4146) // unary minus operator applied to unsigned type, result still unsigned +#pragma warning (disable :4142) // benign redefinition of type + +#elif __GNUC__ +/* The Xserver source compiles with -ansi -pendantic */ +#ifndef __STRICT_ANSI__ +#if defined(VM_X86_64) +typedef unsigned long uint64; +typedef long int64; +#else +typedef unsigned long long uint64; +typedef long long int64; +#endif +#elif __FreeBSD__ +typedef unsigned long long uint64; +typedef long long int64; +#endif +#else +#error - Need compiler define for int64/uint64 +#endif + +typedef unsigned int uint32; +typedef unsigned short uint16; +typedef unsigned char uint8; + +typedef int int32; +typedef short int16; +typedef char int8; + +/* + * FreeBSD (for the tools build) unconditionally defines these in + * sys/inttypes.h so don't redefine them if this file has already + * been included. [greg] + * + * This applies to Solaris as well. + */ + +/* + * Before trying to do the includes based on OS defines, see if we can use + * feature-based defines to get as much functionality as possible + */ + +#ifdef HAVE_INTTYPES_H +#include <inttypes.h> +#endif +#ifdef HAVE_SYS_TYPES_H +#include <sys/types.h> +#endif +#ifdef HAVE_SYS_INTTYPES_H +#include <sys/inttypes.h> +#endif +#ifdef HAVE_STDINT_H +#include <stdint.h> +#endif +#ifdef HAVE_STDLIB_H +#include <stdlib.h> +#endif + +#ifdef __FreeBSD__ +#include <sys/param.h> /* For __FreeBSD_version */ +#endif + +#if !defined(USING_AUTOCONF) +# if defined(__FreeBSD__) || defined(sun) +# ifdef KLD_MODULE +# include <sys/types.h> +# else +# if !defined(VMKERNEL) && (__FreeBSD_version >= 500043) +# include <inttypes.h> +# include <sys/types.h> +# else +# include <sys/inttypes.h> +# endif +# endif +# elif defined __APPLE__ +# if KERNEL +# include <sys/unistd.h> +# include <sys/types.h> /* mostly for size_t */ +# include <stdint.h> +# else +# include <unistd.h> +# include <inttypes.h> +# include <stdlib.h> +# include <stdint.h> +# endif +# else +# if !defined(__intptr_t_defined) && !defined(intptr_t) +# define __intptr_t_defined +# define intptr_t intptr_t +# ifdef VM_I386 +# ifdef VM_X86_64 +typedef int64 intptr_t; +# else +typedef int32 intptr_t; +# endif +# endif +# endif + +# ifndef _STDINT_H +# ifdef VM_I386 +# ifdef VM_X86_64 +typedef uint64 uintptr_t; +# else +typedef uint32 uintptr_t; +# endif +# endif +# endif +# endif +#endif + + +/* + * Time + * XXX These should be cleaned up. -- edward + */ + +typedef int64 VmTimeType; /* Time in microseconds */ +typedef int64 VmTimeRealClock; /* Real clock kept in microseconds */ +typedef int64 VmTimeVirtualClock; /* Virtual Clock kept in CPU cycles */ + +/* + * Printf format specifiers for size_t and 64-bit number. + * Use them like this: + * printf("%"FMT64"d\n", big); + * + * FMTH is for handles/fds. + */ + +#ifdef _MSC_VER + #define FMT64 "I64" + #ifdef VM_X86_64 + #define FMTSZ "I64" + #define FMTPD "I64" + #define FMTH "I64" + #else + #define FMTSZ "I" + #define FMTPD "I" + #define FMTH "I" + #endif +#elif __GNUC__ + #define FMTH "" + #if defined(N_PLAT_NLM) || defined(sun) || \ + (defined(__FreeBSD__) && (__FreeBSD__ + 0) && ((__FreeBSD__ + 0) < 5)) + /* + * Why (__FreeBSD__ + 0)? See bug 141008. + * Yes, we really need to test both (__FreeBSD__ + 0) and + * ((__FreeBSD__ + 0) < 5). No, we can't remove "+ 0" from + * ((__FreeBSD__ + 0) < 5). + */ + #ifdef VM_X86_64 + #define FMTSZ "l" + #define FMTPD "l" + #else + #define FMTSZ "" + #define FMTPD "" + #endif + #elif defined(__linux__) \ + || (defined(_POSIX_C_SOURCE) && _POSIX_C_SOURCE >= 200112L) \ + || (defined(_POSIX_VERSION) && _POSIX_VERSION >= 200112L) \ + || (defined(_POSIX2_VERSION) && _POSIX2_VERSION >= 200112L) + /* BSD/Darwin, Linux */ + #define FMTSZ "z" + + #if defined(VM_X86_64) || defined(__APPLE__) + #define FMTPD "l" + #else + #define FMTPD "" + #endif + #else + /* Systems with a pre-C99 libc */ + #define FMTSZ "Z" + #ifdef VM_X86_64 + #define FMTPD "l" + #else + #define FMTPD "" + #endif + #endif + #ifdef VM_X86_64 + #define FMT64 "l" + #elif defined(sun) || defined(__APPLE__) || defined(__FreeBSD__) + #define FMT64 "ll" + #else + #define FMT64 "L" + #endif +#else + #error - Need compiler define for FMT64 and FMTSZ +#endif + +/* + * Suffix for 64-bit constants. Use it like this: + * CONST64(0x7fffffffffffffff) for signed or + * CONST64U(0x7fffffffffffffff) for unsigned. + * + * 2004.08.30(thutt): + * The vmcore/asm64/gen* programs are compiled as 32-bit + * applications, but must handle 64 bit constants. If the + * 64-bit-constant defining macros are already defined, the + * definition will not be overwritten. + */ + +#if !defined(CONST64) || !defined(CONST64U) +#ifdef _MSC_VER +#define CONST64(c) c##I64 +#define CONST64U(c) c##uI64 +#elif __GNUC__ +#ifdef VM_X86_64 +#define CONST64(c) c##L +#define CONST64U(c) c##uL +#else +#define CONST64(c) c##LL +#define CONST64U(c) c##uLL +#endif +#else +#error - Need compiler define for CONST64 +#endif +#endif + +/* + * Use CONST3264/CONST3264U if you want a constant to be + * treated as a 32-bit number on 32-bit compiles and + * a 64-bit number on 64-bit compiles. Useful in the case + * of shifts, like (CONST3264U(1) << x), where x could be + * more than 31 on a 64-bit compile. + */ + +#ifdef VM_X86_64 + #define CONST3264(a) CONST64(a) + #define CONST3264U(a) CONST64U(a) +#else + #define CONST3264(a) (a) + #define CONST3264U(a) (a) +#endif + +#define MIN_INT32 ((int32)0x80000000) +#define MAX_INT32 ((int32)0x7fffffff) + +#define MIN_UINT32 ((uint32)0) +#define MAX_UINT32 ((uint32)0xffffffff) + +#define MIN_INT64 (CONST64(0x8000000000000000)) +#define MAX_INT64 (CONST64(0x7fffffffffffffff)) + +#define MIN_UINT64 (CONST64U(0)) +#define MAX_UINT64 (CONST64U(0xffffffffffffffff)) + +typedef uint8 *TCA; /* Pointer into TC (usually). */ + +/* + * Type big enough to hold an integer between 0..100 + */ +typedef uint8 Percent; +#define AsPercent(v) ((Percent)(v)) +#define CHOOSE_PERCENT AsPercent(101) + + +typedef uintptr_t VA; +typedef uintptr_t VPN; + +typedef uint64 PA; +typedef uint32 PPN; + +typedef uint64 PhysMemOff; +typedef uint64 PhysMemSize; + +/* The Xserver source compiles with -ansi -pendantic */ +#ifndef __STRICT_ANSI__ +typedef uint64 BA; +#endif +typedef uint32 BPN; +typedef uint32 PageNum; +typedef unsigned MemHandle; +typedef int32 World_ID; + +#define INVALID_WORLD_ID ((World_ID)0) + +typedef World_ID User_CartelID; +#define INVALID_CARTEL_ID INVALID_WORLD_ID + +typedef User_CartelID User_SessionID; +#define INVALID_SESSION_ID INVALID_CARTEL_ID + +typedef User_CartelID User_CartelGroupID; +#define INVALID_CARTELGROUP_ID INVALID_CARTEL_ID + +typedef uint32 Worldlet_ID; +#define INVALID_WORLDLET_ID ((Worldlet_ID)0) + +/* world page number */ +typedef uint32 WPN; + +/* The Xserver source compiles with -ansi -pendantic */ +#ifndef __STRICT_ANSI__ +typedef uint64 MA; +typedef uint32 MPN; +#endif + +/* + * This type should be used for variables that contain sector + * position/quantity. + */ +typedef uint64 SectorType; + +/* + * Linear address + */ + +typedef uintptr_t LA; +typedef uintptr_t LPN; +#define LA_2_LPN(_la) ((_la) >> PAGE_SHIFT) +#define LPN_2_LA(_lpn) ((_lpn) << PAGE_SHIFT) + +#define LAST_LPN ((((LA) 1) << (8 * sizeof(LA) - PAGE_SHIFT)) - 1) +#define LAST_LPN32 ((((LA32)1) << (8 * sizeof(LA32) - PAGE_SHIFT)) - 1) +#define LAST_LPN64 ((((LA64)1) << (8 * sizeof(LA64) - PAGE_SHIFT)) - 1) + +/* Valid bits in a LPN. */ +#define LPN_MASK LAST_LPN +#define LPN_MASK32 LAST_LPN32 +#define LPN_MASK64 LAST_LPN64 + +/* + * On 64 bit platform, address and page number types default + * to 64 bit. When we need to represent a 32 bit address, we use + * types defined below. + * + * On 32 bit platform, the following types are the same as the + * default types. + */ +typedef uint32 VA32; +typedef uint32 VPN32; +typedef uint32 LA32; +typedef uint32 LPN32; +typedef uint32 PA32; +typedef uint32 PPN32; +typedef uint32 MA32; +typedef uint32 MPN32; + +/* + * On 64 bit platform, the following types are the same as the + * default types. + */ +typedef uint64 VA64; +typedef uint64 VPN64; +typedef uint64 LA64; +typedef uint64 LPN64; +typedef uint64 PA64; +typedef uint64 PPN64; +typedef uint64 MA64; +typedef uint64 MPN64; + +/* + * VA typedefs for user world apps. + */ +typedef VA32 UserVA32; +typedef VA64 UserVA64; +typedef UserVA32 UserVAConst; /* Userspace ptr to data that we may only read. */ +typedef UserVA64 UserVA64Const; /* Used by 64-bit syscalls until conversion is finished. */ +#ifdef VMKERNEL +typedef UserVA32 UserVA; +#else +typedef void * UserVA; +#endif + + +/* + * Maximal possible PPN value (errors too) that PhysMem can handle. + * Must be at least as large as MAX_PPN which is the maximum PPN + * for any region other than buserror. + */ +#define PHYSMEM_MAX_PPN ((PPN)0xffffffff) +#define MAX_PPN ((PPN)0x1fffffff) /* Maximal observable PPN value. */ +#define INVALID_PPN ((PPN)0xffffffff) + +#define INVALID_BPN ((BPN) 0x1fffffff) + +#define INVALID_MPN ((MPN)-1) +#define MEMREF_MPN ((MPN)-2) +#define RESERVED_MPN ((MPN) 0) +/* Support 39 bits of address space, minus one page. */ +#define MAX_MPN ((MPN) 0x07ffffff) + +#define INVALID_LPN ((LPN)-1) +#define INVALID_VPN ((VPN)-1) +#define INVALID_LPN64 ((LPN64)-1) +#define INVALID_PAGENUM ((PageNum)-1) +#define INVALID_WPN ((WPN) -1) + + +/* + * Format modifier for printing VA, LA, and VPN. + * Use them like this: Log("%#"FMTLA"x\n", laddr) + */ + +#if defined(VMM64) || defined(FROBOS64) || vm_x86_64 || defined __APPLE__ +# define FMTLA "l" +# define FMTVA "l" +# define FMTVPN "l" +#else +# define FMTLA "" +# define FMTVA "" +# define FMTVPN "" +#endif + +#ifndef EXTERN +#define EXTERN extern +#endif +#define CONST const + + +#ifndef INLINE +# ifdef _MSC_VER +# define INLINE __inline +# else +# define INLINE inline +# endif +#endif + + +/* + * Annotation for data that may be exported into a DLL and used by other + * apps that load that DLL and import the data. + */ +#if defined(_WIN32) && defined(VMX86_IMPORT_DLLDATA) +# define VMX86_EXTERN_DATA extern __declspec(dllimport) +#else // !_WIN32 +# define VMX86_EXTERN_DATA extern +#endif + +#if defined(_WIN32) && !defined(VMX86_NO_THREADS) +#define THREADSPECIFIC __declspec(thread) +#else +#define THREADSPECIFIC +#endif + +/* + * Due to the wonderful "registry redirection" feature introduced in + * 64-bit Windows, if you access any key under HKLM\Software in 64-bit + * code, you need to open/create/delete that key with + * VMKEY_WOW64_32KEY if you want a consistent view with 32-bit code. + */ + +#ifdef _WIN32 +#ifdef _WIN64 +#define VMW_KEY_WOW64_32KEY KEY_WOW64_32KEY +#else +#define VMW_KEY_WOW64_32KEY 0x0 +#endif +#endif + + +/* + * Consider the following reasons functions are inlined: + * + * 1) inlined for performance reasons + * 2) inlined because it's a single-use function + * + * Functions which meet only condition 2 should be marked with this + * inline macro; It is not critical to be inlined (but there is a + * code-space & runtime savings by doing so), so when other callers + * are added the inline-ness should be removed. + */ + +#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) +/* + * Starting at version 3.3, gcc does not always inline functions marked + * 'inline' (it depends on their size). To force gcc to do so, one must use the + * extra __always_inline__ attribute. + */ +# define INLINE_SINGLE_CALLER INLINE __attribute__((__always_inline__)) +# if defined(VMM) \ + && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 1)) +# warning Verify INLINE_SINGLE_CALLER '__always_inline__' attribute (did \ + monitor size change?) +# endif +#else +# define INLINE_SINGLE_CALLER INLINE +#endif + +/* + * Used when a hard guaranteed of no inlining is needed. Very few + * instances need this since the absence of INLINE is a good hint + * that gcc will not do inlining. + */ + +#if defined(__GNUC__) && defined(VMM) +#define ABSOLUTELY_NOINLINE __attribute__((__noinline__)) +#endif + +/* + * Attributes placed on function declarations to tell the compiler + * that the function never returns. + */ + +#ifdef _MSC_VER +#define NORETURN __declspec(noreturn) +#elif __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 9) +#define NORETURN __attribute__((__noreturn__)) +#else +#define NORETURN +#endif + +/* + * GCC 3.2 inline asm needs the + constraint for input/ouput memory operands. + * Older GCCs don't know about it --hpreg + */ + +#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2) +# define VM_ASM_PLUS 1 +#else +# define VM_ASM_PLUS 0 +#endif + +/* + * Branch prediction hints: + * LIKELY(exp) - Expression exp is likely TRUE. + * UNLIKELY(exp) - Expression exp is likely FALSE. + * Usage example: + * if (LIKELY(excCode == EXC_NONE)) { + * or + * if (UNLIKELY(REAL_MODE(vc))) { + * + * We know how to predict branches on gcc3 and later (hopefully), + * all others we don't so we do nothing. + */ + +#if (__GNUC__ >= 3) +/* + * gcc3 uses __builtin_expect() to inform the compiler of an expected value. + * We use this to inform the static branch predictor. The '!!' in LIKELY + * will convert any !=0 to a 1. + */ +#define LIKELY(_exp) __builtin_expect(!!(_exp), 1) +#define UNLIKELY(_exp) __builtin_expect((_exp), 0) +#else +#define LIKELY(_exp) (_exp) +#define UNLIKELY(_exp) (_exp) +#endif + +/* + * GCC's argument checking for printf-like functions + * This is conditional until we have replaced all `"%x", void *' + * with `"0x%08x", (uint32) void *'. Note that %p prints different things + * on different platforms. Argument checking is enabled for the + * vmkernel, which has already been cleansed. + * + * fmtPos is the position of the format string argument, beginning at 1 + * varPos is the position of the variable argument, beginning at 1 + */ + +#if defined(__GNUC__) +# define PRINTF_DECL(fmtPos, varPos) __attribute__((__format__(__printf__, fmtPos, varPos))) +#else +# define PRINTF_DECL(fmtPos, varPos) +#endif + +#if defined(__GNUC__) +# define SCANF_DECL(fmtPos, varPos) __attribute__((__format__(__scanf__, fmtPos, varPos))) +#else +# define SCANF_DECL(fmtPos, varPos) +#endif + +/* + * UNUSED_PARAM should surround the parameter name and type declaration, + * e.g. "int MyFunction(int var1, UNUSED_PARAM(int var2))" + * + */ + +#ifndef UNUSED_PARAM +# if defined(__GNUC__) +# define UNUSED_PARAM(_parm) _parm __attribute__((__unused__)) +# else +# define UNUSED_PARAM(_parm) _parm +# endif +#endif + +/* + * REGPARM defaults to REGPARM3, i.e., a requent that gcc + * puts the first three arguments in registers. (It is fine + * if the function has fewer than three args.) Gcc only. + * Syntactically, put REGPARM where you'd put INLINE or NORETURN. + */ + +#if defined(__GNUC__) +# define REGPARM0 __attribute__((regparm(0))) +# define REGPARM1 __attribute__((regparm(1))) +# define REGPARM2 __attribute__((regparm(2))) +# define REGPARM3 __attribute__((regparm(3))) +# define REGPARM REGPARM3 +#else +# define REGPARM0 +# define REGPARM1 +# define REGPARM2 +# define REGPARM3 +# define REGPARM +#endif + +/* + * ALIGNED specifies minimum alignment in "n" bytes. + */ + +#ifdef __GNUC__ +#define ALIGNED(n) __attribute__((__aligned__(n))) +#else +#define ALIGNED(n) +#endif + +/* + *********************************************************************** + * STRUCT_OFFSET_CHECK -- */ /** + * + * \brief Check if the actual offsef of a member in a structure + * is what is expected + * + * + * \param[in] STRUCT Structure the member is a part of. + * \param[in] MEMBER Member to check the offset of. + * \param[in] OFFSET Expected offset of MEMBER in STRUCTURE. + * \param[in] DEBUG_EXTRA Additional bytes to be added to OFFSET to + * compensate for extra info in debug builds. + * + *********************************************************************** + */ +#ifdef VMX86_DEBUG +#define STRUCT_OFFSET_CHECK(STRUCT, MEMBER, OFFSET, DEBUG_EXTRA) \ + ASSERT_ON_COMPILE(vmk_offsetof(STRUCT, MEMBER) == (OFFSET + DEBUG_EXTRA)) +#else +#define STRUCT_OFFSET_CHECK(STRUCT, MEMBER, OFFSET, DEBUG_EXTRA) \ + ASSERT_ON_COMPILE(vmk_offsetof(STRUCT, MEMBER) == OFFSET) +#endif + +/* + *********************************************************************** + * STRUCT_SIZE_CHECK -- */ /** + * + * \brief Check if the actual size of a structure is what is expected + * + * + * \param[in] STRUCT Structure whose size is to be checked. + * \param[in] SIZE Expected size of STRUCT. + * \param[in] DEBUG_EXTRA Additional bytes to be added to SIZE to + * compensate for extra info in debug builds. + * + *********************************************************************** + */ +#ifdef VMX86_DEBUG +#define STRUCT_SIZE_CHECK(STRUCT, SIZE, DEBUG_EXTRA) \ + ASSERT_ON_COMPILE(sizeof(STRUCT) == (SIZE + DEBUG_EXTRA)) +#else +#define STRUCT_SIZE_CHECK(STRUCT, SIZE, DEBUG_EXTRA) \ + ASSERT_ON_COMPILE(sizeof(STRUCT) == SIZE) +#endif + +/* + * __func__ is a stringified function name that is part of the C99 standard. The block + * below defines __func__ on older systems where the compiler does not support that + * macro. + */ +#if defined(__GNUC__) \ + && ((__GNUC__ == 2 && __GNUC_MINOR < 96) \ + || (__GNUC__ < 2)) +# define __func__ __FUNCTION__ +#endif + +/* + * Once upon a time, this was used to silence compiler warnings that + * get generated when the compiler thinks that a function returns + * when it is marked noreturn. Don't do it. Use NOT_REACHED(). + */ + +#define INFINITE_LOOP() do { } while (1) + +/* + * On FreeBSD (for the tools build), size_t is typedef'd if _BSD_SIZE_T_ + * is defined. Use the same logic here so we don't define it twice. [greg] + */ +#ifdef __FreeBSD__ +# ifdef _BSD_SIZE_T_ +# undef _BSD_SIZE_T_ +# ifdef VM_I386 +# ifdef VM_X86_64 + typedef uint64 size_t; +# else + typedef uint32 size_t; +# endif +# endif /* VM_I386 */ +# endif + +# ifdef _BSD_SSIZE_T_ +# undef _BSD_SSIZE_T_ +# define _SSIZE_T +# define __ssize_t_defined +# define _SSIZE_T_DECLARED +# ifdef VM_I386 +# ifdef VM_X86_64 + typedef int64 ssize_t; +# else + typedef int32 ssize_t; +# endif +# endif /* VM_I386 */ +# endif + +#else +# ifndef _SIZE_T +# define _SIZE_T +# ifdef VM_I386 +# ifdef VM_X86_64 + typedef uint64 size_t; +# else + typedef uint32 size_t; +# endif +# endif /* VM_I386 */ +# endif + +# if !defined(FROBOS) && !defined(_SSIZE_T) && !defined(ssize_t) && \ + !defined(__ssize_t_defined) && !defined(_SSIZE_T_DECLARED) +# define _SSIZE_T +# define __ssize_t_defined +# define _SSIZE_T_DECLARED +# ifdef VM_I386 +# ifdef VM_X86_64 + typedef int64 ssize_t; +# else + typedef int32 ssize_t; +# endif +# endif /* VM_I386 */ +# endif + +#endif + +/* + * Format modifier for printing pid_t. On sun the pid_t is a ulong, but on + * Linux it's an int. + * Use this like this: printf("The pid is %"FMTPID".\n", pid); + */ +#ifdef sun +# ifdef VM_X86_64 +# define FMTPID "d" +# else +# define FMTPID "lu" +# endif +#else +# define FMTPID "d" +#endif + +/* + * Format modifier for printing uid_t. On sun the uid_t is a ulong, but on + * Linux it's an int. + * Use this like this: printf("The uid is %"FMTUID".\n", uid); + */ +#ifdef sun +# ifdef VM_X86_64 +# define FMTUID "u" +# else +# define FMTUID "lu" +# endif +#else +# define FMTUID "u" +#endif + +/* + * Format modifier for printing mode_t. On sun the mode_t is a ulong, but on + * Linux it's an int. + * Use this like this: printf("The mode is %"FMTMODE".\n", mode); + */ +#ifdef sun +# ifdef VM_X86_64 +# define FMTMODE "o" +# else +# define FMTMODE "lo" +# endif +#else +# define FMTMODE "o" +#endif + +/* + * Format modifier for printing time_t. Most platforms define a time_t to be + * a long int, but on FreeBSD (as of 5.0, it seems), the time_t is a signed + * size quantity. Refer to the definition of FMTSZ to see why we need silly + * preprocessor arithmetic. + * Use this like this: printf("The mode is %"FMTTIME".\n", time); + */ +#if defined(__FreeBSD__) && (__FreeBSD__ + 0) && ((__FreeBSD__ + 0) >= 5) +# define FMTTIME FMTSZ"d" +#else +# define FMTTIME "ld" +#endif + +/* + * Define MXSemaHandle here so both vmmon and vmx see this definition. + */ + +#ifdef _WIN32 +typedef uintptr_t MXSemaHandle; +#else +typedef int MXSemaHandle; +#endif + +/* + * Define type for poll device handles. + */ + +#ifdef _WIN32 +typedef uintptr_t PollDevHandle; +#else +typedef int PollDevHandle; +#endif + +/* + * Define the utf16_t type. + */ + +#if defined(_WIN32) && defined(_NATIVE_WCHAR_T_DEFINED) +typedef wchar_t utf16_t; +#else +typedef uint16 utf16_t; +#endif + +#endif /* _VM_BASIC_TYPES_H_ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/vmci_call_defs.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/vmci_call_defs.h --- open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/vmci_call_defs.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/vmci_call_defs.h 2008-10-13 08:01:40.000000000 +0100 @@ -0,0 +1,266 @@ +/********************************************************* + * Copyright (C) 2006-2007 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +#ifndef _VMCI_CALL_DEFS_H_ +#define _VMCI_CALL_DEFS_H_ + +#define INCLUDE_ALLOW_USERLEVEL +#define INCLUDE_ALLOW_VMMEXT +#define INCLUDE_ALLOW_MODULE +#define INCLUDE_ALLOW_VMMON +#define INCLUDE_ALLOW_VMCORE +#define INCLUDE_ALLOW_VMKMOD +#define INCLUDE_ALLOW_VMKERNEL +#define INCLUDE_ALLOW_DISTRIBUTE +#include "includeCheck.h" + +#include "vm_basic_types.h" +#include "vmci_defs.h" + +/* + * All structs here are an integral size of their largest member, ie. a struct + * with at least one 8-byte member will have a size that is an integral of 8. + * A struct which has a largest member of size 4 will have a size that is an + * integral of 4. This is because Windows CL enforces this rule. 32 bit gcc + * doesn't e.g. 32 bit gcc can misalign an 8 byte member if it is preceeded by + * a 4 byte member. + */ + +/* + * Base struct for vmci datagrams. + */ + +typedef struct VMCIDatagram { + VMCIHandle dst; + VMCIHandle src; + uint64 payloadSize; +} VMCIDatagram; + +typedef int +(*VMCIDatagramRecvCB)(void *clientData, // IN: client data for handler + VMCIDatagram *msg); // IN: + +/* Flag for creating a wellknown handle instead of a per context handle. */ +#define VMCI_FLAG_WELLKNOWN_DG_HND 0x1 + +/* + * Maximum supported size of a VMCI datagram for routable datagrams. + * Datagrams going to the hypervisor are allowed to be larger. + */ +#define VMCI_MAX_DG_SIZE (17 * 4096) +#define VMCI_MAX_DG_PAYLOAD_SIZE (VMCI_MAX_DG_SIZE - sizeof(VMCIDatagram)) +#define VMCI_DG_PAYLOAD(_dg) (void *)((char *)(_dg) + sizeof(VMCIDatagram)) +#define VMCI_DG_HEADERSIZE sizeof(VMCIDatagram) +#define VMCI_DG_SIZE(_dg) (VMCI_DG_HEADERSIZE + (size_t)(_dg)->payloadSize) +#define VMCI_DG_SIZE_ALIGNED(_dg) ((VMCI_DG_SIZE(_dg) + 7) & (size_t)CONST64U(0xfffffffffffffff8)) +#define VMCI_MAX_DATAGRAM_QUEUE_SIZE (VMCI_MAX_DG_SIZE * 2) + +/* + * Struct for sending VMCI_DATAGRAM_REQUEST_MAP and VMCI_DATAGRAM_REMOVE_MAP + * datagrams. Struct size is 32 bytes. All fields in struct are aligned to + * their natural alignment. + */ +typedef struct VMCIDatagramWellKnownMapMsg { + VMCIDatagram hdr; + VMCIId wellKnownID; + uint32 _pad; +} VMCIDatagramWellKnownMapMsg; + + +/* + * Struct used for querying, via VMCI_RESOURCES_QUERY, the availability of + * hypervisor resources. + * Struct size is 16 bytes. All fields in struct are aligned to their natural + * alignment. + */ +typedef struct VMCIResourcesQueuryHdr { + VMCIDatagram hdr; + uint32 numResources; + uint32 _padding; +} VMCIResourcesQueryHdr; + + +/* + * Convenience struct for negotiating vectors. Must match layout of + * VMCIResourceQueryHdr minus the VMCIDatagram header. + */ +typedef struct VMCIResourcesQueryMsg { + uint32 numResources; + uint32 _padding; + VMCI_Resource resources[1]; +} VMCIResourcesQueryMsg; + + +/* + * The maximum number of resources that can be queried using + * VMCI_RESOURCE_QUERY is 31, as the result is encoded in the lower 31 + * bits of a positive return value. Negative values are reserved for + * errors. + */ +#define VMCI_RESOURCE_QUERY_MAX_NUM 31 + +/* Maximum size for the VMCI_RESOURCE_QUERY request. */ +#define VMCI_RESOURCE_QUERY_MAX_SIZE sizeof(VMCIResourcesQueryHdr) \ + + VMCI_RESOURCE_QUERY_MAX_NUM * sizeof(VMCI_Resource) + +/* + * Struct used for making VMCI_SHAREDMEM_CREATE message. Struct size is 24 bytes. + * All fields in struct are aligned to their natural alignment. + */ +typedef struct VMCISharedMemCreateMsg { + VMCIDatagram hdr; + VMCIHandle handle; + uint32 memSize; + uint32 _padding; + /* PPNs placed after struct. */ +} VMCISharedMemCreateMsg; + + +/* + * Struct used for sending VMCI_SHAREDMEM_ATTACH messages. Same as struct used + * for create messages. + */ +typedef VMCISharedMemCreateMsg VMCISharedMemAttachMsg; + + +/* + * Struct used for sending VMCI_SHAREDMEM_DETACH messsages. Struct size is 16 + * bytes. All fields in struct are aligned to their natural alignment. + */ +typedef struct VMCISharedMemDetachMsg { + VMCIDatagram hdr; + VMCIHandle handle; +} VMCISharedMemDetachMsg; + + +/* + * Struct used for sending VMCI_SHAREDMEM_QUERY messages. Same as struct used + * for detach messages. + */ +typedef VMCISharedMemDetachMsg VMCISharedMemQueryMsg; + + +/* + * This struct is used to contain data for events. Size of this struct is a + * multiple of 8 bytes, and all fields are aligned to their natural alignment. + */ +typedef struct VMCI_EventData { + VMCI_Event event; /* 4 bytes. */ + uint32 _pad; + /* + * Event payload is put here. + */ +} VMCI_EventData; + + +/* + * We use the following inline function to access the payload data associated + * with an event data. + */ + +static INLINE void * +VMCIEventDataPayload(VMCI_EventData *evData) // IN: +{ + return (void *)((char *)evData + sizeof *evData); +} + +/* + * Define the different VMCI_EVENT payload data types here. All structs must + * be a multiple of 8 bytes, and fields must be aligned to their natural + * alignment. + */ +typedef struct VMCIEventPayload_Context { + VMCIId contextID; /* 4 bytes. */ + uint32 _pad; +} VMCIEventPayload_Context; + +typedef struct VMCIEventPayload_QP { + VMCIHandle handle; /* QueuePair handle. */ + VMCIId peerId; /* Context id of attaching/detaching VM. */ + uint32 _pad; +} VMCIEventPayload_QP; + +/* + * We define the following struct to get the size of the maximum event data + * the hypervisor may send to the guest. If adding a new event payload type + * above, add it to the following struct too (inside the union). + */ +typedef struct VMCIEventData_Max { + VMCI_EventData eventData; + union { + VMCIEventPayload_Context contextPayload; + VMCIEventPayload_QP qpPayload; + } evDataPayload; +} VMCIEventData_Max; + + +/* + * Struct used for VMCI_EVENT_SUBSCRIBE/UNSUBSCRIBE and VMCI_EVENT_HANDLER + * messages. Struct size is 32 bytes. All fields in struct are aligned to + * their natural alignment. + */ +typedef struct VMCIEventMsg { + VMCIDatagram hdr; + VMCI_EventData eventData; /* Has event type and payload. */ + /* + * Payload gets put here. + */ +} VMCIEventMsg; + + +/* + * We use the following inline function to access the payload data associated + * with an event message. + */ + +static INLINE void * +VMCIEventMsgPayload(VMCIEventMsg *eMsg) // IN: +{ + return VMCIEventDataPayload(&eMsg->eventData); +} + + +/* Flags for VMCI QueuePair API. */ +#define VMCI_QPFLAG_ATTACH_ONLY 0x1 /* Fail alloc if QP not created by peer. */ +#define VMCI_QPFLAG_LOCAL 0x2 /* Only allow attaches from local context. */ +/* Update the following (bitwise OR flags) while adding new flags. */ +#define VMCI_QP_ALL_FLAGS (VMCI_QPFLAG_ATTACH_ONLY | VMCI_QPFLAG_LOCAL) + +/* + * Structs used for QueuePair alloc and detach messages. We align fields of + * these structs to 64bit boundaries. + */ + +typedef struct VMCIQueuePairAllocMsg { + VMCIDatagram hdr; + VMCIHandle handle; + VMCIId peer; /* 32bit field. */ + uint32 flags; + uint64 produceSize; + uint64 consumeSize; + uint64 numPPNs; + /* List of PPNs placed here. */ +} VMCIQueuePairAllocMsg; + + +typedef struct VMCIQueuePairDetachMsg { + VMCIDatagram hdr; + VMCIHandle handle; +} VMCIQueuePairDetachMsg; + +#endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/vmci_defs.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/vmci_defs.h --- open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/vmci_defs.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/vmci_defs.h 2008-10-13 08:01:40.000000000 +0100 @@ -0,0 +1,290 @@ +/********************************************************* + * Copyright (C) 2005-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 General Public License as published by the + * Free Software Foundation version 2 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 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 + * + *********************************************************/ + +#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" + +/* 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 + +/* Interrupt Cause register bits. */ +#define VMCI_ICR_DATAGRAM 0x1 + +/* Interrupt Mask register bits. */ +#define VMCI_IMR_DATAGRAM 0x1 + +/* + * 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_SHAREDMEM_CREATE 2 +#define VMCI_SHAREDMEM_ATTACH 3 +#define VMCI_SHAREDMEM_DETACH 4 +#define VMCI_SHAREDMEM_QUERY 5 +#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 +#define VMCI_RESOURCE_MAX 12 + +/* VMCI Ids. */ +typedef uint32 VMCIId; + +typedef struct VMCIHandle { + VMCIId context; + VMCIId resource; +} VMCIHandle; + +static INLINE +VMCIHandle VMCI_MAKE_HANDLE(VMCIId cid, + VMCIId rid) +{ + VMCIHandle h = {cid, rid}; + return h; +} + +#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. + */ +#define VMCI_WELL_KNOWN_CONTEXT_ID 1 + +/* Todo: Change host context id to dynamic/random id. */ +#define VMCI_HOST_CONTEXT_ID 2 + +/* + * 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 0 +#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) + +/* 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 +#define VMCI_EVENT_CTX_REMOVED 1 +#define VMCI_EVENT_QP_RESUMED 2 +#define VMCI_EVENT_QP_PEER_ATTACH 3 +#define VMCI_EVENT_QP_PEER_DETACH 4 +#define VMCI_EVENT_MAX 5 + +/* 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_SM_CREATE, + VMCI_PRIV_SM_ATTACH, + 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 + +/* VMCI Discovery Service. */ + +/* Well-known handle to the discovery service. */ +#define VMCI_DS_RESOURCE_ID 1 /* Reserved resource ID for discovery service. */ +#define VMCI_DS_HANDLE VMCI_MAKE_HANDLE(VMCI_WELL_KNOWN_CONTEXT_ID, \ + VMCI_DS_RESOURCE_ID) +#define VMCI_DS_CONTEXT VMCI_MAKE_HANDLE(VMCI_WELL_KNOWN_CONTEXT_ID, \ + VMCI_CONTEXT_RESOURCE_ID) + +/* Maximum length of a DS message. */ +#define VMCI_DS_MAX_MSG_SIZE 300 + +/* Command actions. */ +#define VMCI_DS_ACTION_LOOKUP 0 +#define VMCI_DS_ACTION_REGISTER 1 +#define VMCI_DS_ACTION_UNREGISTER 2 + +/* Defines wire-protocol format for a request send to the DS from a context. */ +typedef struct VMCIDsRequestHeader { + int32 action; + int32 msgid; + VMCIHandle handle; + int32 nameLen; + int8 name[1]; +} VMCIDsRequestHeader; + + +/* Defines the wire-protocol format for a request send from the DS to a context. */ +typedef struct VMCIDsReplyHeader { + int32 msgid; + int32 code; + VMCIHandle handle; + int32 msgLen; + int8 msg[1]; +} VMCIDsReplyHeader; + +#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: " + +#endif + diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/vmciGuestKernelAPI.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/vmciGuestKernelAPI.h --- open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/vmciGuestKernelAPI.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/vmciGuestKernelAPI.h 2008-10-13 08:01:40.000000000 +0100 @@ -0,0 +1,81 @@ +/********************************************************* + * Copyright (C) 2007 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * vmciGuestKernelAPI.h -- + * + * Kernel API exported from the VMCI guest driver. + */ + +#ifndef __VMCI_GUESTKERNELAPI_H__ +#define __VMCI_GUESTKERNELAPI_H__ + +/* VMCI guest kernel API version number. */ +#define VMCI_GUEST_KERNEL_API_VERSION 1 + +/* Macros to operate on the driver version number. */ +#define VMCI_MAJOR_VERSION(v) (((v) >> 16) & 0xffff) +#define VMCI_MINOT_VERSION(v) ((v) & 0xffff) + +#define INCLUDE_ALLOW_MODULE +#include "includeCheck.h" + +#include "vmci_defs.h" +#include "vmci_call_defs.h" + +#if defined(__linux__) || defined(_WIN32) + /* XXX TODO for other guests. */ +# include "vmci_queue_pair.h" +#endif + +/* VMCI Device Usage API. */ +Bool VMCI_DeviceGet(void); +void VMCI_DeviceRelease(void); + +/* VMCI Datagram API. */ +int VMCIDatagram_CreateHnd(VMCIId resourceID, uint32 flags, + VMCIDatagramRecvCB recvCB, void *clientData, + VMCIHandle *outHandle); +int VMCIDatagram_DestroyHnd(VMCIHandle handle); +int VMCIDatagram_Send(VMCIDatagram *msg); + +/* VMCI Utility API. */ +VMCIId VMCI_GetContextID(void); +uint32 VMCI_Version(void); + +/* VMCI Event API. */ + +typedef void (*VMCI_EventCB)(VMCIId subID, VMCI_EventData *ed, + void *clientData); + +int VMCIEvent_Subscribe(VMCI_Event event, VMCI_EventCB callback, + void *callbackData, VMCIId *subID); +int VMCIEvent_Unsubscribe(VMCIId subID); + +/* VMCI Discovery Service API. */ +int VMCIDs_Lookup(const char *name, VMCIHandle *out); + +#if defined(__linux__) || defined(_WIN32) +/* VMCI QueuePair API. XXX TODO for other guests. */ +int VMCIQueuePair_Alloc(VMCIHandle *handle, VMCIQueue **produceQ, + uint64 produceSize, VMCIQueue **consumeQ, + uint64 consumeSize, VMCIId peer, uint32 flags); +int VMCIQueuePair_Detach(VMCIHandle handle); +#endif + +#endif /* !__VMCI_GUESTKERNELAPI_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/vmci_infrastructure.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/vmci_infrastructure.h --- open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/vmci_infrastructure.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/vmci_infrastructure.h 2008-10-13 08:01:40.000000000 +0100 @@ -0,0 +1,95 @@ +/********************************************************* + * Copyright (C) 2006 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * vmci_infrastructure.h -- + * + * This file implements the VMCI infrastructure. + */ + +#ifndef _VMCI_INFRASTRUCTURE_H_ +#define _VMCI_INFRASTRUCTURE_H_ + +#define INCLUDE_ALLOW_USERLEVEL +#define INCLUDE_ALLOW_VMMEXT +#define INCLUDE_ALLOW_MODULE +#define INCLUDE_ALLOW_VMMON +#define INCLUDE_ALLOW_VMCORE +#define INCLUDE_ALLOW_VMKERNEL +#define INCLUDE_ALLOW_DISTRIBUTE +#include "includeCheck.h" + +#include "vmware.h" +#include "vmci_defs.h" + +typedef enum { + VMCIOBJ_VMX_VM = 10, + VMCIOBJ_CONTEXT, + VMCIOBJ_PROCESS, + VMCIOBJ_DATAGRAM_PROCESS, + VMCIOBJ_NOT_SET, +} VMCIObjType; + +/* Guestcalls currently support a maximum of 8 uint64 arguments. */ +#define VMCI_GUESTCALL_MAX_ARGS_SIZE 64 + +/* Used to determine what checkpoint state to get and set. */ +#define VMCI_NOTIFICATION_CPT_STATE 0x1 +#define VMCI_WELLKNOWN_CPT_STATE 0x2 +#define VMCI_QP_CPT_STATE 0x3 +#define VMCI_QP_INFO_CPT_STATE 0x4 + +/* Used to control the VMCI device in the vmkernel */ +#define VMCI_DEV_RESET 0x01 +#define VMCI_DEV_QP_RESET 0x02 +#define VMCI_DEV_QUIESCE 0x03 +#define VMCI_DEV_UNQUIESCE 0x04 +#define VMCI_DEV_QP_BREAK_SHARING 0x05 + +/* + *------------------------------------------------------------------------- + * + * VMCI_Hash -- + * + * Hash function used by the Simple Datagram API. Based on the djb2 + * hash function by Dan Bernstein. + * + * Result: + * Returns guest call size. + * + * Side effects: + * None. + * + *------------------------------------------------------------------------- + */ + +static INLINE int +VMCI_Hash(VMCIHandle handle, // IN + unsigned size) // IN +{ + unsigned i; + int hash = 5381; + const uint64 handleValue = QWORD(handle.resource, handle.context); + + for (i = 0; i < sizeof handle; i++) { + hash = ((hash << 5) + hash) + (uint8)(handleValue >> (i * 8)); + } + return hash & (size - 1); +} + +#endif // _VMCI_INFRASTRUCTURE_H_ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/vmci_iocontrols.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/vmci_iocontrols.h --- open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/vmci_iocontrols.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/vmci_iocontrols.h 2008-10-13 08:01:40.000000000 +0100 @@ -0,0 +1,419 @@ +/********************************************************* + * Copyright (C) 2007 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + + +/* + * vmci_iocontrols.h + * + * The VMCI driver io controls. + */ + +#ifndef _VMCI_IOCONTROLS_H_ +#define _VMCI_IOCONTROLS_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 "vmci_defs.h" + +/* + * Driver version. + * + * Increment major version when you make an incompatible change. + * Compatibility goes both ways (old driver with new executable + * as well as new driver with old executable). + */ + +#define VMCI_VERSION_SHIFT_WIDTH 16 /* Never change this. */ +#define VMCI_MAJOR_VERSION_VALUE 8 /* Bump major version number here. */ +#define VMCI_MINOR_VERSION_VALUE 0 /* Bump minor version number here. */ + +/* Don't modify the next three macros. */ +#define VMCI_VERSION (VMCI_MAJOR_VERSION_VALUE << \ + VMCI_VERSION_SHIFT_WIDTH | \ + VMCI_MINOR_VERSION_VALUE) +#define VMCI_VERSION_MAJOR(v) ((uint32) (v) >> VMCI_VERSION_SHIFT_WIDTH) +#define VMCI_VERSION_MINOR(v) ((uint16) (v)) + +#if defined(__linux__) || defined(__APPLE__) || defined(SOLARIS) || defined(VMKERNEL) +/* + * Linux defines _IO* macros, but the core kernel code ignore the encoded + * ioctl value. It is up to individual drivers to decode the value (for + * example to look at the size of a structure to determine which version + * of a specific command should be used) or not (which is what we + * currently do, so right now the ioctl value for a given command is the + * command itself). + * + * Hence, we just define the IOCTL_VMCI_foo values directly, with no + * intermediate IOCTLCMD_ representation. + */ +# define IOCTLCMD(_cmd) IOCTL_VMCI_ ## _cmd +#else // if defined(__linux__) +/* + * On platforms other than Linux, IOCTLCMD_foo values are just numbers, and + * we build the IOCTL_VMCI_foo values around these using platform-specific + * format for encoding arguments and sizes. + */ +# define IOCTLCMD(_cmd) IOCTLCMD_VMCI_ ## _cmd +#endif + + +enum IOCTLCmd_VMCI { + /* + * We need to bracket the range of values used for ioctls, because x86_64 + * Linux forces us to explicitly register ioctl handlers by value for + * handling 32 bit ioctl syscalls. Hence FIRST and LAST. Pick something + * for FIRST that doesn't collide with vmmon (2001+). + */ +#if defined(__linux__) + IOCTLCMD(FIRST) = 1951, +#else + /* Start at 0. */ + IOCTLCMD(FIRST), +#endif + IOCTLCMD(VERSION) = IOCTLCMD(FIRST), + + /* BEGIN VMCI */ + IOCTLCMD(INIT_CONTEXT), + IOCTLCMD(CREATE_PROCESS), + IOCTLCMD(CREATE_DATAGRAM_PROCESS), + IOCTLCMD(SHAREDMEM_CREATE), + IOCTLCMD(SHAREDMEM_ATTACH), + IOCTLCMD(SHAREDMEM_QUERY), + IOCTLCMD(SHAREDMEM_DETACH), + IOCTLCMD(VERSION2), + IOCTLCMD(QUEUEPAIR_ALLOC), + IOCTLCMD(QUEUEPAIR_SETPAGEFILE), + IOCTLCMD(QUEUEPAIR_DETACH), + IOCTLCMD(DATAGRAM_SEND), + IOCTLCMD(DATAGRAM_RECEIVE), + IOCTLCMD(DATAGRAM_REQUEST_MAP), + IOCTLCMD(DATAGRAM_REMOVE_MAP), + IOCTLCMD(CTX_ADD_NOTIFICATION), + IOCTLCMD(CTX_REMOVE_NOTIFICATION), + IOCTLCMD(CTX_GET_CPT_STATE), + IOCTLCMD(CTX_SET_CPT_STATE), + IOCTLCMD(GET_CONTEXT_ID), + /* END VMCI */ + + /* + * BEGIN VMCI SOCKETS + * + * We mark the end of the vmci commands and the start of the vmci sockets + * commands since they are used in separate modules on Linux. + * */ + IOCTLCMD(LAST), + IOCTLCMD(SOCKETS_FIRST) = IOCTLCMD(LAST), + IOCTLCMD(SOCKETS_ACCEPT) = IOCTLCMD(SOCKETS_FIRST), + IOCTLCMD(SOCKETS_BIND), + IOCTLCMD(SOCKETS_CLOSE), + IOCTLCMD(SOCKETS_CONNECT), + /* + * The next two values are public (vmci_sockets.h) and cannot be changed. + * That means the number of values above these cannot be changed either + * unless the base index (specified below) is updated accordingly. + */ + IOCTLCMD(SOCKETS_GET_AF_VALUE), + IOCTLCMD(SOCKETS_GET_LOCAL_CID), + IOCTLCMD(SOCKETS_GET_SOCK_NAME), + IOCTLCMD(SOCKETS_GET_SOCK_OPT), + IOCTLCMD(SOCKETS_GET_VM_BY_NAME), + IOCTLCMD(SOCKETS_LISTEN), + IOCTLCMD(SOCKETS_RECV), + IOCTLCMD(SOCKETS_RECV_FROM), + IOCTLCMD(SOCKETS_SELECT), + IOCTLCMD(SOCKETS_SEND), + IOCTLCMD(SOCKETS_SEND_TO), + IOCTLCMD(SOCKETS_SET_SOCK_OPT), + IOCTLCMD(SOCKETS_SHUTDOWN), + IOCTLCMD(SOCKETS_SOCKET), /* 1989 on Linux. */ + /* END VMCI SOCKETS */ + + /* + * We reserve a range of 5 ioctls for VMCI Sockets to grow. We cannot + * reserve many ioctls here since we are close to overlapping with vmmon + * ioctls. Define a meta-ioctl if running out of this binary space. + */ + // Must be last. + IOCTLCMD(SOCKETS_LAST) = IOCTLCMD(SOCKETS_SOCKET) + 5, /* 1994 on Linux. */ + + /* + * The VSockets ioctls occupy the block above. We define a new range of + * VMCI ioctls to maintain binary compatibility between the user land and + * the kernel driver. Careful, vmmon ioctls start from 2001, so this means + * we can add only 5 new VMCI ioctls. Define a meta-ioctl if running out of + * this binary space. + */ + + IOCTLCMD(FIRST2), + IOCTLCMD(SET_NOTIFY) = IOCTLCMD(FIRST2), /* 1995 on Linux. */ + IOCTLCMD(LAST2), +}; + + +#if defined _WIN32 +/* + * Windows VMCI ioctl definitions. + */ + +/* These values cannot be changed since some of the ioctl values are public. */ +#define FILE_DEVICE_VMCI 0x8103 +#define VMCI_IOCTL_BASE_INDEX 0x801 +#define VMCIIOCTL_BUFFERED(name) \ + CTL_CODE(FILE_DEVICE_VMCI, \ + VMCI_IOCTL_BASE_INDEX + IOCTLCMD_VMCI_ ## name, \ + METHOD_BUFFERED, \ + FILE_ANY_ACCESS) +#define VMCIIOCTL_NEITHER(name) \ + CTL_CODE(FILE_DEVICE_VMCI, \ + VMCI_IOCTL_BASE_INDEX + IOCTLCMD_VMCI_ ## name, \ + METHOD_NEITHER, \ + FILE_ANY_ACCESS) + +#define IOCTL_VMCI_VERSION VMCIIOCTL_BUFFERED(VERSION) + +/* BEGIN VMCI */ +#define IOCTL_VMCI_INIT_CONTEXT VMCIIOCTL_BUFFERED(INIT_CONTEXT) +#define IOCTL_VMCI_CREATE_PROCESS VMCIIOCTL_BUFFERED(CREATE_PROCESS) +#define IOCTL_VMCI_CREATE_DATAGRAM_PROCESS \ + VMCIIOCTL_BUFFERED(CREATE_DATAGRAM_PROCESS) +#define IOCTL_VMCI_HYPERCALL VMCIIOCTL_BUFFERED(HYPERCALL) +#define IOCTL_VMCI_SHAREDMEM_CREATE \ + VMCIIOCTL_BUFFERED(SHAREDMEM_CREATE) +#define IOCTL_VMCI_SHAREDMEM_ATTACH \ + VMCIIOCTL_BUFFERED(SHAREDMEM_ATTACH) +#define IOCTL_VMCI_SHAREDMEM_QUERY \ + VMCIIOCTL_BUFFERED(SHAREDMEM_QUERY) +#define IOCTL_VMCI_SHAREDMEM_DETACH \ + VMCIIOCTL_BUFFERED(SHAREDMEM_DETACH) +#define IOCTL_VMCI_VERSION2 VMCIIOCTL_BUFFERED(VERSION2) +#define IOCTL_VMCI_QUEUEPAIR_ALLOC \ + VMCIIOCTL_BUFFERED(QUEUEPAIR_ALLOC) +#define IOCTL_VMCI_QUEUEPAIR_SETPAGEFILE \ + VMCIIOCTL_BUFFERED(QUEUEPAIR_SETPAGEFILE) +#define IOCTL_VMCI_QUEUEPAIR_DETACH \ + VMCIIOCTL_BUFFERED(QUEUEPAIR_DETACH) +#define IOCTL_VMCI_DATAGRAM_SEND VMCIIOCTL_BUFFERED(DATAGRAM_SEND) +#define IOCTL_VMCI_DATAGRAM_RECEIVE VMCIIOCTL_NEITHER(DATAGRAM_RECEIVE) +#define IOCTL_VMCI_DATAGRAM_REQUEST_MAP VMCIIOCTL_BUFFERED(DATAGRAM_REQUEST_MAP) +#define IOCTL_VMCI_DATAGRAM_REMOVE_MAP VMCIIOCTL_BUFFERED(DATAGRAM_REMOVE_MAP) +#define IOCTL_VMCI_CTX_ADD_NOTIFICATION VMCIIOCTL_BUFFERED(CTX_ADD_NOTIFICATION) +#define IOCTL_VMCI_CTX_REMOVE_NOTIFICATION \ + VMCIIOCTL_BUFFERED(CTX_REMOVE_NOTIFICATION) +#define IOCTL_VMCI_CTX_GET_CPT_STATE \ + VMCIIOCTL_BUFFERED(CTX_GET_CPT_STATE) +#define IOCTL_VMCI_CTX_SET_CPT_STATE \ + VMCIIOCTL_BUFFERED(CTX_SET_CPT_STATE) +#define IOCTL_VMCI_GET_CONTEXT_ID \ + VMCIIOCTL_BUFFERED(GET_CONTEXT_ID) +/* END VMCI */ + +/* BEGIN VMCI SOCKETS */ +#define IOCTL_VMCI_SOCKETS_ACCEPT \ + VMCIIOCTL_BUFFERED(SOCKETS_ACCEPT) +#define IOCTL_VMCI_SOCKETS_BIND \ + VMCIIOCTL_BUFFERED(SOCKETS_BIND) +#define IOCTL_VMCI_SOCKETS_CLOSE \ + VMCIIOCTL_BUFFERED(SOCKETS_CLOSE) +#define IOCTL_VMCI_SOCKETS_CONNECT \ + VMCIIOCTL_BUFFERED(SOCKETS_CONNECT) +#define IOCTL_VMCI_SOCKETS_GET_AF_VALUE \ + VMCIIOCTL_BUFFERED(SOCKETS_GET_AF_VALUE) +#define IOCTL_VMCI_SOCKETS_GET_LOCAL_CID \ + VMCIIOCTL_BUFFERED(SOCKETS_GET_LOCAL_CID) +#define IOCTL_VMCI_SOCKETS_GET_SOCK_NAME \ + VMCIIOCTL_BUFFERED(SOCKETS_GET_SOCK_NAME) +#define IOCTL_VMCI_SOCKETS_GET_SOCK_OPT \ + VMCIIOCTL_BUFFERED(SOCKETS_GET_SOCK_OPT) +#define IOCTL_VMCI_SOCKETS_GET_VM_BY_NAME \ + VMCIIOCTL_BUFFERED(SOCKETS_GET_VM_BY_NAME) +#define IOCTL_VMCI_SOCKETS_LISTEN \ + VMCIIOCTL_BUFFERED(SOCKETS_LISTEN) +#define IOCTL_VMCI_SOCKETS_RECV \ + VMCIIOCTL_BUFFERED(SOCKETS_RECV) +#define IOCTL_VMCI_SOCKETS_RECV_FROM \ + VMCIIOCTL_BUFFERED(SOCKETS_RECV_FROM) +#define IOCTL_VMCI_SOCKETS_SELECT \ + VMCIIOCTL_BUFFERED(SOCKETS_SELECT) +#define IOCTL_VMCI_SOCKETS_SEND \ + VMCIIOCTL_BUFFERED(SOCKETS_SEND) +#define IOCTL_VMCI_SOCKETS_SEND_TO \ + VMCIIOCTL_BUFFERED(SOCKETS_SEND_TO) +#define IOCTL_VMCI_SOCKETS_SET_SOCK_OPT \ + VMCIIOCTL_BUFFERED(SOCKETS_SET_SOCK_OPT) +#define IOCTL_VMCI_SOCKETS_SHUTDOWN \ + VMCIIOCTL_BUFFERED(SOCKETS_SHUTDOWN) +#define IOCTL_VMCI_SOCKETS_SOCKET \ + VMCIIOCTL_BUFFERED(SOCKETS_SOCKET) +/* END VMCI SOCKETS */ + +#endif // _WIN32 + + +/* + * VMCI driver initialization. This block can also be used to + * pass initial group membership etc. + */ +typedef struct VMCIInitBlock { + VMCIId cid; + VMCIPrivilegeFlags flags; +#ifdef _WIN32 + uint64 event; /* Handle for signalling vmci calls on windows. */ +#endif // _WIN32 +} VMCIInitBlock; + +typedef struct VMCISharedMemInfo { + VMCIHandle handle; + uint32 size; + uint32 result; + VA64 va; /* Currently only used in the guest. */ + char pageFileName[VMCI_PATH_MAX]; +} VMCISharedMemInfo; + +typedef struct VMCIQueuePairAllocInfo { + VMCIHandle handle; + VMCIId peer; + uint32 flags; + uint64 produceSize; + uint64 consumeSize; + VA64 producePageFile; /* User VA. */ + VA64 consumePageFile; /* User VA. */ + uint64 producePageFileSize; /* Size of the file name array. */ + uint64 consumePageFileSize; /* Size of the file name array. */ + int32 result; + uint32 _pad; +} VMCIQueuePairAllocInfo; + +typedef struct VMCIQueuePairPageFileInfo { + VMCIHandle handle; + VA64 producePageFile; /* User VA. */ + VA64 consumePageFile; /* User VA. */ + uint64 producePageFileSize; /* Size of the file name array. */ + uint64 consumePageFileSize; /* Size of the file name array. */ + int32 result; + uint32 _pad; +} VMCIQueuePairPageFileInfo; + +typedef struct VMCIQueuePairDetachInfo { + VMCIHandle handle; + int32 result; + uint32 _pad; +} VMCIQueuePairDetachInfo; + +typedef struct VMCIDatagramSendRecvInfo { + VA64 addr; + uint32 len; + int32 result; +} VMCIDatagramSendRecvInfo; + +/* Used to create datagram endpoints in guest or host userlevel. */ +typedef struct VMCIDatagramCreateInfo { + VMCIId resourceID; + uint32 flags; + int eventHnd; + int result; // result of handle create operation + VMCIHandle handle; // handle if successfull +} VMCIDatagramCreateInfo; + +/* Used to add/remove well-known datagram mappings. */ +typedef struct VMCIDatagramMapInfo { + VMCIId wellKnownID; + int result; +} VMCIDatagramMapInfo; + + +/* Used to add/remove remote context notifications. */ +typedef struct VMCINotifyAddRemoveInfo { + VMCIId remoteCID; + int result; +} VMCINotifyAddRemoveInfo; + + +/* Used to set/get current context's checkpoint state. */ +typedef struct VMCICptBufInfo { + VA64 cptBuf; + uint32 cptType; + uint32 bufSize; + int32 result; + uint32 _pad; +} VMCICptBufInfo; + +/* Used to pass notify flag's address to the host driver. */ +typedef struct VMCISetNotifyInfo { + VA64 notifyUVA; + int32 result; + uint32 _pad; +} VMCISetNotifyInfo; + + +#ifdef __APPLE__ +/* + * Mac OS ioctl definitions. + * + * Mac OS defines _IO* macros, and the core kernel code uses the size encoded + * in the ioctl value to copy the memory back and forth (depending on the + * direction encoded in the ioctl value) between the user and kernel address + * spaces. + * See iocontrolsMacOS.h for details on how this is done. We use sockets only + * for vmci. + */ + +#include <sys/ioccom.h> + +enum VMCrossTalkSockOpt { + VMCI_SO_VERSION = 0, + VMCI_SO_CONTEXT = IOCTL_VMCI_INIT_CONTEXT, + VMCI_SO_PROCESS = IOCTL_VMCI_CREATE_PROCESS, + VMCI_SO_DATAGRAM_PROCESS = IOCTL_VMCI_CREATE_DATAGRAM_PROCESS, + VMCI_SO_SHAREDMEM_CREATE = IOCTL_VMCI_SHAREDMEM_CREATE, + VMCI_SO_SHAREDMEM_ATTACH = IOCTL_VMCI_SHAREDMEM_ATTACH, + VMCI_SO_SHAREDMEM_QUERY = IOCTL_VMCI_SHAREDMEM_QUERY, + VMCI_SO_SHAREDMEM_DETACH = IOCTL_VMCI_SHAREDMEM_DETACH, + VMCI_SO_VERSION2 = IOCTL_VMCI_VERSION2, + VMCI_SO_QUEUEPAIR_ALLOC = IOCTL_VMCI_QUEUEPAIR_ALLOC, + VMCI_SO_QUEUEPAIR_SETPAGEFILE = IOCTL_VMCI_QUEUEPAIR_SETPAGEFILE, + VMCI_SO_QUEUEPAIR_DETACH = IOCTL_VMCI_QUEUEPAIR_DETACH, + VMCI_SO_DATAGRAM_SEND = IOCTL_VMCI_DATAGRAM_SEND, + VMCI_SO_DATAGRAM_RECEIVE = IOCTL_VMCI_DATAGRAM_RECEIVE, + VMCI_SO_DATAGRAM_REQUEST_MAP = IOCTL_VMCI_DATAGRAM_REQUEST_MAP, + VMCI_SO_DATAGRAM_REMOVE_MAP = IOCTL_VMCI_DATAGRAM_REMOVE_MAP, + VMCI_SO_CTX_ADD_NOTIFICATION = IOCTL_VMCI_CTX_ADD_NOTIFICATION, + VMCI_SO_CTX_REMOVE_NOTIFICATION = IOCTL_VMCI_CTX_REMOVE_NOTIFICATION, + VMCI_SO_CTX_GET_CPT_STATE = IOCTL_VMCI_CTX_GET_CPT_STATE, + VMCI_SO_CTX_SET_CPT_STATE = IOCTL_VMCI_CTX_SET_CPT_STATE, + VMCI_SO_GET_CONTEXT_ID = IOCTL_VMCI_GET_CONTEXT_ID, + VMCI_SO_USERFD, +}; + +# define VMCI_MACOS_HOST_DEVICE_BASE "com.vmware.kext.vmci" +# ifdef VMX86_DEVEL +# define VMCI_MACOS_HOST_DEVICE VMCI_MACOS_HOST_DEVICE_BASE ".devel" +# else +# define VMCI_MACOS_HOST_DEVICE VMCI_MACOS_HOST_DEVICE_BASE +# endif + +#endif + +/* Clean up helper macros */ +#undef IOCTLCMD + +#endif // ifndef _VMCI_IOCONTROLS_H_ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/vmci_kernel_if.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/vmci_kernel_if.h --- open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/vmci_kernel_if.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/vmci_kernel_if.h 2008-10-13 08:01:40.000000000 +0100 @@ -0,0 +1,266 @@ +/********************************************************* + * Copyright (C) 2006 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * vmci_kernel_if.h -- + * + * This file defines helper functions for VMCI host _and_ guest + * kernel code. It must work for windows, macosx, vmkernel and + * linux kernel, ie. using defines where necessary. + */ + +#ifndef _VMCI_KERNEL_IF_H_ +#define _VMCI_KERNEL_IF_H_ + +#if !defined(linux) && !defined(_WIN32) && !defined(__APPLE__) && \ + !defined(VMKERNEL) && !defined(SOLARIS) +#error "Platform not supported." +#endif + +#if defined(_WIN32) +#include <ntddk.h> +#endif + +#if defined(linux) && !defined(VMKERNEL) +# include "compat_version.h" +# include "compat_wait.h" +# include "compat_spinlock.h" +# include "compat_semaphore.h" +#endif // linux + +#ifdef __APPLE__ +# include <IOKit/IOLib.h> +#include <mach/task.h> +#include <mach/semaphore.h> +#endif + +#ifdef VMKERNEL +#include "splock.h" +#include "semaphore_ext.h" +#endif + +#ifdef SOLARIS +# include <sys/mutex.h> +# include <sys/poll.h> +# include <sys/semaphore.h> +#endif + +#include "vm_basic_types.h" +#include "vmci_defs.h" + +/* Flags for specifying memory type. */ +#define VMCI_MEMORY_NORMAL 0x0 +#define VMCI_MEMORY_ATOMIC 0x1 +#define VMCI_MEMORY_NONPAGED 0x2 + +/* Platform specific type definitions. */ + +#if defined(VMKERNEL) + typedef SP_SpinLock VMCILock; + typedef SP_IRQL VMCILockFlags; + typedef Semaphore VMCIEvent; + typedef Semaphore VMCIMutex; +#elif defined(linux) + typedef spinlock_t VMCILock; + typedef unsigned long VMCILockFlags; + typedef wait_queue_head_t VMCIEvent; + typedef struct semaphore VMCIMutex; + typedef PPN *VMCIPpnList; /* List of PPNs in produce/consume queue. */ +#elif defined(__APPLE__) + typedef IOLock *VMCILock; + typedef unsigned long VMCILockFlags; + typedef semaphore_t VMCIEvent; + typedef IOLock *VMCIMutex; +#elif defined(_WIN32) + typedef KSPIN_LOCK VMCILock; + typedef KIRQL VMCILockFlags; + typedef KEVENT VMCIEvent; + typedef FAST_MUTEX VMCIMutex; + typedef PMDL VMCIPpnList; /* MDL to map the produce/consume queue. */ +#elif defined(SOLARIS) + typedef kmutex_t VMCILock; + typedef unsigned long VMCILockFlags; + typedef ksema_t VMCIEvent; +#endif // VMKERNEL + +/* Callback needed for correctly waiting on events. */ +typedef int (*VMCIEventReleaseCB)(void *clientData); + +/* + * The VMCI locks use a ranking scheme similar to the one used by + * vmkernel. While holding a lock L1 with rank R1, only locks with + * rank higher than R1 may be grabbed. The available ranks for VMCI + * locks are (in descending order): + * - VMCI_LOCK_RANK_HIGH_BH : to be used for locks grabbed while executing + * in a bottom half and not held while grabbing other locks. + * - VMCI_LOCK_RANK_MIDDLE_BH : to be for locks grabbed while executing in a + * bottom half and held while grabbing locks of rank VMCI_LOCK_RANK_HIGH_BH. + * - VMCI_LOCK_RANK_LOW_BH : to be for locks grabbed while executing in a + * bottom half and held while grabbing locks of rank + * VMCI_LOCK_RANK_MIDDLE_BH. + * - VMCI_LOCK_RANK_HIGHEST : to be used for locks that are not held while + * grabbing other locks except system locks with higher ranks and bottom + * half locks. + * - VMCI_LOCK_RANK_HIGHER : to be used for locks that are held while + * grabbing locks of rank VMCI_LOCK_RANK_HIGHEST or higher. + * - VMCI_LOCK_RANK_HIGH : to be used for locks that are held while + * grabbing locks of rank VMCI_LOCK_RANK_HIGHER or higher. This is + * the highest lock rank used by core VMCI services + * - VMCI_LOCK_RANK_MIDDLE : to be used for locks that are held while + * grabbing locks of rank VMCI_LOCK_RANK_HIGH or higher. + * - VMCI_LOCK_RANK_LOW : to be used for locks that are held while + * grabbing locks of rank VMCI_LOCK_RANK_MIDDLE or higher. + * - VMCI_LOCK_RANK_LOWEST : to be used for locks that are held while + * grabbing locks of rank VMCI_LOCK_RANK_LOW or higher. + */ +#ifdef VMKERNEL + typedef SP_Rank VMCILockRank; + + #define VMCI_LOCK_RANK_HIGH_BH SP_RANK_IRQ_LEAF + #define VMCI_LOCK_RANK_MIDDLE_BH (SP_RANK_IRQ_LEAF-1) + #define VMCI_LOCK_RANK_LOW_BH SP_RANK_IRQ_LOWEST + #define VMCI_LOCK_RANK_HIGHEST SP_RANK_SHM_MGR-1 +#else + typedef unsigned long VMCILockRank; + + #define VMCI_LOCK_RANK_HIGH_BH 0x4000 + #define VMCI_LOCK_RANK_MIDDLE_BH 0x2000 + #define VMCI_LOCK_RANK_LOW_BH 0x1000 + #define VMCI_LOCK_RANK_HIGHEST 0x0fff +#endif // VMKERNEL +#define VMCI_LOCK_RANK_HIGHER (VMCI_LOCK_RANK_HIGHEST-1) +#define VMCI_LOCK_RANK_HIGH (VMCI_LOCK_RANK_HIGHER-1) +#define VMCI_LOCK_RANK_MIDDLE_HIGH (VMCI_LOCK_RANK_HIGH-1) +#define VMCI_LOCK_RANK_MIDDLE (VMCI_LOCK_RANK_MIDDLE_HIGH-1) +#define VMCI_LOCK_RANK_MIDDLE_LOW (VMCI_LOCK_RANK_MIDDLE-1) +#define VMCI_LOCK_RANK_LOW (VMCI_LOCK_RANK_MIDDLE_LOW-1) +#define VMCI_LOCK_RANK_LOWEST (VMCI_LOCK_RANK_LOW-1) + + +/* + * In vmkernel, we try to reduce the amount of memory mapped into the + * virtual address space by only mapping the memory of buffered + * datagrams when copying from and to the guest. In other OSes, + * regular kernel memory is used. VMCIBuffer is used to reference + * possibly unmapped memory. + */ + +#ifdef VMKERNEL +typedef MPN VMCIBuffer; +#define VMCI_BUFFER_INVALID INVALID_MPN +#else +typedef void * VMCIBuffer; +#define VMCI_BUFFER_INVALID NULL +#endif + +/* + * Host specific struct used for signalling. + */ + +typedef struct VMCIHost { +#if defined(VMKERNEL) + World_ID vmmWorldID; +#elif defined(linux) + wait_queue_head_t waitQueue; +#elif defined(__APPLE__) + struct Socket *socket; /* vmci Socket object on Mac OS. */ +#elif defined(_WIN32) + KEVENT *callEvent; /* Ptr to userlevel event used when signalling + * new pending guestcalls in kernel. + */ +#elif defined(SOLARIS) + struct pollhead pollhead; /* Per datagram handle pollhead structure to + * be treated as a black-box. None of its + * fields should be referenced. + */ +#endif +} VMCIHost; + + +void VMCI_InitLock(VMCILock *lock, char *name, VMCILockRank rank); +void VMCI_CleanupLock(VMCILock *lock); +void VMCI_GrabLock(VMCILock *lock, VMCILockFlags *flags); +void VMCI_ReleaseLock(VMCILock *lock, VMCILockFlags flags); +void VMCI_GrabLock_BH(VMCILock *lock, VMCILockFlags *flags); +void VMCI_ReleaseLock_BH(VMCILock *lock, VMCILockFlags flags); + +void VMCIHost_InitContext(VMCIHost *hostContext, uintptr_t eventHnd); +void VMCIHost_ReleaseContext(VMCIHost *hostContext); +void VMCIHost_SignalCall(VMCIHost *hostContext); +void VMCIHost_ClearCall(VMCIHost *hostContext); +Bool VMCIHost_WaitForCallLocked(VMCIHost *hostContext, + VMCILock *lock, + VMCILockFlags *flags, + Bool useBH); + +void *VMCI_AllocKernelMem(size_t size, int flags); +void VMCI_FreeKernelMem(void *ptr, size_t size); +VMCIBuffer VMCI_AllocBuffer(size_t size, int flags); +void *VMCI_MapBuffer(VMCIBuffer buf); +void VMCI_ReleaseBuffer(void *ptr); +void VMCI_FreeBuffer(VMCIBuffer buf, size_t size); +#ifdef SOLARIS +int VMCI_CopyToUser(void *dst, const void *src, unsigned int len, int mode); +#else +int VMCI_CopyToUser(void *dst, const void *src, unsigned int len); +/* + * Don't need the following for guests, hence no Solaris code for this + * function. + */ +Bool VMCIWellKnownID_AllowMap(VMCIId wellKnownID, + VMCIPrivilegeFlags privFlags); +#endif + +void VMCI_CreateEvent(VMCIEvent *event); +void VMCI_DestroyEvent(VMCIEvent *event); +void VMCI_SignalEvent(VMCIEvent *event); +void VMCI_WaitOnEvent(VMCIEvent *event, VMCIEventReleaseCB releaseCB, + void *clientData); + +/* XXX TODO for VMKERNEL (host) and Solaris (guest). */ +#if !defined(VMKERNEL) && (defined(__linux__) || defined(_WIN32) || \ + defined(__APPLE__)) +int VMCI_CopyFromUser(void *dst, const void *src, size_t len); +#endif + +#if !defined(SOLARIS) +int VMCIMutex_Init(VMCIMutex *mutex); +void VMCIMutex_Destroy(VMCIMutex *mutex); +void VMCIMutex_Acquire(VMCIMutex *mutex); +void VMCIMutex_Release(VMCIMutex *mutex); +#endif + +/* XXX TODO for Solaris (guest). */ +#if !defined(VMKERNEL) && (defined(__linux__) || defined(_WIN32)) +VA VMCI_AllocQueueKVA(uint64 size); +void VMCI_FreeQueueKVA(VA va, uint64 size); +typedef struct PPNSet { + uint64 numProducePages; + uint64 numConsumePages; + VMCIPpnList producePPNs; + VMCIPpnList consumePPNs; + Bool initialized; +} PPNSet; +int VMCI_AllocPPNSet(VA produceVA, uint64 numProducePages, VA consumeVA, + uint64 numConsumePages, PPNSet *ppnSet); +void VMCI_FreePPNSet(PPNSet *ppnSet); +int VMCI_PopulatePPNList(uint8 *callBuf, const PPNSet *ppnSet); +#endif + +#endif // _VMCI_KERNEL_IF_H_ + diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/vmci_queue_pair.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/vmci_queue_pair.h --- open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/vmci_queue_pair.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/vmci_queue_pair.h 2008-10-13 08:01:40.000000000 +0100 @@ -0,0 +1,668 @@ +/********************************************************* + * Copyright (C) 2007 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +#ifndef _VMCI_QUEUE_PAIR_H_ +#define _VMCI_QUEUE_PAIR_H_ + +/* + * + * vmci_queue_pair.h -- + * + * Defines queue layout in memory, and helper functions to enqueue and + * dequeue items. XXX needs checksumming? + */ + +#define INCLUDE_ALLOW_MODULE +#define INCLUDE_ALLOW_VMX +#include "includeCheck.h" + +#include "vm_basic_defs.h" +#include "vm_basic_types.h" +#include "vm_atomic.h" +#include "vmci_defs.h" +#include "vm_assert.h" +#if defined(__linux__) && defined(__KERNEL__) +# include "vmci_kernel_if.h" +#endif + + +#if defined(__linux__) && defined(__KERNEL__) +struct page; +#endif + + +/* + * For a queue of buffer 'size' bytes, the tail and head pointers will be in + * the range [0, size-1]. + */ + +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; + +typedef struct VMCIQueue { + VMCIQueueHeader queueHeader; + uint8 _padding[PAGE_SIZE - sizeof(VMCIQueueHeader)]; +#if defined(__linux__) && defined(__KERNEL__) + struct page *page[0]; /* List of pages containing queue data. */ +#else + uint8 buffer[0]; /* Buffer containing data. */ +#endif +} VMCIQueue; + + +typedef int VMCIMemcpyToQueueFunc(VMCIQueue *queue, uint64 queueOffset, + const void *src, size_t srcOffset, + size_t size); +typedef int VMCIMemcpyFromQueueFunc(void *dest, size_t destOffset, + const VMCIQueue *queue, uint64 queueOffset, + size_t size); + +#if defined(__linux__) && defined(__KERNEL__) +int VMCIMemcpyToQueue(VMCIQueue *queue, uint64 queueOffset, const void *src, + size_t srcOffset, size_t size); +int VMCIMemcpyFromQueue(void *dest, size_t destOffset, const VMCIQueue *queue, + uint64 queueOffset, size_t size); +int VMCIMemcpyToQueueV(VMCIQueue *queue, uint64 queueOffset, const void *src, + size_t srcOffset, size_t size); +int VMCIMemcpyFromQueueV(void *dest, size_t destOffset, const VMCIQueue *queue, + uint64 queueOffset, size_t size); +#elif defined(_WIN32) && defined(WINNT_DDK) +int VMCIMemcpyToQueue(VMCIQueue *queue, uint64 queueOffset, const void *src, + size_t srcOffset, size_t size); +int VMCIMemcpyFromQueue(void *dest, size_t destOffset, const VMCIQueue *queue, + uint64 queueOffset, size_t size); +#else + + +/* + *----------------------------------------------------------------------------- + * + * VMCIMemcpyToQueue -- + * + * Wrapper for memcpy --- copies from a given buffer to a VMCI Queue. + * Assumes that offset + size does not wrap around in the queue. + * + * Results: + * Zero on success, negative error code on failure. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static INLINE int +VMCIMemcpyToQueue(VMCIQueue *queue, // OUT: + uint64 queueOffset, // IN: + const void *src, // IN: + size_t srcOffset, // IN: + size_t size) // IN: +{ + memcpy(queue->buffer + queueOffset, (uint8 *)src + srcOffset, size); + return 0; +} + + +/* + *----------------------------------------------------------------------------- + * + * VMCIMemcpyFromQueue -- + * + * Wrapper for memcpy --- copies to a given buffer from a VMCI Queue. + * Assumes that offset + size does not wrap around in the queue. + * + * Results: + * Zero on success, negative error code on failure. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static INLINE int +VMCIMemcpyFromQueue(void *dest, // OUT: + size_t destOffset, // IN: + const VMCIQueue *queue, // IN: + uint64 queueOffset, // IN: + size_t size) // IN: +{ + memcpy((uint8 *)dest + destOffset, queue->buffer + queueOffset, size); + return 0; +} +#endif /* __linux__ && __KERNEL__ */ + + +/* + * 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 +# define QP_MAX_QUEUE_SIZE_ARCH CONST64U(0xffffffff) +# define QPAtomic_ReadOffset(x) Atomic_Read32((Atomic_uint32 *)(x)) +# define QPAtomic_WriteOffset(x, y) \ + Atomic_Write32((Atomic_uint32 *)(x), (uint32)(y)) +#endif + + +/* + *----------------------------------------------------------------------------- + * + * VMCIQueue_CheckAlignment -- + * + * Checks if the given queue is aligned to page boundary. + * + * Results: + * TRUE or FALSE. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static INLINE Bool +VMCIQueue_CheckAlignment(const VMCIQueue *queue) // IN: +{ + return ((uintptr_t)queue & (PAGE_SIZE - 1)) == 0; +} + + +static INLINE void +VMCIQueue_GetPointers(const VMCIQueue *produceQ, + const VMCIQueue *consumeQ, + uint64 *producerTail, + uint64 *consumerHead) +{ + *producerTail = QPAtomic_ReadOffset(&produceQ->queueHeader.producerTail); + *consumerHead = QPAtomic_ReadOffset(&consumeQ->queueHeader.consumerHead); +} + + +/* + *----------------------------------------------------------------------------- + * + * VMCIQueue_ResetPointers -- + * + * Reset the tail pointer (of "this" queue) and the head pointer (of + * "peer" queue). + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static INLINE void +VMCIQueue_ResetPointers(VMCIQueue *queue) // IN: +{ + QPAtomic_WriteOffset(&queue->queueHeader.producerTail, CONST64U(0)); + QPAtomic_WriteOffset(&queue->queueHeader.consumerHead, CONST64U(0)); +} + + +/* + *----------------------------------------------------------------------------- + * + * VMCIQueue_Init -- + * + * Initializes a queue's state (head & tail pointers). + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static INLINE void +VMCIQueue_Init(const VMCIHandle handle, // IN: + VMCIQueue *queue) // IN: +{ + ASSERT_NOT_IMPLEMENTED(VMCIQueue_CheckAlignment(queue)); + queue->queueHeader.handle = handle; + VMCIQueue_ResetPointers(queue); +} + + +/* + *----------------------------------------------------------------------------- + * + * VMCIQueueFreeSpaceInt -- + * + * 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. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static INLINE int +VMCIQueueFreeSpaceInt(const VMCIQueue *produceQueue, // IN: + const VMCIQueue *consumeQueue, // IN: + const uint64 produceQSize, // IN: + uint64 *freeSpace) // OUT: +{ + const uint64 tail = + QPAtomic_ReadOffset(&produceQueue->queueHeader.producerTail); + const uint64 head = + QPAtomic_ReadOffset(&consumeQueue->queueHeader.consumerHead); + + ASSERT(freeSpace); + + 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 VMCI_SUCCESS; +} + + +/* + *----------------------------------------------------------------------------- + * + * VMCIQueue_FreeSpace -- + * + * Finds available free space in a produce queue to enqueue more data. + * + * Results: + * On success, free space size in bytes (up to MAX_INT64). + * On failure, appropriate error code. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static INLINE int64 +VMCIQueue_FreeSpace(const VMCIQueue *produceQueue, // IN: + const VMCIQueue *consumeQueue, // IN: + const uint64 produceQSize) // IN: +{ + uint64 freeSpace; + int retval; + + retval = VMCIQueueFreeSpaceInt(produceQueue, consumeQueue, produceQSize, + &freeSpace); + + if (retval != VMCI_SUCCESS) { + return retval; + } + + return MIN(freeSpace, MAX_INT64); +} + + +/* + *----------------------------------------------------------------------------- + * + * VMCIQueue_BufReady -- + * + * Finds available data to dequeue from a consume queue. + * + * Results: + * On success, available data size in bytes (up to MAX_INT64). + * On failure, appropriate error code. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static INLINE int64 +VMCIQueue_BufReady(const VMCIQueue *consumeQueue, // IN: + const VMCIQueue *produceQueue, // IN: + const uint64 consumeQSize) // IN: +{ + int retval; + uint64 freeSpace; + + retval = VMCIQueueFreeSpaceInt(consumeQueue, produceQueue, + consumeQSize, &freeSpace); + if (retval != VMCI_SUCCESS) { + return retval; + } else { + uint64 available = consumeQSize - freeSpace - 1; + return MIN(available, MAX_INT64); + } +} + + +/* + *----------------------------------------------------------------------------- + * + * AddPointer -- + * + * 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 +AddPointer(Atomic_uint64 *var, // IN: + size_t add, // IN: + uint64 max) // IN: +{ + uint64 newVal = QPAtomic_ReadOffset(var); + + if (newVal >= max - add) { + newVal -= max; + } + newVal += add; + + QPAtomic_WriteOffset(var, newVal); +} + + +/* + *----------------------------------------------------------------------------- + * + * __VMCIQueue_Enqueue -- + * + * Enqueues a given buffer to the produce queue using the provided + * function. As many bytes as possible (space available in the queue) + * are enqueued. + * + * Results: + * VMCI_ERROR_QUEUEPAIR_NOSPACE if no space was available to enqueue data. + * VMCI_ERROR_INVALID_SIZE, if any queue pointer is outside the queue + * (as defined by the queue size). + * Otherwise, the number of bytes written to the queue is returned. + * + * Side effects: + * Updates the tail pointer of the produce queue. + * + *----------------------------------------------------------------------------- + */ + +static INLINE ssize_t +__VMCIQueue_Enqueue(VMCIQueue *produceQueue, // IN: + const VMCIQueue *consumeQueue, // IN: + const uint64 produceQSize, // IN: + const void *buf, // IN: + size_t bufSize, // IN: + VMCIMemcpyToQueueFunc memcpyToQueue) // IN: +{ + const int64 freeSpace = VMCIQueue_FreeSpace(produceQueue, consumeQueue, + produceQSize); + const uint64 tail = + QPAtomic_ReadOffset(&produceQueue->queueHeader.producerTail); + size_t written; + + if (!freeSpace) { + return VMCI_ERROR_QUEUEPAIR_NOSPACE; + } + if (freeSpace < 0) { + return (ssize_t)freeSpace; + } + + written = (size_t)(freeSpace > bufSize ? bufSize : freeSpace); + if (LIKELY(tail + written < produceQSize)) { + memcpyToQueue(produceQueue, tail, buf, 0, written); + } else { + /* Tail pointer wraps around. */ + const size_t tmp = (size_t)(produceQSize - tail); + + memcpyToQueue(produceQueue, tail, buf, 0, tmp); + memcpyToQueue(produceQueue, 0, buf, tmp, written - tmp); + } + AddPointer(&produceQueue->queueHeader.producerTail, written, produceQSize); + return written; +} + + +/* + *----------------------------------------------------------------------------- + * + * VMCIQueue_Enqueue -- + * + * Enqueues a given buffer to the produce queue. As many bytes as possible + * (space available in the queue) are enqueued. If bufSize is larger than + * the maximum value of ssize_t the result is unspecified. + * + * Results: + * VMCI_ERROR_QUEUEPAIR_NOSPACE if no space was available to enqueue data. + * VMCI_ERROR_INVALID_SIZE, if any queue pointer is outside the queue + * (as defined by the queue size). + * Otherwise, the number of bytes written to the queue is returned. + * + * Side effects: + * Updates the tail pointer of the produce queue. + * + *----------------------------------------------------------------------------- + */ + +static INLINE ssize_t +VMCIQueue_Enqueue(VMCIQueue *produceQueue, // IN: + const VMCIQueue *consumeQueue, // IN: + const uint64 produceQSize, // IN: + const void *buf, // IN: + size_t bufSize) // IN: +{ + return __VMCIQueue_Enqueue(produceQueue, consumeQueue, produceQSize, + buf, bufSize, VMCIMemcpyToQueue); +} + + +#if defined(__linux__) && defined(__KERNEL__) +/* + *----------------------------------------------------------------------------- + * + * VMCIQueue_EnqueueV -- + * + * Enqueues a given iovec to the produce queue. As many bytes as possible + * (space available in the queue) are enqueued. If bufSize is larger than + * the maximum value of ssize_t the result is unspecified. + * + * Results: + * VMCI_ERROR_QUEUEPAIR_NOSPACE if no space was available to enqueue data. + * VMCI_ERROR_INVALID_SIZE, if any queue pointer is outside the queue + * (as defined by the queue size). + * Otherwise, the number of bytes written to the queue is returned. + * + * Side effects: + * Updates the tail pointer of the produce queue. + * + *----------------------------------------------------------------------------- + */ + +static INLINE ssize_t +VMCIQueue_EnqueueV(VMCIQueue *produceQueue, // IN: + const VMCIQueue *consumeQueue, // IN: + const uint64 produceQSize, // IN: + struct iovec *iov, // IN: + size_t iovSize) // IN: +{ + return __VMCIQueue_Enqueue(produceQueue, consumeQueue, produceQSize, + (void *)iov, iovSize, VMCIMemcpyToQueueV); +} +#endif + + +/* + *----------------------------------------------------------------------------- + * + * __VMCIQueue_Dequeue -- + * + * Dequeues data (if available) from the given consume queue. Writes data + * to the user provided buffer using the provided function. + * + * Results: + * VMCI_ERROR_QUEUEPAIR_NODATA if no data was available to dequeue. + * VMCI_ERROR_INVALID_SIZE, if any queue pointer is outside the queue + * (as defined by the queue size). + * Otherwise the number of bytes dequeued is returned. + * + * Side effects: + * Updates the head pointer of the consume queue. + * + *----------------------------------------------------------------------------- + */ + +static INLINE ssize_t +__VMCIQueue_Dequeue(VMCIQueue *produceQueue, // IN: + const VMCIQueue *consumeQueue, // IN: + const uint64 consumeQSize, // IN: + void *buf, // IN: + size_t bufSize, // IN: + VMCIMemcpyFromQueueFunc memcpyFromQueue) // IN: +{ + const int64 bufReady = VMCIQueue_BufReady(consumeQueue, produceQueue, + consumeQSize); + const uint64 head = + QPAtomic_ReadOffset(&produceQueue->queueHeader.consumerHead); + size_t written; + + if (!bufReady) { + return VMCI_ERROR_QUEUEPAIR_NODATA; + } + if (bufReady < 0) { + return (ssize_t)bufReady; + } + + written = (size_t)(bufReady > bufSize ? bufSize : bufReady); + if (LIKELY(head + written < consumeQSize)) { + memcpyFromQueue(buf, 0, consumeQueue, head, written); + } else { + /* Head pointer wraps around. */ + const size_t tmp = (size_t)(consumeQSize - head); + + memcpyFromQueue(buf, 0, consumeQueue, head, tmp); + memcpyFromQueue(buf, tmp, consumeQueue, 0, written - tmp); + } + AddPointer(&produceQueue->queueHeader.consumerHead, written, consumeQSize); + return written; +} + + +/* + *----------------------------------------------------------------------------- + * + * VMCIQueue_Dequeue -- + * + * Dequeues data (if available) from the given consume queue. Writes data + * to the user provided buffer. If bufSize is larger than the maximum + * value of ssize_t the result is unspecified. + * + * Results: + * VMCI_ERROR_QUEUEPAIR_NODATA if no data was available to dequeue. + * VMCI_ERROR_INVALID_SIZE, if any queue pointer is outside the queue + * (as defined by the queue size). + * Otherwise the number of bytes dequeued is returned. + * + * Side effects: + * Updates the head pointer of the consume queue. + * + *----------------------------------------------------------------------------- + */ + +static INLINE ssize_t +VMCIQueue_Dequeue(VMCIQueue *produceQueue, // IN: + const VMCIQueue *consumeQueue, // IN: + const uint64 consumeQSize, // IN: + void *buf, // IN: + size_t bufSize) // IN: +{ + return __VMCIQueue_Dequeue(produceQueue, consumeQueue, consumeQSize, + buf, bufSize, VMCIMemcpyFromQueue); +} + + +#if defined(__linux__) && defined(__KERNEL__) +/* + *----------------------------------------------------------------------------- + * + * VMCIQueue_DequeueV -- + * + * Dequeues data (if available) from the given consume queue. Writes data + * to the user provided iovec. If bufSize is larger than the maximum + * value of ssize_t the result is unspecified. + * + * Results: + * VMCI_ERROR_QUEUEPAIR_NODATA if no data was available to dequeue. + * VMCI_ERROR_INVALID_SIZE, if any queue pointer is outside the queue + * (as defined by the queue size). + * Otherwise the number of bytes dequeued is returned. + * + * Side effects: + * Updates the head pointer of the consume queue. + * + *----------------------------------------------------------------------------- + */ + +static INLINE ssize_t +VMCIQueue_DequeueV(VMCIQueue *produceQueue, // IN: + const VMCIQueue *consumeQueue, // IN: + const uint64 consumeQSize, // IN: + struct iovec *iov, // IN: + size_t iovSize) // IN: +{ + return __VMCIQueue_Dequeue(produceQueue, consumeQueue, consumeQSize, + (void *)iov, iovSize, VMCIMemcpyFromQueueV); +} +#endif + +#endif /* !_VMCI_QUEUE_PAIR_H_ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/vmware.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/vmware.h --- open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/vmware.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/vmware.h 2008-10-13 08:01:40.000000000 +0100 @@ -0,0 +1,58 @@ +/********************************************************* + * Copyright (C) 2003 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * vmware.h -- + * + * Standard include file for VMware source code. + */ + +#ifndef _VMWARE_H_ +#define _VMWARE_H_ + +#define INCLUDE_ALLOW_USERLEVEL +#define INCLUDE_ALLOW_VMCORE +#define INCLUDE_ALLOW_MODULE +#define INCLUDE_ALLOW_VMMON +#define INCLUDE_ALLOW_VMNIXMOD +#define INCLUDE_ALLOW_VMKERNEL +#define INCLUDE_ALLOW_VMK_MODULE +#define INCLUDE_ALLOW_DISTRIBUTE +#include "includeCheck.h" + +#include "vm_basic_types.h" +#include "vm_basic_defs.h" +#include "vm_assert.h" + +/* + * Global error codes. Currently used internally, but may be exported + * to customers one day, like VM_E_XXX in vmcontrol_constants.h + */ + +typedef enum VMwareStatus { + VMWARE_STATUS_SUCCESS, /* success */ + VMWARE_STATUS_ERROR, /* generic error */ + VMWARE_STATUS_NOMEM, /* generic memory allocation error */ + VMWARE_STATUS_INSUFFICIENT_RESOURCES, /* internal or system resource limit exceeded */ + VMWARE_STATUS_INVALID_ARGS /* invalid arguments */ +} VMwareStatus; + +#define VMWARE_SUCCESS(s) ((s) == VMWARE_STATUS_SUCCESS) + + +#endif // ifndef _VMWARE_H_ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/vmware_pack_begin.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/vmware_pack_begin.h --- open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/vmware_pack_begin.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/vmware_pack_begin.h 2008-10-13 08:01:40.000000000 +0100 @@ -0,0 +1,43 @@ +/********************************************************* + * Copyright (C) 2002 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * 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 diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/vmware_pack_end.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/vmware_pack_end.h --- open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/vmware_pack_end.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/vmware_pack_end.h 2008-10-13 08:01:40.000000000 +0100 @@ -0,0 +1,44 @@ +/********************************************************* + * Copyright (C) 2002 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * vmware_pack_end.h -- + * + * End 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(pop) +#elif __GNUC__ +__attribute__((__packed__)) +#else +# error Compiler packing... +#endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/vmware_pack_init.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/vmware_pack_init.h --- open-vm-tools-2008.01.23-74039/modules/linux/vsock/include/vmware_pack_init.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/include/vmware_pack_init.h 2008-10-13 08:01:40.000000000 +0100 @@ -0,0 +1,65 @@ +/********************************************************* + * Copyright (C) 2002 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +#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__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vsock/linux/af_vsock.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/linux/af_vsock.c --- open-vm-tools-2008.01.23-74039/modules/linux/vsock/linux/af_vsock.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/linux/af_vsock.c 2008-10-13 08:01:40.000000000 +0100 @@ -0,0 +1,5092 @@ +/********************************************************* + * Copyright (C) 2007 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * af_vsock.c -- + * + * Linux socket module for the VMCI Sockets protocol family. + */ + + +/* + * Implementation notes: + * + * - There are two kinds of sockets: those created by user action (such as + * calling socket(2)) and those created by incoming connection request + * packets. + * + * - There are two "global" tables, one for bound sockets (sockets that have + * specified an address that they are responsible for) and one for connected + * sockets (sockets that have established a connection with another socket). + * These tables are "global" in that all sockets on the system are placed + * within them. + * - Note, though, that the bound table contains an extra entry for a list of + * unbound sockets and SOCK_DGRAM sockets will always remain in that list. + * The bound table is used solely for lookup of sockets when packets are + * received and that's not necessary for SOCK_DGRAM sockets since we create + * a datagram handle for each and need not perform a lookup. Keeping + * SOCK_DGRAM sockets out of the bound hash buckets will reduce the chance + * of collisions when looking for SOCK_STREAM sockets and prevents us from + * having to check the socket type in the hash table lookups. + * + * - Sockets created by user action will either be "client" sockets that + * initiate a connection or "server" sockets that listen for connections; we + * do not support simultaneous connects (two "client" sockets connecting). + * + * - "Server" sockets are referred to as listener sockets throughout this + * implementation because they are in the SS_LISTEN state. When a connection + * request is received (the second kind of socket mentioned above), we create + * a new socket and refer to it as a pending socket. These pending sockets + * are placed on the pending connection list of the listener socket. When + * future packets are received for the address the listener socket is bound + * to, we check if the source of the packet is from one that has an existing + * pending connection. If it does, we process the packet for the pending + * socket. When that socket reaches the connected state, it is removed from + * the listener socket's pending list and enqueued in the listener socket's + * accept queue. Callers of accept(2) will accept connected sockets from the + * listener socket's accept queue. If the socket cannot be accepted for some + * reason then it is marked rejected. Once the connection is accepted, it is + * owned by the user process and the responsibility for cleanup falls with + * that user process. + * + * - It is possible that these pending sockets will never reach the connected + * state; in fact, we may never receive another packet after the connection + * request. Because of this, we must schedule a cleanup function to run in + * the future, after some amount of time passes where a connection should + * have been established. This function ensures that the socket is off all + * lists so it cannot be retrieved, then drops all references to the socket + * so it is cleaned up (sock_put() -> sk_free() -> our sk_destruct + * implementation). Note this function will also cleanup rejected sockets, + * those that reach the connected state but leave it before they have been + * accepted. + * + * - Sockets created by user action will be cleaned up when the user + * process calls close(2), causing our release implementation to be called. + * Our release implementation will perform some cleanup then drop the + * last reference so our sk_destruct implementation is invoked. Our + * sk_destruct implementation will perform additional cleanup that's common + * for both types of sockets. + * + * - A socket's reference count is what ensures that the structure won't be + * freed. Each entry in a list (such as the "global" bound and connected + * tables and the listener socket's pending list and connected queue) ensures + * a reference. When we defer work until process context and pass a socket + * as our argument, we must ensure the reference count is increased to ensure + * the socket isn't freed before the function is run; the deferred function + * will then drop the reference. + * + */ + +#include "driver-config.h" + +#include <linux/kmod.h> +#include <linux/socket.h> +#include <linux/net.h> +#include <linux/skbuff.h> +#include <linux/miscdevice.h> +#include <linux/poll.h> +#include <linux/smp.h> +#include <linux/smp_lock.h> +#include <asm/io.h> +#if defined(__x86_64__) && LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 12) +# if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 0) +# include <asm/ioctl32.h> +# else +# include <linux/ioctl32.h> +# endif +/* Use weak: not all kernels export sys_ioctl for use by modules */ +# if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 66) +asmlinkage __attribute__((weak)) long +sys_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg); +# else +asmlinkage __attribute__((weak)) int +sys_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg); +# endif +#endif + +#include "compat_module.h" +#include "compat_kernel.h" +#include "compat_init.h" +#include "compat_sock.h" +#include "compat_wait.h" +#include "compat_version.h" +#include "compat_workqueue.h" +#include "compat_list.h" +#if defined(HAVE_COMPAT_IOCTL) || defined(HAVE_UNLOCKED_IOCTL) +# include "compat_semaphore.h" +#endif + +#include "vmware.h" + +#include "vsockCommon.h" +#include "vsockPacket.h" +#include "vsockVmci.h" + +#include "vmci_defs.h" +#include "vmci_call_defs.h" +#include "vmci_iocontrols.h" +#ifdef VMX86_TOOLS +# include "vmciGuestKernelAPI.h" +#else +# include "vmciDatagram.h" +#endif + +#include "af_vsock.h" +#include "util.h" +#include "vsock_version.h" +#include "driverLog.h" + + +#define VSOCK_INVALID_FAMILY NPROTO +#define VSOCK_AF_IS_REGISTERED(val) ((val) >= 0 && (val) < NPROTO) + +/* Some kernel versions don't define __user. Define it ourself if so. */ +#ifndef __user +#define __user +#endif + + +/* + * Prototypes + */ + +int VSockVmci_GetAFValue(void); + +/* Internal functions. */ +static int VSockVmciRecvDgramCB(void *data, VMCIDatagram *dg); +#ifdef VMX86_TOOLS +static int VSockVmciRecvStreamCB(void *data, VMCIDatagram *dg); +static void VSockVmciPeerAttachCB(VMCIId subId, + VMCI_EventData *ed, void *clientData); +static void VSockVmciPeerDetachCB(VMCIId subId, + VMCI_EventData *ed, void *clientData); +static int VSockVmciSendControlPktBH(struct sockaddr_vm *src, + struct sockaddr_vm *dst, + VSockPacketType type, + uint64 size, + uint64 mode, + VSockWaitingInfo *wait, + VMCIHandle handle); +static int VSockVmciSendControlPkt(struct sock *sk, VSockPacketType type, + uint64 size, uint64 mode, + VSockWaitingInfo *wait, VMCIHandle handle); +static void VSockVmciRecvPktWork(compat_work_arg work); +static int VSockVmciRecvListen(struct sock *sk, VSockPacket *pkt); +static int VSockVmciRecvConnectingServer(struct sock *sk, + struct sock *pending, VSockPacket *pkt); +static int VSockVmciRecvConnectingClient(struct sock *sk, VSockPacket *pkt); +static int VSockVmciRecvConnectingClientNegotiate(struct sock *sk, + VSockPacket *pkt); +static int VSockVmciRecvConnected(struct sock *sk, VSockPacket *pkt); +#endif +static int __VSockVmciBind(struct sock *sk, struct sockaddr_vm *addr); +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 14) +static struct sock *__VSockVmciCreate(struct socket *sock, unsigned int priority, + unsigned short type); +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24) +static struct sock *__VSockVmciCreate(struct socket *sock, gfp_t priority, + unsigned short type); +#else +static struct sock *__VSockVmciCreate(struct net *net, + struct socket *sock, gfp_t priority, + unsigned short type); +#endif +static int VSockVmciRegisterAddressFamily(void); +static void VSockVmciUnregisterAddressFamily(void); + + +/* Socket operations. */ +static void VSockVmciSkDestruct(struct sock *sk); +static int VSockVmciQueueRcvSkb(struct sock *sk, struct sk_buff *skb); +static int VSockVmciRelease(struct socket *sock); +static int VSockVmciBind(struct socket *sock, + struct sockaddr *addr, int addrLen); +static int VSockVmciDgramConnect(struct socket *sock, + struct sockaddr *addr, int addrLen, int flags); +#ifdef VMX86_TOOLS +static int VSockVmciStreamConnect(struct socket *sock, + struct sockaddr *addr, int addrLen, int flags); +static int VSockVmciAccept(struct socket *sock, struct socket *newsock, int flags); +#endif +static int VSockVmciGetname(struct socket *sock, + struct sockaddr *addr, int *addrLen, int peer); +static unsigned int VSockVmciPoll(struct file *file, + struct socket *sock, poll_table *wait); +#ifdef VMX86_TOOLS +static int VSockVmciListen(struct socket *sock, int backlog); +#endif +static int VSockVmciShutdown(struct socket *sock, int mode); + +#ifdef VMX86_TOOLS +static int VSockVmciStreamSetsockopt(struct socket *sock, int level, int optname, + char __user *optval, int optlen); +static int VSockVmciStreamGetsockopt(struct socket *sock, int level, int optname, + char __user *optval, int __user * optlen); +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 43) +static int VSockVmciDgramSendmsg(struct socket *sock, struct msghdr *msg, + int len, struct scm_cookie *scm); +static int VSockVmciDgramRecvmsg(struct socket *sock, struct msghdr *msg, + int len, int flags, struct scm_cookie *scm); +# ifdef VMX86_TOOLS +static int VSockVmciStreamSendmsg(struct socket *sock, struct msghdr *msg, + int len, struct scm_cookie *scm); +static int VSockVmciStreamRecvmsg(struct socket *sock, struct msghdr *msg, + int len, int flags, struct scm_cookie *scm); +# endif +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 65) +static int VSockVmciDgramSendmsg(struct kiocb *kiocb, struct socket *sock, + struct msghdr *msg, int len, + struct scm_cookie *scm); +static int VSockVmciDgramRecvmsg(struct kiocb *kiocb, struct socket *sock, + struct msghdr *msg, int len, + int flags, struct scm_cookie *scm); +# ifdef VMX86_TOOLS +static int VSockVmciStreamSendmsg(struct kiocb *kiocb, struct socket *sock, + struct msghdr *msg, int len, + struct scm_cookie *scm); +static int VSockVmciStreamRecvmsg(struct kiocb *kiocb, struct socket *sock, + struct msghdr *msg, int len, + int flags, struct scm_cookie *scm); +# endif +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 2) +static int VSockVmciDgramSendmsg(struct kiocb *kiocb, + struct socket *sock, struct msghdr *msg, int len); +static int VSockVmciDgramRecvmsg(struct kiocb *kiocb, struct socket *sock, + struct msghdr *msg, int len, int flags); +# ifdef VMX86_TOOLS +static int VSockVmciStreamSendmsg(struct kiocb *kiocb, + struct socket *sock, struct msghdr *msg, int len); +static int VSockVmciStreamRecvmsg(struct kiocb *kiocb, struct socket *sock, + struct msghdr *msg, int len, int flags); +# endif +#else +static int VSockVmciDgramSendmsg(struct kiocb *kiocb, + struct socket *sock, struct msghdr *msg, size_t len); +static int VSockVmciDgramRecvmsg(struct kiocb *kiocb, struct socket *sock, + struct msghdr *msg, size_t len, int flags); +# ifdef VMX86_TOOLS +static int VSockVmciStreamSendmsg(struct kiocb *kiocb, + struct socket *sock, struct msghdr *msg, size_t len); +static int VSockVmciStreamRecvmsg(struct kiocb *kiocb, struct socket *sock, + struct msghdr *msg, size_t len, int flags); +# endif +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24) +static int VSockVmciCreate(struct socket *sock, int protocol); +#else +static int VSockVmciCreate(struct net *net, struct socket *sock, int protocol); +#endif + +/* + * Device operations. + */ +int VSockVmciDevOpen(struct inode *inode, struct file *file); +int VSockVmciDevRelease(struct inode *inode, struct file *file); +static int VSockVmciDevIoctl(struct inode *inode, struct file *filp, + u_int iocmd, unsigned long ioarg); +#if defined(HAVE_COMPAT_IOCTL) || defined(HAVE_UNLOCKED_IOCTL) +static long VSockVmciDevUnlockedIoctl(struct file *filp, + u_int iocmd, unsigned long ioarg); +#endif + +/* + * Variables. + */ + +/* Protocol family. We only use this for builds against 2.6.9 and later. */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 9) +static struct proto vsockVmciProto = { + .name = "AF_VMCI", +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 10) + /* Added in 2.6.10. */ + .owner = THIS_MODULE, +#endif + /* + * Before 2.6.9, each address family created their own slab (by calling + * kmem_cache_create() directly). From 2.6.9 until 2.6.11, these address + * families instead called sk_alloc_slab() and the allocated slab was + * assigned to the slab variable in the proto struct and was created of size + * slab_obj_size. As of 2.6.12 and later, this slab allocation was moved + * into proto_register() and only done if you specified a non-zero value for + * the second argument (alloc_slab); the size of the slab element was + * changed to obj_size. + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 9) +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 12) + .slab_obj_size = sizeof (VSockVmciSock), +#else + .obj_size = sizeof (VSockVmciSock), +#endif +}; +#endif + +static struct net_proto_family vsockVmciFamilyOps = { + .family = VSOCK_INVALID_FAMILY, + .create = VSockVmciCreate, +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 69) + .owner = THIS_MODULE, +#endif +}; + +/* Socket operations, split for DGRAM and STREAM sockets. */ +static struct proto_ops vsockVmciDgramOps = { + .family = VSOCK_INVALID_FAMILY, +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 69) + .owner = THIS_MODULE, +#endif + .release = VSockVmciRelease, + .bind = VSockVmciBind, + .connect = VSockVmciDgramConnect, + .socketpair = sock_no_socketpair, + .accept = sock_no_accept, + .getname = VSockVmciGetname, + .poll = VSockVmciPoll, + .ioctl = sock_no_ioctl, + .listen = sock_no_listen, + .shutdown = VSockVmciShutdown, + .setsockopt = sock_no_setsockopt, + .getsockopt = sock_no_getsockopt, + .sendmsg = VSockVmciDgramSendmsg, + .recvmsg = VSockVmciDgramRecvmsg, + .mmap = sock_no_mmap, +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 4) + .sendpage = sock_no_sendpage, +#endif +}; + +#ifdef VMX86_TOOLS +static struct proto_ops vsockVmciStreamOps = { + .family = VSOCK_INVALID_FAMILY, +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 69) + .owner = THIS_MODULE, +#endif + .release = VSockVmciRelease, + .bind = VSockVmciBind, + .connect = VSockVmciStreamConnect, + .socketpair = sock_no_socketpair, + .accept = VSockVmciAccept, + .getname = VSockVmciGetname, + .poll = VSockVmciPoll, + .ioctl = sock_no_ioctl, + .listen = VSockVmciListen, + .shutdown = VSockVmciShutdown, + .setsockopt = VSockVmciStreamSetsockopt, + .getsockopt = VSockVmciStreamGetsockopt, + .sendmsg = VSockVmciStreamSendmsg, + .recvmsg = VSockVmciStreamRecvmsg, + .mmap = sock_no_mmap, +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 4, 4) + .sendpage = sock_no_sendpage, +#endif +}; +#endif + +static struct file_operations vsockVmciDeviceOps = { +#ifdef HAVE_UNLOCKED_IOCTL + .unlocked_ioctl = VSockVmciDevUnlockedIoctl, +#else + .ioctl = VSockVmciDevIoctl, +#endif +#ifdef HAVE_COMPAT_IOCTL + .compat_ioctl = VSockVmciDevUnlockedIoctl, +#endif + .open = VSockVmciDevOpen, + .release = VSockVmciDevRelease, +}; + +static struct miscdevice vsockVmciDevice = { + .name = "vsock", + .minor = MISC_DYNAMIC_MINOR, + .fops = &vsockVmciDeviceOps, +}; + +typedef struct VSockRecvPktInfo { + compat_work work; + struct sock *sk; + VSockPacket pkt; +} VSockRecvPktInfo; + +static DECLARE_MUTEX(registrationMutex); +static int devOpenCount = 0; +static int vsockVmciSocketCount = 0; +#ifdef VMX86_TOOLS +static VMCIHandle vmciStreamHandle = { VMCI_INVALID_ID, VMCI_INVALID_ID }; +static Bool vmciDevicePresent = FALSE; +static VMCIId qpResumedSubId = VMCI_INVALID_ID; +#endif + +/* Comment this out to compare with old protocol. */ +#define VSOCK_OPTIMIZATION_WAITING_NOTIFY 1 +#if defined(VMX86_TOOLS) && defined(VSOCK_OPTIMIZATION_WAITING_NOTIFY) +/* Comment this out to remove flow control for "new" protocol */ +# define VSOCK_OPTIMIZATION_FLOW_CONTROL 1 +#endif + +/* Comment this out to turn off datagram counting. */ +//#define VSOCK_CONTROL_PACKET_COUNT 1 +#ifdef VSOCK_CONTROL_PACKET_COUNT +uint64 controlPacketCount[VSOCK_PACKET_TYPE_MAX]; +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 9) +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 5) +kmem_cache_t *vsockCachep; +#endif +#endif + +#define VSOCK_MAX_DGRAM_RESENDS 10 + +/* + * 64k is hopefully a reasonable default, but we should do some real + * benchmarks. There are also some issues with resource limits on ESX. + */ +#define VSOCK_DEFAULT_QP_SIZE_MIN 128 +#define VSOCK_DEFAULT_QP_SIZE 65536 +#define VSOCK_DEFAULT_QP_SIZE_MAX 262144 + +#define VSOCK_SEND_RESET_BH(_dst, _src, _pkt) \ + ((_pkt)->type == VSOCK_PACKET_TYPE_RST) ? \ + 0 : \ + VSockVmciSendControlPktBH(_dst, _src, VSOCK_PACKET_TYPE_RST, 0, \ + 0, NULL, VMCI_INVALID_HANDLE) +#define VSOCK_SEND_INVALID_BH(_dst, _src) \ + VSockVmciSendControlPktBH(_dst, _src, VSOCK_PACKET_TYPE_INVALID, 0, \ + 0, NULL, VMCI_INVALID_HANDLE) +#define VSOCK_SEND_WROTE_BH(_dst, _src) \ + VSockVmciSendControlPktBH(_dst, _src, VSOCK_PACKET_TYPE_WROTE, 0, \ + 0, NULL, VMCI_INVALID_HANDLE) +#define VSOCK_SEND_READ_BH(_dst, _src) \ + VSockVmciSendControlPktBH(_dst, _src, VSOCK_PACKET_TYPE_READ, 0, \ + 0, NULL, VMCI_INVALID_HANDLE) +#define VSOCK_SEND_RESET(_sk, _pkt) \ + ((_pkt)->type == VSOCK_PACKET_TYPE_RST) ? \ + 0 : \ + VSockVmciSendControlPkt(_sk, VSOCK_PACKET_TYPE_RST, \ + 0, 0, NULL, VMCI_INVALID_HANDLE) +#define VSOCK_SEND_NEGOTIATE(_sk, _size) \ + VSockVmciSendControlPkt(_sk, VSOCK_PACKET_TYPE_NEGOTIATE, \ + _size, 0, NULL, VMCI_INVALID_HANDLE) +#define VSOCK_SEND_QP_OFFER(_sk, _handle) \ + VSockVmciSendControlPkt(_sk, VSOCK_PACKET_TYPE_OFFER, \ + 0, 0, NULL, _handle) +#define VSOCK_SEND_CONN_REQUEST(_sk, _size) \ + VSockVmciSendControlPkt(_sk, VSOCK_PACKET_TYPE_REQUEST, \ + _size, 0, NULL, VMCI_INVALID_HANDLE) +#define VSOCK_SEND_ATTACH(_sk, _handle) \ + VSockVmciSendControlPkt(_sk, VSOCK_PACKET_TYPE_ATTACH, \ + 0, 0, NULL, _handle) +#define VSOCK_SEND_WROTE(_sk) \ + VSockVmciSendControlPkt(_sk, VSOCK_PACKET_TYPE_WROTE, \ + 0, 0, NULL, VMCI_INVALID_HANDLE) +#define VSOCK_SEND_READ(_sk) \ + VSockVmciSendControlPkt(_sk, VSOCK_PACKET_TYPE_READ, \ + 0, 0, NULL, VMCI_INVALID_HANDLE) +#define VSOCK_SEND_SHUTDOWN(_sk, _mode) \ + VSockVmciSendControlPkt(_sk, VSOCK_PACKET_TYPE_SHUTDOWN, \ + 0, _mode, NULL, VMCI_INVALID_HANDLE) +#define VSOCK_SEND_WAITING_WRITE(_sk, _waitInfo) \ + VSockVmciSendControlPkt(_sk, VSOCK_PACKET_TYPE_WAITING_WRITE, \ + 0, 0, _waitInfo, VMCI_INVALID_HANDLE) +#define VSOCK_SEND_WAITING_READ(_sk, _waitInfo) \ + VSockVmciSendControlPkt(_sk, VSOCK_PACKET_TYPE_WAITING_READ, \ + 0, 0, _waitInfo, VMCI_INVALID_HANDLE) + + +#ifdef VMX86_LOG +# define LOG_PACKET(_pkt) VSockVmciLogPkt(__FUNCTION__, __LINE__, _pkt) +#else +# define LOG_PACKET(_pkt) +#endif + + +/* + *---------------------------------------------------------------------------- + * + * VSockVmci_GetAFValue -- + * + * Returns the address family value being used. + * + * Results: + * The address family on success, a negative error on failure. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +int +VSockVmci_GetAFValue(void) +{ + int afvalue; + + down(®istrationMutex); + + afvalue = vsockVmciFamilyOps.family; + if (!VSOCK_AF_IS_REGISTERED(afvalue)) { + afvalue = VSockVmciRegisterAddressFamily(); + } + + up(®istrationMutex); + return afvalue; +} + + +/* + *---------------------------------------------------------------------------- + * + * VSockVmciTestUnregister -- + * + * Tests if it's necessary to unregister the socket family, and does so. + * + * Note that this assumes the registration lock is held. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +static inline void +VSockVmciTestUnregister(void) +{ + if (devOpenCount <= 0 && vsockVmciSocketCount <= 0) { + if (VSOCK_AF_IS_REGISTERED(vsockVmciFamilyOps.family)) { + VSockVmciUnregisterAddressFamily(); + } + } +} + + +/* + * Helper functions. + */ + + +#ifdef VMX86_TOOLS +/* + *---------------------------------------------------------------------------- + * + * VSockVmciNotifyWaitingWrite -- + * + * Determines if the conditions have been met to notify a waiting writer. + * + * Results: + * TRUE if a notification should be sent, FALSE otherwise. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +static Bool +VSockVmciNotifyWaitingWrite(VSockVmciSock *vsk) // IN +{ +#ifdef VSOCK_OPTIMIZATION_WAITING_NOTIFY + Bool retval; + uint64 notifyLimit; + + if (!vsk->peerWaitingWrite) { + return FALSE; + } + +#ifdef VSOCK_OPTIMIZATION_FLOW_CONTROL + /* + * When the sender blocks, we take that as a sign that the sender + * is faster than the receiver. To reduce the transmit rate of the + * sender, we delay the sending of the read notification by + * decreasing the writeNotifyWindow. The notification is delayed + * until the number of bytes used in the queue drops below the + * writeNotifyWindow. + */ + + if (!vsk->peerWaitingWriteDetected) { + vsk->peerWaitingWriteDetected = TRUE; + vsk->writeNotifyWindow -= PAGE_SIZE; + if (vsk->writeNotifyWindow < vsk->writeNotifyMinWindow) { + vsk->writeNotifyWindow = vsk->writeNotifyMinWindow; + } + } + notifyLimit = vsk->consumeSize - vsk->writeNotifyWindow; +#else + notifyLimit = 0; +#endif // VSOCK_OPTIMIZATION_FLOW_CONTROL + + /* + * For now we ignore the wait information and just see if the free + * space exceeds the notify limit. Note that improving this + * function to be more intelligent will not require a protocol + * change and will retain compatibility between endpoints with + * mixed versions of this function. + * + * The notifyLimit is used to delay notifications in the case where + * flow control is enabled. Below the test is expressed in terms of + * free space in the queue: + * if freeSpace > ConsumeSize - writeNotifyWindow then notify + * An alternate way of expressing this is to rewrite the expression + * to use the data ready in the receive queue: + * if writeNotifyWindow > bufferReady then notify + * as freeSpace == ConsumeSize - bufferReady. + */ + retval = VMCIQueue_FreeSpace(vsk->consumeQ, vsk->produceQ, vsk->consumeSize) > + notifyLimit; +#ifdef VSOCK_OPTIMIZATION_FLOW_CONTROL + if (retval) { + /* + * Once we notify the peer, we reset the detected flag so the + * next wait will again cause a decrease in the window size. + */ + + vsk->peerWaitingWriteDetected = FALSE; + } +#endif // VSOCK_OPTIMIZATION_FLOW_CONTROL + return retval; +#else + return TRUE; +#endif +} + + +/* + *---------------------------------------------------------------------------- + * + * VSockVmciNotifyWaitingRead -- + * + * Determines if the conditions have been met to notify a waiting reader. + * + * Results: + * TRUE if a notification should be sent, FALSE otherwise. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +static Bool +VSockVmciNotifyWaitingRead(VSockVmciSock *vsk) // IN +{ +#ifdef VSOCK_OPTIMIZATION_WAITING_NOTIFY + if (!vsk->peerWaitingRead) { + return FALSE; + } + + /* + * For now we ignore the wait information and just see if there is any data + * to read. Note that improving this function to be more intelligent will + * not require a protocol change and will retain compatibility between + * endpoints with mixed versions of this function. + */ + return VMCIQueue_BufReady(vsk->produceQ, + vsk->consumeQ, vsk->produceSize) > 0; +#else + return TRUE; +#endif +} + + +/* + *---------------------------------------------------------------------------- + * + * VSockVmciHandleWaitingWrite -- + * + * Handles an incoming waiting write message. + * + * Results: + * None. + * + * Side effects: + * May send a notification to the peer, may update socket's wait info + * structure. + * + *---------------------------------------------------------------------------- + */ + +static void +VSockVmciHandleWaitingWrite(struct sock *sk, // IN + VSockPacket *pkt, // IN + Bool bottomHalf, // IN + struct sockaddr_vm *dst, // IN + struct sockaddr_vm *src) // IN +{ +#ifdef VSOCK_OPTIMIZATION_WAITING_NOTIFY + VSockVmciSock *vsk; + + vsk = vsock_sk(sk); + + vsk->peerWaitingWrite = TRUE; + memcpy(&vsk->peerWaitingWriteInfo, &pkt->u.wait, + sizeof vsk->peerWaitingWriteInfo); + + if (VSockVmciNotifyWaitingWrite(vsk)) { + Bool sent; + + if (bottomHalf) { + sent = VSOCK_SEND_READ_BH(dst, src) > 0; + } else { + sent = VSOCK_SEND_READ(sk) > 0; + } + + if (sent) { + vsk->peerWaitingWrite = FALSE; + } + } +#endif +} + + +/* + *---------------------------------------------------------------------------- + * + * VSockVmciHandleWaitingRead -- + * + * Handles an incoming waiting read message. + * + * Results: + * None. + * + * Side effects: + * May send a notification to the peer, may update socket's wait info + * structure. + * + *---------------------------------------------------------------------------- + */ + +static void +VSockVmciHandleWaitingRead(struct sock *sk, // IN + VSockPacket *pkt, // IN + Bool bottomHalf, // IN + struct sockaddr_vm *dst, // IN + struct sockaddr_vm *src) // IN +{ +#ifdef VSOCK_OPTIMIZATION_WAITING_NOTIFY + VSockVmciSock *vsk; + + vsk = vsock_sk(sk); + + vsk->peerWaitingRead = TRUE; + memcpy(&vsk->peerWaitingReadInfo, &pkt->u.wait, + sizeof vsk->peerWaitingReadInfo); + + if (VSockVmciNotifyWaitingRead(vsk)) { + Bool sent; + + if (bottomHalf) { + sent = VSOCK_SEND_WROTE_BH(dst, src) > 0; + } else { + sent = VSOCK_SEND_WROTE(sk) > 0; + } + + if (sent) { + vsk->peerWaitingRead = FALSE; + } + } +#endif +} +#endif + + +/* + *---------------------------------------------------------------------------- + * + * VSockVmciRecvDgramCB -- + * + * VMCI Datagram receive callback. This function is used specifically for + * SOCK_DGRAM sockets. + * + * This is invoked as part of a tasklet that's scheduled when the VMCI + * interrupt fires. This is run in bottom-half context and if it ever needs + * to sleep it should defer that work to a work queue. + * + * Results: + * Zero on success, negative error code on failure. + * + * Side effects: + * An sk_buff is created and queued with this socket. + * + *---------------------------------------------------------------------------- + */ + +static int +VSockVmciRecvDgramCB(void *data, // IN + VMCIDatagram *dg) // IN +{ + struct sock *sk; + size_t size; + struct sk_buff *skb; + + ASSERT(dg); + ASSERT(dg->payloadSize <= VMCI_MAX_DG_PAYLOAD_SIZE); + + sk = (struct sock *)data; + + ASSERT(sk); + /* XXX Figure out why sk->compat_sk_socket can be NULL. */ + ASSERT(sk->compat_sk_socket ? sk->compat_sk_socket->type == SOCK_DGRAM : 1); + + size = VMCI_DG_SIZE(dg); + + /* + * Attach the packet to the socket's receive queue as an sk_buff. + */ + skb = alloc_skb(size, GFP_ATOMIC); + if (skb) { + /* compat_sk_receive_skb() will do a sock_put(), so hold here. */ + sock_hold(sk); + skb_put(skb, size); + memcpy(skb->data, dg, size); + compat_sk_receive_skb(sk, skb, 0); + } + + return 0; +} + + +#ifdef VMX86_TOOLS +/* + *---------------------------------------------------------------------------- + * + * VSockVmciRecvStreamCB -- + * + * VMCI stream receive callback for control datagrams. This function is + * used specifically for SOCK_STREAM sockets. + * + * This is invoked as part of a tasklet that's scheduled when the VMCI + * interrupt fires. This is run in bottom-half context but it defers most + * of its work to the packet handling work queue. + * + * Results: + * Zero on success, negative error code on failure. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +static int +VSockVmciRecvStreamCB(void *data, // IN + VMCIDatagram *dg) // IN +{ + struct sock *sk; + struct sockaddr_vm dst; + struct sockaddr_vm src; + VSockPacket *pkt; + Bool processPkt; + int err; + + ASSERT(dg); + ASSERT(dg->payloadSize <= VMCI_MAX_DG_PAYLOAD_SIZE); + + sk = NULL; + err = VMCI_SUCCESS; + processPkt = TRUE; + + /* + * Ignore incoming packets from contexts without sockets, or resources that + * aren't vsock implementations. + */ + if (!VSockAddr_SocketContext(VMCI_HANDLE_TO_CONTEXT_ID(dg->src)) || + VSOCK_PACKET_RID != VMCI_HANDLE_TO_RESOURCE_ID(dg->src)) { + return VMCI_ERROR_NO_ACCESS; + } + + if (VMCI_DG_SIZE(dg) < sizeof *pkt) { + /* Drop datagrams that do not contain full VSock packets. */ + return VMCI_ERROR_INVALID_ARGS; + } + + pkt = (VSockPacket *)dg; + + LOG_PACKET(pkt); + + /* + * Find the socket that should handle this packet. First we look for + * a connected socket and if there is none we look for a socket bound to + * the destintation address. + * + * Note that we don't initialize the family member of the src and dst + * sockaddr_vm since we don't want to call VMCISock_GetAFValue() and + * possibly register the address family. + */ + VSockAddr_InitNoFamily(&src, + VMCI_HANDLE_TO_CONTEXT_ID(pkt->dg.src), + pkt->srcPort); + + VSockAddr_InitNoFamily(&dst, + VMCI_HANDLE_TO_CONTEXT_ID(pkt->dg.dst), + pkt->dstPort); + + sk = VSockVmciFindConnectedSocket(&src, &dst); + if (!sk) { + sk = VSockVmciFindBoundSocket(&dst); + if (!sk) { + /* + * We could not find a socket for this specified address. If this + * packet is a RST, we just drop it. If it is another packet, we send + * a RST. Note that we do not send a RST reply to RSTs so that we do + * not continually send RSTs between two endpoints. + * + * Note that since this is a reply, dst is src and src is dst. + */ + if (VSOCK_SEND_RESET_BH(&dst, &src, pkt) < 0) { + Log("unable to send reset.\n"); + } + err = VMCI_ERROR_NOT_FOUND; + goto out; + } + } + + /* + * If the received packet type is beyond all types known to this + * implementation, reply with an invalid message. Hopefully this will help + * when implementing backwards compatibility in the future. + */ + if (pkt->type >= VSOCK_PACKET_TYPE_MAX) { + if (VSOCK_SEND_INVALID_BH(&dst, &src) < 0) { + Warning("unable to send reply for invalid packet.\n"); + err = VMCI_ERROR_INVALID_ARGS; + goto out; + } + } + + /* + * We do most everything in a work queue, but let's fast path the + * notification of reads and writes to help data transfer performance. We + * can only do this if there is no process context code executing for this + * socket since that may change the state. + */ + bh_lock_sock(sk); + + if (!compat_sock_owned_by_user(sk) && sk->compat_sk_state == SS_CONNECTED) { + switch (pkt->type) { + case VSOCK_PACKET_TYPE_WROTE: + sk->compat_sk_data_ready(sk, 0); + processPkt = FALSE; + break; + case VSOCK_PACKET_TYPE_READ: + sk->compat_sk_write_space(sk); + processPkt = FALSE; + break; + case VSOCK_PACKET_TYPE_WAITING_WRITE: + VSockVmciHandleWaitingWrite(sk, pkt, TRUE, &dst, &src); + processPkt = FALSE; + break; + + case VSOCK_PACKET_TYPE_WAITING_READ: + VSockVmciHandleWaitingRead(sk, pkt, TRUE, &dst, &src); + processPkt = FALSE; + break; + } + } + + bh_unlock_sock(sk); + + if (processPkt) { + VSockRecvPktInfo *recvPktInfo; + + recvPktInfo = kmalloc(sizeof *recvPktInfo, GFP_ATOMIC); + if (!recvPktInfo) { + if (VSOCK_SEND_RESET_BH(&dst, &src, pkt) < 0) { + Warning("unable to send reset\n"); + } + err = VMCI_ERROR_NO_MEM; + goto out; + } + + recvPktInfo->sk = sk; + memcpy(&recvPktInfo->pkt, pkt, sizeof recvPktInfo->pkt); + COMPAT_INIT_WORK(&recvPktInfo->work, VSockVmciRecvPktWork, recvPktInfo); + + compat_schedule_work(&recvPktInfo->work); + /* + * Clear sk so that the reference count incremented by one of the Find + * functions above is not decremented below. We need that reference + * count for the packet handler we've scheduled to run. + */ + sk = NULL; + } + +out: + if (sk) { + sock_put(sk); + } + return err; +} + + +/* + *---------------------------------------------------------------------------- + * + * VSockVmciPeerAttachCB -- + * + * Invoked when a peer attaches to a queue pair. + * + * Right now this does not do anything. + * + * Results: + * None. + * + * Side effects: + * May modify socket state and signal socket. + * + *---------------------------------------------------------------------------- + */ + +static void +VSockVmciPeerAttachCB(VMCIId subId, // IN + VMCI_EventData *eData, // IN + void *clientData) // IN +{ + struct sock *sk; + VMCIEventPayload_QP *ePayload; + VSockVmciSock *vsk; + + ASSERT(eData); + ASSERT(clientData); + + sk = (struct sock *)clientData; + ePayload = VMCIEventDataPayload(eData); + + vsk = vsock_sk(sk); + + bh_lock_sock(sk); + + /* + * XXX This is lame, we should provide a way to lookup sockets by qpHandle. + */ + if (VMCI_HANDLE_EQUAL(vsk->qpHandle, ePayload->handle)) { + /* + * XXX This doesn't do anything, but in the future we may want to set + * a flag here to verify the attach really did occur and we weren't just + * sent a datagram claiming it was. + */ + goto out; + } + +out: + bh_unlock_sock(sk); +} + + +/* + *---------------------------------------------------------------------------- + * + * VSockVmciHandleDetach -- + * + * Perform the work necessary when the peer has detached. + * + * Note that this assumes the socket lock is held. + * + * Results: + * None. + * + * Side effects: + * The socket's and its peer's shutdown mask will be set appropriately, + * and any callers waiting on this socket will be awoken. + * + *---------------------------------------------------------------------------- + */ + +static INLINE void +VSockVmciHandleDetach(struct sock *sk) // IN +{ + VSockVmciSock *vsk; + + ASSERT(sk); + + vsk = vsock_sk(sk); + if (!VMCI_HANDLE_INVALID(vsk->qpHandle)) { + ASSERT(vsk->produceQ); + ASSERT(vsk->consumeQ); + +#ifdef VMX86_TOOLS + if (sk->compat_sk_type == SOCK_STREAM && + sk->compat_sk_state == SS_CONNECTED) { + compat_sock_set_done(sk); + } +#endif + + /* On a detach the peer will not be sending or receiving anymore. */ + vsk->peerShutdown = SHUTDOWN_MASK; + + /* + * We should not be sending anymore since the peer won't be there to + * receive, but we can still receive if there is data left in our consume + * queue. + */ + sk->compat_sk_shutdown |= SEND_SHUTDOWN; + if (VMCIQueue_BufReady(vsk->consumeQ, + vsk->produceQ, vsk->consumeSize) <= 0) { + sk->compat_sk_shutdown |= RCV_SHUTDOWN; + sk->compat_sk_state = SS_UNCONNECTED; + } + sk->compat_sk_state_change(sk); + } +} + + +/* + *---------------------------------------------------------------------------- + * + * VSockVmciPeerDetachCB -- + * + * Invoked when a peer detaches from a queue pair. + * + * Results: + * None. + * + * Side effects: + * May modify socket state and signal socket. + * + *---------------------------------------------------------------------------- + */ + +static void +VSockVmciPeerDetachCB(VMCIId subId, // IN + VMCI_EventData *eData, // IN + void *clientData) // IN +{ + struct sock *sk; + VMCIEventPayload_QP *ePayload; + VSockVmciSock *vsk; + + ASSERT(eData); + ASSERT(clientData); + + sk = (struct sock *)clientData; + ePayload = VMCIEventDataPayload(eData); + vsk = vsock_sk(sk); + if (VMCI_HANDLE_INVALID(ePayload->handle)) { + return; + } + + /* + * XXX This is lame, we should provide a way to lookup sockets by qpHandle. + */ + bh_lock_sock(sk); + + if (VMCI_HANDLE_EQUAL(vsk->qpHandle, ePayload->handle)) { + VSockVmciHandleDetach(sk); + } + + bh_unlock_sock(sk); +} + + +/* + *---------------------------------------------------------------------------- + * + * VSockVmciQPResumedCB -- + * + * Invoked when a VM is resumed. We must mark all connected stream sockets + * as detached. + * + * Results: + * None. + * + * Side effects: + * May modify socket state and signal socket. + * + *---------------------------------------------------------------------------- + */ + +static void +VSockVmciQPResumedCB(VMCIId subId, // IN + VMCI_EventData *eData, // IN + void *clientData) // IN +{ + uint32 i; + + spin_lock_bh(&vsockTableLock); + + /* + * XXX This loop should probably be provided by util.{h,c}, but that's for + * another day. + */ + for (i = 0; i < ARRAYSIZE(vsockConnectedTable); i++) { + VSockVmciSock *vsk; + + list_for_each_entry(vsk, &vsockConnectedTable[i], connectedTable) { + struct sock *sk = sk_vsock(vsk); + + /* + * XXX Technically this is racy but the resulting outcome from such + * a race is relatively harmless. My next change will be a fix to + * this. + */ + VSockVmciHandleDetach(sk); + } + } + + spin_unlock_bh(&vsockTableLock); +} + + +/* + *---------------------------------------------------------------------------- + * + * VSockVmciPendingWork -- + * + * Releases the resources for a pending socket if it has not reached the + * connected state and been accepted by a user process. + * + * Results: + * None. + * + * Side effects: + * The socket may be removed from the connected list and all its resources + * freed. + * + *---------------------------------------------------------------------------- + */ + +static void +VSockVmciPendingWork(compat_delayed_work_arg work) // IN +{ + struct sock *sk; + struct sock *listener; + VSockVmciSock *vsk; + Bool cleanup; + + vsk = COMPAT_DELAYED_WORK_GET_DATA(work, VSockVmciSock, dwork); + ASSERT(vsk); + + sk = sk_vsock(vsk); + listener = vsk->listener; + cleanup = TRUE; + + ASSERT(listener); + + lock_sock(listener); + lock_sock(sk); + + /* + * The socket should be on the pending list or the accept queue, but not + * both. It's also possible that the socket isn't on either. + */ + ASSERT( ( VSockVmciIsPending(sk) && !VSockVmciInAcceptQueue(sk)) + || (!VSockVmciIsPending(sk) && VSockVmciInAcceptQueue(sk)) + || (!VSockVmciIsPending(sk) && !VSockVmciInAcceptQueue(sk))); + + if (VSockVmciIsPending(sk)) { + VSockVmciRemovePending(listener, sk); + } else if (!vsk->rejected) { + /* + * We are not on the pending list and accept() did not reject us, so we + * must have been accepted by our user process. We just need to drop our + * references to the sockets and be on our way. + */ + cleanup = FALSE; + goto out; + } + + listener->compat_sk_ack_backlog--; + + /* + * We need to remove ourself from the global connected sockets list so + * incoming packets can't find this socket, and to reduce the reference + * count. + */ + if (VSockVmciInConnectedTable(sk)) { + VSockVmciRemoveConnected(sk); + } + + sk->compat_sk_state = SS_FREE; + +out: + release_sock(sk); + release_sock(listener); + if (cleanup) { + sock_put(sk); + } + sock_put(sk); + sock_put(listener); +} + + +/* + *---------------------------------------------------------------------------- + * + * VSockVmciRecvPktWork -- + * + * Handles an incoming control packet for the provided socket. This is the + * state machine for our stream sockets. + * + * Results: + * None. + * + * Side effects: + * May set state and wakeup threads waiting for socket state to change. + * + *---------------------------------------------------------------------------- + */ + +static void +VSockVmciRecvPktWork(compat_work_arg work) // IN +{ + int err; + VSockRecvPktInfo *recvPktInfo; + VSockPacket *pkt; + VSockVmciSock *vsk; + struct sock *sk; + + recvPktInfo = COMPAT_WORK_GET_DATA(work, VSockRecvPktInfo); + ASSERT(recvPktInfo); + + err = 0; + sk = recvPktInfo->sk; + pkt = &recvPktInfo->pkt; + vsk = vsock_sk(sk); + + ASSERT(vsk); + ASSERT(pkt); + ASSERT(pkt->type < VSOCK_PACKET_TYPE_MAX); + + lock_sock(sk); + + switch (sk->compat_sk_state) { + case SS_LISTEN: + err = VSockVmciRecvListen(sk, pkt); + break; + case SS_UNCONNECTED: + Log("packet received for socket in unconnected state; dropping.\n"); + goto out; + case SS_CONNECTING: + /* + * Processing of pending connections for servers goes through the + * listening socket, so see VSockVmciRecvListen() for that path. + */ + err = VSockVmciRecvConnectingClient(sk, pkt); + break; + case SS_CONNECTED: + err = VSockVmciRecvConnected(sk, pkt); + break; + case SS_DISCONNECTING: + Log("packet receieved for socket in disconnecting state; dropping.\n"); + goto out; + case SS_FREE: + Log("packet receieved for socket in free state; dropping.\n"); + goto out; + default: + Log("socket is in invalid state; dropping packet.\n"); + goto out; + } + +out: + release_sock(sk); + kfree(recvPktInfo); + /* + * Release reference obtained in the stream callback when we fetched this + * socket out of the bound or connected list. + */ + sock_put(sk); +} + + +/* + *---------------------------------------------------------------------------- + * + * VSockVmciRecvListen -- + * + * Receives packets for sockets in the listen state. + * + * Note that this assumes the socket lock is held. + * + * Results: + * Zero on success, negative error code on failure. + * + * Side effects: + * A new socket may be created and a negotiate control packet is sent. + * + *---------------------------------------------------------------------------- + */ + +static int +VSockVmciRecvListen(struct sock *sk, // IN + VSockPacket *pkt) // IN +{ + VSockVmciSock *vsk; + struct sock *pending; + VSockVmciSock *vpending; + int err; + uint64 qpSize; + + ASSERT(sk); + ASSERT(pkt); + ASSERT(sk->compat_sk_state == SS_LISTEN); + + vsk = vsock_sk(sk); + err = 0; + + /* + * Because we are in the listen state, we could be receiving a packet for + * ourself or any previous connection requests that we received. If it's + * the latter, we try to find a socket in our list of pending connections + * and, if we do, call the appropriate handler for the state that that + * socket is in. Otherwise we try to service the connection request. + */ + pending = VSockVmciGetPending(sk, pkt); + if (pending) { + lock_sock(pending); + switch (pending->compat_sk_state) { + case SS_CONNECTING: + err = VSockVmciRecvConnectingServer(sk, pending, pkt); + break; + default: + VSOCK_SEND_RESET(pending, pkt); + err = -EINVAL; + } + + if (err < 0) { + VSockVmciRemovePending(sk, pending); + } + + release_sock(pending); + VSockVmciReleasePending(pending); + + return err; + } + + /* + * The listen state only accepts connection requests. Reply with a reset + * unless we received a reset. + */ + if (pkt->type != VSOCK_PACKET_TYPE_REQUEST || + pkt->u.size == 0) { + VSOCK_SEND_RESET(sk, pkt); + return -EINVAL; + } + + /* + * If this socket can't accommodate this connection request, we send + * a reset. Otherwise we create and initialize a child socket and reply + * with a connection negotiation. + */ + if (sk->compat_sk_ack_backlog >= sk->compat_sk_max_ack_backlog) { + VSOCK_SEND_RESET(sk, pkt); + return -ECONNREFUSED; + } + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24) + pending = __VSockVmciCreate(NULL, GFP_KERNEL, sk->compat_sk_type); +#else + pending = __VSockVmciCreate(compat_sock_net(sk), NULL, GFP_KERNEL, + sk->compat_sk_type); +#endif + if (!pending) { + VSOCK_SEND_RESET(sk, pkt); + return -ENOMEM; + } + + vpending = vsock_sk(pending); + ASSERT(vpending); + ASSERT(vsk->localAddr.svm_port == pkt->dstPort); + + VSockAddr_Init(&vpending->localAddr, + VMCI_GetContextID(), + pkt->dstPort); + VSockAddr_Init(&vpending->remoteAddr, + VMCI_HANDLE_TO_CONTEXT_ID(pkt->dg.src), + pkt->srcPort); + + /* + * If the proposed size fits within our min/max, accept + * it. Otherwise propose our own size. + */ + if (pkt->u.size >= vsk->queuePairMinSize && + pkt->u.size <= vsk->queuePairMaxSize) { + qpSize = pkt->u.size; + } else { + qpSize = vsk->queuePairSize; + } + + err = VSOCK_SEND_NEGOTIATE(pending, qpSize); + if (err < 0) { + VSOCK_SEND_RESET(sk, pkt); + sock_put(pending); + err = VSockVmci_ErrorToVSockError(err); + goto out; + } + + VSockVmciAddPending(sk, pending); + sk->compat_sk_ack_backlog++; + + pending->compat_sk_state = SS_CONNECTING; + vpending->produceSize = vpending->consumeSize = + vpending->writeNotifyWindow = pkt->u.size; + + + /* + * We might never receive another message for this socket and it's not + * connected to any process, so we have to ensure it gets cleaned up + * ourself. Our delayed work function will take care of that. Note that we + * do not ever cancel this function since we have few guarantees about its + * state when calling cancel_delayed_work(). Instead we hold a reference on + * the socket for that function and make it capable of handling cases where + * it needs to do nothing but release that reference. + */ + vpending->listener = sk; + sock_hold(sk); + sock_hold(pending); + COMPAT_INIT_DELAYED_WORK(&vpending->dwork, VSockVmciPendingWork, vpending); + compat_schedule_delayed_work(&vpending->dwork, HZ); + +out: + return err; +} + + +/* + *---------------------------------------------------------------------------- + * + * VSockVmciRecvConnectingServer -- + * + * Receives packets for sockets in the connecting state on the server side. + * + * Connecting sockets on the server side can only receive queue pair offer + * packets. All others should be treated as cause for closing the + * connection. + * + * Note that this assumes the socket lock is held for both sk and pending. + * + * Results: + * Zero on success, negative error code on failure. + * + * Side effects: + * A queue pair may be created, an attach control packet may be sent, the + * socket may transition to the connected state, and a pending caller in + * accept() may be woken up. + * + *---------------------------------------------------------------------------- + */ + +static int +VSockVmciRecvConnectingServer(struct sock *listener, // IN: the listening socket + struct sock *pending, // IN: the pending connection + VSockPacket *pkt) // IN: current packet +{ + VSockVmciSock *vpending; + VMCIHandle handle; + VMCIQueue *produceQ; + VMCIQueue *consumeQ; + Bool isLocal; + uint32 flags; + VMCIId detachSubId; + int err; + int skerr; + + ASSERT(listener); + ASSERT(pkt); + ASSERT(listener->compat_sk_state == SS_LISTEN); + ASSERT(pending->compat_sk_state == SS_CONNECTING); + + vpending = vsock_sk(pending); + detachSubId = VMCI_INVALID_ID; + + switch (pkt->type) { + case VSOCK_PACKET_TYPE_OFFER: + if (VMCI_HANDLE_INVALID(pkt->u.handle)) { + VSOCK_SEND_RESET(pending, pkt); + skerr = EPROTO; + err = -EINVAL; + goto destroy; + } + break; + default: + /* Close and cleanup the connection. */ + VSOCK_SEND_RESET(pending, pkt); + skerr = EPROTO; + err = pkt->type == VSOCK_PACKET_TYPE_RST ? + 0 : + -EINVAL; + goto destroy; + } + + ASSERT(pkt->type == VSOCK_PACKET_TYPE_OFFER); + + /* + * In order to complete the connection we need to attach to the offered + * queue pair and send an attach notification. We also subscribe to the + * detach event so we know when our peer goes away, and we do that before + * attaching so we don't miss an event. If all this succeeds, we update our + * state and wakeup anything waiting in accept() for a connection. + */ + + /* + * We don't care about attach since we ensure the other side has attached by + * specifying the ATTACH_ONLY flag below. + */ + err = VMCIEvent_Subscribe(VMCI_EVENT_QP_PEER_DETACH, + VSockVmciPeerDetachCB, + pending, + &detachSubId); + if (err < VMCI_SUCCESS) { + VSOCK_SEND_RESET(pending, pkt); + err = VSockVmci_ErrorToVSockError(err); + skerr = -err; + goto destroy; + } + + vpending->detachSubId = detachSubId; + + /* Now attach to the queue pair the client created. */ + handle = pkt->u.handle; + isLocal = vpending->remoteAddr.svm_cid == vpending->localAddr.svm_cid; + flags = VMCI_QPFLAG_ATTACH_ONLY; + flags |= isLocal ? VMCI_QPFLAG_LOCAL : 0; + + err = VMCIQueuePair_Alloc(&handle, + &produceQ, vpending->produceSize, + &consumeQ, vpending->consumeSize, + VMCI_HANDLE_TO_CONTEXT_ID(pkt->dg.src), + flags); + if (err < 0) { + /* We cannot complete this connection: send a reset and close. */ + Log("Could not attach to queue pair with %d\n", err); + VSOCK_SEND_RESET(pending, pkt); + err = VSockVmci_ErrorToVSockError(err); + skerr = -err; + goto destroy; + } + + VMCIQueue_Init(handle, produceQ); + + ASSERT(VMCI_HANDLE_EQUAL(handle, pkt->u.handle)); + vpending->qpHandle = handle; + vpending->produceQ = produceQ; + vpending->consumeQ = consumeQ; + + /* Notify our peer of our attach. */ + err = VSOCK_SEND_ATTACH(pending, handle); + if (err < 0) { + Log("Could not send attach\n"); + VSOCK_SEND_RESET(pending, pkt); + err = VSockVmci_ErrorToVSockError(err); + skerr = -err; + goto destroy; + } + + /* + * We have a connection. Add our connection to the connected list so it no + * longer goes through the listening socket, move it from the listener's + * pending list to the accept queue so callers of accept() can find it. + * Note that enqueueing the socket increments the reference count, so even + * if a reset comes before the connection is accepted, the socket will be + * valid until it is removed from the queue. + */ + pending->compat_sk_state = SS_CONNECTED; + + VSockVmciInsertConnected(vsockConnectedSocketsVsk(vpending), pending); + + VSockVmciRemovePending(listener, pending); + VSockVmciEnqueueAccept(listener, pending); + + /* + * Callers of accept() will be be waiting on the listening socket, not the + * pending socket. + */ + listener->compat_sk_state_change(listener); + + return 0; + +destroy: + pending->compat_sk_err = skerr; + pending->compat_sk_state = SS_UNCONNECTED; + /* + * As long as we drop our reference, all necessary cleanup will handle when + * the cleanup function drops its reference and our destruct implementation + * is called. Note that since the listen handler will remove pending from + * the pending list upon our failure, the cleanup function won't drop the + * additional reference, which is why we do it here. + */ + sock_put(pending); + + return err; +} + + +/* + *---------------------------------------------------------------------------- + * + * VSockVmciRecvConnectingClient -- + * + * Receives packets for sockets in the connecting state on the client side. + * + * Connecting sockets on the client side should only receive attach packets. + * All others should be treated as cause for closing the connection. + * + * Note that this assumes the socket lock is held for both sk and pending. + * + * Results: + * Zero on success, negative error code on failure. + * + * Side effects: + * The socket may transition to the connected state and wakeup the pending + * caller of connect(). + * + *---------------------------------------------------------------------------- + */ + +static int +VSockVmciRecvConnectingClient(struct sock *sk, // IN: socket + VSockPacket *pkt) // IN: current packet +{ + VSockVmciSock *vsk; + int err; + int skerr; + + ASSERT(sk); + ASSERT(pkt); + ASSERT(sk->compat_sk_state == SS_CONNECTING); + + vsk = vsock_sk(sk); + + switch (pkt->type) { + case VSOCK_PACKET_TYPE_ATTACH: + if (VMCI_HANDLE_INVALID(pkt->u.handle) || + !VMCI_HANDLE_EQUAL(pkt->u.handle, vsk->qpHandle)) { + skerr = EPROTO; + err = -EINVAL; + goto destroy; + } + + /* + * Signify the socket is connected and wakeup the waiter in connect(). + * Also place the socket in the connected table for accounting (it can + * already be found since it's in the bound table). + */ + sk->compat_sk_state = SS_CONNECTED; + sk->compat_sk_socket->state = SS_CONNECTED; + VSockVmciInsertConnected(vsockConnectedSocketsVsk(vsk), sk); + sk->compat_sk_state_change(sk); + break; + case VSOCK_PACKET_TYPE_NEGOTIATE: + if (pkt->u.size == 0 || + VMCI_HANDLE_TO_CONTEXT_ID(pkt->dg.src) != vsk->remoteAddr.svm_cid || + pkt->srcPort != vsk->remoteAddr.svm_port || + !VMCI_HANDLE_INVALID(vsk->qpHandle) || + vsk->produceQ || + vsk->consumeQ || + vsk->produceSize != 0 || + vsk->consumeSize != 0 || + vsk->attachSubId != VMCI_INVALID_ID || + vsk->detachSubId != VMCI_INVALID_ID) { + skerr = EPROTO; + err = -EINVAL; + goto destroy; + } + + err = VSockVmciRecvConnectingClientNegotiate(sk, pkt); + if (err) { + skerr = -err; + goto destroy; + } + + break; + case VSOCK_PACKET_TYPE_RST: + skerr = ECONNRESET; + err = 0; + goto destroy; + default: + /* Close and cleanup the connection. */ + skerr = EPROTO; + err = -EINVAL; + goto destroy; + } + + ASSERT(pkt->type == VSOCK_PACKET_TYPE_ATTACH || + pkt->type == VSOCK_PACKET_TYPE_NEGOTIATE); + + return 0; + +destroy: + VSOCK_SEND_RESET(sk, pkt); + + sk->compat_sk_state = SS_UNCONNECTED; + sk->compat_sk_err = skerr; + sk->compat_sk_error_report(sk); + return err; +} + + +/* + *---------------------------------------------------------------------------- + * + * VSockVmciRecvConnectingClientNegotiate -- + * + * Handles a negotiate packet for a client in the connecting state. + * + * Note that this assumes the socket lock is held for both sk and pending. + * + * Results: + * Zero on success, negative error code on failure. + * + * Side effects: + * The socket may transition to the connected state and wakeup the pending + * caller of connect(). + * + *---------------------------------------------------------------------------- + */ + +static int +VSockVmciRecvConnectingClientNegotiate(struct sock *sk, // IN: socket + VSockPacket *pkt) // IN: current packet +{ + int err; + VSockVmciSock *vsk; + VMCIHandle handle; + VMCIQueue *produceQ; + VMCIQueue *consumeQ; + VMCIId attachSubId; + VMCIId detachSubId; + Bool isLocal; + + vsk = vsock_sk(sk); + handle = VMCI_INVALID_HANDLE; + attachSubId = VMCI_INVALID_ID; + detachSubId = VMCI_INVALID_ID; + + ASSERT(sk); + ASSERT(pkt); + ASSERT(pkt->u.size > 0); + ASSERT(vsk->remoteAddr.svm_cid == VMCI_HANDLE_TO_CONTEXT_ID(pkt->dg.src)); + ASSERT(vsk->remoteAddr.svm_port == pkt->srcPort); + ASSERT(VMCI_HANDLE_INVALID(vsk->qpHandle)); + ASSERT(vsk->produceQ == NULL); + ASSERT(vsk->consumeQ == NULL); + ASSERT(vsk->produceSize == 0); + ASSERT(vsk->consumeSize == 0); + ASSERT(vsk->attachSubId == VMCI_INVALID_ID); + ASSERT(vsk->detachSubId == VMCI_INVALID_ID); + + /* Verify that we're OK with the proposed queue pair size */ + if (pkt->u.size < vsk->queuePairMinSize || + pkt->u.size > vsk->queuePairMaxSize) { + err = -EINVAL; + goto destroy; + } + + /* + * Subscribe to attach and detach events first. + * + * XXX We attach once for each queue pair created for now so it is easy + * to find the socket (it's provided), but later we should only subscribe + * once and add a way to lookup sockets by queue pair handle. + */ + err = VMCIEvent_Subscribe(VMCI_EVENT_QP_PEER_ATTACH, + VSockVmciPeerAttachCB, + sk, + &attachSubId); + if (err < VMCI_SUCCESS) { + err = VSockVmci_ErrorToVSockError(err); + goto destroy; + } + + err = VMCIEvent_Subscribe(VMCI_EVENT_QP_PEER_DETACH, + VSockVmciPeerDetachCB, + sk, + &detachSubId); + if (err < VMCI_SUCCESS) { + err = VSockVmci_ErrorToVSockError(err); + goto destroy; + } + + /* Make VMCI select the handle for us. */ + handle = VMCI_INVALID_HANDLE; + isLocal = vsk->remoteAddr.svm_cid == vsk->localAddr.svm_cid; + + err = VMCIQueuePair_Alloc(&handle, + &produceQ, pkt->u.size, + &consumeQ, pkt->u.size, + vsk->remoteAddr.svm_cid, + isLocal ? VMCI_QPFLAG_LOCAL : 0); + if (err < VMCI_SUCCESS) { + err = VSockVmci_ErrorToVSockError(err); + goto destroy; + } + + VMCIQueue_Init(handle, produceQ); + + err = VSOCK_SEND_QP_OFFER(sk, handle); + if (err < 0) { + err = VSockVmci_ErrorToVSockError(err); + goto destroy; + } + + vsk->qpHandle = handle; + vsk->produceQ = produceQ; + vsk->consumeQ = consumeQ; + vsk->produceSize = vsk->consumeSize = vsk->writeNotifyWindow = pkt->u.size; + vsk->attachSubId = attachSubId; + vsk->detachSubId = detachSubId; + + return 0; + +destroy: + if (attachSubId != VMCI_INVALID_ID) { + VMCIEvent_Unsubscribe(attachSubId); + ASSERT(vsk->attachSubId == VMCI_INVALID_ID); + } + + if (detachSubId != VMCI_INVALID_ID) { + VMCIEvent_Unsubscribe(detachSubId); + ASSERT(vsk->detachSubId == VMCI_INVALID_ID); + } + + if (!VMCI_HANDLE_INVALID(handle)) { + VMCIQueuePair_Detach(handle); + ASSERT(VMCI_HANDLE_INVALID(vsk->qpHandle)); + } + + return err; +} + + +/* + *---------------------------------------------------------------------------- + * + * VSockVmciRecvConnected -- + * + * Receives packets for sockets in the connected state. + * + * Connected sockets should only ever receive detach, wrote, read, or reset + * control messages. Others are treated as errors that are ignored. + * + * Wrote and read signify that the peer has produced or consumed, + * respectively. + * + * Detach messages signify that the connection is being closed cleanly and + * reset messages signify that the connection is being closed in error. + * + * Note that this assumes the socket lock is held. + * + * Results: + * Zero on success, negative error code on failure. + * + * Side effects: + * A queue pair may be created, an offer control packet sent, and the socket + * may transition to the connecting state. + * + * + *---------------------------------------------------------------------------- + */ + +static int +VSockVmciRecvConnected(struct sock *sk, // IN + VSockPacket *pkt) // IN +{ + ASSERT(sk); + ASSERT(pkt); + ASSERT(sk->compat_sk_state == SS_CONNECTED); + + /* + * In cases where we are closing the connection, it's sufficient to mark + * the state change (and maybe error) and wake up any waiting threads. + * Since this is a connected socket, it's owned by a user process and will + * be cleaned up when the failure is passed back on the current or next + * system call. Our system call implementations must therefore check for + * error and state changes on entry and when being awoken. + */ + switch (pkt->type) { + case VSOCK_PACKET_TYPE_SHUTDOWN: + if (pkt->u.mode) { + VSockVmciSock *vsk = vsock_sk(sk); + + vsk->peerShutdown |= pkt->u.mode; + sk->compat_sk_state_change(sk); + } + break; + + case VSOCK_PACKET_TYPE_RST: + sk->compat_sk_state = SS_DISCONNECTING; + sk->compat_sk_shutdown = SHUTDOWN_MASK; + sk->compat_sk_err = ECONNRESET; + sk->compat_sk_error_report(sk); + break; + + case VSOCK_PACKET_TYPE_WROTE: + sk->compat_sk_data_ready(sk, 0); + break; + + case VSOCK_PACKET_TYPE_READ: + sk->compat_sk_write_space(sk); + break; + + case VSOCK_PACKET_TYPE_WAITING_WRITE: + VSockVmciHandleWaitingWrite(sk, pkt, FALSE, NULL, NULL); + break; + + case VSOCK_PACKET_TYPE_WAITING_READ: + VSockVmciHandleWaitingRead(sk, pkt, FALSE, NULL, NULL); + break; + + default: + return -EINVAL; + } + + return 0; +} + + +/* + *---------------------------------------------------------------------------- + * + * VSockVmciSendControlPktBH -- + * + * Sends a control packet from bottom-half context. + * + * Results: + * Size of datagram sent on success, negative error code otherwise. Note + * that we return a VMCI error message since that's what callers will need + * to provide. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +static int +VSockVmciSendControlPktBH(struct sockaddr_vm *src, // IN + struct sockaddr_vm *dst, // IN + VSockPacketType type, // IN + uint64 size, // IN + uint64 mode, // IN + VSockWaitingInfo *wait, // IN + VMCIHandle handle) // IN +{ + /* + * Note that it is safe to use a single packet across all CPUs since two + * tasklets of the same type are guaranteed to not ever run simultaneously. + * If that ever changes, or VMCI stops using tasklets, we can use per-cpu + * packets. + */ + static VSockPacket pkt; + + VSockPacket_Init(&pkt, src, dst, type, size, mode, wait, handle); + + LOG_PACKET(&pkt); +#ifdef VSOCK_CONTROL_PACKET_COUNT + controlPacketCount[pkt.type]++; +#endif + return VMCIDatagram_Send(&pkt.dg); +} + + +/* + *---------------------------------------------------------------------------- + * + * VSockVmciSendControlPkt -- + * + * Sends a control packet. + * + * Results: + * Size of datagram sent on success, negative error on failure. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +static int +VSockVmciSendControlPkt(struct sock *sk, // IN + VSockPacketType type, // IN + uint64 size, // IN + uint64 mode, // IN + VSockWaitingInfo *wait, // IN + VMCIHandle handle) // IN +{ + VSockPacket *pkt; + VSockVmciSock *vsk; + int err; + + ASSERT(sk); + /* + * New sockets for connection establishment won't have socket structures + * yet; if one exists, ensure it is of the proper type. + */ + ASSERT(sk->compat_sk_socket ? + sk->compat_sk_socket->type == SOCK_STREAM : + 1); + + vsk = vsock_sk(sk); + + if (!VSockAddr_Bound(&vsk->localAddr)) { + return -EINVAL; + } + + if (!VSockAddr_Bound(&vsk->remoteAddr)) { + return -EINVAL; + } + + pkt = kmalloc(sizeof *pkt, GFP_KERNEL); + if (!pkt) { + return -ENOMEM; + } + + VSockPacket_Init(pkt, &vsk->localAddr, &vsk->remoteAddr, + type, size, mode, wait, handle); + + LOG_PACKET(pkt); + err = VMCIDatagram_Send(&pkt->dg); + kfree(pkt); + if (err < 0) { + return VSockVmci_ErrorToVSockError(err); + } + +#ifdef VSOCK_CONTROL_PACKET_COUNT + controlPacketCount[pkt->type]++; +#endif + + return err; +} +#endif + + +/* + *---------------------------------------------------------------------------- + * + * __VSockVmciBind -- + * + * Common functionality needed to bind the specified address to the + * VSocket. If VMADDR_CID_ANY or VMADDR_PORT_ANY are specified, the context + * ID or port are selected automatically. + * + * Results: + * Zero on success, negative error code on failure. + * + * Side effects: + * On success, a new datagram handle is created. + * + *---------------------------------------------------------------------------- + */ + +static int +__VSockVmciBind(struct sock *sk, // IN/OUT + struct sockaddr_vm *addr) // IN +{ + static unsigned int port = LAST_RESERVED_PORT + 1; + struct sockaddr_vm newAddr; + VSockVmciSock *vsk; + VMCIId cid; + int err; + + ASSERT(sk); + ASSERT(sk->compat_sk_socket); + ASSERT(addr); + + vsk = vsock_sk(sk); + + /* First ensure this socket isn't already bound. */ + if (VSockAddr_Bound(&vsk->localAddr)) { + return -EINVAL; + } + + /* + * Now bind to the provided address or select appropriate values if none are + * provided (VMADDR_CID_ANY and VMADDR_PORT_ANY). Note that like AF_INET + * prevents binding to a non-local IP address (in most cases), we only allow + * binding to the local CID. + */ + VSockAddr_Init(&newAddr, VMADDR_CID_ANY, VMADDR_PORT_ANY); + + cid = VMCI_GetContextID(); + if (addr->svm_cid != cid && + addr->svm_cid != VMADDR_CID_ANY) { + return -EADDRNOTAVAIL; + } + + newAddr.svm_cid = cid; + + switch (sk->compat_sk_socket->type) { + case SOCK_STREAM: + spin_lock_bh(&vsockTableLock); + + if (addr->svm_port == VMADDR_PORT_ANY) { + Bool found = FALSE; + unsigned int i; + + for (i = 0; i < MAX_PORT_RETRIES; i++) { + if (port <= LAST_RESERVED_PORT) { + port = LAST_RESERVED_PORT + 1; + } + + newAddr.svm_port = port++; + + if (!__VSockVmciFindBoundSocket(&newAddr)) { + found = TRUE; + break; + } + } + + if (!found) { + err = -EADDRNOTAVAIL; + goto out; + } + } else { + /* If port is in reserved range, ensure caller has necessary privileges. */ + if (addr->svm_port <= LAST_RESERVED_PORT && + !capable(CAP_NET_BIND_SERVICE)) { + err = -EACCES; + goto out; + } + + newAddr.svm_port = addr->svm_port; + if (__VSockVmciFindBoundSocket(&newAddr)) { + err = -EADDRINUSE; + goto out; + } + + } + break; + case SOCK_DGRAM: + /* VMCI will select a resource ID for us if we provide VMCI_INVALID_ID. */ + newAddr.svm_port = addr->svm_port == VMADDR_PORT_ANY ? + VMCI_INVALID_ID : + addr->svm_port; + + if (newAddr.svm_port <= LAST_RESERVED_PORT && + !capable(CAP_NET_BIND_SERVICE)) { + err = -EACCES; + goto out; + } + + err = VMCIDatagram_CreateHnd(newAddr.svm_port, 0, + VSockVmciRecvDgramCB, sk, + &vsk->dgHandle); + if (err != VMCI_SUCCESS || + vsk->dgHandle.context == VMCI_INVALID_ID || + vsk->dgHandle.resource == VMCI_INVALID_ID) { + err = VSockVmci_ErrorToVSockError(err); + goto out; + } + + newAddr.svm_port = VMCI_HANDLE_TO_RESOURCE_ID(vsk->dgHandle); + break; + default: + err = -EINVAL; + goto out; + } + + VSockAddr_Init(&vsk->localAddr, newAddr.svm_cid, newAddr.svm_port); + + /* + * Remove stream sockets from the unbound list and add them to the hash + * table for easy lookup by its address. The unbound list is simply an + * extra entry at the end of the hash table, a trick used by AF_UNIX. + */ + if (sk->compat_sk_socket->type == SOCK_STREAM) { + __VSockVmciRemoveBound(sk); + __VSockVmciInsertBound(vsockBoundSockets(&vsk->localAddr), sk); + } + + err = 0; + +out: + if (sk->compat_sk_socket->type == SOCK_STREAM) { + spin_unlock_bh(&vsockTableLock); + } + return err; +} + + +#ifdef VMX86_TOOLS +/* + *---------------------------------------------------------------------------- + * + * VSockVmciSendWaitingWrite -- + * + * Sends a waiting write notification to this socket's peer. + * + * Results: + * TRUE if the datagram is sent successfully, FALSE otherwise. + * + * Side effects: + * Our peer will notify us when there is room to write in to our produce + * queue. + * + *---------------------------------------------------------------------------- + */ + + +static Bool +VSockVmciSendWaitingWrite(struct sock *sk, // IN + uint64 roomNeeded) // IN +{ +#ifdef VSOCK_OPTIMIZATION_WAITING_NOTIFY + VSockVmciSock *vsk; + VSockWaitingInfo waitingInfo; + uint64 tail; + uint64 head; + uint64 roomLeft; + + ASSERT(sk); + + vsk = vsock_sk(sk); + + VMCIQueue_GetPointers(vsk->produceQ, vsk->consumeQ, &tail, &head); + roomLeft = vsk->produceSize - tail; + if (roomNeeded + 1 >= roomLeft) { + /* Wraps around to current generation. */ + waitingInfo.offset = roomNeeded + 1 - roomLeft; + waitingInfo.generation = vsk->produceQGeneration; + } else { + waitingInfo.offset = tail + roomNeeded + 1; + waitingInfo.generation = vsk->produceQGeneration - 1; + } + + return VSOCK_SEND_WAITING_WRITE(sk, &waitingInfo) > 0; +#else + return TRUE; +#endif +} + + +/* + *---------------------------------------------------------------------------- + * + * VSockVmciSendWaitingRead -- + * + * Sends a waiting read notification to this socket's peer. + * + * Results: + * TRUE if the datagram is sent successfully, FALSE otherwise. + * + * Side effects: + * Our peer will notify us when there is data to read from our consume + * queue. + * + *---------------------------------------------------------------------------- + */ + +static Bool +VSockVmciSendWaitingRead(struct sock *sk, // IN + uint64 roomNeeded) // IN +{ +#ifdef VSOCK_OPTIMIZATION_WAITING_NOTIFY + VSockVmciSock *vsk; + VSockWaitingInfo waitingInfo; + uint64 tail; + uint64 head; + uint64 roomLeft; + + ASSERT(sk); + + vsk = vsock_sk(sk); + + if (vsk->writeNotifyWindow < vsk->consumeSize) { + vsk->writeNotifyWindow = MIN(vsk->writeNotifyWindow + PAGE_SIZE, + vsk->consumeSize); + } + + VMCIQueue_GetPointers(vsk->consumeQ, vsk->produceQ, &tail, &head); + roomLeft = vsk->consumeSize - head; + if (roomNeeded >= roomLeft) { + waitingInfo.offset = roomNeeded - roomLeft; + waitingInfo.generation = vsk->consumeQGeneration + 1; + } else { + waitingInfo.offset = head + roomNeeded; + waitingInfo.generation = vsk->consumeQGeneration; + } + + return VSOCK_SEND_WAITING_READ(sk, &waitingInfo) > 0; +#else + return TRUE; +#endif +} + + +/* + *---------------------------------------------------------------------------- + * + * VSockVmciSendReadNotification -- + * + * Sends a read notification to this socket's peer. + * + * Results: + * >= 0 if the datagram is sent successfully, negative error value + * otherwise. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +static int +VSockVmciSendReadNotification(struct sock *sk) // IN +{ + VSockVmciSock *vsk; + Bool sentRead; + unsigned int retries; + int err; + + ASSERT(sk); + + vsk = vsock_sk(sk); + sentRead = FALSE; + retries = 0; + err = 0; + + if (VSockVmciNotifyWaitingWrite(vsk)) { + /* + * Notify the peer that we have read, retrying the send on failure up to our + * maximum value. XXX For now we just log the failure, but later we should + * schedule a work item to handle the resend until it succeeds. That would + * require keeping track of work items in the vsk and cleaning them up upon + * socket close. + */ + while (!(vsk->peerShutdown & RCV_SHUTDOWN) && + !sentRead && + retries < VSOCK_MAX_DGRAM_RESENDS) { + err = VSOCK_SEND_READ(sk); + if (err >= 0) { + sentRead = TRUE; + } + + retries++; + } + + if (retries >= VSOCK_MAX_DGRAM_RESENDS) { + Warning("unable to send read notification to peer for socket %p.\n", sk); + } else { +#if defined(VSOCK_OPTIMIZATION_WAITING_NOTIFY) + vsk->peerWaitingWrite = FALSE; +#endif + } + } + return err; +} +#endif // VMX86_TOOLS + + +/* + *---------------------------------------------------------------------------- + * + * __VSockVmciCreate -- + * + * Does the work to create the sock structure. + * Note: If sock is NULL then the type field must be non-zero. + * Otherwise, sock is non-NULL and the type of sock is used in the + * newly created socket. + * + * Results: + * sock structure on success, NULL on failure. + * + * Side effects: + * Allocated sk is added to the unbound sockets list iff it is owned by + * a struct socket. + * + *---------------------------------------------------------------------------- + */ + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 14) +static struct sock * +__VSockVmciCreate(struct socket *sock, // IN: Owning socket, may be NULL + unsigned int priority, // IN: Allocation flags + unsigned short type) // IN: Socket type if sock is NULL +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24) +static struct sock * +__VSockVmciCreate(struct socket *sock, // IN: Owning socket, may be NULL + gfp_t priority, // IN: Allocation flags + unsigned short type) // IN: Socket type if sock is NULL +#else +static struct sock * +__VSockVmciCreate(struct net *net, // IN: Network namespace + struct socket *sock, // IN: Owning socket, may be NULL + gfp_t priority, // IN: Allocation flags + unsigned short type) // IN: Socket type if sock is NULL + +#endif +{ + struct sock *sk; + VSockVmciSock *vsk; + + ASSERT((sock && !type) || (!sock && type)); + + vsk = NULL; + + /* + * Before 2.5.5, sk_alloc() always used its own cache and protocol-specific + * data was contained in the protinfo union. We cannot use those other + * structures so we allocate our own structure and attach it to the + * user_data pointer that we don't otherwise need. We must be sure to free + * it later in our destruct routine. + * + * From 2.5.5 until 2.6.8, sk_alloc() offerred to use a cache that the + * caller provided. After this, the cache was moved into the proto + * structure, but you still had to specify the size and cache yourself until + * 2.6.12. Most recently (in 2.6.24), sk_alloc() was changed to expect the + * network namespace, and the option to zero the sock was dropped. + * + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 5) + sk = sk_alloc(vsockVmciFamilyOps.family, priority, 1); +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 9) + sk = sk_alloc(vsockVmciFamilyOps.family, priority, + sizeof (VSockVmciSock), vsockCachep); +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 12) + sk = sk_alloc(vsockVmciFamilyOps.family, priority, + vsockVmciProto.slab_obj_size, vsockVmciProto.slab); +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24) + sk = sk_alloc(vsockVmciFamilyOps.family, priority, &vsockVmciProto, 1); +#else + sk = sk_alloc(net, vsockVmciFamilyOps.family, priority, &vsockVmciProto); +#endif + if (!sk) { + return NULL; + } + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 5) + vsock_sk(sk) = kmalloc(sizeof *vsk, priority); + if (!vsock_sk(sk)) { + sk_free(sk); + return NULL; + } + sk_vsock(vsock_sk(sk)) = sk; +#endif + + /* + * If we go this far, we know the socket family is registered, so there's no + * need to register it now. + */ + down(®istrationMutex); + vsockVmciSocketCount++; + up(®istrationMutex); + + sock_init_data(sock, sk); + + /* + * sk->compat_sk_type is normally set in sock_init_data, but only if + * sock is non-NULL. We make sure that our sockets always have a type + * by setting it here if needed. + */ + if (!sock) { + sk->compat_sk_type = type; + } + + vsk = vsock_sk(sk); + VSockAddr_Init(&vsk->localAddr, VMADDR_CID_ANY, VMADDR_PORT_ANY); + VSockAddr_Init(&vsk->remoteAddr, VMADDR_CID_ANY, VMADDR_PORT_ANY); + + sk->compat_sk_destruct = VSockVmciSkDestruct; + sk->compat_sk_backlog_rcv = VSockVmciQueueRcvSkb; + sk->compat_sk_state = SS_UNCONNECTED; + compat_sock_reset_done(sk); + + INIT_LIST_HEAD(&vsk->boundTable); + INIT_LIST_HEAD(&vsk->connectedTable); + vsk->dgHandle = VMCI_INVALID_HANDLE; +#ifdef VMX86_TOOLS + vsk->qpHandle = VMCI_INVALID_HANDLE; + vsk->produceQ = vsk->consumeQ = NULL; + vsk->produceQGeneration = vsk->consumeQGeneration = 0; + vsk->produceSize = vsk->consumeSize = 0; + vsk->writeNotifyWindow = 0; + vsk->writeNotifyMinWindow = PAGE_SIZE; + vsk->queuePairSize = VSOCK_DEFAULT_QP_SIZE; + vsk->queuePairMinSize = VSOCK_DEFAULT_QP_SIZE_MIN; + vsk->queuePairMaxSize = VSOCK_DEFAULT_QP_SIZE_MAX; + vsk->peerWaitingRead = vsk->peerWaitingWrite = FALSE; + vsk->peerWaitingWriteDetected = FALSE; + memset(&vsk->peerWaitingReadInfo, 0, sizeof vsk->peerWaitingReadInfo); + memset(&vsk->peerWaitingWriteInfo, 0, sizeof vsk->peerWaitingWriteInfo); + vsk->listener = NULL; + INIT_LIST_HEAD(&vsk->pendingLinks); + INIT_LIST_HEAD(&vsk->acceptQueue); + vsk->rejected = FALSE; + vsk->attachSubId = vsk->detachSubId = VMCI_INVALID_ID; + vsk->peerShutdown = 0; +#endif + + if (sock) { + VSockVmciInsertBound(vsockUnboundSockets, sk); + } + + return sk; +} + + +/* + *---------------------------------------------------------------------------- + * + * __VSockVmciRelease -- + * + * Releases the provided socket. + * + * Results: + * None. + * + * Side effects: + * Any pending sockets are also released. + * + *---------------------------------------------------------------------------- + */ + +static void +__VSockVmciRelease(struct sock *sk) // IN +{ + if (sk) { + struct sk_buff *skb; + struct sock *pending; + struct VSockVmciSock *vsk; + + vsk = vsock_sk(sk); + pending = NULL; /* Compiler warning. */ + + if (VSockVmciInBoundTable(sk)) { + VSockVmciRemoveBound(sk); + } + + if (VSockVmciInConnectedTable(sk)) { + VSockVmciRemoveConnected(sk); + } + + if (!VMCI_HANDLE_INVALID(vsk->dgHandle)) { + VMCIDatagram_DestroyHnd(vsk->dgHandle); + vsk->dgHandle = VMCI_INVALID_HANDLE; + } + + lock_sock(sk); + sock_orphan(sk); + sk->compat_sk_shutdown = SHUTDOWN_MASK; + + while ((skb = skb_dequeue(&sk->compat_sk_receive_queue))) { + kfree_skb(skb); + } + + /* Clean up any sockets that never were accepted. */ +#ifdef VMX86_TOOLS + while ((pending = VSockVmciDequeueAccept(sk)) != NULL) { + __VSockVmciRelease(pending); + sock_put(pending); + } +#endif + + release_sock(sk); + sock_put(sk); + } +} + + +/* + * Sock operations. + */ + +/* + *---------------------------------------------------------------------------- + * + * VSockVmciSkDestruct -- + * + * Destroys the provided socket. This is called by sk_free(), which is + * invoked when the reference count of the socket drops to zero. + * + * Results: + * None. + * + * Side effects: + * Socket count is decremented. + * + *---------------------------------------------------------------------------- + */ + +static void +VSockVmciSkDestruct(struct sock *sk) // IN +{ + VSockVmciSock *vsk; + + vsk = vsock_sk(sk); + +#ifdef VMX86_TOOLS + if (vsk->attachSubId != VMCI_INVALID_ID) { + VMCIEvent_Unsubscribe(vsk->attachSubId); + vsk->attachSubId = VMCI_INVALID_ID; + } + + if (vsk->detachSubId != VMCI_INVALID_ID) { + VMCIEvent_Unsubscribe(vsk->detachSubId); + vsk->detachSubId = VMCI_INVALID_ID; + } + + if (!VMCI_HANDLE_INVALID(vsk->qpHandle)) { + VMCIQueuePair_Detach(vsk->qpHandle); + vsk->qpHandle = VMCI_INVALID_HANDLE; + vsk->produceQ = vsk->consumeQ = NULL; + vsk->produceSize = vsk->consumeSize = 0; + } +#endif + + /* + * Each list entry holds a reference on the socket, so we should not even be + * here if the socket is in one of our lists. If we are we have a stray + * sock_put() that needs to go away. + */ + ASSERT(!VSockVmciInBoundTable(sk)); + ASSERT(!VSockVmciInConnectedTable(sk)); +#ifdef VMX86_TOOLS + ASSERT(!VSockVmciIsPending(sk)); + ASSERT(!VSockVmciInAcceptQueue(sk)); +#endif + + /* + * When clearing these addresses, there's no need to set the family and + * possibly register the address family with the kernel. + */ + VSockAddr_InitNoFamily(&vsk->localAddr, VMADDR_CID_ANY, VMADDR_PORT_ANY); + VSockAddr_InitNoFamily(&vsk->remoteAddr, VMADDR_CID_ANY, VMADDR_PORT_ANY); + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 5) + ASSERT(vsock_sk(sk) == vsk); + kfree(vsock_sk(sk)); +#endif + + down(®istrationMutex); + vsockVmciSocketCount--; + VSockVmciTestUnregister(); + up(®istrationMutex); + +#ifdef VSOCK_CONTROL_PACKET_COUNT + { + uint32 index; + for (index = 0; index < ARRAYSIZE(controlPacketCount); index++) { + Warning("Control packet count: Type = %u, Count = %"FMT64"u\n", + index, controlPacketCount[index]); + } + } +#endif +} + + +/* + *---------------------------------------------------------------------------- + * + * VSockVmciQueueRcvSkb -- + * + * Receives skb on the socket's receive queue. + * + * Results: + * Zero on success, negative error code on failure. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +static int +VSockVmciQueueRcvSkb(struct sock *sk, // IN + struct sk_buff *skb) // IN +{ + int err; + + err = sock_queue_rcv_skb(sk, skb); + if (err) { + kfree_skb(skb); + } + + return err; +} + + +/* + *---------------------------------------------------------------------------- + * + * VSockVmciRegisterProto -- + * + * Registers the vmci sockets protocol family. + * + * Results: + * Zero on success, error code on failure. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +static INLINE int +VSockVmciRegisterProto(void) +{ + int err; + + err = 0; + + /* + * Before 2.6.9, each address family created their own slab (by calling + * kmem_cache_create() directly). From 2.6.9 until 2.6.11, these address + * families instead called sk_alloc_slab() and the allocated slab was + * assigned to the slab variable in the proto struct and was created of size + * slab_obj_size. As of 2.6.12 and later, this slab allocation was moved + * into proto_register() and only done if you specified a non-zero value for + * the second argument (alloc_slab); the size of the slab element was + * changed to obj_size. + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 5) + /* Simply here for clarity and so else case at end implies > rest. */ +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 9) + vsockCachep = kmem_cache_create("vsock", sizeof (VSockVmciSock), + 0, SLAB_HWCACHE_ALIGN, NULL, NULL); + if (!vsockCachep) { + err = -ENOMEM; + } +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 12) + err = sk_alloc_slab(&vsockVmciProto, "vsock"); + if (err != 0) { + sk_alloc_slab_error(&vsockVmciProto); + } +#else + /* Specify 1 as the second argument so the slab is created for us. */ + err = proto_register(&vsockVmciProto, 1); +#endif + + return err; +} + + +/* + *---------------------------------------------------------------------------- + * + * VSockVmciUnregisterProto -- + * + * Unregisters the vmci sockets protocol family. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +static INLINE void +VSockVmciUnregisterProto(void) +{ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 5) + /* Simply here for clarity and so else case at end implies > rest. */ +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 9) + kmem_cache_destroy(vsockCachep); +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 12) + sk_free_slab(&vsockVmciProto); +#else + proto_unregister(&vsockVmciProto); +#endif + +#ifdef VSOCK_CONTROL_PACKET_COUNT + { + uint32 index; + for (index = 0; index < ARRAYSIZE(controlPacketCount); index++) { + controlPacketCount[index] = 0; + } + } +#endif +} + + +/* + *---------------------------------------------------------------------------- + * + * VSockVmciRegisterAddressFamily -- + * + * Registers our socket address family with the kernel. + * + * Note that this assumes the registration lock is held. + * + * Results: + * The address family value on success, negative error code on failure. + * + * Side effects: + * Callers of socket operations with the returned value, on success, will + * be able to use our socket implementation. + * + *---------------------------------------------------------------------------- + */ + +static int +VSockVmciRegisterAddressFamily(void) +{ + int err = 0; + int i; + +#ifdef VMX86_TOOLS + /* + * We don't call into the vmci module or register our socket family if the + * vmci device isn't present. + */ + vmciDevicePresent = VMCI_DeviceGet(); + if (!vmciDevicePresent) { + Log("Could not register VMCI Sockets because VMCI device is not present.\n"); + return -1; + } + + /* + * Create the datagram handle that we will use to send and receive all + * VSocket control messages for this context. + */ + err = VMCIDatagram_CreateHnd(VSOCK_PACKET_RID, 0, + VSockVmciRecvStreamCB, NULL, &vmciStreamHandle); + if (err != VMCI_SUCCESS || + vmciStreamHandle.context == VMCI_INVALID_ID || + vmciStreamHandle.resource == VMCI_INVALID_ID) { + Warning("Unable to create datagram handle. (%d)\n", err); + return -ENOMEM; + } + + err = VMCIEvent_Subscribe(VMCI_EVENT_QP_RESUMED, + VSockVmciQPResumedCB, + NULL, + &qpResumedSubId); + if (err < VMCI_SUCCESS) { + Warning("Unable to subscribe to QP resumed event. (%d)\n", err); + err = -ENOMEM; + qpResumedSubId = VMCI_INVALID_ID; + goto error; + } +#endif + + /* + * Linux will not allocate an address family to code that is not part of the + * kernel proper, so until that time comes we need a workaround. Here we + * loop through the allowed values and claim the first one that's not + * currently used. Users will then make an ioctl(2) into our module to + * retrieve this value before calling socket(2). + * + * This is undesirable, but it's better than having users' programs break + * when a hard-coded, currently-available value gets assigned to someone + * else in the future. + */ + for (i = NPROTO - 1; i >= 0; i--) { + vsockVmciFamilyOps.family = i; + err = sock_register(&vsockVmciFamilyOps); + if (err) { + Warning("Could not register address family %d.\n", i); + vsockVmciFamilyOps.family = VSOCK_INVALID_FAMILY; + } else { + vsockVmciDgramOps.family = i; +#ifdef VMX86_TOOLS + vsockVmciStreamOps.family = i; +#endif + break; + } + } + + if (err) { + goto error; + } + + return vsockVmciFamilyOps.family; + +error: +#ifdef VMX86_TOOLS + if (qpResumedSubId != VMCI_INVALID_ID) { + VMCIEvent_Unsubscribe(qpResumedSubId); + qpResumedSubId = VMCI_INVALID_ID; + } + VMCIDatagram_DestroyHnd(vmciStreamHandle); +#endif + return err; +} + + +/* + *---------------------------------------------------------------------------- + * + * VSockVmciUnregisterAddressFamily -- + * + * Unregisters the address family with the kernel. + * + * Note that this assumes the registration lock is held. + * + * Results: + * None. + * + * Side effects: + * Our socket implementation is no longer accessible. + * + *---------------------------------------------------------------------------- + */ + +static void +VSockVmciUnregisterAddressFamily(void) +{ +#ifdef VMX86_TOOLS + if (!vmciDevicePresent) { + /* Nothing was registered. */ + return; + } + + if (!VMCI_HANDLE_INVALID(vmciStreamHandle)) { + if (VMCIDatagram_DestroyHnd(vmciStreamHandle) != VMCI_SUCCESS) { + Warning("Could not destroy VMCI datagram handle.\n"); + } + } + + if (qpResumedSubId != VMCI_INVALID_ID) { + VMCIEvent_Unsubscribe(qpResumedSubId); + qpResumedSubId = VMCI_INVALID_ID; + } +#endif + + if (vsockVmciFamilyOps.family != VSOCK_INVALID_FAMILY) { + sock_unregister(vsockVmciFamilyOps.family); + } + + vsockVmciDgramOps.family = vsockVmciFamilyOps.family = VSOCK_INVALID_FAMILY; +#ifdef VMX86_TOOLS + vsockVmciStreamOps.family = vsockVmciFamilyOps.family; +#endif + +} + + +/* + * Socket operations. + */ + +/* + *---------------------------------------------------------------------------- + * + * VSockVmciRelease -- + * + * Releases the provided socket by freeing the contents of its queue. This + * is called when a user process calls close(2) on the socket. + * + * Results: + * Zero on success, negative error code on failure. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +static int +VSockVmciRelease(struct socket *sock) // IN +{ + __VSockVmciRelease(sock->sk); + sock->sk = NULL; + sock->state = SS_FREE; + + return 0; +} + + +/* + *---------------------------------------------------------------------------- + * + * VSockVmciBind -- + * + * Binds the provided address to the provided socket. + * + * Results: + * Zero on success, negative error code on failure. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +static int +VSockVmciBind(struct socket *sock, // IN + struct sockaddr *addr, // IN + int addrLen) // IN +{ + int err; + struct sock *sk; + struct sockaddr_vm *vmciAddr; + + sk = sock->sk; + + if (VSockAddr_Cast(addr, addrLen, &vmciAddr) != 0) { + return -EINVAL; + } + + lock_sock(sk); + err = __VSockVmciBind(sk, vmciAddr); + release_sock(sk); + + return err; +} + + +/* + *---------------------------------------------------------------------------- + * + * VSockVmciDgramConnect -- + * + * Connects a datagram socket. This can be called multiple times to change + * the socket's association and can be called with a sockaddr whose family + * is set to AF_UNSPEC to dissolve any existing association. + * + * Results: + * Zero on success, negative error code on failure. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +static int +VSockVmciDgramConnect(struct socket *sock, // IN + struct sockaddr *addr, // IN + int addrLen, // IN + int flags) // IN +{ + int err; + struct sock *sk; + VSockVmciSock *vsk; + struct sockaddr_vm *remoteAddr; + + sk = sock->sk; + vsk = vsock_sk(sk); + + err = VSockAddr_Cast(addr, addrLen, &remoteAddr); + if (err == -EAFNOSUPPORT && remoteAddr->svm_family == AF_UNSPEC) { + lock_sock(sk); + VSockAddr_Init(&vsk->remoteAddr, VMADDR_CID_ANY, VMADDR_PORT_ANY); + sock->state = SS_UNCONNECTED; + release_sock(sk); + return 0; + } else if (err != 0) { + return -EINVAL; + } + + lock_sock(sk); + + + if (!VSockAddr_Bound(&vsk->localAddr)) { + struct sockaddr_vm localAddr; + + VSockAddr_Init(&localAddr, VMADDR_CID_ANY, VMADDR_PORT_ANY); + if ((err = __VSockVmciBind(sk, &localAddr))) { + goto out; + } + } + + memcpy(&vsk->remoteAddr, remoteAddr, sizeof vsk->remoteAddr); + sock->state = SS_CONNECTED; + +out: + release_sock(sk); + return err; +} + + +#ifdef VMX86_TOOLS +/* + *---------------------------------------------------------------------------- + * + * VSockVmciStreamConnect -- + * + * Connects a stream socket. + * + * Results: + * Zero on success, negative error code on failure. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +static int +VSockVmciStreamConnect(struct socket *sock, // IN + struct sockaddr *addr, // IN + int addrLen, // IN + int flags) // IN +{ + int err; + struct sock *sk; + VSockVmciSock *vsk; + struct sockaddr_vm *remoteAddr; + long timeout; + COMPAT_DEFINE_WAIT(wait); + + err = 0; + sk = sock->sk; + vsk = vsock_sk(sk); + + lock_sock(sk); + + /* XXX AF_UNSPEC should make us disconnect like AF_INET. */ + + switch (sock->state) { + case SS_CONNECTED: + err = -EISCONN; + goto out; + case SS_DISCONNECTING: + case SS_LISTEN: + err = -EINVAL; + goto out; + case SS_CONNECTING: + /* + * This continues on so we can move sock into the SS_CONNECTED state once + * the connection has completed (at which point err will be set to zero + * also). Otherwise, we will either wait for the connection or return + * -EALREADY should this be a non-blocking call. + */ + err = -EALREADY; + break; + default: + ASSERT(sk->compat_sk_state == SS_FREE || + sk->compat_sk_state == SS_UNCONNECTED); + if (VSockAddr_Cast(addr, addrLen, &remoteAddr) != 0) { + err = -EINVAL; + goto out; + } + + /* The hypervisor and well-known contexts do not have socket endpoints. */ + if (!VSockAddr_SocketContext(remoteAddr->svm_cid)) { + err = -ENETUNREACH; + goto out; + } + + /* Set the remote address that we are connecting to. */ + memcpy(&vsk->remoteAddr, remoteAddr, sizeof vsk->remoteAddr); + + /* Autobind this socket to the local address if necessary. */ + if (!VSockAddr_Bound(&vsk->localAddr)) { + struct sockaddr_vm localAddr; + + VSockAddr_Init(&localAddr, VMADDR_CID_ANY, VMADDR_PORT_ANY); + if ((err = __VSockVmciBind(sk, &localAddr))) { + goto out; + } + } + + sk->compat_sk_state = SS_CONNECTING; + + err = VSOCK_SEND_CONN_REQUEST(sk, vsk->queuePairSize); + if (err < 0) { + sk->compat_sk_state = SS_UNCONNECTED; + goto out; + } + + /* + * Mark sock as connecting and set the error code to in progress in case + * this is a non-blocking connect. + */ + sock->state = SS_CONNECTING; + err = -EINPROGRESS; + } + + /* + * The receive path will handle all communication until we are able to enter + * the connected state. Here we wait for the connection to be completed or + * a notification of an error. + */ + timeout = sock_sndtimeo(sk, flags & O_NONBLOCK); + compat_init_prepare_to_wait(sk->compat_sk_sleep, &wait, TASK_INTERRUPTIBLE); + + while (sk->compat_sk_state != SS_CONNECTED && sk->compat_sk_err == 0) { + if (timeout == 0) { + /* + * If we're not going to block, skip ahead to preserve error code set + * above. + */ + goto outWait; + } + + release_sock(sk); + timeout = schedule_timeout(timeout); + lock_sock(sk); + + if (signal_pending(current)) { + err = sock_intr_errno(timeout); + goto outWaitError; + } else if (timeout == 0) { + err = -ETIMEDOUT; + goto outWaitError; + } + + compat_cont_prepare_to_wait(sk->compat_sk_sleep, &wait, TASK_INTERRUPTIBLE); + } + + if (sk->compat_sk_err) { + err = -sk->compat_sk_err; + goto outWaitError; + } else { + ASSERT(sk->compat_sk_state == SS_CONNECTED); + err = 0; + } + +outWait: + compat_finish_wait(sk->compat_sk_sleep, &wait, TASK_RUNNING); +out: + release_sock(sk); + return err; + +outWaitError: + sk->compat_sk_state = SS_UNCONNECTED; + sock->state = SS_UNCONNECTED; + goto outWait; +} + + +/* + *---------------------------------------------------------------------------- + * + * VSockVmciAccept -- + * + * Accepts next available connection request for this socket. + * + * Results: + * Zero on success, negative error code on failure. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +static int +VSockVmciAccept(struct socket *sock, // IN + struct socket *newsock, // IN/OUT + int flags) // IN +{ + struct sock *listener; + int err; + struct sock *connected; + VSockVmciSock *vconnected; + long timeout; + COMPAT_DEFINE_WAIT(wait); + + err = 0; + listener = sock->sk; + + lock_sock(listener); + + if (sock->type != SOCK_STREAM) { + err = -EOPNOTSUPP; + goto out; + } + + if (listener->compat_sk_state != SS_LISTEN) { + err = -EINVAL; + goto out; + } + + /* + * Wait for children sockets to appear; these are the new sockets created + * upon connection establishment. + */ + timeout = sock_sndtimeo(listener, flags & O_NONBLOCK); + compat_init_prepare_to_wait(listener->compat_sk_sleep, &wait, TASK_INTERRUPTIBLE); + + while ((connected = VSockVmciDequeueAccept(listener)) == NULL && + listener->compat_sk_err == 0) { + release_sock(listener); + timeout = schedule_timeout(timeout); + lock_sock(listener); + + if (signal_pending(current)) { + err = sock_intr_errno(timeout); + goto outWait; + } else if (timeout == 0) { + err = -ETIMEDOUT; + goto outWait; + } + + compat_cont_prepare_to_wait(listener->compat_sk_sleep, &wait, TASK_INTERRUPTIBLE); + } + + if (listener->compat_sk_err) { + err = -listener->compat_sk_err; + } + + if (connected) { + listener->compat_sk_ack_backlog--; + + lock_sock(connected); + vconnected = vsock_sk(connected); + + /* + * If the listener socket has received an error, then we should reject + * this socket and return. Note that we simply mark the socket rejected, + * drop our reference, and let the cleanup function handle the cleanup; + * the fact that we found it in the listener's accept queue guarantees + * that the cleanup function hasn't run yet. + */ + if (err) { + vconnected->rejected = TRUE; + release_sock(connected); + sock_put(connected); + goto outWait; + } + + newsock->state = SS_CONNECTED; + sock_graft(connected, newsock); + release_sock(connected); + sock_put(connected); + } + +outWait: + compat_finish_wait(listener->compat_sk_sleep, &wait, TASK_RUNNING); +out: + release_sock(listener); + return err; +} +#endif + + +/* + *---------------------------------------------------------------------------- + * + * VSockVmciGetname -- + * + * Provides the local or remote address for the socket. + * + * Results: + * Zero on success, negative error code otherwise. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +static int +VSockVmciGetname(struct socket *sock, // IN + struct sockaddr *addr, // OUT + int *addrLen, // OUT + int peer) // IN +{ + int err; + struct sock *sk; + VSockVmciSock *vsk; + struct sockaddr_vm *vmciAddr; + + sk = sock->sk; + vsk = vsock_sk(sk); + err = 0; + + lock_sock(sk); + + if (peer) { + if (sock->state != SS_CONNECTED) { + err = -ENOTCONN; + goto out; + } + vmciAddr = &vsk->remoteAddr; + } else { + vmciAddr = &vsk->localAddr; + } + + if (!vmciAddr) { + err = -EINVAL; + goto out; + } + + /* + * sys_getsockname() and sys_getpeername() pass us a MAX_SOCK_ADDR-sized + * buffer and don't set addrLen. Unfortunately that macro is defined in + * socket.c instead of .h, so we hardcode its value here. + */ + ASSERT_ON_COMPILE(sizeof *vmciAddr <= 128); + memcpy(addr, vmciAddr, sizeof *vmciAddr); + *addrLen = sizeof *vmciAddr; + +out: + release_sock(sk); + return err; +} + + +/* + *---------------------------------------------------------------------------- + * + * VSockVmciPoll -- + * + * Waits on file for activity then provides mask indicating state of socket. + * + * Results: + * Mask of flags containing socket state. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +static unsigned int +VSockVmciPoll(struct file *file, // IN + struct socket *sock, // IN + poll_table *wait) // IN +{ + struct sock *sk; + unsigned int mask; + + sk = sock->sk; + + poll_wait(file, sk->compat_sk_sleep, wait); + mask = 0; + + if (sk->compat_sk_err) { + /* Signify that there has been an error on this socket. */ + mask |= POLLERR; + } + + if (sk->compat_sk_shutdown == SHUTDOWN_MASK) { + mask |= POLLHUP; + } + + /* POLLRDHUP wasn't added until 2.6.17. */ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 17) + if (sk->compat_sk_shutdown & RCV_SHUTDOWN) { + mask |= POLLRDHUP; + } +#endif + + if (sock->type == SOCK_DGRAM) { + /* + * For datagram sockets we can read if there is something in the queue + * and write as long as the socket isn't shutdown for sending. + */ + if (!skb_queue_empty(&sk->compat_sk_receive_queue) || + (sk->compat_sk_shutdown & RCV_SHUTDOWN)) { + mask |= POLLIN | POLLRDNORM; + } + + if (!(sk->compat_sk_shutdown & SEND_SHUTDOWN)) { + mask |= POLLOUT | POLLWRNORM | POLLWRBAND; + } +#ifdef VMX86_TOOLS + } else if (sock->type == SOCK_STREAM) { + VSockVmciSock *vsk; + + lock_sock(sk); + + vsk = vsock_sk(sk); + + /* + * Listening sockets that have connections in their accept queue and + * connected sockets that have consumable data can be read. Sockets + * whose connections have been close, reset, or terminated should also be + * considered read, and we check the shutdown flag for that. + */ + if ((sk->compat_sk_state == SS_LISTEN && + !VSockVmciIsAcceptQueueEmpty(sk)) || + (!VMCI_HANDLE_INVALID(vsk->qpHandle) && + !(sk->compat_sk_shutdown & RCV_SHUTDOWN) && + VMCIQueue_BufReady(vsk->consumeQ, + vsk->produceQ, vsk->consumeSize)) || + sk->compat_sk_shutdown) { + mask |= POLLIN | POLLRDNORM; + } + + /* + * Connected sockets that can produce data can be written. + */ + if (sk->compat_sk_state == SS_CONNECTED && + !(sk->compat_sk_shutdown & SEND_SHUTDOWN) && + VMCIQueue_FreeSpace(vsk->produceQ, + vsk->consumeQ, vsk->produceSize) > 0) { + mask |= POLLOUT | POLLWRNORM | POLLWRBAND; + } + + /* + * Connected sockets also need to notify their peer that they are + * waiting. Optimally these calls would happen in the code that decides + * whether the caller will wait or not, but that's core kernel code and + * this is the best we can do. If the caller doesn't sleep, the worst + * that happens is a few extra datagrams are sent. + */ + if (sk->compat_sk_state == SS_CONNECTED) { + if (VMCIQueue_FreeSpace(vsk->produceQ, + vsk->consumeQ, vsk->produceSize) == 0) { + /* + * Only send waiting write if the queue is full, otherwise we end + * up in an infinite WAITING_WRITE, READ, WAITING_WRITE, READ, etc. + * loop. Treat failing to send the notification as a socket error, + * passing that back through the mask. + */ + if (!VSockVmciSendWaitingWrite(sk, 1)) { + mask |= POLLERR; + } + } + + if (!VSockVmciSendWaitingRead(sk, 1)) { + mask |= POLLERR; + } + } + + release_sock(sk); +#endif + } + + return mask; +} + + +#ifdef VMX86_TOOLS +/* + *---------------------------------------------------------------------------- + * + * VSockVmciListen -- + * + * Signify that this socket is listening for connection requests. + * + * Results: + * Zero on success, negative error code on failure. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +static int +VSockVmciListen(struct socket *sock, // IN + int backlog) // IN +{ + int err; + struct sock *sk; + VSockVmciSock *vsk; + + sk = sock->sk; + + lock_sock(sk); + + if (sock->type != SOCK_STREAM) { + err = -EOPNOTSUPP; + goto out; + } + + if (sock->state != SS_UNCONNECTED) { + err = -EINVAL; + goto out; + } + + vsk = vsock_sk(sk); + + if (!VSockAddr_Bound(&vsk->localAddr)) { + err = -EINVAL; + goto out; + } + + sk->compat_sk_max_ack_backlog = backlog; + sk->compat_sk_state = SS_LISTEN; + + err = 0; + +out: + release_sock(sk); + return err; +} +#endif + + +/* + *---------------------------------------------------------------------------- + * + * VSockVmciShutdown -- + * + * Shuts down the provided socket in the provided method. + * + * Results: + * Zero on success, negative error code on failure. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +static int +VSockVmciShutdown(struct socket *sock, // IN + int mode) // IN +{ + struct sock *sk; + + /* + * User level uses SHUT_RD (0) and SHUT_WR (1), but the kernel uses + * RCV_SHUTDOWN (1) and SEND_SHUTDOWN (2), so we must increment mode here + * like the other address families do. Note also that the increment makes + * SHUT_RDWR (2) into RCV_SHUTDOWN | SEND_SHUTDOWN (3), which is what we + * want. + */ + mode++; + + if ((mode & ~SHUTDOWN_MASK) || !mode) { + return -EINVAL; + } + + if (sock->state == SS_UNCONNECTED) { + return -ENOTCONN; + } + + sk = sock->sk; + sock->state = SS_DISCONNECTING; + + /* Receive and send shutdowns are treated alike. */ + mode = mode & (RCV_SHUTDOWN | SEND_SHUTDOWN); + if (mode) { + lock_sock(sk); + sk->compat_sk_shutdown |= mode; + sk->compat_sk_state_change(sk); + release_sock(sk); + } + +#ifdef VMX86_TOOLS + if (sk->compat_sk_type == SOCK_STREAM && mode) { + compat_sock_reset_done(sk); + VSOCK_SEND_SHUTDOWN(sk, mode); + } +#endif + + return 0; +} + + +/* + *---------------------------------------------------------------------------- + * + * VSockVmciDgramSendmsg -- + * + * Sends a datagram. + * + * Results: + * Number of bytes sent on success, negative error code on failure. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 43) +static int +VSockVmciDgramSendmsg(struct socket *sock, // IN: socket to send on + struct msghdr *msg, // IN: message to send + int len, // IN: length of message + struct scm_cookie *scm) // UNUSED +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 65) +static int +VSockVmciDgramSendmsg(struct kiocb *kiocb, // UNUSED + struct socket *sock, // IN: socket to send on + struct msghdr *msg, // IN: message to send + int len, // IN: length of message + struct scm_cookie *scm); // UNUSED +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 2) +static int +VSockVmciDgramSendmsg(struct kiocb *kiocb, // UNUSED + struct socket *sock, // IN: socket to send on + struct msghdr *msg, // IN: message to send + int len) // IN: length of message +#else +static int +VSockVmciDgramSendmsg(struct kiocb *kiocb, // UNUSED + struct socket *sock, // IN: socket to send on + struct msghdr *msg, // IN: message to send + size_t len) // IN: length of message +#endif +{ + int err; + struct sock *sk; + VSockVmciSock *vsk; + struct sockaddr_vm *remoteAddr; + VMCIDatagram *dg; + + if (msg->msg_flags & MSG_OOB) { + return -EOPNOTSUPP; + } + + if (len > VMCI_MAX_DG_PAYLOAD_SIZE) { + return -EMSGSIZE; + } + + /* For now, MSG_DONTWAIT is always assumed... */ + err = 0; + sk = sock->sk; + vsk = vsock_sk(sk); + + lock_sock(sk); + + if (!VSockAddr_Bound(&vsk->localAddr)) { + struct sockaddr_vm localAddr; + + VSockAddr_Init(&localAddr, VMADDR_CID_ANY, VMADDR_PORT_ANY); + if ((err = __VSockVmciBind(sk, &localAddr))) { + goto out; + } + } + + /* + * If the provided message contains an address, use that. Otherwise fall + * back on the socket's remote handle (if it has been connected). + */ + if (msg->msg_name && + VSockAddr_Cast(msg->msg_name, msg->msg_namelen, &remoteAddr) == 0) { + /* Ensure this address is of the right type and is a valid destination. */ + // XXXAB Temporary to handle test program + if (remoteAddr->svm_cid == VMADDR_CID_ANY) { + remoteAddr->svm_cid = VMCI_GetContextID(); + } + + if (!VSockAddr_Bound(remoteAddr)) { + err = -EINVAL; + goto out; + } + } else if (sock->state == SS_CONNECTED) { + remoteAddr = &vsk->remoteAddr; + // XXXAB Temporary to handle test program + if (remoteAddr->svm_cid == VMADDR_CID_ANY) { + remoteAddr->svm_cid = VMCI_GetContextID(); + } + + /* XXX Should connect() or this function ensure remoteAddr is bound? */ + if (!VSockAddr_Bound(&vsk->remoteAddr)) { + err = -EINVAL; + goto out; + } + } else { + err = -EINVAL; + goto out; + } + + /* + * Allocate a buffer for the user's message and our packet header. + */ + dg = kmalloc(len + sizeof *dg, GFP_KERNEL); + if (!dg) { + err = -ENOMEM; + goto out; + } + + memcpy_fromiovec(VMCI_DG_PAYLOAD(dg), msg->msg_iov, len); + + dg->dst = VMCI_MAKE_HANDLE(remoteAddr->svm_cid, remoteAddr->svm_port); + dg->src = VMCI_MAKE_HANDLE(vsk->localAddr.svm_cid, vsk->localAddr.svm_port); + dg->payloadSize = len; + + err = VMCIDatagram_Send(dg); + kfree(dg); + if (err < 0) { + err = VSockVmci_ErrorToVSockError(err); + goto out; + } + + /* + * err is the number of bytes sent on success. We need to subtract the + * VSock-specific header portions of what we've sent. + */ + err -= sizeof *dg; + +out: + release_sock(sk); + return err; +} + +#ifdef VMX86_TOOLS +/* + *---------------------------------------------------------------------------- + * + * VSockVmciStreamSetsockopt -- + * + * Set a socket option on a stream socket + * + * Results: + * 0 on success, negative error code on failure. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +int +VSockVmciStreamSetsockopt(struct socket *sock, // IN/OUT + int level, // IN + int optname, // IN + char __user *optval, // IN + int optlen) // IN +{ + int err; + struct sock *sk; + VSockVmciSock *vsk; + uint64 val; + + if (level != VSockVmci_GetAFValue()) { + return -ENOPROTOOPT; + } + + if (optlen < sizeof val) { + return -EINVAL; + } + + if (copy_from_user(&val, optval, sizeof val) != 0) { + return -EFAULT; + } + + err = 0; + sk = sock->sk; + vsk = vsock_sk(sk); + + ASSERT(vsk->queuePairMinSize <= vsk->queuePairSize && + vsk->queuePairSize <= vsk->queuePairMaxSize); + + lock_sock(sk); + + switch (optname) { + case SO_VMCI_BUFFER_SIZE: + if (val < vsk->queuePairMinSize || val > vsk->queuePairMaxSize) { + err = -EINVAL; + goto out; + } + vsk->queuePairSize = val; + break; + + case SO_VMCI_BUFFER_MAX_SIZE: + if (val < vsk->queuePairSize) { + err = -EINVAL; + goto out; + } + vsk->queuePairMaxSize = val; + break; + + case SO_VMCI_BUFFER_MIN_SIZE: + if (val > vsk->queuePairSize) { + err = -EINVAL; + goto out; + } + vsk->queuePairMinSize = val; + break; + + default: + err = -ENOPROTOOPT; + break; + } + +out: + + ASSERT(vsk->queuePairMinSize <= vsk->queuePairSize && + vsk->queuePairSize <= vsk->queuePairMaxSize); + + release_sock(sk); + return err; +} + +#endif + +#ifdef VMX86_TOOLS +/* + *---------------------------------------------------------------------------- + * + * VSockVmciStreamGetsockopt -- + * + * Get a socket option for a stream socket + * + * Results: + * 0 on success, negative error code on failure. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +int +VSockVmciStreamGetsockopt(struct socket *sock, // IN + int level, // IN + int optname, // IN + char __user *optval, // OUT + int __user * optlen) // IN/OUT +{ + int err; + int len; + struct sock *sk; + VSockVmciSock *vsk; + uint64 val; + + if (level != VSockVmci_GetAFValue()) { + return -ENOPROTOOPT; + } + + if ((err = get_user(len, optlen)) != 0) { + return err; + } + if (len < sizeof val) { + return -EINVAL; + } + + len = sizeof val; + + err = 0; + sk = sock->sk; + vsk = vsock_sk(sk); + + switch (optname) { + case SO_VMCI_BUFFER_SIZE: + val = vsk->queuePairSize; + break; + + case SO_VMCI_BUFFER_MAX_SIZE: + val = vsk->queuePairMaxSize; + break; + + case SO_VMCI_BUFFER_MIN_SIZE: + val = vsk->queuePairMinSize; + break; + + default: + return -ENOPROTOOPT; + } + + if ((err = copy_to_user(optval, &val, len)) != 0) { + return -EFAULT; + } + if ((err = put_user(len, optlen)) != 0) { + return -EFAULT; + } + return 0; +} +#endif + + +#ifdef VMX86_TOOLS +/* + *---------------------------------------------------------------------------- + * + * VSockVmciStreamSendmsg -- + * + * Sends a message on the socket. + * + * Results: + * Number of bytes sent on success, negative error code on failure. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 43) +static int +VSockVmciStreamSendmsg(struct socket *sock, // IN: socket to send on + struct msghdr *msg, // IN: message to send + int len, // IN: length of message + struct scm_cookie *scm) // UNUSED +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 65) +static int +VSockVmciStreamSendmsg(struct kiocb *kiocb, // UNUSED + struct socket *sock, // IN: socket to send on + struct msghdr *msg, // IN: message to send + int len, // IN: length of message + struct scm_cookie *scm); // UNUSED +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 2) +static int +VSockVmciStreamSendmsg(struct kiocb *kiocb, // UNUSED + struct socket *sock, // IN: socket to send on + struct msghdr *msg, // IN: message to send + int len) // IN: length of message +#else +static int +VSockVmciStreamSendmsg(struct kiocb *kiocb, // UNUSED + struct socket *sock, // IN: socket to send on + struct msghdr *msg, // IN: message to send + size_t len) // IN: length of message +#endif +{ + struct sock *sk; + VSockVmciSock *vsk; + ssize_t totalWritten; + long timeout; + int err; +#if defined(VMX86_TOOLS) && defined(VSOCK_OPTIMIZATION_WAITING_NOTIFY) + uint64 produceTail; + uint64 consumeHead; +#endif + COMPAT_DEFINE_WAIT(wait); + + sk = sock->sk; + vsk = vsock_sk(sk); + totalWritten = 0; + err = 0; + + if (msg->msg_flags & MSG_OOB) { + return -EOPNOTSUPP; + } + + lock_sock(sk); + + /* Callers should not provide a destination with stream sockets. */ + if (msg->msg_namelen) { + err = sk->compat_sk_state == SS_CONNECTED ? -EISCONN : -EOPNOTSUPP; + goto out; + } + + if (sk->compat_sk_shutdown & SEND_SHUTDOWN) { + err = -EPIPE; + goto out; + } + + if (sk->compat_sk_state != SS_CONNECTED || + !VSockAddr_Bound(&vsk->localAddr)) { + err = -ENOTCONN; + goto out; + } + + if (!VSockAddr_Bound(&vsk->remoteAddr)) { + err = -EDESTADDRREQ; + goto out; + } + + /* + * Wait for room in the produce queue to enqueue our user's data. + */ + timeout = sock_sndtimeo(sk, msg->msg_flags & MSG_DONTWAIT); + compat_init_prepare_to_wait(sk->compat_sk_sleep, &wait, TASK_INTERRUPTIBLE); + + while (totalWritten < len) { + Bool sentWrote; + unsigned int retries; + ssize_t written; + + sentWrote = FALSE; + retries = 0; + + while (VMCIQueue_FreeSpace(vsk->produceQ, + vsk->consumeQ, vsk->produceSize) == 0 && + sk->compat_sk_err == 0 && + !(sk->compat_sk_shutdown & SEND_SHUTDOWN) && + !(vsk->peerShutdown & RCV_SHUTDOWN)) { + + /* Don't wait for non-blocking sockets. */ + if (timeout == 0) { + err = -EAGAIN; + goto outWait; + } + + /* Notify our peer that we are waiting for room to write. */ + if (!VSockVmciSendWaitingWrite(sk, 1)) { + err = -EHOSTUNREACH; + goto outWait; + } + + release_sock(sk); + timeout = schedule_timeout(timeout); + lock_sock(sk); + if (signal_pending(current)) { + err = sock_intr_errno(timeout); + goto outWait; + } else if (timeout == 0) { + err = -EAGAIN; + goto outWait; + } + + compat_cont_prepare_to_wait(sk->compat_sk_sleep, + &wait, TASK_INTERRUPTIBLE); + } + + /* + * These checks occur both as part of and after the loop conditional + * since we need to check before and after sleeping. + */ + if (sk->compat_sk_err) { + err = -sk->compat_sk_err; + goto outWait; + } else if ((sk->compat_sk_shutdown & SEND_SHUTDOWN) || + (vsk->peerShutdown & RCV_SHUTDOWN)) { + err = -EPIPE; + goto outWait; + } + + /* + * Note that enqueue will only write as many bytes as are free in the + * produce queue, so we don't need to ensure len is smaller than the queue + * size. It is the caller's responsibility to check how many bytes we were + * able to send. + */ +#if defined(VMX86_TOOLS) && defined(VSOCK_OPTIMIZATION_WAITING_NOTIFY) + VMCIQueue_GetPointers(vsk->produceQ, vsk->consumeQ, + &produceTail, &consumeHead); +#endif + + written = VMCIQueue_EnqueueV(vsk->produceQ, vsk->consumeQ, + vsk->produceSize, msg->msg_iov, + len - totalWritten); + if (written < 0) { + err = -ENOMEM; + goto outWait; + } + +#if defined(VMX86_TOOLS) && defined(VSOCK_OPTIMIZATION_WAITING_NOTIFY) + /* + * Detect a wrap-around to maintain queue generation. Note that this is + * safe since we hold the socket lock across the two queue pair + * operations. + */ + if (written >= vsk->produceSize - produceTail) { + vsk->produceQGeneration++; + } +#endif + + totalWritten += written; + + if (VSockVmciNotifyWaitingRead(vsk)) { + /* + * Notify the peer that we have written, retrying the send on failure up to + * our maximum value. See the XXX comment for the corresponding piece of + * code in StreamRecvmsg() for potential improvements. + */ + while (!(vsk->peerShutdown & RCV_SHUTDOWN) && + !sentWrote && + retries < VSOCK_MAX_DGRAM_RESENDS) { + err = VSOCK_SEND_WROTE(sk); + if (err >= 0) { + sentWrote = TRUE; + } + + retries++; + } + + if (retries >= VSOCK_MAX_DGRAM_RESENDS) { + Warning("unable to send wrote notification to peer for socket %p.\n", sk); + goto outWait; + } else { +#if defined(VMX86_TOOLS) && defined(VSOCK_OPTIMIZATION_WAITING_NOTIFY) + vsk->peerWaitingRead = FALSE; +#endif + } + } + } + + ASSERT(totalWritten <= INT_MAX); + +outWait: + if (totalWritten > 0) { + err = totalWritten; + } + compat_finish_wait(sk->compat_sk_sleep, &wait, TASK_RUNNING); +out: + release_sock(sk); + return err; +} +#endif + + +/* + *---------------------------------------------------------------------------- + * + * VSockVmciDgramRecvmsg -- + * + * Receives a datagram and places it in the caller's msg. + * + * Results: + * The size of the payload on success, negative value on failure. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 43) +static int +VSockVmciDgramRecvmsg(struct socket *sock, // IN: socket to receive from + struct msghdr *msg, // IN/OUT: message to receive into + int len, // IN: length of receive buffer + int flags, // IN: receive flags + struct scm_cookie *scm) // UNUSED +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 65) +static int +VSockVmciDgramRecvmsg(struct kiocb *kiocb, // UNUSED + struct socket *sock, // IN: socket to receive from + struct msghdr *msg, // IN/OUT: message to receive into + int len, // IN: length of receive buffer + int flags, // IN: receive flags + struct scm_cookie *scm) // UNUSED +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 2) +static int +VSockVmciDgramRecvmsg(struct kiocb *kiocb, // UNUSED + struct socket *sock, // IN: socket to receive from + struct msghdr *msg, // IN/OUT: message to receive into + int len, // IN: length of receive buffer + int flags) // IN: receive flags +#else +static int +VSockVmciDgramRecvmsg(struct kiocb *kiocb, // UNUSED + struct socket *sock, // IN: socket to receive from + struct msghdr *msg, // IN/OUT: message to receive into + size_t len, // IN: length of receive buffer + int flags) // IN: receive flags +#endif +{ + int err; + int noblock; + struct sock *sk; + VMCIDatagram *dg; + size_t payloadLen; + struct sk_buff *skb; + struct sockaddr_vm *vmciAddr; + + err = 0; + sk = sock->sk; + payloadLen = 0; + noblock = flags & MSG_DONTWAIT; + vmciAddr = (struct sockaddr_vm *)msg->msg_name; + + if (flags & MSG_OOB || flags & MSG_ERRQUEUE) { + return -EOPNOTSUPP; + } + + /* Retrieve the head sk_buff from the socket's receive queue. */ + skb = skb_recv_datagram(sk, flags, noblock, &err); + if (err) { + return err; + } + + if (!skb) { + return -EAGAIN; + } + + dg = (VMCIDatagram *)skb->data; + if (!dg) { + /* err is 0, meaning we read zero bytes. */ + goto out; + } + + payloadLen = dg->payloadSize; + /* Ensure the sk_buff matches the payload size claimed in the packet. */ + if (payloadLen != skb->len - sizeof *dg) { + err = -EINVAL; + goto out; + } + + if (payloadLen > len) { + payloadLen = len; + msg->msg_flags |= MSG_TRUNC; + } + + /* Place the datagram payload in the user's iovec. */ + err = skb_copy_datagram_iovec(skb, sizeof *dg, msg->msg_iov, payloadLen); + if (err) { + goto out; + } + + msg->msg_namelen = 0; + if (vmciAddr) { + /* Provide the address of the sender. */ + VSockAddr_Init(vmciAddr, + VMCI_HANDLE_TO_CONTEXT_ID(dg->src), + VMCI_HANDLE_TO_RESOURCE_ID(dg->src)); + msg->msg_namelen = sizeof *vmciAddr; + } + err = payloadLen; + +out: + skb_free_datagram(sk, skb); + return err; +} + + +#ifdef VMX86_TOOLS +/* + *---------------------------------------------------------------------------- + * + * VSockVmciStreamRecvmsg -- + * + * Receives a datagram and places it in the caller's msg. + * + * Results: + * The size of the payload on success, negative value on failure. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 43) +static int +VSockVmciStreamRecvmsg(struct socket *sock, // IN: socket to receive from + struct msghdr *msg, // IN/OUT: message to receive into + int len, // IN: length of receive buffer + int flags, // IN: receive flags + struct scm_cookie *scm) // UNUSED +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 65) +static int +VSockVmciStreamRecvmsg(struct kiocb *kiocb, // UNUSED + struct socket *sock, // IN: socket to receive from + struct msghdr *msg, // IN/OUT: message to receive into + int len, // IN: length of receive buffer + int flags, // IN: receive flags + struct scm_cookie *scm) // UNUSED +#elif LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 2) +static int +VSockVmciStreamRecvmsg(struct kiocb *kiocb, // UNUSED + struct socket *sock, // IN: socket to receive from + struct msghdr *msg, // IN/OUT: message to receive into + int len, // IN: length of receive buffer + int flags) // IN: receive flags +#else +static int +VSockVmciStreamRecvmsg(struct kiocb *kiocb, // UNUSED + struct socket *sock, // IN: socket to receive from + struct msghdr *msg, // IN/OUT: message to receive into + size_t len, // IN: length of receive buffer + int flags) // IN: receive flags +#endif +{ + struct sock *sk; + VSockVmciSock *vsk; + int err; + int target; + int64 ready; + long timeout; + ssize_t copied; + Bool sentRead; + unsigned int retries; +#if defined(VMX86_TOOLS) && defined(VSOCK_OPTIMIZATION_WAITING_NOTIFY) + uint64 consumeHead; + uint64 produceTail; +#ifdef VSOCK_OPTIMIZATION_FLOW_CONTROL + Bool notifyOnBlock; +#endif +#endif + + COMPAT_DEFINE_WAIT(wait); + + sk = sock->sk; + vsk = vsock_sk(sk); + err = 0; + retries = 0; + sentRead = FALSE; +#ifdef VSOCK_OPTIMIZATION_FLOW_CONTROL + notifyOnBlock = FALSE; +#endif + + lock_sock(sk); + + if (sk->compat_sk_state != SS_CONNECTED) { + /* + * Recvmsg is supposed to return 0 if a peer performs an orderly shutdown. + * Differentiate between that case and when a peer has not connected or a + * local shutdown occured with the SOCK_DONE flag. + */ + if (compat_sock_test_done(sk)) { + err = 0; + } else { + err = -ENOTCONN; + } + goto out; + } + + if (flags & MSG_OOB) { + err = -EOPNOTSUPP; + goto out; + } + + if (sk->compat_sk_shutdown & RCV_SHUTDOWN) { + err = 0; + goto out; + } + + /* + * We must not copy less than target bytes into the user's buffer before + * returning successfully, so we wait for the consume queue to have that + * much data to consume before dequeueing. Note that this makes it + * impossible to handle cases where target is greater than the queue size. + */ + target = sock_rcvlowat(sk, flags & MSG_WAITALL, len); + if (target >= vsk->consumeSize) { + err = -ENOMEM; + goto out; + } + timeout = sock_rcvtimeo(sk, flags & MSG_DONTWAIT); + copied = 0; + +#ifdef VSOCK_OPTIMIZATION_FLOW_CONTROL + if (vsk->writeNotifyMinWindow < target + 1) { + ASSERT(target < vsk->consumeSize); + vsk->writeNotifyMinWindow = target + 1; + if (vsk->writeNotifyWindow < vsk->writeNotifyMinWindow) { + /* + * If the current window is smaller than the new minimal + * window size, we need to reevaluate whether we need to + * notify the sender. If the number of ready bytes are + * smaller than the new window, we need to send a + * notification to the sender before we block. + */ + + vsk->writeNotifyWindow = vsk->writeNotifyMinWindow; + notifyOnBlock = TRUE; + } + } +#endif + + compat_init_prepare_to_wait(sk->compat_sk_sleep, &wait, TASK_INTERRUPTIBLE); + + while ((ready = VMCIQueue_BufReady(vsk->consumeQ, + vsk->produceQ, + vsk->consumeSize)) < target && + sk->compat_sk_err == 0 && + !(sk->compat_sk_shutdown & RCV_SHUTDOWN) && + !(vsk->peerShutdown & SEND_SHUTDOWN)) { + + if (ready < 0) { + /* + * Invalid queue pair content. XXX This should be changed to + * a connection reset in a later change. + */ + + err = -ENOMEM; + goto out; + } + + /* Don't wait for non-blocking sockets. */ + if (timeout == 0) { + err = -EAGAIN; + goto outWait; + } + + /* Notify our peer that we are waiting for data to read. */ + if (!VSockVmciSendWaitingRead(sk, target)) { + err = -EHOSTUNREACH; + goto outWait; + } + +#ifdef VSOCK_OPTIMIZATION_FLOW_CONTROL + if (notifyOnBlock) { + err = VSockVmciSendReadNotification(sk); + if (err < 0) { + goto outWait; + } + notifyOnBlock = FALSE; + } +#endif + + release_sock(sk); + timeout = schedule_timeout(timeout); + lock_sock(sk); + + if (signal_pending(current)) { + err = sock_intr_errno(timeout); + goto outWait; + } else if (timeout == 0) { + err = -EAGAIN; + goto outWait; + } + + compat_cont_prepare_to_wait(sk->compat_sk_sleep, &wait, TASK_INTERRUPTIBLE); + } + + if (sk->compat_sk_err) { + err = -sk->compat_sk_err; + goto outWait; + } else if (sk->compat_sk_shutdown & RCV_SHUTDOWN) { + err = 0; + goto outWait; + } else if ((vsk->peerShutdown & SEND_SHUTDOWN) && + VMCIQueue_BufReady(vsk->consumeQ, + vsk->produceQ, vsk->consumeSize) < target) { + err = 0; + goto outWait; + } + + /* + * Now consume up to len bytes from the queue. Note that since we have the + * socket locked we should copy at least ready bytes. + */ +#if defined(VMX86_TOOLS) && defined(VSOCK_OPTIMIZATION_WAITING_NOTIFY) + VMCIQueue_GetPointers(vsk->consumeQ, vsk->produceQ, + &produceTail, &consumeHead); +#endif + + copied = VMCIQueue_DequeueV(vsk->produceQ, vsk->consumeQ, + vsk->consumeSize, msg->msg_iov, len); + if (copied < 0) { + err = -ENOMEM; + goto outWait; + } + +#if defined(VMX86_TOOLS) && defined(VSOCK_OPTIMIZATION_WAITING_NOTIFY) + /* + * Detect a wrap-around to maintain queue generation. Note that this is + * safe since we hold the socket lock across the two queue pair + * operations. + */ + if (copied >= vsk->consumeSize - consumeHead) { + vsk->consumeQGeneration++; + } +#endif + + ASSERT(copied >= target); + + /* + * If the other side has shutdown for sending and there is nothing more to + * read, then set our socket's RCV_SHUTDOWN flag and modify the socket + * state. + */ + if (vsk->peerShutdown & SEND_SHUTDOWN) { + if (VMCIQueue_BufReady(vsk->consumeQ, + vsk->produceQ, vsk->consumeSize) <= 0) { + sk->compat_sk_shutdown |= RCV_SHUTDOWN; + sk->compat_sk_state = SS_UNCONNECTED; + compat_sock_set_done(sk); + sk->compat_sk_state_change(sk); + } + } + + err = VSockVmciSendReadNotification(sk); + if (err < 0) { + goto outWait; + } + + ASSERT(copied <= INT_MAX); + err = copied; + +outWait: + compat_finish_wait(sk->compat_sk_sleep, &wait, TASK_RUNNING); +out: + release_sock(sk); + return err; +} +#endif + + +/* + * Protocol operation. + */ + +/* + *---------------------------------------------------------------------------- + * + * VSockVmciCreate -- + * + * Creates a VSocket socket. + * + * Results: + * Zero on success, negative error code on failure. + * + * Side effects: + * Socket count is incremented. + * + *---------------------------------------------------------------------------- + */ + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24) +static int +VSockVmciCreate(struct socket *sock, // IN + int protocol) // IN +#else +static int +VSockVmciCreate(struct net *net, // IN + struct socket *sock, // IN + int protocol) // IN +#endif +{ + if (!sock) { + return -EINVAL; + } + + if (protocol) { + return -EPROTONOSUPPORT; + } + + switch (sock->type) { + case SOCK_DGRAM: + sock->ops = &vsockVmciDgramOps; + break; +# ifdef VMX86_TOOLS + /* + * Queue pairs are /currently/ only supported within guests, so stream + * sockets are only supported within guests. + */ + case SOCK_STREAM: + sock->ops = &vsockVmciStreamOps; + break; +# endif + default: + return -ESOCKTNOSUPPORT; + } + + sock->state = SS_UNCONNECTED; + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24) + return __VSockVmciCreate(sock, GFP_KERNEL, 0) ? 0 : -ENOMEM; +#else + return __VSockVmciCreate(net, sock, GFP_KERNEL, 0) ? 0 : -ENOMEM; +#endif +} + + +/* + *---------------------------------------------------------------------------- + * + * VSockVmciIoctl32Handler -- + * + * Handler for 32-bit ioctl(2) on 64-bit. + * + * Results: + * Same as VsockVmciDevIoctl(). + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +#ifdef VM_X86_64 +#ifndef HAVE_COMPAT_IOCTL +static int +VSockVmciIoctl32Handler(unsigned int fd, // IN + unsigned int iocmd, // IN + unsigned long ioarg, // IN/OUT + struct file * filp) // IN +{ + int ret; +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 26) || \ + (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 0) && LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 3)) + lock_kernel(); +#endif + ret = -ENOTTY; + if (filp && filp->f_op && filp->f_op->ioctl == VSockVmciDevIoctl) { + ret = VSockVmciDevIoctl(filp->f_dentry->d_inode, filp, iocmd, ioarg); + } +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 26) || \ + (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 0) && LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 3)) + unlock_kernel(); +#endif + return ret; +} +#endif /* !HAVE_COMPAT_IOCTL */ + + +/* + *---------------------------------------------------------------------------- + * + * register_ioctl32_handlers -- + * + * Registers the ioctl conversion handler. + * + * Results: + * Zero on success, error code otherwise. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +static int +register_ioctl32_handlers(void) +{ +#ifndef HAVE_COMPAT_IOCTL + { + int i; + for (i = IOCTL_VMCI_SOCKETS_FIRST; i < IOCTL_VMCI_SOCKETS_LAST; i++) { + int retval = register_ioctl32_conversion(i, VSockVmciIoctl32Handler); + if (retval) { + Warning("Fail to register ioctl32 conversion for cmd %d\n", i); + return retval; + } + } + } +#endif /* !HAVE_COMPAT_IOCTL */ + return 0; +} + + +/* + *---------------------------------------------------------------------------- + * + * unregister_ioctl32_handlers -- + * + * Unregisters the ioctl converstion handler. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +static void +unregister_ioctl32_handlers(void) +{ +#ifndef HAVE_COMPAT_IOCTL + { + int i; + for (i = IOCTL_VMCI_SOCKETS_FIRST; i < IOCTL_VMCI_SOCKETS_LAST; i++) { + int retval = unregister_ioctl32_conversion(i); + if (retval) { + Warning("Fail to unregister ioctl32 conversion for cmd %d\n", i); + } + } + } +#endif /* !HAVE_COMPAT_IOCTL */ +} +#else /* VM_X86_64 */ +#define register_ioctl32_handlers() (0) +#define unregister_ioctl32_handlers() do { } while (0) +#endif /* VM_X86_64 */ + + +/* + * Device operations. + */ + + +/* + *---------------------------------------------------------------------------- + * + * VSockVmciDevOpen -- + * + * Invoked when the device is opened. Simply maintains a count of open + * instances. + * + * Results: + * Zero on success, negative value otherwise. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +int +VSockVmciDevOpen(struct inode *inode, // IN + struct file *file) // IN +{ + down(®istrationMutex); + devOpenCount++; + up(®istrationMutex); + return 0; +} + + +/* + *---------------------------------------------------------------------------- + * + * VSockVmciDevRelease -- + * + * Invoked when the device is closed. Updates the open instance count and + * unregisters the socket family if this is the last user. + * + * Results: + * Zero on success, negative value otherwise. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +int +VSockVmciDevRelease(struct inode *inode, // IN + struct file *file) // IN +{ + down(®istrationMutex); + devOpenCount--; + VSockVmciTestUnregister(); + up(®istrationMutex); + return 0; +} + + +/* + *---------------------------------------------------------------------------- + * + * VSockVmciDevIoctl -- + * + * ioctl(2) handler. + * + * Results: + * Zero on success, negative error code otherwise. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +static int +VSockVmciDevIoctl(struct inode *inode, // IN + struct file *filp, // IN + u_int iocmd, // IN + unsigned long ioarg) // IN/OUT +{ + int retval; + + retval = 0; + + switch (iocmd) { + case IOCTL_VMCI_SOCKETS_GET_AF_VALUE: { + int family; + + family = VSockVmci_GetAFValue(); + if (family < 0) { + Warning("AF_VSOCK is not registered\n"); + } + if (copy_to_user((void *)ioarg, &family, sizeof family) != 0) { + retval = -EFAULT; + } + break; + } + + case IOCTL_VMCI_SOCKETS_GET_LOCAL_CID: { + VMCIId cid = VMCI_GetContextID(); + if (copy_to_user((void *)ioarg, &cid, sizeof cid) != 0) { + retval = -EFAULT; + } + break; + } + + default: + Warning("Unknown ioctl %d\n", iocmd); + retval = -EINVAL; + } + + return retval; +} + + +#if defined(HAVE_COMPAT_IOCTL) || defined(HAVE_UNLOCKED_IOCTL) +/* + *----------------------------------------------------------------------------- + * + * VSockVmciDevUnlockedIoctl -- + * + * Wrapper for VSockVmciDevIoctl() supporting the compat_ioctl and + * unlocked_ioctl methods that have signatures different from the + * old ioctl. Used as compat_ioctl method for 32bit apps running + * on 64bit kernel and for unlocked_ioctl on systems supporting + * those. VSockVmciDevIoctl() may safely be called without holding + * the BKL. + * + * Results: + * Same as VSockVmciDevIoctl(). + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static long +VSockVmciDevUnlockedIoctl(struct file *filp, // IN + u_int iocmd, // IN + unsigned long ioarg) // IN/OUT +{ + return VSockVmciDevIoctl(NULL, filp, iocmd, ioarg); +} +#endif + +/* + * Module operations. + */ + +/* + *---------------------------------------------------------------------------- + * + * VSockVmciInit -- + * + * Initialization routine for the VSockets module. + * + * Results: + * Zero on success, error code on failure. + * + * Side effects: + * The VSocket protocol family and socket operations are registered. + * + *---------------------------------------------------------------------------- + */ + +static int __init +VSockVmciInit(void) +{ + int err; + + DriverLog_Init("VSock"); + + request_module("vmci"); + + err = misc_register(&vsockVmciDevice); + if (err) { + return -ENOENT; + } + + err = register_ioctl32_handlers(); + if (err) { + misc_deregister(&vsockVmciDevice); + return err; + } + + err = VSockVmciRegisterProto(); + if (err) { + Warning("Cannot register vsock protocol.\n"); + unregister_ioctl32_handlers(); + misc_deregister(&vsockVmciDevice); + return err; + } + + VSockVmciInitTables(); + return 0; +} + + +/* + *---------------------------------------------------------------------------- + * + * VSocketVmciExit -- + * + * VSockets module exit routine. + * + * Results: + * None. + * + * Side effects: + * Unregisters VSocket protocol family and socket operations. + * + *---------------------------------------------------------------------------- + */ + +static void __exit +VSockVmciExit(void) +{ + unregister_ioctl32_handlers(); + misc_deregister(&vsockVmciDevice); + down(®istrationMutex); + VSockVmciUnregisterAddressFamily(); + up(®istrationMutex); + + VSockVmciUnregisterProto(); +} + + +module_init(VSockVmciInit); +module_exit(VSockVmciExit); + +MODULE_AUTHOR("VMware, Inc."); +MODULE_DESCRIPTION("VMware Virtual Socket Family"); +MODULE_VERSION(VSOCK_DRIVER_VERSION_STRING); +MODULE_LICENSE("GPL v2"); diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vsock/linux/af_vsock.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/linux/af_vsock.h --- open-vm-tools-2008.01.23-74039/modules/linux/vsock/linux/af_vsock.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/linux/af_vsock.h 2008-10-13 08:01:40.000000000 +0100 @@ -0,0 +1,94 @@ +/********************************************************* + * Copyright (C) 2007 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + + +/* + * af_vsock.h -- + * + * Definitions for Linux VSockets module. + */ + +#ifndef __AF_VSOCK_H__ +#define __AF_VSOCK_H__ + +#include "vsockCommon.h" +#include "vsockPacket.h" +#include "compat_workqueue.h" + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 5) +# define vsock_sk(__sk) ((VSockVmciSock *)(__sk)->user_data) +# define sk_vsock(__vsk) ((__vsk)->sk) +#else +# define vsock_sk(__sk) ((VSockVmciSock *)__sk) +# define sk_vsock(__vsk) (&(__vsk)->sk) +#endif + +typedef struct VSockVmciSock { +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 5) + struct sock *sk; +#else + /* sk must be the first member. */ + struct sock sk; +#endif + struct sockaddr_vm localAddr; + struct sockaddr_vm remoteAddr; + /* Links for the global tables of bound and connected sockets. */ + struct list_head boundTable; + struct list_head connectedTable; + VMCIHandle dgHandle; /* For SOCK_DGRAM only. */ +#ifdef VMX86_TOOLS + /* Rest are SOCK_STREAM only. */ + VMCIHandle qpHandle; + VMCIQueue *produceQ; + VMCIQueue *consumeQ; + uint64 produceQGeneration; + uint64 consumeQGeneration; + uint64 produceSize; + uint64 consumeSize; + uint64 queuePairSize; + uint64 queuePairMinSize; + uint64 queuePairMaxSize; + uint64 writeNotifyWindow; + uint64 writeNotifyMinWindow; + Bool peerWaitingRead; + Bool peerWaitingWrite; + Bool peerWaitingWriteDetected; + VSockWaitingInfo peerWaitingReadInfo; + VSockWaitingInfo peerWaitingWriteInfo; + VMCIId attachSubId; + VMCIId detachSubId; + /* Listening socket that this came from. */ + struct sock *listener; + /* + * Used for pending list and accept queue during connection handshake. The + * listening socket is the head for both lists. Sockets created for + * connection requests are placed in the pending list until they are + * connected, at which point they are put in the accept queue list so they + * can be accepted in accept(). If accept() cannot accept the connection, + * it is marked as rejected so the cleanup function knows to clean up the + * socket. + */ + struct list_head pendingLinks; + struct list_head acceptQueue; + Bool rejected; + compat_delayed_work dwork; + uint32 peerShutdown; +#endif +} VSockVmciSock; + +#endif /* __AF_VSOCK_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vsock/linux/driverLog.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/linux/driverLog.c --- open-vm-tools-2008.01.23-74039/modules/linux/vsock/linux/driverLog.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/linux/driverLog.c 2008-10-13 08:01:40.000000000 +0100 @@ -0,0 +1,207 @@ +/********************************************************* + * Copyright (C) 2007 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + + +/* + * driverLog.c -- + * + * Common logging functions for Linux kernel modules. + */ + +#include "driver-config.h" +#include "compat_kernel.h" +#include "compat_sched.h" +#include <asm/current.h> + +#include "driverLog.h" + +#define LINUXLOG_BUFFER_SIZE 1024 + +static const char *driverLogPrefix = ""; + +/* + * vsnprintf was born in 2.4.10. Fall back on vsprintf if we're + * an older kernel. + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 10) +# define vsnprintf(str, size, fmt, args) vsprintf(str, fmt, args) +#endif + + +/* + *---------------------------------------------------------------------------- + * + * DriverLog_Init -- + * + * Initializes the Linux logging. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +void +DriverLog_Init(const char *prefix) // IN +{ + driverLogPrefix = prefix ? prefix : ""; +} + + +/* + *---------------------------------------------------------------------- + * + * DriverLogPrint -- + * + * Log error message from a Linux module. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +static void +DriverLogPrint(const char *level, // IN: KERN_* constant + const char *fmt, // IN: error format string + va_list args) // IN: arguments for format string +{ + static char staticBuf[LINUXLOG_BUFFER_SIZE]; + char stackBuf[128]; + va_list args2; + const char *buf; + + /* + * By default, use a small buffer on the stack (thread safe). If it is too + * small, fall back to a larger static buffer (not thread safe). + */ + va_copy(args2, args); + if (vsnprintf(stackBuf, sizeof stackBuf, fmt, args2) < sizeof stackBuf) { + buf = stackBuf; + } else { + vsnprintf(staticBuf, sizeof staticBuf, fmt, args); + buf = staticBuf; + } + va_end(args2); + + printk("%s%s[%d]: %s", level, driverLogPrefix, current->pid, buf); +} + + +/* + *---------------------------------------------------------------------- + * + * Warning -- + * + * Warning messages from kernel module: logged into kernel log + * as warnings. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +void +Warning(const char *fmt, ...) // IN: warning format string +{ + va_list args; + + va_start(args, fmt); + DriverLogPrint(KERN_WARNING, fmt, args); + va_end(args); +} + + +/* + *---------------------------------------------------------------------- + * + * Log -- + * + * Log messages from kernel module: logged into kernel log + * as debug information. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------- + */ + +void +Log(const char *fmt, ...) // IN: log format string +{ + va_list args; + + /* + * Use the kernel log with at least a KERN_DEBUG level + * so it doesn't garbage the screen at (re)boot time on RedHat 6.0. + */ + + va_start(args, fmt); + DriverLogPrint(KERN_DEBUG, fmt, args); + va_end(args); +} + + +/* + *---------------------------------------------------------------------- + * + * Panic -- + * + * ASSERTION failures and Panics from kernel module get here. + * Message is logged to the kernel log and on console. + * + * Results: + * None. + * + * Side effects: + * Never returns + * + *---------------------------------------------------------------------- + */ + +void +Panic(const char *fmt, ...) // IN: panic format string +{ + va_list args; + + va_start(args, fmt); + DriverLogPrint(KERN_EMERG, fmt, args); + va_end(args); + +#ifdef BUG + BUG(); +#else + /* Should die with %cs unwritable, or at least with page fault. */ + asm volatile("movb $0, %cs:(0)"); +#endif + + while (1); +} diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vsock/linux/driverLog.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/linux/driverLog.h --- open-vm-tools-2008.01.23-74039/modules/linux/vsock/linux/driverLog.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/linux/driverLog.h 2008-10-13 08:01:40.000000000 +0100 @@ -0,0 +1,37 @@ +/********************************************************* + * Copyright (C) 2007 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + + +/* + * driverLog.h -- + * + * Logging functions for Linux kernel modules. + */ + +#ifndef __DRIVERLOG_H__ +#define __DRIVERLOG_H__ + +/* + * The definitions of Warning(), Log(), and Panic() come from vm_assert.h for + * consistency. + */ +#include "vm_assert.h" + +void DriverLog_Init(const char *prefix); + +#endif /* __DRIVERLOG_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vsock/linux/util.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/linux/util.c --- open-vm-tools-2008.01.23-74039/modules/linux/vsock/linux/util.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/linux/util.c 2008-10-13 08:01:40.000000000 +0100 @@ -0,0 +1,857 @@ +/********************************************************* + * Copyright (C) 2007 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + + +/* + * util.c -- + * + * Utility functions for Linux VSocket module. + */ + +#include "driver-config.h" +#include <linux/socket.h> +#include "compat_sock.h" +#include "compat_list.h" + +#include "af_vsock.h" +#include "util.h" + +struct list_head vsockBindTable[VSOCK_HASH_SIZE + 1]; +struct list_head vsockConnectedTable[VSOCK_HASH_SIZE]; + +spinlock_t vsockTableLock = SPIN_LOCK_UNLOCKED; + +/* + * snprintf() wasn't exported until 2.4.10: fall back on sprintf in those + * cases. It's okay since this is only for the debug function for logging + * packets. + */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 4, 10) +#define snprintf(str, size, fmt, args...) sprintf(str, fmt, ## args) +#endif + + +/* + *---------------------------------------------------------------------------- + * + * VSockVmciLogPkt -- + * + * Logs the provided packet. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +void +VSockVmciLogPkt(char const *function, // IN + uint32 line, // IN + VSockPacket *pkt) // IN +{ + char buf[256]; + char *cur = buf; + int left = sizeof buf; + int written = 0; + char *typeStrings[] = { + [VSOCK_PACKET_TYPE_INVALID] = "INVALID", + [VSOCK_PACKET_TYPE_REQUEST] = "REQUEST", + [VSOCK_PACKET_TYPE_NEGOTIATE] = "NEGOTIATE", + [VSOCK_PACKET_TYPE_OFFER] = "OFFER", + [VSOCK_PACKET_TYPE_ATTACH] = "ATTACH", + [VSOCK_PACKET_TYPE_WROTE] = "WROTE", + [VSOCK_PACKET_TYPE_READ] = "READ", + [VSOCK_PACKET_TYPE_RST] = "RST", + [VSOCK_PACKET_TYPE_SHUTDOWN] = "SHUTDOWN", + [VSOCK_PACKET_TYPE_WAITING_WRITE] = "WAITING_WRITE", + [VSOCK_PACKET_TYPE_WAITING_READ] = "WAITING_READ", + }; + + written = snprintf(cur, left, "PKT: %u:%u -> %u:%u", + VMCI_HANDLE_TO_CONTEXT_ID(pkt->dg.src), + pkt->srcPort, + VMCI_HANDLE_TO_CONTEXT_ID(pkt->dg.dst), + pkt->dstPort); + if (written >= left) { + goto error; + } + + left -= written; + cur += written; + + switch (pkt->type) { + case VSOCK_PACKET_TYPE_REQUEST: + case VSOCK_PACKET_TYPE_NEGOTIATE: + written = snprintf(cur, left, ", %s, size = %"FMT64"u", + typeStrings[pkt->type], pkt->u.size); + break; + + case VSOCK_PACKET_TYPE_OFFER: + case VSOCK_PACKET_TYPE_ATTACH: + written = snprintf(cur, left, ", %s, handle = %u:%u", + typeStrings[pkt->type], + VMCI_HANDLE_TO_CONTEXT_ID(pkt->u.handle), + VMCI_HANDLE_TO_RESOURCE_ID(pkt->u.handle)); + break; + + case VSOCK_PACKET_TYPE_WROTE: + case VSOCK_PACKET_TYPE_READ: + case VSOCK_PACKET_TYPE_RST: + written = snprintf(cur, left, ", %s", typeStrings[pkt->type]); + break; + case VSOCK_PACKET_TYPE_SHUTDOWN: { + Bool recv; + Bool send; + + recv = pkt->u.mode & RCV_SHUTDOWN; + send = pkt->u.mode & SEND_SHUTDOWN; + written = snprintf(cur, left, ", %s, mode = %c%c", + typeStrings[pkt->type], + recv ? 'R' : ' ', + send ? 'S' : ' '); + } + break; + + case VSOCK_PACKET_TYPE_WAITING_WRITE: + case VSOCK_PACKET_TYPE_WAITING_READ: + written = snprintf(cur, left, ", %s, generation = %"FMT64"u, " + "offset = %"FMT64"u", typeStrings[pkt->type], + pkt->u.wait.generation, pkt->u.wait.offset); + + break; + + default: + written = snprintf(cur, left, ", unrecognized type"); + } + + if (written >= left) { + goto error; + } + + left -= written; + cur += written; + + written = snprintf(cur, left, " [%s:%u]\n", function, line); + if (written >= left) { + goto error; + } + + Log("%s", buf); + + return; + +error: + Log("could not log packet\n"); +} + + +/* + *---------------------------------------------------------------------------- + * + * VSockVmciInitTables -- + * + * Initializes the tables used for socket lookup. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +void +VSockVmciInitTables(void) +{ + uint32 i; + + for (i = 0; i < ARRAYSIZE(vsockBindTable); i++) { + INIT_LIST_HEAD(&vsockBindTable[i]); + } + + for (i = 0; i < ARRAYSIZE(vsockConnectedTable); i++) { + INIT_LIST_HEAD(&vsockConnectedTable[i]); + } +} + + +/* + *---------------------------------------------------------------------------- + * + * __VSockVmciInsertBound -- + * + * Inserts socket into the bound table. + * + * Note that this assumes any necessary locks are held. + * + * Results: + * None. + * + * Side effects: + * The reference count for sk is incremented. + * + *---------------------------------------------------------------------------- + */ + +void +__VSockVmciInsertBound(struct list_head *list, // IN + struct sock *sk) // IN +{ + VSockVmciSock *vsk; + + ASSERT(list); + ASSERT(sk); + + vsk = vsock_sk(sk); + + sock_hold(sk); + list_add(&vsk->boundTable, list); +} + + +/* + *---------------------------------------------------------------------------- + * + * __VSockVmciInsertConnected -- + * + * Inserts socket into the connected table. + * + * Note that this assumes any necessary locks are held. + * + * Results: + * None. + * + * Side effects: + * The reference count for sk is incremented. + * + *---------------------------------------------------------------------------- + */ + +void +__VSockVmciInsertConnected(struct list_head *list, // IN + struct sock *sk) // IN +{ + VSockVmciSock *vsk; + + ASSERT(list); + ASSERT(sk); + + vsk = vsock_sk(sk); + + sock_hold(sk); + list_add(&vsk->connectedTable, list); +} + + +/* + *---------------------------------------------------------------------------- + * + * __VSockVmciRemoveBound -- + * + * Removes socket from the bound table. + * + * Note that this assumes any necessary locks are held. + * + * Results: + * None. + * + * Side effects: + * The reference count for sk is decremented. + * + *---------------------------------------------------------------------------- + */ + +void +__VSockVmciRemoveBound(struct sock *sk) // IN +{ + VSockVmciSock *vsk; + + ASSERT(sk); + ASSERT(__VSockVmciInBoundTable(sk)); + + vsk = vsock_sk(sk); + + list_del_init(&vsk->boundTable); + sock_put(sk); +} + + +/* + *---------------------------------------------------------------------------- + * + * __VSockVmciRemoveConnected -- + * + * Removes socket from the connected table. + * + * Note that this assumes any necessary locks are held. + * + * Results: + * None. + * + * Side effects: + * The reference count for sk is decremented. + * + *---------------------------------------------------------------------------- + */ + +void +__VSockVmciRemoveConnected(struct sock *sk) // IN +{ + VSockVmciSock *vsk; + + ASSERT(sk); + ASSERT(__VSockVmciInConnectedTable(sk)); + + vsk = vsock_sk(sk); + + list_del_init(&vsk->connectedTable); + sock_put(sk); +} + + +/* + *---------------------------------------------------------------------------- + * + * __VSockVmciFindBoundSocket -- + * + * Finds the socket corresponding to the provided address in the bound + * sockets hash table. + * + * Note that this assumes any necessary locks are held. + * + * Results: + * The sock structure if found, NULL if not found. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +struct sock * +__VSockVmciFindBoundSocket(struct sockaddr_vm *addr) // IN +{ + VSockVmciSock *vsk; + struct sock *sk; + + ASSERT(addr); + + + list_for_each_entry(vsk, vsockBoundSockets(addr), boundTable) { + if (VSockAddr_EqualsAddr(addr, &vsk->localAddr)) { + sk = sk_vsock(vsk); + + /* We only store stream sockets in the bound table. */ + ASSERT(sk->compat_sk_socket ? + sk->compat_sk_socket->type == SOCK_STREAM : + 1); + goto found; + } + } + + sk = NULL; +found: + return sk; +} + + +/* + *---------------------------------------------------------------------------- + * + * __VSockVmciFindConnectedSocket -- + * + * Finds the socket corresponding to the provided addresses in the connected + * sockets hash table. + * + * Note that this assumes any necessary locks are held. + * + * Results: + * The sock structure if found, NULL if not found. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +struct sock * +__VSockVmciFindConnectedSocket(struct sockaddr_vm *src, // IN + struct sockaddr_vm *dst) // IN +{ + VSockVmciSock *vsk; + struct sock *sk; + + ASSERT(src); + ASSERT(dst); + + list_for_each_entry(vsk, vsockConnectedSockets(src, dst), connectedTable) { + if (VSockAddr_EqualsAddr(src, &vsk->remoteAddr) && + VSockAddr_EqualsAddr(dst, &vsk->localAddr)) { + sk = sk_vsock(vsk); + goto found; + } + } + + sk = NULL; +found: + return sk; +} + + +/* + *---------------------------------------------------------------------------- + * + * __VSockVmciInBoundTable -- + * + * Determines whether the provided socket is in the bound table. + * + * Results: + * TRUE is socket is in bound table, FALSE otherwise. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +Bool +__VSockVmciInBoundTable(struct sock *sk) // IN +{ + VSockVmciSock *vsk; + + ASSERT(sk); + + vsk = vsock_sk(sk); + + return !list_empty(&vsk->boundTable); +} + + +/* + *---------------------------------------------------------------------------- + * + * __VSockVmciInConnectedTable -- + * + * Determines whether the provided socket is in the connected table. + * + * Results: + * TRUE is socket is in connected table, FALSE otherwise. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +Bool +__VSockVmciInConnectedTable(struct sock *sk) // IN +{ + VSockVmciSock *vsk; + + ASSERT(sk); + + vsk = vsock_sk(sk); + + return !list_empty(&vsk->connectedTable); +} + + +#ifdef VMX86_TOOLS +/* + *---------------------------------------------------------------------------- + * + * VSockVmciGetPending -- + * + * Retrieves a pending connection that matches the addresses specified in + * the provided packet. + * + * Assumes the socket lock is held for listener. + * + * Results: + * Socket of the pending connection on success, NULL if not found. + * + * Side effects: + * A reference is held on the socket until the release function is called. + * + *---------------------------------------------------------------------------- + */ + +struct sock * +VSockVmciGetPending(struct sock *listener, // IN: listening socket + VSockPacket *pkt) // IN: incoming packet +{ + VSockVmciSock *vlistener; + VSockVmciSock *vpending; + struct sock *pending; + + ASSERT(listener); + ASSERT(pkt); + + vlistener = vsock_sk(listener); + + list_for_each_entry(vpending, &vlistener->pendingLinks, pendingLinks) { + struct sockaddr_vm src; + struct sockaddr_vm dst; + + VSockAddr_Init(&src, VMCI_HANDLE_TO_CONTEXT_ID(pkt->dg.src), pkt->srcPort); + VSockAddr_Init(&dst, VMCI_HANDLE_TO_CONTEXT_ID(pkt->dg.dst), pkt->dstPort); + + if (VSockAddr_EqualsAddr(&src, &vpending->remoteAddr) && + VSockAddr_EqualsAddr(&dst, &vpending->localAddr)) { + pending = sk_vsock(vpending); + sock_hold(pending); + goto found; + } + } + + pending = NULL; +found: + return pending; + +} + + +/* + *---------------------------------------------------------------------------- + * + * VSockVmciReleasePending -- + * + * Releases the reference on a socket previously obtained by a call to + * VSockVmciGetPending(). + * + * Results: + * None. + * + * Side effects: + * The socket may be freed if this was the last reference. + * + *---------------------------------------------------------------------------- + */ + +void +VSockVmciReleasePending(struct sock *pending) // IN: pending connection +{ + ASSERT(pending); + + sock_put(pending); +} + + +/* + *---------------------------------------------------------------------------- + * + * VSockVmciAddPending -- + * + * Adds a pending connection on listener's pending list. + * + * Assumes the socket lock is held for listener. + * Assumes the socket lock is held for pending. + * + * Results: + * None. + * + * Side effects: + * The reference count of the sockets is incremented. + * + *---------------------------------------------------------------------------- + */ + +void +VSockVmciAddPending(struct sock *listener, // IN: listening socket + struct sock *pending) // IN: pending connection +{ + VSockVmciSock *vlistener; + VSockVmciSock *vpending; + + ASSERT(listener); + ASSERT(pending); + + vlistener = vsock_sk(listener); + vpending = vsock_sk(pending); + + sock_hold(pending); + sock_hold(listener); + list_add_tail(&vpending->pendingLinks, &vlistener->pendingLinks); +} + + +/* + *---------------------------------------------------------------------------- + * + * VSockVmciRemovePending -- + * + * Removes a pending connection from the listener's pending list. + * + * Assumes the socket lock is held for listener. + * Assumes the socket lock is held for pending. + * + * Results: + * None. + * + * Side effects: + * The reference count of the sockets is decremented. + * + *---------------------------------------------------------------------------- + */ + +void +VSockVmciRemovePending(struct sock *listener, // IN: listening socket + struct sock *pending) // IN: pending connection +{ + VSockVmciSock *vlistener; + VSockVmciSock *vpending; + + ASSERT(listener); + ASSERT(pending); + + vlistener = vsock_sk(listener); + vpending = vsock_sk(pending); + + list_del_init(&vpending->pendingLinks); + sock_put(listener); + sock_put(pending); +} + + +/* + *---------------------------------------------------------------------------- + * + * VSockVmciEnqueueAccept -- + * + * Enqueues the connected socket on the listening socket's accepting + * queue. + * + * Assumes the socket lock is held for listener. + * Assumes the socket lock is held for connected. + * + * Results: + * None. + * + * Side effects: + * The sockets' reference counts are incremented. + * + *---------------------------------------------------------------------------- + */ + +void +VSockVmciEnqueueAccept(struct sock *listener, // IN: listening socket + struct sock *connected) // IN: connected socket +{ + VSockVmciSock *vlistener; + VSockVmciSock *vconnected; + + ASSERT(listener); + ASSERT(connected); + + vlistener = vsock_sk(listener); + vconnected = vsock_sk(connected); + + sock_hold(connected); + sock_hold(listener); + list_add_tail(&vconnected->acceptQueue, &vlistener->acceptQueue); +} + + +/* + *---------------------------------------------------------------------------- + * + * VSockVmciDequeueAccept -- + * + * Dequeues the next connected socket from the listening socket's accept + * queue. + * + * Assumes the socket lock is held for listener. + * + * Note that the caller must call sock_put() on the returned socket once it + * is done with the socket. + * + * Results: + * The next socket from the queue, or NULL if the queue is empty. + * + * Side effects: + * The reference count of the listener is decremented. + * + *---------------------------------------------------------------------------- + */ + +struct sock * +VSockVmciDequeueAccept(struct sock *listener) // IN: listening socket +{ + VSockVmciSock *vlistener; + VSockVmciSock *vconnected; + + ASSERT(listener); + + vlistener = vsock_sk(listener); + + if (list_empty(&vlistener->acceptQueue)) { + return NULL; + } + + vconnected = list_entry(vlistener->acceptQueue.next, + VSockVmciSock, acceptQueue); + ASSERT(vconnected); + + list_del_init(&vconnected->acceptQueue); + sock_put(listener); + /* + * The caller will need a reference on the connected socket so we let it + * call sock_put(). + */ + + ASSERT(sk_vsock(vconnected)); + return sk_vsock(vconnected); +} + + +/* + *---------------------------------------------------------------------------- + * + * VSockVmciRemoveAccept -- + * + * Removes a socket from the accept queue of a listening socket. + * + * Assumes the socket lock is held for listener. + * Assumes the socket lock is held for connected. + * + * Results: + * None. + * + * Side effects: + * The sockets' reference counts are decremented. + * + *---------------------------------------------------------------------------- + */ + +void +VSockVmciRemoveAccept(struct sock *listener, // IN: listening socket + struct sock *connected) // IN: connected socket +{ + VSockVmciSock *vconnected; + + ASSERT(listener); + ASSERT(connected); + + if (!VSockVmciInAcceptQueue(connected)) { + return; + } + + vconnected = vsock_sk(connected); + ASSERT(vconnected->listener == listener); + + list_del_init(&vconnected->acceptQueue); + sock_put(listener); + sock_put(connected); +} + + +/* + *---------------------------------------------------------------------------- + * + * VSockVmciInAcceptQueue -- + * + * Determines whether a socket is on an accept queue. + * + * Assumes the socket lock is held for sk. + * + * Results: + * TRUE if the socket is in an accept queue, FALSE otherwise. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +Bool +VSockVmciInAcceptQueue(struct sock *sk) // IN: socket +{ + ASSERT(sk); + + /* + * If our accept queue isn't empty, it means we're linked into some listener + * socket's accept queue. + */ + return !VSockVmciIsAcceptQueueEmpty(sk); +} + + +/* + *---------------------------------------------------------------------------- + * + * VSockVmciIsAcceptQueueEmpty -- + * + * Determines whether the provided socket's accept queue is empty. + * + * Assumes the socket lock is held for sk. + * + * Results: + * TRUE if the socket's accept queue is empty, FALSE otherwsise. + * + * Side effects: + * None. + * + * + *---------------------------------------------------------------------------- + */ + +Bool +VSockVmciIsAcceptQueueEmpty(struct sock *sk) // IN: socket +{ + VSockVmciSock *vsk; + + ASSERT(sk); + + vsk = vsock_sk(sk); + return list_empty(&vsk->acceptQueue); +} + + +/* + *---------------------------------------------------------------------------- + * + * VSockVmciIsPending -- + * + * Determines whether a socket is pending. + * + * Assumes the socket lock is held for sk. + * + * Results: + * TRUE if the socket is pending, FALSE otherwise. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +Bool +VSockVmciIsPending(struct sock *sk) // IN: socket +{ + VSockVmciSock *vsk; + + ASSERT(sk); + + vsk = vsock_sk(sk); + return !list_empty(&vsk->pendingLinks); +} +#endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vsock/linux/util.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/linux/util.h --- open-vm-tools-2008.01.23-74039/modules/linux/vsock/linux/util.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/linux/util.h 2008-10-13 08:01:40.000000000 +0100 @@ -0,0 +1,384 @@ +/********************************************************* + * Copyright (C) 2007 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + + +/* + * util.h -- + * + * Utility functions for Linux VSocket module. + */ + +#ifndef __UTIL_H__ +#define __UTIL_H__ + +#include "driver-config.h" +#include "compat_sock.h" +#include "compat_spinlock.h" + +#include "vsockCommon.h" +#include "vsockPacket.h" + +/* + * Each bound VSocket is stored in the bind hash table and each connected + * VSocket is stored in the connected hash table. + * + * Unbound sockets are all put on the same list attached to the end of the hash + * table (vsockUnboundSockets). Bound sockets are added to the hash table in + * the bucket that their local address hashes to (vsockBoundSockets(addr) + * represents the list that addr hashes to). + * + * Specifically, we initialize the vsockBindTable array to a size of + * VSOCK_HASH_SIZE + 1 so that vsockBindTable[0] through + * vsockBindTable[VSOCK_HASH_SIZE - 1] are for bound sockets and + * vsockBindTable[VSOCK_HASH_SIZE] is for unbound sockets. The hash function + * mods with VSOCK_HASH_SIZE - 1 to ensure this. + */ +#define VSOCK_HASH_SIZE 251 +#define LAST_RESERVED_PORT 1023 +#define MAX_PORT_RETRIES 24 + +extern struct list_head vsockBindTable[VSOCK_HASH_SIZE + 1]; +extern struct list_head vsockConnectedTable[VSOCK_HASH_SIZE]; + +extern spinlock_t vsockTableLock; + +#define VSOCK_HASH(addr) ((addr)->svm_port % (VSOCK_HASH_SIZE - 1)) +#define vsockBoundSockets(addr) (&vsockBindTable[VSOCK_HASH(addr)]) +#define vsockUnboundSockets (&vsockBindTable[VSOCK_HASH_SIZE]) + +/* XXX This can probably be implemented in a better way. */ +#define VSOCK_CONN_HASH(src, dst) \ + (((src)->svm_cid ^ (dst)->svm_port) % (VSOCK_HASH_SIZE - 1)) +#define vsockConnectedSockets(src, dst) \ + (&vsockConnectedTable[VSOCK_CONN_HASH(src, dst)]) +#define vsockConnectedSocketsVsk(vsk) \ + vsockConnectedSockets(&(vsk)->remoteAddr, &(vsk)->localAddr) + +/* + * Prototypes. + */ + +void VSockVmciLogPkt(char const *function, uint32 line, VSockPacket *pkt); + +void VSockVmciInitTables(void); +void __VSockVmciInsertBound(struct list_head *list, struct sock *sk); +void __VSockVmciInsertConnected(struct list_head *list, struct sock *sk); +void __VSockVmciRemoveBound(struct sock *sk); +void __VSockVmciRemoveConnected(struct sock *sk); +struct sock *__VSockVmciFindBoundSocket(struct sockaddr_vm *addr); +struct sock *__VSockVmciFindConnectedSocket(struct sockaddr_vm *src, + struct sockaddr_vm *dst); +Bool __VSockVmciInBoundTable(struct sock *sk); +Bool __VSockVmciInConnectedTable(struct sock *sk); + +#ifdef VMX86_TOOLS +struct sock *VSockVmciGetPending(struct sock *listener, VSockPacket *pkt); +void VSockVmciReleasePending(struct sock *pending); +void VSockVmciAddPending(struct sock *listener, struct sock *pending); +void VSockVmciRemovePending(struct sock *listener, struct sock *pending); +void VSockVmciEnqueueAccept(struct sock *listener, struct sock *connected); +struct sock *VSockVmciDequeueAccept(struct sock *listener); +void VSockVmciRemoveAccept(struct sock *listener, struct sock *connected); +Bool VSockVmciInAcceptQueue(struct sock *sk); +Bool VSockVmciIsAcceptQueueEmpty(struct sock *sk); +Bool VSockVmciIsPending(struct sock *sk); +#endif + +static INLINE void VSockVmciInsertBound(struct list_head *list, struct sock *sk); +static INLINE void VSockVmciInsertConnected(struct list_head *list, struct sock *sk); +static INLINE void VSockVmciRemoveBound(struct sock *sk); +static INLINE void VSockVmciRemoveConnected(struct sock *sk); +static INLINE struct sock *VSockVmciFindBoundSocket(struct sockaddr_vm *addr); +static INLINE struct sock *VSockVmciFindConnectedSocket(struct sockaddr_vm *src, + struct sockaddr_vm *dst); +static INLINE Bool VSockVmciInBoundTable(struct sock *sk); +static INLINE Bool VSockVmciInConnectedTable(struct sock *sk); + + +/* + *---------------------------------------------------------------------------- + * + * VSockVmciInsertBound -- + * + * Inserts socket into the bound table. + * + * Note that it is important to invoke the bottom-half versions of the + * spinlock functions since these may be called from tasklets. + * + * Results: + * None. + * + * Side effects: + * vsockTableLock is acquired and released. + * + *---------------------------------------------------------------------------- + */ + +static INLINE void +VSockVmciInsertBound(struct list_head *list, // IN + struct sock *sk) // IN +{ + ASSERT(list); + ASSERT(sk); + + spin_lock_bh(&vsockTableLock); + __VSockVmciInsertBound(list, sk); + spin_unlock_bh(&vsockTableLock); +} + + +/* + *---------------------------------------------------------------------------- + * + * VSockVmciInsertConnected -- + * + * Inserts socket into the connected table. + * + * Note that it is important to invoke the bottom-half versions of the + * spinlock functions since these may be called from tasklets. + * + * Results: + * None. + * + * Side effects: + * vsockTableLock is acquired and released. + * + *---------------------------------------------------------------------------- + */ + +static INLINE void +VSockVmciInsertConnected(struct list_head *list, // IN + struct sock *sk) // IN +{ + ASSERT(list); + ASSERT(sk); + + spin_lock_bh(&vsockTableLock); + __VSockVmciInsertConnected(list, sk); + spin_unlock_bh(&vsockTableLock); +} + + +/* + *---------------------------------------------------------------------------- + * + * VSockVmciRemoveBound -- + * + * Removes socket from the bound list. + * + * Note that it is important to invoke the bottom-half versions of the + * spinlock functions since these may be called from tasklets. + * + * Results: + * None. + * + * Side effects: + * vsockTableLock is acquired and released. + * + *---------------------------------------------------------------------------- + */ + +static INLINE void +VSockVmciRemoveBound(struct sock *sk) // IN +{ + ASSERT(sk); + + spin_lock_bh(&vsockTableLock); + __VSockVmciRemoveBound(sk); + spin_unlock_bh(&vsockTableLock); +} + + +/* + *---------------------------------------------------------------------------- + * + * VSockVmciRemoveConnected -- + * + * Removes socket from the connected list. + * + * Note that it is important to invoke the bottom-half versions of the + * spinlock functions since these may be called from tasklets. + * + * Results: + * None. + * + * Side effects: + * vsockTableLock is acquired and released. + * + *---------------------------------------------------------------------------- + */ + +static INLINE void +VSockVmciRemoveConnected(struct sock *sk) // IN +{ + ASSERT(sk); + + spin_lock_bh(&vsockTableLock); + __VSockVmciRemoveConnected(sk); + spin_unlock_bh(&vsockTableLock); +} + + +/* + *---------------------------------------------------------------------------- + * + * VSockVmciFindBoundSocket -- + * + * Finds the socket corresponding to the provided address in the bound + * sockets hash table. + * + * Note that it is important to invoke the bottom-half versions of the + * spinlock functions since these are called from tasklets. + * + * Results: + * The sock structure if found, NULL on failure. + * + * Side effects: + * vsockTableLock is acquired and released. + * The socket's reference count is increased. + * + *---------------------------------------------------------------------------- + */ + +static INLINE struct sock * +VSockVmciFindBoundSocket(struct sockaddr_vm *addr) // IN +{ + struct sock *sk; + + ASSERT(addr); + + spin_lock_bh(&vsockTableLock); + sk = __VSockVmciFindBoundSocket(addr); + if (sk) { + sock_hold(sk); + } + spin_unlock_bh(&vsockTableLock); + + return sk; +} + + +/* + *---------------------------------------------------------------------------- + * + * VSockVmciFindConnectedSocket -- + * + * Finds the socket corresponding to the provided address in the connected + * sockets hash table. + * + * Note that it is important to invoke the bottom-half versions of the + * spinlock functions since these are called from tasklets. + * + * Results: + * The sock structure if found, NULL on failure. + * + * Side effects: + * vsockTableLock is acquired and released. + * The socket's reference count is increased. + * + *---------------------------------------------------------------------------- + */ + +static INLINE struct sock * +VSockVmciFindConnectedSocket(struct sockaddr_vm *src, // IN + struct sockaddr_vm *dst) // IN +{ + struct sock *sk; + + ASSERT(src); + ASSERT(dst); + + spin_lock_bh(&vsockTableLock); + sk = __VSockVmciFindConnectedSocket(src, dst); + if (sk) { + sock_hold(sk); + } + spin_unlock_bh(&vsockTableLock); + + return sk; +} + + +/* + *---------------------------------------------------------------------------- + * + * VSockVmciInBoundTable -- + * + * Determines whether the provided socket is in the bound table. + * + * Note that it is important to invoke the bottom-half versions of the + * spinlock functions since these may be called from tasklets. + * + * Results: + * TRUE is socket is in bound table, FALSE otherwise. + * + * Side effects: + * vsockTableLock is acquired and released. + * + *---------------------------------------------------------------------------- + */ + +static INLINE Bool +VSockVmciInBoundTable(struct sock *sk) // IN +{ + Bool ret; + + ASSERT(sk); + + spin_lock_bh(&vsockTableLock); + ret = __VSockVmciInBoundTable(sk); + spin_unlock_bh(&vsockTableLock); + + return ret; +} + + +/* + *---------------------------------------------------------------------------- + * + * VSockVmciInConnectedTable -- + * + * Determines whether the provided socket is in the connected table. + * + * Note that it is important to invoke the bottom-half versions of the + * spinlock functions since these may be called from tasklets. + * + * Results: + * TRUE is socket is in connected table, FALSE otherwise. + * + * Side effects: + * vsockTableLock is acquired and released. + * + *---------------------------------------------------------------------------- + */ + +static INLINE Bool +VSockVmciInConnectedTable(struct sock *sk) // IN +{ + Bool ret; + + ASSERT(sk); + + spin_lock_bh(&vsockTableLock); + ret = __VSockVmciInConnectedTable(sk); + spin_unlock_bh(&vsockTableLock); + + return ret; +} + +#endif /* __UTIL_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vsock/linux/vmci_sockets.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/linux/vmci_sockets.h --- open-vm-tools-2008.01.23-74039/modules/linux/vsock/linux/vmci_sockets.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/linux/vmci_sockets.h 2008-10-13 08:01:40.000000000 +0100 @@ -0,0 +1,242 @@ +/********************************************************* + * Copyright (C) 2007 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * vmci_sockets.h -- + * + * VMCI sockets public constants and types. + */ + +#ifndef _VMCI_SOCKETS_H_ +#define _VMCI_SOCKETS_H_ + + +#if defined(_WIN32) +# include <winsock2.h> +#else // _WIN32 +#if defined(linux) && !defined(VMKERNEL) +# if defined(__KERNEL__) +# include "driver-config.h" +# include "compat_sock.h" +# else +# include <sys/socket.h> +# endif // __KERNEL__ +#endif // linux && !VMKERNEL +#endif + +/* + * We use the same value for the AF family and the socket option + * level. To set options, use the value of VMCISock_GetAFValue for + * 'level' and these constants for the optname. + */ +#define SO_VMCI_BUFFER_SIZE 0 +#define SO_VMCI_BUFFER_MIN_SIZE 1 +#define SO_VMCI_BUFFER_MAX_SIZE 2 + +/* + * The VMCI sockets address equivalents of INADDR_ANY. The first works for + * the svm_cid (context id) field of the address structure below and indicates + * the current guest (or the host, if running outside a guest), while the + * second indicates any available port. + */ +#define VMADDR_CID_ANY ((unsigned int) -1) +#define VMADDR_PORT_ANY ((unsigned int) -1) + + +#if defined(_WIN32) || defined(VMKERNEL) + typedef unsigned short sa_family_t; +#endif // _WIN32 + +#if defined(VMKERNEL) + struct sockaddr { + sa_family_t sa_family; + char sa_data[14]; + }; +#endif + +/* + * Address structure for VSockets VMCI sockets. The address family should be + * set to AF_VMCI. + */ +struct sockaddr_vm { + sa_family_t svm_family; // AF_VMCI. + unsigned short svm_reserved1; // Reserved. + unsigned int svm_port; // Port. + unsigned int svm_cid; // Context id. + unsigned char svm_zero[sizeof(struct sockaddr) - // Same size as sockaddr. + sizeof(sa_family_t) - + sizeof(unsigned short) - + sizeof(unsigned int) - + sizeof(unsigned int)]; +}; + + +#if defined(_WIN32) +# if !defined(WINNT_DDK) +# include <winioctl.h> +# define VMCI_SOCKETS_DEVICE TEXT("\\\\.\\VMCI") +# define VMCI_SOCKETS_GET_AF_VALUE 0x81032068 +# define VMCI_SOCKETS_GET_LOCAL_CID 0x8103206c + + static __inline int VMCISock_GetAFValue(void) + { + HANDLE device = CreateFile(VMCI_SOCKETS_DEVICE, GENERIC_READ, 0, NULL, + OPEN_EXISTING, FILE_FLAG_OVERLAPPED, NULL); + if (INVALID_HANDLE_VALUE != device) { + DWORD ioReturn; + int afvalue; + if (DeviceIoControl(device, VMCI_SOCKETS_GET_AF_VALUE, &afvalue, + sizeof afvalue, &afvalue, sizeof afvalue, + &ioReturn, NULL)) { + CloseHandle(device); + device = INVALID_HANDLE_VALUE; + return afvalue; + } + CloseHandle(device); + device = INVALID_HANDLE_VALUE; + } + return -1; + } + + static __inline unsigned int VMCISock_GetLocalCID(void) + { + HANDLE device = CreateFile(VMCI_SOCKETS_DEVICE, GENERIC_READ, 0, NULL, + OPEN_EXISTING, FILE_FLAG_OVERLAPPED, NULL); + if (INVALID_HANDLE_VALUE != device) { + DWORD ioReturn; + unsigned int cid; + if (DeviceIoControl(device, VMCI_SOCKETS_GET_LOCAL_CID, &cid, + sizeof cid, &cid, sizeof cid, &ioReturn, + NULL)) { + CloseHandle(device); + device = INVALID_HANDLE_VALUE; + return cid; + } + CloseHandle(device); + device = INVALID_HANDLE_VALUE; + } + return VMADDR_CID_ANY; + } +# endif // WINNT_DDK +#else // _WIN32 +#if defined(linux) && !defined(VMKERNEL) +# ifndef __KERNEL__ +# include <sys/types.h> +# include <sys/stat.h> +# include <fcntl.h> +# include <sys/ioctl.h> +# include <unistd.h> + +# include <stdio.h> + +# define VMCI_SOCKETS_DEFAULT_DEVICE "/dev/vsock" +# define IOCTL_VMCI_SOCKETS_GET_AF_VALUE 1976 +# define IOCTL_VMCI_SOCKETS_GET_LOCAL_CID 1977 + + /* + *---------------------------------------------------------------------------- + * + * VMCISock_GetAFValue and VMCISock_GetAFValueFd -- + * + * Returns the value to be used for the VMCI Sockets address family. + * This value should be used as the domain argument to socket(2) (when + * you might otherwise use AF_INET). For VMCI Socket-specific options, + * this value should also be used for the level argument to + * setsockopt(2) (when you might otherwise use SOL_TCP). + * + * This function leaves its descriptor to the vsock device open so that + * the socket implementation knows that the socket family is still in + * use. We do this because we register our address family with the + * kernel on-demand and need a notification to unregister the address + * family. + * + * For many programs this behavior is sufficient as is, but some may + * wish to close this descriptor once they are done with VMCI Sockets. + * For these programs, we provide a VMCISock_GetAFValueFd() that takes + * an optional outFd argument. This value can be provided to + * VMCISock_ReleaseAFValueFd() only after the program no longer will + * use VMCI Sockets. Note that outFd is only valid in cases where + * VMCISock_GetAFValueFd() returns a non-negative value. + * + * Results: + * The address family value to use on success, negative error code on + * failure. + * + *---------------------------------------------------------------------------- + */ + + static inline int VMCISock_GetAFValueFd(int *outFd) + { + int fd; + int family; + + fd = open(VMCI_SOCKETS_DEFAULT_DEVICE, O_RDWR); + if (fd < 0) { + return -1; + } + + if (ioctl(fd, IOCTL_VMCI_SOCKETS_GET_AF_VALUE, &family) < 0) { + family = -1; + } + + if (family < 0) { + close(fd); + } else if (outFd) { + *outFd = fd; + } + + return family; + } + + static inline int VMCISock_GetAFValue(void) + { + return VMCISock_GetAFValueFd(NULL); + } + + + static inline void VMCISock_ReleaseAFValueFd(int fd) + { + if (fd >= 0) { + close(fd); + } + } + + static inline unsigned int VMCISock_GetLocalCID(void) + { + int fd; + unsigned int contextId; + + fd = open(VMCI_SOCKETS_DEFAULT_DEVICE, O_RDWR); + if (fd < 0) { + return VMADDR_CID_ANY; + } + + if (ioctl(fd, IOCTL_VMCI_SOCKETS_GET_LOCAL_CID, &contextId) < 0) { + contextId = VMADDR_CID_ANY; + } + + close(fd); + return contextId; + } +# endif // __KERNEL__ +#endif // linux && !VMKERNEL +#endif // _WIN32 + + +#endif // _VMCI_SOCKETS_H_ + diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vsock/linux/vmci_sockets_kernel.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/linux/vmci_sockets_kernel.h --- open-vm-tools-2008.01.23-74039/modules/linux/vsock/linux/vmci_sockets_kernel.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/linux/vmci_sockets_kernel.h 2008-10-13 08:01:40.000000000 +0100 @@ -0,0 +1,48 @@ +/********************************************************* + * Copyright (C) 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 General Public License as published by the + * Free Software Foundation version 2 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 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 + * + *********************************************************/ + +/* + * vmci_sockets_kernel.h -- + * + * VMCI sockets kernel public constants and types. + */ + +#ifndef _VMCI_SOCKETS_KERNEL_H_ +#define _VMCI_SOCKETS_KERNEL_H_ + + +#include "vmci_sockets.h" + + +#if defined(_WIN32) +# if defined(WINNT_DDK) + typedef WSACMSGHDR CMSGHDR, *PCMSGHDR; +# include <wsk.h> + NTSTATUS VMCISock_WskRegister(PWSK_CLIENT_NPI wskClientNpi, + PWSK_REGISTRATION wskRegistration); + NTSTATUS VMCISock_WskDeregister(PWSK_REGISTRATION wskRegistration); + NTSTATUS VMCISock_WskCaptureProviderNPI(PWSK_REGISTRATION wskRegistration, + ULONG waitTimeout, + PWSK_PROVIDER_NPI wskProviderNpi); + NTSTATUS VMCISock_WskReleaseProviderNPI(PWSK_REGISTRATION wskRegistration); +# endif // WINNT_DDK +#endif // _WIN32 + + +#endif // _VMCI_SOCKETS_KERNEL_H_ + diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vsock/linux/vsockAddr.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/linux/vsockAddr.c --- open-vm-tools-2008.01.23-74039/modules/linux/vsock/linux/vsockAddr.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/linux/vsockAddr.c 2008-10-13 08:01:40.000000000 +0100 @@ -0,0 +1,384 @@ +/********************************************************* + * Copyright (C) 2007 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * vsockAddr.c -- + * + * VSockets address implementation. + */ + +/* + * These includes come before vsockCommon.h to ensure that VMware's ASSERT + * macro is used instead of Linux's irda.h definition. + */ +#if defined(linux) && !defined(VMKERNEL) +# if defined(__KERNEL__) +# include "driver-config.h" +# include <linux/socket.h> +# include "compat_sock.h" +# else +# include <string.h> +# include <errno.h> +# endif +#elif defined(VMKERNEL) +# include "vm_libc.h" +# include "return_status.h" +#endif + +#include "vsockCommon.h" + + +/* + *----------------------------------------------------------------------------- + * + * VSockAddr_Init -- + * + * Initialize the given address with the given context id and port. This + * will clear the address, set the correct family, and add the given + * values. + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +void +VSockAddr_Init(struct sockaddr_vm *addr, // OUT + uint32 cid, // IN + uint32 port) // IN +{ + ASSERT(addr); + memset(addr, 0, sizeof *addr); + VSockAddr_InitNoFamily(addr, cid, port); + addr->svm_family = VMCISock_GetAFValue(); + VSOCK_ADDR_ASSERT(addr); +} + + +/* + *----------------------------------------------------------------------------- + * + * VSockAddr_InitNoFamily -- + * + * Initialize the given address with the given context id and port. This + * will clear the address and add the given values, but not set the + * family. Note that this is needed because in some places we don't want + * to re-register the address family in the Linux kernel and all we need + * is to check the context id and port. + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +void +VSockAddr_InitNoFamily(struct sockaddr_vm *addr, // OUT + uint32 cid, // IN + uint32 port) // IN +{ + ASSERT(addr); + memset(addr, 0, sizeof *addr); + addr->svm_cid = cid; + addr->svm_port = port; + VSOCK_ADDR_NOFAMILY_ASSERT(addr); +} + + +/* + *----------------------------------------------------------------------------- + * + * VSockAddr_Validate -- + * + * Try to validate the given address. The address must not be null and + * must have the correct address family. Any reserved fields must be + * zero. + * + * Results: + * 0 on success, EFAULT if the address is null, EAFNOSUPPORT if the + * address is of the wrong family, and EINVAL if the reserved fields are + * not zero. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +int32 +VSockAddr_Validate(const struct sockaddr_vm *addr) // IN +{ + int32 err; + + if (NULL == addr) { + err = EFAULT; + goto exit; + } + + if (VMCISock_GetAFValue() != addr->svm_family) { + err = EAFNOSUPPORT; + goto exit; + } + + if (0 != addr->svm_zero[0]) { + err = EINVAL; + goto exit; + } + + err = 0; + +exit: + return sockerr2err(err); +} + + +/* + *----------------------------------------------------------------------------- + * + * VSockAddr_ValidateNoFamily -- + * + * Try to validate the given address. The address must not be null and + * any reserved fields must be zero, but the address family is not + * checked. Note that this is needed because in some places we don't want + * to re-register the address family with the Linux kernel. + * + * Also note that we duplicate the code from _Validate() since we want to + * retain the ordering or the error return values. + * + * Results: + * 0 on success, EFAULT if the address is null and EINVAL if the reserved + * fields are not zero. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +int32 +VSockAddr_ValidateNoFamily(const struct sockaddr_vm *addr) // IN +{ + int32 err; + + if (NULL == addr) { + err = EFAULT; + goto exit; + } + + if (0 != addr->svm_zero[0]) { + err = EINVAL; + goto exit; + } + + err = 0; + +exit: + return sockerr2err(err); +} + + +/* + *---------------------------------------------------------------------------- + * + * VSockAddr_Bound -- + * + * Determines whether the provided address is bound. + * + * Results: + * TRUE if the address structure is bound, FALSE otherwise. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +Bool +VSockAddr_Bound(struct sockaddr_vm *addr) // IN: socket address to check +{ + ASSERT(addr); + return addr->svm_cid != VMADDR_CID_ANY && addr->svm_port != VMADDR_PORT_ANY; +} + + +/* + *---------------------------------------------------------------------------- + * + * VSockAddr_Unbind -- + * + * Unbind the given addresss. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +void +VSockAddr_Unbind(struct sockaddr_vm *addr) // IN +{ + VSockAddr_Init(addr, VMADDR_CID_ANY, VMADDR_PORT_ANY); +} + + +/* + *---------------------------------------------------------------------------- + * + * VSockAddr_EqualsAddr -- + * + * Determine if the given addresses are equal. + * + * Results: + * TRUE if the addresses are equal, FALSE otherwise. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +Bool +VSockAddr_EqualsAddr(struct sockaddr_vm *addr, // IN + struct sockaddr_vm *other) // IN +{ + /* + * XXX We don't ASSERT on the family here since this is used on the receive + * path in Linux and we don't want to re-register the address family + * unnecessarily. + */ + VSOCK_ADDR_NOFAMILY_ASSERT(addr); + VSOCK_ADDR_NOFAMILY_ASSERT(other); + return (addr->svm_cid == other->svm_cid && + addr->svm_port == other->svm_port); +} + + +/* + *---------------------------------------------------------------------------- + * + * VSockAddr_EqualsHandlePort -- + * + * Determines if the given address matches the given handle and port. + * + * Results: + * TRUE if the address matches the handle and port, FALSE otherwise. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +Bool +VSockAddr_EqualsHandlePort(struct sockaddr_vm *addr, // IN + VMCIHandle handle, // IN + uint32 port) // IN +{ + VSOCK_ADDR_ASSERT(addr); + return (addr->svm_cid == VMCI_HANDLE_TO_CONTEXT_ID(handle) && + addr->svm_port == port); +} + + +/* + *----------------------------------------------------------------------------- + * + * VSockAddr_Cast -- + * + * Try to cast the given generic address to a VM address. The given + * length must match that of a VM address and the address must be valid. + * The "outAddr" parameter contains the address if successful. + * + * Results: + * 0 on success, EFAULT if the length is too small. See + * VSockAddr_Validate() for other possible return codes. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +int32 +VSockAddr_Cast(const struct sockaddr *addr, // IN + int32 len, // IN + struct sockaddr_vm **outAddr) // OUT +{ + int32 err; + + ASSERT(outAddr); + + if (len < sizeof **outAddr) { + err = EFAULT; + goto exit; + } + + *outAddr = (struct sockaddr_vm *) addr; + err = VSockAddr_Validate(*outAddr); + +exit: + return sockerr2err(err); +} + + +/* + *---------------------------------------------------------------------------- + * + * VSockAddr_SocketContext -- + * + * Determines whether the provided context id represents a context that + * contains socket endpoints. + * + * Results: + * TRUE if the context does have socket endpoints, FALSE otherwise. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +Bool +VSockAddr_SocketContext(uint32 cid) // IN +{ + uint32 i; + VMCIId nonSocketContexts[] = { + VMCI_HYPERVISOR_CONTEXT_ID, + VMCI_WELL_KNOWN_CONTEXT_ID, + }; + + ASSERT_ON_COMPILE(sizeof cid == sizeof *nonSocketContexts); + + for (i = 0; i < ARRAYSIZE(nonSocketContexts); i++) { + if (cid == nonSocketContexts[i]) { + return FALSE; + } + } + + return TRUE; +} diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vsock/linux/vsockAddr.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/linux/vsockAddr.h --- open-vm-tools-2008.01.23-74039/modules/linux/vsock/linux/vsockAddr.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/linux/vsockAddr.h 2008-10-13 08:01:40.000000000 +0100 @@ -0,0 +1,52 @@ +/********************************************************* + * Copyright (C) 2007 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * vsockAddr.h -- + * + * VSockets address constants, types and functions. + */ + + +#ifndef _VSOCK_ADDR_H_ +#define _VSOCK_ADDR_H_ + + +/* Assert that the given address is valid. */ +#define VSOCK_ADDR_ASSERT(_a) \ + ASSERT(0 == VSockAddr_Validate((_a))) +#define VSOCK_ADDR_NOFAMILY_ASSERT(_a) \ + ASSERT(0 == VSockAddr_ValidateNoFamily((_a))) + + +void VSockAddr_Init(struct sockaddr_vm *addr, uint32 cid, uint32 port); +void VSockAddr_InitNoFamily(struct sockaddr_vm *addr, uint32 cid, uint32 port); +int32 VSockAddr_Validate(const struct sockaddr_vm *addr); +int32 VSockAddr_ValidateNoFamily(const struct sockaddr_vm *addr); +Bool VSockAddr_Bound(struct sockaddr_vm *addr); +void VSockAddr_Unbind(struct sockaddr_vm *addr); +Bool VSockAddr_EqualsAddr(struct sockaddr_vm *addr, struct sockaddr_vm *other); +Bool VSockAddr_EqualsHandlePort(struct sockaddr_vm *addr, VMCIHandle handle, + uint32 port); +int32 VSockAddr_Cast(const struct sockaddr *addr, int32 len, + struct sockaddr_vm **outAddr); +Bool VSockAddr_SocketContext(VMCIId cid); + + +#endif // _VSOCK_ADDR_H_ + diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vsock/linux/vsockCommon.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/linux/vsockCommon.h --- open-vm-tools-2008.01.23-74039/modules/linux/vsock/linux/vsockCommon.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/linux/vsockCommon.h 2008-10-13 08:01:40.000000000 +0100 @@ -0,0 +1,106 @@ +/********************************************************* + * Copyright (C) 2007 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * vsockCommon.h -- + * + * VSockets common constants, types and functions. + */ + + +#ifndef _VSOCK_COMMON_H_ +#define _VSOCK_COMMON_H_ + + +#if defined(_WIN32) +# define VMCI_SOCKETS_AF_VALUE 28 +# if defined(WINNT_DDK) +# define _WIN2K_COMPAT_SLIST_USAGE + /* + * wdm.h has to come first, otherwise NTDDI_VERSION gets all confused + * and we start pulling in the wrong versions of the Ke() routines. + */ +# include <wdm.h> +# include <ntddk.h> +# include <windef.h> + /* + * Using ntifs.h for these functions does not play nicely with having + * wdm.h first. So rather than include that header, we pull these in + * directly. + */ + NTKERNELAPI HANDLE PsGetCurrentProcessId(VOID); + NTKERNELAPI NTSTATUS PsSetCreateProcessNotifyRoutine( + PCREATE_PROCESS_NOTIFY_ROUTINE, BOOLEAN); + NTSYSAPI NTSTATUS NTAPI + ZwWaitForSingleObject(HANDLE, BOOLEAN, PLARGE_INTEGER); +# define _INC_WINDOWS +# include "vmci_queue_pair.h" + /* In the kernel we can't call into the provider. */ +# define VMCISock_GetAFValue() VMCI_SOCKETS_AF_VALUE +# else // WINNT_DDK +# include <windows.h> +# endif // WINNT_DDK +# define Uint64ToPtr(_ui) ((void *)(uint64)(_ui)) +# define PtrToUint64(_p) ((uint64)(_p)) +#else +#if defined(VMKERNEL) +# include "uwvmkAPI.h" +# define VMCI_SOCKETS_AF_VALUE AF_VMCI /* Defined in uwvmkAPI.h. */ + /* The address family is fixed in the vmkernel. */ +# define VMCISock_GetAFValue() VMCI_SOCKETS_AF_VALUE +# include "vmci_queue_pair_vmk.h" +# define Uint64ToPtr(_ui) ((void *)(uint64)(_ui)) +# define PtrToUint64(_p) ((uint64)(_p)) +#else +#if defined(linux) +# if defined(__KERNEL__) + /* Include compat_page.h now so PAGE_SIZE and friends don't get redefined. */ +# include "driver-config.h" +# include "compat_page.h" +# if defined(VMX86_TOOLS) +# include "vmci_queue_pair.h" +# endif + /* + * In the kernel we call back into af_vsock.c to get the address family + * being used. Otherwise an ioctl(2) is performed (see vmci_sockets.h). + */ + extern int VSockVmci_GetAFValue(void); +# define VMCISock_GetAFValue() VSockVmci_GetAFValue() +# endif +#endif // linux +#endif // VMKERNEL +#endif // _WIN32 + +#include "vmware.h" +#include "vmware_pack_init.h" +#include "vmci_defs.h" +#include "vmci_call_defs.h" +#include "vmci_sockets.h" +#include "vmci_sockets_kernel.h" +#include "vsockAddr.h" +#include "vsockSocketWrapper.h" + + +/* Memory allocation flags. */ +#define VSOCK_MEMORY_NORMAL 0 +#define VSOCK_MEMORY_ATOMIC (1 << 0) +#define VSOCK_MEMORY_NONPAGED (1 << 1) + + +#endif // _VSOCK_COMMON_H_ + diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vsock/linux/vsockPacket.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/linux/vsockPacket.h --- open-vm-tools-2008.01.23-74039/modules/linux/vsock/linux/vsockPacket.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/linux/vsockPacket.h 2008-10-13 08:01:40.000000000 +0100 @@ -0,0 +1,291 @@ +/********************************************************* + * Copyright (C) 2007 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * vsockPacket.h -- + * + * Packet constants, types and functions. + */ + +#if defined(_WIN32) || defined(VMKERNEL) +# include "vsockOSInt.h" +#else +# define VSockOS_ClearMemory(_dst, _sz) memset(_dst, 0, _sz) +# define VSockOS_Memcpy(_dst, _src, _sz) memcpy(_dst, _src, _sz) +#endif + + +#ifndef _VSOCK_PACKET_H_ +#define _VSOCK_PACKET_H_ + + +/* If the packet format changes in a release then this should change too. */ +#define VSOCK_PACKET_VERSION 1 + +/* The resource ID on which control packets are sent. */ +#define VSOCK_PACKET_RID 1 + +/* Assert that the given packet is valid. */ +#define VSOCK_PACKET_ASSERT(_p) \ + ASSERT((_p)); \ + ASSERT((_p)->type < VSOCK_PACKET_TYPE_MAX); \ + ASSERT(0 == (_p)->_reserved1); \ + ASSERT(0 == (_p)->_reserved2) + + +typedef enum VSockPacketType { + VSOCK_PACKET_TYPE_INVALID = 0, // Invalid type. + VSOCK_PACKET_TYPE_REQUEST, // Connection request. + VSOCK_PACKET_TYPE_NEGOTIATE, // Connection negotiate. + VSOCK_PACKET_TYPE_OFFER, // Connection offer queue pair. + VSOCK_PACKET_TYPE_ATTACH, // Connection attach. + VSOCK_PACKET_TYPE_WROTE, // Wrote data to queue pair. + VSOCK_PACKET_TYPE_READ, // Read data from queue pair. + VSOCK_PACKET_TYPE_RST, // Reset. + VSOCK_PACKET_TYPE_SHUTDOWN, // Shutdown the connection. + VSOCK_PACKET_TYPE_WAITING_WRITE, // Notify peer we are waiting to write. + VSOCK_PACKET_TYPE_WAITING_READ, // Notify peer we are waiting to read. + VSOCK_PACKET_TYPE_MAX // Last message. +} VSockPacketType; + +typedef struct VSockWaitingInfo { + uint64 generation; // Generation of the queue. + uint64 offset; // Offset within the queue. +} VSockWaitingInfo; + +/* + * Control packet type for STREAM sockets. DGRAMs have no control packets + * nor special packet header for data packets, they are just raw VMCI DGRAM + * messages. For STREAMs, control packets are sent over the control channel + * while data is written and read directly from queue pairs with no packet + * format. + */ +typedef struct VSockPacket { + VMCIDatagram dg; // Datagram header. + uint8 version; // Version. + uint8 type; // Type of message. + uint16 _reserved1; // Reserved. + uint32 srcPort; // Source port. + uint32 dstPort; // Destination port. + uint32 _reserved2; // Reserved. + union { + uint64 size; // Size of queue pair for request/negotiation. + uint64 mode; // Mode of shutdown for shutdown. + VMCIHandle handle; // Queue pair handle once size negotiated. + VSockWaitingInfo wait; // Information provided for wait notifications. + } u; +} VSockPacket; + + +MY_ASSERTS(VSockPacketAsserts, + ASSERT_ON_COMPILE(sizeof (VSockPacket) == 56); +) + + +/* + *----------------------------------------------------------------------------- + * + * VSockPacket_Init -- + * + * Initialize the given packet. The packet version is set and the fields + * are filled out. Reserved fields are cleared. + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static INLINE void +VSockPacket_Init(VSockPacket *pkt, // OUT + struct sockaddr_vm *src, // IN + struct sockaddr_vm *dst, // IN + uint8 type, // IN + uint64 size, // IN + uint64 mode, // IN + VSockWaitingInfo *wait, // IN + VMCIHandle handle) // IN +{ + ASSERT(pkt); + VSOCK_ADDR_NOFAMILY_ASSERT(src); + VSOCK_ADDR_NOFAMILY_ASSERT(dst); + + pkt->dg.src = VMCI_MAKE_HANDLE(src->svm_cid, VSOCK_PACKET_RID); + pkt->dg.dst = VMCI_MAKE_HANDLE(dst->svm_cid, VSOCK_PACKET_RID); + pkt->dg.payloadSize = sizeof *pkt - sizeof pkt->dg; + pkt->version = VSOCK_PACKET_VERSION; + pkt->type = type; + pkt->srcPort = src->svm_port; + pkt->dstPort = dst->svm_port; + VSockOS_ClearMemory(&pkt->_reserved1, sizeof pkt->_reserved1); + VSockOS_ClearMemory(&pkt->_reserved2, sizeof pkt->_reserved2); + + switch (pkt->type) { + case VSOCK_PACKET_TYPE_INVALID: + pkt->u.size = 0; + break; + + case VSOCK_PACKET_TYPE_REQUEST: + case VSOCK_PACKET_TYPE_NEGOTIATE: + pkt->u.size = size; + break; + + case VSOCK_PACKET_TYPE_OFFER: + case VSOCK_PACKET_TYPE_ATTACH: + pkt->u.handle = handle; + break; + + case VSOCK_PACKET_TYPE_WROTE: + case VSOCK_PACKET_TYPE_READ: + case VSOCK_PACKET_TYPE_RST: + pkt->u.size = 0; + break; + + case VSOCK_PACKET_TYPE_SHUTDOWN: + pkt->u.mode = mode; + break; + + case VSOCK_PACKET_TYPE_WAITING_READ: + case VSOCK_PACKET_TYPE_WAITING_WRITE: + ASSERT(wait); + VSockOS_Memcpy(&pkt->u.wait, wait, sizeof pkt->u.wait); + break; + } + + VSOCK_PACKET_ASSERT(pkt); +} + + +/* + *----------------------------------------------------------------------------- + * + * VSockPacket_Validate -- + * + * Validate the given packet. + * + * Results: + * 0 on success, EFAULT if the address is invalid, EINVAL if the packet + * fields are invalid. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static INLINE int32 +VSockPacket_Validate(VSockPacket *pkt) +{ + int32 err = EINVAL; + + if (NULL == pkt) { + err = EFAULT; + goto exit; + } + + if (VMCI_HANDLE_INVALID(pkt->dg.src)) { + goto exit; + } + + if (VMCI_HANDLE_INVALID(pkt->dg.dst)) { + goto exit; + } + + if (VMCI_INVALID_ID == pkt->dstPort || VMCI_INVALID_ID == pkt->srcPort) { + goto exit; + } + + if (VSOCK_PACKET_VERSION != pkt->version) { + goto exit; + } + + if (0 != pkt->_reserved1 || 0 != pkt->_reserved2) { + goto exit; + } + + switch (pkt->type) { + case VSOCK_PACKET_TYPE_INVALID: + if (0 != pkt->u.size) { + goto exit; + } + break; + + case VSOCK_PACKET_TYPE_REQUEST: + case VSOCK_PACKET_TYPE_NEGOTIATE: + if (0 == pkt->u.size) { + goto exit; + } + break; + + case VSOCK_PACKET_TYPE_OFFER: + case VSOCK_PACKET_TYPE_ATTACH: + if (VMCI_HANDLE_INVALID(pkt->u.handle)) { + goto exit; + } + break; + + case VSOCK_PACKET_TYPE_WROTE: + case VSOCK_PACKET_TYPE_READ: + case VSOCK_PACKET_TYPE_RST: + if (0 != pkt->u.size) { + goto exit; + } + break; + } + + err = 0; + +exit: + return sockerr2err(err); +} + + +/* + *----------------------------------------------------------------------------- + * + * VSockPacket_GetAddresses -- + * + * Get the local and remote addresses from the given packet. + * + * Results: + * None + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static INLINE void +VSockPacket_GetAddresses(VSockPacket *pkt, // IN + struct sockaddr_vm *local, // OUT + struct sockaddr_vm *remote) // OUT +{ + VSOCK_PACKET_ASSERT(pkt); + VSockAddr_Init(local, VMCI_HANDLE_TO_CONTEXT_ID(pkt->dg.dst), + pkt->dstPort); + VSockAddr_Init(remote, VMCI_HANDLE_TO_CONTEXT_ID(pkt->dg.src), + pkt->srcPort); +} + + +#endif // _VSOCK_PACKET_H_ + diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vsock/linux/vsockSocketWrapper.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/linux/vsockSocketWrapper.h --- open-vm-tools-2008.01.23-74039/modules/linux/vsock/linux/vsockSocketWrapper.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/linux/vsockSocketWrapper.h 2008-10-13 08:01:40.000000000 +0100 @@ -0,0 +1,188 @@ +/********************************************************* + * Copyright (C) 2007 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * vsockSocketWrapper.h -- + * + * Socket wrapper constants, types and functions. + */ + + +#ifndef _VSOCK_SOCKET_WRAPPER_H_ +#define _VSOCK_SOCKET_WRAPPER_H_ + + +/* + * Socket states and flags. Note that MSG_WAITALL is only supported on 2K3, + * XP-SP2 and above. Since we currently build for 2K to maintain backwards + * compatibility, it will always be 0. + */ +#if defined(_WIN32) +# define MSG_DONTWAIT 0 +# define MSG_NOSIGNAL 0 +# if (_WIN32_WINNT < 0x0502) +# define MSG_WAITALL 0 +# endif +#endif + +#if defined(_WIN32) || defined(VMKERNEL) +# define SS_FREE 0 +# define SS_UNCONNECTED 1 +# define SS_CONNECTING 2 +# define SS_CONNECTED 3 +# define SS_DISCONNECTING 4 +# define RCV_SHUTDOWN 1 +# define SEND_SHUTDOWN 2 +# define SHUTDOWN_MASK 3 +#endif // _WIN32 || VMKERNEL + + +/* + * Error codes. + */ +#if defined(_WIN32) +# if !defined(EINTR) +# define EINTR WSAEINTR +# endif +# if !defined(EACCES) +# define EACCES WSAEACCES +# endif +# if !defined(EFAULT) +# define EFAULT WSAEFAULT +# endif +# if !defined(EINVAL) +# define EINVAL WSAEINVAL +# endif +# define EWOULDBLOCK WSAEWOULDBLOCK +# define EINPROGRESS WSAEINPROGRESS +# define EALREADY WSAEALREADY +# define ENOTSOCK WSAENOTSOCK +# define EDESTADDRREQ WSAEDESTADDRREQ +# define EMSGSIZE WSAEMSGSIZE +# define EPROTOTYPE WSAEPROTOTYPE +# define ENOPROTOOPT WSAENOPROTOOPT +# define EPROTONOSUPPORT WSAEPROTONOSUPPORT +# define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT +# define EOPNOTSUPP WSAEOPNOTSUPP +# define EPFNOSUPPORT WSAEPFNOSUPPORT +# define EAFNOSUPPORT WSAEAFNOSUPPORT +# define EADDRINUSE WSAEADDRINUSE +# define EADDRNOTAVAIL WSAEADDRNOTAVAIL +# define ENETDOWN WSAENETDOWN +# define ENETUNREACH WSAENETUNREACH +# define ENETRESET WSAENETRESET +# define ECONNABORTED WSAECONNABORTED +# define ECONNRESET WSAECONNRESET +# define ENOBUFS WSAENOBUFS +# define EISCONN WSAEISCONN +# define ENOTCONN WSAENOTCONN +# define ESHUTDOWN WSAESHUTDOWN +# define ETIMEDOUT WSAETIMEDOUT +# define ECONNREFUSED WSAECONNREFUSED +# define EHOSTDOWN WSAEHOSTDOWN +# define EHOSTUNREACH WSAEHOSTUNREACH +#else +#if defined(VMKERNEL) +# define EINTR VMK_WAIT_INTERRUPTED +# define EACCES VMK_NOACCESS +# define EFAULT VMK_INVALID_ADDRESS +# define EINVAL VMK_FAILURE +# define EWOULDBLOCK VMK_WOULD_BLOCK +# define EINPROGRESS VMK_EINPROGRESS +# define EALREADY VMK_EALREADY +# define ENOTSOCK VMK_NOT_A_SOCKET +# define EDESTADDRREQ VMK_EDESTADDRREQ + /* + * Do not change EMSGSIZE definition without changing uses of + * VMK_LIMIT_EXCEEDED in userSocketVmci.c's implementation of recvmsg(). + */ +# define EMSGSIZE VMK_LIMIT_EXCEEDED +# define EPROTOTYPE VMK_NOT_SUPPORTED +# define ENOPROTOOPT VMK_NOT_SUPPORTED +# define EPROTONOSUPPORT VMK_EPROTONOSUPPORT +# define ESOCKTNOSUPPORT VMK_NOT_SUPPORTED +# define EOPNOTSUPP VMK_EOPNOTSUPP +# define EPFNOSUPPORT VMK_ADDRFAM_UNSUPP +# define EAFNOSUPPORT VMK_ADDRFAM_UNSUPP +# define EADDRINUSE VMK_EADDRINUSE +# define EADDRNOTAVAIL VMK_EADDRNOTAVAIL +# define ENETDOWN VMK_ENETDOWN +# define ENETUNREACH VMK_ENETUNREACH +# define ENETRESET VMK_ENETRESET +# define ECONNABORTED VMK_ECONNABORTED +# define ECONNRESET VMK_ECONNRESET +# define ENOBUFS VMK_NO_MEMORY +# define ENOMEM VMK_NO_MEMORY +# define EISCONN VMK_ALREADY_CONNECTED +# define ENOTCONN VMK_ENOTCONN +# define ESHUTDOWN VMK_ESHUTDOWN +# define ETIMEDOUT VMK_TIMEOUT +# define ECONNREFUSED VMK_ECONNREFUSED +# define EHOSTDOWN VMK_EHOSTDOWN +# define EHOSTUNREACH VMK_EHOSTUNREACH +#endif // VMKERNEL +#endif // _WIN32 + + +#if defined(_WIN32) +# define sockerr() WSAGetLastError() +# define sockerr2err(_e) (((_e) < 0) ? -(_e) : (_e)) +# define sockcleanup() WSACleanup() + typedef uint32 socklen_t; + typedef uint32 in_addr_t; +#else // _WIN32 +#if defined(VMKERNEL) +# define SOCKET_ERROR (-1) +# define INVALID_SOCKET ((SOCKET) -1) +# define sockerr() errno +# define sockerr2err(_e) (_e) +# define sockcleanup() do {} while (0) +# define closesocket(_s) close((_s)) + typedef int32 SOCKET; +#else +#if defined(linux) +# define SOCKET_ERROR (-1) +# define INVALID_SOCKET ((SOCKET) -1) +# define sockerr() errno +# define sockerr2err(_e) (((_e) > 0) ? -(_e) : (_e)) +# define sockcleanup() do {} while (0) +# define closesocket(_s) close((_s)) + typedef int32 SOCKET; +#endif // linux +#endif // VMKERNEL +#endif // _WIN32 + + +/* + * There is no SS_XXX state equivalent to TCP_LISTEN. Linux does have a flag + * __SO_ACCEPTCON which some of the socket implementations use, but it does + * not fit in the state field (although it is sometimes incorrectly used that + * way). So we define our own listen state here for all platforms. + */ +#define SS_LISTEN 255 + + +/* + * Initialize sockets. This is really for platforms that do not have + * on-by-default socket implementations like Windows. + */ +int sockinit(void); + + +#endif // _VSOCK_SOCKET_WRAPPER_H_ + diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vsock/linux/vsock_version.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/linux/vsock_version.h --- open-vm-tools-2008.01.23-74039/modules/linux/vsock/linux/vsock_version.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/linux/vsock_version.h 2008-10-13 08:01:40.000000000 +0100 @@ -0,0 +1,32 @@ +/********************************************************* + * Copyright (C) 2007 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * vsock_version.h -- + * + * Version definitions for the Linux vsock driver. + */ + +#ifndef _VSOCK_VERSION_H_ +#define _VSOCK_VERSION_H_ + +#define VSOCK_DRIVER_VERSION 1.0.0.0 +#define VSOCK_DRIVER_VERSION_COMMAS 1,0,0,0 +#define VSOCK_DRIVER_VERSION_STRING "1.0.0.0" + +#endif /* _VSOCK_VERSION_H_ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vsock/linux/vsockVmci.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/linux/vsockVmci.h --- open-vm-tools-2008.01.23-74039/modules/linux/vsock/linux/vsockVmci.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/linux/vsockVmci.h 2008-10-13 08:01:40.000000000 +0100 @@ -0,0 +1,101 @@ +/********************************************************* + * Copyright (C) 2007 VMware, Inc. All rights reserved. + * + * 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 version 2 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 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 + * + *********************************************************/ + +/* + * vsockVmci.h -- + * + * VSockets VMCI constants, types and functions. + */ + + +#ifndef _VSOCK_VMCI_H_ +#define _VSOCK_VMCI_H_ + + +extern VMCIId VMCI_GetContextID(void); + + +/* + *----------------------------------------------------------------------------- + * + * VSockVmci_IsLocal -- + * + * Determine if the given handle points to the local context. + * + * Results: + * TRUE if the given handle is for the local context, FALSE otherwise. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static INLINE Bool +VSockVmci_IsLocal(VMCIHandle handle) // IN +{ + return VMCI_GetContextID() == VMCI_HANDLE_TO_CONTEXT_ID(handle); +} + + +/* + *---------------------------------------------------------------------------- + * + * VSockVmci_ErrorToVSockError -- + * + * Converts from a VMCI error code to a VSock error code. + * + * Results: + * Appropriate error code. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +static INLINE int32 +VSockVmci_ErrorToVSockError(int32 vmciError) // IN +{ + int32 err; + switch (vmciError) { + case VMCI_ERROR_NO_MEM: +#if defined(_WIN32) + err = ENOBUFS; +#else // _WIN32 + err = ENOMEM; +#endif // _WIN32 + break; + case VMCI_ERROR_DUPLICATE_ENTRY: + err = EADDRINUSE; + break; + case VMCI_ERROR_NO_RESOURCES: + err = ENOBUFS; + break; + case VMCI_ERROR_INVALID_ARGS: + case VMCI_ERROR_INVALID_RESOURCE: + default: + err = EINVAL; + } + + return sockerr2err(err); +} + + +#endif // _VSOCK_VMCI_H_ + diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vsock/Makefile /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/Makefile --- open-vm-tools-2008.01.23-74039/modules/linux/vsock/Makefile 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/Makefile 2008-10-13 08:01:40.000000000 +0100 @@ -0,0 +1,149 @@ +#!/usr/bin/make -f +########################################################## +# Copyright (C) 1998 VMware, Inc. All rights reserved. +# +# 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 version 2 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 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 +# +########################################################## + +#### +#### VMware kernel module Makefile to be distributed externally +#### + +#### +#### SRCROOT _must_ be a relative path. +#### +SRCROOT = . + +VM_UNAME = $(shell uname -r) + +# Header directory for the running kernel +HEADER_DIR = /lib/modules/$(VM_UNAME)/build/include + +BUILD_DIR = $(HEADER_DIR)/.. + +DRIVER := vsock +PRODUCT := tools-source + +# Grep program +GREP = /bin/grep + +vm_check_gcc = $(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null \ + > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi) +vm_check_file = $(shell if test -f $(1); then echo "yes"; else echo "no"; fi) + +ifndef VM_KBUILD +VM_KBUILD := no +ifeq ($(call vm_check_file,$(BUILD_DIR)/Makefile), yes) +ifneq ($(call vm_check_file,$(BUILD_DIR)/Rules.make), yes) +VM_KBUILD := 26 +endif +endif +export VM_KBUILD +endif + +ifndef VM_KBUILD_SHOWN +ifeq ($(VM_KBUILD), no) +VM_DUMMY := $(shell echo >&2 "Using standalone build system.") +else +ifeq ($(VM_KBUILD), 24) +VM_DUMMY := $(shell echo >&2 "Using 2.4.x kernel build system.") +else +VM_DUMMY := $(shell echo >&2 "Using 2.6.x kernel build system.") +endif +endif +VM_KBUILD_SHOWN := yes +export VM_KBUILD_SHOWN +endif + +ifneq ($(VM_KBUILD), no) + +VMCCVER := $(shell $(CC) -dumpversion) + +# If there is no version defined, we are in toplevel pass, not yet in kernel makefiles... +ifeq ($(VERSION),) + +ifeq ($(VM_KBUILD), 24) +DRIVER_KO := $(DRIVER).o +else +DRIVER_KO := $(DRIVER).ko +endif + +.PHONY: $(DRIVER_KO) + +auto-build: $(DRIVER_KO) + cp -f $< $(SRCROOT)/../$(DRIVER).o + +# $(DRIVER_KO) is a phony target, so compare file times explicitly +$(DRIVER): $(DRIVER_KO) + if [ $< -nt $@ ] || [ ! -e $@ ] ; then cp -f $< $@; fi + +# Pass gcc version down the chain, so we can detect if kernel attempts to use unapproved compiler +VM_CCVER := $(VMCCVER) +export VM_CCVER +VM_CC := $(CC) +export VM_CC + +MAKEOVERRIDES := $(filter-out CC=%,$(MAKEOVERRIDES)) + +$(DRIVER_KO): + make -C $(BUILD_DIR) SUBDIRS=$$PWD SRCROOT=$$PWD/$(SRCROOT) modules + +else + +ifneq ($(VM_CCVER), $(VMCCVER)) +$(warning *** Inappropriate build environment: you wanted to use gcc \ + version $(VM_CCVER) while kernel attempts to use gcc version $(VMCCVER).) +$(error For proper build you'll have to replace $(CC) with symbolic \ + link to $(VM_CC)) +endif + +endif + +vm_check_build = $(shell if $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) \ + $(CPPFLAGS) $(CFLAGS) $(CFLAGS_KERNEL) \ + $(EXTRA_CFLAGS) -Iinclude2/asm/mach-default \ + -DKBUILD_BASENAME=\"$(DRIVER)\" \ + -Werror -S -o /dev/null -xc $(1) \ + > /dev/null 2>&1; then echo "$(2)"; else echo "$(3)"; fi) + +CC_WARNINGS := -Wall -Wstrict-prototypes +CC_OPTS := $(GLOBAL_DEFS) $(CC_WARNINGS) -DVMW_USING_KBUILD +ifdef VMX86_DEVEL +CC_OPTS += -DVMX86_DEVEL +endif +ifdef VMX86_DEBUG +CC_OPTS += -DVMX86_DEBUG +endif + +include $(SRCROOT)/Makefile.kernel + +ifdef TOPDIR +ifeq ($(VM_KBUILD), 24) + +O_TARGET := $(DRIVER).o + +obj-y := $($(DRIVER)-y) + +include $(TOPDIR)/Rules.make +endif +endif + +else + +include $(SRCROOT)/Makefile.normal + +endif + +#.SILENT: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vsock/Makefile.kernel /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/Makefile.kernel --- open-vm-tools-2008.01.23-74039/modules/linux/vsock/Makefile.kernel 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/Makefile.kernel 2008-10-13 08:01:40.000000000 +0100 @@ -0,0 +1,43 @@ +#!/usr/bin/make -f +########################################################## +# Copyright (C) 2007 VMware, Inc. All rights reserved. +# +# 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 version 2 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 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 +# +########################################################## + +vm_product_defines = $(if $(findstring tools,$(1)), -DVMX86_TOOLS,) +CC_OPTS += $(call vm_product_defines, $(PRODUCT)) + +INCLUDE := -I. +INCLUDE := -I$(SRCROOT)/include +INCLUDE += -I$(SRCROOT)/linux +INCLUDE += -I$(SRCROOT)/common + +EXTRA_CFLAGS := $(CC_OPTS) $(INCLUDE) +EXTRA_CFLAGS += $(call vm_check_build, $(SRCROOT)/autoconf/epoll.c, -DVMW_HAVE_EPOLL, ) +EXTRA_CFLAGS += $(call vm_check_build, $(SRCROOT)/autoconf/setnice.c, -DVMW_HAVE_SET_USER_NICE, ) + +# This test is inverted. +EXTRA_CFLAGS += $(call vm_check_build, $(SRCROOT)/autoconf/sk_filter.c,, -DVMW_HAVE_NEW_SKFILTER ) + +obj-m += $(DRIVER).o + +$(DRIVER)-y := $(subst $(SRCROOT)/, , $(patsubst %.c, %.o, $(wildcard $(SRCROOT)/linux/*.c))) + +clean: + rm -rf $(wildcard $(DRIVER).mod.c $(DRIVER).ko .tmp_versions \ + Module.symvers Modules.symvers Module.markers modules.order \ + $(foreach dir,./ linux/ \ + ,$(addprefix $(dir),.*.cmd .*.o.flags *.o))) diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vsock/Makefile.normal /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/Makefile.normal --- open-vm-tools-2008.01.23-74039/modules/linux/vsock/Makefile.normal 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/Makefile.normal 2008-10-13 08:01:40.000000000 +0100 @@ -0,0 +1,137 @@ +#!/usr/bin/make -f +########################################################## +# Copyright (C) 2007 VMware, Inc. All rights reserved. +# +# 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 version 2 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 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 +# +########################################################## + +vm_check_build = $(shell if $(CC) $(CC_OPTS) $(INCLUDE) -Werror -S -o /dev/null -xc $(1) \ + > /dev/null 2>&1; then echo "$(2)"; else echo "$(3)"; fi) + +vm_product_defines = $(if $(findstring tools,$(1)), -DVMX86_TOOLS,) + +#### +#### DESTDIR is where the module, object files, and dependencies are built +#### +DESTDIR := driver-$(VM_UNAME) + +#### +#### DRIVERNAME should be untouched unless you have a good reason to change +#### it. The form below is how the scripts expect it. +#### +DRIVERNAME := $(DRIVER)-xxx-$(VM_UNAME) + +ifneq (,$(filter x86_64%, $(shell $(CC) -dumpmachine))) +MACHINE := x86_64 +else +MACHINE := x386 +endif + +ifdef QUIET +ECHO := @true +else +ECHO := @echo +endif + +#### +#### You must compile with at least -O level of optimization +#### or the module won't load. +#### If desparate, I think that bringing in <linux/bitops.h> might +#### suffice. +#### +CC_WARNINGS := -Wall -Wstrict-prototypes +# Don't use -pipe or egcs-2.91.66 (shipped with RedHat) will die +CC_KFLAGS := -D__KERNEL__ -fno-strength-reduce -fno-omit-frame-pointer \ + -fno-common -DKBUILD_MODNAME=$(DRIVER) +CC_KFLAGS += $(call vm_check_gcc,-falign-loops=2 -falign-jumps=2 -falign-functions=2, \ + -malign-loops=2 -malign-jumps=2 -malign-functions=2) +CC_KFLAGS += $(call vm_check_gcc,-fno-strict-aliasing,) +CC_KFLAGS += $(call vm_product_defines, $(PRODUCT)) +ifeq ($(MACHINE),x86_64) +CC_KFLAGS += -mno-red-zone -mcmodel=kernel +else +# Gcc 3.0 deprecates -m486 --hpreg +CC_KFLAGS += -DCPU=586 $(call check_gcc,-march=i586,-m486) +endif + +CC_OPTS := -O2 -DMODULE $(GLOBAL_DEFS) $(CC_KFLAGS) $(CC_WARNINGS) + +INCLUDE := -I$(SRCROOT)/include +INCLUDE += -I$(SRCROOT)/linux +INCLUDE += -I$(SRCROOT)/common +INCLUDE += -I$(HEADER_DIR) + +INCLUDE += $(shell $(CC) $(INCLUDE) -E $(SRCROOT)/autoconf/geninclude.c \ + | sed -n -e 's!^APATH!-I$(HEADER_DIR)/asm!p') + +CC_OPTS += $(call vm_check_build, $(SRCROOT)/autoconf/skas1.c, -DVMW_SKAS_MMAP, ) +CC_OPTS += $(call vm_check_build, $(SRCROOT)/autoconf/epoll.c, -DVMW_HAVE_EPOLL, ) +CC_OPTS += $(call vm_check_build, $(SRCROOT)/autoconf/setnice.c, -DVMW_HAVE_SET_USER_NICE, ) + +# This test is inverted. +CC_OPTS += $(call vm_check_build, $(SRCROOT)/autoconf/sk_filter.c,, -DVMW_HAVE_NEW_SKFILTER ) + +CC_OPTS += -DVMW_KMEMCR_HAS_DTOR + +LINUX_OBJS := af_vsock.o +LINUX_OBJS += vsockAddr.o +LINUX_OBJS += util.o +LINUX_OBJS += driverLog.o +LINUX_DEPS := ${LINUX_OBJS:.o=.d} +OBJS := $(LINUX_OBJS) + +#### +#### Make Targets are beneath here. +#### + +driver: setup deps + $(MAKE) -C $(DESTDIR) -f ../Makefile SRCROOT=../$(SRCROOT) $(DRIVERNAME) \ + INCLUDE_DEPS=1 + +setup: + @if [ -d $(DESTDIR) ] ; then true ; else mkdir $(DESTDIR); chmod 755 $(DESTDIR) ; fi + +$(DRIVER): $(DRIVERNAME) + cp -f $< $@ + +$(DRIVERNAME): $(OBJS) + $(ECHO) "Building $(DRIVERNAME)" + ld -r -o $(DRIVERNAME) $^ + +auto-build: + $(MAKE) driver QUIET=1 + cp -f $(DESTDIR)/$(DRIVERNAME) $(SRCROOT)/../$(DRIVER).o + +$(LINUX_OBJS): %.o: $(SRCROOT)/linux/%.c + $(ECHO) "Compiling $<" + $(CC) $(CC_OPTS) $(INCLUDE) -c $< + +clean: + rm -rf $(DESTDIR)/ + +$(LINUX_DEPS): %.d: $(SRCROOT)/linux/%.c + $(ECHO) "Dependencies for $<" + $(CC) -MM $(CC_OPTS) $(INCLUDE) $< > $@ + +deps: setup + $(MAKE) -C $(DESTDIR) -f ../Makefile SRCROOT=../$(SRCROOT) driver_deps + +driver_deps: ${OBJS:.o=.d} + +ifdef INCLUDE_DEPS +include ${OBJS:.o=.d} +endif + +.SILENT: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/linux/vsock/README /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/README --- open-vm-tools-2008.01.23-74039/modules/linux/vsock/README 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/linux/vsock/README 2008-10-13 08:01:40.000000000 +0100 @@ -0,0 +1,17 @@ +This files in this directory and its subdirectories are the kernel module +for the VMware VSockets module. In order to build, make certain the Makefile +is correct and then just type + + make + +from this directory. A copy of the module will be left in + + driver-<kernel version>/vsock-<kernel-version> + +(e.g. driver-up-2.4.20/vsock-up-2.4.20) for 2.4 series kernels and in + + ../vsock.o + +for 2.6 series kernels. + +If you have any problems or questions, send mail to support@vmware.com diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/Makefile.am --- open-vm-tools-2008.01.23-74039/modules/Makefile.am 2008-01-28 08:02:43.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/Makefile.am 2008-10-13 08:01:38.000000000 +0100 @@ -4,12 +4,45 @@ modules: $(MODULES) $(MODULES): - $(MAKE) -C "$(MODULES_OS)/$@" + $(MAKE) VM_UNAME=$(KERNEL_RELEASE) -C "$(MODULES_OS)/$@" -## Automake will supplement its own "distclean" and "clean" targets with these. -distclean-local: +if LINUX +export vmblockdir := $(MODULES_DIR)/fs/vmblock +export vmcidir := $(MODULES_DIR)/drivers/misc +export vmhgfsdir := $(MODULES_DIR)/fs/vmhgfs +export vmmemctldir := $(MODULES_DIR)/drivers/misc +export vmsyncdir := $(MODULES_DIR)/drivers/misc +export vmxnetdir := $(MODULES_DIR)/drivers/net +export vmxnet3dir := $(MODULES_DIR)/drivers/net +export vsockdir := $(MODULES_DIR)/net/vsock +if WITH_ROOT_PRIVILEGES +export DEPMOD := depmod -a +endif WITH_ROOT_PRIVILEGES +endif LINUX + +if FREEBSD +export vmblockdir := $(MODULES_DIR) +export vmhgfsdir := $(MODULES_DIR) +export vmmemctldir := $(MODULES_DIR) +export vmsyncdir := $(MODULES_DIR) +export vmxnetdir := $(MODULES_DIR) +endif FREEBSD + +## Automake will supplement its own "clean" targets with this. clean-local: for MOD in $(MODULES); do \ $(MAKE) -C "$(MODULES_OS)/$$MOD" clean || exit 1; \ done - rm -f $(MODULES_OS)/*.o $(MODULES_OS)/*.ko + $(RM) -f $(MODULES_OS)/*.o $(MODULES_OS)/*.ko + +install-exec-hook: + for MOD in $(MODULES); do \ + $(INSTALL) -d $(DESTDIR)`eval echo '$$'$${MOD}dir`; \ + $(INSTALL) -m644 $(MODULES_OS)/$$MOD/$$MOD.ko $(DESTDIR)`eval echo '$$'$${MOD}dir`; \ + done + eval "$$DEPMOD" +uninstall-hook: + for MOD in $(MODULES); do \ + $(RM) -f $(DESTDIR)`eval echo '$$'$${MOD}dir`/$$MOD.ko &> /dev/null; \ + done + eval "$$DEPMOD" diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/modules/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/modules/Makefile.in --- open-vm-tools-2008.01.23-74039/modules/Makefile.in 2008-01-28 08:03:06.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/modules/Makefile.in 2008-10-13 08:02:16.000000000 +0100 @@ -34,7 +34,10 @@ subdir = modules DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +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)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d @@ -52,8 +55,6 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -COMMON_CFLAGS = @COMMON_CFLAGS@ -COMMON_PROG_CFLAGS = @COMMON_PROG_CFLAGS@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -64,45 +65,57 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ -ECHO = @ECHO@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GREP = @GREP@ -GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_AUTH_CFLAGS = @LIB_AUTH_CFLAGS@ -LIB_FILE_CFLAGS = @LIB_FILE_CFLAGS@ -LIB_HGFS_SERVER_CFLAGS = @LIB_HGFS_SERVER_CFLAGS@ -LIB_IMPERSONATE_CFLAGS = @LIB_IMPERSONATE_CFLAGS@ -LIB_MISC_CFLAGS = @LIB_MISC_CFLAGS@ -LIB_PROC_MGR_CFLAGS = @LIB_PROC_MGR_CFLAGS@ -LIB_STRING_CFLAGS = @LIB_STRING_CFLAGS@ -LIB_USER_CFLAGS = @LIB_USER_CFLAGS@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -110,27 +123,35 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ VERSION = @VERSION@ -VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -161,6 +182,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -280,7 +302,7 @@ distclean: distclean-am -rm -f Makefile -distclean-am: clean-am distclean-generic distclean-local +distclean-am: clean-am distclean-generic dvi: dvi-am @@ -297,6 +319,8 @@ install-dvi: install-dvi-am install-exec-am: + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-am @@ -327,20 +351,22 @@ ps-am: uninstall-am: + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) uninstall-hook -.MAKE: install-am install-strip +.MAKE: install-am install-exec-am install-strip uninstall-am .PHONY: all all-am check check-am clean clean-generic clean-libtool \ clean-local distclean distclean-generic distclean-libtool \ - distclean-local 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-generic mostlyclean-libtool pdf pdf-am ps ps-am \ - uninstall uninstall-am + 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-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \ + ps ps-am uninstall uninstall-am uninstall-hook all: modules @@ -348,14 +374,41 @@ modules: $(MODULES) $(MODULES): - $(MAKE) -C "$(MODULES_OS)/$@" + $(MAKE) VM_UNAME=$(KERNEL_RELEASE) -C "$(MODULES_OS)/$@" + +@LINUX_TRUE@export vmblockdir := $(MODULES_DIR)/fs/vmblock +@LINUX_TRUE@export vmcidir := $(MODULES_DIR)/drivers/misc +@LINUX_TRUE@export vmhgfsdir := $(MODULES_DIR)/fs/vmhgfs +@LINUX_TRUE@export vmmemctldir := $(MODULES_DIR)/drivers/misc +@LINUX_TRUE@export vmsyncdir := $(MODULES_DIR)/drivers/misc +@LINUX_TRUE@export vmxnetdir := $(MODULES_DIR)/drivers/net +@LINUX_TRUE@export vmxnet3dir := $(MODULES_DIR)/drivers/net +@LINUX_TRUE@export vsockdir := $(MODULES_DIR)/net/vsock +@LINUX_TRUE@@WITH_ROOT_PRIVILEGES_TRUE@export DEPMOD := depmod -a + +@FREEBSD_TRUE@export vmblockdir := $(MODULES_DIR) +@FREEBSD_TRUE@export vmhgfsdir := $(MODULES_DIR) +@FREEBSD_TRUE@export vmmemctldir := $(MODULES_DIR) +@FREEBSD_TRUE@export vmsyncdir := $(MODULES_DIR) +@FREEBSD_TRUE@export vmxnetdir := $(MODULES_DIR) -distclean-local: clean-local: for MOD in $(MODULES); do \ $(MAKE) -C "$(MODULES_OS)/$$MOD" clean || exit 1; \ done - rm -f $(MODULES_OS)/*.o $(MODULES_OS)/*.ko + $(RM) -f $(MODULES_OS)/*.o $(MODULES_OS)/*.ko + +install-exec-hook: + for MOD in $(MODULES); do \ + $(INSTALL) -d $(DESTDIR)`eval echo '$$'$${MOD}dir`; \ + $(INSTALL) -m644 $(MODULES_OS)/$$MOD/$$MOD.ko $(DESTDIR)`eval echo '$$'$${MOD}dir`; \ + done + eval "$$DEPMOD" +uninstall-hook: + for MOD in $(MODULES); do \ + $(RM) -f $(DESTDIR)`eval echo '$$'$${MOD}dir`/$$MOD.ko &> /dev/null; \ + done + eval "$$DEPMOD" # 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: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/NEWS /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/NEWS --- open-vm-tools-2008.01.23-74039/NEWS 2008-01-28 08:02:43.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/NEWS 2008-10-13 08:01:38.000000000 +0100 @@ -1,3 +1,170 @@ +open-vm-tools 2009.10.13 changes: + * The vmxnet3 Linux kernel module has been added. This module provides + better network performance for the guest. The corresponding virtual + hardware is available beginning with Workstation 6.5, though + performance benefits are unlikely to be realized until a later VMware + product release. The module should work for all kernels beginning with + 2.6. + + * The open-vm-tools no longer depend on libproc-dev. Several people + reported this issue (Sourceforge bug 1960947). + + * Added a command line argument to skip privileged operations during + make install (--without-root-privileges). + + * Guestd now supports backwards time synchronization, though the + corresponding hypervisor-side changes are not yet part of any shipping + VMware products. + + * Assortment of bug fixes. + +open-vm-tools 2009.09.03 changes: + * Fixed an issue where open-vm-tools fails to configure when using + --without-icu. Thanks to Timo Gurr for reporting the issue (Sourceforge + bug 2046262). + + * Fixed failed build on Ubuntu Intrepid and Fedora 9. Thanks to Nathan + Charles for reporting the issue (Sourceforge bug 2048423). + + * Fixed kernel module build issues on 2.6.27 pre-release kernels. + Thanks to Dominique Leuenberger for reporting the issue (Sourceforge + bug 2071170). + + * ...and other bug fixes. + +open-vm-tools 2008.08.08 changes: + * Unity for X11 guests has been added. Unity is implemented within + vmware-user and requires no additional setup beyond setting up the + vmware-user application itself. Unity should work with Fusion 1.x + releases as well as with the upcoming Workstation 6.5 release. Our + in-house testing was with Linux guests, and they should mostly work. + There is very little standing in the way of FreeBSD/Solaris support, + though we've never built or tested Unity for those platforms. + + * The VMCI Linux kernel module has been added. This module provides + high-speed datagram and socket interfaces for guest<->guest and + host<->guest communication. It should work for all kernels beginning + with 2.4, and for VMware products beginning with Workstation 6.5. + + * The VMCI sockets Linux kernel module has been added. It provides + both datagram and stream socket interfaces to userlevel for use with + VMCI. As with VMCI, it should work for kernels 2.4 or later, and for + VMware products beginning with Workstation 6.5. + + * The command-line Toolbox has been added. This application provides + the same functionality as the GTK Toolbox, but with a scriptable + command-line interface. It also has some statistic retrieval commands + that aren't found in the GTK Toolbox. + + * Fixed compilation of vmsync and vmmemctl Linux kernel modules on + 2.6.26. Thanks to Pavol Rusnak for the report (Sourceforge bug 2032683). + + * Fixed an issue with guestd's nicInfo updating mechanism. Thanks to + Jason Lunz for the patch (not tracked on Sourceforge). + + * Fixed handling of $(DESTDIR) in automake. Thanks to Mike Auty for + the patch (Sourceforge bug 2018802). + + * Fixed build of vmware-user using gtk 1.2. Thanks to Stephen Duncan + for the report (Sourceforge bug 2014338). + + * Fixed compilation of lib/guestApp when using --without-x. Thanks to + Martin Preishuber for the report (Sourceforge bug 2013568). + + * As usual, other bug fixes. + +open-vm-tools 2008.07.01 changes: + * Fixed a backwards time synchronization issue (not tracked on + Sourceforge). Thanks to Eric Castan for reporting it. + + * Fixed an issue where open-vm-tools configured via --without-x didn't + compile (not tracked on Sourceforge). Thanks to Mark Foster for + reporting the bug. + + * Other bug fixes. + +open-vm-tools 2008.06.20 changes: + * Fixed Sourceforge bug 1847750 (FreeBSD 7 & 8 builds) and Sourceforge + bug 1981632 (build failure on Solaris). This should get open-vm-tools + building and running on FreeBSD 7 & 8 and Solaris. Thanks to Martin + Blapp for all the FreeBSD patches, and Jonathan Keatley for reporting + the Solaris bug. + + * Fixed Sourceforge bug 1968416 (packet counting in FreeBSD vmxnet). + Thanks to Shunsuke SHINOMIYA for reporting this bug. + + * Fixed Sourceforge bug 1983375 (Cannot specify kernel constraints). + You can now pass --without-kernel-modules, --with-kernel-release, and + --with-linuxdir to the ./configure script. Thanks to Craig Phillips for + reporting this bug. + + * Other bug fixes. + +open-vm-tools 2008.06.03 changes: + * Added the vmware-user-suid-wrapper application, with implementations + for Linux, FreeBSD, and Solaris. This app is needed to make correct use + of vmware-user with the vmblock kernel module. It should have been in + the previous code refresh, but we accidentally overlooked it. + + * Fixed Sourceforge bug 1924246: vmhgfs on Linux properly reports the + available space on the host. Thanks to Mikhail Krivtsov for reporting + the bug. + + * Fixed Sourceforge bug 1839981: we now have rudimentary `make install` + support. On any platform, it should copy files and kernel modules to + the location specified at build-time, and on Linux, it will additionally + run `depmod -a` to make the kernel modules accessible to modprobe. This + change also adds a "--with-pam-prefix" argument to the configure + script, which controls the location of guestd's pam files. + + * Other bug fixes. + +open-vm-tools 2008.05.15 changes: + * guestd no longer starts vmware-user. Packagers will need to use + the XDG autostart spec, Xsession drop-in scripts, or other appropriate + mechanisms to make sure that vmware-user is started as part of + X session initialization. Please see + http://open-vm-tools.wiki.sourceforge.net/Packaging for more details. + + * Bug fixes as usual. + +open-vm-tools 2008.05.02 changes: + * Continued Unicode support. + + * open-vm-tools now depends on libicu for codeset conversions. If you + wish to build open-vm-tools without libicu, pass "--without--icu" when + configuring the package. Without libicu, codeset conversions will be + done as before, via calls to iconv. + + * A few more bug fixes. + +open-vm-tools 2008.04.14 changes: + * Update the license stamp on all LGPL files. + + * Continued Unicode support. + + * Handle libdumbnet on Debian. + + * More bug fixes, including a security fix in guestd. + +open-vm-tools 2008.03.19 changes: + * Continued Unicode support. + + * A few bug fixes. + +open-vm-tools 2008.03.03 changes: + * Bug fixes (including the ability to specify custom LDFLAGS + at build time, thanks to Mike Auty). + + * First cut of HGFSv3 implementation. + + * Beginnings of DnDv3 implementation. + + * Add Unicode support all over the code base. + +open-vm-tools 2008.02.13 changes: + * Some bug fixes. + open-vm-tools 2008.01.23 changes: * The Linux HGFS kernel module now supports writeback caching, which diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/scripts/common/vm-support /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/scripts/common/vm-support --- open-vm-tools-2008.01.23-74039/scripts/common/vm-support 2008-01-28 08:02:54.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/scripts/common/vm-support 2008-10-13 08:01:55.000000000 +0100 @@ -1,6 +1,6 @@ #!/bin/bash ########################################################## -# Copyright (C) 2006 VMware, Inc. All rights reserved. +# Copyright (C) 2006-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 @@ -8,11 +8,11 @@ # # 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. +# 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 General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., +# 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. # ########################################################## diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/scripts/common/vmware-toolbox.desktop /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/scripts/common/vmware-toolbox.desktop --- open-vm-tools-2008.01.23-74039/scripts/common/vmware-toolbox.desktop 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/scripts/common/vmware-toolbox.desktop 2008-10-13 08:01:55.000000000 +0100 @@ -0,0 +1,10 @@ +[Desktop Entry] +Encoding=UTF-8 +Name=VMware Toolbox +Comment=VMware Guest Toolbox utility +# have to use the full path here otherwise help won't work +Exec=/usr/lib/vmware-tools/bin/vmware-toolbox +Icon=vmware-toolbox +Terminal=false +Type=Application +Categories=Application;Utility; diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/scripts/common/vmware-user.desktop /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/scripts/common/vmware-user.desktop --- open-vm-tools-2008.01.23-74039/scripts/common/vmware-user.desktop 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/scripts/common/vmware-user.desktop 2008-10-13 08:01:55.000000000 +0100 @@ -0,0 +1,6 @@ +[Desktop Entry] +Encoding=UTF-8 +Exec=vmware-user-suid-wrapper +Name=VMware User Agent +X-KDE-autostart-phase=1 +NoDisplay=true diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/scripts/freebsd/poweroff-vm-default /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/scripts/freebsd/poweroff-vm-default --- open-vm-tools-2008.01.23-74039/scripts/freebsd/poweroff-vm-default 2008-01-28 08:02:54.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/scripts/freebsd/poweroff-vm-default 2008-10-13 08:01:55.000000000 +0100 @@ -1,6 +1,6 @@ #!/bin/sh ########################################################## -# Copyright (C) 2004 VMware, Inc. All rights reserved. +# Copyright (C) 2004-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 @@ -8,11 +8,11 @@ # # 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. +# 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 General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., +# 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. # ########################################################## diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/scripts/freebsd/poweron-vm-default /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/scripts/freebsd/poweron-vm-default --- open-vm-tools-2008.01.23-74039/scripts/freebsd/poweron-vm-default 2008-01-28 08:02:54.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/scripts/freebsd/poweron-vm-default 2008-10-13 08:01:55.000000000 +0100 @@ -1,6 +1,6 @@ #!/bin/sh ########################################################## -# Copyright (C) 2004 VMware, Inc. All rights reserved. +# Copyright (C) 2004-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 @@ -8,11 +8,11 @@ # # 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. +# 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 General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., +# 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. # ########################################################## diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/scripts/freebsd/resume-vm-default /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/scripts/freebsd/resume-vm-default --- open-vm-tools-2008.01.23-74039/scripts/freebsd/resume-vm-default 2008-01-28 08:02:54.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/scripts/freebsd/resume-vm-default 2008-10-13 08:01:55.000000000 +0100 @@ -1,6 +1,6 @@ #!/bin/sh ########################################################## -# Copyright (C) 2004 VMware, Inc. All rights reserved. +# Copyright (C) 2004-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 @@ -8,11 +8,11 @@ # # 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. +# 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 General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., +# 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. # ########################################################## diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/scripts/freebsd/suspend-vm-default /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/scripts/freebsd/suspend-vm-default --- open-vm-tools-2008.01.23-74039/scripts/freebsd/suspend-vm-default 2008-01-28 08:02:54.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/scripts/freebsd/suspend-vm-default 2008-10-13 08:01:55.000000000 +0100 @@ -1,6 +1,6 @@ #!/bin/sh ########################################################## -# Copyright (C) 2004 VMware, Inc. All rights reserved. +# Copyright (C) 2004-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 @@ -8,11 +8,11 @@ # # 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. +# 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 General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., +# 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. # ########################################################## diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/scripts/linux/pam.d/vmware-guestd /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/scripts/linux/pam.d/vmware-guestd --- open-vm-tools-2008.01.23-74039/scripts/linux/pam.d/vmware-guestd 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/scripts/linux/pam.d/vmware-guestd 2008-10-13 08:01:55.000000000 +0100 @@ -0,0 +1,5 @@ +#%PAM-1.0 +auth sufficient /lib/security/pam_unix2.so shadow nullok +auth required /lib/security/pam_unix_auth.so shadow nullok +account sufficient /lib/security/pam_unix2.so +account required /lib/security/pam_unix_acct.so diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/scripts/linux/pam.d/vmware-guestd-x64 /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/scripts/linux/pam.d/vmware-guestd-x64 --- open-vm-tools-2008.01.23-74039/scripts/linux/pam.d/vmware-guestd-x64 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/scripts/linux/pam.d/vmware-guestd-x64 2008-10-13 08:01:55.000000000 +0100 @@ -0,0 +1,5 @@ +#%PAM-1.0 +auth sufficient /lib64/security/pam_unix2.so shadow nullok +auth required /lib64/security/pam_unix_auth.so shadow nullok +account sufficient /lib64/security/pam_unix2.so +account required /lib64/security/pam_unix_acct.so diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/scripts/linux/poweroff-vm-default /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/scripts/linux/poweroff-vm-default --- open-vm-tools-2008.01.23-74039/scripts/linux/poweroff-vm-default 2008-01-28 08:02:54.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/scripts/linux/poweroff-vm-default 2008-10-13 08:01:55.000000000 +0100 @@ -1,6 +1,6 @@ #!/bin/sh ########################################################## -# Copyright (C) 2001 VMware, Inc. All rights reserved. +# Copyright (C) 2001-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 @@ -8,11 +8,11 @@ # # 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. +# 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 General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., +# 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. # ########################################################## diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/scripts/linux/poweron-vm-default /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/scripts/linux/poweron-vm-default --- open-vm-tools-2008.01.23-74039/scripts/linux/poweron-vm-default 2008-01-28 08:02:54.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/scripts/linux/poweron-vm-default 2008-10-13 08:01:55.000000000 +0100 @@ -1,6 +1,6 @@ #!/bin/sh ########################################################## -# Copyright (C) 2001 VMware, Inc. All rights reserved. +# Copyright (C) 2001-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 @@ -8,11 +8,11 @@ # # 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. +# 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 General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., +# 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. # ########################################################## diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/scripts/linux/resume-vm-default /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/scripts/linux/resume-vm-default --- open-vm-tools-2008.01.23-74039/scripts/linux/resume-vm-default 2008-01-28 08:02:54.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/scripts/linux/resume-vm-default 2008-10-13 08:01:55.000000000 +0100 @@ -1,6 +1,6 @@ #!/bin/sh ########################################################## -# Copyright (C) 2001 VMware, Inc. All rights reserved. +# Copyright (C) 2001-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 @@ -8,11 +8,11 @@ # # 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. +# 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 General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., +# 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. # ########################################################## diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/scripts/linux/suspend-vm-default /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/scripts/linux/suspend-vm-default --- open-vm-tools-2008.01.23-74039/scripts/linux/suspend-vm-default 2008-01-28 08:02:54.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/scripts/linux/suspend-vm-default 2008-10-13 08:01:55.000000000 +0100 @@ -1,6 +1,6 @@ #!/bin/sh ########################################################## -# Copyright (C) 2001 VMware, Inc. All rights reserved. +# Copyright (C) 2001-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 @@ -8,11 +8,11 @@ # # 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. +# 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 General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., +# 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. # ########################################################## diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/scripts/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/scripts/Makefile.am --- open-vm-tools-2008.01.23-74039/scripts/Makefile.am 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/scripts/Makefile.am 2008-10-13 08:01:55.000000000 +0100 @@ -0,0 +1,7 @@ +confdir = /etc/vmware-tools + +conf_SCRIPTS = ./common/vm-support +conf_SCRIPTS += $(MODULES_OS)/poweron-vm-default +conf_SCRIPTS += $(MODULES_OS)/poweroff-vm-default +conf_SCRIPTS += $(MODULES_OS)/suspend-vm-default +conf_SCRIPTS += $(MODULES_OS)/resume-vm-default diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/scripts/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/scripts/Makefile.in --- open-vm-tools-2008.01.23-74039/scripts/Makefile.in 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/scripts/Makefile.in 2008-10-13 08:02:16.000000000 +0100 @@ -0,0 +1,400 @@ +# 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@ + +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 = scripts +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)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(install_sh) -d +CONFIG_CLEAN_FILES = +am__installdirs = "$(DESTDIR)$(confdir)" +confSCRIPT_INSTALL = $(INSTALL_SCRIPT) +SCRIPTS = $(conf_SCRIPTS) +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_XLIBS = @COMMON_XLIBS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ +DNET_LIBS = @DNET_LIBS@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ +GTK_LIBS = @GTK_LIBS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ +HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ +MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ +RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ +VERSION = @VERSION@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +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@ +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@ +lt_ECHO = @lt_ECHO@ +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@ +confdir = /etc/vmware-tools +conf_SCRIPTS = ./common/vm-support $(MODULES_OS)/poweron-vm-default \ + $(MODULES_OS)/poweroff-vm-default \ + $(MODULES_OS)/suspend-vm-default \ + $(MODULES_OS)/resume-vm-default +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 scripts/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu scripts/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(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-confSCRIPTS: $(conf_SCRIPTS) + @$(NORMAL_INSTALL) + test -z "$(confdir)" || $(MKDIR_P) "$(DESTDIR)$(confdir)" + @list='$(conf_SCRIPTS)'; for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + if test -f $$d$$p; then \ + f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ + echo " $(confSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(confdir)/$$f'"; \ + $(confSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(confdir)/$$f"; \ + else :; fi; \ + done + +uninstall-confSCRIPTS: + @$(NORMAL_UNINSTALL) + @list='$(conf_SCRIPTS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \ + echo " rm -f '$(DESTDIR)$(confdir)/$$f'"; \ + rm -f "$(DESTDIR)$(confdir)/$$f"; \ + done + +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 $(SCRIPTS) +installdirs: + for dir in "$(DESTDIR)$(confdir)"; 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 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-confSCRIPTS + +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: uninstall-confSCRIPTS + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic clean-libtool \ + distclean distclean-generic distclean-libtool distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-confSCRIPTS 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-generic mostlyclean-libtool pdf pdf-am ps ps-am \ + uninstall uninstall-am uninstall-confSCRIPTS + +# 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: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/scripts/solaris/poweroff-vm-default /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/scripts/solaris/poweroff-vm-default --- open-vm-tools-2008.01.23-74039/scripts/solaris/poweroff-vm-default 2008-01-28 08:02:54.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/scripts/solaris/poweroff-vm-default 2008-10-13 08:01:55.000000000 +0100 @@ -1,6 +1,6 @@ #!/bin/sh ########################################################## -# Copyright (C) 2006 VMware, Inc. All rights reserved. +# Copyright (C) 2006-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 @@ -8,11 +8,11 @@ # # 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. +# 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 General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., +# 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. # ########################################################## diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/scripts/solaris/poweron-vm-default /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/scripts/solaris/poweron-vm-default --- open-vm-tools-2008.01.23-74039/scripts/solaris/poweron-vm-default 2008-01-28 08:02:54.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/scripts/solaris/poweron-vm-default 2008-10-13 08:01:55.000000000 +0100 @@ -1,6 +1,6 @@ #!/bin/sh ########################################################## -# Copyright (C) 2006 VMware, Inc. All rights reserved. +# Copyright (C) 2006-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 @@ -8,11 +8,11 @@ # # 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. +# 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 General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., +# 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. # ########################################################## diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/scripts/solaris/resume-vm-default /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/scripts/solaris/resume-vm-default --- open-vm-tools-2008.01.23-74039/scripts/solaris/resume-vm-default 2008-01-28 08:02:54.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/scripts/solaris/resume-vm-default 2008-10-13 08:01:55.000000000 +0100 @@ -1,6 +1,6 @@ #!/bin/sh ########################################################## -# Copyright (C) 2006 VMware, Inc. All rights reserved. +# Copyright (C) 2006-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 @@ -8,11 +8,11 @@ # # 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. +# 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 General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., +# 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. # ########################################################## diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/scripts/solaris/suspend-vm-default /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/scripts/solaris/suspend-vm-default --- open-vm-tools-2008.01.23-74039/scripts/solaris/suspend-vm-default 2008-01-28 08:02:54.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/scripts/solaris/suspend-vm-default 2008-10-13 08:01:55.000000000 +0100 @@ -1,6 +1,6 @@ #!/bin/sh ########################################################## -# Copyright (C) 2006 VMware, Inc. All rights reserved. +# Copyright (C) 2006-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 @@ -8,11 +8,11 @@ # # 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. +# 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 General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., +# 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. # ########################################################## diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/toolbox/debugStdio.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/toolbox/debugStdio.c --- open-vm-tools-2008.01.23-74039/toolbox/debugStdio.c 2008-01-28 08:02:54.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/toolbox/debugStdio.c 2008-10-13 08:01:54.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -24,11 +24,6 @@ * */ -#ifndef VMX86_DEVEL - -#endif - - #include <stdlib.h> #include <stdio.h> #include <stdarg.h> @@ -48,7 +43,7 @@ #include "fileIO.h" #include "file.h" #include "system.h" - +#include "unicode.h" static char debugFile[FILE_MAXPATH] = {0}; static Bool debugEnabled = FALSE; @@ -168,40 +163,51 @@ { #ifndef _CONSOLE FileIOResult fr; - FileIODescriptor *fd; + FileIODescriptor fd; size_t bytesWritten; - char *str2; - + Unicode timePrefix; + const char *timePrefixUtf8; + char debugFileShadow; + ASSERT(debugFile[0] != 0); - - fd = (FileIODescriptor *) malloc(sizeof(FileIODescriptor)); - ASSERT_NOT_IMPLEMENTED(fd); - FileIO_Invalidate(fd); - - fr = FileIO_Open(fd, debugFile, FILEIO_OPEN_ACCESS_WRITE, FILEIO_OPEN_CREATE); + + FileIO_Invalidate(&fd); + + fr = FileIO_Open(&fd, debugFile, FILEIO_OPEN_ACCESS_WRITE, + FILEIO_OPEN_CREATE); + debugFileShadow = debugFile[0]; + debugFile[0] = '\0'; if (fr != FILEIO_SUCCESS) { Warning("---Error opening file '%s'.\n", debugFile); - debugFile[0] = '\0'; - goto done; } - FileIO_Seek(fd, 0, FILEIO_SEEK_END); + /* + * XXX: Writing the date/time prefix in UTF-8 and the rest of the string in + * an unspecified encoding is rather broken, but it'll have to do until the + * rest of the Tools are made internationalization-safe. + */ + timePrefix = System_GetTimeAsString(); + if (timePrefix == NULL) { + Warning("---Error getting formatted time string.\n"); + goto close; + } + timePrefixUtf8 = UTF8(timePrefix); + ASSERT(timePrefixUtf8); - str2 = Str_Asprintf(NULL, "(%"FMT64"u) ", System_Uptime()); - fr = FileIO_Write(fd, str2, strlen(str2), &bytesWritten); - fr = FileIO_Write(fd, str, strlen(str), &bytesWritten); - free(str2); + FileIO_Seek(&fd, 0, FILEIO_SEEK_END); + fr = FileIO_Write(&fd, timePrefixUtf8, strlen(timePrefixUtf8), &bytesWritten); + fr = FileIO_Write(&fd, str, strlen(str), &bytesWritten); + Unicode_Free(timePrefix); if (fr != FILEIO_SUCCESS) { Warning("---Error writing to file '%s'.\n", debugFile); - goto close; } close: - FileIO_Close(fd); - + FileIO_Close(&fd); + done: - free(fd); + debugFile[0] = debugFileShadow; return; #endif // _CONSOLE } @@ -249,7 +255,7 @@ OutputDebugString(str); #endif #if !defined(_WIN32) || defined(_CONSOLE) - fprintf(stderr, str); + fputs(str, stderr); #endif #endif if (debugFile[0] != '\0') { diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/toolbox/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/toolbox/Makefile.am --- open-vm-tools-2008.01.23-74039/toolbox/Makefile.am 2008-01-28 08:02:54.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/toolbox/Makefile.am 2008-10-13 08:01:54.000000000 +0100 @@ -15,52 +15,106 @@ ### Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ -noinst_PROGRAMS = toolbox - -AM_CFLAGS = -AM_CFLAGS += @GTK_CFLAGS@ -AM_CFLAGS += @COMMON_CFLAGS@ - -toolbox_LDADD = -toolbox_LDADD += ../lib/conf/libConf.a -toolbox_LDADD += ../lib/eventManager/libEventManager.a -toolbox_LDADD += ../lib/file/libFile.a -toolbox_LDADD += ../lib/guestApp/libGuestApp.a -toolbox_LDADD += ../lib/hgfs/libHgfs.a -toolbox_LDADD += ../lib/procMgr/libProcMgr.a -toolbox_LDADD += ../lib/rpcIn/libRpcIn.a -toolbox_LDADD += ../lib/rpcOut/libRpcOut.a -toolbox_LDADD += ../lib/strUtil/libStrUtil.a -toolbox_LDADD += ../lib/string/libString.a -toolbox_LDADD += ../lib/system/libSystem.a -toolbox_LDADD += ../lib/user/libUser.a -toolbox_LDADD += ../lib/vmCheck/libVmCheck.a -toolbox_LDADD += ../lib/vmSignal/libVmSignal.a -toolbox_LDADD += ../lib/wiper/libWiper.a +COMMON = +COMMON += ../lib/conf/libConf.a +COMMON += ../lib/eventManager/libEventManager.a +COMMON += ../lib/file/libFile.a +COMMON += ../lib/hgfs/libHgfs.a +COMMON += ../lib/procMgr/libProcMgr.a +COMMON += ../lib/rpcIn/libRpcIn.a +COMMON += ../lib/rpcOut/libRpcOut.a +COMMON += ../lib/string/libString.a +COMMON += ../lib/system/libSystem.a +COMMON += ../lib/user/libUser.a +COMMON += ../lib/vmCheck/libVmCheck.a +COMMON += ../lib/vmSignal/libVmSignal.a +COMMON += ../lib/wiper/libWiper.a # In the absence of the linker options --start-group and --end-group (which # can't be put in LDADD), we need to bring the following libraries out of # the alphabetical order so their symbols are properly resolved. -toolbox_LDADD += ../lib/err/libErr.a -toolbox_LDADD += ../lib/backdoor/libBackdoor.a -toolbox_LDADD += ../lib/dict/libDict.a -toolbox_LDADD += ../lib/atomic/libAtomic.a -toolbox_LDADD += ../lib/message/libMessage.a -toolbox_LDADD += ../lib/unicode/libUnicode.a -toolbox_LDADD += ../lib/sync/libSync.a -toolbox_LDADD += ../lib/misc/libMisc.a -toolbox_LDADD += ../lib/panicDefault/libPanicDefault.a -toolbox_LDADD += ../lib/panic/libPanic.a - -toolbox_LDFLAGS = -toolbox_LDFLAGS += -lX11 -toolbox_LDFLAGS += @GTK_LIBS@ - -toolbox_SOURCES = -toolbox_SOURCES += debugStdio.c -toolbox_SOURCES += stub.c -toolbox_SOURCES += toolbox-gtk.c -toolbox_SOURCES += toolboxAbout.c -toolbox_SOURCES += toolboxDevices.c -toolbox_SOURCES += toolboxOptions.c -toolbox_SOURCES += toolboxScripts.c -toolbox_SOURCES += toolboxShrink.c +COMMON += ../lib/err/libErr.a +COMMON += ../lib/backdoor/libBackdoor.a +COMMON += ../lib/dict/libDict.a +COMMON += ../lib/message/libMessage.a +COMMON += ../lib/unicode/libUnicode.a +COMMON += ../lib/sync/libSync.a +COMMON += ../lib/misc/libMisc.a +COMMON += ../lib/panicDefault/libPanicDefault.a +COMMON += ../lib/panic/libPanic.a +COMMON += ../lib/stubs/libStubs.a + +bin_PROGRAMS = +if HAVE_X11 + bin_PROGRAMS += vmware-toolbox + + AM_CFLAGS = @GTK_CPPFLAGS@ + vmware_toolbox_LDADD = + vmware_toolbox_LDADD += ../lib/guestApp/libGuestAppX11.a + vmware_toolbox_LDADD += $(COMMON) + + vmware_toolbox_LDADD += @COMMON_XLIBS@ + vmware_toolbox_LDADD += @GTK_LIBS@ + + vmware_toolbox_SOURCES = + vmware_toolbox_SOURCES += debugStdio.c + vmware_toolbox_SOURCES += toolbox-gtk.c + vmware_toolbox_SOURCES += toolboxAbout.c + vmware_toolbox_SOURCES += toolboxDevices.c + vmware_toolbox_SOURCES += toolboxOptions.c + vmware_toolbox_SOURCES += toolboxScripts.c + vmware_toolbox_SOURCES += toolboxShrink.c + vmware_toolbox_SOURCES += toolboxRecord.c + +# Here's something wacky: automake will muck up the translation of this +# conditional if it is indented. For more details, see: +# http://osdir.com/ml/sysutils.automake.general/2002-10/msg00064.html +if HAVE_ICU + vmware_toolbox_LDADD += @ICU_LIBS@ + vmware_toolbox_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CXX) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +else + vmware_toolbox_LINK = $(LINK) +endif + + install-exec-hook: + $(INSTALL) -d $(DESTDIR)$(datadir)/applications/ + $(INSTALL) -m 644 ../scripts/common/vmware-toolbox.desktop \ + $(DESTDIR)$(datadir)/applications/ + $(SED) -i s/Exec=.*/Exec=vmware-toolbox/ \ + $(DESTDIR)$(datadir)/applications/vmware-toolbox.desktop + $(INSTALL) -d $(DESTDIR)/usr/share/pixmaps/vmware + $(INSTALL) -m 644 bigIcon.xpm \ + $(DESTDIR)/usr/share/pixmaps/vmware/vmware-toolbox.xpm + uninstall-hook: + -$(RM) -f $(DESTDIR)$(datadir)/share/applications/vmware-toolbox.desktop + -$(RM) -rf $(DESTDIR)/usr/share/pixmaps/vmware +endif + +bin_PROGRAMS += vmware-toolbox-cmd + +vmware_toolbox_cmd_LDADD = +vmware_toolbox_cmd_LDADD += ../libguestlib/libguestlib.la +vmware_toolbox_cmd_LDADD += ../lib/guestInfo/libGuestInfo.a +vmware_toolbox_cmd_LDADD += ../lib/guestApp/libGuestApp.a +vmware_toolbox_cmd_LDADD += $(COMMON) + +vmware_toolbox_cmd_SOURCES = +vmware_toolbox_cmd_SOURCES += debugStdio.c +vmware_toolbox_cmd_SOURCES += toolbox-cmd.c +vmware_toolbox_cmd_SOURCES += toolboxcmd-devices.c +vmware_toolbox_cmd_SOURCES += toolboxcmd-scripts.c +vmware_toolbox_cmd_SOURCES += toolboxcmd-shrink.c +vmware_toolbox_cmd_SOURCES += toolboxcmd-stat.c +vmware_toolbox_cmd_SOURCES += toolboxcmd-time.c +vmware_toolbox_cmd_SOURCES += toolboxcmd-record.c + +if HAVE_ICU + vmware_toolbox_cmd_LDADD += @ICU_LIBS@ + vmware_toolbox_cmd_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CXX) \ + $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ + $(LDFLAGS) -o $@ +else + vmware_toolbox_cmd_LINK = $(LINK) +endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/toolbox/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/toolbox/Makefile.in --- open-vm-tools-2008.01.23-74039/toolbox/Makefile.in 2008-01-28 08:03:06.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/toolbox/Makefile.in 2008-10-13 08:02:17.000000000 +0100 @@ -49,39 +49,54 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -noinst_PROGRAMS = toolbox$(EXEEXT) +bin_PROGRAMS = $(am__EXEEXT_1) vmware-toolbox-cmd$(EXEEXT) +@HAVE_X11_TRUE@am__append_1 = vmware-toolbox + +# Here's something wacky: automake will muck up the translation of this +# conditional if it is indented. For more details, see: +# http://osdir.com/ml/sysutils.automake.general/2002-10/msg00064.html +@HAVE_ICU_TRUE@@HAVE_X11_TRUE@am__append_2 = @ICU_LIBS@ +@HAVE_ICU_TRUE@am__append_3 = @ICU_LIBS@ subdir = toolbox DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in COPYING ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +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)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = -PROGRAMS = $(noinst_PROGRAMS) -am_toolbox_OBJECTS = debugStdio.$(OBJEXT) stub.$(OBJEXT) \ - toolbox-gtk.$(OBJEXT) toolboxAbout.$(OBJEXT) \ - toolboxDevices.$(OBJEXT) toolboxOptions.$(OBJEXT) \ - toolboxScripts.$(OBJEXT) toolboxShrink.$(OBJEXT) -toolbox_OBJECTS = $(am_toolbox_OBJECTS) -toolbox_DEPENDENCIES = ../lib/conf/libConf.a \ - ../lib/eventManager/libEventManager.a ../lib/file/libFile.a \ - ../lib/guestApp/libGuestApp.a ../lib/hgfs/libHgfs.a \ - ../lib/procMgr/libProcMgr.a ../lib/rpcIn/libRpcIn.a \ - ../lib/rpcOut/libRpcOut.a ../lib/strUtil/libStrUtil.a \ - ../lib/string/libString.a ../lib/system/libSystem.a \ - ../lib/user/libUser.a ../lib/vmCheck/libVmCheck.a \ - ../lib/vmSignal/libVmSignal.a ../lib/wiper/libWiper.a \ - ../lib/err/libErr.a ../lib/backdoor/libBackdoor.a \ - ../lib/dict/libDict.a ../lib/atomic/libAtomic.a \ - ../lib/message/libMessage.a ../lib/unicode/libUnicode.a \ - ../lib/sync/libSync.a ../lib/misc/libMisc.a \ - ../lib/panicDefault/libPanicDefault.a ../lib/panic/libPanic.a -toolbox_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ - --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(toolbox_LDFLAGS) \ - $(LDFLAGS) -o $@ +@HAVE_X11_TRUE@am__EXEEXT_1 = vmware-toolbox$(EXEEXT) +am__installdirs = "$(DESTDIR)$(bindir)" +binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +PROGRAMS = $(bin_PROGRAMS) +am__vmware_toolbox_SOURCES_DIST = debugStdio.c toolbox-gtk.c \ + toolboxAbout.c toolboxDevices.c toolboxOptions.c \ + toolboxScripts.c toolboxShrink.c toolboxRecord.c +@HAVE_X11_TRUE@am_vmware_toolbox_OBJECTS = debugStdio.$(OBJEXT) \ +@HAVE_X11_TRUE@ toolbox-gtk.$(OBJEXT) toolboxAbout.$(OBJEXT) \ +@HAVE_X11_TRUE@ toolboxDevices.$(OBJEXT) \ +@HAVE_X11_TRUE@ toolboxOptions.$(OBJEXT) \ +@HAVE_X11_TRUE@ toolboxScripts.$(OBJEXT) \ +@HAVE_X11_TRUE@ toolboxShrink.$(OBJEXT) toolboxRecord.$(OBJEXT) +vmware_toolbox_OBJECTS = $(am_vmware_toolbox_OBJECTS) +am__DEPENDENCIES_1 = +@HAVE_X11_TRUE@vmware_toolbox_DEPENDENCIES = \ +@HAVE_X11_TRUE@ ../lib/guestApp/libGuestAppX11.a $(COMMON) \ +@HAVE_X11_TRUE@ $(am__DEPENDENCIES_1) +am_vmware_toolbox_cmd_OBJECTS = debugStdio.$(OBJEXT) \ + toolbox-cmd.$(OBJEXT) toolboxcmd-devices.$(OBJEXT) \ + toolboxcmd-scripts.$(OBJEXT) toolboxcmd-shrink.$(OBJEXT) \ + toolboxcmd-stat.$(OBJEXT) toolboxcmd-time.$(OBJEXT) \ + toolboxcmd-record.$(OBJEXT) +vmware_toolbox_cmd_OBJECTS = $(am_vmware_toolbox_cmd_OBJECTS) +vmware_toolbox_cmd_DEPENDENCIES = ../libguestlib/libguestlib.la \ + ../lib/guestInfo/libGuestInfo.a ../lib/guestApp/libGuestApp.a \ + $(COMMON) $(am__DEPENDENCIES_1) DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp +depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -92,8 +107,9 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ -SOURCES = $(toolbox_SOURCES) -DIST_SOURCES = $(toolbox_SOURCES) +SOURCES = $(vmware_toolbox_SOURCES) $(vmware_toolbox_cmd_SOURCES) +DIST_SOURCES = $(am__vmware_toolbox_SOURCES_DIST) \ + $(vmware_toolbox_cmd_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -107,8 +123,6 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -COMMON_CFLAGS = @COMMON_CFLAGS@ -COMMON_PROG_CFLAGS = @COMMON_PROG_CFLAGS@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -119,45 +133,57 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ -ECHO = @ECHO@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GREP = @GREP@ -GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_AUTH_CFLAGS = @LIB_AUTH_CFLAGS@ -LIB_FILE_CFLAGS = @LIB_FILE_CFLAGS@ -LIB_HGFS_SERVER_CFLAGS = @LIB_HGFS_SERVER_CFLAGS@ -LIB_IMPERSONATE_CFLAGS = @LIB_IMPERSONATE_CFLAGS@ -LIB_MISC_CFLAGS = @LIB_MISC_CFLAGS@ -LIB_PROC_MGR_CFLAGS = @LIB_PROC_MGR_CFLAGS@ -LIB_STRING_CFLAGS = @LIB_STRING_CFLAGS@ -LIB_USER_CFLAGS = @LIB_USER_CFLAGS@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -165,27 +191,35 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ VERSION = @VERSION@ -VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -216,6 +250,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -230,27 +265,46 @@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -AM_CFLAGS = @GTK_CFLAGS@ @COMMON_CFLAGS@ # In the absence of the linker options --start-group and --end-group (which # can't be put in LDADD), we need to bring the following libraries out of # the alphabetical order so their symbols are properly resolved. -toolbox_LDADD = ../lib/conf/libConf.a \ - ../lib/eventManager/libEventManager.a ../lib/file/libFile.a \ - ../lib/guestApp/libGuestApp.a ../lib/hgfs/libHgfs.a \ +COMMON = ../lib/conf/libConf.a ../lib/eventManager/libEventManager.a \ + ../lib/file/libFile.a ../lib/hgfs/libHgfs.a \ ../lib/procMgr/libProcMgr.a ../lib/rpcIn/libRpcIn.a \ - ../lib/rpcOut/libRpcOut.a ../lib/strUtil/libStrUtil.a \ - ../lib/string/libString.a ../lib/system/libSystem.a \ - ../lib/user/libUser.a ../lib/vmCheck/libVmCheck.a \ - ../lib/vmSignal/libVmSignal.a ../lib/wiper/libWiper.a \ - ../lib/err/libErr.a ../lib/backdoor/libBackdoor.a \ - ../lib/dict/libDict.a ../lib/atomic/libAtomic.a \ + ../lib/rpcOut/libRpcOut.a ../lib/string/libString.a \ + ../lib/system/libSystem.a ../lib/user/libUser.a \ + ../lib/vmCheck/libVmCheck.a ../lib/vmSignal/libVmSignal.a \ + ../lib/wiper/libWiper.a ../lib/err/libErr.a \ + ../lib/backdoor/libBackdoor.a ../lib/dict/libDict.a \ ../lib/message/libMessage.a ../lib/unicode/libUnicode.a \ ../lib/sync/libSync.a ../lib/misc/libMisc.a \ - ../lib/panicDefault/libPanicDefault.a ../lib/panic/libPanic.a -toolbox_LDFLAGS = -lX11 @GTK_LIBS@ -toolbox_SOURCES = debugStdio.c stub.c toolbox-gtk.c toolboxAbout.c \ - toolboxDevices.c toolboxOptions.c toolboxScripts.c \ - toolboxShrink.c + ../lib/panicDefault/libPanicDefault.a ../lib/panic/libPanic.a \ + ../lib/stubs/libStubs.a +@HAVE_X11_TRUE@AM_CFLAGS = @GTK_CPPFLAGS@ +@HAVE_X11_TRUE@vmware_toolbox_LDADD = \ +@HAVE_X11_TRUE@ ../lib/guestApp/libGuestAppX11.a $(COMMON) \ +@HAVE_X11_TRUE@ @COMMON_XLIBS@ @GTK_LIBS@ $(am__append_2) +@HAVE_X11_TRUE@vmware_toolbox_SOURCES = debugStdio.c toolbox-gtk.c \ +@HAVE_X11_TRUE@ toolboxAbout.c toolboxDevices.c \ +@HAVE_X11_TRUE@ toolboxOptions.c toolboxScripts.c \ +@HAVE_X11_TRUE@ toolboxShrink.c toolboxRecord.c +@HAVE_ICU_FALSE@@HAVE_X11_TRUE@vmware_toolbox_LINK = $(LINK) +@HAVE_ICU_TRUE@@HAVE_X11_TRUE@vmware_toolbox_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ +@HAVE_ICU_TRUE@@HAVE_X11_TRUE@ $(LIBTOOLFLAGS) --mode=link $(CXX) $(AM_CXXFLAGS) \ +@HAVE_ICU_TRUE@@HAVE_X11_TRUE@ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ + +vmware_toolbox_cmd_LDADD = ../libguestlib/libguestlib.la \ + ../lib/guestInfo/libGuestInfo.a ../lib/guestApp/libGuestApp.a \ + $(COMMON) $(am__append_3) +vmware_toolbox_cmd_SOURCES = debugStdio.c toolbox-cmd.c \ + toolboxcmd-devices.c toolboxcmd-scripts.c toolboxcmd-shrink.c \ + toolboxcmd-stat.c toolboxcmd-time.c toolboxcmd-record.c +@HAVE_ICU_FALSE@vmware_toolbox_cmd_LINK = $(LINK) +@HAVE_ICU_TRUE@vmware_toolbox_cmd_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: @@ -284,16 +338,40 @@ 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-noinstPROGRAMS: - @list='$(noinst_PROGRAMS)'; for p in $$list; do \ +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 -toolbox$(EXEEXT): $(toolbox_OBJECTS) $(toolbox_DEPENDENCIES) - @rm -f toolbox$(EXEEXT) - $(toolbox_LINK) $(toolbox_OBJECTS) $(toolbox_LDADD) $(LIBS) +vmware-toolbox$(EXEEXT): $(vmware_toolbox_OBJECTS) $(vmware_toolbox_DEPENDENCIES) + @rm -f vmware-toolbox$(EXEEXT) + $(vmware_toolbox_LINK) $(vmware_toolbox_OBJECTS) $(vmware_toolbox_LDADD) $(LIBS) +vmware-toolbox-cmd$(EXEEXT): $(vmware_toolbox_cmd_OBJECTS) $(vmware_toolbox_cmd_DEPENDENCIES) + @rm -f vmware-toolbox-cmd$(EXEEXT) + $(vmware_toolbox_cmd_LINK) $(vmware_toolbox_cmd_OBJECTS) $(vmware_toolbox_cmd_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -302,13 +380,20 @@ -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/debugStdio.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stub.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/toolbox-cmd.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/toolbox-gtk.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/toolboxAbout.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/toolboxDevices.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/toolboxOptions.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/toolboxRecord.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/toolboxScripts.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/toolboxShrink.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/toolboxcmd-devices.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/toolboxcmd-record.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/toolboxcmd-scripts.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/toolboxcmd-shrink.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/toolboxcmd-stat.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/toolboxcmd-time.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -415,6 +500,9 @@ 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 @@ -441,8 +529,7 @@ @echo "it deletes files that may require special tools to rebuild." clean: clean-am -clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ - mostlyclean-am +clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) @@ -464,7 +551,7 @@ install-dvi: install-dvi-am -install-exec-am: +install-exec-am: install-binPROGRAMS install-html: install-html-am @@ -496,23 +583,37 @@ ps-am: -uninstall-am: +uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-strip -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstPROGRAMS 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 \ +.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 + pdf pdf-am ps ps-am tags uninstall uninstall-am \ + uninstall-binPROGRAMS + +@HAVE_X11_TRUE@ install-exec-hook: +@HAVE_X11_TRUE@ $(INSTALL) -d $(DESTDIR)$(datadir)/applications/ +@HAVE_X11_TRUE@ $(INSTALL) -m 644 ../scripts/common/vmware-toolbox.desktop \ +@HAVE_X11_TRUE@ $(DESTDIR)$(datadir)/applications/ +@HAVE_X11_TRUE@ $(SED) -i s/Exec=.*/Exec=vmware-toolbox/ \ +@HAVE_X11_TRUE@ $(DESTDIR)$(datadir)/applications/vmware-toolbox.desktop +@HAVE_X11_TRUE@ $(INSTALL) -d $(DESTDIR)/usr/share/pixmaps/vmware +@HAVE_X11_TRUE@ $(INSTALL) -m 644 bigIcon.xpm \ +@HAVE_X11_TRUE@ $(DESTDIR)/usr/share/pixmaps/vmware/vmware-toolbox.xpm +@HAVE_X11_TRUE@ uninstall-hook: +@HAVE_X11_TRUE@ -$(RM) -f $(DESTDIR)$(datadir)/share/applications/vmware-toolbox.desktop +@HAVE_X11_TRUE@ -$(RM) -rf $(DESTDIR)/usr/share/pixmaps/vmware # 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: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/toolbox/stub.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/toolbox/stub.c --- open-vm-tools-2008.01.23-74039/toolbox/stub.c 2008-01-28 08:02:54.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/toolbox/stub.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,268 +0,0 @@ -/********************************************************* - * Copyright (C) 1998 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 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. - * - *********************************************************/ - -/* - * stub.c -- - * - * Stub for unuseful functions. Stolen from one of the other - * 13 stub.c files in bora. This is necessary because the - * toolbox uses FileIO_* API, which in turn uses these suckers - * below. - * --Ganesh. - * - */ - -#ifndef VMX86_DEVEL - -#endif - - -#include <stdlib.h> -#include <stdio.h> -#include <sys/types.h> -#include <stdarg.h> -#include <string.h> - -#ifdef _MSC_VER -# include <io.h> -# include <windows.h> -#endif - - -#include "vm_version.h" -#include "vm_assert.h" -#include "vmware.h" -#include "str.h" -#include "debug.h" - -#ifdef _WIN32 -#include "poll.h" -#endif - -#if defined(N_PLAT_NLM) -char * -File_GetTmpDir(Bool useConf) -{ - return NULL; -} -#endif - - -/* - *---------------------------------------------------------------------- - * - * StubVprintf -- - * - * Output error text. - * - * Results: - * - * None. - * - * Side effects: - * - * None. - * - *---------------------------------------------------------------------- - */ - -void -StubVprintf(const char *prefix, - const char *fmt, - va_list args) -{ - char *str; - - /* Doesn't work yet. [greg] */ - - str = Str_Vasprintf(NULL, fmt, args); - -#if defined(_WIN32) - Debug("%s: %s", prefix, str); - printf("%s: %s", prefix, str); - // how do we print to stderr? fprintf(stderr,...) doesn't work -#else - fprintf(stderr, "%s: %s", prefix, str); - fflush(stderr); -#endif - - free(str); -} - -#ifdef N_PLAT_NLM -void -Panic(const char *fmt, ...) -{ - va_list args; - - va_start(args, fmt); - StubVprintf("PANIC", fmt, args); - va_end(args); - - exit(255); - NOT_REACHED(); -} -#endif - -void -Panic_PostPanicMsg(const char *format, - ...) -{} - -void -Log_DisableThrottling(void) -{} - -void -Log_SetAlwaysKeep(Bool unused) -{} - - -Bool -Config_GetBool(Bool defaultValue, - const char *fmt, - ...) -{ - return defaultValue; -} - - -int32 -Config_GetLong(int32 defaultValue, - const char *fmt, - ...) -{ - return defaultValue; -} - - -void -Log(const char *fmt, - ...) -{ - va_list args; - - va_start(args, fmt); - StubVprintf("Log", fmt, args); - va_end(args); -} - -void -Warning(const char *fmt, - ...) -{ - va_list args; - - va_start(args, fmt); - StubVprintf("Warning", fmt, args); - va_end(args); -} - - -void -Msg_Append(const char *idFmt, - ...) -{ - char *str; - - va_list args; - va_start(args, idFmt); - str = Str_Vasprintf(NULL, idFmt, args); - va_end(args); - - Warning("Msg_Append: %s\n", str); - free(str); -} - -unsigned int -Msg_Question(void *buttons, - int defaultAnswer, - char const *fmt, - ...) -{ - char *str; - - va_list args; - va_start(args, fmt); - str = Str_Vasprintf(NULL, fmt, args); - va_end(args); - - Warning("Msg_Question: %s\n", str); - free(str); - - return 0; -} - -typedef int MsgSeverity; - -void -Msg_Post(MsgSeverity severity, - const char *idFmt, - ...) -{ - char *str; - - va_list args; - va_start(args, idFmt); - str = Str_Vasprintf(NULL, idFmt, args); - va_end(args); - - Warning("Msg_Post: %s\n", str); - free(str); -} - - -#ifdef _WIN32 -Bool -Preference_GetBool(Bool defaultValue, - const char *name) -{ - return defaultValue; -} -#endif - -char * -Preference_GetString(char *defaultValue, - const char *name) -{ - return defaultValue; -} - -#ifdef _WIN32 -VMwareStatus -Poll_CB_RTime(PollerFunction f, // IN - void *clientData, // IN - int info, // IN - Bool periodic, // IN - struct DeviceLock *lock) // IN -{ - //NOT_IMPLEMENTED(); - return VMWARE_STATUS_SUCCESS; -} - - -Bool -Poll_CB_RTimeRemove(PollerFunction f, // IN - void *clientData, // IN - Bool periodic) // IN -{ - //NOT_IMPLEMENTED(); - return TRUE; -} -#endif - diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/toolbox/toolboxAbout.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/toolbox/toolboxAbout.c --- open-vm-tools-2008.01.23-74039/toolbox/toolboxAbout.c 2008-01-28 08:02:54.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/toolbox/toolboxAbout.c 2008-10-13 08:01:54.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -31,7 +31,7 @@ #include "str.h" #include "bigIcon.xpm" -#include "toolboxInt.h" +#include "toolboxGtkInt.h" #ifdef _DEBUG #define new DEBUG_NEW diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/toolbox/toolbox-cmd.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/toolbox/toolbox-cmd.c --- open-vm-tools-2008.01.23-74039/toolbox/toolbox-cmd.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/toolbox/toolbox-cmd.c 2008-10-13 08:01:54.000000000 +0100 @@ -0,0 +1,790 @@ +/********************************************************* + * Copyright (C) 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. + * + *********************************************************/ + +/* + * toolbox-cmd.c -- + * + * The toolbox app with a command line interface. + */ + +#include <stdlib.h> +#include <string.h> +#include <stdio.h> + +#include "toolboxCmdInt.h" +#include "toolboxcmd_version.h" +#include "system.h" + +#include "embed_version.h" +VM_EMBED_VERSION(TOOLBOXCMD_VERSION_STRING); + + +typedef int (*ToolboxCmdFunc)(char **argv, int argc); +typedef void (*ToolboxHelpFunc)(char *progName); + + +/* + * Local Data + */ + +const typedef struct CmdTable { + const char *command; /* The name of the command. */ + ToolboxCmdFunc func; /* The function to execute. */ + Bool requireRoot; /* Indicates whether root is required. */ + ToolboxHelpFunc helpFunc; /* The help function associated with the command. */ +} CmdTable; + +static int quiet_flag; /* Flag set by `--quiet'. */ + +/* + * Sadly, our home-brewed implementation of getopt() doesn't come with an + * implementation of getopt_long(). + */ +#ifndef _WIN32 +static struct option long_options[] = { + /* quiet sets a flag */ + { "quiet", no_argument, 0, 'q' }, + /* These options don't set a flag. + We distinguish them by their indices. */ + { "help", no_argument, 0, 'h' }, + { "version", no_argument, 0, 'v' }, + { 0, 0, 0, 0 } }; +#endif + +static const char *options = "hqv"; + +/* + * Local Functions + */ + +static int HelpCommand(char **argv, int argc); +static int DeviceCommand(char **argv, int argc); +static int DiskCommand(char **argv, int argc); +static int StatCommand(char **argv, int argc); +static int ScriptCommand(char **argv, int argc); +static int TimeSyncCommand(char **argv, int argc); +static int RecordCommand(char **argv, int argc); +static void DeviceHelp(char *progName); +static void DiskHelp(char *progName); +static void ScriptHelp(char *progName); +static void StatHelp(char *progName); +static void TimeSyncHelp(char *progName); +static void RecordHelp(char *progName); +static void ToolboxCmdHelp(char *progName); +static CmdTable *ParseCommand(char **argv, int argc); +static Bool CheckArgumentLength(char **argv, int argc); + + +/* + * The commands table. + * Must go after function declarations + */ +static CmdTable commands[] = { + { "timesync", TimeSyncCommand, FALSE, TimeSyncHelp}, + { "script", ScriptCommand, TRUE, ScriptHelp}, + { "disk", DiskCommand, TRUE, DiskHelp}, + { "stat", StatCommand, FALSE, StatHelp}, + { "device", DeviceCommand, FALSE, DeviceHelp}, + { "record", RecordCommand, FALSE, RecordHelp}, + { "help", HelpCommand, FALSE, ToolboxCmdHelp}, + { NULL, } }; + + +/* + *----------------------------------------------------------------------------- + * + * CheckArgumentLength -- + * + * Makes sure that the program receives at least one subcommand. + * + * Results: + * TRUE if there is at least one subcommand. + * FALSE otherwise. + * + * Side effects: + * Prints to stderr if the subcommand is missing. + * + *----------------------------------------------------------------------------- + */ + +static Bool +CheckArgumentLength(char **argv, // IN: The command line arguments. + int argc) // IN: The length of the command line argumensts +{ + if (++optind < argc) { + return TRUE; + } else { + fprintf(stderr, "Missing command\n"); + return FALSE; + } + +} + + +/* + *----------------------------------------------------------------------------- + * + * DeviceHelp -- + * + * Prints the help for device commands. + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static void +DeviceHelp(char *progName) // IN: The name of the program obtained from argv[0] +{ + printf("device: enable, disable, list devices, or get a device status" + "Usage: %s device <subcommand> [args]\n" + " dev is the name of the device.\n\n" + "Subcommands:\n" + " enable <dev>: enables the device dev\n" + " disable <dev>: disable the device dev\n" + " list: list enabled and disabled devices\n" + " status <dev>: prints the status of device dev\n", progName); +} + + +/* + *----------------------------------------------------------------------------- + * + * ToolboxCmdHelp -- + * + * Print out usage information to stdout. + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static void +ToolboxCmdHelp(char *progName) +{ + printf("usage: %s <command> [options] [subcommand]\n" + "Type \'%s help <command>\' for help on a specific command.\n" + "Type \'%s --version' to see the Vmware Tools version.\n" + "Type \'%s --quiet to supress stdout printing\n" + "Most commands take a subcommand\n\n" + "Available commands:\n" + " timesync\n" + " device\n" + " script\n" + " disk\n" + " stat\n" + " record\n\n" + "For additional information please visit http://www.vmware.com/support/\n\n", + progName, progName, progName, progName); +} + + +/* + *----------------------------------------------------------------------------- + * + * TimeSyncHelp -- + * + * Prints the help for timesync command. + * + * Results: + * None. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static void +TimeSyncHelp(char *progName) // IN: The name of the program obtained from argv[0] +{ + printf("timesync: enable, disable, or check the status of time " + "sync on the guest OS\n" + "Usage: %s timesync <subcommand>\n\n" + "Subcommands\n" + " enable: enable time sync\n" + " disable: disable time sync\n" + " status: display the time sync status\n", progName); +} + + +/* + *----------------------------------------------------------------------------- + * + * ScriptHelp -- + * + * Prints the help for the script command. + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static void +ScriptHelp(char *progName) // IN: The name of the program obtained from argv[0] +{ + printf("script: enable, disable, set, or set to default a particular script\n" + "Usage: %s script <power|resume|suspend|shutdown> <subcomamnd> [args]\n\n" + "Subcommands:\n" + " enable: enables and restores the script to the default one\n" + " disable: disables a particular script\n" + " set <full_path>: sets a script to the script given by full_path\n" + " default: returns the path to the default script\n" + " current: returns the path to the current script\n", progName); +} + + +/* + *----------------------------------------------------------------------------- + * + * DiskHelp -- + * + * Prints the help for the disk command. + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static void +DiskHelp(char *progName) // IN: The name of the program obtained from argv[0] +{ + printf("disk: perform disk shrink operations\n" + "Usage: %s shrink <subcommand> [args]\n\n" + "Subcommands\n" + " list: list available mountpoints\n" + " shrink <mount-point>: shrinks a file system at the given mountpoint\n", + progName); +} + + +/* + *----------------------------------------------------------------------------- + * + * StatHelp -- + * + * Prints the help for the stat command. + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static void +StatHelp(char *progName) // IN: The name of the program obtained from argv[0] +{ + printf("stat: usefull guest and host information\n" + "Usage: %s state <subcommand>\n\n" + "Subcommands\n" + " hosttime: gets the time host time\n" + " memory: gets the virtual machine memory in MBs\n" + " speed: gets the virtual machine speed in MHz\n" + "ESX guests only subcommands\n" + " sessionid: Prints the current the session id\n" + " balloon: Prints memory ballooning\n" + " swap: Prints memory swapping\n" + " memlimit: Prins memery limit\n" + " memres: Prints memory reservation\n" + " cpures: Prints cpu reservation\n" + " cpulimit: Prints cput limit\n", progName); +} + + +/* + *----------------------------------------------------------------------------- + * + * RecordHelp -- + * + * Prints the help for the record command. + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static void +RecordHelp(char *progName) // IN: The name of the program obtained from argv[0] +{ + printf("record: control recording process inside guest\n" + "Usage: %s record <subcommand>\n\n" + "Subcommands\n" + " start: start recording\n" + " stop: stop recording\n", progName); +} + + +/* + *----------------------------------------------------------------------------- + * + * HelpCommand -- + * + * Handle and parse help commands. + * + * Results: + * Returns EXIT_SUCCESS on success. + * Returns other exit codes on errors. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static int +HelpCommand(char **argv, // IN: Command line arguments + int argc) // IN: Length of argv +{ + if (CheckArgumentLength(argv, argc)) { + int i = 0; + while (commands[i].command != 0) { + if (strcmp(commands[i].command, argv[optind]) == 0) { + commands[i].helpFunc(argv[0]); + return EXIT_SUCCESS; + } + i++; + } + fprintf(stderr, "Unknown subcommand\n"); + } + ToolboxCmdHelp(argv[0]); + return EX_USAGE; +} + + +/* + *----------------------------------------------------------------------------- + * + * DeviceCommand -- + * + * Handle and parse device commands. + * + * Results: + * Returns EXIT_SUCCESS on success. + * Returns ther exit code on errors. + * + * Side effects: + * Might enable or disable a device. + * + *----------------------------------------------------------------------------- + */ + +static int +DeviceCommand(char **argv, // IN: Command line arguments + int argc) // IN: Length of command line argumenst +{ + if (CheckArgumentLength(argv, argc)) { + if (strcmp(argv[optind], "list") == 0) { + return Devices_ListDevices(); + } else { + char *subcommand = argv[optind++]; + if (optind < argc) { + if (strcmp(subcommand, "status") == 0) { + return Devices_DeviceStatus(argv[optind]); + } else if (strcmp(subcommand, "enable") == 0) { + return Devices_EnableDevice(argv[optind], quiet_flag); + } else if (strcmp(subcommand, "disable") == 0) { + return Devices_DisableDevice(argv[optind], quiet_flag); + } else { + fprintf(stderr, "Unknown subcommand\n"); + + } + } else { + fprintf(stderr, "Missing device name\n"); + + } + } + } + DeviceHelp(argv[0]); + return EX_USAGE; +} + + +/* + *----------------------------------------------------------------------------- + * + * DiskCommand -- + * + * Handle and parse disk commands. + * + * Results: + * Returns EXIT_SUCCESS on success. + * Returns the appropriate exit code on errors. + * + * Side effects: + * Might shrink disk + * + *----------------------------------------------------------------------------- + */ + +static int +DiskCommand(char **argv, // IN: command line arguments + int argc) // IN: The length of the command line arguments +{ + if (CheckArgumentLength(argv, argc)) { + if (strcmp(argv[optind], "list") == 0) { + return Shrink_List(); + } else if (strcmp(argv[optind], "shrink") == 0) { + optind++; // Position optind at the mountpoint + if (optind < argc) { + return Shrink_DoShrink(argv[optind], quiet_flag); + } else { + fprintf(stderr, "Missing mount point\n"); + } + } else { + fprintf(stderr, "Unknown subcommand\n"); + + } + } + DiskHelp(argv[0]); + return EX_USAGE; +} + + +/* + *----------------------------------------------------------------------------- + * + * StatCommand -- + * + * Handle and parse stat commands. + * + * Results: + * Returns EXIT_SUCCESS on success. + * Returns the appropriate exit codes on errors. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static int +StatCommand(char **argv, // IN: Comand line arguments + int argc) // IN: Length of command line arguments +{ + if (CheckArgumentLength(argv, argc)) { + if (strcmp(argv[optind], "memory") == 0) { + return Stat_MemorySize(); + } else if (strcmp(argv[optind], "hosttime") == 0) { + return Stat_HostTime(); + } else if (strcmp(argv[optind], "sessionid") == 0) { + return Stat_GetSessionID(); + } else if (strcmp(argv[optind], "balloon") == 0) { + return Stat_GetMemoryBallooned(); + } else if (strcmp(argv[optind], "swap") == 0) { + return Stat_GetMemorySwapped(); + } else if (strcmp(argv[optind], "memlimit") == 0) { + return Stat_GetMemoryLimit(); + } else if (strcmp(argv[optind], "memres") == 0) { + return Stat_GetMemoryReservation(); + } else if (strcmp(argv[optind], "cpures") == 0) { + return Stat_GetCpuReservation(); + } else if (strcmp(argv[optind], "cpulimit") == 0) { + return Stat_GetCpuLimit(); + } else if (strcmp(argv[optind], "speed") == 0) { + return Stat_ProcessorSpeed(); + } else { + fprintf(stderr, "Unknown subcommand\n"); + } + } + StatHelp(argv[0]); + return EX_USAGE; +} + + +/* + *----------------------------------------------------------------------------- + * + * ScriptCommand -- + * + * Handle and parse script commands. + * + * Results: + * Returns EXIT_SUCCESS on success. + * Returns the exit code on errors. + * + * Side effects: + * Might enables, disables, or change APM scripts. + * + *----------------------------------------------------------------------------- + */ + +static int +ScriptCommand(char **argv, // IN: command line arguments. + int argc) // IN: the length of the command line arguments. +{ + if (CheckArgumentLength(argv, argc)) { + char* apm = argv[optind++]; + + if (optind >= argc) { + fprintf(stderr, "Missing subcommand\n"); + return EX_USAGE; + } + + if (strcmp(argv[optind], "default") == 0) { + return Script_GetDefault(apm); + } else if (strcmp(argv[optind], "current") == 0) { + return Script_GetCurrent(apm); + } else if (strcmp(argv[optind], "set") == 0) { + optind++; + if (optind < argc) { + return Script_Set(apm, argv[optind], quiet_flag); + } else { + fprintf(stderr, "Missing script path\n"); + ScriptHelp(argv[0]); + return EX_USAGE; + } + } else if (strcmp(argv[optind], "enable") == 0) { + return Script_Enable(apm, quiet_flag); + } else if (strcmp(argv[optind], "disable") == 0) { + return Script_Disable(apm, quiet_flag); + } else { + fprintf(stderr, "Unknown subcommand"); + } + } + ScriptHelp(argv[0]); + return EX_USAGE; +} + + +/* + *----------------------------------------------------------------------------- + * + * TimeSyncCommand -- + * + * Parse and Handle timesync commands. + * + * Results: + * Returns EXIT_SUCCESS on success. + * Returns the appropriate exit code errors. + * + * Side effects: + * Might enable time sync, which would change the time in the guest os. + * + *----------------------------------------------------------------------------- + */ + +static int +TimeSyncCommand(char **argv, // IN: command line arguments + int argc) // IN: The length of the command line arguments +{ + if (CheckArgumentLength(argv, argc)) { + if (strcmp(argv[optind], "enable") == 0) { + return TimeSync_Enable(quiet_flag); + } else if (strcmp(argv[optind], "disable") == 0) { + return TimeSync_Disable(quiet_flag); + } else if (strcmp(argv[optind], "status") == 0) { + return TimeSync_Status(); + } else { + fprintf(stderr, "Unknown subcommand"); + } + } + TimeSyncHelp(argv[0]); + return EX_USAGE; +} + + +/* + *----------------------------------------------------------------------------- + * + * RecordCommand -- + * + * Parse and Handle recording commands. + * + * Results: + * Returns EXIT_SUCCESS on success. + * Returns the appropriate exit code errors. + * + * Side effects: + * Might start and stop recording, guest os may be suspended + * to wait for the recording panel in host. + * + *----------------------------------------------------------------------------- + */ + +static int +RecordCommand(char **argv, // IN: Command line arguments + int argc) // IN: Length of command line argumenst +{ + if (CheckArgumentLength(argv, argc)) { + if (strcmp(argv[optind], "start") == 0) { + return Record_StartRecording(); + } else if (strcmp(argv[optind], "stop") == 0) { + return Record_StopRecording(); + } else { + fprintf(stderr, "Unknown subcommand"); + } + } + RecordHelp(argv[0]); + return EX_USAGE; +} + + +/* + *----------------------------------------------------------------------------- + * + * ParseCommand -- + * + * Parse the non optional command line arguments. + * + * Results: + * Returns the CmdTable pointer on success or calls exit on error. + * + * Side effects: + * Calls exit on parse errors. + * + *----------------------------------------------------------------------------- + */ + +static CmdTable * +ParseCommand(char **argv, // IN: Command line arguments + int argc) // IN: Length of command line arguments +{ + if (optind < argc) { + int i = 0; + while (commands[i].command != 0) { + if (strcmp(commands[i].command, argv[optind]) == 0) { + return &commands[i]; + } + i++; + } + return &commands[i]; + } else { + fprintf(stderr, "Missing command\n"); + ToolboxCmdHelp(argv[0]); + exit(EX_USAGE); + } +} + + +/* + *----------------------------------------------------------------------------- + * + * main -- + * + * This is main + * + * Results: + * Returns EXIT_SUCCESS on success. + * Returns different exit code on failure. + * + * Side effects: + * The vmware-toolbox-cmd will run and do a variety of tricks for your + * amusement. + * + *----------------------------------------------------------------------------- + */ + +int +main(int argc, // IN: length of command line arguments + char **argv) // IN: Command line arguments +{ + int c; + /* + * Check if we are in a VM + */ + if (!VmCheck_IsVirtualWorld()) { + fprintf(stderr, "toolbox-cmd must be run inside a virtual machine.\n"); + exit(EXIT_FAILURE); + } + + if (argc < 2) { + ToolboxCmdHelp(argv[0]); + exit(EX_USAGE); + } + + /* + * Parse the command line optional arguments + */ + while (1) { + int option_index = 0; + +#ifdef _WIN32 + c = getopt(argc, argv, options); +#else + c = getopt_long(argc, argv, options, long_options, &option_index); +#endif + + /* Detect the end of the options. */ + if (c == -1) + break; + + switch (c) { + case 'h': + ToolboxCmdHelp(argv[0]); + exit(EXIT_SUCCESS); + + case 'v': + printf("%s\n", TOOLBOXCMD_VERSION_STRING); + exit(EXIT_SUCCESS); + + case 'q': + quiet_flag = 1; + break; + + case '?': + /* getopt_long already printed an error message. */ + ToolboxCmdHelp(argv[0]); + abort(); + break; + + default: + abort(); + } + } + + /* Process any remaining command line arguments (not options), and + * execute corresponding command + */ + if (optind < argc) { + CmdTable *cmd = ParseCommand(argv, argc); + if (cmd->command == NULL) { + ToolboxCmdHelp(argv[0]); + return EX_USAGE; + } + if (cmd->requireRoot && !System_IsUserAdmin()) { + fprintf(stderr,"You must be root to perform %s operations\n", + cmd->command); + return EX_NOPERM; + } + return cmd->func(argv, argc); + } + return EXIT_SUCCESS; +} diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/toolbox/toolboxcmd-devices.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/toolbox/toolboxcmd-devices.c --- open-vm-tools-2008.01.23-74039/toolbox/toolboxcmd-devices.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/toolbox/toolboxcmd-devices.c 2008-10-13 08:01:54.000000000 +0100 @@ -0,0 +1,194 @@ +/********************************************************* + * Copyright (C) 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. + * + *********************************************************/ + +/* + * toolboxcmd-devices.c -- + * + * The devices functions for toolbox-cmd + */ + +#include <string.h> +#include <stdlib.h> +#include <stdio.h> +#include "toolboxInt.h" +#include "toolboxCmdInt.h" + +static int DevicesSetStatus (char *devName, Bool enable, int quiet_flag); + + +/* + *----------------------------------------------------------------------------- + * + * Devices_ListDevices -- + * + * prints device names and status to stdout. + * + * Results: + * EXIT_SUCCESS. + * + * Side effects: + * Prints to stdout. + * + *----------------------------------------------------------------------------- + */ + +int +Devices_ListDevices(void) +{ + int i; + for (i = 0; i < MAX_DEVICES; i++) { + RD_Info info; + if (GuestApp_GetDeviceInfo(i, &info) && strlen(info.name) > 0) { + printf ("%s: %s\n", info.name, info.enabled ? "Enabled" : "Disabled"); + } + } + return EXIT_SUCCESS; +} + + +/* + *----------------------------------------------------------------------------- + * + * Devices_DeviceStatus -- + * + * Prints device names to stdout. + * + * Results: + * Returns EXIT_SUCCESS on success + * Returns EXIT_OSFILE if devName was not found + * + * Side effects: + * Print to stderr on error. + * + *----------------------------------------------------------------------------- + */ + +int +Devices_DeviceStatus(char *devName) // IN: Device Name +{ + int i; + for (i = 0; i < MAX_DEVICES; i++) { + RD_Info info; + if (GuestApp_GetDeviceInfo(i, &info) + && strcmp(info.name, devName) == 0) { + printf("%s\n", info.enabled ? "Enabled" : "Disabled"); + return EXIT_SUCCESS; + } + } + fprintf(stderr, + "error fetching interface information: Device not found\n"); + return EX_OSFILE; +} + + +/* + *----------------------------------------------------------------------------- + * + * DevicesSetStatus -- + * + * Sets device status to the value in enable. + * + * Results: + * EXIT_SUCCESS on success + * EXIT_TEMPFAIL on failure to connect/disconnect a device + * EXIT_OSFILE if device is not found + * + * Side effects: + * Possibly connects or disconnects a device. + * Print to stderr on error. + * + *----------------------------------------------------------------------------- + */ + +static int +DevicesSetStatus(char *devName, // IN: device name + Bool enable, // IN: status + int quiet_flag) // IN: Verbosity flag +{ + int dev_id; + for (dev_id = 0; dev_id < MAX_DEVICES; dev_id++) { + RD_Info info; + if (GuestApp_GetDeviceInfo(dev_id, &info) + && strcmp(info.name, devName) == 0) { + if (!GuestApp_SetDeviceState(dev_id, enable)) { + fprintf(stderr, "Unable to %s device %s\n", enable ? "connect" + : "disconnect", info.name); + return EX_TEMPFAIL; + } + goto exit; + } + } + fprintf(stderr, + "error fetching interface information: Device not found\n"); + return EX_OSFILE; + exit: + if (!quiet_flag) { + printf("%s\n", enable ? "Enabled" : "Disabled"); + } + return EXIT_SUCCESS; +} + + +/* + *----------------------------------------------------------------------------- + * + * Devices_EnableDevice -- + * + * Connects a device. + * + * Results: + * Same as DevicesSetStatus. + * + * Side effects: + * Possibly connect a device. + * Print to stderr on error. + * + *----------------------------------------------------------------------------- + */ + +int +Devices_EnableDevice(char *name, // IN: device name + int quiet_flag) // IN: Verbosity flag +{ + return DevicesSetStatus(name, TRUE, quiet_flag); +} + + +/* + *----------------------------------------------------------------------------- + * + * Devices_DisableDevice -- + * + * disconnects a device. + * + * Results: + * Same as DevicesSetStatus. + * + * Side effects: + * Possibly disconnect a device. + * Print to stderr on error. + * + *----------------------------------------------------------------------------- + */ + +int +Devices_DisableDevice(char *name, // IN: device name + int quiet_flag) // IN: Verbosity flag +{ + return DevicesSetStatus(name, FALSE, quiet_flag); +} diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/toolbox/toolboxCmdInt.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/toolbox/toolboxCmdInt.h --- open-vm-tools-2008.01.23-74039/toolbox/toolboxCmdInt.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/toolbox/toolboxCmdInt.h 2008-10-13 08:01:54.000000000 +0100 @@ -0,0 +1,120 @@ +/********************************************************* + * Copyright (C) 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. + * + *********************************************************/ + +/* + * toolbox-cmd.h -- + * + * Common defines used by the toolbox-cmd. + */ +#ifndef _TOOLBOX_CMD_INT_H_ +#define _TOOLBOX_CMD_INT_H_ + +#include <stdio.h> +#include <stdlib.h> +#ifdef _WIN32 +# include "getoptwin32.h" +#else +# include <getopt.h> +# include <sysexits.h> +# include <unistd.h> +#endif + +#include "toolboxInt.h" +#include "vmGuestLib.h" + +/* + * Some platforms (such as Win32) don't have sysexits.h and thus don't have + * generic program exit codes. + */ + +#ifndef EX_USAGE +#define EX_USAGE 64 +#endif + +#ifndef EX_UNAVAILABLE +#define EX_UNAVAILABLE 69 +#endif + +#ifndef EX_OSFILE +#define EX_OSFILE 72 +#endif + +#ifndef EX_TEMPFAIL +#define EX_TEMPFAIL 75 +#endif + +#ifndef EX_NOPERM +#define EX_NOPERM 77 +#endif + +/* + * Devices Operations + */ + +int Devices_ListDevices(void); +int Devices_DeviceStatus(char*); +int Devices_EnableDevice(char*, int); +int Devices_DisableDevice(char*, int); + +/* + * TimeSync Operations + */ +int TimeSync_Enable(int); +int TimeSync_Disable(int); +int TimeSync_Status(void); + +/* + * Script Operations + */ + +int Script_GetDefault(char*); +int Script_GetCurrent(char*); +int Script_Enable(char*, int); +int Script_Disable(char*, int); +int Script_Set(char*, char*, int); + + +/* + * Disk Shrink Operations + */ + +int Shrink_List(void); +int Shrink_DoShrink(char*, int); + +/* + * Stat commands + */ + +int Stat_MemorySize(void); +int Stat_HostTime(void); +int Stat_ProcessorSpeed(void); +int Stat_GetSessionID(void); +int Stat_GetCpuLimit(void); +int Stat_GetCpuReservation(void); +int Stat_GetMemoryBallooned(void); +int Stat_GetMemorySwapped(void); +int Stat_GetMemoryLimit(void); +int Stat_GetMemoryReservation(void); + +/* + * Record commands + */ +Bool Record_StartRecording(void); +Bool Record_StopRecording(void); + +#endif /*_TOOLBOX_CMD_H_*/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/toolbox/toolboxcmd-record.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/toolbox/toolboxcmd-record.c --- open-vm-tools-2008.01.23-74039/toolbox/toolboxcmd-record.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/toolbox/toolboxcmd-record.c 2008-10-13 08:01:54.000000000 +0100 @@ -0,0 +1,83 @@ +/********************************************************* + * Copyright (C) 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. + * + *********************************************************/ + +/* + * toolboxcmd-record.c -- + * + * Record operations for toolbox command line console. + */ + +#include "toolboxCmdInt.h" +#include "statelogger_backdoor_def.h" + + +/* + *----------------------------------------------------------------------------- + * + * Record_StartRecording -- + * + * Start recording process. + * + * Results: + * TRUE if the call is successful, FALSE otherwise. + * + * Side effects: + * Host VMware product starts recording this vm. + * + *----------------------------------------------------------------------------- + */ + +Bool +Record_StartRecording(void) +{ + if (GuestApp_ControlRecord(STATELOGGER_BKDR_START_LOGGING) == TRUE) { + return TRUE; + } else { + fprintf(stderr, RECORD_VMX_ERR); + return FALSE; + } +} + + +/* + *----------------------------------------------------------------------------- + * + * Record_StopRecording -- + * + * Stop recording process, + * + * Results: + * TRUE if the call is successful, FALSE otherwise. + * + * Side effects: + * Host VMware product stops recording this vm. + * + *----------------------------------------------------------------------------- + */ + +Bool +Record_StopRecording(void) +{ + if (GuestApp_ControlRecord(STATELOGGER_BKDR_STOP_LOGGING) == TRUE) { + return TRUE; + } else { + fprintf(stderr, RECORD_VMX_ERR); + return FALSE; + } +} + diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/toolbox/toolboxcmd-scripts.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/toolbox/toolboxcmd-scripts.c --- open-vm-tools-2008.01.23-74039/toolbox/toolboxcmd-scripts.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/toolbox/toolboxcmd-scripts.c 2008-10-13 08:01:54.000000000 +0100 @@ -0,0 +1,347 @@ +/********************************************************* + * Copyright (C) 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. + * + *********************************************************/ + +/* + * toolboxcmd-scripts.c -- + * + * The scripts functions for the linux toolbox-cmd + */ + +#include <string.h> +#include <stdlib.h> +#include <sys/types.h> +#include <sys/stat.h> + +#include "toolboxCmdInt.h" + + +#define SCRIPT_SUSPEND "suspend" +#define SCRIPT_RESUME "resume" +#define SCRIPT_OFF "shutdown" +#define SCRIPT_ON "power" + +typedef enum ScriptType { + Default, + Current +} ScriptType; + +static int ScriptToggle(char *apm, Bool enable, int quiet_flag); +static char* GetConfName(char *apm); +static int GetConfEntry(char *apm, ScriptType type); +static int WriteDict(GuestApp_Dict *confDict, int quiet_flag); + + +/* + *----------------------------------------------------------------------------- + * + * GetConfName -- + * + * Gets the apm name. + * + * Results: + * The apm name. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static char * +GetConfName(char *apm) // IN: apm name. +{ + if (strcmp(apm, SCRIPT_SUSPEND) == 0) { + return CONFNAME_SUSPENDSCRIPT; + }else if (strcmp(apm, SCRIPT_RESUME) == 0) { + return CONFNAME_RESUMESCRIPT; + } else if (strcmp(apm, SCRIPT_OFF) == 0) { + return CONFNAME_POWEROFFSCRIPT; + } else if (strcmp(apm, SCRIPT_ON) == 0) { + return CONFNAME_POWERONSCRIPT; + } else { + return NULL; + } +} + + +/* + *----------------------------------------------------------------------------- + * + * GetConfEntry -- + * + * Gets the entry in the ConfDict. + * + * Results: + * The conf entry. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static int +GetConfEntry(char *apm, // IN: apm name + ScriptType type) // IN: Script type (default or current) +{ + const char *entry = NULL; + GuestApp_Dict *confDict; + char *confName; + confDict = Conf_Load(); + confName = GetConfName(apm); + if (!confName) { + fprintf(stderr, "Unknown operation\n"); + return EX_USAGE; + } + if (type == Default) { + entry = GuestApp_GetDictEntryDefault(confDict, confName); + } else if (type == Current) { + entry = GuestApp_GetDictEntry(confDict, confName); + } + if (entry) { + printf("%s\n", entry); + return EXIT_SUCCESS; + } else { + fprintf(stderr, "Error retreiving the path for script %s\n", apm); + return EX_TEMPFAIL; + } +} + + +/* + *----------------------------------------------------------------------------- + * + * WriteDict -- + * + * Writes a ConfDict to the hard disk. + * + * Results: + * EXIT_SUCCESS on success. + * EXIT_TEMPFAIL on failure + * + * Side effects: + * Writes the Dict to the hard disk. + * + *----------------------------------------------------------------------------- + */ + +static int +WriteDict(GuestApp_Dict *confDict, // IN: The Dict to be writen + int quiet_flag) // IN: Verbosity flag. +{ + if (!GuestApp_WriteDict(confDict)) { + fprintf(stderr, "Unable to write dictionary\n"); + GuestApp_FreeDict(confDict); + return EX_TEMPFAIL; + } else { + if (!quiet_flag) { + printf("Script Set\n"); + } + GuestApp_FreeDict(confDict); + return EXIT_SUCCESS; + } +} + + +/* + *----------------------------------------------------------------------------- + * + * Script_GetDefault -- + * + * Gets the path to default script. + * + * Results: + * EXIT_SUCCESS on success. + * EX_USAGE on parse errors. + * EX_TEMPFAIL on failure. + * + * Side effects: + * Print to stderr on error. + * + *----------------------------------------------------------------------------- + */ + +int +Script_GetDefault(char *apm) // IN: APM name +{ + return GetConfEntry(apm, Default); +} + + +/* + *----------------------------------------------------------------------------- + * + * Script_GetCurrent -- + * + * Gets the path to Current script. + * + * Results: + * EXIT_SUCCESS on success. + * EX_USAGE on parse errors. + * EX_TEMPFAIL on failure. + * + * Side effects: + * Print to stderr on error. + * + *----------------------------------------------------------------------------- + */ + +int +Script_GetCurrent(char *apm) // IN: apm function name +{ + return GetConfEntry(apm, Current); +} + + +/* + *----------------------------------------------------------------------------- + * + * ScriptToggle -- + * + * enables/disable script. + * + * Results: + * EXIT_SUCCESS on success. + * EX_USAGE on parse errors. + * EX_TEMPFAIL on failure. + * + * Side effects: + * Enables/Disables a script + * Print to stderr on error. + * + *----------------------------------------------------------------------------- + */ + +static int +ScriptToggle(char *apm, // IN: APM name + Bool enable, // IN: status + int quiet_flag) // IN: Verbosity flag +{ + const char *path; + char *confName; + GuestApp_Dict *confDict; + confDict = Conf_Load(); + confName = GetConfName(apm); + + if (!confName) { + fprintf(stderr, "Unknown operation\n"); + return EX_USAGE; + } + + if (!enable) { + path = ""; + } else { + path = GuestApp_GetDictEntryDefault (confDict, confName); + } + + GuestApp_SetDictEntry(confDict, confName, path); + + return WriteDict(confDict, quiet_flag); +} + + +/* + *----------------------------------------------------------------------------- + * + * Script_Enable -- + * + * enables script. + * + * Results: + * Same as ScriptToggle. + * + * Side effects: + * Same as ScriptToggle. + * + *----------------------------------------------------------------------------- + */ + +int +Script_Enable(char *apm, // IN: APM name + int quiet_flag) // IN: Verbosity flag +{ + return ScriptToggle(apm, TRUE, quiet_flag); +} + + +/* + *----------------------------------------------------------------------------- + * + * Script_Disable -- + * + * disable script + * + * Results: + * Same as ScriptToggle. + * + * Side effects: + * Same as ScriptToggle. + * + *----------------------------------------------------------------------------- + */ + +int +Script_Disable(char *apm, // IN: APM name + int quiet_flag) // IN: Verbosity Flag +{ + return ScriptToggle(apm, FALSE, quiet_flag); +} + + +/* + *----------------------------------------------------------------------------- + * + * sets a script to the given path -- + * + * disable script. + * + * Results: + * EXIT_SUCCESS on success. + * EX_USAGE on parse errors. + * EX_TEMPFAIL on failure. + * + * Side effects: + * Sets a script. + * Print to stderr and exit on error. + * + *----------------------------------------------------------------------------- + */ + +int +Script_Set(char *apm, // IN: APM name + char *path, // IN: path to script + int quiet_flag) // IN: Verbosity flag +{ + char *confName; + GuestApp_Dict *confDict; + if (!File_Exists(path)) { + fprintf(stderr, "%s doesn't exists\n", path); + return EX_OSFILE; + } + confDict = Conf_Load(); + confName = GetConfName(apm); + if (!confName) { + fprintf(stderr, "Unknown operation\n"); + return EX_USAGE; + } + + GuestApp_SetDictEntry(confDict, confName, path); + return WriteDict(confDict, quiet_flag); + +} + diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/toolbox/toolboxcmd-shrink.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/toolbox/toolboxcmd-shrink.c --- open-vm-tools-2008.01.23-74039/toolbox/toolboxcmd-shrink.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/toolbox/toolboxcmd-shrink.c 2008-10-13 08:01:54.000000000 +0100 @@ -0,0 +1,268 @@ +/********************************************************* + * Copyright (C) 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. + * + *********************************************************/ + +/* + * toolboxcmd-shrink.c -- + * + * The shrink operations for toolbox-cmd + */ + + +#include <string.h> +#include <stdlib.h> + +#ifndef _WIN32 +# include <signal.h> +#endif + +#include "toolboxCmdInt.h" + +#ifndef _WIN32 +static void ShrinkWiperDestroy(int signal); +#endif + +static WiperPartition_List * ShrinkGetMountPoints(void); +static WiperPartition * ShrinkGetPartition(char *mountPoint, int quiet_flag); +static Wiper_State *wiper = NULL; + + +/* + *----------------------------------------------------------------------------- + * + * Shrink_List -- + * + * Prints mount points to stdout. + * + * Results: + * EXIT_SUCCESS. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +int +Shrink_List(void) // IN: Verbosity flag. +{ + int i; + WiperPartition_List *plist = ShrinkGetMountPoints(); + if (plist == NULL) { + return EX_TEMPFAIL; + } + for (i = 0; i < plist->size; i++) { + if (strlen(plist->partitions[i].comment) == 0) { + printf("%s\n", plist->partitions[i].mountPoint); + } + } + WiperPartition_Close(plist); + return EXIT_SUCCESS; +} + + +/* + *----------------------------------------------------------------------------- + * + * ShrinkGetPartition -- + * + * Finds the WiperPartion whose mountpoint is given. + * + * Results: + * The WiperPatition. + * + * Side effects: + * None + * + *----------------------------------------------------------------------------- + */ + +static WiperPartition* +ShrinkGetPartition(char *mountPoint, // IN: mount point + int quiet_flag) // IN: Verbosity flag +{ + int i; + WiperPartition *part; + WiperPartition_List *plist = ShrinkGetMountPoints(); + if (!plist) { + return NULL; + } + part = (WiperPartition *) malloc(sizeof *part); + for (i = 0; i < plist->size; i++) { + if (strcmp(plist->partitions[i].mountPoint, mountPoint) == 0) { + memcpy(part, &plist->partitions[i], sizeof *part); + WiperPartition_Close(plist); + return part; + } + } + WiperPartition_Close(plist); + return NULL; +} + + +/* + *----------------------------------------------------------------------------- + * + * ShrinkGetMountPoints -- + * + * Gets a list of wiper partitions. + * + * Results: + * The WiperPartion_List. + * + * Side effects: + * Prints to stderr on errors. + * + *----------------------------------------------------------------------------- + */ + +static WiperPartition_List* +ShrinkGetMountPoints(void) // IN: Verbosity flag +{ + if (GuestApp_IsDiskShrinkCapable()) { + if (GuestApp_IsDiskShrinkEnabled()) { + Wiper_Init(NULL); + return WiperPartition_Open(); + } else { + fprintf(stderr,SHRINK_DISABLED_ERR); + } + } else { + fprintf(stderr, SHRINK_FEATURE_ERR); + } + return NULL; +} + + +/* + *----------------------------------------------------------------------------- + * + * Shrink_DoShrink -- + * + * Wipe a single partition, returning only when the wiper + * operation is done or canceled. + * + * Results: + * EXIT_SUCCESS on success. + * EX_OSFILE if partition is not found. + * EX_TEMPFAIL on failure. + * + * Side effects: + * The wipe operation will fill the partition with dummy files. + * Prints to stderr on errors. + * + *----------------------------------------------------------------------------- + */ + +int +Shrink_DoShrink(char *mountPoint, // IN: mount point + int quiet_flag) // IN: verbosity flag +{ + int i; + int progress = 0; + unsigned char *err; + WiperPartition *part; +#ifndef _WIN32 + signal(SIGINT, ShrinkWiperDestroy); +#endif + part = ShrinkGetPartition(mountPoint, quiet_flag); + if (part == NULL) { + fprintf(stderr, "Unable to find partition\n"); + return EX_OSFILE; + } + /* + * Verify that shrinking is still possible before going through with the + * wiping. This obviously isn't atomic, but it should take care of + * the case where the user takes a snapshot with the toolbox open. + */ + if (!GuestApp_IsDiskShrinkEnabled()) { + fprintf(stderr, SHRINK_CONFLICT_ERR); + free(part); + return EX_TEMPFAIL; + } + + wiper = Wiper_Start (part, MAX_WIPER_FILE_SIZE); + while (progress < 100 && wiper != NULL) { + err = Wiper_Next(&wiper, &progress); + if (strlen(err) > 0) { + if (strcmp(err, "error.create") == 0) { + fprintf(stderr, "Error, Unable to create wiper file\n"); + free(part); + return EX_TEMPFAIL; + } + else { + fprintf(stderr, "Error, %s", err); + free(part); + return EX_TEMPFAIL; + } + free(wiper); + wiper = NULL; + } + if (!quiet_flag) { + printf("\rProgress: %d [", progress); + for (i = 0; i <= progress / 10; i++) { + printf("="); + } + printf(">"); + for (; i <= 100 / 10; i++) { + printf(" "); + } + printf("]"); + } + } + if (progress >= 100) { + if (!quiet_flag) { + printf("\nDisk shrinking complete\n"); + } + wiper = NULL; + free(part); + return EXIT_SUCCESS; + } else { + fprintf(stderr, "Shrinking not completed\n"); + return EX_TEMPFAIL; + } +} + + +#ifndef _WIN32 +/* + *----------------------------------------------------------------------------- + * + * ShrinkWiperDestroy -- + * + * Catch SIGINT and cancel wiper operation. + * + * Results: + * None. + * + * Side effects: + * The wipe operation will be canceled, and "zero" files removed. + * We will also exit the vmware-toolbox-cmd program. + * + *----------------------------------------------------------------------------- + */ + +void +ShrinkWiperDestroy(int signal) // IN: Signal caught +{ + if (wiper != NULL) { + Wiper_Cancel(&wiper); + wiper = NULL; + } + printf("Disk shrink canceled\n"); + exit(EXIT_SUCCESS); +} +#endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/toolbox/toolboxcmd-stat.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/toolbox/toolboxcmd-stat.c --- open-vm-tools-2008.01.23-74039/toolbox/toolboxcmd-stat.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/toolbox/toolboxcmd-stat.c 2008-10-13 08:01:54.000000000 +0100 @@ -0,0 +1,488 @@ +/********************************************************* + * Copyright (C) 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. + * + *********************************************************/ + +/* + * toolboxcmd-stat.c -- + * + * Various stat operations for toolbox-cmd + */ + +#include <time.h> +#include "toolboxCmdInt.h" + + +/* + * Local Functions + */ + +static int OpenHandle(VMGuestLibHandle *glHandle,VMGuestLibError *glError); + + +/* + *----------------------------------------------------------------------------- + * + * OpenHandle -- + * + * Opens a VMGuestLibHandle. + * + * Results: + * 0 on success. + * EX_UNAVAILABLE on failure to open handle. + * EX_TEMPFAIL on failure to update info. + * + * Side effects: + * Prints to stderr and exits on error. + * + *----------------------------------------------------------------------------- + */ + +static int +OpenHandle(VMGuestLibHandle *glHandle, // OUT: The guestlib handle + VMGuestLibError *glError) // OUT: The errors when opening the handle +{ + *glError = VMGuestLib_OpenHandle(glHandle); + if (*glError != VMGUESTLIB_ERROR_SUCCESS) { + fprintf(stderr, "OpenHandle failed: %s\n", VMGuestLib_GetErrorText(*glError)); + return EX_UNAVAILABLE; + } + *glError = VMGuestLib_UpdateInfo(*glHandle); + if (*glError != VMGUESTLIB_ERROR_SUCCESS) { + fprintf(stderr, "UpdateInfo failed: %s\n", VMGuestLib_GetErrorText(*glError)); + return EX_TEMPFAIL; + } + return 0; // We don't return EXIT_SUCCESSS to indicate that this is not + // an exit code + +} + + +/* + *----------------------------------------------------------------------------- + * + * Stat_ProcessorSpeed -- + * + * Gets the Processor Speed. + * + * Results: + * EXIT_SUCCESS on success. + * EX_TEMPFAIL on failure. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +int +Stat_ProcessorSpeed(void) +{ + uint32 speed; + Backdoor_proto bp; + bp.in.cx.halfs.low = BDOOR_CMD_GETMHZ; + Backdoor(&bp); + speed = bp.out.ax.word; + if (speed < 0) { + fprintf(stderr, "Unable to get processor speed\n"); + return EX_TEMPFAIL; + } + printf("%u MHz\n", speed); + return EXIT_SUCCESS; +} + + +/* + *----------------------------------------------------------------------------- + * + * Stat_MemorySize -- + * + * Gets the virtual machine's memory in MBs. + * + * Results: + * EXIT_SUCCESS on success. + * EX_TEMPFAIL on failure. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +int +Stat_MemorySize(void) +{ + uint32 memsize; + Backdoor_proto bp; + bp.in.cx.halfs.low = BDOOR_CMD_GETMEMSIZE; + Backdoor(&bp); + memsize = bp.out.ax.word; + if (memsize < 0) { + fprintf(stderr, "Unable to get memory size\n"); + return EX_TEMPFAIL; + } + printf("%u MB\n", memsize); + return EXIT_SUCCESS; +} + + +/* + *----------------------------------------------------------------------------- + * + * Stat_HostTime -- + * + * Gets the host machine's time. + * + * Results: + * EXIT_SUCCESS on success. + * EX_TEMPFAIL on failure. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +int +Stat_HostTime(void) +{ + int64 hostSecs; + int64 hostUsecs; + time_t sec; + char buf[256]; + Backdoor_proto bp; + + bp.in.cx.halfs.low = BDOOR_CMD_GETTIMEFULL; + Backdoor(&bp); + if (bp.out.ax.word == BDOOR_MAGIC) { + hostSecs = ((uint64)bp.out.si.word << 32) | bp.out.dx.word; + } else { + /* Falling back to older command. */ + bp.in.cx.halfs.low = BDOOR_CMD_GETTIME; + Backdoor(&bp); + hostSecs = bp.out.ax.word; + } + hostUsecs = bp.out.bx.word; + + if (hostSecs <= 0) { + fprintf(stderr, "Unable to get host time\n"); + return EX_TEMPFAIL; + } + + sec = hostSecs + (hostUsecs / 1000000); + if (strftime(buf, sizeof buf, "%d %b %Y %H:%M:%S", localtime(&sec)) == 0) { + fprintf(stderr, "Unable to format host time\n"); + return EX_TEMPFAIL; + } + printf("%s\n", buf); + return EXIT_SUCCESS; +} + + +/* + *----------------------------------------------------------------------------- + * + * Stat_GetSessionID -- + * + * Gets the Session ID for the virtual machine + * Works only if the host is ESX. + * + * Results: + * EXIT_SUCCESS on success. + * EX_TEMPFAIL on failure. + * + * Side effects: + * Prints to stderr on error. + * + *----------------------------------------------------------------------------- + */ + +int +Stat_GetSessionID(void) +{ + int exitStatus = EXIT_SUCCESS; + uint64 session; + VMGuestLibHandle glHandle; + VMGuestLibError glError; + + exitStatus = OpenHandle(&glHandle, &glError); + if (exitStatus) { + return exitStatus; + } + glError = VMGuestLib_GetSessionId(glHandle, &session); + if (glError != VMGUESTLIB_ERROR_SUCCESS) { + fprintf(stderr, "Failed to get session ID: %s\n", + VMGuestLib_GetErrorText(glError)); + exitStatus = EX_TEMPFAIL; + } else { + printf("0x%"FMT64"x\n", session); + } + VMGuestLib_CloseHandle(glHandle); + return exitStatus; +} + + +/* + *----------------------------------------------------------------------------- + * + * Stat_GetMemoryBallooned -- + * + * Retrieves memory ballooned. + * Works only if the host is ESX. + * + * Results: + * EXIT_SUCCESS on success. + * EX_TEMPFAIL on failure. + * + * Side effects: + * Prints to stderr on error. + * + *----------------------------------------------------------------------------- + */ + +int +Stat_GetMemoryBallooned(void) +{ + int exitStatus = EXIT_SUCCESS; + uint32 memBallooned; + VMGuestLibHandle glHandle; + VMGuestLibError glError; + + exitStatus = OpenHandle(&glHandle, &glError); + if (exitStatus) { + return exitStatus; + } + glError = VMGuestLib_GetMemBalloonedMB(glHandle, &memBallooned); + if (glError != VMGUESTLIB_ERROR_SUCCESS) { + fprintf(stderr, "Failed to get CPU Limit: %s\n", VMGuestLib_GetErrorText(glError)); + exitStatus = EX_TEMPFAIL; + } else { + printf("%u MHz\n", memBallooned); + } + VMGuestLib_CloseHandle(glHandle); + return exitStatus; +} + + +/* + *----------------------------------------------------------------------------- + * + * Stat_GetMemoryReservation -- + * + * Retrieves min memory. + * Works only if the host is ESX. + * + * Results: + * EXIT_SUCCESS on success. + * EX_TEMPFAIL on failure. + * + * Side effects: + * Prints to stderr on error. + * + *----------------------------------------------------------------------------- + */ + +int +Stat_GetMemoryReservation(void) +{ + int exitStatus = EXIT_SUCCESS; + uint32 memReservation; + VMGuestLibHandle glHandle; + VMGuestLibError glError; + + exitStatus = OpenHandle(&glHandle, &glError); + if (exitStatus) { + return exitStatus; + } + glError = VMGuestLib_GetMemReservationMB(glHandle, &memReservation); + if (glError != VMGUESTLIB_ERROR_SUCCESS) { + fprintf(stderr, "Failed to get CPU Limit: %s\n", VMGuestLib_GetErrorText(glError)); + exitStatus = EX_TEMPFAIL; + } else { + printf("%u MB\n", memReservation); + } + VMGuestLib_CloseHandle(glHandle); + return exitStatus; +} + + +/* + *----------------------------------------------------------------------------- + * + * Stat_GetMemorySwapped -- + * + * Retrieves swapped memory. + * Works only if the host is ESX. + * + * Results: + * EXIT_SUCCESS on success. + * EX_TEMPFAIL on failure. + * + * Side effects: + * Prints to stderr on error. + * If OpenHandle fails the program exits. + * + *----------------------------------------------------------------------------- + */ + +int +Stat_GetMemorySwapped(void) +{ + int exitStatus = EXIT_SUCCESS; + uint32 memSwapped; + VMGuestLibHandle glHandle; + VMGuestLibError glError; + + exitStatus = OpenHandle(&glHandle, &glError); + if (exitStatus) { + return exitStatus; + } + glError = VMGuestLib_GetMemSwappedMB(glHandle, &memSwapped); + if (glError != VMGUESTLIB_ERROR_SUCCESS) { + fprintf(stderr, "Failed to get CPU Limit: %s\n", VMGuestLib_GetErrorText(glError)); + exitStatus = EX_TEMPFAIL; + } else { + printf("%u MB\n", memSwapped); + } + VMGuestLib_CloseHandle(glHandle); + return exitStatus; +} + + +/* + *----------------------------------------------------------------------------- + * + * Stat_GetMemoryLimit -- + * + * Retrieves max memory. + * Works only if the host is ESX. + * + * Results: + * EXIT_SUCCESS on success. + * EX_TEMPFAIL on failure. + * + * Side effects: + * Prints to stderr on error. + * + *----------------------------------------------------------------------------- + */ + +int +Stat_GetMemoryLimit(void) +{ + int exitStatus = EXIT_SUCCESS; + uint32 memLimit; + VMGuestLibHandle glHandle; + VMGuestLibError glError; + + exitStatus = OpenHandle(&glHandle, &glError); + if (exitStatus) { + return exitStatus; + } + glError = VMGuestLib_GetMemLimitMB(glHandle, &memLimit); + if (glError != VMGUESTLIB_ERROR_SUCCESS) { + fprintf(stderr, "Failed to get CPU Limit: %s\n", VMGuestLib_GetErrorText(glError)); + exitStatus = EX_TEMPFAIL; + } else { + printf("%u MB\n", memLimit); + } + VMGuestLib_CloseHandle(glHandle); + return exitStatus; +} + + +/* + *----------------------------------------------------------------------------- + * + * Stat_GetCpuReservation -- + * + * Retrieves cpu min speed. + * Works only if the host is ESX. + * + * Results: + * EXIT_SUCCESS on success. + * EX_TEMPFAIL on failure. + * + * Side effects: + * Prints to stderr on error. + * + *----------------------------------------------------------------------------- + */ + +int +Stat_GetCpuReservation(void) +{ + int exitStatus = EXIT_SUCCESS; + uint32 cpuReservation; + VMGuestLibHandle glHandle; + VMGuestLibError glError; + + exitStatus = OpenHandle(&glHandle, &glError); + if (exitStatus) { + return exitStatus; + } + glError = VMGuestLib_GetCpuReservationMHz(glHandle, &cpuReservation); + if (glError != VMGUESTLIB_ERROR_SUCCESS) { + fprintf(stderr, "Failed to get CPU Limit: %s\n", VMGuestLib_GetErrorText(glError)); + exitStatus = EX_TEMPFAIL; + } else { + printf("%u MHz\n", cpuReservation); + } + VMGuestLib_CloseHandle(glHandle); + return exitStatus; +} + + +/* + *----------------------------------------------------------------------------- + * + * Stat_GetCpuLimit -- + * + * Retrieves cpu max speed . + * Works only if the host is ESX. + * + * Results: + * EXIT_SUCCESS on success. + * EX_TEMPFAIL on failure. + * + * Side effects: + * Prints to stderr on error. + * + *----------------------------------------------------------------------------- + */ + +int +Stat_GetCpuLimit(void) +{ + int exitStatus = EXIT_SUCCESS; + uint32 cpuLimit; + VMGuestLibHandle glHandle; + VMGuestLibError glError; + + exitStatus = OpenHandle(&glHandle, &glError); + if (exitStatus) { + return exitStatus; + } + glError = VMGuestLib_GetCpuLimitMHz(glHandle, &cpuLimit); + if (glError != VMGUESTLIB_ERROR_SUCCESS) { + fprintf(stderr, "Failed to get CPU Limit: %s\n", VMGuestLib_GetErrorText(glError)); + exitStatus = EX_TEMPFAIL; + } else { + printf("%u MHz\n", cpuLimit); + } + VMGuestLib_CloseHandle(glHandle); + return exitStatus; +} diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/toolbox/toolboxcmd-time.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/toolbox/toolboxcmd-time.c --- open-vm-tools-2008.01.23-74039/toolbox/toolboxcmd-time.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/toolbox/toolboxcmd-time.c 2008-10-13 08:01:54.000000000 +0100 @@ -0,0 +1,132 @@ +/********************************************************* + * Copyright (C) 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. + * + *********************************************************/ + +/* + * toolboxcmd-time.c -- + * + * The time sync operations for toolbox-cmd + */ + +#include "toolboxCmdInt.h" + + +/* + *----------------------------------------------------------------------------- + * + * TimeSyncSet -- + * + * Enable/disable time sync + * + * Results: + * None + * + * Side effects: + * If time syncing is turned on the system time may be changed + * Prints to stderr and exits on errors + * + *----------------------------------------------------------------------------- + */ + +static void +TimeSyncSet(Bool enable) // IN: status +{ + GuestApp_SetOptionInVMX(TOOLSOPTION_SYNCTIME, + !enable ? "1" : "0", enable ? "1" : "0"); +} + + +/* + *----------------------------------------------------------------------------- + * + * TimeSync_Enable -- + * + * Enable time sync. + * + * Results: + * EXIT_SUCCESS + * + * Side effects: + * Same as TimeSyncSet. + * + *----------------------------------------------------------------------------- + */ + +int +TimeSync_Enable(int quiet_flag) // IN: verbosity flag +{ + TimeSyncSet(TRUE); + if (!quiet_flag) { + printf("Enabled\n"); + } + return EXIT_SUCCESS; +} + + +/* + *----------------------------------------------------------------------------- + * + * TimeSync_Disable -- + * + * Disable time sync. + * + * Results: + * EXIT_SUCCESS + * + * Side effects: + * Same as TimeSyncSet. + * + *----------------------------------------------------------------------------- + */ + +int +TimeSync_Disable(int quiet_flag) // IN: verbosity flag +{ + TimeSyncSet(FALSE); + if (!quiet_flag) { + printf("Disabled\n"); + } + return EXIT_SUCCESS; +} + + +/* + *----------------------------------------------------------------------------- + * + * TimeSync_Status -- + * + * Checks the status of time sync in VMX. + * + * Results: + * EXIT_SUCCESS + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +int +TimeSync_Status(void) +{ + Bool status = FALSE; + if (GuestApp_OldGetOptions() & VMWARE_GUI_SYNC_TIME) { + status = TRUE; + } + printf("%s\n", status ? "Enabled" : "Disabled"); + return EXIT_SUCCESS; +} diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/toolbox/toolboxcmd_version.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/toolbox/toolboxcmd_version.h --- open-vm-tools-2008.01.23-74039/toolbox/toolboxcmd_version.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/toolbox/toolboxcmd_version.h 2008-10-13 08:01:54.000000000 +0100 @@ -0,0 +1,39 @@ +/********************************************************* + * Copyright (C) 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. + * + *********************************************************/ + +/* + * toolboxcmd_version.h -- + * + * Version definitions for the vmware-toolbox-cmd program + */ + +#ifndef _TOOLBOXCMD_VERSION_H_ +#define _TOOLBOXCMD_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 TOOLBOXCMD_VERSION_COMMAS TOOLS_VERSION_EXT_CURRENT_CSV +#define TOOLBOXCMD_VERSION_STRING TOOLS_VERSION_EXT_CURRENT_STR + +#endif /* _TOOLBOXCMD_VERSION_H_ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/toolbox/toolboxDevices.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/toolbox/toolboxDevices.c --- open-vm-tools-2008.01.23-74039/toolbox/toolboxDevices.c 2008-01-28 08:02:54.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/toolbox/toolboxDevices.c 2008-10-13 08:01:54.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -26,7 +26,7 @@ #include <stdlib.h> #include <stdio.h> -#include "toolboxInt.h" +#include "toolboxGtkInt.h" #include "removable_device.h" #include "guestApp.h" #include "eventManager.h" diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/toolbox/toolbox-gtk.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/toolbox/toolbox-gtk.c --- open-vm-tools-2008.01.23-74039/toolbox/toolbox-gtk.c 2008-01-28 08:02:54.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/toolbox/toolbox-gtk.c 2008-10-13 08:01:54.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -26,7 +26,7 @@ #include <stdlib.h> #include <string.h> -#include "toolboxInt.h" +#include "toolboxGtkInt.h" #include "vm_assert.h" #include "vm_app.h" #include "eventManager.h" @@ -42,6 +42,8 @@ #include "smallIcon.xpm" #include "conf.h" #include "toolboxgtk_version.h" +#include "util.h" +#include "system.h" #include "embed_version.h" VM_EMBED_VERSION(TOOLBOXGTK_VERSION_STRING); @@ -62,13 +64,24 @@ /* * Globals */ -static char hlpDir[PATH_MAX]; +static char *hlpDir = NULL; static Display *gXDisplay; static Window gXRoot; RpcIn *gRpcInCtlPanel; static GtkWidget *toolsMain; static Bool optionAutoHide; static guint gTimeoutId; +static const char **gNativeEnviron; + +/* Help pages. These need to be in the same order as the tabs in the UI. */ +static const char *gHelpPages[] = { + "index.html", + "tools_options.htm", + "tools_devices.htm", + "tools_scripts.htm", + "tools_shrink.htm", + "tools_about.htm", +}; /* * All signals that: @@ -105,8 +118,7 @@ GtkWidget* ToolsMain_Create(void); -Bool RpcInResetCB(char const **result, size_t *resultLen, const char *name, - const char *args, size_t argsSize, void *clientData); +Bool RpcInResetCB(RpcInData *data); Bool RpcInSetOptionCB(char const **result, size_t *resultLen, const char *name, const char *args, size_t argsSize, void *clientData); Bool RpcInCapRegCB(char const **result, size_t *resultLen, const char *name, @@ -145,7 +157,7 @@ gRpcInCtlPanel = NULL; } - /* Remove timeout so event queue isn't pumped after being destroyed. */ + /* Remove timeout so event queue isn't pumped after being destroyed. */ gtk_timeout_remove(gTimeoutId); ASSERT(gEventQueue); EventManager_Destroy(gEventQueue); @@ -157,7 +169,7 @@ * * ToolsMainSignalHandler -- * - * Handler for Posix signals. We do this to ensure that we exit + * Handler for Posix signals. We do this to ensure that we exit * gracefully. * * Results: @@ -198,12 +210,17 @@ { char helpPage[1000]; + if (hlpDir == NULL) { + ToolsMain_MsgBox("Error", "Unable to determine where help pages are stored."); + return; + } + if (help == NULL) { ToolsMain_MsgBox("Error", "No help was found for the page."); return; } - Str_Snprintf(helpPage, sizeof helpPage, "file:%s%s", hlpDir, help); + Str_Snprintf(helpPage, sizeof helpPage, "file:%s/%s", hlpDir, help); if (!GuestApp_OpenUrl(helpPage, FALSE)) { ToolsMain_MsgBox("Help Unavailable", "Sorry, but help requires a web browser. You may need " @@ -234,8 +251,7 @@ ToolsMain_OnHelp(gpointer btn, // IN: Unused gpointer data) // IN: notebook containing all tabs { - char *text; - GtkWidget *curPage; + gint page; GtkNotebook *nb; nb = GTK_NOTEBOOK(data); @@ -243,21 +259,19 @@ return; } - curPage = gtk_notebook_get_nth_page(nb, gtk_notebook_get_current_page(nb)); - gtk_label_get(GTK_LABEL(gtk_notebook_get_tab_label(nb,curPage)), &text); - if (strcmp(text, TAB_LABEL_OPTIONS) == 0) { - ToolsMain_OpenHelp("tools_options.htm"); - } else if (strcmp(text, TAB_LABEL_DEVICES) == 0) { - ToolsMain_OpenHelp("tools_devices.htm"); - } else if (strcmp(text, TAB_LABEL_SCRIPTS) == 0) { - ToolsMain_OpenHelp("tools_scripts.htm"); - } else if (strcmp(text, TAB_LABEL_SHRINK) == 0) { - ToolsMain_OpenHelp("tools_shrink.htm"); - } else if (strcmp(text, TAB_LABEL_ABOUT) == 0) { - ToolsMain_OpenHelp("tools_about.htm"); - } else { - ToolsMain_OpenHelp("index.htm"); + page = gtk_notebook_get_current_page(nb) + 1; + ASSERT(page > 0); + + if (page >= ARRAYSIZE(gHelpPages)) { + char *text; + GtkWidget *curPage; + curPage = gtk_notebook_get_nth_page(nb, page - 1); + gtk_label_get(GTK_LABEL(gtk_notebook_get_tab_label(nb,curPage)), &text); + Warning("No help page for tab %s, defaulting to index.\n", text); + page = 0; } + + ToolsMain_OpenHelp(gHelpPages[page]); } @@ -301,12 +315,18 @@ gtk_widget_show(label); gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), label); +#ifdef GTK2 + okbtn = gtk_button_new_with_mnemonic("_OK"); +#else okbtn = gtk_button_new_with_label("OK"); +#endif gtk_widget_show(okbtn); gtk_box_pack_end(GTK_BOX(GTK_DIALOG(dialog)->action_area), okbtn, FALSE, FALSE, 0); gtk_widget_set_usize(okbtn, 70, 25); gtk_signal_connect_object(GTK_OBJECT(okbtn), "clicked", GTK_SIGNAL_FUNC(gtk_widget_destroy), GTK_OBJECT(dialog)); + GTK_WIDGET_SET_FLAGS(okbtn, GTK_CAN_DEFAULT); + gtk_widget_grab_default(okbtn); gtk_widget_show_all(dialog); } @@ -352,14 +372,22 @@ gtk_widget_show(label); gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), label); +#ifdef GTK2 + btn = gtk_button_new_with_mnemonic("_Yes"); +#else btn = gtk_button_new_with_label("Yes"); +#endif gtk_widget_show(btn); gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->action_area), btn, FALSE, FALSE, 0); gtk_widget_set_usize(btn, 70, 25); gtk_signal_connect(GTK_OBJECT(btn), "clicked", GTK_SIGNAL_FUNC(ToolsMain_YesNoBoxOnClicked), &ret); +#ifdef GTK2 + btn = gtk_button_new_with_mnemonic("_No"); +#else btn = gtk_button_new_with_label("No"); +#endif gtk_widget_show(btn); gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->action_area), btn, FALSE, FALSE, 0); gtk_widget_set_usize(btn, 70, 25); @@ -528,31 +556,55 @@ gtk_box_pack_start(GTK_BOX(vbox), notebookMain, TRUE, TRUE, 0); gtk_container_set_border_width(GTK_CONTAINER(notebookMain), 0); +#ifdef GTK2 + gtk_notebook_append_page(GTK_NOTEBOOK(notebookMain), Options_Create(ToolsMain), + gtk_label_new_with_mnemonic(TAB_LABEL_OPTIONS)); +#else gtk_notebook_append_page(GTK_NOTEBOOK(notebookMain), Options_Create(ToolsMain), gtk_label_new(TAB_LABEL_OPTIONS)); +#endif - /* - * Beginning with ACE1, a VM could be configured to prevent editing of - * device state from the guest. So we enable the devices page only if the + /* + * Beginning with ACE1, a VM could be configured to prevent editing of + * device state from the guest. So we enable the devices page only if the * command fails (meaning we're pre-ACE1), or if the command succeeds and * we're allowed to edit the devices. */ if (!RpcOut_sendOne(&result, &resultLen, "vmx.capability.edit_devices") || strcmp(result, "0") != 0) { - gtk_notebook_append_page(GTK_NOTEBOOK(notebookMain), +#ifdef GTK2 + gtk_notebook_append_page(GTK_NOTEBOOK(notebookMain), + Devices_Create(ToolsMain), + gtk_label_new_with_mnemonic(TAB_LABEL_DEVICES)); +#else + gtk_notebook_append_page(GTK_NOTEBOOK(notebookMain), Devices_Create(ToolsMain), gtk_label_new(TAB_LABEL_DEVICES)); +#endif } else { Debug("User not allowed to edit devices"); } free(result); +#ifdef GTK2 gtk_notebook_append_page(GTK_NOTEBOOK(notebookMain), Scripts_Create(ToolsMain), - gtk_label_new(TAB_LABEL_SCRIPTS)); + gtk_label_new_with_mnemonic(TAB_LABEL_SCRIPTS)); + gtk_notebook_append_page(GTK_NOTEBOOK(notebookMain), Shrink_Create(ToolsMain), + gtk_label_new_with_mnemonic(TAB_LABEL_SHRINK)); + gtk_notebook_append_page(GTK_NOTEBOOK(notebookMain), Record_Create(ToolsMain), + gtk_label_new_with_mnemonic(TAB_LABEL_RECORD)); + gtk_notebook_append_page(GTK_NOTEBOOK(notebookMain), About_Create(ToolsMain), + gtk_label_new_with_mnemonic(TAB_LABEL_ABOUT)); +#else + gtk_notebook_append_page(GTK_NOTEBOOK(notebookMain), Scripts_Create(ToolsMain), + gtk_label_new(TAB_LABEL_SCRIPTS)); gtk_notebook_append_page(GTK_NOTEBOOK(notebookMain), Shrink_Create(ToolsMain), gtk_label_new(TAB_LABEL_SHRINK)); + gtk_notebook_append_page(GTK_NOTEBOOK(notebookMain), Record_Create(ToolsMain), + gtk_lable_new(TAB_LABEL_RECORD)); gtk_notebook_append_page(GTK_NOTEBOOK(notebookMain), About_Create(ToolsMain), gtk_label_new(TAB_LABEL_ABOUT)); +#endif hbox = gtk_hbutton_box_new(); gtk_button_box_set_spacing(GTK_BUTTON_BOX(hbox), 10); @@ -560,19 +612,27 @@ gtk_widget_show(hbox); gtk_box_pack_end(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); - /* + /* * The HIG says that the Help button should be in the lower left, and all * other buttons in the lower right. * * See http://developer.gnome.org/projects/gup/hig/2.0/windows-alert.html#alert-button-order */ +#ifdef GTK2 + btn = gtk_button_new_with_mnemonic("_Help"); +#else btn = gtk_button_new_with_label("Help"); +#endif gtk_widget_show(btn); gtk_box_pack_start(GTK_BOX(hbox), btn, FALSE, FALSE, 0); gtk_signal_connect(GTK_OBJECT(btn), "clicked", GTK_SIGNAL_FUNC(ToolsMain_OnHelp), notebookMain); +#ifdef GTK2 + btn = gtk_button_new_with_mnemonic("_Close"); +#else btn = gtk_button_new_with_label("Close"); +#endif gtk_widget_show(btn); gtk_box_pack_start(GTK_BOX(hbox), btn, FALSE, FALSE, 0); gtk_signal_connect_object(GTK_OBJECT(btn), "clicked", @@ -602,17 +662,11 @@ */ Bool -RpcInResetCB(char const **result, // OUT - size_t *resultLen, // OUT - const char *name, // IN - const char *args, // IN - size_t argsSize, // Unused - void *clientData) // Unused +RpcInResetCB(RpcInData *data) // IN/OUT { Debug("----------toolbox: Received 'reset' from vmware\n"); - return RpcIn_SetRetVals(result, resultLen, "ATR " TOOLS_CTLPANEL_NAME, - TRUE); + return RPCIN_SETRETVALS(data, "ATR " TOOLS_CTLPANEL_NAME, TRUE); } @@ -820,6 +874,54 @@ /* *----------------------------------------------------------------------------- * + * InitHelpDir -- + * + * Queries the Tools config dictionary for the location of the Toolbox + * Help docs. If not found, will try to fall back to semi-safe defaults. + * + * Results: + * None. + * + * Side effects: + * If a suitable directory was found, hlpDir will point to a buffer + * containing it. Otherwise it will remain NULL. + * + *----------------------------------------------------------------------------- + */ + +void +InitHelpDir(GuestApp_Dict *pConfDict) // IN +{ + const char *tmpDir = NULL; + + ASSERT(hlpDir == NULL); + + tmpDir = GuestApp_GetDictEntry(pConfDict, CONFNAME_HELPDIR); + if (!tmpDir || !File_Exists(tmpDir)) { + unsigned int i; + + static const char *candidates[] = { + "/usr/lib/vmware-tools/hlp", // Linux, Solaris + "/usr/local/lib/vmware-tools/hlp", // FreeBSD + }; + + for (i = 0; i < ARRAYSIZE(candidates); i++) { + if (File_Exists(candidates[i])) { + tmpDir = candidates[i]; + break; + } + } + } + + if (tmpDir) { + hlpDir = Util_SafeStrdup(tmpDir); + } +} + + +/* + *----------------------------------------------------------------------------- + * * ShowUsage -- * * Print out usage information to stdout. @@ -841,10 +943,13 @@ " %s --help\n" " Display this help message.\n" "\n" - " %s --minimize|--inconify\n" + " %s --minimize|--iconify\n" " Start the toolbox window minimized.\n" + "\n" + " %s --version\n" + " Show the VMware(R) Tools version.\n" "\n", - prog, prog); + prog, prog, prog); } @@ -856,7 +961,7 @@ * This is main * * Results: - * 0 on success, -1 otherwise + * 0 on success. * * Side effects: * The linux toolbox ui will run and do a variety of tricks for your @@ -865,35 +970,18 @@ *----------------------------------------------------------------------------- */ int -main(int argc, char *argv[]) +main(int argc, // IN: ARRAY_SIZEOF(argv) + char *argv[], // IN: argument vector + const char *envp[]) // IN: environment vector { - char *tmp; - Bool optIconify, optHelp; + Bool optIconify, optHelp, optVersion; struct sigaction olds[ARRAYSIZE(gSignals)]; GuestApp_Dict *pConfDict; - /* - * Setup the path to the help directory. We assume that this binary lives in - * "LIBDIR/<some_bin_path>" and that the help directory is "LIBDIR/hlp". - * - * If for some reason this isn't true (if argv[0] lacks enough parent - * directories) we'll still initialize the help directory path to something, - * but subsequent help requests will probably fail. - */ - Str_Strcpy(hlpDir, argv[0], sizeof hlpDir); - tmp = Str_Strrchr(hlpDir, '/'); - if (tmp) { - *tmp-- = '\0'; - tmp = Str_Strrchr(hlpDir, '/'); - if (tmp) { - *tmp = '\0'; - } - } - Str_Strcat(hlpDir, "/hlp/", sizeof hlpDir); - if (!VmCheck_IsVirtualWorld()) { #ifndef ALLOW_TOOLS_IN_FOREIGN_VM - Panic("The VMware Toolbox must be run inside a virtual machine.\n"); + Warning("The VMware Toolbox must be run inside a virtual machine.\n"); + return 1; #else runningInForeignVM = TRUE; #endif @@ -907,6 +995,7 @@ pConfDict = Conf_Load(); Debug_Set(GuestApp_GetDictEntryBool(pConfDict, CONFNAME_LOG), DEBUG_PREFIX); Debug_EnableToFile(GuestApp_GetDictEntry(pConfDict, CONFNAME_LOGFILE), FALSE); + InitHelpDir(pConfDict); GuestApp_FreeDict(pConfDict); optionAutoHide = FALSE; @@ -929,12 +1018,15 @@ /* Default values */ optIconify = FALSE; optHelp = FALSE; + optVersion = FALSE; if (argc == 2) { if (strcmp(argv[1], "--iconify") == 0) { optIconify = TRUE; } else if (strcmp(argv[1], "--minimize") == 0) { - optIconify = TRUE; + optIconify = TRUE; + } else if (strcmp(argv[1], "--version") == 0) { + optVersion = TRUE; } else { optHelp = TRUE; } @@ -946,6 +1038,17 @@ ShowUsage(argv[0]); exit(0); } + if (optVersion) { + printf("VMware(R) Tools version %s\n", TOOLS_VERSION); + exit(0); + } + + /* + * Determine our pre-VMware wrapper native environment for use with spawned + * applications. + */ + gNativeEnviron = System_GetNativeEnviron(envp); + GuestApp_SetSpawnEnviron(gNativeEnviron); /* * See bug 73119. Some distros (SUSE 9.2 64-bit) set LC_CTYPE to the UTF-8 version of @@ -1005,16 +1108,18 @@ */ gTimeoutId = gtk_timeout_add(0, &EventQueuePump, NULL); - /* - * We'll block here until the window is destroyed or a - * signal is received. + /* + * We'll block here until the window is destroyed or a + * signal is received. */ gtk_main(); Signal_ResetGroupHandler(gSignals, olds, ARRAYSIZE(gSignals)); + System_FreeNativeEnviron(gNativeEnviron); gdk_pixmap_unref(pixmap); gdk_bitmap_unref(bitmask); + free(hlpDir); return 0; } diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/toolbox/toolboxGtkInt.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/toolbox/toolboxGtkInt.h --- open-vm-tools-2008.01.23-74039/toolbox/toolboxGtkInt.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/toolbox/toolboxGtkInt.h 2008-10-13 08:01:54.000000000 +0100 @@ -0,0 +1,88 @@ +/********************************************************* + * Copyright (C) 2004 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. + * + *********************************************************/ + +/* + * toolboxInt.h -- + * + * Common defines used by the gtk toolbox + */ +#ifndef _TOOLBOX_GTK_INT_H_ +# define _TOOLBOX_GTK_INT_H_ + +#include <X11/Xlib.h> +#include <gtk/gtk.h> +#include <gdk/gdkx.h> +#undef Bool +#include "toolboxInt.h" +#include "vm_basic_types.h" +#include "vm_version.h" +#include "dbllnklst.h" + +#define RPCIN_POLL_TIME 10 /* in 1/1000ths of a second */ +#define DEVICES_POLL_TIME 100 /* in 1/1000ths of a second */ +#define WIPER_POLL_TIME 10 /* in 1/1000ths of a second */ +#define POST_RESET_TIME 100 /* in 1/1000ths of a second */ + +#define SCRIPT_SUSPEND "Suspend Guest Operating System" +#define SCRIPT_RESUME "Resume Guest Operating System" +#define SCRIPT_OFF "Shut Down Guest Operating System" +#define SCRIPT_ON "Power On Guest Operating System" + +#if GTK2 +#define TAB_LABEL_OPTIONS "_Options" +#define TAB_LABEL_DEVICES "De_vices" +#define TAB_LABEL_SCRIPTS "Scri_pts" +#define TAB_LABEL_SHRINK "Shrin_k" +#define TAB_LABEL_RECORD "_Record" +#define TAB_LABEL_ABOUT "Abo_ut" +#else +#define TAB_LABEL_OPTIONS "Options" +#define TAB_LABEL_DEVICES "Devices" +#define TAB_LABEL_SCRIPTS "Scripts" +#define TAB_LABEL_SHRINK "Shrink" +#define TAB_LABEL_RECORD "Record" +#define TAB_LABEL_ABOUT "About" +#endif + +void OnViewportSizeRequest(GtkWidget *widget, GtkRequisition *requisition, + gpointer user_data); + +Bool ToolsMain_YesNoBox(gchar* title, gchar *msg); +void ToolsMain_MsgBox(gchar* title, gchar *msg); +void ToolsMain_OnDestroy(GtkWidget *widget, gpointer data); + +GtkWidget* About_Create(GtkWidget* mainWnd); +GtkWidget* Devices_Create(GtkWidget* mainWnd); +GtkWidget* Options_Create(GtkWidget* mainWnd); +GtkWidget* Scripts_Create(GtkWidget* mainWnd); +GtkWidget* Shrink_Create(GtkWidget* mainWnd); +GtkWidget* Record_Create(GtkWidget* mainWnd); + +void Options_OnTimeSyncToggled(gpointer btn, gpointer data); +void Devices_OnDeviceToggled(gpointer btn, gpointer data); +void Pointer_SetXCursorPos(int x, int y); +void Scripts_OnApply(gpointer btn, gpointer data); + +extern GdkPixmap* pixmap; +extern GdkBitmap* bitmask; +extern GdkColormap* colormap; +extern GtkWidget *optionsTimeSync; +extern DblLnkLst_Links *gEventQueue; +extern GtkWidget *scriptsApply; + +#endif // _TOOLBOX_INT_H_ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/toolbox/toolboxgtk_version.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/toolbox/toolboxgtk_version.h --- open-vm-tools-2008.01.23-74039/toolbox/toolboxgtk_version.h 2008-01-28 08:02:54.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/toolbox/toolboxgtk_version.h 2008-10-13 08:01:54.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/toolbox/toolboxInt.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/toolbox/toolboxInt.h --- open-vm-tools-2008.01.23-74039/toolbox/toolboxInt.h 2008-01-28 08:02:54.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/toolbox/toolboxInt.h 2008-10-13 08:01:54.000000000 +0100 @@ -1,5 +1,5 @@ /********************************************************* - * Copyright (C) 2005 VMware, Inc. All rights reserved. + * Copyright (C) 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 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -19,61 +19,48 @@ /* * toolboxInt.h -- * - * Common defines used by the gtk toolbox + * Common defines used by the toolbox-cmd and toolbox-gtk */ #ifndef _TOOLBOX_INT_H_ -# define _TOOLBOX_INT_H_ +#define _TOOLBOX_INT_H_ -#include <X11/Xlib.h> -#include <gtk/gtk.h> -#include <gdk/gdkx.h> -#undef Bool #include "vm_basic_types.h" #include "vm_version.h" #include "dbllnklst.h" +#include "wiper.h" +#include "vmcheck.h" +#include "removable_device.h" +#include "guestApp.h" +#include "conf.h" +#include "file.h" +#include "wiper.h" +#include "backdoor_def.h" +#include "backdoor.h" +#include "vm_app.h" -#define RPCIN_POLL_TIME 10 /* in 1/1000ths of a second */ -#define DEVICES_POLL_TIME 100 /* in 1/1000ths of a second */ -#define WIPER_POLL_TIME 10 /* in 1/1000ths of a second */ -#define POST_RESET_TIME 100 /* in 1/1000ths of a second */ - -#define SCRIPT_SUSPEND "Suspend Guest Operating System" -#define SCRIPT_RESUME "Resume Guest Operating System" -#define SCRIPT_OFF "Shut Down Guest Operating System" -#define SCRIPT_ON "Power On Guest Operating System" - #define MAX_DEVICES 50 /* maximum number of devices we'll show */ +#define SHRINK_DISABLED_ERR "Shrink disk is disabled for this virtual machine." \ + "Shrinking is disabled for linked clones, parents of " \ + "linked clones, pre-allocated disks, snapshots, and " \ + "other factors. See the User's manual for more " \ + "information.\n" +#define SHRINK_FEATURE_ERR "The shrink feature is not available,\n\n" \ + "either because you are running an old version of a VMware product, or " \ + "because too many communication channels are open.\n\n If you are running " \ + "an old version of a VMware product, you should consider upgrading.\n\n" \ + "If too many communication channels are open, you should power off your " \ + "virtual machine and then power it back on\n." +#define SHRINK_CONFLICT_ERR "Error, The Toolbox believes disk shrinking is " \ + "enabled while the host believes it is disabled. " \ + "Please close and reopen the Toolbox to synchronize " \ + "it with the host.\n" +#define RECORD_VMX_ERR "Error, the Record/Replay control operation failed. This could be for " \ + "one of the following reasons:\n" \ + "1. You are running an old version of a VMware product.\n\n" \ + "2. Your product has disabled these controls. To enable them, consult " \ + "the product documentation.\n\n" \ + "3. You tried to start a recording while already recording.\n\n" \ + "4. You tried to stop a recording while not recording.\n\n" \ -#define TAB_LABEL_OPTIONS "Options" -#define TAB_LABEL_DEVICES "Devices" -#define TAB_LABEL_SCRIPTS "Scripts" -#define TAB_LABEL_SHRINK "Shrink" -#define TAB_LABEL_ABOUT "About" - -void OnViewportSizeRequest(GtkWidget *widget, GtkRequisition *requisition, - gpointer user_data); - -Bool ToolsMain_YesNoBox(gchar* title, gchar *msg); -void ToolsMain_MsgBox(gchar* title, gchar *msg); -void ToolsMain_OnDestroy(GtkWidget *widget, gpointer data); - -GtkWidget* About_Create(GtkWidget* mainWnd); -GtkWidget* Devices_Create(GtkWidget* mainWnd); -GtkWidget* Options_Create(GtkWidget* mainWnd); -GtkWidget* Scripts_Create(GtkWidget* mainWnd); -GtkWidget* Shrink_Create(GtkWidget* mainWnd); - -void Options_OnTimeSyncToggled(gpointer btn, gpointer data); -void Devices_OnDeviceToggled(gpointer btn, gpointer data); -void Pointer_SetXCursorPos(int x, int y); -void Scripts_OnApply(gpointer btn, gpointer data); - -extern GdkPixmap* pixmap; -extern GdkBitmap* bitmask; -extern GdkColormap* colormap; -extern GtkWidget *optionsTimeSync; -extern DblLnkLst_Links *gEventQueue; -extern GtkWidget *scriptsApply; - -#endif // _TOOLBOX_INT_H_ +#endif /*_TOOLBOX_INT_H_*/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/toolbox/toolboxOptions.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/toolbox/toolboxOptions.c --- open-vm-tools-2008.01.23-74039/toolbox/toolboxOptions.c 2008-01-28 08:02:54.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/toolbox/toolboxOptions.c 2008-10-13 08:01:54.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -22,7 +22,7 @@ * The options tab for the linux gtk toolbox */ -#include "toolboxInt.h" +#include "toolboxGtkInt.h" #include "vm_version.h" #include "vm_app.h" #include "guestApp.h" @@ -65,9 +65,17 @@ /* Load the correct strings for the UI. */ VmCheck_GetVersion(&version, &type); if (type == VMX_TYPE_SCALABLE_SERVER) { +#ifdef GTK2 + optionsTimeSync = gtk_check_button_new_with_mnemonic("Time _synchronization between the virtual machine\nand the ESX Server."); +#else optionsTimeSync = gtk_check_button_new_with_label("Time synchronization between the virtual machine\nand the ESX Server."); +#endif } else { +#ifdef GTK2 + optionsTimeSync = gtk_check_button_new_with_mnemonic("Time _synchronization between the virtual machine\nand the host operating system."); +#else optionsTimeSync = gtk_check_button_new_with_label("Time synchronization between the virtual machine\nand the host operating system."); +#endif } gtk_widget_show(optionsTimeSync); @@ -91,7 +99,7 @@ * * Callback for the gtk signal "toggled" on the Options tab's timesync * checkbox. Sends the new and old values thru the backdoor. The VMX - * should turn time syncing on or off. + * should turn time syncing on or off. * * Results: * None. diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/toolbox/toolboxRecord.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/toolbox/toolboxRecord.c --- open-vm-tools-2008.01.23-74039/toolbox/toolboxRecord.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/toolbox/toolboxRecord.c 2008-10-13 08:01:54.000000000 +0100 @@ -0,0 +1,145 @@ +/********************************************************* + * Copyright (C) 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. + * + *********************************************************/ + +/* + * toolboxRecord.c -- + * + * The record tab for the linux gtk toolbox. + */ + +#include <unistd.h> + +#include "toolboxGtkInt.h" +#include "debug.h" +#include "statelogger_backdoor_def.h" + +static void RecordOnStart(gpointer, gpointer); +static void RecordOnStop(gpointer, gpointer); + +/* + *----------------------------------------------------------------------------- + * + * Record_Create -- + * + * Create, layout, and init the Record tab UI and all its widgets. + * + * Results: + * The Record tab widget (it's a vbox). + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +GtkWidget * +Record_Create(GtkWidget* mainWnd) +{ + GtkWidget *recordtab; + GtkWidget *hbox[2]; + GtkWidget *startbtn; + GtkWidget *stopbtn; + GtkWidget *label; + recordtab = gtk_vbox_new(FALSE, 50); + gtk_widget_show(recordtab); + gtk_container_set_border_width(GTK_CONTAINER(recordtab), 10); + hbox[0] = gtk_hbox_new(FALSE, 10); + hbox[1] = gtk_hbox_new(FALSE, 10); + label = + gtk_label_new("Press start or stop button to control recording."); + gtk_widget_show(hbox[0]); + gtk_widget_show(hbox[1]); + gtk_widget_show(label); + gtk_box_pack_start(GTK_BOX(recordtab), hbox[0], FALSE, FALSE, 0); + gtk_box_pack_start(GTK_BOX(hbox[0]), label, TRUE, TRUE, 0); + gtk_box_pack_start(GTK_BOX(recordtab), hbox[1], FALSE, FALSE, 0); +#ifdef GTK2 + startbtn = gtk_button_new_with_mnemonic("_Start"); + stopbtn = gtk_button_new_with_mnemonic("S_top"); +#else + startbtn = gtk_button_new_with_label("Start"); + stopbtn = gtk_button_new_with_label("Stop"); +#endif + gtk_widget_show(startbtn); + gtk_box_pack_start(GTK_BOX(hbox[1]), startbtn, FALSE, FALSE, 10); + gtk_widget_set_usize(startbtn, 70, 25); + gtk_signal_connect(GTK_OBJECT(startbtn), "clicked", + GTK_SIGNAL_FUNC(RecordOnStart), NULL); + gtk_widget_show(stopbtn); + gtk_box_pack_end(GTK_BOX(hbox[1]), stopbtn, FALSE, FALSE, 10); + gtk_widget_set_usize(stopbtn, 70, 6); + gtk_signal_connect(GTK_OBJECT(stopbtn), "clicked", + GTK_SIGNAL_FUNC(RecordOnStop), NULL); + + return recordtab; +} + + +/* + *----------------------------------------------------------------------------- + * + * RecordOnStart -- + * + * Callback for the gtk signal "clicked" on the Record tab's start + * button. + * + * Results: + * None. + * + * Side effects: + * Host VMware product starts recording this vm. + * + *----------------------------------------------------------------------------- + */ + +static void +RecordOnStart(gpointer btn, // IN: unused + gpointer data) // IN: unused +{ + if (GuestApp_ControlRecord(STATELOGGER_BKDR_START_LOGGING) == FALSE) { + ToolsMain_MsgBox(NULL, RECORD_VMX_ERR); + } +} + + +/* + *----------------------------------------------------------------------------- + * + * RecordOnStop -- + * + * Callback for the gtk signal "clicked" on the Record tab's stop + * button. + * + * Results: + * None. + * + * Side effects: + * Host VMware product stops recording this vm. + * + *----------------------------------------------------------------------------- + */ + +static void +RecordOnStop(gpointer btn, // IN: unused + gpointer data) // IN: unused +{ + if (GuestApp_ControlRecord(STATELOGGER_BKDR_STOP_LOGGING) == FALSE) { + ToolsMain_MsgBox(NULL, RECORD_VMX_ERR); + } +} + diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/toolbox/toolboxScripts.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/toolbox/toolboxScripts.c --- open-vm-tools-2008.01.23-74039/toolbox/toolboxScripts.c 2008-01-28 08:02:54.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/toolbox/toolboxScripts.c 2008-10-13 08:01:54.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -27,11 +27,14 @@ #include <stdlib.h> #include <sys/types.h> #include <sys/stat.h> -#if defined(__FreeBSD__) && BSD_VERSION >= 53 -# include <syslimits.h> +#if defined(__FreeBSD__) +#include <sys/param.h> +#if __FreeBSD_version >= 530000 +#include <syslimits.h> +#endif #endif -#include "toolboxInt.h" +#include "toolboxGtkInt.h" #include "guestApp.h" #include "conf.h" #include "str.h" @@ -106,7 +109,7 @@ /* Only root can edit scripts. */ if (geteuid() != 0) { - label = + label = gtk_label_new("This option is enabled only if you run VMware Tools as root."); gtk_widget_show(label); gtk_box_pack_start(GTK_BOX(scriptstab), label, FALSE, FALSE, 0); @@ -115,7 +118,11 @@ gtk_widget_show(hbox); gtk_box_pack_start(GTK_BOX(scriptstab), hbox, FALSE, FALSE, 0); +#ifdef GTK2 + label = gtk_label_new_with_mnemonic("Script Even_t"); +#else label = gtk_label_new("Script Event"); +#endif gtk_widget_show(label); gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); @@ -124,7 +131,7 @@ gtk_box_pack_start(GTK_BOX(hbox), scriptsCombo, TRUE, TRUE, 0); items = g_list_append(items, SCRIPT_SUSPEND); items = g_list_append(items, SCRIPT_RESUME); - items = g_list_append(items, SCRIPT_OFF); + items = g_list_append(items, SCRIPT_OFF); items = g_list_append(items, SCRIPT_ON); gtk_combo_set_popdown_strings(GTK_COMBO(scriptsCombo), items); gtk_combo_set_use_arrows(GTK_COMBO(scriptsCombo), TRUE); @@ -132,8 +139,13 @@ gtk_entry_set_editable(GTK_ENTRY(GTK_COMBO(scriptsCombo)->entry), FALSE); gtk_signal_connect(GTK_OBJECT(GTK_COMBO(scriptsCombo)->entry), "changed", GTK_SIGNAL_FUNC(Scripts_OnComboChanged), NULL); +#ifdef GTK2 + gtk_label_set_mnemonic_widget(GTK_LABEL(label), GTK_COMBO(scriptsCombo)->entry); + scriptsUseScript = gtk_check_button_new_with_mnemonic("_Use Script"); +#else scriptsUseScript = gtk_check_button_new_with_label("Use Script"); +#endif gtk_widget_show(scriptsUseScript); gtk_box_pack_start(GTK_BOX(scriptstab), scriptsUseScript, FALSE, FALSE, 0); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(scriptsUseScript), TRUE); @@ -157,7 +169,7 @@ GuestApp_FindProgram("gnome-terminal")) { termApp = "gnome-terminal"; termAppOption = "-x"; - } else if (getenv("KDE_FULL_SESSION") != NULL && + } else if (getenv("KDE_FULL_SESSION") != NULL && !strcmp(getenv("KDE_FULL_SESSION"), "true") && GuestApp_FindProgram("konsole")) { termApp = "konsole"; @@ -172,75 +184,95 @@ termAppOption = "-x"; } - scriptsDefaultScript = +#ifdef GTK2 + scriptsDefaultScript = + gtk_radio_button_new_with_mnemonic(NULL,("_Default Script")); +#else + scriptsDefaultScript = gtk_radio_button_new_with_label(NULL,("Default Script")); +#endif gtk_widget_show(scriptsDefaultScript); gtk_box_pack_start(GTK_BOX(scriptstab), scriptsDefaultScript, FALSE, FALSE, 0); - radiobtn_group = + radiobtn_group = gtk_radio_button_group(GTK_RADIO_BUTTON(scriptsDefaultScript)); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(scriptsDefaultScript), TRUE); gtk_signal_connect(GTK_OBJECT(scriptsDefaultScript), "toggled", GTK_SIGNAL_FUNC(Scripts_OnDefaultScriptToggled), NULL); - + +#ifdef GTK2 + scriptsCustomScript = gtk_radio_button_new_with_mnemonic(NULL,("Cu_stom Script")); +#else scriptsCustomScript = gtk_radio_button_new_with_label(NULL,("Custom Script")); +#endif gtk_widget_show(scriptsCustomScript); gtk_box_pack_start(GTK_BOX(scriptstab), scriptsCustomScript, FALSE, FALSE, 0); gtk_radio_button_set_group(GTK_RADIO_BUTTON(scriptsCustomScript), radiobtn_group); - + hbox = gtk_hbox_new(FALSE, 10); gtk_widget_show(hbox); gtk_box_pack_start(GTK_BOX(scriptstab), hbox, FALSE, FALSE, 0); - gtk_widget_set_usize(hbox, -1, 25); - + scriptsPath = gtk_entry_new(); gtk_widget_show(scriptsPath); gtk_box_pack_start(GTK_BOX(hbox), scriptsPath, TRUE, TRUE, 0); gtk_widget_set_sensitive(scriptsPath, FALSE); gtk_signal_connect(GTK_OBJECT(scriptsPath), "changed", GTK_SIGNAL_FUNC(Scripts_PathOnChanged), NULL); - + +#ifdef GTK2 + scriptsBrowse = gtk_button_new_with_mnemonic("_Browse..."); +#else scriptsBrowse = gtk_button_new_with_label("Browse..."); +#endif gtk_widget_show(scriptsBrowse); if (termApp) { gtk_box_pack_start(GTK_BOX(hbox), scriptsBrowse, FALSE, FALSE, 0); } else { gtk_box_pack_end(GTK_BOX(hbox), scriptsBrowse, FALSE, FALSE, 0); } - gtk_widget_set_usize(scriptsBrowse, 70, 6); gtk_widget_set_sensitive(scriptsBrowse, FALSE); - gtk_signal_connect(GTK_OBJECT(scriptsBrowse), "clicked", + gtk_signal_connect(GTK_OBJECT(scriptsBrowse), "clicked", GTK_SIGNAL_FUNC(Scripts_OnBrowse), NULL); /* Only create edit button if there is an available X terminal app. */ if (termApp) { +#ifdef GTK2 + scriptsEdit = gtk_button_new_with_mnemonic("_Edit..."); +#else scriptsEdit = gtk_button_new_with_label("Edit..."); +#endif gtk_widget_show(scriptsEdit); gtk_box_pack_end(GTK_BOX(hbox), scriptsEdit, FALSE, FALSE, 0); - gtk_widget_set_usize(scriptsEdit, 70, 25); - gtk_signal_connect(GTK_OBJECT(scriptsEdit), "clicked", + gtk_signal_connect(GTK_OBJECT(scriptsEdit), "clicked", GTK_SIGNAL_FUNC(Scripts_OnEdit), NULL); } hbox = gtk_hbox_new(FALSE, 10); gtk_widget_show(hbox); gtk_box_pack_end(GTK_BOX(scriptstab), hbox, FALSE, FALSE, 0); - + +#ifdef GTK2 + scriptsRun = gtk_button_new_with_mnemonic("_Run Now"); +#else scriptsRun = gtk_button_new_with_label("Run Now"); +#endif gtk_widget_show(scriptsRun); gtk_box_pack_end(GTK_BOX(hbox), scriptsRun, FALSE, FALSE, 0); - gtk_widget_set_usize(scriptsRun, 70, 25); - gtk_signal_connect(GTK_OBJECT(scriptsRun), "clicked", + gtk_signal_connect(GTK_OBJECT(scriptsRun), "clicked", GTK_SIGNAL_FUNC(Scripts_OnRun), NULL); +#ifdef GTK2 + scriptsApply = gtk_button_new_with_mnemonic("_Apply"); +#else scriptsApply = gtk_button_new_with_label("Apply"); +#endif gtk_widget_show(scriptsApply); gtk_box_pack_end(GTK_BOX(hbox), scriptsApply, FALSE, FALSE, 0); - gtk_widget_set_usize(scriptsApply, 70, 6); gtk_widget_set_sensitive(scriptsApply, FALSE); - gtk_signal_connect(GTK_OBJECT(scriptsApply), "clicked", + gtk_signal_connect(GTK_OBJECT(scriptsApply), "clicked", GTK_SIGNAL_FUNC(Scripts_OnApply), NULL); - + gtk_signal_emit_by_name(GTK_OBJECT(GTK_COMBO(scriptsCombo)->entry), "changed"); } @@ -253,8 +285,8 @@ * * Scripts_UpdateEnabled -- * - * Update the enabled/disabled state of the widgets on the Scripts tab. - * + * Update the enabled/disabled state of the widgets on the Scripts tab. + * * Results: * None. * @@ -268,9 +300,9 @@ Scripts_UpdateEnabled(void) { Bool enabledUse, enabledCustom; - + enabledUse = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(scriptsUseScript)); - enabledCustom = + enabledCustom = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(scriptsCustomScript)); gtk_widget_set_sensitive(scriptsDefaultScript, enabledUse); gtk_widget_set_sensitive(scriptsCustomScript, enabledUse); @@ -282,7 +314,7 @@ gtk_widget_set_sensitive(scriptsBrowse, enabledUse && enabledCustom); } - + /* *----------------------------------------------------------------------------- * @@ -290,8 +322,8 @@ * * Callback for the gtk signal "changed" on the Scripts tab's combo box. * Lookup the script paths based on the entry selected and update the UI - * to match the contents of confDict. It temporarily blocks the "toggled" - * signals because the callbacks for those signal should only be called + * to match the contents of confDict. It temporarily blocks the "toggled" + * signals because the callbacks for those signal should only be called * if a user makes a change, not when the state is changed internally * * Results: @@ -306,7 +338,7 @@ void Scripts_OnComboChanged(gpointer entry, // IN: the entry selected gpointer data) // IN: unused -{ +{ const char *path, *defaultPath; const char *currentState; currentState = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(scriptsCombo)->entry)); @@ -317,10 +349,10 @@ path = GuestApp_GetDictEntry(confDict, CONFNAME_RESUMESCRIPT); defaultPath = GuestApp_GetDictEntryDefault(confDict, CONFNAME_RESUMESCRIPT); } else if (strcmp(currentState, SCRIPT_OFF) == 0) { - path = GuestApp_GetDictEntry(confDict, CONFNAME_POWEROFFSCRIPT); + path = GuestApp_GetDictEntry(confDict, CONFNAME_POWEROFFSCRIPT); defaultPath = GuestApp_GetDictEntryDefault(confDict, CONFNAME_POWEROFFSCRIPT); } else if (strcmp(currentState, SCRIPT_ON) == 0) { - path = GuestApp_GetDictEntry(confDict, CONFNAME_POWERONSCRIPT); + path = GuestApp_GetDictEntry(confDict, CONFNAME_POWERONSCRIPT); defaultPath = GuestApp_GetDictEntryDefault(confDict, CONFNAME_POWERONSCRIPT); } else { path = ""; @@ -331,7 +363,7 @@ GTK_SIGNAL_FUNC(Scripts_OnUseScriptToggled), NULL); gtk_signal_handler_block_by_func(GTK_OBJECT(scriptsDefaultScript), - GTK_SIGNAL_FUNC(Scripts_OnDefaultScriptToggled), + GTK_SIGNAL_FUNC(Scripts_OnDefaultScriptToggled), NULL); if (strcmp(path, "") == 0) { gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(scriptsUseScript), FALSE); @@ -355,7 +387,7 @@ GTK_SIGNAL_FUNC(Scripts_OnDefaultScriptToggled), NULL); gtk_widget_set_sensitive(scriptsApply, FALSE); - + gtk_signal_handler_unblock_by_func(GTK_OBJECT(scriptsUseScript), GTK_SIGNAL_FUNC(Scripts_OnUseScriptToggled), NULL); @@ -464,7 +496,7 @@ if (enabledDef) { path = GuestApp_GetDictEntryDefault(confDict, confName); } else { - path = gtk_editable_get_chars(GTK_EDITABLE(scriptsPath), 0, -1); + path = gtk_editable_get_chars(GTK_EDITABLE(scriptsPath), 0, -1); } } @@ -588,15 +620,15 @@ char path[PATH_MAX]; const char *defaultPath; struct stat statBuf; - + scriptsFileDlg = gtk_file_selection_new("Select a file"); gtk_widget_show(scriptsFileDlg); defaultPath = gtk_entry_get_text(GTK_ENTRY(scriptsPath)); Str_Strcpy(path, defaultPath, sizeof path); - /* - * If the filename represents a directory but does not end with a path + /* + * If the filename represents a directory but does not end with a path * separator, append a path separator to it so that the file chooser will * start off in that directory instead of its parent. */ @@ -605,14 +637,18 @@ S_ISDIR(statBuf.st_mode)) { Str_Strcat(path, "/", sizeof path); } - - gtk_file_selection_set_filename(GTK_FILE_SELECTION(scriptsFileDlg), + + gtk_file_selection_set_filename(GTK_FILE_SELECTION(scriptsFileDlg), path); gtk_file_selection_hide_fileop_buttons(GTK_FILE_SELECTION(scriptsFileDlg)); gtk_widget_set_sensitive(GTK_FILE_SELECTION(scriptsFileDlg)->ok_button, FALSE); +#ifdef GTK2 + gtk_file_selection_set_select_multiple(GTK_FILE_SELECTION(scriptsFileDlg), FALSE); +#else gtk_clist_set_selection_mode(GTK_CLIST(GTK_FILE_SELECTION(scriptsFileDlg)-> file_list), GTK_SELECTION_BROWSE); +#endif gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(scriptsFileDlg)->ok_button), "clicked", (GtkSignalFunc)Scripts_BrowseOnOk, &path); gtk_signal_connect(GTK_OBJECT(scriptsFileDlg), "destroy", @@ -621,9 +657,9 @@ cancel_button), "clicked", (GtkSignalFunc)gtk_widget_destroy, GTK_OBJECT(scriptsFileDlg)); - gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(scriptsFileDlg)->selection_entry), + gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(scriptsFileDlg)->selection_entry), "changed", - (GtkSignalFunc)Scripts_BrowseOnChanged, + (GtkSignalFunc)Scripts_BrowseOnChanged, GTK_FILE_SELECTION(scriptsFileDlg)->ok_button); @@ -631,9 +667,9 @@ while (gtk_events_pending() || scriptsFileDlg != NULL) { gtk_main_iteration(); } - + if (*path != 0) { - gtk_entry_set_text(GTK_ENTRY(scriptsPath), path); + gtk_entry_set_text(GTK_ENTRY(scriptsPath), path); gtk_widget_set_sensitive(scriptsApply, TRUE); } } @@ -672,7 +708,7 @@ * Scripts_BrowseOnOk -- * * Callback for the gtk signal "clicked" on the Scripts file browser OK - * button. Set "okPressed" to 1 so the Scripts_OnBrowse code knows to + * button. Set "okPressed" to 1 so the Scripts_OnBrowse code knows to * quit looping and that OK was the reason we closed. * * Results: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/toolbox/toolboxShrink.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/toolbox/toolboxShrink.c --- open-vm-tools-2008.01.23-74039/toolbox/toolboxShrink.c 2008-01-28 08:02:54.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/toolbox/toolboxShrink.c 2008-10-13 08:01:54.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -26,10 +26,10 @@ #include <string.h> #include <stdlib.h> -#include "toolboxInt.h" +#include "toolboxGtkInt.h" #include "debug.h" +#include "guestApp.h" #include "wiper.h" -#include "rpcout.h" /* * Globals @@ -71,8 +71,6 @@ GtkWidget *viewport; GtkWidget *ebox; - char *result; - size_t resultLen; int i; WiperPartition_List *plist; WiperPartition *partkb; @@ -86,7 +84,7 @@ /* Only root can do shrink. */ if (geteuid() != 0) { Debug("User not allowed to do shrink"); - label = + label = gtk_label_new("This option is enabled only if you run VMware Tools as root."); gtk_widget_show(label); gtk_box_pack_start(GTK_BOX(shrinktab), label, FALSE, FALSE, 0); @@ -101,10 +99,10 @@ gtk_widget_show(scrollwin); gtk_box_pack_start(GTK_BOX(shrinktab), scrollwin, TRUE, TRUE, 0); gtk_container_set_border_width(GTK_CONTAINER(scrollwin), 0); - gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrollwin), + gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrollwin), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); - viewport = + viewport = gtk_viewport_new( gtk_scrolled_window_get_hadjustment( GTK_SCROLLED_WINDOW(scrollwin)), @@ -136,17 +134,19 @@ gtk_widget_show(hbox); gtk_box_pack_end(GTK_BOX(shrinktab), hbox, FALSE, FALSE, 0); +#ifdef GTK2 + button = gtk_button_new_with_mnemonic("_Shrink"); +#else button = gtk_button_new_with_label("Shrink"); +#endif gtk_widget_show(button); gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); - gtk_widget_set_usize(button, 70, 25); gtk_widget_set_sensitive(button, FALSE); gtk_signal_connect(GTK_OBJECT(button), "clicked", GTK_SIGNAL_FUNC(Shrink_OnShrinkClicked), mainWnd); - if (RpcOut_sendOne(&result, &resultLen, "disk.wiper.enable")) { - if (resultLen == 1 && strcmp(result, "1") == 0) - { + if (GuestApp_IsDiskShrinkCapable()) { + if (GuestApp_IsDiskShrinkEnabled()) { gtk_widget_set_sensitive(button, TRUE); shrinkList = gtk_clist_new(1); gtk_widget_show(shrinkList); @@ -163,18 +163,14 @@ memcpy(partkb, &(plist->partitions[i]), sizeof (WiperPartition)); items = partkb->mountPoint; newrow = gtk_clist_append(GTK_CLIST(shrinkList), &items); - gtk_clist_set_row_data(GTK_CLIST(shrinkList), newrow, + gtk_clist_set_row_data(GTK_CLIST(shrinkList), newrow, partkb); } } WiperPartition_Close(plist); } } else { - label = gtk_label_new("Shrink disk is disabled for this virtual machine. " - "Shrinking is disabled for linked clones, parents of " - "linked clones, pre-allocated disks, snapshots, and " - "other factors. See the User's manual for more " - "information."); + label = gtk_label_new(SHRINK_DISABLED_ERR); gtk_widget_show(label); gtk_container_add(GTK_CONTAINER(ebox), label); gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); @@ -182,7 +178,7 @@ gtk_misc_set_alignment(GTK_MISC(label), 0, 0); } } else { - label = gtk_label_new("The shrink feature is not available,\n\neither because you are running an old version of a VMware product, or because too many communication channels are open.\n\nIf you are running an old version of a VMware product, you should consider upgrading.\n\nIf too many communication channels are open, you should power off your virtual machine and then power it back on."); + label = gtk_label_new(SHRINK_FEATURE_ERR); gtk_widget_show(label); gtk_container_add(GTK_CONTAINER(ebox), label); gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); @@ -190,12 +186,11 @@ gtk_misc_set_alignment(GTK_MISC(label), 0, 0); } - free(result); } return shrinktab; } - + /* *----------------------------------------------------------------------------- @@ -217,7 +212,7 @@ *----------------------------------------------------------------------------- */ -void +void Shrink_OnShrinkClicked(GtkButton *btn, // IN: unused gpointer user_data) // IN: unused { @@ -228,13 +223,13 @@ GtkWidget *mainWnd = GTK_WIDGET(user_data); slist = GTK_CLIST(shrinkList)->selection; if (slist) { - if (!ToolsMain_YesNoBox("Shrink Disk", + if (!ToolsMain_YesNoBox("Shrink Disk", "Do you want to prepare the disk(s) for shrinking?\n")) { return; - } + } do { rnum = GPOINTER_TO_UINT(slist->data); - part = (WiperPartition *)(gtk_clist_get_row_data(GTK_CLIST(shrinkList), + part = (WiperPartition *)(gtk_clist_get_row_data(GTK_CLIST(shrinkList), rnum)); if (Shrink_DoWipe(part, mainWnd)) { disks_to_shrink++; @@ -242,13 +237,13 @@ } else { disks_to_shrink = 0; break; - } + } } while (slist); if (disks_to_shrink > 0) { - if (ToolsMain_YesNoBox("Shrink Disk", + if (ToolsMain_YesNoBox("Shrink Disk", "Do you want to shrink the disk(s)?\n")) { - if (RpcOut_sendOne(NULL, NULL, "disk.shrink")) { + if (GuestApp_DiskShrink()) { ToolsMain_MsgBox("Information", "The shrink process is complete."); } gtk_clist_unselect_all(GTK_CLIST(shrinkList)); @@ -266,8 +261,8 @@ * Shrink_DoWipe -- * * Wipe a single partition, displaying a modal dialog with a progress - * bar. This function works similar to Win32's DoModal in that it blocks - * the caller and pumps its own messages, returning only when the wiper + * bar. This function works similar to Win32's DoModal in that it blocks + * the caller and pumps its own messages, returning only when the wiper * operation is done or canceled. * * Results: @@ -280,32 +275,25 @@ *----------------------------------------------------------------------------- */ -Bool +Bool Shrink_DoWipe(WiperPartition *part, GtkWidget* mainWnd) // IN: partition to be wiped { - char *result; - size_t resultLen; Bool performShrink = FALSE; GtkWidget *btn; int progress = 0; unsigned char *err; - /* + /* * Verify that shrinking is still possible before going through with the * wiping. This obviously isn't atomic, but it should take care of * the case where the user takes a snapshot with the toolbox open. */ - if (RpcOut_sendOne(&result, &resultLen, "disk.wiper.enable")) { - if (resultLen == 1 && strcmp(result, "1") == 0) { + if (GuestApp_IsDiskShrinkEnabled()) { performShrink = TRUE; - } } - free(result); + if (!performShrink) { - ToolsMain_MsgBox("Error", "The Toolbox believes disk shrinking is " - "enabled while the host believes it is disabled. " - "Please close and reopen the Toolbox to synchronize " - "it with the host.\n"); + ToolsMain_MsgBox("Error", SHRINK_CONFLICT_ERR); return FALSE; } @@ -320,34 +308,38 @@ gdk_window_set_icon(shrinkWipeDlg->window, NULL, pixmap, bitmask); gtk_signal_connect(GTK_OBJECT(shrinkWipeDlg), "destroy", GTK_SIGNAL_FUNC(Shrink_OnWipeDestroy), shrinkWipeDlg); - + shrinkWipeProgress = gtk_progress_bar_new(); gtk_widget_show(shrinkWipeProgress); gtk_progress_set_show_text(GTK_PROGRESS(shrinkWipeProgress), TRUE); - gtk_progress_set_format_string(GTK_PROGRESS(shrinkWipeProgress), + gtk_progress_set_format_string(GTK_PROGRESS(shrinkWipeProgress), "Preparing to shrink... (%p%%)"); gtk_progress_set_text_alignment(GTK_PROGRESS(shrinkWipeProgress), 0, 0.5); gtk_progress_set_activity_mode(GTK_PROGRESS(shrinkWipeProgress), FALSE); - gtk_progress_bar_set_bar_style(GTK_PROGRESS_BAR(shrinkWipeProgress), + gtk_progress_bar_set_bar_style(GTK_PROGRESS_BAR(shrinkWipeProgress), GTK_PROGRESS_CONTINUOUS); gtk_progress_bar_set_orientation(GTK_PROGRESS_BAR(shrinkWipeProgress), GTK_PROGRESS_LEFT_TO_RIGHT); - gtk_box_pack_start(GTK_BOX(GTK_DIALOG(shrinkWipeDlg)->vbox), + gtk_box_pack_start(GTK_BOX(GTK_DIALOG(shrinkWipeDlg)->vbox), shrinkWipeProgress, FALSE, FALSE, 0); +#ifdef GTK2 + btn = gtk_button_new_with_mnemonic("_Cancel"); +#else btn = gtk_button_new_with_label("Cancel"); +#endif gtk_widget_show(btn); - gtk_box_pack_end(GTK_BOX(GTK_DIALOG(shrinkWipeDlg)->action_area), btn, + gtk_box_pack_end(GTK_BOX(GTK_DIALOG(shrinkWipeDlg)->action_area), btn, FALSE, FALSE, 0); gtk_widget_set_usize(btn, 70, 25); - gtk_signal_connect_object(GTK_OBJECT(btn), "clicked", + gtk_signal_connect_object(GTK_OBJECT(btn), "clicked", GTK_SIGNAL_FUNC(gtk_widget_destroy), GTK_OBJECT(shrinkWipeDlg)); gtk_widget_show_all(shrinkWipeDlg); - wiper = Wiper_Start(part, 2 << 30); + wiper = Wiper_Start(part, MAX_WIPER_FILE_SIZE); while (progress < 100 && wiper != NULL) { err = Wiper_Next(&wiper, &progress); @@ -361,19 +353,19 @@ wiper = NULL; gtk_widget_destroy(shrinkWipeDlg); } else { - gtk_progress_set_percentage(GTK_PROGRESS(shrinkWipeProgress), + gtk_progress_set_percentage(GTK_PROGRESS(shrinkWipeProgress), progress/100.0); } while (gtk_events_pending()) { gtk_main_iteration(); } - + } - + if (progress >= 100) { wiper = NULL; - gtk_widget_destroy(shrinkWipeDlg); + gtk_widget_destroy(shrinkWipeDlg); return TRUE; } else { return FALSE; @@ -387,8 +379,8 @@ * Shrink_OnWipeDestroy -- * * Callback for the gtk signal "destroy" on the wipe progress dialog. - * Cancel the wipe operation, setting global variables so the loop in - * Shrink_DoWipe will exit. + * Cancel the wipe operation, setting global variables so the loop in + * Shrink_DoWipe will exit. * * Results: * None. @@ -399,7 +391,7 @@ *----------------------------------------------------------------------------- */ -void +void Shrink_OnWipeDestroy(GtkWidget *widget, // IN: the cancel button gpointer user_data) // IN: unused { diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/vmware-user/copyPaste.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/vmware-user/copyPaste.c --- open-vm-tools-2008.01.23-74039/vmware-user/copyPaste.c 2008-01-28 08:02:53.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/vmware-user/copyPaste.c 2008-10-13 08:01:54.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -78,6 +78,9 @@ #include "vmblock.h" #include "file.h" #include "codeset.h" +#include "escape.h" +#include "hostinfo.h" +#include "wiper.h" /* @@ -96,15 +99,6 @@ GdkAtom GDK_SELECTION_TYPE_UTF8_STRING; #endif -/* FCP target used in gnome. */ -#define FCP_TARGET_NAME_GNOME_COPIED_FILES "x-special/gnome-copied-files" -#define FCP_TARGET_INFO_GNOME_COPIED_FILES 0 -/* FCP target used in KDE. */ -#define FCP_TARGET_NAME_URI_LIST "text/uri-list" -#define FCP_TARGET_INFO_URI_LIST 1 -/* Number of FCP targets. */ -#define NR_FCP_TARGETS 2 - typedef struct FCPGHState { char *fileList; char *fileListNext; @@ -130,8 +124,8 @@ static Bool gWaitingOnGuestSelection = FALSE; static char gGuestSelPrimaryBuf[MAX_SELECTION_BUFFER_LENGTH]; static char gGuestSelClipboardBuf[MAX_SELECTION_BUFFER_LENGTH]; -static uint32 gGuestSelPrimaryTime = 0; -static uint32 gGuestSelClipboardTime = 0; +static uint64 gGuestSelPrimaryTime = 0; +static uint64 gGuestSelClipboardTime = 0; static char gHostClipboardBuf[MAX_SELECTION_BUFFER_LENGTH]; /* Guest->Host state. */ @@ -157,10 +151,12 @@ static char gFileRoot[DND_MAX_PATH]; static size_t gFileRootSize; static Bool gIsOwner; +static VmTimeType gHGGetListTime; /* * Forward Declarations */ +static INLINE void CopyPasteStateInit(void); static void CopyPasteSelectionReceivedCB(GtkWidget *widget, GtkSelectionData *selection_data, gpointer data); @@ -209,7 +205,7 @@ *----------------------------------------------------------------------------- */ -void +void CopyPasteSelectionRemoveTarget(GtkWidget *widget, GdkAtom selection, GdkAtom target) @@ -371,14 +367,32 @@ /* Try to get clipboard or selection timestamp. */ if (selection_data->target == GDK_SELECTION_TYPE_TIMESTAMP) { if (selection_data->selection == GDK_SELECTION_PRIMARY) { - gGuestSelPrimaryTime = *(uint32 *)selection_data->data; - Debug("CopyPasteSelectionReceivedCB: Got pri time [%d]\n", - gGuestSelPrimaryTime); + if (selection_data->length == 4) { + gGuestSelPrimaryTime = *(uint32 *)selection_data->data; + Debug("CopyPasteSelectionReceivedCB: Got pri time [%"FMT64"u]\n", + gGuestSelPrimaryTime); + } else if (selection_data->length == 8) { + gGuestSelPrimaryTime = *(uint64 *)selection_data->data; + Debug("CopyPasteSelectionReceivedCB: Got pri time [%"FMT64"u]\n", + gGuestSelPrimaryTime); + } else { + Debug("CopyPasteSelectionReceivedCB: Unknown pri time. Size %d\n", + selection_data->length); + } } if (selection_data->selection == GDK_SELECTION_CLIPBOARD) { - gGuestSelClipboardTime = *(uint32 *)selection_data->data; - Debug("CopyPasteSelectionReceivedCB: Got clip time [%d]\n", - gGuestSelClipboardTime); + if (selection_data->length == 4) { + gGuestSelClipboardTime = *(uint32 *)selection_data->data; + Debug("CopyPasteSelectionReceivedCB: Got clip time [%"FMT64"u]\n", + gGuestSelClipboardTime); + } else if (selection_data->length == 8) { + gGuestSelClipboardTime = *(uint64 *)selection_data->data; + Debug("CopyPasteSelectionReceivedCB: Got clip time [%"FMT64"u]\n", + gGuestSelClipboardTime); + } else { + Debug("CopyPasteSelectionReceivedCB: Unknown clip time. Size %d\n", + selection_data->length); + } } goto exit; } @@ -419,7 +433,7 @@ return; } - /* + /* * String in backdoor communication is 4 bytes by 4 bytes, so the len * should be aligned to 4; */ @@ -490,6 +504,7 @@ size_t textLen = 1; Bool blockAdded = FALSE; Bool gnomeFCP = FALSE; + VmTimeType curTime; if ((widget == NULL) || (selection_data == NULL)) { Debug("CopyPasteSelectionGetCB: Error, widget or selection_data is invalid\n"); @@ -537,8 +552,19 @@ return; } + /* + * KDE may ask for clipboard content right after clipboard owner changed, + * and cause unexpected HG file copy. So HG FCP will return nothing for 1 + * second after switch from host OS to guest OS. Please refer to bug 301971. + */ + Hostinfo_GetTimeOfDay(&curTime); + if (curTime - gHGGetListTime < FCP_COPY_DELAY) { + Debug("%s: waiting for delay\n", __FUNCTION__); + return; + } + if (gHGFCPFileTransferStatus == FCP_FILE_TRANSFER_NOT_YET) { - if (GetAvailableDiskSpace(gFileRoot) < gHGFCPTotalSize) { + if (GuestInfo_GetAvailableDiskSpace(gFileRoot) < gHGFCPTotalSize) { Debug("CopyPasteSelectionGetCB no enough space to copy file from host.\n"); return; } @@ -633,6 +659,7 @@ /* Build up selection data */ while ((len = CPName_GetComponentGeneric(begin, end, "", &next)) != 0) { const size_t origTextLen = textLen; + Bool freeBegin = FALSE; if (len < 0) { Debug("CopyPasteSelectionGetCB: error getting next component\n"); @@ -643,6 +670,37 @@ } /* + * A URI list will expect the provided path to be escaped. If we cannot + * escape the path for some reason we just use the unescaped version and + * hope that it works. + */ + if (selection_data->target == gFCPAtom[FCP_TARGET_INFO_URI_LIST]) { + size_t newLen; + char *escapedComponent; + int escIndex; + int bytesToEsc[256] = { 0, }; + + /* We escape the following characters based on RFC 1630. */ + bytesToEsc['#'] = 1; + bytesToEsc['?'] = 1; + bytesToEsc['*'] = 1; + bytesToEsc['!'] = 1; + bytesToEsc['%'] = 1; /* Escape character */ + + /* Escape non-ASCII characters so we can pass UTF-8 filenames */ + for (escIndex = 0x80; escIndex < 0x100; escIndex++) { + bytesToEsc[escIndex] = 1; + } + + escapedComponent = Escape_Do('%', bytesToEsc, begin, len, &newLen); + if (escapedComponent) { + begin = escapedComponent; + len = newLen; + freeBegin = TRUE; + } + } + + /* * Append component. NUL terminator was accounted for by initializing * textLen to one above. */ @@ -664,6 +722,10 @@ textLen - origTextLen + 1, "%s%s%s", pre, begin, gnomeFCP && next == end ? "" : post); + if (freeBegin) { + free((void *)begin); + } + /* Iterate to next component */ begin = next; } @@ -1497,7 +1559,7 @@ * to access the file since it will enable vmblock to block that * application's progress if necessary. */ - DnD_GetLastDirName(gFileRoot, strlen(gFileRoot), &stagingDirName); + stagingDirName = DnD_GetLastDirName(gFileRoot); if (!stagingDirName) { Debug("CopyPasteHGSetFileList: error construct stagingDirName\n"); retStr = "error construct stagingDirName"; @@ -1558,6 +1620,7 @@ free(sTotalSize); free(sListSize); free(stagingDirName); + Hostinfo_GetTimeOfDay(&gHGGetListTime); return RpcIn_SetRetVals(result, resultLen, retStr, ret); } @@ -1850,14 +1913,6 @@ gtk_signal_connect(GTK_OBJECT(mainWnd), "selection_clear_event", GTK_SIGNAL_FUNC(CopyPasteSelectionClearCB), mainWnd); - gHostClipboardBuf[0] = '\0'; - gGuestSelPrimaryBuf[0] = '\0'; - gGuestSelClipboardBuf[0] = '\0'; - gIsOwner = FALSE; - gGHFCPRpcResultBuffer = NULL; - gHGFCPPending = FALSE; - gHGFCPFileTransferStatus = FCP_FILE_TRANSFER_NOT_YET; - RpcIn_RegisterCallback(gRpcIn, "copypaste.hg.data.set", CopyPasteRpcInHGSetDataCB, NULL); RpcIn_RegisterCallback(gRpcIn, "copypaste.hg.data.finish", @@ -1869,14 +1924,9 @@ RpcIn_RegisterCallback(gRpcIn, "copypaste.gh.finish", CopyPasteRpcInGHFinishCB, NULL); - if (CopyPaste_GetVmxCopyPasteVersion() >= 2) { - /* - * Create staging directory for file copy/paste. This is for vmx with version 2 - * or greater. - */ - gFileRootSize = DnD_GetNewFileRoot(gFileRoot, sizeof gFileRoot); - Debug("CopyPaste_Register create file root [%s]\n", gFileRoot); - } + CopyPasteStateInit(); + Wiper_Init(NULL); + return CopyPaste_RegisterCapability(); } @@ -1913,6 +1963,37 @@ /* + *----------------------------------------------------------------------------- + * + * CopyPaste_OnReset -- + * + * Handles reinitializing Copy Paste state on a reset. + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +void +CopyPaste_OnReset(void) +{ + if (gHGFCPFileTransferStatus == FCP_FILE_TRANSFERRING) { + File_DeleteDirectoryTree(gFileRoot); + if (gBlockFd > 0 && !DnD_RemoveBlock(gBlockFd, gFileRoot)) { + Warning("CopyPasteRpcInHGDataFinishCB: Unable to remove block [%s].\n", + gFileRoot); + } + gFileRootSize = DnD_GetNewFileRoot(gFileRoot, sizeof gFileRoot); + } + + CopyPasteStateInit(); +} + +/* *---------------------------------------------------------------------------- * * CopyPaste_InProgress -- @@ -1934,3 +2015,64 @@ /* XXX We currently have no way to determine if a G->H FCP is ongoing. */ return gHGFCPFileTransferStatus == FCP_FILE_TRANSFERRING; } + + +/* + *---------------------------------------------------------------------------- + * + * CopyPaste_IsRpcCPSupported -- + * + * Check if RPC copy/paste is supported by vmx or not. + * + * Results: + * TRUE if RPC copy/paste is supported, FALSE otherwise. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +Bool +CopyPaste_IsRpcCPSupported(void) +{ + return gVmxCopyPasteVersion > 1; +} + + +/* + *---------------------------------------------------------------------------- + * + * CopyPasteStateInit -- + * + * Initalialize CopyPaste State. + * + * Results: + * None. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +void +CopyPasteStateInit(void) +{ + gHostClipboardBuf[0] = '\0'; + gGuestSelPrimaryBuf[0] = '\0'; + gGuestSelClipboardBuf[0] = '\0'; + gIsOwner = FALSE; + gGHFCPRpcResultBuffer = NULL; + gHGFCPPending = FALSE; + gHGFCPFileTransferStatus = FCP_FILE_TRANSFER_NOT_YET; + + if (CopyPaste_GetVmxCopyPasteVersion() >= 2) { + /* + * Create staging directory for file copy/paste. This is for vmx with version 2 + * or greater. + */ + gFileRootSize = DnD_GetNewFileRoot(gFileRoot, sizeof gFileRoot); + Debug("CopyPaste_Register create file root [%s]\n", gFileRoot); + } +} diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/vmware-user/debugStdio.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/vmware-user/debugStdio.c --- open-vm-tools-2008.01.23-74039/vmware-user/debugStdio.c 2008-01-28 08:02:53.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/vmware-user/debugStdio.c 2008-10-13 08:01:54.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -24,11 +24,6 @@ * */ -#ifndef VMX86_DEVEL - -#endif - - #include <stdlib.h> #include <stdio.h> #include <stdarg.h> @@ -48,7 +43,7 @@ #include "fileIO.h" #include "file.h" #include "system.h" - +#include "unicode.h" static char debugFile[FILE_MAXPATH] = {0}; static Bool debugEnabled = FALSE; @@ -168,40 +163,51 @@ { #ifndef _CONSOLE FileIOResult fr; - FileIODescriptor *fd; + FileIODescriptor fd; size_t bytesWritten; - char *str2; - + Unicode timePrefix; + const char *timePrefixUtf8; + char debugFileShadow; + ASSERT(debugFile[0] != 0); - - fd = (FileIODescriptor *) malloc(sizeof(FileIODescriptor)); - ASSERT_NOT_IMPLEMENTED(fd); - FileIO_Invalidate(fd); - - fr = FileIO_Open(fd, debugFile, FILEIO_OPEN_ACCESS_WRITE, FILEIO_OPEN_CREATE); + + FileIO_Invalidate(&fd); + + fr = FileIO_Open(&fd, debugFile, FILEIO_OPEN_ACCESS_WRITE, + FILEIO_OPEN_CREATE); + debugFileShadow = debugFile[0]; + debugFile[0] = '\0'; if (fr != FILEIO_SUCCESS) { Warning("---Error opening file '%s'.\n", debugFile); - debugFile[0] = '\0'; - goto done; } - FileIO_Seek(fd, 0, FILEIO_SEEK_END); + /* + * XXX: Writing the date/time prefix in UTF-8 and the rest of the string in + * an unspecified encoding is rather broken, but it'll have to do until the + * rest of the Tools are made internationalization-safe. + */ + timePrefix = System_GetTimeAsString(); + if (timePrefix == NULL) { + Warning("---Error getting formatted time string.\n"); + goto close; + } + timePrefixUtf8 = UTF8(timePrefix); + ASSERT(timePrefixUtf8); - str2 = Str_Asprintf(NULL, "(%"FMT64"u) ", System_Uptime()); - fr = FileIO_Write(fd, str2, strlen(str2), &bytesWritten); - fr = FileIO_Write(fd, str, strlen(str), &bytesWritten); - free(str2); + FileIO_Seek(&fd, 0, FILEIO_SEEK_END); + fr = FileIO_Write(&fd, timePrefixUtf8, strlen(timePrefixUtf8), &bytesWritten); + fr = FileIO_Write(&fd, str, strlen(str), &bytesWritten); + Unicode_Free(timePrefix); if (fr != FILEIO_SUCCESS) { Warning("---Error writing to file '%s'.\n", debugFile); - goto close; } close: - FileIO_Close(fd); - + FileIO_Close(&fd); + done: - free(fd); + debugFile[0] = debugFileShadow; return; #endif // _CONSOLE } @@ -249,7 +255,7 @@ OutputDebugString(str); #endif #if !defined(_WIN32) || defined(_CONSOLE) - fprintf(stderr, str); + fputs(str, stderr); #endif #endif if (debugFile[0] != '\0') { diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/vmware-user/dnd.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/vmware-user/dnd.c --- open-vm-tools-2008.01.23-74039/vmware-user/dnd.c 2008-01-28 08:02:53.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/vmware-user/dnd.c 2008-10-13 08:01:54.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -283,7 +283,7 @@ static char gFileRoot[DND_MAX_PATH]; static size_t gFileRootSize; static size_t gDnDDataSize; - +static Bool gUnity; /* * From vmwareuserInt.h @@ -460,7 +460,7 @@ * access the file since it will enable vmblock to block that application's * progress if necessary. */ - DnD_GetLastDirName(gFileRoot, gFileRootSize, &perDnDDir); + perDnDDir = DnD_GetLastDirName(gFileRoot); if (!perDnDDir) { Debug("DnDRpcInDataSetCB: cannot obtain dirname of root.\n"); retStr = "error obtaining dirname of root"; @@ -805,12 +805,14 @@ if (!StrUtil_GetNextIntToken(&xPos, &index, args, " ")) { Warning("DnDRpcInMouseUngrabCB: could not parse x coordinate\n"); + RpcOut_sendOne(NULL, NULL, "dnd.notpending"); return RpcIn_SetRetVals(result, resultLen, "Failed to parse x coordinate", FALSE); } if (!StrUtil_GetNextIntToken(&yPos, &index, args, " ")) { Warning("DnDRpcInMouseUngrabCB: could not parse y coordinate\n"); + RpcOut_sendOne(NULL, NULL, "dnd.notpending"); return RpcIn_SetRetVals(result, resultLen, "Failed to parse y coordinate", FALSE); } @@ -838,6 +840,7 @@ */ if (!DnDGHFakeDrag(mainWnd)) { Warning("DnDRpcInMouseUngrabCB: could not fake X events\n"); + RpcOut_sendOne(NULL, NULL, "dnd.notpending"); return RpcIn_SetRetVals(result, resultLen, "error faking X events", FALSE); } @@ -852,6 +855,7 @@ DnDGHXEventTimeout, mainWnd); if (!gGHState.event) { Warning("DnDRpcInMouseUngrabCB: could not create event\n"); + RpcOut_sendOne(NULL, NULL, "dnd.notpending"); return RpcIn_SetRetVals(result, resultLen, "could not create timeout event", FALSE); } @@ -1239,6 +1243,7 @@ if (info == DRAG_TARGET_INFO_URI_LIST) { size_t newLen; char *escapedComponent; + int escIndex; int bytesToEsc[256] = { 0, }; /* We escape the following characters based on RFC 1630. */ @@ -1248,6 +1253,11 @@ bytesToEsc['!'] = 1; bytesToEsc['%'] = 1; /* Escape character */ + /* Escape non-ASCII characters so we can pass UTF-8 filenames */ + for (escIndex = 0x80; escIndex < 0x100; escIndex++) { + bytesToEsc[escIndex] = 1; + } + escapedComponent = Escape_Do('%', bytesToEsc, begin, len, &newLen); if (escapedComponent) { begin = escapedComponent; @@ -1336,8 +1346,12 @@ /* * We'll get a number of these and should only carry on these operations on * the first one. + * + * XXX Unity mode needs to know if there is a g->h->g dnd operation by + * detecting if the mouse has left the detection window. This code is + * currently not in the guest and should be ported from the host. */ - if (gGHState.dragInProgress) { + if (gGHState.dragInProgress && !gUnity) { Debug("DnDGtkDragMotionCB: drag already in progress\n"); return FALSE; } @@ -1347,7 +1361,7 @@ * signals after we have already handled them. Prevent resetting the data * and trying to start a new DnD operation. */ - if (!gGHState.ungrabReceived) { + if (!gGHState.ungrabReceived && !gUnity) { Debug("DnDGtkDragMotionCB: extra drag motion without ungrab\n"); return FALSE; } @@ -1558,6 +1572,7 @@ return; error: + RpcOut_sendOne(NULL, NULL, "dnd.notpending"); DnDGHCancel(widget); } @@ -1603,7 +1618,9 @@ } /* Hide our window so we don't receive stray signals */ - gtk_widget_hide(widget); + if (!gUnity) { + gtk_widget_hide(widget); + } gtk_drag_finish(dc, TRUE, FALSE, time); @@ -2220,7 +2237,9 @@ gGHState.ungrabReceived = FALSE; gGHState.event = NULL; DnDGHXdndClearPending(widget); - gtk_widget_hide(widget); + if (!gUnity) { + gtk_widget_hide(widget); + } } @@ -2268,7 +2287,7 @@ DnDGHCancel(GtkWidget *widget) // IN: program's widget { /* Hide our widget so we don't receive stray signals */ - if (widget) { + if (widget && !gUnity) { gtk_widget_hide(widget); } @@ -2318,7 +2337,9 @@ Debug("DnDGHXEventTimeout time out \n"); - if (!gGHState.dragInProgress) { + RpcOut_sendOne(NULL, NULL, "dnd.notpending"); + + if (!gGHState.dragInProgress && !gUnity) { gtk_widget_hide(widget); } @@ -2422,11 +2443,15 @@ */ Bool -DnD_Register(GtkWidget *mainWnd) // IN: The widget to register as a drag source. +DnD_Register(GtkWidget *hgWnd, // IN: The widget to register as a drag source. + GtkWidget *ghWnd) // IN: The widget to register as a drag target. { gDragCtx = NULL; uint32 i; + ASSERT(hgWnd); + ASSERT(ghWnd); + if (DnD_GetVmxDnDVersion() < 2) { goto error; } @@ -2436,26 +2461,26 @@ * variable to avoid segfaults. If we have a reason to check the major and * minor numbers of the running extension, that would go here. */ - if (!XTestQueryExtension(GDK_WINDOW_XDISPLAY(mainWnd->window), + if (!XTestQueryExtension(GDK_WINDOW_XDISPLAY(hgWnd->window), &i, &i, &i, &i)) { goto error; } /* Host->Guest RPC callbacks */ - RpcIn_RegisterCallback(gRpcIn, "dnd.data.set", DnDRpcInDataSetCB, mainWnd); - RpcIn_RegisterCallback(gRpcIn, "dnd.enter", DnDRpcInEnterCB, mainWnd); - RpcIn_RegisterCallback(gRpcIn, "dnd.move", DnDRpcInMoveCB, mainWnd); - RpcIn_RegisterCallback(gRpcIn, "dnd.drop", DnDRpcInDropCB, mainWnd); + RpcIn_RegisterCallback(gRpcIn, "dnd.data.set", DnDRpcInDataSetCB, hgWnd); + RpcIn_RegisterCallback(gRpcIn, "dnd.enter", DnDRpcInEnterCB, hgWnd); + RpcIn_RegisterCallback(gRpcIn, "dnd.move", DnDRpcInMoveCB, hgWnd); + RpcIn_RegisterCallback(gRpcIn, "dnd.drop", DnDRpcInDropCB, hgWnd); RpcIn_RegisterCallback(gRpcIn, "dnd.data.finish", DnDRpcInDataFinishCB, - mainWnd); + hgWnd); /* Guest->Host RPC callbacks */ RpcIn_RegisterCallback(gRpcIn, "dnd.ungrab", - DnDRpcInMouseUngrabCB, mainWnd); + DnDRpcInMouseUngrabCB, ghWnd); RpcIn_RegisterCallback(gRpcIn, "dnd.data.get.file", - DnDRpcInGetNextFileCB, mainWnd); + DnDRpcInGetNextFileCB, ghWnd); RpcIn_RegisterCallback(gRpcIn, "dnd.finish", - DnDRpcInFinishCB, mainWnd); + DnDRpcInFinishCB, ghWnd); /* * Setup mainWnd as a DND source/dest. @@ -2481,16 +2506,16 @@ } /* Drag source for Host->Guest */ - gtk_drag_source_set(mainWnd, GDK_BUTTON1_MASK, + gtk_drag_source_set(hgWnd, GDK_BUTTON1_MASK, gTargetEntry, ARRAYSIZE(gTargetEntry), GDK_ACTION_COPY | GDK_ACTION_MOVE); - gtk_signal_connect(GTK_OBJECT(mainWnd), "drag_begin", - GTK_SIGNAL_FUNC(DnDGtkBeginCB), mainWnd); - gtk_signal_connect(GTK_OBJECT(mainWnd), "drag_end", - GTK_SIGNAL_FUNC(DnDGtkEndCB), mainWnd); - gtk_signal_connect(GTK_OBJECT(mainWnd), "drag_data_get", - GTK_SIGNAL_FUNC(DnDGtkDataRequestCB), mainWnd); + gtk_signal_connect(GTK_OBJECT(hgWnd), "drag_begin", + GTK_SIGNAL_FUNC(DnDGtkBeginCB), hgWnd); + gtk_signal_connect(GTK_OBJECT(hgWnd), "drag_end", + GTK_SIGNAL_FUNC(DnDGtkEndCB), hgWnd); + gtk_signal_connect(GTK_OBJECT(hgWnd), "drag_data_get", + GTK_SIGNAL_FUNC(DnDGtkDataRequestCB), hgWnd); /* @@ -2499,21 +2524,20 @@ * We provide NR_GH_DRAG_TARGETS (rather than ARRAYSIZE(gTargetEntry)) to * gtk_drag_dest_set() since we support less targets for G->H than H->G. */ - gtk_drag_dest_set(mainWnd, + gtk_drag_dest_set(ghWnd, GTK_DEST_DEFAULT_MOTION, gTargetEntry, NR_GH_DRAG_TARGETS, GDK_ACTION_COPY | GDK_ACTION_MOVE); - gtk_signal_connect(GTK_OBJECT(mainWnd), "drag_motion", - GTK_SIGNAL_FUNC(DnDGtkDragMotionCB), mainWnd); - gtk_signal_connect(GTK_OBJECT(mainWnd), "drag_data_received", + gtk_signal_connect(GTK_OBJECT(ghWnd), "drag_motion", + GTK_SIGNAL_FUNC(DnDGtkDragMotionCB), ghWnd); + gtk_signal_connect(GTK_OBJECT(ghWnd), "drag_data_received", GTK_SIGNAL_FUNC(DnDGtkDragDataReceivedCB), - mainWnd); - gtk_signal_connect(GTK_OBJECT(mainWnd), "drag_drop", - GTK_SIGNAL_FUNC(DnDGtkDragDropCB), mainWnd); + ghWnd); + gtk_signal_connect(GTK_OBJECT(ghWnd), "drag_drop", + GTK_SIGNAL_FUNC(DnDGtkDragDropCB), ghWnd); - DnDHGStateInit(); - DnDGHStateInit(mainWnd); + DnD_OnReset(hgWnd, ghWnd); if (DnD_RegisterCapability()) { return TRUE; @@ -2523,7 +2547,7 @@ * We get here if DnD registration fails for some reason */ error: - DnD_Unregister(mainWnd); + DnD_Unregister(hgWnd, ghWnd); return FALSE; } @@ -2545,35 +2569,36 @@ */ void -DnD_Unregister(GtkWidget *mainWnd) // IN: program's widget +DnD_Unregister(GtkWidget *hgWnd, // IN: The widget for hg dnd + GtkWidget *ghWnd) // IN: The widget for gh dnd { RpcOut_sendOne(NULL, NULL, "dnd.ready disable"); DnDGHFileListClear(); /* Unregister source for Host->Guest DnD. */ - gtk_drag_source_unset(mainWnd); - gtk_signal_disconnect_by_func(GTK_OBJECT(mainWnd), + gtk_drag_source_unset(hgWnd); + gtk_signal_disconnect_by_func(GTK_OBJECT(hgWnd), GTK_SIGNAL_FUNC(DnDGtkBeginCB), - mainWnd); - gtk_signal_disconnect_by_func(GTK_OBJECT(mainWnd), + hgWnd); + gtk_signal_disconnect_by_func(GTK_OBJECT(hgWnd), GTK_SIGNAL_FUNC(DnDGtkEndCB), - mainWnd); - gtk_signal_disconnect_by_func(GTK_OBJECT(mainWnd), + hgWnd); + gtk_signal_disconnect_by_func(GTK_OBJECT(hgWnd), GTK_SIGNAL_FUNC(DnDGtkDataRequestCB), - mainWnd); + hgWnd); /* Unregister destination for Guest->Host DnD. */ - gtk_drag_dest_unset(mainWnd); - gtk_signal_disconnect_by_func(GTK_OBJECT(mainWnd), + gtk_drag_dest_unset(ghWnd); + gtk_signal_disconnect_by_func(GTK_OBJECT(ghWnd), GTK_SIGNAL_FUNC(DnDGtkDragMotionCB), - mainWnd); - gtk_signal_disconnect_by_func(GTK_OBJECT(mainWnd), + ghWnd); + gtk_signal_disconnect_by_func(GTK_OBJECT(ghWnd), GTK_SIGNAL_FUNC(DnDGtkDragDataReceivedCB), - mainWnd); - gtk_signal_disconnect_by_func(GTK_OBJECT(mainWnd), + ghWnd); + gtk_signal_disconnect_by_func(GTK_OBJECT(ghWnd), GTK_SIGNAL_FUNC(DnDGtkDragDropCB), - mainWnd); + ghWnd); } @@ -2594,27 +2619,45 @@ */ void -DnD_OnReset(GtkWidget *mainWnd) // IN: program's widget +DnD_OnReset(GtkWidget *hgWnd, // IN: The widget for hg dnd + GtkWidget *ghWnd) // IN: The widget for gh dnd + { Debug("DnD_OnReset: entry\n"); + + /* Cancel file transfer. */ + if (gHGDnDInProgress || gHGDataPending) { + DnD_DeleteStagingFiles(gFileRoot, FALSE); + if (gBlockFd >= 0 && !DnD_RemoveBlock(gBlockFd, gFileRoot)) { + Warning("DnD_OnReset: could not remove block on %s\n", + gFileRoot); + } + } + /* * If a DnD in either direction was in progress during suspend, send an * escape to cancel the operation and reset the pointer state. */ - if (gHGDnDInProgress || gGHState.dragInProgress) { - Debug("DnD_OnReset: sending escape\n"); - DnDSendEscapeKey(mainWnd); + if (gHGDnDInProgress) { + Debug("DnD_OnReset: sending hgWnd escape\n"); + DnDSendEscapeKey(hgWnd); + } + + if (gGHState.dragInProgress) { + Debug("DnD_OnReset: sending ghWnd escape\n"); + DnDSendEscapeKey(ghWnd); } if (gGHState.dragInProgress) { Debug("DnD_OnReset: canceling host->guest DnD\n"); - DnDGHCancel(mainWnd); + DnDGHCancel(ghWnd); } /* Reset DnD state. */ DnDHGStateInit(); - DnDGHStateInit(mainWnd); + DnDGHStateInit(ghWnd); DnDGHFileListClear(); + DnD_SetMode(FALSE); } @@ -2639,3 +2682,26 @@ { return gGHState.dragInProgress || gHGDnDInProgress || gHGDataPending; } + + +/* + *---------------------------------------------------------------------------- + * + * DnD_SetMode -- + * + * Sets dnd mode to single window or unity mode. + * + * Results: + * None. + * + * Side effects: + * Controls if the g->h det window is automatically hidden. + * + *---------------------------------------------------------------------------- + */ + +void +DnD_SetMode(Bool unity) // IN +{ + gUnity = unity; +} diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/vmware-user/foreignVMToolsDaemon.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/vmware-user/foreignVMToolsDaemon.c --- open-vm-tools-2008.01.23-74039/vmware-user/foreignVMToolsDaemon.c 2008-01-28 08:02:53.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/vmware-user/foreignVMToolsDaemon.c 2008-10-13 08:01:54.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -55,7 +55,7 @@ #include <netinet/tcp.h> #include <arpa/inet.h> #include <fcntl.h> -#if defined(__FreeBSD__) || defined(sun) +#if defined(__FreeBSD__) || defined(sun) || defined(__APPLE__) #include <unistd.h> #else #include <linux/unistd.h> @@ -92,6 +92,7 @@ VixLockType globalLock; static struct FoundryWorkerThread *selectThread; +static DblLnkLst_Links *gEventQueue; ForeignVMToolsConnection *activeConnectionList = NULL; ForeignVMToolsCommand *globalCommandList = NULL; @@ -105,7 +106,8 @@ static void ForeignToolsSendRunProgramResponse(const char *requestName, VixError resultErr, int exitCode, - int64 pid); + int64 pid, + void *clientData); static VixError ForeignToolsGetUserCredentialForGuest(ForeignVMToolsConnection *connectionState, ForeignVMToolsCommand *commandState); @@ -136,12 +138,14 @@ */ Bool -ForeignTools_Initialize(GuestApp_Dict *configDictionaryParam) // IN +ForeignTools_Initialize(GuestApp_Dict *configDictionaryParam, // IN + DblLnkLst_Links *eventQueue) // IN { VixError err = VIX_OK; Bool success = TRUE; MessageStub_RegisterTransport(); + gEventQueue = eventQueue; /* * Initialize the limited global state that protects us when @@ -160,7 +164,7 @@ configDictionary = configDictionaryParam; VixTools_SetConsoleUserPolicy(TRUE); // allowConsoleUserOpsParam - VixTools_SetRunProgramCallback(ForeignToolsSendRunProgramResponse); + VixTools_SetRunProgramCallback(ForeignToolsSendRunProgramResponse, NULL); success = ForeignTools_InitializeNetworking(); if (!success) { @@ -394,7 +398,8 @@ ForeignToolsSendRunProgramResponse(const char *requestName, // IN VixError resultErr, // IN int exitCode, // IN - int64 pid) // IN + int64 pid, // IN + void *clientData) // IN { VixError err = VIX_OK; int additionalError = 0; @@ -880,7 +885,7 @@ VixError ForeignToolsGetToolsState(ForeignVMToolsCommand *asyncCommand, // IN - VixMsgTrivialRequest *requestMsg) // IN + VixMsgTrivialRequest *requestMsg) // IN { VixError err = VIX_OK; VixPropertyListImpl propList; @@ -901,6 +906,7 @@ asyncCommand->asyncOpName, 1024 * 1024, // maxResultBufferSize, &configDictionary, + gEventQueue, &base64Buffer, &base64BufferLength, &deleteResultValue); @@ -1078,6 +1084,7 @@ commandState->asyncOpName, 1024 * 1024, // maxResultBufferSize, &configDictionary, + gEventQueue, &dummyResponse, &dummyResponseLength, &deleteResultValue); @@ -1129,6 +1136,7 @@ commandState->asyncOpName, 1024 * 1024, // maxResultBufferSize, &configDictionary, + gEventQueue, &(commandState->responseBody), &(commandState->responseBodyLength), &deleteResultValue); @@ -1153,6 +1161,7 @@ commandState->asyncOpName, 1024 * 1024, // maxResultBufferSize, &configDictionary, + gEventQueue, &(commandState->responseBody), &(commandState->responseBodyLength), &deleteResultValue); diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/vmware-user/foreignVMToolsDaemon.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/vmware-user/foreignVMToolsDaemon.h --- open-vm-tools-2008.01.23-74039/vmware-user/foreignVMToolsDaemon.h 2008-01-28 08:02:53.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/vmware-user/foreignVMToolsDaemon.h 2008-10-13 08:01:54.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/vmware-user/foreignVMToolsNetworking.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/vmware-user/foreignVMToolsNetworking.c --- open-vm-tools-2008.01.23-74039/vmware-user/foreignVMToolsNetworking.c 2008-01-28 08:02:53.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/vmware-user/foreignVMToolsNetworking.c 2008-10-13 08:01:54.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -48,7 +48,7 @@ #include "SLPv2Private.h" #include "guestInfo.h" #include "netutil.h" -#include "guestInfoInt.h" +#include "guestInfo.h" #include "vixOpenSource.h" #include "syncEvent.h" @@ -57,7 +57,6 @@ #include "foreignVMToolsDaemon.h" - #ifdef _WIN32 #define ASOCK_ENOTCONN WSAENOTCONN #define ASOCK_ENOTSOCK WSAENOTSOCK @@ -86,7 +85,7 @@ * * We cannot link with winsock, since the DLL may not be present in all guests. * That would create a dll link problem that would prevent the tools from loading. - * Instead, we try to get the procedure pointer ourselves at runtime, and quietly + * Instead, we try to get the procedure pointer ourselves at runtime, and quietly * fail if it is not there. *----------------------------------------------------------------------------- */ @@ -147,8 +146,8 @@ int tolen); typedef int (WSAAPI *SendSockOptProcType)(SOCKET s, - int level, - int optname, + int level, + int optname, const void *optval, socklen_t optlen); @@ -215,7 +214,7 @@ #define VMToolsNet_FDIsSet FD_ISSET #define VMToolsNet_Recvfrom recvfrom -#endif +#endif Bool ForeignToolsMakeNonBlocking(int fd); @@ -265,7 +264,7 @@ char *ipAddressStr = NULL; char *destPtr; char *endDestPtr; - NicInfo nicInfo; + GuestNicList nicInfo; #ifdef _WIN32 HMODULE hWs2_32 = NULL; WSADATA wsaData; @@ -281,7 +280,7 @@ } #ifdef _WIN32 - hWs2_32 = LoadLibrary("ws2_32.dll"); + hWs2_32 = LoadLibrary(_T("ws2_32.dll")); if (NULL == hWs2_32) { goto abort; } @@ -412,23 +411,20 @@ VixSocketListenerPort); /* - * Find out how big the IP_ADAPTER_INFO table needs to be. + * Find out how big the IP_ADAPTER_INFO table needs to be. */ - success = GuestInfoGetNicInfo(&nicInfo); + success = GuestInfo_GetNicInfo(&nicInfo); if (success) { - NicEntry *nicEntryPtr = NULL; - DblLnkLst_Links *nicEntryLink; - - DblLnkLst_ForEach(nicEntryLink, &nicInfo.nicList) { - nicEntryPtr = DblLnkLst_Container(nicEntryLink, NicEntry, links); + u_int i; + for (i = 0; i < nicInfo.nics.nics_len; i++) { + GuestNic *nic = &nicInfo.nics.nics_val[i]; destPtr += Str_Snprintf(destPtr, endDestPtr - destPtr, "%s=%s;", VIX_SLPV2_PROPERTY_MAC_ADDR, - nicEntryPtr->nicEntryProto.macAddress); - } - - GuestInfo_FreeDynamicMemoryInNicInfo(&nicInfo); + nic->macAddress); + } + VMX_XDR_FREE(xdr_GuestNicList, &nicInfo); } free(ipAddressStr); @@ -601,8 +597,8 @@ goto abort; } //success = ForeignToolsMakeNonBlocking(tcpListenerSocket); - success = ForeignToolsSocketBind(tcpListenerSocket, - INADDR_ANY, + success = ForeignToolsSocketBind(tcpListenerSocket, + INADDR_ANY, VixSocketListenerPort); if (!success) { goto abort; @@ -615,16 +611,16 @@ goto abort; } //success = ForeignToolsMakeNonBlocking(tcpListenerSocket); - success = ForeignToolsSocketBind(udpListenerSocket, - INADDR_ANY, + success = ForeignToolsSocketBind(udpListenerSocket, + INADDR_ANY, SLPv2SocketListenerPort); if (!success) { goto abort; } - VMToolsNet_SetSockOpt(udpListenerSocket, - SOL_SOCKET, + VMToolsNet_SetSockOpt(udpListenerSocket, + SOL_SOCKET, SO_BROADCAST, - (const void *) &bcast, + (const void *) &bcast, sizeof(bcast)); #ifdef _WIN32 @@ -639,14 +635,14 @@ DWORD dwBytesReturned = 0; BOOL bNewBehavior = FALSE; DWORD status; - status = VMToolsNet_WSAIoctl(udpListenerSocket, + status = VMToolsNet_WSAIoctl(udpListenerSocket, SIO_UDP_CONNRESET, - &bNewBehavior, + &bNewBehavior, sizeof(bNewBehavior), - NULL, - 0, + NULL, + 0, &dwBytesReturned, - NULL, + NULL, NULL); if (SOCKET_ERROR == status) { } @@ -732,7 +728,7 @@ if (udpListenerSocket != -1) { VMToolsNet_CloseSocket(udpListenerSocket); udpListenerSocket = -1; - } + } } // ForeignToolsSelectLoop @@ -773,9 +769,9 @@ } } - + VIX_ENTER_LOCK(&globalLock); - + /* * Allocate some state for the connection */ @@ -818,8 +814,8 @@ /* * Read the message header. */ - result = VMToolsNet_Recv(connectionState->socket, - (char *) &(connectionState->requestHeader), + result = VMToolsNet_Recv(connectionState->socket, + (char *) &(connectionState->requestHeader), sizeof(connectionState->requestHeader), 0); if (result <= 0) { @@ -835,7 +831,7 @@ goto abort; } - connectionState->completeRequest + connectionState->completeRequest = Util_SafeMalloc(connectionState->requestHeader.commonHeader.totalMessageLength); memcpy(connectionState->completeRequest, &(connectionState->requestHeader), @@ -843,12 +839,12 @@ /* * If this request has a variable-sized part, like a body or a user credential, - * then start reading that. Otherwise, if the request only has a fixed-size header, + * then start reading that. Otherwise, if the request only has a fixed-size header, * then we can start processing it now. */ if (connectionState->requestHeader.commonHeader.totalMessageLength > result) { - result = VMToolsNet_Recv(connectionState->socket, - connectionState->completeRequest + result, + result = VMToolsNet_Recv(connectionState->socket, + connectionState->completeRequest + result, connectionState->requestHeader.commonHeader.totalMessageLength - result, 0); if (result <= 0) { @@ -908,9 +904,9 @@ responseHeader->responseFlags |= responseFlags; - result = VMToolsNet_Send(connectionState->socket, + result = VMToolsNet_Send(connectionState->socket, (const char *) responseHeader, - totalMessageSize, + totalMessageSize, 0); if (result <= 0) { } @@ -958,9 +954,9 @@ responseHeader->responseFlags |= responseFlags; - result = VMToolsNet_Send(connectionState->socket, + result = VMToolsNet_Send(connectionState->socket, (const char *) responseHeader, - totalMessageSize, + totalMessageSize, 0); if (result <= 0) { } @@ -997,11 +993,11 @@ char *replyPacket = NULL; int replyPacketSize = 0; - actualPacketLength = VMToolsNet_Recvfrom(udpListenerSocket, - receiveBuffer, + actualPacketLength = VMToolsNet_Recvfrom(udpListenerSocket, + receiveBuffer, sizeof(receiveBuffer), 0, - (struct sockaddr *) &clientAddr, + (struct sockaddr *) &clientAddr, &clientAddrLen); if (actualPacketLength <= 0) { goto abort; @@ -1025,9 +1021,9 @@ "", // LDAPv3 predicate &xid); if (match) { - Str_Sprintf(urlBuffer, - sizeof urlBuffer, - "%s://%s/", + Str_Sprintf(urlBuffer, + sizeof urlBuffer, + "%s://%s/", VIX_SLPV2_SERVICE_NAME_TOOLS_SERVICE, globalHostName); success = SLPv2MsgAssembler_ServiceReply(&replyPacket, @@ -1063,11 +1059,11 @@ * for more responses. */ if (NULL != replyPacket) { - VMToolsNet_Sendto(udpListenerSocket, - replyPacket, + VMToolsNet_Sendto(udpListenerSocket, + replyPacket, replyPacketSize, 0, // flags - (struct sockaddr *) &clientAddr, + (struct sockaddr *) &clientAddr, clientAddrLen); } @@ -1111,7 +1107,7 @@ /* * It's possible that data on a connection arrives late, after we have - * closed it. In that case, VMAutomationReceiveMessage will correctly + * closed it. In that case, VMAutomationReceiveMessage will correctly * not process the data. But, be careful that we don't try to close * the connection again. */ @@ -1145,7 +1141,7 @@ ForeignToolsDiscardCommand(command); } - + command = nextCommand; } // while (NULL != command) @@ -1210,11 +1206,11 @@ localAddr.sin_addr.s_addr = VMToolsNet_htonl(INADDR_ANY); localAddr.sin_port = VMToolsNet_htons(SLPv2SocketListenerPort); - VMToolsNet_Sendto(udpListenerSocket, - packet, + VMToolsNet_Sendto(udpListenerSocket, + packet, sizeof(packet), 0, // flags - (struct sockaddr *) &localAddr, + (struct sockaddr *) &localAddr, sizeof(localAddr)); } // ForeignToolsWakeSelectThread diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/vmware-user/foundryToolsDaemon.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/vmware-user/foundryToolsDaemon.c --- open-vm-tools-2008.01.23-74039/vmware-user/foundryToolsDaemon.c 2008-01-28 08:02:53.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/vmware-user/foundryToolsDaemon.c 2008-10-13 08:01:54.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -27,11 +27,13 @@ #include <stdlib.h> #include <stdarg.h> #include <fcntl.h> - -#if !defined(__FreeBSD__) && !defined(sun) -#define IMPLEMENT_SOCKET_MGR 1 +#if defined(linux) +#include <sys/wait.h> +#include <mntent.h> +#include <paths.h> #endif + #ifdef _WIN32 #include <io.h> #else @@ -40,7 +42,10 @@ #endif #ifdef _MSC_VER -# include <windows.h> +# include <Windows.h> +# include <WinSock2.h> +# include <WinSpool.h> +# include "win32u.h" #elif _WIN32 # include "win95.h" #endif @@ -50,14 +55,21 @@ #include "vm_version.h" #include "vm_app.h" #include "message.h" -#include "eventManager.h" -#include "debug.h" -#include "rpcout.h" -#include "rpcin.h" + +#if defined(VMTOOLS_USE_GLIB) +# include "vixPluginInt.h" +# include "vmtools.h" +#else +# include "debug.h" +# include "eventManager.h" +# include "rpcin.h" +# include "rpcout.h" +#endif + #include "util.h" #include "strutil.h" #include "str.h" -#include "fileUTF8.h" +#include "file.h" #include "err.h" #include "hostinfo.h" #include "guest_os.h" @@ -66,42 +78,42 @@ #include "foundryToolsDaemon.h" #include "printer.h" #include "base64.h" -#include "guestInfoInt.h" #include "syncDriver.h" #include "hgfsServer.h" #include "hgfs.h" #include "system.h" #include "codeset.h" -#if IMPLEMENT_SOCKET_MGR -#include "socketMgr.h" + +#if defined(linux) +#include "hgfsDevLinux.h" #endif #ifndef __FreeBSD__ #include "netutil.h" #endif -/* Stub out impersonation functions for these platforms. */ -#if defined(__FreeBSD__) || defined(sun) || defined(N_PLAT_NLM) -void Impersonate_Init(void) { return; } -#else +/* Only Win32 and Linux use impersonation functions. */ +#if !defined(__FreeBSD__) && !defined(sun) #include "impersonate.h" #endif #include "vixTools.h" #include "vixOpenSource.h" +#if !defined(VMTOOLS_USE_GLIB) static DblLnkLst_Links *globalEventQueue; // event queue for main event loop +#endif #define GUESTMSG_MAX_IN_SIZE (64 * 1024) /* vmx/main/guest_msg.c */ #define MAX64_DECIMAL_DIGITS 20 /* 2^64 = 18,446,744,073,709,551,616 */ -#if defined(linux) || (defined(_WIN32) && !defined(SERVICE9X)) +#if defined(linux) || defined(_WIN32) # if defined(_WIN32) -# define DECLARE_SYNCDRIVER_ERROR(name) DWORD name = ERROR_SUCCESS; +# define DECLARE_SYNCDRIVER_ERROR(name) DWORD name = ERROR_SUCCESS # define SYNCDRIVERERROR ERROR_GEN_FAILURE # else -# define DECLARE_SYNCDRIVER_ERROR(name) int name = 0; +# define DECLARE_SYNCDRIVER_ERROR(name) int name = 0 # define SYNCDRIVERERROR errno # endif @@ -116,56 +128,25 @@ static char * ToolsDaemonTcloGetEncodedQuotedString(const char *args, const char **endOfArg); -Bool ToolsDaemonTcloReceiveVixCommand(char const **result, - size_t *resultLen, - const char *name, - const char *args, - size_t argsSize, - void *clientData); - -static Bool ToolsDaemonTcloCheckUserAccount(char const **result, - size_t *resultLen, - const char *name, - const char *args, - size_t argsSize, - void *clientData); +Bool ToolsDaemonTcloReceiveVixCommand(RpcInData *data); #if !defined(N_PLAT_NLM) -static Bool ToolsDaemonHgfsImpersonated(char const **result, - size_t *resultLen, - const char *name, - const char *args, - size_t argsSize, - void *clientData); -#endif - -#if defined(linux) || (defined(_WIN32) && !defined(SERVICE9X)) -static Bool ToolsDaemonTcloSyncDriverFreeze(char const **result, - size_t *resultLen, - const char *name, - const char *args, - size_t argsSize, - void *clientData); - -static Bool ToolsDaemonTcloSyncDriverThaw(char const **result, - size_t *resultLen, - const char *name, - const char *args, - size_t argsSize, - void *clientData); -#endif - -static Bool ToolsDaemonTcloMountHGFS(char const **result, - size_t *resultLen, - const char *name, - const char *args, - size_t argsSize, - void *clientData); +Bool ToolsDaemonHgfsImpersonated(RpcInData *data); +#endif + +#if defined(linux) || defined(_WIN32) +Bool ToolsDaemonTcloSyncDriverFreeze(RpcInData *data); + +Bool ToolsDaemonTcloSyncDriverThaw(RpcInData *data); +#endif + +Bool ToolsDaemonTcloMountHGFS(RpcInData *data); void ToolsDaemonTcloReportProgramCompleted(const char *requestName, VixError err, int exitCode, - int64 pid); + int64 pid, + void *clientData); /* * These constants are a bad hack. I really should generate the result @@ -174,10 +155,6 @@ */ #define DEFAULT_RESULT_MSG_MAX_LENGTH 1024 -#if IMPLEMENT_SOCKET_MGR -static Bool socketMgrInitialized = FALSE; -#endif - static Bool thisProcessRunsAsRoot = FALSE; @@ -200,12 +177,7 @@ */ Bool -FoundryToolsDaemonRunProgram(char const **result, // OUT - size_t *resultLen, // OUT - const char *name, // IN - const char *args, // IN - size_t argsSize, // Ignored - void *clientData) // IN +FoundryToolsDaemonRunProgram(RpcInData *data) // IN { VixError err = VIX_OK; char *requestName = NULL; @@ -219,18 +191,23 @@ Bool impersonatingVMWareUser = FALSE; void *userToken = NULL; ProcMgr_Pid pid; +#if defined(VMTOOLS_USE_GLIB) + GMainLoop *eventQueue = ((ToolsAppCtx *)data->appCtx)->mainLoop; +#else + DblLnkLst_Links *eventQueue = data->clientData; +#endif /* * Parse the arguments. Some of these are optional, so they * may be NULL. */ - requestName = ToolsDaemonTcloGetQuotedString(args, &args); - commandLine = ToolsDaemonTcloGetEncodedQuotedString(args, &args); - commandLineArgs = ToolsDaemonTcloGetEncodedQuotedString(args, &args); - credentialTypeStr = ToolsDaemonTcloGetQuotedString(args, &args); - obfuscatedNamePassword = ToolsDaemonTcloGetQuotedString(args, &args); - directoryPath = ToolsDaemonTcloGetQuotedString(args, &args); - environmentVariables = ToolsDaemonTcloGetQuotedString(args, &args); + requestName = ToolsDaemonTcloGetQuotedString(data->args, &data->args); + commandLine = ToolsDaemonTcloGetEncodedQuotedString(data->args, &data->args); + commandLineArgs = ToolsDaemonTcloGetEncodedQuotedString(data->args, &data->args); + credentialTypeStr = ToolsDaemonTcloGetQuotedString(data->args, &data->args); + obfuscatedNamePassword = ToolsDaemonTcloGetQuotedString(data->args, &data->args); + directoryPath = ToolsDaemonTcloGetQuotedString(data->args, &data->args); + environmentVariables = ToolsDaemonTcloGetQuotedString(data->args, &data->args); /* * Make sure we are passed the correct arguments. @@ -260,6 +237,7 @@ commandLineArgs, 0, userToken, + eventQueue, (int64 *) &pid); abort: @@ -278,7 +256,7 @@ err, Err_Errno(), (int64) pid); - RpcIn_SetRetVals(result, resultLen, resultBuffer, TRUE); + RPCIN_SETRETVALS(data, resultBuffer, TRUE); /* * These were allocated by ToolsDaemonTcloGetQuotedString. @@ -313,15 +291,9 @@ */ Bool -FoundryToolsDaemonGetToolsProperties(char const **result, // OUT - size_t *resultLen, // OUT - const char *name, // IN - const char *args, // IN - size_t argsSize, // Ignored - void *clientData) // IN +FoundryToolsDaemonGetToolsProperties(RpcInData *data) // IN { VixError err = VIX_OK; - GuestApp_Dict **confDictRef; int additionalError = 0; static char resultBuffer[DEFAULT_RESULT_MSG_MAX_LENGTH]; char *serializedBuffer = NULL; @@ -330,11 +302,16 @@ size_t base64BufferLength = 0; Bool success; char *returnBuffer = NULL; +#if defined(VMTOOLS_USE_GLIB) + GKeyFile *confDictRef; +#else + GuestApp_Dict **confDictRef; +#endif /* * Collect some values about the host. */ - confDictRef = (GuestApp_Dict **) clientData; + confDictRef = data->clientData; err = VixTools_GetToolsPropertiesImpl(confDictRef, &serializedBuffer, @@ -375,7 +352,7 @@ err, additionalError, returnBuffer); - RpcIn_SetRetVals(result, resultLen, resultBuffer, TRUE); + RPCIN_SETRETVALS(data, resultBuffer, TRUE); free(serializedBuffer); free(base64Buffer); @@ -401,12 +378,7 @@ */ Bool -ToolsDaemonTcloCheckUserAccount(char const **result, // OUT - size_t *resultLen, // OUT - const char *name, // IN - const char *args, // IN - size_t argsSize, // Ignored - void *clientData) // IN +ToolsDaemonTcloCheckUserAccount(RpcInData *data) // IN { VixError err = VIX_OK; char *credentialTypeStr = NULL; @@ -419,8 +391,8 @@ /* * Parse the argument */ - credentialTypeStr = ToolsDaemonTcloGetQuotedString(args, &args); - obfuscatedNamePassword = ToolsDaemonTcloGetQuotedString(args, &args); + credentialTypeStr = ToolsDaemonTcloGetQuotedString(data->args, &data->args); + obfuscatedNamePassword = ToolsDaemonTcloGetQuotedString(data->args, &data->args); /* * Make sure we are passed the correct arguments. @@ -456,7 +428,7 @@ "%"FMT64"d %d", err, Err_Errno()); - RpcIn_SetRetVals(result, resultLen, resultBuffer, TRUE); + RPCIN_SETRETVALS(data, resultBuffer, TRUE); /* * These were allocated by ToolsDaemonTcloGetQuotedString. @@ -467,6 +439,31 @@ return TRUE; } // ToolsDaemonTcloCheckUserAccount +#if defined(VMTOOLS_USE_GLIB) + +/** + * Initializes internal state of the Foundry daemon. + * + * @param[in] ctx Application context. + */ + +void +FoundryToolsDaemon_Initialize(ToolsAppCtx *ctx) +{ + thisProcessRunsAsRoot = (strcmp(ctx->name, VMTOOLS_GUEST_SERVICE) == 0); + (void) VixTools_Initialize(thisProcessRunsAsRoot, + ToolsDaemonTcloReportProgramCompleted, + ctx); + +#if defined(linux) || defined(_WIN32) + if (thisProcessRunsAsRoot) { + Impersonate_Init(); + } +#endif + +} + +#else /* *----------------------------------------------------------------------------- @@ -491,7 +488,7 @@ Bool runAsRoot) // IN { static Bool inited = FALSE; -#if defined(linux) || (defined(_WIN32) && !defined(SERVICE9X)) +#if defined(linux) || defined(_WIN32) static Bool sync_driver_inited = FALSE; #endif @@ -502,10 +499,11 @@ thisProcessRunsAsRoot = runAsRoot; globalEventQueue = eventQueue; - (void) VixTools_Initialize(thisProcessRunsAsRoot, - globalEventQueue, - ToolsDaemonTcloReportProgramCompleted); + (void) VixTools_Initialize(thisProcessRunsAsRoot, + ToolsDaemonTcloReportProgramCompleted, + NULL); +#if defined(linux) || defined(_WIN32) /* * Be careful, Impersonate_Init should only be ever called once per process. * @@ -515,44 +513,36 @@ if (!inited && thisProcessRunsAsRoot) { Impersonate_Init(); } +#endif - RpcIn_RegisterCallback(in, - VIX_BACKDOORCOMMAND_RUN_PROGRAM, - FoundryToolsDaemonRunProgram, - NULL); - RpcIn_RegisterCallback(in, - VIX_BACKDOORCOMMAND_GET_PROPERTIES, - FoundryToolsDaemonGetToolsProperties, - confDictRef); - RpcIn_RegisterCallback(in, - VIX_BACKDOORCOMMAND_CHECK_USER_ACCOUNT, - ToolsDaemonTcloCheckUserAccount, - NULL); + RpcIn_RegisterCallbackEx(in, + VIX_BACKDOORCOMMAND_RUN_PROGRAM, + FoundryToolsDaemonRunProgram, + eventQueue); + RpcIn_RegisterCallbackEx(in, + VIX_BACKDOORCOMMAND_GET_PROPERTIES, + FoundryToolsDaemonGetToolsProperties, + confDictRef); + RpcIn_RegisterCallbackEx(in, + VIX_BACKDOORCOMMAND_CHECK_USER_ACCOUNT, + ToolsDaemonTcloCheckUserAccount, + NULL); #if !defined(N_PLAT_NLM) - RpcIn_RegisterCallback(in, - VIX_BACKDOORCOMMAND_SEND_HGFS_PACKET, - ToolsDaemonHgfsImpersonated, - NULL); -#endif - RpcIn_RegisterCallback(in, - VIX_BACKDOORCOMMAND_COMMAND, - ToolsDaemonTcloReceiveVixCommand, - confDictRef); - RpcIn_RegisterCallback(in, - VIX_BACKDOORCOMMAND_MOUNT_VOLUME_LIST, - ToolsDaemonTcloMountHGFS, - NULL); -#if IMPLEMENT_SOCKET_MGR - /* - * We can be called again in certain tools error recovery cases, such - * as restoring from a hibernation. This annoys SocketMgr_Init(). - */ - if (!inited) { - socketMgrInitialized = SocketMgr_Init(globalEventQueue); - } -#endif // IMPLEMENT_SOCKET_MGR + RpcIn_RegisterCallbackEx(in, + VIX_BACKDOORCOMMAND_SEND_HGFS_PACKET, + ToolsDaemonHgfsImpersonated, + NULL); +#endif + RpcIn_RegisterCallbackEx(in, + VIX_BACKDOORCOMMAND_COMMAND, + ToolsDaemonTcloReceiveVixCommand, + confDictRef); + RpcIn_RegisterCallbackEx(in, + VIX_BACKDOORCOMMAND_MOUNT_VOLUME_LIST, + ToolsDaemonTcloMountHGFS, + NULL); -#if defined(linux) || (defined(_WIN32) && !defined(SERVICE9X)) +#if defined(linux) || defined(_WIN32) /* * Only init once, but always register the RpcIn. @@ -568,23 +558,22 @@ * Win2k) but the running of the scripts is implemented using * VIX_BACKDOORCOMMAND_RUN_PROGRAM. */ - RpcIn_RegisterCallback(in, - VIX_BACKDOORCOMMAND_SYNCDRIVER_FREEZE, - ToolsDaemonTcloSyncDriverFreeze, - NULL); - RpcIn_RegisterCallback(in, - VIX_BACKDOORCOMMAND_SYNCDRIVER_THAW, - ToolsDaemonTcloSyncDriverThaw, - NULL); + RpcIn_RegisterCallbackEx(in, + VIX_BACKDOORCOMMAND_SYNCDRIVER_FREEZE, + ToolsDaemonTcloSyncDriverFreeze, + eventQueue); + RpcIn_RegisterCallbackEx(in, + VIX_BACKDOORCOMMAND_SYNCDRIVER_THAW, + ToolsDaemonTcloSyncDriverThaw, + NULL); } else { Debug("FoundryToolsDaemon: Failed to init SyncDriver, skipping command handlers.\n"); } - - inited = TRUE; - #endif + inited = TRUE; } // FoundryToolsDaemon_RegisterRoutines +#endif /* *----------------------------------------------------------------------------- @@ -688,6 +677,7 @@ } +#if !defined(VMTOOLS_USE_GLIB) /* *----------------------------------------------------------------------------- * @@ -705,13 +695,8 @@ *----------------------------------------------------------------------------- */ -static Bool -ToolsDaemonTcloOpenUrl(char const **result, // OUT - size_t *resultLen, // OUT - const char *name, // IN - const char *args, // IN - size_t argsSize, // Ignored - void *clientData) // IN +Bool +ToolsDaemonTcloOpenUrl(RpcInData *data) // IN { static char resultBuffer[DEFAULT_RESULT_MSG_MAX_LENGTH]; VixError err = VIX_OK; @@ -727,11 +712,11 @@ /* * Parse the arguments */ - url = ToolsDaemonTcloGetEncodedQuotedString(args, &args); - windowState = ToolsDaemonTcloGetQuotedString(args, &args); + url = ToolsDaemonTcloGetEncodedQuotedString(data->args, &data->args); + windowState = ToolsDaemonTcloGetQuotedString(data->args, &data->args); // These parameters at the end are optional, so they may be NULL. - credentialTypeStr = ToolsDaemonTcloGetQuotedString(args, &args); - obfuscatedNamePassword = ToolsDaemonTcloGetQuotedString(args, &args); + credentialTypeStr = ToolsDaemonTcloGetQuotedString(data->args, &data->args); + obfuscatedNamePassword = ToolsDaemonTcloGetQuotedString(data->args, &data->args); /* * Validate the arguments. @@ -758,17 +743,11 @@ Debug("Opening URL: \"%s\"\n", url); /* Actually open the URL. */ - #if !defined(WIN9XCOMPAT) if (!GuestApp_OpenUrl(url, strcmp(windowState, "maximize") == 0)) { err = VIX_E_FAIL; Debug("Failed to open the url \"%s\"\n", url); goto abort; } -#else - err = VIX_E_OP_NOT_SUPPORTED_ON_GUEST; - goto abort; -#endif - abort: if (impersonatingVMWareUser) { @@ -781,7 +760,7 @@ * foundry error and a guest-OS-specific error. */ Str_Sprintf(resultBuffer, sizeof resultBuffer, "%"FMT64"d %d", err, sysError); - RpcIn_SetRetVals(result, resultLen, resultBuffer, TRUE); + RPCIN_SETRETVALS(data, resultBuffer, TRUE); /* * These were allocated by ToolsDaemonTcloGetQuotedString. @@ -813,13 +792,8 @@ *----------------------------------------------------------------------------- */ -static Bool -ToolsDaemonTcloSetPrinter(char const **result, // OUT - size_t *resultLen, // OUT - const char *name, // IN - const char *args, // IN - size_t argsSize, // Ignored - void *clientData) // IN +Bool +ToolsDaemonTcloSetPrinter(RpcInData *data) // IN { static char resultBuffer[DEFAULT_RESULT_MSG_MAX_LENGTH]; #if defined(_WIN32) @@ -833,8 +807,8 @@ /* * Parse the arguments */ - printerName = ToolsDaemonTcloGetQuotedString(args, &args); - defaultString = ToolsDaemonTcloGetQuotedString(args, &args); + printerName = ToolsDaemonTcloGetQuotedString(data->args, &data->args); + defaultString = ToolsDaemonTcloGetQuotedString(data->args, &data->args); /* * Validate the arguments. @@ -864,7 +838,7 @@ /* Set this printer as the default if requested. */ if (defaultInt != 0) { - if (!SetDefaultPrinter(printerName)) { + if (!Win32U_SetDefaultPrinter(printerName)) { /* * We couldn't set this printer as default. Oh well. We'll * still report success or failure based purely on whether @@ -881,7 +855,7 @@ * foundry error and a guest-OS-specific error. */ Str_Sprintf(resultBuffer, sizeof resultBuffer, "%"FMT64"d %d", err, sysError); - RpcIn_SetRetVals(result, resultLen, resultBuffer, TRUE); + RPCIN_SETRETVALS(data, resultBuffer, TRUE); /* * These were allocated by ToolsDaemonTcloGetQuotedString. @@ -898,10 +872,11 @@ "%d %d 0", VIX_E_OP_NOT_SUPPORTED_ON_GUEST, Err_Errno()); - RpcIn_SetRetVals(result, resultLen, resultBuffer, TRUE); + RPCIN_SETRETVALS(data, resultBuffer, TRUE); return TRUE; #endif } +#endif /* @@ -921,30 +896,30 @@ *----------------------------------------------------------------------------- */ -#if defined(linux) || (defined(_WIN32) && !defined(SERVICE9X)) -static Bool -ToolsDaemonTcloSyncDriverFreeze(char const **result, // OUT - size_t *resultLen, // OUT - const char *name, // IN - const char *args, // IN - size_t argsSize, // Ignored - void *clientData) // IN +#if defined(linux) || defined(_WIN32) +Bool +ToolsDaemonTcloSyncDriverFreeze(RpcInData *data) { static char resultBuffer[DEFAULT_RESULT_MSG_MAX_LENGTH]; VixError err = VIX_OK; char *driveList = NULL; char *timeout = NULL; int timeoutVal; - Event *cbEvent; DECLARE_SYNCDRIVER_ERROR(sysError); +#if defined(VMTOOLS_USE_GLIB) + ToolsAppCtx *ctx = data->appCtx; + GSource *timer; +#else + Event *cbEvent; +#endif Debug(">ToolsDaemonTcloSyncDriverFreeze\n"); /* * Parse the arguments */ - driveList = ToolsDaemonTcloGetQuotedString(args, &args); - timeout = ToolsDaemonTcloGetQuotedString(args, &args); + driveList = ToolsDaemonTcloGetQuotedString(data->args, &data->args); + timeout = ToolsDaemonTcloGetQuotedString(data->args, &data->args); /* * Validate the arguments. @@ -987,7 +962,12 @@ /* Start the timer callback to automatically thaw. */ if (0 != timeoutVal) { Debug("ToolsDaemonTcloSyncDriverFreeze: Starting timer callback %d\n", timeoutVal); - cbEvent = EventManager_Add(globalEventQueue, +#if defined(VMTOOLS_USE_GLIB) + timer = g_timeout_source_new(timeoutVal * 10); + VMTOOLSAPP_ATTACH_SOURCE(ctx, timer, ToolsDaemonSyncDriverThawCallback, NULL, NULL); + g_source_unref(timer); +#else + cbEvent = EventManager_Add(data->clientData, timeoutVal, ToolsDaemonSyncDriverThawCallback, NULL); @@ -996,10 +976,12 @@ if (!SyncDriver_Thaw(gSyncDriverHandle)) { Debug("ToolsDaemonTcloSyncDriverFreeze: Unable to abort freeze. Oh well.\n"); } + SyncDriver_CloseHandle(&gSyncDriverHandle); err = VIX_E_FAIL; sysError = SYNCDRIVERERROR; goto abort; } +#endif } abort: @@ -1015,7 +997,7 @@ */ Str_Sprintf(resultBuffer, sizeof resultBuffer, "%"FMT64"d %d", err, sysError); Debug("<ToolsDaemonTcloSyncDriverFreeze\n"); - return RpcIn_SetRetVals(result, resultLen, resultBuffer, TRUE); + return RPCIN_SETRETVALS(data, resultBuffer, TRUE); } #endif @@ -1037,7 +1019,7 @@ *----------------------------------------------------------------------------- */ -#if defined(linux) || (defined(_WIN32) && !defined(SERVICE9X)) +#if defined(linux) || defined(_WIN32) static Bool ToolsDaemonSyncDriverThawCallback(void *clientData) // IN (ignored) { @@ -1081,14 +1063,9 @@ *----------------------------------------------------------------------------- */ -#if defined(linux) || (defined(_WIN32) && !defined(SERVICE9X)) -static Bool -ToolsDaemonTcloSyncDriverThaw(char const **result, // OUT - size_t *resultLen, // OUT - const char *name, // IN - const char *args, // IN - size_t argsSize, // Ignored - void *clientData) // IN +#if defined(linux) || defined(_WIN32) +Bool +ToolsDaemonTcloSyncDriverThaw(RpcInData *data) // IN { static char resultBuffer[DEFAULT_RESULT_MSG_MAX_LENGTH]; VixError err = VIX_OK; @@ -1106,26 +1083,25 @@ err = VIX_E_GUEST_VOLUMES_NOT_FROZEN; sysError = SYNCDRIVERERROR; Debug("ToolsDaemonTcloSyncDriverThaw: No drives are frozen.\n"); - goto abort; - } - - if (!SyncDriver_Thaw(gSyncDriverHandle)) { + } else if (!SyncDriver_Thaw(gSyncDriverHandle)) { err = VIX_E_FAIL; sysError = SYNCDRIVERERROR; Debug("ToolsDaemonTcloSyncDriverThaw: Failed to Thaw drives\n"); } - abort: + SyncDriver_CloseHandle(&gSyncDriverHandle); + /* * All Foundry tools commands return results that start with a * foundry error and a guest-OS-specific error. */ Str_Sprintf(resultBuffer, sizeof resultBuffer, "%"FMT64"d %d", err, sysError); Debug("<ToolsDaemonTcloSyncDriverThaw\n"); - return RpcIn_SetRetVals(result, resultLen, resultBuffer, TRUE); + return RPCIN_SETRETVALS(data, resultBuffer, TRUE); } #endif +#if !defined(VMTOOLS_USE_GLIB) /* *----------------------------------------------------------------------------- @@ -1180,10 +1156,10 @@ FoundryToolsDaemon_RegisterOpenUrl(RpcIn *in) // IN { /* Register the TCLO handler. */ - RpcIn_RegisterCallback(in, - VIX_BACKDOORCOMMAND_OPEN_URL, - ToolsDaemonTcloOpenUrl, - NULL); + RpcIn_RegisterCallbackEx(in, + VIX_BACKDOORCOMMAND_OPEN_URL, + ToolsDaemonTcloOpenUrl, + NULL); /* * Inform the VMX that we support opening urls in the guest; the UI * and VMX need to know about this capability in advance (rather than @@ -1302,10 +1278,10 @@ } /* Register the TCLO handler. */ - RpcIn_RegisterCallback(in, - VIX_BACKDOORCOMMAND_SET_GUEST_PRINTER, - ToolsDaemonTcloSetPrinter, - NULL); + RpcIn_RegisterCallbackEx(in, + VIX_BACKDOORCOMMAND_SET_GUEST_PRINTER, + ToolsDaemonTcloSetPrinter, + NULL); /* * Inform the VMX that we support setting the guest printer; the UI * and VMX need to know about this capability in advance (rather than @@ -1373,6 +1349,8 @@ return TRUE; } +#endif + /* *----------------------------------------------------------------------------- @@ -1390,25 +1368,47 @@ */ Bool -ToolsDaemonTcloMountHGFS(char const **result, // OUT - size_t *resultLen, // OUT - const char *name, // IN - const char *args, // IN - size_t argsSize, // Ignored - void *clientData) // IN +ToolsDaemonTcloMountHGFS(RpcInData *data) // IN { VixError err = VIX_OK; static char resultBuffer[DEFAULT_RESULT_MSG_MAX_LENGTH]; - Debug(">ToolsDaemonTcloMountHGFS\n"); #if defined(linux) /* + * Look for a vmhgfs mount at /mnt/hgfs. If one exists, nothing + * else needs to be done. If one doesn't exist, then mount at + * that location. + */ + FILE *mtab; + struct mntent *mnt; + Bool vmhgfsMntFound = FALSE; + if ((mtab = setmntent(_PATH_MOUNTED, "r")) == NULL) { + err = VIX_E_FAIL; + } else { + while ((mnt = getmntent(mtab)) != NULL) { + if ((strcmp(mnt->mnt_fsname, ".host:/") == 0) && + (strcmp(mnt->mnt_type, HGFS_NAME) == 0) && + (strcmp(mnt->mnt_dir, "/mnt/hgfs") == 0)) { + vmhgfsMntFound = TRUE; + break; + } + } + endmntent(mtab); + } + + if (vmhgfsMntFound) { + /* * We need to call the mount program, not the mount system call. The - * mount program does several additional things, like compute the mount options - * from the contents of /etc/fstab, and invoke custom mount programs like the - * one needed for HGFS. - */ - system("mount -a -t vmhgfs"); + * mount program does several additional things, like compute the mount + * options from the contents of /etc/fstab, and invoke custom mount + * programs like the one needed for HGFS. + */ + int ret = system("mount -t vmhgfs .host:/ /mnt/hgfs"); + if (ret == -1 || WIFSIGNALED(ret) || + (WIFEXITED(ret) && WEXITSTATUS(ret) != 0)) { + err = VIX_E_FAIL; + } + } #endif /* @@ -1420,9 +1420,8 @@ "%"FMT64"d %d", err, Err_Errno()); - RpcIn_SetRetVals(result, resultLen, resultBuffer, TRUE); + RPCIN_SETRETVALS(data, resultBuffer, TRUE); - Debug("<ToolsDaemonTcloMountHGFS\n"); return TRUE; } // ToolsDaemonTcloMountHGFS @@ -1449,8 +1448,8 @@ * * We do this funky "allocate an HGFS packet with extra * room for foundry error codes" to avoid copying buffers - * around. The HGFS packet buffer is roughly 6k, so it would - * be bad to copy that for every packet. + * around. The HGFS packet buffer is roughly 62k for large V3 Hgfs request + * or 6k for other request , so it would be bad to copy that for every packet. * * It is guaranteed that we will not be called twice * at the same time, so it is safe for resultPacket to be static. @@ -1468,16 +1467,11 @@ */ Bool -ToolsDaemonHgfsImpersonated(char const **result, // OUT - size_t *resultLen, // OUT - const char *name, // IN - const char *args, // IN - size_t argsSize, // IN: Size of args - void *clientData) // Unused +ToolsDaemonHgfsImpersonated(RpcInData *data) // IN { VixError err; size_t hgfsPacketSize = 0; - const char *origArgs = args; + const char *origArgs = data->args; Bool impersonatingVMWareUser = FALSE; char *credentialTypeStr = NULL; char *obfuscatedNamePassword = NULL; @@ -1487,7 +1481,7 @@ #define OTHER_TEXT_SIZE 4 /* strlen(space zero space quote) */ static char resultPacket[STRLEN_OF_MAX_64_BIT_NUMBER_AS_STRING + OTHER_TEXT_SIZE - + HGFS_PACKET_MAX]; + + HGFS_LARGE_PACKET_MAX]; char *hgfsReplyPacket = resultPacket + STRLEN_OF_MAX_64_BIT_NUMBER_AS_STRING + OTHER_TEXT_SIZE; @@ -1510,8 +1504,8 @@ /* * Get the authentication information. */ - credentialTypeStr = ToolsDaemonTcloGetQuotedString(args, &args); - obfuscatedNamePassword = ToolsDaemonTcloGetQuotedString(args, &args); + credentialTypeStr = ToolsDaemonTcloGetQuotedString(data->args, &data->args); + obfuscatedNamePassword = ToolsDaemonTcloGetQuotedString(data->args, &data->args); /* * Make sure we are passed the correct arguments. @@ -1527,21 +1521,21 @@ * since it will try to eat trailing spaces after a quoted string, * and the HGFS packet might begin with a space. */ - if (((args - origArgs) >= argsSize) || ('#' != *args)) { + if (((data->args - origArgs) >= data->argsSize) || ('#' != *(data->args))) { /* * Buffer too small or we got an unexpected token. */ err = VIX_E_FAIL; goto abort; } - args++; + data->args++; /* * At this point args points to the HGFS packet. * If we're pointing beyond the end of the buffer, we'll * get a negative HGFS packet length and abort. */ - hgfsPacketSize = argsSize - (args - origArgs); + hgfsPacketSize = data->argsSize - (data->args - origArgs); if (hgfsPacketSize <= 0) { err = VIX_E_FAIL; goto abort; @@ -1563,7 +1557,7 @@ * Impersonation was okay, so let's give our packet to * the HGFS server and forward the reply packet back. */ - HgfsServer_DispatchPacket(args, // packet in buf + HgfsServer_DispatchPacket(data->args, // packet in buf hgfsReplyPacket, // packet out buf &hgfsPacketSize); // in/out size @@ -1579,10 +1573,10 @@ free(credentialTypeStr); free(obfuscatedNamePassword); - *result = resultPacket; - *resultLen = STRLEN_OF_MAX_64_BIT_NUMBER_AS_STRING - + OTHER_TEXT_SIZE - + hgfsPacketSize; + data->result = resultPacket; + data->resultLen = STRLEN_OF_MAX_64_BIT_NUMBER_AS_STRING + + OTHER_TEXT_SIZE + + hgfsPacketSize; /* * Render the foundry error codes into the buffer. @@ -1607,7 +1601,7 @@ actualUsed = Str_Snprintf(resultPacket, STRLEN_OF_MAX_64_BIT_NUMBER_AS_STRING, "1 0 #"); - *resultLen = actualUsed; + data->resultLen = actualUsed; } else { /* * We computed the string length correctly. Great! @@ -1658,10 +1652,23 @@ ToolsDaemonTcloReportProgramCompleted(const char *requestName, // IN VixError err, // IN int exitCode, // IN - int64 pid) // IN + int64 pid, // IN + void *clientData) // IN { Bool sentResult; +#if defined(VMTOOLS_USE_GLIB) + ToolsAppCtx *ctx = clientData; + gchar *msg = g_strdup_printf("%s %s %"FMT64"d %d %d %"FMT64"d", + VIX_BACKDOORCOMMAND_RUN_PROGRAM_DONE, + requestName, + err, + Err_Errno(), + exitCode, + (int64) pid); + sentResult = RpcChannel_Send(ctx->rpc, msg, strlen(msg) + 1, NULL, NULL); + g_free(msg); +#else sentResult = RpcOut_sendOne(NULL, NULL, "%s %s %"FMT64"d %d %d %"FMT64"d", @@ -1671,6 +1678,8 @@ Err_Errno(), exitCode, (int64) pid); +#endif + if (!sentResult) { Warning("Unable to send results from polling the result program.\n\n"); } @@ -1694,12 +1703,7 @@ */ Bool -ToolsDaemonTcloReceiveVixCommand(char const **result, // OUT - size_t *resultLen, // OUT - const char *name, // IN - const char *args, // IN - size_t argsSize, // IN: Size of args - void *clientData) // IN +ToolsDaemonTcloReceiveVixCommand(RpcInData *data) // IN { VixError err = VIX_OK; char *requestName = NULL; @@ -1710,39 +1714,47 @@ size_t resultValueLength = 0; Bool deleteResultValue = FALSE; char *destPtr = NULL; - GuestApp_Dict **confDictRef; int vixPrefixDataSize = (MAX64_DECIMAL_DIGITS * 2) + (sizeof(' ') * 2) + sizeof('\0'); + /* - * Our temporary buffer will be the same size as what the + * Our temporary buffer will be the same size as what the * Tclo/RPC system can handle, which is GUESTMSG_MAX_IN_SIZE. */ static char tcloBuffer[GUESTMSG_MAX_IN_SIZE]; - - - requestName = ToolsDaemonTcloGetQuotedString(args, &args); + +#if defined(VMTOOLS_USE_GLIB) + ToolsAppCtx *ctx = data->appCtx; + GMainLoop *eventQueue = ctx->mainLoop; + GKeyFile *confDictRef = ctx->config; +#else + DblLnkLst_Links *eventQueue = globalEventQueue; + GuestApp_Dict **confDictRef = data->clientData; +#endif + + requestName = ToolsDaemonTcloGetQuotedString(data->args, &data->args); /* * Skip the NULL, char, and then the rest of the buffer should just * be a Vix command object. */ - while (*args) { - args += 1; + while (*data->args) { + data->args += 1; } - args += 1; - err = VixMsg_ValidateMessage((char *) args, argsSize); + data->args += 1; + err = VixMsg_ValidateMessage((char *) data->args, data->argsSize); if (VIX_OK != err) { goto abort; } - requestMsg = (VixCommandRequestHeader *) args; - confDictRef = (GuestApp_Dict **) clientData; + requestMsg = (VixCommandRequestHeader *) data->args; maxResultBufferSize = sizeof(tcloBuffer) - vixPrefixDataSize; err = VixTools_ProcessVixCommand(requestMsg, requestName, maxResultBufferSize, confDictRef, + eventQueue, &resultValue, &resultValueLength, &deleteResultValue); @@ -1792,7 +1804,7 @@ if ((NULL != requestMsg) && (requestMsg->commonHeader.commonFlags & VIX_COMMAND_GUEST_RETURNS_BINARY)) { *(destPtr++) = '#'; - *resultLen = destPtr - tcloBuffer + sizeof '#' + resultValueLength; + data->resultLen = destPtr - tcloBuffer + sizeof '#' + resultValueLength; } /* @@ -1807,10 +1819,10 @@ if ((NULL == requestMsg) || !(requestMsg->commonHeader.commonFlags & VIX_COMMAND_GUEST_RETURNS_BINARY)) { *(destPtr++) = 0; - *resultLen = strlen(tcloBuffer); + data->resultLen = strlen(tcloBuffer) + 1; } - *result = tcloBuffer; + data->result = tcloBuffer; if (deleteResultValue) { free(resultValue); diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/vmware-user/foundryToolsDaemon.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/vmware-user/foundryToolsDaemon.h --- open-vm-tools-2008.01.23-74039/vmware-user/foundryToolsDaemon.h 2008-01-28 08:02:53.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/vmware-user/foundryToolsDaemon.h 2008-10-13 08:01:54.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -29,6 +29,15 @@ # define __VIX_TOOLS_DAEMON_H__ +#if defined(VMTOOLS_USE_GLIB) + +#include "vmtoolsApp.h" + +void +FoundryToolsDaemon_Initialize(ToolsAppCtx *ctx); + +#else /* not vix plugin */ + #include "vm_basic_types.h" #include "rpcin.h" #include "guestApp.h" @@ -47,5 +56,6 @@ Bool FoundryToolsDaemon_RegisterOpenUrlCapability(void); Bool FoundryToolsDaemon_UnregisterOpenUrl(void); +#endif #endif /* __VIX_TOOLS_DAEMON_H__ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/vmware-user/libvmwarectrl.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/vmware-user/libvmwarectrl.c --- open-vm-tools-2008.01.23-74039/vmware-user/libvmwarectrl.c 2008-01-28 08:02:53.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/vmware-user/libvmwarectrl.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,275 +0,0 @@ -/* - * Copyright 2006 by VMware, Inc. - * - * 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name of the copyright holder(s) - * and author(s) shall not be used in advertising or otherwise to promote - * the sale, use or other dealings in this Software without prior written - * authorization from the copyright holder(s) and author(s). - */ - -/* - * libvmwarectrl.c -- - * - * The VMWARE_CTRL client library. - */ - - -#define NEED_EVENTS -#define NEED_REPLIES -#include <X11/Xlibint.h> -#include "libvmwarectrl.h" -#include "vmwarectrlproto.h" -#include <X11/extensions/Xext.h> -#include <X11/extensions/extutil.h> - - -/* - * Static data and functions. - */ - -static XExtensionInfo _vmwarectrl_info_data; -static XExtensionInfo *vmwarectrl_info = &_vmwarectrl_info_data; -static char *vmwarectrl_extension_name = VMWARE_CTRL_PROTOCOL_NAME; - -#define VMwareCtrlCheckExtension(dpy, i, val) \ - XextCheckExtension(dpy, i, vmwarectrl_extension_name, val) - -static int close_display(Display *dpy, XExtCodes *codes); - -static /* const */ XExtensionHooks vmwarectrl_extension_hooks = { - NULL, /* create_gc */ - NULL, /* copy_gc */ - NULL, /* flush_gc */ - NULL, /* free_gc */ - NULL, /* create_font */ - NULL, /* free_font */ - close_display, /* close_display */ - NULL, /* wire_to_event */ - NULL, /* event_to_wire */ - NULL, /* error */ - NULL, /* error_string */ -}; - -static XEXT_GENERATE_CLOSE_DISPLAY (close_display, vmwarectrl_info) - -static XEXT_GENERATE_FIND_DISPLAY (find_display, vmwarectrl_info, - vmwarectrl_extension_name, - &vmwarectrl_extension_hooks, - 0, NULL) - -/* - *---------------------------------------------------------------------------- - * - * VMwareCtrl_QueryExtension -- - * - * Standard QueryExtension implementation. Not very interesting for - * VMWARE_CTRL as it doesn't define any events or errors. - * - * Results: - * True if information is successfully retrieved. False otherwise. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------------- - */ - -Bool -VMwareCtrl_QueryExtension(Display *dpy, // IN: - int *event_basep, // OUT: - int *error_basep) // OUT: -{ - XExtDisplayInfo *info = find_display(dpy); - - if (XextHasExtension(info)) { - *event_basep = info->codes->first_event; - *error_basep = info->codes->first_error; - return True; - } else { - return False; - } -} - - -/* - *---------------------------------------------------------------------------- - * - * VMwareCtrl_QueryVersion -- - * - * Send the QueryVersion command to the driver and return the results. - * - * Results: - * True if information is successfully retrieved. False otherwise. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------------- - */ - -Bool -VMwareCtrl_QueryVersion(Display *dpy, // IN: - int *majorVersion, // OUT: - int *minorVersion) // OUT: -{ - xVMwareCtrlQueryVersionReply rep; - xVMwareCtrlQueryVersionReq *req; - XExtDisplayInfo *info = find_display(dpy); - Bool ret = False; - - VMwareCtrlCheckExtension(dpy, info, False); - LockDisplay(dpy); - - GetReq(VMwareCtrlQueryVersion, req); - req->reqType = info->codes->major_opcode; - req->VMwareCtrlReqType = X_VMwareCtrlQueryVersion; - - if (!_XReply(dpy, (xReply *)&rep, 0, xFalse)) { - goto exit; - } - *majorVersion = rep.majorVersion; - *minorVersion = rep.minorVersion; - - ret = True; - -exit: - UnlockDisplay(dpy); - SyncHandle(); - - return ret; -} - - -/* - *---------------------------------------------------------------------------- - * - * VMwareCtrl_SetRes -- - * - * Send the SetRes command to the driver. - * - * Results: - * True if the resolution was set. False otherwise. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------------- - */ - -Bool -VMwareCtrl_SetRes(Display *dpy, // IN: - int screen, // IN: - int x, // IN: - int y) // IN: -{ - xVMwareCtrlSetResReply rep; - xVMwareCtrlSetResReq *req; - XExtDisplayInfo *info = find_display(dpy); - Bool ret = False; - - VMwareCtrlCheckExtension(dpy, info, False); - LockDisplay(dpy); - - GetReq(VMwareCtrlSetRes, req); - req->reqType = info->codes->major_opcode; - req->VMwareCtrlReqType = X_VMwareCtrlSetRes; - req->screen = screen; - req->x = x; - req->y = y; - - if (!_XReply(dpy, (xReply *)&rep, - (SIZEOF(xVMwareCtrlSetResReply) - SIZEOF(xReply)) >> 2, - xFalse)) { - goto exit; - } - - ret = True; - -exit: - UnlockDisplay(dpy); - SyncHandle(); - - return ret; -} - - -/* - *---------------------------------------------------------------------------- - * - * VMwareCtrl_SetTopology -- - * - * Send the SetTopology command to the driver. - * - * Solaris 10 uses a different Xinerama standard than expected here. As a - * result, topology set is not supported and this function is excluded from - * Solaris builds. - * - * Results: - * True if the resolution and xinerama topology were set. False otherwise. - * - * Side effects: - * None. - * - *---------------------------------------------------------------------------- - */ - -#ifndef NO_MULTIMON -Bool -VMwareCtrl_SetTopology(Display *dpy, // IN: - int screen, // IN: - xXineramaScreenInfo extents[], // IN: - int number) // IN: -{ - xVMwareCtrlSetTopologyReply rep; - xVMwareCtrlSetTopologyReq *req; - XExtDisplayInfo *info = find_display(dpy); - Bool ret = False; - long len; - - VMwareCtrlCheckExtension(dpy, info, False); - LockDisplay(dpy); - - GetReq(VMwareCtrlSetTopology, req); - req->reqType = info->codes->major_opcode; - req->VMwareCtrlReqType = X_VMwareCtrlSetTopology; - req->screen = screen; - req->number = number; - - len = ((long) number) << 1; - SetReqLen(req, len, len); - len <<= 2; - _XSend(dpy, (char *)extents, len); - - if (!_XReply(dpy, (xReply *)&rep, - (SIZEOF(xVMwareCtrlSetTopologyReply) - SIZEOF(xReply)) >> 2, - xFalse)) { - goto exit; - } - - ret = True; - -exit: - UnlockDisplay(dpy); - SyncHandle(); - - return ret; -} -#endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/vmware-user/libvmwarectrl.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/vmware-user/libvmwarectrl.h --- open-vm-tools-2008.01.23-74039/vmware-user/libvmwarectrl.h 2008-01-28 08:02:53.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/vmware-user/libvmwarectrl.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,51 +0,0 @@ -/* - * Copyright 2006 by VMware, Inc. - * - * 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name of the copyright holder(s) - * and author(s) shall not be used in advertising or otherwise to promote - * the sale, use or other dealings in this Software without prior written - * authorization from the copyright holder(s) and author(s). - */ - -/* - * libvmwarectrl.c -- - * - * The VMWARE_CTRL client library. - */ - - -#ifndef _LIB_VMWARE_CTRL_H_ -#define _LIB_VMWARE_CTRL_H_ - -#include <X11/X.h> -#include <X11/Xmd.h> -#ifndef NO_MULTIMON -#include <X11/extensions/panoramiXproto.h> -#endif - -Bool VMwareCtrl_QueryExtension(Display *dpy, int *event_basep, int *error_basep); -Bool VMwareCtrl_QueryVersion(Display *dpy, int *majorVersion, int *minorVersion); -Bool VMwareCtrl_SetRes(Display *dpy, int screen, int x, int y); -#ifndef NO_MULTIMON -Bool VMwareCtrl_SetTopology(Display *dpy, int screen, xXineramaScreenInfo[], int number); -#endif - -#endif /* _LIB_VMWARE_CTRL_H_ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/vmware-user/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/vmware-user/Makefile.am --- open-vm-tools-2008.01.23-74039/vmware-user/Makefile.am 2008-01-28 08:02:53.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/vmware-user/Makefile.am 2008-10-13 08:01:54.000000000 +0100 @@ -15,20 +15,25 @@ ### Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ -noinst_PROGRAMS = vmware-user +bin_PROGRAMS = vmware-user AM_CFLAGS = -AM_CFLAGS += @GTK_CFLAGS@ -AM_CFLAGS += @COMMON_CFLAGS@ -AM_CFLAGS += @VMWARE_USER_CFLAGS@ +AM_CFLAGS += @GTK_CPPFLAGS@ +AM_CFLAGS += @VMWARE_USER_CPPFLAGS@ +AM_CFLAGS += -I$(top_builddir)/include +AM_CFLAGS += -DRESOLUTION_X11 vmware_user_LDADD = -vmware_user_LDADD += ../lib/atomic/libAtomic.a vmware_user_LDADD += ../lib/conf/libConf.a vmware_user_LDADD += ../lib/dnd/libDnd.a vmware_user_LDADD += ../lib/eventManager/libEventManager.a vmware_user_LDADD += ../lib/file/libFile.a -vmware_user_LDADD += ../lib/guestApp/libGuestApp.a +if ENABLE_UNITY + vmware_user_LDADD += ../lib/ghIntegration/libGhIntegration.a +else + vmware_user_LDADD += ../lib/ghIntegrationStub/libGhIntegrationStub.a +endif +vmware_user_LDADD += ../lib/guestApp/libGuestAppX11.a vmware_user_LDADD += ../lib/guestInfo/libGuestInfo.a vmware_user_LDADD += ../lib/hgfsServer/libHgfsServer.a vmware_user_LDADD += ../lib/hgfsServerManagerGuest/libHgfsServerManagerGuest.a @@ -36,16 +41,23 @@ vmware_user_LDADD += ../lib/impersonate/libImpersonate.a vmware_user_LDADD += ../lib/netUtil/libNetUtil.a vmware_user_LDADD += ../lib/printer/libPrinter.a +vmware_user_LDADD += ../lib/resolution/libResolution.a vmware_user_LDADD += ../lib/rpcIn/libRpcIn.a vmware_user_LDADD += ../lib/rpcOut/libRpcOut.a vmware_user_LDADD += ../lib/rpcVmx/libRpcVmx.a vmware_user_LDADD += ../lib/SLPv2Parser/libSLPv2Parser.a vmware_user_LDADD += ../lib/socketMgr/libSocketMgr.a -vmware_user_LDADD += ../lib/strUtil/libStrUtil.a vmware_user_LDADD += ../lib/string/libString.a vmware_user_LDADD += ../lib/sync/libSync.a vmware_user_LDADD += ../lib/syncDriver/libSyncDriver.a vmware_user_LDADD += ../lib/system/libSystem.a +if ENABLE_UNITY + vmware_user_LDADD += ../lib/unity/libUnity.a + vmware_user_LDADD += ../lib/unityWindowTracker/libUnityWindowTracker.a +else + vmware_user_LDADD += ../lib/unityStub/libUnityStub.a +endif +vmware_user_LDADD += ../lib/guestRpc/libGuestRpc.a vmware_user_LDADD += ../lib/user/libUser.a vmware_user_LDADD += ../lib/vixTools/libVixTools.a vmware_user_LDADD += ../lib/vmCheck/libVmCheck.a @@ -58,21 +70,31 @@ vmware_user_LDADD += ../lib/foundryMsg/libFoundryMsg.a vmware_user_LDADD += ../lib/backdoor/libBackdoor.a vmware_user_LDADD += ../lib/dict/libDict.a +vmware_user_LDADD += ../lib/dynxdr/libDynxdr.a vmware_user_LDADD += ../lib/hgfs/libHgfs.a vmware_user_LDADD += ../lib/message/libMessage.a vmware_user_LDADD += ../lib/unicode/libUnicode.a vmware_user_LDADD += ../lib/misc/libMisc.a -vmware_user_LDADD += ../lib/fileUtf8/libFileUtf8.a vmware_user_LDADD += ../lib/procMgr/libProcMgr.a vmware_user_LDADD += ../lib/auth/libAuth.a vmware_user_LDADD += ../lib/panicDefault/libPanicDefault.a vmware_user_LDADD += ../lib/panic/libPanic.a - -vmware_user_LDFLAGS = -vmware_user_LDFLAGS += -lcrypt -vmware_user_LDFLAGS += @GTK_LIBS@ -vmware_user_LDFLAGS += @VMWARE_USER_LDFLAGS@ -vmware_user_LDFLAGS += @COMMON_XLIBS@ +vmware_user_LDADD += ../lib/stubs/libStubs.a +if ENABLE_UNITY + vmware_user_LDADD += ../lib/appUtil/libAppUtil.a + vmware_user_LDADD += ../lib/image/libImage.a + vmware_user_LDADD += ../lib/raster/libRaster.a + vmware_user_LDADD += ../lib/region/libRegion.a +endif +vmware_user_LDADD += -lcrypt +vmware_user_LDADD += @GTK_LIBS@ +vmware_user_LDADD += @VMWARE_USER_LDADD@ +vmware_user_LDADD += @COMMON_XLIBS@ +if ENABLE_UNITY + vmware_user_LDADD += @URIPARSER_LIBS@ + vmware_user_LDADD += @LIBPNG_LIBS@ + vmware_user_LDADD += @ZLIB_LIBS@ +endif vmware_user_SOURCES = vmware_user_SOURCES += copyPaste.c @@ -81,8 +103,22 @@ vmware_user_SOURCES += foreignVMToolsDaemon.c vmware_user_SOURCES += foreignVMToolsNetworking.c vmware_user_SOURCES += foundryToolsDaemon.c -vmware_user_SOURCES += libvmwarectrl.c +vmware_user_SOURCES += notify.c vmware_user_SOURCES += pointer.c -vmware_user_SOURCES += resolution.c -vmware_user_SOURCES += stub.c vmware_user_SOURCES += vmware-user.c + +if HAVE_ICU + vmware_user_LDADD += @ICU_LIBS@ + vmware_user_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CXX) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +else + vmware_user_LINK = $(LINK) +endif + +install-exec-hook: + $(INSTALL) -d $(DESTDIR)$(datadir)/applications/ + $(INSTALL) -m 644 ../scripts/common/vmware-user.desktop \ + $(DESTDIR)$(datadir)/applications/ +uninstall-hook: + -$(RM) -f $(DESTDIR)$(datadir)/applications/vmware-user.desktop diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/vmware-user/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/vmware-user/Makefile.in --- open-vm-tools-2008.01.23-74039/vmware-user/Makefile.in 2008-01-28 08:03:06.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/vmware-user/Makefile.in 2008-10-13 08:02:17.000000000 +0100 @@ -49,52 +49,69 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -noinst_PROGRAMS = vmware-user$(EXEEXT) +bin_PROGRAMS = vmware-user$(EXEEXT) +@ENABLE_UNITY_TRUE@am__append_1 = ../lib/ghIntegration/libGhIntegration.a +@ENABLE_UNITY_FALSE@am__append_2 = ../lib/ghIntegrationStub/libGhIntegrationStub.a +@ENABLE_UNITY_TRUE@am__append_3 = ../lib/unity/libUnity.a \ +@ENABLE_UNITY_TRUE@ ../lib/unityWindowTracker/libUnityWindowTracker.a +@ENABLE_UNITY_FALSE@am__append_4 = ../lib/unityStub/libUnityStub.a +@ENABLE_UNITY_TRUE@am__append_5 = ../lib/appUtil/libAppUtil.a \ +@ENABLE_UNITY_TRUE@ ../lib/image/libImage.a \ +@ENABLE_UNITY_TRUE@ ../lib/raster/libRaster.a \ +@ENABLE_UNITY_TRUE@ ../lib/region/libRegion.a +@ENABLE_UNITY_TRUE@am__append_6 = @URIPARSER_LIBS@ @LIBPNG_LIBS@ \ +@ENABLE_UNITY_TRUE@ @ZLIB_LIBS@ $(am__empty) +@HAVE_ICU_TRUE@am__append_7 = @ICU_LIBS@ subdir = vmware-user DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in COPYING ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +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)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = -PROGRAMS = $(noinst_PROGRAMS) +am__installdirs = "$(DESTDIR)$(bindir)" +binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +PROGRAMS = $(bin_PROGRAMS) am_vmware_user_OBJECTS = copyPaste.$(OBJEXT) debugStdio.$(OBJEXT) \ dnd.$(OBJEXT) foreignVMToolsDaemon.$(OBJEXT) \ foreignVMToolsNetworking.$(OBJEXT) \ - foundryToolsDaemon.$(OBJEXT) libvmwarectrl.$(OBJEXT) \ - pointer.$(OBJEXT) resolution.$(OBJEXT) stub.$(OBJEXT) \ - vmware-user.$(OBJEXT) + foundryToolsDaemon.$(OBJEXT) notify.$(OBJEXT) \ + pointer.$(OBJEXT) vmware-user.$(OBJEXT) vmware_user_OBJECTS = $(am_vmware_user_OBJECTS) -vmware_user_DEPENDENCIES = ../lib/atomic/libAtomic.a \ - ../lib/conf/libConf.a ../lib/dnd/libDnd.a \ +am__DEPENDENCIES_1 = +vmware_user_DEPENDENCIES = ../lib/conf/libConf.a ../lib/dnd/libDnd.a \ ../lib/eventManager/libEventManager.a ../lib/file/libFile.a \ - ../lib/guestApp/libGuestApp.a ../lib/guestInfo/libGuestInfo.a \ + $(am__append_1) $(am__append_2) \ + ../lib/guestApp/libGuestAppX11.a \ + ../lib/guestInfo/libGuestInfo.a \ ../lib/hgfsServer/libHgfsServer.a \ ../lib/hgfsServerManagerGuest/libHgfsServerManagerGuest.a \ ../lib/hgfsServerPolicyGuest/libHgfsServerPolicyGuest.a \ ../lib/impersonate/libImpersonate.a \ ../lib/netUtil/libNetUtil.a ../lib/printer/libPrinter.a \ - ../lib/rpcIn/libRpcIn.a ../lib/rpcOut/libRpcOut.a \ - ../lib/rpcVmx/libRpcVmx.a ../lib/SLPv2Parser/libSLPv2Parser.a \ - ../lib/socketMgr/libSocketMgr.a ../lib/strUtil/libStrUtil.a \ - ../lib/string/libString.a ../lib/sync/libSync.a \ - ../lib/syncDriver/libSyncDriver.a ../lib/system/libSystem.a \ - ../lib/user/libUser.a ../lib/vixTools/libVixTools.a \ - ../lib/vmCheck/libVmCheck.a ../lib/vmSignal/libVmSignal.a \ - ../lib/wiper/libWiper.a ../lib/err/libErr.a \ - ../lib/foundryMsg/libFoundryMsg.a \ + ../lib/resolution/libResolution.a ../lib/rpcIn/libRpcIn.a \ + ../lib/rpcOut/libRpcOut.a ../lib/rpcVmx/libRpcVmx.a \ + ../lib/SLPv2Parser/libSLPv2Parser.a \ + ../lib/socketMgr/libSocketMgr.a ../lib/string/libString.a \ + ../lib/sync/libSync.a ../lib/syncDriver/libSyncDriver.a \ + ../lib/system/libSystem.a $(am__append_3) $(am__append_4) \ + ../lib/guestRpc/libGuestRpc.a ../lib/user/libUser.a \ + ../lib/vixTools/libVixTools.a ../lib/vmCheck/libVmCheck.a \ + ../lib/vmSignal/libVmSignal.a ../lib/wiper/libWiper.a \ + ../lib/err/libErr.a ../lib/foundryMsg/libFoundryMsg.a \ ../lib/backdoor/libBackdoor.a ../lib/dict/libDict.a \ - ../lib/hgfs/libHgfs.a ../lib/message/libMessage.a \ - ../lib/unicode/libUnicode.a ../lib/misc/libMisc.a \ - ../lib/fileUtf8/libFileUtf8.a ../lib/procMgr/libProcMgr.a \ + ../lib/dynxdr/libDynxdr.a ../lib/hgfs/libHgfs.a \ + ../lib/message/libMessage.a ../lib/unicode/libUnicode.a \ + ../lib/misc/libMisc.a ../lib/procMgr/libProcMgr.a \ ../lib/auth/libAuth.a ../lib/panicDefault/libPanicDefault.a \ - ../lib/panic/libPanic.a -vmware_user_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ - $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ - $(vmware_user_LDFLAGS) $(LDFLAGS) -o $@ + ../lib/panic/libPanic.a ../lib/stubs/libStubs.a \ + $(am__append_5) $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp +depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -120,8 +137,6 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -COMMON_CFLAGS = @COMMON_CFLAGS@ -COMMON_PROG_CFLAGS = @COMMON_PROG_CFLAGS@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -132,45 +147,57 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ -ECHO = @ECHO@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GREP = @GREP@ -GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_AUTH_CFLAGS = @LIB_AUTH_CFLAGS@ -LIB_FILE_CFLAGS = @LIB_FILE_CFLAGS@ -LIB_HGFS_SERVER_CFLAGS = @LIB_HGFS_SERVER_CFLAGS@ -LIB_IMPERSONATE_CFLAGS = @LIB_IMPERSONATE_CFLAGS@ -LIB_MISC_CFLAGS = @LIB_MISC_CFLAGS@ -LIB_PROC_MGR_CFLAGS = @LIB_PROC_MGR_CFLAGS@ -LIB_STRING_CFLAGS = @LIB_STRING_CFLAGS@ -LIB_USER_CFLAGS = @LIB_USER_CFLAGS@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -178,27 +205,35 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ VERSION = @VERSION@ -VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -229,6 +264,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -243,40 +279,47 @@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -AM_CFLAGS = @GTK_CFLAGS@ @COMMON_CFLAGS@ @VMWARE_USER_CFLAGS@ +AM_CFLAGS = @GTK_CPPFLAGS@ @VMWARE_USER_CPPFLAGS@ \ + -I$(top_builddir)/include -DRESOLUTION_X11 # In the absence of the linker options --start-group and --end-group (which # can't be put in LDADD), we need to bring the following libraries out of # the alphabetical order so their symbols are properly resolved. -vmware_user_LDADD = ../lib/atomic/libAtomic.a ../lib/conf/libConf.a \ - ../lib/dnd/libDnd.a ../lib/eventManager/libEventManager.a \ - ../lib/file/libFile.a ../lib/guestApp/libGuestApp.a \ +vmware_user_LDADD = ../lib/conf/libConf.a ../lib/dnd/libDnd.a \ + ../lib/eventManager/libEventManager.a ../lib/file/libFile.a \ + $(am__append_1) $(am__append_2) \ + ../lib/guestApp/libGuestAppX11.a \ ../lib/guestInfo/libGuestInfo.a \ ../lib/hgfsServer/libHgfsServer.a \ ../lib/hgfsServerManagerGuest/libHgfsServerManagerGuest.a \ ../lib/hgfsServerPolicyGuest/libHgfsServerPolicyGuest.a \ ../lib/impersonate/libImpersonate.a \ ../lib/netUtil/libNetUtil.a ../lib/printer/libPrinter.a \ - ../lib/rpcIn/libRpcIn.a ../lib/rpcOut/libRpcOut.a \ - ../lib/rpcVmx/libRpcVmx.a ../lib/SLPv2Parser/libSLPv2Parser.a \ - ../lib/socketMgr/libSocketMgr.a ../lib/strUtil/libStrUtil.a \ - ../lib/string/libString.a ../lib/sync/libSync.a \ - ../lib/syncDriver/libSyncDriver.a ../lib/system/libSystem.a \ - ../lib/user/libUser.a ../lib/vixTools/libVixTools.a \ - ../lib/vmCheck/libVmCheck.a ../lib/vmSignal/libVmSignal.a \ - ../lib/wiper/libWiper.a ../lib/err/libErr.a \ - ../lib/foundryMsg/libFoundryMsg.a \ + ../lib/resolution/libResolution.a ../lib/rpcIn/libRpcIn.a \ + ../lib/rpcOut/libRpcOut.a ../lib/rpcVmx/libRpcVmx.a \ + ../lib/SLPv2Parser/libSLPv2Parser.a \ + ../lib/socketMgr/libSocketMgr.a ../lib/string/libString.a \ + ../lib/sync/libSync.a ../lib/syncDriver/libSyncDriver.a \ + ../lib/system/libSystem.a $(am__append_3) $(am__append_4) \ + ../lib/guestRpc/libGuestRpc.a ../lib/user/libUser.a \ + ../lib/vixTools/libVixTools.a ../lib/vmCheck/libVmCheck.a \ + ../lib/vmSignal/libVmSignal.a ../lib/wiper/libWiper.a \ + ../lib/err/libErr.a ../lib/foundryMsg/libFoundryMsg.a \ ../lib/backdoor/libBackdoor.a ../lib/dict/libDict.a \ - ../lib/hgfs/libHgfs.a ../lib/message/libMessage.a \ - ../lib/unicode/libUnicode.a ../lib/misc/libMisc.a \ - ../lib/fileUtf8/libFileUtf8.a ../lib/procMgr/libProcMgr.a \ + ../lib/dynxdr/libDynxdr.a ../lib/hgfs/libHgfs.a \ + ../lib/message/libMessage.a ../lib/unicode/libUnicode.a \ + ../lib/misc/libMisc.a ../lib/procMgr/libProcMgr.a \ ../lib/auth/libAuth.a ../lib/panicDefault/libPanicDefault.a \ - ../lib/panic/libPanic.a -vmware_user_LDFLAGS = -lcrypt @GTK_LIBS@ @VMWARE_USER_LDFLAGS@ \ - @COMMON_XLIBS@ $(am__empty) + ../lib/panic/libPanic.a ../lib/stubs/libStubs.a \ + $(am__append_5) -lcrypt @GTK_LIBS@ @VMWARE_USER_LDADD@ \ + @COMMON_XLIBS@ $(am__append_6) $(am__append_7) vmware_user_SOURCES = copyPaste.c debugStdio.c dnd.c \ foreignVMToolsDaemon.c foreignVMToolsNetworking.c \ - foundryToolsDaemon.c libvmwarectrl.c pointer.c resolution.c \ - stub.c vmware-user.c + foundryToolsDaemon.c notify.c pointer.c vmware-user.c +@HAVE_ICU_FALSE@vmware_user_LINK = $(LINK) +@HAVE_ICU_TRUE@vmware_user_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ +@HAVE_ICU_TRUE@ $(LIBTOOLFLAGS) --mode=link $(CXX) $(AM_CXXFLAGS) \ +@HAVE_ICU_TRUE@ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ + all: all-am .SUFFIXES: @@ -310,9 +353,30 @@ 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-noinstPROGRAMS: - @list='$(noinst_PROGRAMS)'; for p in $$list; do \ +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 ; \ @@ -333,10 +397,8 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/foreignVMToolsDaemon.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/foreignVMToolsNetworking.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/foundryToolsDaemon.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libvmwarectrl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/notify.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pointer.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/resolution.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stub.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vmware-user.Po@am__quote@ .c.o: @@ -444,6 +506,9 @@ 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 @@ -470,8 +535,7 @@ @echo "it deletes files that may require special tools to rebuild." clean: clean-am -clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ - mostlyclean-am +clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) @@ -493,7 +557,9 @@ install-dvi: install-dvi-am -install-exec-am: +install-exec-am: install-binPROGRAMS + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-exec-hook install-html: install-html-am @@ -525,23 +591,33 @@ ps-am: -uninstall-am: - -.MAKE: install-am install-strip - -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstPROGRAMS 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 - +uninstall-am: uninstall-binPROGRAMS + @$(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-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-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-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \ + uninstall-am uninstall-binPROGRAMS uninstall-hook + + +install-exec-hook: + $(INSTALL) -d $(DESTDIR)$(datadir)/applications/ + $(INSTALL) -m 644 ../scripts/common/vmware-user.desktop \ + $(DESTDIR)$(datadir)/applications/ +uninstall-hook: + -$(RM) -f $(DESTDIR)$(datadir)/applications/vmware-user.desktop # 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: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/vmware-user/modconfig.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/vmware-user/modconfig.c --- open-vm-tools-2008.01.23-74039/vmware-user/modconfig.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/vmware-user/modconfig.c 2008-10-13 08:01:54.000000000 +0100 @@ -0,0 +1,240 @@ +/********************************************************* + * Copyright (C) 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. + * + *********************************************************/ + +/* + * modconfig.c -- + * + * Handles interaction with the modconfig gui for vmware-user. + */ + +#include "vmwareuserInt.h" + +#ifdef USE_NOTIFY_DLOPEN + +#include "installerdb.h" +#include "file.h" +#include "installerdb.h" +#include "modconf.h" +#include "str.h" + + +/* + * Local functions + */ +static GtkWidget *GetMenu(void); +static void LaunchModconfig(void); +static gboolean ActivateCallback(GtkWidget *widget, Notifier *n); +static void MenuItemCallback(GObject *self, void *data); + + +/* + *---------------------------------------------------------------------------- + * + * LaunchModconfig -- + * + * Asynchronously spawn the modconfig process to rebuild kernel modules. + * + * Results: + * None. + * + * Side effects: + * The modoconfig program is launched, and modules are recompiled. + * + *---------------------------------------------------------------------------- + */ + +static void +LaunchModconfig(void) +{ + char *exePath; + char *command; + gchar *quotedExePath; + + exePath = Str_Asprintf(NULL, "%s/sbin/vmware-modconfig-wrapper", vmLibDir); + quotedExePath = g_shell_quote(exePath); + command = Str_Asprintf(NULL, "%s --icon=\"vmware-modconfig\" " + "--appname=\"VMware Tools\"", quotedExePath); + + g_spawn_command_line_async(command, NULL); + + free(command); + g_free(quotedExePath); + free(exePath); +} + + +/* + *---------------------------------------------------------------------------- + * + * ActivateCallback -- + * + * The callback invoked when the status icon is left-clicked. + * + * Results: + * TRUE if the signal is handled, FALSE otherwise. + * + * Side effects: + * Launches modconfig. + * + *---------------------------------------------------------------------------- + */ + +static gboolean +ActivateCallback(GtkWidget *widget, // IN + Notifier *n) // IN +{ + LaunchModconfig(); + return TRUE; +} + + +/* + *---------------------------------------------------------------------------- + * + * MenuItemCallback -- + * + * The callback invoked when any item on the popup context menu is clicked. + * + * Results: + * None. + * + * Side effects: + * Launches modconfig. + * + *---------------------------------------------------------------------------- + */ + +static void +MenuItemCallback(GObject *self, // IN + void *data) // IN +{ + LaunchModconfig(); +} + + +/* + *---------------------------------------------------------------------------- + * + * GetMenu -- + * + * Create the context menu for the status icon. + * + * Results: + * Returns a pointer to the created menu. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +static GtkWidget * +GetMenu(void) +{ + GtkWidget *menu = gtk_menu_new(); + GtkWidget *menuItem = gtk_menu_item_new_with_label("Update Modules"); + g_signal_connect(G_OBJECT(menuItem), "activate", G_CALLBACK(MenuItemCallback), + NULL); + gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuItem); + + return menu; +} + + +/* + *---------------------------------------------------------------------------- + * + * Modules_Init -- + * + * Check for kernel modules and display a notification if any are + * found missing. + * + * Results: + * TRUE on success, FALSE otherwise + * + * Side effects: + * A notification is displayed, informing the user of the missing + * modules. + * + *---------------------------------------------------------------------------- + */ + +Bool +Modules_Init(void) +{ + if (!InstallerDB_Init("/etc/vmware-tools", TRUE)) { + return FALSE; + } + + /* + * Only do module out-of-dateness checking if we weren't installed as + * a DSP. + */ + if (InstallerDB_IsDSPInstall()) { + InstallerDB_DeInit(); + return FALSE; + } + + if (!ModConf_Init()) { + return FALSE; + } + + const char *libdir = InstallerDB_GetLibDir(); + char *moduleListPath = g_build_filename(libdir, "modules/modules.xml", NULL); + GList *modules = ModConf_GetModulesList(moduleListPath); + GList *modulesNotInstalled = ModConf_GetModulesNotInstalled(modules); + + if (modulesNotInstalled != NULL) { + Notify_Notify(30, "Kernel modules out-of-date", + "It appears your kernel modules are not longer " + "compatible with the running kernel. Please " + "click on the icon to recompile them.", + GetMenu(), ActivateCallback); + } + + g_list_free(modulesNotInstalled); + ModConf_FreeModulesList(modules); + + return TRUE; +} + + +/* + *---------------------------------------------------------------------------- + * + * Modules_Cleanup -- + * + * Cleanup the modconf subsystem. + * + * Results: + * TRUE on success, FALSE otherwise + * + * Side effects: + * The modconf subsystem is closed. + * + *---------------------------------------------------------------------------- + */ + +void +Modules_Cleanup(void) +{ + ModConf_DeInit(); + InstallerDB_DeInit(); +} + +#endif /* USE_NOTIFY_DLOPEN */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/vmware-user/notify.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/vmware-user/notify.c --- open-vm-tools-2008.01.23-74039/vmware-user/notify.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/vmware-user/notify.c 2008-10-13 08:01:54.000000000 +0100 @@ -0,0 +1,312 @@ +/********************************************************* + * Copyright (C) 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. + * + *********************************************************/ + +/* + * notify.c -- + * + * Handles the system tray notifications for vmware-user. + */ + +#include "vmware.h" +#include "vmwareuserInt.h" + +#ifdef USE_NOTIFY + +#include "conf.h" +#include "debug.h" +#include "str.h" + +#if defined(USE_NOTIFY_SO) +#include <libnotify/notify.h> +#include <libnotify/notification.h> +#include <libnotify/NotifyNotification.h> +#elif defined(USE_NOTIFY_DLOPEN) +#include <dlfcn.h> +#include <stdlib.h> +#endif + + +/* + * Local symbols + */ +const char *vmLibDir = NULL; + +#ifdef USE_NOTIFY_DLOPEN +static gboolean (*notify_init)(const char *app_name) = NULL; +static void (*notify_uninit)(void) = NULL; +static NotifyNotification *(*notify_notification_new_with_status_icon) + (const gchar *summary, const gchar *body, + const gchar *icon, GtkStatusIcon *status_icon) = NULL; +static gboolean (*notify_notification_show)(NotifyNotification *notification, + GError **error) = NULL; +void (*notify_notification_set_timeout)(NotifyNotification *notification, + gint timeout) = NULL; + +static Bool LoadLibNotify(void); +static Bool UnloadLibNotify(void); + +static void *libNotifyHandle = NULL; +static Bool initialized = FALSE; + + +/* + *---------------------------------------------------------------------------- + * + * LoadLibNotify -- + * + * Dynamically load required symbols from libnotify. We only do this + * when building inside the VMware tree; when shipping open-vm-tools, + * we can just let the linker do the work, since we have the libraries + * available at build-time. + * + * Results: + * TRUE on success, FALSE otherwise + * + * Side effects: + * libnotify is loaded, and symbols populated. + * + *---------------------------------------------------------------------------- + */ + +static Bool +LoadLibNotify(void) +{ + int i; + + libNotifyHandle = dlopen("libnotify.so.1", RTLD_LAZY); + + if (!libNotifyHandle) { + return FALSE; + } + + /* + * The list of symbols we want to dynamically load from libnotify. It + * must be NULL-terminated. To load additional symbols, be sure to + * define them above, with file-level scope, and then add them to this + * list. + */ + struct FuncEntry + { + void **funcPtr; + const char *symName; + } vtable[] = { + { (void **) ¬ify_init, "notify_init" }, + { (void **) ¬ify_uninit, "notify_uninit" }, + { (void **) ¬ify_notification_show, "notify_notification_show" }, + { (void **) ¬ify_notification_new_with_status_icon, + "notify_notification_new_with_status_icon" }, + { (void **) ¬ify_notification_set_timeout, + "notify_notification_set_timeout" }, + { NULL, NULL } + }; + + /* + * Load each of the above symbols from libnotify, checking to make sure + * that they exist. + */ + for (i = 0; vtable[i].funcPtr != NULL; i++) { + *(vtable[i].funcPtr) = dlsym(libNotifyHandle, vtable[i].symName); + if ( *(vtable[i].funcPtr) == NULL) { + Debug("Could not find %s in libnotify\n", vtable[i].symName); + UnloadLibNotify(); + return FALSE; + } + } + + return TRUE; +} + + +/* + *---------------------------------------------------------------------------- + * + * UnloadLibNotify -- + * + * Decrement the reference count for libnotify. We only do this when + * building inside the VMware tree; when shipping open-vm-tools, we can + * just let the linker do the work, since we have the libraries + * available at build-time. + * + * Results: + * TRUE on success, FALSE otherwise + * + * Side effects: + * libnotify is unloaded + * + *---------------------------------------------------------------------------- + */ + +static Bool +UnloadLibNotify(void) +{ + return dlclose(libNotifyHandle) == 0; +} +#endif /* USE_NOTIFY_DLOPEN */ + + +/* + *---------------------------------------------------------------------------- + * + * Notify_Init -- + * + * Initializes the notification system. + * + * Results: + * TRUE on success, FALSE otherwise + * + * Side effects: + * Notification system is initialized. + * + *---------------------------------------------------------------------------- + */ + +Bool +Notify_Init(GuestApp_Dict *confDict) // IN: Configuration dictionary +{ +#ifdef USE_NOTIFY_DLOPEN + if (LoadLibNotify() == FALSE) { + return FALSE; + } +#endif + + vmLibDir = GuestApp_GetDictEntry(confDict, CONFNAME_LIBDIR); + initialized = notify_init("vmware-user"); + + return initialized; +} + + +/* + *---------------------------------------------------------------------------- + * + * Notify_Cleanup -- + * + * Clean up the notification system. + * + * Results: + * None. + * + * Side effects: + * Notification system is deinitialized. + * + *---------------------------------------------------------------------------- + */ + +void +Notify_Cleanup(void) +{ + initialized = FALSE; + notify_uninit(); + +#ifdef USE_NOTIFY_DLOPEN + UnloadLibNotify(); +#endif +} + + +/* + *---------------------------------------------------------------------------- + * + * PopupCallback -- + * + * The callback invoked when the status icon is right-clicked. + * + * Results: + * TRUE if the signal is handled, FALSE otherwise. + * + * Side effects: + * Displays the popup menu for the icon. + * + *---------------------------------------------------------------------------- + */ + +static gboolean +PopupCallback(GtkStatusIcon *statusIcon, // IN + guint button, // IN + guint activateTime, // IN + Notifier *n) // IN +{ + gtk_menu_set_screen(GTK_MENU(n->menu), + gtk_status_icon_get_screen(n->statusIcon)); + gtk_menu_popup(GTK_MENU(n->menu), NULL, NULL, + gtk_status_icon_position_menu, n->statusIcon, button, + activateTime); + return TRUE; +} + + +/* + *---------------------------------------------------------------------------- + * + * Notify_Notify -- + * + * Create and display the notification icon with the given message. + * + * Results: + * TRUE if successful, FALSE otherwise. + * + * Side effects: + * Notification is displayed. + * + *---------------------------------------------------------------------------- + */ + +Bool +Notify_Notify(int secs, // IN: Number of seconds to display + const char *shortMsg, // IN: Short summary message + const char *longMsg, // IN: Longer detailed message + GtkWidget *menu, // IN: Context menu + gboolean (*activateCallback)(GtkWidget *, Notifier *)) + // IN: The left-click callback +{ + char *iconPath; + + if (!initialized) { + return FALSE; + } + + Notifier *n = g_new0(Notifier, 1); + iconPath = Str_Asprintf(NULL, "%s/share/icons/vmware.png", vmLibDir); + n->statusIcon = gtk_status_icon_new_from_file(iconPath); + gtk_status_icon_set_tooltip(n->statusIcon, shortMsg); + gtk_status_icon_set_visible(n->statusIcon, TRUE); + free(iconPath); + + /* + * Display the notification for secs seconds. + */ + n->notification = notify_notification_new_with_status_icon(shortMsg, longMsg, + NULL, n->statusIcon); + notify_notification_set_timeout(n->notification, secs * 1000); + notify_notification_show(n->notification, NULL); + + /* + * Connect the click and right-click signals. + */ + g_signal_connect(G_OBJECT(n->statusIcon), "activate", + G_CALLBACK(activateCallback), n); + g_signal_connect(G_OBJECT(n->statusIcon), "popup-menu", + G_CALLBACK(PopupCallback), n); + + n->menu = menu; + gtk_widget_show_all(n->menu); + + return TRUE; +} + +#endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/vmware-user/pointer.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/vmware-user/pointer.c --- open-vm-tools-2008.01.23-74039/vmware-user/pointer.c 2008-01-28 08:02:53.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/vmware-user/pointer.c 2008-10-13 08:01:54.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -163,6 +163,10 @@ * to ungrabbed, call PointerHasBeenUngrabbed, which will push our * clipboard thru the backdoor. While ungrabbed, don't do a thing. * + * This function is queued in Event Manager only when vmx doesn't support + * RPC copy/paste because newer vmx initiates copy/paste from UI through + * RPC, and doesn't need cursor grab/ungrab state to start copy/paste. + * * Results: * TRUE. * @@ -190,8 +194,8 @@ if (hostX != guestX || hostY != guestY) { GuestApp_SetPos(guestX,guestY); } - if (gHostClipboardTries-- > 0 ) { - if (gHostClipboardTries < 6 && + if (gHostClipboardTries-- > 0) { + if (gHostClipboardTries < 6 && CopyPaste_GetBackdoorSelections()) { gHostClipboardTries = 0; } @@ -205,8 +209,10 @@ } - EventManager_Add(gEventQueue, POINTER_POLL_TIME, PointerUpdatePointerLoop, - clientData); + if (!CopyPaste_IsRpcCPSupported()) { + EventManager_Add(gEventQueue, POINTER_POLL_TIME, PointerUpdatePointerLoop, + clientData); + } return TRUE; } diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/vmware-user/resolution.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/vmware-user/resolution.c --- open-vm-tools-2008.01.23-74039/vmware-user/resolution.c 2008-01-28 08:02:53.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/vmware-user/resolution.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,514 +0,0 @@ -/********************************************************* - * Copyright (C) 2005 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 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. - * - *********************************************************/ - -/* - * resolution.c -- - * - * Set of functions to handle guest screen resizing for the vmwareuser. - */ - -#include "vmwareuserInt.h" -#include <stdio.h> -#include <stdlib.h> -#include <string.h> - -#include "vm_assert.h" -#include "vm_app.h" -#include "debug.h" -#include "fileIO.h" -#include "str.h" -#include "strutil.h" - -#include "libvmwarectrl.h" - -#define VMWAREDRV_PATH_64 "/usr/X11R6/lib64/modules/drivers/vmware_drv.o" -#define VMWAREDRV_PATH "/usr/X11R6/lib/modules/drivers/vmware_drv.o" -#define VERSION_STRING "VMware Guest X Server" - -/*----------------------------------------------------------------------------- - * - * ResolutionCanSet -- - * - * Is the VMware SVGA driver a high enough version to support resolution - * changing? We check by searching the driver binary for a known version - * string. - * - * Results: - * TRUE if the driver version is high enough, FALSE otherwise. - * - * Side effects: - * None. - * - *----------------------------------------------------------------------------- - */ - -Bool -ResolutionCanSet(void) -{ - FileIODescriptor fd; - FileIOResult res; - int64 filePos = 0; - Bool keepSearching = TRUE; - Bool found = FALSE; - char buf[sizeof VERSION_STRING + 10]; // size of VERSION_STRING plus some extra for the version number - const char versionString[] = VERSION_STRING; - size_t bytesRead; - int32 major, minor, level; - unsigned int tokPos; - - /* See if the randr X module is loaded */ - if ( gXDisplay && !XRRQueryVersion(gXDisplay, &major, &minor) ) { - return FALSE; - } - - /* See if the VMWARE_CTRL extension is supported */ - gCanUseVMwareCtrl = - gXDisplay ? VMwareCtrl_QueryVersion(gXDisplay, &major, &minor) : FALSE; - - if (gCanUseVMwareCtrl) { - /* - * We need both a new enough VMWARE_CTRL and Xinerama for this to work. - */ -#ifndef NO_MULTIMON - gCanUseVMwareCtrlTopologySet = major >= 0 && minor >= 2 && - XineramaQueryVersion(gXDisplay, &major, &minor); -#endif - - return TRUE; - } else { - gCanUseVMwareCtrlTopologySet = FALSE; - } - - /* - * XXX: This check does not work with XOrg 6.9/7.0 for two reasons: Both - * versions now use .so for the driver extension and 7.0 moves the drivers - * to a completely different directory. As long as we ship a driver for - * 6.9/7.0, we can instead just use the VMWARE_CTRL check. - */ - buf[sizeof buf - 1] = '\0'; - FileIO_Invalidate(&fd); - res = FileIO_Open(&fd, VMWAREDRV_PATH_64, FILEIO_ACCESS_READ, FILEIO_OPEN); - if (res != FILEIO_SUCCESS) { - res = FileIO_Open(&fd, VMWAREDRV_PATH, FILEIO_ACCESS_READ, FILEIO_OPEN); - } - if (res == FILEIO_SUCCESS) { - /* - * One of the opens succeeded, so start searching thru the file. - */ - while (keepSearching) { - res = FileIO_Read(&fd, buf, sizeof buf - 1, &bytesRead); - if (res != FILEIO_SUCCESS || bytesRead < sizeof buf -1 ) { - keepSearching = FALSE; - } else { - if (Str_Strncmp(versionString, buf, sizeof versionString - 1) == 0) { - keepSearching = FALSE; - found = TRUE; - } - } - filePos = FileIO_Seek(&fd, filePos+1, FILEIO_SEEK_BEGIN); - if (filePos == -1) { - keepSearching = FALSE; - } - } - FileIO_Close(&fd); - if (found) { - /* - * We NUL-terminated buf earlier, but Coverity really wants it to - * be NUL-terminated after the call to FileIO_Read (because - * FileIO_Read doesn't NUL-terminate). So we'll do it again. - */ - buf[sizeof buf - 1] = '\0'; - - /* - * Try and parse the major, minor and level versions - */ - tokPos = sizeof versionString - 1; - if (!StrUtil_GetNextIntToken(&major, &tokPos, buf, ".- ")) { - return FALSE; - } - if (!StrUtil_GetNextIntToken(&minor, &tokPos, buf, ".- ")) { - return FALSE; - } - if (!StrUtil_GetNextIntToken(&level, &tokPos, buf, ".- ")) { - return FALSE; - } - - return ((major > 10) || (major == 10 && minor >= 11)); - } - } - return FALSE; -} - - -/*----------------------------------------------------------------------------- - * - * ResolutionSet -- - * - * Given a width and height, find the biggest resolution that will "fit". - * This is called as a result of the resolution set request from the vmx. - * - * Results: - * TRUE if we are able to set to the exact size requested, FALSE otherwise. - * - * Side effects: - * The screen resolution of will change. - * - *----------------------------------------------------------------------------- - */ - -Bool -ResolutionSet(uint32 width, // IN - uint32 height) // IN -{ - XRRScreenConfiguration* xrrConfig; - XRRScreenSize *xrrSizes; - Rotation xrrCurRotation; - uint32 xrrNumSizes; - uint32 i; - uint32 bestFitIndex = 0; - uint64 bestFitSize = 0; - uint64 potentialSize; - - xrrConfig = XRRGetScreenInfo(gXDisplay, gXRoot); - xrrSizes = XRRConfigSizes(xrrConfig, &xrrNumSizes); - XRRConfigCurrentConfiguration(xrrConfig, &xrrCurRotation); - - /* - * Iterate thru the list finding the best fit that is still <= in both width - * and height. - */ - for (i = 0; i < xrrNumSizes; i++) { - potentialSize = xrrSizes[i].width * xrrSizes[i].height; - if (xrrSizes[i].width <= width && xrrSizes[i].height <= height && - potentialSize > bestFitSize ) { - bestFitSize = potentialSize; - bestFitIndex = i; - } - } - - if (bestFitSize > 0) { - Debug("Setting guest resolution to: %dx%d (requested: %d, %d)\n", - xrrSizes[bestFitIndex].width, xrrSizes[bestFitIndex].height, width, height); - XRRSetScreenConfig(gXDisplay, xrrConfig, gXRoot, bestFitIndex, xrrCurRotation, - GDK_CURRENT_TIME); - } else { - Debug("Can't find a suitable guest resolution, ignoring request for %dx%d\n", - width, height); - } - - XRRFreeScreenConfigInfo(xrrConfig); - return xrrSizes[bestFitIndex].width == width && - xrrSizes[bestFitIndex].height == height; -} - - -/* - *----------------------------------------------------------------------------- - * - * ResolutionRpcInSetCB -- - * - * Handler for TCLO 'Resolution_Set'. - * - * Results: - * TRUE if we can reply, FALSE otherwise. - * - * Side effects: - * None. - * - *----------------------------------------------------------------------------- - */ - -Bool -ResolutionRpcInSetCB(char const **result, // OUT - size_t *resultLen, // OUT - const char *name, // IN - const char *args, // IN - size_t argsSize, // unused - void *clientData) // unused - -{ - uint32 width = 0 ; - uint32 height = 0; - unsigned int index = 0; - - /* parse the width and height */ - if (!StrUtil_GetNextUintToken(&width, &index, args, " ")) { - goto invalid_arguments; - } - if (!StrUtil_GetNextUintToken(&height, &index, args, "")) { - goto invalid_arguments; - } - - if (gCanUseVMwareCtrl) { - /* - * If so, set the current res with it. This means we'll get an exact - * match when we search in ResolutionSet. (Unless the res is too large). - * - * As such, we don't care if this succeeds or fails, we'll make a best - * effort attempt to change resolution anyway. - */ - VMwareCtrl_SetRes(gXDisplay, DefaultScreen(gXDisplay), width, height); - } - - return RpcIn_SetRetVals(result, resultLen, "", ResolutionSet(width, height)); - -invalid_arguments: - return RpcIn_SetRetVals(result, resultLen, "Invalid arguments", FALSE); -} - - -/* - *----------------------------------------------------------------------------- - * - * TopologyRpcInSetCB -- - * - * Handler for TCLO 'DisplayTopology_Set'. - * - * Solaris 10 uses a different Xinerama standard than expected here. As a - * result, topology set is not supported and this function is excluded from - * Solaris builds. - * - * Results: - * TRUE if we can reply, FALSE otherwise. - * - * Side effects: - * None. - * - *----------------------------------------------------------------------------- - */ - -#ifndef NO_MULTIMON -Bool -TopologyRpcInSetCB(char const **result, // OUT - size_t *resultLen, // OUT - const char *name, // IN - const char *args, // IN - size_t argsSize, // unused - void *clientData) // unused - -{ - Bool success = FALSE; - uint32 count, i; - xXineramaScreenInfo *displays = NULL; - short maxX = 0; - short maxY = 0; - - /* - * The argument string will look something like: - * <count> [ , <x> <y> <w> <h> ] * count. - * - * e.g. - * 3 , 0 0 640 480 , 640 0 800 600 , 0 480 640 480 - */ - - if (sscanf(args, "%u", &count) != 1) { - return RpcIn_SetRetVals(result, resultLen, - "Invalid arguments. Expected \"count\"", - FALSE); - } - displays = (xXineramaScreenInfo *)malloc(sizeof *displays * count); - if (!displays) { - RpcIn_SetRetVals(result, resultLen, - "Failed to alloc buffer for display info", - FALSE); - goto out; - } - for (i = 0; i < count; i++) { - args = strchr(args, ','); - if (!args) { - RpcIn_SetRetVals(result, resultLen, - "Expected comma separated display list", - FALSE); - goto out; - } - args++; /* Skip past the , */ - - if (sscanf(args, " %hd %hd %hd %hd ", &displays[i].x_org, - &displays[i].y_org, &displays[i].width, &displays[i].height) != 4) { - RpcIn_SetRetVals(result, resultLen, - "Expected x, y, w, h in display entry", - FALSE); - goto out; - } - maxX = MAX(maxX, displays[i].x_org + displays[i].width); - maxY = MAX(maxY, displays[i].y_org + displays[i].height); - } - - if (!VMwareCtrl_SetTopology(gXDisplay, DefaultScreen(gXDisplay), displays, count)) { - RpcIn_SetRetVals(result, resultLen, "Failed to set topology in the driver.", - FALSE); - goto out; - } - - if (!ResolutionSet(maxX, maxY)) { - RpcIn_SetRetVals(result, resultLen, "Failed to set new resolution.", - FALSE); - goto out; - } - - RpcIn_SetRetVals(result, resultLen, "", TRUE); - success = TRUE; - -out: - free(displays); - return success; -} -#endif - - -/* - *----------------------------------------------------------------------------- - * - * Resolution_RegisterCapability -- - * - * Register the "Resolution_Set" capability. Sometimes this needs to - * be done separately from the TCLO callback registration, so we - * provide it separately here. - * - * Results: - * TRUE on success - * FALSE on failure - * - * Side effects: - * None - * - *----------------------------------------------------------------------------- - */ - -Bool -Resolution_RegisterCapability(void) -{ - if (!RpcOut_sendOne(NULL, NULL, "tools.capability.resolution_set 1")) { - Debug("%s: Unable to register resolution set capability\n", - __FUNCTION__); - return FALSE; - } - if (!RpcOut_sendOne(NULL, NULL, "tools.capability.resolution_server %s 1", - TOOLS_DND_NAME)) { - Debug("%s: Unable to register resolution server capability\n", - __FUNCTION__); - - /* - * Note that we do not return false so that we stay backwards - * compatible with old vmx code (Workstation 6/ESX 3.5) that doesn't - * handle resolution_server. - */ - } -#ifndef NO_MULTIMON - if (gCanUseVMwareCtrlTopologySet && - !RpcOut_sendOne(NULL, NULL, "tools.capability.display_topology_set 1")) { - Debug("%s: Unable to register topology set capability\n", - __FUNCTION__); - return FALSE; - } -#endif - return TRUE; -} - - -/*----------------------------------------------------------------------------- - * - * Resolution_Register -- - * - * Register the capability and resolution setting callbacks. - * - * Results: - * TRUE on success, FALSE otherwise. - * - * Side effects: - * None. - * - *----------------------------------------------------------------------------- - */ - -Bool -Resolution_Register(void) -{ - if (!gRpcIn) { - return FALSE; - } - if (!ResolutionCanSet()) { - return FALSE; - } - - RpcIn_RegisterCallback(gRpcIn, "Resolution_Set", ResolutionRpcInSetCB, NULL); -#ifndef NO_MULTIMON - if (gCanUseVMwareCtrlTopologySet) { - RpcIn_RegisterCallback(gRpcIn, "DisplayTopology_Set", TopologyRpcInSetCB, NULL); - } -#endif - if (!Resolution_RegisterCapability()) { - return FALSE; - } - - return TRUE; -} - - -/* - *----------------------------------------------------------------------------- - * - * Resolution_Unregister -- - * - * Unregister the "Resolution_Set" capability. - * - * Results: - * TRUE on success - * FALSE on failure - * - * Side effects: - * None - * - *----------------------------------------------------------------------------- - */ - -Bool -Resolution_Unregister(void) -{ - /* - * RpcIn doesn't have an unregister facility, so all we need to do - * here is unregister the capability. - */ - - if (!RpcOut_sendOne(NULL, NULL, "tools.capability.resolution_set 0")) { - Debug("%s: Unable to unregister ResolutionSet capability\n", - __FUNCTION__); - return FALSE; - } - if (!RpcOut_sendOne(NULL, NULL, "tools.capability.resolution_server %s 0", - TOOLS_DND_NAME)) { - Debug("%s: Unable to unregister resolution server capability\n", - __FUNCTION__); - - /* - * Don't return false here so that an older vmx (Workstation 6/ESX 3.5) - * that that supports resolution_set and not resolution_server will - * still work. - */ - } -#ifndef NO_MULTIMON - if (gCanUseVMwareCtrlTopologySet && - !RpcOut_sendOne(NULL, NULL, "tools.capability.display_topology_set 0")) { - Debug("%s: Unable to unregister TopologySet capability\n", - __FUNCTION__); - return FALSE; - } -#endif - - return TRUE; -} diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/vmware-user/stub.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/vmware-user/stub.c --- open-vm-tools-2008.01.23-74039/vmware-user/stub.c 2008-01-28 08:02:53.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/vmware-user/stub.c 1970-01-01 01:00:00.000000000 +0100 @@ -1,268 +0,0 @@ -/********************************************************* - * Copyright (C) 1998 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 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. - * - *********************************************************/ - -/* - * stub.c -- - * - * Stub for unuseful functions. Stolen from one of the other - * 13 stub.c files in bora. This is necessary because the - * toolbox uses FileIO_* API, which in turn uses these suckers - * below. - * --Ganesh. - * - */ - -#ifndef VMX86_DEVEL - -#endif - - -#include <stdlib.h> -#include <stdio.h> -#include <sys/types.h> -#include <stdarg.h> -#include <string.h> - -#ifdef _MSC_VER -# include <io.h> -# include <windows.h> -#endif - - -#include "vm_version.h" -#include "vm_assert.h" -#include "vmware.h" -#include "str.h" -#include "debug.h" - -#ifdef _WIN32 -#include "poll.h" -#endif - -#if defined(N_PLAT_NLM) -char * -File_GetTmpDir(Bool useConf) -{ - return NULL; -} -#endif - - -/* - *---------------------------------------------------------------------- - * - * StubVprintf -- - * - * Output error text. - * - * Results: - * - * None. - * - * Side effects: - * - * None. - * - *---------------------------------------------------------------------- - */ - -void -StubVprintf(const char *prefix, - const char *fmt, - va_list args) -{ - char *str; - - /* Doesn't work yet. [greg] */ - - str = Str_Vasprintf(NULL, fmt, args); - -#if defined(_WIN32) - Debug("%s: %s", prefix, str); - printf("%s: %s", prefix, str); - // how do we print to stderr? fprintf(stderr,...) doesn't work -#else - fprintf(stderr, "%s: %s", prefix, str); - fflush(stderr); -#endif - - free(str); -} - -#ifdef N_PLAT_NLM -void -Panic(const char *fmt, ...) -{ - va_list args; - - va_start(args, fmt); - StubVprintf("PANIC", fmt, args); - va_end(args); - - exit(255); - NOT_REACHED(); -} -#endif - -void -Panic_PostPanicMsg(const char *format, - ...) -{} - -void -Log_DisableThrottling(void) -{} - -void -Log_SetAlwaysKeep(Bool unused) -{} - - -Bool -Config_GetBool(Bool defaultValue, - const char *fmt, - ...) -{ - return defaultValue; -} - - -int32 -Config_GetLong(int32 defaultValue, - const char *fmt, - ...) -{ - return defaultValue; -} - - -void -Log(const char *fmt, - ...) -{ - va_list args; - - va_start(args, fmt); - StubVprintf("Log", fmt, args); - va_end(args); -} - -void -Warning(const char *fmt, - ...) -{ - va_list args; - - va_start(args, fmt); - StubVprintf("Warning", fmt, args); - va_end(args); -} - - -void -Msg_Append(const char *idFmt, - ...) -{ - char *str; - - va_list args; - va_start(args, idFmt); - str = Str_Vasprintf(NULL, idFmt, args); - va_end(args); - - Warning("Msg_Append: %s\n", str); - free(str); -} - -unsigned int -Msg_Question(void *buttons, - int defaultAnswer, - char const *fmt, - ...) -{ - char *str; - - va_list args; - va_start(args, fmt); - str = Str_Vasprintf(NULL, fmt, args); - va_end(args); - - Warning("Msg_Question: %s\n", str); - free(str); - - return 0; -} - -typedef int MsgSeverity; - -void -Msg_Post(MsgSeverity severity, - const char *idFmt, - ...) -{ - char *str; - - va_list args; - va_start(args, idFmt); - str = Str_Vasprintf(NULL, idFmt, args); - va_end(args); - - Warning("Msg_Post: %s\n", str); - free(str); -} - - -#ifdef _WIN32 -Bool -Preference_GetBool(Bool defaultValue, - const char *name) -{ - return defaultValue; -} -#endif - -char * -Preference_GetString(char *defaultValue, - const char *name) -{ - return defaultValue; -} - -#ifdef _WIN32 -VMwareStatus -Poll_CB_RTime(PollerFunction f, // IN - void *clientData, // IN - int info, // IN - Bool periodic, // IN - struct DeviceLock *lock) // IN -{ - //NOT_IMPLEMENTED(); - return VMWARE_STATUS_SUCCESS; -} - - -Bool -Poll_CB_RTimeRemove(PollerFunction f, // IN - void *clientData, // IN - Bool periodic) // IN -{ - //NOT_IMPLEMENTED(); - return TRUE; -} -#endif - diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/vmware-user/vmwarectrl.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/vmware-user/vmwarectrl.h --- open-vm-tools-2008.01.23-74039/vmware-user/vmwarectrl.h 2008-01-28 08:02:53.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/vmware-user/vmwarectrl.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,48 +0,0 @@ -/* - * Copyright 2006 by VMware, Inc. - * - * 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name of the copyright holder(s) - * and author(s) shall not be used in advertising or otherwise to promote - * the sale, use or other dealings in this Software without prior written - * authorization from the copyright holder(s) and author(s). - */ - -/* - * vmwarectrl.h -- - * - * The definitions used by the VMWARE_CTRL protocol extension that - * allows X clients to communicate with the driver. - */ - - -#ifndef _VMWARE_CTRL_H_ -#define _VMWARE_CTRL_H_ - -#define VMWARE_CTRL_PROTOCOL_NAME "VMWARE_CTRL" - -#define VMWARE_CTRL_MAJOR_VERSION 0 -#define VMWARE_CTRL_MINOR_VERSION 2 - -#define X_VMwareCtrlQueryVersion 0 -#define X_VMwareCtrlSetRes 1 -#define X_VMwareCtrlSetTopology 2 - -#endif /* _VMWARE_CTRL_H_ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/vmware-user/vmwarectrlproto.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/vmware-user/vmwarectrlproto.h --- open-vm-tools-2008.01.23-74039/vmware-user/vmwarectrlproto.h 2008-01-28 08:02:53.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/vmware-user/vmwarectrlproto.h 1970-01-01 01:00:00.000000000 +0100 @@ -1,122 +0,0 @@ -/* - * Copyright 2006 by VMware, Inc. - * - * 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 COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR - * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR - * OTHER DEALINGS IN THE SOFTWARE. - * - * Except as contained in this notice, the name of the copyright holder(s) - * and author(s) shall not be used in advertising or otherwise to promote - * the sale, use or other dealings in this Software without prior written - * authorization from the copyright holder(s) and author(s). - */ - -/* - * vmwarectrlproto.h -- - * - * The description of the VMWARE_CTRL protocol extension that - * allows X clients to communicate with the driver. - */ - -#ifndef _VMWARE_CTRL_PROTO_H_ -#define _VMWARE_CTRL_PROTO_H_ - - -#include <X11/X.h> -#include "vmwarectrl.h" - - -/* - * Requests and Replies - */ - -/* Version 0.1 definitions. */ - -typedef struct { - CARD8 reqType; /* always X_VMwareCtrlReqCode */ - CARD8 VMwareCtrlReqType; /* always X_VMwareCtrlQueryVersion */ - CARD16 length B16; - CARD32 majorVersion B32; - CARD32 minorVersion B32; -} xVMwareCtrlQueryVersionReq; -#define sz_xVMwareCtrlQueryVersionReq 12 - -typedef struct { - BYTE type; /* X_Reply */ - BYTE pad1; - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD32 majorVersion B32; - CARD32 minorVersion B32; - CARD32 pad2 B32; - CARD32 pad3 B32; - CARD32 pad4 B32; - CARD32 pad5 B32; -} xVMwareCtrlQueryVersionReply; -#define sz_xVMwareCtrlQueryVersionReply 32 - -typedef struct { - CARD8 reqType; /* always X_VMwareCtrlReqCode */ - CARD8 VMwareCtrlReqType; /* always X_VMwareCtrlSetRes */ - CARD16 length B16; - CARD32 screen B32; - CARD32 x B32; - CARD32 y B32; -} xVMwareCtrlSetResReq; -#define sz_xVMwareCtrlSetResReq 16 - -typedef struct { - BYTE type; /* X_Reply */ - BYTE pad1; - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD32 screen B32; - CARD32 x B32; - CARD32 y B32; - CARD32 pad2 B32; - CARD32 pad3 B32; - CARD32 pad4 B32; -} xVMwareCtrlSetResReply; -#define sz_xVMwareCtrlSetResReply 32 - -/* Version 0.2 definitions. */ - -typedef struct { - CARD8 reqType; /* always X_VMwareCtrlReqCode */ - CARD8 VMwareCtrlReqType; /* always X_VMwareCtrlSetTopology */ - CARD16 length B16; - CARD32 screen B32; - CARD32 number B32; - CARD32 pad1 B32; -} xVMwareCtrlSetTopologyReq; -#define sz_xVMwareCtrlSetTopologyReq 16 - -typedef struct { - BYTE type; /* X_Reply */ - BYTE pad1; - CARD16 sequenceNumber B16; - CARD32 length B32; - CARD32 screen B32; - CARD32 pad2 B32; - CARD32 pad3 B32; - CARD32 pad4 B32; - CARD32 pad5 B32; - CARD32 pad6 B32; -} xVMwareCtrlSetTopologyReply; -#define sz_xVMwareCtrlSetTopologyReply 32 - -#endif /* _VMWARE_CTRL_PROTO_H_ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/vmware-user/vmware-user.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/vmware-user/vmware-user.c --- open-vm-tools-2008.01.23-74039/vmware-user/vmware-user.c 2008-01-28 08:02:53.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/vmware-user/vmware-user.c 2008-10-13 08:01:54.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -25,9 +25,11 @@ * user. */ - +#include <errno.h> +#include <fcntl.h> #include <string.h> #include <stdlib.h> +#include <pwd.h> #include <unistd.h> #include <gtk/gtkinvisible.h> #include <locale.h> @@ -51,6 +53,9 @@ #include "syncDriver.h" #include "str.h" #include "guestApp.h" // for ALLOW_TOOLS_IN_FOREIGN_VM +#include "unity.h" +#include "ghIntegration.h" +#include "resolution.h" #include "vm_atomic.h" #include "hostinfo.h" @@ -65,6 +70,9 @@ static char THIS_FILE[] = __FILE__; #endif +#define VMUSER_TITLE "vmware-user" +#define LOCK_ATOM_NAME "vmware-user-lock" + #define INVALID_VALUE "Invalid option" #define INVALID_OPTION "Invalid value" #define INVALID_COMMAND "Invalid command format" @@ -74,12 +82,10 @@ * Forward Declarations */ void VMwareUser_OnDestroy(GtkWidget *widget, gpointer data); -GtkWidget* VMwareUser_Create(void); +GtkWidget* VMwareUser_CreateWindow(void); gint EventQueuePump(gpointer data); -Bool VMwareUserRpcInResetCB (char const **result, size_t *resultLen, - const char *name, const char *args, - size_t argsSize, void *clientData); +Bool VMwareUserRpcInResetCB (RpcInData *data); Bool VMwareUserRpcInSetOptionCB(char const **result, size_t *resultLen, const char *name, const char *args, size_t argsSize, void *clientData); @@ -88,14 +94,21 @@ size_t argsSize, void *clientData); void VMwareUserRpcInErrorCB (void *clientdata, char const *status); -extern Bool ForeignTools_Initialize(GuestApp_Dict *configDictionaryParam); +extern Bool ForeignTools_Initialize(GuestApp_Dict *configDictionaryParam, + DblLnkLst_Links *eventQueue); extern void ForeignTools_Shutdown(void); +static Bool InitGroupLeader(Window *groupLeader, Window *rootWindow); +static Bool AcquireDisplayLock(void); +static Bool QueryX11Lock(Display *dpy, Window w, Atom lockAtom); +static void ReloadSelf(void); + + /* * Globals */ + static Bool gOpenUrlRegistered; -static Bool gResolutionSetRegistered; static Bool gDnDRegistered; static Bool gCopyPasteRegistered; static Bool gHgfsServerRegistered; @@ -103,11 +116,23 @@ static char gLogFilePath[PATH_MAX]; /* + * The following are flags set by our signal handler. They are evaluated + * in main() only if gtk_main() ever returns. + */ +static Bool gReloadSelf; // Set by SIGUSR2; triggers reload. +static Bool gYieldBlock; // Set by SIGUSR1; triggers DND shutdown +static Bool gSigExit; // Set by all but SIGUSR1; triggers app shutdown + +/* * From vmwareuserInt.h */ RpcIn *gRpcIn; Display *gXDisplay; GtkWidget *gUserMainWidget; + +GtkWidget *gHGWnd; +GtkWidget *gGHWnd; + Window gXRoot; DblLnkLst_Links *gEventQueue; Bool optionCopyPaste; @@ -127,8 +152,9 @@ SIGINT, SIGQUIT, SIGTERM, - SIGUSR1, - SIGUSR2, + SIGUSR1, // yield vmblock, uninit DnD + SIGUSR2, // reload vmware-user + SIGPIPE }; @@ -151,6 +177,11 @@ void VMwareUserCleanupRpc(void) { if (gRpcIn) { + Unity_UnregisterCaps(); + GHI_Cleanup(); + Unity_Cleanup(); + Resolution_Cleanup(); + if (gHgfsServerRegistered) { HgfsServerManager_Unregister(gRpcIn, TOOLS_DND_NAME); gHgfsServerRegistered = FALSE; @@ -163,12 +194,8 @@ FoundryToolsDaemon_UnregisterOpenUrl(); gOpenUrlRegistered = FALSE; } - if (gResolutionSetRegistered) { - Resolution_Unregister(); - gResolutionSetRegistered = FALSE; - } if (gDnDRegistered) { - DnD_Unregister(gUserMainWidget); + DnD_Unregister(gHGWnd, gGHWnd); gDnDRegistered = FALSE; } if (gCopyPasteRegistered) { @@ -192,14 +219,31 @@ * None. * * Side effects: - * The application will close. + * Application will break out of the gtk_main() loop. One or more of the + * signal flags (gReloadSelf, gYieldBlock, gSigExit) may be set. For all + * signals but SIGUSR1, VMwareUserCleanupRpc() will be called. * *----------------------------------------------------------------------------- */ void VMwareUserSignalHandler(int sig) // IN { - VMwareUserCleanupRpc(); + switch (sig) { + case SIGUSR1: + gYieldBlock = TRUE; + break; + case SIGUSR2: + gReloadSelf = TRUE; + gSigExit = TRUE; + break; + default: + gSigExit = TRUE; + } + + if (gSigExit) { + VMwareUserCleanupRpc(); + } + gtk_main_quit(); } @@ -269,13 +313,12 @@ /* *----------------------------------------------------------------------------- * - * VMwareUser_Create -- + * VMwareUser_CreateWindow -- * - * Create and init the main window. It's hidden, but we need it to recieve - * X-Windows messages + * Create and initializes a hidden input only window for dnd and cp. * * Results: - * The main window widget. + * An invisible gtk widget. * * Side effects: * None. @@ -284,7 +327,7 @@ */ GtkWidget* -VMwareUser_Create(void) +VMwareUser_CreateWindow(void) { GtkWidget *wnd; @@ -312,19 +355,16 @@ */ Bool -VMwareUserRpcInResetCB(char const **result, // OUT - size_t *resultLen, // OUT - const char *name, // IN - const char *args, // IN - size_t argsSize, // Unused - void *clientData) // Unused +VMwareUserRpcInResetCB(RpcInData *data) // IN/OUT { Debug("----------toolbox: Received 'reset' from vmware\n"); if (gDnDRegistered) { - DnD_OnReset(gUserMainWidget); + DnD_OnReset(gHGWnd, gGHWnd); } - return RpcIn_SetRetVals(result, resultLen, "ATR " TOOLS_DND_NAME, - TRUE); + if (gCopyPasteRegistered) { + CopyPaste_OnReset(); + } + return RPCIN_SETRETVALS(data, "ATR " TOOLS_DND_NAME, TRUE); } @@ -384,16 +424,17 @@ } else { FoundryToolsDaemon_RegisterOpenUrlCapability(); } - if (!gResolutionSetRegistered) { - gResolutionSetRegistered = Resolution_Register(); - } else { - Resolution_RegisterCapability(); - } if (!gDnDRegistered) { - gDnDRegistered = DnD_Register(gUserMainWidget); + gDnDRegistered = DnD_Register(gHGWnd, gGHWnd); + if (gDnDRegistered) { + UnityDnD state; + state.detWnd = gGHWnd; + state.setMode = DnD_SetMode; + Unity_SetActiveDnDDetWnd(&state); + } } else if (DnD_GetVmxDnDVersion() > 1) { if (!DnD_RegisterCapability()) { - DnD_Unregister(gUserMainWidget); + DnD_Unregister(gHGWnd, gGHWnd); gDnDRegistered = FALSE; } } @@ -401,7 +442,7 @@ if (!gCopyPasteRegistered) { gCopyPasteRegistered = CopyPaste_Register(gUserMainWidget); } - + if (gCopyPasteRegistered) { if (!CopyPaste_RegisterCapability()) { CopyPaste_Unregister(gUserMainWidget); @@ -413,6 +454,9 @@ Debug("VMwareUserRpcInCapRegCB: Failed to register HGFS server capability.\n"); } + Unity_RegisterCaps(); + Resolution_RegisterCaps(); + return RpcIn_SetRetVals(result, resultLen, "", TRUE); } @@ -494,13 +538,13 @@ if (strcmp(value, "1") == 0) { optionDnD = TRUE; if (!gDnDRegistered) { - DnD_Register(gUserMainWidget); + DnD_Register(gHGWnd, gGHWnd); gDnDRegistered = TRUE; } } else if (strcmp(value, "0") == 0) { optionDnD = FALSE; if (gDnDRegistered) { - DnD_Unregister(gUserMainWidget); + DnD_Unregister(gHGWnd, gGHWnd); gDnDRegistered = FALSE; } } else { @@ -526,21 +570,23 @@ /* *----------------------------------------------------------------------------- * - * VMwareUserXErrorHandler -- + * VMwareUserXIOErrorHandler -- * - * Handler for all X I/O errors. Xlib documentation says we should not return - * when handling I/O errors. + * Handler for all X I/O errors. Xlib documentation says we should not + * return when handling I/O errors. * * Results: - * 1, but really we don't ever return. + * On success, and assuming we're called inside the parent vmware-user + * process (see comment below), we attempt to restart ourselves. On + * failure, we'll exit with EXIT_FAILURE. * * Side effects: - * Exits the application. + * This function does not return. * *----------------------------------------------------------------------------- */ -int VMwareUserXErrorHandler(Display *dpy) +int VMwareUserXIOErrorHandler(Display *dpy) { pid_t my_pid = getpid(); @@ -549,13 +595,16 @@ * watching the process being run. When it dies, it will come * through here, so we don't want to let it shut down the Rpc */ - Debug("> VMwareUserXErrorHandler\n"); + Debug("> VMwareUserXIOErrorHandler\n"); if (my_pid == gParentPid) { VMwareUserCleanupRpc(); + ReloadSelf(); + exit(EXIT_FAILURE); } else { - Debug("VMwareUserXErrorHandler hit from forked() child, not cleaning Rpc\n"); + Debug("VMwareUserXIOErrorHandler hit from forked() child, not cleaning Rpc\n"); + _exit(EXIT_FAILURE); } - exit(1); + return 1; } @@ -641,7 +690,7 @@ * This is main * * Results: - * 0 on success, -1 otherwise + * Returns either EXIT_SUCCESS or EXIT_FAILURE appropriately. * * Side effects: * The linux toolbox ui will run and do a variety of tricks for your @@ -653,28 +702,51 @@ main(int argc, char *argv[]) { gOpenUrlRegistered = FALSE; - gResolutionSetRegistered = FALSE; gDnDRegistered = FALSE; gCopyPasteRegistered = FALSE; gHgfsServerRegistered = FALSE; gBlockFd = -1; + gReloadSelf = FALSE; + gYieldBlock = FALSE; + gSigExit = FALSE; struct sigaction olds[ARRAYSIZE(gSignals)]; int index; - GuestApp_Dict *confDict = Conf_Load(); + GuestApp_Dict *confDict; const char *pathName; +#ifdef USE_NOTIFY + Bool notifyPresent = TRUE; +#endif Atomic_Init(); if (!VmCheck_IsVirtualWorld()) { #ifndef ALLOW_TOOLS_IN_FOREIGN_VM - Panic("vmware-user must be run inside a virtual machine.\n"); + Warning("vmware-user must be run inside a virtual machine.\n"); + return EXIT_SUCCESS; #else runningInForeignVM = TRUE; #endif } + confDict = Conf_Load(); + /* Set to system locale. */ setlocale(LC_CTYPE, ""); + gtk_set_locale(); + gtk_init(&argc, &argv); + + /* + * Running more than 1 VMware user process (vmware-user) per X11 session + * invites bad juju. The following routine ensures that only one instance + * will run per session. + * + * NB: The lock is tied to this process, so it disappears when we exit. + * As such, there is no corresponding unlock routine. + */ + if (AcquireDisplayLock() == FALSE) { + Warning("Another instance of vmware-user already running. Exiting.\n"); + return EXIT_FAILURE; + } gParentPid = getpid(); @@ -756,14 +828,15 @@ } } - gtk_set_locale(); - gtk_init(&argc, &argv); - - gUserMainWidget = VMwareUser_Create(); + gUserMainWidget = VMwareUser_CreateWindow(); + gHGWnd = VMwareUser_CreateWindow(); + gGHWnd = VMwareUser_CreateWindow(); /* * I don't want to show the window, but I need it's X window to exist. */ gtk_widget_realize(gUserMainWidget); + gtk_widget_realize(gHGWnd); + gtk_widget_realize(gGHWnd); gXDisplay = GDK_WINDOW_XDISPLAY(gUserMainWidget->window); @@ -772,29 +845,42 @@ gEventQueue = EventManager_Init(); if (gEventQueue == NULL) { Warning("Unable to create the event queue.\n\n"); - return -1; + return EXIT_FAILURE; } if (runningInForeignVM) { - Bool success = ForeignTools_Initialize(confDict); + Bool success = ForeignTools_Initialize(confDict, gEventQueue); if (!success) { - return -1; + return EXIT_FAILURE; } } EventManager_Add(gEventQueue, CONF_POLL_TIME, VMwareUserConfFileLoop, &confDict); + Unity_Init(confDict, NULL); + GHI_Init(NULL, NULL); + Resolution_Init(TOOLS_DND_NAME, gXDisplay); + +#ifdef USE_NOTIFY + if (!Notify_Init(confDict)) { + Warning("Unable to initialize notification system.\n\n"); + notifyPresent = FALSE; + } + + Modules_Init(); +#endif + gRpcIn = RpcIn_Construct(gEventQueue); if (gRpcIn == NULL) { Warning("Unable to create the RpcIn object.\n\n"); - return -1; + return EXIT_FAILURE; } if (!RpcIn_start(gRpcIn, RPCIN_POLL_TIME, VMwareUserRpcInResetCB, NULL, VMwareUserRpcInErrorCB, NULL)) { Warning("Unable to start the receive loop.\n\n"); - return -1; + return EXIT_FAILURE; } RpcIn_RegisterCallback(gRpcIn, "Capabilities_Register", @@ -802,11 +888,15 @@ RpcIn_RegisterCallback(gRpcIn, "Set_Option", VMwareUserRpcInSetOptionCB, NULL); + Unity_InitBackdoor(gRpcIn); + GHI_InitBackdoor(gRpcIn); + Resolution_InitBackdoor(gRpcIn); + #if !defined(N_PLAT_NLM) && !defined(sun) { - FoundryToolsDaemon_RegisterRoutines(gRpcIn, - &confDict, - gEventQueue, + FoundryToolsDaemon_RegisterRoutines(gRpcIn, + &confDict, + gEventQueue, FALSE); } #endif @@ -819,14 +909,38 @@ */ gTimeoutId = gtk_timeout_add(0, &EventQueuePump, NULL); - XSetIOErrorHandler(VMwareUserXErrorHandler); + XSetIOErrorHandler(VMwareUserXIOErrorHandler); Pointer_Register(gUserMainWidget); - /* - * We'll block here until the window is destroyed or a signal is recieved - */ - gtk_main(); + for (;;) { + /* + * We'll block here until the window is destroyed or a signal is recieved + */ + gtk_main(); + + if (gSigExit) { + break; + } + + /* XXX Refactor this. */ + if (gYieldBlock) { + Debug("Yielding vmblock descriptor.\n"); + if (gDnDRegistered) { + DnD_Unregister(gHGWnd, gGHWnd); + gDnDRegistered = FALSE; + } + if (gCopyPasteRegistered) { + CopyPaste_Unregister(gUserMainWidget); + gCopyPasteRegistered = FALSE; + } + if (gBlockFd >= 0 && !DnD_UninitializeBlocking(gBlockFd)) { + Debug("vmware-user failed to uninitialize blocking.\n"); + } + gBlockFd = -1; + gYieldBlock = FALSE; + } + } if (runningInForeignVM) { ForeignTools_Shutdown(); @@ -837,5 +951,349 @@ if (gBlockFd >= 0 && !DnD_UninitializeBlocking(gBlockFd)) { Debug("vmware-user failed to uninitialize blocking.\n"); } - return 0; + +#ifdef USE_NOTIFY + Modules_Cleanup(); + + if (notifyPresent) { + Notify_Cleanup(); + } +#endif + + /* + * SIGUSR2 sets this to TRUE, indicating that we should relaunch ourselves. + * This is useful during a Tools upgrade where we'd like to automatically + * restart a new vmware-user binary. + * + * NB: This just makes a best effort and relies on the user's PATH + * environment variable. If it fails for any reason, then we'll just exit. + */ + if (gReloadSelf) { + ReloadSelf(); + } + + return EXIT_SUCCESS; +} + + +/* + *----------------------------------------------------------------------------- + * + * InitGroupLeader -- + * + * This routine sets a few properties related to our main window created + * by {gdk,gtk}_init. Specifically this routine sets the window title, + * sets the override_redirect X11 property, and reparents it to the root + * window, + * + * In addition, this routine will return Xlib handles for the following + * objects: + * - Main or group leader window + * - Display's root window + * + * Results: + * TRUE on success, FALSE on failure. + * + * Side effects: + * Errors may be sent to stderr. + * Window will have a title of VMUSER_TITLE. + * Window, if not already directly parented by the root, will be. + * + * dpy will point to our default display (ex: $DISPLAY). + * groupLeader will point to the window created by gtk_init(). + * rootWindow will point to the root window on $DISPLAY. + * + *----------------------------------------------------------------------------- + */ + +static Bool +InitGroupLeader(Window *groupLeader, // OUT: group leader window + Window *rootWindow) // OUT: root window +{ + Window myGroupLeader; + Window myRootWindow; + XSetWindowAttributes attr = { .override_redirect = True }; + + ASSERT(groupLeader); + ASSERT(rootWindow); + +#if GTK_CHECK_VERSION(2,0,0) + { + GdkDisplay *gdkDisplay = gdk_display_get_default(); + GdkWindow *gdkLeader = gdk_display_get_default_group(gdkDisplay); + myGroupLeader = GDK_WINDOW_XWINDOW(gdkLeader); + } +#else + /* + * This requires digging around in gdk 1.x private code. However, we'll + * assume that GTK 1.x isn't going anywhere, so this should remain stable. + */ + myGroupLeader = gdk_leader_window; +#endif + + myRootWindow = GDK_ROOT_WINDOW(); + + ASSERT(myGroupLeader); + ASSERT(myRootWindow); + + XStoreName(GDK_DISPLAY(), myGroupLeader, VMUSER_TITLE); + + /* + * Sanity check: Set the override redirect property on our group leader + * window (not default), then re-parent it to the root window (default). + * This makes sure that (a) a window manager can't re-parent our window, + * and (b) that we remain a top-level window. + */ + XChangeWindowAttributes(GDK_DISPLAY(), myGroupLeader, CWOverrideRedirect, + &attr); + XReparentWindow(GDK_DISPLAY(), myGroupLeader, myRootWindow, 10, 10); + XSync(GDK_DISPLAY(), FALSE); + + *groupLeader = myGroupLeader; + *rootWindow = myRootWindow; + + return TRUE; +} + + +/* + *----------------------------------------------------------------------------- + * + * AcquireDisplayLock -- + * + * This function "locks" the display against being "claimed" by another + * instance of vmware-user. It will succeed if we're the first/only + * instance of vmware-user, and fail otherwise. + * + * NB: This routine must be called -after- gtk_init(). + * + * Vmware-user enjoys per-display exclusivity using the following algorithm: + * + * 1. Grab X server. (I.e., get exclusive access.) + * 2. Search for top-level X windows meeting the following criteria: + * a. named "vmware-user" + * b. has the property "vmware-user-lock" set. + * 3a. If any such windows described above found, then another vmware-user + * process is attached to this display, so we consider the display + * locked. + * 3b. Else we're the only one. Set the "vmware-user-lock" property on + * our top-level window. + * 4. Ungrab the X server. + * + * Results: + * TRUE if "lock" acquired (i.e., we're the first/only vmware-user process); + * otherwise FALSE. + * + * Side effects: + * The first time this routine is ever called during the lifetime of an X + * session, a new X11 Atom, "vmware-user-lock" is created for the lifetime + * of the X server. + * + * The "vmware-user-lock" property may be set on this process's group leader + * window. + * + *----------------------------------------------------------------------------- + */ + +static Bool +AcquireDisplayLock(void) +{ + Display *defaultDisplay; // Current default X11 display. + Window rootWindow; // Root window of defaultDisplay; used as root node + // passed to XQueryTree(). + Window groupLeader; // Our instance's window group leader. This is + // implicitly created by gtk_init(). + + Window *children = NULL; // Array of windows returned by XQueryTree(). + unsigned int nchildren; // Length of children. + + Window dummy1, dummy2; // Throwaway window IDs for XQueryTree(). + Atom lockAtom; // Refers to the "vmware-user-lock" X11 Atom. + + unsigned int index; + Bool alreadyLocked = FALSE; // Set to TRUE if we discover lock is held. + Bool retval = FALSE; + + defaultDisplay = GDK_DISPLAY(); + + /* + * Reset some of our main window's settings & fetch Xlib handles for + * the GDK group leader and root windows. + */ + if (InitGroupLeader(&groupLeader, &rootWindow) == FALSE) { + Warning("%s: unable to initialize main window.\n", __func__); + return FALSE; + } + + /* + * Look up the lock atom, creating it if it doesn't already exist. + */ + lockAtom = XInternAtom(defaultDisplay, LOCK_ATOM_NAME, False); + if (lockAtom == None) { + Warning("%s: unable to create X11 atom: " LOCK_ATOM_NAME "\n", __func__); + return FALSE; + } + + /* + * Okay, so at this point the following is done: + * + * 1. Our top-level / group leader window is a child of the display's + * root window. + * 2. The window manager can't get its hands on said window. + * 3. We have a handle on the X11 atom which will be used to identify + * the X11 property used as our lock. + */ + + Debug("%s: Grabbing X server.\n", __func__); + + /* + * Neither of these can fail, or at least not in the sense that they'd + * return an error. Instead we'd likely see an X11 I/O error, tearing + * the connection down. + * + * XSync simply blocks until the XGrabServer request is acknowledged + * by the server. It makes sure that we don't continue issuing requests, + * such as XQueryTree, until the server grants our "grab". + */ + XGrabServer(defaultDisplay); + XSync(defaultDisplay, False); + + /* + * WARNING: At this point, we have grabbed the X server. Consider the + * UI to be completely frozen. Under -no- circumstances should we return + * without ungrabbing the server first. + */ + + if (XQueryTree(defaultDisplay, rootWindow, &dummy1, &dummy2, &children, + &nchildren) == 0) { + Warning("%s: XQueryTree failed\n", __func__); + goto out; + } + + /* + * Iterate over array of top-level windows. Search for those named + * vmware-user and with the property "vmware-user-lock" set. + * + * If any such windows are found, then another process has already + * claimed this X session. + */ + for (index = 0; (index < nchildren) && !alreadyLocked; index++) { + char *name = NULL; + + /* Skip unless window is named vmware-user. */ + if ((XFetchName(defaultDisplay, children[index], &name) == 0) || + (name == NULL) || + strcmp(name, VMUSER_TITLE)) { + XFree(name); + continue; + } + + /* + * Query the window for the "vmware-user-lock" property. + */ + alreadyLocked = QueryX11Lock(defaultDisplay, children[index], lockAtom); + XFree(name); + } + + /* + * Yay. Lock isn't held, so go ahead and acquire it. + */ + if (!alreadyLocked) { + unsigned char dummy[] = "1"; + Debug("%s: Setting property " LOCK_ATOM_NAME "\n", __func__); + /* + * NB: Current Xlib always returns one. This may generate a -fatal- IO + * error, though. + */ + XChangeProperty(defaultDisplay, groupLeader, lockAtom, lockAtom, 8, + PropModeReplace, dummy, sizeof dummy); + retval = TRUE; + } + +out: + XUngrabServer(defaultDisplay); + XSync(defaultDisplay, False); + XFree(children); + + return retval; +} + + +/* + *----------------------------------------------------------------------------- + * + * QueryX11Lock -- + * + * This is just a wrapper around XGetWindowProperty which queries the + * window described by <dpy,w> for the property described by lockAtom. + * + * Results: + * TRUE if property defined by parameters exists; FALSE otherwise. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static Bool +QueryX11Lock(Display *dpy, // IN: X11 display to query + Window w, // IN: window to query + Atom lockAtom) // IN: atom used for locking +{ + Atom ptype; // returned property type + int pfmt; // returned property format + unsigned long np; // returned # of properties + unsigned long remaining; // amount of data remaining in property + unsigned char *data = NULL; + + if (XGetWindowProperty(dpy, w, lockAtom, 0, 1, False, lockAtom, + &ptype, &pfmt, &np, &remaining, &data) != Success) { + Warning("%s: Unable to query window %lx for property %s\n", __func__, w, + LOCK_ATOM_NAME); + return FALSE; + } + + /* + * Xlib is wacky. If the following test is true, then our property + * didn't exist for the window in question. As a result, `data' is + * unset, so don't worry about the lack of XFree(data) here. + */ + if (ptype == None) { + return FALSE; + } + + /* + * We care only about the existence of the property, not its value. + */ + XFree(data); + + return TRUE; +} + + +/* + *----------------------------------------------------------------------------- + * + * ReloadSelf -- + * + * Re-launch vmware-user by attempting to execute VMUSER_TITLE + * ('vmware-user'), relying on the user's search path. + * + * Results: + * On success, vmware-user is relaunched in our stead. On failure, we + * exit with EXIT_FAILURE. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static void +ReloadSelf(void) +{ + Debug("> %s\n", __func__); + execlp(VMUSER_TITLE, VMUSER_TITLE, NULL); + exit(EXIT_FAILURE); } diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/vmware-user/vmwareuserInt.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/vmware-user/vmwareuserInt.h --- open-vm-tools-2008.01.23-74039/vmware-user/vmwareuserInt.h 2008-01-28 08:02:53.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/vmware-user/vmwareuserInt.h 2008-10-13 08:01:54.000000000 +0100 @@ -8,11 +8,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -37,6 +37,8 @@ #include "rpcout.h" #include "rpcin.h" +#include "guestApp.h" + /* * These must be the same as the minimum values used by the lots_of_modlines() * function in config.pl @@ -53,17 +55,14 @@ #define FCP_FILE_TRANSFERRING 1 #define FCP_FILE_TRANSFERRED 2 -Bool Resolution_Register(void); -Bool Resolution_RegisterCapability(void); -Bool Resolution_Unregister(void); - -Bool DnD_Register(GtkWidget *mainWnd); +Bool DnD_Register(GtkWidget *hgWnd, GtkWidget *ghWnd); Bool DnD_RegisterCapability(void); -void DnD_Unregister(GtkWidget *mainWnd); +void DnD_Unregister(GtkWidget *hgWnd, GtkWidget *ghWnd); uint32 DnD_GetVmxDnDVersion(void); int DnD_GetNewFileRoot(char *fileRoot, int bufSize); -void DnD_OnReset(GtkWidget *mainWnd); +void DnD_OnReset(GtkWidget *hgWnd, GtkWidget *gHWnd); Bool DnD_InProgress(void); +void DnD_SetMode(Bool unity); Bool CopyPaste_Register(GtkWidget* mainWnd); Bool CopyPaste_RegisterCapability(void); @@ -72,18 +71,56 @@ Bool CopyPaste_GetBackdoorSelections(void); void CopyPaste_Unregister(GtkWidget* mainWnd); Bool CopyPaste_GHFileListGetNext(char **fileName, size_t *fileNameSize); +void CopyPaste_OnReset(void); Bool CopyPaste_InProgress(void); +Bool CopyPaste_IsRpcCPSupported(void); Bool Pointer_Register(GtkWidget* mainWnd); +#if defined(USING_AUTOCONF) && defined(HAVE_LIBNOTIFY) +#if defined(USE_NOTIFY_DLOPEN) +#error "USE_NOTIFY_SO and USE_NOTIFY_DLOPEN cannot be simultaneously defined" +#endif + +#define USE_NOTIFY_SO +#endif + +#if defined(USE_NOTIFY_SO) || defined(USE_NOTIFY_DLOPEN) +#define USE_NOTIFY +#endif + +#ifdef USE_NOTIFY +#ifdef USE_NOTIFY_DLOPEN +struct NotifyNotification; +typedef struct NotifyNotification NotifyNotification; +#endif + +typedef struct +{ + GtkStatusIcon *statusIcon; + NotifyNotification *notification; + GtkWidget *menu; +} Notifier; +extern const char *vmLibDir; + +Bool Notify_Init(GuestApp_Dict *confDict); +void Notify_Cleanup(void); +Bool Notify_Notify(int secs, const char *shortMsg, const char *longMsg, + GtkWidget *menu, + gboolean (*callback)(GtkWidget *, Notifier *)); + +#ifdef USE_NOTIFY_DLOPEN +Bool Modules_Init(void); +void Modules_Cleanup(void); +#endif +#endif + extern RpcIn *gRpcIn; extern Display *gXDisplay; extern Window gXRoot; extern DblLnkLst_Links *gEventQueue; extern GtkWidget *gUserMainWidget; extern Bool optionCopyPaste; -extern Bool gCanUseVMwareCtrl; -extern Bool gCanUseVMwareCtrlTopologySet; extern int gBlockFd; #endif // _VMWAREUSER_INT_H_ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/vmware-user/vmwareuser_version.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/vmware-user/vmwareuser_version.h --- open-vm-tools-2008.01.23-74039/vmware-user/vmwareuser_version.h 2008-01-28 08:02:53.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/vmware-user/vmwareuser_version.h 2008-10-13 08:01:54.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/vmware-user-suid-wrapper/COPYING /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/vmware-user-suid-wrapper/COPYING --- open-vm-tools-2008.01.23-74039/vmware-user-suid-wrapper/COPYING 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/vmware-user-suid-wrapper/COPYING 2008-10-13 08:01:54.000000000 +0100 @@ -0,0 +1,502 @@ + 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. + + <one line to give the library's name and a brief idea of what it does.> + Copyright (C) <year> <name of author> + + 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. + + <signature of Ty Coon>, 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/vmware-user-suid-wrapper/locationsdb.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/vmware-user-suid-wrapper/locationsdb.c --- open-vm-tools-2008.01.23-74039/vmware-user-suid-wrapper/locationsdb.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/vmware-user-suid-wrapper/locationsdb.c 2008-10-13 08:01:54.000000000 +0100 @@ -0,0 +1,149 @@ +/********************************************************* + * Copyright (C) 2007 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. + * + *********************************************************/ + + +/* + * locationsdb.c -- + * + * Provides the QueryLocationsDB routine for finding keys in the locations + * database. Because our application is a setuid binary and we want to + * minimize risk, we retain the duplicated functionality here rather than + * link against lib/unixinstall. + */ + +#if !defined(sun) && !defined(__FreeBSD__) && !defined(linux) +# error This program is not supported on your platform. +#endif + +#include <sys/param.h> + +#include <fcntl.h> +#include <string.h> +#include <strings.h> + +#include "vm_basic_types.h" +#include "wrapper.h" + + + +/* + * Local data + */ + +/* + * Mappings between queries and search strings + */ + +typedef struct Mapping { + const char *answer; /* string to match for "answer FOO" */ + const char *remove; /* string to match for "remove_answer FOO" */ + size_t answerSize; /* size of answer buffer */ + size_t removeSize; /* size of remove buffer */ +} Mapping; + +/* + * queryMappings between Selector => search strings. Used by QueryLocationsDB. + */ + +#define ANSWER_LIBDIR "answer LIBDIR" +#define REMOVE_LIBDIR "remove_answer LIBDIR" +#define ANSWER_BINDIR "answer BINDIR" +#define REMOVE_BINDIR "remove_answer BINDIR" + +static Mapping queryMappings[] = { + { ANSWER_LIBDIR, REMOVE_LIBDIR, sizeof ANSWER_LIBDIR, sizeof REMOVE_LIBDIR }, + { ANSWER_BINDIR, REMOVE_BINDIR, sizeof ANSWER_BINDIR, sizeof REMOVE_BINDIR }, + { 0, 0, 0, 0 } +}; + + +/* + * Global functions (definitions) + */ + + +/* + *---------------------------------------------------------------------------- + * + * QueryLocationsDB -- + * + * Based on the caller's Selector, determines the directory selected as + * "LIBDIR", "BINDIR", etc. when the Tools were last configured. + * + * Results: + * TRUE on success, FALSE on failure. queryDir is filled in on success. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +Bool +QueryLocationsDB(const char *locations, // IN : path of locations database + Selector selector, // IN : DB query to search for + char *queryDir, // OUT: address to write dirname to + size_t queryDirSize) // IN : size of queryDir buffer +{ + FILE *file = NULL; + char buf[MAXPATHLEN]; + Bool found = FALSE; + Mapping *map; + + if (selector < 0 || selector >= QUERY_MAX) { + Error("Internal logic error. This is a bug."); + return FALSE; + } + + file = fopen(locations, "r"); + if (!file) { + return FALSE; + } + + map = &queryMappings[selector]; + + /* + * We need to inspect the entire locations database since there are both + * "answer"s and "remove_answer"s. We want to provide the last answer that + * has not been removed. + */ + while (fgets(buf, sizeof buf, file)) { + if (strncmp(buf, map->answer, map->answerSize - 1) == 0) { + char *newline; + + strncpy(queryDir, buf + map->answerSize, queryDirSize); + if (queryDir[queryDirSize - 1] != '\0') { + found = FALSE; + continue; + } + + /* Truncate the string at the newline character, if it's present. */ + newline = strchr(queryDir, '\n'); + if (newline && newline - queryDir < queryDirSize) { + *newline = '\0'; + } + + found = TRUE; + } else if (strncmp(buf, map->remove, map->removeSize - 1) == 0) { + found = FALSE; + } + } + + fclose(file); + return found; +} diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/vmware-user-suid-wrapper/main.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/vmware-user-suid-wrapper/main.c --- open-vm-tools-2008.01.23-74039/vmware-user-suid-wrapper/main.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/vmware-user-suid-wrapper/main.c 2008-10-13 08:01:54.000000000 +0100 @@ -0,0 +1,499 @@ +/********************************************************* + * Copyright (C) 2007 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. + * + *********************************************************/ + + +/* + * main.c -- + * + * This program is run as root to prepare the system for vmware-user. It + * unmounts the vmblock file system, unloads the vmblock module, then + * reloads the module, mounts the file system, and opens a file descriptor + * that vmware-user can use to add and remove blocks. This must all + * happen as root since we cannot allow any random process to add and + * remove blocks in the blocking file system. + */ + +#if !defined(sun) && !defined(__FreeBSD__) && !defined(linux) +# error This program is not supported on your platform. +#endif + +#include <sys/param.h> +#include <sys/mount.h> +#include <sys/types.h> +#include <sys/stat.h> + +#if defined(sun) +# include <sys/systeminfo.h> +#endif + +#include <stdlib.h> +#include <stdio.h> +#include <errno.h> +#include <fcntl.h> +#include <unistd.h> +#include <string.h> +#include <strings.h> + +#include "vmware.h" +#include "vmblock.h" +#include "wrapper.h" + +#include "wrapper_version.h" +#include "embed_version.h" +VM_EMBED_VERSION(WRAPPER_VERSION_STRING); + + +/* + * Local functions (prototypes) + */ + +#ifdef TOGGLE_VMBLOCK +static void ToggleVMBlock(void); +static Bool StartVMBlock(void); +static Bool StopVMBlock(void); +static Bool MakeDirectory(const char *path, mode_t mode, uid_t uid, gid_t gid); +static Bool ChmodChownDirectory(const char *path, + mode_t mode, uid_t uid, gid_t gid); +#endif +static Bool StartVMwareUser(char *const envp[]); + + +/* + *---------------------------------------------------------------------------- + * + * main -- + * + * On platforms where this wrapper manages the vmblock module: + * Unmounts vmblock and unloads the module, then reloads the module, + * and remounts the file system, then starts vmware-user as described + * below. + * + * This program is the only point at which vmblock is stopped or + * started. This means we must always unload the module to ensure that + * we are using the newest installed version (since an upgrade could + * have occurred since the last time this program ran). + * + * On all platforms: + * Acquires the vmblock control file descriptor, drops privileges, then + * starts vmware-user. + * + * Results: + * EXIT_SUCCESS on success and EXIT_FAILURE on failure. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +int +main(int argc, + char *argv[], + char *envp[]) +{ +#ifdef TOGGLE_VMBLOCK + ToggleVMBlock(); +#endif + + if (!StartVMwareUser(envp)) { + Error("failed to start vmware-user\n"); + exit(EXIT_FAILURE); + } + + exit(EXIT_SUCCESS); +} + + +/* + * Local functions (definitions) + */ + + +#ifdef TOGGLE_VMBLOCK +/* + *---------------------------------------------------------------------------- + * + * ToggleVMBlock -- + * + * Unmounts vmblock and unloads the module, then reloads the module and + * remounts the file system. + * + * Results: + * Vmblock file system "service" is reloaded. + * + * Side effects: + * May exit with EXIT_FAILURE if the vmblock service cannot be stopped. + * + *---------------------------------------------------------------------------- + */ + +static void +ToggleVMBlock(void) +{ + if (!StopVMBlock()) { + Error("failed to stop vmblock\n"); + exit(EXIT_FAILURE); + } + + if (!StartVMBlock()) { + /* + * There is more to vmware-user than VMBlock, so in case of error, + * only make a little noise. Continue to launch vmware-user. + */ + Error("failed to start vmblock\n"); + } +} + + +/* + *---------------------------------------------------------------------------- + * + * StopVMBlock -- + * + * Unmounts the vmblock file system and unload the vmblock module. + * + * Results: + * TRUE on success, FALSE on failure. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +static Bool +StopVMBlock(void) +{ + Bool ret; + int id; + + /* + * Default to success whether or not module loaded. Can fail only if + * unload fails. + */ + ret = TRUE; + + /* + * The file system may not be mounted and that's okay. If it is mounted and + * this fails, the unloading of the module will fail later. + */ + UnmountVMBlock(VMBLOCK_MOUNT_POINT); + + id = GetModuleId(MODULE_NAME); + if (id >= 0) { + /* The module is loaded. */ + if (!UnloadModule(id)) { + ret = FALSE; + } + } + + return ret; +} + + +/* + *---------------------------------------------------------------------------- + * + * StartVMBlock -- + * + * Loads the vmblock module and mounts its file system. + * + * Results: + * TRUE on success and FALSE on failure. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +static Bool +StartVMBlock(void) +{ + uid_t euid; + gid_t egid; + + euid = geteuid(); + egid = getegid(); + + if (!MakeDirectory(TMP_DIR, TMP_DIR_MODE, euid, egid)) { + Error("failed to create %s\n", TMP_DIR); + return FALSE; + } + + if (!MakeDirectory(VMBLOCK_MOUNT_POINT, MOUNT_POINT_MODE, euid, egid)) { + Error("failed to create %s\n", VMBLOCK_MOUNT_POINT); + return FALSE; + } + + if (!LoadVMBlock()) { + return FALSE; + } + + if (!MountVMBlock()) { + /* This will unload the module and ignore the unmount failure. */ + StopVMBlock(); + return FALSE; + } + + return TRUE; +} + + +/* + *---------------------------------------------------------------------------- + * + * MakeDirectory -- + * + * Creates a directory with the provided mode, uid, and gid. If the + * provided path already exists, this will ensure that it has the correct + * mode, uid, and gid, or else it will fail. + * + * Results: + * TRUE on success, FALSE on failure. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +static Bool +MakeDirectory(const char *path, // IN: path to create + mode_t mode, // IN: mode of new directory + uid_t uid, // IN: owner of new directory + gid_t gid) // IN: group of new directory +{ + if (mkdir(path, mode) == 0) { + /* + * We still need to chmod(2) the directory since mkdir(2) takes the umask + * into account. + */ + if (!ChmodChownDirectory(path, mode, uid, gid)) { + return FALSE; + } + return TRUE; + } + + /* + * If we couldn't create the directory because the path already exists, we + * need to make sure it's a directory and that it has the correct + * permissions and owner. For any other failure we fail. + */ + if (errno != EEXIST || !ChmodChownDirectory(path, mode, uid, gid)) { + return FALSE; + } + + return TRUE; +} + + +/* + *---------------------------------------------------------------------------- + * + * ChmodChownDirectory -- + * + * Atomically ensures the provided path is a directory and changes its mode, + * uid, and gid to the provided values. + * + * Results: + * TRUE on success, FALSE on failure. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +static Bool +ChmodChownDirectory(const char *path, // IN + mode_t mode, // IN + uid_t uid, // IN + gid_t gid) // IN +{ + int fd; + struct stat stat; + int ret = FALSE; + + fd = open(path, O_RDONLY); + if (fd < 0) { + return FALSE; + } + + if (fstat(fd, &stat) != 0) { + goto out; + } + + if (!S_ISDIR(stat.st_mode)) { + goto out; + } + + if ((stat.st_uid != uid || stat.st_gid != gid) && + fchown(fd, uid, gid) != 0) { + goto out; + } + + if (stat.st_mode != mode && fchmod(fd, mode) != 0) { + goto out; + } + + ret = TRUE; + +out: + close(fd); + return ret; +} +#endif // ifdef TOGGLE_VMBLOCK + + +/* + *---------------------------------------------------------------------------- + * + * StartVMwareUser -- + * + * Obtains the library directory from the Tools locations database, then + * opens a file descriptor (while still root) to add and remove blocks, + * drops privilege to the real uid of this process, and finally starts + * vmware-user. + * + * Results: + * Parent: TRUE on success, FALSE on failure. + * Child: FALSE on failure, no return on success. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +static Bool +StartVMwareUser(char *const envp[]) +{ + pid_t pid; + uid_t uid; + gid_t gid; + int fd = -1; + int ret; + char path[MAXPATHLEN]; + char *argv[4]; + + if (!BuildExecPath(path, sizeof path)) { + return FALSE; + } + + /* + * Now create a child process, obtain a file descriptor as root, downgrade + * privilege, and run vmware-user. + */ + pid = fork(); + if (pid == -1) { + Error("fork failed: %s\n", strerror(errno)); + return FALSE; + } else if (pid != 0) { + /* Parent */ + return TRUE; + } + + /* Child */ + + /* + * We know the file system is mounted and want to keep this suid + * root wrapper as small as possible, so here we directly open(2) the + * "device" instead of calling DnD_InitializeBlocking() and bringing along + * a whole host of libs. + */ + fd = open(VMBLOCK_DEVICE, VMBLOCK_DEVICE_MODE); + + uid = getuid(); + gid = getgid(); + + if ((setreuid(uid, uid) != 0) || + (setregid(gid, gid) != 0)) { + Error("could not drop privileges: %s\n", strerror(errno)); + if (fd != -1) { + close(fd); + } + return FALSE; + } + + /* + * Since vmware-user provides features that don't depend on vmblock, we + * invoke vmware-user even if we couldn't obtain a file descriptor or we + * can't parse the descriptor to pass as an argument. We set up the + * argument vector accordingly. + */ + argv[0] = path; + + if (fd < 0) { + Error("could not open %s\n", VMBLOCK_DEVICE); + argv[1] = NULL; + } else { + char fdStr[8]; + + ret = snprintf(fdStr, sizeof fdStr, "%d", fd); + if (ret == 0 || ret >= sizeof fdStr) { + Error("could not parse file descriptor (%d)\n", fd); + argv[1] = NULL; + } else { + argv[1] = "-blockFd"; + argv[2] = fdStr; + argv[3] = NULL; + } + } + + CompatExec(path, argv, envp); + + /* + * CompatExec, if successful, doesn't return. I.e., we're here only + * if CompatExec fails. + */ + Error("could not execute %s: %s\n", path, strerror(errno)); + exit(EXIT_FAILURE); +} + + +#ifndef USES_LOCATIONS_DB +/* + *----------------------------------------------------------------------------- + * + * BuildExecPath -- + * + * Writes the path to vmware-user to execPath. This version, as opposed + * to the versions in $platform/wrapper.c, is only used when the locations + * database isn't used. + * + * Results: + * TRUE on success, FALSE on failure. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +Bool +BuildExecPath(char *execPath, // OUT: Buffer to store executable's path + size_t execPathSize) // IN : size of execPath buffer +{ + if (execPathSize < sizeof VMWARE_USER_PATH) { + return FALSE; + } + strcpy(execPath, VMWARE_USER_PATH); + return TRUE; +} +#endif // ifndef USES_LOCATIONS_DB diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/vmware-user-suid-wrapper/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/vmware-user-suid-wrapper/Makefile.am --- open-vm-tools-2008.01.23-74039/vmware-user-suid-wrapper/Makefile.am 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/vmware-user-suid-wrapper/Makefile.am 2008-10-13 08:01:54.000000000 +0100 @@ -0,0 +1,29 @@ +################################################################################ +### Copyright 2007 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-user-suid-wrapper + +# We shouldn't impose on users' installation preferences, so just provide +# a sane default and let them override it at configure or make time. +VMWARE_USER_PATH = $(bindir)/vmware-user + +AM_CPPFLAGS = +AM_CPPFLAGS += -DVMWARE_USER_PATH=\"$(VMWARE_USER_PATH)\" + +vmware_user_suid_wrapper_SOURCES = +vmware_user_suid_wrapper_SOURCES += main.c +vmware_user_suid_wrapper_SOURCES += wrapper-@TARGET_OS@.c diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/vmware-user-suid-wrapper/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/vmware-user-suid-wrapper/Makefile.in --- open-vm-tools-2008.01.23-74039/vmware-user-suid-wrapper/Makefile.in 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/vmware-user-suid-wrapper/Makefile.in 2008-10-13 08:02:17.000000000 +0100 @@ -0,0 +1,529 @@ +# 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 2007 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-user-suid-wrapper$(EXEEXT) +subdir = vmware-user-suid-wrapper +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)/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_user_suid_wrapper_OBJECTS = main.$(OBJEXT) \ + wrapper-@TARGET_OS@.$(OBJEXT) +vmware_user_suid_wrapper_OBJECTS = \ + $(am_vmware_user_suid_wrapper_OBJECTS) +vmware_user_suid_wrapper_LDADD = $(LDADD) +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_user_suid_wrapper_SOURCES) +DIST_SOURCES = $(vmware_user_suid_wrapper_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_XLIBS = @COMMON_XLIBS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ +DNET_LIBS = @DNET_LIBS@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +FGREP = @FGREP@ +GREP = @GREP@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ +GTK_LIBS = @GTK_LIBS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ +HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ +LN_S = @LN_S@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ +MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ +RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ +VERSION = @VERSION@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ +XMKMF = @XMKMF@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +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@ +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@ +lt_ECHO = @lt_ECHO@ +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@ + +# We shouldn't impose on users' installation preferences, so just provide +# a sane default and let them override it at configure or make time. +VMWARE_USER_PATH = $(bindir)/vmware-user +AM_CPPFLAGS = -DVMWARE_USER_PATH=\"$(VMWARE_USER_PATH)\" +vmware_user_suid_wrapper_SOURCES = main.c wrapper-@TARGET_OS@.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 vmware-user-suid-wrapper/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu vmware-user-suid-wrapper/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-user-suid-wrapper$(EXEEXT): $(vmware_user_suid_wrapper_OBJECTS) $(vmware_user_suid_wrapper_DEPENDENCIES) + @rm -f vmware-user-suid-wrapper$(EXEEXT) + $(LINK) $(vmware_user_suid_wrapper_OBJECTS) $(vmware_user_suid_wrapper_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wrapper-@TARGET_OS@.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: diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/vmware-user-suid-wrapper/wrapper-freebsd.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/vmware-user-suid-wrapper/wrapper-freebsd.c --- open-vm-tools-2008.01.23-74039/vmware-user-suid-wrapper/wrapper-freebsd.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/vmware-user-suid-wrapper/wrapper-freebsd.c 2008-10-13 08:01:54.000000000 +0100 @@ -0,0 +1,291 @@ +/********************************************************* + * Copyright (C) 2007 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. + * + *********************************************************/ + +/* + * wrapper.c -- + * + * Platform specific code for the VMware User Agent setuid wrapper. + */ + + +#include <sys/param.h> +#include <sys/mount.h> +#include <sys/uio.h> // for nmount(2) +#include <sys/linker.h> // for kldfind(2), kldload(2), etc. + +#include <errno.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> + +#include "vmware.h" +#include "wrapper.h" + + +/* + * Global functions + */ + + +/* + *---------------------------------------------------------------------------- + * + * GetModuleId -- + * + * Finds the id of the provided loaded module. + * + * Results: + * The id on success, a negative error code on failure. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +int +GetModuleId(const char *name) // IN: module name to search for +{ + return kldfind(name); +} + + +/* + *----------------------------------------------------------------------------- + * + * UnloadModule -- + * + * Lookup and, if loaded, unload the VMBlock kernel module. + * + * Results: + * TRUE on success, FALSE otherwise + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +Bool +UnloadModule(int id) // IN: module id for kldunload(2) +{ + if (kldunload(id) < 0) { + Error("failed to unload vmblock: %s\n", strerror(errno)); + return FALSE; + } + + return TRUE; +} + + +/* + *----------------------------------------------------------------------------- + * + * LoadVMBlock -- + * + * Load the VMBlock kernel module. + * + * Results: + * TRUE on success, FALSE otherwise + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +Bool +LoadVMBlock(void) +{ + /* + * Kldload(2) will handle module search paths for us. + */ + if (kldload(MODULE_NAME) == -1) { + Error("failed to load vmblock: %s\n", strerror(errno)); + return FALSE; + } + + return TRUE; +} + + +/* + *----------------------------------------------------------------------------- + * + * UnmountVMBlock -- + * + * Unmount the VMBlock file system. + * + * Results: + * TRUE on success, FALSE otherwise. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +Bool +UnmountVMBlock(const char *mountPoint) // IN: VMBlock mount point +{ + if (unmount(mountPoint, 0) == -1) { + return FALSE; + } + return TRUE; +} + + +/* + *----------------------------------------------------------------------------- + * + * MountVMBlock -- + * + * Mount the VMBlock file system. + * + * Results: + * TRUE on success, FALSE otherwise + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +Bool +MountVMBlock(void) +{ + /* + * These arguments are given as interleaved key => value pairs. We're + * requesting mount of the VMBlock filesystem (fstype), with TMP_DIR (target) + * remounted over VMBLOCK_MOUNT_POINT (fspath). + */ + struct iovec iov[] = { + { .iov_base = "fstype", .iov_len = sizeof "fstype" }, + { .iov_base = "vmblock", .iov_len = sizeof "vmblock" }, + { .iov_base = "fspath", .iov_len = sizeof "fspath" }, + { .iov_base = VMBLOCK_MOUNT_POINT, .iov_len = sizeof VMBLOCK_MOUNT_POINT }, + { .iov_base = "target", .iov_len = sizeof "target" }, + { .iov_base = TMP_DIR, .iov_len = sizeof TMP_DIR } + }; + + if (nmount(iov, ARRAYSIZE(iov), MNT_NOSUID) == -1) { + Error("failed to mount vmblock file system: %s\n", strerror(errno)); + return FALSE; + } + + return TRUE; +} + + +#ifdef USES_LOCATIONS_DB +/* + *----------------------------------------------------------------------------- + * + * BuildExecPath -- + * + * Determine & return path of vmware-user for use by execve(2). + * + * Results: + * TRUE on success, FALSE otherwise + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +Bool +BuildExecPath(char *execPath, // OUT: Buffer to store executable's path + size_t execPathSize) // IN : size of execPath buffer +{ + char tmpPath[MAXPATHLEN]; + int execLen; + + /* + * The locations database is the only path that's fixed, and it contains the + * paths to all the other paths selected during Tools configuration. The + * locations database file is only writable by root, so we can trust it. + */ + if (!QueryLocationsDB(LOCATIONS_PATH, QUERY_BINDIR, tmpPath, sizeof tmpPath)) { + Error("could not obtain BINDIR\n"); + return FALSE; + } + + if (strlcat(tmpPath, + "/vmware-user-wrapper", sizeof tmpPath) >= sizeof tmpPath) { + Error("could not construct program filename\n"); + return FALSE; + } + + /* + * From readlink(2), "The readlink() system call does not append a NUL + * character to buf." (NB: This breaks if user ever replaces the symlink + * with the target.) + */ + if ((execLen = readlink(tmpPath, execPath, execPathSize - 1)) == -1) { + Error("could not resolve symlink: %s\n", strerror(errno)); + return FALSE; + } + + execPath[execLen] = '\0'; + + /* + * Now make sure that the target is actually part of our "trusted" + * directory. (Check that execPath has LIBDIR as a prefix and does + * not contain "..".) + */ + if (!QueryLocationsDB(LOCATIONS_PATH, QUERY_LIBDIR, tmpPath, + sizeof tmpPath)) { + Error("could not obtain LIBDIR\n"); + return FALSE; + } + + if ((strncmp(execPath, tmpPath, strlen(tmpPath)) != 0) || + (strstr(execPath, "..") != NULL)) { + Error("vmware-user path untrusted\n"); + return FALSE; + } + + return TRUE; +} +#endif // ifdef USES_LOCATIONS_DB + + +/* + *---------------------------------------------------------------------------- + * + * CompatExec -- + * + * Simple platform-dependent execve() wrapper. + * + * Results: + * False. + * + * Side effects: + * This function may not return. + * + *---------------------------------------------------------------------------- + */ + +Bool +CompatExec(const char *path, char * const argv[], char * const envp[]) +{ + execve(path, argv, envp); + return FALSE; +} diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/vmware-user-suid-wrapper/wrapper.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/vmware-user-suid-wrapper/wrapper.h --- open-vm-tools-2008.01.23-74039/vmware-user-suid-wrapper/wrapper.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/vmware-user-suid-wrapper/wrapper.h 2008-10-13 08:01:54.000000000 +0100 @@ -0,0 +1,95 @@ +/********************************************************* + * Copyright (C) 2007 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. + * + *********************************************************/ + +/* + * wrapper.h -- + * + * Platform independent definitions for the VMware User Agent setuid + * wrapper. + */ + +#ifndef _WRAPPER_H_ +#define _WRAPPER_H_ + +#include <sys/types.h> + +#include <stdio.h> + +#include "vm_basic_types.h" +#include "vmblock.h" + +#define TMP_DIR "/tmp/VMwareDnD" +#define TMP_DIR_MODE (S_ISVTX | S_IRWXU | S_IRWXO | S_IRWXG) +#define MOUNT_POINT_MODE (S_IRWXU | S_IRWXO | S_IRWXG) +#define MODULE_NAME VMBLOCK_FS_NAME + +#define progname "vmware-user" +#define Error(fmt, args...) fprintf(stderr, "%s: " fmt, progname, ##args); + + +/* + * XXX Document official VMware Tools releases vs. Open VM Tools and the + * use of the locations database in the former vs. compile-time pathing + * in the latter. + */ +#ifdef USES_LOCATIONS_DB +# define LOCATIONS_PATH "/etc/vmware-tools/locations" + +/* + * Locations DB query selector. Values in this enum are used as array + * indexes, so any updates to this enum must follow updating + * main.c::queryMappings. + */ + +typedef enum { + QUERY_LIBDIR = 0, /* Ask for "BINDIR" */ + QUERY_BINDIR, /* Ask for "LIBDIR" */ + QUERY_MAX /* Upper limit -- Insert other queries above only. */ +} Selector; +#else +# ifndef VMWARE_USER_PATH +# error This program requires either USES_LOCATIONS_DB or VMWARE_USER_PATH. +# endif // ifndef VMWARE_USER_PATH +#endif // ifdef USES_LOCATIONS_DB + + +/* + * Global functions + */ + +#if defined(sun) || defined(__FreeBSD__) +#define TOGGLE_VMBLOCK +extern int GetModuleId(const char *); +extern Bool UnloadModule(int); + +extern Bool UnloadVMBlock(void); +extern Bool LoadVMBlock(void); +extern Bool UnmountVMBlock(const char *); +extern Bool MountVMBlock(void); +#endif + +extern Bool CompatExec(const char *, char * const [], char * const []); +extern Bool BuildExecPath(char *, size_t); + +/* See above re: USES_LOCATIONS_DB. */ +#ifdef USES_LOCATIONS_DB +extern Bool QueryLocationsDB(const char *, Selector, char *, size_t); +#endif // ifdef USES_LOCATIONS_DB + + +#endif // ifndef _WRAPPER_H_ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/vmware-user-suid-wrapper/wrapper-linux.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/vmware-user-suid-wrapper/wrapper-linux.c --- open-vm-tools-2008.01.23-74039/vmware-user-suid-wrapper/wrapper-linux.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/vmware-user-suid-wrapper/wrapper-linux.c 2008-10-13 08:01:54.000000000 +0100 @@ -0,0 +1,145 @@ +/********************************************************* + * Copyright (C) 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. + * + *********************************************************/ + +/* + * wrapper.c -- + * + * Platform specific code for the VMware User Agent setuid wrapper. + */ + +#include <sys/mount.h> +#include <sys/param.h> +#include <sys/utsname.h> +#include <sys/types.h> +#include <sys/stat.h> +#include <sys/wait.h> + +#include <errno.h> +#include <fcntl.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <unistd.h> + +#include "vmware.h" +#include "wrapper.h" + + +/* + * Global functions + */ + + +#ifdef USES_LOCATIONS_DB +/* + *----------------------------------------------------------------------------- + * + * BuildExecPath -- + * + * Determine & return path of vmware-user for use by execve(2). + * + * Results: + * TRUE on success, FALSE otherwise + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +Bool +BuildExecPath(char *execPath, // OUT: Buffer to store executable's path + size_t execPathSize) // IN : size of execPath buffer +{ + char tmpPath[MAXPATHLEN]; + int execLen; + + /* + * The locations database is the only path that's fixed, and it contains the + * paths to all the other paths selected during Tools configuration. The + * locations database file is only writable by root, so we can trust it. + */ + if (!QueryLocationsDB(LOCATIONS_PATH, QUERY_BINDIR, tmpPath, sizeof tmpPath)) { + Error("could not obtain BINDIR\n"); + return FALSE; + } + + if (strlen(tmpPath) + strlen("/vmware-user-wrapper") + 1 > sizeof tmpPath) { + Error("could not construct program filename\n"); + return FALSE; + } + strcat(tmpPath, "/vmware-user-wrapper"); + + /* + * From readlink(2), "The readlink() system call does not append a NUL + * character to buf." (NB: This breaks if user ever replaces the symlink + * with the target.) + */ + if ((execLen = readlink(tmpPath, execPath, execPathSize - 1)) == -1) { + Error("could not resolve symlink: %s\n", strerror(errno)); + return FALSE; + } + + execPath[execLen] = '\0'; + + /* + * Now make sure that the target is actually part of our "trusted" + * directory. (Check that execPath has LIBDIR as a prefix and does + * not contain "..".) + */ + if (!QueryLocationsDB(LOCATIONS_PATH, QUERY_LIBDIR, tmpPath, + sizeof tmpPath)) { + Error("could not obtain LIBDIR\n"); + return FALSE; + } + + if ((strncmp(execPath, tmpPath, strlen(tmpPath)) != 0) || + (strstr(execPath, "..") != NULL)) { + Error("vmware-user path untrusted\n"); + return FALSE; + } + + return TRUE; +} +#endif // ifdef USES_LOCATIONS_DB + + +/* + *---------------------------------------------------------------------------- + * + * CompatExec -- + * + * Simple platform-dependent execve() wrapper. + * + * Results: + * False. + * + * Side effects: + * This function may not return. + * + *---------------------------------------------------------------------------- + */ + +Bool +CompatExec(const char *path, // IN: path to executable + char * const argv[], // IN: argument vector (see execve) + char * const envp[]) // IN: environment vector (see execve) +{ + execve(path, argv, envp); + return FALSE; +} diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/vmware-user-suid-wrapper/wrapper-solaris.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/vmware-user-suid-wrapper/wrapper-solaris.c --- open-vm-tools-2008.01.23-74039/vmware-user-suid-wrapper/wrapper-solaris.c 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/vmware-user-suid-wrapper/wrapper-solaris.c 2008-10-13 08:01:54.000000000 +0100 @@ -0,0 +1,261 @@ +/********************************************************* + * Copyright (C) 2007 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. + * + *********************************************************/ + +/* + * wrapper.c -- + * + * Platform dependent code for the VMware User Agent setuid wrapper. + */ + +#include <sys/types.h> +#include <sys/mount.h> +#include <sys/mntent.h> +#include <sys/modctl.h> +#include <sys/systeminfo.h> + +#include <errno.h> +#include <strings.h> +#include <unistd.h> + +#include "wrapper.h" + + +/* + * Global functions + */ + + +/* + *----------------------------------------------------------------------------- + * + * UnloadModule -- + * + * Lookup and, if loaded, unload the VMBlock kernel module. + * + * Results: + * TRUE on success, FALSE otherwise + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +Bool +UnloadModule(int id) // IN: module id for modctl(2) +{ + if (modctl(MODUNLOAD, id) < 0) { + Error("Error unloading VMBlock module: %s", strerror(errno)); + return FALSE; + } + + return TRUE; +} + + +/* + *----------------------------------------------------------------------------- + * + * LoadVMBlock -- + * + * Load the VMBlock kernel module. + * + * Results: + * TRUE on success, FALSE otherwise + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +Bool +LoadVMBlock(void) +{ + /* + * modctl will load either the 32-bit or 64-bit module, as appropriate. + */ + if (modctl(MODLOAD, 1, "drv/vmblock", NULL) < 0) { + Error("failed to load vmblock\n"); + return FALSE; + } + + return TRUE; +} + + +/* + *----------------------------------------------------------------------------- + * + * UnmountVMBlock -- + * + * Unmount the VMBlock file system. + * + * Results: + * TRUE on success, FALSE otherwise. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +Bool +UnmountVMBlock(const char *mountPoint) // IN: VMBlock mount point +{ + if (umount(mountPoint) == -1) { + return FALSE; + } + return TRUE; +} + + +/* + *----------------------------------------------------------------------------- + * + * MountVMBlock -- + * + * Mount the VMBlock file system. + * + * Results: + * TRUE on success, FALSE otherwise + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +Bool +MountVMBlock(void) +{ + if (mount(TMP_DIR, VMBLOCK_MOUNT_POINT, MS_DATA, VMBLOCK_FS_NAME) < 0) { + Error("failed to mount vmblock file system: %s\n", strerror(errno)); + return FALSE; + } + + return TRUE; +} + + +#ifdef USES_LOCATIONS_DB +/* + *----------------------------------------------------------------------------- + * + * BuildExecPath -- + * + * Mount the VMBlock file system. + * + * Results: + * TRUE on success, FALSE otherwise + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +Bool +BuildExecPath(char *execPath, // OUT: Path to executable for isaexec() + size_t execPathSize) // IN : size of execPath buffer +{ + /* + * The locations database is the only path that's fixed, and it contains the + * paths to all the other paths selected during Tools configuration. The + * locations database file is only writable by root, so we can trust it. + */ + if (!QueryLocationsDB(LOCATIONS_PATH, QUERY_LIBDIR, execPath, execPathSize)) { + Error("could not obtain LIBDIR\n"); + return FALSE; + } + + /* + * We will use isaexec(3C) below so we specify the base directory in our + * tarball that contains the ISA directories with actual binaries. + */ + if (strlcat(execPath, + "/bin/vmware-user-wrapper", execPathSize) >= execPathSize) { + Error("could not construct program filename\n"); + return FALSE; + } + + return TRUE; +} +#endif // ifdef USES_LOCATIONS_DB + + +/* + *---------------------------------------------------------------------------- + * + * GetModuleId -- + * + * Finds the id of the provided loaded module. + * + * Results: + * The id on success, a negative error code on failure. + * + * Side effects: + * None. + * + *---------------------------------------------------------------------------- + */ + +int +GetModuleId(const char *name) // IN: module name to search for +{ + struct modinfo modinfo; + + /* + * Loop until either there are no more modules (modctl() fails) or we found + * the module the caller wanted. + */ + modinfo.mi_id = modinfo.mi_nextid = -1; + modinfo.mi_info = MI_INFO_ALL; + + do { + if (modctl(MODINFO, modinfo.mi_id, &modinfo) < 0) { + return -1; + } + } while (strcmp(modinfo.mi_name, name) != 0); + + return modinfo.mi_id; +} + + +/* + *---------------------------------------------------------------------------- + * + * CompatExec -- + * + * Simple platform-dependent isaexec() wrapper. + * + * Results: + * False. + * + * Side effects: + * Ideally, this function should not return. + * + *---------------------------------------------------------------------------- + */ + +Bool +CompatExec(const char *path, char * const argv[], char * const envp[]) +{ + isaexec(path, argv, envp); + return FALSE; +} diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/vmware-user-suid-wrapper/wrapper_version.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/vmware-user-suid-wrapper/wrapper_version.h --- open-vm-tools-2008.01.23-74039/vmware-user-suid-wrapper/wrapper_version.h 1970-01-01 01:00:00.000000000 +0100 +++ open-vm-tools-2008.10.10-123053-3~ppa2/vmware-user-suid-wrapper/wrapper_version.h 2008-10-13 08:01:54.000000000 +0100 @@ -0,0 +1,39 @@ +/********************************************************* + * Copyright (C) 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. + * + *********************************************************/ + +/* + * wrapper_version.h -- + * + * Version definitions for the vmware-user SUID wrapper. + */ + +#ifndef _WRAPPER_VERSION_H_ +#define _WRAPPER_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 WRAPPER_VERSION_COMMAS TOOLS_VERSION_EXT_CURRENT_CSV +#define WRAPPER_VERSION_STRING TOOLS_VERSION_EXT_CURRENT_STR + +#endif /* _WRAPPER_VERSION_H_ */ diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/xferlogs/Makefile.am /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/xferlogs/Makefile.am --- open-vm-tools-2008.01.23-74039/xferlogs/Makefile.am 2008-01-28 08:02:54.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/xferlogs/Makefile.am 2008-10-13 08:01:55.000000000 +0100 @@ -15,21 +15,27 @@ ### Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ################################################################################ -noinst_PROGRAMS = xferlogs +bin_PROGRAMS = vmware-xferlogs -AM_CFLAGS = -AM_CFLAGS += @COMMON_CFLAGS@ - -xferlogs_LDADD = -xferlogs_LDADD += ../lib/rpcVmx/libRpcVmx.a -xferlogs_LDADD += ../lib/string/libString.a +vmware_xferlogs_LDADD = +vmware_xferlogs_LDADD += ../lib/rpcVmx/libRpcVmx.a +vmware_xferlogs_LDADD += ../lib/string/libString.a # In the absence of the linker options --start-group and --end-group (which can't # be put in LDADD), we need to bring the following libraries out of the alphebetical # order so their symbols are properly resolved. -xferlogs_LDADD += ../lib/rpcOut/libRpcOut.a -xferlogs_LDADD += ../lib/message/libMessage.a -xferlogs_LDADD += ../lib/backdoor/libBackdoor.a -xferlogs_LDADD += ../lib/misc/libMisc.a +vmware_xferlogs_LDADD += ../lib/rpcOut/libRpcOut.a +vmware_xferlogs_LDADD += ../lib/message/libMessage.a +vmware_xferlogs_LDADD += ../lib/backdoor/libBackdoor.a +vmware_xferlogs_LDADD += ../lib/misc/libMisc.a + +vmware_xferlogs_SOURCES = +vmware_xferlogs_SOURCES += xferlogs.c -xferlogs_SOURCES = -xferlogs_SOURCES += xferlogs.c +if HAVE_ICU + vmware_xferlogs_LDADD += @ICU_LIBS@ + vmware_xferlogs_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CXX) $(AM_CXXFLAGS) \ + $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +else + vmware_xferlogs_LINK = $(LINK) +endif diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/xferlogs/Makefile.in /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/xferlogs/Makefile.in --- open-vm-tools-2008.01.23-74039/xferlogs/Makefile.in 2008-01-28 08:03:06.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/xferlogs/Makefile.in 2008-10-13 08:02:17.000000000 +0100 @@ -49,24 +49,31 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -noinst_PROGRAMS = xferlogs$(EXEEXT) +bin_PROGRAMS = vmware-xferlogs$(EXEEXT) +@HAVE_ICU_TRUE@am__append_1 = @ICU_LIBS@ subdir = xferlogs DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in COPYING ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/configure.ac +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)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_CLEAN_FILES = -PROGRAMS = $(noinst_PROGRAMS) -am_xferlogs_OBJECTS = xferlogs.$(OBJEXT) -xferlogs_OBJECTS = $(am_xferlogs_OBJECTS) -xferlogs_DEPENDENCIES = ../lib/rpcVmx/libRpcVmx.a \ +am__installdirs = "$(DESTDIR)$(bindir)" +binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +PROGRAMS = $(bin_PROGRAMS) +am_vmware_xferlogs_OBJECTS = xferlogs.$(OBJEXT) +vmware_xferlogs_OBJECTS = $(am_vmware_xferlogs_OBJECTS) +am__DEPENDENCIES_1 = +vmware_xferlogs_DEPENDENCIES = ../lib/rpcVmx/libRpcVmx.a \ ../lib/string/libString.a ../lib/rpcOut/libRpcOut.a \ ../lib/message/libMessage.a ../lib/backdoor/libBackdoor.a \ - ../lib/misc/libMisc.a + ../lib/misc/libMisc.a $(am__DEPENDENCIES_1) DEFAULT_INCLUDES = -I.@am__isrc@ -depcomp = $(SHELL) $(top_srcdir)/depcomp +depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) @@ -77,8 +84,8 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ -SOURCES = $(xferlogs_SOURCES) -DIST_SOURCES = $(xferlogs_SOURCES) +SOURCES = $(vmware_xferlogs_SOURCES) +DIST_SOURCES = $(vmware_xferlogs_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -92,8 +99,6 @@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -COMMON_CFLAGS = @COMMON_CFLAGS@ -COMMON_PROG_CFLAGS = @COMMON_PROG_CFLAGS@ COMMON_XLIBS = @COMMON_XLIBS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ @@ -104,45 +109,57 @@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ -DNET_CFLAGS = @DNET_CFLAGS@ DNET_CONFIG = @DNET_CONFIG@ +DNET_CPPFLAGS = @DNET_CPPFLAGS@ DNET_LIBS = @DNET_LIBS@ -ECHO = @ECHO@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ -F77 = @F77@ -FFLAGS = @FFLAGS@ +FGREP = @FGREP@ GREP = @GREP@ -GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CPPFLAGS = @GTK_CPPFLAGS@ GTK_LIBS = @GTK_LIBS@ -GUESTD_LDFLAGS = @GUESTD_LDFLAGS@ +GUESTD_LDADD = @GUESTD_LDADD@ +HAVE_CXX = @HAVE_CXX@ HAVE_PKG_CONFIG = @HAVE_PKG_CONFIG@ +ICU_CONFIG = @ICU_CONFIG@ +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@ +KERNEL_RELEASE = @KERNEL_RELEASE@ +LD = @LD@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ +LIBPNG_CONFIG = @LIBPNG_CONFIG@ +LIBPNG_CPPFLAGS = @LIBPNG_CPPFLAGS@ +LIBPNG_LIBS = @LIBPNG_LIBS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ -LIB_AUTH_CFLAGS = @LIB_AUTH_CFLAGS@ -LIB_FILE_CFLAGS = @LIB_FILE_CFLAGS@ -LIB_HGFS_SERVER_CFLAGS = @LIB_HGFS_SERVER_CFLAGS@ -LIB_IMPERSONATE_CFLAGS = @LIB_IMPERSONATE_CFLAGS@ -LIB_MISC_CFLAGS = @LIB_MISC_CFLAGS@ -LIB_PROC_MGR_CFLAGS = @LIB_PROC_MGR_CFLAGS@ -LIB_STRING_CFLAGS = @LIB_STRING_CFLAGS@ -LIB_USER_CFLAGS = @LIB_USER_CFLAGS@ +LIB_AUTH_CPPFLAGS = @LIB_AUTH_CPPFLAGS@ +LIB_FILE_CPPFLAGS = @LIB_FILE_CPPFLAGS@ +LIB_HGFS_SERVER_CPPFLAGS = @LIB_HGFS_SERVER_CPPFLAGS@ +LIB_IMPERSONATE_CPPFLAGS = @LIB_IMPERSONATE_CPPFLAGS@ +LIB_MISC_CPPFLAGS = @LIB_MISC_CPPFLAGS@ +LIB_PROC_MGR_CPPFLAGS = @LIB_PROC_MGR_CPPFLAGS@ +LIB_STRING_CPPFLAGS = @LIB_STRING_CPPFLAGS@ +LIB_USER_CPPFLAGS = @LIB_USER_CPPFLAGS@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MODULES = @MODULES@ +MODULES_DIR = @MODULES_DIR@ MODULES_OS = @MODULES_OS@ +NM = @NM@ +NMEDIT = @NMEDIT@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ @@ -150,27 +167,35 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ +PAM_PREFIX = @PAM_PREFIX@ PATH_SEPARATOR = @PATH_SEPARATOR@ +PROCPS_LIBS = @PROCPS_LIBS@ RANLIB = @RANLIB@ +RPCGEN = @RPCGEN@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ +TARGET_OS = @TARGET_OS@ +URIPARSER_CPPFLAGS = @URIPARSER_CPPFLAGS@ +URIPARSER_LIBS = @URIPARSER_LIBS@ VERSION = @VERSION@ -VMWARE_USER_CFLAGS = @VMWARE_USER_CFLAGS@ -VMWARE_USER_LDFLAGS = @VMWARE_USER_LDFLAGS@ +VMWARE_USER_CPPFLAGS = @VMWARE_USER_CPPFLAGS@ +VMWARE_USER_LDADD = @VMWARE_USER_LDADD@ XMKMF = @XMKMF@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ +ZLIB_CPPFLAGS = @ZLIB_CPPFLAGS@ +ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ -ac_ct_F77 = @ac_ct_F77@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ @@ -201,6 +226,7 @@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ +lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ @@ -215,14 +241,19 @@ target_alias = @target_alias@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -AM_CFLAGS = @COMMON_CFLAGS@ # In the absence of the linker options --start-group and --end-group (which can't # be put in LDADD), we need to bring the following libraries out of the alphebetical # order so their symbols are properly resolved. -xferlogs_LDADD = ../lib/rpcVmx/libRpcVmx.a ../lib/string/libString.a \ - ../lib/rpcOut/libRpcOut.a ../lib/message/libMessage.a \ - ../lib/backdoor/libBackdoor.a ../lib/misc/libMisc.a -xferlogs_SOURCES = xferlogs.c +vmware_xferlogs_LDADD = ../lib/rpcVmx/libRpcVmx.a \ + ../lib/string/libString.a ../lib/rpcOut/libRpcOut.a \ + ../lib/message/libMessage.a ../lib/backdoor/libBackdoor.a \ + ../lib/misc/libMisc.a $(am__append_1) +vmware_xferlogs_SOURCES = xferlogs.c +@HAVE_ICU_FALSE@vmware_xferlogs_LINK = $(LINK) +@HAVE_ICU_TRUE@vmware_xferlogs_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ +@HAVE_ICU_TRUE@ $(LIBTOOLFLAGS) --mode=link $(CXX) $(AM_CXXFLAGS) \ +@HAVE_ICU_TRUE@ $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ + all: all-am .SUFFIXES: @@ -256,16 +287,37 @@ 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 -clean-noinstPROGRAMS: - @list='$(noinst_PROGRAMS)'; for p in $$list; do \ +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 -xferlogs$(EXEEXT): $(xferlogs_OBJECTS) $(xferlogs_DEPENDENCIES) - @rm -f xferlogs$(EXEEXT) - $(LINK) $(xferlogs_OBJECTS) $(xferlogs_LDADD) $(LIBS) +vmware-xferlogs$(EXEEXT): $(vmware_xferlogs_OBJECTS) $(vmware_xferlogs_DEPENDENCIES) + @rm -f vmware-xferlogs$(EXEEXT) + $(vmware_xferlogs_LINK) $(vmware_xferlogs_OBJECTS) $(vmware_xferlogs_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -380,6 +432,9 @@ 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 @@ -406,8 +461,7 @@ @echo "it deletes files that may require special tools to rebuild." clean: clean-am -clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \ - mostlyclean-am +clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) @@ -429,7 +483,7 @@ install-dvi: install-dvi-am -install-exec-am: +install-exec-am: install-binPROGRAMS install-html: install-html-am @@ -461,22 +515,23 @@ ps-am: -uninstall-am: +uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-strip -.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ - clean-libtool clean-noinstPROGRAMS 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 \ +.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 + 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. diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/xferlogs/xferlogs.c /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/xferlogs/xferlogs.c --- open-vm-tools-2008.01.23-74039/xferlogs/xferlogs.c 2008-01-28 08:02:54.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/xferlogs/xferlogs.c 2008-10-13 08:01:55.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/ @@ -125,7 +125,7 @@ RpcVMX_Log("%s: %s: ver - %d", LOG_START_MARK, filename, LOG_VERSION); while ((readLen = fread(buf, 1, sizeof buf, fp)) > 0 ) { if (Base64_Encode(buf, readLen, base64Buf, sizeof base64B - 1, NULL)) { - RpcVMX_Log(base64B); + RpcVMX_Log("%s", base64B); } else { Warning("Error in Base64_Encode\n"); goto exit; @@ -236,7 +236,9 @@ ptrStr = strstr(buf, LOG_GUEST_MARK); ptrStr += sizeof LOG_GUEST_MARK - 1; if (Base64_Decode(ptrStr, base64Out, BUF_OUT_SIZE, &lenOut)) { - fwrite(base64Out, 1, lenOut, outfp); + if (fwrite(base64Out, 1, lenOut, outfp) != lenOut) { + Warning("Error writing output\n"); + } } else { Warning("Error decoding output %s\n", ptrStr); } @@ -259,7 +261,7 @@ usage(); return -1; } if (argc == 2) { - RpcVMX_Log(argv[1]); + RpcVMX_Log("%s", argv[1]); return 0; } @@ -284,7 +286,7 @@ Str_Vsnprintf(buf, sizeof buf, fmt, args); va_end(args); - fprintf(stderr, buf); + fputs(buf, stderr); abort(); } diff -Nru /tmp/SKPXui45HQ/open-vm-tools-2008.01.23-74039/xferlogs/xferlogs_version.h /tmp/oGzBxOwnax/open-vm-tools-2008.10.10-123053-3~ppa2/xferlogs/xferlogs_version.h --- open-vm-tools-2008.01.23-74039/xferlogs/xferlogs_version.h 2008-01-28 08:02:54.000000000 +0000 +++ open-vm-tools-2008.10.10-123053-3~ppa2/xferlogs/xferlogs_version.h 2008-10-13 08:01:55.000000000 +0100 @@ -7,11 +7,11 @@ * * 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. + * 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 General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., + * 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. * *********************************************************/